"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 transaction_filter_exports = {};
__export(transaction_filter_exports, {
  CumulativeFilter: () => CumulativeFilter,
  EventFormat: () => EventFormat,
  Filters: () => Filters,
  InterfaceFilter: () => InterfaceFilter,
  ParticipantAuthorizationTopologyFormat: () => ParticipantAuthorizationTopologyFormat,
  TemplateFilter: () => TemplateFilter,
  TopologyFormat: () => TopologyFormat,
  TransactionFilter: () => TransactionFilter,
  TransactionFormat: () => TransactionFormat,
  TransactionShape: () => TransactionShape,
  UpdateFormat: () => UpdateFormat,
  WildcardFilter: () => WildcardFilter
});
module.exports = __toCommonJS(transaction_filter_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 TransactionShape = /* @__PURE__ */ ((TransactionShape2) => {
  TransactionShape2[TransactionShape2["UNSPECIFIED"] = 0] = "UNSPECIFIED";
  TransactionShape2[TransactionShape2["ACS_DELTA"] = 1] = "ACS_DELTA";
  TransactionShape2[TransactionShape2["LEDGER_EFFECTS"] = 2] = "LEDGER_EFFECTS";
  return TransactionShape2;
})(TransactionShape || {});
class Filters$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.Filters", [
      {
        no: 1,
        name: "cumulative",
        kind: "message",
        repeat: 2,
        T: () => CumulativeFilter
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.cumulative = [];
    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 com.daml.ledger.api.v2.CumulativeFilter cumulative */
        1:
          message.cumulative.push(
            CumulativeFilter.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) {
    for (let i = 0; i < message.cumulative.length; i++)
      CumulativeFilter.internalBinaryWrite(
        message.cumulative[i],
        writer.tag(1, 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 Filters = new Filters$Type();
class CumulativeFilter$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.CumulativeFilter", [
      {
        no: 1,
        name: "wildcard_filter",
        kind: "message",
        oneof: "identifierFilter",
        T: () => WildcardFilter
      },
      {
        no: 2,
        name: "interface_filter",
        kind: "message",
        oneof: "identifierFilter",
        T: () => InterfaceFilter
      },
      {
        no: 3,
        name: "template_filter",
        kind: "message",
        oneof: "identifierFilter",
        T: () => TemplateFilter
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.identifierFilter = { 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.WildcardFilter wildcard_filter */
        1:
          message.identifierFilter = {
            oneofKind: "wildcardFilter",
            wildcardFilter: WildcardFilter.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.identifierFilter.wildcardFilter
            )
          };
          break;
        case /* com.daml.ledger.api.v2.InterfaceFilter interface_filter */
        2:
          message.identifierFilter = {
            oneofKind: "interfaceFilter",
            interfaceFilter: InterfaceFilter.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.identifierFilter.interfaceFilter
            )
          };
          break;
        case /* com.daml.ledger.api.v2.TemplateFilter template_filter */
        3:
          message.identifierFilter = {
            oneofKind: "templateFilter",
            templateFilter: TemplateFilter.internalBinaryRead(
              reader,
              reader.uint32(),
              options,
              message.identifierFilter.templateFilter
            )
          };
          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.identifierFilter.oneofKind === "wildcardFilter")
      WildcardFilter.internalBinaryWrite(
        message.identifierFilter.wildcardFilter,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.identifierFilter.oneofKind === "interfaceFilter")
      InterfaceFilter.internalBinaryWrite(
        message.identifierFilter.interfaceFilter,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.identifierFilter.oneofKind === "templateFilter")
      TemplateFilter.internalBinaryWrite(
        message.identifierFilter.templateFilter,
        writer.tag(3, 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 CumulativeFilter = new CumulativeFilter$Type();
class WildcardFilter$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.WildcardFilter", [
      {
        no: 1,
        name: "include_created_event_blob",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.includeCreatedEventBlob = false;
    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 /* bool include_created_event_blob */
        1:
          message.includeCreatedEventBlob = reader.bool();
          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.includeCreatedEventBlob !== false)
      writer.tag(1, import_runtime.WireType.Varint).bool(message.includeCreatedEventBlob);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const WildcardFilter = new WildcardFilter$Type();
class InterfaceFilter$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.InterfaceFilter", [
      {
        no: 1,
        name: "interface_id",
        kind: "message",
        T: () => import_value.Identifier
      },
      {
        no: 2,
        name: "include_interface_view",
        kind: "scalar",
        T: 8
      },
      {
        no: 3,
        name: "include_created_event_blob",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.includeInterfaceView = false;
    message.includeCreatedEventBlob = false;
    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.Identifier interface_id */
        1:
          message.interfaceId = import_value.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.interfaceId
          );
          break;
        case /* bool include_interface_view */
        2:
          message.includeInterfaceView = reader.bool();
          break;
        case /* bool include_created_event_blob */
        3:
          message.includeCreatedEventBlob = reader.bool();
          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.interfaceId)
      import_value.Identifier.internalBinaryWrite(
        message.interfaceId,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.includeInterfaceView !== false)
      writer.tag(2, import_runtime.WireType.Varint).bool(message.includeInterfaceView);
    if (message.includeCreatedEventBlob !== false)
      writer.tag(3, import_runtime.WireType.Varint).bool(message.includeCreatedEventBlob);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const InterfaceFilter = new InterfaceFilter$Type();
class TemplateFilter$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.TemplateFilter", [
      {
        no: 1,
        name: "template_id",
        kind: "message",
        T: () => import_value.Identifier
      },
      {
        no: 2,
        name: "include_created_event_blob",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.includeCreatedEventBlob = false;
    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.Identifier template_id */
        1:
          message.templateId = import_value.Identifier.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.templateId
          );
          break;
        case /* bool include_created_event_blob */
        2:
          message.includeCreatedEventBlob = reader.bool();
          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.templateId)
      import_value.Identifier.internalBinaryWrite(
        message.templateId,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.includeCreatedEventBlob !== false)
      writer.tag(2, import_runtime.WireType.Varint).bool(message.includeCreatedEventBlob);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const TemplateFilter = new TemplateFilter$Type();
class TransactionFilter$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.TransactionFilter", [
      {
        no: 1,
        name: "filters_by_party",
        kind: "map",
        K: 9,
        V: { kind: "message", T: () => Filters }
      },
      {
        no: 2,
        name: "filters_for_any_party",
        kind: "message",
        T: () => Filters
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.filtersByParty = {};
    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 /* map<string, com.daml.ledger.api.v2.Filters> filters_by_party */
        1:
          this.binaryReadMap1(message.filtersByParty, reader, options);
          break;
        case /* com.daml.ledger.api.v2.Filters filters_for_any_party */
        2:
          message.filtersForAnyParty = Filters.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.filtersForAnyParty
          );
          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;
  }
  binaryReadMap1(map, reader, options) {
    let len = reader.uint32(), end = reader.pos + len, key, val;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case 1:
          key = reader.string();
          break;
        case 2:
          val = Filters.internalBinaryRead(
            reader,
            reader.uint32(),
            options
          );
          break;
        default:
          throw new globalThis.Error(
            "unknown map entry field for com.daml.ledger.api.v2.TransactionFilter.filters_by_party"
          );
      }
    }
    map[key ?? ""] = val ?? Filters.create();
  }
  internalBinaryWrite(message, writer, options) {
    for (let k of globalThis.Object.keys(message.filtersByParty)) {
      writer.tag(1, import_runtime.WireType.LengthDelimited).fork().tag(1, import_runtime.WireType.LengthDelimited).string(k);
      writer.tag(2, import_runtime.WireType.LengthDelimited).fork();
      Filters.internalBinaryWrite(
        message.filtersByParty[k],
        writer,
        options
      );
      writer.join().join();
    }
    if (message.filtersForAnyParty)
      Filters.internalBinaryWrite(
        message.filtersForAnyParty,
        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 TransactionFilter = new TransactionFilter$Type();
class EventFormat$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.EventFormat", [
      {
        no: 1,
        name: "filters_by_party",
        kind: "map",
        K: 9,
        V: { kind: "message", T: () => Filters }
      },
      {
        no: 2,
        name: "filters_for_any_party",
        kind: "message",
        T: () => Filters
      },
      {
        no: 3,
        name: "verbose",
        kind: "scalar",
        T: 8
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.filtersByParty = {};
    message.verbose = false;
    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 /* map<string, com.daml.ledger.api.v2.Filters> filters_by_party */
        1:
          this.binaryReadMap1(message.filtersByParty, reader, options);
          break;
        case /* com.daml.ledger.api.v2.Filters filters_for_any_party */
        2:
          message.filtersForAnyParty = Filters.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.filtersForAnyParty
          );
          break;
        case /* bool verbose */
        3:
          message.verbose = reader.bool();
          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;
  }
  binaryReadMap1(map, reader, options) {
    let len = reader.uint32(), end = reader.pos + len, key, val;
    while (reader.pos < end) {
      let [fieldNo, wireType] = reader.tag();
      switch (fieldNo) {
        case 1:
          key = reader.string();
          break;
        case 2:
          val = Filters.internalBinaryRead(
            reader,
            reader.uint32(),
            options
          );
          break;
        default:
          throw new globalThis.Error(
            "unknown map entry field for com.daml.ledger.api.v2.EventFormat.filters_by_party"
          );
      }
    }
    map[key ?? ""] = val ?? Filters.create();
  }
  internalBinaryWrite(message, writer, options) {
    for (let k of globalThis.Object.keys(message.filtersByParty)) {
      writer.tag(1, import_runtime.WireType.LengthDelimited).fork().tag(1, import_runtime.WireType.LengthDelimited).string(k);
      writer.tag(2, import_runtime.WireType.LengthDelimited).fork();
      Filters.internalBinaryWrite(
        message.filtersByParty[k],
        writer,
        options
      );
      writer.join().join();
    }
    if (message.filtersForAnyParty)
      Filters.internalBinaryWrite(
        message.filtersForAnyParty,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.verbose !== false)
      writer.tag(3, import_runtime.WireType.Varint).bool(message.verbose);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const EventFormat = new EventFormat$Type();
class TransactionFormat$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.TransactionFormat", [
      {
        no: 1,
        name: "event_format",
        kind: "message",
        T: () => EventFormat
      },
      {
        no: 2,
        name: "transaction_shape",
        kind: "enum",
        T: () => [
          "com.daml.ledger.api.v2.TransactionShape",
          TransactionShape,
          "TRANSACTION_SHAPE_"
        ]
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.transactionShape = 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.EventFormat event_format */
        1:
          message.eventFormat = EventFormat.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.eventFormat
          );
          break;
        case /* com.daml.ledger.api.v2.TransactionShape transaction_shape */
        2:
          message.transactionShape = reader.int32();
          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.eventFormat)
      EventFormat.internalBinaryWrite(
        message.eventFormat,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.transactionShape !== 0)
      writer.tag(2, import_runtime.WireType.Varint).int32(message.transactionShape);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const TransactionFormat = new TransactionFormat$Type();
class TopologyFormat$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.TopologyFormat", [
      {
        no: 1,
        name: "include_participant_authorization_events",
        kind: "message",
        T: () => ParticipantAuthorizationTopologyFormat
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    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.ParticipantAuthorizationTopologyFormat include_participant_authorization_events */
        1:
          message.includeParticipantAuthorizationEvents = ParticipantAuthorizationTopologyFormat.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.includeParticipantAuthorizationEvents
          );
          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.includeParticipantAuthorizationEvents)
      ParticipantAuthorizationTopologyFormat.internalBinaryWrite(
        message.includeParticipantAuthorizationEvents,
        writer.tag(1, 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 TopologyFormat = new TopologyFormat$Type();
class ParticipantAuthorizationTopologyFormat$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.ParticipantAuthorizationTopologyFormat", [
      {
        no: 1,
        name: "parties",
        kind: "scalar",
        repeat: 2,
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.parties = [];
    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 parties */
        1:
          message.parties.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.parties.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.parties[i]);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ParticipantAuthorizationTopologyFormat = new ParticipantAuthorizationTopologyFormat$Type();
class UpdateFormat$Type extends import_runtime4.MessageType {
  constructor() {
    super("com.daml.ledger.api.v2.UpdateFormat", [
      {
        no: 1,
        name: "include_transactions",
        kind: "message",
        T: () => TransactionFormat
      },
      {
        no: 2,
        name: "include_reassignments",
        kind: "message",
        T: () => EventFormat
      },
      {
        no: 3,
        name: "include_topology_events",
        kind: "message",
        T: () => TopologyFormat
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    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.TransactionFormat include_transactions */
        1:
          message.includeTransactions = TransactionFormat.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.includeTransactions
          );
          break;
        case /* com.daml.ledger.api.v2.EventFormat include_reassignments */
        2:
          message.includeReassignments = EventFormat.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.includeReassignments
          );
          break;
        case /* com.daml.ledger.api.v2.TopologyFormat include_topology_events */
        3:
          message.includeTopologyEvents = TopologyFormat.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.includeTopologyEvents
          );
          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.includeTransactions)
      TransactionFormat.internalBinaryWrite(
        message.includeTransactions,
        writer.tag(1, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.includeReassignments)
      EventFormat.internalBinaryWrite(
        message.includeReassignments,
        writer.tag(2, import_runtime.WireType.LengthDelimited).fork(),
        options
      ).join();
    if (message.includeTopologyEvents)
      TopologyFormat.internalBinaryWrite(
        message.includeTopologyEvents,
        writer.tag(3, 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 UpdateFormat = new UpdateFormat$Type();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  CumulativeFilter,
  EventFormat,
  Filters,
  InterfaceFilter,
  ParticipantAuthorizationTopologyFormat,
  TemplateFilter,
  TopologyFormat,
  TransactionFilter,
  TransactionFormat,
  TransactionShape,
  UpdateFormat,
  WildcardFilter
});
//# sourceMappingURL=transaction_filter.cjs.map