/**
 * 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 action_specs_exports = {};
__export(action_specs_exports, {
  FLOW_SURFACE_PLAN_ACTION_SPECS: () => FLOW_SURFACE_PLAN_ACTION_SPECS,
  FLOW_SURFACE_PLAN_STEP_ACTIONS: () => FLOW_SURFACE_PLAN_STEP_ACTIONS,
  getFlowSurfacePlanActionSpec: () => getFlowSurfacePlanActionSpec,
  getFlowSurfacePlanSelectorRequirements: () => getFlowSurfacePlanSelectorRequirements,
  isFlowSurfacePlanOnlyAction: () => isFlowSurfacePlanOnlyAction
});
module.exports = __toCommonJS(action_specs_exports);
const FLOW_SURFACE_PLAN_SELECTOR_REQUIREMENTS = {
  none: {
    requiresTarget: false,
    requiresSource: false
  },
  target: {
    requiresTarget: true,
    requiresSource: false
  },
  rootUidTarget: {
    requiresTarget: true,
    requiresSource: false
  },
  sourceTarget: {
    requiresTarget: true,
    requiresSource: true
  }
};
function defineFlowSurfacePlanActionSpecs(specs) {
  return specs;
}
const FLOW_SURFACE_PLAN_ACTION_SPECS = defineFlowSurfacePlanActionSpecs({
  createMenu: {
    selectorMode: "none",
    executionKind: "mutate"
  },
  createPage: {
    selectorMode: "none",
    executionKind: "mutate"
  },
  compose: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  configure: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  setFieldValueRules: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  setBlockLinkageRules: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  setFieldLinkageRules: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  setActionLinkageRules: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  updateSettings: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  addEventFlow: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  setEventFlow: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  removeEventFlow: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  setEventFlows: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  setLayout: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  addTab: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  updateTab: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  moveTab: {
    selectorMode: "sourceTarget",
    executionKind: "mutate"
  },
  removeTab: {
    selectorMode: "rootUidTarget",
    executionKind: "mutate"
  },
  addPopupTab: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  updatePopupTab: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  movePopupTab: {
    selectorMode: "sourceTarget",
    executionKind: "mutate"
  },
  removePopupTab: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  addBlock: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  addField: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  addAction: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  addRecordAction: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  moveNode: {
    selectorMode: "sourceTarget",
    executionKind: "mutate"
  },
  removeNode: {
    selectorMode: "target",
    executionKind: "mutate"
  },
  convertTemplateToCopy: {
    selectorMode: "target",
    executionKind: "planOnly"
  },
  destroyPage: {
    selectorMode: "rootUidTarget",
    executionKind: "mutate"
  }
});
const FLOW_SURFACE_PLAN_STEP_ACTIONS = Object.freeze(
  Object.keys(FLOW_SURFACE_PLAN_ACTION_SPECS)
);
function getFlowSurfacePlanSelectorRequirements(selectorMode) {
  return FLOW_SURFACE_PLAN_SELECTOR_REQUIREMENTS[selectorMode];
}
function getFlowSurfacePlanActionSpec(action) {
  if (!Object.prototype.hasOwnProperty.call(FLOW_SURFACE_PLAN_ACTION_SPECS, action)) {
    return void 0;
  }
  return FLOW_SURFACE_PLAN_ACTION_SPECS[action];
}
function isFlowSurfacePlanOnlyAction(action) {
  var _a;
  return ((_a = getFlowSurfacePlanActionSpec(action)) == null ? void 0 : _a.executionKind) === "planOnly";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  FLOW_SURFACE_PLAN_ACTION_SPECS,
  FLOW_SURFACE_PLAN_STEP_ACTIONS,
  getFlowSurfacePlanActionSpec,
  getFlowSurfacePlanSelectorRequirements,
  isFlowSurfacePlanOnlyAction
});
