/**
 * 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 semantic_use_exports = {};
__export(semantic_use_exports, {
  APPROVAL_ACTION_CONTAINER_USES: () => APPROVAL_ACTION_CONTAINER_USES,
  APPROVAL_BLOCK_GRID_USES: () => APPROVAL_BLOCK_GRID_USES,
  APPROVAL_DETAILS_BLOCK_USES: () => APPROVAL_DETAILS_BLOCK_USES,
  APPROVAL_DETAILS_GRID_USES: () => APPROVAL_DETAILS_GRID_USES,
  APPROVAL_FIELD_WRAPPER_USES: () => APPROVAL_FIELD_WRAPPER_USES,
  APPROVAL_FORM_BLOCK_USES: () => APPROVAL_FORM_BLOCK_USES,
  APPROVAL_FORM_GRID_USES: () => APPROVAL_FORM_GRID_USES,
  APPROVAL_PAGE_MODEL_USES: () => APPROVAL_PAGE_MODEL_USES,
  APPROVAL_TAB_MODEL_USES: () => APPROVAL_TAB_MODEL_USES,
  APPROVAL_TASK_CARD_GRID_USES: () => APPROVAL_TASK_CARD_GRID_USES,
  getApprovalDefaultGridUse: () => getApprovalDefaultGridUse,
  getApprovalFieldWrapperUse: () => getApprovalFieldWrapperUse,
  isApprovalFormContainerUse: () => isApprovalFormContainerUse,
  isApprovalTaskCardGridUse: () => isApprovalTaskCardGridUse,
  normalizeApprovalSemanticUse: () => normalizeApprovalSemanticUse
});
module.exports = __toCommonJS(semantic_use_exports);
const APPROVAL_PAGE_MODEL_USES = ["TriggerChildPageModel", "ApprovalChildPageModel"];
const APPROVAL_TAB_MODEL_USES = ["TriggerChildPageTabModel", "ApprovalChildPageTabModel"];
const APPROVAL_BLOCK_GRID_USES = ["TriggerBlockGridModel", "ApprovalBlockGridModel"];
const APPROVAL_FORM_GRID_USES = ["PatternFormGridModel"];
const APPROVAL_TASK_CARD_GRID_USES = ["ApplyTaskCardGridModel", "ApprovalTaskCardGridModel"];
const APPROVAL_DETAILS_GRID_USES = ["ApprovalDetailsGridModel", ...APPROVAL_TASK_CARD_GRID_USES];
const APPROVAL_FORM_BLOCK_USES = ["ApplyFormModel", "ProcessFormModel"];
const APPROVAL_DETAILS_BLOCK_USES = [
  "ApprovalDetailsModel",
  "ApplyTaskCardDetailsModel",
  "ApprovalTaskCardDetailsModel"
];
const APPROVAL_FIELD_WRAPPER_USES = [
  "PatternFormItemModel",
  "ApprovalDetailsItemModel",
  "ApplyTaskCardDetailsItemModel",
  "ApprovalTaskCardDetailsItemModel"
];
const APPROVAL_ACTION_CONTAINER_USES = ["ApplyFormModel", "ProcessFormModel"];
const APPROVAL_FORM_CONTAINER_USE_SET = /* @__PURE__ */ new Set([
  ...APPROVAL_FORM_BLOCK_USES,
  ...APPROVAL_FORM_GRID_USES,
  "PatternFormItemModel"
]);
const APPROVAL_SEMANTIC_USE_ALIASES = {
  TriggerChildPageModel: "ChildPageModel",
  ApprovalChildPageModel: "ChildPageModel",
  TriggerChildPageTabModel: "ChildPageTabModel",
  ApprovalChildPageTabModel: "ChildPageTabModel",
  TriggerBlockGridModel: "BlockGridModel",
  ApprovalBlockGridModel: "BlockGridModel",
  PatternFormGridModel: "FormGridModel",
  ApprovalDetailsGridModel: "DetailsGridModel",
  ApplyTaskCardGridModel: "DetailsGridModel",
  ApprovalTaskCardGridModel: "DetailsGridModel",
  ApplyFormModel: "FormBlockModel",
  ProcessFormModel: "FormBlockModel",
  ApprovalDetailsModel: "DetailsBlockModel",
  ApplyTaskCardDetailsModel: "DetailsBlockModel",
  ApprovalTaskCardDetailsModel: "DetailsBlockModel",
  PatternFormItemModel: "FormItemModel",
  ApprovalDetailsItemModel: "DetailsItemModel",
  ApplyTaskCardDetailsItemModel: "DetailsItemModel",
  ApprovalTaskCardDetailsItemModel: "DetailsItemModel",
  PatternFormAssociationFieldGroupModel: "FormAssociationFieldGroupModel",
  ApprovalDetailsAssociationFieldGroupModel: "DetailsAssociationFieldGroupModel",
  ApplyTaskCardDetailsAssociationFieldGroupModel: "DetailsAssociationFieldGroupModel",
  ApprovalTaskCardDetailsAssociationFieldGroupModel: "DetailsAssociationFieldGroupModel"
};
const APPROVAL_DEFAULT_GRID_USE_BY_OWNER_USE = {
  TriggerChildPageTabModel: "TriggerBlockGridModel",
  ApprovalChildPageTabModel: "ApprovalBlockGridModel",
  ApplyFormModel: "PatternFormGridModel",
  ProcessFormModel: "PatternFormGridModel",
  ApprovalDetailsModel: "ApprovalDetailsGridModel",
  ApplyTaskCardDetailsModel: "ApplyTaskCardGridModel",
  ApprovalTaskCardDetailsModel: "ApprovalTaskCardGridModel"
};
const APPROVAL_FIELD_WRAPPER_USE_BY_CONTAINER_USE = {
  ApplyFormModel: "PatternFormItemModel",
  ProcessFormModel: "PatternFormItemModel",
  PatternFormGridModel: "PatternFormItemModel",
  ApprovalDetailsModel: "ApprovalDetailsItemModel",
  ApprovalDetailsGridModel: "ApprovalDetailsItemModel",
  ApplyTaskCardDetailsModel: "ApplyTaskCardDetailsItemModel",
  ApplyTaskCardGridModel: "ApplyTaskCardDetailsItemModel",
  ApprovalTaskCardDetailsModel: "ApprovalTaskCardDetailsItemModel",
  ApprovalTaskCardGridModel: "ApprovalTaskCardDetailsItemModel"
};
function normalizeApprovalSemanticUse(use) {
  const normalized = String(use || "").trim();
  if (!normalized) {
    return normalized;
  }
  return APPROVAL_SEMANTIC_USE_ALIASES[normalized] || normalized;
}
function getApprovalDefaultGridUse(use) {
  const normalized = String(use || "").trim();
  return normalized ? APPROVAL_DEFAULT_GRID_USE_BY_OWNER_USE[normalized] : void 0;
}
function getApprovalFieldWrapperUse(containerUse) {
  const normalized = String(containerUse || "").trim();
  return normalized ? APPROVAL_FIELD_WRAPPER_USE_BY_CONTAINER_USE[normalized] : void 0;
}
function isApprovalFormContainerUse(use) {
  return APPROVAL_FORM_CONTAINER_USE_SET.has(String(use || "").trim());
}
function isApprovalTaskCardGridUse(use) {
  return APPROVAL_TASK_CARD_GRID_USES.includes(
    String(use || "").trim()
  );
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  APPROVAL_ACTION_CONTAINER_USES,
  APPROVAL_BLOCK_GRID_USES,
  APPROVAL_DETAILS_BLOCK_USES,
  APPROVAL_DETAILS_GRID_USES,
  APPROVAL_FIELD_WRAPPER_USES,
  APPROVAL_FORM_BLOCK_USES,
  APPROVAL_FORM_GRID_USES,
  APPROVAL_PAGE_MODEL_USES,
  APPROVAL_TAB_MODEL_USES,
  APPROVAL_TASK_CARD_GRID_USES,
  getApprovalDefaultGridUse,
  getApprovalFieldWrapperUse,
  isApprovalFormContainerUse,
  isApprovalTaskCardGridUse,
  normalizeApprovalSemanticUse
});
