/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */

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);
var core_field_default_bindings_exports = {};
__export(core_field_default_bindings_exports, {
  CORE_FIELD_DEFAULT_BINDING_MATRIX: () => CORE_FIELD_DEFAULT_BINDING_MATRIX,
  getSharedFieldDefaultBindingUse: () => getSharedFieldDefaultBindingUse,
  inferSharedFieldDefaultBindingUse: () => inferSharedFieldDefaultBindingUse
});
module.exports = __toCommonJS(core_field_default_bindings_exports);
const CORE_FIELD_DEFAULT_BINDING_MATRIX = {
  display: {
    richText: "DisplayHtmlFieldModel",
    number: "DisplayNumberFieldModel",
    integer: "DisplayNumberFieldModel",
    id: "DisplayNumberFieldModel",
    snowflakeId: "DisplayNumberFieldModel",
    json: "DisplayJSONFieldModel",
    select: "DisplayEnumFieldModel",
    multipleSelect: "DisplayEnumFieldModel",
    radioGroup: "DisplayEnumFieldModel",
    checkboxGroup: "DisplayEnumFieldModel",
    collection: "DisplayEnumFieldModel",
    tableoid: "DisplayEnumFieldModel",
    icon: "DisplayIconFieldModel",
    checkbox: "DisplayCheckboxFieldModel",
    password: "DisplayPasswordFieldModel",
    percent: "DisplayPercentFieldModel",
    date: "DisplayDateTimeFieldModel",
    datetimeNoTz: "DisplayDateTimeFieldModel",
    createdAt: "DisplayDateTimeFieldModel",
    datetime: "DisplayDateTimeFieldModel",
    updatedAt: "DisplayDateTimeFieldModel",
    unixTimestamp: "DisplayDateTimeFieldModel",
    input: "DisplayTextFieldModel",
    email: "DisplayTextFieldModel",
    phone: "DisplayTextFieldModel",
    uuid: "DisplayTextFieldModel",
    textarea: "DisplayTextFieldModel",
    nanoid: "DisplayTextFieldModel",
    url: "DisplayURLFieldModel",
    color: "DisplayColorFieldModel",
    time: "DisplayTimeFieldModel"
  },
  editable: {
    json: "JsonFieldModel",
    textarea: "TextareaFieldModel",
    icon: "IconFieldModel",
    radioGroup: "RadioGroupFieldModel",
    color: "ColorFieldModel",
    select: "SelectFieldModel",
    multipleSelect: "SelectFieldModel",
    checkboxGroup: "CheckboxGroupFieldModel",
    checkbox: "CheckboxFieldModel",
    password: "PasswordFieldModel",
    number: "NumberFieldModel",
    integer: "NumberFieldModel",
    id: "NumberFieldModel",
    snowflakeId: "NumberFieldModel",
    percent: "PercentFieldModel",
    datetimeNoTz: "DateTimeNoTzFieldModel",
    date: "DateOnlyFieldModel",
    datetime: "DateTimeTzFieldModel",
    createdAt: "DateTimeTzFieldModel",
    updatedAt: "DateTimeTzFieldModel",
    unixTimestamp: "DateTimeTzFieldModel",
    time: "TimeFieldModel",
    collection: "CollectionSelectorFieldModel",
    tableoid: "CollectionSelectorFieldModel",
    richText: "RichTextFieldModel",
    input: "InputFieldModel",
    email: "InputFieldModel",
    phone: "InputFieldModel",
    uuid: "InputFieldModel",
    url: "InputFieldModel",
    nanoid: "InputFieldModel"
  },
  filter: {
    date: "DateOnlyFilterFieldModel",
    datetimeNoTz: "DateTimeNoTzFilterFieldModel",
    createdAt: "DateTimeTzFilterFieldModel",
    datetime: "DateTimeTzFilterFieldModel",
    updatedAt: "DateTimeTzFilterFieldModel",
    unixTimestamp: "DateTimeTzFilterFieldModel",
    select: "SelectFieldModel",
    multipleSelect: "SelectFieldModel",
    radioGroup: "SelectFieldModel",
    checkboxGroup: "SelectFieldModel",
    checkbox: "SelectFieldModel",
    number: "NumberFieldModel",
    integer: "NumberFieldModel",
    id: "NumberFieldModel",
    snowflakeId: "NumberFieldModel",
    time: "TimeFieldModel",
    percent: "PercentFieldModel",
    input: "InputFieldModel",
    email: "InputFieldModel",
    phone: "InputFieldModel",
    uuid: "InputFieldModel",
    url: "InputFieldModel",
    nanoid: "InputFieldModel"
  }
};
const SUPPLEMENTAL_FIELD_DEFAULT_BINDING_MATRIX = {
  display: {
    formula: "DisplayDateTimeFieldModel"
  },
  editable: {},
  filter: {}
};
const FIELD_DEFAULT_BINDING_FALLBACKS = {
  display: "DisplayTextFieldModel",
  editable: "InputFieldModel",
  filter: "InputFieldModel"
};
function normalizeFieldInterface(fieldInterface) {
  return String(fieldInterface || "").trim();
}
function getSharedFieldDefaultBindingUse(scope, fieldInterface) {
  const normalized = normalizeFieldInterface(fieldInterface);
  if (!normalized) {
    return void 0;
  }
  return CORE_FIELD_DEFAULT_BINDING_MATRIX[scope][normalized] || SUPPLEMENTAL_FIELD_DEFAULT_BINDING_MATRIX[scope][normalized];
}
function inferSharedFieldDefaultBindingUse(scope, fieldInterface) {
  return getSharedFieldDefaultBindingUse(scope, fieldInterface) || FIELD_DEFAULT_BINDING_FALLBACKS[scope];
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  CORE_FIELD_DEFAULT_BINDING_MATRIX,
  getSharedFieldDefaultBindingUse,
  inferSharedFieldDefaultBindingUse
});
