var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/plus/contactInfoModal/ContactInfoContent.tsx
var ContactInfoContent_exports = {};
__export(ContactInfoContent_exports, {
  default: () => ContactInfoContent_default
});
module.exports = __toCommonJS(ContactInfoContent_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var import_materials = require("@pisell/materials");
var import_utils = require("@pisell/utils");
var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
var import_locales = __toESM(require("./locales"));
var import_index = require("./index.less");
var ContactInfoContent = (props) => {
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
  const context = (0, import_useEngineContext.default)();
  import_utils.locales.init(
    import_locales.default,
    ((_b = (_a = context.appHelper.utils) == null ? void 0 : _a.storage) == null ? void 0 : _b.get("umi_locale")) || "en"
  );
  const { config, form } = props;
  console.log("config", config);
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-contact-info-modal-content" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { size: "large", layout: "vertical", form }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-contact-info-modal-content-name-wrap" }, ((_c = config == null ? void 0 : config.first_name) == null ? void 0 : _c.visible) !== false ? /* @__PURE__ */ import_react.default.createElement(
    import_materials.FormItemInput,
    {
      renderMode: "edit",
      label: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.first-name"
      ),
      placeholder: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.first-name-placeholder"
      ),
      name: "first_name",
      requiredobj: {
        required: ((_d = config == null ? void 0 : config.first_name) == null ? void 0 : _d.required) !== true ? false : true,
        message: import_utils.locales.getText(
          "pisell2.text.contact-info.modal.first-name-required"
        )
      }
    }
  ) : null, ((_e = config == null ? void 0 : config.last_name) == null ? void 0 : _e.visible) !== false ? /* @__PURE__ */ import_react.default.createElement(
    import_materials.FormItemInput,
    {
      renderMode: "edit",
      label: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.last-name"
      ),
      placeholder: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.last-name-placeholder"
      ),
      name: "last_name",
      requiredobj: {
        required: ((_f = config == null ? void 0 : config.last_name) == null ? void 0 : _f.required) !== true ? false : true,
        message: import_utils.locales.getText(
          "pisell2.text.contact-info.modal.last-name-required"
        )
      }
    }
  ) : null), ((_g = config == null ? void 0 : config.phone) == null ? void 0 : _g.visible) !== false ? /* @__PURE__ */ import_react.default.createElement(
    import_materials.FormItemInput.Mobile,
    {
      renderMode: "edit",
      name: "phone",
      label: import_utils.locales.getText("pisell2.text.contact-info.modal.mobile"),
      placeholder: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.mobile-placeholder"
      ),
      typeobj: { type: "phone", enabled: true, message: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.mobile-error"
      ) },
      requiredobj: {
        required: ((_h = config == null ? void 0 : config.phone) == null ? void 0 : _h.required) !== true ? false : true,
        message: import_utils.locales.getText(
          "pisell2.text.contact-info.modal.mobile-required"
        )
      },
      returnFormat: "object"
    }
  ) : null, ((_i = config == null ? void 0 : config.email) == null ? void 0 : _i.visible) !== false ? /* @__PURE__ */ import_react.default.createElement(
    import_materials.FormItemInput.Email,
    {
      renderMode: "edit",
      name: "email",
      label: import_utils.locales.getText("pisell2.text.contact-info.modal.email"),
      placeholder: import_utils.locales.getText(
        "pisell2.text.contact-info.modal.email-placeholder"
      ),
      typeobj: { type: "email", enabled: true },
      requiredobj: {
        required: ((_j = config == null ? void 0 : config.email) == null ? void 0 : _j.required) !== true ? false : true,
        message: import_utils.locales.getText(
          "pisell2.text.contact-info.modal.email-required"
        )
      },
      onChange: () => {
        form.validateFields(["email"]);
      }
    }
  ) : null));
};
var ContactInfoContent_default = ContactInfoContent;
