import { c as create$3, a as create$6 } from './form.js';
import { c as cityValidation, l as lineTwoValidation, b as lineOneValidation, A as makePostalValidation } from './schema-validations.js';
import { a as CountryCode } from './Business.js';

// Internal USA schemas
const schemaUSA = () => create$3({
    line1: lineOneValidation.nullable(),
    line2: lineTwoValidation.nullable(),
    city: cityValidation.nullable(),
    state: create$6().nullable(),
    postal_code: create$6().nullable(),
});
const strictSchemaUSA = () => create$3({
    line1: lineOneValidation.required('Enter street address'),
    line2: lineTwoValidation.nullable(),
    city: cityValidation.required('Enter city'),
    state: create$6().required('Select state'),
    postal_code: makePostalValidation(CountryCode.USA).required('Enter postal code'),
});
// Internal CAN schemas
const schemaCAN = () => create$3({
    line1: lineOneValidation.nullable(),
    line2: lineTwoValidation.nullable(),
    city: cityValidation.nullable(),
    state: create$6().nullable(),
    postal_code: create$6().nullable(),
});
const strictSchemaCAN = () => create$3({
    line1: lineOneValidation.required('Enter street address'),
    line2: lineTwoValidation.nullable(),
    city: cityValidation.required('Enter city'),
    state: create$6().required('Select province or state'),
    postal_code: makePostalValidation(CountryCode.CAN).required('Enter postal code'),
});
// Public API
const addressSchemaUSA = (allowOptionalFields) => allowOptionalFields ? schemaUSA() : strictSchemaUSA();
const addressSchemaCAN = (allowOptionalFields) => allowOptionalFields ? schemaCAN() : strictSchemaCAN();
// Country-keyed mapping
const addressSchemaByCountry = {
    [CountryCode.USA]: addressSchemaUSA,
    [CountryCode.CAN]: addressSchemaCAN,
};

export { addressSchemaCAN as a, addressSchemaUSA as b, addressSchemaByCountry as c };
