"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const zod_1 = require("zod");
const field_1 = require("../../../../types/field");
const filter_1 = require("../../../../types/filter");
const fieldId_1 = require("../fieldId");
const commonBooleanFilterRuleSchema = zod_1.z.object({
    fieldId: (0, fieldId_1.getFieldIdSchema)({ additionalDescription: null }),
    fieldType: zod_1.z.union([
        zod_1.z.literal(field_1.DimensionType.BOOLEAN),
        zod_1.z.literal(field_1.MetricType.BOOLEAN),
    ]),
    fieldFilterType: zod_1.z.literal(filter_1.FilterType.BOOLEAN),
});
const booleanFilterSchema = zod_1.z.union([
    commonBooleanFilterRuleSchema.extend({
        operator: zod_1.z.union([
            zod_1.z.literal(filter_1.FilterOperator.NULL),
            zod_1.z.literal(filter_1.FilterOperator.NOT_NULL),
        ]),
    }),
    commonBooleanFilterRuleSchema.extend({
        operator: zod_1.z.union([
            zod_1.z.literal(filter_1.FilterOperator.EQUALS),
            zod_1.z.literal(filter_1.FilterOperator.NOT_EQUALS),
        ]),
        values: zod_1.z.array(zod_1.z.boolean()).length(1),
    }),
]);
exports.default = booleanFilterSchema;
//# sourceMappingURL=booleanFilters.js.map