var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/saasDevice/devicePlanning/types.ts
var types_exports = {};
__export(types_exports, {
  DEVICE_KIND_OPTIONS: () => DEVICE_KIND_OPTIONS,
  EMPTY_I18N: () => EMPTY_I18N,
  toLangDict: () => toLangDict,
  validateI18nRequired: () => validateI18nRequired
});
module.exports = __toCommonJS(types_exports);
var EMPTY_I18N = {
  original: "",
  en: "",
  "zh-CN": "",
  "zh-HK": "",
  ja: "",
  pt: ""
};
var DEVICE_KIND_OPTIONS = ["smart"];
var toLangDict = (val) => {
  if (!val) return { ...EMPTY_I18N };
  if (typeof val === "string") {
    return { ...EMPTY_I18N, original: val, en: val };
  }
  return { ...EMPTY_I18N, ...val };
};
var 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 ? void 0 : value.original) === "string" && value.original.trim() !== "";
  return filled || original ? Promise.resolve() : Promise.reject(new Error(message));
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  DEVICE_KIND_OPTIONS,
  EMPTY_I18N,
  toLangDict,
  validateI18nRequired
});
