/**
 * 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 registry_exports = {};
__export(registry_exports, {
  FLOW_SURFACE_ACTION_LINKAGE_STATES: () => FLOW_SURFACE_ACTION_LINKAGE_STATES,
  FLOW_SURFACE_BLOCK_LINKAGE_STATES: () => FLOW_SURFACE_BLOCK_LINKAGE_STATES,
  FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE: () => FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE,
  FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE: () => FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE,
  FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES: () => FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES,
  FLOW_SURFACE_REACTION_SLOT_REGISTRY: () => FLOW_SURFACE_REACTION_SLOT_REGISTRY,
  FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE: () => FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE,
  getReactionKindsForUse: () => getReactionKindsForUse,
  getReactionSlot: () => getReactionSlot
});
module.exports = __toCommonJS(registry_exports);
const FLOW_SURFACE_REACTION_SLOT_REGISTRY = {
  fieldValue: {
    form: {
      flowKey: "formModelSettings",
      stepKey: "assignRules",
      valuePath: "value"
    }
  },
  blockLinkage: {
    block: {
      flowKey: "cardSettings",
      stepKey: "linkageRules",
      valuePath: "value"
    }
  },
  fieldLinkage: {
    form: {
      flowKey: "eventSettings",
      stepKey: "linkageRules",
      valuePath: "value"
    },
    details: {
      flowKey: "detailsSettings",
      stepKey: "linkageRules",
      valuePath: "value"
    },
    subForm: {
      flowKey: "eventSettings",
      stepKey: "linkageRules",
      valuePath: "value"
    }
  },
  actionLinkage: {
    action: {
      flowKey: "buttonSettings",
      stepKey: "linkageRules",
      valuePath: "value"
    }
  }
};
const FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE = {
  CreateFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
  EditFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
  FormBlockModel: ["blockLinkage", "fieldLinkage"],
  ApplyFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
  ProcessFormModel: ["fieldValue", "blockLinkage", "fieldLinkage"],
  DetailsBlockModel: ["blockLinkage", "fieldLinkage"],
  ApprovalDetailsModel: ["blockLinkage", "fieldLinkage"],
  ApplyTaskCardDetailsModel: ["blockLinkage", "fieldLinkage"],
  ApprovalTaskCardDetailsModel: ["blockLinkage", "fieldLinkage"],
  TableBlockModel: ["blockLinkage"],
  CalendarBlockModel: ["blockLinkage"],
  ListBlockModel: ["blockLinkage"],
  GridCardBlockModel: ["blockLinkage"],
  MarkdownBlockModel: ["blockLinkage"],
  IframeBlockModel: ["blockLinkage"],
  MapBlockModel: ["blockLinkage"],
  CommentsBlockModel: ["blockLinkage"],
  ChartBlockModel: ["blockLinkage"],
  ActionPanelBlockModel: ["blockLinkage"],
  AddNewActionModel: ["actionLinkage"],
  ViewActionModel: ["actionLinkage"],
  EditActionModel: ["actionLinkage"],
  PopupCollectionActionModel: ["actionLinkage"],
  DeleteActionModel: ["actionLinkage"],
  UpdateRecordActionModel: ["actionLinkage"],
  BulkUpdateActionModel: ["actionLinkage"],
  BulkDeleteActionModel: ["actionLinkage"],
  BulkEditActionModel: ["actionLinkage"],
  DuplicateActionModel: ["actionLinkage"],
  AddChildActionModel: ["actionLinkage"],
  MailSendActionModel: ["actionLinkage"],
  JSCollectionActionModel: ["actionLinkage"],
  JSRecordActionModel: ["actionLinkage"],
  JSFormActionModel: ["actionLinkage"],
  JSItemActionModel: ["actionLinkage"],
  FilterFormJSActionModel: ["actionLinkage"],
  JSActionModel: ["actionLinkage"],
  CalendarTodayActionModel: ["actionLinkage"],
  CalendarNavActionModel: ["actionLinkage"],
  CalendarTitleActionModel: ["actionLinkage"],
  CalendarViewSelectActionModel: ["actionLinkage"],
  LinkActionModel: ["actionLinkage"],
  ExportActionModel: ["actionLinkage"],
  ExportAttachmentActionModel: ["actionLinkage"],
  ImportActionModel: ["actionLinkage"],
  CollectionTriggerWorkflowActionModel: ["actionLinkage"],
  RecordTriggerWorkflowActionModel: ["actionLinkage"],
  FormTriggerWorkflowActionModel: ["actionLinkage"],
  WorkbenchTriggerWorkflowActionModel: ["actionLinkage"],
  RefreshActionModel: ["actionLinkage"],
  FilterActionModel: ["actionLinkage"],
  ExpandCollapseActionModel: ["actionLinkage"],
  FormSubmitActionModel: ["actionLinkage"],
  ApplyFormSubmitModel: ["actionLinkage"],
  ApplyFormSaveDraftModel: ["actionLinkage"],
  ApplyFormWithdrawModel: ["actionLinkage"],
  ProcessFormApproveModel: ["actionLinkage"],
  ProcessFormRejectModel: ["actionLinkage"],
  ProcessFormReturnModel: ["actionLinkage"],
  ProcessFormDelegateModel: ["actionLinkage"],
  ProcessFormAddAssigneeModel: ["actionLinkage"],
  FilterFormSubmitActionModel: ["actionLinkage"],
  FilterFormResetActionModel: ["actionLinkage"],
  FilterFormCollapseActionModel: ["actionLinkage"],
  SubFormFieldModel: ["fieldLinkage"],
  SubFormListFieldModel: ["fieldLinkage"]
};
const FLOW_SURFACE_BLOCK_LINKAGE_STATES = ["visible", "hidden"];
const FLOW_SURFACE_ACTION_LINKAGE_STATES = ["visible", "hidden", "hiddenText", "enabled", "disabled"];
const FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE = {
  form: ["visible", "hidden", "hiddenReservedValue", "required", "notRequired", "disabled", "enabled"],
  details: ["visible", "hidden", "hiddenReservedValue"],
  subForm: ["visible", "hidden", "hiddenReservedValue", "required", "notRequired", "disabled", "enabled"]
};
const FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE = {
  form: ["setFieldState", "assignField", "setFieldDefaultValue", "runjs"],
  details: ["setFieldState", "runjs"],
  subForm: ["setFieldState", "assignField", "runjs"]
};
const FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES = {
  block: {
    setBlockState: "linkageSetBlockProps",
    runjs: "linkageRunjs"
  },
  action: {
    setActionState: "linkageSetActionProps",
    runjs: "linkageRunjs"
  },
  form: {
    setFieldState: "linkageSetFieldProps",
    assignField: "linkageAssignField",
    setFieldDefaultValue: "setFieldsDefaultValue",
    runjs: "linkageRunjs"
  },
  details: {
    setFieldState: "linkageSetDetailsFieldProps",
    runjs: "linkageRunjs"
  },
  subForm: {
    setFieldState: "subFormLinkageSetFieldProps",
    assignField: "subFormLinkageAssignField",
    runjs: "linkageRunjs"
  }
};
function getReactionKindsForUse(use) {
  if (!use) {
    return [];
  }
  return [...FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE[use] || []];
}
function getReactionSlot(kind, scene) {
  var _a;
  return (_a = FLOW_SURFACE_REACTION_SLOT_REGISTRY[kind]) == null ? void 0 : _a[scene];
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FLOW_SURFACE_ACTION_LINKAGE_STATES,
  FLOW_SURFACE_BLOCK_LINKAGE_STATES,
  FLOW_SURFACE_FIELD_LINKAGE_ACTION_TYPES_BY_SCENE,
  FLOW_SURFACE_FIELD_LINKAGE_STATES_BY_SCENE,
  FLOW_SURFACE_LINKAGE_CANONICAL_ACTION_NAMES,
  FLOW_SURFACE_REACTION_SLOT_REGISTRY,
  FLOW_SURFACE_REACTION_SUPPORTED_KINDS_BY_USE,
  getReactionKindsForUse,
  getReactionSlot
});
