attaform 0.31.0 → 0.31.1

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 (50) hide show
  1. package/dist/abstract.d.mts +5 -5
  2. package/dist/abstract.mjs +4 -4
  3. package/dist/dev/abstract.mjs +4 -4
  4. package/dist/dev/chunks/devtools.mjs +1 -1
  5. package/dist/dev/directive.mjs +1 -1
  6. package/dist/dev/history.mjs +15 -2
  7. package/dist/dev/index.mjs +5 -5
  8. package/dist/dev/runtime/plugins/attaform.mjs +1 -1
  9. package/dist/dev/shared/{attaform-dev.zlvDr0WB.mjs → attaform-dev.04aupFBW.mjs} +3 -2
  10. package/dist/dev/shared/{attaform-dev.y9x9Vp9F.mjs → attaform-dev.3uTCYwy8.mjs} +572 -135
  11. package/dist/dev/shared/{attaform-dev.DJ3nsWw6.mjs → attaform-dev.BpVGFSFa.mjs} +18 -9
  12. package/dist/dev/shared/{attaform-dev.B1q-x9R9.mjs → attaform-dev.Bu6wgrA5.mjs} +1 -1
  13. package/dist/dev/shared/{attaform-dev.k5X47GMD.mjs → attaform-dev.Cbx0AiQF.mjs} +3 -2
  14. package/dist/dev/shared/attaform-dev.CwYTWyPX.mjs +120 -0
  15. package/dist/dev/shared/{attaform-dev.DlaT4xGd.mjs → attaform-dev.D7lKyM_7.mjs} +4 -4
  16. package/dist/dev/shared/{attaform-dev.CtyqGia7.mjs → attaform-dev.OceE0X3v.mjs} +4 -4
  17. package/dist/dev/shared/{attaform-dev.Caibt7sb.mjs → attaform-dev.PTGM9KE1.mjs} +6 -6
  18. package/dist/{shared/attaform.8mfKZCwH.mjs → dev/shared/attaform-dev.n6n00owJ.mjs} +49 -128
  19. package/dist/dev/zod-v3.mjs +6 -6
  20. package/dist/dev/zod-v4.mjs +6 -6
  21. package/dist/dev/zod.mjs +5 -5
  22. package/dist/directive.d.mts +2 -2
  23. package/dist/directive.mjs +1 -1
  24. package/dist/history.d.mts +1 -1
  25. package/dist/history.mjs +15 -2
  26. package/dist/index.d.mts +16 -55
  27. package/dist/index.mjs +5 -5
  28. package/dist/runtime/plugins/attaform.mjs +1 -1
  29. package/dist/shared/{attaform.BWUn8Kjy.mjs → attaform.B5b-HmhH.mjs} +18 -9
  30. package/dist/shared/{attaform.CRVe8s82.d.mts → attaform.B9PYKlhB.d.mts} +43 -19
  31. package/dist/shared/{attaform.DxKQsqFZ.mjs → attaform.BPMOl562.mjs} +3 -2
  32. package/dist/{dev/shared/attaform-dev.CZz4GYZ6.mjs → shared/attaform.BPSqtU7a.mjs} +44 -156
  33. package/dist/shared/{attaform.CdZIEf7_.mjs → attaform.BhtAZysa.mjs} +3 -2
  34. package/dist/shared/{attaform.DAo0QBmS.d.mts → attaform.CYlF4P6X.d.mts} +31 -10
  35. package/dist/shared/{attaform.C4shmwyJ.mjs → attaform.CdA9bfRv.mjs} +1 -1
  36. package/dist/shared/{attaform.DNPJPOO7.mjs → attaform.DAf4ehIe.mjs} +569 -134
  37. package/dist/shared/{attaform.D9RqPgGu.d.mts → attaform.DZOynI6c.d.mts} +1 -1
  38. package/dist/shared/{attaform.L011tHgJ.mjs → attaform.KEfNRDot.mjs} +4 -4
  39. package/dist/shared/attaform._1Zp3mDG.mjs +96 -0
  40. package/dist/shared/{attaform.DZnrDrNb.d.mts → attaform.i13OEHJF.d.mts} +60 -7
  41. package/dist/shared/{attaform.DL2nl_QR.mjs → attaform.j9xI_ObC.mjs} +6 -6
  42. package/dist/shared/{attaform.LUPC-2Qg.mjs → attaform.u6jfHoed.mjs} +4 -4
  43. package/dist/zod-v3.d.mts +4 -4
  44. package/dist/zod-v3.mjs +6 -6
  45. package/dist/zod-v4.d.mts +15 -11
  46. package/dist/zod-v4.mjs +6 -6
  47. package/dist/zod.d.mts +4 -4
  48. package/dist/zod.mjs +5 -5
  49. package/package.json +2 -1
  50. package/skills/attaform/SKILL.md +1 -0
