import { number, object, string, mixed, boolean } from "yup";
const scoreObject = object({
    hide: boolean().optional(),
    hideScore: boolean().optional(),
    order: number().optional(),
}).optional();
const colorsObject = object({
    background: string().required(),
    fill: string().required(),
}).optional();
const scoresMenu = object({
    defaultOpen: boolean().optional(),
    title: mixed().optional(),
    categories: object({
        transport: object({
            hide: boolean().optional(),
            order: number().optional(),
            colors: colorsObject,
            scores: object({
                pedestrian_friendly: scoreObject,
                transit_friendly: scoreObject,
                cycling_friendly: scoreObject,
                car_friendly: scoreObject,
            }).optional(),
        }).optional(),
        education: object({
            hide: boolean().optional(),
            order: number().optional(),
            colors: colorsObject,
            scores: object({
                daycares: scoreObject,
                primary_schools: scoreObject,
                high_schools: scoreObject,
            }).optional(),
        }).optional(),
        amenities: object({
            hide: boolean().optional(),
            order: number().optional(),
            colors: colorsObject,
            scores: object({
                shopping: scoreObject,
                groceries: scoreObject,
                restaurants: scoreObject,
                cafes: scoreObject,
            }).optional(),
        }).optional(),
        character: object({
            hide: boolean().optional(),
            order: number().optional(),
            colors: colorsObject,
            scores: object({
                nightlife: scoreObject,
                vibrant: scoreObject,
                historic: scoreObject,
                quiet: scoreObject,
            }).optional(),
        }).optional(),
        nature: object({
            hide: boolean().optional(),
            order: number().optional(),
            colors: colorsObject,
            scores: object({
                parks: scoreObject,
                greenery: scoreObject,
            }).optional(),
        }).optional(),
        health: object({
            hide: boolean().optional(),
            order: number().optional(),
            colors: colorsObject,
            scores: object({
                wellness: scoreObject,
            }).optional(),
        }).optional(),
    }).optional(),
})
    .optional()
    .default({
    defaultOpen: true,
});
export const schema = object({
    lat: number()
        .min(-90, "Must be a valid latitude.")
        .max(90, "Must be a valid latitude.")
        .required(),
    lng: number()
        .min(-180, "Must be a valid longitude.")
        .max(180, "Must be a valid longitude.")
        .required(),
    zoom: number().optional(),
    pitch: number().optional(),
    bearing: number().optional(),
    distanceUnit: mixed().oneOf(["metric", "imperial"]).optional(),
    marker: object({
        lat: number()
            .min(-90, "Must be a valid latitude.")
            .max(90, "Must be a valid latitude.")
            .required(),
        lng: number()
            .min(-180, "Must be a valid longitude.")
            .max(180, "Must be a valid longitude.")
            .required(),
        icon: mixed().oneOf(["house", "pin"]).optional(),
        addressLabel: string().optional(),
    }).default(undefined),
    cooperativeGestures: boolean().optional(),
    mapProvider: mixed().optional(),
    hideScores: boolean().optional(),
    showSchoolRatings: boolean().optional(),
    scoresMenu,
    hideAttribution: boolean().optional(),
}).noUnknown(true);
export const validateOptions = (options) => schema.validate(options, { abortEarly: false });
//# sourceMappingURL=schema.js.map