attaform 0.16.3 → 0.17.0

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 (86) hide show
  1. package/README.md +4 -2
  2. package/dist/chunks/devtools.cjs +19 -12
  3. package/dist/chunks/devtools.cjs.map +1 -1
  4. package/dist/chunks/devtools.mjs +19 -12
  5. package/dist/chunks/devtools.mjs.map +1 -1
  6. package/dist/chunks/indexeddb.cjs +1 -1
  7. package/dist/chunks/indexeddb.mjs +1 -1
  8. package/dist/chunks/local-storage.cjs +1 -1
  9. package/dist/chunks/local-storage.mjs +1 -1
  10. package/dist/chunks/session-storage.cjs +1 -1
  11. package/dist/chunks/session-storage.mjs +1 -1
  12. package/dist/index.cjs +27 -7
  13. package/dist/index.cjs.map +1 -1
  14. package/dist/index.d.cts +80 -8
  15. package/dist/index.d.mts +80 -8
  16. package/dist/index.d.ts +80 -8
  17. package/dist/index.mjs +28 -9
  18. package/dist/index.mjs.map +1 -1
  19. package/dist/nuxt.d.cts +1 -1
  20. package/dist/nuxt.d.mts +1 -1
  21. package/dist/nuxt.d.ts +1 -1
  22. package/dist/runtime/plugins/attaform.cjs +3 -3
  23. package/dist/runtime/plugins/attaform.cjs.map +1 -1
  24. package/dist/runtime/plugins/attaform.mjs +3 -3
  25. package/dist/runtime/plugins/attaform.mjs.map +1 -1
  26. package/dist/shared/{attaform.KrNw10aW.cjs → attaform.0Wg7UEeX.cjs} +60 -20
  27. package/dist/shared/attaform.0Wg7UEeX.cjs.map +1 -0
  28. package/dist/shared/attaform.AOgGyRoI.d.cts +65 -0
  29. package/dist/shared/{attaform.lFNwBcA3.d.ts → attaform.B0zue7zt.d.ts} +1 -1
  30. package/dist/shared/{attaform.c_NzdRyc.cjs → attaform.BBM2muQ9.cjs} +7 -3
  31. package/dist/shared/attaform.BBM2muQ9.cjs.map +1 -0
  32. package/dist/shared/{attaform.C9Ph2SMx.cjs → attaform.BFumZXY2.cjs} +1514 -391
  33. package/dist/shared/attaform.BFumZXY2.cjs.map +1 -0
  34. package/dist/shared/attaform.BQ-iGGWd.d.mts +65 -0
  35. package/dist/shared/{attaform.DILbdvfo.mjs → attaform.BT55rDNN.mjs} +1514 -393
  36. package/dist/shared/attaform.BT55rDNN.mjs.map +1 -0
  37. package/dist/shared/{attaform._EqYNPYF.d.mts → attaform.BYbsV2Wv.d.cts} +738 -138
  38. package/dist/shared/{attaform._EqYNPYF.d.ts → attaform.BYbsV2Wv.d.mts} +738 -138
  39. package/dist/shared/{attaform._EqYNPYF.d.cts → attaform.BYbsV2Wv.d.ts} +738 -138
  40. package/dist/shared/{attaform.DGuGGNg9.cjs → attaform.C6_zOf8x.cjs} +232 -113
  41. package/dist/shared/attaform.C6_zOf8x.cjs.map +1 -0
  42. package/dist/shared/{attaform.CJttVxRj.cjs → attaform.C8LVFVVe.cjs} +2 -2
  43. package/dist/shared/{attaform.CJttVxRj.cjs.map → attaform.C8LVFVVe.cjs.map} +1 -1
  44. package/dist/shared/{attaform.BfMxsfmE.mjs → attaform.CIEQgJnM.mjs} +143 -78
  45. package/dist/shared/attaform.CIEQgJnM.mjs.map +1 -0
  46. package/dist/shared/attaform.CX9v2M8k.d.ts +65 -0
  47. package/dist/shared/{attaform.XYOMTvuO.mjs → attaform.Cj0pCNVn.mjs} +232 -113
  48. package/dist/shared/attaform.Cj0pCNVn.mjs.map +1 -0
  49. package/dist/shared/{attaform.DLnKT7wk.d.cts → attaform.ClfCi1i2.d.mts} +1 -1
  50. package/dist/shared/{attaform.CFA6y0KF.mjs → attaform.D6Q5ZP8L.mjs} +60 -20
  51. package/dist/shared/attaform.D6Q5ZP8L.mjs.map +1 -0
  52. package/dist/shared/{attaform.Bls_kFR6.d.mts → attaform.D7lomopc.d.cts} +1 -1
  53. package/dist/shared/{attaform.rIRYSUI1.cjs → attaform.Dee2rU1P.cjs} +145 -77
  54. package/dist/shared/attaform.Dee2rU1P.cjs.map +1 -0
  55. package/dist/shared/{attaform.CINUMjPq.mjs → attaform.Vo-Kft0t.mjs} +2 -2
  56. package/dist/shared/{attaform.CINUMjPq.mjs.map → attaform.Vo-Kft0t.mjs.map} +1 -1
  57. package/dist/shared/{attaform.jrxE_xZw.mjs → attaform.h1sq3BFu.mjs} +6 -4
  58. package/dist/shared/attaform.h1sq3BFu.mjs.map +1 -0
  59. package/dist/zod-v3.cjs +3 -3
  60. package/dist/zod-v3.d.cts +5 -5
  61. package/dist/zod-v3.d.mts +5 -5
  62. package/dist/zod-v3.d.ts +5 -5
  63. package/dist/zod-v3.mjs +3 -3
  64. package/dist/zod-v4.cjs +3 -3
  65. package/dist/zod-v4.d.cts +16 -42
  66. package/dist/zod-v4.d.mts +16 -42
  67. package/dist/zod-v4.d.ts +16 -42
  68. package/dist/zod-v4.mjs +3 -3
  69. package/dist/zod.cjs +4 -4
  70. package/dist/zod.cjs.map +1 -1
  71. package/dist/zod.d.cts +6 -5
  72. package/dist/zod.d.mts +6 -5
  73. package/dist/zod.d.ts +6 -5
  74. package/dist/zod.mjs +5 -5
  75. package/dist/zod.mjs.map +1 -1
  76. package/package.json +3 -8
  77. package/dist/shared/attaform.BfMxsfmE.mjs.map +0 -1
  78. package/dist/shared/attaform.C9Ph2SMx.cjs.map +0 -1
  79. package/dist/shared/attaform.CFA6y0KF.mjs.map +0 -1
  80. package/dist/shared/attaform.DGuGGNg9.cjs.map +0 -1
  81. package/dist/shared/attaform.DILbdvfo.mjs.map +0 -1
  82. package/dist/shared/attaform.KrNw10aW.cjs.map +0 -1
  83. package/dist/shared/attaform.XYOMTvuO.mjs.map +0 -1
  84. package/dist/shared/attaform.c_NzdRyc.cjs.map +0 -1
  85. package/dist/shared/attaform.jrxE_xZw.mjs.map +0 -1
  86. package/dist/shared/attaform.rIRYSUI1.cjs.map +0 -1