package/dist/index.d.mts CHANGED
@@ -1,55 +1,15 @@
1
- export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.DAo0QBmS.mjs';
2
- import { G as GenericForm, F as FormKey, U as UseFormConfiguration, ap as AcceptableDefaults, ab as ValidateOnConfig, a as UseFormReturnType, D as DefaultValuesInput, h as FieldMetaPayload } from './shared/attaform.DZnrDrNb.mjs';
1
+ export { a as AnyForm, b as AttaformDevtoolsBridge, c as AttaformError, d as AttaformErrorCode, e as AttaformPluginOptions, A as AttaformRegistry, C as CompiledStep, D as DEVTOOLS_WINDOW_KEY, F as FormStatus, f as FormStatusSeed, G as GateMarker, I as InjectWizardInput, g as InvalidPathError, h as InvalidUseFormConfigError, L as LazyMarker, O as OutsideSetupError, R as RegistryNotInstalledError, i as ReservedFormKeyError, S as SerializedAttaformState, j as SerializedFormData, k as StepSlot, l as SubmitErrorHandlerError, U as UseRegisterOptions, m as UseRegisterReturn, n as UseWizardReturnType, W as WizardAggregateError, o as WizardCtx, p as WizardCtxForm, q as WizardOnError, r as WizardOnSubmit, s as WizardOptions, t as WizardPersistFn, u as WizardRestoreFn, v as WizardRestoreState, w as WizardStatusesProxy, x as WizardSubmitContext, y as assignKey, z as createAttaform, B as createRegistry, E as escapeForInlineScript, H as gate, J as getRegistryFromApp, K as hydrateAttaformState, M as injectForm, N as injectWizard, P as isRegisterValue, Q as kAttaformRegistry, T as lazy, V as renderAttaformState, X as useRegister, Y as useRegistry, Z as useWizard } from './shared/attaform.CYlF4P6X.mjs';
2
+ import { G as GenericForm, F as FormKey, U as UseFormConfiguration, ap as AcceptableDefaults, ab as ValidateOnConfig, a as UseFormReturnType, D as DefaultValuesInput, h as FieldMetaPayload } from './shared/attaform.i13OEHJF.mjs';
3
3
  import { AbstractSchema } from './abstract.mjs';
4
- export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, aa as ValidateOn, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.DZnrDrNb.mjs';
5
- export { v as vRegister } from './shared/attaform.D9RqPgGu.mjs';
6
- import { S as SupportedRootSchema, b as StorageShape } from './shared/attaform.CRVe8s82.mjs';
7
- export { P as PathInput, a as PathOutput } from './shared/attaform.CRVe8s82.mjs';
4
+ export { b as ArrayItem, c as ArrayPath, C as CustomDirectiveRegisterAssignerFn, d as DeepPartial, e as DefaultValuesShape, f as DisplayState, E as ErrorInput, g as ErrorsProxyShape, i as FieldState, j as FieldStateMap, k as FieldStateMapEntry, l as FlatPath, m as FormErrorRecord, n as FormErrorsSurface, o as FormMeta, H as HandleSubmit, p as HistoryPlugin, I as IsTuple, q as IsUnion, J as JoinSegments, r as Json, K as KeyofUnion, L as LiftedValueShape, M as MetaTrackerValue, N as NestedReadType, s as NestedType, O as OnError, t as OnSubmit, P as ParseOptions, u as PartialFlatPath, v as Path, w as PathKey, x as PendingValidationStatus, y as Primitive, R as ROOT_PATH, z as ROOT_PATH_KEY, B as ReactiveValidationStatus, Q as RecordPath, S as RecordValue, T as RegisterDirective, V as RegisterFlatPath, W as RegisterOptions, X as RegisterSelectModifier, Y as RegisterTextModifier, Z as RegisterTransform, _ as RegisterValue, $ as SchemaParseErrorWithData, a0 as SchemaParseErrorWithoutData, a1 as SchemaParseResult, a2 as SchemaParseSuccess, a3 as Segment, a4 as SetValueCallback, a5 as SetValuePayload, a6 as SettledValidationStatus, a7 as SlimPrimitiveKind, a8 as SubmitHandler, a9 as Unset, aa as ValidateOn, ac as ValidationError, ad as ValidationResponse, ae as ValidationResponseWithoutValue, af as ValueOfUnion, ag as WriteMeta, ah as WriteShape, ai as canonicalizePath, aj as isPathPrefix, ak as isUnset, al as parseDottedPath, am as unset } from './shared/attaform.i13OEHJF.mjs';
5
+ export { v as vRegister } from './shared/attaform.DZOynI6c.mjs';
6
+ import { S as SupportedRootSchema, b as StorageShape } from './shared/attaform.B9PYKlhB.mjs';
7
+ export { P as PathInput, a as PathOutput } from './shared/attaform.B9PYKlhB.mjs';
8
8
  import { S as SupportedRootSchema$1, a as StorageShape$1 } from './shared/attaform.B-Tb62qV.mjs';
9
9
  import { UnwrapZodRoot } from './zod-v3.mjs';
10
10
  import { z } from 'zod';
11
11
  import 'vue';
12
12
 
13
- /**
14
- * Type-level Zod-major discriminator for the unified `attaform/zod`
15
- * entry. The runtime dispatch (`use-form.ts`'s impl) already routes on
16
- * the schema's shape via `isZodV4SchemaShape`; this is the type-level
17
- * mirror so the overloads and projection helpers discriminate the same
18
- * way.
19
- *
20
- * Why a structural marker instead of `z.ZodObject`: the unified entry's
21
- * overloads constrain on `z.ZodObject`, but the published `.d.mts`
22
- * resolves `z` against whichever single Zod major the consumer
23
- * installed. In a v3-only install `z.ZodObject` is v3's `ZodObject`
24
- * (and, lacking its required type arguments, degrades to an `any`-like
25
- * error type under `skipLibCheck`), so a v3 schema satisfies the v4
26
- * overload's constraint and binds it, collapsing the read slot to
27
- * `never`. A Zod v4 schema carries the `_zod` internals brand; a v3
28
- * schema never does.
29
- * Intersecting a v4-only constraint or conditional branch with this
30
- * marker keeps it unreachable for a v3 schema regardless of how `zod`
31
- * resolves, so v3 schemas fall through to the v3 overload.
32
- *
33
- * Distinct from `core/zod-shape.ts`'s runtime `ZodV4Shape` (which reads
34
- * the public `def` getter): at the type level the stable v4 brand is
35
- * `_zod.def`, the same internals `StorageShape` (v4) already reads.
36
- *
37
- * Pairing requirement: a v4 overload/branch must constrain on
38
- * `z.ZodObject<z.ZodRawShape> & ZodV4Internals`, NOT bare
39
- * `z.ZodObject & ZodV4Internals`. In a v3-only install `z.ZodObject`
40
- * with no type argument is `ZodObject<T, ...>` missing its required
41
- * arguments, an error type that behaves like `any` under
42
- * `skipLibCheck`, so `any & ZodV4Internals` collapses back to `any` and
43
- * the marker stops excluding v3 schemas. Supplying `z.ZodRawShape`
44
- * keeps it a concrete object type in both majors, so the intersection
45
- * stays meaningful.
46
- */
47
- type ZodV4Internals = {
48
- _zod: {
49
- def: unknown;
50
- };
51
- };
52
-
53
13
  /**
54
14
  * Per-major projection helpers shared by the unified `attaform/zod`
55
15
  * entry. Each maps an arbitrary Zod v4 OR v3 object schema to the
@@ -101,12 +61,13 @@ type V3ReadOf<S extends SupportedRootSchema$1> = StorageShape$1<UnwrapZodRoot<S>
101
61
  * const form = useForm({ schema })
102
62
  * ```
103
63
  *
104
- * The constraint intersects `ZodV4Internals`, the v4-only `_zod` brand,
105
- * so a v3 schema cannot bind this overload even where `z` resolves to v3
106
- * in a single-major install; it falls through to the v3 overload below.
107
- * See `types-zod-major.ts`.
64
+ * The constraint is structural on Zod's core `_zod` internals. A
65
+ * `zod/mini` schema binds it as its classic twin does, and a v3 schema,
66
+ * which carries no `_zod`, cannot bind it even where `zod` resolves to v3
67
+ * in a single-major install, so it falls through to the v3 overload
68
+ * below. See `SupportedRootSchema` in `../zod-v4/types-root.ts`.
108
69
  */
