{"version":3,"file":"index.cjs","names":["events","React","events","React"],"sources":["../../../../../../react-form/src/locales/index.ts","../../../../../../react-form/src/locales/register-defaults.ts","../../../../../../react-form/src/active-form.ts","../../../../../../react-form/src/configurations.ts","../../../../../../react-form/src/standard-schema/adapter.ts","../../../../../../react-form/src/engine/FormEngine.ts","../../../../../../react-form/src/components/BaseForm.ts","../../../../../../react-form/src/contexts/FormContext.ts","../../../../../../react-form/src/components/useFormEngine.ts","../../../../../../react-form/src/components/Form.tsx","../../../../../../react-form/src/hooks/form-hooks.ts","../../../../../../react-form/src/hooks/useForm.ts","../../../../../../react-form/src/hooks/useFieldArray.ts","../../../../../../react-form/src/hooks/useFormControl.ts","../../../../../../react-form/src/hooks/useFormState.ts","../../../../../../react-form/src/hooks/useInputValue.ts","../../../../../../react-form/src/hooks/useRadioInput.tsx","../../../../../../react-form/src/hooks/useSubmitButton.tsx","../../../../../../react-form/src/hooks/useWatch.ts","../../../../../../react-form/src/components/HiddenInput.tsx","../../../../../../react-form/src/components/NativeForm.tsx","../../../../../../react-form/src/rules/alphabet.ts","../../../../../../react-form/src/rules/email.ts","../../../../../../react-form/src/rules/float.ts","../../../../../../react-form/src/rules/integer.ts","../../../../../../react-form/src/rules/length.ts","../../../../../../react-form/src/rules/match.ts","../../../../../../react-form/src/rules/max.ts","../../../../../../react-form/src/rules/maxLength.ts","../../../../../../react-form/src/rules/min.ts","../../../../../../react-form/src/rules/minLength.ts","../../../../../../react-form/src/rules/number.ts","../../../../../../react-form/src/rules/pattern.ts","../../../../../../react-form/src/rules/required.ts","../../../../../../react-form/src/rules/strong.ts","../../../../../../react-form/src/rules/url.ts"],"sourcesContent":["export const enValidationTranslation = {\r\n  required: \"This input is required\",\r\n  email: \"Invalid Email Address\",\r\n  url: \"Invalid URL\",\r\n  min: \"Value can not be lower than :min\",\r\n  max: \"Value can not be greater than :max\",\r\n  match: \"This input is not matching with :matchingInput\",\r\n  length: \"This input should have :length characters\",\r\n  minLength: \"This input can not be less than :length characters\",\r\n  maxLength: \"This input can not be greater than :length characters\",\r\n  pattern: \"This input is not matching with the :pattern\",\r\n  number: \"This input accepts only numbers\",\r\n  integer: \"This input accepts only integer digits\",\r\n  float: \"This input accepts only integer or float digits\",\r\n  alphabet: \"This input accepts only alphabets\",\r\n  strongMinLength: \"Password must be at least :length characters\",\r\n  strongUppercase: \"Password must contain an uppercase letter\",\r\n  strongLowercase: \"Password must contain a lowercase letter\",\r\n  strongDigit: \"Password must contain a number\",\r\n  strongSymbol: \"Password must contain a symbol\",\r\n};\r\n\r\nexport const arValidationTranslation = {\r\n  required: \"هذا الحقل مطلوب\",\r\n  email: \"بريد الكتروني خاطئ\",\r\n  url: \"رابط غير صحيح\",\r\n  min: \"القيمة يجب أن لا تقل عن :min\",\r\n  max: \"القيمة يجب أن لا تزيد عن :max\",\r\n  match: \"هذا الحقل غير متطابق مع :matchingInput\",\r\n  length: \"حروف الحقل يجب ان تساوي :length\",\r\n  minLength: \"هذا الحقل يجب ألا يقل عن :length حرف\",\r\n  maxLength: \"هذا الحقل يجب ألا يزيد عن :length حرف\",\r\n  pattern: \"هذا الحقل غير مطابق :pattern\",\r\n  number: \"هذا الحقل لا يقبل غير أرقام فقط\",\r\n  integer: \"هذا الحقل لا يقبل غير أرقام صحيحة\",\r\n  float: \"هذا الحقل لا يقبل غير أرقام صحيحة او عشرية\",\r\n  alphabet: \"هذا الحقل لا يقبل غير أحرف فقط\",\r\n  strongMinLength: \"يجب أن تتكون كلمة المرور من :length حروف على الأقل\",\r\n  strongUppercase: \"يجب أن تحتوي كلمة المرور على حرف كبير\",\r\n  strongLowercase: \"يجب أن تحتوي كلمة المرور على حرف صغير\",\r\n  strongDigit: \"يجب أن تحتوي كلمة المرور على رقم\",\r\n  strongSymbol: \"يجب أن تحتوي كلمة المرور على رمز\",\r\n};\r\n\r\nexport const frValidationTranslation = {\r\n  required: \"Ce champ est requis\",\r\n  email: \"Adresse e-mail invalide\",\r\n  url: \"URL invalide\",\r\n  min: \"La valeur ne peut pas être inférieure à :min\",\r\n  max: \"La valeur ne peut pas être supérieure à :max\",\r\n  match: \"Ce champ ne correspond pas à :matchingInput\",\r\n  length: \"Ce champ doit avoir :length caractères\",\r\n  minLength: \"Ce champ ne peut pas être inférieur à :length caractères\",\r\n  maxLength: \"Ce champ ne peut pas être supérieur à :length caractères\",\r\n  pattern: \"Ce champ ne correspond pas au :pattern\",\r\n  number: \"Ce champ ne peut contenir que des chiffres\",\r\n  integer: \"Ce champ ne peut contenir que des chiffres entiers\",\r\n  float: \"Ce champ ne peut contenir que des chiffres entiers ou décimaux\",\r\n  alphabet: \"Ce champ ne peut contenir que des lettres\",\r\n  strongMinLength: \"Le mot de passe doit contenir au moins :length caractères\",\r\n  strongUppercase: \"Le mot de passe doit contenir une lettre majuscule\",\r\n  strongLowercase: \"Le mot de passe doit contenir une lettre minuscule\",\r\n  strongDigit: \"Le mot de passe doit contenir un chiffre\",\r\n  strongSymbol: \"Le mot de passe doit contenir un symbole\",\r\n};\r\n\r\nexport const esValidationTranslation = {\r\n  required: \"Este campo es obligatorio\",\r\n  email: \"Dirección de correo electrónico no válida\",\r\n  url: \"URL no válida\",\r\n  min: \"El valor no puede ser inferior a :min\",\r\n  max: \"El valor no puede ser superior a :max\",\r\n  match: \"Este campo no coincide con :matchingInput\",\r\n  length: \"Este campo debe tener :length caracteres\",\r\n  minLength: \"Este campo no puede ser inferior a :length caracteres\",\r\n  maxLength: \"Este campo no puede ser superior a :length caracteres\",\r\n  pattern: \"Este campo no coincide con el :pattern\",\r\n  number: \"Este campo solo acepta números\",\r\n  integer: \"Este campo solo acepta dígitos enteros\",\r\n  float: \"Este campo solo acepta dígitos enteros o decimales\",\r\n  alphabet: \"Este campo solo acepta letras\",\r\n  strongMinLength: \"La contraseña debe tener al menos :length caracteres\",\r\n  strongUppercase: \"La contraseña debe contener una letra mayúscula\",\r\n  strongLowercase: \"La contraseña debe contener una letra minúscula\",\r\n  strongDigit: \"La contraseña debe contener un número\",\r\n  strongSymbol: \"La contraseña debe contener un símbolo\",\r\n};\r\n\r\nexport const itValidationTranslation = {\r\n  required: \"Questo campo è obbligatorio\",\r\n  email: \"Indirizzo email non valido\",\r\n  url: \"URL non valido\",\r\n  min: \"Il valore non può essere inferiore a :min\",\r\n  max: \"Il valore non può essere superiore a :max\",\r\n  match: \"Questo campo non corrisponde a :matchingInput\",\r\n  length: \"Questo campo deve avere :length caratteri\",\r\n  minLength: \"Questo campo non può essere inferiore a :length caratteri\",\r\n  maxLength: \"Questo campo non può essere superiore a :length caratteri\",\r\n  pattern: \"Questo campo non corrisponde al :pattern\",\r\n  number: \"Questo campo accetta solo numeri\",\r\n  integer: \"Questo campo accetta solo cifre intere\",\r\n  float: \"Questo campo accetta solo cifre intere o decimali\",\r\n  alphabet: \"Questo campo accetta solo lettere\",\r\n  strongMinLength: \"La password deve contenere almeno :length caratteri\",\r\n  strongUppercase: \"La password deve contenere una lettera maiuscola\",\r\n  strongLowercase: \"La password deve contenere una lettera minuscola\",\r\n  strongDigit: \"La password deve contenere un numero\",\r\n  strongSymbol: \"La password deve contenere un simbolo\",\r\n};\r\n\r\nexport const deValidationTranslation = {\r\n  required: \"Dieses Feld ist erforderlich\",\r\n  email: \"Ungültige E-Mail-Adresse\",\r\n  url: \"Ungültige URL\",\r\n  min: \"Der Wert darf nicht kleiner sein als :min\",\r\n  max: \"Der Wert darf nicht größer sein als :max\",\r\n  match: \"Dieses Feld stimmt nicht mit :matchingInput überein\",\r\n  length: \"Dieses Feld sollte :length Zeichen haben\",\r\n  minLength: \"Dieses Feld darf nicht weniger als :length Zeichen haben\",\r\n  maxLength: \"Dieses Feld darf nicht mehr als :length Zeichen haben\",\r\n  pattern: \"Dieses Feld stimmt nicht mit dem :pattern überein\",\r\n  number: \"Dieses Feld akzeptiert nur Zahlen\",\r\n  integer: \"Dieses Feld akzeptiert nur ganze Zahlen\",\r\n  float: \"Dieses Feld akzeptiert nur ganze oder Dezimalzahlen\",\r\n  alphabet: \"Dieses Feld akzeptiert nur Buchstaben\",\r\n  strongMinLength: \"Das Passwort muss mindestens :length Zeichen lang sein\",\r\n  strongUppercase: \"Das Passwort muss einen Großbuchstaben enthalten\",\r\n  strongLowercase: \"Das Passwort muss einen Kleinbuchstaben enthalten\",\r\n  strongDigit: \"Das Passwort muss eine Zahl enthalten\",\r\n  strongSymbol: \"Das Passwort muss ein Symbol enthalten\",\r\n};\r\n","import { extend } from \"@mongez/localization\";\nimport { enValidationTranslation } from \"./index\";\n\n/**\n * Register sensible default **English** validation messages on import, so a\n * brand-new user sees readable errors (\"This input is required\") with **zero\n * setup** instead of raw keys like `validation.required`.\n *\n * This runs at package-import time, which is *before* a consumer's own\n * `extend(\"en\", { validation: ... })` call at app entry — and `extend` merges —\n * so a consumer's custom messages still override these, and registering other\n * locales works exactly as before. To opt out of the English defaults, simply\n * `extend(\"en\", { validation: yourMessages })` at app entry as usual.\n */\nextend(\"en\", { validation: enValidationTranslation });\n","import { ActiveForms, FormInterface } from \"./types\";\r\n\r\n// Current active form\r\nlet activeForm: FormInterface | null = null;\r\n\r\n// Active forms ids\r\nconst activeFormsIds: string[] = [];\r\n\r\n/**\r\n * List of all active forms\r\n */\r\nconst activeForms: ActiveForms = {};\r\n\r\n/**\r\n * Get the current active form\r\n */\r\nexport function getActiveForm(): FormInterface | null {\r\n  return activeForm;\r\n}\r\n\r\n/**\r\n * Set the current active form\r\n */\r\nexport function setActiveForm(form: FormInterface): void {\r\n  activeForm = form;\r\n  if (!activeFormsIds.includes(form.id)) {\r\n    activeFormsIds.push(form.id);\r\n  }\r\n}\r\n\r\n/**\r\n * Remove the given form from being active form.\r\n *\r\n * The id is purged from `activeFormsIds` **unconditionally** — not only when the\r\n * form is the current active one — otherwise a form unmounted while a different\r\n * form is active would leave a dead id behind. Over a long-lived app that\r\n * mounts/unmounts forms out of LIFO order (modals, routes, wizards) those dead\r\n * ids would accumulate and the \"restore last active form\" logic would resolve\r\n * stale ids and fail to restore a still-live form.\r\n */\r\nexport function removeActiveForm(form: FormInterface): void {\r\n  const index = activeFormsIds.indexOf(form.id);\r\n  if (index > -1) {\r\n    activeFormsIds.splice(index, 1);\r\n  }\r\n\r\n  // Only re-pick an active form when the one being removed WAS active.\r\n  if (activeForm && form.id === activeForm.id) {\r\n    activeForm = null;\r\n\r\n    // Walk from the most recent, skipping any id whose form is already gone.\r\n    for (let i = activeFormsIds.length - 1; i >= 0; i--) {\r\n      const candidate = getForm(activeFormsIds[i]);\r\n\r\n      if (candidate) {\r\n        setActiveForm(candidate);\r\n        break;\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n/**\r\n * Get form by the given id\r\n */\r\nexport function getForm(formId: string): FormInterface | null {\r\n  return activeForms[formId] || null;\r\n}\r\n\r\n/**\r\n * Add the given form to the active forms\r\n */\r\nexport function addToFormsList(form: FormInterface): void {\r\n  activeForms[form.id] = form;\r\n}\r\n\r\n/**\r\n * Remove the given form from the active forms\r\n */\r\nexport function removeFromFormsList(form: FormInterface): void {\r\n  delete activeForms[form.id];\r\n}\r\n","import { FormConfigurations } from \"./types\";\r\n\r\nexport let formConfigurations: FormConfigurations = {};\r\n\r\nexport function setFormConfigurations(newConfigurations: FormConfigurations) {\r\n  formConfigurations = { ...formConfigurations, ...newConfigurations };\r\n}\r\n\r\nexport function getFormConfig(\r\n  key: keyof FormConfigurations,\r\n  defaultValue?: any,\r\n) {\r\n  return formConfigurations[key] ?? defaultValue;\r\n}\r\n\r\nexport function getFormConfigurations(): FormConfigurations {\r\n  return formConfigurations;\r\n}\r\n","import { ReactNode } from \"react\";\nimport { InputRule } from \"../types\";\nimport { StandardSchemaV1 } from \"./types\";\n\n/**\n * Duck-type guard: is `value` a Standard-Schema-compliant validator?\n *\n * We intentionally avoid importing any concrete library — anything exposing a\n * `~standard.validate` function is accepted (seal, zod, valibot, arktype, …).\n */\nexport function isStandardSchema(value: any): value is StandardSchemaV1 {\n  return (\n    !!value &&\n    typeof value === \"object\" &&\n    \"~standard\" in value &&\n    typeof value[\"~standard\"]?.validate === \"function\"\n  );\n}\n\n/**\n * Run a Standard Schema against a value and normalize the result to a plain\n * `{ issues }` shape. Always returns a Promise — the spec allows `validate` to\n * be sync or async, so we await uniformly.\n */\nexport async function runStandardSchema<Output>(\n  schema: StandardSchemaV1<unknown, Output>,\n  value: unknown\n): Promise<StandardSchemaV1.Result<Output>> {\n  return await schema[\"~standard\"].validate(value);\n}\n\n/**\n * Convert a Standard Schema issue path (e.g. `[\"user\", { key: \"addresses\" }, 0,\n * \"city\"]`) into a dot-notation form-control name (`user.addresses.0.city`).\n */\nexport function issuePathToName(\n  path: StandardSchemaV1.Issue[\"path\"]\n): string {\n  if (!path || path.length === 0) return \"\";\n\n  return path\n    .map((segment) =>\n      typeof segment === \"object\" && segment !== null && \"key\" in segment\n        ? (segment as StandardSchemaV1.PathSegment).key\n        : segment\n    )\n    .join(\".\");\n}\n\n/**\n * Wrap a **single-field** Standard Schema as an `InputRule` so it can run inside\n * the per-control rule pipeline. The first issue's message becomes the rendered\n * error.\n *\n * Used by `useFormControl({ schema })`. The rule is async (the spec permits an\n * async `validate`) and participates in the engine's async gating just like any\n * other promise-returning rule.\n */\nexport function standardSchemaToRule(\n  schema: StandardSchemaV1,\n  name = \"schema\"\n): InputRule {\n  return {\n    name,\n    // Empty values are still handed to the schema so `optional`/`required`\n    // semantics defined by the schema itself are honored.\n    requiresValue: false,\n    validate: async ({ value }): Promise<ReactNode | undefined> => {\n      const result = await runStandardSchema(schema, value);\n\n      if (result.issues && result.issues.length > 0) {\n        return result.issues[0].message;\n      }\n\n      return undefined;\n    },\n  };\n}\n","import events, { EventSubscription } from \"@mongez/events\";\nimport { debounce, get, merge, toInputName } from \"@mongez/reinforcements\";\nimport { isPlainObject } from \"@mongez/supportive-is\";\nimport React from \"react\";\nimport {\n  addToFormsList,\n  removeActiveForm,\n  removeFromFormsList,\n  setActiveForm,\n} from \"../active-form\";\nimport { getFormConfig } from \"../configurations\";\nimport {\n  issuePathToName,\n  isStandardSchema,\n  runStandardSchema,\n} from \"../standard-schema/adapter\";\nimport { StandardSchemaV1 } from \"../standard-schema/types\";\nimport {\n  FillOptions,\n  FormControl,\n  FormControlValues,\n  FormEventType,\n  FormInterface,\n  ValidateOn,\n} from \"../types\";\n\n/**\n * Process-wide counter used only as the LAST resort for a form id (when the\n * host passes none and React's `useId()` is unavailable). Ids are otherwise\n * supplied by the host so they stay stable and SSR-safe.\n */\nlet engineCounter = 0;\n\n/**\n * Mutable options synced into the engine each render by the host component.\n */\nexport type FormEngineOptions = {\n  id?: string;\n  defaultValue?: Record<string, any>;\n  values?: Record<string, any>;\n  schema?: StandardSchemaV1;\n  validateOn?: ValidateOn;\n  ignoreEmptyValues?: boolean;\n  focusFirstError?: boolean;\n  onSubmit?: (options: {\n    form: FormInterface;\n    event?: React.FormEvent;\n    values: any;\n    formData: FormData;\n  }) => void | Promise<any>;\n  onError?: (invalidControls: FormControl[]) => void;\n};\n\n/**\n * Platform-agnostic, **React-free** form engine — the controller object behind\n * every `<Form>` / `<NativeForm>`.\n *\n * It is a plain class (not a `React.Component`) so it can be unit-tested in\n * isolation and held in a `useRef` by the host function component. The host\n * owns rendering and the host element; the engine owns *everything else* —\n * registration, validation, value collection, dirty tracking, hydration, and\n * the submit pipeline.\n *\n * ## Mental model\n *\n * The engine never re-renders anything itself. It coordinates the form through\n * three cooperating mechanisms — keep these in mind when reading any method:\n *\n * 1. **Mutable instance state** (`formControls`, `invalidControls`,\n *    `dirtyControls`, `_isSubmitting`, …). Plain arrays/flags mutated in place.\n *    Mutating them is intentionally invisible to React; that is what keeps the\n *    library fast (registering a control or flipping validity does not re-render\n *    the tree).\n * 2. **A pub/sub event bus** (`@mongez/events`). Every event is namespaced under\n *    `form.{id}.{event}` (see {@link on} / {@link trigger}). Consumers like\n *    `useSubmitButton` / `useWatch` and the host subscribe via {@link on}; the\n *    engine emits via {@link trigger}. Per-control value changes flow on a\n *    separate key, `form.control.{controlId}.change`, owned by the control.\n * 3. **Control registration.** Each `useFormControl` builds a mutable\n *    `FormControl` object and calls {@link register} on mount / {@link unregister}\n *    on unmount. The engine reads/writes those objects directly (e.g.\n *    `control.value`, `control.validate()`); it never copies their state.\n *\n * ## Lifecycle (driven by the host component)\n *\n * ```text\n * new FormEngine(options)      // construct once, seed id + defaultValue + values + schema\n *   → activate()               // mount effect: register as the active form\n *   → setOptions(options)      // every render: re-sync scalar handlers (onSubmit/onError/…)\n *   → fill() / setDefaultValue()   // when the reactive `values` / `defaultValue` prop changes\n *   → register() / unregister()    // as controls mount / unmount\n *   → handleSubmit() / validate()  // on submit (native event or form.submit())\n *   → destroy()                // unmount effect: drop active-form registration\n * ```\n *\n * The host injects {@link submitHandler} so `form.submit()` can trigger a native\n * DOM submit on web vs. run the pipeline directly on React Native.\n */\nexport class FormEngine implements FormInterface {\n  /**\n   * Reference to the host element (HTMLFormElement on web, any on native).\n   * Assigned by the host component via its ref callback.\n   */\n  public formElement: any = null;\n\n  /**\n   * Form id.\n   */\n  protected formId: string;\n\n  /**\n   * Form event prefix.\n   */\n  protected formEventPrefix: string;\n\n  /**\n   * Form controls.\n   */\n  protected formControls: FormControl[] = [];\n\n  /**\n   * Determine whether form validation is valid.\n   */\n  protected isValidForm = true;\n\n  /**\n   * Determine form submission state.\n   */\n  protected _isSubmitting = false;\n\n  /**\n   * Determine if form is disabled.\n   */\n  protected _isDisabled = false;\n\n  /**\n   * List of invalid controls.\n   */\n  protected invalidControls: FormControl[] = [];\n\n  /**\n   * List of valid controls.\n   */\n  protected validControls: FormControl[] = [];\n\n  /**\n   * Form-level error messages with no owning control — produced by whole-form\n   * schema issues whose path maps to no control (cross-field / root errors).\n   */\n  public formErrors: React.ReactNode[] = [];\n\n  /**\n   * Dirty controls.\n   */\n  public dirtyControls: FormControl[] = [];\n\n  /**\n   * Default value (reset baseline).\n   */\n  public defaultValue: Record<string, any> | undefined;\n\n  /**\n   * Reactive hydration snapshot (nested object) — read by controls mounting\n   * after a `fill()` / reactive `values` update.\n   */\n  public hydrationValues: Record<string, any> | undefined;\n\n  /**\n   * Whole-form Standard Schema validator.\n   */\n  public schema: StandardSchemaV1 | undefined;\n\n  /**\n   * Form-level default validation trigger.\n   */\n  public validateOn: ValidateOn | undefined;\n\n  /**\n   * Whether the form has attempted submission at least once.\n   */\n  public wasSubmitted = false;\n\n  /**\n   * Form control change subscriptions, keyed by control id/name.\n   */\n  protected formControlEvents: Record<string, EventSubscription[]> = {};\n\n  /**\n   * Current form dirty state.\n   */\n  public isDirty = false;\n\n  /**\n   * Latest mutable options synced from the host component.\n   */\n  protected formOptions: FormEngineOptions;\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Lifecycle — construct once, sync each render, (de)activate on mount/unmount\n  // ───────────────────────────────────────────────────────────────────────\n\n  /**\n   * Seeds the one-time state: the (stable) form id + its event prefix, the\n   * reset baseline (`defaultValue`), the initial hydration snapshot (cloned from\n   * `values` so later `fill()` merges don't mutate the caller's object), the\n   * whole-form schema, and the default validation trigger.\n   *\n   * Everything that can change between renders (the `onSubmit` / `onError`\n   * handlers, `ignoreEmptyValues`, …) is re-read from {@link setOptions}, not\n   * captured here.\n   */\n  public constructor(options: FormEngineOptions = {}) {\n    this.formOptions = options;\n    this.formId =\n      options.id || `frm-${(++engineCounter).toString(36)}`;\n    this.formEventPrefix = `form.${this.formId}`;\n    this.defaultValue = options.defaultValue;\n    this.hydrationValues = options.values\n      ? merge({}, options.values)\n      : undefined;\n    this.schema = isStandardSchema(options.schema) ? options.schema : undefined;\n    this.validateOn = options.validateOn;\n  }\n\n  /**\n   * Sync the latest scalar options/handlers from the host component. Reactive\n   * `values` / `defaultValue` identity changes are handled by the host calling\n   * `fill()` / `setDefaultValue()` explicitly.\n   */\n  public setOptions(options: FormEngineOptions) {\n    this.formOptions = options;\n    this.schema = isStandardSchema(options.schema) ? options.schema : undefined;\n    this.validateOn = options.validateOn;\n  }\n\n  /**\n   * Register the engine as the active form. Called by the host on mount.\n   */\n  public activate() {\n    setActiveForm(this);\n    addToFormsList(this);\n  }\n\n  /**\n   * Tear down active-form registration. Called by the host on unmount.\n   */\n  public destroy() {\n    removeActiveForm(this);\n    removeFromFormsList(this);\n  }\n\n  public change(name: string, value: any) {\n    const formControl = this.control(name);\n\n    if (!formControl) return;\n\n    formControl.change(value);\n  }\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Validity tracking\n  //\n  // Two layers work together:\n  //  - EAGER, per-control: invalidControl()/validControl() move a single control\n  //    between the valid/invalid buckets the instant its own validation\n  //    resolves, and fire the singular `invalidControl` / `validControl` events.\n  //  - DEBOUNCED, aggregate: checkIfIsValid() coalesces a burst of per-control\n  //    updates (e.g. validating the whole form) into ONE `validControls` /\n  //    `invalidControls` event on the next tick, so a button bound to form\n  //    validity flips once, not once per field.\n  // ───────────────────────────────────────────────────────────────────────\n\n  /** Move a control into the invalid bucket and mark the form invalid. */\n  public invalidControl(formControl: FormControl) {\n    this.isValidForm = false;\n\n    this.validControls = this.validControls.filter(\n      (control) => control.id !== formControl.id\n    );\n\n    if (!this.invalidControls.includes(formControl)) {\n      this.invalidControls.push(formControl);\n    }\n\n    this.trigger(\"invalidControl\", formControl, this);\n  }\n\n  /**\n   * Move a control into the valid bucket; the form is valid again only once the\n   * invalid bucket is empty.\n   */\n  public validControl(formControl: FormControl) {\n    this.invalidControls = this.invalidControls.filter(\n      (control) => control.id !== formControl.id\n    );\n\n    if (!this.validControls.includes(formControl)) {\n      this.validControls.push(formControl);\n    }\n\n    this.isValidForm = this.invalidControls.length === 0;\n\n    this.trigger(\"validControl\", formControl, this);\n  }\n\n  /**\n   * Debounced aggregate validity check. Call it after a batch of per-control\n   * validity changes; it emits a single `validControls` / `invalidControls`\n   * event on the next tick. (A field initializer rather than a method so each\n   * engine instance owns its own debounced function.)\n   */\n  public checkIfIsValid = this._checkIfIsValid();\n\n  protected _checkIfIsValid() {\n    return debounce(() => {\n      const isValidForm = this.invalidControls.length === 0;\n\n      this.isValidForm = isValidForm;\n\n      if (this.isValidForm) {\n        this.trigger(\"validControls\", this.validControls, this);\n      } else {\n        this.trigger(\"invalidControls\", this.invalidControls, this);\n      }\n    }, 0);\n  }\n\n  /**\n   * Set the in-flight submit state and emit `submitting`. Clearing it\n   * (`submitting(false)`) *also* emits `submit` — that is the single completion\n   * signal for an async submit (see {@link handleSubmit}). Call this yourself in\n   * a sync `onSubmit`'s success/failure path to re-enable a submit button.\n   */\n  public submitting(submitting: boolean) {\n    this._isSubmitting = submitting;\n\n    this.trigger(\"submitting\", submitting, this);\n\n    if (submitting === false) {\n      this.trigger(\"submit\", submitting, this);\n    }\n  }\n\n  public disable(isDisabled = true) {\n    const controls = this.formControls;\n\n    this._isDisabled = isDisabled;\n\n    controls.forEach((control) => {\n      control.disable(isDisabled);\n    });\n\n    this.trigger(\"disable\", isDisabled, this);\n\n    return this;\n  }\n\n  public enable() {\n    return this.disable(false);\n  }\n\n  /** Whether the whole form is currently disabled (via {@link disable}). */\n  public isDisabled() {\n    return this._isDisabled;\n  }\n\n  public isSubmitting() {\n    return this._isSubmitting;\n  }\n\n  public isValid() {\n    return this.isValidForm;\n  }\n\n  public get id() {\n    return this.formId;\n  }\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Events — all keyed under `form.{id}.{event}` so multiple forms never collide\n  // ───────────────────────────────────────────────────────────────────────\n\n  /**\n   * Subscribe to a form event. Returns an `EventSubscription` — call\n   * `.unsubscribe()` (typically in a `useEffect` cleanup) to detach.\n   */\n  public on(\n    event: FormEventType,\n    callback: (form: FormInterface) => void\n  ): EventSubscription {\n    return events.subscribe(`${this.formEventPrefix}.${event}`, callback);\n  }\n\n  /** Emit a form event (fire-and-forget; listener return values are ignored). */\n  public trigger(event: FormEventType, ...values: any[]) {\n    return events.trigger(`${this.formEventPrefix}.${event}`, ...values);\n  }\n\n  /**\n   * Emit a form event and collect every listener's return value in\n   * `response.results`. Used by {@link validate} for the `validating` veto: a\n   * listener returning `false` aborts validation.\n   */\n  public triggerAll(event: FormEventType, ...values: any[]) {\n    return events.triggerAll(`${this.formEventPrefix}.${event}`, ...values);\n  }\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Validation pipeline\n  // ───────────────────────────────────────────────────────────────────────\n\n  /**\n   * Validate `controls` (the whole form by default) and recompute form validity.\n   *\n   * Flow:\n   *  1. Reset the valid/invalid buckets and optimistically assume valid.\n   *  2. Fire `validating` — any listener returning `false` **vetoes** the run\n   *     (the form is marked invalid and nothing else validates).\n   *  3. `await` each control's `validate()` in turn. This is what makes async\n   *     rules genuinely gate submission: a control whose rule returns a Promise\n   *     is awaited here before the form decides it is valid. Each control sorts\n   *     itself into the invalid/valid bucket via its resolved `isValid`.\n   *  4. If a whole-form {@link schema} is set, run it and map issues back to\n   *     controls (see {@link validateSchema}).\n   *  5. Emit `validation`, schedule the debounced aggregate event, and call the\n   *     `onError` handler when invalid.\n   *\n   * `validateVisible()` passes a filtered `controls` subset; schema issues for\n   * controls outside that subset are ignored so hidden fields don't fail it.\n   */\n  public async validate(controls: FormControl[] | string[] = this.formControls) {\n    // Accept control names as a convenience: validate([\"email\", \"password\"]).\n    const targetControls: FormControl[] =\n      controls.length > 0 && typeof controls[0] === \"string\"\n        ? this.controls(controls as string[])\n        : (controls as FormControl[]);\n\n    this.isValidForm = true;\n    this.validControls = [];\n    this.invalidControls = [];\n    this.formErrors = [];\n\n    const eventResponse = this.triggerAll(\"validating\", this);\n\n    const validatedInputs: FormControl[] = [];\n\n    if (eventResponse.results.includes(false)) {\n      this.isValidForm = false;\n      return validatedInputs;\n    }\n\n    for (const input of targetControls) {\n      validatedInputs.push(input);\n\n      // Awaited: a control with an async rule resolves its `isValid` before we\n      // bucket it, so async validation actually blocks the form.\n      await input.validate();\n\n      if (input.isValid === false) {\n        this.invalidControl(input);\n      } else {\n        this.validControl(input);\n      }\n    }\n\n    // Whole-form schema validation. Issues are mapped back to controls by path;\n    // issues whose control is not in the validated subset become form-level\n    // errors (so a subset validation like `validateVisible()` still won't fail\n    // on hidden fields' own messages, but a cross-field error still blocks).\n    if (this.schema) {\n      await this.validateSchema(targetControls);\n    }\n\n    this.trigger(\"validation\", this.isValidForm, validatedInputs, this);\n\n    this.checkIfIsValid();\n\n    if (!this.isValidForm) {\n      this.formOptions.onError?.(this.invalidControls);\n\n      // Opt-in: move focus to the first invalid control so the user lands on\n      // the problem without a manual scroll/focus recipe.\n      if (this.formOptions.focusFirstError) {\n        this.invalidControls[0]?.focus();\n      }\n    }\n\n    return validatedInputs;\n  }\n\n  /**\n   * Run the whole-form Standard Schema and distribute its issues. Three cases:\n   *\n   * - **Maps to a control in the validated subset** → shown on that control.\n   * - **Maps to a control OUTSIDE the subset** (e.g. a hidden wizard step during\n   *   `validateVisible()`) → ignored, so a subset validation isn't failed by\n   *   fields it deliberately skipped.\n   * - **Root / cross-field issue (empty path)** → there is no control to own it,\n   *   so it becomes a {@link formErrors} entry and blocks submission. (These\n   *   were previously dropped, letting the form submit schema-invalid.)\n   *\n   * A non-empty path matching no control is treated as a schema/form-name\n   * mismatch and ignored, so a stray path can't make the form permanently\n   * unsubmittable.\n   */\n  protected async validateSchema(controls: FormControl[]) {\n    if (!this.schema) return;\n\n    const result = await runStandardSchema(this.schema, this.values());\n\n    if (!result.issues || result.issues.length === 0) return;\n\n    for (const issue of result.issues) {\n      const name = issuePathToName(issue.path);\n\n      const control = name ? this.control(name) : null;\n\n      if (control) {\n        if (controls.includes(control)) {\n          this.applyControlError(control, issue.message);\n        }\n        continue;\n      }\n\n      if (name === \"\") {\n        this.formErrors.push(issue.message);\n        this.isValidForm = false;\n      }\n    }\n  }\n\n  /**\n   * Force a control into an invalid state with the given message.\n   */\n  protected applyControlError(control: FormControl, message: React.ReactNode) {\n    control.setError(message);\n    control.error = message;\n    control.isValid = false;\n    this.invalidControl(control);\n  }\n\n  public validateVisible() {\n    const controls = this.formControls.filter((control) => {\n      return control.isVisible();\n    });\n\n    return this.validate(controls);\n  }\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Control registration — controls call these from their mount/unmount effects\n  // ───────────────────────────────────────────────────────────────────────\n\n  /**\n   * Add a control to the form and wire its change subscription.\n   *\n   * - The leading guard makes registration idempotent (a control re-running its\n   *   effect, e.g. a field-array row whose name/index changed, won't be added\n   *   twice).\n   * - The `onChange` subscription is the engine's link to per-control changes:\n   *   it keeps `dirtyControls` (and thus `isDirty`) in sync and re-broadcasts a\n   *   form-level `change` event for `useWatch` / `useFieldArray`.\n   * - The subscription is stored under the control's key so {@link unregister}\n   *   can tear it down.\n   */\n  public register(formControl: FormControl) {\n    if (this.control(formControl.id, \"id\")) return;\n\n    this.trigger(\"registering\", formControl, this);\n\n    this.formControls.push(formControl);\n\n    const event = formControl.onChange(() => {\n      if (formControl.isDirty && !this.dirtyControls.includes(formControl)) {\n        this.dirtyControls.push(formControl);\n      } else if (\n        !formControl.isDirty &&\n        this.dirtyControls.includes(formControl)\n      ) {\n        this.dirtyControls = this.dirtyControls.filter(\n          (control) => control.id !== formControl.id\n        );\n      }\n\n      this.setIsDirty(this.dirtyControls.length > 0);\n\n      // Form-level change broadcast — consumed by `useWatch`.\n      this.trigger(\"change\", formControl, this);\n    });\n\n    this.formControlEvents[formControl.id || formControl.name] = [\n      ...(this.formControlEvents[formControl.id || formControl.name] || []),\n      event,\n    ];\n\n    this.trigger(\"register\", formControl, this);\n  }\n\n  /**\n   * Remove a control and undo everything {@link register} set up: notify the\n   * control (`unregister`), drop it from `formControls` and the invalid bucket,\n   * unsubscribe its change listener, and recompute dirty/validity so the form\n   * doesn't stay blocked by a control that no longer exists.\n   */\n  public unregister(formControl: FormControl) {\n    formControl.unregister();\n\n    const formControlIndex = this.formControls.findIndex(\n      (input) => input.id === formControl.id\n    );\n\n    if (formControlIndex === -1) return;\n\n    this.formControls.splice(formControlIndex, 1);\n\n    // Drop the control from BOTH validity buckets so an unmounted control's\n    // object (and its DOM refs / closures) isn't retained until the next full\n    // validate(). The valid bucket was previously only cleared wholesale by\n    // validate(), so a valid-then-unmounted control leaked.\n    this.invalidControls = this.invalidControls.filter(\n      (control) => control.id !== formControl.id\n    );\n    this.validControls = this.validControls.filter(\n      (control) => control.id !== formControl.id\n    );\n\n    const formControlKey = formControl.id || formControl.name;\n\n    const controlEvents = this.formControlEvents[formControlKey];\n\n    if (controlEvents) {\n      controlEvents.forEach((event) => {\n        event.unsubscribe();\n      });\n\n      delete this.formControlEvents[formControlKey];\n\n      if (this.dirtyControls.includes(formControl)) {\n        this.dirtyControls = this.dirtyControls.filter(\n          (control) => control.id !== formControl.id\n        );\n\n        this.setIsDirty(this.dirtyControls.length > 0);\n      }\n    }\n\n    this.checkIfIsValid();\n\n    this.trigger(\"unregister\", formControl, this);\n  }\n\n  protected setIsDirty(isDirty: boolean) {\n    this.isDirty = isDirty;\n\n    this.trigger(\"dirty\", isDirty, this);\n  }\n\n  public control(\n    value: string,\n    getBy: \"name\" | \"id\" = \"name\"\n  ): FormControl | null {\n    return this.formControls.find((input) => input[getBy] === value) || null;\n  }\n\n  /**\n   * Restore the form to its pristine state: each control resets to its\n   * `initialValue` (the reset baseline — see {@link getResetBaseline}) and\n   * clears its error/dirty/touched flags, then the form-level flags reset.\n   * Brackets the work with `resetting` (before) and `reset` (after) events.\n   *\n   * Pass `values` to reset to a NEW baseline (e.g. after saving an edit form):\n   * the new values are merged into `defaultValue` and become each control's\n   * reset target, so subsequent resets restore to them too.\n   */\n  public reset(values?: Record<string, any>) {\n    this.trigger(\"resetting\", this);\n\n    if (values !== undefined) {\n      this.defaultValue = merge(this.defaultValue ?? {}, values);\n\n      for (const control of this.formControls) {\n        const baseline = get(this.defaultValue, control.name);\n        if (baseline !== undefined) control.initialValue = baseline;\n      }\n    }\n\n    this.formControls.forEach((input) => {\n      input.reset();\n    });\n\n    this.isValidForm = true;\n    this._isSubmitting = false;\n    this._isDisabled = false;\n    this.wasSubmitted = false;\n    this.formErrors = [];\n\n    this.trigger(\"reset\", this);\n\n    return this;\n  }\n\n  public resetErrors() {\n    this.formControls.forEach((formControl) => {\n      formControl.setError(null);\n      formControl.isValid = null;\n    });\n\n    this.invalidControls = [];\n    // Clear the valid bucket too — otherwise stale/unmounted controls linger\n    // here until a full re-validate.\n    this.validControls = [];\n    this.formErrors = [];\n    this.isValidForm = true;\n\n    return this;\n  }\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Values & hydration\n  //\n  // Two distinct concepts that are easy to conflate:\n  //  - DISPLAY seed (getInitialValue): what a control shows when it mounts.\n  //    Live-loaded `values` (hydrationValues) win here so edit forms render the\n  //    record.\n  //  - RESET baseline (getResetBaseline): what `form.reset()` restores to. Only\n  //    `defaultValue` counts — never the hydration snapshot — so loading a\n  //    record never silently becomes the \"reset\" target.\n  // Controls read the display seed for their initial value and the reset\n  // baseline for `formControl.initialValue`.\n  // ───────────────────────────────────────────────────────────────────────\n\n  /**\n   * Resolve the seed (display) value for a control name: the reactive hydration\n   * snapshot wins over the reset baseline.\n   */\n  public getInitialValue(name: string): any {\n    if (this.hydrationValues !== undefined) {\n      const value = get(this.hydrationValues, name);\n      if (value !== undefined) return value;\n    }\n\n    if (this.defaultValue !== undefined) {\n      return get(this.defaultValue, name);\n    }\n\n    return undefined;\n  }\n\n  /**\n   * Resolve the **reset baseline** for a control name — from `defaultValue`\n   * only, never the hydration snapshot. `form.reset()` restores controls to\n   * this, so live-loaded `values` never become the reset target.\n   */\n  public getResetBaseline(name: string): any {\n    if (this.defaultValue === undefined) return undefined;\n\n    return get(this.defaultValue, name);\n  }\n\n  /**\n   * Bulk-write values onto mounted controls and seed later-mounting controls.\n   * Does not change the reset baseline (`defaultValue`).\n   */\n  public fill(values: Record<string, any>, options: FillOptions = {}) {\n    const { dirty = false, validate = false } = options;\n\n    this.hydrationValues = merge(this.hydrationValues ?? {}, values);\n\n    for (const control of this.formControls) {\n      const value = get(values, control.name);\n\n      if (value === undefined) continue;\n\n      control.change(value, { dirty, validate, updateState: true });\n    }\n\n    // Notify hydration listeners (useWatch, useFieldArray) even when no control\n    // matched yet — e.g. a field array that needs to grow its rows to match a\n    // freshly-loaded array.\n    this.trigger(\"change\", undefined, this);\n\n    return this;\n  }\n\n  public setValues(values: Record<string, any>, options: FillOptions = {}) {\n    return this.fill(values, options);\n  }\n\n  /**\n   * Update the reset baseline. Pristine (non-dirty) controls re-hydrate to the\n   * new baseline; dirty controls keep the user's edits.\n   */\n  public setDefaultValue(defaultValue: Record<string, any> | undefined) {\n    this.defaultValue = defaultValue;\n\n    if (!defaultValue) return this;\n\n    for (const control of this.formControls) {\n      if (control.isDirty) continue;\n\n      const value = get(defaultValue, control.name);\n\n      if (value === undefined) continue;\n\n      control.initialValue = value;\n      control.change(value, { dirty: false, validate: false, updateState: true });\n    }\n\n    return this;\n  }\n\n  public setErrors(errors: Record<string, React.ReactNode>) {\n    for (const name in errors) {\n      const control = this.control(name);\n\n      if (!control) continue;\n\n      this.applyControlError(control, errors[name]);\n    }\n\n    this.checkIfIsValid();\n\n    if (this.invalidControls.length > 0) {\n      this.trigger(\"invalidControls\", this.invalidControls, this);\n    }\n\n    return this;\n  }\n\n  /** Current value of a single control by name (live, not collected). */\n  public value(formControlName: string): any {\n    return this.control(formControlName, \"name\")?.value;\n  }\n\n  /**\n   * The collected form values as a nested object: takes the flat dot-notation\n   * map from {@link collectValues} and expands it (`user.address.city` →\n   * `{ user: { address: { city } } }`, numeric segments → arrays). This is what\n   * `onSubmit` receives as `values`.\n   */\n  public values(formControlNames: string[] = []) {\n    return createNestedObjectFromDotNotation(\n      this.collectValues(formControlNames)\n    );\n  }\n\n  public shouldIgnoreEmptyValues() {\n    return (\n      this.formOptions.ignoreEmptyValues !== undefined\n        ? this.formOptions.ignoreEmptyValues\n        : getFormConfig(\"ignoreEmptyValues\", false)\n    ) as boolean;\n  }\n\n  /**\n   * Collect a FLAT `{ dotNotationName: value }` map from the registered\n   * controls — the raw material {@link values} nests into objects/arrays.\n   *\n   * Per control: skip the unnamed and the non-collectable (disabled, unchecked\n   * boxes, …); optionally drop empties when `ignoreEmptyValues` is on; then\n   * merge into the map. The merge collapses repeats into an array — if a name\n   * already has a value (or the control is `multiple`), the slot is promoted to\n   * an array and subsequent values are pushed. That is how N inputs sharing one\n   * `name` (e.g. a checkbox group) become a single array value.\n   */\n  public collectValues(formControlNames: string[] = []) {\n    const formControls = this.controls(formControlNames);\n\n    const values: FormControlValues = {};\n\n    const ignoreEmptyValues = this.shouldIgnoreEmptyValues();\n\n    for (const formControl of formControls) {\n      const name = formControl.name;\n      if (!name || !formControl.isCollectable()) continue;\n\n      const value = formControl.collectValue();\n\n      if (\n        ignoreEmptyValues &&\n        ([null, undefined, \"\"].includes(value) ||\n          (Array.isArray(value) && value.length === 0))\n      )\n        continue;\n\n      if (\n        (values[name] || formControl.multiple) &&\n        !Array.isArray(values[name]) &&\n        !Array.isArray(value)\n      ) {\n        values[name] = values[name] ? [values[name]] : [];\n      }\n\n      if (Array.isArray(values[name])) {\n        values[name].push(value);\n      } else {\n        values[name] = value;\n      }\n    }\n\n    return values;\n  }\n\n  /**\n   * The collected values as a `FormData` for `multipart/form-data` submits.\n   * Mirrors the nested shape using PHP/Rails-style bracket keys on the wire:\n   * arrays as `name[]`, plain objects as `name[key]`.\n   */\n  public formData(): FormData {\n    const formData: FormData = new FormData();\n\n    const values = this.collectValues();\n\n    for (const name in values) {\n      const value = values[name];\n      const formControlName = toInputName(name);\n\n      if (Array.isArray(value)) {\n        for (const item of value) {\n          formData.append(`${formControlName}[]`, item);\n        }\n        continue;\n      } else if (isPlainObject(value)) {\n        for (const key in value) {\n          formData.append(`${formControlName}[${key}]`, value[key]);\n        }\n        continue;\n      }\n\n      formData.append(formControlName, value);\n    }\n\n    return formData;\n  }\n\n  public controls(formControls: string[] = []): FormControl[] {\n    if (formControls?.length === 0) return this.formControls;\n\n    return this.formControls.filter((formControl) =>\n      formControls.includes(formControl.name)\n    );\n  }\n\n  // ───────────────────────────────────────────────────────────────────────\n  // Submit pipeline\n  //\n  // Two entry points converge on handleSubmit():\n  //  - Web: form.submit() → submitHandler() dispatches a native submit event →\n  //    the host's onSubmit listener calls handleSubmit(event).\n  //  - Native / programmatic: submitHandler() (or the host) calls handleSubmit()\n  //    directly — there is no DOM event to dispatch.\n  // ───────────────────────────────────────────────────────────────────────\n\n  /**\n   * Manually submit the form. Delegates to the host-injected\n   * {@link submitHandler} because only the host knows how to dispatch a native\n   * submit on web vs. run the pipeline directly on React Native.\n   */\n  public submit() {\n    this.submitHandler?.();\n  }\n\n  /**\n   * Submit trigger injected by the host component (see {@link submit}).\n   */\n  public submitHandler: (() => void) | undefined;\n\n  /**\n   * The shared submit pipeline.\n   *\n   * Flow:\n   *  1. Mark `wasSubmitted` (drives `validateOn: \"submit\"` revalidation).\n   *  2. `await validate()` — async rules block here.\n   *  3. Bail if invalid, or if a submit is already in flight (re-entrancy guard).\n   *  4. With no `onSubmit`, emit `submit` immediately and stop.\n   *  5. Otherwise flip submitting on and invoke `onSubmit` with lazy `values` /\n   *     `formData` getters (re-collected on access).\n   *     - **Async** `onSubmit`: defer clearing the submitting state AND the\n   *       `submit` completion event until the returned promise settles, so\n   *       `submit` fires exactly once, after the work is done. (`submitting(false)`\n   *       is itself what emits `submit` here — see {@link submitting}.)\n   *     - **Sync / void** `onSubmit`: completion is immediate; the caller owns\n   *       clearing the submitting state.\n   *     - A synchronous throw clears the submitting state and re-throws.\n   */\n  public async handleSubmit(event?: React.FormEvent) {\n    this.wasSubmitted = true;\n\n    await this.validate();\n\n    if (this.isValidForm === false) return;\n\n    if (this.isSubmitting()) return;\n\n    const onSubmit = this.formOptions.onSubmit;\n\n    if (!onSubmit) {\n      // Nothing to run — emit the completion event immediately.\n      this.trigger(\"submit\", this);\n      return;\n    }\n\n    this.submitting(true);\n\n    // eslint-disable-next-line @typescript-eslint/no-this-alias\n    const form = this;\n\n    let result: void | Promise<any>;\n\n    try {\n      result = onSubmit({\n        form: this,\n        event,\n        get values() {\n          return form.values();\n        },\n        get formData() {\n          return form.formData();\n        },\n      });\n    } catch (error) {\n      this.submitting(false);\n      throw error;\n    }\n\n    if (result && typeof (result as any).then === \"function\") {\n      // Async submit: defer the `submit` completion event (and clearing the\n      // submitting state) until the promise settles, so `\"submit\"` fires once,\n      // after the work is actually done.\n      Promise.resolve(result).then(\n        () => this.submitting(false),\n        () => this.submitting(false)\n      );\n      return;\n    }\n\n    // Sync/void submit: completion is immediate.\n    this.trigger(\"submit\", this);\n  }\n}\n\n// Segments that would let a dotted field name reach `Object.prototype` (or\n// any other prototype) and pollute every plain object in the runtime.\n// Writing through them is always rejected. Kept local/standalone (no\n// cross-package dependency) — mirrors `@mongez/reinforcements`'s\n// `isForbiddenKey` guard.\nfunction isForbiddenKey(key: string): boolean {\n  return key === \"__proto__\" || key === \"constructor\" || key === \"prototype\";\n}\n\n// Numeric segments above this are treated as plain object keys rather than\n// array indices. Field names are attacker-controlled in schema/CMS-driven\n// forms; without this cap a name like `items.4000000000.x` would create a\n// sparse array with a `length` in the billions, blowing up memory/CPU the\n// first time a consumer iterates or serializes the collected values.\nconst MAX_ARRAY_INDEX = 10000;\n\nfunction isArrayIndexSegment(segment: string | undefined): boolean {\n  if (!segment) return false;\n\n  const index = Number(segment);\n\n  return !isNaN(index) && index <= MAX_ARRAY_INDEX;\n}\n\n// create a function that receives an object\n// each key is a dot notation syntax\n// return an object with nested objects\n// if the key is a dot notation syntax, then create a nested object\n// if a segment of the key is a number, then create an array\n// if the key is a number, then create an array\n// i.e name.0.text => { name: [{ text: 'value' }] }\n// name.firstName => { name: { firstName: 'value' } }\n// name.addresses.0.city => { name: { addresses: [{ city: 'value' }] } }\nexport function createNestedObjectFromDotNotation(object: any) {\n  const result: any = {};\n\n  for (const key in object) {\n    const value = object[key];\n\n    if (key.includes(\".\")) {\n      const nestedName = key.split(\".\");\n      const nestedNameLength = nestedName.length;\n\n      // Never write through/onto a prototype-pollution vector segment. Checked\n      // up front so a blocked key doesn't leave a partial container (e.g. the\n      // `a` in `a.__proto__.x`) behind on `result`.\n      if (nestedName.some(isForbiddenKey)) continue;\n\n      let nestedObject = result;\n\n      for (let i = 0; i < nestedNameLength; i++) {\n        const nestedNamePart = nestedName[i];\n        const isLastSegment = i === nestedNameLength - 1;\n        const nextSegment = nestedName[i + 1];\n\n        if (isLastSegment) {\n          // Always assign the leaf — even a falsy value (0, \"\", false). The old\n          // truthiness guard treated falsy existing values as \"absent\" and\n          // could overwrite them with a container.\n          nestedObject[nestedNamePart] = value;\n          break;\n        }\n\n        // Descending: ensure an object/array container exists. If a primitive\n        // already sits here (a leaf/parent name collision, e.g. both `a` and\n        // `a.b`), replace it with a container instead of crashing on the next\n        // property write. Existing containers are preserved.\n        const existing = nestedObject[nestedNamePart];\n\n        if (typeof existing !== \"object\" || existing === null) {\n          nestedObject[nestedNamePart] = isArrayIndexSegment(nextSegment)\n            ? []\n            : {};\n        }\n\n        nestedObject = nestedObject[nestedNamePart];\n      }\n    } else if (!isForbiddenKey(key)) {\n      result[key] = value;\n    }\n  }\n\n  return result;\n}\n","import { FormEngine } from \"../engine/FormEngine\";\n\n/**\n * @deprecated Since v4. `BaseForm` was an abstract `React.Component`; the\n * platform-agnostic logic now lives in the React-free {@link FormEngine} class,\n * and `Form` / `NativeForm` are function components built over it.\n *\n * Migration:\n * - To access the engine instance from a `ref`, the type is `FormEngine`\n *   (still assignable to `FormInterface`).\n * - To support a custom renderer, subclass `FormEngine` and render a thin\n *   function component that lazy-inits it (see `useFormEngine`), instead of\n *   subclassing `BaseForm`.\n *\n * This alias is kept for one major version to ease the migration and will be\n * removed in v5.\n */\nexport const BaseForm = FormEngine;\n\n/**\n * @deprecated Since v4. Use `FormEngine` instead.\n */\nexport type BaseForm = FormEngine;\n","import React from \"react\";\r\nimport type { FormContextData } from \"../types\";\r\n\r\nexport const FormContext = React.createContext<FormContextData>(null);\r\n","\"use client\";\n\nimport { useEffect, useId, useRef } from \"react\";\nimport { FormEngine, FormEngineOptions } from \"../engine/FormEngine\";\nimport { FormProps } from \"../types\";\n\nfunction buildOptions(props: FormProps<any>, id: string): FormEngineOptions {\n  return {\n    id,\n    defaultValue: props.defaultValue,\n    values: props.values,\n    schema: props.schema,\n    validateOn: props.validateOn,\n    ignoreEmptyValues: props.ignoreEmptyValues,\n    focusFirstError: props.focusFirstError,\n    onSubmit: props.onSubmit,\n    onError: props.onError,\n  };\n}\n\n/**\n * Shared wiring for the `Form` / `NativeForm` function components:\n *\n * - Lazily instantiates a single {@link FormEngine} held in a ref (stable\n *   identity for context + the event bus).\n * - Derives an SSR-safe id from React's `useId()` when none is provided.\n * - Syncs the latest scalar options/handlers into the engine each render.\n * - Re-hydrates controls when the reactive `values` prop identity changes, and\n *   updates the reset baseline when `defaultValue` changes.\n * - Activates/destroys the active-form registry on mount/unmount.\n *\n * @param submitHandler platform-specific submit trigger invoked by `form.submit()`.\n */\nexport function useFormEngine(\n  props: FormProps<any>,\n  submitHandler: (engine: FormEngine) => void\n) {\n  const reactId = useId();\n  const id = props.id ? String(props.id) : `form-${reactId}`;\n\n  const engineRef = useRef<FormEngine>();\n\n  if (!engineRef.current) {\n    engineRef.current = new FormEngine(buildOptions(props, id));\n  }\n\n  const engine = engineRef.current;\n\n  // Sync scalar options/handlers every render. This only mutates the engine's\n  // option bag (no React state), so it is safe during render.\n  engine.setOptions(buildOptions(props, id));\n  engine.submitHandler = () => submitHandler(engine);\n\n  // Reactive value hydration. Gate on the last-applied identity (not a\n  // first-run boolean) so React StrictMode's double-mount does not fire a\n  // spurious `fill()` with the unchanged initial `values`. The constructor\n  // already seeded `hydrationValues` from the initial `props.values`.\n  const lastValues = useRef(props.values);\n  useEffect(() => {\n    if (props.values === undefined || props.values === lastValues.current) {\n      return;\n    }\n\n    lastValues.current = props.values;\n    engine.fill(props.values, { dirty: false, validate: false });\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [props.values]);\n\n  // Reactive reset baseline — same identity-gated pattern. The constructor\n  // already applied the initial `props.defaultValue`.\n  const lastDefaultValue = useRef(props.defaultValue);\n  useEffect(() => {\n    if (props.defaultValue === lastDefaultValue.current) {\n      return;\n    }\n\n    lastDefaultValue.current = props.defaultValue;\n    engine.setDefaultValue(props.defaultValue);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [props.defaultValue]);\n\n  useEffect(() => {\n    engine.activate();\n\n    return () => {\n      engine.destroy();\n    };\n  }, [engine]);\n\n  return { engine, id };\n}\n","\"use client\";\n\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { getFormConfig } from \"../configurations\";\nimport { FormContext } from \"../contexts/FormContext\";\nimport { FormEngine } from \"../engine/FormEngine\";\nimport { StandardSchemaV1 } from \"../standard-schema/types\";\nimport { FormInterface, FormProps } from \"../types\";\nimport { useFormEngine } from \"./useFormEngine\";\n\n/**\n * Web submit trigger. Dispatches a native `submit` event (so the browser-style\n * pipeline runs), falling back to the engine pipeline if there is no host\n * element.\n */\nfunction webSubmit(engine: FormEngine) {\n  const element: HTMLFormElement | null = engine.formElement;\n\n  if (!element) {\n    engine.handleSubmit();\n    return;\n  }\n\n  if (engine.isSubmitting()) return;\n\n  if (element.requestSubmit) {\n    element.requestSubmit();\n  } else {\n    // polyfill for Edge and bloody safari\n    const submitter = document.createElement(\"input\");\n    submitter.type = \"submit\";\n    submitter.style.display = \"none\";\n    element.appendChild(submitter);\n    submitter.click();\n    element.removeChild(submitter);\n  }\n}\n\n/**\n * Generic call signature preserving schema inference and `ref` support.\n */\ntype FormComponent = <\n  Schema extends StandardSchemaV1 | undefined = undefined,\n>(\n  props: FormProps<Schema> & { ref?: React.Ref<FormInterface> }\n) => React.ReactElement | null;\n\n/**\n * Web form. Renders an HTML `<form>` element by default, built over the\n * React-free {@link FormEngine}. The engine instance is exposed via `ref`.\n */\nexport const Form = forwardRef(function Form(\n  props: FormProps<any>,\n  ref: React.Ref<FormInterface>\n) {\n  const { engine, id } = useFormEngine(props, webSubmit);\n\n  useImperativeHandle(ref, () => engine, [engine]);\n\n  const {\n    onError: _onError,\n    onSubmit: _onSubmit,\n    component: Component = getFormConfig(\"formComponent\", \"form\"),\n    children,\n    ignoreEmptyValues: _ignoreEmptyValues,\n    defaultValue: _defaultValue,\n    values: _values,\n    schema: _schema,\n    validateOn: _validateOn,\n    focusFirstError: _focusFirstError,\n    id: _id,\n    ...otherProps\n  } = props;\n\n  const handleSubmit = async (event: React.FormEvent) => {\n    event.preventDefault();\n    event.stopPropagation();\n\n    await engine.handleSubmit(event);\n  };\n\n  return (\n    <FormContext.Provider value={engine}>\n      <Component\n        ref={(form: any) => {\n          engine.formElement = form ? form.root || form : form;\n        }}\n        id={id}\n        noValidate\n        onSubmit={handleSubmit}\n        {...otherProps}\n      >\n        {children}\n      </Component>\n    </FormContext.Provider>\n  );\n}) as unknown as FormComponent;\n","\"use client\";\n\nimport { useMemo } from \"react\";\n\n/**\n * Derive a stable DOM id for a form control from its `id` prop or `name`.\n *\n * Renamed from `useId` in v4 so the package root no longer shadows React 18's\n * `useId` for `import { useId } from \"@mongez/react-form\"`.\n */\nexport function useControlId(data: { id?: string; name: string }) {\n  return useMemo(() => {\n    if (data.id) return data.id;\n\n    const name = data.name\n      // replace all . to -\n      .replace(/\\./g, \"-\")\n      // remove any non-alphanumeric characters\n      .replace(/[^a-zA-Z0-9-]/g, \"\")\n      // reduce any dashes to a single dash\n      .replace(/-+/g, \"-\")\n      // remove any leading or trailing dashes\n      .replace(/^-+|-+$/g, \"\");\n\n    if (data.name) return `input-${name}`;\n\n    return \"input-\" + Math.random().toString(36).substring(2, 9);\n  }, [data.id, data.name]);\n}\n","\"use client\";\n\nimport { useContext } from \"react\";\r\nimport { FormContext } from \"../contexts/FormContext\";\r\nimport { FormContextData } from \"../types\";\r\n\r\nexport function useForm(): FormContextData {\r\n  return useContext<FormContextData>(FormContext);\r\n}\r\n","\"use client\";\n\nimport { useEffect, useRef, useState } from \"react\";\nimport { FieldArrayHelpers, FieldArrayItem } from \"../types\";\nimport { useForm } from \"./useForm\";\n\n/**\n * Manage a dynamic list of repeated field rows (add / remove / reorder) with\n * **stable keys** that survive reordering and removal.\n *\n * Rows are keyed by a stable `key`; each row's input names derive from its\n * current `index` (`addresses.0.city`, `addresses.1.city`, …), so the form's\n * dot-notation collection nests them into an array automatically. Because rows\n * keep their identity, a surviving row carries its own value when others are\n * removed or moved.\n *\n * ```tsx\n * const { fields, append, remove } = useFieldArray(\"addresses\");\n *\n * {fields.map((field) => (\n *   <div key={field.key}>\n *     <TextInput name={`${field.name}.city`} />\n *     <button type=\"button\" onClick={() => remove(field.index)}>Remove</button>\n *   </div>\n * ))}\n * <button type=\"button\" onClick={() => append()}>Add address</button>\n * ```\n */\nexport function useFieldArray(name: string): FieldArrayHelpers {\n  const form = useForm();\n\n  const keyCounter = useRef(0);\n\n  const makeKey = () => `${name}-${keyCounter.current++}`;\n\n  const makeKeys = (count: number) =>\n    Array.from({ length: Math.max(0, count) }, () => makeKey());\n\n  const [keys, setKeys] = useState<string[]>(() => {\n    const initial = form?.getInitialValue(name);\n    const length = Array.isArray(initial) ? initial.length : 0;\n    return makeKeys(length);\n  });\n\n  // Snapshot of the initial row count, restored on form reset.\n  const initialLength = useRef(keys.length);\n\n  useEffect(() => {\n    if (!form) return;\n\n    // Grow rows to match data that arrives after mount (reactive `values` /\n    // `form.fill()`), so async edit forms render every loaded row. Never\n    // shrinks — explicit removal is the user's call.\n    const changeEvent = form.on(\"change\", () => {\n      const hydrated = form.getInitialValue(name);\n      const length = Array.isArray(hydrated) ? hydrated.length : 0;\n\n      setKeys((current) =>\n        length > current.length\n          ? [...current, ...makeKeys(length - current.length)]\n          : current\n      );\n    });\n\n    const resetEvent = form.on(\"reset\", () => {\n      setKeys(makeKeys(initialLength.current));\n    });\n\n    return () => {\n      changeEvent.unsubscribe();\n      resetEvent.unsubscribe();\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [form]);\n\n  const fields: FieldArrayItem[] = keys.map((key, index) => ({\n    key,\n    index,\n    name: `${name}.${index}`,\n  }));\n\n  const append = (count = 1) =>\n    setKeys((current) => [...current, ...makeKeys(count)]);\n\n  const prepend = (count = 1) =>\n    setKeys((current) => [...makeKeys(count), ...current]);\n\n  const remove = (index?: number) =>\n    setKeys((current) => {\n      if (index === undefined) return current.slice(0, -1);\n      const next = [...current];\n      next.splice(index, 1);\n      return next;\n    });\n\n  const insert = (index: number) =>\n    setKeys((current) => {\n      const next = [...current];\n      next.splice(index, 0, makeKey());\n      return next;\n    });\n\n  const move = (from: number, to: number) =>\n    setKeys((current) => {\n      const next = [...current];\n      const [moved] = next.splice(from, 1);\n      next.splice(to, 0, moved);\n      return next;\n    });\n\n  const swap = (a: number, b: number) =>\n    setKeys((current) => {\n      const next = [...current];\n      [next[a], next[b]] = [next[b], next[a]];\n      return next;\n    });\n\n  const replace = (count: number) => setKeys(makeKeys(count));\n\n  return { fields, append, prepend, remove, insert, move, swap, replace };\n}\n","\"use client\";\n\nimport events, { EventSubscription } from \"@mongez/events\";\nimport { ReactNode, useEffect, useMemo, useRef, useState } from \"react\";\nimport { getFormConfig } from \"../configurations\";\nimport { standardSchemaToRule } from \"../standard-schema/adapter\";\nimport {\n  FormContextData,\n  FormControl,\n  FormControlChangeOptions,\n  FormControlHook,\n  FormControlOptions,\n  FormControlProps,\n  InputRule,\n  InputRuleOptions,\n  ValidateOn,\n} from \"../types\";\nimport { useControlId } from \"./form-hooks\";\nimport { useForm } from \"./useForm\";\n\nexport const defaultFormControlOptions = {\n  collectUnchecked: true,\n  uncheckedValue: false,\n  transformValue: (value: any, formControl?: FormControl) => {\n    if (formControl?.multiple && !Array.isArray(value)) {\n      return [value];\n    }\n\n    return value;\n  },\n};\n\n/**\n * Sentinel returned by the per-rule applier when a rule passed (or was a\n * non-short-circuiting failure under `validateAll`) so the pipeline keeps going.\n */\nconst VALIDATION_CONTINUE = Symbol(\"validation.continue\");\n\nconst isDomAvailable = () =>\n  typeof document !== \"undefined\" && typeof window !== \"undefined\";\n\nconst isElementOrAncestorHidden = (element: HTMLElement) => {\n  if (!element) {\n    return false;\n  }\n\n  if (element.hidden) {\n    return true;\n  }\n\n  if (!element.parentElement) {\n    return false;\n  }\n\n  return isElementOrAncestorHidden(element.parentElement);\n};\n\nconst initializeValue = (\n  props: FormControlProps,\n  options: FormControlOptions,\n  form: FormContextData,\n  name: string\n) => {\n  if (![undefined, null].includes(props.value)) {\n    return options.transformValue?.(props.value);\n  }\n\n  if (![undefined, null].includes(props.defaultValue)) {\n    return options.transformValue?.(props.defaultValue);\n  }\n\n  if (form && name) {\n    const value = form.getInitialValue(name);\n\n    if (value !== undefined) return value;\n  }\n\n  return props.multiple ? [] : \"\";\n};\n\nexport function useFormControl<T extends FormControlProps>(\n  baseProps: T,\n  incomingFormControlOptions: FormControlOptions = {}\n) {\n  const {\n    id: incomingId,\n    name: incomingName,\n    onChange,\n    rules = [],\n    errors = {},\n    type = \"text\",\n    errorKeys = {},\n    onError,\n    disabled: incomingDisabled,\n    validate: incomingValidate,\n    schema: incomingSchema,\n    validateOn: incomingValidateOn,\n    value: incomingValue,\n    defaultValue: _dv,\n    checked: _checked,\n    defaultChecked: _defaultChecked,\n    ...props\n  } = baseProps;\n\n  const name = useMemo(\n    () =>\n      String(incomingName)\n        .replace(\"][\", \".\")\n        .replace(\"[\", \".\")\n        .replace(\"]\", \"\"),\n    [incomingName]\n  );\n\n  const id = useControlId({\n    id: incomingId,\n    name,\n  });\n\n  const errorId = `${id}-error`;\n\n  const formControlOptions = {\n    ...defaultFormControlOptions,\n    ...incomingFormControlOptions,\n  };\n\n  const [disabled, setDisabled] = useState(Boolean(incomingDisabled));\n\n  const inputRef = useRef<any>();\n  const visibleElementRef = useRef<any>();\n  const form = useForm();\n\n  // Monotonic token guarding against stale async validation results: each\n  // validation run captures the current value; if a newer run starts before an\n  // async rule resolves, the stale result is discarded.\n  const validationSeq = useRef(0);\n\n  // Count of async validation runs still in flight. `isValidating` clears only\n  // when this returns to 0, so a sync run that supersedes an async run cannot\n  // leave the flag stuck `true`.\n  const asyncInFlight = useRef(0);\n\n  const [state, setState] = useState<{\n    error: ReactNode;\n    value: any;\n    checked: boolean;\n    isValidating: boolean;\n  }>(() => {\n    return {\n      error: null,\n      isValidating: false,\n      value: initializeValue(baseProps, formControlOptions, form, name),\n      checked:\n        _checked ??\n        (_defaultChecked !== undefined\n          ? _defaultChecked\n          : (form && name ? form.getInitialValue(name) : undefined) ??\n            (type === \"checkbox\" ? false : undefined)),\n    };\n  });\n\n  const { value, checked, error, isValidating } = state;\n\n  const updateError = (error: ReactNode) => {\n    setState((state) => ({\n      ...state,\n      error,\n    }));\n  };\n\n  const setError = (error: ReactNode) => {\n    updateError(error);\n    onError?.(error);\n  };\n\n  const setValidating = (isValidating: boolean) => {\n    setState((state) => ({\n      ...state,\n      isValidating,\n    }));\n  };\n\n  const setValue = (value = formControl.value) => {\n    setState((state) => ({\n      ...state,\n      value,\n    }));\n  };\n\n  const setCheckedState = (checked: boolean) => {\n    setState((state) => ({\n      ...state,\n      checked,\n    }));\n  };\n\n  const updateFormControlValidityState = (error: any) => {\n    formControl.error = error;\n    formControl.isValid = !error;\n\n    if (error) {\n      form?.invalidControl(formControl);\n    } else {\n      form?.validControl(formControl);\n    }\n\n    form?.checkIfIsValid();\n  };\n\n  /**\n   * Resolve the active validation trigger: per-control > form-level > global\n   * config > `\"change\"`.\n   */\n  const resolveValidateOn = (): ValidateOn =>\n    (incomingValidateOn as ValidateOn) ||\n    form?.validateOn ||\n    (getFormConfig(\"validateOn\", \"change\") as ValidateOn);\n\n  /**\n   * Whether a value change should trigger validation now. For `\"blur\"` /\n   * `\"submit\"` modes we still revalidate on change once the field has already\n   * errored or the form has been submitted — so cleared errors update live.\n   */\n  const shouldValidateOnChange = (): boolean => {\n    const mode = resolveValidateOn();\n\n    if (mode === \"change\") return true;\n\n    return formControl.isValid === false || form?.wasSubmitted === true;\n  };\n\n  /**\n   * Build the ordered rule list: per-instance `validate` first, then the\n   * passed `rules`, then a per-field `schema` (if any) last.\n   */\n  const buildRules = (): InputRule[] => {\n    const list: InputRule[] = [];\n\n    if (incomingValidate) {\n      list.push({\n        validate: incomingValidate,\n        name: \"custom\",\n        requiresValue: true,\n      });\n    }\n\n    list.push(...rules);\n\n    const schema = incomingSchema || incomingFormControlOptions.schema;\n\n    if (schema) {\n      list.push(standardSchemaToRule(schema, \"schema\"));\n    }\n\n    return list;\n  };\n\n  /**\n   * Run the rule pipeline. Returns `{ error, errorsList }` synchronously when\n   * every rule resolves synchronously (preserving the engine's original\n   * timing), and a `Promise` of the same shape only when a rule returns one —\n   * so async validation genuinely gates submission without making the common\n   * sync path async.\n   *\n   * Each run owns a fresh `errorsList` (assigned onto `formControl.errorsList`\n   * up front so rules like `strongRule` that write per-criterion keys land in\n   * it). The committer reassigns `formControl.errorsList` only for the latest\n   * run, so a discarded stale async run cannot poison a fresh result.\n   */\n  const runValidationRules = ():\n    | { error: ReactNode; errorsList: Record<string, ReactNode> }\n    | Promise<{ error: ReactNode; errorsList: Record<string, ReactNode> }> => {\n    if (!errorKeys.name) {\n      errorKeys.name = String(baseProps.label || baseProps.placeholder || name);\n    }\n\n    const runErrors: Record<string, ReactNode> = {};\n\n    // Expose this run's error map to the rules (strongRule et al. write here).\n    formControl.errorsList = runErrors;\n\n    const validationData: InputRuleOptions = {\n      ...baseProps,\n      value: formControl.value,\n      name,\n      checked: formControl.checked,\n      formControl,\n      errorKeys,\n      form,\n    };\n\n    const rulesList = buildRules();\n\n    const applyResult = (\n      rule: InputRule,\n      result: ReactNode\n    ): ReactNode | typeof VALIDATION_CONTINUE => {\n      if (result) {\n        const ruleName = rule.name || \"custom\";\n        const errorMessage = errors[ruleName] || result;\n\n        runErrors[ruleName] = errorMessage;\n\n        if (!incomingFormControlOptions.validateAll) {\n          return errorMessage;\n        }\n      }\n\n      return VALIDATION_CONTINUE;\n    };\n\n    const finalize = (): ReactNode => {\n      if (\n        Object.keys(runErrors).length > 0 &&\n        !incomingFormControlOptions.validateAll\n      ) {\n        return Object.keys(runErrors).map((key) => runErrors[key]);\n      }\n\n      return null;\n    };\n\n    const process = (\n      index: number\n    ):\n      | { error: ReactNode; errorsList: Record<string, ReactNode> }\n      | Promise<{ error: ReactNode; errorsList: Record<string, ReactNode> }> => {\n      for (let i = index; i < rulesList.length; i++) {\n        const rule = rulesList[i];\n\n        if (rule.requiresType && rule.requiresType !== formControl.type)\n          continue;\n\n        const requiresValue =\n          rule.requiresValue === undefined || rule.requiresValue;\n\n        if (\n          requiresValue &&\n          [undefined, null, \"\"].includes(formControl.value)\n        ) {\n          continue;\n        }\n\n        const result = rule.validate(validationData) as\n          | ReactNode\n          | Promise<ReactNode>;\n\n        if (result instanceof Promise) {\n          return result.then((resolved) => {\n            const applied = applyResult(rule, resolved as ReactNode);\n\n            if (applied !== VALIDATION_CONTINUE) {\n              return { error: applied, errorsList: runErrors };\n            }\n\n            return process(i + 1);\n          });\n        }\n\n        const applied = applyResult(rule, result as ReactNode);\n\n        if (applied !== VALIDATION_CONTINUE) {\n          return { error: applied, errorsList: runErrors };\n        }\n      }\n\n      return { error: finalize(), errorsList: runErrors };\n    };\n\n    return process(0);\n  };\n\n  /**\n   * Validate the control and commit the result (error + validity). Sync rules\n   * commit synchronously; async rules flip `isValidating` and commit on resolve.\n   *\n   * Stale-result handling uses two independent guards:\n   * - a sequence token (`validationSeq`) so only the latest run commits its\n   *   error / validity / errorsList;\n   * - an in-flight counter (`asyncInFlight`) so `isValidating` clears exactly\n   *   when the last outstanding async run settles — even if a later *sync* run\n   *   superseded it (which previously left the flag stuck `true`).\n   */\n  const validateFormControl = (): ReactNode | Promise<ReactNode> => {\n    const seq = ++validationSeq.current;\n\n    const outcome = runValidationRules();\n\n    if (outcome instanceof Promise) {\n      asyncInFlight.current++;\n      formControl.isValidating = true;\n      setValidating(true);\n\n      return outcome.then((result) => {\n        const isLatest = seq === validationSeq.current;\n        const settledAll = --asyncInFlight.current === 0;\n\n        if (settledAll) {\n          formControl.isValidating = false;\n          setValidating(false);\n        }\n\n        if (!isLatest) {\n          // Superseded run: discard its error/validity/errorsList entirely.\n          return result.error;\n        }\n\n        formControl.errorsList = result.errorsList;\n        setError(result.error);\n        updateFormControlValidityState(result.error);\n\n        return result.error;\n      });\n    }\n\n    // Sync completion. If an async run was superseded by this one, it stays\n    // in-flight and will clear `isValidating` when it settles; only clear here\n    // when nothing async is pending.\n    if (asyncInFlight.current === 0 && formControl.isValidating) {\n      formControl.isValidating = false;\n      setValidating(false);\n    }\n\n    formControl.errorsList = outcome.errorsList;\n    setError(outcome.error);\n    updateFormControlValidityState(outcome.error);\n\n    return outcome.error;\n  };\n\n  // Reset baseline — what `form.reset()` restores this control to. It prefers\n  // an explicit `defaultValue` (control- then form-level) over the reactive\n  // hydration snapshot, so live-loaded `values` never become the reset target.\n  // Falls back to the initial display value when no default exists.\n  const resetBaseline = (() => {\n    if (![undefined, null].includes(baseProps.value)) {\n      return formControlOptions.transformValue?.(baseProps.value);\n    }\n\n    if (![undefined, null].includes(baseProps.defaultValue)) {\n      return formControlOptions.transformValue?.(baseProps.defaultValue);\n    }\n\n    if (form && name) {\n      const baseline = form.getResetBaseline(name);\n      if (baseline !== undefined) return baseline;\n    }\n\n    return value;\n  })();\n\n  const formControl: FormControl = useMemo(() => {\n    const formControlData: FormControl = {\n      initialValue: resetBaseline,\n      initialChecked: checked,\n      collectUnchecked: formControlOptions.collectUnchecked,\n      uncheckedValue: formControlOptions.uncheckedValue,\n      value,\n      isDirty: false,\n      isValidating: false,\n      errorsList: {},\n      isTouched: false,\n      isControlled:\n        baseProps.value !== undefined || baseProps.checked !== undefined,\n      id,\n      name,\n      checked,\n      defaultValue: _dv,\n      disabled,\n      isValid: null, // null means not validated yet\n      disable(isDisabled) {\n        isDisabled = Boolean(isDisabled);\n        setDisabled(isDisabled);\n        formControl.disabled = isDisabled;\n      },\n      type,\n      inputRef,\n      rendered: false,\n      visibleElementRef,\n      error,\n      setError,\n      props: baseProps,\n      setChecked: (checked: boolean) => {\n        formControl.checked = checked;\n        formControl.isDirty = true;\n\n        setCheckedState(checked);\n\n        if (shouldValidateOnChange()) {\n          validateFormControl();\n        }\n\n        onChange?.(checked, {\n          formControl,\n        });\n\n        // Emit the same wrapper shape as change() so `formControl.onChange`\n        // subscribers always receive `{ value, checked, formControl }`.\n        events.trigger(`form.control.${id}.change`, {\n          value: formControl.value,\n          checked: formControl.checked,\n          formControl,\n        });\n      },\n      isVisible: () => {\n        // On non-DOM platforms (e.g. React Native) we cannot inspect the\n        // rendered tree for visibility, so treat every control as visible.\n        if (!isDomAvailable()) return true;\n        return isElementOrAncestorHidden(visibleElementRef.current) === false;\n      },\n      focus: () => {\n        inputRef.current?.focus();\n      },\n      blur: () => {\n        inputRef.current?.blur();\n      },\n      clear: () => {\n        formControl.cancelValidation();\n\n        formControl.change(formControl.multiple ? [] : \"\", {\n          updateState: true,\n          validate: false,\n          checked: false,\n        });\n\n        formControl.setError(null);\n        formControl.isValid = null;\n        formControl.isDirty = false;\n        formControl.isTouched = false;\n\n        events.trigger(`form.control.${id}.clear`, formControl);\n      },\n      cancelValidation: () => {\n        // Invalidate any in-flight async run (so it won't commit) and clear the\n        // validating flag. The pending run still settles and decrements the\n        // in-flight counter; it just won't apply its result.\n        validationSeq.current++;\n\n        if (formControl.isValidating) {\n          formControl.isValidating = false;\n          setValidating(false);\n        }\n      },\n      reset: () => {\n        formControl.cancelValidation();\n\n        // Clear the dirty flag BEFORE firing change() so the form-level\n        // listener registered in FormEngine.register sees `isDirty === false`\n        // and removes this control from `dirtyControls`. We pass\n        // `dirty: false` so change() does not clobber the flag back to true.\n        formControl.isDirty = false;\n\n        formControl.change(formControl.initialValue, {\n          checked: formControl.initialChecked,\n          updateState: true,\n          validate: false,\n          dirty: false,\n        });\n\n        formControl.setError(null);\n        formControl.isValid = null;\n        formControl.isDirty = false;\n        formControl.isTouched = false;\n\n        events.trigger(`form.control.${id}.reset`, formControl);\n      },\n      multiple: formControlOptions.multiple,\n      validate: validateFormControl,\n      change(\n        value,\n        {\n          updateState = true,\n          validate = true,\n          dirty = true,\n          ...other\n        }: FormControlChangeOptions = {}\n      ) {\n        if (value !== undefined) {\n          value = formControlOptions.transformValue?.(value, formControl);\n          formControl.value = value;\n        }\n\n        if (typeof other.checked !== \"undefined\") {\n          formControl.checked = other.checked;\n        }\n\n        formControl.isDirty = dirty;\n\n        events.trigger(`form.control.${id}.change`, {\n          value: formControl.value,\n          checked: formControl.checked,\n          ...other,\n          formControl,\n        });\n\n        if (updateState) {\n          // Value updates synchronously so the rendered input and\n          // `form.value(name)` reflect the change immediately. Validation is\n          // separate and may resolve asynchronously.\n          if (other.checked !== undefined) {\n            setCheckedState(formControl.checked);\n          }\n\n          setValue(formControl.value);\n\n          if (validate && shouldValidateOnChange()) {\n            validateFormControl();\n          }\n        }\n      },\n      onChange: (callback: any) => {\n        return events.subscribe(`form.control.${id}.change`, callback);\n      },\n      onDestroy: (callback: any) => {\n        return events.subscribe(`form.control.${id}.destroy`, callback);\n      },\n      onReset: (callback: any) => {\n        return events.subscribe(`form.control.${id}.reset`, callback);\n      },\n      onClear: (callback: any) => {\n        return events.subscribe(`form.control.${id}.clear`, callback);\n      },\n      unregister() {\n        events.trigger(`form.control.${id}.destroy`, formControl);\n      },\n      isCollectable() {\n        if (formControlOptions.isCollectable) {\n          return formControlOptions.isCollectable(formControl);\n        }\n\n        if (formControl.disabled) return false;\n\n        if (\n          [\"checkbox\", \"radio\"].includes(formControl.type) &&\n          !formControl.checked\n        ) {\n          return Boolean(formControlOptions.collectUnchecked);\n        }\n\n        return formControl.value !== undefined && formControl.value !== null;\n      },\n      collectValue() {\n        if (formControlOptions.collectValue) {\n          return formControlOptions.collectValue(formControl);\n        }\n\n        if ([\"checkbox\", \"radio\"].includes(formControl.type)) {\n          if (\n            !formControl.checked &&\n            formControlOptions.uncheckedValue !== undefined\n          ) {\n            return formControlOptions.uncheckedValue;\n          } else if (formControl.checked) {\n            return formControl.value || true;\n          }\n\n          return false;\n        }\n\n        if (formControl.multiple && !Array.isArray(formControl.value)) {\n          return [formControl.value];\n        }\n\n        return formControl.value;\n      },\n    };\n\n    return formControlData;\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n\n  // Hold a stable reference to the latest rest props so the `onInit` effect\n  // below does not need `props` (a fresh object every render) as a dep.\n  const latestPropsRef = useRef(props);\n  latestPropsRef.current = props;\n\n  // Build a stable identity for `rules` so consumers passing a fresh\n  // array literal each render do not retrigger the `onInit` subscription\n  // loop below. Two arrays with the same rule names (in the same order)\n  // are treated as equal.\n  const rulesKey = useMemo(\n    () =>\n      rules.map((rule, index) => rule.name ?? `__anonymous_${index}`).join(\"|\"),\n    [rules]\n  );\n\n  useEffect(() => {\n    // now find all rules that have onInit method and call it\n    const subscriptions: EventSubscription[] = [];\n    for (const rule of rules) {\n      if ((rule as any).onInit) {\n        const output = (rule as any).onInit({\n          formControl,\n          form,\n          ...latestPropsRef.current,\n        });\n\n        if (output) {\n          subscriptions.push(output);\n        }\n      }\n    }\n\n    return () => {\n      subscriptions.forEach((subscription) => subscription?.unsubscribe());\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [form, formControl, rulesKey]);\n\n  const changeValue = (value: any, options: any) => {\n    formControl.change(value, {\n      ...options,\n      updateState: !formControl.isControlled,\n    });\n\n    onChange?.(value, {\n      ...options,\n      formControl,\n    });\n  };\n\n  /**\n   * Blur handler — marks the control touched and triggers validation when the\n   * resolved mode is `\"blur\"`.\n   */\n  const handleBlur = () => {\n    formControl.isTouched = true;\n\n    if (resolveValidateOn() === \"blur\") {\n      validateFormControl();\n    }\n  };\n\n  useEffect(() => {\n    if (!formControl.isControlled || formControl.rendered === false) return;\n\n    formControl.change(incomingValue);\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [incomingValue]);\n\n  useEffect(() => {\n    if (!formControl.isControlled || formControl.rendered === false) {\n      return;\n    }\n\n    formControl.checked = _checked;\n    formControl.isDirty = true;\n\n    setCheckedState(_checked as boolean);\n\n    if (shouldValidateOnChange()) {\n      validateFormControl();\n    }\n\n    // Consistent wrapper payload (see setChecked / change).\n    events.trigger(`form.control.${id}.change`, {\n      value: formControl.value,\n      checked: formControl.checked,\n      formControl,\n    });\n\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [_checked]);\n\n  useEffect(() => {\n    formControl.disable(Boolean(incomingDisabled));\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [incomingDisabled]);\n\n  useEffect(() => {\n    // Check if the form control is touched.\n    // This hook auto-binds a `focus` listener on the DOM input to mark the\n    // control as touched. On React Native there is no DOM, so we skip it —\n    // native inputs should set `formControl.isTouched = true` from their\n    // own `onFocus` handler if touched-state tracking is needed.\n    if (formControl.isTouched) return;\n    if (!isDomAvailable()) return;\n\n    const input: HTMLInputElement | undefined =\n      formControl.inputRef?.current || document.getElementById(formControl.id);\n\n    if (!input || typeof (input as any).addEventListener !== \"function\") return;\n\n    const updateTouchState = () => (formControl.isTouched = true);\n\n    input.addEventListener(\"focus\", updateTouchState);\n\n    return () => {\n      input.removeEventListener(\"focus\", updateTouchState);\n    };\n  }, [formControl]);\n\n  useEffect(() => {\n    // Keep the frozen formControl identity's name in sync with the latest\n    // (memoized) name. This is what makes `useFieldArray` reorders/removals\n    // carry each row's value: when a row's index shifts, its input name\n    // changes, this effect re-runs, and the control is re-registered under the\n    // new name while keeping its (persisted) value.\n    formControl.name = name;\n\n    // Mark as committed synchronously (post-commit) so the controlled-prop sync\n    // effects above — which run before this on mount and bail while\n    // `rendered === false` — proceed on subsequent updates.\n    formControl.rendered = true;\n\n    let resetEvent: EventSubscription | undefined;\n    if (form) {\n      form.register(formControl);\n      resetEvent = form.on(\"reset\", formControl.reset);\n    }\n\n    return () => {\n      // Abandon any in-flight async validation so its `.then` doesn't retain\n      // this (now unmounted) control's closure and won't setState after unmount.\n      formControl.cancelValidation();\n\n      if (form) {\n        form.unregister(formControl);\n      } else {\n        formControl.unregister();\n      }\n\n      resetEvent?.unsubscribe();\n    };\n  }, [form, formControl, name]);\n\n  // Stable signature of the rest props so `outputProps` keeps a stable identity\n  // across renders when the props are shallowly unchanged (the raw `props`\n  // object is a fresh literal every render, which would bust the memo).\n  const propsSignature = Object.keys(props)\n    .sort()\n    .map((key) => `${key}=${String((props as any)[key])}`)\n    .join(\"&\");\n\n  const outputProps = useMemo(() => {\n    let finalProps = { ...props };\n\n    const except = (props: any, keys: string[]) => {\n      const newProps = { ...props };\n      for (const key of keys) {\n        delete newProps[key];\n      }\n      return newProps;\n    };\n\n    for (const rule of rules) {\n      if (rule.preservedProps) {\n        finalProps = except(finalProps, rule.preservedProps);\n      }\n    }\n\n    return finalProps;\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [rulesKey, propsSignature]);\n\n  const getInputProps = (overrides: Record<string, any> = {}) => {\n    const isCheckable = [\"checkbox\", \"radio\"].includes(type);\n\n    const base: Record<string, any> = {\n      id,\n      name,\n      ref: inputRef,\n      disabled,\n      onBlur: handleBlur,\n      // Drive both ARIA attributes off the displayed `error` so they stay\n      // consistent: when an error is shown, the input is marked invalid AND\n      // points at the error node (was previously gated on `isTouched`, which\n      // left a submit-revealed error described but not marked invalid).\n      \"aria-invalid\": error ? true : undefined,\n      \"aria-required\": baseProps.required || undefined,\n      \"aria-describedby\": error ? errorId : undefined,\n    };\n\n    if (isCheckable) {\n      base.checked = Boolean(checked);\n      base.onChange = (e: any) =>\n        formControl.setChecked(e?.target ? e.target.checked : Boolean(e));\n    } else {\n      base.value = value ?? \"\";\n      base.onChange = (e: any) =>\n        changeValue(e?.target ? e.target.value : e, undefined);\n    }\n\n    return { ...base, ...outputProps, ...overrides };\n  };\n\n  const getErrorProps = () => ({\n    id: errorId,\n    role: \"alert\" as const,\n    \"aria-live\": \"polite\" as const,\n  });\n\n  const output: FormControlHook = {\n    id,\n    name,\n    value,\n    type,\n    error,\n    errorId,\n    setError,\n    inputRef,\n    visibleElementRef,\n    formControl,\n    validate: validateFormControl,\n    changeValue,\n    onBlur: handleBlur,\n    checked,\n    disabled,\n    isValidating,\n    errorsList: formControl.errorsList,\n    disable: formControl.disable.bind(formControl, true),\n    enable: formControl.disable.bind(formControl, false),\n    setChecked: formControl.setChecked.bind(formControl),\n    otherProps: outputProps,\n    getInputProps,\n    getErrorProps,\n    get isInvalid() {\n      return formControl.isTouched && formControl.isValid === false;\n    },\n  };\n\n  return output;\n}\n","\"use client\";\n\nimport { ReactNode, useEffect, useState } from \"react\";\nimport { FormContextData } from \"../types\";\nimport { useForm } from \"./useForm\";\n\nexport type FormState = {\n  /** Whether the form currently has no invalid controls. */\n  isValid: boolean;\n  /** Whether any control has been changed from its initial value. */\n  isDirty: boolean;\n  /** Whether the form is mid-submit. */\n  isSubmitting: boolean;\n  /** Whether the form has attempted submission at least once. */\n  isSubmitted: boolean;\n  /** Whether any control has an async validation in flight. */\n  isValidating: boolean;\n  /** Form-level errors with no owning control (whole-form schema). */\n  formErrors: ReactNode[];\n};\n\nconst emptyState: FormState = {\n  isValid: true,\n  isDirty: false,\n  isSubmitting: false,\n  isSubmitted: false,\n  isValidating: false,\n  formErrors: [],\n};\n\nfunction readState(form: FormContextData): FormState {\n  if (!form) return emptyState;\n\n  return {\n    isValid: form.isValid(),\n    isDirty: form.isDirty,\n    isSubmitting: form.isSubmitting(),\n    isSubmitted: form.wasSubmitted,\n    isValidating: form.controls().some((control) => control.isValidating),\n    formErrors: form.formErrors,\n  };\n}\n\n/**\n * One-stop reactive snapshot of form-level state — `isValid`, `isDirty`,\n * `isSubmitting`, `isSubmitted`, `isValidating`, and `formErrors` — for any\n * descendant of a `Form` / `NativeForm`.\n *\n * ```tsx\n * const { isValid, isSubmitting, isDirty } = useFormState();\n * <button disabled={!isValid || isSubmitting || !isDirty}>Save</button>\n * ```\n */\nexport function useFormState(): FormState {\n  const form = useForm();\n  const [state, setState] = useState<FormState>(() => readState(form));\n\n  useEffect(() => {\n    if (!form) return;\n\n    const update = () => setState(readState(form));\n\n    const subscriptions = [\n      form.on(\"validControls\", update),\n      form.on(\"invalidControls\", update),\n      form.on(\"validation\", update),\n      form.on(\"dirty\", update),\n      form.on(\"submitting\", update),\n      form.on(\"submit\", update),\n      form.on(\"reset\", update),\n      form.on(\"change\", update),\n    ];\n\n    // Sync once on mount in case state changed between render and effect.\n    update();\n\n    return () => {\n      subscriptions.forEach((subscription) => subscription.unsubscribe());\n    };\n  }, [form]);\n\n  return state;\n}\n","\"use client\";\n\nimport React from \"react\";\r\n\r\nexport function useInputValue<T>(initialValue: T) {\r\n  const [value, setValue] = React.useState<T>(initialValue);\r\n\r\n  const valueDetector: (e: any) => void = (e: any): void => {\r\n    if (e === 0) {\r\n      setValue(e);\r\n    } else if (!e) {\r\n      setValue(\"\" as T);\r\n    } else if (e.target?.value !== undefined) {\r\n      setValue(e.target.value);\r\n    } else if (e.value !== undefined) {\r\n      setValue(e.value);\r\n    } else {\r\n      setValue(e);\r\n    }\r\n  };\r\n\r\n  const returnedState: [T, (e: any) => void] = [value, valueDetector];\r\n\r\n  return returnedState;\r\n}\r\n","\"use client\";\n\nimport { createContext, useContext } from \"react\";\r\n\r\ntype Value = string | number | boolean;\r\n\r\nexport type RadioGroupContextOptions = {\r\n  value: Value;\r\n  changeValue: (value: Value) => void;\r\n};\r\n\r\nexport const RadioGroupContext = createContext<RadioGroupContextOptions>({\r\n  value: \"\",\r\n  changeValue: () => {},\r\n});\r\n\r\nexport type RadioInputHookOutput = {\r\n  isSelected: boolean;\r\n  changeValue: () => void;\r\n};\r\n\r\nexport function useRadioInput(value: Value): RadioInputHookOutput {\r\n  const context = useContext(RadioGroupContext);\r\n\r\n  if (!context) {\r\n    throw new Error(\"useRadioInput must be used within a RadioGroupContext\");\r\n  }\r\n\r\n  const { value: groupValue, changeValue } = context;\r\n\r\n  return {\r\n    isSelected: groupValue === value,\r\n    changeValue: () => changeValue(value),\r\n  };\r\n}\r\n","\"use client\";\n\nimport { useEffect, useState } from \"react\";\r\nimport { useForm } from \"./useForm\";\r\n\r\nexport function useSubmitButton() {\r\n  const [isSubmitting, setSubmitState] = useState(false);\r\n  const [disabled, disable] = useState(false);\r\n  const form = useForm();\r\n  const [isDirty, setIsDirty] = useState(form?.isDirty ?? false);\r\n\r\n  useEffect(() => {\r\n    if (!form) return;\r\n\r\n    const onSubmit = form.on(\"submit\", () => {\r\n      setSubmitState(form.isSubmitting());\r\n      disable(form.isSubmitting());\r\n    });\r\n\r\n    const inValidControls = form.on(\"invalidControls\", () => {\r\n      disable(true);\r\n    });\r\n\r\n    const isDisabledEvent = form.on(\"disable\", disable as any);\r\n    const validControl = form.on(\"validControls\", () => disable(false));\r\n    const resetEvent = form.on(\"reset\", () => disable(false));\r\n    const dirtyEvent = form.on(\"dirty\", () => setIsDirty(form.isDirty));\r\n\r\n    return () => {\r\n      onSubmit.unsubscribe();\r\n      validControl.unsubscribe();\r\n      inValidControls.unsubscribe();\r\n      isDisabledEvent.unsubscribe();\r\n      resetEvent.unsubscribe();\r\n      dirtyEvent.unsubscribe();\r\n    };\r\n  }, [form]);\r\n\r\n  return {\r\n    isSubmitting,\r\n    disabled,\r\n    disable,\r\n    setSubmitState,\r\n    isDirty,\r\n  };\r\n}\r\n","\"use client\";\n\nimport { useEffect, useReducer, useRef } from \"react\";\nimport { useForm } from \"./useForm\";\n\n/**\n * Shallow equality used to decide whether a watched value actually changed.\n * Primitives compare by `Object.is`; arrays compare element-wise (for the\n * `names[]` form). Two fresh objects (the `watch-all` case) never compare equal,\n * so `useWatch()` still re-renders on every change — that is inherent.\n */\nfunction isSameWatched(a: any, b: any): boolean {\n  if (Object.is(a, b)) return true;\n\n  if (Array.isArray(a) && Array.isArray(b)) {\n    return a.length === b.length && a.every((value, i) => Object.is(value, b[i]));\n  }\n\n  return false;\n}\n\n/**\n * Reactively read form values from any descendant of a `Form` / `NativeForm`.\n *\n * - `useWatch()` → the whole collected values object (re-renders on any change).\n * - `useWatch(\"user.email\")` → that single control's current value.\n * - `useWatch([\"a\", \"b\"])` → an array of those controls' values.\n *\n * For the single / `names[]` forms the component re-renders **only when the\n * watched value(s) change**, not on every unrelated field change.\n */\nexport function useWatch(): Record<string, any>;\nexport function useWatch(name: string): any;\nexport function useWatch(names: string[]): any[];\nexport function useWatch(name?: string | string[]): any {\n  const form = useForm();\n  const [, rerender] = useReducer((count: number) => count + 1, 0);\n\n  const read = () => {\n    if (!form) {\n      if (name === undefined) return {};\n      return Array.isArray(name) ? name.map(() => undefined) : undefined;\n    }\n\n    if (name === undefined) return form.values();\n    if (Array.isArray(name)) return name.map((control) => form.value(control));\n    return form.value(name);\n  };\n\n  const current = read();\n\n  // Latest rendered value, compared against on each change event.\n  const latest = useRef(current);\n  latest.current = current;\n\n  // Stable dependency for the `names[]` form so a fresh array literal each\n  // render does not re-subscribe.\n  const nameKey = Array.isArray(name) ? name.join(\"|\") : name;\n\n  useEffect(() => {\n    if (!form) return;\n\n    const onChange = () => {\n      const next = read();\n\n      if (!isSameWatched(latest.current, next)) {\n        latest.current = next;\n        rerender();\n      }\n    };\n\n    const changeEvent = form.on(\"change\", onChange);\n    const resetEvent = form.on(\"reset\", onChange);\n\n    return () => {\n      changeEvent.unsubscribe();\n      resetEvent.unsubscribe();\n    };\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [form, nameKey]);\n\n  return current;\n}\n","\"use client\";\n\nimport { useFormControl } from \"../hooks\";\r\nimport { HiddenInputProps } from \"../types\";\r\n\r\nexport function HiddenInput(props: HiddenInputProps) {\r\n  useFormControl(props);\r\n\r\n  return null;\r\n}\r\n","\"use client\";\n\nimport React, { forwardRef, useImperativeHandle } from \"react\";\nimport { FormContext } from \"../contexts/FormContext\";\nimport { StandardSchemaV1 } from \"../standard-schema/types\";\nimport { FormInterface, FormProps } from \"../types\";\nimport { useFormEngine } from \"./useFormEngine\";\n\n/**\n * Generic call signature preserving schema inference and `ref` support.\n */\ntype NativeFormComponent = <\n  Schema extends StandardSchemaV1 | undefined = undefined,\n>(\n  props: FormProps<Schema> & { ref?: React.Ref<FormInterface> }\n) => React.ReactElement | null;\n\n/**\n * React Native form. Renders no host element by default (just a Fragment) so it\n * does not depend on `react-native` being installed; pass a `component` prop\n * (e.g. `View`) to wrap children with a host view.\n *\n * Same engine, context, hooks, validation, and value collection as the web\n * `Form`. Submission is programmatic only — call `form.submit()`.\n */\nexport const NativeForm = forwardRef(function NativeForm(\n  props: FormProps<any>,\n  ref: React.Ref<FormInterface>\n) {\n  const { engine } = useFormEngine(props, (formEngine) =>\n    formEngine.handleSubmit()\n  );\n\n  useImperativeHandle(ref, () => engine, [engine]);\n\n  const {\n    onError: _onError,\n    onSubmit: _onSubmit,\n    component: Component,\n    children,\n    ignoreEmptyValues: _ignoreEmptyValues,\n    defaultValue: _defaultValue,\n    values: _values,\n    schema: _schema,\n    validateOn: _validateOn,\n    focusFirstError: _focusFirstError,\n    id: _id,\n    ...otherProps\n  } = props;\n\n  const content = Component ? (\n    <Component\n      ref={(node: any) => {\n        engine.formElement = node;\n      }}\n      {...otherProps}\n    >\n      {children}\n    </Component>\n  ) : (\n    <>{children}</>\n  );\n\n  return <FormContext.Provider value={engine}>{content}</FormContext.Provider>;\n}) as unknown as NativeFormComponent;\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const alphabetRule: InputRule = {\r\n  name: \"alphabet\",\r\n  requiresType: \"alphabet\",\r\n  validate: ({ value, errorKeys }) => {\r\n    if (!/^[a-zA-Z]+$/.test(value)) {\r\n      return trans(\"validation.alphabet\", { input: errorKeys.name });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nconst emailRegex =\r\n  /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n\r\nexport const emailRule: InputRule = {\r\n  name: \"email\",\r\n  requiresType: \"email\",\r\n  validate: ({ value, errorKeys }) => {\r\n    if (!emailRegex.test(value)) {\r\n      return trans(\"validation.email\", { input: errorKeys.name });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const floatRule: InputRule = {\r\n  name: \"float\",\r\n  requiresType: \"float\",\r\n  validate: ({ value, errorKeys }) => {\r\n    if (isNaN(Number(value)) && !Number.isInteger(Number(value))) {\r\n      return trans(\"validation.float\", { input: errorKeys.name });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const integerRule: InputRule = {\r\n  name: \"integer\",\r\n  requiresType: \"integer\",\r\n  validate: ({ value, errorKeys }) => {\r\n    if (isNaN(Number(value)) || !Number.isInteger(Number(value))) {\r\n      return trans(\"validation.integer\", { input: errorKeys.name });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const lengthRule: InputRule = {\r\n  name: \"length\",\r\n  preservedProps: [\"length\"],\r\n  validate: ({ value, length, errorKeys }) => {\r\n    if (!length || value?.length === undefined) return;\r\n\r\n    if (value.length !== length) {\r\n      return trans(\"validation.length\", { input: errorKeys.name, length });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const matchRule: InputRule = {\r\n  name: \"match\",\r\n  preservedProps: [\"match\"],\r\n  onInit: ({ formControl, form, match }) => {\r\n    if (!match || !form) return;\r\n\r\n    const matchingElement = form.control(match);\r\n\r\n    if (!matchingElement) return;\r\n\r\n    return matchingElement.onChange(() => {\r\n      if (!formControl.isDirty) return;\r\n\r\n      formControl.validate();\r\n    });\r\n  },\r\n  validate: ({ value, match, form, errorKeys }) => {\r\n    if (!form) return;\r\n\r\n    const matchingElement = form.control(match);\r\n\r\n    if (!matchingElement) return;\r\n\r\n    if (matchingElement.value !== value) {\r\n      const matchingName = errorKeys.matchingElement || matchingElement.name;\r\n\r\n      return trans(\"validation.match\", {\r\n        input: errorKeys.name,\r\n        matchingInput: matchingName,\r\n      });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const maxRule: InputRule = {\r\n  name: \"max\",\r\n  preservedProps: [\"max\"],\r\n  validate: ({ value, max, errorKeys }) => {\r\n    if (isNaN(max)) return;\r\n    if (value === null || value === undefined || value === \"\") return;\r\n\r\n    if (Number(value) > Number(max)) {\r\n      return trans(\"validation.max\", { input: errorKeys.name, max: max });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const maxLengthRule: InputRule = {\r\n  name: \"maxLength\",\r\n  preservedProps: [\"maxLength\"],\r\n  validate: ({ value, maxLength, errorKeys }) => {\r\n    if (!maxLength || value?.length === undefined) return;\r\n\r\n    if (value.length > maxLength) {\r\n      return trans(\"validation.maxLength\", {\r\n        input: errorKeys.name,\r\n        length: maxLength,\r\n      });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const minRule: InputRule = {\r\n  name: \"min\",\r\n  preservedProps: [\"min\"],\r\n  validate: ({ value, min, errorKeys }) => {\r\n    if (min === undefined) return;\r\n\r\n    if (Number(value) < Number(min)) {\r\n      return trans(\"validation.min\", { input: errorKeys.name, min: min });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const minLengthRule: InputRule = {\r\n  name: \"minLength\",\r\n  preservedProps: [\"minLength\"],\r\n  validate: ({ value, minLength, errorKeys, errors }) => {\r\n    if (!minLength || value?.length === undefined) return;\r\n\r\n    if (value.length < minLength) {\r\n      return trans(errors?.minLength ?? \"validation.minLength\", {\r\n        input: errorKeys.name,\r\n        length: minLength,\r\n      });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\r\nimport { InputRule } from \"../types\";\r\n\r\nexport const numberRule: InputRule = {\r\n  name: \"number\",\r\n  requiresType: \"number\",\r\n  validate: ({ value, errorKeys }) => {\r\n    if (isNaN(Number(value))) {\r\n      return trans(\"validation.number\", { input: errorKeys.name });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\nimport { InputRule } from \"../types\";\n\n// Defense-in-depth caps: validation patterns/values may end up sourced from\n// server/CMS-driven config, so an unbounded pattern or input is a ReDoS risk.\nconst MAX_PATTERN_LENGTH = 200;\nconst MAX_VALUE_LENGTH = 2000;\n\nconst regexCache = new Map<string, RegExp | null>();\n\nfunction compilePattern(pattern: string | RegExp): RegExp | null {\n  const isString = typeof pattern === \"string\";\n  const source = isString ? pattern : pattern.source;\n  const flags = isString ? \"\" : pattern.flags;\n  const cacheKey = `${flags}::${source}`;\n\n  if (regexCache.has(cacheKey)) {\n    return regexCache.get(cacheKey) as RegExp | null;\n  }\n\n  let compiled: RegExp | null = null;\n\n  if (source.length <= MAX_PATTERN_LENGTH) {\n    try {\n      compiled = isString ? new RegExp(pattern) : pattern;\n    } catch {\n      compiled = null;\n    }\n  }\n\n  regexCache.set(cacheKey, compiled);\n\n  return compiled;\n}\n\nexport const patternRule: InputRule = {\n  name: \"pattern\",\n  preservedProps: [\"pattern\"],\n  validate: ({ value, pattern, errorKeys }) => {\n    if (!pattern) return;\n\n    const regex = compilePattern(pattern);\n\n    // An invalid or oversized pattern source is a config problem, not the\n    // user's fault — fail safe by skipping validation rather than blocking\n    // every submission.\n    if (!regex) return;\n\n    // A value longer than the cap is overwhelmingly more likely invalid than\n    // valid — fail closed instead of truncating, which would let an anchored\n    // pattern (e.g. `^[0-9a-f]+$`) pass on a valid prefix with an arbitrary tail.\n    if (typeof value === \"string\" && value.length > MAX_VALUE_LENGTH) {\n      return trans(\"validation.pattern\", {\n        input: errorKeys.name,\n        pattern: errorKeys.pattern || \"pattern\",\n      });\n    }\n\n    if (!regex.test(value)) {\n      return trans(\"validation.pattern\", {\n        input: errorKeys.name,\n        pattern: errorKeys.pattern || \"pattern\",\n      });\n    }\n  },\n};\n","import { trans } from \"@mongez/localization\";\r\nimport { type InputRule } from \"../types\";\r\n\r\nconst isEmpty = (value: any) => {\r\n  return (\r\n    value === undefined ||\r\n    value === null ||\r\n    value === \"\" ||\r\n    (Array.isArray(value) && value.length === 0)\r\n  );\r\n};\r\n\r\nexport const requiredRule: InputRule = {\r\n  name: \"required\",\r\n  preservedProps: [\"required\"],\r\n  requiresValue: false,\r\n  validate: ({ type, value, errorKeys, required, checked }) => {\r\n    if (!required) return;\r\n\r\n    if (type === \"checkbox\") {\r\n      if (!checked) {\r\n        return trans(\"validation.required\", { input: errorKeys.name });\r\n      }\r\n\r\n      return;\r\n    }\r\n\r\n    if (isEmpty(value)) {\r\n      return trans(\"validation.required\", { input: errorKeys.name });\r\n    }\r\n  },\r\n};\r\n","import { trans } from \"@mongez/localization\";\nimport { ReactNode } from \"react\";\nimport { type InputRule } from \"../types\";\n\n/**\n * Configurable strong-password criteria.\n *\n * Pass as the value of the `strong` prop on a form control:\n *\n * - `<TextInput strong />`                  — apply all defaults\n * - `<TextInput strong={{ symbol: false }}` — selectively disable a criterion\n * - `<TextInput strong={{ minLength: 10 }}` — override a numeric criterion\n */\nexport type StrongPasswordCriteria = {\n  /**\n   * Minimum password length. Set to 0 (or falsy) to disable the length check.\n   * @default 8\n   */\n  minLength?: number;\n  /**\n   * Require at least one uppercase letter (A-Z).\n   * @default true\n   */\n  uppercase?: boolean;\n  /**\n   * Require at least one lowercase letter (a-z).\n   * @default true\n   */\n  lowercase?: boolean;\n  /**\n   * Require at least one digit (0-9).\n   * @default true\n   */\n  digit?: boolean;\n  /**\n   * Require at least one non-alphanumeric character.\n   * @default true\n   */\n  symbol?: boolean;\n};\n\nconst defaultCriteria: Required<StrongPasswordCriteria> = {\n  minLength: 8,\n  uppercase: true,\n  lowercase: true,\n  digit: true,\n  symbol: true,\n};\n\n/**\n * Validates a strong password against five composable criteria:\n *\n *   - `strong.minLength` — minimum length (default 8)\n *   - `strong.uppercase` — at least one uppercase letter\n *   - `strong.lowercase` — at least one lowercase letter\n *   - `strong.digit`     — at least one digit\n *   - `strong.symbol`    — at least one non-alphanumeric character\n *\n * Each failing criterion is also written individually into\n * `formControl.errorsList` under the namespaced key (e.g. `strong.uppercase`)\n * so consumers can render per-criterion password-strength checklists.\n *\n * The rule's primary `error` (consumed by the hook into `errorsList.strong`) is\n * the first failing message — same convention as every other rule.\n *\n * Requires `type=\"password\"`. Activated by passing the `strong` prop:\n *\n * ```tsx\n * <TextInput type=\"password\" name=\"password\" strong required minLength={8} />\n * <TextInput type=\"password\" name=\"password\" strong={{ symbol: false }} />\n * ```\n */\nexport const strongRule: InputRule = {\n  name: \"strong\",\n  preservedProps: [\"strong\"],\n  requiresType: \"password\",\n  validate: ({ value, strong, formControl, errorKeys }) => {\n    if (!strong) return;\n\n    const criteria: Required<StrongPasswordCriteria> =\n      strong === true ? defaultCriteria : { ...defaultCriteria, ...strong };\n\n    const stringValue = typeof value === \"string\" ? value : \"\";\n    const failures: ReactNode[] = [];\n\n    const fail = (key: string, message: ReactNode) => {\n      formControl.errorsList[`strong.${key}`] = message;\n      failures.push(message);\n    };\n\n    if (criteria.minLength && stringValue.length < criteria.minLength) {\n      fail(\n        \"minLength\",\n        trans(\"validation.strongMinLength\", {\n          input: errorKeys.name,\n          length: criteria.minLength,\n        })\n      );\n    }\n\n    if (criteria.uppercase && !/[A-Z]/.test(stringValue)) {\n      fail(\n        \"uppercase\",\n        trans(\"validation.strongUppercase\", { input: errorKeys.name })\n      );\n    }\n\n    if (criteria.lowercase && !/[a-z]/.test(stringValue)) {\n      fail(\n        \"lowercase\",\n        trans(\"validation.strongLowercase\", { input: errorKeys.name })\n      );\n    }\n\n    if (criteria.digit && !/\\d/.test(stringValue)) {\n      fail(\n        \"digit\",\n        trans(\"validation.strongDigit\", { input: errorKeys.name })\n      );\n    }\n\n    if (criteria.symbol && !/[^A-Za-z0-9]/.test(stringValue)) {\n      fail(\n        \"symbol\",\n        trans(\"validation.strongSymbol\", { input: errorKeys.name })\n      );\n    }\n\n    if (failures.length > 0) {\n      return failures[0];\n    }\n  },\n};\n","import { trans } from \"@mongez/localization\";\nimport { isUrl } from \"@mongez/supportive-is\";\nimport { type InputRule } from \"../types\";\n\nexport const urlRule: InputRule = {\n  name: \"url\",\n  requiresType: \"url\",\n  validate: ({ value }) => {\n    if (!isUrl(value)) {\n      return trans(\"validation.url\");\n    }\n  },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAa,0BAA0B;CACrC,UAAU;CACV,OAAO;CACP,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,OAAO;CACP,UAAU;CACV,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;CACb,cAAc;AAChB;AAEA,MAAa,0BAA0B;CACrC,UAAU;CACV,OAAO;CACP,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,OAAO;CACP,UAAU;CACV,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;CACb,cAAc;AAChB;AAEA,MAAa,0BAA0B;CACrC,UAAU;CACV,OAAO;CACP,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,OAAO;CACP,UAAU;CACV,iBAAiB;CACjB,iBAAiB;CACjB,iBAAiB;CACjB,aAAa;CACb,cAAc;AAChB;AAEA,MAAa,0BAA0B;CACrC,UAAU;CACV,OAAO;CACP,KAAK;CACL,KAAK;CACL,KAAK;CACL,OAAO;CACP,QAAQ;CACR,WAAW;CACX,WAAW;CACX,SAAS;CACT,QAAQ;CACR,SAAS;CACT,OAAO;CACP,UAAU;CACV,i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