"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 error_details_exports = {};
__export(error_details_exports, {
  BadRequest: () => BadRequest,
  BadRequest_FieldViolation: () => BadRequest_FieldViolation,
  DebugInfo: () => DebugInfo,
  ErrorInfo: () => ErrorInfo,
  Help: () => Help,
  Help_Link: () => Help_Link,
  LocalizedMessage: () => LocalizedMessage,
  PreconditionFailure: () => PreconditionFailure,
  PreconditionFailure_Violation: () => PreconditionFailure_Violation,
  QuotaFailure: () => QuotaFailure,
  QuotaFailure_Violation: () => QuotaFailure_Violation,
  RequestInfo: () => RequestInfo,
  ResourceInfo: () => ResourceInfo,
  RetryInfo: () => RetryInfo
});
module.exports = __toCommonJS(error_details_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_duration = require("../protobuf/duration.cjs");
class ErrorInfo$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.ErrorInfo", [
      {
        no: 1,
        name: "reason",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "domain",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "metadata",
        kind: "map",
        K: 9,
        V: {
          kind: "scalar",
          T: 9
          /*ScalarType.STRING*/
        }
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.reason = "";
    message.domain = "";
    message.metadata = {};
    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 reason */
        1:
          message.reason = reader.string();
          break;
        case /* string domain */
        2:
          message.domain = reader.string();
          break;
        case /* map<string, string> metadata */
        3:
          this.binaryReadMap3(message.metadata, reader, 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;
  }
  binaryReadMap3(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 = reader.string();
          break;
        default:
          throw new globalThis.Error(
            "unknown map entry field for google.rpc.ErrorInfo.metadata"
          );
      }
    }
    map[key ?? ""] = val ?? "";
  }
  internalBinaryWrite(message, writer, options) {
    if (message.reason !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.reason);
    if (message.domain !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.domain);
    for (let k of globalThis.Object.keys(message.metadata))
      writer.tag(3, import_runtime.WireType.LengthDelimited).fork().tag(1, import_runtime.WireType.LengthDelimited).string(k).tag(2, import_runtime.WireType.LengthDelimited).string(message.metadata[k]).join();
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ErrorInfo = new ErrorInfo$Type();
class RetryInfo$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.RetryInfo", [
      { no: 1, name: "retry_delay", kind: "message", T: () => import_duration.Duration }
    ]);
  }
  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 /* google.protobuf.Duration retry_delay */
        1:
          message.retryDelay = import_duration.Duration.internalBinaryRead(
            reader,
            reader.uint32(),
            options,
            message.retryDelay
          );
          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.retryDelay)
      import_duration.Duration.internalBinaryWrite(
        message.retryDelay,
        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 RetryInfo = new RetryInfo$Type();
class DebugInfo$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.DebugInfo", [
      {
        no: 1,
        name: "stack_entries",
        kind: "scalar",
        repeat: 2,
        T: 9
      },
      {
        no: 2,
        name: "detail",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.stackEntries = [];
    message.detail = "";
    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 stack_entries */
        1:
          message.stackEntries.push(reader.string());
          break;
        case /* string detail */
        2:
          message.detail = 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.stackEntries.length; i++)
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.stackEntries[i]);
    if (message.detail !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.detail);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const DebugInfo = new DebugInfo$Type();