package/dist/zod-v3.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { ae as ValidateOnConfig, F as FormKey, B as OnInvalidSubmitPolicy, W as PersistConfig, x as HistoryConfig, C as CoercionRegistry, G as GenericForm, U as UseFormConfiguration, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.mjs';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.mjs';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.Bls_kFR6.mjs';
2
+ import { ag as ValidateOnConfig, F as FormKey, E as OnInvalidSubmitPolicy, X as PersistConfig, y as HistoryConfig, C as CoercionRegistry, G as GenericForm, U as UseFormConfiguration, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, d as UseFormReturnType, ar as SchemaFactoryOptions, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.mjs';
3
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.mjs';
4
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.ClfCi1i2.mjs';
5
5
  import 'vue';
6
6
 
7
7
  /**
@@ -97,7 +97,7 @@ declare function useForm<Form extends GenericForm, GetValueFormType extends Gene
97
97
  *
98
98
  * For Zod v4, import from `attaform/zod` instead.
99
99
  */
100
- declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, GetValueFormType extends GenericForm = TypeWithNullableDynamicKeys<Schema>>(configuration: UseFormConfigurationWithZod<Schema, DeepPartial<DefaultValuesShape<z.infer<UnwrapZodObject<Schema>>>>>): UseFormReturnType<z.infer<UnwrapZodObject<Schema>>, GetValueFormType>;
100
+ declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, GetValueFormType extends GenericForm = TypeWithNullableDynamicKeys<Schema>>(configuration: UseFormConfigurationWithZod<Schema, DeepPartial<DefaultValuesShape<z.input<UnwrapZodObject<Schema>>>>>): UseFormReturnType<z.input<UnwrapZodObject<Schema>>, GetValueFormType>;
101
101
 
102
102
  /**
103
103
  * Wrap a Zod v3 `ZodObject` schema in an `AbstractSchema` factory.
@@ -109,7 +109,7 @@ declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, GetValueForm
109
109
  *
110
110
  * Throws if the underlying schema isn't a `ZodObject`.
111
111
  */
112
- declare function zodAdapter<FormSchema extends z.ZodSchema, Form extends z.infer<FormSchema>, GetValueFormType extends TypeWithNullableDynamicKeys<FormSchema>>(zodSchema: FormSchema): (formKey: FormKey) => AbstractSchema<Form, GetValueFormType>;
112
+ declare function zodAdapter<FormSchema extends z.ZodSchema, Form extends z.input<FormSchema>, GetValueFormType extends TypeWithNullableDynamicKeys<FormSchema>>(zodSchema: FormSchema): (formKey: FormKey, options: SchemaFactoryOptions) => AbstractSchema<Form, GetValueFormType>;
113
113
 
114
114
  type ZodTypeMap = {
115
115
  ZodObject: z.AnyZodObject;
package/dist/zod-v3.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
- import { ae as ValidateOnConfig, F as FormKey, B as OnInvalidSubmitPolicy, W as PersistConfig, x as HistoryConfig, C as CoercionRegistry, G as GenericForm, U as UseFormConfiguration, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.js';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.js';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.lFNwBcA3.js';
2
+ import { ag as ValidateOnConfig, F as FormKey, E as OnInvalidSubmitPolicy, X as PersistConfig, y as HistoryConfig, C as CoercionRegistry, G as GenericForm, U as UseFormConfiguration, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, d as UseFormReturnType, ar as SchemaFactoryOptions, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.js';
3
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.js';
4
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.B0zue7zt.js';
5
5
  import 'vue';
6
6
 
7
7
  /**
@@ -97,7 +97,7 @@ declare function useForm<Form extends GenericForm, GetValueFormType extends Gene
97
97
  *
98
98
  * For Zod v4, import from `attaform/zod` instead.
99
99
  */
100
- declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, GetValueFormType extends GenericForm = TypeWithNullableDynamicKeys<Schema>>(configuration: UseFormConfigurationWithZod<Schema, DeepPartial<DefaultValuesShape<z.infer<UnwrapZodObject<Schema>>>>>): UseFormReturnType<z.infer<UnwrapZodObject<Schema>>, GetValueFormType>;
100
+ declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, GetValueFormType extends GenericForm = TypeWithNullableDynamicKeys<Schema>>(configuration: UseFormConfigurationWithZod<Schema, DeepPartial<DefaultValuesShape<z.input<UnwrapZodObject<Schema>>>>>): UseFormReturnType<z.input<UnwrapZodObject<Schema>>, GetValueFormType>;
101
101
 
102
102
  /**
103
103
  * Wrap a Zod v3 `ZodObject` schema in an `AbstractSchema` factory.
@@ -109,7 +109,7 @@ declare function useForm<Schema extends z.ZodObject<z.ZodRawShape>, GetValueForm
109
109
  *
110
110
  * Throws if the underlying schema isn't a `ZodObject`.
111
111
  */
112
- declare function zodAdapter<FormSchema extends z.ZodSchema, Form extends z.infer<FormSchema>, GetValueFormType extends TypeWithNullableDynamicKeys<FormSchema>>(zodSchema: FormSchema): (formKey: FormKey) => AbstractSchema<Form, GetValueFormType>;
112
+ declare function zodAdapter<FormSchema extends z.ZodSchema, Form extends z.input<FormSchema>, GetValueFormType extends TypeWithNullableDynamicKeys<FormSchema>>(zodSchema: FormSchema): (formKey: FormKey, options: SchemaFactoryOptions) => AbstractSchema<Form, GetValueFormType>;
113
113
 
114
114
  type ZodTypeMap = {
115
115
  ZodObject: z.AnyZodObject;
package/dist/zod-v3.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { f as fieldMeta, i as isZodSchemaType, u as useForm, w as withMeta, z as zodAdapter } from './shared/attaform.CFA6y0KF.mjs';
2
- export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.DILbdvfo.mjs';
3
- export { u as useRegister } from './shared/attaform.BfMxsfmE.mjs';
1
+ export { f as fieldMeta, i as isZodSchemaType, u as useForm, w as withMeta, z as zodAdapter } from './shared/attaform.D6Q5ZP8L.mjs';
2
+ export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.BT55rDNN.mjs';
3
+ export { u as useRegister } from './shared/attaform.CIEQgJnM.mjs';
4
4
  //# sourceMappingURL=zod-v3.mjs.map
package/dist/zod-v4.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./shared/attaform.DGuGGNg9.cjs');
4
- const useFormContext = require('./shared/attaform.C9Ph2SMx.cjs');
5
- const plugin = require('./shared/attaform.rIRYSUI1.cjs');
3
+ const index = require('./shared/attaform.C6_zOf8x.cjs');
4
+ const useFormContext = require('./shared/attaform.BFumZXY2.cjs');
5
+ const plugin = require('./shared/attaform.Dee2rU1P.cjs');
6
6
 
7
7
 
8
8
 
package/dist/zod-v4.d.cts CHANGED
@@ -1,7 +1,8 @@
1
+ export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.AOgGyRoI.cjs';
2
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.D7lomopc.cjs';
3
+ import { F as FormKey, ar as SchemaFactoryOptions, b as AbstractSchema, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.cjs';
4
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.cjs';
1
5
  import { z } from 'zod';
2
- import { F as FormKey, b as AbstractSchema, U as UseFormConfiguration, G as GenericForm, D as DeepPartial, c as DefaultValuesShape, ae as ValidateOnConfig, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.cjs';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.cjs';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.DLnKT7wk.cjs';
5
6
  import { a as AttaformError } from './shared/attaform.B7rzpK1U.cjs';
6
7
  import 'vue';
7
8
 
@@ -14,11 +15,17 @@ import 'vue';
14
15
  * data with the same library used elsewhere in the form runtime, or
15
16
  * exposing the adapter to a custom integration).
16
17
  *
17
- * Throws if the schema isn't Zod v4, or contains kinds the adapter
18
- * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`,
19
- * recursive `z.lazy(...)`).
18
+ * The returned factory accepts per-form `SchemaFactoryOptions` (notably
19
+ * `maxRecursionDepth`); the adapter closure bakes them into every
20
+ * downstream walk so a per-form override can lift the cap without
21
+ * touching the app-level default.
22
+ *
23
+ * Throws if the schema isn't Zod v4 or contains kinds the adapter
24
+ * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`).
25
+ * Recursive `z.lazy(...)` is supported — the runtime walks bound their
26
+ * descent via `maxRecursionDepth`.
20
27
  */
21
- declare function zodV4Adapter<FormSchema extends z.ZodObject, Form extends z.infer<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey) => AbstractSchema<Form, Form>;
28
+ declare function zodV4Adapter<FormSchema extends z.ZodObject, Form extends z.input<FormSchema>, GetValueFormType extends z.output<FormSchema> = z.output<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey, options: SchemaFactoryOptions) => AbstractSchema<Form, GetValueFormType>;
22
29
 
23
30
  /**
24
31
  * Thrown when a Zod schema includes a kind the form library cannot
@@ -47,7 +54,7 @@ declare class UnsupportedSchemaError extends AttaformError {
47
54
  * `kindOf(schema)`. Use when building a custom integration that
48
55
  * needs to branch on schema shape — most consumers don't need this.
49
56
  */
50
- type ZodKind = 'object' | 'array' | 'set' | 'record' | 'tuple' | 'union' | 'discriminated-union' | 'string' | 'number' | 'boolean' | 'bigint' | 'date' | 'enum' | 'literal' | 'null' | 'undefined' | 'any' | 'unknown' | 'optional' | 'nullable' | 'default' | 'pipe' | 'readonly' | 'nan' | 'void' | 'never' | 'lazy' | 'intersection' | 'catch' | 'promise' | 'custom' | 'template-literal';
57
+ type ZodKind = 'object' | 'array' | 'set' | 'record' | 'tuple' | 'union' | 'discriminated-union' | 'string' | 'number' | 'boolean' | 'bigint' | 'date' | 'enum' | 'literal' | 'null' | 'undefined' | 'any' | 'unknown' | 'optional' | 'nullable' | 'default' | 'pipe' | 'readonly' | 'nan' | 'void' | 'never' | 'lazy' | 'intersection' | 'catch' | 'promise' | 'custom' | 'template-literal' | 'transform';
51
58
  /**
52
59
  * Inspect a Zod v4 schema and return its `ZodKind`. Returns
53
60
  * `'unknown'` for non-Zod inputs and unrecognised shapes.
@@ -66,39 +73,6 @@ declare function kindOf(schema: unknown): ZodKind;
66
73
  */
67
74
  declare function assertZodVersion(schema: unknown): void;
68
75
 
69
- /**
70
- * Zod v4 adapter entry point. Re-exports the adapter + the useForm
71
- * wrapper that threads zod-v4-specific schema types through
72
- * useAbstractForm.
73
- */
74
-
75
- /**
76
- * Create a form bound to a Zod v4 schema.
77
- *
78
- * ```ts
79
- * import { useForm } from 'attaform/zod'
80
- * import { z } from 'zod'
81
- *
82
- * const form = useForm({
83
- * schema: z.object({
84
- * email: z.email(),
85
- * password: z.string().min(8),
86
- * }),
87
- * defaultValues: { email: '' },
88
- * })
89
- * ```
90
- *
91
- * Returns a form API exposing `register`, `values`, `errors`,
92
- * `fields`, `setValue`, `handleSubmit`, `meta`, field-array
93
- * helpers, and more. See `UseFormReturnType` for the full
94
- * surface.
95
- *
96
- * For Zod v3, import from `attaform/zod-v3` instead.
97
- */
98
- declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
99
- schema: Schema;
100
- } & ValidateOnConfig): UseFormReturnType<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
101
-
102
76
  /**
103
77
  * Field-metadata write/read API for the Zod v4 adapter.
104
78
  *
@@ -189,5 +163,5 @@ declare const fieldMeta: ZodFieldMetaRegistry;
189
163
  */
190
164
  declare function withMeta<S extends z.ZodType>(schema: S, payload: FieldMetaPayload): S;
191
165
 
192
- export { FieldMetaPayload, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, useForm, withMeta, zodV4Adapter as zodAdapter };
166
+ export { FieldMetaPayload, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, withMeta, zodV4Adapter as zodAdapter };
193
167
  export type { ZodKind };
package/dist/zod-v4.d.mts CHANGED
@@ -1,7 +1,8 @@
1
+ export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.BQ-iGGWd.mjs';
2
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.ClfCi1i2.mjs';
3
+ import { F as FormKey, ar as SchemaFactoryOptions, b as AbstractSchema, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.mjs';
4
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.mjs';
1
5
  import { z } from 'zod';
2
- import { F as FormKey, b as AbstractSchema, U as UseFormConfiguration, G as GenericForm, D as DeepPartial, c as DefaultValuesShape, ae as ValidateOnConfig, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.mjs';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.mjs';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.Bls_kFR6.mjs';
5
6
  import { a as AttaformError } from './shared/attaform.B7rzpK1U.mjs';
6
7
  import 'vue';
7
8
 
@@ -14,11 +15,17 @@ import 'vue';
14
15
  * data with the same library used elsewhere in the form runtime, or
15
16
  * exposing the adapter to a custom integration).
16
17
  *
17
- * Throws if the schema isn't Zod v4, or contains kinds the adapter
18
- * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`,
19
- * recursive `z.lazy(...)`).
18
+ * The returned factory accepts per-form `SchemaFactoryOptions` (notably
19
+ * `maxRecursionDepth`); the adapter closure bakes them into every
20
+ * downstream walk so a per-form override can lift the cap without
21
+ * touching the app-level default.
22
+ *
23
+ * Throws if the schema isn't Zod v4 or contains kinds the adapter
24
+ * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`).
25
+ * Recursive `z.lazy(...)` is supported — the runtime walks bound their
26
+ * descent via `maxRecursionDepth`.
20
27
  */
21
- declare function zodV4Adapter<FormSchema extends z.ZodObject, Form extends z.infer<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey) => AbstractSchema<Form, Form>;
28
+ declare function zodV4Adapter<FormSchema extends z.ZodObject, Form extends z.input<FormSchema>, GetValueFormType extends z.output<FormSchema> = z.output<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey, options: SchemaFactoryOptions) => AbstractSchema<Form, GetValueFormType>;
22
29
 
