{"version":3,"file":"_ProtobufReader.mjs","names":[],"sources":["../../src/internal/_ProtobufReader.ts"],"sourcesContent":["import { ProtobufWire } from \"@typia/interface\";\nimport { Singleton } from \"@typia/utils\";\n\n/// @reference https://github.com/piotr-oles/as-proto/blob/main/packages/as-proto/assembly/internal/FixedReader.ts\n/**\n * Reads a Protocol Buffer message from a buffer.\n *\n * Every malformed input throws an error prefixed with\n * `typia.protobuf.decode()`. Length-prefixed bytes, message forks and field\n * skips restore their position on failure. Scalar varints may consume bytes\n * before failing, and invalid UTF-8 is reported after its byte range has been\n * consumed. Adapted from the fixed reader of as-proto.\n *\n * @evidence contracts/common.md#principled-implementation The reader decodes the wire format from a buffer with a pointer and a length-delimited boundary, throwing a typia-prefixed error for overflow, malformed varints or invalid UTF-8. Atomic bytes, fork and skip operations restore their pointer and boundary on failure; scalar varint reads can retain consumed bytes, and UTF-8 decoding can fail after bytes has completed. Varints are bounded to ten bytes with a tenth byte limited to bit 63 in every reading path, so skipping and reading agree on the wire limits.\n * @evidence contracts/common.md#clear-and-simple-design One class with public typed readers, skip methods and a message fork and close pair, and private varint readers and a bounds check shared by all of them; the fault builder and limits are module constants.\n * @evidence contracts/common.md#prohibited-implementation-shortcuts Limits come from the wire format; invalid input throws and is never repaired by truncation or guessing.\n * @evidence contracts/common.md#meaningful-documentation A reference comment names the origin, the fields have comments and the skip and varint helpers explain their bounds.\n */\nexport class _ProtobufReader {\n  /** Read buffer */\n  private buf: Uint8Array;\n\n  /** Read buffer pointer. */\n  private ptr: number;\n\n  /** DataView for buffer. */\n  private view: DataView;\n\n  /** Current length-delimited boundary. */\n  private end: number;\n\n  public constructor(buf: Uint8Array) {\n    this.buf = buf;\n    this.ptr = 0;\n    this.view = new DataView(buf.buffer, buf.byteOffset, buf.byteLength);\n    this.end = buf.length;\n  }\n\n  /**\n   * Return the offset of the next byte to read.\n   *\n   * @evidence contracts/common.md#principled-implementation Returns the read pointer, which is the offset of the next byte to be read.\n   * @evidence contracts/common.md#clear-and-simple-design One accessor.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts It exposes no mutable state.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is returned.\n   */\n  public index(): number {\n    return this.ptr;\n  }\n\n  /**\n   * Return the end of the buffer or of the open length-delimited message.\n   *\n   * @evidence contracts/common.md#principled-implementation Returns the current boundary, which is the end of the whole buffer or of the open length-delimited message.\n   * @evidence contracts/common.md#clear-and-simple-design One accessor.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts It exposes no mutable state.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is returned.\n   */\n  public size(): number {\n    return this.end;\n  }\n\n  /**\n   * Read an unsigned 32-bit varint.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads a varint and reinterprets it as an unsigned 32-bit number, so values of 2^31 or more are positive.\n   * @evidence contracts/common.md#clear-and-simple-design One delegation with an unsigned shift.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The reading follows the wire format.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public uint32(): number {\n    return this.varint32() >>> 0;\n  }\n\n  /**\n   * Read a signed 32-bit varint.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads a varint as a signed 32-bit number, which keeps the two's-complement meaning of a ten-byte negative value after truncation to 32 bits.\n   * @evidence contracts/common.md#clear-and-simple-design One delegation.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The reading follows the wire format.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public int32(): number {\n    return this.varint32();\n  }\n\n  /**\n   * Read a ZigZag encoded signed 32-bit integer.\n   *\n   * @evidence contracts/common.md#principled-implementation The varint is decoded with the ZigZag inverse `(v >>> 1) ^ -(v & 1)`, where the unsigned shift treats the 32-bit pattern as unsigned.\n   * @evidence contracts/common.md#clear-and-simple-design One expression over the varint reader.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is the protobuf definition.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public sint32(): number {\n    const value: number = this.varint32();\n    return (value >>> 1) ^ -(value & 1);\n  }\n\n  /**\n   * Read an unsigned 64-bit varint.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads a varint as an unsigned bigint, rejecting a payload above bit 63 or a varint longer than ten bytes.\n   * @evidence contracts/common.md#clear-and-simple-design One delegation.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The bounds are the wire format's.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public uint64(): bigint {\n    return this.varint64();\n  }\n\n  /**\n   * Read a signed 64-bit varint.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads the unsigned pattern and reinterprets it as a signed 64-bit bigint.\n   * @evidence contracts/common.md#clear-and-simple-design One delegation with an integer cast.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The reading follows the wire format.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public int64(): bigint {\n    return BigInt.asIntN(64, this.varint64());\n  }\n\n  /**\n   * Read a ZigZag encoded signed 64-bit integer.\n   *\n   * @evidence contracts/common.md#principled-implementation The varint is decoded with the ZigZag inverse on a bigint.\n   * @evidence contracts/common.md#clear-and-simple-design One expression over the 64-bit reader.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The mapping is the protobuf definition.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public sint64(): bigint {\n    const value = this.varint64();\n    return (value >> BigInt(0x01)) ^ -(value & BigInt(0x01));\n  }\n\n  /**\n   * Read a boolean, which is true for any non-zero varint.\n   *\n   * @evidence contracts/common.md#principled-implementation A varint is true when it is not zero, as the format defines.\n   * @evidence contracts/common.md#clear-and-simple-design One delegation.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The reading follows the wire format.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public bool(): boolean {\n    return this.varint32() !== 0;\n  }\n\n  /**\n   * Read a little-endian 32-bit float.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads four little-endian bytes through the data view after a bounds check.\n   * @evidence contracts/common.md#clear-and-simple-design One checked read.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The bounds check throws rather than reading past the boundary.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public float(): number {\n    return this.view.getFloat32(this.take(4), true);\n  }\n\n  /**\n   * Read a little-endian 64-bit float.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads eight little-endian bytes through the data view after a bounds check.\n   * @evidence contracts/common.md#clear-and-simple-design One checked read.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The bounds check throws rather than reading past the boundary.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public double(): number {\n    return this.view.getFloat64(this.take(8), true);\n  }\n\n  /**\n   * Read a length-prefixed byte range as a view into the buffer, without\n   * copying.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads a length-prefixed byte range as a view of the buffer and not a copy, inside an atomic block that restores the pointer if the length is invalid.\n   * @evidence contracts/common.md#clear-and-simple-design One function using the checked read.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The returned view shares memory with the input buffer, a stated aliasing.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public bytes(): Uint8Array {\n    return this.atomic(() => {\n      const length: number = this.uint32();\n      const from: number = this.take(length);\n      return this.buf.subarray(from, from + length);\n    });\n  }\n\n  /**\n   * Read a length-prefixed UTF-8 string, throwing on invalid UTF-8 after\n   * consuming its byte range. An invalid length restores the read position.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads the bytes and decodes them with a decoder that is fatal on invalid UTF-8, so malformed text throws a typia error instead of producing replacement characters. A byte-range failure rolls back through bytes; a decoding failure occurs after that range has been consumed and does not rewind it.\n   * @evidence contracts/common.md#clear-and-simple-design One function over bytes with a shared decoder.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The error is raised, not repaired.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is read.\n   */\n  public string(): string {\n    const bytes: Uint8Array = this.bytes();\n    const decoder: TextDecoder = utf8.get();\n    try {\n      return decoder.decode(bytes);\n    } catch {\n      throw error(\"invalid UTF-8 string.\");\n    }\n  }\n\n  /**\n   * Begin a length-delimited message and return the previous boundary to pass\n   * to `close`.\n   *\n   * @evidence contracts/common.md#principled-implementation Reads the length prefix, checks that it fits within the current boundary, narrows the boundary to the message end and returns the previous boundary for `close`; the pointer is restored on failure.\n   * @evidence contracts/common.md#clear-and-simple-design One atomic function paired with close.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The bounds check throws on an oversized prefix.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states what is returned.\n   */\n  public fork(): number {\n    return this.atomic(() => {\n      const previous: number = this.end;\n      const length: number = this.uint32();\n      this.validate(length);\n      this.end = this.ptr + length;\n      return previous;\n    });\n  }\n\n  /**\n   * End the message that `fork` began, which must have been consumed\n   * completely.\n   *\n   * @evidence contracts/common.md#principled-implementation Requires that the whole message was consumed and restores the previous boundary; an unread remainder is a malformed message and throws.\n   * @evidence contracts/common.md#clear-and-simple-design One check and one assignment.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The strictness is intentional and reports corruption.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states the check.\n   */\n  public close(previous: number): void {\n    if (this.ptr !== this.end) throw error(\"buffer overflow.\");\n    this.end = previous;\n  }\n\n  /**\n   * Advance by exactly `length` bytes, for every length including zero.\n   *\n   * @evidence contracts/common.md#principled-implementation Advances exactly the given number of bytes after a bounds check, including zero, so a zero-length field is skipped without moving or failing.\n   * @evidence contracts/common.md#clear-and-simple-design One checked advance.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The bounds check throws on overflow.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states the zero-length case.\n   */\n  public skip(length: number): void {\n    this.take(length);\n  }\n\n  /**\n   * Advance by exactly one varint, which carries no length prefix.\n   *\n   * A varint terminates at its first byte without the continuation bit, and may\n   * occupy no more than {@link VARINT_MAX_BYTES}. Its tenth byte is bounded\n   * twice over, by {@link lastVarintByte}: it may neither continue into an\n   * eleventh byte nor carry payload above bit 63. Skipping is where that is\n   * easiest to get wrong, because this path discards the bytes it reads and so\n   * never notices a value it could not have represented. Relaxing either bound\n   * here would accept a varint that `varint32` and `varint64` reject, making\n   * the limit depend on which method happens to consume the value.\n   *\n   * @evidence contracts/common.md#principled-implementation Advances over one varint, which has no length prefix, using the same ten-byte and bit-63 limits as the value readers, so the limit does not depend on which method consumes the value.\n   * @evidence contracts/common.md#clear-and-simple-design One atomic loop that delegates the last byte check to a shared helper.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts The skipped bytes are validated, which is the point of the helper; no looser limit is used.\n   * @evidence contracts/common.md#meaningful-documentation A long comment explains the bounds and why skipping must match reading.\n   */\n  public skipVarint(): void {\n    this.atomic(() => {\n      for (let i: number = 1; i < VARINT_MAX_BYTES; ++i)\n        if ((this.u8() & 0x80) === 0) return;\n      this.lastVarintByte();\n    });\n  }\n\n  /**\n   * Skip a field of the given wire type, including a nested group.\n   *\n   * @evidence contracts/common.md#principled-implementation A wire type selects how far to advance: a varint, eight bytes, a length-prefixed range, a group read until its end tag or four bytes; an unknown type throws with the offset. Group skipping recurses on nested types.\n   * @evidence contracts/common.md#clear-and-simple-design One atomic function with a switch.\n   * @evidence contracts/common.md#prohibited-implementation-shortcuts Unknown wire types are an error and not skipped by guess.\n   * @evidence contracts/common.md#meaningful-documentation A short comment states the supported wire types.\n   */\n  public skipType(wireType: ProtobufWire): void {\n    this.atomic(() => {\n      switch (wireType) {\n        case ProtobufWire.VARIANT:\n          this.skipVarint();\n          break;\n        case ProtobufWire.I64:\n          this.skip(8);\n          break;\n        case ProtobufWire.LEN:\n          this.skip(this.uint32());\n          break;\n        case ProtobufWire.START_GROUP:\n          while ((wireType = this.uint32() & 0x07) !== ProtobufWire.END_GROUP)\n            this.skipType(wireType);\n          break;\n        case ProtobufWire.I32:\n          this.skip(4);\n          break;\n        default:\n          throw error(`invalid wire type ${wireType} at offset ${this.ptr}.`);\n      }\n    });\n  }\n\n  private varint32(): number {\n    let loaded: number;\n    let value: number;\n\n    value = (loaded = this.u8()) & 0x7f;\n    if (loaded < 0x80) return value;\n\n    value |= ((loaded = this.u8()) & 0x7f) << 7;\n    if (loaded < 0x80) return value;\n\n    value |= ((loaded = this.u8()) & 0x7f) << 14;\n    if (loaded < 0x80) return value;\n\n    value |= ((loaded = this.u8()) & 0x7f) << 21;\n    if (loaded < 0x80) return value;\n\n    value |= ((loaded = this.u8()) & 0xf) << 28;\n    if (loaded < 0x80) return value;\n\n    // increment position until there is no continuation bit, or until this read\n    // reaches VARINT_MAX_BYTES and the value can hold no further bits\n    if (this.u8() < 0x80) return value;\n    if (this.u8() < 0x80) return value;\n    if (this.u8() < 0x80) return value;\n    if (this.u8() < 0x80) return value;\n    this.lastVarintByte();\n    return value;\n  }\n\n  private varint64(): bigint {\n    let loaded: bigint;\n    let value: bigint;\n\n    value = (loaded = this.u8n()) & BigInt(0x7f);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(7);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(14);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(21);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(28);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(35);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(42);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(49);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= ((loaded = this.u8n()) & BigInt(0x7f)) << BigInt(56);\n    if (loaded < BigInt(0x80)) return value;\n\n    value |= BigInt(this.lastVarintByte()) << BigInt(63);\n    return BigInt.asUintN(64, value);\n  }\n\n  /**\n   * Read the only byte whose varint payload is limited to bit 63.\n   *\n   * Two distinct faults meet on this byte, and each is named for what it is. A\n   * continuation bit means the varint would occupy an eleventh byte, which no\n   * 64-bit value can reach. Any other payload bit means the varint terminates\n   * within its ten bytes but carries a value bit above 63. Reporting the second\n   * as a length fault would tell the caller something untrue about a payload\n   * that is exactly ten bytes long.\n   */\n  private lastVarintByte(): number {\n    const loaded: number = this.u8();\n    if ((loaded & 0x80) !== 0)\n      throw error(`varint exceeds ${VARINT_MAX_BYTES} bytes.`);\n    if (loaded > 0x01) throw error(`varint exceeds ${VARINT_MAX_BITS} bits.`);\n    return loaded;\n  }\n\n  private u8(): number {\n    return this.view.getUint8(this.take(1));\n  }\n\n  private u8n(): bigint {\n    return BigInt(this.u8());\n  }\n\n  private take(length: number): number {\n    this.validate(length);\n    const from: number = this.ptr;\n    this.ptr += length;\n    return from;\n  }\n\n  private atomic<T>(closure: () => T): T {\n    const index: number = this.ptr;\n    const end: number = this.end;\n    try {\n      return closure();\n    } catch (thrown) {\n      this.ptr = index;\n      this.end = end;\n      throw thrown;\n    }\n  }\n\n  private validate(length: number): void {\n    if (\n      Number.isSafeInteger(length) === false ||\n      length < 0 ||\n      length > this.size() - this.ptr\n    )\n      throw error(\"buffer overflow.\");\n  }\n}\n\n/**\n * Builds every fault this reader raises, so each one names typia as its source.\n *\n * Every decode error a caller can see must be attributable, and the prefix is\n * what attributes it. Composing it here rather than at each throw keeps a new\n * fault from silently shipping without it.\n */\nconst error = (message: string): Error =>\n  new Error(`Error on typia.protobuf.decode(): ${message}`);\n\n/**\n * The most bytes a varint may occupy: a 64-bit value in seven-bit groups.\n *\n * Every path reads no further than its tenth byte and accepts only bit 63 from\n * that byte. This constant keeps the loop-driven skip path on the same limit.\n */\nconst VARINT_MAX_BYTES = 10;\n\n/**\n * The widest value a varint may carry: the 64-bit Protocol Buffer wire domain.\n *\n * The tenth byte reaches only bit 63, so a payload bit above it belongs to no\n * representable value. This names the overflow fault apart from the length\n * one.\n */\nconst VARINT_MAX_BITS = 64;\n\nconst utf8 = new Singleton(\n  () => new TextDecoder(\"utf-8\", { fatal: true, ignoreBOM: true }),\n);\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,IAAa,kBAAb,MAA6B;CAa3B,YAAmB,KAAiB;EAClC,KAAK,MAAM;EACX,KAAK,MAAM;EACX,KAAK,OAAO,IAAI,SAAS,IAAI,QAAQ,IAAI,YAAY,IAAI,UAAU;EACnE,KAAK,MAAM,IAAI;CACjB;;;;;;;;;CAUA,QAAuB;EACrB,OAAO,KAAK;CACd;;;;;;;;;CAUA,OAAsB;EACpB,OAAO,KAAK;CACd;;;;;;;;;CAUA,SAAwB;EACtB,OAAO,KAAK,SAAS,MAAM;CAC7B;;;;;;;;;CAUA,QAAuB;EACrB,OAAO,KAAK,SAAS;CACvB;;;;;;;;;CAUA,SAAwB;EACtB,MAAM,QAAgB,KAAK,SAAS;EACpC,OAAQ,UAAU,IAAK,EAAE,QAAQ;CACnC;;;;;;;;;CAUA,SAAwB;EACtB,OAAO,KAAK,SAAS;CACvB;;;;;;;;;CAUA,QAAuB;EACrB,OAAO,OAAO,OAAO,IAAI,KAAK,SAAS,CAAC;CAC1C;;;;;;;;;CAUA,SAAwB;EACtB,MAAM,QAAQ,KAAK,SAAS;EAC5B,OAAQ,SAAS,OAAO,CAAI,IAAK,EAAE,QAAQ,OAAO,CAAI;CACxD;;;;;;;;;CAUA,OAAuB;EACrB,OAAO,KAAK,SAAS,MAAM;CAC7B;;;;;;;;;CAUA,QAAuB;EACrB,OAAO,KAAK,KAAK,WAAW,KAAK,KAAK,CAAC,GAAG,IAAI;CAChD;;;;;;;;;CAUA,SAAwB;EACtB,OAAO,KAAK,KAAK,WAAW,KAAK,KAAK,CAAC,GAAG,IAAI;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