import { useIntlayer } from "react-intlayer";
import { z } from "zod/v4";

//#region src/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.ts
const useDictionaryDetailsSchema = (projectId) => {
	const { titleRequiredError, titleInvalidTypeError, titleMinLengthError, keyRequiredError, keyInvalidTypeError, keySpaceError, keyMinLengthError, descriptionRequiredError, descriptionInvalidTypeError, requiredErrorProjectId, invalidTypeErrorProjectId, invalidTypeErrorTags, locationRequiredError, locationInvalidTypeError, filePathRequiredError, filePathInvalidTypeError } = useIntlayer("dictionary-detail-schema");
	return z.object({
		title: z.string({ error: (issue) => issue.input === void 0 ? titleRequiredError.value : titleInvalidTypeError.value }).refine((val) => val.length === 0 || val.length >= 4, { error: titleMinLengthError.value }).optional(),
		key: z.string({ error: (issue) => issue.input === void 0 ? keyRequiredError.value : keyInvalidTypeError.value }).min(4, { error: keyMinLengthError.value }).regex(/^[a-zA-Z0-9-_]+$/, { error: keySpaceError.value }).default(""),
		description: z.string({ error: (issue) => issue.input === void 0 ? descriptionRequiredError.value : descriptionInvalidTypeError.value }).optional(),
		projectIds: z.array(z.string({ error: (issue) => issue.input === void 0 ? requiredErrorProjectId.value : invalidTypeErrorProjectId.value })).default([projectId]),
		tags: z.array(z.string({ error: () => invalidTypeErrorTags.value })).default([]),
		location: z.enum([
			"local",
			"remote",
			"hybrid",
			"plugin"
		], { error: (issue) => issue.input === void 0 ? locationRequiredError.value : locationInvalidTypeError.value }).optional(),
		importMode: z.enum([
			"static",
			"dynamic",
			"fetch"
		]).optional(),
		filePath: z.string({ error: (issue) => issue.input === void 0 ? filePathRequiredError.value : filePathInvalidTypeError.value }).optional()
	});
};

//#endregion
export { useDictionaryDetailsSchema };
//# sourceMappingURL=useDictionaryDetailsSchema.mjs.map