23
30
  /**
24
31
  * Thrown when a Zod schema includes a kind the form library cannot
@@ -47,7 +54,7 @@ declare class UnsupportedSchemaError extends AttaformError {
47
54
  * `kindOf(schema)`. Use when building a custom integration that
48
55
  * needs to branch on schema shape — most consumers don't need this.
49
56
  */
50
- type ZodKind = 'object' | 'array' | 'set' | 'record' | 'tuple' | 'union' | 'discriminated-union' | 'string' | 'number' | 'boolean' | 'bigint' | 'date' | 'enum' | 'literal' | 'null' | 'undefined' | 'any' | 'unknown' | 'optional' | 'nullable' | 'default' | 'pipe' | 'readonly' | 'nan' | 'void' | 'never' | 'lazy' | 'intersection' | 'catch' | 'promise' | 'custom' | 'template-literal';
57
+ type ZodKind = 'object' | 'array' | 'set' | 'record' | 'tuple' | 'union' | 'discriminated-union' | 'string' | 'number' | 'boolean' | 'bigint' | 'date' | 'enum' | 'literal' | 'null' | 'undefined' | 'any' | 'unknown' | 'optional' | 'nullable' | 'default' | 'pipe' | 'readonly' | 'nan' | 'void' | 'never' | 'lazy' | 'intersection' | 'catch' | 'promise' | 'custom' | 'template-literal' | 'transform';
51
58
  /**
52
59
  * Inspect a Zod v4 schema and return its `ZodKind`. Returns
53
60
  * `'unknown'` for non-Zod inputs and unrecognised shapes.
@@ -66,39 +73,6 @@ declare function kindOf(schema: unknown): ZodKind;
66
73
  */
67
74
  declare function assertZodVersion(schema: unknown): void;
68
75
 
69
- /**
70
- * Zod v4 adapter entry point. Re-exports the adapter + the useForm
71
- * wrapper that threads zod-v4-specific schema types through
72
- * useAbstractForm.
73
- */
74
-
75
- /**
76
- * Create a form bound to a Zod v4 schema.
77
- *
78
- * ```ts
79
- * import { useForm } from 'attaform/zod'
80
- * import { z } from 'zod'
81
- *
82
- * const form = useForm({
83
- * schema: z.object({
84
- * email: z.email(),
85
- * password: z.string().min(8),
86
- * }),
87
- * defaultValues: { email: '' },
88
- * })
89
- * ```
90
- *
91
- * Returns a form API exposing `register`, `values`, `errors`,
92
- * `fields`, `setValue`, `handleSubmit`, `meta`, field-array
93
- * helpers, and more. See `UseFormReturnType` for the full
94
- * surface.
95
- *
96
- * For Zod v3, import from `attaform/zod-v3` instead.
97
- */
98
- declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
99
- schema: Schema;
100
- } & ValidateOnConfig): UseFormReturnType<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
101
-
102
76
  /**
103
77
  * Field-metadata write/read API for the Zod v4 adapter.
104
78
  *
@@ -189,5 +163,5 @@ declare const fieldMeta: ZodFieldMetaRegistry;
189
163
  */
190
164
  declare function withMeta<S extends z.ZodType>(schema: S, payload: FieldMetaPayload): S;
191
165
 
192
- export { FieldMetaPayload, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, useForm, withMeta, zodV4Adapter as zodAdapter };
166
+ export { FieldMetaPayload, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, withMeta, zodV4Adapter as zodAdapter };
193
167
  export type { ZodKind };