class QuotaFailure$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.QuotaFailure", [
      {
        no: 1,
        name: "violations",
        kind: "message",
        repeat: 2,
        T: () => QuotaFailure_Violation
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.violations = [];
    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 google.rpc.QuotaFailure.Violation violations */
        1:
          message.violations.push(
            QuotaFailure_Violation.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.violations.length; i++)
      QuotaFailure_Violation.internalBinaryWrite(
        message.violations[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 QuotaFailure = new QuotaFailure$Type();
class QuotaFailure_Violation$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.QuotaFailure.Violation", [
      {
        no: 1,
        name: "subject",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "description",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.subject = "";
    message.description = "";
    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 subject */
        1:
          message.subject = reader.string();
          break;
        case /* string description */
        2:
          message.description = 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.subject !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.subject);
    if (message.description !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.description);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const QuotaFailure_Violation = new QuotaFailure_Violation$Type();
class PreconditionFailure$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.PreconditionFailure", [
      {
        no: 1,
        name: "violations",
        kind: "message",
        repeat: 2,
        T: () => PreconditionFailure_Violation
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.violations = [];
    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 google.rpc.PreconditionFailure.Violation violations */
        1:
          message.violations.push(
            PreconditionFailure_Violation.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.violations.length; i++)
      PreconditionFailure_Violation.internalBinaryWrite(
        message.violations[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 PreconditionFailure = new PreconditionFailure$Type();
class PreconditionFailure_Violation$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.PreconditionFailure.Violation", [
      {
        no: 1,
        name: "type",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      },
      {
        no: 2,
        name: "subject",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "description",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.type = "";
    message.subject = "";
    message.description = "";
    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 type */
        1:
          message.type = reader.string();
          break;
        case /* string subject */
        2:
          message.subject = reader.string();
          break;
        case /* string description */
        3:
          message.description = 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.type !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.type);
    if (message.subject !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.subject);
    if (message.description !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.description);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const PreconditionFailure_Violation = new PreconditionFailure_Violation$Type();
class BadRequest$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.BadRequest", [
      {
        no: 1,
        name: "field_violations",
        kind: "message",
        repeat: 2,
        T: () => BadRequest_FieldViolation
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.fieldViolations = [];
    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 google.rpc.BadRequest.FieldViolation field_violations */
        1:
          message.fieldViolations.push(
            BadRequest_FieldViolation.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.fieldViolations.length; i++)
      BadRequest_FieldViolation.internalBinaryWrite(
        message.fieldViolations[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 BadRequest = new BadRequest$Type();
class BadRequest_FieldViolation$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.BadRequest.FieldViolation", [
      {
        no: 1,
        name: "field",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "description",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.field = "";
    message.description = "";
    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 field */
        1:
          message.field = reader.string();
          break;
        case /* string description */
        2:
          message.description = 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.field !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.field);
    if (message.description !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.description);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const BadRequest_FieldViolation = new BadRequest_FieldViolation$Type();
class RequestInfo$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.RequestInfo", [
      {
        no: 1,
        name: "request_id",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "serving_data",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.requestId = "";
    message.servingData = "";
    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 request_id */
        1:
          message.requestId = reader.string();
          break;
        case /* string serving_data */
        2:
          message.servingData = 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.requestId !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.requestId);
    if (message.servingData !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.servingData);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const RequestInfo = new RequestInfo$Type();
class ResourceInfo$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.ResourceInfo", [
      {
        no: 1,
        name: "resource_type",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "resource_name",
        kind: "scalar",
        T: 9
      },
      {
        no: 3,
        name: "owner",
        kind: "scalar",
        T: 9
      },
      {
        no: 4,
        name: "description",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.resourceType = "";
    message.resourceName = "";
    message.owner = "";
    message.description = "";
    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 resource_type */
        1:
          message.resourceType = reader.string();
          break;
        case /* string resource_name */
        2:
          message.resourceName = reader.string();
          break;
        case /* string owner */
        3:
          message.owner = reader.string();
          break;
        case /* string description */
        4:
          message.description = 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.resourceType !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.resourceType);
    if (message.resourceName !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.resourceName);
    if (message.owner !== "")
      writer.tag(3, import_runtime.WireType.LengthDelimited).string(message.owner);
    if (message.description !== "")
      writer.tag(4, import_runtime.WireType.LengthDelimited).string(message.description);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const ResourceInfo = new ResourceInfo$Type();
class Help$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.Help", [
      {
        no: 1,
        name: "links",
        kind: "message",
        repeat: 2,
        T: () => Help_Link
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.links = [];
    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 google.rpc.Help.Link links */
        1:
          message.links.push(
            Help_Link.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.links.length; i++)
      Help_Link.internalBinaryWrite(
        message.links[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 Help = new Help$Type();
class Help_Link$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.Help.Link", [
      {
        no: 1,
        name: "description",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "url",
        kind: "scalar",
        T: 9
        /*ScalarType.STRING*/
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.description = "";
    message.url = "";
    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 description */
        1:
          message.description = reader.string();
          break;
        case /* string url */
        2:
          message.url = 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.description !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.description);
    if (message.url !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.url);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const Help_Link = new Help_Link$Type();
class LocalizedMessage$Type extends import_runtime4.MessageType {
  constructor() {
    super("google.rpc.LocalizedMessage", [
      {
        no: 1,
        name: "locale",
        kind: "scalar",
        T: 9
      },
      {
        no: 2,
        name: "message",
        kind: "scalar",
        T: 9
      }
    ]);
  }
  create(value) {
    const message = globalThis.Object.create(this.messagePrototype);
    message.locale = "";
    message.message = "";
    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 locale */
        1:
          message.locale = reader.string();
          break;
        case /* string message */
        2:
          message.message = 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.locale !== "")
      writer.tag(1, import_runtime.WireType.LengthDelimited).string(message.locale);
    if (message.message !== "")
      writer.tag(2, import_runtime.WireType.LengthDelimited).string(message.message);
    let u = options.writeUnknownFields;
    if (u !== false)
      (u == true ? import_runtime2.UnknownFieldHandler.onWrite : u)(
        this.typeName,
        message,
        writer
      );
    return writer;
  }
}
const LocalizedMessage = new LocalizedMessage$Type();
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  BadRequest,
  BadRequest_FieldViolation,
  DebugInfo,
  ErrorInfo,
  Help,
  Help_Link,
  LocalizedMessage,
  PreconditionFailure,
  PreconditionFailure_Violation,
  QuotaFailure,
  QuotaFailure_Violation,
  RequestInfo,
  ResourceInfo,
  RetryInfo
});
//# sourceMappingURL=error_details.cjs.map