{"version":3,"file":"index.min.mjs","names":[],"sources":["../../src/unicode.ts","../../src/util.ts","../../src/bytes.ts","../../src/raw.ts","../../src/parseBytes.ts","../../src/parse.ts","../../src/escapes.ts","../../src/serializeShared.ts","../../src/stringifyBytes.ts","../../src/stringify.ts","../../src/index.ts"],"sourcesContent":["/* ECMAScript identifier + space-separator character classes.\n *\n * ID_Start / ID_Continue use ES2018 RegExp Unicode property escapes, so they\n * track the JavaScript engine's current Unicode version automatically (no\n * generated tables, no build step). Characters are tested as full code points\n * (the parser reads via String.fromCodePoint), so astral identifiers match.\n *\n * Space_Separator is the General_Category Zs set minus the ASCII space and\n * U+00A0, both of which the lexer handles as explicit cases.\n */\nexport const Space_Separator = /[\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport const ID_Start = /\\p{ID_Start}/u;\nexport const ID_Continue = /\\p{ID_Continue}/u;\n\nexport default { Space_Separator, ID_Start, ID_Continue };\n","import unicode from './unicode';\n\n/* Default digit-length cap for numeric tokens that feed BigInt(...). Base-10 →\n * BigInt conversion is super-linear in the digit count, so an attacker-sized\n * literal is a synchronous CPU/event-loop DoS; the cap bounds that work. Shared\n * by both parsers so the byte and string paths reject identically (the\n * differential invariant). Callers may override via the maxNumericDigits option. */\nexport const MAX_NUMERIC_DIGITS_DEFAULT = 10000;\n\n/* Default nesting-depth cap for the recursive reviver walk and both serializers.\n * Tree construction in the parsers is iterative and unaffected, but the reviver's\n * `internalize` and the serializers recurse once per nesting level, so a\n * deeply-nested document/value can overflow the JS call stack. The cap converts\n * that engine-level RangeError into a controlled, typed limit. Shared by every\n * recursive site so the byte and string paths reject at the same depth (the\n * differential invariant). Callers may override via the maxDepth option. */\nexport const MAX_DEPTH_DEFAULT = 1000;\n\nexport const isSpaceSeparator = (c?: string): boolean => {\n  return typeof c === 'string' && unicode.Space_Separator.test(c);\n};\n\nexport const isIdStartChar = (c?: string): boolean => {\n  return typeof c === 'string' && (\n    (c >= 'a' && c <= 'z') ||\n    (c >= 'A' && c <= 'Z') ||\n    (c === '$') || (c === '_') ||\n    unicode.ID_Start.test(c)\n  );\n};\n\nexport const isIdContinueChar = (c?: string): boolean => {\n  return typeof c === 'string' && (\n    (c >= 'a' && c <= 'z') ||\n    (c >= 'A' && c <= 'Z') ||\n    (c >= '0' && c <= '9') ||\n    (c === '$') || (c === '_') ||\n    (c === '\\u200C') || (c === '\\u200D') ||\n    unicode.ID_Continue.test(c)\n  );\n};\n\nexport const isDigit = (c?: string): boolean => {\n  return typeof c === 'string' && /[0-9]/.test(c);\n};\n\nexport const isInteger = (s?: string): boolean => {\n  return typeof s === 'string' && !/[^0-9]/.test(s);\n};\n\nexport const isHex = (s?: string): boolean => {\n  return typeof s === 'string' && /0x[0-9a-f]+$/i.test(s);\n};\n\nexport const isHexDigit = (c?: string): boolean => {\n  return typeof c === 'string' && /[0-9a-f]/i.test(c);\n};\n","/* Low-level byte primitives shared by the byte parser and byte serializer.\n *\n * Nothing here ever constructs a JS String from value bytes; that is the whole\n * point of byte-mode. `ByteWriter` is a small growable Uint8Array, and the\n * helpers below decode/encode UTF-8 with strict bounds checking so hostile input\n * can never read out of bounds.\n */\n\n/* A growable byte buffer. `toUint8Array` returns a right-sized copy so the\n * internal (possibly over-allocated) backing store is never aliased out.\n */\nexport class ByteWriter {\n  private buf: Uint8Array;\n  private len = 0;\n\n  constructor(initialCapacity = 64) {\n    this.buf = new Uint8Array(Math.max(16, initialCapacity));\n  }\n\n  get length(): number {\n    return this.len;\n  }\n\n  private ensure(extra: number): void {\n    const needed = this.len + extra;\n    if (needed <= this.buf.length) {\n      return;\n    }\n    let next = this.buf.length * 2;\n    while (next < needed) {\n      next *= 2;\n    }\n    const grown = new Uint8Array(next);\n    grown.set(this.buf.subarray(0, this.len));\n    this.buf = grown;\n  }\n\n  pushByte(b: number): void {\n    this.ensure(1);\n    this.buf[this.len++] = b & 0xff;\n  }\n\n  /* Copy a verbatim run of bytes from `src[start, end)`. */\n  pushBytes(src: Uint8Array, start = 0, end = src.length): void {\n    const count = end - start;\n    if (count <= 0) {\n      return;\n    }\n    this.ensure(count);\n    this.buf.set(src.subarray(start, end), this.len);\n    this.len += count;\n  }\n\n  /* Insert `src` immediately before offset `at`, shifting the existing bytes\n   * [at, len) to the right. The byte serializer uses this for an object member\n   * whose key needs quoting: that key's quote choice depends on the quote\n   * weights its *value* contributes, so the value must be serialized first\n   * (appended here) yet appear after the key — the key is spliced in front once\n   * known. Numeric only: it moves bytes, never constructs a String. */\n  insertBefore(at: number, src: Uint8Array): void {\n    const count = src.length;\n    if (count <= 0) {\n      return;\n    }\n    this.ensure(count);\n    this.buf.copyWithin(at + count, at, this.len);\n    this.buf.set(src, at);\n    this.len += count;\n  }\n\n  /* Encode a single Unicode scalar value as UTF-8. Surrogate code points\n   * (0xD800-0xDFFF) are emitted as U+FFFD because they have no valid UTF-8\n   * encoding; surrogate *pairs* must be combined by the caller before reaching\n   * here.\n   */\n  pushCodePoint(cp: number): void {\n    if (cp < 0x80) {\n      this.pushByte(cp);\n    } else if (cp < 0x800) {\n      this.ensure(2);\n      this.buf[this.len++] = 0xc0 | (cp >> 6);\n      this.buf[this.len++] = 0x80 | (cp & 0x3f);\n    } else if (cp >= 0xd800 && cp <= 0xdfff) {\n      this.pushReplacement();\n    } else if (cp < 0x10000) {\n      this.ensure(3);\n      this.buf[this.len++] = 0xe0 | (cp >> 12);\n      this.buf[this.len++] = 0x80 | ((cp >> 6) & 0x3f);\n      this.buf[this.len++] = 0x80 | (cp & 0x3f);\n    } else {\n      this.ensure(4);\n      this.buf[this.len++] = 0xf0 | (cp >> 18);\n      this.buf[this.len++] = 0x80 | ((cp >> 12) & 0x3f);\n      this.buf[this.len++] = 0x80 | ((cp >> 6) & 0x3f);\n      this.buf[this.len++] = 0x80 | (cp & 0x3f);\n    }\n  }\n\n  private pushReplacement(): void {\n    this.ensure(3);\n    this.buf[this.len++] = 0xef;\n    this.buf[this.len++] = 0xbf;\n    this.buf[this.len++] = 0xbd;\n  }\n\n  toUint8Array(): Uint8Array {\n    return this.buf.slice(0, this.len);\n  }\n}\n\n/* The number of bytes in the UTF-8 sequence whose lead byte is `b`, or 0 if `b`\n * is not a valid UTF-8 lead byte (continuation byte, or 0xF8-0xFF).\n */\nfunction utf8SequenceLength(b: number): number {\n  if (b < 0x80) return 1;\n  if (b < 0xc0) return 0; // continuation byte cannot start a sequence\n  if (b < 0xe0) return 2;\n  if (b < 0xf0) return 3;\n  if (b < 0xf8) return 4;\n  return 0;\n}\n\nexport type DecodedCodePoint = { cp: number; size: number };\n\n/* Strictly decode the UTF-8 sequence starting at `pos`, never reading at or past\n * `limit`. Returns the code point and its byte length, or null at end of input.\n * Throws RangeError on any malformed/overlong/out-of-range/surrogate sequence so\n * callers can convert it into a typed parse error.\n */\nexport function decodeUtf8(source: Uint8Array, pos: number, limit: number = source.length): DecodedCodePoint | null {\n  if (pos >= limit) {\n    return null;\n  }\n\n  const b0 = source[pos];\n  const size = utf8SequenceLength(b0);\n  if (size === 0) {\n    throw new RangeError(`invalid UTF-8 lead byte at ${pos}`);\n  }\n  if (size === 1) {\n    return { cp: b0, size: 1 };\n  }\n  if (pos + size > limit) {\n    throw new RangeError(`truncated UTF-8 sequence at ${pos}`);\n  }\n\n  let cp: number;\n  if (size === 2) {\n    const b1 = source[pos + 1];\n    if ((b1 & 0xc0) !== 0x80) throw new RangeError(`invalid UTF-8 continuation at ${pos + 1}`);\n    cp = ((b0 & 0x1f) << 6) | (b1 & 0x3f);\n    if (cp < 0x80) throw new RangeError(`overlong UTF-8 sequence at ${pos}`);\n  } else if (size === 3) {\n    const b1 = source[pos + 1];\n    const b2 = source[pos + 2];\n    if ((b1 & 0xc0) !== 0x80 || (b2 & 0xc0) !== 0x80) {\n      throw new RangeError(`invalid UTF-8 continuation at ${pos}`);\n    }\n    cp = ((b0 & 0x0f) << 12) | ((b1 & 0x3f) << 6) | (b2 & 0x3f);\n    if (cp < 0x800) throw new RangeError(`overlong UTF-8 sequence at ${pos}`);\n    if (cp >= 0xd800 && cp <= 0xdfff) throw new RangeError(`UTF-8 encoded surrogate at ${pos}`);\n  } else {\n    const b1 = source[pos + 1];\n    const b2 = source[pos + 2];\n    const b3 = source[pos + 3];\n    if ((b1 & 0xc0) !== 0x80 || (b2 & 0xc0) !== 0x80 || (b3 & 0xc0) !== 0x80) {\n      throw new RangeError(`invalid UTF-8 continuation at ${pos}`);\n    }\n    cp = ((b0 & 0x07) << 18) | ((b1 & 0x3f) << 12) | ((b2 & 0x3f) << 6) | (b3 & 0x3f);\n    if (cp < 0x10000 || cp > 0x10ffff) throw new RangeError(`out-of-range UTF-8 sequence at ${pos}`);\n  }\n\n  return { cp, size };\n}\n","/* Borrowed value spans and raw-byte injection for JSON11 byte-mode.\n *\n * `RawString` is the borrowed-span node returned by `parse(bytes, …, { raw })`:\n * it aliases the input buffer and exposes a chosen string value's bytes without\n * ever constructing a GC-managed JS String (`span`/`copy`/`decode`). It only\n * materializes a String if the caller deliberately opts in via\n * `unsafeDecodeToString` (single value) or the top-level `unsafeEncodeAsJSON`\n * helper (a whole parsed tree). Every implicit coercion (`${x}`, `String(x)`,\n * `'' + x`) and `JSON.stringify` is wired to throw instead of leaking the bytes.\n *\n * `RawValue` is the tagged wrapper the byte serializer injects verbatim\n * (pre-escaped) or escapes itself (raw bytes), so a secret can reach the output\n * buffer without becoming a String.\n *\n * Both sit on one shared escape engine (`walkString`) so parser-side and\n * serializer-side escape handling are mutually consistent by construction.\n */\n\nimport { ByteWriter, decodeUtf8 } from './bytes';\n\nexport const QUOTE_DOUBLE = 0x22;\nexport const QUOTE_SINGLE = 0x27;\nconst BACKSLASH = 0x5c;\nconst LF = 0x0a;\nconst CR = 0x0d;\n\n/* Node renders objects through this hook; defining it lets `console.log`/\n * `util.inspect` show a byte-free placeholder instead of dumping the borrowed\n * bytes. Not a literal/unique-symbol type, so it is installed on the prototype\n * after each class body rather than as an in-class computed member. */\nconst NODE_INSPECT = Symbol.for('nodejs.util.inspect.custom');\n\n/* ignoreBOM: true — without it TextDecoder strips a leading U+FEFF from every\n * decoded run, dropping BOMs that the string parser preserves. */\nconst textDecoder = new TextDecoder('utf-8', { ignoreBOM: true });\n\nexport type QuoteByte = 0x22 | 0x27;\n\nexport class JSON11ByteError extends SyntaxError {\n  readonly offset: number;\n  constructor(message: string, offset: number) {\n    super(`JSON11: ${message} at byte ${offset}`);\n    this.name = 'JSON11ByteError';\n    this.offset = offset;\n  }\n}\n\nexport function byteError(message: string, offset: number): JSON11ByteError {\n  return new JSON11ByteError(message, offset);\n}\n\n/* A sink consumes the decoded content of a JSON string: verbatim source runs\n * plus escape-produced code points. The same walk drives a String-building sink,\n * a byte-building sink, and a validate-only (null) sink.\n */\ninterface Sink {\n  literalRun(start: number, end: number): void;\n  codePoint(cp: number): void;\n}\n\nconst NULL_SINK: Sink = {\n  literalRun() {},\n  codePoint() {},\n};\n\nclass StringSink implements Sink {\n  private str = '';\n  constructor(private readonly source: Uint8Array) {}\n  literalRun(start: number, end: number): void {\n    this.str += textDecoder.decode(this.source.subarray(start, end));\n  }\n  codePoint(cp: number): void {\n    this.str += String.fromCodePoint(cp);\n  }\n  result(): string {\n    return this.str;\n  }\n}\n\nclass ByteSink implements Sink {\n  private readonly writer = new ByteWriter();\n  private pendingHigh = -1;\n  constructor(private readonly source: Uint8Array) {}\n  literalRun(start: number, end: number): void {\n    this.flushPending();\n    this.writer.pushBytes(this.source, start, end);\n  }\n  codePoint(cp: number): void {\n    if (this.pendingHigh >= 0) {\n      if (cp >= 0xdc00 && cp <= 0xdfff) {\n        const astral = (this.pendingHigh - 0xd800) * 0x400 + (cp - 0xdc00) + 0x10000;\n        this.pendingHigh = -1;\n        this.writer.pushCodePoint(astral);\n        return;\n      }\n      this.writer.pushCodePoint(0xfffd);\n      this.pendingHigh = -1;\n    }\n    if (cp >= 0xd800 && cp <= 0xdbff) {\n      this.pendingHigh = cp;\n      return;\n    }\n    this.writer.pushCodePoint(cp);\n  }\n  private flushPending(): void {\n    if (this.pendingHigh >= 0) {\n      this.writer.pushCodePoint(0xfffd);\n      this.pendingHigh = -1;\n    }\n  }\n  result(): Uint8Array {\n    this.flushPending();\n    return this.writer.toUint8Array();\n  }\n}\n\nfunction hexValue(b: number): number {\n  if (b >= 0x30 && b <= 0x39) return b - 0x30;\n  if (b >= 0x61 && b <= 0x66) return b - 0x61 + 10;\n  if (b >= 0x41 && b <= 0x46) return b - 0x41 + 10;\n  return -1;\n}\n\nfunction readHex(source: Uint8Array, start: number, count: number, limit: number): { value: number; next: number } {\n  let value = 0;\n  let i = start;\n  for (let k = 0; k < count; k++) {\n    if (i >= limit) {\n      throw byteError('truncated unicode/hex escape', i);\n    }\n    const d = hexValue(source[i]);\n    if (d < 0) {\n      throw byteError('invalid hex digit in escape', i);\n    }\n    value = value * 16 + d;\n    i++;\n  }\n  return { value, next: i };\n}\n\n/* Handle the escape sequence whose backslash was at `i - 1` (so `i` points at\n * the escape selector). Emits to `sink` and returns the index just past the\n * sequence. Bounded by `limit`. Mirrors the existing string parser's `escape`.\n */\nfunction handleEscape(source: Uint8Array, i: number, limit: number, sink: Sink): number {\n  if (i >= limit) {\n    throw byteError('lone trailing backslash in string', i);\n  }\n  const e = source[i];\n  switch (e) {\n    case 0x62: sink.codePoint(0x08); return i + 1; // \\b\n    case 0x66: sink.codePoint(0x0c); return i + 1; // \\f\n    case 0x6e: sink.codePoint(0x0a); return i + 1; // \\n\n    case 0x72: sink.codePoint(0x0d); return i + 1; // \\r\n    case 0x74: sink.codePoint(0x09); return i + 1; // \\t\n    case 0x76: sink.codePoint(0x0b); return i + 1; // \\v\n    case 0x30: { // \\0 (not followed by a decimal digit)\n      if (i + 1 < limit && source[i + 1] >= 0x30 && source[i + 1] <= 0x39) {\n        throw byteError('invalid \\\\0 escape followed by digit', i + 1);\n      }\n      sink.codePoint(0x00);\n      return i + 1;\n    }\n    case 0x78: { // \\xHH\n      const { value, next } = readHex(source, i + 1, 2, limit);\n      sink.codePoint(value);\n      return next;\n    }\n    case 0x75: { // \\uHHHH\n      const { value, next } = readHex(source, i + 1, 4, limit);\n      sink.codePoint(value);\n      return next;\n    }\n    case LF:\n      return i + 1; // line continuation\n    case CR:\n      if (i + 1 < limit && source[i + 1] === LF) return i + 2;\n      return i + 1; // line continuation (CR or CRLF)\n    case 0x31: case 0x32: case 0x33: case 0x34: case 0x35:\n    case 0x36: case 0x37: case 0x38: case 0x39:\n      throw byteError('invalid escape sequence (digit)', i);\n    default: {\n      if (e >= 0x80) {\n        let dec;\n        try {\n          dec = decodeUtf8(source, i, limit);\n        } catch (ex) {\n          const msg = ex instanceof Error ? ex.message : String(ex);\n          throw byteError(msg, i);\n        }\n        if (!dec) {\n          throw byteError('lone trailing backslash in string', i);\n        }\n        if (dec.cp === 0x2028 || dec.cp === 0x2029) {\n          return i + dec.size; // line continuation\n        }\n        sink.literalRun(i, i + dec.size); // unnecessary escape of a multibyte char\n        return i + dec.size;\n      }\n      sink.literalRun(i, i + 1); // unnecessary escape of an ASCII char\n      return i + 1;\n    }\n  }\n}\n\n/* Walk the body of a JSON11 string starting at `start` (just past the opening\n * quote), feeding `sink`. Stops at an unescaped `quote` byte (returns its index)\n * or at `limit`. When `requireQuote` is true (parsing), reaching `limit` without\n * the closing quote is an unterminated-string error; when false (decoding a\n * known inner range), reaching `limit` is the normal stop.\n *\n * Throws a typed `JSON11ByteError` on any malformed input — unterminated string,\n * raw newline, bad escape, lone trailing backslash, malformed UTF-8 — and never\n * reads past `limit`.\n */\nfunction walkString(\n  source: Uint8Array,\n  start: number,\n  quote: number,\n  sink: Sink,\n  limit: number,\n  requireQuote: boolean,\n  onSeparator?: () => void,\n): number {\n  let i = start;\n  let runStart = start;\n\n  while (i < limit) {\n    const b = source[i];\n\n    if (b === quote) {\n      if (i > runStart) sink.literalRun(runStart, i);\n      return i;\n    }\n\n    if (b === BACKSLASH) {\n      if (i > runStart) sink.literalRun(runStart, i);\n      i = handleEscape(source, i + 1, limit, sink);\n      runStart = i;\n      continue;\n    }\n\n    if (b === LF || b === CR) {\n      throw byteError('unescaped newline in string', i);\n    }\n\n    if (b < 0x80) {\n      i++;\n      continue;\n    }\n\n    let dec;\n    try {\n      dec = decodeUtf8(source, i, limit);\n    } catch (ex) {\n      const msg = ex instanceof Error ? ex.message : String(ex);\n      throw byteError(msg, i);\n    }\n    if (!dec) break;\n    if (dec.cp === 0x2028 || dec.cp === 0x2029) {\n      if (onSeparator) onSeparator();\n    }\n    i += dec.size;\n  }\n\n  if (requireQuote) {\n    throw byteError('unterminated string', i);\n  }\n  if (i > runStart) sink.literalRun(runStart, i);\n  return i;\n}\n\n/* Used by the byte parser: scan a string value/key starting just past the\n * opening quote, returning the index of the closing quote. With a non-null\n * `sink` (off-mode / keys) the decoded JS string is produced; with the null sink\n * (raw values) it validates only. */\nexport function scanStringForParse(\n  source: Uint8Array,\n  start: number,\n  quote: number,\n  collect: boolean,\n  onSeparator?: () => void,\n): { innerEnd: number; value?: string } {\n  if (collect) {\n    const sink = new StringSink(source);\n    const innerEnd = walkString(source, start, quote, sink, source.length, true, onSeparator);\n    return { innerEnd, value: sink.result() };\n  }\n  const innerEnd = walkString(source, start, quote, NULL_SINK, source.length, true, onSeparator);\n  return { innerEnd };\n}\n\n/* A borrowed view over one JSON string value's escaped inner bytes. Aliases the\n * input buffer; the caller owns that buffer's lifetime and zeroing. */\nexport class RawString {\n  /* The input buffer this value is borrowed from (aliased, not copied).\n   * `declare` keeps the public type surface without emitting a class-field\n   * initializer; the constructor defines it non-enumerable instead. */\n  declare readonly source: Uint8Array;\n  /* Inner byte offset just past the opening quote. */\n  declare readonly start: number;\n  /* Inner byte offset of the closing quote (exclusive end of the value). */\n  declare readonly end: number;\n  /* The quote byte the value was written with (0x22 `\"` or 0x27 `'`). */\n  declare readonly quote: QuoteByte;\n\n  constructor(source: Uint8Array, start: number, end: number, quote: QuoteByte) {\n    /* Secret-bearing state is defined non-enumerable so a property-walking\n     * serializer (JSON.stringify, util.inspect's default render, a structured\n     * clone, a logging framework) cannot dump the borrowed bytes. The fields\n     * stay publicly readable (documented accessors; quote is read by the byte\n     * serializer cross-module) — only their enumerability changes. */\n    Object.defineProperty(this, 'source', { value: source, enumerable: false, writable: false });\n    Object.defineProperty(this, 'start', { value: start, enumerable: false, writable: false });\n    Object.defineProperty(this, 'end', { value: end, enumerable: false, writable: false });\n    Object.defineProperty(this, 'quote', { value: quote, enumerable: false, writable: false });\n  }\n\n  /* Zero-copy view of the escaped inner bytes between the quotes. Aliases the\n   * input buffer — do not mutate, and copy before the input is zeroed. */\n  span(): Uint8Array {\n    return this.source.subarray(this.start, this.end);\n  }\n\n  /* A fresh copy of the escaped inner bytes (safe to retain). */\n  copy(): Uint8Array {\n    return this.source.slice(this.start, this.end);\n  }\n\n  /* The decoded (unescaped) value as fresh UTF-8 bytes. Never constructs a\n   * JS String. Lone surrogate escapes are emitted as U+FFFD. */\n  decode(): Uint8Array {\n    return RawString.decodeBytes(this.source, this.start, this.end, this.quote);\n  }\n\n  /* Materializes the value as a JS String. Never call this for a secret — the\n   * resulting String is immutable, unzeroable, and lingers on the heap. This is\n   * the single sanctioned byte→String door for one value; lone surrogate escapes\n   * are preserved exactly as `parse(string)` produces them. */\n  unsafeDecodeToString(): string {\n    const sink = new StringSink(this.source);\n    walkString(this.source, this.start, this.quote, sink, this.end, false);\n    return sink.result();\n  }\n\n  /* Redacted, byte-free placeholder so an accidental `console.log(rs)` or an\n   * explicit `rs.toString()` reveals nothing. Built from the inner byte length\n   * only — never decodes the bytes. To materialize the value, call\n   * `unsafeDecodeToString()` deliberately. */\n  toString(): string {\n    return `[RawString length=${this.end - this.start}]`;\n  }\n\n  /* Every implicit coercion funnels through ToPrimitive; throwing here makes\n   * `${rs}`, `String(rs)`, `'' + rs`, `[rs].join()`, and `rs.toLocaleString()`\n   * fail loud instead of silently decoding the secret. */\n  [Symbol.toPrimitive](): never {\n    throw new TypeError(\n      'JSON11: refusing to coerce a RawString to a primitive; use .decode() for bytes or .unsafeDecodeToString() to opt in',\n    );\n  }\n\n  valueOf(): never {\n    throw new TypeError(\n      'JSON11: refusing to coerce a RawString to a primitive; use .decode() for bytes or .unsafeDecodeToString() to opt in',\n    );\n  }\n\n  /* Makes `JSON.stringify(rawTree)` fail loud rather than enumerate the bytes.\n   * A raw parse returns a RawString for every string value, so this throws for\n   * any raw-parsed document, secret-bearing or not. */\n  toJSON(): never {\n    throw new TypeError(\n      'JSON11: refusing to JSON-serialize a RawString; call .decode()/.copy() for bytes, .unsafeDecodeToString() for a String, or JSON11.unsafeEncodeAsJSON(tree) to opt into JSON materialization of a whole parsed tree',\n    );\n  }\n\n  /* Low-level byte-level JSON11 string unescape over an explicit inner range,\n   * folded in as a static so spans obtained elsewhere can be decoded too. Never\n   * constructs a String. */\n  static decodeBytes(buf: Uint8Array, start: number, end: number, quote: QuoteByte = QUOTE_DOUBLE): Uint8Array {\n    /* The offsets are caller-supplied; reject an out-of-range window up front so\n     * a bad call fails with a clear contract error rather than a confusing\n     * malformed-UTF-8 throw (from reading `undefined` past the array) or a\n     * silently empty result (when start > end). */\n    if (\n      !Number.isInteger(start) ||\n      !Number.isInteger(end) ||\n      start < 0 ||\n      start > end ||\n      end > buf.length\n    ) {\n      throw new TypeError(\n        `JSON11: RawString.decodeBytes: start/end out of range for buffer length ${buf.length}`,\n      );\n    }\n    const sink = new ByteSink(buf);\n    /* Default quote is `\"`; a single-quoted span legitimately contains an\n     * unescaped `\"`, so decoding it with the wrong terminator stops early. A\n     * correctly-quoted, correctly-bounded span always walks to `end` (the framing\n     * quote cannot appear unescaped inside a valid value), so a short walk means\n     * the quote or the range is wrong — throw instead of returning a truncated\n     * value. */\n    const stop = walkString(buf, start, quote, sink, end, false);\n    if (stop < end) {\n      throw new TypeError(\n        `JSON11: RawString.decodeBytes: span not fully consumed (stopped at offset ${stop} before end ${end}) — wrong quote for this span, or a bad range`,\n      );\n    }\n    return sink.result();\n  }\n}\n\nObject.defineProperty(RawString.prototype, NODE_INSPECT, {\n  value(this: RawString): string {\n    return this.toString();\n  },\n  enumerable: false,\n  writable: true,\n  configurable: true,\n});\n\n/* A tagged value the byte serializer injects without it ever becoming a String:\n * either pre-escaped inner bytes spliced verbatim between quotes, or raw\n * (unescaped) bytes that JSON11 escapes into the output using its own escaper. */\nexport class RawValue {\n  /** Read cross-module by the byte serializer; `declare` keeps the type while the\n   * constructor defines it non-enumerable (so a property-walk cannot dump the\n   * bytes).\n   * @internal */\n  declare readonly bytes: Uint8Array;\n  /** @internal */ declare readonly preEscaped: boolean;\n  /** @internal */ declare readonly quote: QuoteByte | 0;\n\n  private constructor(bytes: Uint8Array, preEscaped: boolean, quote: QuoteByte | 0) {\n    Object.defineProperty(this, 'bytes', { value: bytes, enumerable: false, writable: false });\n    Object.defineProperty(this, 'preEscaped', { value: preEscaped, enumerable: false, writable: false });\n    Object.defineProperty(this, 'quote', { value: quote, enumerable: false, writable: false });\n  }\n\n  /* Splice already-escaped inner bytes verbatim, wrapped in `quote`. Use this to\n   * move an escaped span lifted from a JSON11 document (byte-identical). */\n  static escaped(inner: Uint8Array, quote: QuoteByte): RawValue {\n    if (quote !== QUOTE_DOUBLE && quote !== QUOTE_SINGLE) {\n      throw new TypeError('JSON11: RawValue.escaped quote must be 0x22 (\") or 0x27 (\\')');\n    }\n    /* Validate inner at the boundary so a frame-breaking RawValue never exists.\n     * `spliceEscaped` wraps inner verbatim between two `quote` bytes without\n     * inspecting it; an unescaped `quote` inside inner would terminate the value\n     * early and turn the trailing bytes into document structure. Scan with the\n     * shared engine and a numeric sink (no String) — if the walk does not consume\n     * the whole buffer before an unescaped `quote`, the span is unsplice-able for\n     * this delimiter. `walkString` itself throws on a raw newline / bad escape /\n     * lone `\\` / malformed UTF-8, which is the desired fail-closed behavior. */\n    const stop = walkString(inner, 0, quote, NULL_SINK, inner.length, false);\n    if (stop !== inner.length) {\n      const quoteChar = quote === QUOTE_DOUBLE ? '\"' : \"'\";\n      throw new TypeError(\n        `JSON11: RawValue.escaped: inner contains an unescaped ${quoteChar} at offset ${stop} that would break string framing`,\n      );\n    }\n    return new RawValue(inner, true, quote);\n  }\n\n  /* Hand JSON11 raw (unescaped) value bytes; the serializer escapes them into the\n   * output buffer using its own escaper. */\n  static raw(bytes: Uint8Array): RawValue {\n    return new RawValue(bytes, false, 0);\n  }\n\n  /* Byte-free placeholder; never decodes the bytes. */\n  toString(): string {\n    return `[RawValue length=${this.bytes.length}]`;\n  }\n\n  [Symbol.toPrimitive](): never {\n    throw new TypeError(\n      'JSON11: refusing to coerce a RawValue to a primitive; pass it to stringify(value, { raw: true }) to emit its bytes',\n    );\n  }\n\n  valueOf(): never {\n    throw new TypeError(\n      'JSON11: refusing to coerce a RawValue to a primitive; pass it to stringify(value, { raw: true }) to emit its bytes',\n    );\n  }\n\n  toJSON(): never {\n    throw new TypeError(\n      'JSON11: refusing to JSON-serialize a RawValue; pass it to stringify(value, { raw: true }), or JSON11.unsafeEncodeAsJSON(tree) to opt into JSON materialization',\n    );\n  }\n}\n\nObject.defineProperty(RawValue.prototype, NODE_INSPECT, {\n  value(this: RawValue): string {\n    return this.toString();\n  },\n  enumerable: false,\n  writable: true,\n  configurable: true,\n});\n\n/* Decode a RawValue's bytes to a JS String through the single `StringSink`\n * door. Defensive: a parse never yields a RawValue (it yields RawString), so\n * this only fires when a caller has placed a RawValue into a tree they then ask\n * `unsafeEncodeAsJSON` to materialize. Raw (unescaped) bytes are walked with the\n * same escaper for consistency. */\nfunction rawValueToString(value: RawValue): string {\n  const quote = value.quote === 0 ? QUOTE_DOUBLE : value.quote;\n  const sink = new StringSink(value.bytes);\n  walkString(value.bytes, 0, quote, sink, value.bytes.length, false);\n  return sink.result();\n}\n\n/* UNSAFE: materializes every borrowed value in the tree as a JS String. Only\n * call when you deliberately intend to JSON-serialize raw-parsed data; never for\n * a tree that still holds a secret you mean to keep out of the heap.\n *\n * Returns a fresh, plain JSON-encodable structure — the input tree is never\n * mutated, so its RawStrings stay byte-only. Each RawString becomes its\n * `unsafeDecodeToString()` value; every other value (number/bigint/boolean/null)\n * passes through unchanged (BigInt remains the caller's/JSON.stringify's\n * concern). */\nexport function unsafeEncodeAsJSON(value: unknown): unknown {\n  if (value instanceof RawString) {\n    return value.unsafeDecodeToString();\n  }\n  if (value instanceof RawValue) {\n    return rawValueToString(value);\n  }\n  if (Array.isArray(value)) {\n    return value.map((element) => unsafeEncodeAsJSON(element));\n  }\n  if (value !== null && typeof value === 'object') {\n    const source = value as Record<string, unknown>;\n    const out: Record<string, unknown> = {};\n    /* Prototype-safe rebuild: a `__proto__`/accessor key in the source becomes a\n     * plain own data property on the copy instead of polluting the prototype. */\n    for (const key of Object.keys(source)) {\n      Object.defineProperty(out, key, {\n        value: unsafeEncodeAsJSON(source[key]),\n        writable: true,\n        enumerable: true,\n        configurable: true,\n      });\n    }\n    return out;\n  }\n  return value;\n}\n","/* Internal byte-input parser for JSON11 byte-mode.\n *\n * This is a faithful port of the string parser's state machine (`./parse`) onto\n * a Uint8Array source: the lexer/parser states are identical so the byte path\n * accepts exactly the same JSON11 grammar, but it reads UTF-8 bytes (with strict\n * bounds checks) instead of a JS String and can return string *values* as\n * borrowed `RawString` spans instead of materializing them on the heap.\n *\n * It is not a public export; it is reached through `parse(bytes, …, { raw })`.\n */\n\nimport * as util from './util';\nimport type { Reviver } from './parse';\nimport { decodeUtf8 } from './bytes';\nimport { byteError, type QuoteByte, RawString, scanStringForParse } from './raw';\n\nexport type RawMode = 'off' | 'values' | 'all';\n\n/* A primitive token payload plus the borrowed `RawString` a value token carries\n * in raw mode (keys are always decoded to JS strings). */\ntype TokenValue = string | number | bigint | boolean | null | RawString;\n\ntype TokenType =\n  | 'eof'\n  | 'punctuator'\n  | 'null'\n  | 'boolean'\n  | 'numeric'\n  | 'bigint'\n  | 'string'\n  | 'identifier';\n\ninterface Token {\n  type: TokenType;\n  value?: TokenValue;\n  line: number;\n  column: number;\n}\n\n/* The container frames the parser builds and the reviver walks. */\ntype Container = { [key: string]: unknown } | unknown[];\n\nexport type ParseBytesOptions = {\n  withLongNumerals?: boolean;\n  raw?: RawMode;\n  /* Maximum digit-buffer length accepted for a BigInt literal (the explicit\n   * `…n` form and the withLongNumerals promotion). Defaults to\n   * util.MAX_NUMERIC_DIGITS_DEFAULT; bounds the super-linear BigInt(...) cost. */\n  maxNumericDigits?: number;\n  /* Maximum nesting depth the reviver walk will descend before throwing. Only\n   * the reviver path recurses (tree construction is iterative), so this bounds\n   * the reviver's stack use. Defaults to util.MAX_DEPTH_DEFAULT. */\n  maxDepth?: number;\n};\n\nexport function parseBytes<T = unknown>(\n  source: Uint8Array,\n  reviver?: Reviver | null,\n  options?: ParseBytesOptions,\n): T {\n  const rawValues = options?.raw === 'values' || options?.raw === 'all';\n  const maxNumericDigits = options?.maxNumericDigits ?? util.MAX_NUMERIC_DIGITS_DEFAULT;\n  const maxDepth = options?.maxDepth ?? util.MAX_DEPTH_DEFAULT;\n\n  let parseState: string = 'start';\n  const stack: Container[] = [];\n  let pos: number = 0;\n  let line: number = 1;\n  let column: number = 0;\n  let token: Token;\n  let key: string;\n  let root: unknown;\n  let lexState: string;\n  let buffer: string | undefined;\n  let sign: number;\n  let c: string | undefined;\n\n  const lexStates: { [state: string]: () => Token | undefined } = {\n    default() {\n      switch (c) {\n        case '\\t':\n        case '\\v':\n        case '\\f':\n        case ' ':\n        case '\\u00A0':\n        case '\\uFEFF':\n        case '\\n':\n        case '\\r':\n        case '\\u2028':\n        case '\\u2029':\n          read();\n          return;\n\n        case '/':\n          read();\n          lexState = 'comment';\n          return;\n\n        case undefined:\n          read();\n          return newToken('eof');\n      }\n\n      if (util.isSpaceSeparator(c)) {\n        read();\n        return;\n      }\n\n      return lexStates[parseState]();\n    },\n\n    comment() {\n      switch (c) {\n        case '*':\n          read();\n          lexState = 'multiLineComment';\n          return;\n\n        case '/':\n          read();\n          lexState = 'singleLineComment';\n          return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    multiLineComment() {\n      switch (c) {\n        case '*':\n          read();\n          lexState = 'multiLineCommentAsterisk';\n          return;\n\n        case undefined:\n          throw invalidChar(read());\n      }\n\n      read();\n    },\n\n    multiLineCommentAsterisk() {\n      switch (c) {\n        case '*':\n          read();\n          return;\n\n        case '/':\n          read();\n          lexState = 'default';\n          return;\n\n        case undefined:\n          throw invalidChar(read());\n      }\n\n      read();\n      lexState = 'multiLineComment';\n    },\n\n    singleLineComment() {\n      switch (c) {\n        case '\\n':\n        case '\\r':\n        case '\\u2028':\n        case '\\u2029':\n          read();\n          lexState = 'default';\n          return;\n\n        case undefined:\n          read();\n          return newToken('eof');\n      }\n\n      read();\n    },\n\n    value() {\n      switch (c) {\n        case '{':\n        case '[':\n          return newToken('punctuator', read());\n\n        case 'n':\n          read();\n          literal('ull');\n          return newToken('null', null);\n\n        case 't':\n          read();\n          literal('rue');\n          return newToken('boolean', true);\n\n        case 'f':\n          read();\n          literal('alse');\n          return newToken('boolean', false);\n\n        case '-':\n        case '+':\n          if (read() === '-') {\n            sign = -1;\n          }\n\n          lexState = 'sign';\n          return;\n\n        case '.':\n          buffer = read();\n          lexState = 'decimalPointLeading';\n          return;\n\n        case '0':\n          buffer = read();\n          lexState = 'zero';\n          return;\n\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n          buffer = read();\n          lexState = 'decimalInteger';\n          return;\n\n        case 'I':\n          read();\n          literal('nfinity');\n          return newToken('numeric', Infinity);\n\n        case 'N':\n          read();\n          literal('aN');\n          return newToken('numeric', NaN);\n\n        case '\"':\n        case '\\'':\n          return scanStringToken(c === '\"' ? 0x22 : 0x27, !rawValues);\n      }\n\n      throw invalidChar(read());\n    },\n\n    identifierNameStartEscape() {\n      if (c !== 'u') {\n        throw invalidChar(read());\n      }\n\n      read();\n      const u = unicodeEscape();\n      switch (u) {\n        case '$':\n        case '_':\n          break;\n\n        default:\n          if (!util.isIdStartChar(u)) {\n            throw invalidIdentifier();\n          }\n\n          break;\n      }\n\n      buffer += u;\n      lexState = 'identifierName';\n    },\n\n    identifierName() {\n      switch (c) {\n        case '$':\n        case '_':\n        case '\\u200C':\n        case '\\u200D':\n          buffer += read()!;\n          return;\n\n        case '\\\\':\n          read();\n          lexState = 'identifierNameEscape';\n          return;\n      }\n\n      if (util.isIdContinueChar(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newToken('identifier', buffer);\n    },\n\n    identifierNameEscape() {\n      if (c !== 'u') {\n        throw invalidChar(read());\n      }\n\n      read();\n      const u = unicodeEscape();\n      switch (u) {\n        case '$':\n        case '_':\n        case '\\u200C':\n        case '\\u200D':\n          break;\n\n        default:\n          if (!util.isIdContinueChar(u)) {\n            throw invalidIdentifier();\n          }\n\n          break;\n      }\n\n      buffer += u;\n      lexState = 'identifierName';\n    },\n\n    sign() {\n      switch (c) {\n        case '.':\n          buffer = read();\n          lexState = 'decimalPointLeading';\n          return;\n\n        case '0':\n          buffer = read();\n          lexState = 'zero';\n          return;\n\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n          buffer = read();\n          lexState = 'decimalInteger';\n          return;\n\n        case 'I':\n          read();\n          literal('nfinity');\n          return newToken('numeric', sign * Infinity);\n\n        case 'N':\n          read();\n          literal('aN');\n          return newToken('numeric', NaN);\n      }\n\n      throw invalidChar(read());\n    },\n\n    zero() {\n      switch (c) {\n        case '.':\n          buffer += read()!;\n          lexState = 'decimalPoint';\n          return;\n\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n\n        case 'x':\n        case 'X':\n          buffer += read()!;\n          lexState = 'hexadecimal';\n          return;\n\n        case 'n':\n          lexState = 'bigInt';\n          return;\n      }\n\n      return newToken('numeric', sign * 0);\n    },\n\n    decimalInteger() {\n      switch (c) {\n        case '.':\n          buffer += read()!;\n          lexState = 'decimalPoint';\n          return;\n\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n\n        case 'n':\n          lexState = 'bigInt';\n          return;\n\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    decimalPointLeading() {\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalFraction';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    decimalPoint() {\n      switch (c) {\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalFraction';\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    decimalFraction() {\n      switch (c) {\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    decimalExponent() {\n      switch (c) {\n        case '+':\n        case '-':\n          buffer += read()!;\n          lexState = 'decimalExponentSign';\n          return;\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalExponentInteger';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    decimalExponentSign() {\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalExponentInteger';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    decimalExponentInteger() {\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    bigInt() {\n      if (buffer?.length && (util.isInteger(buffer) || util.isHex(buffer))) {\n        if (buffer.length > maxNumericDigits) {\n          throw byteError(\n            `numeric literal of length ${buffer.length} exceeds the ${maxNumericDigits}-digit BigInt cap`,\n            pos,\n          );\n        }\n        read();\n        return newToken('bigint', BigInt(sign) * BigInt(buffer));\n      }\n\n      throw invalidChar(read());\n    },\n\n    hexadecimal() {\n      if (util.isHexDigit(c)) {\n        buffer += read()!;\n        lexState = 'hexadecimalInteger';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    hexadecimalInteger() {\n      if (util.isHexDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      if (c === 'n') {\n        lexState = 'bigInt';\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    start() {\n      switch (c) {\n        case '{':\n        case '[':\n          return newToken('punctuator', read());\n\n        case undefined:\n          return newToken('eof')\n      }\n\n      lexState = 'value';\n    },\n\n    beforePropertyName() {\n      switch (c) {\n        case '$':\n        case '_':\n          buffer = read();\n          lexState = 'identifierName';\n          return;\n\n        case '\\\\':\n          read();\n          lexState = 'identifierNameStartEscape';\n          return;\n\n        case '}':\n          return newToken('punctuator', read());\n\n        case '\"':\n        case '\\'':\n          return scanStringToken(c === '\"' ? 0x22 : 0x27, true);\n      }\n\n      if (util.isIdStartChar(c)) {\n        buffer += read()!;\n        lexState = 'identifierName';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    afterPropertyName() {\n      if (c === ':') {\n        return newToken('punctuator', read());\n      }\n\n      throw invalidChar(read());\n    },\n\n    beforePropertyValue() {\n      lexState = 'value';\n    },\n\n    afterPropertyValue() {\n      switch (c) {\n        case ',':\n        case '}':\n          return newToken('punctuator', read());\n      }\n\n      throw invalidChar(read());\n    },\n\n    beforeArrayValue() {\n      if (c === ']') {\n        return newToken('punctuator', read());\n      }\n\n      lexState = 'value';\n    },\n\n    afterArrayValue() {\n      switch (c) {\n        case ',':\n        case ']':\n          return newToken('punctuator', read());\n      }\n\n      throw invalidChar(read());\n    },\n\n    end() {\n      throw invalidChar(read());\n    },\n  };\n\n  const parseStates: { [key: string]: () => void } = {\n    start() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      push();\n    },\n\n    beforePropertyName() {\n      switch (token.type) {\n        case 'identifier':\n        case 'string':\n          key = token.value as string;\n          parseState = 'afterPropertyName';\n          return;\n\n        case 'punctuator':\n          pop();\n          return;\n\n        case 'eof':\n          throw invalidEOF();\n      }\n    },\n\n    afterPropertyName() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      parseState = 'beforePropertyValue';\n    },\n\n    beforePropertyValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      push();\n    },\n\n    beforeArrayValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      if (token.type === 'punctuator' && token.value === ']') {\n        pop();\n        return;\n      }\n\n      push();\n    },\n\n    afterPropertyValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      switch (token.value) {\n        case ',':\n          parseState = 'beforePropertyName';\n          return;\n\n        case '}':\n          pop();\n      }\n    },\n\n    afterArrayValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      switch (token.value) {\n        case ',':\n          parseState = 'beforeArrayValue';\n          return;\n\n        case ']':\n          pop();\n      }\n    },\n\n    end() {\n      // Do nothing\n    },\n  };\n\n  do {\n    token = lex();\n\n    parseStates[parseState]();\n  } while (token.type !== 'eof');\n\n  if (typeof reviver === 'function') {\n    return internalize({ '': root }, '', reviver, 0) as T;\n  }\n\n  return root as T;\n\n  function internalize(holder: Container, name: string, reviver: Reviver, depth: number): unknown {\n    if (depth > maxDepth) {\n      throw byteError(`maximum nesting depth ${maxDepth} exceeded`, pos);\n    }\n    const value = (holder as { [key: string]: unknown })[name];\n    if (value != null && typeof value === 'object' && !(value instanceof RawString)) {\n      if (Array.isArray(value)) {\n        for (let i = 0; i < value.length; i++) {\n          const key = String(i);\n          const replacement = internalize(value, key, reviver, depth + 1);\n          if (replacement === undefined) {\n            delete value[i];\n          } else {\n            Object.defineProperty(value, key, {\n              value: replacement,\n              writable: true,\n              enumerable: true,\n              configurable: true,\n            });\n          }\n        }\n      } else {\n        const object = value as { [key: string]: unknown };\n        for (const key in object) {\n          const replacement = internalize(object, key, reviver, depth + 1);\n          if (replacement === undefined) {\n            delete object[key];\n          } else {\n            Object.defineProperty(object, key, {\n              value: replacement,\n              writable: true,\n              enumerable: true,\n              configurable: true,\n            });\n          }\n        }\n      }\n    }\n\n    return reviver.call(holder, name, value);\n  }\n\n  function lex(): Token {\n    lexState = 'default';\n    buffer = '';\n    sign = 1;\n\n    for (; ;) {\n      c = peek();\n\n      const token = lexStates[lexState]();\n      if (token) {\n        return token;\n      }\n    }\n  }\n\n  function peek(): string | undefined {\n    if (pos >= source.length) {\n      return undefined;\n    }\n    let dec;\n    try {\n      dec = decodeUtf8(source, pos);\n    } catch (ex) {\n      const msg = ex instanceof Error ? ex.message : String(ex);\n      throw byteError(msg, pos);\n    }\n    if (!dec) {\n      return undefined;\n    }\n    return String.fromCodePoint(dec.cp);\n  }\n\n  function read(): string | undefined {\n    if (pos >= source.length) {\n      column++;\n      return undefined;\n    }\n    let dec;\n    try {\n      dec = decodeUtf8(source, pos);\n    } catch (ex) {\n      const msg = ex instanceof Error ? ex.message : String(ex);\n      throw byteError(msg, pos);\n    }\n    if (!dec) {\n      column++;\n      return undefined;\n    }\n\n    const cp = dec.cp;\n    if (cp === 0x0a) {\n      line++;\n      column = 0;\n    } else {\n      column++;\n    }\n    pos += dec.size;\n    return String.fromCodePoint(cp);\n  }\n\n  /* Consume an opening quote (already the current char), then scan the whole\n   * string value/key via the shared escape engine. Advances `pos` past the\n   * closing quote and returns the token. */\n  function scanStringToken(quoteByte: QuoteByte, collect: boolean): Token {\n    read(); // consume opening quote\n    const startInner = pos;\n    const res = scanStringForParse(source, pos, quoteByte, collect, separatorWarn);\n    pos = res.innerEnd + 1;\n    column += res.innerEnd - startInner + 1;\n\n    if (collect) {\n      return newToken('string', res.value);\n    }\n    return newToken('string', new RawString(source, startInner, res.innerEnd, quoteByte));\n  }\n\n  function newToken(type: TokenType, value?: TokenValue): Token {\n    return {\n      type,\n      value,\n      line,\n      column,\n    };\n  }\n\n  function newNumericToken(sign: number, buffer?: string): Token {\n    const num = sign * Number(buffer);\n\n    if (options?.withLongNumerals) {\n      if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {\n        if (buffer!.length > maxNumericDigits) {\n          throw byteError(\n            `numeric literal of length ${buffer!.length} exceeds the ${maxNumericDigits}-digit BigInt cap`,\n            pos,\n          );\n        }\n        try {\n          return newToken('bigint', BigInt(sign) * BigInt(buffer!));\n        } catch (ex) {\n          // RangeError when num is not an integer\n          console.warn(ex);\n        }\n      }\n    }\n\n    return newToken('numeric', num);\n  }\n\n  function literal(s: string): void {\n    for (const ch of s) {\n      const p = peek();\n\n      if (p !== ch) {\n        throw invalidChar(read());\n      }\n\n      read();\n    }\n  }\n\n  function unicodeEscape(): string {\n    let buffer = '';\n    let count = 4;\n\n    while (count-- > 0) {\n      const ch = peek();\n      if (!util.isHexDigit(ch)) {\n        throw invalidChar(read());\n      }\n\n      buffer += read()!;\n    }\n\n    return String.fromCodePoint(parseInt(buffer, 16));\n  }\n\n  function push() {\n    let value: unknown;\n\n    switch (token.type) {\n      case 'punctuator':\n        switch (token.value) {\n          case '{':\n            value = {};\n            break;\n\n          case '[':\n            value = [];\n            break;\n        }\n\n        break;\n\n      case 'null':\n      case 'boolean':\n      case 'numeric':\n      case 'string':\n      case 'bigint':\n        value = token.value;\n        break;\n    }\n\n    if (root === undefined) {\n      root = value;\n    } else {\n      const parent = stack[stack.length - 1];\n      if (Array.isArray(parent)) {\n        parent.push(value);\n      } else {\n        Object.defineProperty(parent, key, {\n          value,\n          writable: true,\n          enumerable: true,\n          configurable: true,\n        });\n      }\n    }\n\n    if (value !== null && typeof value === 'object' && !(value instanceof RawString)) {\n      stack.push(value as Container);\n\n      if (Array.isArray(value)) {\n        parseState = 'beforeArrayValue';\n      } else {\n        parseState = 'beforePropertyName';\n      }\n    } else {\n      const current = stack[stack.length - 1];\n      if (current == null) {\n        parseState = 'end';\n      } else if (Array.isArray(current)) {\n        parseState = 'afterArrayValue';\n      } else {\n        parseState = 'afterPropertyValue';\n      }\n    }\n  }\n\n  function pop() {\n    stack.pop();\n\n    const current = stack[stack.length - 1];\n    if (current == null) {\n      parseState = 'end';\n    } else if (Array.isArray(current)) {\n      parseState = 'afterArrayValue';\n    } else {\n      parseState = 'afterPropertyValue';\n    }\n  }\n\n  function invalidChar(ch: string | undefined): Error {\n    if (ch === undefined) {\n      return syntaxError(`JSON11: invalid end of input at ${line}:${column}`);\n    }\n\n    return syntaxError(`JSON11: invalid character '${formatChar(ch)}' at ${line}:${column}`);\n  }\n\n  function invalidEOF(): Error {\n    return syntaxError(`JSON11: invalid end of input at ${line}:${column}`);\n  }\n\n  function invalidIdentifier(): Error {\n    column -= 5;\n    return syntaxError(`JSON11: invalid identifier character at ${line}:${column}`);\n  }\n\n  function separatorWarn(): void {\n    console.warn(`JSON11: '\\\\u2028' or '\\\\u2029' in strings is not valid ECMAScript; consider escaping`);\n  }\n\n  function formatChar(ch: string): string {\n    const replacements: Record<string, string> = {\n      '\\'': '\\\\\\'',\n      '\"': '\\\\\"',\n      '\\\\': '\\\\\\\\',\n      '\\b': '\\\\b',\n      '\\f': '\\\\f',\n      '\\n': '\\\\n',\n      '\\r': '\\\\r',\n      '\\t': '\\\\t',\n      '\\v': '\\\\v',\n      '\\0': '\\\\0',\n      '\\u2028': '\\\\u2028',\n      '\\u2029': '\\\\u2029',\n    };\n\n    if (replacements[ch]) {\n      return replacements[ch];\n    }\n\n    if (ch < ' ') {\n      const hexString = ch.charCodeAt(0).toString(16);\n      return '\\\\x' + ('00' + hexString).substring(hexString.length);\n    }\n\n    return ch;\n  }\n\n  function syntaxError(message: string): Error {\n    const err = new SyntaxError(message);\n    Object.defineProperty(err, 'lineNumber', {\n      value: line,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    });\n    Object.defineProperty(err, 'columnNumber', {\n      value: column,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    });\n    return err;\n  }\n}\n","import * as util from './util';\nimport { parseBytes } from './parseBytes';\n\nexport type Reviver = (this: unknown, key: string, value: unknown) => unknown;\n\n/* A primitive JSON11 token payload: the parsed leaf values plus the raw\n * punctuator strings the lexer carries on `Token.value`. */\ntype TokenValue = string | number | bigint | boolean | null;\n\ntype TokenType =\n  | 'eof'\n  | 'punctuator'\n  | 'null'\n  | 'boolean'\n  | 'numeric'\n  | 'bigint'\n  | 'string'\n  | 'identifier';\n\ninterface Token {\n  type: TokenType;\n  value?: TokenValue;\n  line: number;\n  column: number;\n}\n\n/* The container frames the parser builds and the reviver walks: a plain object\n * or an array of already-parsed values. */\ntype Container = { [key: string]: unknown } | unknown[];\n\nexport type Parse11Options = {\n  /* Allow parsing long numeric values as BigInt.\n   * When true, integer values larger than Number.MAX_SAFE_INTEGER and smaller than Number.MIN_SAFE_INTEGER\n   *     are converted to BigInt.\n   * When undefined or false, they are handled just like JSON and loose precision.\n   */\n  withLongNumerals?: boolean,\n  /* Borrowed-span / byte-mode extraction. Only valid when `text` is a\n   * Uint8Array (byte input); passing a string with 'values'/'all' is both a\n   * type error and a runtime error, because the secret would already be a String.\n   *   'off'    (default) decode every string to a JS String.\n   *   'values' string *values* are returned as borrowed `RawString` spans;\n   *            object keys are still decoded to JS strings.\n   *   'all'    alias of 'values' (JS object keys must be strings, so keys are\n   *            always decoded; see README).\n   */\n  raw?: 'off' | 'values' | 'all',\n  /* Maximum digit-buffer length accepted for a BigInt literal (the explicit\n   * `…n` form and the withLongNumerals promotion). Defaults to\n   * util.MAX_NUMERIC_DIGITS_DEFAULT; bounds the super-linear BigInt(...) cost. */\n  maxNumericDigits?: number,\n  /* Maximum nesting depth the reviver walk will descend before throwing. Only\n   * the reviver path recurses (tree construction is iterative), so this bounds\n   * the reviver's stack use. Defaults to util.MAX_DEPTH_DEFAULT. */\n  maxDepth?: number,\n}\n\nexport function parse<T = unknown>(\n  text: string,\n  reviver?: Reviver | null,\n  options?: Parse11Options & { raw?: 'off' },\n): T;\nexport function parse<T = unknown>(\n  text: Uint8Array,\n  reviver?: Reviver | null,\n  options?: Parse11Options,\n): T;\nexport function parse<T = unknown>(\n  text: string | Uint8Array,\n  reviver?: Reviver | null,\n  options?: Parse11Options,\n): T {\n  if (text instanceof Uint8Array) {\n    return parseBytes<T>(text, reviver, options);\n  }\n\n  if (options?.raw === 'values' || options?.raw === 'all') {\n    throw new TypeError(\n      'JSON11: parse \\'raw\\' mode requires Uint8Array input; a string value cannot be borrowed without first materializing it as a String',\n    );\n  }\n\n  const source: string = String(text);\n  let parseState: string = 'start';\n  const stack: Container[] = [];\n  let pos: number = 0;\n  let line: number = 1;\n  let column: number = 0;\n  let token: Token;\n  let key: string;\n  let root: unknown;\n  let lexState: string;\n  let buffer: string | undefined;\n  let doubleQuote: boolean;\n  let sign: number;\n  let c: string | undefined;\n\n  const maxNumericDigits = options?.maxNumericDigits ?? util.MAX_NUMERIC_DIGITS_DEFAULT;\n  const maxDepth = options?.maxDepth ?? util.MAX_DEPTH_DEFAULT;\n\n  const lexStates: { [state: string]: () => Token | undefined } = {\n    default() {\n      switch (c) {\n        case '\\t':\n        case '\\v':\n        case '\\f':\n        case ' ':\n        case '\\u00A0':\n        case '\\uFEFF':\n        case '\\n':\n        case '\\r':\n        case '\\u2028':\n        case '\\u2029':\n          read();\n          return;\n\n        case '/':\n          read();\n          lexState = 'comment';\n          return;\n\n        case undefined:\n          read();\n          return newToken('eof');\n      }\n\n      if (util.isSpaceSeparator(c)) {\n        read();\n        return;\n      }\n\n      return lexStates[parseState]();\n    },\n\n    comment() {\n      switch (c) {\n        case '*':\n          read();\n          lexState = 'multiLineComment';\n          return;\n\n        case '/':\n          read();\n          lexState = 'singleLineComment';\n          return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    multiLineComment() {\n      switch (c) {\n        case '*':\n          read();\n          lexState = 'multiLineCommentAsterisk';\n          return;\n\n        case undefined:\n          throw invalidChar(read());\n      }\n\n      read();\n    },\n\n    multiLineCommentAsterisk() {\n      switch (c) {\n        case '*':\n          read();\n          return;\n\n        case '/':\n          read();\n          lexState = 'default';\n          return;\n\n        case undefined:\n          throw invalidChar(read());\n      }\n\n      read();\n      lexState = 'multiLineComment';\n    },\n\n    singleLineComment() {\n      switch (c) {\n        case '\\n':\n        case '\\r':\n        case '\\u2028':\n        case '\\u2029':\n          read();\n          lexState = 'default';\n          return;\n\n        case undefined:\n          read();\n          return newToken('eof');\n      }\n\n      read();\n    },\n\n    value() {\n      switch (c) {\n        case '{':\n        case '[':\n          return newToken('punctuator', read());\n\n        case 'n':\n          read();\n          literal('ull');\n          return newToken('null', null);\n\n        case 't':\n          read();\n          literal('rue');\n          return newToken('boolean', true);\n\n        case 'f':\n          read();\n          literal('alse');\n          return newToken('boolean', false);\n\n        case '-':\n        case '+':\n          if (read() === '-') {\n            sign = -1;\n          }\n\n          lexState = 'sign';\n          return;\n\n        case '.':\n          buffer = read();\n          lexState = 'decimalPointLeading';\n          return;\n\n        case '0':\n          buffer = read();\n          lexState = 'zero';\n          return;\n\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n          buffer = read();\n          lexState = 'decimalInteger';\n          return;\n\n        case 'I':\n          read();\n          literal('nfinity');\n          return newToken('numeric', Infinity);\n\n        case 'N':\n          read();\n          literal('aN');\n          return newToken('numeric', NaN);\n\n        case '\"':\n        case '\\'':\n          doubleQuote = (read() === '\"');\n          buffer = '';\n          lexState = 'string';\n          return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    identifierNameStartEscape() {\n      if (c !== 'u') {\n        throw invalidChar(read());\n      }\n\n      read();\n      const u = unicodeEscape();\n      switch (u) {\n        case '$':\n        case '_':\n          break;\n\n        default:\n          if (!util.isIdStartChar(u)) {\n            throw invalidIdentifier();\n          }\n\n          break;\n      }\n\n      buffer += u;\n      lexState = 'identifierName';\n    },\n\n    identifierName() {\n      switch (c) {\n        case '$':\n        case '_':\n        case '\\u200C':\n        case '\\u200D':\n          buffer += read()!;\n          return;\n\n        case '\\\\':\n          read();\n          lexState = 'identifierNameEscape';\n          return;\n      }\n\n      if (util.isIdContinueChar(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newToken('identifier', buffer);\n    },\n\n    identifierNameEscape() {\n      if (c !== 'u') {\n        throw invalidChar(read());\n      }\n\n      read();\n      const u = unicodeEscape();\n      switch (u) {\n        case '$':\n        case '_':\n        case '\\u200C':\n        case '\\u200D':\n          break;\n\n        default:\n          if (!util.isIdContinueChar(u)) {\n            throw invalidIdentifier();\n          }\n\n          break;\n      }\n\n      buffer += u;\n      lexState = 'identifierName';\n    },\n\n    sign() {\n      switch (c) {\n        case '.':\n          buffer = read();\n          lexState = 'decimalPointLeading';\n          return;\n\n        case '0':\n          buffer = read();\n          lexState = 'zero';\n          return;\n\n        case '1':\n        case '2':\n        case '3':\n        case '4':\n        case '5':\n        case '6':\n        case '7':\n        case '8':\n        case '9':\n          buffer = read();\n          lexState = 'decimalInteger';\n          return;\n\n        case 'I':\n          read();\n          literal('nfinity');\n          return newToken('numeric', sign * Infinity);\n\n        case 'N':\n          read();\n          literal('aN');\n          return newToken('numeric', NaN);\n      }\n\n      throw invalidChar(read());\n    },\n\n    zero() {\n      switch (c) {\n        case '.':\n          buffer += read()!;\n          lexState = 'decimalPoint';\n          return;\n\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n\n        case 'x':\n        case 'X':\n          buffer += read()!;\n          lexState = 'hexadecimal';\n          return;\n\n        case 'n':\n          lexState = 'bigInt';\n          return;\n      }\n\n      return newToken('numeric', sign * 0);\n    },\n\n    decimalInteger() {\n      switch (c) {\n        case '.':\n          buffer += read()!;\n          lexState = 'decimalPoint';\n          return;\n\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n\n        case 'n':\n          lexState = 'bigInt';\n          return;\n\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    decimalPointLeading() {\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalFraction';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    decimalPoint() {\n      switch (c) {\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalFraction';\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    decimalFraction() {\n      switch (c) {\n        case 'e':\n        case 'E':\n          buffer += read()!;\n          lexState = 'decimalExponent';\n          return;\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    decimalExponent() {\n      switch (c) {\n        case '+':\n        case '-':\n          buffer += read()!;\n          lexState = 'decimalExponentSign';\n          return;\n      }\n\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalExponentInteger';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    decimalExponentSign() {\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        lexState = 'decimalExponentInteger';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    decimalExponentInteger() {\n      if (util.isDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    bigInt() {\n      if (buffer?.length && (util.isInteger(buffer) || util.isHex(buffer))) {\n        if (buffer.length > maxNumericDigits) {\n          throw syntaxError(\n            `JSON11: numeric literal of length ${buffer.length} exceeds the ${maxNumericDigits}-digit BigInt cap at ${line}:${column}`,\n          );\n        }\n        read();\n        return newToken('bigint', BigInt(sign) * BigInt(buffer));\n      }\n\n      throw invalidChar(read());\n    },\n\n    hexadecimal() {\n      if (util.isHexDigit(c)) {\n        buffer += read()!;\n        lexState = 'hexadecimalInteger';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    hexadecimalInteger() {\n      if (util.isHexDigit(c)) {\n        buffer += read()!;\n        return;\n      }\n\n      if (c === 'n') {\n        lexState = 'bigInt';\n        return;\n      }\n\n      return newNumericToken(sign, buffer);\n    },\n\n    string() {\n      switch (c) {\n        case '\\\\':\n          read();\n          buffer += escape();\n          return;\n\n        case '\"':\n          if (doubleQuote) {\n            read();\n            return newToken('string', buffer);\n          }\n\n          buffer += read()!;\n          return;\n\n        case '\\'':\n          if (!doubleQuote) {\n            read();\n            return newToken('string', buffer);\n          }\n\n          buffer += read()!;\n          return;\n\n        case '\\n':\n        case '\\r':\n          throw invalidChar(read());\n\n        case '\\u2028':\n        case '\\u2029':\n          separatorChar(c);\n          break;\n\n        case undefined:\n          throw invalidChar(read());\n      }\n\n      buffer += read()!;\n    },\n\n    start() {\n      switch (c) {\n        case '{':\n        case '[':\n          return newToken('punctuator', read());\n\n        case undefined:\n          return newToken('eof')\n      }\n\n      lexState = 'value';\n    },\n\n    beforePropertyName() {\n      switch (c) {\n        case '$':\n        case '_':\n          buffer = read();\n          lexState = 'identifierName';\n          return;\n\n        case '\\\\':\n          read();\n          lexState = 'identifierNameStartEscape';\n          return;\n\n        case '}':\n          return newToken('punctuator', read());\n\n        case '\"':\n        case '\\'':\n          doubleQuote = (read() === '\"');\n          lexState = 'string';\n          return;\n      }\n\n      if (util.isIdStartChar(c)) {\n        buffer += read()!;\n        lexState = 'identifierName';\n        return;\n      }\n\n      throw invalidChar(read());\n    },\n\n    afterPropertyName() {\n      if (c === ':') {\n        return newToken('punctuator', read());\n      }\n\n      throw invalidChar(read());\n    },\n\n    beforePropertyValue() {\n      lexState = 'value';\n    },\n\n    afterPropertyValue() {\n      switch (c) {\n        case ',':\n        case '}':\n          return newToken('punctuator', read());\n      }\n\n      throw invalidChar(read());\n    },\n\n    beforeArrayValue() {\n      if (c === ']') {\n        return newToken('punctuator', read());\n      }\n\n      lexState = 'value';\n    },\n\n    afterArrayValue() {\n      switch (c) {\n        case ',':\n        case ']':\n          return newToken('punctuator', read());\n      }\n\n      throw invalidChar(read());\n    },\n\n    end() {\n      throw invalidChar(read());\n    },\n  };\n\n  const parseStates: { [key: string]: () => void } = {\n    start() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      push();\n    },\n\n    beforePropertyName() {\n      switch (token.type) {\n        case 'identifier':\n        case 'string':\n          key = token.value as string;\n          parseState = 'afterPropertyName';\n          return;\n\n        case 'punctuator':\n          pop();\n          return;\n\n        case 'eof':\n          throw invalidEOF();\n      }\n    },\n\n    afterPropertyName() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      parseState = 'beforePropertyValue';\n    },\n\n    beforePropertyValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      push();\n    },\n\n    beforeArrayValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      if (token.type === 'punctuator' && token.value === ']') {\n        pop();\n        return;\n      }\n\n      push();\n    },\n\n    afterPropertyValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      switch (token.value) {\n        case ',':\n          parseState = 'beforePropertyName';\n          return;\n\n        case '}':\n          pop();\n      }\n    },\n\n    afterArrayValue() {\n      if (token.type === 'eof') {\n        throw invalidEOF();\n      }\n\n      switch (token.value) {\n        case ',':\n          parseState = 'beforeArrayValue';\n          return;\n\n        case ']':\n          pop();\n      }\n    },\n\n    end() {\n      // Do nothing\n    },\n  };\n\n  do {\n    token = lex();\n\n    parseStates[parseState]();\n  } while (token.type !== 'eof');\n\n  if (typeof reviver === 'function') {\n    return internalize({ '': root }, '', reviver, 0) as T;\n  }\n\n  return root as T;\n\n  function internalize(holder: Container, name: string, reviver: Reviver, depth: number): unknown {\n    if (depth > maxDepth) {\n      throw syntaxError(`JSON11: maximum nesting depth ${maxDepth} exceeded`);\n    }\n    const value = (holder as { [key: string]: unknown })[name];\n    if (value != null && typeof value === 'object') {\n      if (Array.isArray(value)) {\n        for (let i = 0; i < value.length; i++) {\n          const key = String(i);\n          const replacement = internalize(value, key, reviver, depth + 1);\n          if (replacement === undefined) {\n            delete value[i];\n          } else {\n            Object.defineProperty(value, key, {\n              value: replacement,\n              writable: true,\n              enumerable: true,\n              configurable: true,\n            });\n          }\n        }\n      } else {\n        const object = value as { [key: string]: unknown };\n        for (const key in object) {\n          const replacement = internalize(object, key, reviver, depth + 1);\n          if (replacement === undefined) {\n            delete object[key];\n          } else {\n            Object.defineProperty(object, key, {\n              value: replacement,\n              writable: true,\n              enumerable: true,\n              configurable: true,\n            });\n          }\n        }\n      }\n    }\n\n    return reviver.call(holder, name, value);\n  }\n\n  function lex(): Token {\n    lexState = 'default';\n    buffer = '';\n    doubleQuote = false;\n    sign = 1;\n\n    for (; ;) {\n      c = peek();\n\n      const token = lexStates[lexState]();\n      if (token) {\n        return token;\n      }\n    }\n  }\n\n  function peek(): string | undefined {\n    if (source[pos]) {\n      return String.fromCodePoint(source.codePointAt(pos)!);\n    }\n  }\n\n  function read(): string | undefined {\n    const c = peek();\n\n    if (c === '\\n') {\n      line++;\n      column = 0;\n    } else if (c) {\n      column += c.length;\n    } else {\n      column++;\n    }\n\n    if (c) {\n      pos += c.length;\n    }\n\n    return c;\n  }\n\n  function newToken(type: TokenType, value?: TokenValue): Token {\n    return {\n      type,\n      value,\n      line,\n      column,\n    };\n  }\n\n  function newNumericToken(sign: number, buffer?: string): Token {\n    const num = sign * Number(buffer);\n\n    if (options?.withLongNumerals) {\n      if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {\n        if (buffer!.length > maxNumericDigits) {\n          throw syntaxError(\n            `JSON11: numeric literal of length ${buffer!.length} exceeds the ${maxNumericDigits}-digit BigInt cap at ${line}:${column}`,\n          );\n        }\n        try {\n          return newToken('bigint', BigInt(sign) * BigInt(buffer!));\n        } catch (ex) {\n          // RangeError when num is not an integer\n          console.warn(ex);\n        }\n      }\n    }\n\n    return newToken('numeric', num);\n  }\n\n  function literal(s: string): void {\n    for (const c of s) {\n      const p = peek();\n\n      if (p !== c) {\n        throw invalidChar(read());\n      }\n\n      read();\n    }\n  }\n\n  function escape(): string {\n    const c = peek();\n    switch (c) {\n      case 'b':\n        read();\n        return '\\b';\n\n      case 'f':\n        read();\n        return '\\f';\n\n      case 'n':\n        read();\n        return '\\n';\n\n      case 'r':\n        read();\n        return '\\r';\n\n      case 't':\n        read();\n        return '\\t';\n\n      case 'v':\n        read();\n        return '\\v';\n\n      case '0':\n        read();\n        if (util.isDigit(peek())) {\n          throw invalidChar(read());\n        }\n\n        return '\\0';\n\n      case 'x':\n        read();\n        return hexEscape();\n\n      case 'u':\n        read();\n        return unicodeEscape();\n\n      case '\\n':\n      case '\\u2028':\n      case '\\u2029':\n        read();\n        return '';\n\n      case '\\r':\n        read();\n        if (peek() === '\\n') {\n          read();\n        }\n\n        return '';\n\n      case '1':\n      case '2':\n      case '3':\n      case '4':\n      case '5':\n      case '6':\n      case '7':\n      case '8':\n      case '9':\n        throw invalidChar(read());\n\n      case undefined:\n        throw invalidChar(read());\n    }\n\n    return read()!;\n  }\n\n  function hexEscape(): string {\n    let buffer = '';\n    let c = peek();\n\n    if (!util.isHexDigit(c)) {\n      throw invalidChar(read());\n    }\n\n    buffer += read()!;\n\n    c = peek();\n    if (!util.isHexDigit(c)) {\n      throw invalidChar(read());\n    }\n\n    buffer += read()!;\n\n    return String.fromCodePoint(parseInt(buffer, 16));\n  }\n\n  function unicodeEscape(): string {\n    let buffer = '';\n    let count = 4;\n\n    while (count-- > 0) {\n      const c = peek();\n      if (!util.isHexDigit(c)) {\n        throw invalidChar(read());\n      }\n\n      buffer += read()!;\n    }\n\n    return String.fromCodePoint(parseInt(buffer, 16));\n  }\n\n  function push() {\n    let value: unknown;\n\n    switch (token.type) {\n      case 'punctuator':\n        switch (token.value) {\n          case '{':\n            value = {};\n            break;\n\n          case '[':\n            value = [];\n            break;\n        }\n\n        break;\n\n      case 'null':\n      case 'boolean':\n      case 'numeric':\n      case 'string':\n      case 'bigint':\n        value = token.value;\n        break;\n    }\n\n    if (root === undefined) {\n      root = value;\n    } else {\n      const parent = stack[stack.length - 1];\n      if (Array.isArray(parent)) {\n        parent.push(value);\n      } else {\n        Object.defineProperty(parent, key, {\n          value,\n          writable: true,\n          enumerable: true,\n          configurable: true,\n        });\n      }\n    }\n\n    if (value !== null && typeof value === 'object') {\n      stack.push(value as Container);\n\n      if (Array.isArray(value)) {\n        parseState = 'beforeArrayValue';\n      } else {\n        parseState = 'beforePropertyName';\n      }\n    } else {\n      const current = stack[stack.length - 1];\n      if (current == null) {\n        parseState = 'end';\n      } else if (Array.isArray(current)) {\n        parseState = 'afterArrayValue';\n      } else {\n        parseState = 'afterPropertyValue';\n      }\n    }\n  }\n\n  function pop() {\n    stack.pop();\n\n    const current = stack[stack.length - 1];\n    if (current == null) {\n      parseState = 'end';\n    } else if (Array.isArray(current)) {\n      parseState = 'afterArrayValue';\n    } else {\n      parseState = 'afterPropertyValue';\n    }\n  }\n\n  function invalidChar(c: string | undefined): Error {\n    if (c === undefined) {\n      return syntaxError(`JSON11: invalid end of input at ${line}:${column}`);\n    }\n\n    return syntaxError(`JSON11: invalid character '${formatChar(c)}' at ${line}:${column}`);\n  }\n\n  function invalidEOF(): Error {\n    return syntaxError(`JSON11: invalid end of input at ${line}:${column}`);\n  }\n\n  function invalidIdentifier(): Error {\n    column -= 5;\n    return syntaxError(`JSON11: invalid identifier character at ${line}:${column}`);\n  }\n\n  function separatorChar(c: string): void {\n    console.warn(`JSON11: '${formatChar(c)}' in strings is not valid ECMAScript; consider escaping`);\n  }\n\n  function formatChar(c: string): string {\n    const replacements: Record<string, string> = {\n      '\\'': '\\\\\\'',\n      '\"': '\\\\\"',\n      '\\\\': '\\\\\\\\',\n      '\\b': '\\\\b',\n      '\\f': '\\\\f',\n      '\\n': '\\\\n',\n      '\\r': '\\\\r',\n      '\\t': '\\\\t',\n      '\\v': '\\\\v',\n      '\\0': '\\\\0',\n      '\\u2028': '\\\\u2028',\n      '\\u2029': '\\\\u2029',\n    };\n\n    if (replacements[c]) {\n      return replacements[c];\n    }\n\n    if (c < ' ') {\n      const hexString = c.charCodeAt(0).toString(16);\n      return '\\\\x' + ('00' + hexString).substring(hexString.length);\n    }\n\n    return c;\n  }\n\n  function syntaxError(message: string): Error {\n    const err = new SyntaxError(message);\n    Object.defineProperty(err, 'lineNumber', {\n      value: line,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    });\n    Object.defineProperty(err, 'columnNumber', {\n      value: column,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    });\n    return err;\n  }\n}\n","/* Shared string-escaping table for the serializers.\n *\n * Both the string serializer (`stringify`, char-out) and the byte serializer\n * (`stringify(..., { raw: true })`, byte-out) build their escaping from this one\n * source of truth so that, by construction, a value serialized to bytes is\n * byte-identical to the UTF-8 encoding of the same value serialized to a string.\n * This is the invariant that makes lifted escaped spans round-trip safely.\n */\n\nexport type QuoteReplacements = { [key: string]: string };\n\n/* The non-quote-character escape replacements, matching JSON5/JSON11 semantics.\n * `withLegacyEscapes` controls whether \\v, \\0, and \\x00 use the short JSON5\n * forms (`\\v`, `\\0`, `\\x00`) or the safer \\u escapes.\n */\nexport function buildQuoteReplacements(withLegacyEscapes?: boolean): QuoteReplacements {\n  return {\n    '\\'': '\\\\\\'',\n    '\"': '\\\\\"',\n    '\\\\': '\\\\\\\\',\n    '\\b': '\\\\b',\n    '\\f': '\\\\f',\n    '\\n': '\\\\n',\n    '\\r': '\\\\r',\n    '\\t': '\\\\t',\n    '\\v': withLegacyEscapes ? '\\\\v' : '\\\\u000b',\n    '\\0': withLegacyEscapes ? '\\\\0' : '\\\\u0000',\n    '\\u2028': '\\\\u2028',\n    '\\u2029': '\\\\u2029',\n  };\n}\n\n/* The escape for a NUL that is immediately followed by a decimal digit; the\n * short `\\0` form would otherwise be ambiguous with an octal escape.\n */\nexport function nulFollowedByDigitReplacement(withLegacyEscapes?: boolean): string {\n  return withLegacyEscapes ? '\\\\x00' : '\\\\u0000';\n}\n\n/* The escape for a control character (code point < 0x20) that has no dedicated\n * short form. Returns an ASCII-only escape sequence.\n */\nexport function controlEscape(codeUnit: number, withLegacyEscapes?: boolean): string {\n  const hexString = codeUnit.toString(16);\n  return withLegacyEscapes\n    ? '\\\\x' + ('00' + hexString).substring(hexString.length)\n    : '\\\\u' + hexString.padStart(4, '0');\n}\n","/* Leaf string/key serialization shared by the string serializer (`stringify`)\n * and the byte serializer (`stringify(..., { raw: true })`).\n *\n * Both serializers produce string/key fragments through these exact functions so\n * the byte output is byte-identical to the UTF-8 encoding of the string output.\n * `quoteWeights` is intentionally shared, accumulating per stringify call: the\n * chosen quote character depends on the quote balance across the whole document,\n * so both serializers must thread the same context to stay identical.\n */\n\nimport * as util from './util';\nimport { controlEscape, type QuoteReplacements } from './escapes';\n\nexport type QuoteContext = {\n  quoteWeights: Record<string, number>;\n  quote?: string;\n  quoteReplacements: QuoteReplacements;\n  nulFollowedByDigit: string;\n  withLegacyEscapes?: boolean;\n};\n\nexport function quoteString(value: string, ctx: QuoteContext): string {\n  let product = '';\n\n  for (let i = 0; i < value.length; i++) {\n    const c = value[i];\n    switch (c) {\n      case '\\'':\n      case '\"':\n        ctx.quoteWeights[c]++;\n        product += c;\n        continue;\n\n      case '\\0':\n        if (util.isDigit(value[i + 1])) {\n          product += ctx.nulFollowedByDigit;\n          continue;\n        }\n    }\n\n    if (ctx.quoteReplacements[c]) {\n      product += ctx.quoteReplacements[c];\n      continue;\n    }\n\n    if (c < ' ') {\n      product += controlEscape(c.charCodeAt(0), ctx.withLegacyEscapes);\n      continue;\n    }\n\n    product += c;\n  }\n\n  const quoteChar = chooseQuote(ctx);\n\n  product = product.replace(new RegExp(quoteChar, 'g'), ctx.quoteReplacements[quoteChar]);\n\n  return quoteChar + product + quoteChar;\n}\n\n/* The quote character to wrap a leaf in: a caller-forced quote if any, else the\n * cheaper of `'`/`\"` by accumulated document-wide weight (ties resolve to the\n * first `quoteWeights` key). Single source of truth so the byte serializer's raw\n * escaper and `quoteString` pick the quote identically. */\nexport function chooseQuote(ctx: QuoteContext): string {\n  return ctx.quote || Object.keys(ctx.quoteWeights).reduce((a, b) => (ctx.quoteWeights[a] < ctx.quoteWeights[b]) ? a : b);\n}\n\nexport function serializeKey(key: string, ctx: QuoteContext): string {\n  if (key.length === 0) {\n    return quoteString(key, ctx);\n  }\n\n  const firstChar = String.fromCodePoint(key.codePointAt(0)!);\n  if (!util.isIdStartChar(firstChar)) {\n    return quoteString(key, ctx);\n  }\n\n  for (let i = firstChar.length; i < key.length; i++) {\n    if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)!))) {\n      return quoteString(key, ctx);\n    }\n  }\n\n  return key;\n}\n","/* Internal byte-output serializer for JSON11 byte-mode.\n *\n * Reached through `stringify(value, …, { raw: true })`. It mirrors the string\n * serializer's structure/formatting exactly — leaf strings and keys go through\n * the same shared `quoteString`/`serializeKey` helpers, so for any value without\n * raw nodes the byte output is byte-identical to the UTF-8 encoding of the string\n * output. Where it differs: it recognizes `RawValue`/`RawString` nodes\n * and injects their bytes directly (pre-escaped spliced verbatim, or raw bytes\n * escaped with JSON11's own escaper), so a secret reaches the buffer without ever\n * becoming a JS String.\n *\n * Not a public export.\n */\n\nimport { ByteWriter, decodeUtf8 } from './bytes';\nimport { controlEscape } from './escapes';\nimport { type QuoteContext, quoteString, serializeKey, chooseQuote } from './serializeShared';\nimport { RawString, RawValue, QUOTE_DOUBLE, QUOTE_SINGLE } from './raw';\nimport type { Replacer } from './stringify';\n\n/* A value that holds the property being serialized: the synthetic root, a parsed\n * object, or an array indexed by stringified position. */\ntype Holder = { [key: string]: unknown };\n\n/* The self-serialization hooks a value may define, honored toJSON11 > toJSON5 > toJSON. */\ninterface ToJsonHooks {\n  toJSON11?: (key: string) => unknown;\n  toJSON5?: (key: string) => unknown;\n  toJSON?: (key: string) => unknown;\n}\n\nexport type SerializeConfig = {\n  gap: string,\n  trailingComma: string,\n  quoteContext: QuoteContext,\n  quoteNames: boolean,\n  replacer?: Replacer,\n  propertyList?: string[],\n  withBigInt?: boolean,\n  nonFinite: 'literal' | 'null' | 'throw',\n  maxDepth: number,\n};\n\nconst textEncoder = new TextEncoder();\nconst enc = (s: string): Uint8Array => textEncoder.encode(s);\n\n/* ASCII byte literals for the structural tokens and the three keyword constants.\n * Writing these straight into the shared buffer avoids a TextEncoder call per\n * occurrence (the dominant constant-factor cost of the old per-fragment encode).\n */\nconst BYTE_LBRACE = 0x7b; /* { */\nconst BYTE_RBRACE = 0x7d; /* } */\nconst BYTE_LBRACKET = 0x5b; /* [ */\nconst BYTE_RBRACKET = 0x5d; /* ] */\nconst BYTE_COLON = 0x3a; /* : */\nconst BYTE_COMMA = 0x2c; /* , */\nconst BYTE_SPACE = 0x20; /*   */\nconst BYTE_NEWLINE = 0x0a; /* \\n */\nconst NULL_BYTES = enc('null');\nconst TRUE_BYTES = enc('true');\nconst FALSE_BYTES = enc('false');\n\n/* A sentinel for a member that produces no output (a function/symbol/undefined\n * value after the toJSON ladder + replacer). The resolve step returns it so the\n * caller can decide — *before writing anything* — whether to emit a member\n * (object: skip entirely; array: write null). */\nconst SKIP = Symbol('skip');\n\nexport function serializeToBytes(value: unknown, config: SerializeConfig): Uint8Array | undefined {\n  const { gap, trailingComma, quoteContext, quoteNames, replacer, propertyList, withBigInt, nonFinite, maxDepth } = config;\n  /* Open-ancestor set for O(1) cycle detection; doubles as the live nesting\n   * depth via stack.size. Set.has matches Array.includes object identity. */\n  const stack = new Set<object>();\n  const gapBytes = enc(gap);\n  const pretty = gap !== '';\n\n  const escapeTable = buildEscapeTable(quoteContext);\n  const writer = new ByteWriter();\n\n  const nameSerializer = (key: string): Uint8Array =>\n    enc(quoteNames ? quoteString(key, quoteContext) : serializeKey(key, quoteContext));\n\n  const root = resolveValue('', { '': value });\n  if (root === SKIP) {\n    return undefined;\n  }\n  writeValue(root);\n  return writer.toUint8Array();\n\n  /* Run the toJSON11 > toJSON5 > toJSON ladder, the replacer, and the boxed-\n   * primitive unwrap exactly once (they may have side effects), yielding either\n   * the final value to serialize or SKIP. Splitting resolve from write lets the\n   * object writer learn a member is skippable before it has written the key. */\n  function resolveValue(key: string, holder: Holder): unknown {\n    let value: unknown = holder[key];\n\n    if (value != null && !(value instanceof RawValue) && !(value instanceof RawString)) {\n      const hooks = value as ToJsonHooks;\n      if (typeof hooks.toJSON11 === 'function') {\n        value = hooks.toJSON11(key);\n      } else if (typeof hooks.toJSON5 === 'function') {\n        value = hooks.toJSON5(key);\n      } else if (typeof hooks.toJSON === 'function') {\n        value = hooks.toJSON(key);\n      }\n    }\n\n    if (replacer) {\n      value = replacer.call(holder, key, value);\n    }\n\n    if (value instanceof RawString || value instanceof RawValue) {\n      return value;\n    }\n\n    if (value instanceof Number) {\n      value = Number(value);\n    } else if (value instanceof String) {\n      value = String(value);\n    } else if (value instanceof Boolean) {\n      value = value.valueOf();\n    }\n\n    const type = typeof value;\n    if (type === 'function' || type === 'symbol' || type === 'undefined') {\n      return SKIP;\n    }\n    return value;\n  }\n\n  /* Write the bytes of an already-resolved (never SKIP) value into the shared\n   * writer. */\n  function writeValue(value: unknown): void {\n    if (value instanceof RawString) {\n      spliceEscaped(value.span(), value.quote);\n      return;\n    }\n\n    if (value instanceof RawValue) {\n      if (value.preEscaped) {\n        spliceEscaped(value.bytes, value.quote);\n      } else {\n        escapeRaw(value.bytes);\n      }\n      return;\n    }\n\n    switch (value) {\n      case null:\n        writer.pushBytes(NULL_BYTES);\n        return;\n      case true:\n        writer.pushBytes(TRUE_BYTES);\n        return;\n      case false:\n        writer.pushBytes(FALSE_BYTES);\n        return;\n    }\n\n    if (typeof value === 'string') {\n      writer.pushBytes(enc(quoteString(value, quoteContext)));\n      return;\n    }\n\n    if (typeof value === 'number') {\n      if (!isFinite(value) && nonFinite !== 'literal') {\n        if (nonFinite === 'throw') {\n          throw new TypeError(`Cannot serialize non-finite number ${String(value)} as JSON`);\n        }\n        writer.pushBytes(NULL_BYTES);\n        return;\n      }\n      writer.pushBytes(enc(String(value)));\n      return;\n    }\n\n    if (typeof value === 'bigint') {\n      writer.pushBytes(enc(value.toString() + (withBigInt === false ? '' : 'n')));\n      return;\n    }\n\n    if (Array.isArray(value)) {\n      writeArray(value);\n    } else {\n      writeObject(value as object);\n    }\n  }\n\n  /* Write 0x0a followed by `depth` copies of the gap bytes — the byte form of\n   * the string serializer's '\\n' + indent, where indent is the gap repeated per\n   * open container. */\n  function writeIndent(depth: number): void {\n    writer.pushByte(BYTE_NEWLINE);\n    for (let i = 0; i < depth; i++) {\n      writer.pushBytes(gapBytes);\n    }\n  }\n\n  function spliceEscaped(inner: Uint8Array, quoteByte: number): void {\n    writer.pushByte(quoteByte);\n    writer.pushBytes(inner);\n    writer.pushByte(quoteByte);\n  }\n\n  function escapeRaw(bytes: Uint8Array): void {\n    /* Mirror quoteString's two-pass shape over the raw bytes: first bump the\n     * shared quote weights for every literal '/\" byte (exactly as quoteString\n     * does per char) so this node both picks its own quote from — and\n     * contributes to — the document-wide balance, then escape whichever quote\n     * that balance selects. Byte-only: the weight keys are the static strings\n     * \"'\"/'\"', never value-derived bytes. */\n    for (let i = 0; i < bytes.length; i++) {\n      if (bytes[i] === QUOTE_SINGLE) quoteContext.quoteWeights[\"'\"]++;\n      else if (bytes[i] === QUOTE_DOUBLE) quoteContext.quoteWeights['\"']++;\n    }\n    const quoteByte = chooseQuote(quoteContext) === '\"' ? QUOTE_DOUBLE : QUOTE_SINGLE;\n\n    writer.pushByte(quoteByte);\n    escapeRawInto(writer, bytes, quoteByte);\n    writer.pushByte(quoteByte);\n  }\n\n  function escapeRawInto(writer: ByteWriter, bytes: Uint8Array, quoteByte: number): void {\n    const otherQuote = quoteByte === QUOTE_DOUBLE ? QUOTE_SINGLE : QUOTE_DOUBLE;\n    const len = bytes.length;\n    let i = 0;\n    while (i < len) {\n      const b = bytes[i];\n\n      if (b >= 0x80) {\n        let dec;\n        try {\n          dec = decodeUtf8(bytes, i);\n        } catch (ex) {\n          const msg = ex instanceof Error ? ex.message : String(ex);\n          throw new TypeError(`JSON11: RawValue.raw contains malformed UTF-8 (${msg})`, { cause: ex });\n        }\n        if (!dec) break;\n        const escape = escapeTable.multiByte.get(dec.cp);\n        if (escape) {\n          writer.pushBytes(escape);\n        } else {\n          writer.pushBytes(bytes, i, i + dec.size);\n        }\n        i += dec.size;\n        continue;\n      }\n\n      if (b === quoteByte) {\n        writer.pushByte(0x5c);\n        writer.pushByte(b);\n        i++;\n        continue;\n      }\n      if (b === otherQuote) {\n        writer.pushByte(b);\n        i++;\n        continue;\n      }\n      if (b === 0x00) {\n        const next = i + 1 < len ? bytes[i + 1] : -1;\n        writer.pushBytes(next >= 0x30 && next <= 0x39 ? escapeTable.nulDigit : escapeTable.byByte[0]!);\n        i++;\n        continue;\n      }\n\n      const e = escapeTable.byByte[b];\n      if (e) {\n        writer.pushBytes(e);\n        i++;\n        continue;\n      }\n\n      writer.pushByte(b);\n      i++;\n    }\n  }\n\n  /* Emit one resolved (never SKIP) object member as `key:value` (or `key: value`\n   * when pretty). The string serializer serializes the value before the key\n   * (serializeProperty then nameSerializer), so the key's quote choice depends\n   * on the quote weights the value subtree contributes. To stay byte-identical\n   * we must preserve that order: a bare-identifier key bumps no weights, so it\n   * is written first and the value appended (single pass). A key that routes\n   * through quoteString has its weight bumps rolled back, the value is\n   * serialized first, then the key is re-serialized in the correct order and\n   * spliced in front of the value bytes. */\n  function writeMember(key: string, resolved: unknown): void {\n    const savedSingle = quoteContext.quoteWeights[\"'\"];\n    const savedDouble = quoteContext.quoteWeights['\"'];\n    const keyBytes = nameSerializer(key);\n    const keyQuoted = keyBytes.length > 0 && (keyBytes[0] === QUOTE_SINGLE || keyBytes[0] === QUOTE_DOUBLE);\n\n    if (!keyQuoted) {\n      writer.pushBytes(keyBytes);\n      writer.pushByte(BYTE_COLON);\n      if (pretty) {\n        writer.pushByte(BYTE_SPACE);\n      }\n      writeValue(resolved);\n      return;\n    }\n\n    quoteContext.quoteWeights[\"'\"] = savedSingle;\n    quoteContext.quoteWeights['\"'] = savedDouble;\n\n    const mark = writer.length;\n    writeValue(resolved);\n\n    const orderedKey = nameSerializer(key);\n    const sepLength = pretty ? 2 : 1;\n    const prefix = new Uint8Array(orderedKey.length + sepLength);\n    prefix.set(orderedKey, 0);\n    prefix[orderedKey.length] = BYTE_COLON;\n    if (pretty) {\n      prefix[orderedKey.length + 1] = BYTE_SPACE;\n    }\n    writer.insertBefore(mark, prefix);\n  }\n\n  function writeObject(value: object): void {\n    if (stack.has(value)) {\n      throw TypeError('Converting circular structure to JSON11');\n    }\n    if (stack.size >= maxDepth) {\n      throw TypeError(`JSON11: maximum nesting depth ${maxDepth} exceeded`);\n    }\n\n    stack.add(value);\n\n    /* The member indent is the gap repeated per open container (stack size,\n     * counting this object); the closing brace steps back one level. */\n    const depth = stack.size;\n    const keys = propertyList || Object.keys(value);\n\n    writer.pushByte(BYTE_LBRACE);\n    let emitted = 0;\n    for (const key of keys) {\n      const resolved = resolveValue(key, value as Holder);\n      if (resolved === SKIP) {\n        continue;\n      }\n      if (emitted > 0) {\n        writer.pushByte(BYTE_COMMA);\n      }\n      if (pretty) {\n        writeIndent(depth);\n      }\n      writeMember(key, resolved);\n      emitted++;\n    }\n\n    if (emitted > 0 && pretty) {\n      if (trailingComma) {\n        writer.pushByte(BYTE_COMMA);\n      }\n      writeIndent(depth - 1);\n    }\n    writer.pushByte(BYTE_RBRACE);\n\n    stack.delete(value);\n  }\n\n  function writeArray(value: unknown[]): void {\n    if (stack.has(value)) {\n      throw TypeError('Converting circular structure to JSON11');\n    }\n    if (stack.size >= maxDepth) {\n      throw TypeError(`JSON11: maximum nesting depth ${maxDepth} exceeded`);\n    }\n\n    stack.add(value);\n\n    const depth = stack.size;\n    const len = value.length;\n\n    writer.pushByte(BYTE_LBRACKET);\n    for (let i = 0; i < len; i++) {\n      if (i > 0) {\n        writer.pushByte(BYTE_COMMA);\n      }\n      if (pretty) {\n        writeIndent(depth);\n      }\n      const resolved = resolveValue(String(i), value as unknown as Holder);\n      if (resolved === SKIP) {\n        writer.pushBytes(NULL_BYTES);\n      } else {\n        writeValue(resolved);\n      }\n    }\n\n    if (len > 0 && pretty) {\n      if (trailingComma) {\n        writer.pushByte(BYTE_COMMA);\n      }\n      writeIndent(depth - 1);\n    }\n    writer.pushByte(BYTE_RBRACKET);\n\n    stack.delete(value);\n  }\n}\n\ntype EscapeTable = {\n  byByte: (Uint8Array | undefined)[];\n  nulDigit: Uint8Array;\n  multiByte: Map<number, Uint8Array>;\n};\n\n/* Build the escape table from the same shared escape mappings the string\n * serializer uses, so RawValue.raw escaping is consistent with the rest of\n * JSON11's output: a byte-indexed array for the ASCII (< 0x80) escapes and a\n * code-point-keyed map for the non-ASCII ones. Deriving the multibyte set from\n * the table (rather than hardcoding U+2028/U+2029) keeps the raw path in\n * lockstep with the string path by construction — a new non-ASCII entry in the\n * shared table is picked up here automatically. */\nfunction buildEscapeTable(ctx: QuoteContext): EscapeTable {\n  const byByte: (Uint8Array | undefined)[] = new Array(0x80);\n  for (let b = 0; b < 0x20; b++) {\n    byByte[b] = enc(controlEscape(b, ctx.withLegacyEscapes));\n  }\n  const multiByte = new Map<number, Uint8Array>();\n  for (const key of Object.keys(ctx.quoteReplacements)) {\n    const cp = key.codePointAt(0)!;\n    if (cp < 0x80) {\n      if (cp !== QUOTE_DOUBLE && cp !== QUOTE_SINGLE) {\n        byByte[cp] = enc(ctx.quoteReplacements[key]);\n      }\n    } else {\n      multiByte.set(cp, enc(ctx.quoteReplacements[key]));\n    }\n  }\n  return {\n    byByte,\n    nulDigit: enc(ctx.nulFollowedByDigit),\n    multiByte,\n  };\n}\n","import { buildQuoteReplacements, nulFollowedByDigitReplacement } from './escapes';\nimport { quoteString, serializeKey, type QuoteContext } from './serializeShared';\nimport { RawString, RawValue } from './raw';\nimport { serializeToBytes } from './stringifyBytes';\nimport * as util from './util';\n\nexport type AllowList = (string | number)[];\nexport type Replacer = (this: unknown, key: string, value: unknown) => unknown;\n/* `space` accepts boxed `String`/`Number` objects (e.g. `new Number(2)`) as well\n * as primitives, matching JSON5; getGap unwraps them at runtime. The wrapper\n * object types are deliberate here, not the mistake the lint rule guards against. */\n// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types\nexport type Space = string | number | String | Number | null;\nexport type StringifyQuoteOptions = {\n  quote?: string,\n  quoteNames?: boolean,\n};\n/* `pureJson` is mutually exclusive with the output-shaping options it subsumes.\n * Because it overrides all of them at serialize time, the type forbids passing\n * any of them alongside `pureJson: true`, so a caller can't set an option that\n * would be silently ignored. `raw`/`maxDepth` (and `space`/`replacer` on\n * `StringifyOptions`) are orthogonal to JSON validity and stay allowed in both\n * arms. The two helper shapes are inlined to keep the public d.ts surface to\n * just `StringifyQuoteOptions`/`Stringify11Options`/`StringifyOptions`. */\nexport type Stringify11Options = {\n  /* Byte-mode output. When true, `stringify` returns a Uint8Array instead of a\n   * string, and recognizes `RawValue`/`RawString` nodes which it injects as raw\n   * bytes (pre-escaped, spliced verbatim, or escaped from raw bytes) so a secret\n   * can reach the output buffer without ever becoming a JS String.\n   */\n  raw?: boolean,\n  /* Maximum nesting depth the serializer will descend before throwing. Both the\n   * string and byte serializers recurse once per nesting level, so a\n   * deeply-nested value can overflow the JS call stack; this bounds it.\n   * Defaults to util.MAX_DEPTH_DEFAULT. */\n  maxDepth?: number,\n} & (\n  | (StringifyQuoteOptions & {\n    /* Allow serializing BigInt values as <num>n.\n     * When undefined or true, BigInt values are serialized with the `n` suffix.\n     * When false, the `n` suffix is not included after the long numeral.\n     */\n    withBigInt?: boolean,\n    /* Add a trailing comma to arrays and objects, like JSON5.\n     * Applicable only when space is used for indenting.\n     */\n    trailingComma?: boolean,\n    /* Use legacy escape sequences, like JSON5.\n     * When true, \\v, \\0, and \\x0-\\x19 will be serialized as \\v, \\0, and \\x0-\\x19\n     * When undefined or false, \\v, \\0, and \\x0-\\x19 will be serialized as \\u000b, \\u0000, and \\u0000-\\u0019\n     */\n    withLegacyEscapes?: boolean,\n    /* How to serialize the non-finite numbers Infinity, -Infinity, and NaN, none\n     * of which is valid JSON.\n     *   'literal' (default) — emit them verbatim (`Infinity`/`-Infinity`/`NaN`),\n     *     valid JSON11 but invalid JSON. This is the historical behavior.\n     *   'null'    — emit `null` instead, matching the global `JSON.stringify`, so\n     *     the output is valid JSON.\n     *   'throw'   — throw a TypeError rather than emit an invalid value.\n     * Finite numbers are unaffected. */\n    nonFinite?: 'literal' | 'null' | 'throw',\n    /* Emit strict, valid JSON. When true this overrides the other output-shaping\n     * options: double quotes, quoted property names, BigInt as a bare integer\n     * (valid JSON number text — a consumer reading it as a double may lose\n     * precision), non-finite numbers as `null`, no legacy escapes, and no\n     * trailing comma. `space` is left untouched (indentation is valid JSON).\n     * Use this instead of composing the individual flags by hand. */\n    pureJson?: false,\n  })\n  | {\n    /* When `pureJson` is true the output-shaping options it overrides are\n     * forbidden, so none is set only to be silently ignored. */\n    quote?: never,\n    quoteNames?: never,\n    withBigInt?: never,\n    trailingComma?: never,\n    withLegacyEscapes?: never,\n    nonFinite?: never,\n    pureJson: true,\n  }\n);\nexport type StringifyOptions = Stringify11Options & {\n  replacer?: Replacer | AllowList | null,\n  space?: Space,\n};\n\n/* The hooks a value may define to customize its own serialization, honored in\n * the order toJSON11 > toJSON5 > toJSON. */\ninterface ToJsonHooks {\n  toJSON11?: (key: string) => unknown;\n  toJSON5?: (key: string) => unknown;\n  toJSON?: (key: string) => unknown;\n}\n\n/* A value that holds the property being serialized: the synthetic `{ '': value }`\n * root, a parsed object, or an array indexed by stringified position. */\ntype Holder = { [key: string]: unknown };\n\nexport function stringify(\n  value: unknown,\n  options: StringifyOptions & { raw: true },\n): Uint8Array | undefined;\n\nexport function stringify(\n  value: unknown,\n  options?: StringifyOptions,\n): string | undefined;\n\nexport function stringify(\n  value: unknown,\n  replacer: Replacer | null | undefined,\n  space: Space | undefined,\n  options: Stringify11Options & { raw: true },\n): Uint8Array | undefined;\n\nexport function stringify(\n  value: unknown,\n  replacer?: Replacer | null,\n  space?: Space,\n  options?: Stringify11Options,\n): string | undefined;\n\nexport function stringify(\n  value: unknown,\n  allowList: AllowList,\n  space: Space | undefined,\n  options: Stringify11Options & { raw: true },\n): Uint8Array | undefined;\n\nexport function stringify(\n  value: unknown,\n  allowList?: AllowList,\n  space?: Space,\n  options?: Stringify11Options,\n): string | undefined;\n\nexport function stringify(\n  value: unknown,\n  replacerOrAllowListOrOptions?: Replacer | StringifyOptions | AllowList | null,\n  space?: Space,\n  options?: Stringify11Options,\n): string | undefined | Uint8Array {\n  /* Open-ancestor set for cycle detection: membership is O(1) so a deeply\n   * nested value does not pay an O(depth) scan per node. Set.has uses\n   * SameValueZero, identical object identity to the prior Array.includes. */\n  const stack = new Set<object>();\n  let indent = '';\n  let propertyList: string[] | undefined;\n  let replacer: Replacer | undefined;\n  let gap = '';\n  let quote: string | undefined;\n  let withBigInt: boolean | undefined;\n  let withLegacyEscapes: boolean | undefined;\n  let quoteNames: boolean = false;\n  let trailingComma: string = '';\n  let nonFinite: 'literal' | 'null' | 'throw' = 'literal';\n  let pureJson: boolean;\n  let raw: boolean;\n  let maxDepth: number = util.MAX_DEPTH_DEFAULT;\n\n  const quoteWeights: Record<string, number> = {\n    '\\'': 0.1,\n    '\"': 0.2,\n  };\n\n  if (\n    // replacerOrAllowListOrOptions is StringifyOptions\n    replacerOrAllowListOrOptions != null &&\n    typeof replacerOrAllowListOrOptions === 'object' &&\n    !Array.isArray(replacerOrAllowListOrOptions)\n  ) {\n    gap = getGap(replacerOrAllowListOrOptions.space);\n    if (replacerOrAllowListOrOptions.trailingComma) {\n      trailingComma = ',';\n    }\n    quote = replacerOrAllowListOrOptions.quote?.trim?.();\n    if (replacerOrAllowListOrOptions.quoteNames === true) {\n      quoteNames = true;\n    }\n    if (typeof replacerOrAllowListOrOptions.replacer === 'function') {\n      replacer = replacerOrAllowListOrOptions.replacer;\n    }\n    withBigInt = replacerOrAllowListOrOptions.withBigInt;\n    withLegacyEscapes = replacerOrAllowListOrOptions.withLegacyEscapes === true;\n    nonFinite = replacerOrAllowListOrOptions.nonFinite ?? 'literal';\n    pureJson = replacerOrAllowListOrOptions.pureJson === true;\n    raw = replacerOrAllowListOrOptions.raw === true;\n    maxDepth = replacerOrAllowListOrOptions.maxDepth ?? util.MAX_DEPTH_DEFAULT;\n  } else {\n    if (\n      // replacerOrAllowListOrOptions is Replacer\n      typeof replacerOrAllowListOrOptions === 'function'\n    ) {\n      replacer = replacerOrAllowListOrOptions;\n    } else if (\n      // replacerOrAllowListOrOptions is AllowList\n      Array.isArray(replacerOrAllowListOrOptions)\n    ) {\n      propertyList = [];\n      const propertySet: Set<string> = new Set();\n      for (const v of replacerOrAllowListOrOptions) {\n        const key = v?.toString?.();\n        if (key !== undefined) propertySet.add(key);\n      }\n      propertyList = [...propertySet];\n    }\n\n    gap = getGap(space);\n    quote = options?.quote?.trim?.();\n    if (options?.quoteNames === true) {\n      quoteNames = true;\n    }\n    withBigInt = options?.withBigInt;\n    withLegacyEscapes = options?.withLegacyEscapes === true;\n    if (options?.trailingComma) {\n      trailingComma = ',';\n    }\n    nonFinite = options?.nonFinite ?? 'literal';\n    pureJson = options?.pureJson === true;\n    raw = options?.raw === true;\n    maxDepth = options?.maxDepth ?? util.MAX_DEPTH_DEFAULT;\n  }\n\n  /* Evaluated last so it wins over every other output-shaping option: force the\n   * settings that make the output strict, valid JSON. `space`/`maxDepth`/\n   * `replacer` are orthogonal to JSON validity and left as the caller set them. */\n  if (pureJson) {\n    quote = '\"';\n    quoteNames = true;\n    withBigInt = false;\n    withLegacyEscapes = false;\n    trailingComma = '';\n    nonFinite = 'null';\n  }\n\n  const quoteReplacements = buildQuoteReplacements(withLegacyEscapes);\n  const quoteReplacementForNulFollowedByDigit = nulFollowedByDigitReplacement(withLegacyEscapes);\n\n  const quoteContext: QuoteContext = {\n    quoteWeights,\n    quote,\n    quoteReplacements,\n    nulFollowedByDigit: quoteReplacementForNulFollowedByDigit,\n    withLegacyEscapes,\n  };\n\n  const nameSerializer = (key: string): string =>\n    quoteNames ? quoteString(key, quoteContext) : serializeKey(key, quoteContext);\n\n  if (raw) {\n    return serializeToBytes(value, {\n      gap,\n      trailingComma,\n      quoteContext,\n      quoteNames,\n      replacer,\n      propertyList,\n      withBigInt,\n      nonFinite,\n      maxDepth,\n    });\n  }\n\n  return serializeProperty('', { '': value });\n\n  function getGap(space?: Space) {\n    if (typeof space === 'number' || space instanceof Number) {\n      const num = Number(space);\n      if (isFinite(num) && num > 0) {\n        return ' '.repeat(Math.min(10, Math.floor(num)));\n      }\n    } else if (typeof space === 'string' || space instanceof String) {\n      return space.substring(0, 10);\n    }\n\n    return '';\n  }\n\n  function serializeProperty(key: string, holder: Holder): string | undefined {\n    let value: unknown = holder[key];\n\n    if (value instanceof RawValue || value instanceof RawString) {\n      throw new TypeError('JSON11: RawValue/RawString can only be serialized in byte mode; use stringify(value, { raw: true })');\n    }\n\n    if (value != null) {\n      const hooks = value as ToJsonHooks;\n      if (typeof hooks.toJSON11 === 'function') {\n        value = hooks.toJSON11(key);\n      } else if (typeof hooks.toJSON5 === 'function') {\n        value = hooks.toJSON5(key);\n      } else if (typeof hooks.toJSON === 'function') {\n        value = hooks.toJSON(key);\n      }\n    }\n\n    if (replacer) {\n      value = replacer.call(holder, key, value);\n    }\n\n    if (value instanceof Number) {\n      value = Number(value);\n    } else if (value instanceof String) {\n      value = String(value);\n    } else if (value instanceof Boolean) {\n      value = value.valueOf();\n    }\n\n    switch (value) {\n      case null:\n        return 'null';\n      case true:\n        return 'true';\n      case false:\n        return 'false';\n    }\n\n    if (typeof value === 'string') {\n      return quoteString(value, quoteContext);\n    }\n\n    if (typeof value === 'number') {\n      if (!isFinite(value) && nonFinite !== 'literal') {\n        if (nonFinite === 'throw') {\n          throw new TypeError(`Cannot serialize non-finite number ${String(value)} as JSON`);\n        }\n        return 'null';\n      }\n      return String(value);\n    }\n\n    if (typeof value === 'bigint') {\n      return value.toString() + (withBigInt === false ? '' : 'n');\n    }\n\n    if (typeof value === 'object' && value !== null) {\n      return Array.isArray(value) ? serializeArray(value) : serializeObject(value);\n    }\n\n    return undefined;\n  }\n\n  function serializeObject(value: object): string {\n    if (stack.has(value)) {\n      throw TypeError('Converting circular structure to JSON11');\n    }\n    if (stack.size >= maxDepth) {\n      throw TypeError(`JSON11: maximum nesting depth ${maxDepth} exceeded`);\n    }\n\n    stack.add(value);\n\n    const stepback = indent;\n    indent = indent + gap;\n\n    const keys = propertyList || Object.keys(value);\n    const partial: string[] = [];\n    for (const key of keys) {\n      const propertyString = serializeProperty(key, value as Holder);\n      if (propertyString !== undefined) {\n        let member = nameSerializer(key) + ':';\n        if (gap !== '') {\n          member += ' ';\n        }\n        member += propertyString;\n        partial.push(member);\n      }\n    }\n\n    let final: string;\n    if (partial.length === 0) {\n      final = '{}';\n    } else {\n      let properties: string;\n      if (gap === '') {\n        properties = partial.join(',');\n        final = '{' + properties + '}';\n      } else {\n        properties = partial.join(',\\n' + indent);\n        final = '{\\n' + indent + properties + trailingComma + '\\n' + stepback + '}';\n      }\n    }\n\n    stack.delete(value);\n    indent = stepback;\n    return final;\n  }\n\n  function serializeArray(value: unknown[]): string {\n    if (stack.has(value)) {\n      throw TypeError('Converting circular structure to JSON11');\n    }\n    if (stack.size >= maxDepth) {\n      throw TypeError(`JSON11: maximum nesting depth ${maxDepth} exceeded`);\n    }\n\n    stack.add(value);\n\n    const stepback = indent;\n    indent = indent + gap;\n\n    const partial: string[] = [];\n    for (let i = 0; i < value.length; i++) {\n      const propertyString = serializeProperty(String(i), value as unknown as Holder);\n      partial.push((propertyString !== undefined) ? propertyString : 'null');\n    }\n\n    let final: string;\n    if (partial.length === 0) {\n      final = '[]';\n    } else {\n      if (gap === '') {\n        const properties = partial.join(',');\n        final = '[' + properties + ']';\n      } else {\n        const properties = partial.join(',\\n' + indent);\n        final = '[\\n' + indent + properties + trailingComma + '\\n' + stepback + ']';\n      }\n    }\n\n    stack.delete(value);\n    indent = stepback;\n    return final;\n  }\n}\n","import { parse } from './parse';\nimport { stringify } from './stringify';\nimport { RawString, RawValue, unsafeEncodeAsJSON } from './raw';\n\nexport {\n  parse,\n  stringify,\n  RawString,\n  RawValue,\n  unsafeEncodeAsJSON,\n}\n\n/* Also expose a default export so consumers can use any import style:\n *   import JSON11 from 'json11'         (default)\n *   import * as JSON11 from 'json11'    (namespace)\n *   import { parse } from 'json11'      (named)\n *   const JSON11 = require('json11')    (CJS)\n */\nexport default {\n  parse,\n  stringify,\n  RawString,\n  RawValue,\n  unsafeEncodeAsJSON,\n};\n"],"mappings":"AAUA,IAIA,IAAe;CAAE,iBAJc;CAIG,UAHV;CAGoB,aAFjB;AAAA,GCMd,KAAoB,MACX,OAAN,KAAM,YAAY,EAAQ,gBAAgB,KAAK,CAAA,GAGlD,KAAiB,MACR,OAAN,KAAM,aACjB,KAAK,OAAO,KAAK,OACjB,KAAK,OAAO,KAAK,OACjB,MAAM,OAAS,MAAM,OACtB,EAAQ,SAAS,KAAK,CAAA,IAIb,KAAoB,MACX,OAAN,KAAM,aACjB,KAAK,OAAO,KAAK,OACjB,KAAK,OAAO,KAAK,OACjB,KAAK,OAAO,KAAK,OACjB,MAAM,OAAS,MAAM,OACrB,MAAM,OAAc,MAAM,OAC3B,EAAQ,YAAY,KAAK,CAAA,IAIhB,KAAW,MACF,OAAN,KAAM,YAAY,QAAQ,KAAK,CAAA,GAGlC,KAAa,MACJ,OAAN,KAAM,YAAN,CAAmB,SAAS,KAAK,CAAA,GAGpC,KAAS,MACA,OAAN,KAAM,YAAY,gBAAgB,KAAK,CAAA,GAG1C,KAAc,MACL,OAAN,KAAM,YAAY,YAAY,KAAK,CAAA,GC5CtC,IAAb,MAAA;CACE;CACA,MAAc;CAEd,YAAY,IAAkB,IAAA;EAC5B,KAAK,MAAM,IAAI,WAAW,KAAK,IAAI,IAAI,CAAA,CAAA;CACzC;CAEA,IAAA,SAAI;EACF,OAAO,KAAK;CACd;CAEA,OAAe,GAAA;EACb,IAAM,IAAS,KAAK,MAAM;EAC1B,IAAI,KAAU,KAAK,IAAI,QACrB;EAEF,IAAI,IAAyB,IAAlB,KAAK,IAAI;EACpB,OAAO,IAAO,IACZ,KAAQ;EAEV,IAAM,IAAQ,IAAI,WAAW,CAAA;EAC7B,EAAM,IAAI,KAAK,IAAI,SAAS,GAAG,KAAK,GAAA,CAAA,GACpC,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