109
- declare function useForm<Schema extends SupportedRootSchema & ZodV4Internals, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, never, K>, 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'> & {
70
+ declare function useForm<Schema extends SupportedRootSchema, K extends FormKey = FormKey>(configuration: Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, never, K>, 'schema' | 'validateOn' | 'debounceMs' | 'defaultValues'> & {
110
71
  schema: Schema;
111
72
  defaultValues?: AcceptableDefaults<V4FormOf<Schema>, V4SchemaInput<Schema>>;
112
73
  } & ValidateOnConfig): UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
@@ -158,11 +119,11 @@ declare function useForm<Schema extends SupportedRootSchema$1, K extends FormKey
158
119
  * cleanly under a generic constraint because no conditional
159
120
  * is present.
160
121
  */
161
- type UseFormReturnV4<Schema extends z.ZodObject, K extends FormKey = FormKey> = UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
122
+ type UseFormReturnV4<Schema extends SupportedRootSchema, K extends FormKey = FormKey> = UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K>;
162
123
  /**
163
124
  * Direct V4 configuration projection. Mirrors `UseFormReturnV4`.
164
125
  */
165
- type UseFormConfigV4<Schema extends z.ZodObject, K extends FormKey = FormKey> = Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
126
+ type UseFormConfigV4<Schema extends SupportedRootSchema, K extends FormKey = FormKey> = Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
166
127
  schema: Schema;
167
128
  } & ValidateOnConfig;
168
129
  /**
@@ -190,13 +151,13 @@ type UseFormConfigV3<Schema extends z.ZodObject<z.ZodRawShape>, K extends FormKe
190
151
  * under a generic constraint, so this helper's dispatch stays deferred
191
152
  * and return-type compatibility cannot be proven.
192
153
  */
193
- type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema & ZodV4Internals ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends SupportedRootSchema$1 ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
154
+ type UseFormReturn<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema ? UseFormReturnType<V4FormOf<Schema>, V4OutOf<Schema>, V4ReadOf<Schema>, K> : Schema extends SupportedRootSchema$1 ? UseFormReturnType<V3FormOf<Schema>, V3OutOf<Schema>, V3ReadOf<Schema>, K> : never;
194
155
  /**
195
156
  * The configuration parameter shape of `useForm` for a given Zod
196
157
  * schema. Same dispatch as `UseFormReturn`; it replaces
197
158
  * `Parameters<typeof useForm<Schema, K>>[0]` in test code.
198
159
  */
199
- type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema & ZodV4Internals ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
160
+ type UseFormConfig<Schema, K extends FormKey = FormKey> = Schema extends SupportedRootSchema ? Omit<UseFormConfiguration<V4FormOf<Schema>, V4OutOf<Schema>, AbstractSchema<V4FormOf<Schema>, V4OutOf<Schema>>, DefaultValuesInput<V4FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
200
161
  schema: Schema;
