attaform 0.17.1 → 0.17.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.
- package/dist/shared/{attaform.B5qiXQwN.cjs → attaform.BPRHR3Zs.cjs} +11 -7
- package/dist/shared/{attaform.CVCmBKZX.mjs.map → attaform.BPRHR3Zs.cjs.map} +1 -1
- package/dist/shared/attaform.C5MH4lNh.d.mts +53 -0
- package/dist/shared/attaform.C6lbmMUe.d.ts +53 -0
- package/dist/shared/{attaform.CVCmBKZX.mjs → attaform.Drt6fivF.mjs} +11 -7
- package/dist/shared/{attaform.B5qiXQwN.cjs.map → attaform.Drt6fivF.mjs.map} +1 -1
- package/dist/shared/attaform.DtMN-MAm.d.cts +53 -0
- package/dist/zod-v3.cjs +1 -1
- package/dist/zod-v3.d.cts +33 -81
- package/dist/zod-v3.d.mts +33 -81
- package/dist/zod-v3.d.ts +33 -81
- package/dist/zod-v3.mjs +1 -1
- package/dist/zod.cjs +7 -3
- package/dist/zod.cjs.map +1 -1
- package/dist/zod.d.cts +32 -7
- package/dist/zod.d.mts +32 -7
- package/dist/zod.d.ts +32 -7
- package/dist/zod.mjs +7 -3
- package/dist/zod.mjs.map +1 -1
- package/package.json +1 -1
package/dist/zod.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { S as StorageShape } from './shared/attaform.CHorcsIU.cjs';
|
|
3
3
|
export { P as PathInput, a as PathOutput } from './shared/attaform.CHorcsIU.cjs';
|
|
4
|
+
import { U as UnwrapZodObject, S as StorageShape$1 } from './shared/attaform.DtMN-MAm.cjs';
|
|
4
5
|
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.C_5aB6EQ.cjs';
|
|
5
6
|
export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.C_5aB6EQ.cjs';
|
|
6
7
|
export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.C6qzEdIM.cjs';
|
|
@@ -13,6 +14,22 @@ import 'vue';
|
|
|
13
14
|
* to the v3 wrapper, which already accepts both Zod v3 input and
|
|
14
15
|
* `AbstractSchema` directly via its built-in shape branch.
|
|
15
16
|
*
|
|
17
|
+
* Type-level dispatch happens through a single signature with a
|
|
18
|
+
* union constraint — `Schema extends z.ZodObject |
|
|
19
|
+
* zV3.ZodObject<zV3.ZodRawShape>`. The configuration parameter and
|
|
20
|
+
* return type both dispatch conditionally on whether `Schema` is a
|
|
21
|
+
* v4 or v3 object. The two majors don't structurally satisfy each
|
|
22
|
+
* other's `ZodObject` constraints (v4 has `loose` / `safeExtend` /
|
|
23
|
+
* `def` / `type` members v3 lacks), so neither alone is enough — the
|
|
24
|
+
* union accepts both, and the conditional return type routes through
|
|
25
|
+
* the matching adapter's `StorageShape` / `z.input` / `z.output`.
|
|
26
|
+
*
|
|
27
|
+
* A single signature (rather than overloads) keeps `typeof
|
|
28
|
+
* useForm<X>` instantiation expressions in test code unambiguous:
|
|
29
|
+
* TypeScript's overload-resolution rules for these expressions are
|
|
30
|
+
* brittle when multiple overloads partially match, so we collapse to
|
|
31
|
+
* one signature.
|
|
32
|
+
*
|
|
16
33
|
* This module is the FALLBACK path. Vite consumers see the
|
|
17
34
|
* `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`
|
|
18
35
|
* imports to either `attaform/zod-v3` or `attaform/zod-v4` at build
|
|
@@ -27,15 +44,25 @@ import 'vue';
|
|
|
27
44
|
* adapter.
|
|
28
45
|
*/
|
|
29
46
|
|
|
47
|
+
type FormInput<Schema> = Schema extends z.ZodObject ? z.input<Schema> extends GenericForm ? z.input<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? z.input<UnwrapZodObject<Schema>> extends GenericForm ? z.input<UnwrapZodObject<Schema>> : never : never;
|
|
48
|
+
type FormOutput<Schema> = Schema extends z.ZodObject ? z.output<Schema> extends GenericForm ? z.output<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? z.output<UnwrapZodObject<Schema>> extends GenericForm ? z.output<UnwrapZodObject<Schema>> : never : never;
|
|
49
|
+
type FormStorageShape<Schema> = Schema extends z.ZodObject ? StorageShape<Schema> extends GenericForm ? StorageShape<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? StorageShape$1<UnwrapZodObject<Schema>> extends GenericForm ? StorageShape$1<UnwrapZodObject<Schema>> : never : never;
|
|
50
|
+
type UnifiedConfiguration<Schema> = Omit<UseFormConfiguration<FormInput<Schema>, FormOutput<Schema>, AbstractSchema<FormInput<Schema>, FormOutput<Schema>>, DeepPartial<DefaultValuesShape<FormInput<Schema>>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
51
|
+
schema: Schema;
|
|
52
|
+
} & ValidateOnConfig;
|
|
30
53
|
/**
|
|
31
54
|
* Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4
|
|
32
55
|
* schemas; the runtime picks the right adapter from the schema's
|
|
33
56
|
* shape.
|
|
34
57
|
*
|
|
35
|
-
* Type inference
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
58
|
+
* Type inference works transparently for both Zod v3 and Zod v4
|
|
59
|
+
* schemas — the adapter is selected from the schema's shape at both
|
|
60
|
+
* runtime and type-check time. `form.values`, `form.fields`,
|
|
61
|
+
* `register`, and the `handleSubmit` callback data type all resolve
|
|
62
|
+
* against the matching adapter's storage shape; consumers don't need
|
|
63
|
+
* to reach for `attaform/zod-v3` or `attaform/zod-v4` to get full
|
|
64
|
+
* inference. Those subpath entries remain as lean-bundle escape
|
|
65
|
+
* hatches for non-Vite tooling, not correctness escape hatches.
|
|
39
66
|
*
|
|
40
67
|
* ```ts
|
|
41
68
|
* import { useForm } from 'attaform/zod'
|
|
@@ -49,9 +76,7 @@ import 'vue';
|
|
|
49
76
|
* })
|
|
50
77
|
* ```
|
|
51
78
|
*/
|
|
52
|
-
declare function useForm<Schema extends z.ZodObject
|
|
53
|
-
schema: Schema;
|
|
54
|
-
} & ValidateOnConfig): UseFormReturnType<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, StorageShape<Schema> extends GenericForm ? StorageShape<Schema> : never>;
|
|
79
|
+
declare function useForm<Schema extends z.ZodObject | z.ZodObject<z.ZodRawShape>>(configuration: UnifiedConfiguration<Schema>): UseFormReturnType<FormInput<Schema>, FormOutput<Schema>, FormStorageShape<Schema>>;
|
|
55
80
|
|
|
56
81
|
/**
|
|
57
82
|
* Field-metadata write/read API for the unified `attaform/zod` entry.
|
package/dist/zod.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { S as StorageShape } from './shared/attaform.CuE-bS1C.mjs';
|
|
3
3
|
export { P as PathInput, a as PathOutput } from './shared/attaform.CuE-bS1C.mjs';
|
|
4
|
+
import { U as UnwrapZodObject, S as StorageShape$1 } from './shared/attaform.C5MH4lNh.mjs';
|
|
4
5
|
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.C_5aB6EQ.mjs';
|
|
5
6
|
export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.C_5aB6EQ.mjs';
|
|
6
7
|
export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.B1jvxsOF.mjs';
|
|
@@ -13,6 +14,22 @@ import 'vue';
|
|
|
13
14
|
* to the v3 wrapper, which already accepts both Zod v3 input and
|
|
14
15
|
* `AbstractSchema` directly via its built-in shape branch.
|
|
15
16
|
*
|
|
17
|
+
* Type-level dispatch happens through a single signature with a
|
|
18
|
+
* union constraint — `Schema extends z.ZodObject |
|
|
19
|
+
* zV3.ZodObject<zV3.ZodRawShape>`. The configuration parameter and
|
|
20
|
+
* return type both dispatch conditionally on whether `Schema` is a
|
|
21
|
+
* v4 or v3 object. The two majors don't structurally satisfy each
|
|
22
|
+
* other's `ZodObject` constraints (v4 has `loose` / `safeExtend` /
|
|
23
|
+
* `def` / `type` members v3 lacks), so neither alone is enough — the
|
|
24
|
+
* union accepts both, and the conditional return type routes through
|
|
25
|
+
* the matching adapter's `StorageShape` / `z.input` / `z.output`.
|
|
26
|
+
*
|
|
27
|
+
* A single signature (rather than overloads) keeps `typeof
|
|
28
|
+
* useForm<X>` instantiation expressions in test code unambiguous:
|
|
29
|
+
* TypeScript's overload-resolution rules for these expressions are
|
|
30
|
+
* brittle when multiple overloads partially match, so we collapse to
|
|
31
|
+
* one signature.
|
|
32
|
+
*
|
|
16
33
|
* This module is the FALLBACK path. Vite consumers see the
|
|
17
34
|
* `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`
|
|
18
35
|
* imports to either `attaform/zod-v3` or `attaform/zod-v4` at build
|
|
@@ -27,15 +44,25 @@ import 'vue';
|
|
|
27
44
|
* adapter.
|
|
28
45
|
*/
|
|
29
46
|
|
|
47
|
+
type FormInput<Schema> = Schema extends z.ZodObject ? z.input<Schema> extends GenericForm ? z.input<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? z.input<UnwrapZodObject<Schema>> extends GenericForm ? z.input<UnwrapZodObject<Schema>> : never : never;
|
|
48
|
+
type FormOutput<Schema> = Schema extends z.ZodObject ? z.output<Schema> extends GenericForm ? z.output<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? z.output<UnwrapZodObject<Schema>> extends GenericForm ? z.output<UnwrapZodObject<Schema>> : never : never;
|
|
49
|
+
type FormStorageShape<Schema> = Schema extends z.ZodObject ? StorageShape<Schema> extends GenericForm ? StorageShape<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? StorageShape$1<UnwrapZodObject<Schema>> extends GenericForm ? StorageShape$1<UnwrapZodObject<Schema>> : never : never;
|
|
50
|
+
type UnifiedConfiguration<Schema> = Omit<UseFormConfiguration<FormInput<Schema>, FormOutput<Schema>, AbstractSchema<FormInput<Schema>, FormOutput<Schema>>, DeepPartial<DefaultValuesShape<FormInput<Schema>>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
51
|
+
schema: Schema;
|
|
52
|
+
} & ValidateOnConfig;
|
|
30
53
|
/**
|
|
31
54
|
* Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4
|
|
32
55
|
* schemas; the runtime picks the right adapter from the schema's
|
|
33
56
|
* shape.
|
|
34
57
|
*
|
|
35
|
-
* Type inference
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
58
|
+
* Type inference works transparently for both Zod v3 and Zod v4
|
|
59
|
+
* schemas — the adapter is selected from the schema's shape at both
|
|
60
|
+
* runtime and type-check time. `form.values`, `form.fields`,
|
|
61
|
+
* `register`, and the `handleSubmit` callback data type all resolve
|
|
62
|
+
* against the matching adapter's storage shape; consumers don't need
|
|
63
|
+
* to reach for `attaform/zod-v3` or `attaform/zod-v4` to get full
|
|
64
|
+
* inference. Those subpath entries remain as lean-bundle escape
|
|
65
|
+
* hatches for non-Vite tooling, not correctness escape hatches.
|
|
39
66
|
*
|
|
40
67
|
* ```ts
|
|
41
68
|
* import { useForm } from 'attaform/zod'
|
|
@@ -49,9 +76,7 @@ import 'vue';
|
|
|
49
76
|
* })
|
|
50
77
|
* ```
|
|
51
78
|
*/
|
|
52
|
-
declare function useForm<Schema extends z.ZodObject
|
|
53
|
-
schema: Schema;
|
|
54
|
-
} & ValidateOnConfig): UseFormReturnType<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, StorageShape<Schema> extends GenericForm ? StorageShape<Schema> : never>;
|
|
79
|
+
declare function useForm<Schema extends z.ZodObject | z.ZodObject<z.ZodRawShape>>(configuration: UnifiedConfiguration<Schema>): UseFormReturnType<FormInput<Schema>, FormOutput<Schema>, FormStorageShape<Schema>>;
|
|
55
80
|
|
|
56
81
|
/**
|
|
57
82
|
* Field-metadata write/read API for the unified `attaform/zod` entry.
|
package/dist/zod.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { S as StorageShape } from './shared/attaform.C0iFnTN0.js';
|
|
3
3
|
export { P as PathInput, a as PathOutput } from './shared/attaform.C0iFnTN0.js';
|
|
4
|
+
import { U as UnwrapZodObject, S as StorageShape$1 } from './shared/attaform.C6lbmMUe.js';
|
|
4
5
|
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.C_5aB6EQ.js';
|
|
5
6
|
export { ae as Unset, ao as isUnset, aq as unset } from './shared/attaform.C_5aB6EQ.js';
|
|
6
7
|
export { A as AttaformErrorCode, i as injectForm, u as useRegister } from './shared/attaform.CTwNcpLE.js';
|
|
@@ -13,6 +14,22 @@ import 'vue';
|
|
|
13
14
|
* to the v3 wrapper, which already accepts both Zod v3 input and
|
|
14
15
|
* `AbstractSchema` directly via its built-in shape branch.
|
|
15
16
|
*
|
|
17
|
+
* Type-level dispatch happens through a single signature with a
|
|
18
|
+
* union constraint — `Schema extends z.ZodObject |
|
|
19
|
+
* zV3.ZodObject<zV3.ZodRawShape>`. The configuration parameter and
|
|
20
|
+
* return type both dispatch conditionally on whether `Schema` is a
|
|
21
|
+
* v4 or v3 object. The two majors don't structurally satisfy each
|
|
22
|
+
* other's `ZodObject` constraints (v4 has `loose` / `safeExtend` /
|
|
23
|
+
* `def` / `type` members v3 lacks), so neither alone is enough — the
|
|
24
|
+
* union accepts both, and the conditional return type routes through
|
|
25
|
+
* the matching adapter's `StorageShape` / `z.input` / `z.output`.
|
|
26
|
+
*
|
|
27
|
+
* A single signature (rather than overloads) keeps `typeof
|
|
28
|
+
* useForm<X>` instantiation expressions in test code unambiguous:
|
|
29
|
+
* TypeScript's overload-resolution rules for these expressions are
|
|
30
|
+
* brittle when multiple overloads partially match, so we collapse to
|
|
31
|
+
* one signature.
|
|
32
|
+
*
|
|
16
33
|
* This module is the FALLBACK path. Vite consumers see the
|
|
17
34
|
* `attaform/vite` plugin's `resolveId` hook rewrite `attaform/zod`
|
|
18
35
|
* imports to either `attaform/zod-v3` or `attaform/zod-v4` at build
|
|
@@ -27,15 +44,25 @@ import 'vue';
|
|
|
27
44
|
* adapter.
|
|
28
45
|
*/
|
|
29
46
|
|
|
47
|
+
type FormInput<Schema> = Schema extends z.ZodObject ? z.input<Schema> extends GenericForm ? z.input<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? z.input<UnwrapZodObject<Schema>> extends GenericForm ? z.input<UnwrapZodObject<Schema>> : never : never;
|
|
48
|
+
type FormOutput<Schema> = Schema extends z.ZodObject ? z.output<Schema> extends GenericForm ? z.output<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? z.output<UnwrapZodObject<Schema>> extends GenericForm ? z.output<UnwrapZodObject<Schema>> : never : never;
|
|
49
|
+
type FormStorageShape<Schema> = Schema extends z.ZodObject ? StorageShape<Schema> extends GenericForm ? StorageShape<Schema> : never : Schema extends z.ZodObject<z.ZodRawShape> ? StorageShape$1<UnwrapZodObject<Schema>> extends GenericForm ? StorageShape$1<UnwrapZodObject<Schema>> : never : never;
|
|
50
|
+
type UnifiedConfiguration<Schema> = Omit<UseFormConfiguration<FormInput<Schema>, FormOutput<Schema>, AbstractSchema<FormInput<Schema>, FormOutput<Schema>>, DeepPartial<DefaultValuesShape<FormInput<Schema>>>>, 'schema' | 'validateOn' | 'debounceMs'> & {
|
|
51
|
+
schema: Schema;
|
|
52
|
+
} & ValidateOnConfig;
|
|
30
53
|
/**
|
|
31
54
|
* Create a form bound to a Zod schema. Accepts both Zod v3 and Zod v4
|
|
32
55
|
* schemas; the runtime picks the right adapter from the schema's
|
|
33
56
|
* shape.
|
|
34
57
|
*
|
|
35
|
-
* Type inference
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
58
|
+
* Type inference works transparently for both Zod v3 and Zod v4
|
|
59
|
+
* schemas — the adapter is selected from the schema's shape at both
|
|
60
|
+
* runtime and type-check time. `form.values`, `form.fields`,
|
|
61
|
+
* `register`, and the `handleSubmit` callback data type all resolve
|
|
62
|
+
* against the matching adapter's storage shape; consumers don't need
|
|
63
|
+
* to reach for `attaform/zod-v3` or `attaform/zod-v4` to get full
|
|
64
|
+
* inference. Those subpath entries remain as lean-bundle escape
|
|
65
|
+
* hatches for non-Vite tooling, not correctness escape hatches.
|
|
39
66
|
*
|
|
40
67
|
* ```ts
|
|
41
68
|
* import { useForm } from 'attaform/zod'
|
|
@@ -49,9 +76,7 @@ import 'vue';
|
|
|
49
76
|
* })
|
|
50
77
|
* ```
|
|
51
78
|
*/
|
|
52
|
-
declare function useForm<Schema extends z.ZodObject
|
|
53
|
-
schema: Schema;
|
|
54
|
-
} & ValidateOnConfig): UseFormReturnType<z.input<Schema> extends GenericForm ? z.input<Schema> : never, z.output<Schema> extends GenericForm ? z.output<Schema> : never, StorageShape<Schema> extends GenericForm ? StorageShape<Schema> : never>;
|
|
79
|
+
declare function useForm<Schema extends z.ZodObject | z.ZodObject<z.ZodRawShape>>(configuration: UnifiedConfiguration<Schema>): UseFormReturnType<FormInput<Schema>, FormOutput<Schema>, FormStorageShape<Schema>>;
|
|
55
80
|
|
|
56
81
|
/**
|
|
57
82
|
* Field-metadata write/read API for the unified `attaform/zod` entry.
|
package/dist/zod.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { b as InvalidUseFormConfigError } from './shared/attaform.CIEQgJnM.mjs';
|
|
2
2
|
export { u as useRegister } from './shared/attaform.CIEQgJnM.mjs';
|
|
3
|
-
import { u as useForm$2 } from './shared/attaform.
|
|
3
|
+
import { u as useForm$2 } from './shared/attaform.Drt6fivF.mjs';
|
|
4
4
|
import { u as useForm$1 } from './shared/attaform.CpERWz3u.mjs';
|
|
5
5
|
export { A as AttaformErrorCode, i as injectForm, a as isUnset, u as unset } from './shared/attaform.B3ZaPIzS.mjs';
|
|
6
6
|
import { f as fieldMetaStore, g as getFieldMetaForSchema } from './shared/attaform.D13GMFgK.mjs';
|
|
@@ -18,9 +18,13 @@ function useForm(configuration) {
|
|
|
18
18
|
}
|
|
19
19
|
const { schema } = configuration;
|
|
20
20
|
if (isZodV4SchemaShape(schema)) {
|
|
21
|
-
return useForm$1(
|
|
21
|
+
return useForm$1(
|
|
22
|
+
configuration
|
|
23
|
+
);
|
|
22
24
|
}
|
|
23
|
-
return useForm$2(
|
|
25
|
+
return useForm$2(
|
|
26
|
+
configuration
|
|
27
|
+
);
|
|
24
28
|
}
|
|
25
29
|
|
|
26
30
|
const fieldMeta = fieldMetaStore;
|
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 { StorageShape } from '../zod-v4/types-storage-shape'\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 StorageShape<Schema> extends GenericForm ? StorageShape<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;;ACWO,SAAS,QACd,aAAA,EAgBA;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 * Type-level dispatch happens through a single signature with a\n * union constraint — `Schema extends z.ZodObject |\n * zV3.ZodObject<zV3.ZodRawShape>`. The configuration parameter and\n * return type both dispatch conditionally on whether `Schema` is a\n * v4 or v3 object. The two majors don't structurally satisfy each\n * other's `ZodObject` constraints (v4 has `loose` / `safeExtend` /\n * `def` / `type` members v3 lacks), so neither alone is enough — the\n * union accepts both, and the conditional return type routes through\n * the matching adapter's `StorageShape` / `z.input` / `z.output`.\n *\n * A single signature (rather than overloads) keeps `typeof\n * useForm<X>` instantiation expressions in test code unambiguous:\n * TypeScript's overload-resolution rules for these expressions are\n * brittle when multiple overloads partially match, so we collapse to\n * one signature.\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 type { z as zV3 } from 'zod-v3'\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 { StorageShape as StorageShapeV4 } from '../zod-v4/types-storage-shape'\nimport type { StorageShape as StorageShapeV3 } from '../zod-v3/types-storage-shape'\nimport type { UnwrapZodObject } from '../zod-v3/types-zod-adapter'\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// Per-major projections. Each dispatches a single Schema to the\n// matching adapter's input / output / storage-shape slot. The\n// trailing `never` arms catch the \"other major\" case so an isolated\n// instantiation stays well-formed; the union constraint on the\n// public signature guarantees one arm always fires.\n// ───────────────────────────────────────────────────────────────────\n\ntype FormInput<Schema> = Schema extends z.ZodObject\n ? z.input<Schema> extends GenericForm\n ? z.input<Schema>\n : never\n : Schema extends zV3.ZodObject<zV3.ZodRawShape>\n ? zV3.input<UnwrapZodObject<Schema>> extends GenericForm\n ? zV3.input<UnwrapZodObject<Schema>>\n : never\n : never\n\ntype FormOutput<Schema> = Schema extends z.ZodObject\n ? z.output<Schema> extends GenericForm\n ? z.output<Schema>\n : never\n : Schema extends zV3.ZodObject<zV3.ZodRawShape>\n ? zV3.output<UnwrapZodObject<Schema>> extends GenericForm\n ? zV3.output<UnwrapZodObject<Schema>>\n : never\n : never\n\ntype FormStorageShape<Schema> = Schema extends z.ZodObject\n ? StorageShapeV4<Schema> extends GenericForm\n ? StorageShapeV4<Schema>\n : never\n : Schema extends zV3.ZodObject<zV3.ZodRawShape>\n ? StorageShapeV3<UnwrapZodObject<Schema>> extends GenericForm\n ? StorageShapeV3<UnwrapZodObject<Schema>>\n : never\n : never\n\n// Single unified configuration shape. The outer structure is\n// non-conditional (so TS can resolve it for any Schema satisfying\n// the union constraint, including generic `F extends z.ZodObject`\n// helpers in test code); only the field-level types dispatch on\n// Schema kind via `FormInput` / `FormOutput`. The runtime cast\n// passes the configuration through unchanged — each adapter's own\n// signature absorbs the residual structural drift.\ntype UnifiedConfiguration<Schema> = Omit<\n UseFormConfiguration<\n FormInput<Schema>,\n FormOutput<Schema>,\n AbstractSchema<FormInput<Schema>, FormOutput<Schema>>,\n DeepPartial<DefaultValuesShape<FormInput<Schema>>>\n >,\n 'schema' | 'validateOn' | 'debounceMs'\n> & { schema: Schema } & ValidateOnConfig\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 works transparently for both Zod v3 and Zod v4\n * schemas — the adapter is selected from the schema's shape at both\n * runtime and type-check time. `form.values`, `form.fields`,\n * `register`, and the `handleSubmit` callback data type all resolve\n * against the matching adapter's storage shape; consumers don't need\n * to reach for `attaform/zod-v3` or `attaform/zod-v4` to get full\n * inference. Those subpath entries remain as lean-bundle escape\n * hatches for non-Vite tooling, not correctness escape hatches.\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 | zV3.ZodObject<zV3.ZodRawShape>>(\n configuration: UnifiedConfiguration<Schema>\n): UseFormReturnType<FormInput<Schema>, FormOutput<Schema>, FormStorageShape<Schema>> {\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(\n configuration as Parameters<typeof useFormV4>[0]\n ) as unknown as UseFormReturnType<\n FormInput<Schema>,\n FormOutput<Schema>,\n FormStorageShape<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.\n return useFormV3(\n configuration as Parameters<typeof useFormV3>[0]\n ) as unknown as UseFormReturnType<FormInput<Schema>, FormOutput<Schema>, FormStorageShape<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;;ACyFO,SAAS,QACd,aAAA,EACoF;AAEpF,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,SAAA;AAAA,MACL;AAAA,KACF;AAAA,EAKF;AAKA,EAAA,OAAOC,SAAA;AAAA,IACL;AAAA,GACF;AACF;;AC/HO,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;;;;"}
|