import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
//#region src/plus/saasDevice/appPeripheral/types.ts
const EMPTY_I18N = {
	original: "",
	en: "",
	"zh-CN": "",
	"zh-HK": "",
	ja: "",
	pt: ""
};
const toLangDict = (val) => {
	if (!val) return _objectSpread2({}, EMPTY_I18N);
	if (typeof val === "string") return _objectSpread2(_objectSpread2({}, EMPTY_I18N), {}, {
		original: val,
		en: val
	});
	return _objectSpread2(_objectSpread2({}, EMPTY_I18N), val);
};
const validateI18nRequired = (message) => (_rule, value) => {
	if (!value) return Promise.reject(new Error(message));
	if (typeof value === "string") return value.trim() ? Promise.resolve() : Promise.reject(new Error(message));
	const filled = Object.entries(value).some(([key, val]) => key !== "original" && typeof val === "string" && val.trim() !== "");
	const original = typeof (value === null || value === void 0 ? void 0 : value.original) === "string" && value.original.trim() !== "";
	return filled || original ? Promise.resolve() : Promise.reject(new Error(message));
};
//#endregion
export { EMPTY_I18N, toLangDict, validateI18nRequired };
