"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 interactive_submission_data_exports = {};
__export(interactive_submission_data_exports, {
  Create: () => Create,
  Exercise: () => Exercise,
  Fetch: () => Fetch,
  Node: () => Node,
  Rollback: () => Rollback
});
module.exports = __toCommonJS(interactive_submission_data_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");
var import_value = require("../../../value.cjs");
var import_value2 = require("../../../value.cjs");
class Fetch$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.transaction.v1.Fetch", [
      {
        no: 1,
        name: "lf_version",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "contract_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "package_name",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "template_id",
        kind: "message",
        T: () => import_value2.Identifier
      },
      {
        no: 5,
        name: "signatories",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 6,
        name: "stakeholders",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 7,
        name: "acting_parties",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 8,
        name: "interface_id",
        kind: "message",
        T: () => import_value2.Identifier
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.lfVersion = "";
    message.contractId = "";
    message.packageName = "";
    message.signatories = [];
    message.stakeholders = [];
    message.actingParties = [];
    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 lf_version */
        1:
          message.lfVersion = reader.string();
          break;
        case /* string contract_id */
        2:
          message.contractId = reader.string();
          break;
        case /* string package_name */
        3:
          message.packageName = reader.string();
          break;
        case /* com.daml.ledger.api.v2.Identifier template_id */
        4:
          message.templateId = import_value2.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.templateId
          );
          break;
        case /* repeated string signatories */
        5:
          message.signatories.push(reader.string());
          break;
        case /* repeated string stakeholders */
        6:
          message.stakeholders.push(reader.string());
          break;
        case /* repeated string acting_parties */
        7:
          message.actingParties.push(reader.string());
          break;
        case /* com.daml.ledger.api.v2.Identifier interface_id */
        8:
          message.interfaceId = import_value2.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.interfaceId
          );
          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.lfVersion !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.lfVersion);
    if (message.contractId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.contractId);
    if (message.packageName !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.packageName);
    if (message.templateId)
      import_value2.Identifier.internalBinaryWrite(
        message.templateId,
        writer.tag(4, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.signatories.length; i++)
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.signatories[i]);
    for (let i = 0; i < message.stakeholders.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.stakeholders[i]);
    for (let i = 0; i < message.actingParties.length; i++)
      writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.actingParties[i]);
    if (message.interfaceId)
      import_value2.Identifier.internalBinaryWrite(
        message.interfaceId,
        writer.tag(8, 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 Fetch = new Fetch$Type();
class Exercise$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.transaction.v1.Exercise", [
      {
        no: 1,
        name: "lf_version",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "contract_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "package_name",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "template_id",
        kind: "message",
        T: () => import_value2.Identifier
      },
      {
        no: 5,
        name: "signatories",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 6,
        name: "stakeholders",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 7,
        name: "acting_parties",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 8,
        name: "interface_id",
        kind: "message",
        T: () => import_value2.Identifier
      },
      {
        no: 9,
        name: "choice_id",
        kind: "scalar",
        T: 9
      },
      { no: 10, name: "chosen_value", kind: "message", T: () => import_value.Value },
      {
        no: 11,
        name: "consuming",
        kind: "scalar",
        T: 8
      },
      {
        no: 12,
        name: "children",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 13,
        name: "exercise_result",
        kind: "message",
        T: () => import_value.Value
      },
      {
        no: 14,
        name: "choice_observers",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.lfVersion = "";
    message.contractId = "";
    message.packageName = "";
    message.signatories = [];
    message.stakeholders = [];
    message.actingParties = [];
    message.choiceId = "";
    message.consuming = false;
    message.children = [];
    message.choiceObservers = [];
    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 lf_version */
        1:
          message.lfVersion = reader.string();
          break;
        case /* string contract_id */
        2:
          message.contractId = reader.string();
          break;
        case /* string package_name */
        3:
          message.packageName = reader.string();
          break;
        case /* com.daml.ledger.api.v2.Identifier template_id */
        4:
          message.templateId = import_value2.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.templateId
          );
          break;
        case /* repeated string signatories */
        5:
          message.signatories.push(reader.string());
          break;
        case /* repeated string stakeholders */
        6:
          message.stakeholders.push(reader.string());
          break;
        case /* repeated string acting_parties */
        7:
          message.actingParties.push(reader.string());
          break;
        case /* com.daml.ledger.api.v2.Identifier interface_id */
        8:
          message.interfaceId = import_value2.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.interfaceId
          );
          break;
        case /* string choice_id */
        9:
          message.choiceId = reader.string();
          break;
        case /* com.daml.ledger.api.v2.Value chosen_value */
        10:
          message.chosenValue = import_value.Value.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.chosenValue
          );
          break;
        case /* bool consuming */
        11:
          message.consuming = reader.bool();
          break;
        case /* repeated string children */
        12:
          message.children.push(reader.string());
          break;
        case /* com.daml.ledger.api.v2.Value exercise_result */
        13:
          message.exerciseResult = import_value.Value.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.exerciseResult
          );
          break;
        case /* repeated string choice_observers */
        14:
          message.choiceObservers.push(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.lfVersion !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.lfVersion);
    if (message.contractId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.contractId);
    if (message.packageName !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.packageName);
    if (message.templateId)
      import_value2.Identifier.internalBinaryWrite(
        message.templateId,
        writer.tag(4, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.signatories.length; i++)
      writer.tag(5, import_runtime.WireType.LengthDelimited).string(message.signatories[i]);
    for (let i = 0; i < message.stakeholders.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.stakeholders[i]);
    for (let i = 0; i < message.actingParties.length; i++)
      writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.actingParties[i]);
    if (message.interfaceId)
      import_value2.Identifier.internalBinaryWrite(
        message.interfaceId,
        writer.tag(8, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.choiceId !== "")
      writer.tag(9, import_runtime.WireType.LengthDelimited).string(message.choiceId);
    if (message.chosenValue)
      import_value.Value.internalBinaryWrite(
        message.chosenValue,
        writer.tag(10, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.consuming !== false)
      writer.tag(11, import_runtime.WireType.Varint).bool(message.consuming);
    for (let i = 0; i < message.children.length; i++)
      writer.tag(12, import_runtime.WireType.LengthDelimited).string(message.children[i]);
    if (message.exerciseResult)
      import_value.Value.internalBinaryWrite(
        message.exerciseResult,
        writer.tag(13, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.choiceObservers.length; i++)
      writer.tag(14, import_runtime.WireType.LengthDelimited).string(message.choiceObservers[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Exercise = new Exercise$Type();
class Create$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.transaction.v1.Create", [
      {
        no: 1,
        name: "lf_version",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "contract_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "package_name",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "template_id",
        kind: "message",
        T: () => import_value2.Identifier
      },
      { no: 5, name: "argument", kind: "message", T: () => import_value.Value },
      {
        no: 6,
        name: "signatories",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 7,
        name: "stakeholders",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.lfVersion = "";
    message.contractId = "";
    message.packageName = "";
    message.signatories = [];
    message.stakeholders = [];
    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 lf_version */
        1:
          message.lfVersion = reader.string();
          break;
        case /* string contract_id */
        2:
          message.contractId = reader.string();
          break;
        case /* string package_name */
        3:
          message.packageName = reader.string();
          break;
        case /* com.daml.ledger.api.v2.Identifier template_id */
        4:
          message.templateId = import_value2.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.templateId
          );
          break;
        case /* com.daml.ledger.api.v2.Value argument */
        5:
          message.argument = import_value.Value.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.argument
          );
          break;
        case /* repeated string signatories */
        6:
          message.signatories.push(reader.string());
          break;
        case /* repeated string stakeholders */
        7:
          message.stakeholders.push(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.lfVersion !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.lfVersion);
    if (message.contractId !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.contractId);
    if (message.packageName !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.packageName);
    if (message.templateId)
      import_value2.Identifier.internalBinaryWrite(
        message.templateId,
        writer.tag(4, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.argument)
      import_value.Value.internalBinaryWrite(
        message.argument,
        writer.tag(5, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    for (let i = 0; i < message.signatories.length; i++)
      writer.tag(6, import_runtime.WireType.LengthDelimited).string(message.signatories[i]);
    for (let i = 0; i < message.stakeholders.length; i++)
      writer.tag(7, import_runtime.WireType.LengthDelimited).string(message.stakeholders[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Create = new Create$Type();
class Rollback$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.transaction.v1.Rollback", [
      {
        no: 1,
        name: "children",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.children = [];
    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 /* repeated string children */
        1:
          message.children.push(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) {
    for (let i = 0; i < message.children.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.children[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Rollback = new Rollback$Type();
class Node$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.interactive.transaction.v1.Node", [
      {
        no: 1,
        name: "create",
        kind: "message",
        oneof: "nodeType",
        T: () => Create
      },
      {
        no: 2,
        name: "fetch",
        kind: "message",
        oneof: "nodeType",
        T: () => Fetch
      },
      {
        no: 3,
        name: "exercise",
        kind: "message",
        oneof: "nodeType",
        T: () => Exercise
      },
      {
        no: 4,
        name: "rollback",
        kind: "message",
        oneof: "nodeType",
        T: () => Rollback
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.nodeType = { 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.interactive.transaction.v1.Create create */
        1:
          message.nodeType = {
            oneofKind: "create",
            create: Create.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.nodeType.create
            )
          };
          break;
        case /* com.daml.ledger.api.v2.interactive.transaction.v1.Fetch fetch */
        2:
          message.nodeType = {
            oneofKind: "fetch",
            fetch: Fetch.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.nodeType.fetch
            )
          };
          break;
        case /* com.daml.ledger.api.v2.interactive.transaction.v1.Exercise exercise */
        3:
          message.nodeType = {
            oneofKind: "exercise",
            exercise: Exercise.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.nodeType.exercise
            )
          };
          break;
        case /* com.daml.ledger.api.v2.interactive.transaction.v1.Rollback rollback */
        4:
          message.nodeType = {
            oneofKind: "rollback",
            rollback: Rollback.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.nodeType.rollback
            )
          };
          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.nodeType.oneofKind === "create")
      Create.internalBinaryWrite(
        message.nodeType.create,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.nodeType.oneofKind === "fetch")
      Fetch.internalBinaryWrite(
        message.nodeType.fetch,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.nodeType.oneofKind === "exercise")
      Exercise.internalBinaryWrite(
        message.nodeType.exercise,
        writer.tag(3, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.nodeType.oneofKind === "rollback")
      Rollback.internalBinaryWrite(
        message.nodeType.rollback,
        writer.tag(4, 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 Node = new Node$Type();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  Create,
  Exercise,
  Fetch,
  Node,
  Rollback
});
//# sourceMappingURL=interactive_submission_data.cjs.map