"use strict";
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 reassignment_commands_exports = {};
__export(reassignment_commands_exports, {
  AssignCommand: () => AssignCommand,
  ReassignmentCommand: () => ReassignmentCommand,
  ReassignmentCommands: () => ReassignmentCommands,
  UnassignCommand: () => UnassignCommand
});
module.exports = __toCommonJS(reassignment_commands_exports);
var import_runtime = require("@protobuf-ts/runtime");
var import_runtime2 = require("@protobuf-ts/runtime");
var import_runtime3 = require("@protobuf-ts/runtime");
var import_runtime4 = require("@protobuf-ts/runtime");
class ReassignmentCommands$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ReassignmentCommands", [
      {
        no: 1,
        name: "workflow_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "user_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "command_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "submitter",
        kind: "scalar",
        T: 9
      },
      {
        no: 5,
        name: "submission_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 6,
        name: "commands",
        kind: "message",
        repeat: 2,
        T: () => ReassignmentCommand
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.workflowId = "";
    message.userId = "";
    message.commandId = "";
    message.submitter = "";
    message.submissionId = "";
    message.commands = [];
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string workflow_id */
        1:
          message.workflowId = reader.string();
          break;
        case /* string user_id */
        2:
          message.userId = reader.string();
          break;
        case /* string command_id */
        3:
          message.commandId = reader.string();
          break;
        case /* string submitter */
        4:
          message.submitter = reader.string();
          break;
        case /* string submission_id */
        5:
          message.submissionId = reader.string();
          break;
        case /* repeated com.daml.ledger.api.v2.ReassignmentCommand commands */
        6:
          message.commands.push(
            ReassignmentCommand.internalBinaryRead(
              reader,
              reader.uint32(),
              options
            )
          );
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.workflowId !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.workflowId);
    if (message.userId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.userId);
    if (message.commandId !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.commandId);
    if (message.submitter !== "")
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.submitter);
    if (message.submissionId !== "")
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.submissionId);
    for (let i = 0; i < message.commands.length; i++)
      ReassignmentCommand.internalBinaryWrite(
        message.commands[i],
        writer.tag(6, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ReassignmentCommands = new ReassignmentCommands$Type();
class ReassignmentCommand$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ReassignmentCommand", [
      {
        no: 1,
        name: "unassign_command",
        kind: "message",
        oneof: "command",
        T: () => UnassignCommand
      },
      {
        no: 2,
        name: "assign_command",
        kind: "message",
        oneof: "command",
        T: () => AssignCommand
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.command = { oneofKind: void 0 };
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* com.daml.ledger.api.v2.UnassignCommand unassign_command */
        1:
          message.command = {
            oneofKind: "unassignCommand",
            unassignCommand: UnassignCommand.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.command.unassignCommand
            )
          };
          break;
        case /* com.daml.ledger.api.v2.AssignCommand assign_command */
        2:
          message.command = {
            oneofKind: "assignCommand",
            assignCommand: AssignCommand.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.command.assignCommand
            )
          };
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.command.oneofKind === "unassignCommand")
      UnassignCommand.internalBinaryWrite(
        message.command.unassignCommand,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.command.oneofKind === "assignCommand")
      AssignCommand.internalBinaryWrite(
        message.command.assignCommand,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ReassignmentCommand = new ReassignmentCommand$Type();
class UnassignCommand$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.UnassignCommand", [
      {
        no: 1,
        name: "contract_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "source",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "target",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.contractId = "";
    message.source = "";
    message.target = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string contract_id */
        1:
          message.contractId = reader.string();
          break;
        case /* string source */
        2:
          message.source = reader.string();
          break;
        case /* string target */
        3:
          message.target = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.contractId !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.contractId);
    if (message.source !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.source);
    if (message.target !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.target);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const UnassignCommand = new UnassignCommand$Type();
class AssignCommand$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.AssignCommand", [
      {
        no: 1,
        name: "unassign_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "source",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "target",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.unassignId = "";
    message.source = "";
    message.target = "";
    if (value !== void 0)
      (0, import_runtime3.reflectionMergePartial)(this, message, value);
    return message;
  }
  internalBinaryRead(reader, length, options, target) {
    let message = target ?? this.create(), end = reader.pos + length;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case /* string unassign_id */
        1:
          message.unassignId = reader.string();
          break;
        case /* string source */
        2:
          message.source = reader.string();
          break;
        case /* string target */
        3:
          message.target = reader.string();
          break;
        default:
          let u = options.readUnknownField;
          if (u === "throw")
            throw new globalThis.Error(
              `Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`
            );
          let d = reader.skip(wireType);
          if (u !== false)
            (u === true ? import_runtime2.UnknownFieldHandler.onRead : u)(
              this.typeName,
              message,
              fieldNo,
              wireType,
              d
            );
      }
    }
    return message;
  }
  internalBinaryWrite(message, writer, options) {
    if (message.unassignId !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.unassignId);
    if (message.source !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.source);
    if (message.target !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.target);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const AssignCommand = new AssignCommand$Type();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  AssignCommand,
  ReassignmentCommand,
  ReassignmentCommands,
  UnassignCommand
});
//# sourceMappingURL=reassignment_commands.cjs.map