201
162
  } & ValidateOnConfig : Schema extends SupportedRootSchema$1 ? Omit<UseFormConfiguration<V3FormOf<Schema>, V3OutOf<Schema>, AbstractSchema<V3FormOf<Schema>, V3OutOf<Schema>>, DefaultValuesInput<V3FormOf<Schema>>, K>, 'schema' | 'validateOn' | 'debounceMs'> & {
202
163
  schema: Schema;
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.CdZIEf7_.mjs';
2
- export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform.DNPJPOO7.mjs';
3
- export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.C4shmwyJ.mjs';
4
- export { a as assignKey, v as vRegister } from './shared/attaform.DxKQsqFZ.mjs';
5
- export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.L011tHgJ.mjs';
1
+ export { A as AttaformError, I as InvalidPathError, a as InvalidUseFormConfigError, O as OutsideSetupError, R as ROOT_PATH, b as ROOT_PATH_KEY, c as RegistryNotInstalledError, d as ReservedFormKeyError, S as SubmitErrorHandlerError, e as canonicalizePath, i as isPathPrefix, p as parseDottedPath } from './shared/attaform.BhtAZysa.mjs';
2
+ export { A as AttaformErrorCode, e as escapeForInlineScript, g as gate, i as injectForm, a as injectWizard, b as isUnset, l as lazy, u as unset, d as useRegister, f as useWizard } from './shared/attaform.DAf4ehIe.mjs';
3
+ export { D as DEVTOOLS_WINDOW_KEY, c as createAttaform, a as createRegistry, g as getRegistryFromApp, h as hydrateAttaformState, k as kAttaformRegistry, r as renderAttaformState, u as useRegistry } from './shared/attaform.CdA9bfRv.mjs';
4
+ export { a as assignKey, v as vRegister } from './shared/attaform.BPMOl562.mjs';
5
+ export { f as fieldMeta, u as useForm, w as withMeta } from './shared/attaform.KEfNRDot.mjs';
6
6
  export { i as isRegisterValue } from './shared/attaform.KvlEedlF.mjs';
@@ -1,5 +1,5 @@
1
1
  import { defineNuxtPlugin, useRuntimeConfig, useRoute } from 'nuxt/app';
2
- import { c as createAttaform, b as kAttaformWizardActiveStepResolver, r as renderAttaformState, h as hydrateAttaformState, g as getRegistryFromApp, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform.C4shmwyJ.mjs';
2
+ import { c as createAttaform, b as kAttaformWizardActiveStepResolver, r as renderAttaformState, h as hydrateAttaformState, g as getRegistryFromApp, D as DEVTOOLS_WINDOW_KEY } from '../../shared/attaform.CdA9bfRv.mjs';
3
3
 
4
4
  var attaform_default = defineNuxtPlugin({
5
5
  // `enforce: 'pre'` makes the "we run before any component's setup" claim
@@ -1,7 +1,7 @@
1
- import { j as humanize, c as useAbstractForm } from './attaform.DNPJPOO7.mjs';
2
- import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.CdZIEf7_.mjs';
3
- import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform.DL2nl_QR.mjs';
4
- import { c as callConsumerFn } from './attaform.8mfKZCwH.mjs';
1
+ import { j as humanize, c as useAbstractForm } from './attaform.DAf4ehIe.mjs';
2
+ import { A as AttaformError, e as canonicalizePath, a as InvalidUseFormConfigError } from './attaform.BhtAZysa.mjs';
3
+ import { s as slimPrimitivesWalk, d as deriveDefaultWalk, m as mergeDeep, f as fixStructuralDefaults, w as walkPathSegments, c as createAbstractSchema, a as createSharedSchemaStore, b as buildFieldMetaPathMap, e as getFieldMetaListForSchema, g as getFieldMetaForSchema } from './attaform.j9xI_ObC.mjs';
4
+ import { d as callConsumerFn } from './attaform._1Zp3mDG.mjs';
5
5
 
6
6
  function readDef(schema) {
7
7
  if (schema === null || typeof schema !== "object") return void 0;
@@ -179,6 +179,9 @@ function getDiscriminatedOptions(schema) {
179
179
  return Array.isArray(options) ? options : [];
180
180
  }
181
181
  function assertZodVersion(schema) {
182
+ assertZodV4Node(schema);
183
+ }
184
+ function assertZodV4Node(schema) {
182
185
  const def = readDef(schema);
183
186
  if (def?.type === void 0) {
184
187
  throw new Error(
@@ -237,7 +240,7 @@ function walkCapabilities(node, capabilities, visited) {
237
240
  if (def === void 0) return;
238
241
  const checks = getChecks(node);
239
242
  if (checks.some(isAsyncCheck)) capabilities.asyncRefine = true;
240
- if (checks.length > 0 && CONTAINER_SLOTS.some((key) => def[key] !== void 0)) {
243
+ if (checks.some(isVerdictCheck) && CONTAINER_SLOTS.some((key) => def[key] !== void 0)) {
241
244
  capabilities.containerOrRootRefine = true;
242
245
  }
243
246
  if (typeof def.transform === "function" && def.transform.constructor.name === "AsyncFunction") {
@@ -259,6 +262,11 @@ function walkCapabilities(node, capabilities, visited) {
259
262
  }
260
263
  }
261
264
  }
265
+ function isVerdictCheck(check) {
266
+ if (typeof check !== "object" || check === null) return true;
267
+ const kind = check._zod?.def?.check;
268
+ return kind !== "describe" && kind !== "meta";
269
+ }
262
270
  function isAsyncCheck(check) {
263
271
  if (typeof check !== "object" || check === null) return false;
264
272
  const c = check;
@@ -315,9 +323,9 @@ function zodIssuesToValidationErrors(issues) {
315
323
 
316
324
  const V4_INTROSPECTOR = {
317
325
  kindOf: (schema) => kindOf(schema),
318
- getObjectShape: (schema) => getObjectShape(schema),
326
+ getObjectShape,
319
327
  getTupleItems,
320
- getDiscriminatedOptions: (schema) => getDiscriminatedOptions(schema),
328
+ getDiscriminatedOptions,
321
329
  getDiscriminator,
322
330
  getLiteralValues,
323
331
  isPreprocessNode,
@@ -481,7 +489,7 @@ function isLeafRequired(schema, depth = 0) {
481
489
  return true;
482
490
  }
483
491
  function zodV4Adapter(rootSchema) {
484
- assertZodVersion(rootSchema);
492
+ assertZodV4Node(rootSchema);
485
493
  assertKeyedRoot(rootSchema);
486
494
  return (_formKey, options) => sharedV4Schemas(
487
495
  rootSchema,
@@ -602,7 +610,8 @@ function resolveFieldMetaAtPath(rootSchema, path, maxRecursionDepth) {
602
610
  };
603
611
  }
604
612
  function readDescription(schema) {
605
- const candidate = schema.description;
613
+ const scope = globalThis;
614
+ const candidate = scope.__zod_globalRegistry?.get(schema)?.description ?? schema.description;
606
615
  return typeof candidate === "string" ? candidate : void 0;
607
616
  }
608
617
 
@@ -1,6 +1,23 @@
1
1
  import { z } from 'zod';
2
- import { G as GenericForm, l as FlatPath, s as NestedType, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, ap as AcceptableDefaults, ab as ValidateOnConfig, a as UseFormReturnType } from './attaform.DZnrDrNb.mjs';
2
+ import { G as GenericForm, l as FlatPath, s as NestedType, F as FormKey, U as UseFormConfiguration, A as AbstractSchema, ap as AcceptableDefaults, ab as ValidateOnConfig, a as UseFormReturnType } from './attaform.i13OEHJF.mjs';
3
3
 
4
+ /**
5
+ * A Zod v4 schema whose core definition matches `Def`, named by the
6
+ * `_zod` internals that classic `zod` and `zod/mini` schemas both carry.
7
+ */
8
+ type ZodV4SchemaOf<Def> = {
9
+ _zod: {
10
+ def: Def;
11
+ };
12
+ };
13
+ /**
14
+ * Any Zod v4 schema, from `zod` or `zod/mini`. The public signatures that
15
+ * take a v4 schema below the root (`PathInput`, `PathOutput`, `withMeta`)
16
+ * constrain on it, for the reasons `SupportedRootSchema` gives.
17
+ */
18
+ type ZodV4Schema = ZodV4SchemaOf<{
19
+ type: string;
20
+ }>;
4
21
  /**
5
22
  * The Zod v4 schema roots `useForm` accepts. A fixed-shape
6
23
  * `z.object({ … })` is the common case; `z.record(K, V)` admits a
@@ -16,22 +33,29 @@ import { G as GenericForm, l as FlatPath, s as NestedType, F as FormKey, U as Us
16
33
  * `z.map` / `z.set`) are not form roots; wrap them under a key. The
17
34
  * adapter's runtime construction rejects them with a legible error.
18
35
  *
19
- * `z.ZodObject` MUST keep its `z.ZodRawShape` argument, and the
20
- * discriminated-union arm MUST stay fully applied. The unified entry's
21
- * v4 overload constrains on `SupportedRootSchema & ZodV4Internals` to
22
- * keep v3 schemas out (see `../unified/types-zod-major.ts`). In a
23
- * single-major (v3-only) consumer install, the published `.d.mts`
24
- * resolves this `z` to v3, where a bare or under-applied Zod class is
25
- * missing its required arguments and degrades to an `any`-like error
26
- * type; `any` then absorbs the union and `any & ZodV4Internals`
27
- * collapses back to `any`, so the marker stops excluding v3 schemas and
28
- * the read slot poisons to `never`. `z.ZodRecord` carries defaults for
29
- * both arguments, so it stays concrete in either major.
30
- * `z.ZodDiscriminatedUnion` does NOT (v3 requires both arguments, and
31
- * its parameter order is the reverse of v4's), so the arm is written
32
- * fully applied; the v3-only bundled-types fixture guards it.
36
+ * Each arm is structural on `_zod.def.type`, Zod's core internals, so a
37
+ * `zod/mini` root binds exactly as its classic twin does, and the form
38
+ * types project through `z.input` / `z.output`, which are core's too. A
39
+ * plain union's `def` has no `discriminator`, which keeps it out of the
40
+ * third arm.
41
+ *
42
+ * The alias names nothing from `zod`, and the unified `attaform/zod`
43
+ * entry depends on that. Its published `.d.mts` resolves `zod` against
44
+ * the one major a consumer installed, and in a v3-only install a classic
45
+ * class reference such as `z.ZodObject` degrades to an `any`-like error
46
+ * type, which a v3 schema satisfies: the v4 overload would capture it and
47
+ * collapse its read slot to `never`. No v3 schema carries `_zod`, so this
48
+ * constraint sends every v3 schema to the v3 overload however `zod`
49
+ * resolves. The v3-only bundled-types fixture guards it.
33
50
  */
34
- type SupportedRootSchema = z.ZodObject<z.ZodRawShape> | z.ZodRecord | z.ZodDiscriminatedUnion<readonly z.ZodObject<z.ZodRawShape>[], string>;
51
+ type SupportedRootSchema = ZodV4SchemaOf<{
52
+ type: 'object';
53
+ }> | ZodV4SchemaOf<{
54
+ type: 'record';
55
+ }> | ZodV4SchemaOf<{
56
+ type: 'union';
57
+ discriminator: string;
58
+ }>;
35
59
 
36
60
  /**
37
61
  * The shape `form.values.<key>` returns at runtime. Four cases per leaf:
@@ -164,7 +188,7 @@ type StorageLeaf<L> = InputIsUnknown<L> extends true ? unknown : L extends {
164
188
  * type FlagWriteIn = PathInput<typeof schema, 'flag'> // string
165
189
  * ```
166
190
  */
167
- type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema> extends GenericForm ? Path extends FlatPath<z.input<Schema>> ? NestedType<z.input<Schema>, Path> : never : never;
191
+ type PathInput<Schema extends ZodV4Schema, Path extends string> = z.input<Schema> extends GenericForm ? Path extends FlatPath<z.input<Schema>> ? NestedType<z.input<Schema>, Path> : never : never;
168
192
  /**
169
193
  * What `Path` holds after the full parse pipeline: the schema's
170
194
  * `z.output<Schema>` shape there. It matches `form.parse()`'s `data` and
@@ -177,7 +201,7 @@ type PathInput<Schema extends z.ZodType, Path extends string> = z.input<Schema>
177
201
  * type FlagParsedOut = PathOutput<typeof schema, 'flag'> // boolean
178
202
  * ```
179
203
  */
180
- type PathOutput<Schema extends z.ZodType, Path extends string> = z.output<Schema> extends GenericForm ? Path extends FlatPath<z.output<Schema>> ? NestedType<z.output<Schema>, Path> : never : never;
204
+ type PathOutput<Schema extends ZodV4Schema, Path extends string> = z.output<Schema> extends GenericForm ? Path extends FlatPath<z.output<Schema>> ? NestedType<z.output<Schema>, Path> : never : never;
181
205
  /**
182
206
  * Factor the three identical-shape conditionals out of `useForm`'s public
183
207
  * signature, so the bundled `.d.ts` carries one alias per shape instead
@@ -217,4 +241,4 @@ declare function useForm<Schema extends SupportedRootSchema, K extends FormKey =
217
241
  } & ValidateOnConfig): UseFormReturnType<FormOf<Schema>, OutOf<Schema>, ReadOf<Schema>, K>;
218
242
 
219
243
  export { useForm as u };
220
- export type { PathInput as P, SupportedRootSchema as S, PathOutput as a, StorageShape as b };
244
+ export type { PathInput as P, SupportedRootSchema as S, ZodV4Schema as Z, PathOutput as a, StorageShape as b };
@@ -1,6 +1,7 @@
1
1
  import { toRaw, reactive, markRaw, effectScope, watch, nextTick } from 'vue';
2
2
  import { i as isRegisterValue, a as isTransforming, S as SSR_COMPONENT_HOST_MODIFIER, R as REGISTER_OWNER_MARKER, b as V_REGISTER_MARKER } from './attaform.KvlEedlF.mjs';
3
- import { e as canonicalizePath } from './attaform.CdZIEf7_.mjs';
3
+ import { e as canonicalizePath } from './attaform.BhtAZysa.mjs';
4
+ import { e as safeOwnHas } from './attaform._1Zp3mDG.mjs';
4
5
 
5
6
  function activeElementOf(node) {
6
7
  const rootNode = node.getRootNode();
@@ -304,7 +305,7 @@ function createHostChannel() {
304
305
  return commit(rv, value, modifiers);
305
306
  },
306
307
  writeInput(rv, payload, modifiers) {
307
- if (typeof payload !== "object" || payload === null || payload instanceof Event || !("value" in payload) || !Object.hasOwn(payload, "value")) {
308
+ if (typeof payload !== "object" || payload === null || payload instanceof Event || !("value" in payload) || !safeOwnHas(payload, "value")) {
308
309
  return false;
309
310
  }
310
311
  return rv.setValueFromHost(payload.value, modifiers);
@@ -1,4 +1,5 @@
1
- import { m as mapSegmentKeys, f as pathsEqual, i as isPathPrefix } from './attaform-dev.zlvDr0WB.mjs';
1
+ import { s as safeAssign, a as safeOwnRead, r as readConsumerIndex, c as consumerKeys, b as readConsumerProp } from './attaform._1Zp3mDG.mjs';
2
+ import { m as mapSegmentKeys, f as pathsEqual, i as isPathPrefix } from './attaform.BhtAZysa.mjs';
2
3
 
3
4
  const DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS = 0;
4
5
  const DEFAULT_HISTORY_MAX_SNAPSHOTS = 128;
@@ -9,11 +10,6 @@ const DEFAULT_MAX_RECURSION_DEPTH = 64;
9
10
  function normalizeNumericOption(config) {
10
11
  const { value, source, min, defaultValue } = config;
11
12
  if (typeof value !== "number" || !Number.isFinite(value)) {
12
- {
13
- console.warn(
14
- `[attaform] ${source} must be a non-negative finite integer; got ${String(value)}. Falling back to ${String(defaultValue)}.`
15
- );
16
- }
17
13
  return defaultValue;
18
14
  }
19
15
  return Math.max(min, Math.floor(value));
@@ -26,124 +22,6 @@ function pickDefined(bag) {
26
22
  return out;
27
23
  }
28
24
 
29
- const reported = /* @__PURE__ */ new Set() ;
30
- function reportConsumerThrow(site, detail, err) {
31
- const key = detail === void 0 ? site : `${site}|${detail}`;
32
- if (reported === null || reported.has(key)) return;
33
- reported.add(key);
34
- const at = detail === void 0 ? "" : ` at \`${detail}\``;
35
- const advice = {
36
- "default-factory": "a `.default(() => ...)` factory threw. Attaform used `undefined` for that field's initial value.",
37
- "catch-factory": "a `.catch(() => ...)` fallback threw. Attaform used `undefined` for that value.",
38
- "lazy-getter": "a `z.lazy(() => ...)` factory threw. Attaform stopped descending at that node, so paths below it will not resolve.",
39
- "wizard-slot": `a function step slot threw${at}. Attaform dropped that step from the compiled list; the rest of the flow still navigates.`,
40
- "wizard-lazy-slot": `a \`lazy()\` step resolver threw${at}. Attaform dropped that step from the compiled list until the resolver's own dependencies change.`,
41
- "wizard-progress": "a `useWizard({ progress })` override threw. Attaform fell back to its own valid-step ratio.",
42
- "wizard-restore": "a `useWizard({ restore })` callback threw. Attaform read no step from it, so the wizard stays where it is.",
43
- "wizard-persist": "a `useWizard({ persist })` callback threw. Attaform navigated anyway, so the step is live but unrecorded.",
44
- "wizard-default-statuses": "a `useWizard({ defaultStatuses })` factory threw or rejected. Attaform seeded no statuses, the same as omitting the option."
45
- };
46
- console.error(
47
- `[attaform] ${advice[site]} Attaform has nowhere to surface this, so it must not throw; wrap your own try/catch if the failure is recoverable. Original error:`,
48
- err
49
- );
50
- }
51
- function callConsumerFn(fn, fallback, site, detail) {
52
- try {
53
- return fn();
54
- } catch (err) {
55
- reportConsumerThrow(site, detail, err);
56
- return fallback;
57
- }
58
- }
59
- function readConsumerProp(obj, key) {
60
- try {
61
- return obj[key];
62
- } catch {
63
- return void 0;
64
- }
65
- }
66
- function consumerKeys(obj) {
67
- try {
68
- return Object.keys(obj);
69
- } catch {
70
- return [];
71
- }
72
- }
73
- function readConsumerIndex(arr, i) {
74
- try {
75
- return arr[i];
76
- } catch {
77
- return void 0;
78
- }
79
- }
80
- function consumerSymbolKeys(obj) {
81
- try {
82
- return Object.getOwnPropertySymbols(obj);
83
- } catch {
84
- return [];
85
- }
86
- }
87
- function consumerHas(obj, key) {
88
- try {
89
- return key in obj;
90
- } catch {
91
- return false;
92
- }
93
- }
94
-
95
- function safeAssign(target, key, value) {
96
- if (key === "__proto__") {
97
- Object.defineProperty(target, key, {
98
- value,
99
- writable: true,
100
- enumerable: true,
101
- configurable: true
102
- });
103
- return;
104
- }
105
- target[key] = value;
106
- }
107
- const SHADOWED_KEYS = new Set(Object.getOwnPropertyNames(Object.prototype));
108
- function isShadowedKey(key) {
109
- return SHADOWED_KEYS.has(key);
110
- }
111
- function safeOwnRead(target, key) {
112
- if (isShadowedKey(key)) {
113
- const desc = Object.getOwnPropertyDescriptor(target, key);
114
- if (desc === void 0) return void 0;
115
- return "value" in desc ? desc.value : readConsumerProp(target, key);
116
- }
117
- return readConsumerProp(target, key);
118
- }
119
- function safeOwnHas(target, key) {
120
- try {
121
- return Object.prototype.hasOwnProperty.call(target, key);
122
- } catch {
123
- return false;
124
- }
125
- }
126
- function spreadConsumerRecord(src) {
127
- try {
128
- return { ...src };
129
- } catch {
130
- const out = {};
131
- for (const key of Object.keys(src)) {
132
- safeAssign(out, key, readConsumerProp(src, key));
133
- }
134
- return out;
135
- }
136
- }
137
- function copyConsumerArray(src) {
138
- try {
139
- return src.slice();
140
- } catch {
141
- const out = new Array(src.length);
142
- for (let i = 0; i < src.length; i++) out[i] = readConsumerIndex(src, i);
143
- return out;
144
- }
145
- }
146
-
147
25
  function isDescendable(value) {
148
26
  if (value === null || typeof value !== "object") return false;
149
27
  if (Array.isArray(value)) return true;
@@ -151,6 +29,9 @@ function isDescendable(value) {
151
29
  const proto = Object.getPrototypeOf(value);
152
30
  return proto === null || proto === Object.prototype;
153
31
  }
32
+ function isBarePatch(patch) {
33
+ return patch.kind === "added" ? isDescendable(patch.newValue) : patch.kind === "removed" && isDescendable(patch.oldValue);
34
+ }
154
35
  function appendSegment(prefix, segment) {
155
36
  const next = new Array(prefix.length + 1);
156
37
  for (let i = 0; i < prefix.length; i++) {
@@ -165,11 +46,11 @@ function diffAndApply(oldValue, newValue, prefix, visit) {
165
46
  const oldIsDescendable = isDescendable(oldValue);
166
47
  const newIsDescendable = isDescendable(newValue);
167
48
  if (oldValue === void 0 && newIsDescendable) {
168
- walkNewDescendable(newValue, prefix, visit);
49
+ walkDescendable(newValue, prefix, visit, true);
169
50
  return;
170
51
  }
171
52
  if (oldIsDescendable && newValue === void 0) {
172
- walkOldDescendable(oldValue, prefix, visit);
53
+ walkDescendable(oldValue, prefix, visit, false);
173
54
  return;
174
55
  }
175
56
  if (oldIsDescendable && newIsDescendable) {
@@ -219,50 +100,51 @@ function diffAndApply(oldValue, newValue, prefix, visit) {
219
100
  }
220
101
  visit({ kind: "changed", path: prefix, oldValue, newValue });
221
102
  }
222
- function walkNewDescendable(newValue, prefix, visit) {
223
- if (Array.isArray(newValue)) {
224
- for (let i = 0; i < newValue.length; i++) {
225
- diffAndApply(void 0, readConsumerIndex(newValue, i), appendSegment(prefix, i), visit);
103
+ function walkDescendable(value, prefix, visit, arrived) {
104
+ let reported = false;
105
+ if (Array.isArray(value)) {
106
+ for (let i = 0; i < value.length; i++) {
107
+ diffSlot(readConsumerIndex(value, i), appendSegment(prefix, i), visit, arrived);
226
108
  }
227
- } else if (newValue instanceof Map) {
228
- for (const [key, entry] of newValue) {
229
- diffAndApply(void 0, entry, appendSegment(prefix, key), visit);
109
+ reported = value.length > 0;
110
+ } else if (value instanceof Map) {
111
+ for (const [key, entry] of value) {
112
+ diffSlot(entry, appendSegment(prefix, key), visit, arrived);
230
113
  }
114
+ reported = value.size > 0;
231
115
  } else {
232
- const rec = newValue;
116
+ const rec = value;
233
117
  for (const k of consumerKeys(rec)) {
234
- diffAndApply(void 0, readConsumerProp(rec, k), appendSegment(prefix, k), visit);
118
+ const entry = readConsumerProp(rec, k);
119
+ if (entry === void 0) continue;
120
+ reported = true;
121
+ if (arrived) diffAndApply(void 0, entry, appendSegment(prefix, k), visit);
122
+ else diffAndApply(entry, void 0, appendSegment(prefix, k), visit);
235
123
  }
236
124
  }
125
+ if (!reported) visit(presencePatch(arrived, prefix, value));
237
126
  }
238
- function walkOldDescendable(oldValue, prefix, visit) {
239
- if (Array.isArray(oldValue)) {
240
- for (let i = 0; i < oldValue.length; i++) {
241
- diffAndApply(readConsumerIndex(oldValue, i), void 0, appendSegment(prefix, i), visit);
242
- }
243
- } else if (oldValue instanceof Map) {
244
- for (const [key, entry] of oldValue) {
245
- diffAndApply(entry, void 0, appendSegment(prefix, key), visit);
246
- }
247
- } else {
248
- const rec = oldValue;
249
- for (const k of consumerKeys(rec)) {
250
- diffAndApply(readConsumerProp(rec, k), void 0, appendSegment(prefix, k), visit);
251
- }
252
- }
127
+ function diffSlot(entry, path, visit, arrived) {
128
+ if (entry === void 0) visit(presencePatch(arrived, path, entry));
129
+ else if (arrived) diffAndApply(void 0, entry, path, visit);
130
+ else diffAndApply(entry, void 0, path, visit);
131
+ }
132
+ function presencePatch(arrived, path, value) {
133
+ return arrived ? { kind: "added", path, newValue: value } : { kind: "removed", path, oldValue: value };
253
134
  }
254
135
  function diffMapsLockstep(oldMap, newMap, prefix, visit) {
255
136
  for (const [key, entry] of newMap) {
256
- diffAndApply(oldMap.get(key), entry, appendSegment(prefix, key), visit);
137
+ const path = appendSegment(prefix, key);
138
+ if (oldMap.has(key)) diffAndApply(oldMap.get(key), entry, path, visit);
139
+ else diffSlot(entry, path, visit, true);
257
140
  }
258
141
  for (const [key, entry] of oldMap) {
259
- if (newMap.has(key)) continue;
260
- diffAndApply(entry, void 0, appendSegment(prefix, key), visit);
142
+ if (!newMap.has(key)) diffSlot(entry, appendSegment(prefix, key), visit, false);
261
143
  }
262
144
  }
263
145
  function diffArraysLockstep(oldArr, newArr, prefix, visit) {
264
- const max = Math.max(oldArr.length, newArr.length);
265
- for (let i = 0; i < max; i++) {
146
+ const min = Math.min(oldArr.length, newArr.length);
147
+ for (let i = 0; i < min; i++) {
266
148
  diffAndApply(
267
149
  readConsumerIndex(oldArr, i),
268
150
  readConsumerIndex(newArr, i),
@@ -270,6 +152,12 @@ function diffArraysLockstep(oldArr, newArr, prefix, visit) {
270
152
  visit
271
153
  );
272
154
  }
155
+ for (let i = min; i < newArr.length; i++) {
156
+ diffSlot(readConsumerIndex(newArr, i), appendSegment(prefix, i), visit, true);
157
+ }
158
+ for (let i = min; i < oldArr.length; i++) {
159
+ diffSlot(readConsumerIndex(oldArr, i), appendSegment(prefix, i), visit, false);
160
+ }
273
161
  }
274
162
  function diffObjectsLockstep(oldRec, newRec, prefix, visit) {
275
163
  const seen = /* @__PURE__ */ new Set();
@@ -383,4 +271,4 @@ function structuralSnapshot(value) {
383
271
  return out;
384
272
  }
385
273
 
386
- export { ANONYMOUS_FORM_KEY_PREFIX as A, DEFAULT_HISTORY_MAX_SNAPSHOTS as D, RESERVED_KEY_PREFIX as R, safeOwnRead as a, safeAssign as b, callConsumerFn as c, safeOwnHas as d, consumerHas as e, spreadConsumerRecord as f, copyConsumerArray as g, consumerKeys as h, isShadowedKey as i, readConsumerProp as j, diffAndApply as k, DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS as l, consumerSymbolKeys as m, normalizeNumericOption as n, applyChangedKeys as o, pickDefined as p, DEFAULT_MAX_RECURSION_DEPTH as q, readConsumerIndex as r, structuralSnapshot as s, reportConsumerThrow as t, ANONYMOUS_WIZARD_KEY_PREFIX as u };
274
+ export { ANONYMOUS_FORM_KEY_PREFIX as A, DEFAULT_HISTORY_MAX_SNAPSHOTS as D, RESERVED_KEY_PREFIX as R, DEFAULT_FIELD_VALIDATION_DEBOUNCE_MS as a, isDescendable as b, applyChangedKeys as c, diffAndApply as d, DEFAULT_MAX_RECURSION_DEPTH as e, ANONYMOUS_WIZARD_KEY_PREFIX as f, isBarePatch as i, normalizeNumericOption as n, pickDefined as p, structuralSnapshot as s };
@@ -114,7 +114,8 @@ const canonicalStringCache = /* @__PURE__ */ new Map();
114
114
  const PATHKEY_TO_SEGMENTS_MAX = 4096;
115
115
  const pathKeyToSegments = /* @__PURE__ */ new Map();
116
116
  function rememberSegmentsForPathKey(key, segments) {
117
- if (!pathKeyToSegments.has(key) && pathKeyToSegments.size >= PATHKEY_TO_SEGMENTS_MAX) {
117
+ if (pathKeyToSegments.has(key)) return;
118
+ if (pathKeyToSegments.size >= PATHKEY_TO_SEGMENTS_MAX) {
118
119
  const oldest = pathKeyToSegments.keys().next().value;
119
120
  if (oldest !== void 0) pathKeyToSegments.delete(oldest);
120
121
  }
@@ -156,7 +157,7 @@ function canonicalizePath(input) {
156
157
  return keyForSegments(input);
157
158
  }
158
159
  function keyForSegments(input) {
159
- const segments = Array.from(input).map(normalizeSegment);
160
+ const segments = input.map(normalizeSegment);
160
161
  const key = JSON.stringify(segments);
161
162
  rememberSegmentsForPathKey(key, segments);
162
163
  return { segments, key };