package/dist/zod-v4.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ export { P as PathInput, a as PathOutput, u as useForm } from './shared/attaform.CX9v2M8k.js';
2
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.B0zue7zt.js';
3
+ import { F as FormKey, ar as SchemaFactoryOptions, b as AbstractSchema, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.js';
4
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.js';
1
5
  import { z } from 'zod';
2
- import { F as FormKey, b as AbstractSchema, U as UseFormConfiguration, G as GenericForm, D as DeepPartial, c as DefaultValuesShape, ae as ValidateOnConfig, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.js';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.js';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.lFNwBcA3.js';
5
6
  import { a as AttaformError } from './shared/attaform.B7rzpK1U.js';
6
7
  import 'vue';
7
8
 
@@ -14,11 +15,17 @@ import 'vue';
14
15
  * data with the same library used elsewhere in the form runtime, or
15
16
  * exposing the adapter to a custom integration).
16
17
  *
17
- * Throws if the schema isn't Zod v4, or contains kinds the adapter
18
- * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`,
19
- * recursive `z.lazy(...)`).
18
+ * The returned factory accepts per-form `SchemaFactoryOptions` (notably
19
+ * `maxRecursionDepth`); the adapter closure bakes them into every
20
+ * downstream walk so a per-form override can lift the cap without
21
+ * touching the app-level default.
22
+ *
23
+ * Throws if the schema isn't Zod v4 or contains kinds the adapter
24
+ * cannot represent (`z.promise`, `z.custom`, `z.templateLiteral`).
25
+ * Recursive `z.lazy(...)` is supported — the runtime walks bound their
26
+ * descent via `maxRecursionDepth`.
20
27
  */
21
- declare function zodV4Adapter<FormSchema extends z.ZodObject, Form extends z.infer<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey) => AbstractSchema<Form, Form>;
28
+ declare function zodV4Adapter<FormSchema extends z.ZodObject, Form extends z.input<FormSchema>, GetValueFormType extends z.output<FormSchema> = z.output<FormSchema>>(rootSchema: FormSchema): (formKey: FormKey, options: SchemaFactoryOptions) => AbstractSchema<Form, GetValueFormType>;
22
29
 
23
30
  /**
24
31
  * Thrown when a Zod schema includes a kind the form library cannot
@@ -47,7 +54,7 @@ declare class UnsupportedSchemaError extends AttaformError {
47
54
  * `kindOf(schema)`. Use when building a custom integration that
48
55
  * needs to branch on schema shape — most consumers don't need this.
49
56
  */
50
- type ZodKind = 'object' | 'array' | 'set' | 'record' | 'tuple' | 'union' | 'discriminated-union' | 'string' | 'number' | 'boolean' | 'bigint' | 'date' | 'enum' | 'literal' | 'null' | 'undefined' | 'any' | 'unknown' | 'optional' | 'nullable' | 'default' | 'pipe' | 'readonly' | 'nan' | 'void' | 'never' | 'lazy' | 'intersection' | 'catch' | 'promise' | 'custom' | 'template-literal';
57
+ type ZodKind = 'object' | 'array' | 'set' | 'record' | 'tuple' | 'union' | 'discriminated-union' | 'string' | 'number' | 'boolean' | 'bigint' | 'date' | 'enum' | 'literal' | 'null' | 'undefined' | 'any' | 'unknown' | 'optional' | 'nullable' | 'default' | 'pipe' | 'readonly' | 'nan' | 'void' | 'never' | 'lazy' | 'intersection' | 'catch' | 'promise' | 'custom' | 'template-literal' | 'transform';
51
58
  /**
52
59
  * Inspect a Zod v4 schema and return its `ZodKind`. Returns
53
60
  * `'unknown'` for non-Zod inputs and unrecognised shapes.
@@ -66,39 +73,6 @@ declare function kindOf(schema: unknown): ZodKind;
66
73
  */
67
74
  declare function assertZodVersion(schema: unknown): void;
68
75
 
69
- /**
70
- * Zod v4 adapter entry point. Re-exports the adapter + the useForm
71
- * wrapper that threads zod-v4-specific schema types through
72
- * useAbstractForm.
73
- */
74
-
75
- /**
76
- * Create a form bound to a Zod v4 schema.
77
- *
78
- * ```ts
79
- * import { useForm } from 'attaform/zod'
80
- * import { z } from 'zod'
81
- *
82
- * const form = useForm({
83
- * schema: z.object({
84
- * email: z.email(),
85
- * password: z.string().min(8),
86
- * }),
87
- * defaultValues: { email: '' },
88
- * })
89
- * ```
90
- *
91
- * Returns a form API exposing `register`, `values`, `errors`,
92
- * `fields`, `setValue`, `handleSubmit`, `meta`, field-array
93
- * helpers, and more. See `UseFormReturnType` for the full
94
- * surface.
95
- *
96
- * For Zod v3, import from `attaform/zod-v3` instead.
97
- */
98
- declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
99
- schema: Schema;
100
- } & ValidateOnConfig): UseFormReturnType<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
101
-
102
76
  /**
103
77
  * Field-metadata write/read API for the Zod v4 adapter.
104
78
  *
@@ -189,5 +163,5 @@ declare const fieldMeta: ZodFieldMetaRegistry;
189
163
  */
190
164
  declare function withMeta<S extends z.ZodType>(schema: S, payload: FieldMetaPayload): S;
191
165
 
192
- export { FieldMetaPayload, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, useForm, withMeta, zodV4Adapter as zodAdapter };
166
+ export { FieldMetaPayload, UnsupportedSchemaError, assertZodVersion, fieldMeta, kindOf, withMeta, zodV4Adapter as zodAdapter };
193
167
  export type { ZodKind };
package/dist/zod-v4.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { U as UnsupportedSchemaError, a as assertZodVersion, f as fieldMeta, k as kindOf, u as useForm, w as withMeta, z as zodAdapter } from './shared/attaform.XYOMTvuO.mjs';
2
- export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.DILbdvfo.mjs';
3
- export { u as useRegister } from './shared/attaform.BfMxsfmE.mjs';
1
+ export { U as UnsupportedSchemaError, a as assertZodVersion, f as fieldMeta, k as kindOf, u as useForm, w as withMeta, z as zodAdapter } from './shared/attaform.Cj0pCNVn.mjs';
2
+ export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.BT55rDNN.mjs';
3
+ export { u as useRegister } from './shared/attaform.CIEQgJnM.mjs';
4
4
  //# sourceMappingURL=zod-v4.mjs.map
package/dist/zod.cjs CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- const plugin = require('./shared/attaform.rIRYSUI1.cjs');
4
- const useForm$1 = require('./shared/attaform.KrNw10aW.cjs');
5
- const index = require('./shared/attaform.DGuGGNg9.cjs');
6
- const useFormContext = require('./shared/attaform.C9Ph2SMx.cjs');
3
+ const plugin = require('./shared/attaform.Dee2rU1P.cjs');
4
+ const useForm$1 = require('./shared/attaform.0Wg7UEeX.cjs');
5
+ const index = require('./shared/attaform.C6_zOf8x.cjs');
6
+ const useFormContext = require('./shared/attaform.BFumZXY2.cjs');
7
7
  const fieldMetaStore = require('./shared/attaform.C8CyvYa_.cjs');
8
8
 
9
9
  function isZodV4SchemaShape(value) {
package/dist/zod.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"zod.cjs","sources":["../src/runtime/core/zod-shape.ts","../src/runtime/adapters/unified/use-form.ts","../src/runtime/adapters/unified/field-meta.ts"],"sourcesContent":["/**\n * Shape detectors for Zod schemas. Used by the unified `attaform/zod`\n * entry's runtime dispatch (`runtime/adapters/unified/use-form.ts`)\n * to route to the v3 or v4 adapter based on the schema's runtime\n * shape. Mirrors the discrimination already used by the v4\n * introspection helper (`adapters/zod-v4/introspect.ts`'s\n * `assertZodVersion`, which reads `def.type`) and the v3 wrapper's\n * legitimate-input branch (`composables/use-form.ts`'s `isZodType`,\n * which reads `_def`).\n *\n * Why this discriminator and not `_zod` / `_def`:\n * - Zod v4 retained `_def` for backward compat — reading `_def` alone\n * misclassifies v4 schemas as v3.\n * - Zod v4's stable shape is `def.type: string` (lowercase tag like\n * `'object'`); Zod v3's is `_def.typeName: string` (capitalised tag\n * like `'ZodObject'`). Both are checked structurally so consumers\n * who alias one Zod major to a non-standard import path still work.\n */\n\ninterface ZodV4Shape {\n def: { type: unknown }\n}\n\ninterface ZodV3Shape {\n _def: { typeName: unknown }\n}\n\n/**\n * Returns true when `value` looks like a Zod schema of either major\n * version. Convenience wrapper around the v3 / v4 detectors.\n */\nexport function isZodSchemaShape(value: unknown): boolean {\n return isZodV4SchemaShape(value) || isZodV3SchemaShape(value)\n}\n\n/**\n * Returns true when `value` looks like a Zod v4 schema (has\n * `def.type: string`). Used by the unified entry's runtime-dispatch\n * to route to the v4 adapter.\n */\nexport function isZodV4SchemaShape(value: unknown): value is ZodV4Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { def?: unknown }).def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { type?: unknown }).type === 'string'\n}\n\n/**\n * Returns true when `value` looks like a Zod v3 schema (has\n * `_def.typeName: string`). Kept distinct from `isZodV4SchemaShape`\n * because some v4 schemas also expose `_def` for backward compat —\n * the v4 detector wins first in `isZodSchemaShape`.\n */\nexport function isZodV3SchemaShape(value: unknown): value is ZodV3Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { _def?: unknown })._def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { typeName?: unknown }).typeName === 'string'\n}\n","/**\n * Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches\n * on schema shape: a Zod v4 schema (`def.type` truthy) routes to the\n * v4 adapter; a Zod v3 schema (or any other `AbstractSchema`) routes\n * to the v3 wrapper, which already accepts both Zod v3 input and\n * `AbstractSchema` directly via its built-in shape branch.\n *\n * This module is the FALLBACK path. Vite consumers see the\n * `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`\n * imports to either `attaform/zod-v3` or `attaform/zod-v4` at build\n * time — in that case this dispatch never runs and the consumer\n * bundle ships only the matching adapter. Other bundlers (and\n * non-bundled ESM consumption) hit this dispatch instead, paying a\n * modest size cost for the convenience of a single hello-world import.\n *\n * Power users who want a guaranteed lean bundle on non-Vite tooling\n * can import directly from `attaform/zod-v3` or `attaform/zod-v4` —\n * those subpaths are never rewritten and never load the other\n * adapter.\n */\nimport type { z } from 'zod'\nimport { InvalidUseFormConfigError } from '../../core/errors'\nimport { isZodV4SchemaShape } from '../../core/zod-shape'\nimport { useForm as useFormV3 } from '../../composables/use-form'\nimport { useForm as useFormV4 } from '../zod-v4'\nimport type {\n AbstractSchema,\n ValidateOnConfig,\n UseFormReturnType,\n UseFormConfiguration,\n} from '../../types/types-api'\nimport type { DeepPartial, DefaultValuesShape, GenericForm } from '../../types/types-core'\n\n/**\n * Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4\n * schemas; the runtime picks the right adapter from the schema's\n * shape.\n *\n * Type inference targets Zod v4 — the recommended major. Consumers\n * still on Zod v3 get correct runtime behavior here, but the strongest\n * TypeScript inference comes from importing `attaform/zod-v3`\n * directly.\n *\n * ```ts\n * import { useForm } from 'attaform/zod'\n * import { z } from 'zod'\n *\n * const form = useForm({\n * schema: z.object({\n * username: z.string().min(2, 'At least 2 characters'),\n * password: z.string().min(8, 'At least 8 characters'),\n * }),\n * })\n * ```\n */\nexport function useForm<Schema extends z.ZodObject>(\n configuration: Omit<\n UseFormConfiguration<\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n AbstractSchema<\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n >,\n DeepPartial<\n DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>\n >\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & ValidateOnConfig\n): UseFormReturnType<\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n> {\n // Foot-gun guard mirrors the typed wrappers'.\n if (\n configuration === undefined ||\n configuration === null ||\n (configuration as { schema?: unknown }).schema === undefined\n ) {\n throw new InvalidUseFormConfigError()\n }\n\n const { schema } = configuration as { schema: unknown }\n if (isZodV4SchemaShape(schema)) {\n return useFormV4(configuration as Parameters<typeof useFormV4<Schema>>[0]) as ReturnType<\n typeof useForm<Schema>\n >\n }\n // Anything else (Zod v3 schema, custom AbstractSchema, schema\n // factory) goes through the v3 wrapper, which already accepts both\n // Zod v3 input and AbstractSchema directly via its existing shape\n // branch. Cast through unknown — the unified entry's TS surface\n // tracks v4, but the runtime accepts the broader shape.\n return useFormV3(configuration as never) as unknown as ReturnType<typeof useForm<Schema>>\n}\n","/**\n * Field-metadata write/read API for the unified `attaform/zod` entry.\n *\n * Storage is shared with both adapters via `field-meta-store` — a\n * payload written here is visible to whichever adapter the unified\n * `useForm` dispatches to at runtime, regardless of Zod major. No\n * `zod` runtime import; the type-only `import type` is erased at\n * build, so `attaform/zod` carries no `z.registry` reference even\n * when consumed by a Zod 3 project without the Vite plugin alias.\n *\n * The native v4 chain `schema.register(fieldMeta, payload)` continues\n * to work — Zod 4's `.register()` only calls `.add(this, payload)`\n * structurally, satisfied by the shared store.\n */\nimport type { z } from 'zod'\nimport type { FieldMetaPayload } from '../../core/field-meta'\nimport { fieldMetaStore, getFieldMetaForSchema } from '../../core/field-meta-store'\n\n// Zod v4's `$ZodRegistry` class isn't surfaced under the `z` namespace\n// of the classic external entry, but `z.registry()` returns one — so\n// `ReturnType<typeof z.registry<T>>` resolves to the registry type\n// without needing a direct import. The `import type` keeps the\n// reference type-only; nothing about `z.registry` lands in the bundle.\ntype ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>\n\n/**\n * The shared registry every Attaform-aware Zod schema can register\n * field metadata against, regardless of major. Same instance the v3\n * and v4 adapter entries expose — write in one place, read from\n * any.\n *\n * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native\n * `schema.register(fieldMeta, payload)` chain type-checks for v4\n * users; the runtime call only needs `.add` structurally, which the\n * shared store provides.\n */\nexport const fieldMeta = fieldMetaStore as unknown as ZodFieldMetaRegistry\n\n/**\n * Attach `payload` to `schema` in the shared registry and return a\n * clone of `schema` so each call gets its own identity (the registry\n * keys on schema reference, so cloning prevents last-write-wins\n * collisions for sub-schemas reused at multiple paths).\n *\n * Works on both Zod 3 and Zod 4 schemas — branches on the runtime\n * shape of the schema:\n * - Zod 4 schemas expose a public `.clone()` method; we call it.\n * - Zod 3 schemas don't, so we reconstruct via\n * `new schema.constructor(schema._def)`.\n *\n * Both forms produce a fresh schema with the same effective\n * structure, so the registry slot is unique to this call site.\n */\nexport function withMeta<S>(schema: S, payload: FieldMetaPayload): S {\n const target = schema as object\n const existing = getFieldMetaForSchema(target) ?? {}\n const cloned = cloneSchema(schema)\n fieldMetaStore.add(cloned as object, { ...existing, ...payload })\n return cloned\n}\n\nfunction cloneSchema<S>(schema: S): S {\n const candidate = schema as { clone?: unknown; constructor: unknown; _def: unknown }\n if (typeof candidate.clone === 'function') {\n return (candidate.clone as () => S)()\n }\n // Zod 3 path: reconstruct via constructor + _def (no public\n // `.clone()` on v3).\n const Ctor = candidate.constructor as new (def: unknown) => S\n return new Ctor(candidate._def)\n}\n"],"names":["InvalidUseFormConfigError","useFormV4","useFormV3","fieldMetaStore","getFieldMetaForSchema"],"mappings":";;;;;;;;AAwCO,SAAS,mBAAmB,KAAA,EAAqC;AACtE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AACxD,EAAA,MAAM,MAAO,KAAA,CAA4B,GAAA;AACzC,EAAA,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,GAAA,KAAQ,MAAM,OAAO,KAAA;AACpD,EAAA,OAAO,OAAQ,IAA2B,IAAA,KAAS,QAAA;AACrD;;ACUO,SAAS,QACd,aAAA,EAiBA;AAEA,EAAA,IACE,kBAAkB,MAAA,IAClB,aAAA,KAAkB,IAAA,IACjB,aAAA,CAAuC,WAAW,MAAA,EACnD;AACA,IAAA,MAAM,IAAIA,gCAAA,EAA0B;AAAA,EACtC;AAEA,EAAA,MAAM,EAAE,QAAO,GAAI,aAAA;AACnB,EAAA,IAAI,kBAAA,CAAmB,MAAM,CAAA,EAAG;AAC9B,IAAA,OAAOC,cAAU,aAAwD,CAAA;AAAA,EAG3E;AAMA,EAAA,OAAOC,kBAAU,aAAsB,CAAA;AACzC;;AC3DO,MAAM,SAAA,GAAYC;AAiBlB,SAAS,QAAA,CAAY,QAAW,OAAA,EAA8B;AACnE,EAAA,MAAM,MAAA,GAAS,MAAA;AACf,EAAA,MAAM,QAAA,GAAWC,oCAAA,CAAsB,MAAM,CAAA,IAAK,EAAC;AACnD,EAAA,MAAM,MAAA,GAAS,YAAY,MAAM,CAAA;AACjC,EAAAD,6BAAA,CAAe,IAAI,MAAA,EAAkB,EAAE,GAAG,QAAA,EAAU,GAAG,SAAS,CAAA;AAChE,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,YAAe,MAAA,EAAc;AACpC,EAAA,MAAM,SAAA,GAAY,MAAA;AAClB,EAAA,IAAI,OAAO,SAAA,CAAU,KAAA,KAAU,UAAA,EAAY;AACzC,IAAA,OAAQ,UAAU,KAAA,EAAkB;AAAA,EACtC;AAGA,EAAA,MAAM,OAAO,SAAA,CAAU,WAAA;AACvB,EAAA,OAAO,IAAI,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAChC;;;;;;;;;;;"}
1
+ {"version":3,"file":"zod.cjs","sources":["../src/runtime/core/zod-shape.ts","../src/runtime/adapters/unified/use-form.ts","../src/runtime/adapters/unified/field-meta.ts"],"sourcesContent":["/**\n * Shape detectors for Zod schemas. Used by the unified `attaform/zod`\n * entry's runtime dispatch (`runtime/adapters/unified/use-form.ts`)\n * to route to the v3 or v4 adapter based on the schema's runtime\n * shape. Mirrors the discrimination already used by the v4\n * introspection helper (`adapters/zod-v4/introspect.ts`'s\n * `assertZodVersion`, which reads `def.type`) and the v3 wrapper's\n * legitimate-input branch (`composables/use-form.ts`'s `isZodType`,\n * which reads `_def`).\n *\n * Why this discriminator and not `_zod` / `_def`:\n * - Zod v4 retained `_def` for backward compat — reading `_def` alone\n * misclassifies v4 schemas as v3.\n * - Zod v4's stable shape is `def.type: string` (lowercase tag like\n * `'object'`); Zod v3's is `_def.typeName: string` (capitalised tag\n * like `'ZodObject'`). Both are checked structurally so consumers\n * who alias one Zod major to a non-standard import path still work.\n */\n\ninterface ZodV4Shape {\n def: { type: unknown }\n}\n\ninterface ZodV3Shape {\n _def: { typeName: unknown }\n}\n\n/**\n * Returns true when `value` looks like a Zod schema of either major\n * version. Convenience wrapper around the v3 / v4 detectors.\n */\nexport function isZodSchemaShape(value: unknown): boolean {\n return isZodV4SchemaShape(value) || isZodV3SchemaShape(value)\n}\n\n/**\n * Returns true when `value` looks like a Zod v4 schema (has\n * `def.type: string`). Used by the unified entry's runtime-dispatch\n * to route to the v4 adapter.\n */\nexport function isZodV4SchemaShape(value: unknown): value is ZodV4Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { def?: unknown }).def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { type?: unknown }).type === 'string'\n}\n\n/**\n * Returns true when `value` looks like a Zod v3 schema (has\n * `_def.typeName: string`). Kept distinct from `isZodV4SchemaShape`\n * because some v4 schemas also expose `_def` for backward compat —\n * the v4 detector wins first in `isZodSchemaShape`.\n */\nexport function isZodV3SchemaShape(value: unknown): value is ZodV3Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { _def?: unknown })._def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { typeName?: unknown }).typeName === 'string'\n}\n","/**\n * Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches\n * on schema shape: a Zod v4 schema (`def.type` truthy) routes to the\n * v4 adapter; a Zod v3 schema (or any other `AbstractSchema`) routes\n * to the v3 wrapper, which already accepts both Zod v3 input and\n * `AbstractSchema` directly via its built-in shape branch.\n *\n * This module is the FALLBACK path. Vite consumers see the\n * `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`\n * imports to either `attaform/zod-v3` or `attaform/zod-v4` at build\n * time — in that case this dispatch never runs and the consumer\n * bundle ships only the matching adapter. Other bundlers (and\n * non-bundled ESM consumption) hit this dispatch instead, paying a\n * modest size cost for the convenience of a single hello-world import.\n *\n * Power users who want a guaranteed lean bundle on non-Vite tooling\n * can import directly from `attaform/zod-v3` or `attaform/zod-v4` —\n * those subpaths are never rewritten and never load the other\n * adapter.\n */\nimport type { z } from 'zod'\nimport { InvalidUseFormConfigError } from '../../core/errors'\nimport { isZodV4SchemaShape } from '../../core/zod-shape'\nimport { useForm as useFormV3 } from '../../composables/use-form'\nimport { useForm as useFormV4 } from '../zod-v4'\nimport type {\n AbstractSchema,\n ValidateOnConfig,\n UseFormReturnType,\n UseFormConfiguration,\n} from '../../types/types-api'\nimport type { DeepPartial, DefaultValuesShape, GenericForm } from '../../types/types-core'\n\n/**\n * Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4\n * schemas; the runtime picks the right adapter from the schema's\n * shape.\n *\n * Type inference targets Zod v4 — the recommended major. Consumers\n * still on Zod v3 get correct runtime behavior here, but the strongest\n * TypeScript inference comes from importing `attaform/zod-v3`\n * directly.\n *\n * ```ts\n * import { useForm } from 'attaform/zod'\n * import { z } from 'zod'\n *\n * const form = useForm({\n * schema: z.object({\n * username: z.string().min(2, 'At least 2 characters'),\n * password: z.string().min(8, 'At least 8 characters'),\n * }),\n * })\n * ```\n */\nexport function useForm<Schema extends z.ZodObject>(\n configuration: Omit<\n UseFormConfiguration<\n z.input<Schema> extends GenericForm ? z.input<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n AbstractSchema<\n z.input<Schema> extends GenericForm ? z.input<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n >,\n DeepPartial<DefaultValuesShape<z.input<Schema> extends GenericForm ? z.input<Schema> : never>>\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & ValidateOnConfig\n): UseFormReturnType<\n z.input<Schema> extends GenericForm ? z.input<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n> {\n // Foot-gun guard mirrors the typed wrappers'.\n if (\n configuration === undefined ||\n configuration === null ||\n (configuration as { schema?: unknown }).schema === undefined\n ) {\n throw new InvalidUseFormConfigError()\n }\n\n const { schema } = configuration as { schema: unknown }\n if (isZodV4SchemaShape(schema)) {\n return useFormV4(configuration as Parameters<typeof useFormV4<Schema>>[0]) as ReturnType<\n typeof useForm<Schema>\n >\n }\n // Anything else (Zod v3 schema, custom AbstractSchema, schema\n // factory) goes through the v3 wrapper, which already accepts both\n // Zod v3 input and AbstractSchema directly via its existing shape\n // branch. Cast through unknown — the unified entry's TS surface\n // tracks v4, but the runtime accepts the broader shape.\n return useFormV3(configuration as never) as unknown as ReturnType<typeof useForm<Schema>>\n}\n","/**\n * Field-metadata write/read API for the unified `attaform/zod` entry.\n *\n * Storage is shared with both adapters via `field-meta-store` — a\n * payload written here is visible to whichever adapter the unified\n * `useForm` dispatches to at runtime, regardless of Zod major. No\n * `zod` runtime import; the type-only `import type` is erased at\n * build, so `attaform/zod` carries no `z.registry` reference even\n * when consumed by a Zod 3 project without the Vite plugin alias.\n *\n * The native v4 chain `schema.register(fieldMeta, payload)` continues\n * to work — Zod 4's `.register()` only calls `.add(this, payload)`\n * structurally, satisfied by the shared store.\n */\nimport type { z } from 'zod'\nimport type { FieldMetaPayload } from '../../core/field-meta'\nimport { fieldMetaStore, getFieldMetaForSchema } from '../../core/field-meta-store'\n\n// Zod v4's `$ZodRegistry` class isn't surfaced under the `z` namespace\n// of the classic external entry, but `z.registry()` returns one — so\n// `ReturnType<typeof z.registry<T>>` resolves to the registry type\n// without needing a direct import. The `import type` keeps the\n// reference type-only; nothing about `z.registry` lands in the bundle.\ntype ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>\n\n/**\n * The shared registry every Attaform-aware Zod schema can register\n * field metadata against, regardless of major. Same instance the v3\n * and v4 adapter entries expose — write in one place, read from\n * any.\n *\n * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native\n * `schema.register(fieldMeta, payload)` chain type-checks for v4\n * users; the runtime call only needs `.add` structurally, which the\n * shared store provides.\n */\nexport const fieldMeta = fieldMetaStore as unknown as ZodFieldMetaRegistry\n\n/**\n * Attach `payload` to `schema` in the shared registry and return a\n * clone of `schema` so each call gets its own identity (the registry\n * keys on schema reference, so cloning prevents last-write-wins\n * collisions for sub-schemas reused at multiple paths).\n *\n * Works on both Zod 3 and Zod 4 schemas — branches on the runtime\n * shape of the schema:\n * - Zod 4 schemas expose a public `.clone()` method; we call it.\n * - Zod 3 schemas don't, so we reconstruct via\n * `new schema.constructor(schema._def)`.\n *\n * Both forms produce a fresh schema with the same effective\n * structure, so the registry slot is unique to this call site.\n */\nexport function withMeta<S>(schema: S, payload: FieldMetaPayload): S {\n const target = schema as object\n const existing = getFieldMetaForSchema(target) ?? {}\n const cloned = cloneSchema(schema)\n fieldMetaStore.add(cloned as object, { ...existing, ...payload })\n return cloned\n}\n\nfunction cloneSchema<S>(schema: S): S {\n const candidate = schema as { clone?: unknown; constructor: unknown; _def: unknown }\n if (typeof candidate.clone === 'function') {\n return (candidate.clone as () => S)()\n }\n // Zod 3 path: reconstruct via constructor + _def (no public\n // `.clone()` on v3).\n const Ctor = candidate.constructor as new (def: unknown) => S\n return new Ctor(candidate._def)\n}\n"],"names":["InvalidUseFormConfigError","useFormV4","useFormV3","fieldMetaStore","getFieldMetaForSchema"],"mappings":";;;;;;;;AAwCO,SAAS,mBAAmB,KAAA,EAAqC;AACtE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AACxD,EAAA,MAAM,MAAO,KAAA,CAA4B,GAAA;AACzC,EAAA,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,GAAA,KAAQ,MAAM,OAAO,KAAA;AACpD,EAAA,OAAO,OAAQ,IAA2B,IAAA,KAAS,QAAA;AACrD;;ACUO,SAAS,QACd,aAAA,EAeA;AAEA,EAAA,IACE,kBAAkB,MAAA,IAClB,aAAA,KAAkB,IAAA,IACjB,aAAA,CAAuC,WAAW,MAAA,EACnD;AACA,IAAA,MAAM,IAAIA,gCAAA,EAA0B;AAAA,EACtC;AAEA,EAAA,MAAM,EAAE,QAAO,GAAI,aAAA;AACnB,EAAA,IAAI,kBAAA,CAAmB,MAAM,CAAA,EAAG;AAC9B,IAAA,OAAOC,cAAU,aAAwD,CAAA;AAAA,EAG3E;AAMA,EAAA,OAAOC,kBAAU,aAAsB,CAAA;AACzC;;ACzDO,MAAM,SAAA,GAAYC;AAiBlB,SAAS,QAAA,CAAY,QAAW,OAAA,EAA8B;AACnE,EAAA,MAAM,MAAA,GAAS,MAAA;AACf,EAAA,MAAM,QAAA,GAAWC,oCAAA,CAAsB,MAAM,CAAA,IAAK,EAAC;AACnD,EAAA,MAAM,MAAA,GAAS,YAAY,MAAM,CAAA;AACjC,EAAAD,6BAAA,CAAe,IAAI,MAAA,EAAkB,EAAE,GAAG,QAAA,EAAU,GAAG,SAAS,CAAA;AAChE,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,YAAe,MAAA,EAAc;AACpC,EAAA,MAAM,SAAA,GAAY,MAAA;AAClB,EAAA,IAAI,OAAO,SAAA,CAAU,KAAA,KAAU,UAAA,EAAY;AACzC,IAAA,OAAQ,UAAU,KAAA,EAAkB;AAAA,EACtC;AAGA,EAAA,MAAM,OAAO,SAAA,CAAU,WAAA;AACvB,EAAA,OAAO,IAAI,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAChC;;;;;;;;;;;"}
package/dist/zod.d.cts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { U as UseFormConfiguration, G as GenericForm, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, ae as ValidateOnConfig, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.cjs';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.cjs';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.DLnKT7wk.cjs';
2
+ import { U as UseFormConfiguration, G as GenericForm, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, ag as ValidateOnConfig, d as UseFormReturnType, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.cjs';
3
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.cjs';
4
+ export { P as PathInput, a as PathOutput } from './shared/attaform.AOgGyRoI.cjs';
5
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.D7lomopc.cjs';
5
6
  import 'vue';
6
7
 
7
8
  /**
@@ -47,9 +48,9 @@ import 'vue';
47
48
  * })
48
49
  * ```
49
50
  */
50
- declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
51
+ declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.input<Schema> extends GenericForm ? z.input<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
51
52
  schema: Schema;
52
- } & ValidateOnConfig): UseFormReturnType<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
53
+ } & ValidateOnConfig): UseFormReturnType<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
53
54
 
