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);
var Plugin_exports = {};
__export(Plugin_exports, {
  PluginManual: () => PluginManual
});
module.exports = __toCommonJS(Plugin_exports);
var import_actions = __toESM(require("@tachybase/actions"));
var import_server = require("@tachybase/server");
var import__ = __toESM(require("../.."));
var import_actions2 = require("./actions");
var import_ManualInstruction = __toESM(require("./ManualInstruction"));
class PluginManual extends import_server.Plugin {
  async load() {
    this.app.resourcer.define({
      name: "users_jobs",
      actions: {
        list: {
          filter: {
            $or: [
              {
                "workflow.enabled": true
              },
              {
                "workflow.enabled": false,
                status: {
                  $ne: import__.JOB_STATUS.PENDING
                }
              }
            ]
          },
          handler: import_actions.default.list
        },
        submit: import_actions2.submit
      }
    });
    this.app.acl.allow("users_jobs", ["list", "get", "submit"], "loggedIn");
    const workflowPlugin = this.app.pm.get(import__.default);
    workflowPlugin.registerInstruction("manual", import_ManualInstruction.default);
  }
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  PluginManual
});
