import * as t from "yup";
import { isDynamicFormDateRangeField as c } from "../../../isDateRangeField.js";
import { resolveFieldTypeComponentProps as a } from "../../../resolveFieldContractAliases.js";
const p = () => t.object().shape({
  startDate: t.date().nullable(),
  endDate: t.date().nullable()
}).nullable(), n = () => t.array().of(t.mixed()), l = {
  /**
   * Returns true if this strategy applies to the field (i.e. field is a date range).
   * @param field - Form field to check (uses fieldType.componentId and fieldType.id).
   * @returns True if the field is a date range field.
   */
  applies(e) {
    return c(e);
  },
  create() {
    return p();
  }
}, i = {
  /**
   * Returns true if this strategy applies to the field (checkable list or days of week).
   * @param field - Form field to check.
   * @returns True if the field is RHFCheckableList, RHFDaysOfWeekPicker, or fft_checkable_list.
   */
  applies(e) {
    const r = e.fieldType.componentId;
    return r === "RHFCheckableList" || r === "RHFDaysOfWeekPicker" || e.fieldType.id === "fft_checkable_list";
  },
  /** Returns a Yup array-of-mixed schema for the field. */
  create() {
    return n();
  }
}, s = {
  /**
   * Returns true if this strategy applies to the field (number/integer/double type).
   * @param field - Form field to check.
   * @returns True if the field is RHFNumberInput or fft_number, fft_integer, fft_double.
   */
  applies(e) {
    const r = e.fieldType.id;
    return e.fieldType.componentId === "RHFNumberInput" || r === "fft_number" || r === "fft_integer" || r === "fft_double";
  },
  /** Returns a Yup number schema for the field. */
  create() {
    return t.number();
  }
}, m = {
  /**
   * Returns true if this strategy applies to the field (checkbox/boolean type).
   * @param field - Form field to check (uses fieldType.componentId and fieldType.id).
   * @returns True if the field is RHFCheckbox or fft_boolean or fft_checkbox.
   */
  applies(e) {
    const r = e.fieldType.id;
    return e.fieldType.componentId === "RHFCheckbox" || r === "fft_boolean" || r === "fft_checkbox";
  },
  /** Returns a Yup boolean schema for the field. */
  create() {
    return t.boolean();
  }
}, u = {
  /**
   * Returns true if this strategy applies to the field (RHFRadioGroup).
   * @param field - Form field to check.
   * @returns True if the field is RHFRadioGroup.
   */
  applies(e) {
    return e.fieldType.componentId === "RHFRadioGroup";
  },
  /** Returns a Yup mixed schema for string or number (selected option value). */
  create() {
    return t.mixed();
  }
}, d = {
  /**
   * Returns true if this strategy applies to the field (RHFSelect).
   * @param field - Form field to check.
   * @returns True if the field is RHFSelect.
   */
  applies(e) {
    return e.fieldType.componentId === "RHFSelect";
  },
  /** Returns a Yup string or array schema depending on isMultiple. */
  create(e) {
    return a(e.fieldType)?.isMultiple === !0 ? n() : t.string();
  }
}, f = {
  /**
   * Returns true if this strategy applies to the field (RHFAutoComplete).
   * @param field - Form field to check.
   * @returns True if the field is RHFAutoComplete.
   */
  applies(e) {
    return e.fieldType.componentId === "RHFAutoComplete";
  },
  /** Returns a Yup mixed/array schema depending on isMultiple. */
  create(e) {
    return a(e.fieldType)?.isMultiple === !0 ? t.array().of(t.mixed()) : t.mixed().nullable();
  }
}, S = {
  /**
   * Returns true if this strategy applies to the field (RHFImageSelector).
   * @param field - Form field to check.
   * @returns True if the field is RHFImageSelector.
   */
  applies(e) {
    return e.fieldType.componentId === "RHFImageSelector";
  },
  /** Returns a Yup mixed schema for the selected option object (nullable). */
  create() {
    return t.mixed().nullable();
  }
}, y = {
  applies(e) {
    return e.fieldType.componentId === "RHFTextField";
  },
  create() {
    return t.string();
  }
}, g = {
  applies() {
    return !0;
  },
  create() {
    return t.string();
  }
}, T = [
  l,
  i,
  s,
  m,
  u,
  d,
  f,
  S,
  y,
  g
];
export {
  T as BASE_SCHEMA_STRATEGIES,
  f as autocompleteBaseSchemaStrategy,
  m as booleanBaseSchemaStrategy,
  i as checkableListBaseSchemaStrategy,
  l as dateRangeBaseSchemaStrategy,
  g as defaultStringBaseSchemaStrategy,
  S as imageSelectorBaseSchemaStrategy,
  s as numberBaseSchemaStrategy,
  u as radioGroupBaseSchemaStrategy,
  d as selectBaseSchemaStrategy,
  y as textFieldBaseSchemaStrategy
};