54
55
  /**
55
56
  * Field-metadata write/read API for the unified `attaform/zod` entry.
package/dist/zod.d.mts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { U as UseFormConfiguration, G as GenericForm, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, ae as ValidateOnConfig, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.mjs';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.mjs';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.Bls_kFR6.mjs';
2
+ import { U as UseFormConfiguration, G as GenericForm, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, ag as ValidateOnConfig, d as UseFormReturnType, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.mjs';
3
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.mjs';
4
+ export { P as PathInput, a as PathOutput } from './shared/attaform.BQ-iGGWd.mjs';
5
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.ClfCi1i2.mjs';
5
6
  import 'vue';
6
7
 
7
8
  /**
@@ -47,9 +48,9 @@ import 'vue';
47
48
  * })
48
49
  * ```
49
50
  */
50
- declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
51
+ declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.input<Schema> extends GenericForm ? z.input<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
51
52
  schema: Schema;
52
- } & ValidateOnConfig): UseFormReturnType<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
53
+ } & ValidateOnConfig): UseFormReturnType<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
53
54
 
54
55
  /**
55
56
  * Field-metadata write/read API for the unified `attaform/zod` entry.
package/dist/zod.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
- import { U as UseFormConfiguration, G as GenericForm, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, ae as ValidateOnConfig, d as UseFormReturnType, n as FieldMetaPayload } from './shared/attaform._EqYNPYF.js';
3
- export { ac as Unset, am as isUnset, ao as unset } from './shared/attaform._EqYNPYF.js';
4
- export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.lFNwBcA3.js';
2
+ import { U as UseFormConfiguration, G as GenericForm, b as AbstractSchema, D as DeepPartial, c as DefaultValuesShape, ag as ValidateOnConfig, d as UseFormReturnType, o as FieldMetaPayload } from './shared/attaform.BYbsV2Wv.js';
3
+ export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.BYbsV2Wv.js';
4
+ export { P as PathInput, a as PathOutput } from './shared/attaform.CX9v2M8k.js';
5
+ export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.B0zue7zt.js';
5
6
  import 'vue';
6
7
 
7
8
  /**
@@ -47,9 +48,9 @@ import 'vue';
47
48
  * })
48
49
  * ```
49
50
  */
