"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.FieldsValidationSchema = exports.fields = void 0;
const extensions_core_1 = require("@awell-health/extensions-core");
const lodash_1 = require("lodash");
const zod_1 = require("zod");
exports.fields = {
    careFlowIds: {
        id: 'careFlowIds',
        label: 'Care flow ID(s)',
        description: 'The care flow ID(s) to stop. You can stop multiple care flows at once by separating the IDs with a comma. If not provided, the current care flow will be stopped.',
        type: extensions_core_1.FieldType.STRING,
        required: false,
    },
    reason: {
        id: 'reason',
        label: 'Reason',
        description: 'The reason why you want to stop the care flow.',
        type: extensions_core_1.FieldType.STRING,
        required: true,
    },
};
exports.FieldsValidationSchema = zod_1.z.object({
    careFlowIds: zod_1.z.string().optional().transform((str, ctx) => {
        // Remove all whitespace from the string
        const cleanedStr = str === null || str === void 0 ? void 0 : str.replace(/\s/g, '');
        if ((0, lodash_1.isNil)(cleanedStr) || (0, lodash_1.isEmpty)(cleanedStr)) {
            return [];
        }
        return cleanedStr.split(',');
    }),
    reason: zod_1.z
        .string()
        .optional()
        .default('Default message: Stopped by extension.'),
});
//# sourceMappingURL=fields.js.map