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/contactInfo/utils.ts
var utils_exports = {};
__export(utils_exports, {
  getAvatarText: () => getAvatarText,
  getFieldValue: () => getFieldValue
});
module.exports = __toCommonJS(utils_exports);
var import_lodash = require("lodash");
function getFieldValue(data, fieldKey, mapping) {
  if (!fieldKey || typeof fieldKey !== "string") {
    console.warn("getFieldValue: fieldKey must be a non-empty string");
    return void 0;
  }
  if (!data || typeof data !== "object") {
    console.warn("getFieldValue: data must be a valid object");
    return void 0;
  }
  const fieldMapping = mapping || {};
  const mappingRule = fieldMapping[fieldKey];
  try {
    if (typeof mappingRule === "function") {
      return mappingRule(data);
    }
    if (typeof mappingRule === "string") {
      return (0, import_lodash.get)(data, mappingRule);
    }
    return (0, import_lodash.get)(data, fieldKey);
  } catch (error) {
    console.error(
      `getFieldValue: Error processing field '${fieldKey}':`,
      error
    );
    return void 0;
  }
}
var getAvatarText = (name) => {
  if (!name) return "";
  const words = name.trim().split(/\s+/);
  const initials = words.slice(0, 2).map((word) => word.charAt(0).toUpperCase()).join("");
  return initials;
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getAvatarText,
  getFieldValue
});