50
- declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
51
+ declare function useForm<Schema extends z.ZodObject>(configuration: Omit<UseFormConfiguration<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, AbstractSchema<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>, DeepPartial<DefaultValuesShape<z.input<Schema> extends GenericForm ? z.input<Schema> : never>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
51
52
  schema: Schema;
52
- } & ValidateOnConfig): UseFormReturnType<z.output<Schema> extends GenericForm ? z.output<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
53
+ } & ValidateOnConfig): UseFormReturnType<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never>;
53
54
 
54
55
  /**
55
56
  * Field-metadata write/read API for the unified `attaform/zod` entry.
package/dist/zod.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { b as InvalidUseFormConfigError } from './shared/attaform.BfMxsfmE.mjs';
2
- export { u as useRegister } from './shared/attaform.BfMxsfmE.mjs';
3
- import { u as useForm$2 } from './shared/attaform.CFA6y0KF.mjs';
4
- import { u as useForm$1 } from './shared/attaform.XYOMTvuO.mjs';
5
- export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.DILbdvfo.mjs';
1
+ import { b as InvalidUseFormConfigError } from './shared/attaform.CIEQgJnM.mjs';
2
+ export { u as useRegister } from './shared/attaform.CIEQgJnM.mjs';
3
+ import { u as useForm$2 } from './shared/attaform.D6Q5ZP8L.mjs';
4
+ import { u as useForm$1 } from './shared/attaform.Cj0pCNVn.mjs';
5
+ export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.BT55rDNN.mjs';
6
6
  import { f as fieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.D13GMFgK.mjs';
7
7
 
8
8
  function isZodV4SchemaShape(value) {
package/dist/zod.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"zod.mjs","sources":["../src/runtime/core/zod-shape.ts","../src/runtime/adapters/unified/use-form.ts","../src/runtime/adapters/unified/field-meta.ts"],"sourcesContent":["/**\n * Shape detectors for Zod schemas. Used by the unified `attaform/zod`\n * entry's runtime dispatch (`runtime/adapters/unified/use-form.ts`)\n * to route to the v3 or v4 adapter based on the schema's runtime\n * shape. Mirrors the discrimination already used by the v4\n * introspection helper (`adapters/zod-v4/introspect.ts`'s\n * `assertZodVersion`, which reads `def.type`) and the v3 wrapper's\n * legitimate-input branch (`composables/use-form.ts`'s `isZodType`,\n * which reads `_def`).\n *\n * Why this discriminator and not `_zod` / `_def`:\n * - Zod v4 retained `_def` for backward compat — reading `_def` alone\n * misclassifies v4 schemas as v3.\n * - Zod v4's stable shape is `def.type: string` (lowercase tag like\n * `'object'`); Zod v3's is `_def.typeName: string` (capitalised tag\n * like `'ZodObject'`). Both are checked structurally so consumers\n * who alias one Zod major to a non-standard import path still work.\n */\n\ninterface ZodV4Shape {\n def: { type: unknown }\n}\n\ninterface ZodV3Shape {\n _def: { typeName: unknown }\n}\n\n/**\n * Returns true when `value` looks like a Zod schema of either major\n * version. Convenience wrapper around the v3 / v4 detectors.\n */\nexport function isZodSchemaShape(value: unknown): boolean {\n return isZodV4SchemaShape(value) || isZodV3SchemaShape(value)\n}\n\n/**\n * Returns true when `value` looks like a Zod v4 schema (has\n * `def.type: string`). Used by the unified entry's runtime-dispatch\n * to route to the v4 adapter.\n */\nexport function isZodV4SchemaShape(value: unknown): value is ZodV4Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { def?: unknown }).def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { type?: unknown }).type === 'string'\n}\n\n/**\n * Returns true when `value` looks like a Zod v3 schema (has\n * `_def.typeName: string`). Kept distinct from `isZodV4SchemaShape`\n * because some v4 schemas also expose `_def` for backward compat —\n * the v4 detector wins first in `isZodSchemaShape`.\n */\nexport function isZodV3SchemaShape(value: unknown): value is ZodV3Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { _def?: unknown })._def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { typeName?: unknown }).typeName === 'string'\n}\n","/**\n * Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches\n * on schema shape: a Zod v4 schema (`def.type` truthy) routes to the\n * v4 adapter; a Zod v3 schema (or any other `AbstractSchema`) routes\n * to the v3 wrapper, which already accepts both Zod v3 input and\n * `AbstractSchema` directly via its built-in shape branch.\n *\n * This module is the FALLBACK path. Vite consumers see the\n * `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`\n * imports to either `attaform/zod-v3` or `attaform/zod-v4` at build\n * time — in that case this dispatch never runs and the consumer\n * bundle ships only the matching adapter. Other bundlers (and\n * non-bundled ESM consumption) hit this dispatch instead, paying a\n * modest size cost for the convenience of a single hello-world import.\n *\n * Power users who want a guaranteed lean bundle on non-Vite tooling\n * can import directly from `attaform/zod-v3` or `attaform/zod-v4` —\n * those subpaths are never rewritten and never load the other\n * adapter.\n */\nimport type { z } from 'zod'\nimport { InvalidUseFormConfigError } from '../../core/errors'\nimport { isZodV4SchemaShape } from '../../core/zod-shape'\nimport { useForm as useFormV3 } from '../../composables/use-form'\nimport { useForm as useFormV4 } from '../zod-v4'\nimport type {\n AbstractSchema,\n ValidateOnConfig,\n UseFormReturnType,\n UseFormConfiguration,\n} from '../../types/types-api'\nimport type { DeepPartial, DefaultValuesShape, GenericForm } from '../../types/types-core'\n\n/**\n * Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4\n * schemas; the runtime picks the right adapter from the schema's\n * shape.\n *\n * Type inference targets Zod v4 — the recommended major. Consumers\n * still on Zod v3 get correct runtime behavior here, but the strongest\n * TypeScript inference comes from importing `attaform/zod-v3`\n * directly.\n *\n * ```ts\n * import { useForm } from 'attaform/zod'\n * import { z } from 'zod'\n *\n * const form = useForm({\n * schema: z.object({\n * username: z.string().min(2, 'At least 2 characters'),\n * password: z.string().min(8, 'At least 8 characters'),\n * }),\n * })\n * ```\n */\nexport function useForm<Schema extends z.ZodObject>(\n configuration: Omit<\n UseFormConfiguration<\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n AbstractSchema<\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n >,\n DeepPartial<\n DefaultValuesShape<z.output<Schema> extends GenericForm ? z.output<Schema> : never>\n >\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & ValidateOnConfig\n): UseFormReturnType<\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n> {\n // Foot-gun guard mirrors the typed wrappers'.\n if (\n configuration === undefined ||\n configuration === null ||\n (configuration as { schema?: unknown }).schema === undefined\n ) {\n throw new InvalidUseFormConfigError()\n }\n\n const { schema } = configuration as { schema: unknown }\n if (isZodV4SchemaShape(schema)) {\n return useFormV4(configuration as Parameters<typeof useFormV4<Schema>>[0]) as ReturnType<\n typeof useForm<Schema>\n >\n }\n // Anything else (Zod v3 schema, custom AbstractSchema, schema\n // factory) goes through the v3 wrapper, which already accepts both\n // Zod v3 input and AbstractSchema directly via its existing shape\n // branch. Cast through unknown — the unified entry's TS surface\n // tracks v4, but the runtime accepts the broader shape.\n return useFormV3(configuration as never) as unknown as ReturnType<typeof useForm<Schema>>\n}\n","/**\n * Field-metadata write/read API for the unified `attaform/zod` entry.\n *\n * Storage is shared with both adapters via `field-meta-store` — a\n * payload written here is visible to whichever adapter the unified\n * `useForm` dispatches to at runtime, regardless of Zod major. No\n * `zod` runtime import; the type-only `import type` is erased at\n * build, so `attaform/zod` carries no `z.registry` reference even\n * when consumed by a Zod 3 project without the Vite plugin alias.\n *\n * The native v4 chain `schema.register(fieldMeta, payload)` continues\n * to work — Zod 4's `.register()` only calls `.add(this, payload)`\n * structurally, satisfied by the shared store.\n */\nimport type { z } from 'zod'\nimport type { FieldMetaPayload } from '../../core/field-meta'\nimport { fieldMetaStore, getFieldMetaForSchema } from '../../core/field-meta-store'\n\n// Zod v4's `$ZodRegistry` class isn't surfaced under the `z` namespace\n// of the classic external entry, but `z.registry()` returns one — so\n// `ReturnType<typeof z.registry<T>>` resolves to the registry type\n// without needing a direct import. The `import type` keeps the\n// reference type-only; nothing about `z.registry` lands in the bundle.\ntype ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>\n\n/**\n * The shared registry every Attaform-aware Zod schema can register\n * field metadata against, regardless of major. Same instance the v3\n * and v4 adapter entries expose — write in one place, read from\n * any.\n *\n * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native\n * `schema.register(fieldMeta, payload)` chain type-checks for v4\n * users; the runtime call only needs `.add` structurally, which the\n * shared store provides.\n */\nexport const fieldMeta = fieldMetaStore as unknown as ZodFieldMetaRegistry\n\n/**\n * Attach `payload` to `schema` in the shared registry and return a\n * clone of `schema` so each call gets its own identity (the registry\n * keys on schema reference, so cloning prevents last-write-wins\n * collisions for sub-schemas reused at multiple paths).\n *\n * Works on both Zod 3 and Zod 4 schemas — branches on the runtime\n * shape of the schema:\n * - Zod 4 schemas expose a public `.clone()` method; we call it.\n * - Zod 3 schemas don't, so we reconstruct via\n * `new schema.constructor(schema._def)`.\n *\n * Both forms produce a fresh schema with the same effective\n * structure, so the registry slot is unique to this call site.\n */\nexport function withMeta<S>(schema: S, payload: FieldMetaPayload): S {\n const target = schema as object\n const existing = getFieldMetaForSchema(target) ?? {}\n const cloned = cloneSchema(schema)\n fieldMetaStore.add(cloned as object, { ...existing, ...payload })\n return cloned\n}\n\nfunction cloneSchema<S>(schema: S): S {\n const candidate = schema as { clone?: unknown; constructor: unknown; _def: unknown }\n if (typeof candidate.clone === 'function') {\n return (candidate.clone as () => S)()\n }\n // Zod 3 path: reconstruct via constructor + _def (no public\n // `.clone()` on v3).\n const Ctor = candidate.constructor as new (def: unknown) => S\n return new Ctor(candidate._def)\n}\n"],"names":["useFormV4","useFormV3"],"mappings":";;;;;;;AAwCO,SAAS,mBAAmB,KAAA,EAAqC;AACtE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AACxD,EAAA,MAAM,MAAO,KAAA,CAA4B,GAAA;AACzC,EAAA,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,GAAA,KAAQ,MAAM,OAAO,KAAA;AACpD,EAAA,OAAO,OAAQ,IAA2B,IAAA,KAAS,QAAA;AACrD;;ACUO,SAAS,QACd,aAAA,EAiBA;AAEA,EAAA,IACE,kBAAkB,MAAA,IAClB,aAAA,KAAkB,IAAA,IACjB,aAAA,CAAuC,WAAW,MAAA,EACnD;AACA,IAAA,MAAM,IAAI,yBAAA,EAA0B;AAAA,EACtC;AAEA,EAAA,MAAM,EAAE,QAAO,GAAI,aAAA;AACnB,EAAA,IAAI,kBAAA,CAAmB,MAAM,CAAA,EAAG;AAC9B,IAAA,OAAOA,UAAU,aAAwD,CAAA;AAAA,EAG3E;AAMA,EAAA,OAAOC,UAAU,aAAsB,CAAA;AACzC;;AC3DO,MAAM,SAAA,GAAY;AAiBlB,SAAS,QAAA,CAAY,QAAW,OAAA,EAA8B;AACnE,EAAA,MAAM,MAAA,GAAS,MAAA;AACf,EAAA,MAAM,QAAA,GAAW,qBAAA,CAAsB,MAAM,CAAA,IAAK,EAAC;AACnD,EAAA,MAAM,MAAA,GAAS,YAAY,MAAM,CAAA;AACjC,EAAA,cAAA,CAAe,IAAI,MAAA,EAAkB,EAAE,GAAG,QAAA,EAAU,GAAG,SAAS,CAAA;AAChE,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,YAAe,MAAA,EAAc;AACpC,EAAA,MAAM,SAAA,GAAY,MAAA;AAClB,EAAA,IAAI,OAAO,SAAA,CAAU,KAAA,KAAU,UAAA,EAAY;AACzC,IAAA,OAAQ,UAAU,KAAA,EAAkB;AAAA,EACtC;AAGA,EAAA,MAAM,OAAO,SAAA,CAAU,WAAA;AACvB,EAAA,OAAO,IAAI,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAChC;;;;"}
1
+ {"version":3,"file":"zod.mjs","sources":["../src/runtime/core/zod-shape.ts","../src/runtime/adapters/unified/use-form.ts","../src/runtime/adapters/unified/field-meta.ts"],"sourcesContent":["/**\n * Shape detectors for Zod schemas. Used by the unified `attaform/zod`\n * entry's runtime dispatch (`runtime/adapters/unified/use-form.ts`)\n * to route to the v3 or v4 adapter based on the schema's runtime\n * shape. Mirrors the discrimination already used by the v4\n * introspection helper (`adapters/zod-v4/introspect.ts`'s\n * `assertZodVersion`, which reads `def.type`) and the v3 wrapper's\n * legitimate-input branch (`composables/use-form.ts`'s `isZodType`,\n * which reads `_def`).\n *\n * Why this discriminator and not `_zod` / `_def`:\n * - Zod v4 retained `_def` for backward compat — reading `_def` alone\n * misclassifies v4 schemas as v3.\n * - Zod v4's stable shape is `def.type: string` (lowercase tag like\n * `'object'`); Zod v3's is `_def.typeName: string` (capitalised tag\n * like `'ZodObject'`). Both are checked structurally so consumers\n * who alias one Zod major to a non-standard import path still work.\n */\n\ninterface ZodV4Shape {\n def: { type: unknown }\n}\n\ninterface ZodV3Shape {\n _def: { typeName: unknown }\n}\n\n/**\n * Returns true when `value` looks like a Zod schema of either major\n * version. Convenience wrapper around the v3 / v4 detectors.\n */\nexport function isZodSchemaShape(value: unknown): boolean {\n return isZodV4SchemaShape(value) || isZodV3SchemaShape(value)\n}\n\n/**\n * Returns true when `value` looks like a Zod v4 schema (has\n * `def.type: string`). Used by the unified entry's runtime-dispatch\n * to route to the v4 adapter.\n */\nexport function isZodV4SchemaShape(value: unknown): value is ZodV4Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { def?: unknown }).def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { type?: unknown }).type === 'string'\n}\n\n/**\n * Returns true when `value` looks like a Zod v3 schema (has\n * `_def.typeName: string`). Kept distinct from `isZodV4SchemaShape`\n * because some v4 schemas also expose `_def` for backward compat —\n * the v4 detector wins first in `isZodSchemaShape`.\n */\nexport function isZodV3SchemaShape(value: unknown): value is ZodV3Shape {\n if (typeof value !== 'object' || value === null) return false\n const def = (value as { _def?: unknown })._def\n if (typeof def !== 'object' || def === null) return false\n return typeof (def as { typeName?: unknown }).typeName === 'string'\n}\n","/**\n * Unified `useForm` for the `attaform/zod` entry. Runtime-dispatches\n * on schema shape: a Zod v4 schema (`def.type` truthy) routes to the\n * v4 adapter; a Zod v3 schema (or any other `AbstractSchema`) routes\n * to the v3 wrapper, which already accepts both Zod v3 input and\n * `AbstractSchema` directly via its built-in shape branch.\n *\n * This module is the FALLBACK path. Vite consumers see the\n * `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`\n * imports to either `attaform/zod-v3` or `attaform/zod-v4` at build\n * time — in that case this dispatch never runs and the consumer\n * bundle ships only the matching adapter. Other bundlers (and\n * non-bundled ESM consumption) hit this dispatch instead, paying a\n * modest size cost for the convenience of a single hello-world import.\n *\n * Power users who want a guaranteed lean bundle on non-Vite tooling\n * can import directly from `attaform/zod-v3` or `attaform/zod-v4` —\n * those subpaths are never rewritten and never load the other\n * adapter.\n */\nimport type { z } from 'zod'\nimport { InvalidUseFormConfigError } from '../../core/errors'\nimport { isZodV4SchemaShape } from '../../core/zod-shape'\nimport { useForm as useFormV3 } from '../../composables/use-form'\nimport { useForm as useFormV4 } from '../zod-v4'\nimport type {\n AbstractSchema,\n ValidateOnConfig,\n UseFormReturnType,\n UseFormConfiguration,\n} from '../../types/types-api'\nimport type { DeepPartial, DefaultValuesShape, GenericForm } from '../../types/types-core'\n\n/**\n * Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4\n * schemas; the runtime picks the right adapter from the schema's\n * shape.\n *\n * Type inference targets Zod v4 — the recommended major. Consumers\n * still on Zod v3 get correct runtime behavior here, but the strongest\n * TypeScript inference comes from importing `attaform/zod-v3`\n * directly.\n *\n * ```ts\n * import { useForm } from 'attaform/zod'\n * import { z } from 'zod'\n *\n * const form = useForm({\n * schema: z.object({\n * username: z.string().min(2, 'At least 2 characters'),\n * password: z.string().min(8, 'At least 8 characters'),\n * }),\n * })\n * ```\n */\nexport function useForm<Schema extends z.ZodObject>(\n configuration: Omit<\n UseFormConfiguration<\n z.input<Schema> extends GenericForm ? z.input<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never,\n AbstractSchema<\n z.input<Schema> extends GenericForm ? z.input<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n >,\n DeepPartial<DefaultValuesShape<z.input<Schema> extends GenericForm ? z.input<Schema> : never>>\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n > & { schema: Schema } & ValidateOnConfig\n): UseFormReturnType<\n z.input<Schema> extends GenericForm ? z.input<Schema> : never,\n z.output<Schema> extends GenericForm ? z.output<Schema> : never\n> {\n // Foot-gun guard mirrors the typed wrappers'.\n if (\n configuration === undefined ||\n configuration === null ||\n (configuration as { schema?: unknown }).schema === undefined\n ) {\n throw new InvalidUseFormConfigError()\n }\n\n const { schema } = configuration as { schema: unknown }\n if (isZodV4SchemaShape(schema)) {\n return useFormV4(configuration as Parameters<typeof useFormV4<Schema>>[0]) as ReturnType<\n typeof useForm<Schema>\n >\n }\n // Anything else (Zod v3 schema, custom AbstractSchema, schema\n // factory) goes through the v3 wrapper, which already accepts both\n // Zod v3 input and AbstractSchema directly via its existing shape\n // branch. Cast through unknown — the unified entry's TS surface\n // tracks v4, but the runtime accepts the broader shape.\n return useFormV3(configuration as never) as unknown as ReturnType<typeof useForm<Schema>>\n}\n","/**\n * Field-metadata write/read API for the unified `attaform/zod` entry.\n *\n * Storage is shared with both adapters via `field-meta-store` — a\n * payload written here is visible to whichever adapter the unified\n * `useForm` dispatches to at runtime, regardless of Zod major. No\n * `zod` runtime import; the type-only `import type` is erased at\n * build, so `attaform/zod` carries no `z.registry` reference even\n * when consumed by a Zod 3 project without the Vite plugin alias.\n *\n * The native v4 chain `schema.register(fieldMeta, payload)` continues\n * to work — Zod 4's `.register()` only calls `.add(this, payload)`\n * structurally, satisfied by the shared store.\n */\nimport type { z } from 'zod'\nimport type { FieldMetaPayload } from '../../core/field-meta'\nimport { fieldMetaStore, getFieldMetaForSchema } from '../../core/field-meta-store'\n\n// Zod v4's `$ZodRegistry` class isn't surfaced under the `z` namespace\n// of the classic external entry, but `z.registry()` returns one — so\n// `ReturnType<typeof z.registry<T>>` resolves to the registry type\n// without needing a direct import. The `import type` keeps the\n// reference type-only; nothing about `z.registry` lands in the bundle.\ntype ZodFieldMetaRegistry = ReturnType<typeof z.registry<FieldMetaPayload>>\n\n/**\n * The shared registry every Attaform-aware Zod schema can register\n * field metadata against, regardless of major. Same instance the v3\n * and v4 adapter entries expose — write in one place, read from\n * any.\n *\n * Cast to Zod 4's `$ZodRegistry<FieldMetaPayload>` so the native\n * `schema.register(fieldMeta, payload)` chain type-checks for v4\n * users; the runtime call only needs `.add` structurally, which the\n * shared store provides.\n */\nexport const fieldMeta = fieldMetaStore as unknown as ZodFieldMetaRegistry\n\n/**\n * Attach `payload` to `schema` in the shared registry and return a\n * clone of `schema` so each call gets its own identity (the registry\n * keys on schema reference, so cloning prevents last-write-wins\n * collisions for sub-schemas reused at multiple paths).\n *\n * Works on both Zod 3 and Zod 4 schemas — branches on the runtime\n * shape of the schema:\n * - Zod 4 schemas expose a public `.clone()` method; we call it.\n * - Zod 3 schemas don't, so we reconstruct via\n * `new schema.constructor(schema._def)`.\n *\n * Both forms produce a fresh schema with the same effective\n * structure, so the registry slot is unique to this call site.\n */\nexport function withMeta<S>(schema: S, payload: FieldMetaPayload): S {\n const target = schema as object\n const existing = getFieldMetaForSchema(target) ?? {}\n const cloned = cloneSchema(schema)\n fieldMetaStore.add(cloned as object, { ...existing, ...payload })\n return cloned\n}\n\nfunction cloneSchema<S>(schema: S): S {\n const candidate = schema as { clone?: unknown; constructor: unknown; _def: unknown }\n if (typeof candidate.clone === 'function') {\n return (candidate.clone as () => S)()\n }\n // Zod 3 path: reconstruct via constructor + _def (no public\n // `.clone()` on v3).\n const Ctor = candidate.constructor as new (def: unknown) => S\n return new Ctor(candidate._def)\n}\n"],"names":["useFormV4","useFormV3"],"mappings":";;;;;;;AAwCO,SAAS,mBAAmB,KAAA,EAAqC;AACtE,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,KAAA,KAAU,MAAM,OAAO,KAAA;AACxD,EAAA,MAAM,MAAO,KAAA,CAA4B,GAAA;AACzC,EAAA,IAAI,OAAO,GAAA,KAAQ,QAAA,IAAY,GAAA,KAAQ,MAAM,OAAO,KAAA;AACpD,EAAA,OAAO,OAAQ,IAA2B,IAAA,KAAS,QAAA;AACrD;;ACUO,SAAS,QACd,aAAA,EAeA;AAEA,EAAA,IACE,kBAAkB,MAAA,IAClB,aAAA,KAAkB,IAAA,IACjB,aAAA,CAAuC,WAAW,MAAA,EACnD;AACA,IAAA,MAAM,IAAI,yBAAA,EAA0B;AAAA,EACtC;AAEA,EAAA,MAAM,EAAE,QAAO,GAAI,aAAA;AACnB,EAAA,IAAI,kBAAA,CAAmB,MAAM,CAAA,EAAG;AAC9B,IAAA,OAAOA,UAAU,aAAwD,CAAA;AAAA,EAG3E;AAMA,EAAA,OAAOC,UAAU,aAAsB,CAAA;AACzC;;ACzDO,MAAM,SAAA,GAAY;AAiBlB,SAAS,QAAA,CAAY,QAAW,OAAA,EAA8B;AACnE,EAAA,MAAM,MAAA,GAAS,MAAA;AACf,EAAA,MAAM,QAAA,GAAW,qBAAA,CAAsB,MAAM,CAAA,IAAK,EAAC;AACnD,EAAA,MAAM,MAAA,GAAS,YAAY,MAAM,CAAA;AACjC,EAAA,cAAA,CAAe,IAAI,MAAA,EAAkB,EAAE,GAAG,QAAA,EAAU,GAAG,SAAS,CAAA;AAChE,EAAA,OAAO,MAAA;AACT;AAEA,SAAS,YAAe,MAAA,EAAc;AACpC,EAAA,MAAM,SAAA,GAAY,MAAA;AAClB,EAAA,IAAI,OAAO,SAAA,CAAU,KAAA,KAAU,UAAA,EAAY;AACzC,IAAA,OAAQ,UAAU,KAAA,EAAkB;AAAA,EACtC;AAGA,EAAA,MAAM,OAAO,SAAA,CAAU,WAAA;AACvB,EAAA,OAAO,IAAI,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAChC;;;;"}