[
  {
    "path": ".eslintignore",
    "content": "**/node_modules/*\nbin/*\ncli/wrappers/*\ncoverage/*\ndist/*\ndocs/*\nlib/deep-equal/*\nlib/prelude.js\nlib/polyfill.js\nlib/tape-adapter.js\nlib/tsd-jsdoc/*\nlib/*/tests/*\nsandbox/*\nscripts/*\ntests/*\n"
  },
  {
    "path": ".gitattributes",
    "content": "bin/* text eol=lf\ndist/* binary\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE.md",
    "content": "protobuf.js version: <please fill in>\n\n<please describe the expected and actual behavior>\n\n```js\n<please provide a code snippet for reproduction>\n```\n\n```\n<please paste the stack trace of the error if applicable>\n```\n"
  },
  {
    "path": ".github/workflows/release.yaml",
    "content": "on:\n  push:\n    branches:\n      - master\nname: release-please\njobs:\n  release-please:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: google-github-actions/release-please-action@v3\n        with:\n          command: manifest\n          package-name: release-please-action\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "name: \"Test\"\non:\n  push:\n    branches:\n    - master\n  pull_request:\n    types: [assigned, opened, synchronize, reopened, labeled]\njobs:\n  lint:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v1\n    - uses: actions/setup-node@v1\n      with:\n        node-version: \"12\"\n    - name: \"Install dependencies\"\n      run: npm install\n    - name: \"Lint sources\"\n      run: npm run lint:sources -- --max-warnings 0\n    - name: \"Lint types\"\n      run: npm run lint:types\n  test:\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        node_version: [\"12\", \"14\", \"16\", \"18\"]\n    steps:\n    - uses: actions/checkout@v1\n    - uses: actions/setup-node@v1\n      with:\n        node-version: ${{ matrix.node_version }}\n    - name: \"Install dependencies\"\n      run: npm install\n    - name: \"Test sources\"\n      run: npm run test:sources\n    - name: \"Test types\"\n      run: npm run test:types\n  bench:\n    runs-on: ubuntu-latest\n    steps:\n    - uses: actions/checkout@v1\n    - uses: actions/setup-node@v1\n      with:\n        node-version: \"12\"\n    - name: \"Install dependencies\"\n      run: npm install\n    - name: \"Run benchmark\"\n      run: npm run bench\n"
  },
  {
    "path": ".gitignore",
    "content": ".nyc_output\n.vscode\n*.log\nnpm-debug.*\nnode_modules/\ncli/node_modules/\ncli/package-lock.json\ndocs/\ncoverage/\nsandbox/\n.nyc_output\ndist/\n.gitpod.yml\n"
  },
  {
    "path": ".release-please-manifest.json",
    "content": "{\".\":\"8.0.1\",\"cli\":\"2.0.1\"}\n"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Changelog\n\n## [8.0.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v8.0.0...protobufjs-v8.0.1) (2026-03-11)\n\n\n### Bug Fixes\n\n* bump protobufjs dependency version for cli package ([#2128](https://github.com/protobufjs/protobuf.js/issues/2128)) ([549b05e](https://github.com/protobufjs/protobuf.js/commit/549b05ecd95e23da40fa1a36a9336c57946b8377))\n* correct json syntax in tsconfig.json ([#2120](https://github.com/protobufjs/protobuf.js/issues/2120)) ([8065625](https://github.com/protobufjs/protobuf.js/commit/80656255c75000f3e954e036cdfcb5bfd0a8c687))\n* **descriptor:** guard oneof index for non-Type parents ([#2122](https://github.com/protobufjs/protobuf.js/issues/2122)) ([1cac5cf](https://github.com/protobufjs/protobuf.js/commit/1cac5cf811d0855b27dcde73a3a04d15efde3728))\n* do not allow setting __proto__ in Message constructor ([#2126](https://github.com/protobufjs/protobuf.js/issues/2126)) ([f05e3c3](https://github.com/protobufjs/protobuf.js/commit/f05e3c3bdd0b3c2cddbf8540bb5bd4d394a693ad))\n* filter invalid characters from the type name ([#2127](https://github.com/protobufjs/protobuf.js/issues/2127)) ([535df44](https://github.com/protobufjs/protobuf.js/commit/535df444ac060243722ac5d672db205e5c531d75))\n\n## [8.0.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.4...protobufjs-v8.0.0) (2025-12-16)\n\n\n### ⚠ BREAKING CHANGES\n\n* add Edition 2024 Support ([#2060](https://github.com/protobufjs/protobuf.js/issues/2060))\n\n### Features\n\n* add Edition 2024 Support ([#2060](https://github.com/protobufjs/protobuf.js/issues/2060)) ([53e8492](https://github.com/protobufjs/protobuf.js/commit/53e8492cbaae2c741801fa50b5f908ff5129c3d7))\n\n## [7.5.4](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.3...protobufjs-v7.5.4) (2025-08-15)\n\n\n### Bug Fixes\n\n* invalid syntax in descriptor.proto ([#2092](https://github.com/protobufjs/protobuf.js/issues/2092)) ([5a3769a](https://github.com/protobufjs/protobuf.js/commit/5a3769a465fead089a533ad55c21d069299df760))\n\n## [7.5.3](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.2...protobufjs-v7.5.3) (2025-05-28)\n\n\n### Bug Fixes\n\n* descriptor extensions handling post-editions ([#2075](https://github.com/protobufjs/protobuf.js/issues/2075)) ([6e255d4](https://github.com/protobufjs/protobuf.js/commit/6e255d4ad6982cc857f26e1731c2cedcf5796f68))\n\n## [7.5.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.1...protobufjs-v7.5.2) (2025-05-14)\n\n\n### Bug Fixes\n\n* ensure that types are always resolved ([#2068](https://github.com/protobufjs/protobuf.js/issues/2068)) ([4b51cb2](https://github.com/protobufjs/protobuf.js/commit/4b51cb2b8450b77f9f5de1c562e7fae93b19d040))\n\n## [7.5.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.0...protobufjs-v7.5.1) (2025-05-08)\n\n\n### Bug Fixes\n\n* optimize regressions from editions implementations ([#2066](https://github.com/protobufjs/protobuf.js/issues/2066)) ([6406d4c](https://github.com/protobufjs/protobuf.js/commit/6406d4c18afae309fc7b5f4a24d9674d85da180b))\n* reserved field inside group blocks fail parsing ([#2058](https://github.com/protobufjs/protobuf.js/issues/2058)) ([56782bf](https://github.com/protobufjs/protobuf.js/commit/56782bff0c4b5132806eb1a6bc4d08f930c4aaad))\n\n## [7.5.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.4.0...protobufjs-v7.5.0) (2025-04-15)\n\n\n### Features\n\n* add Edition 2023 Support ([f04ded3](https://github.com/protobufjs/protobuf.js/commit/f04ded3a03a3ddd383f0228e2fe2627a51f31aa3))\n* add Edition 2023 Support ([ac9a3b9](https://github.com/protobufjs/protobuf.js/commit/ac9a3b9fe3134d48187e41b08d54ffaceddc6c1b))\n* add Edition 2023 Support ([e5ca5c8](https://github.com/protobufjs/protobuf.js/commit/e5ca5c84e326699e10258367883a54934e0bfe14))\n* add Edition 2023 Support ([a84409b](https://github.com/protobufjs/protobuf.js/commit/a84409b47f9ba0dba56da1af8054fb54f85d85a1))\n* add Edition 2023 Support ([9c5a178](https://github.com/protobufjs/protobuf.js/commit/9c5a178c4b59e0aa65ecac0bd7420171213b2ff9))\n* add Edition 2023 Support ([b2c6867](https://github.com/protobufjs/protobuf.js/commit/b2c686721e3b63d092419fa1cbe58e1deb89534e))\n* add Edition 2023 Support ([60f3e51](https://github.com/protobufjs/protobuf.js/commit/60f3e51087ca2c247473410f39331e1c766aefef))\n* add Edition 2023 Support ([a656361](https://github.com/protobufjs/protobuf.js/commit/a6563617de04d510d6e8865eb6c5067f10247f64))\n* add Edition 2023 Support ([869a95b](https://github.com/protobufjs/protobuf.js/commit/869a95b1e5f553c76243aac45619061407a41084))\n* add Edition 2023 Support ([b936af4](https://github.com/protobufjs/protobuf.js/commit/b936af4219181811e98f72d4902a40e1c3f1f3be))\n* add Edition 2023 Support ([a938467](https://github.com/protobufjs/protobuf.js/commit/a938467e476b3e168b8df1b89452864731e6a373))\n* add Edition 2023 Support ([1af8454](https://github.com/protobufjs/protobuf.js/commit/1af8454538b63d58b822ea9d20b935f2ac9f158c))\n* add Edition 2023 Support ([785416f](https://github.com/protobufjs/protobuf.js/commit/785416fd2b9827e4cb9bfccd823c3b6836baffb0))\n* add feature resolution ([a9ffc8a](https://github.com/protobufjs/protobuf.js/commit/a9ffc8a7b593209642fc9d89e884ac6c4e746494))\n* add feature resolution and tests ([68b5339](https://github.com/protobufjs/protobuf.js/commit/68b5339ea1936c90f526983da29b4267d20f9a51))\n* add feature resolution for protobuf editions ([547afa2](https://github.com/protobufjs/protobuf.js/commit/547afa26f76e22e5463a17aec082b0b60cd951d8))\n* add feature resolution for protobuf editions ([65d3ed1](https://github.com/protobufjs/protobuf.js/commit/65d3ed15e3c3ffd41b488aaa2eb8aa53026419b9))\n* api_converters_editions tests added and run successfully\" ([b4b5ca4](https://github.com/protobufjs/protobuf.js/commit/b4b5ca468fcde2082d65a72b508f18d07d75245c))\n* increase size of file that protobufjs CLI can process ([00d5f1a](https://github.com/protobufjs/protobuf.js/commit/00d5f1aca4d7959068f52fd11767c21b483e75bb))\n* increase size of file that protobufjs CLI can process ([d36ef0f](https://github.com/protobufjs/protobuf.js/commit/d36ef0faeae9a9ec655747cb650571bdd9b1243b))\n\n\n### Bug Fixes\n\n* change tree traversal order and feature resolution algorithm ([d2d47d9](https://github.com/protobufjs/protobuf.js/commit/d2d47d9e4fbe754d3f83fd2608d93ef0daa43658))\n* remove eval usage so that chrome extension MV3 can run properly ([#1941](https://github.com/protobufjs/protobuf.js/issues/1941)) ([f2ccb99](https://github.com/protobufjs/protobuf.js/commit/f2ccb999220ee596d68c80b36265e5ee4ec877b3))\n\n## [7.4.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.3.3...protobufjs-v7.4.0) (2024-08-22)\n\n\n### Features\n\n* Add `prepublishOnly` script ([0e4da8b](https://github.com/protobufjs/protobuf.js/commit/0e4da8b158a85af5160e2f4ba5eb097a8dc65cb1))\n\n\n### Bug Fixes\n\n* include ([28e3334](https://github.com/protobufjs/protobuf.js/commit/28e333415d3c85687810e164125997d17baba0bd))\n\n## [7.3.3](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.3.2...protobufjs-v7.3.3) (2024-08-16)\n\n\n### Bug Fixes\n\n* handle nullability for optional fields ([59569c1](https://github.com/protobufjs/protobuf.js/commit/59569c12c85c1c7b783ace9a71775b1d05a08e9c))\n\n## [7.3.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.3.1...protobufjs-v7.3.2) (2024-06-12)\n\n\n### Bug Fixes\n\n* **docs:** Update readme to correct command for creating types ([#1939](https://github.com/protobufjs/protobuf.js/issues/1939)) ([0f9d477](https://github.com/protobufjs/protobuf.js/commit/0f9d4770e0fb360c767241a13696d73edc6536b7))\n\n## [7.3.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.3.0...protobufjs-v7.3.1) (2024-06-05)\n\n\n### Bug Fixes\n\n* **types:** reserved field in IType can contain reserved names ([#2001](https://github.com/protobufjs/protobuf.js/issues/2001)) ([d1d2c0c](https://github.com/protobufjs/protobuf.js/commit/d1d2c0c7890e07ca1302c83a136051ee0624cba8))\n\n## [7.3.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.6...protobufjs-v7.3.0) (2024-05-10)\n\n\n### Features\n\n* add handling for extension range options ([#1990](https://github.com/protobufjs/protobuf.js/issues/1990)) ([2d58011](https://github.com/protobufjs/protobuf.js/commit/2d58011cc0bc495c68ed70f5aad297deb1722378))\n\n## [7.2.6](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.5...protobufjs-v7.2.6) (2024-01-16)\n\n\n### Bug Fixes\n\n* report missing import properly in loadSync ([#1960](https://github.com/protobufjs/protobuf.js/issues/1960)) ([af3ff83](https://github.com/protobufjs/protobuf.js/commit/af3ff83dc41c7736b7e57f2a02fd94ac03b76a4c))\n\n## [7.2.5](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.4...protobufjs-v7.2.5) (2023-08-21)\n\n\n### Bug Fixes\n\n* crash in comment parsing ([#1890](https://github.com/protobufjs/protobuf.js/issues/1890)) ([eaf9f0a](https://github.com/protobufjs/protobuf.js/commit/eaf9f0a5a4009a8981c69af78365dfc988ed925b))\n* deprecation warning for new Buffer ([#1905](https://github.com/protobufjs/protobuf.js/issues/1905)) ([e93286e](https://github.com/protobufjs/protobuf.js/commit/e93286ef70d2e673c341ac08a192cc2abe6fd2eb))\n* possible infinite loop when parsing option ([#1923](https://github.com/protobufjs/protobuf.js/issues/1923)) ([f2a8620](https://github.com/protobufjs/protobuf.js/commit/f2a86201799af5842e1339c22950abbb3db00f51))\n\n## [7.2.4](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.3...protobufjs-v7.2.4) (2023-06-23)\n\n\n### Bug Fixes\n\n* do not let setProperty change the prototype ([#1899](https://github.com/protobufjs/protobuf.js/issues/1899)) ([e66379f](https://github.com/protobufjs/protobuf.js/commit/e66379f451b0393c27d87b37fa7d271619e16b0d))\n\n## [7.2.3](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.2...protobufjs-v7.2.3) (2023-03-27)\n\n\n### Bug Fixes\n\n* type names can be split into multiple tokens ([#1877](https://github.com/protobufjs/protobuf.js/issues/1877)) ([8817ee6](https://github.com/protobufjs/protobuf.js/commit/8817ee613dfcf55f7f6fa8704f3fdd3e68c0e1d8))\n\n## [7.2.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.1...protobufjs-v7.2.2) (2023-02-07)\n\n\n### Bug Fixes\n\n* do not allow to extend same field twice to prevent the error ([#1784](https://github.com/protobufjs/protobuf.js/issues/1784)) ([14f0536](https://github.com/protobufjs/protobuf.js/commit/14f05364a04fe1ca0bfb278b3407e058c6b5a1ab))\n\n## [7.2.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.2.0...protobufjs-v7.2.1) (2023-02-02)\n\n\n### Bug Fixes\n\n* **cli:** fix relative path to Google pb files ([#1859](https://github.com/protobufjs/protobuf.js/issues/1859)) ([e42eea4](https://github.com/protobufjs/protobuf.js/commit/e42eea4868b11f4a07934804a56683321ed191e2))\n* Revert \"fix: error should be thrown\" ([4489fa7](https://github.com/protobufjs/protobuf.js/commit/4489fa771464bcb49b57149760e9cc4131e8077e))\n* use bundled filename to fix common pb includes ([#1860](https://github.com/protobufjs/protobuf.js/issues/1860)) ([dce9a2e](https://github.com/protobufjs/protobuf.js/commit/dce9a2ef92d363752e40b295b0da9bd178f82e83))\n* use ES5 style function syntax ([#1830](https://github.com/protobufjs/protobuf.js/issues/1830)) ([64e8936](https://github.com/protobufjs/protobuf.js/commit/64e8936ad9f73c68b3fa1e57857dd38323b5a745))\n\n## [7.2.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.1.2...protobufjs-v7.2.0) (2023-01-24)\n\n\n### Features\n\n* **cli:** generate static files at the granularity of proto messages ([#1840](https://github.com/protobufjs/protobuf.js/issues/1840)) ([32f2d6a](https://github.com/protobufjs/protobuf.js/commit/32f2d6a68b27997bd0f7619998695a9fa7a4fd70))\n\n\n### Bug Fixes\n\n* error should be thrown ([#1817](https://github.com/protobufjs/protobuf.js/issues/1817)) ([e7a3489](https://github.com/protobufjs/protobuf.js/commit/e7a34897a122342485468999a507626f1ea91507))\n\n## [7.1.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.1.1...protobufjs-v7.1.2) (2022-09-22)\n\n\n### Bug Fixes\n\n* **types:** nested object can be a oneof ([#1812](https://github.com/protobufjs/protobuf.js/issues/1812)) ([119d90a](https://github.com/protobufjs/protobuf.js/commit/119d90aa1ce14d7bff20bb1dcc1ddc4544a80c23))\n\n## [7.1.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.1.0...protobufjs-v7.1.1) (2022-09-09)\n\n\n### Bug Fixes\n\n* add import long to the generated .d.ts ([#1802](https://github.com/protobufjs/protobuf.js/issues/1802)) ([7c27b5a](https://github.com/protobufjs/protobuf.js/commit/7c27b5ad5d161c9f3711aa053ca704f8e1224e90))\n* generate valid js code for aliased enum values ([#1801](https://github.com/protobufjs/protobuf.js/issues/1801)) ([7120e93](https://github.com/protobufjs/protobuf.js/commit/7120e93b7980728614779c50f40877da57e3cf37))\n\n## [7.1.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.0.0...protobufjs-v7.1.0) (2022-08-26)\n\n\n### Features\n\n* accept unknown enum values in fromObject ([#1793](https://github.com/protobufjs/protobuf.js/issues/1793)) ([ef24ae4](https://github.com/protobufjs/protobuf.js/commit/ef24ae4e93cf8635ff38398b37f3597e5d478330))\n* valuesOptions for enums ([#1358](https://github.com/protobufjs/protobuf.js/issues/1358)) ([bb6b1d4](https://github.com/protobufjs/protobuf.js/commit/bb6b1d4942d924bcb4ee3ad15f4823f2d9c1ab22))\n\n\n### Bug Fixes\n\n* **deps:** update dependency glob to v8 ([#1750](https://github.com/protobufjs/protobuf.js/issues/1750)) ([8303a64](https://github.com/protobufjs/protobuf.js/commit/8303a648bc12dcea5aa8e7efa042de39011857f9))\n* extensions broke oneof ([#1789](https://github.com/protobufjs/protobuf.js/issues/1789)) ([d7f501c](https://github.com/protobufjs/protobuf.js/commit/d7f501c49d523cda423a3ab8bcaeb59a0216b350))\n* remove unused `@types/long` ([#1785](https://github.com/protobufjs/protobuf.js/issues/1785)) ([0f4af83](https://github.com/protobufjs/protobuf.js/commit/0f4af83e4ed3cef1ec035c2833e0b06cab0bd87f))\n* support for nested messages and enums within group blocks ([#1790](https://github.com/protobufjs/protobuf.js/issues/1790)) ([f36d4e4](https://github.com/protobufjs/protobuf.js/commit/f36d4e4a2df809b47ff85f87aba319b86be90878))\n* **types:** update type deps ([#1776](https://github.com/protobufjs/protobuf.js/issues/1776)) ([d87978b](https://github.com/protobufjs/protobuf.js/commit/d87978b8eb2a176676c58379a89206b94a6d926a))\n\n## [7.0.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v6.0.0...protobufjs-v7.0.0) (2022-07-08)\n\n\n### ⚠ BREAKING CHANGES\n\n* drop support for Node 4, 6, 8, 10 (#1764)\n* move command line tool to a new package named protobufjs-cli (#1234)\n* encoding of empty Buffers (#1514)\n\n### Features\n\n* add --no-service option for pbjs static target ([#1577](https://github.com/protobufjs/protobuf.js/issues/1577)) ([d01394a](https://github.com/protobufjs/protobuf.js/commit/d01394a1463062824c066b653aad53c449752202))\n* add alt-comment CLI option ([#1692](https://github.com/protobufjs/protobuf.js/issues/1692)) ([7558ef0](https://github.com/protobufjs/protobuf.js/commit/7558ef0f93177978272f68f1710144a26b63e525))\n* add configurable Root.prototype.fetch ([ad3cffd](https://github.com/protobufjs/protobuf.js/commit/ad3cffdc5a54a7c94830674270d3386e1a2b58fc))\n* add getTypeUrl method to generated code ([#1463](https://github.com/protobufjs/protobuf.js/issues/1463)) ([d13d5d5](https://github.com/protobufjs/protobuf.js/commit/d13d5d5688052e366aa2e9169f50dfca376b32cf))\n* add null-defaults option ([#1611](https://github.com/protobufjs/protobuf.js/issues/1611)) ([6e713ba](https://github.com/protobufjs/protobuf.js/commit/6e713baf54bd987ae52cbf92a4f2742c70201dc0))\n* add support for buffer configuration ([#1372](https://github.com/protobufjs/protobuf.js/issues/1372)) ([101aa1a](https://github.com/protobufjs/protobuf.js/commit/101aa1a4f148516fdc83a74f54a229f06e24a5de))\n* allow message.getTypeUrl provide custom typeUrlPrefix ([#1762](https://github.com/protobufjs/protobuf.js/issues/1762)) ([8aad1dd](https://github.com/protobufjs/protobuf.js/commit/8aad1dd994b1fc1f23bd71adf3a81b7a5616b210))\n* better comment parse ([#1419](https://github.com/protobufjs/protobuf.js/issues/1419)) ([7fd2e18](https://github.com/protobufjs/protobuf.js/commit/7fd2e182150c9b6be9ba21e6450b6e4668ad9f82))\n* move command line tool to a new package named protobufjs-cli ([#1234](https://github.com/protobufjs/protobuf.js/issues/1234)) ([da34f43](https://github.com/protobufjs/protobuf.js/commit/da34f43ccd51ad97017e139f137521782f5ef119))\n* parsed options ([#1256](https://github.com/protobufjs/protobuf.js/issues/1256)) ([7a25398](https://github.com/protobufjs/protobuf.js/commit/7a2539843055b6daecb9f369c67a6cf588dbb54c))\n* prepare initial publication of cli ([#1752](https://github.com/protobufjs/protobuf.js/issues/1752)) ([64811d5](https://github.com/protobufjs/protobuf.js/commit/64811d5878c31e4a86a39da5fec6aea35da22fcd))\n* proto3 optional support ([#1584](https://github.com/protobufjs/protobuf.js/issues/1584)) ([6c4d307](https://github.com/protobufjs/protobuf.js/commit/6c4d30716a9a756dcdc21d64f9c9d069315fc5b1))\n* support parsing of complex options ([#1744](https://github.com/protobufjs/protobuf.js/issues/1744)) ([b1746a8](https://github.com/protobufjs/protobuf.js/commit/b1746a8c5e2b9c29644318090cc9e581f7e34b6e))\n* update dependencies / general cleanup ([#1356](https://github.com/protobufjs/protobuf.js/issues/1356)) ([42f49b4](https://github.com/protobufjs/protobuf.js/commit/42f49b43f692c24c2bc1ae081b4d1ad9fa173cd7))\n\n\n### Bug Fixes\n\n* allow for an optional semicolon where there is an optional comma in parseOptionValue ([#1571](https://github.com/protobufjs/protobuf.js/issues/1571)) ([af1b449](https://github.com/protobufjs/protobuf.js/commit/af1b449602b360091e191a58abde2f246d8b0f1d))\n* allow Windows unc paths to be resolved and normalized ([#1351](https://github.com/protobufjs/protobuf.js/issues/1351)) ([cd4aeda](https://github.com/protobufjs/protobuf.js/commit/cd4aeda8036f80cfa3b9f1db4096d856b2fd05fb))\n* **deps:** patch minimatch vulnerability ([#1704](https://github.com/protobufjs/protobuf.js/issues/1704)) ([bac61b8](https://github.com/protobufjs/protobuf.js/commit/bac61b8c2757804bbb9c5fa0f8bc6a7bcf0bb374))\n* **deps:** update dependency long to v5 ([#1751](https://github.com/protobufjs/protobuf.js/issues/1751)) ([dadc65e](https://github.com/protobufjs/protobuf.js/commit/dadc65e12d654f96daf83253476e55da35214904))\n* **deps:** use eslint 8.x ([#1728](https://github.com/protobufjs/protobuf.js/issues/1728)) ([fa01883](https://github.com/protobufjs/protobuf.js/commit/fa01883a0f756824d69ce92bfb012de05ff223ef))\n* do not fail if no process ([#1440](https://github.com/protobufjs/protobuf.js/issues/1440)) ([f2faa8c](https://github.com/protobufjs/protobuf.js/commit/f2faa8c32e918b3b843005f0419608b8e158998d))\n* do not let setProperty change the prototype ([#1731](https://github.com/protobufjs/protobuf.js/issues/1731)) ([3357ef7](https://github.com/protobufjs/protobuf.js/commit/3357ef753871b394b825d15429ceb27b26e24d63))\n* **docs:** update CHANGELOG to match format of release-please ([#1376](https://github.com/protobufjs/protobuf.js/issues/1376)) ([15ed8a0](https://github.com/protobufjs/protobuf.js/commit/15ed8a0fbe72b2e408b87ba25028f877796cc191))\n* drop support for Node 4, 6, 8, 10 ([#1764](https://github.com/protobufjs/protobuf.js/issues/1764)) ([50370dd](https://github.com/protobufjs/protobuf.js/commit/50370dd7747a0986e83ddbe51c54b97033af5ead))\n* encoding of empty Buffers ([#1514](https://github.com/protobufjs/protobuf.js/issues/1514)) ([b4cae07](https://github.com/protobufjs/protobuf.js/commit/b4cae07440387399e097058e15e50608a0e764fd)), closes [#1500](https://github.com/protobufjs/protobuf.js/issues/1500) [#885](https://github.com/protobufjs/protobuf.js/issues/885)\n* es6 export enum ([#1446](https://github.com/protobufjs/protobuf.js/issues/1446)) ([9f33784](https://github.com/protobufjs/protobuf.js/commit/9f33784350b1efc2e774bbfc087cbd2c47828748))\n* fix util.global ([#1441](https://github.com/protobufjs/protobuf.js/issues/1441)) ([742b8dc](https://github.com/protobufjs/protobuf.js/commit/742b8dcbc750f9c2659088cbd88ea61fd11b24a7))\n* fromObject should not initialize oneof members ([#1597](https://github.com/protobufjs/protobuf.js/issues/1597)) ([90afe44](https://github.com/protobufjs/protobuf.js/commit/90afe4412de8070b0c0681e5905a6e0213072a85))\n* google.protobuf.Any type_url fixes ([#1068](https://github.com/protobufjs/protobuf.js/issues/1068)) ([192f5f1](https://github.com/protobufjs/protobuf.js/commit/192f5f12d071fa534ac625290d4666c839a46a9e))\n* handling of map entries with omitted key or value ([#1348](https://github.com/protobufjs/protobuf.js/issues/1348)) ([b950877](https://github.com/protobufjs/protobuf.js/commit/b950877c86676399674821fca4cf444f046b5acb))\n* handling properly fields with leading and trailing comments after field with trailing comment ([#1593](https://github.com/protobufjs/protobuf.js/issues/1593)) ([9011aac](https://github.com/protobufjs/protobuf.js/commit/9011aac161e1bf8eaa3cbf0f17e8f321b6e0d9c4))\n* make node detection a bit more forgiving ([#1445](https://github.com/protobufjs/protobuf.js/issues/1445)) ([4e75f6d](https://github.com/protobufjs/protobuf.js/commit/4e75f6de4a2e49f28c24b59107f262d472b68977))\n* make parsedOptions appear in method JSON representation ([#1506](https://github.com/protobufjs/protobuf.js/issues/1506)) ([3d29969](https://github.com/protobufjs/protobuf.js/commit/3d29969865f2119550d9dc88391846469da9fa7f))\n* proper relative path to protobufjs in cli ([#1753](https://github.com/protobufjs/protobuf.js/issues/1753)) ([a1d6029](https://github.com/protobufjs/protobuf.js/commit/a1d60292ecb22fcf89c493c562ae07ab10ef49c9))\n* properly parse empty messages in options ([#1429](https://github.com/protobufjs/protobuf.js/issues/1429)) ([7fbc79f](https://github.com/protobufjs/protobuf.js/commit/7fbc79f11d89b263dafc8f332ccba59a8d181fca))\n* proto3 optional scalars should default to null in reflection API ([#1693](https://github.com/protobufjs/protobuf.js/issues/1693)) ([d9144de](https://github.com/protobufjs/protobuf.js/commit/d9144dea611c9a1c0e01cc3e0e2491c6de5f9c97))\n* replace deprecated String.prototype.substr() ([#1701](https://github.com/protobufjs/protobuf.js/issues/1701)) ([e33a84a](https://github.com/protobufjs/protobuf.js/commit/e33a84a301eb6beaaa6a71a20756f0b5ccfb0459))\n* scope variable for map field to avoid redeclaration ([#1717](https://github.com/protobufjs/protobuf.js/issues/1717)) ([#1718](https://github.com/protobufjs/protobuf.js/issues/1718)) ([1d3c02a](https://github.com/protobufjs/protobuf.js/commit/1d3c02a89ea9ad794b454d11ca2de425db4772dd))\n* support for options with `repeated_value: [ \"foo\", \"bar\" ]` ([#1574](https://github.com/protobufjs/protobuf.js/issues/1574)) ([f5b893c](https://github.com/protobufjs/protobuf.js/commit/f5b893c03e9694bbe7da7c4001cc74b06039eb9c))\n* typo in pbjs help text ([#1552](https://github.com/protobufjs/protobuf.js/issues/1552)) ([7f46dbe](https://github.com/protobufjs/protobuf.js/commit/7f46dbeb538a6277035a896e1ab5e1a070e28681))\n* update minimal.js to evade override mistake ([#1742](https://github.com/protobufjs/protobuf.js/issues/1742)) ([e2f33a0](https://github.com/protobufjs/protobuf.js/commit/e2f33a04eddbcffcbc2ae16c72ac3820410057bc))\n* updated isNode check ([#1221](https://github.com/protobufjs/protobuf.js/issues/1221)) ([#1363](https://github.com/protobufjs/protobuf.js/issues/1363)) ([5564e7b](https://github.com/protobufjs/protobuf.js/commit/5564e7b5f07d3eab99762528e8ce88507af5a5a3))\n* utf8 -> utf16 decoding bug on surrogate pairs ([#1486](https://github.com/protobufjs/protobuf.js/issues/1486)) ([75172cd](https://github.com/protobufjs/protobuf.js/commit/75172cd11be137bbabd2fba7a02b15067695ebad))\n\n### [6.10.2](https://www.github.com/protobufjs/protobuf.js/compare/v6.10.1...v6.10.2) (2020-11-13)\n\n\n### Bug Fixes\n\n* es6 export enum ([#1446](https://www.github.com/protobufjs/protobuf.js/issues/1446)) ([9f33784](https://www.github.com/protobufjs/protobuf.js/commit/9f33784350b1efc2e774bbfc087cbd2c47828748))\n* make parsedOptions appear in method JSON representation ([#1506](https://www.github.com/protobufjs/protobuf.js/issues/1506)) ([3d29969](https://www.github.com/protobufjs/protobuf.js/commit/3d29969865f2119550d9dc88391846469da9fa7f))\n* utf8 -> utf16 decoding bug on surrogate pairs ([#1486](https://www.github.com/protobufjs/protobuf.js/issues/1486)) ([75172cd](https://www.github.com/protobufjs/protobuf.js/commit/75172cd11be137bbabd2fba7a02b15067695ebad))\n\n### [6.10.1](https://www.github.com/protobufjs/protobuf.js/compare/v6.10.0...v6.10.1) (2020-07-16)\n\n\n### Bug Fixes\n\n* make node detection a bit more forgiving ([#1445](https://www.github.com/protobufjs/protobuf.js/issues/1445)) ([4e75f6d](https://www.github.com/protobufjs/protobuf.js/commit/4e75f6de4a2e49f28c24b59107f262d472b68977))\n\n## [6.10.0](https://www.github.com/protobufjs/protobuf.js/compare/v6.9.0...v6.10.0) (2020-07-13)\n\n\n### Features\n\n* add configurable Root.prototype.fetch ([ad3cffd](https://www.github.com/protobufjs/protobuf.js/commit/ad3cffdc5a54a7c94830674270d3386e1a2b58fc))\n* better comment parse ([#1419](https://www.github.com/protobufjs/protobuf.js/issues/1419)) ([7fd2e18](https://www.github.com/protobufjs/protobuf.js/commit/7fd2e182150c9b6be9ba21e6450b6e4668ad9f82))\n* parsed options ([#1256](https://www.github.com/protobufjs/protobuf.js/issues/1256)) ([7a25398](https://www.github.com/protobufjs/protobuf.js/commit/7a2539843055b6daecb9f369c67a6cf588dbb54c))\n\n\n### Bug Fixes\n\n* allow Windows unc paths to be resolved and normalized ([#1351](https://www.github.com/protobufjs/protobuf.js/issues/1351)) ([cd4aeda](https://www.github.com/protobufjs/protobuf.js/commit/cd4aeda8036f80cfa3b9f1db4096d856b2fd05fb))\n* do not fail if no process ([#1440](https://www.github.com/protobufjs/protobuf.js/issues/1440)) ([f2faa8c](https://www.github.com/protobufjs/protobuf.js/commit/f2faa8c32e918b3b843005f0419608b8e158998d))\n* fix util.global ([#1441](https://www.github.com/protobufjs/protobuf.js/issues/1441)) ([742b8dc](https://www.github.com/protobufjs/protobuf.js/commit/742b8dcbc750f9c2659088cbd88ea61fd11b24a7))\n* google.protobuf.Any type_url fixes ([#1068](https://www.github.com/protobufjs/protobuf.js/issues/1068)) ([192f5f1](https://www.github.com/protobufjs/protobuf.js/commit/192f5f12d071fa534ac625290d4666c839a46a9e))\n* handling of map entries with omitted key or value ([#1348](https://www.github.com/protobufjs/protobuf.js/issues/1348)) ([b950877](https://www.github.com/protobufjs/protobuf.js/commit/b950877c86676399674821fca4cf444f046b5acb))\n* properly parse empty messages in options ([#1429](https://www.github.com/protobufjs/protobuf.js/issues/1429)) ([7fbc79f](https://www.github.com/protobufjs/protobuf.js/commit/7fbc79f11d89b263dafc8f332ccba59a8d181fca))\n* updated isNode check ([#1221](https://www.github.com/protobufjs/protobuf.js/issues/1221)) ([#1363](https://www.github.com/protobufjs/protobuf.js/issues/1363)) ([5564e7b](https://www.github.com/protobufjs/protobuf.js/commit/5564e7b5f07d3eab99762528e8ce88507af5a5a3))\n\n## [6.9.0](https://www.github.com/protobufjs/protobuf.js/compare/6.8.8...v6.9.0) (2020-04-17)\n\n\n### Features\n\n* add support for buffer configuration ([#1372](https://www.github.com/protobufjs/protobuf.js/issues/1372)) ([101aa1a](https://www.github.com/protobufjs/protobuf.js/commit/101aa1a4f148516fdc83a74f54a229f06e24a5de))\n* update dependencies / general cleanup ([#1356](https://www.github.com/protobufjs/protobuf.js/issues/1356)) ([42f49b4](https://www.github.com/protobufjs/protobuf.js/commit/42f49b43f692c24c2bc1ae081b4d1ad9fa173cd7))\n\n\n### Bug Fixes\n\n* allow file-level options everywhere in the file ([b70eebd](https://www.github.com/protobufjs/protobuf.js/commit/b70eebd86e113effaa7d13b24b19ee4a0cb9e1e5))\n* Import Long types ([1d98cb8](https://www.github.com/protobufjs/protobuf.js/commit/1d98cb86fcbc69bd54fb3d3254b348da6ac0a96b))\n* npm audit fixes ([ca52447](https://www.github.com/protobufjs/protobuf.js/commit/ca524478621bd2e08120eb444c7ad8089dba1929))\n* properly iterate and return method descriptors ([d96bb7a](https://www.github.com/protobufjs/protobuf.js/commit/d96bb7ae991ca7d5ef8eea3bca75a2089c6f1212))\n* run npm audit fix ([#1208](https://www.github.com/protobufjs/protobuf.js/issues/1208)) ([b5b6632](https://www.github.com/protobufjs/protobuf.js/commit/b5b66321762a24c5ac2753b68331cbe115969da7))\n* **docs:** update CHANGELOG to match format of release-please ([#1376](https://www.github.com/protobufjs/protobuf.js/issues/1376)) ([15ed8a0](https://www.github.com/protobufjs/protobuf.js/commit/15ed8a0fbe72b2e408b87ba25028f877796cc191))\n\n## [6.8.8](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.8)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3001425b0d896d14188307cd0cc84ce195ad9e04) Persist recent index.d.ts changes in JSDoc<br />\n\n## [6.8.7](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.7)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e8449c4bf1269a2cc423708db6f0b47a383d33f0) Fix package browser field descriptor ([#1046](https://github.com/protobufjs/protobuf.js/issues/1046))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/996b3fa0c598ecc73302bfc39208c44830f07b1a) Fix static codegen issues with uglifyjs3<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a06317139b92fdd8c6b3b188fb7b9704dc8ccbf1) Fix lint issues / pbts on windows<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a927a6646e8fdddebcb3e13bc8b28b041b3ee40a) Fix empty 'bytes' field decoding, now using Buffer where applicable ([#1020](https://github.com/protobufjs/protobuf.js/issues/1020))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f13a81fb41fbef2ce9dcee13f23b7276c83fbcfd) Fix circular dependency of Namespace and Enum ([#994](https://github.com/protobufjs/protobuf.js/issues/994))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c05c58fad61c16e5ce20ca19758e4782cdd5d2e3) Ignore optional commas in aggregate options ([#999](https://github.com/protobufjs/protobuf.js/issues/999))<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/36fc964b8db1e4372c76b1baf9f03857cd875b07) Make Message<T> have a default type param ([#1086](https://github.com/protobufjs/protobuf.js/issues/1086))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/996b3fa0c598ecc73302bfc39208c44830f07b1a) Explicitly define service method names when generating static code, see [#857](https://github.com/protobufjs/protobuf.js/issues/857)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/07c5d59e1da8c5533a39007ba332928206281408) Also handle services in ext/descriptor ([#1001](https://github.com/protobufjs/protobuf.js/issues/1001))<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2c5ef95818a310243f88ffba0331cd47ee603c0a) Extend list of ignored ESLint rules for pbjs, fixes [#1085](https://github.com/protobufjs/protobuf.js/issues/1085)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8576b49ad3e55b8beae2a8f044c51040484eef12) Fix declared return type of pbjs/pbts callback ([#1025](https://github.com/protobufjs/protobuf.js/issues/1025))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9fceaa69667895e609a3ed78eb2efa7a0ecfb890) Added an option to pbts to allow custom imports ([#1038](https://github.com/protobufjs/protobuf.js/issues/1038))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/65d113b0079fa2570837f3cf95268ce24714a248) Get node executable path from process.execPath ([#1018](https://github.com/protobufjs/protobuf.js/issues/1018))<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b611875cfbc1f98d8973a2e86f1506de84f00049) Slim down CI testing and remove some not ultimately necesssary dependencies with audit issues<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/812b38ddabb35e154f9ff94f32ad8ce2a70310f1) Move global handling to util, see [#995](https://github.com/protobufjs/protobuf.js/issues/995)<br />\n\n## [6.8.6](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.6)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2ee1028d631a328e152d7e09f2a0e0c5c83dc2aa) Fix typeRefRe being vulnerable to ReDoS<br />\n\n## [6.8.5](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.6)\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/462132f222d8febb8211d839635aad5b82dc6315) Preserve comments when serializing/deserializing with toJSON and fromJSON. ([#983](https://github.com/protobufjs/protobuf.js/issues/983))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d29c0caa715a14214fc755b3cf10ac119cdaf199) Add more details to some frequent error messages ([#962](https://github.com/protobufjs/protobuf.js/issues/962))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8400f87ad8ed2b47e659bc8bb6c3cf2467802425) Add IParseOptions#alternateCommentMode ([#968](https://github.com/protobufjs/protobuf.js/issues/968))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d6e3b9e218896ec1910e02448b5ee87e4d96ede6) Added field_mask to built-in common wrappers ([#982](https://github.com/protobufjs/protobuf.js/issues/982))<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/635fef013fbb3523536d92c690ffd7d84829db35) Remove code climate config in order to use 'in-app' config instead<br />\n\n## [6.8.4](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.4)\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/69440c023e6962c644715a0c95363ddf19db648f) Update jsdoc dependency (pinned vulnerable marked)<br />\n\n## [6.8.3](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.3)\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cc991a058b0636f3454166c76de7b664cf23a8f4) Use correct safeProp in json-module target, see [#956](https://github.com/protobufjs/protobuf.js/issues/956)<br />\n\n## [6.8.2](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.2)\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6fc6481d790648e9e2169a961ad31a732398c911) Include dist files in npm package, see [#955](https://github.com/protobufjs/protobuf.js/issues/955)<br />\n\n## [6.8.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.1)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/db2dd49f6aab6ecd606eee334b95cc0969e483c2) Prevent invalid JSDoc names when generating service methods, see [#870](https://github.com/protobufjs/protobuf.js/issues/870)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/62297998d681357ada70fb370b99bac5573e5054) Prevent parse errors when generating service method names, see [#870](https://github.com/protobufjs/protobuf.js/issues/870)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/478f332e0fc1d0c318a70b1514b1d59c8c200c37) Support parsing nested option-values with or without ':' ([#951](https://github.com/protobufjs/protobuf.js/issues/951), fixes [#946](https://github.com/protobufjs/protobuf.js/issues/946))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/83477ca8e0e1f814ac79a642ea656f047563613a) Add support for reserved keyword in enums ([#950](https://github.com/protobufjs/protobuf.js/issues/950), fixes [#949](https://github.com/protobufjs/protobuf.js/issues/949))<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c482a5b76fd57769eae4308793e3ff8725264664) Unified safe property escapes and added a test for [#834](https://github.com/protobufjs/protobuf.js/issues/834)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1724581c36ecc4fc166ea14a9dd57af5e093a467) Fix codegen if type name starts with \"Object\"<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/adecd544c5fcbeba28d502645f895024e3552970) Fixed dependency for json-module to use \"light\".<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2a8dd74fca70d4e6fb41328a7cee81d1d50ad7ad) Basic support for URL prefixes in google.protobuf.Any types.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/be78a3d9bc8d9618950c77f9e261b422670042ce) fixed 'error is not defined linter warning when using static/static-module and es6<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c712447b309ae81134c7afd60f8dfa5ecd3be230) Fixed wrong type_url for any type (no leading '.' allowed).<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/145bda25ee1de2c0678ce7b8a093669ec2526b1d) Fixed fromObject() for google.protobuf.Any types.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7dec43d9d847481ad93fca498fd970b3a4a14b11) Handle case where 'extendee' is undefined in ext/descriptor<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/20a26271423319085d321878edc5166a5449e68a) Sanitize CR-only line endings (coming from jsdoc?)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/19d2af12b5db5a0f668f50b0cae3ee0f8a7affc2) Make sure enum typings become generated ([#884](https://github.com/protobufjs/protobuf.js/issues/884) didn't solve this)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a2c72c08b0265b112d367fa3d33407ff0de955b9) Remove exclude and include patterns from jsdoc config<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9afb8a2ff27c1e0a999d7331f3f65f568f5cced5) Skip defaults when generating proto3<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/952c7d1b478cc7c6de82475a17a1387992e8651f) Wait for both the 'end' and 'close' event to happen before finishing in pbts, see [#863](https://github.com/protobufjs/protobuf.js/issues/863)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ed7e2e71f5cde27c4128f4f2e3f4782cc51fbec7) Accept null for optional fields in generated static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/27cc66a539251216ef10aea04652d58113949df9) Annotate TS classes with @implements<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/05e7e0636727008c72549459b8594fa0442d346f) Annotate virtual oneofs as string literal unions<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/685adb0e7ef0f50e4b93a105013547884957cc98) Also check for reserved ids and names in enums<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/843d0d5b927968025ca11babff28495dd3bb2863) Also support 'reserved' in enum descriptors<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a8376b57fb0a858adff9dc8a1d1b5372eff9d85c) Include just relevant files in npm package, fixes [#781](https://github.com/protobufjs/protobuf.js/issues/781)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bda1bc6917c681516f6be8be8f0e84ba1262c4ce) Fix travis build<br />\n\n## [6.8.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.8.0)\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ff858003f525db542cbb270777b6fab3a230c9bb) Replaced Buffer and Long types with interfaces and removed stubs<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/22f907c49adbbdf09b72bde5299271dbe0ee9cbe) Removed Message#toObject in favor of having just the static version (unnecessary static code otherwise)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c97b61811248df002f1fb93557b982bc0aa27309) Everything uses interfaces now instead of typedefs (SomethingProperties is now ISomething)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b9f179064f3ddf683f13e0d4e17840301be64010) ReflectionObject#toJSON properly omits explicit undefined values<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7a6f98b5e74f9e9142f9be3ba0683caeaff916c4) Initial implementation of TypeScript decorators<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7a6f98b5e74f9e9142f9be3ba0683caeaff916c4) Refactored protobuf.Class away<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7a6f98b5e74f9e9142f9be3ba0683caeaff916c4) TypeScript definitions now have (a lot of) generics<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7a6f98b5e74f9e9142f9be3ba0683caeaff916c4) Removed deprecated features<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c306d19d806eb697913ffa2b8613f650127a4c50) Added 'undefined' besides 'null' as a valid value of an optional field, fixes [#826](https://github.com/protobufjs/protobuf.js/issues/826)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c5518c3bac0da9c2045e6f1baf0dee915afb4221) Fixed an issue with codegen typings, see [#819](https://github.com/protobufjs/protobuf.js/issues/819)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/66d149e92ff1baddfdfd4b6a88ca9bcea6fc6195) Ported utf8 chunking mechanism to base64 as well, fixes [#800](https://github.com/protobufjs/protobuf.js/issues/800)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e1f9d9856c98a0f0eb1aa8bdf4ac0df467bee8b9) Also be more verbose when defining properties for ES6, fixes [#820](https://github.com/protobufjs/protobuf.js/issues/820)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cf36097305ab02047be5014eabeccc3154e18bde) Generate more verbose JSDoc comments for ES6 support, fixes [#820](https://github.com/protobufjs/protobuf.js/issues/820)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f2959795330966f13cb65bbb6034c88a01fc0bcc) Emit a maximum of one error var when generating verifiers, fixes [#786](https://github.com/protobufjs/protobuf.js/issues/786)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3b848a10b39c1897ca1ea3b5149ef72ae43fcd11) Fixed missing semicolon after 'extensions' and 'reserved' when generating proto files, fixes [#810](https://github.com/protobufjs/protobuf.js/issues/810)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/eb1b40497e14a09facbc370676f486bed1376f52) Call npm with '--no-bin-links' when installing CLI deps, fixes [#823](https://github.com/protobufjs/protobuf.js/issues/823)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/429de19d851477f1df2804d5bc0be30228cd0924) Fix Reader argument conversion in static module<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/03194c203d6ff61ae825e66f8a29ca204fa503b9) Use JSDoc, they said, it documents code, they said. Fixes [#770](https://github.com/protobufjs/protobuf.js/issues/770)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ec6a133ff541c638517e00f47b772990207c8640) parser should not confuse previous trailing line comments with comments for the next declaration, see [#762](https://github.com/protobufjs/protobuf.js/issues/762)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0589ace4dc9e5c565ff996cf6e6bf94e63f43c4e) Types should not clear constructor with cache (fixes decorators)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/056ecc3834a3b323aaaa676957efcbe3f52365a0) Namespace#lookup should also check in nested namespaces (wtf)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ed34b093839652db2ff7b84db87857fc57d96038) Reader#bytes should also support plain arrays<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/514afcfa890aa598e93254576c4fd6062e0eff3b) Fix markdown for pipe in code in table<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/17c2797592bc4effd9aaae3ba9777c9550bb75ac) Upgrade to codegen 2<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/57d7d35ddbb9e3a28c396b4ef1ae3b150eeb8035) ext/descriptor enables interoperability between reflection and descriptor.proto (experimental), see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3939667ef1f37b025bd7f9476015890496d50e00) Added 'json' conversion option for proto3 JSON mapping compatibility of NaN and Infinity + additional documentation of util.toJSONOptions, see [#351](https://github.com/protobufjs/protobuf.js/issues/351)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4eac28c7d3acefb0af7b82c62cf8d19bf3e7d37b) Use protobuf/minimal when pbjs target is static-module<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3a959453fe63706c38ebbacda208e1f25f27dc99) Added closure wrapper<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/13bf9c2635e6a1a2711670fc8e28ae9d7b8d1c8f) Various improvements to statically generated JSDoc, also fixes [#772](https://github.com/protobufjs/protobuf.js/issues/772)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ffdc93c7cf7c8a716316b00864ea7c510e05b0c8) Check incompatible properties for namespaces only in tsd-jsdoc<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fb3f9c70436d4f81bcd0bf62b71af4d253390e4f) Additional tsd-jsdoc handling of properties inside of namespaces and TS specific API exposure<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2dcae25c99e2ed8afd01e27d21b106633b8c31b9) Several improvements to tsd-jsdoc emitted comments<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ff858003f525db542cbb270777b6fab3a230c9bb) Further TypeScript definition improvements<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/22f907c49adbbdf09b72bde5299271dbe0ee9cbe) Relieved tsd files from unnecessary comments<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/22f907c49adbbdf09b72bde5299271dbe0ee9cbe) Generate TS namespaces for vars and functions with properties<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b355115e619c6595ac9d91897cfe628ef0e46054) Prefer @tstype over @type when generating typedefs (tsd-jsdoc)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/23f4b990375efcac2c144592cf4ca558722dcf2d) Replaced nullable types with explicit type|null for better tooling compatibility, also fixes [#766](https://github.com/protobufjs/protobuf.js/issues/766) and fixes 767<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6493f52013c92a34b8305a25068ec7b8c4c29d54) Added more info to ext/descriptor README, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ef92da3768d8746dbfe72e77232f78b879fc811d) Additional notes on ext/descriptor<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b646cf7499791a41b75eef2de1a80fb558d4159e) Updated CHANGELOG so everyone knows what's going on (and soon, breaking)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/35a663757efe188bea552aef017837bc6c6a481a) Additional docs on TS/decorators usage<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9726be0888a9461721447677e9dece16a682b9f6) Updated dist files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9726be0888a9461721447677e9dece16a682b9f6) Added package-lock.json<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/114f7ea9fa3813003afc3ebb453b2dd2262808e1) Minor formatting<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8a6e464954b472fdbb4d46d9270fe3b4b3c7272d) Generate files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/42f8a97630bcb30d197b0f1d6cbdd96879d27f96) Remove the no-constructor arg<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6446247cd7edbb77f03dc42c557f568811286a39) Remove the ctor option.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2059ee0f6f951575d5c5d2dc5eb06b6fa34e27aa) Add support to generate types for JSON object.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7445da0f8cb2e450eff17723f25f366daaf3bbbb) aspromise performance pass<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3f8b74ba6726567eaf68c4d447c120f75eac042f) codegen 2 performance pass, [#653](https://github.com/protobufjs/protobuf.js/issues/653) might benefit<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d44a7eec2fd393e5cb24196fb5818c8c278a0f34) Fixed minimal library including reflection functionality<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a18e6db9f02696c66032bce7ef4c0eb0568a8048) Minor compression ratio tuning<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b49a4edd38395e209bedac2e0bfb7b9d5c4e980b) Fixed failing test case + coverage<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8f7111cacd236501b7e26791b9747b1974a2d9eb) Improved fromObject wrapper for google.protobuf.Any.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0e471a2516bde3cd3c27b2691afa0dcfbb01f042) Fixed failing tokenize test case<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5867f076d8510fa97e3bd6642bbe61960f7fd196) Removed debug build, made it an extension<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/22f907c49adbbdf09b72bde5299271dbe0ee9cbe) Regenerated dist files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5bc3541d2da19e2857dc884f743d37c27e8e21f2) Even more documentation and typings for ext/descriptor<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/773e6347b57e4a5236b1ef0bb8d361e4b233caf7) ext/descriptor docs<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/773e6347b57e4a5236b1ef0bb8d361e4b233caf7) Decorators coverage<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9a23ded94729ceeea2f87cb7e8460eaaaf1c8269) ext/descriptor support for various standard options, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2d8ce6ec0abd261f9b261a44a0a258fdf57ecec3) ext/descriptor passes descriptor.proto test with no differences, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3a20968c6d676312e4f2a510f7e079e0e0819daf) Properly remove unnecessary (packed) options from JSON descriptors<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2a30df8bd5f20d91143a38c2232dafc3a6f3a7bd) Use typedefs in ext/descriptor (like everywhere else), see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1fc911cef01e081c04fb82ead685f49dde1403bb) Fixed obvious issues with ext/descriptor, does not throw anymore when throwing descriptor.proto itself at it, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6c37dbd14f39dad687f2f89f1558a875f7dcc882) Added still missing root traversal to ext/descriptor, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7ab136daa5eb2769b616b6b7522e45a4e33a59f6) Initial map fields support for ext/descriptor, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/708552bb84508364b6e6fdf73906aa69e83854e1) Added infrastructure for TypeScript support of extensions<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/23f26defa793b371c16b5f920fbacb3fb66bdf22) TypeScript generics improvements<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e49bef863c0fb10257ec1001a3c5561755f2ec6b) More ext/descriptor progress, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6b94336c1e6eec0f2eb1bd5dca73a7a8e71a2153) Just export the relevant namespace in ext/descriptor<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fbb99489ed0c095174feff8f53431d30fb6c34a0) Initial descriptor.proto extension for reflection interoperability, see [#757](https://github.com/protobufjs/protobuf.js/issues/757)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/48e66d975bf7b4e6bdbb68ec24386c98b16c54c5) Moved custom wrappers to its own module instead, also makes the API easier to use manually, see [#677](https://github.com/protobufjs/protobuf.js/issues/677)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0c6e639d08fdf9be12677bf678563ea631bafb2c) Added infrastructure for custom wrapping/unwrapping of special types, see [#677](https://github.com/protobufjs/protobuf.js/issues/677)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0425b584f49841d87a8249fef30c78cc31c1c742) More decorator progress (MapField.d, optional Type.d)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7a6f98b5e74f9e9142f9be3ba0683caeaff916c4) tsd-jsdoc now has limited generics support<br />\n\n## [6.7.3](https://github.com/protobufjs/protobuf.js/releases/tag/6.7.3)\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/57f1da64945f2dc5537c6eaa53e08e8fdd477b67) long, @types/long and @types/node are just dependencies, see [#753](https://github.com/protobufjs/protobuf.js/issues/753)<br />\n\n## [6.7.2](https://github.com/protobufjs/protobuf.js/releases/tag/6.7.2)\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a7621be0a56585defc72d863f4e891e476905692) Split up NamespaceDescriptor to make nested plain namespaces a thing, see [#749](https://github.com/protobufjs/protobuf.js/issues/749)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e980e72ae3d4697ef0426c8a51608d31f516a2c4) More README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1f76749d0b9a780c7b6cb56be304f7327d74ebdb) Replaced 'runtime message' with 'message instance' for clarity<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e6b6dedb550edbd0e54e212799e42aae2f1a87f1) Rephrased the Usage section around the concept of valid messages<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0d8100ba87be768ebdec834ca2759693e0bf4325) Added toolset diagram to README<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3405ae8d1ea775c96c30d1ef5cde666c9c7341b3) Touched benchmark output metrics once more<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e36b228f4bb8b1cd835bf31f8605b759a7f1f501) Fixed failing browser test<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7b3bdb562ee7d30c1a557d7b7851d55de3091da4) Output more human friendly metrics from benchmark<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/59e447889057c4575f383630942fd308a35c12e6) Stripped down static bench code to what's necessary<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f88dad098282ece65f5d6e224ca38305a8431829) Revamped benchmark, now also covers Google's JS implementation<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/45356be81ba7796faee0d4d8ad324abdd9f301fb) Updated dependencies and dist files<br />\n\n## [6.7.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.7.1)\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3d23eed6f7c79007969672f06c1a9ccd691e2411) Made .verify behave more like .encode, see [#710](https://github.com/protobufjs/protobuf.js/issues/710)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bed514290c105c3b606f760f2abba80510721c77) With null/undefined eliminated by constructors and .create, document message fields as non-optional where applicable (ideally used with TS & strictNullChecks), see [#743](https://github.com/protobufjs/protobuf.js/issues/743)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/007b2329842679ddf994df7ec0f9c70e73ee3caf) Renamed --strict-long/message to --force-long/message with backward compatible aliases, see [#741](https://github.com/protobufjs/protobuf.js/issues/741)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6aae71f75e82ffd899869b0c952daf98991421b8) Keep $Properties with --strict-message but require actual instances within, see [#741](https://github.com/protobufjs/protobuf.js/issues/741)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c812cef0eff26998f14c9d58d4486464ad7b2bbc) Added --strict-message option to pbjs to strictly reference message instances instead of $Properties, see [#741](https://github.com/protobufjs/protobuf.js/issues/741)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/412407de9afb7ec3a999c4c9a3a1f388f971fce7) Restructured README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1c4d9d7f024bfa096ddc24aabbdf39211ed8637a) Added more information on typings usage, see [#744](https://github.com/protobufjs/protobuf.js/issues/744)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/602065e16862751c515c2f3391ee8b880e8140b1) Clarified typescript example in README, see [#744](https://github.com/protobufjs/protobuf.js/issues/744)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/79d0ba2cc71a156910a9d937683af164df694f08) Clarified that the service API targets clients consuming a service, see [#742](https://github.com/protobufjs/protobuf.js/issues/742)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a66f76452ba050088efd1aaebf3c503a55e6287c) Omit copying of undefined or null in constructors and .create, see [#743](https://github.com/protobufjs/protobuf.js/issues/743)<br />\n\n## [6.7.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.7.0)\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9c1bbf10e445c3495b23a354f9cbee951b4b20f0) Namespace#lookupEnum should actually look up the reflected enum and not just its values<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/44a8d3af5da578c2e6bbe0a1b948d469bbe27ca1) Decoder now throws if required fields are missing, see [#695](https://github.com/protobufjs/protobuf.js/issues/695) / [#696](https://github.com/protobufjs/protobuf.js/issues/696)<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d1e3122e326480fdd44e96afd76ee72e9744b246) Added functionality to filter for multiple types at once in lookup(), used by lookupTypeOrEnum(), fixes [#740](https://github.com/protobufjs/protobuf.js/issues/740)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8aa21268aa5e0f568cb39e99a83b99ccb4084381) Ensure that fields have been resolved when looking up js types in static target, see [#731](https://github.com/protobufjs/protobuf.js/issues/731)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f755d36829b9f1effd7960fab3a86a141aeb9fea) Properly copy fields array before sorting in toObject, fixes [#729](https://github.com/protobufjs/protobuf.js/issues/729)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a06691f5b87f7e90fed0115b78ce6febc4479206) Actually emit TS compatible enums in static target if not aliases, see [#720](https://github.com/protobufjs/protobuf.js/issues/720)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b01bb58dec92ebf6950846d9b8d8e3df5442b15d) Hardened tokenize/parse, esp. comment parsing, see [#713](https://github.com/protobufjs/protobuf.js/issues/713)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bc76ad732fc0689cb0a2aeeb91b06ec5331d7972) Exclude any fields part of some oneof when populating defaults in toObject, see [#710](https://github.com/protobufjs/protobuf.js/issues/710)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/68cdb5f11fdbb950623be089f98e1356cb7b1ea3) Most of the parser is not case insensitive, see [#705](https://github.com/protobufjs/protobuf.js/issues/705)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3e930b907a834a7da759478b8d3f52fef1da22d8) Retain options argument in Root#load when used with promises, see [#684](https://github.com/protobufjs/protobuf.js/issues/684)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3c14ef42b3c8f2fef2d96d65d6e288211f86c9ef) Created a micromodule from (currently still bundled) float support<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7ecae9e9f2e1324ef72bf5073463e01deff50cd6) util.isset(obj, prop) can be used to test if a message property is considered to be set, see [#728](https://github.com/protobufjs/protobuf.js/issues/728)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c04d4a5ab8f91899bd3e1b17fe4407370ef8abb7) Implemented stubs for long.js / node buffers to be used where either one isn't wanted, see [#718](https://github.com/protobufjs/protobuf.js/issues/718)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b9574ad02521a31ebd509cdaa269e7807da78d7c) Simplified reusing / replacing internal constructors<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1f97b7af05b49ef69bd6e9d54906d1b7583f42c4) Constructors/.create always initialize proper mutable objects/arrays, see [#700](https://github.com/protobufjs/protobuf.js/issues/700)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/adb4bb001a894dd8d00bcfe03457497eb994f6ba) Verifiers return an error if multiple fields part of the same oneof are set, see [#710](https://github.com/protobufjs/protobuf.js/issues/710)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fe93d436b430d01b563318bff591e0dd408c06a4) Added `oneofs: true` to ConversionOptions, see [#710](https://github.com/protobufjs/protobuf.js/issues/710)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/228c882410d47a26576f839b15f1601e8aa7914d) Optional fields handle null just like undefined regardless of type see [#709](https://github.com/protobufjs/protobuf.js/issues/709)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/da6af8138afa5343a47c12a8beedb99889c0dd51) Encoders no longer examine virtual oneof properties but encode whatever is present, see [#710](https://github.com/protobufjs/protobuf.js/issues/710)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ac26a7aa60359a37dbddaad139c0134b592b3325) pbjs now generates multiple exports when using ES6 syntax, see [#686](https://github.com/protobufjs/protobuf.js/issues/686)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c1ca65dc6987384af6f9fac2fbd7700fcf5765b2) Sequentially serialize fields ordered by id, as of the spec.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/26d9fadb21a85ca0b5609156c26453ae875e4933) decode throws specific ProtocolError with a reference to the so far decoded message if required fields are missing + example<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2b5577b238a452ae86aa395fb2ad3a3f45d755dc) Reader.create asserts that `buffer` is a valid buffer, see [#695](https://github.com/protobufjs/protobuf.js/issues/695)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6f74d30f059e33a4678f28e7a50dc4878c54bed2) Exclude JSDoc on typedefs from generated d.ts files because typescript@next, see [#737](https://github.com/protobufjs/protobuf.js/issues/737)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2ebb1b781812e77de914cd260e7ab69612ffd99e) Prepare static code with estraverse instead of regular expressions, see [#732](https://github.com/protobufjs/protobuf.js/issues/732)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/29ce6cae0cacc0f1d87ca47e64be6a81325aaa55) Moved tsd-jsdoc to future cli package, see [#716](https://github.com/protobufjs/protobuf.js/issues/716)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8de21e1a947ddb50a167147dd63ad29d37b6a891) $Properties are just a type that's satisfied, not implemented, by classes, see [#723](https://github.com/protobufjs/protobuf.js/issues/723)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4bfe0c239b9c337f8fa64ea64f6a71baf5639b84) More progress on decoupling the CLI<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8a60174932d15198883ac3f07000ab4e7179a695) Fixed computed array indexes not being renamed in static code, see [#726](https://github.com/protobufjs/protobuf.js/issues/726)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8d9981588d17709791846de63f1f3bfd09433b03) Check upfront if key-var is required in static decoders with maps, see [#726](https://github.com/protobufjs/protobuf.js/issues/726)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/16adff0c7b67c69a2133b6aac375365c5f2bdbf7) Fixed handling of stdout if callback is specified, see [#724](https://github.com/protobufjs/protobuf.js/issues/724)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6423a419fe45e648593833bf535ba1736b31ef63) Preparations for moving the CLI to its own package, see [#716](https://github.com/protobufjs/protobuf.js/issues/716)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/afefa3de09620f50346bdcfa04d52952824c3c8d) Properly implement $Properties interface in JSDoc, see [#723](https://github.com/protobufjs/protobuf.js/issues/723)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a1f23e09fb5635275bb7646dfafc70caef74c6b8) Recursively use $Properties inside of $Properties in static code, see [#717](https://github.com/protobufjs/protobuf.js/issues/717)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c3f0a2124c661bb9ba35f92c21a98a4405d30b47) Added --strict-long option to pbjs to always emit 'Long' instead of 'number|Long' (only relevant with long.js), see [#718](https://github.com/protobufjs/protobuf.js/issues/718)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0bc4a14501f84f93afd6ce2933ad00749c82f4df) Statically emitted long type is 'Long' now instead of '$protobuf.Long', see [#718](https://github.com/protobufjs/protobuf.js/issues/718)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a75625d176b7478e0e506f05e2cee5e3d7a0d89a) Decoupled message properties as an interface in static code for TS intellisense support, see [#717](https://github.com/protobufjs/protobuf.js/issues/717)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/23f14a61e8c2f68b06d1bb4ed20b938764c78860) Static code statically resolves types[..], see [#715](https://github.com/protobufjs/protobuf.js/issues/715)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ef71e77726b6bf5978b948d598c18bf8b237ade4) Added type definitions for all possible JSON descriptors<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4bfe0c239b9c337f8fa64ea64f6a71baf5639b84) Explained the JSON structure in README and moved CLI specific information to the CLI package<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3ba3ad762f7486b4806ad1c45764e92a81ca24dd) Added information on how to use the stubs to README, see [#718](https://github.com/protobufjs/protobuf.js/issues/718)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a5dbba41341bf44876cd4226f08044f88148f37d) Added 'What is a valid message' section to README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6f8f2c1fdf92e6f81363d77bc059820b2376fe32) Added a hint on using .create to initial example<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3ad28ec920e0fe8d0223db28804a7b3f8a6880c2) Even more usage for README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5a1f861a0f6b582faae7a4cc5c6ca7e4418086da) Additional information on general usage (README)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/320dea5a1d1387c72759e10a17afd77dc48c3de0) Restructured README to Installation, Usage and Examples sections<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1c9055dd69f7696d2582942b307a1ac8ac0f5533) Added a longish section on the correct use of the toolset to README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/99667c8e1ff0fd3dac83ce8c0cff5d0b1e347310) Added a few additional notes on core methods to README, see [#710](https://github.com/protobufjs/protobuf.js/issues/710)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2130bc97e44567e766ea8efacb365383c909dbd4) Extended traverse-types example, see [#693](https://github.com/protobufjs/protobuf.js/issues/693)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/13e4aa3ff274ab42f1302e16fd59d074c5587b5b) Better explain how .verify, .encode and .decode are connected<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7502dd2dfdaea111e5c1a902c524ad0a51ff9bd4) Documented that Type#encode respectively Message.encode do not implicitly .verify, see [#696](https://github.com/protobufjs/protobuf.js/issues/696) [ci-skip]<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e7e123aa0b6c05eb4156a761739e37c008a3cbc1) Documented throwing behavior of Reader.create and Message.decode<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0fcde32306da77f02cb1ea81ed18a32cee01f17b) Added error handling notes to README, see [#696](https://github.com/protobufjs/protobuf.js/issues/696)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fef924e5f708f14dac5713aedc484535d36bfb47) Use @protobufjs/float<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fef924e5f708f14dac5713aedc484535d36bfb47) Rebuilt dist files for 6.7.0<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ca0dce2d7f34cd45e4c1cc753a97c58e05b3b9d2) Updated deps, ts fixes and regenerated dist files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2c2d4002d6776f3edde608bd813c37d798d87e6b) Manually merged gentests improvements, fixes [#733](https://github.com/protobufjs/protobuf.js/issues/733)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e4a6b6f81fa492a63b12f0da0c381612deff1973) Make sure that util.Long is overridden by AMD loaders only if present, see [#730](https://github.com/protobufjs/protobuf.js/issues/730)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fff1eb297a728ed6d334c591e7d796636859aa9a) Coverage for util.isset and service as a namespace<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8401a47d030214a54b5ee30426ebc7a9d9c3773d) Shortened !== undefined && !== null to equivalent != null in static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e1dd1bc2667de73bb65d876162131be2a4d9fef4) With stubs in place, 'number|Long' return values can be just 'Long' instead, see [#718](https://github.com/protobufjs/protobuf.js/issues/718)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/404ba8e03a63f708a70a72f0208e0ca9826fe20b) Just alias as the actual ideal type when using stubs, see [#718](https://github.com/protobufjs/protobuf.js/issues/718)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/270cc94c7c4b8ad84d19498672bfc854b55130c9) General cleanup + regenerated dist/test files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/017161ce97ceef3b2d0ce648651a4636f187d78b) Simplified camel case regex, see [#714](https://github.com/protobufjs/protobuf.js/issues/714)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d410fd20f35d2a35eb314783b17b6570a40a99e8) Regenerated dist files and changelog for 6.7.0<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/88ca8f0d1eb334646ca2625c78e63fdd57221408) Retain alias order in static code for what it's worth, see [#712](https://github.com/protobufjs/protobuf.js/issues/712)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2a74fbf551e934b3212273e6a28ad65ac4436faf) Everything can be block- or line-style when parsing, see [#713](https://github.com/protobufjs/protobuf.js/issues/713)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/47bb95a31784b935b9ced52aa773b9d66236105e) Determine necessary aliases depending on config, see [#712](https://github.com/protobufjs/protobuf.js/issues/712)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/588ffd9b129869de0abcef1d69bfa18f2f25d8e1) Use more precise types for message-like plain objects<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/37b39c8d1a5307eea09aa24d7fd9233a8df5b7b6) Regenerated dist files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9c94813f9a5f1eb114d7c6112f7e87cb116fe9da) Regenerated relevant files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d7493efe1a86a60f6cdcf7976523e69523d3f7a3) Moved field comparer to util<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fe917652f88df17d4dbaae1cd74f470385342be2) Updated tests to use new simplified encoder logic<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b69173b4e7b514c40bb4a85b54ca5465492a235b) Updated path to tsd-jsdoc template used by pbts, see [#707](https://github.com/protobufjs/protobuf.js/issues/707)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5041fad9defdb0bc8131560e92f3b454d8e45273) Additional restructuring for moving configuration files out of the root folder<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c0b7c9fa6309d345c4ce8e06fd86f27528f4ea66) Added codegen support for constructor functions, see [#700](https://github.com/protobufjs/protobuf.js/issues/700)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4573f9aabd7e8f883e530f4d0b055e5ec9b75219) Attempted to fix broken custom error test<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4b49f500fce156b164c757d8f17be2338f767c82) Trying out a more aggressive aproach for custom error subclasses<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/95cd64ee514dc60d10daac5180726ff39594e8e8) Moved a few things out of the root folder<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/db1030ed257f9699a0bcf3bad0bbe8acccf5d766) Coverage for encoder compat. / protocolerror<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/948a4caf5092453fa091ac7a594ccd1cc5b503d2) Updated dist and generated test files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3ead13e83ecdc8715fbab916f7ccaf3fbfdf59ed) Added tslint<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/364e7d457ed4c11328e609f600a57b7bc4888554) Exclude dist/ from codeclimate checks<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6e81fcb05f25386e3997399e6596e9d9414f0286) Also lint cli utilities<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e7e123aa0b6c05eb4156a761739e37c008a3cbc1) Cache any regexp instance (perf)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d89c45f8af0293fb34e6f12b37ceca49083e1faa) Use code climate badges<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e70fbe3492c37f009dbaccf910c1e0f81e8f0f44) Updated travis to pipe to codeclimate, coverage<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a7ab1036906bb7638193a9e991cb62c86108880a) More precise linter configuration<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/58688c178257051ceb2dfea8a63eb6be7dcf1cf1) Added codeclimate<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4b21e00adc6fae42e6a88deaeb0b7c077c6ca50e) Moved cli deps placeholder creation to post install script<br />\n\n## [6.6.5](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.5)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/478ee51194878f24be8607e42e5259952607bd44) sfixed64 is not zig-zag encoded, see [#692](https://github.com/protobufjs/protobuf.js/issues/692)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7a944538c89492abbed147915acea611f11c03a2) Added a placeholder to cli deps node_modules folder to make sure node can load from it<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/83142e420eb1167b2162063a092ae8d89c9dd4b2) Restructured a few failing tests<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/367d55523a3ae88f21d47aa96447ec3e943d4620) Traversal example + minimalistic documentation<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8eeffcbcd027c929e2a76accad588c61dfa2e37c) Added a custom getters/setters example for gRPC<br />\n\n## [6.6.4](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.4)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/88eb7a603a21643d5012a374c7d246f4c27620f3) Made sure that LongBits ctor is always called with unsigned 32 bits + static codegen compat., fixes [#690](https://github.com/protobufjs/protobuf.js/issues/690)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/50e82fa7759be035a67c7818a1e3ebe0d6f453b6) Properly handle multiple ../.. in path.normalize, see [#688](https://github.com/protobufjs/protobuf.js/issues/688)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7c3506b3f0c5a08a887e97313828af0c21effc61) Post-merge, also tackles [#683](https://github.com/protobufjs/protobuf.js/issues/683) (packed option for repeated enum values)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7f3f4600bcae6f2e4dadd5cdb055886193a539b7) Verify accepts non-null objects only, see [#685](https://github.com/protobufjs/protobuf.js/issues/685)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d65c22936183d04014d6a8eb880ae0ec33aeba6d) allow_alias enum option was not being honored. This case is now handled and a test case was added<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2ddb76b6e93174787a68f68fb28d26b8ece7cc56) Added an experimental --sparse option to limit pbjs output to actually referenced types within main files<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/33d14c97600ed954193301aecbf8492076dd0179) Added explicit hint on Uint8Array to initial example, see [#670](https://github.com/protobufjs/protobuf.js/issues/670)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cbd4c622912688b47658fea00fd53603049b5104) Ranges and names support for reserved fields, see [#676](https://github.com/protobufjs/protobuf.js/issues/676)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/487f8922d879955ba22f89b036f897b9753b0355) Updated depdendencies / rebuilt dist files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/37536e5fa7a15fbc851040e09beb465bc22d9cf3) Use ?: instead of |undefined in .d.ts files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f8b415a2fc2d1b1eff19333600a010bcaaebf890) Mark optional fields as possibly being undefined<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2ddb76b6e93174787a68f68fb28d26b8ece7cc56) Added a few more common google types from google/api, see [#433](https://github.com/protobufjs/protobuf.js/issues/433)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d246024f4c7d13ca970c91a757e2f47432a619df) Minor optimizations to dependencies, build process and tsd<br />\n\n## [6.6.3](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.3)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0be01a14915e3e510038808fedbc67192a182d9b) Support node 4.2.0 to 4.4.7 buffers + travis case, see [#665](https://github.com/protobufjs/protobuf.js/issues/665)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a0920b2c32e7963741693f5a773b89f4b262688) Added ES6 syntax flag to pbjs, see [#667](https://github.com/protobufjs/protobuf.js/issues/667)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c365242bdc28a47f5c6ab91bae34c277d1044eb3) Reference Buffer for BufferReader/Writer, see [#668](https://github.com/protobufjs/protobuf.js/issues/668)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/43976072d13bb760a0689b54cc35bdea6817ca0d) Slightly shortened README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e64cf65b09047755899ec2330ca0fc2f4d7932c2) Additional notes on the distinction of different use cases / distributions, see [#666](https://github.com/protobufjs/protobuf.js/issues/666)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/83758c99275c2bbd30f63ea1661284578f5c9d91) Extended README with additional information on JSON format<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fdc3102689e8a3e8345eee5ead07ba3c9c3fe80c) Added extended usage instructions for TypeScript and custom classes to README, see [#666](https://github.com/protobufjs/protobuf.js/issues/666)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3701488cca6bc56ce6b7ad93c7b80e16de2571a7) Updated dist files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/579068a45e285c7d2c69b359716dd6870352f46f) Updated test cases to use new buffer util<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0be01a14915e3e510038808fedbc67192a182d9b) Added fetch test cases + some test cleanup<br />\n\n## [6.6.2](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.2)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3aea1bf3d4920dc01603fda25b86e6436ae45ec2) Properly replace short vars when beautifying static code, see [#663](https://github.com/protobufjs/protobuf.js/issues/663)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b6cf228a82152f72f21b1b307983126395313470) Use custom prelude in order to exclude any module loader code from source (for webpack), see [#658](https://github.com/protobufjs/protobuf.js/issues/658)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2b12fb7db9d4eaa3b76b7198539946e97db684c4) Make sure to check optional inner messages for null when encoding, see [#658](https://github.com/protobufjs/protobuf.js/issues/658)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/276a594771329da8334984771cb536de7322d5b4) Initial attempt on a backwards compatible fetch implementation with binary support, see [#661](https://github.com/protobufjs/protobuf.js/issues/661)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2d81864fa5c4dac75913456d582e0bea9cf0dd80) Root#resolvePath skips files when returning null, see [#368](https://github.com/protobufjs/protobuf.js/issues/368)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/aab3ec1a757aff0f11402c3fb943c003f092c1af) Changes callback on failed response decode in rpc service to pass actual error instead of 'error' string<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9044178c052299670108f10621d6e9b3d56e8a40) Travis should exit with the respective error when running sauce tests<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/73721f12072d77263e72a3b27cd5cf9409db9f8b) Moved checks whether a test case is applicable to parent case<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3fcd88c3f9b1a084b06cab2d5881cb5bb895869d) Added eventemitter tests and updated micromodule dependencies (so far)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2db4305ca67d003d57aa14eb23f25eb6c3672034) Added lib/path tests and updated a few dependencies<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2b12fb7db9d4eaa3b76b7198539946e97db684c4) Moved micro modules to lib so they can have their own tests etc.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b6dfa9f0a4c899b5c217d60d1c2bb835e06b2122) Updated travis<br />\n\n## [6.6.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.1)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/039ac77b062ee6ebf4ec84a5e6c6ece221e63401) Properly set up reflection when using light build<br />\n\n## [6.6.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.0) ([release](https://github.com/protobufjs/protobuf.js/releases/tag/6.6.0))\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cdfe6bfba27fa1a1d0e61887597ad4bb16d7e5ed) Inlined / refactored away .testJSON, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a483a529ef9345ed217a23394a136db0d9f7771) Refactored util.extend away<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/27b16351f3286468e539c2ab382de4b52667cf5e) Reflected and statically generated services use common utility, now work exactly the same<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/dca26badfb843a597f81e98738e2fda3f66c7341) fromObject now throws for entirely bogus values (repeated, map and inner message fields), fixes [#601](https://github.com/protobufjs/protobuf.js/issues/601)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4bff9c356ef5c10b4aa34d1921a3b513e03dbb3d) Cleaned up library distributions, now is full / light / minimal with proper browserify support for each<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/301f7762ef724229cd1df51e496eed8cfd2f10eb) Do not randomly remove slashes from comments, fixes [#656](https://github.com/protobufjs/protobuf.js/issues/656)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ef7be352baaec26bdcdce01a71fbee47bbdeec15) Properly parse nested textformat options, also tackles [#655](https://github.com/protobufjs/protobuf.js/issues/655)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b4f4f48f1949876ae92808b0a5ca5f2b29cc011c) Relieved the requirement to call .resolveAll() on roots in order to populate static code-compatible properties, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/56c8ec4196d461383c3e1f271da02553d877ae81) Added a (highly experimental) debug build as a starting point for [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c5d291f9bab045385c5938ba0f6cdf50a315461f) Full build depends on light build depends on minimal build, shares all relevant code<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/735da4315a98a6960f3b5089115e308548b91c07) Also reuse specified root in pbjs for JSON modules, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3a056244d3acf339722d56549469a8df018e682e) Reuse specified root name in pbjs to be able to split definitions over multiple files more easily, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/28ddf756ab83cc890761ef2bd84a0788d2ad040d) Improved pbjs/pbts examples, better covers reflection with definitions for static modules<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6f0b44aea6cf72d23042810f05a7cede85239eb3) Fixed centered formatting on npm<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/dd96dcdacb8eae94942f7016b8dc37a2569fe420) Various other minor improvements / assertions refactored away, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3317a76fb56b9b31bb07ad672d6bdda94b79b6c3) Fixed some common reflection deopt sites, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a483a529ef9345ed217a23394a136db0d9f7771) Reflection performance pass, see [#653](https://github.com/protobufjs/protobuf.js/issues/653)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a483a529ef9345ed217a23394a136db0d9f7771) Added TS definitions to alternative builds' index files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a483a529ef9345ed217a23394a136db0d9f7771) Removed unnecessary prototype aliases, improves gzip ratio<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/641625fd64aca55b1163845e6787b58054ac36ec) Unified behaviour of and docs on Class constructor / Class.create<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7299929b37267af2100237d4f8b4ed8610b9f7e1) Statically generated services actually inherit from rpc.Service<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f4cf75e4e4192910b52dd5864a32ee138bd4e508) Do not try to run sauce tests for PRs<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/33da148e2b750ce06591c1c66ce4c46ccecc3c8f) Added utility to enable/disable debugging extensions to experimental debug build<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fdb1a729ae5f8ab762c51699bc4bb721102ef0c8) Fixed node 0.12 tests<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6bc5bb4a7649d6b91a5944a9ae20178d004c8856) Fixed coverage<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6f0b44aea6cf72d23042810f05a7cede85239eb3) Added a test case for [#652](https://github.com/protobufjs/protobuf.js/issues/652)<br />\n\n## [6.5.3](https://github.com/protobufjs/protobuf.js/releases/tag/6.5.3)\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/799d0303bf289bb720f2b27af59e44c3197f3fb7) In fromObject, check if object is already a runtime message, see [#652](https://github.com/protobufjs/protobuf.js/issues/652)<br />\n\n## [6.5.2](https://github.com/protobufjs/protobuf.js/releases/tag/6.5.2)\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8cff92fe3b7ddb1930371edb4937cd0db9216e52) Added coverage reporting<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cbaaae99b4e39a859664df0e6d20f0491169f489) Added version scheme warning to everything CLI so that we don't need this overly explicit in README<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6877b3399f1a4c33568221bffb4e298b01b14439) Coverage progress, 100%<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/711a9eb55cb796ec1e51af7d56ef2ebbd5903063) Coverage progress<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e7526283ee4dd82231235afefbfad6af54ba8970) Attempted to fix badges once and for all<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5aa296c901c2b460ee3be4530ede394e2a45e0ea) Coverage progress<br />\n\n## [6.5.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.5.1)\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9719fd2fa8fd97899c54712a238091e8fd1c57b2) Reuse module paths when looking up cli dependencies, see [#648](https://github.com/protobufjs/protobuf.js/issues/648)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6302655d1304cf662f556be5d9fe7a016fcedc3c) Check actual module directories to determine if cli dependencies are present and bootstrap semver, see [#648](https://github.com/protobufjs/protobuf.js/issues/648)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/dfc7c4323bf98fb26ddcfcfbb6896a6d6e8450a4) Added a note on semver-incompatibility, see [#649](https://github.com/protobufjs/protobuf.js/issues/649)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/49053ffa0ea8a4ba5ae048706dba1ab6f3bc803b) Coverage progress<br />\n\n## [6.5.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.5.0) ([release](https://github.com/protobufjs/protobuf.js/releases/tag/6.5.0))\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3946e0fefea415f52a16ea7a74109ff40eee9643) Initial upgrade of converters to real generated functions, see [#620](https://github.com/protobufjs/protobuf.js/issues/620)<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/08cda241a3e095f3123f8a991bfd80aa3eae9400) An enum's default value present as a string looks up using typeDefault, not defaultValue which is an array if repeated<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c7e14b1d684aaba2080195cc83900288c5019bbc) Use common utility for virtual oneof getters and setters in both reflection and static code, see [#644](https://github.com/protobufjs/protobuf.js/issues/644)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/508984b7ff9529906be282375d36fdbada66b8e6) Properly use Type.toObject/Message.toObject within converters, see [#641](https://github.com/protobufjs/protobuf.js/issues/641)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5bca18f2d32e8687986e23edade7c2aeb6b6bac1) Generate null/undefined assertion in fromObject if actually NOT an enum, see [#620](https://github.com/protobufjs/protobuf.js/issues/620)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/508984b7ff9529906be282375d36fdbada66b8e6) Replace ALL occurencies of types[%d].values in static code, see [#641](https://github.com/protobufjs/protobuf.js/issues/641)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9b090bb1673aeb9b8f1d7162316fce4d7a3348f0) Switched to own property-aware encoders for compatibility, see [#639](https://github.com/protobufjs/protobuf.js/issues/639)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/340d6aa82ac17c4a761c681fa71d5a0955032c8b) Now also parses comments, sets them on reflected objects and re-uses them when generating static code, see [#640](https://github.com/protobufjs/protobuf.js/issues/640)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3cb82628159db4d2aa721b63619b16aadc5f1981) Further improved generated static code style<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cda5c5452fa0797f1e4c375471aef96f844711f1) Removed scoping iifes from generated static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/def7b45fb9b5e01028cfa3bf2ecd8272575feb4d) Removed even more clutter from generated static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/dbd19fd9d3a57d033aad1d7173f7f66db8f8db3e) Removed various clutter from generated static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1cc8a2460c7e161c9bc58fa441ec88e752df409c) Made sure that static target's replacement regexes don't match fields<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d4272dbf5d0b2577af8efb74a94d246e2e0d728e) Also accept (trailing) triple-slash comments for compatibility with protoc-gen-doc, see [#640](https://github.com/protobufjs/protobuf.js/issues/640)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0a3862b75fa60ef732e0cd36d623f025acc2fb45) Use semver to validate that CLI dependencies actually satisfy the required version, see [#637](https://github.com/protobufjs/protobuf.js/issues/637)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9e360ea6a74d41307483e51f18769df7f5b047b9) Added a hint on documenting .proto files for static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d2a97bb818474645cf7ce1832952b2c3c739b234) Documented internally used codegen partials for what it's worth<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/079388ca65dfd581d74188a6ae49cfa01b103809) Updated converter documentation<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/168e448dba723d98be05c55dd24769dfe3f43d35) Bundler provides useful stuff to uglify and a global var without extra bloat<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/32e0529387ef97182ad0b9ae135fd8b883ed66b4) Cleaned and categorized tests, coverage progress<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3325e86930a3cb70358c689cb3016c1be991628f) Properly removed builtins from bundle<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2c94b641fc5700c8781ac0b9fe796debac8d6893) Call hasOwnProperty builtin as late as possible decreasing the probability of having to call it at all (perf)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/818bcacde267be70a75e689f480a3caad6f80cf7) Slightly hardened codegen sprintf<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/818bcacde267be70a75e689f480a3caad6f80cf7) Significantly improved uint32 write performance<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b5daa272407cb31945fd38c34bbef7c9edd1db1c) Cleaned up test case data and removed unused files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c280a4a18c6d81c3468177b2ea58ae3bc4f25e73) Removed now useless trailing comment checks, see [#640](https://github.com/protobufjs/protobuf.js/issues/640)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/44167db494c49d9e4b561a66ad9ce2d8ed865a21) Ensured that pbjs' beautify does not break regular expressions in generated verify functions<br />\n\n## [6.4.6](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.6)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e11012ce047e8b231ba7d8cc896b8e3a88bcb902) Case-sensitively test for legacy group definitions, fixes [#638](https://github.com/protobufjs/protobuf.js/issues/638)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7e57f4cdd284f886b936511b213a6468e4ddcdce) Properly parse text format options + simple test case, fixes [#636](https://github.com/protobufjs/protobuf.js/issues/636)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fe4d97bbc4d33ce94352dde62ddcd44ead02d7ad) Added SVG logo, see [#629](https://github.com/protobufjs/protobuf.js/issues/629)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/57990f7ed8ad5c512c28ad040908cee23bbf2aa8) Also refactored Service and Type to inherit from NamespaceBase, see [#635](https://github.com/protobufjs/protobuf.js/issues/635)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fe4d97bbc4d33ce94352dde62ddcd44ead02d7ad) Moved TS-compatible Namespace features to a virtual NamespaceBase class, compiles with strictNullChecks by default now, see [#635](https://github.com/protobufjs/protobuf.js/issues/635)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fe4d97bbc4d33ce94352dde62ddcd44ead02d7ad) Minor codegen enhancements<br />\n\n## [6.4.5](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.5)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1154ce0867306e810cf62a5b41bdb0b765aa8ff3) Properly handle empty/noop Writer#ldelim, fixes [#625](https://github.com/protobufjs/protobuf.js/issues/625)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f303049f92c53970619375653be46fbb4e3b7d78) Properly annotate map fields in pbjs, fixes [#624](https://github.com/protobufjs/protobuf.js/issues/624)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4b786282a906387e071a5a28e4842a46df588c7d) Made sure that Writer#bytes is always able to handle plain arrays<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1e6a8d10f291a16631376dd85d5dd385937e6a55) Slightly restructured utility to better support static code default values<br />\n\n## [6.4.4](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.4)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/26d68e36e438b590589e5beaec418c63b8f939cf) Dynamically resolve jsdoc when running pbts, fixes [#622](https://github.com/protobufjs/protobuf.js/issues/622)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/69c04d7d374e70337352cec9b445301cd7fe60d6) Explain 6.4.2 vs 6.4.3 in changelog<br />\n\n## [6.4.3](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.4)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c2c39fc7cec5634ecd1fbaebbe199bf097269097) Fixed invalid definition of Field#packed property, also introduced decoder.compat mode (packed fields, on by default)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/11fb1a66ae31af675d0d9ce0240cd8e920ae75e7) Always decode packed/non-packed based on wire format only, see [#602](https://github.com/protobufjs/protobuf.js/issues/602)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c9a61e574f5a2b06f6b15b14c0c0ff56f8381d1f) Use full library for JSON modules and runtime dependency for static modules, fixes [#621](https://github.com/protobufjs/protobuf.js/issues/621)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e88d13ca7ee971451b57d056f747215f37dfd3d7) Additional workarounds for on demand CLI dependencies, see [#618](https://github.com/protobufjs/protobuf.js/issues/618)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/44f6357557ab3d881310024342bcc1e0d336a20c) Revised automatic setup of cli dependencies, see [#618](https://github.com/protobufjs/protobuf.js/issues/618)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e027a3c7855368837e477ce074ac65f191bf774a) Removed Android 4.0 test (no longer supported by sauce)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8ba3c5efd182bc80fc36f9d5fe5e2b615b358236) Removed some unused utility, slightly more efficient codegen, additional comments<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f22a34a071753bca416732ec4d01892263f543fb) Updated tests for new package.json layout<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f22a34a071753bca416732ec4d01892263f543fb) Added break/continue label support to codegen<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f2ffa0731aea7c431c59e452e0f74247d815a352) Updated dependencies, rebuilt dist files and changed logo to use an absolute url<br />\n\n6.4.2 had been accidentally published as 6.4.3.\n\n## [6.4.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.1)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9035d4872e32d6402c8e4d8c915d4f24d5192ea9) Added more default value checks to converter, fixes [#616](https://github.com/protobufjs/protobuf.js/issues/616)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/62eef58aa3b002115ebded0fa58acc770cd4e4f4) Respect long defaults in converters<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e3170a160079a3a7a99997a2661cdf654cb69e24) Convert inner messages and undefined/null values more thoroughly, fixes [#615](https://github.com/protobufjs/protobuf.js/issues/615)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b52089efcb9827537012bebe83d1a15738e214f4) Always use first defined enum value as field default, fixes [#613](https://github.com/protobufjs/protobuf.js/issues/613)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/64f95f9fa1bbe42717d261aeec5c16d1a7aedcfb) Install correct 'tmp' dependency when running pbts without dev dependencies installed, fixes [#612](https://github.com/protobufjs/protobuf.js/issues/612)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cba46c389ed56737184e5bc2bcce07243d52e5ce) Generate named constructors for runtime messages, see [#588](https://github.com/protobufjs/protobuf.js/issues/588)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ee20b81f9451c56dc106177bbf9758840b99d0f8) pbjs/pbts no longer generate any volatile headers, see [#614](https://github.com/protobufjs/protobuf.js/issues/614)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ec9d517d0b87ebe489f02097c2fc8005fae38904) Attempted to make broken shields less annoying<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5cd4c2f2a94bc3c0f2c580040bce28dd42eaccec) Updated README<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0643f93f5c0d96ed0ece5b47f54993ac3a827f1b) Some cleanup and added a logo<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/169638382de9efe35a1079c5f2045c33b858059a) use $protobuf.Long<br />\n\n## [6.4.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.0) ([release](https://github.com/protobufjs/protobuf.js/releases/tag/6.4.0))\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a017bf8a2dbdb7f9e7ce4c026bb6845174feb3b1) Dropped IE8 support<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/39bc1031bb502f8b677b3736dd283736ea4d92c1) Removed now unused util.longNeq which was used by early static code<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5915ff972482e7db2a73629244ab8a93685b2e55) Do not swallow errors in loadSync, also accept negative enum values in Enum#add, fixes [#609](https://github.com/protobufjs/protobuf.js/issues/609)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fde56c0de69b480343931264a01a1ead1e3156ec) Improved bytes field support, also fixes [#606](https://github.com/protobufjs/protobuf.js/issues/606)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0c03f327115d57c4cd5eea3a9a1fad672ed6bd44) Fall back to browser Reader when passing an Uint8Array under node, fixes [#605](https://github.com/protobufjs/protobuf.js/issues/605)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7eb3d456370d7d66b0856e32b2d2602abf598516) Respect optional properties when writing interfaces in tsd-jsdoc, fixes [#598](https://github.com/protobufjs/protobuf.js/issues/598)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bcadffecb3a8b98fbbd34b45bae0e6af58f9c810) Instead of protobuf.parse.keepCase, fall back to protobuf.parse.defaults holding all possible defaults, see [#608](https://github.com/protobufjs/protobuf.js/issues/608)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a4d6a2af0d57a2e0cccf31e3462c8b2465239f8b) Added global ParseOptions#keepCase fallback as protobuf.parse.keepCase, see [#608](https://github.com/protobufjs/protobuf.js/issues/608)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a017bf8a2dbdb7f9e7ce4c026bb6845174feb3b1) Converters use code generation and support custom implementations<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/28ce07d9812f5e1743afef95a94532d2c9488a84) Be more verbose when throwing invalid wire type errors, see [#602](https://github.com/protobufjs/protobuf.js/issues/602)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/40074bb69c3ca4fcefe09d4cfe01f3a86844a7e8) Added an asJSON-option to always populate array fields, even if defaults=false, see [#597](https://github.com/protobufjs/protobuf.js/issues/597)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a7d23240a278aac0bf01767b6096d692c09ae1ce) Attempt to improve TypeScript support by using explicit exports<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/cec253fb9a177ac810ec96f4f87186506091fa37) Copy-pasted typescript definitions to micro modules, see [#599](https://github.com/protobufjs/protobuf.js/issues/599)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1f18453c7bfcce65c258fa98a3e3d4577d2e550f) Emit an error on resolveAll() if any extension fields cannot be resolved, see [#595](https://github.com/protobufjs/protobuf.js/issues/595) + test case<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/804739dbb75359b0034db0097fe82081e3870a53) Removed 'not recommend' label for --keep-case, see [#608](https://github.com/protobufjs/protobuf.js/issues/608)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9681854526f1813a6ef08becf130ef2fbc28b638) Added customizable linter configuration to pbjs<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9681854526f1813a6ef08becf130ef2fbc28b638) Added stdin support to pbjs and pbts<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/407223b5ceca3304bc65cb48888abfdc917d5800) Static code no longer uses IE8 support utility<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a017bf8a2dbdb7f9e7ce4c026bb6845174feb3b1) Generated static code now supports asJSON/from<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3c775535517b8385a1d3c1bf056f3da3b4266f8c) Added support for TypeScript enums to pbts<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0cda72a55a1f2567a5d981dc5d924e55b8070513) Added a few helpful comments to static code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/24b293c297feff8bda5ee7a2f8f3f83d77c156d0) Slightly beautify statically generated code<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/65637ffce20099df97ffbcdce50faccc8e97c366) Do not wrap main definition as a module and export directly instead<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/65637ffce20099df97ffbcdce50faccc8e97c366) Generate prettier definitions with --no-comments<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/20d8a2dd93d3bbb6990594286f992e703fc4e334) Added variable arguments support to tsd-jsdoc<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8493dbd9a923693e943f710918937d83ae3c4572) Reference dependency imports as a module to prevent name collisions, see [#596](https://github.com/protobufjs/protobuf.js/issues/596)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/39a2ea361c50d7f4aaa0408a0d55bb13823b906c) Removed now unnecessary comment lines in generated static code<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a4e41b55471d83a8bf265c6641c3c6e0eee82e31) Added notes on CSP-restricted environments to README, see [#593](https://github.com/protobufjs/protobuf.js/issues/593)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1a3effdad171ded0608e8da021ba8f9dd017f2ff) Added test case for asJSON with arrays=true, see [#597](https://github.com/protobufjs/protobuf.js/issues/597)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/751a90f509b68a5f410d1f1844ccff2fc1fc056a) Added a tape adapter to assert message equality accross browsers<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fde56c0de69b480343931264a01a1ead1e3156ec) Refactored some internal utility away<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/805291086f6212d1f108b3d8f36325cf1739c0bd) Reverted previous attempt on [#597](https://github.com/protobufjs/protobuf.js/issues/597)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c5160217ea95996375460c5403dfe37b913d392e) Minor tsd-jsdoc refactor<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/961dd03061fc2c43ab3bf22b3f9f5165504c1002) Removed unused sandbox files<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f625eb8b0762f8f5d35bcd5fc445e52b92d8e77d) Updated package.json of micro modules to reference types, see [#599](https://github.com/protobufjs/protobuf.js/issues/599)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/46ec8209b21cf9ff09ae8674e2a5bbc49fd4991b) Reference dependencies as imports in generated typescript definitions, see [#596](https://github.com/protobufjs/protobuf.js/issues/596)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3bab132b871798c7c50c60a4c14c2effdffa372e) Allow null values on optional long fields, see [#590](https://github.com/protobufjs/protobuf.js/issues/590)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/31da56c177f1e11ffe0072ad5f58a55e3f8008fd) Various jsdoc improvements and a workaround for d.ts generation, see [#592](https://github.com/protobufjs/protobuf.js/issues/592)<br />\n\n## [6.3.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.3.1)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/95ed6e9e8268711db24f44f0d7e58dd278ddac4c) Empty inner messages are always present on the wire + test case + removed now unused Writer#ldelim parameter, see [#585](https://github.com/protobufjs/protobuf.js/issues/585)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e8a4d5373b1a00cc6eafa5b201b91d0e250cc00b) Expose tsd-jsdoc's comments option to pbts as --no-comments, see [#587](https://github.com/protobufjs/protobuf.js/issues/587)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6fe099259b5985d873ba5bec88c049d7491a11cc) Increase child process max buffer when running jsdoc from pbts, see [#587](https://github.com/protobufjs/protobuf.js/issues/587)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3d84ecdb4788d71b5d3928e74db78e8e54695f0a) pbjs now generates more convenient dot-notation property accessors<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1e0ebc064e4f2566cebf525d526d0b701447bd6a) And fixed IE8 again (should probably just drop IE8 for good)<br />\n\n## [6.3.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.3.0)\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a97956b1322b6ee62d4fc9af885658cd5855e521) Moved camelCase/underScore away from util to where actually used<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c144e7386529b53235a4a5bdd8383bdb322f2825) Renamed asJSON option keys (enum to enums, long to longs) because enum is a reserved keyword<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5b9ade428dca2df6a13277522f2916e22092a98b) Moved JSON/Message conversion to its own source file and added Message/Type.from + test case, see [#575](https://github.com/protobufjs/protobuf.js/issues/575)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0b0de2458a1ade1ccd4ceb789697be13290f856b) Relicensed the library and its components to BSD-3-Clause to match the official implementation (again)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/22a64c641d4897965035cc80e92667bd243f182f) Dropped support for browser buffer entirely (is an Uint8Array anyway), ensures performance and makes things simpler<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/22a64c641d4897965035cc80e92667bd243f182f) Removed dead parts of the Reader API<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/964f65a9dd94ae0a18b8be3d9a9c1b0b1fdf6424) Refactored BufferReader/Writer to their own files and removed unnecessary operations (node always has FloatXXArray and browser buffer uses ieee anyway)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bfac0ea9afa3dbaf5caf79ddf0600c3c7772a538) Stripped out fallback encoder/decoder/verifier completely (even IE8 supports codegen), significantly reduces bundle size, can use static codegen elsewhere<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c3023a2f51fc74547f6c6e53cf75feed60f3a25c) Actually concatenate mixed custom options when parsing<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0d66b839df0acec2aea0566d2c0bbcec46c3cd1d) Fixed a couple of issues with alternative browser builds<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/33706cdc201bc863774c4af6ac2c38ad96a276e6) Properly set long defaults on prototypes<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0ea2740f0774b4c5c349b9c303f3fb2c2743c37b) Fixed reference error in minimal runtime, see [#580](https://github.com/protobufjs/protobuf.js/issues/580)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/741b6d8fde84d9574676a729a29a428d99f0a0a0) Non-repeated empty messages are always present on the wire, see [#581](https://github.com/protobufjs/protobuf.js/issues/581)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7fac9d6a39bf42d316c1676082a2d0804bc55934) Properly check Buffer.prototype.set with node v4<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3ad8108eab57e2b061ee6f1fddf964abe3f4cbc7) Prevent NRE and properly annotate verify signature in tsd-jsdoc, fixed [#572](https://github.com/protobufjs/protobuf.js/issues/572)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6c2415d599847cbdadc17dee3cdf369fc9facade) Fix directly using Buffer instead of util.Buffer<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/19e906c2a15acc6178b3bba6b19c2f021e681176) Added filter type to Namespace#lookup, fixes [#569](https://github.com/protobufjs/protobuf.js/issues/569)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9c9a66bf393d9d6927f35a9c18abf5d1c31db912) Fixed parsing enum inner options, see [#565](https://github.com/protobufjs/protobuf.js/issues/565)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ea7ba8b83890084d61012cb5386dc11dadfb3908) Fixed release links in README files<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/442471363f99e67fa97044f234a47b3c9b929dfa) Added a noparse build for completeness<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bfee1cc3624d0fa21f9553c2f6ce2fcf7fcc09b7) Now compresses .gz files using zopfli to make them useful beyond being just a reference<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/aed134aa1cd7edd801de77c736cf5efe6fa61cb0) Updated non-bundled google types folder with missing descriptors and added wrappers to core<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0b0de2458a1ade1ccd4ceb789697be13290f856b) Replaced the ieee754 implementation for old browsers with a faster, use-case specific one + simple test case<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/99ad9cc08721b834a197d4bbb67fa152d7ad79aa) Added .create to statically generated types and uppercase nested elements to reflection namespaces, see [#576](https://github.com/protobufjs/protobuf.js/issues/576)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/99ad9cc08721b834a197d4bbb67fa152d7ad79aa) Also added Namespace#getEnum for completeness, see [#576](https://github.com/protobufjs/protobuf.js/issues/576)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ef43acff547c0cd84cfb7a892fe94504a586e491) Added Namespace#getEnum and changed #lookupEnum to the same behavior, see [#576](https://github.com/protobufjs/protobuf.js/issues/576)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1fcfdfe21c1b321d975a8a96d133a452c9a9c0d8) Added a heap of coverage comments for usually unused code paths to open things up<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c234de7f0573ee30ed1ecb15aa82b74c0f994876) Added codegen test to determine if any ancient browsers don't actually support it<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fed2000e7e461efdb1c3a1a1aeefa8b255a7c20b) Added legacy groups support to pbjs, see [#568](https://github.com/protobufjs/protobuf.js/issues/568)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/974a1321da3614832aa0a5b2e7c923f66e4ba8ae) Initial support for legacy groups + test case, see [#568](https://github.com/protobufjs/protobuf.js/issues/568)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9c9a66bf393d9d6927f35a9c18abf5d1c31db912) Added asJSON bytes as Buffer, see [#566](https://github.com/protobufjs/protobuf.js/issues/566)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c60cd397e902ae6851c017f2c298520b8336cbee) Annotated callback types in pbjs-generated services, see [#582](https://github.com/protobufjs/protobuf.js/issues/582)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3e7e4fc59e6d2d6c862410b4b427fbedccdb237b) Removed type/ns alias comment in static target to not confuse jsdoc unnecessarily<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/99ad9cc08721b834a197d4bbb67fa152d7ad79aa) Made pbjs use loadSync for deterministic outputs, see [#573](https://github.com/protobufjs/protobuf.js/issues/573)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4d1f5facfcaaf5f2ab6a70b12443ff1b66e7b94e) Updated documentation on runtime and noparse builds<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c59647a7542cbc4292248787e5f32bb99a9b8d46) Fixed an issue with the changelog generator skipping some commits<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/24f2c03af9f13f5404259866fdc8fed33bfaae25) Added notes on how to use pbjs and pbts programmatically<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3544576116146b209246d71c7f7a9ed687950b26) Manually sorted old changelog entries<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d5812571f335bae68f924aa1098519683a9f3e44) Initial changelog generator, see [#574](https://github.com/protobufjs/protobuf.js/issues/574)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ab3e236a967a032a98267a648f84d129fdb4d4a6) Added static/JSON module interchangeability to README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7939a4bd8baca5f7e07530fc93f27911a6d91c6f) Updated README and bundler according to dynamic require calls<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/93e04f1db4a9ef3accff8d071c75be3d74c0cd4a) Added basic services test case<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b5a068f5b79b6f00c4b05d9ac458878650ffa09a) Just polyfill Buffer.from / .allocUnsafe for good<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4375a485789e14f7bf24bece819001154a03dca2) Added a test case to find out if all the fallbacks are just for IE8<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/deb2e82ed7eda41d065a09d120e91c0f7ecf1e6a) Commented out float assertions in float test including explanation<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d3ebd5745b024033fbc2410ecad4d4e02abd67db) Expose array implementation used with (older) browsers on util for tests<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b1b6a813c93da4c7459755186aa02ef2f3765c94) Updated test cases<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/99dc5faa7b39fdad8ebc102de4463f8deb7f48ff) Added assumptions to float test case<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/948ca2e3c5c62fedcd918d75539c261abf1a7347) Updated travis config to use C++11<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c59647a7542cbc4292248787e5f32bb99a9b8d46) Updated / added additional LICENSE files where appropriate<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/333f0221814be976874862dc83d0b216e07d4012) Integrated changelog into build process, now also has 'npm run make' for everything, see [#574](https://github.com/protobufjs/protobuf.js/issues/574)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ab3e236a967a032a98267a648f84d129fdb4d4a6) Minor optimizations through providing type-hints<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ab3e236a967a032a98267a648f84d129fdb4d4a6) Reverted shortened switch statements in verifier<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ab3e236a967a032a98267a648f84d129fdb4d4a6) Enums can't be map key types<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8ef6975b0bd372b79e9b638f43940424824e7176) Use custom require (now a micromodule) for all optional modules, see [#571](https://github.com/protobufjs/protobuf.js/issues/571)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e226f001e4e4633d64c52be4abc1915d7b7bd515) Support usage when size = 0<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/19e906c2a15acc6178b3bba6b19c2f021e681176) Reverted aliases frequently used in codegen for better gzip ratio<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/47b51ec95a540681cbed0bac1b2f02fc4cf0b73d) Shrinked bundle size - a bit<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f8451f0058fdf7a1fac15ffc529e4e899c6b343c) Can finally run with --trace-deopt again without crashes<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9c9a66bf393d9d6927f35a9c18abf5d1c31db912) Other minor optimizations<br />\n\n## [6.2.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.2.1)\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1a6fdc9a11fb08506d09351f8e853384c2b8be25) Added ParseOptions to protobuf.parse and --keep-case for .proto sources to pbjs, see [#564](https://github.com/protobufjs/protobuf.js/issues/564)<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fc383d0721d83f66b2d941f0d9361621839327e9) Better TypeScript definition support for @property-annotated objects<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4531d75cddee9a99adcac814d52613116ba789f3) Can't just inline longNeq but can be simplified<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8f25377cf99036794ba13b160a5060f312d1a7e7) Array abuse and varint optimization<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/90b201209a03e8022ada0ab9182f338fa0813651) Updated dependencies<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f1110b0993ec86e0a4aee1735bd75b901952cb36) Other minor improvements to short ifs<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c079c900e2d61c63d5508eafacbd00163d377482) Reader/Writer example<br />\n\n## [6.2.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.2.0)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9b7b92a4c7f8caa460d687778dc0628a74cdde37) Fixed reserved names re, also ensure valid service method names, see [#559](https://github.com/protobufjs/protobuf.js/issues/559)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a83425049c9a78c5607bc35e8089e08ce78a741e) Fix d.ts whitespace on empty lines, added tsd-jsdoc LICENSE<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5f9bede280aa998afb7898e8d2718b4a229e8e6f) Fix asJSON defaults option, make it work for repeated fields.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b0aef62191b65cbb305ece84a6652d76f98da259) Inlined any Reader/Writer#tag calls, also fixes [#556](https://github.com/protobufjs/protobuf.js/issues/556)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4d091d41caad9e63cd64003a08210b78878e01dd) Fix building default dist files with explicit runtime=false<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/096dfb686f88db38ed2d8111ed7aac36f8ba658a) Apply asJSON recursively<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/19c269f1dce1b35fa190f264896d0865a54a4fff) Ensure working reflection class names with minified builds<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9c769504e0ffa6cbe0b6f8cdc14f1231bed7ee34) Lazily resolve (some) cyclic dependencies, see [#560](https://github.com/protobufjs/protobuf.js/issues/560)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/da07d8bbbede4175cc45ca46d883210c1082e295) Added protobuf.roots to minimal runtime, see [#554](https://github.com/protobufjs/protobuf.js/issues/554)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8f407a18607334185afcc85ee98dc1478322bd01) Repo now includes a restructured version of tsd-jsdoc with our changes incorporated for issues/prs, see [#550](https://github.com/protobufjs/protobuf.js/issues/550)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1b5e4250415c6169eadb405561242f847d75044b) Updated pbjs arguments<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4750e3111b9fdb107d0fc811e99904fbcdbb6de1) Pipe tsd-jsdoc output (requires dcodeIO/tsd-jsdoc/master) and respect cwd, see [#550](https://github.com/protobufjs/protobuf.js/issues/550)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/75f4b6cb6325a3fc7cd8fed3de5dbe0b6b29c748) tsd-jsdoc progress<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/766171e4c8b6650ea9c6bc3e76c9c96973c2f546) README<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c33835cb1fe1872d823e94b0fff024dc624323e8) Added GH issue template<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6f9ffb6307476d48f45dc4f936744b82982d386b) Path micromodule, dependencies<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0b9b1d8505743995c5328daab1f1e124debc63bd) Test case for [#556](https://github.com/protobufjs/protobuf.js/issues/556)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/74b2c5c5d33a46c3751ebeadc9d934d4ccb8286c) Raw alloc benchmark<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fb74223b7273530d8baa53437ee96c65a387436d) Other minor optimizations<br />\n\n## [6.1.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.1.1)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/baea920fa6bf5746e0a7888cdbb089cd5d94fc90) Properly encode/decode map kv pairs as repeated messages (codegen and fallback), see [#547](https://github.com/protobufjs/protobuf.js/issues/547)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/28a1d26f28daf855c949614ef485237c6bf316e5) Make genVerifyKey actually generate conditions for 32bit values and bool, fixes [#546](https://github.com/protobufjs/protobuf.js/issues/546)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3e9d8ea9a5cbb2e029b5c892714edd6926d2e5a7) Fix to generation of verify methods for bytes<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e7893675ccdf18f0fdaea8f9a054a6b5402b060e) Take special care of oneofs when encoding (i.e. when explicitly set to defaults), see [#542](https://github.com/protobufjs/protobuf.js/issues/542)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/52cd8b5a891ec8e11611127c8cfa6b3a91ff78e3) Added Message#asJSON option for bytes conversion<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/01365ba9116ca1649b682635bb29814657c4133c) Added Namespace#lookupType and Namespace#lookupService (throw instead of returning null), see [#544](https://github.com/protobufjs/protobuf.js/issues/544)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a54fbc918ef6bd627113f05049ff704e07bf33b4) Provide prebuilt browser versions of the static runtime<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3783af7ca9187a1d9b1bb278ca69e0188c7e4c66) Initial pbts CLI for generating TypeScript definitions, see [#550](https://github.com/protobufjs/protobuf.js/issues/550)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b8bce03405196b1779727f246229fd9217b4303d) Refactored json/static-module targets to use common wrappers<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/691231fbc453a243f48a97bfb86794ab5718ef49) Refactor cli to support multiple built-in wrappers, added named roots instead of always using global.root and added additionally necessary eslint comments, see [#540](https://github.com/protobufjs/protobuf.js/issues/540)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e3e77d0c7dc973d3a5948a49d123bdaf8a048030) Annotate namespaces generated by static target, see [#550](https://github.com/protobufjs/protobuf.js/issues/550)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/aff21a71e6bd949647b1b7721ea4e1fe16bcd933) static target: Basic support for oneof fields, see [#542](https://github.com/protobufjs/protobuf.js/issues/542)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b6b00aa7b0cd35e0e8f3c16b322788e9942668d4) Fix to reflection documentation<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ed86f3acbeb6145be5f24dcd05efb287b539e61b) README on minimal runtime / available downloads<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d31590b82d8bafe6657bf877d403f01a034ab4ba) Notes on descriptors vs static modules<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ce41d0ef21cee2d918bdc5c3b542d3b7638b6ead) A lot of minor optimizations to performance and gzip ratio<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ecbb4a52fbab445e63bf23b91539e853efaefa47) Minimized base64 tables<br />\n\n## [6.1.0](https://github.com/protobufjs/protobuf.js/releases/tag/6.1.0)\n\n### Breaking\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a46cc4934b7e888ae80e06fd7fdf91e5bc7f54f5) Removed as-function overload for Reader/Writer, profiler stub, optimized version of Reader#int32<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7983ee0ba15dc5c1daad82a067616865051848c9) Refactored Prototype and inherits away, is now Class and Message for more intuitive documentation and type refs<br />\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/c3c70fe3a47fd4f7c85dc80e1af7d9403fe349cd) Fixed failing test case on node < 6<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/66be5983321dd06460382d045eb87ed72a186776) Fixed serialization order of sfixed64, fixes [#536](https://github.com/protobufjs/protobuf.js/issues/536)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7def340833f9f1cc41f4835bd0d62e203b54d9eb) Fixed serialization order of fixed64, fallback to parseInt with no long lib, see [#534](https://github.com/protobufjs/protobuf.js/issues/534)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/98a58d40ca7ee7afb1f76c5804e82619104644f6) Actually allow undefined as service method type, fixes [#528](https://github.com/protobufjs/protobuf.js/issues/528)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/38d867fc50a4d7eb1ca07525c9e4c71b8782443e) Do not skip optional delimiter after aggregate options, fixes [#520](https://github.com/protobufjs/protobuf.js/issues/520)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/67449db7c7416cbc59ad230c168cf6e6b6dba0c5) Verify empty base64 encoded strings for bytes fields, see [#535](https://github.com/protobufjs/protobuf.js/issues/535)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ef0fcb6d525c5aab13a39b4f393adf03f751c8c9) wrong spell role should be rule<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/55db92e21a26c04f524aeecb2316968c000e744d) decodeDelimited always forks if writer is specified, see [#531](https://github.com/protobufjs/protobuf.js/issues/531)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ebae1e18152617f11ac07827828f5740d4f2eb7e) Mimic spec-compliant behaviour in oneof getVirtual, see [#523](https://github.com/protobufjs/protobuf.js/issues/523)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/a0398f5880c434ff88fd8d420ba07cc29c5d39d3) Initial base64 string support for bytes fields, see [#535](https://github.com/protobufjs/protobuf.js/issues/535)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a6c00c3e1def5d35c7fcaa1bbb6ce4e0fe67544) Initial type-checking verifier, see [#526](https://github.com/protobufjs/protobuf.js/issues/526), added to bench out of competition<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3aa984e063cd73e4687102b4abd8adc16582dbc4) Initial loadSync (node only), see [#529](https://github.com/protobufjs/protobuf.js/issues/529)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f1370ff5b0db2ebb73b975a3d7c7bd5b901cbfac) Initial RPC service implementaion, see [#529](https://github.com/protobufjs/protobuf.js/issues/529)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/090d8eaf10704a811a73e1becd52f2307cbcad48) added 'defaults' option to Prototype#asJSON, see [#521](https://github.com/protobufjs/protobuf.js/issues/521)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7c28483d65cde148e61fe9993f1716960b39e049) Use Uint8Array pool in browsers, just like node does with buffers<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4157a0ec2e54c4d19794cb16edddcd8d4fbd3e76) Also validate map fields, see [#526](https://github.com/protobufjs/protobuf.js/issues/526) (this really needs some tests)<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0ce099bf4f4666fd00403a2839e6da628b8328a9) Added json-module target to pbjs, renamed static to static-module, see [#522](https://github.com/protobufjs/protobuf.js/issues/522)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1d99442fe65fcaa2f9e33cc0186ef1336057e0cf) updated internals and static target to use immutable objects on prototypes<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e6eaa91b9fe021b3356d4d7e42033a877bc45871) Added a couple of alternative signatures, protobuf.load returns promise or undefined, aliased Reader/Writer-as-function signature with Reader/Writer.create for typed dialects, see [#518](https://github.com/protobufjs/protobuf.js/issues/518)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9df6a3d4a654c3e122f97d9a594574c7bbb412da) Added variations for Root#load, see [#527](https://github.com/protobufjs/protobuf.js/issues/527)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/193e65c006a8df8e9b72e0f23ace14a94952ee36) Added benchmark and profile related information to README<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/228a2027de35238feb867cb0485c78c755c4d17d) Added service example to README, see [#529](https://github.com/protobufjs/protobuf.js/issues/529)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/1a8c720714bf867f1f0195b4690faefa4f65e66a) README on tests<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/014fb668dcf853874c67e3e0aeb7b488a149d35c) Update README/dist to reflect recent changes<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/11d844c010c5a22eff9d5824714fb67feca77b26) Minimal documentation for micromodules<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/47608dd8595b0df2b30dd18fef4b8207f73ed56a) Document all the callbacks, see [#527](https://github.com/protobufjs/protobuf.js/issues/527)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3891ab07bbe20cf84701605aa62453a6dbdb6af2) Documented streaming-rpc example a bit<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5606cb1bc41bc90cb069de676650729186b38640) Removed the need for triple-slash references in .d.ts by providing a minimal Long interface, see [#527](https://github.com/protobufjs/protobuf.js/issues/527), see [#530](https://github.com/protobufjs/protobuf.js/issues/530)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/adf3cc3d340f8b2a596c892c64457b15e42a771b) Transition to micromodules<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f3a9589b74af6a1bf175f2b1994badf703d7abc4) Refactored argument order of utf8 for plausibility<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/14c207ed6e05a61e756fa4192efb2fa219734dd6) Restructured reusable micromodules<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/b510ba258986271f07007aebc5dcfea7cfd90cf4) Can't use Uint8Array#set on node < 6 buffers<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/78952a50ceee8e196b4f156eb01f7f693b5b8aac) Test case for [#531](https://github.com/protobufjs/protobuf.js/issues/531)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/954577c6b421f7d7f4905bcc32f57e4ebaf548da) Safer signaling for synchronous load, see [#529](https://github.com/protobufjs/protobuf.js/issues/529)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9ea3766ff1b8fb7ccad028f44efe27d3b019eeb7) Proper end of stream signaling to rpcImpl, see [#529](https://github.com/protobufjs/protobuf.js/issues/529)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/e4faf7fac9b34d4776f3c15dfef8d2ae54104567) Moved event emitter to util, also accepts listener context, see [#529](https://github.com/protobufjs/protobuf.js/issues/529)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9bdec62793ce77c954774cc19106bde4132f24fc) Probably the worst form of hiding require programmatically, see [#527](https://github.com/protobufjs/protobuf.js/issues/527)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4462d8b05d3aba37c865cf53e09b3199cf051a92) Attempt to hide require('fs') from webpack, see [#527](https://github.com/protobufjs/protobuf.js/issues/527)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/7c3bf8d32cbf831b251730b3876c35c901926300) Trying out jsdoc variations, see [#527](https://github.com/protobufjs/protobuf.js/issues/527)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/bb4059467287fefda8f966de575fd0f8f9690bd3) by the way, why not include the json->proto functionality into \"util\"?<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f1008e6ee53ee50358e19c10df8608e950be4be3) Update proto.js<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fc9014822d9cdeae8c6e454ccb66ee28f579826c) Automatic profile generation and processing<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/2a2f6dcab5beaaa98e55a005b3d02643c45504d6) Generalized buffer pool and moved it to util<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/53a16bf3ada4a60cc09757712e0046f3f2d9d094) Make shields visible on npm, yey<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/9004b9d0c5135a7f6df208ea658258bf2f9e6fc9) More shields, I love shields, and maybe a workaround for travis timing out when sauce takes forever<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/060a7916a2715a9e4cd4d05d7c331bec33e60b7e) Trying SauceLabs with higher concurrency<br />\n\n## [6.0.2](https://github.com/protobufjs/protobuf.js/releases/tag/6.0.2)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/23d664384900eb65e44910def45f04be996fbba1) Fix packable float/double see [#513](https://github.com/protobufjs/protobuf.js/issues/513)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/54283d39c4c955b6a84f7f53d4940eec39e4df5e) Handle oneofs in prototype ctor, add non-ES5 fallbacks, test case<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/0ae66752362899b8407918a759b09938e82436e1) Be nice to AMD, allow reconfiguration of Reader/Writer interface<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/00f3574ef4ee8b237600e41839bf0066719c4469) Initial static codegen target for reference<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/81e36a7c14d89b487dfe7cfb2f8380fcdf0df392) pbjs static target services support<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4885b8239eb74c72e665787ea0ece3336e493d7f) pbjs static target progress, uses customizable wrapper template<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/ad5abe7bac7885ba4f68df7eeb800d2e3b81750b) Static pbjs target progress, now generates usable CommonJS code, see [#512](https://github.com/protobufjs/protobuf.js/issues/512)<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d9634d218849fb49ff5dfb4597bbb2c2d43bbf08) TypeScript example<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/fce8276193a5a9fabad5e5fbeb2ccd4f0f3294a9) Adjectives, notes on browserify<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/23d664384900eb65e44910def45f04be996fbba1) Refactor runtime util into separate file, reader/writer uses runtime util<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/f91c432a498bebc0adecef1562061b392611f51a) Also optimize reader with what we have learned<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d83f799519fe69808c88e83d9ad66c645d15e963) More (shameless) writer over-optimization<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/8a2dbc610a06fe3a1a2695a3ab032d073b77760d) Trading package size for float speed<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/95c5538cfaf1daf6b4990f6aa7599779aaacf99f) Skip defining getters and setters on IE8 entirely, automate defining fallbacks<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/09865d069303e795e475c82afe2b2267abaa59ea) Unified proto/reflection/classes/static encoding API to always return a writer<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/98d6ae186a48416e4ff3030987caed285f40a4f7) plain js utf8 is faster for short strings<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/79fbbf48b8e4dc9c41dcbdef2b73c5f2608b0318) improve TypeScript support. add simple test script.<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/96fa07adec8b0ae05e07c2c40383267f25f2fc92) Use long.js dependency in tests, reference types instead of paths in .d.ts see [#503](https://github.com/protobufjs/protobuf.js/issues/503)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/5785dee15d07fbcd14025a96686707173bd649a0) Restructured encoder / decoder to better support static code gen<br />\n\n## [6.0.1](https://github.com/protobufjs/protobuf.js/releases/tag/6.0.1)\n\n### Fixed\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/799c1c1a84b255d1831cc84c3d24e61b36fa2530) Add support for long strings, fixes [#509](https://github.com/protobufjs/protobuf.js/issues/509)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6e5fdb67cb34f90932e95a51370e1652acc55b4c) expose zero on LongBits, fixes [#508](https://github.com/protobufjs/protobuf.js/issues/508)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/aa922c07490f185c5f97cf28ebbd65200fc5e377) Fixed issues with Root.fromJSON/#addJSON, search global for Long<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/51fe45656b530efbba6dad92f92db2300aa18761) Properly exclude browserify's annoying _process, again, fixes [#502](https://github.com/protobufjs/protobuf.js/issues/502)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/3c16e462a28c36abbc8a176eab9ac2e10ba68597) Remember loaded files earlier to prevent race conditions, fixes [#501](https://github.com/protobufjs/protobuf.js/issues/501)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4012a00a0578185d92fb6e7d3babd059fee6d6ab) Allow negative enum ids even if super inefficient (encodes as 10 bytes), fixes [#499](https://github.com/protobufjs/protobuf.js/issues/499), fixes [#500](https://github.com/protobufjs/protobuf.js/issues/500)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/96dd8f1729ad72e29dbe08dd01bc0ba08446dbe6) set resolvedResponseType on resolve(), fixes [#497](https://github.com/protobufjs/protobuf.js/issues/497)<br />\n\n### New\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/d3ae961765e193ec11227d96d699463de346423f) Initial take on runtime services, see [#507](https://github.com/protobufjs/protobuf.js/issues/507)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/90cd46b3576ddb2d0a6fc6ae55da512db4be3acc) Include dist/ in npm package for frontend use<br />\n\n### CLI\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/4affa1b7c0544229fb5f0d3948df6d832f6feadb) pbjs proto target field options, language-level compliance with jspb test.proto<br />\n\n### Docs\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/6a06e95222d741c47a51bcec85cd20317de7c0b0) always use Uint8Array in docs for tsd, see [#503](https://github.com/protobufjs/protobuf.js/issues/503)<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/637698316e095fc35f62a304daaca22654974966) Notes on dist files<br />\n\n### Other\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/29ff3f10e367d6a2ae15fb4254f4073541559c65) Update eslint env<br />\n[:hash:](https://github.com/protobufjs/protobuf.js/commit/943be1749c7d37945c11d1ebffbed9112c528d9f) Browser field in package.json isn't required<br />\n"
  },
  {
    "path": "LICENSE",
    "content": "This license applies to all parts of protobuf.js except those files\neither explicitly including or referencing a different license or\nlocated in a directory containing a different LICENSE file.\n\n---\n\nCopyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n---\n\nCode generated by the command line utilities is owned by the owner\nof the input file used when generating it. This code is not\nstandalone and requires a support library to be linked with it. This\nsupport library is itself covered by the above license.\n"
  },
  {
    "path": "README.md",
    "content": "<h1><p align=\"center\"><img alt=\"protobuf.js\" src=\"https://github.com/protobufjs/protobuf.js/raw/master/pbjs.svg\" height=\"100\" /><br/>protobuf.js</p></h1>\n<p align=\"center\">\n  <a href=\"https://github.com/protobufjs/protobuf.js/actions/workflows/test.yml\"><img src=\"https://img.shields.io/github/actions/workflow/status/protobufjs/protobuf.js/test.yml?branch=master&label=build&logo=github\" alt=\"\"></a>\n  <a href=\"https://github.com/protobufjs/protobuf.js/actions/workflows/release.yaml\"><img src=\"https://img.shields.io/github/actions/workflow/status/protobufjs/protobuf.js/release.yaml?branch=master&label=release&logo=github\" alt=\"\"></a>\n  <a href=\"https://npmjs.org/package/protobufjs\"><img src=\"https://img.shields.io/npm/v/protobufjs.svg?logo=npm\" alt=\"\"></a>\n  <a href=\"https://npmjs.org/package/protobufjs\"><img src=\"https://img.shields.io/npm/dm/protobufjs.svg?label=downloads&logo=npm\" alt=\"\"></a>\n  <a href=\"https://www.jsdelivr.com/package/npm/protobufjs\"><img src=\"https://img.shields.io/jsdelivr/npm/hm/protobufjs?label=requests&logo=jsdelivr\" alt=\"\"></a>\n</p>\n\n**Protocol Buffers** are a language-neutral, platform-neutral, extensible way of serializing structured data for use in communications protocols, data storage, and more, originally designed at Google ([see](https://protobuf.dev/)).\n\n**protobuf.js** is a pure JavaScript implementation with [TypeScript](https://www.typescriptlang.org) support for [Node.js](https://nodejs.org) and the browser. It's easy to use, does not sacrifice on performance, has good conformance and works out of the box with [.proto](https://protobuf.dev/programming-guides/proto3/) files!\n\nContents\n--------\n\n* [Installation](#installation)<br />\n  How to include protobuf.js in your project.\n\n* [Usage](#usage)<br />\n  A brief introduction to using the toolset.\n\n  * [Valid Message](#valid-message)\n  * [Toolset](#toolset)<br />\n\n* [Examples](#examples)<br />\n  A few examples to get you started.\n\n  * [Using .proto files](#using-proto-files)\n  * [Using JSON descriptors](#using-json-descriptors)\n  * [Using reflection only](#using-reflection-only)\n  * [Using custom classes](#using-custom-classes)\n  * [Using services](#using-services)\n  * [Usage with TypeScript](#usage-with-typescript)<br />\n\n* [Additional documentation](#additional-documentation)<br />\n  A list of available documentation resources.\n\n* [Performance](#performance)<br />\n  A few internals and a benchmark on performance.\n\n* [Compatibility](#compatibility)<br />\n  Notes on compatibility regarding browsers and optional libraries.\n\n* [Building](#building)<br />\n  How to build the library and its components yourself.\n\nInstallation\n---------------\n\n### Node.js\n\n```sh\nnpm install protobufjs --save\n```\n\n```js\n// Static code + Reflection + .proto parser\nvar protobuf = require(\"protobufjs\");\n\n// Static code + Reflection\nvar protobuf = require(\"protobufjs/light\");\n\n// Static code only\nvar protobuf = require(\"protobufjs/minimal\");\n```\n\nThe optional [command line utility](./cli/) to generate static code and reflection bundles lives in the `protobufjs-cli` package and can be installed separately:\n\n```sh\nnpm install protobufjs-cli --save-dev\n```\n\n### Browsers\n\nPick the variant matching your needs and replace the version tag with the exact [release](https://github.com/protobufjs/protobuf.js/tags) your project depends upon. For example, to use the minified full variant:\n\n```html\n<script src=\"//cdn.jsdelivr.net/npm/protobufjs@7.X.X/dist/protobuf.min.js\"></script>\n```\n\n| Distribution | Location\n|--------------|--------------------------------------------------------\n| Full         | <https://cdn.jsdelivr.net/npm/protobufjs/dist/>\n| Light        | <https://cdn.jsdelivr.net/npm/protobufjs/dist/light/>\n| Minimal      | <https://cdn.jsdelivr.net/npm/protobufjs/dist/minimal/>\n\nAll variants support CommonJS and AMD loaders and export globally as `window.protobuf`.\n\nUsage\n-----\n\nBecause JavaScript is a dynamically typed language, protobuf.js utilizes the concept of a **valid message** in order to provide the best possible [performance](#performance) (and, as a side product, proper typings):\n\n### Valid message\n\n> A valid message is an object (1) not missing any required fields and (2) exclusively composed of JS types understood by the wire format writer.\n\nThere are two possible types of valid messages and the encoder is able to work with both of these for convenience:\n\n* **Message instances** (explicit instances of message classes with default values on their prototype) naturally satisfy the requirements of a valid message and\n* **Plain JavaScript objects** that just so happen to be composed in a way satisfying the requirements of a valid message as well.\n\nIn a nutshell, the wire format writer understands the following types:\n\n| Field type | Expected JS type (create, encode) | Conversion (fromObject)\n|------------|-----------------------------------|------------------------\n| s-/u-/int32<br />s-/fixed32 | `number` (32 bit integer) | <code>value &#124; 0</code> if signed<br />`value >>> 0` if unsigned\n| s-/u-/int64<br />s-/fixed64 | `Long`-like (optimal)<br />`number` (53 bit integer) | `Long.fromValue(value)` with long.js<br />`parseInt(value, 10)` otherwise\n| float<br />double | `number` | `Number(value)`\n| bool | `boolean` | `Boolean(value)`\n| string | `string` | `String(value)`\n| bytes | `Uint8Array` (optimal)<br />`Buffer` (optimal under node)<br />`Array.<number>` (8 bit integers) | `base64.decode(value)` if a `string`<br />`Object` with non-zero `.length` is assumed to be buffer-like\n| enum | `number` (32 bit integer) | Looks up the numeric id if a `string`\n| message | Valid message | `Message.fromObject(value)`\n| repeated T | `Array<T>` | Copy\n| map<K, V> | `Object<K,V>` | Copy\n\n* Explicit `undefined` and `null` are considered as not set if the field is optional.\n* Maps are objects where the key is the string representation of the respective value or an 8 characters long hash string for `Long`-likes.\n\n### Toolset\n\nWith that in mind and again for performance reasons, each message class provides a distinct set of methods with each method doing just one thing. This avoids unnecessary assertions / redundant operations where performance is a concern but also forces a user to perform verification (of plain JavaScript objects that *might* just so happen to be a valid message) explicitly where necessary - for example when dealing with user input.\n\n**Note** that `Message` below refers to any message class.\n\n* **Message.verify**(message: `Object`): `null|string`<br />\n  verifies that a **plain JavaScript object** satisfies the requirements of a valid message and thus can be encoded without issues. Instead of throwing, it returns the error message as a string, if any.\n\n  ```js\n  var payload = \"invalid (not an object)\";\n  var err = AwesomeMessage.verify(payload);\n  if (err)\n    throw Error(err);\n  ```\n\n* **Message.encode**(message: `Message|Object` [, writer: `Writer`]): `Writer`<br />\n  encodes a **message instance** or valid **plain JavaScript object**. This method does not implicitly verify the message and it's up to the user to make sure that the payload is a valid message.\n\n  ```js\n  var buffer = AwesomeMessage.encode(message).finish();\n  ```\n\n* **Message.encodeDelimited**(message: `Message|Object` [, writer: `Writer`]): `Writer`<br />\n  works like `Message.encode` but additionally prepends the length of the message as a varint.\n\n* **Message.decode**(reader: `Reader|Uint8Array`): `Message`<br />\n  decodes a buffer to a **message instance**. If required fields are missing, it throws a `util.ProtocolError` with an `instance` property set to the so far decoded message. If the wire format is invalid, it throws an `Error`.\n\n  ```js\n  try {\n    var decodedMessage = AwesomeMessage.decode(buffer);\n  } catch (e) {\n      if (e instanceof protobuf.util.ProtocolError) {\n        // e.instance holds the so far decoded message with missing required fields\n      } else {\n        // wire format is invalid\n      }\n  }\n  ```\n\n* **Message.decodeDelimited**(reader: `Reader|Uint8Array`): `Message`<br />\n  works like `Message.decode` but additionally reads the length of the message prepended as a varint.\n\n* **Message.create**(properties: `Object`): `Message`<br />\n  creates a new **message instance** from a set of properties that satisfy the requirements of a valid message. Where applicable, it is recommended to prefer `Message.create` over `Message.fromObject` because it doesn't perform possibly redundant conversion.\n\n  ```js\n  var message = AwesomeMessage.create({ awesomeField: \"AwesomeString\" });\n  ```\n\n* **Message.fromObject**(object: `Object`): `Message`<br />\n  converts any non-valid **plain JavaScript object** to a **message instance** using the conversion steps outlined within the table above.\n\n  ```js\n  var message = AwesomeMessage.fromObject({ awesomeField: 42 });\n  // converts awesomeField to a string\n  ```\n\n* **Message.toObject**(message: `Message` [, options: `ConversionOptions`]): `Object`<br />\n  converts a **message instance** to an arbitrary **plain JavaScript object** for interoperability with other libraries or storage. The resulting plain JavaScript object *might* still satisfy the requirements of a valid message depending on the actual conversion options specified, but most of the time it does not.\n\n  ```js\n  var object = AwesomeMessage.toObject(message, {\n    enums: String,  // enums as string names\n    longs: String,  // longs as strings (requires long.js)\n    bytes: String,  // bytes as base64 encoded strings\n    defaults: true, // includes default values\n    arrays: true,   // populates empty arrays (repeated fields) even if defaults=false\n    objects: true,  // populates empty objects (map fields) even if defaults=false\n    oneofs: true    // includes virtual oneof fields set to the present field's name\n  });\n  ```\n\nFor reference, the following diagram aims to display relationships between the different methods and the concept of a valid message:\n\n<p align=\"center\"><img alt=\"Toolset Diagram\" src=\"https://protobufjs.github.io/protobuf.js/toolset.svg\" /></p>\n\n> In other words: `verify` indicates that calling `create` or `encode` directly on the plain object will [result in a valid message respectively] succeed. `fromObject`, on the other hand, does conversion from a broader range of plain objects to create valid messages. ([ref](https://github.com/protobufjs/protobuf.js/issues/748#issuecomment-291925749))\n\nExamples\n--------\n\n### Using .proto files\n\nIt is possible to load existing .proto files using the full library, which parses and compiles the definitions to ready to use (reflection-based) message classes:\n\n```protobuf\n// awesome.proto\npackage awesomepackage;\nsyntax = \"proto3\";\n\nmessage AwesomeMessage {\n    string awesome_field = 1; // becomes awesomeField\n}\n```\n\n```js\nprotobuf.load(\"awesome.proto\", function(err, root) {\n    if (err)\n        throw err;\n\n    // Obtain a message type\n    var AwesomeMessage = root.lookupType(\"awesomepackage.AwesomeMessage\");\n\n    // Exemplary payload\n    var payload = { awesomeField: \"AwesomeString\" };\n\n    // Verify the payload if necessary (i.e. when possibly incomplete or invalid)\n    var errMsg = AwesomeMessage.verify(payload);\n    if (errMsg)\n        throw Error(errMsg);\n\n    // Create a new message\n    var message = AwesomeMessage.create(payload); // or use .fromObject if conversion is necessary\n\n    // Encode a message to an Uint8Array (browser) or Buffer (node)\n    var buffer = AwesomeMessage.encode(message).finish();\n    // ... do something with buffer\n\n    // Decode an Uint8Array (browser) or Buffer (node) to a message\n    var message = AwesomeMessage.decode(buffer);\n    // ... do something with message\n\n    // If the application uses length-delimited buffers, there is also encodeDelimited and decodeDelimited.\n\n    // Maybe convert the message back to a plain object\n    var object = AwesomeMessage.toObject(message, {\n        longs: String,\n        enums: String,\n        bytes: String,\n        // see ConversionOptions\n    });\n});\n```\n\nAdditionally, promise syntax can be used by omitting the callback, if preferred:\n\n```js\nprotobuf.load(\"awesome.proto\")\n    .then(function(root) {\n       ...\n    });\n```\n\n### Using JSON descriptors\n\nThe library utilizes JSON descriptors that are equivalent to a .proto definition. For example, the following is identical to the .proto definition seen above:\n\n```json\n// awesome.json\n{\n  \"nested\": {\n    \"awesomepackage\": {\n      \"nested\": {\n        \"AwesomeMessage\": {\n          \"fields\": {\n            \"awesomeField\": {\n              \"type\": \"string\",\n              \"id\": 1\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nJSON descriptors closely resemble the internal reflection structure:\n\n| Type (T)           | Extends            | Type-specific properties\n|--------------------|--------------------|-------------------------\n| *ReflectionObject* |                    | options\n| *Namespace*        | *ReflectionObject* | nested\n| Root               | *Namespace*        | **nested**\n| Type               | *Namespace*        | **fields**\n| Enum               | *ReflectionObject* | **values**\n| Field              | *ReflectionObject* | rule, **type**, **id**\n| MapField           | Field              | **keyType**\n| OneOf              | *ReflectionObject* | **oneof** (array of field names)\n| Service            | *Namespace*        | **methods**\n| Method             | *ReflectionObject* | type, **requestType**, **responseType**, requestStream, responseStream\n\n* **Bold properties** are required. *Italic types* are abstract.\n* `T.fromJSON(name, json)` creates the respective reflection object from a JSON descriptor\n* `T#toJSON()` creates a JSON descriptor from the respective reflection object (its name is used as the key within the parent)\n\nExclusively using JSON descriptors instead of .proto files enables the use of just the light library (the parser isn't required in this case).\n\nA JSON descriptor can either be loaded the usual way:\n\n```js\nprotobuf.load(\"awesome.json\", function(err, root) {\n    if (err) throw err;\n\n    // Continue at \"Obtain a message type\" above\n});\n```\n\nOr it can be loaded inline:\n\n```js\nvar jsonDescriptor = require(\"./awesome.json\"); // exemplary for node\n\nvar root = protobuf.Root.fromJSON(jsonDescriptor);\n\n// Continue at \"Obtain a message type\" above\n```\n\n### Using reflection only\n\nBoth the full and the light library include full reflection support. One could, for example, define the .proto definitions seen in the examples above using just reflection:\n\n```js\n...\nvar Root  = protobuf.Root,\n    Type  = protobuf.Type,\n    Field = protobuf.Field;\n\nvar AwesomeMessage = new Type(\"AwesomeMessage\").add(new Field(\"awesomeField\", 1, \"string\"));\n\nvar root = new Root().define(\"awesomepackage\").add(AwesomeMessage);\n\n// Continue at \"Create a new message\" above\n...\n```\n\nDetailed information on the reflection structure is available within the [API documentation](#additional-documentation).\n\n### Using custom classes\n\nMessage classes can also be extended with custom functionality and it is also possible to register a custom constructor with a reflected message type:\n\n```js\n...\n\n// Define a custom constructor\nfunction AwesomeMessage(properties) {\n    // custom initialization code\n    ...\n}\n\n// Register the custom constructor with its reflected type (*)\nroot.lookupType(\"awesomepackage.AwesomeMessage\").ctor = AwesomeMessage;\n\n// Define custom functionality\nAwesomeMessage.customStaticMethod = function() { ... };\nAwesomeMessage.prototype.customInstanceMethod = function() { ... };\n\n// Continue at \"Create a new message\" above\n```\n\n(*) Besides referencing its reflected type through `AwesomeMessage.$type` and `AwesomeMesage#$type`, the respective custom class is automatically populated with:\n\n* `AwesomeMessage.create`\n* `AwesomeMessage.encode` and `AwesomeMessage.encodeDelimited`\n* `AwesomeMessage.decode` and `AwesomeMessage.decodeDelimited`\n* `AwesomeMessage.verify`\n* `AwesomeMessage.fromObject`, `AwesomeMessage.toObject` and `AwesomeMessage#toJSON`\n\nAfterwards, decoded messages of this type are `instanceof AwesomeMessage`.\n\nAlternatively, it is also possible to reuse and extend the internal constructor if custom initialization code is not required:\n\n```js\n...\n\n// Reuse the internal constructor\nvar AwesomeMessage = root.lookupType(\"awesomepackage.AwesomeMessage\").ctor;\n\n// Define custom functionality\nAwesomeMessage.customStaticMethod = function() { ... };\nAwesomeMessage.prototype.customInstanceMethod = function() { ... };\n\n// Continue at \"Create a new message\" above\n```\n\n### Using services\n\nThe library also supports consuming services but it doesn't make any assumptions about the actual transport channel. Instead, a user must provide a suitable RPC implementation, which is an asynchronous function that takes the reflected service method, the binary request and a node-style callback as its parameters:\n\n```js\nfunction rpcImpl(method, requestData, callback) {\n    // perform the request using an HTTP request or a WebSocket for example\n    var responseData = ...;\n    // and call the callback with the binary response afterwards:\n    callback(null, responseData);\n}\n```\n\nBelow is a working example with a typescript implementation using grpc npm package.\n```ts\nconst grpc = require('grpc')\n\nconst Client = grpc.makeGenericClientConstructor({})\nconst client = new Client(\n  grpcServerUrl,\n  grpc.credentials.createInsecure()\n)\n\nconst rpcImpl = function(method, requestData, callback) {\n  client.makeUnaryRequest(\n    method.name,\n    arg => arg,\n    arg => arg,\n    requestData,\n    callback\n  )\n}\n```\n\nExample:\n\n```protobuf\n// greeter.proto\nsyntax = \"proto3\";\n\nservice Greeter {\n    rpc SayHello (HelloRequest) returns (HelloReply) {}\n}\n\nmessage HelloRequest {\n    string name = 1;\n}\n\nmessage HelloReply {\n    string message = 1;\n}\n```\n\n```js\n...\nvar Greeter = root.lookup(\"Greeter\");\nvar greeter = Greeter.create(/* see above */ rpcImpl, /* request delimited? */ false, /* response delimited? */ false);\n\ngreeter.sayHello({ name: 'you' }, function(err, response) {\n    console.log('Greeting:', response.message);\n});\n```\n\nServices also support promises:\n\n```js\ngreeter.sayHello({ name: 'you' })\n    .then(function(response) {\n        console.log('Greeting:', response.message);\n    });\n```\n\nThere is also an [example for streaming RPC](https://github.com/protobufjs/protobuf.js/blob/master/examples/streaming-rpc.js).\n\nNote that the service API is meant for clients. Implementing a server-side endpoint pretty much always requires transport channel (i.e. http, websocket, etc.) specific code with the only common denominator being that it decodes and encodes messages.\n\n### Usage with TypeScript\n\nThe library ships with its own [type definitions](https://github.com/protobufjs/protobuf.js/blob/master/index.d.ts) and modern editors like [Visual Studio Code](https://code.visualstudio.com/) will automatically detect and use them for code completion.\n\nThe npm package depends on [@types/node](https://www.npmjs.com/package/@types/node) because of `Buffer` and [@types/long](https://www.npmjs.com/package/@types/long) because of `Long`. If you are not building for node and/or not using long.js, it should be safe to exclude them manually.\n\n#### Using the JS API\n\nThe API shown above works pretty much the same with TypeScript. However, because everything is typed, accessing fields on instances of dynamically generated message classes requires either using bracket-notation (i.e. `message[\"awesomeField\"]`) or explicit casts. Alternatively, it is possible to use a [typings file generated for its static counterpart](#pbts-for-typescript).\n\n```ts\nimport { load } from \"protobufjs\"; // respectively \"./node_modules/protobufjs\"\n\nload(\"awesome.proto\", function(err, root) {\n  if (err)\n    throw err;\n\n  // example code\n  const AwesomeMessage = root.lookupType(\"awesomepackage.AwesomeMessage\");\n\n  let message = AwesomeMessage.create({ awesomeField: \"hello\" });\n  console.log(`message = ${JSON.stringify(message)}`);\n\n  let buffer = AwesomeMessage.encode(message).finish();\n  console.log(`buffer = ${Array.prototype.toString.call(buffer)}`);\n\n  let decoded = AwesomeMessage.decode(buffer);\n  console.log(`decoded = ${JSON.stringify(decoded)}`);\n});\n```\n\n#### Using generated static code\n\nIf you generated static code to `bundle.js` using the CLI and its type definitions to `bundle.d.ts`, then you can just do:\n\n```ts\nimport { AwesomeMessage } from \"./bundle.js\";\n\n// example code\nlet message = AwesomeMessage.create({ awesomeField: \"hello\" });\nlet buffer  = AwesomeMessage.encode(message).finish();\nlet decoded = AwesomeMessage.decode(buffer);\n```\n\n#### Using decorators\n\nThe library also includes an early implementation of [decorators](https://www.typescriptlang.org/docs/handbook/decorators.html).\n\n**Note** that decorators are an experimental feature in TypeScript and that declaration order is important depending on the JS target. For example, `@Field.d(2, AwesomeArrayMessage)` requires that `AwesomeArrayMessage` has been defined earlier when targeting `ES5`.\n\n```ts\nimport { Message, Type, Field, OneOf } from \"protobufjs/light\"; // respectively \"./node_modules/protobufjs/light.js\"\n\nexport class AwesomeSubMessage extends Message<AwesomeSubMessage> {\n\n  @Field.d(1, \"string\")\n  public awesomeString: string;\n\n}\n\nexport enum AwesomeEnum {\n  ONE = 1,\n  TWO = 2\n}\n\n@Type.d(\"SuperAwesomeMessage\")\nexport class AwesomeMessage extends Message<AwesomeMessage> {\n\n  @Field.d(1, \"string\", \"optional\", \"awesome default string\")\n  public awesomeField: string;\n\n  @Field.d(2, AwesomeSubMessage)\n  public awesomeSubMessage: AwesomeSubMessage;\n\n  @Field.d(3, AwesomeEnum, \"optional\", AwesomeEnum.ONE)\n  public awesomeEnum: AwesomeEnum;\n\n  @OneOf.d(\"awesomeSubMessage\", \"awesomeEnum\")\n  public which: string;\n\n}\n\n// example code\nlet message = new AwesomeMessage({ awesomeField: \"hello\" });\nlet buffer  = AwesomeMessage.encode(message).finish();\nlet decoded = AwesomeMessage.decode(buffer);\n```\n\nSupported decorators are:\n\n* **Type.d(typeName?: `string`)** &nbsp; *(optional)*<br />\n  annotates a class as a protobuf message type. If `typeName` is not specified, the constructor's runtime function name is used for the reflected type.\n\n* **Field.d&lt;T>(fieldId: `number`, fieldType: `string | Constructor<T>`, fieldRule?: `\"optional\" | \"required\" | \"repeated\"`, defaultValue?: `T`)**<br />\n  annotates a property as a protobuf field with the specified id and protobuf type.\n\n* **MapField.d&lt;T extends { [key: string]: any }>(fieldId: `number`, fieldKeyType: `string`, fieldValueType. `string | Constructor<{}>`)**<br />\n  annotates a property as a protobuf map field with the specified id, protobuf key and value type.\n\n* **OneOf.d&lt;T extends string>(...fieldNames: `string[]`)**<br />\n  annotates a property as a protobuf oneof covering the specified fields.\n\nOther notes:\n\n* Decorated types reside in `protobuf.roots[\"decorated\"]` using a flat structure, so no duplicate names.\n* Enums are copied to a reflected enum with a generic name on decorator evaluation because referenced enum objects have no runtime name the decorator could use.\n* Default values must be specified as arguments to the decorator instead of using a property initializer for proper prototype behavior.\n* Property names on decorated classes must not be renamed on compile time (i.e. by a minifier) because decorators just receive the original field name as a string.\n\n**ProTip!** Not as pretty, but you can [use decorators in plain JavaScript](https://github.com/protobufjs/protobuf.js/blob/master/examples/js-decorators.js) as well.\n\nAdditional documentation\n------------------------\n\n#### Protocol Buffers\n* [Google's Developer Guide](https://protobuf.dev/overview/)\n\n#### protobuf.js\n* [API Documentation](https://protobufjs.github.io/protobuf.js)\n* [CHANGELOG](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)\n* [Frequently asked questions](https://github.com/protobufjs/protobuf.js/wiki) on our wiki\n\n#### Community\n* [Questions and answers](http://stackoverflow.com/search?tab=newest&q=protobuf.js) on StackOverflow\n\nPerformance\n-----------\nThe package includes a benchmark that compares protobuf.js performance to native JSON (as far as this is possible) and [Google's JS implementation](https://github.com/google/protobuf/tree/master/js). On an i7-2600K running node 6.9.1 it yields:\n\n```\nbenchmarking encoding performance ...\n\nprotobuf.js (reflect) x 541,707 ops/sec ±1.13% (87 runs sampled)\nprotobuf.js (static) x 548,134 ops/sec ±1.38% (89 runs sampled)\nJSON (string) x 318,076 ops/sec ±0.63% (93 runs sampled)\nJSON (buffer) x 179,165 ops/sec ±2.26% (91 runs sampled)\ngoogle-protobuf x 74,406 ops/sec ±0.85% (86 runs sampled)\n\n   protobuf.js (static) was fastest\n  protobuf.js (reflect) was 0.9% ops/sec slower (factor 1.0)\n          JSON (string) was 41.5% ops/sec slower (factor 1.7)\n          JSON (buffer) was 67.6% ops/sec slower (factor 3.1)\n        google-protobuf was 86.4% ops/sec slower (factor 7.3)\n\nbenchmarking decoding performance ...\n\nprotobuf.js (reflect) x 1,383,981 ops/sec ±0.88% (93 runs sampled)\nprotobuf.js (static) x 1,378,925 ops/sec ±0.81% (93 runs sampled)\nJSON (string) x 302,444 ops/sec ±0.81% (93 runs sampled)\nJSON (buffer) x 264,882 ops/sec ±0.81% (93 runs sampled)\ngoogle-protobuf x 179,180 ops/sec ±0.64% (94 runs sampled)\n\n  protobuf.js (reflect) was fastest\n   protobuf.js (static) was 0.3% ops/sec slower (factor 1.0)\n          JSON (string) was 78.1% ops/sec slower (factor 4.6)\n          JSON (buffer) was 80.8% ops/sec slower (factor 5.2)\n        google-protobuf was 87.0% ops/sec slower (factor 7.7)\n\nbenchmarking combined performance ...\n\nprotobuf.js (reflect) x 275,900 ops/sec ±0.78% (90 runs sampled)\nprotobuf.js (static) x 290,096 ops/sec ±0.96% (90 runs sampled)\nJSON (string) x 129,381 ops/sec ±0.77% (90 runs sampled)\nJSON (buffer) x 91,051 ops/sec ±0.94% (90 runs sampled)\ngoogle-protobuf x 42,050 ops/sec ±0.85% (91 runs sampled)\n\n   protobuf.js (static) was fastest\n  protobuf.js (reflect) was 4.7% ops/sec slower (factor 1.0)\n          JSON (string) was 55.3% ops/sec slower (factor 2.2)\n          JSON (buffer) was 68.6% ops/sec slower (factor 3.2)\n        google-protobuf was 85.5% ops/sec slower (factor 6.9)\n```\n\nThese results are achieved by\n\n* generating type-specific encoders, decoders, verifiers and converters at runtime\n* configuring the reader/writer interface according to the environment\n* using node-specific functionality where beneficial and, of course\n* avoiding unnecessary operations through splitting up [the toolset](#toolset).\n\nYou can also run [the benchmark](https://github.com/protobufjs/protobuf.js/blob/master/bench/index.js) ...\n\n```\n$> npm run bench\n```\n\nand [the profiler](https://github.com/protobufjs/protobuf.js/blob/master/bench/prof.js) yourself (the latter requires a recent version of node):\n\n```\n$> npm run prof <encode|decode|encode-browser|decode-browser> [iterations=10000000]\n```\n\nNote that as of this writing, the benchmark suite performs significantly slower on node 7.2.0 compared to 6.9.1 because moths.\n\nCompatibility\n-------------\n\n* Works in all modern and not-so-modern browsers except IE8.\n* Because the internals of this package do not rely on `google/protobuf/descriptor.proto`, options are parsed and presented literally.\n* If typed arrays are not supported by the environment, plain arrays will be used instead.\n* Support for pre-ES5 environments (except IE8) can be achieved by [using a polyfill](https://github.com/protobufjs/protobuf.js/blob/master/lib/polyfill.js).\n* Support for [Content Security Policy](https://w3c.github.io/webappsec-csp/)-restricted environments (like Chrome extensions without unsafe-eval) can be achieved by generating and using static code instead.\n* If a proper way to work with 64 bit values (uint64, int64 etc.) is required, just install [long.js](https://github.com/dcodeIO/long.js) alongside this library. All 64 bit numbers will then be returned as a `Long` instance instead of a possibly unsafe JavaScript number ([see](https://github.com/dcodeIO/long.js)).\n* For descriptor.proto interoperability, see [ext/descriptor](https://github.com/protobufjs/protobuf.js/tree/master/ext/descriptor)\n\nBuilding\n--------\n\nTo build the library or its components yourself, clone it from GitHub and install the development dependencies:\n\n```\n$> git clone https://github.com/protobufjs/protobuf.js.git\n$> cd protobuf.js\n$> npm install\n```\n\nBuilding the respective development and production versions with their respective source maps to `dist/`:\n\n```\n$> npm run build\n```\n\nBuilding the documentation to `docs/`:\n\n```\n$> npm run docs\n```\n\nBuilding the TypeScript definition to `index.d.ts`:\n\n```\n$> npm run build:types\n```\n\n### Browserify integration\n\nBy default, protobuf.js integrates into any browserify build-process without requiring any optional modules. Hence:\n\n* If int64 support is required, explicitly require the `long` module somewhere in your project as it will be excluded otherwise. This assumes that a global `require` function is present that protobuf.js can call to obtain the long module.\n\n  If there is no global `require` function present after bundling, it's also possible to assign the long module programmatically:\n\n  ```js\n  var Long = ...;\n\n  protobuf.util.Long = Long;\n  protobuf.configure();\n  ```\n\n* If you have any special requirements, there is [the bundler](https://github.com/protobufjs/protobuf.js/blob/master/scripts/bundle.js) for reference.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "bench/data/bench.json",
    "content": "{\n    \"string\" : \"Lorem ipsum dolor sit amet.\",\n    \"uint32\" : 9000,\n    \"inner\" : {\n        \"int32\" : 20161110,\n        \"innerInner\" : {\n            \"long\" : {\n                \"low\": 1051,\n                \"high\": 151234,\n                \"unsigned\": false\n            },\n            \"enum\" : 1,\n            \"sint32\": -42\n        },\n        \"outer\" : {\n            \"bool\" : [ true, false, false, true, false, false, true ],\n            \"double\": 204.8\n        }\n    },\n    \"float\": 0.25\n}\n"
  },
  {
    "path": "bench/data/bench.proto",
    "content": "syntax = \"proto3\";\n\nmessage Test {\n\n    string  string = 1;\n    uint32  uint32 = 2;\n    Inner   inner  = 3;\n    float   float  = 4; // make sure to set something that's fair to JSON\n\n    message Inner {\n\n        int32      int32      = 1;\n        InnerInner innerInner = 2;\n        Outer      outer      = 3;\n\n        message InnerInner {\n\n            int64  long   = 1;\n            Enum   enum   = 2;\n            sint32 sint32 = 3;\n        }\n    }\n\n    enum Enum {\n\n        ONE   = 0;\n        TWO   = 1;\n        THREE = 2;\n        FOUR  = 3;\n        FIVE  = 4;\n    }\n}\n\nmessage Outer {\n\n    repeated bool bool = 1;\n    double double = 2; // make sure to set something that's fair to JSON\n}\n\n// bytes cannot be used\n"
  },
  {
    "path": "bench/data/static_jspb.js",
    "content": "/*eslint-disable*/\n/**\n * @fileoverview\n * @enhanceable\n * @public\n */\n// GENERATED CODE -- DO NOT EDIT!\n\nvar jspb = require('google-protobuf');\nvar goog = jspb;\nvar global = Function('return this')();\n\ngoog.exportSymbol('proto.Outer', null, global);\ngoog.exportSymbol('proto.Test', null, global);\ngoog.exportSymbol('proto.Test.Enum', null, global);\ngoog.exportSymbol('proto.Test.Inner', null, global);\ngoog.exportSymbol('proto.Test.Inner.InnerInner', null, global);\n\n/**\n * Generated by JsPbCodeGenerator.\n * @param {Array=} opt_data Optional initial data array, typically from a\n * server response, or constructed directly in Javascript. The array is used\n * in place and becomes part of the constructed object. It is not cloned.\n * If no data is provided, the constructed object will be empty, but still\n * valid.\n * @extends {jspb.Message}\n * @constructor\n */\nproto.Test = function(opt_data) {\n  jspb.Message.initialize(this, opt_data, 0, -1, null, null);\n};\ngoog.inherits(proto.Test, jspb.Message);\nif (goog.DEBUG && !COMPILED) {\n  proto.Test.displayName = 'proto.Test';\n}\n\n\nif (jspb.Message.GENERATE_TO_OBJECT) {\n/**\n * Creates an object representation of this proto suitable for use in Soy templates.\n * Field names that are reserved in JavaScript and will be renamed to pb_name.\n * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.\n * For the list of reserved names please see:\n *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.\n * @param {boolean=} opt_includeInstance Whether to include the JSPB instance\n *     for transitional soy proto support: http://goto/soy-param-migration\n * @return {!Object}\n */\nproto.Test.prototype.toObject = function(opt_includeInstance) {\n  return proto.Test.toObject(opt_includeInstance, this);\n};\n\n\n/**\n * Static version of the {@see toObject} method.\n * @param {boolean|undefined} includeInstance Whether to include the JSPB\n *     instance for transitional soy proto support:\n *     http://goto/soy-param-migration\n * @param {!proto.Test} msg The msg instance to transform.\n * @return {!Object}\n */\nproto.Test.toObject = function(includeInstance, msg) {\n  var f, obj = {\n    string: jspb.Message.getFieldWithDefault(msg, 1, \"\"),\n    uint32: jspb.Message.getFieldWithDefault(msg, 2, 0),\n    inner: (f = msg.getInner()) && proto.Test.Inner.toObject(includeInstance, f),\n    pb_float: +jspb.Message.getFieldWithDefault(msg, 4, 0.0)\n  };\n\n  if (includeInstance) {\n    obj.$jspbMessageInstance = msg;\n  }\n  return obj;\n};\n}\n\n\n/**\n * Deserializes binary data (in protobuf wire format).\n * @param {jspb.ByteSource} bytes The bytes to deserialize.\n * @return {!proto.Test}\n */\nproto.Test.deserializeBinary = function(bytes) {\n  var reader = new jspb.BinaryReader(bytes);\n  var msg = new proto.Test;\n  return proto.Test.deserializeBinaryFromReader(msg, reader);\n};\n\n\n/**\n * Deserializes binary data (in protobuf wire format) from the\n * given reader into the given message object.\n * @param {!proto.Test} msg The message object to deserialize into.\n * @param {!jspb.BinaryReader} reader The BinaryReader to use.\n * @return {!proto.Test}\n */\nproto.Test.deserializeBinaryFromReader = function(msg, reader) {\n  while (reader.nextField()) {\n    if (reader.isEndGroup()) {\n      break;\n    }\n    var field = reader.getFieldNumber();\n    switch (field) {\n    case 1:\n      var value = /** @type {string} */ (reader.readString());\n      msg.setString(value);\n      break;\n    case 2:\n      var value = /** @type {number} */ (reader.readUint32());\n      msg.setUint32(value);\n      break;\n    case 3:\n      var value = new proto.Test.Inner;\n      reader.readMessage(value,proto.Test.Inner.deserializeBinaryFromReader);\n      msg.setInner(value);\n      break;\n    case 4:\n      var value = /** @type {number} */ (reader.readFloat());\n      msg.setFloat(value);\n      break;\n    default:\n      reader.skipField();\n      break;\n    }\n  }\n  return msg;\n};\n\n\n/**\n * Serializes the message to binary data (in protobuf wire format).\n * @return {!Uint8Array}\n */\nproto.Test.prototype.serializeBinary = function() {\n  var writer = new jspb.BinaryWriter();\n  proto.Test.serializeBinaryToWriter(this, writer);\n  return writer.getResultBuffer();\n};\n\n\n/**\n * Serializes the given message to binary data (in protobuf wire\n * format), writing to the given BinaryWriter.\n * @param {!proto.Test} message\n * @param {!jspb.BinaryWriter} writer\n */\nproto.Test.serializeBinaryToWriter = function(message, writer) {\n  var f = undefined;\n  f = message.getString();\n  if (f.length > 0) {\n    writer.writeString(\n      1,\n      f\n    );\n  }\n  f = message.getUint32();\n  if (f !== 0) {\n    writer.writeUint32(\n      2,\n      f\n    );\n  }\n  f = message.getInner();\n  if (f != null) {\n    writer.writeMessage(\n      3,\n      f,\n      proto.Test.Inner.serializeBinaryToWriter\n    );\n  }\n  f = message.getFloat();\n  if (f !== 0.0) {\n    writer.writeFloat(\n      4,\n      f\n    );\n  }\n};\n\n\n/**\n * @enum {number}\n */\nproto.Test.Enum = {\n  ONE: 0,\n  TWO: 1,\n  THREE: 2,\n  FOUR: 3,\n  FIVE: 4\n};\n\n\n/**\n * Generated by JsPbCodeGenerator.\n * @param {Array=} opt_data Optional initial data array, typically from a\n * server response, or constructed directly in Javascript. The array is used\n * in place and becomes part of the constructed object. It is not cloned.\n * If no data is provided, the constructed object will be empty, but still\n * valid.\n * @extends {jspb.Message}\n * @constructor\n */\nproto.Test.Inner = function(opt_data) {\n  jspb.Message.initialize(this, opt_data, 0, -1, null, null);\n};\ngoog.inherits(proto.Test.Inner, jspb.Message);\nif (goog.DEBUG && !COMPILED) {\n  proto.Test.Inner.displayName = 'proto.Test.Inner';\n}\n\n\nif (jspb.Message.GENERATE_TO_OBJECT) {\n/**\n * Creates an object representation of this proto suitable for use in Soy templates.\n * Field names that are reserved in JavaScript and will be renamed to pb_name.\n * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.\n * For the list of reserved names please see:\n *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.\n * @param {boolean=} opt_includeInstance Whether to include the JSPB instance\n *     for transitional soy proto support: http://goto/soy-param-migration\n * @return {!Object}\n */\nproto.Test.Inner.prototype.toObject = function(opt_includeInstance) {\n  return proto.Test.Inner.toObject(opt_includeInstance, this);\n};\n\n\n/**\n * Static version of the {@see toObject} method.\n * @param {boolean|undefined} includeInstance Whether to include the JSPB\n *     instance for transitional soy proto support:\n *     http://goto/soy-param-migration\n * @param {!proto.Test.Inner} msg The msg instance to transform.\n * @return {!Object}\n */\nproto.Test.Inner.toObject = function(includeInstance, msg) {\n  var f, obj = {\n    int32: jspb.Message.getFieldWithDefault(msg, 1, 0),\n    innerinner: (f = msg.getInnerinner()) && proto.Test.Inner.InnerInner.toObject(includeInstance, f),\n    outer: (f = msg.getOuter()) && proto.Outer.toObject(includeInstance, f)\n  };\n\n  if (includeInstance) {\n    obj.$jspbMessageInstance = msg;\n  }\n  return obj;\n};\n}\n\n\n/**\n * Deserializes binary data (in protobuf wire format).\n * @param {jspb.ByteSource} bytes The bytes to deserialize.\n * @return {!proto.Test.Inner}\n */\nproto.Test.Inner.deserializeBinary = function(bytes) {\n  var reader = new jspb.BinaryReader(bytes);\n  var msg = new proto.Test.Inner;\n  return proto.Test.Inner.deserializeBinaryFromReader(msg, reader);\n};\n\n\n/**\n * Deserializes binary data (in protobuf wire format) from the\n * given reader into the given message object.\n * @param {!proto.Test.Inner} msg The message object to deserialize into.\n * @param {!jspb.BinaryReader} reader The BinaryReader to use.\n * @return {!proto.Test.Inner}\n */\nproto.Test.Inner.deserializeBinaryFromReader = function(msg, reader) {\n  while (reader.nextField()) {\n    if (reader.isEndGroup()) {\n      break;\n    }\n    var field = reader.getFieldNumber();\n    switch (field) {\n    case 1:\n      var value = /** @type {number} */ (reader.readInt32());\n      msg.setInt32(value);\n      break;\n    case 2:\n      var value = new proto.Test.Inner.InnerInner;\n      reader.readMessage(value,proto.Test.Inner.InnerInner.deserializeBinaryFromReader);\n      msg.setInnerinner(value);\n      break;\n    case 3:\n      var value = new proto.Outer;\n      reader.readMessage(value,proto.Outer.deserializeBinaryFromReader);\n      msg.setOuter(value);\n      break;\n    default:\n      reader.skipField();\n      break;\n    }\n  }\n  return msg;\n};\n\n\n/**\n * Serializes the message to binary data (in protobuf wire format).\n * @return {!Uint8Array}\n */\nproto.Test.Inner.prototype.serializeBinary = function() {\n  var writer = new jspb.BinaryWriter();\n  proto.Test.Inner.serializeBinaryToWriter(this, writer);\n  return writer.getResultBuffer();\n};\n\n\n/**\n * Serializes the given message to binary data (in protobuf wire\n * format), writing to the given BinaryWriter.\n * @param {!proto.Test.Inner} message\n * @param {!jspb.BinaryWriter} writer\n */\nproto.Test.Inner.serializeBinaryToWriter = function(message, writer) {\n  var f = undefined;\n  f = message.getInt32();\n  if (f !== 0) {\n    writer.writeInt32(\n      1,\n      f\n    );\n  }\n  f = message.getInnerinner();\n  if (f != null) {\n    writer.writeMessage(\n      2,\n      f,\n      proto.Test.Inner.InnerInner.serializeBinaryToWriter\n    );\n  }\n  f = message.getOuter();\n  if (f != null) {\n    writer.writeMessage(\n      3,\n      f,\n      proto.Outer.serializeBinaryToWriter\n    );\n  }\n};\n\n\n\n/**\n * Generated by JsPbCodeGenerator.\n * @param {Array=} opt_data Optional initial data array, typically from a\n * server response, or constructed directly in Javascript. The array is used\n * in place and becomes part of the constructed object. It is not cloned.\n * If no data is provided, the constructed object will be empty, but still\n * valid.\n * @extends {jspb.Message}\n * @constructor\n */\nproto.Test.Inner.InnerInner = function(opt_data) {\n  jspb.Message.initialize(this, opt_data, 0, -1, null, null);\n};\ngoog.inherits(proto.Test.Inner.InnerInner, jspb.Message);\nif (goog.DEBUG && !COMPILED) {\n  proto.Test.Inner.InnerInner.displayName = 'proto.Test.Inner.InnerInner';\n}\n\n\nif (jspb.Message.GENERATE_TO_OBJECT) {\n/**\n * Creates an object representation of this proto suitable for use in Soy templates.\n * Field names that are reserved in JavaScript and will be renamed to pb_name.\n * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.\n * For the list of reserved names please see:\n *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.\n * @param {boolean=} opt_includeInstance Whether to include the JSPB instance\n *     for transitional soy proto support: http://goto/soy-param-migration\n * @return {!Object}\n */\nproto.Test.Inner.InnerInner.prototype.toObject = function(opt_includeInstance) {\n  return proto.Test.Inner.InnerInner.toObject(opt_includeInstance, this);\n};\n\n\n/**\n * Static version of the {@see toObject} method.\n * @param {boolean|undefined} includeInstance Whether to include the JSPB\n *     instance for transitional soy proto support:\n *     http://goto/soy-param-migration\n * @param {!proto.Test.Inner.InnerInner} msg The msg instance to transform.\n * @return {!Object}\n */\nproto.Test.Inner.InnerInner.toObject = function(includeInstance, msg) {\n  var f, obj = {\n    pb_long: jspb.Message.getFieldWithDefault(msg, 1, 0),\n    pb_enum: jspb.Message.getFieldWithDefault(msg, 2, 0),\n    sint32: jspb.Message.getFieldWithDefault(msg, 3, 0)\n  };\n\n  if (includeInstance) {\n    obj.$jspbMessageInstance = msg;\n  }\n  return obj;\n};\n}\n\n\n/**\n * Deserializes binary data (in protobuf wire format).\n * @param {jspb.ByteSource} bytes The bytes to deserialize.\n * @return {!proto.Test.Inner.InnerInner}\n */\nproto.Test.Inner.InnerInner.deserializeBinary = function(bytes) {\n  var reader = new jspb.BinaryReader(bytes);\n  var msg = new proto.Test.Inner.InnerInner;\n  return proto.Test.Inner.InnerInner.deserializeBinaryFromReader(msg, reader);\n};\n\n\n/**\n * Deserializes binary data (in protobuf wire format) from the\n * given reader into the given message object.\n * @param {!proto.Test.Inner.InnerInner} msg The message object to deserialize into.\n * @param {!jspb.BinaryReader} reader The BinaryReader to use.\n * @return {!proto.Test.Inner.InnerInner}\n */\nproto.Test.Inner.InnerInner.deserializeBinaryFromReader = function(msg, reader) {\n  while (reader.nextField()) {\n    if (reader.isEndGroup()) {\n      break;\n    }\n    var field = reader.getFieldNumber();\n    switch (field) {\n    case 1:\n      var value = /** @type {number} */ (reader.readInt64());\n      msg.setLong(value);\n      break;\n    case 2:\n      var value = /** @type {!proto.Test.Enum} */ (reader.readEnum());\n      msg.setEnum(value);\n      break;\n    case 3:\n      var value = /** @type {number} */ (reader.readSint32());\n      msg.setSint32(value);\n      break;\n    default:\n      reader.skipField();\n      break;\n    }\n  }\n  return msg;\n};\n\n\n/**\n * Serializes the message to binary data (in protobuf wire format).\n * @return {!Uint8Array}\n */\nproto.Test.Inner.InnerInner.prototype.serializeBinary = function() {\n  var writer = new jspb.BinaryWriter();\n  proto.Test.Inner.InnerInner.serializeBinaryToWriter(this, writer);\n  return writer.getResultBuffer();\n};\n\n\n/**\n * Serializes the given message to binary data (in protobuf wire\n * format), writing to the given BinaryWriter.\n * @param {!proto.Test.Inner.InnerInner} message\n * @param {!jspb.BinaryWriter} writer\n */\nproto.Test.Inner.InnerInner.serializeBinaryToWriter = function(message, writer) {\n  var f = undefined;\n  f = message.getLong();\n  if (f !== 0) {\n    writer.writeInt64(\n      1,\n      f\n    );\n  }\n  f = message.getEnum();\n  if (f !== 0.0) {\n    writer.writeEnum(\n      2,\n      f\n    );\n  }\n  f = message.getSint32();\n  if (f !== 0) {\n    writer.writeSint32(\n      3,\n      f\n    );\n  }\n};\n\n\n/**\n * optional int64 long = 1;\n * @return {number}\n */\nproto.Test.Inner.InnerInner.prototype.getLong = function() {\n  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));\n};\n\n\n/** @param {number} value */\nproto.Test.Inner.InnerInner.prototype.setLong = function(value) {\n  jspb.Message.setField(this, 1, value);\n};\n\n\n/**\n * optional Enum enum = 2;\n * @return {!proto.Test.Enum}\n */\nproto.Test.Inner.InnerInner.prototype.getEnum = function() {\n  return /** @type {!proto.Test.Enum} */ (jspb.Message.getFieldWithDefault(this, 2, 0));\n};\n\n\n/** @param {!proto.Test.Enum} value */\nproto.Test.Inner.InnerInner.prototype.setEnum = function(value) {\n  jspb.Message.setField(this, 2, value);\n};\n\n\n/**\n * optional sint32 sint32 = 3;\n * @return {number}\n */\nproto.Test.Inner.InnerInner.prototype.getSint32 = function() {\n  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0));\n};\n\n\n/** @param {number} value */\nproto.Test.Inner.InnerInner.prototype.setSint32 = function(value) {\n  jspb.Message.setField(this, 3, value);\n};\n\n\n/**\n * optional int32 int32 = 1;\n * @return {number}\n */\nproto.Test.Inner.prototype.getInt32 = function() {\n  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0));\n};\n\n\n/** @param {number} value */\nproto.Test.Inner.prototype.setInt32 = function(value) {\n  jspb.Message.setField(this, 1, value);\n};\n\n\n/**\n * optional InnerInner innerInner = 2;\n * @return {?proto.Test.Inner.InnerInner}\n */\nproto.Test.Inner.prototype.getInnerinner = function() {\n  return /** @type{?proto.Test.Inner.InnerInner} */ (\n    jspb.Message.getWrapperField(this, proto.Test.Inner.InnerInner, 2));\n};\n\n\n/** @param {?proto.Test.Inner.InnerInner|undefined} value */\nproto.Test.Inner.prototype.setInnerinner = function(value) {\n  jspb.Message.setWrapperField(this, 2, value);\n};\n\n\nproto.Test.Inner.prototype.clearInnerinner = function() {\n  this.setInnerinner(undefined);\n};\n\n\n/**\n * Returns whether this field is set.\n * @return {!boolean}\n */\nproto.Test.Inner.prototype.hasInnerinner = function() {\n  return jspb.Message.getField(this, 2) != null;\n};\n\n\n/**\n * optional Outer outer = 3;\n * @return {?proto.Outer}\n */\nproto.Test.Inner.prototype.getOuter = function() {\n  return /** @type{?proto.Outer} */ (\n    jspb.Message.getWrapperField(this, proto.Outer, 3));\n};\n\n\n/** @param {?proto.Outer|undefined} value */\nproto.Test.Inner.prototype.setOuter = function(value) {\n  jspb.Message.setWrapperField(this, 3, value);\n};\n\n\nproto.Test.Inner.prototype.clearOuter = function() {\n  this.setOuter(undefined);\n};\n\n\n/**\n * Returns whether this field is set.\n * @return {!boolean}\n */\nproto.Test.Inner.prototype.hasOuter = function() {\n  return jspb.Message.getField(this, 3) != null;\n};\n\n\n/**\n * optional string string = 1;\n * @return {string}\n */\nproto.Test.prototype.getString = function() {\n  return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, \"\"));\n};\n\n\n/** @param {string} value */\nproto.Test.prototype.setString = function(value) {\n  jspb.Message.setField(this, 1, value);\n};\n\n\n/**\n * optional uint32 uint32 = 2;\n * @return {number}\n */\nproto.Test.prototype.getUint32 = function() {\n  return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));\n};\n\n\n/** @param {number} value */\nproto.Test.prototype.setUint32 = function(value) {\n  jspb.Message.setField(this, 2, value);\n};\n\n\n/**\n * optional Inner inner = 3;\n * @return {?proto.Test.Inner}\n */\nproto.Test.prototype.getInner = function() {\n  return /** @type{?proto.Test.Inner} */ (\n    jspb.Message.getWrapperField(this, proto.Test.Inner, 3));\n};\n\n\n/** @param {?proto.Test.Inner|undefined} value */\nproto.Test.prototype.setInner = function(value) {\n  jspb.Message.setWrapperField(this, 3, value);\n};\n\n\nproto.Test.prototype.clearInner = function() {\n  this.setInner(undefined);\n};\n\n\n/**\n * Returns whether this field is set.\n * @return {!boolean}\n */\nproto.Test.prototype.hasInner = function() {\n  return jspb.Message.getField(this, 3) != null;\n};\n\n\n/**\n * optional float float = 4;\n * @return {number}\n */\nproto.Test.prototype.getFloat = function() {\n  return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 4, 0.0));\n};\n\n\n/** @param {number} value */\nproto.Test.prototype.setFloat = function(value) {\n  jspb.Message.setField(this, 4, value);\n};\n\n\n\n/**\n * Generated by JsPbCodeGenerator.\n * @param {Array=} opt_data Optional initial data array, typically from a\n * server response, or constructed directly in Javascript. The array is used\n * in place and becomes part of the constructed object. It is not cloned.\n * If no data is provided, the constructed object will be empty, but still\n * valid.\n * @extends {jspb.Message}\n * @constructor\n */\nproto.Outer = function(opt_data) {\n  jspb.Message.initialize(this, opt_data, 0, -1, proto.Outer.repeatedFields_, null);\n};\ngoog.inherits(proto.Outer, jspb.Message);\nif (goog.DEBUG && !COMPILED) {\n  proto.Outer.displayName = 'proto.Outer';\n}\n/**\n * List of repeated fields within this message type.\n * @private {!Array<number>}\n * @const\n */\nproto.Outer.repeatedFields_ = [1];\n\n\n\nif (jspb.Message.GENERATE_TO_OBJECT) {\n/**\n * Creates an object representation of this proto suitable for use in Soy templates.\n * Field names that are reserved in JavaScript and will be renamed to pb_name.\n * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.\n * For the list of reserved names please see:\n *     com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.\n * @param {boolean=} opt_includeInstance Whether to include the JSPB instance\n *     for transitional soy proto support: http://goto/soy-param-migration\n * @return {!Object}\n */\nproto.Outer.prototype.toObject = function(opt_includeInstance) {\n  return proto.Outer.toObject(opt_includeInstance, this);\n};\n\n\n/**\n * Static version of the {@see toObject} method.\n * @param {boolean|undefined} includeInstance Whether to include the JSPB\n *     instance for transitional soy proto support:\n *     http://goto/soy-param-migration\n * @param {!proto.Outer} msg The msg instance to transform.\n * @return {!Object}\n */\nproto.Outer.toObject = function(includeInstance, msg) {\n  var f, obj = {\n    boolList: jspb.Message.getField(msg, 1),\n    pb_double: +jspb.Message.getFieldWithDefault(msg, 2, 0.0)\n  };\n\n  if (includeInstance) {\n    obj.$jspbMessageInstance = msg;\n  }\n  return obj;\n};\n}\n\n\n/**\n * Deserializes binary data (in protobuf wire format).\n * @param {jspb.ByteSource} bytes The bytes to deserialize.\n * @return {!proto.Outer}\n */\nproto.Outer.deserializeBinary = function(bytes) {\n  var reader = new jspb.BinaryReader(bytes);\n  var msg = new proto.Outer;\n  return proto.Outer.deserializeBinaryFromReader(msg, reader);\n};\n\n\n/**\n * Deserializes binary data (in protobuf wire format) from the\n * given reader into the given message object.\n * @param {!proto.Outer} msg The message object to deserialize into.\n * @param {!jspb.BinaryReader} reader The BinaryReader to use.\n * @return {!proto.Outer}\n */\nproto.Outer.deserializeBinaryFromReader = function(msg, reader) {\n  while (reader.nextField()) {\n    if (reader.isEndGroup()) {\n      break;\n    }\n    var field = reader.getFieldNumber();\n    switch (field) {\n    case 1:\n      var value = /** @type {!Array.<boolean>} */ (reader.readPackedBool());\n      msg.setBoolList(value);\n      break;\n    case 2:\n      var value = /** @type {number} */ (reader.readDouble());\n      msg.setDouble(value);\n      break;\n    default:\n      reader.skipField();\n      break;\n    }\n  }\n  return msg;\n};\n\n\n/**\n * Serializes the message to binary data (in protobuf wire format).\n * @return {!Uint8Array}\n */\nproto.Outer.prototype.serializeBinary = function() {\n  var writer = new jspb.BinaryWriter();\n  proto.Outer.serializeBinaryToWriter(this, writer);\n  return writer.getResultBuffer();\n};\n\n\n/**\n * Serializes the given message to binary data (in protobuf wire\n * format), writing to the given BinaryWriter.\n * @param {!proto.Outer} message\n * @param {!jspb.BinaryWriter} writer\n */\nproto.Outer.serializeBinaryToWriter = function(message, writer) {\n  var f = undefined;\n  f = message.getBoolList();\n  if (f.length > 0) {\n    writer.writePackedBool(\n      1,\n      f\n    );\n  }\n  f = message.getDouble();\n  if (f !== 0.0) {\n    writer.writeDouble(\n      2,\n      f\n    );\n  }\n};\n\n\n/**\n * repeated bool bool = 1;\n * Note that Boolean fields may be set to 0/1 when serialized from a Java server.\n * You should avoid comparisons like {@code val === true/false} in those cases.\n * If you change this array by adding, removing or replacing elements, or if you\n * replace the array itself, then you must call the setter to update it.\n * @return {!Array.<boolean>}\n */\nproto.Outer.prototype.getBoolList = function() {\n  return /** @type {!Array.<boolean>} */ (jspb.Message.getField(this, 1));\n};\n\n\n/** @param {!Array.<boolean>} value */\nproto.Outer.prototype.setBoolList = function(value) {\n  jspb.Message.setField(this, 1, value || []);\n};\n\n\n/**\n * @param {!boolean} value\n * @param {number=} opt_index\n */\nproto.Outer.prototype.addBool = function(value, opt_index) {\n  jspb.Message.addToRepeatedField(this, 1, value, opt_index);\n};\n\n\nproto.Outer.prototype.clearBoolList = function() {\n  this.setBoolList([]);\n};\n\n\n/**\n * optional double double = 2;\n * @return {number}\n */\nproto.Outer.prototype.getDouble = function() {\n  return /** @type {number} */ (+jspb.Message.getFieldWithDefault(this, 2, 0.0));\n};\n\n\n/** @param {number} value */\nproto.Outer.prototype.setDouble = function(value) {\n  jspb.Message.setField(this, 2, value);\n};\n\n\ngoog.object.extend(exports, proto);\n"
  },
  {
    "path": "bench/data/static_pbjs.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\nvar $root = $protobuf.roots.test_bench || ($protobuf.roots.test_bench = {});\n\n$root.Test = (function() {\n\n    function Test(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    Test.prototype.string = \"\";\n    Test.prototype.uint32 = 0;\n    Test.prototype.inner = null;\n    Test.prototype.float = 0;\n\n    Test.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.string != null && Object.hasOwnProperty.call(message, \"string\"))\n            writer.uint32(10).string(message.string);\n        if (message.uint32 != null && Object.hasOwnProperty.call(message, \"uint32\"))\n            writer.uint32(16).uint32(message.uint32);\n        if (message.inner != null && Object.hasOwnProperty.call(message, \"inner\"))\n            $root.Test.Inner.encode(message.inner, writer.uint32(26).fork()).ldelim();\n        if (message.float != null && Object.hasOwnProperty.call(message, \"float\"))\n            writer.uint32(37).float(message.float);\n        return writer;\n    };\n\n    Test.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Test();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.string = reader.string();\n                break;\n            case 2:\n                message.uint32 = reader.uint32();\n                break;\n            case 3:\n                message.inner = $root.Test.Inner.decode(reader, reader.uint32());\n                break;\n            case 4:\n                message.float = reader.float();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    Test.Inner = (function() {\n\n        function Inner(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        Inner.prototype.int32 = 0;\n        Inner.prototype.innerInner = null;\n        Inner.prototype.outer = null;\n\n        Inner.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.int32 != null && Object.hasOwnProperty.call(message, \"int32\"))\n                writer.uint32(8).int32(message.int32);\n            if (message.innerInner != null && Object.hasOwnProperty.call(message, \"innerInner\"))\n                $root.Test.Inner.InnerInner.encode(message.innerInner, writer.uint32(18).fork()).ldelim();\n            if (message.outer != null && Object.hasOwnProperty.call(message, \"outer\"))\n                $root.Outer.encode(message.outer, writer.uint32(26).fork()).ldelim();\n            return writer;\n        };\n\n        Inner.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Test.Inner();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.int32 = reader.int32();\n                    break;\n                case 2:\n                    message.innerInner = $root.Test.Inner.InnerInner.decode(reader, reader.uint32());\n                    break;\n                case 3:\n                    message.outer = $root.Outer.decode(reader, reader.uint32());\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        Inner.InnerInner = (function() {\n\n            function InnerInner(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            InnerInner.prototype.long = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n            InnerInner.prototype[\"enum\"] = 0;\n            InnerInner.prototype.sint32 = 0;\n\n            InnerInner.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.long != null && Object.hasOwnProperty.call(message, \"long\"))\n                    writer.uint32(8).int64(message.long);\n                if (message[\"enum\"] != null && Object.hasOwnProperty.call(message, \"enum\"))\n                    writer.uint32(16).int32(message[\"enum\"]);\n                if (message.sint32 != null && Object.hasOwnProperty.call(message, \"sint32\"))\n                    writer.uint32(24).sint32(message.sint32);\n                return writer;\n            };\n\n            InnerInner.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Test.Inner.InnerInner();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.long = reader.int64();\n                        break;\n                    case 2:\n                        message[\"enum\"] = reader.int32();\n                        break;\n                    case 3:\n                        message.sint32 = reader.sint32();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            return InnerInner;\n        })();\n\n        return Inner;\n    })();\n\n    Test.Enum = (function() {\n        var valuesById = {}, values = Object.create(valuesById);\n        values[valuesById[0] = \"ONE\"] = 0;\n        values[valuesById[1] = \"TWO\"] = 1;\n        values[valuesById[2] = \"THREE\"] = 2;\n        values[valuesById[3] = \"FOUR\"] = 3;\n        values[valuesById[4] = \"FIVE\"] = 4;\n        return values;\n    })();\n\n    return Test;\n})();\n\n$root.Outer = (function() {\n\n    function Outer(properties) {\n        this.bool = [];\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    Outer.prototype.bool = $util.emptyArray;\n    Outer.prototype.double = 0;\n\n    Outer.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.bool != null && message.bool.length) {\n            writer.uint32(10).fork();\n            for (var i = 0; i < message.bool.length; ++i)\n                writer.bool(message.bool[i]);\n            writer.ldelim();\n        }\n        if (message.double != null && Object.hasOwnProperty.call(message, \"double\"))\n            writer.uint32(17).double(message.double);\n        return writer;\n    };\n\n    Outer.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Outer();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                if (!(message.bool && message.bool.length))\n                    message.bool = [];\n                if ((tag & 7) === 2) {\n                    var end2 = reader.uint32() + reader.pos;\n                    while (reader.pos < end2)\n                        message.bool.push(reader.bool());\n                } else\n                    message.bool.push(reader.bool());\n                break;\n            case 2:\n                message.double = reader.double();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    return Outer;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "bench/index.js",
    "content": "\"use strict\";\n\n// NOTE: This benchmark partly compares apples and oranges in that it measures protocol buffers,\n// which is purely a binary format, and JSON, which is purely a string format.\n//\n// This matters because strings aren't actually transfered over the network but must still be\n// converted to binary somewhere down the road. Because this can't be measured reliably, this\n// benchmark compares both pure string performance of JSON and additional binary conversion of the\n// same data using node buffers. Actual JSON performance on the network level should be somewhere\n// in between.\n\nvar newSuite  = require(\"./suite\"),\n    payload   = require(\"./data/bench.json\"),\n    protobuf = require(\"..\");\n\nvar Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from || function(value, encoding) { return new Buffer(value, encoding); };\n\n// protobuf.js dynamic: load the proto and set up a buffer\nvar pbjsCls = require(\"..\").loadSync(require.resolve(\"./data/bench.proto\")).resolveAll().lookup(\"Test\");\nvar pbjsMsg = payload; // alt: pbjsCls.fromObject(payload);\nvar pbjsBuf = pbjsCls.encode(pbjsMsg).finish();\n\n// protobuf.js static: load the proto\nvar pbjsStaticCls = require(\"./data/static_pbjs.js\").Test;\n\n// JSON: set up a string and a buffer\nvar jsonMsg = payload;\nvar jsonStr = JSON.stringify(jsonMsg);\nvar jsonBuf = Buffer_from(jsonStr, \"utf8\");\n\n// google-protobuf: load the proto, set up an Uint8Array and a message\nvar jspbCls = require(\"./data/static_jspb.js\").Test;\nvar jspbBuf = new Uint8Array(Array.prototype.slice.call(pbjsBuf));\nvar jspbMsg = jspbCls.deserializeBinary(jspbBuf);\n\nnewSuite(\"encoding\")\n\n.add(\"protobuf.js (reflect)\", function() {\n    pbjsCls.encode(pbjsMsg).finish();\n})\n.add(\"protobuf.js (static)\", function() {\n    pbjsStaticCls.encode(pbjsMsg).finish();\n})\n.add(\"JSON (string)\", function() {\n    JSON.stringify(jsonMsg);\n})\n.add(\"JSON (buffer)\", function() {\n    Buffer_from(JSON.stringify(jsonMsg), \"utf8\");\n})\n.add(\"google-protobuf\", function() {\n    jspbMsg.serializeBinary();\n})\n.run();\n\nnewSuite(\"decoding\")\n\n.add(\"protobuf.js (reflect)\", function() {\n    pbjsCls.decode(pbjsBuf); // no allocation overhead, if you wondered\n})\n.add(\"protobuf.js (static)\", function() {\n    pbjsStaticCls.decode(pbjsBuf);\n})\n.add(\"JSON (string)\", function() {\n    JSON.parse(jsonStr);\n})\n.add(\"JSON (buffer)\", function() {\n    JSON.parse(jsonBuf.toString(\"utf8\"));\n})\n.add(\"google-protobuf\", function() {\n    jspbCls.deserializeBinary(jspbBuf);\n})\n.run();\n\nnewSuite(\"combined\")\n\n.add(\"protobuf.js (reflect)\", function() {\n    pbjsCls.decode(pbjsCls.encode(pbjsMsg).finish());\n})\n.add(\"protobuf.js (static)\", function() {\n    pbjsStaticCls.decode(pbjsStaticCls.encode(pbjsMsg).finish());\n})\n.add(\"JSON (string)\", function() {\n    JSON.parse(JSON.stringify(jsonMsg));\n})\n.add(\"JSON (buffer)\", function() {\n    JSON.parse(Buffer_from(JSON.stringify(jsonMsg), \"utf8\").toString(\"utf8\"));\n})\n.add(\"google-protobuf\", function() {\n    jspbCls.deserializeBinary(jspbMsg.serializeBinary());\n})\n.run();\n\nvar json = require(\"../tests/data/test.json\");\nnewSuite(\"fromJSON\")\n.add(\"isolated\", function() {\n    protobuf.Root.fromJSON(json);\n})\n.add(\"isolated (resolveAll)\", function() {\n    protobuf.Root.fromJSON(json).resolveAll();\n})\n.add(\"shared (unique)\", function() {\n    var root = protobuf.Root.fromJSON(json);\n    for (var i = 0; i < 1000; ++i) {\n        var jsonCopy = {\n            options: json.options,\n            nested: {}\n        };\n        // eslint-disable-next-line no-loop-func\n        Object.keys(json).forEach(key => {\n            jsonCopy.nested[key + i] = json[key];\n        });\n\n        protobuf.Root.fromJSON(jsonCopy, root);\n    }\n}).run();\n\nvar resolveAllRoot = protobuf.Root.fromJSON(json);\nnewSuite(\"resolveAll\")\n.add(\"isolated\", function() {\n    resolveAllRoot.resolveAll();\n}).run();\n\nnewSuite(\"load\")\n.add(\"sync\", function() {\n    protobuf.loadSync(\"bench/data/bench.proto\");\n})\n.run();\n\n"
  },
  {
    "path": "bench/prof.js",
    "content": "\"use strict\";\n\nvar fs   = require(\"fs\"),\n    path = require(\"path\");\n\n// A profiling stub to measure encoding / decoding performance using benchmark data.\n\nvar commands = [\"encode\", \"decode\", \"encode-browser\", \"decode-browser\", \"fromjson\"];\nif (commands.indexOf(process.argv[2]) < 0) { // 0: node, 1: prof.js\n    process.stderr.write(\"usage: \" + path.basename(process.argv[1]) + \" <\" + commands.join(\"|\") + \"> [iterations=10000000]\\n\");\n    return;\n}\n\n// Spin up a node process with profiling enabled and process the generated log\nif (process.execArgv.indexOf(\"--prof\") < 0) {\n    process.stdout.write(\"cleaning up old logs ...\\n\");\n    var child_process = require(\"child_process\");\n    var logRe = /^isolate-[0-9A-F]+-v8\\.log$/;\n    fs.readdirSync(process.cwd()).forEach(function readdirSync_it(file) {\n        if (logRe.test(file))\n            fs.unlink(file);\n    });\n    process.stdout.write(\"generating profile (may take a while) ...\\n\");\n    child_process.execSync(\"node --prof --trace-deopt \" + process.execArgv.join(\" \") + \" \" + process.argv.slice(1).join(\" \"), {\n        cwd: process.cwd(),\n        stdio: \"inherit\"\n    });\n    process.stdout.write(\"processing profile ...\\n\");\n    fs.readdirSync(process.cwd()).forEach(function readdirSync_it(file) {\n        if (logRe.test(file)) {\n            child_process.execSync(\"node --prof-process \" + file, {\n                cwd: process.cwd(),\n                stdio: \"inherit\"\n            });\n            // fs.unlink(file);\n        }\n    });\n    process.stdout.write(\"done.\\n\");\n    return;\n}\n\n// Actual profiling code\nvar protobuf = require(\"..\");\n\n// protobuf.util.codegen.verbose = true;\n\nvar root, json;\n\nif (process.argv[2] === \"fromjson\") {\n    json = require(\"../tests/data/test.json\");\n    if (process.argv.indexOf(\"--resolve\") < 0)\n        for (var k = 0; k < 10000; ++k)\n            protobuf.Root.fromJSON(json);\n    else\n        for (var l = 0; l < 10000; ++l)\n            protobuf.Root.fromJSON(json).resolveAll();\n    return;\n}\n\nvar Test, data, count;\n\nif (process.argv.indexOf(\"--alt\") < 0) {\n    root = protobuf.parse(fs.readFileSync(require.resolve(\"../bench/data/bench.proto\")).toString(\"utf8\")).root;\n    Test = root.lookup(\"Test\");\n    json = JSON.stringify(root);\n    data = require(\"../bench/data/bench.json\");\n    count = 10000000;\n    process.stdout.write(\"bench.proto\");\n} else {\n    root = protobuf.parse(fs.readFileSync(require.resolve(\"../tests/data/mapbox/vector_tile.proto\")).toString(\"utf8\")).root;\n    Test = root.lookup(\"vector_tile.Tile\");\n    data = Test.decode(fs.readFileSync(require.resolve(\"../tests/data/mapbox/vector_tile.bin\")));\n    count = 1000;\n    process.stdout.write(\"vector_tile.proto\");\n}\n\nif (process.argv.length > 3 && /^\\d+$/.test(process.argv[3]))\n    count = parseInt(process.argv[3], 10);\nprocess.stdout.write(\" x \" + count + \"\\n\");\n\nfunction setupBrowser() {\n    protobuf.Writer.create = function create_browser() { return new protobuf.Writer(); };\n    protobuf.Reader.create = function create_browser(buf) { return new protobuf.Reader(buf); };\n}\n\nswitch (process.argv[2]) {\n    case \"encode-browser\":\n        setupBrowser();\n        // eslint-disable-next-line no-fallthrough\n    case \"encode\":\n        for (var i = 0; i < count; ++i)\n            Test.encode(data).finish();\n        break;\n    case \"decode-browser\":\n        setupBrowser();\n        // eslint-disable-next-line no-fallthrough\n    case \"decode\":\n        var buf = Test.encode(data).finish();\n        for (var j = 0; j < count; ++j)\n            Test.decode(buf);\n        break;\n}\n"
  },
  {
    "path": "bench/suite.js",
    "content": "\"use strict\";\nmodule.exports = newSuite;\n\nvar benchmark = require(\"benchmark\"),\n    chalk     = require(\"chalk\");\n\nvar padSize = 23;\n\nfunction newSuite(name) {\n    var benches = [];\n    return new benchmark.Suite(name)\n    .on(\"add\", function(event) {\n        benches.push(event.target);\n    })\n    .on(\"start\", function() {\n        process.stdout.write(chalk.white.bold(\"benchmarking \" + name + \" performance ...\") + \"\\n\\n\");\n    })\n    .on(\"cycle\", function(event) {\n        process.stdout.write(String(event.target) + \"\\n\");\n    })\n    .on(\"complete\", function() {\n        if (benches.length > 1) {\n            benches.sort(function(a, b) { return getHz(b) - getHz(a); });\n            var fastest   = benches[0],\n                fastestHz = getHz(fastest);\n            process.stdout.write(\"\\n\" + chalk.white(pad(fastest.name, padSize)) + \" was \" + chalk.green(\"fastest\") + \"\\n\");\n            benches.slice(1).forEach(function(bench) {\n                var hz = getHz(bench);\n                var percent = 1 - hz / fastestHz;\n                process.stdout.write(chalk.white(pad(bench.name, padSize)) + \" was \" + chalk.red((percent * 100).toFixed(1) + \"% ops/sec slower (factor \" + (fastestHz / hz).toFixed(1) + \")\") + \"\\n\");\n            });\n        }\n        process.stdout.write(\"\\n\");\n    });\n}\n\nfunction getHz(bench) {\n    return 1 / (bench.stats.mean + bench.stats.moe);\n}\n\nfunction pad(str, len, l) {\n    while (str.length < len)\n        str = l ? str + \" \" : \" \" + str;\n    return str;\n}\n"
  },
  {
    "path": "cli/CHANGELOG.md",
    "content": "# Changelog\n\n## [2.0.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v2.0.0...protobufjs-cli-v2.0.1) (2026-03-11)\n\n\n### Bug Fixes\n\n* bump protobufjs dependency version for cli package ([#2128](https://github.com/protobufjs/protobuf.js/issues/2128)) ([549b05e](https://github.com/protobufjs/protobuf.js/commit/549b05ecd95e23da40fa1a36a9336c57946b8377))\n\n## [2.0.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.2.0...protobufjs-cli-v2.0.0) (2025-12-16)\n\n\n### ⚠ BREAKING CHANGES\n\n* add Edition 2024 Support ([#2060](https://github.com/protobufjs/protobuf.js/issues/2060))\n\n### Features\n\n* add Edition 2024 Support ([#2060](https://github.com/protobufjs/protobuf.js/issues/2060)) ([53e8492](https://github.com/protobufjs/protobuf.js/commit/53e8492cbaae2c741801fa50b5f908ff5129c3d7))\n\n## [1.2.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.1.4...protobufjs-cli-v1.2.0) (2025-04-15)\n\n\n### Features\n\n* add Edition 2023 Support ([f04ded3](https://github.com/protobufjs/protobuf.js/commit/f04ded3a03a3ddd383f0228e2fe2627a51f31aa3))\n* add Edition 2023 Support ([a84409b](https://github.com/protobufjs/protobuf.js/commit/a84409b47f9ba0dba56da1af8054fb54f85d85a1))\n* add Edition 2023 Support ([9c5a178](https://github.com/protobufjs/protobuf.js/commit/9c5a178c4b59e0aa65ecac0bd7420171213b2ff9))\n* add Edition 2023 Support ([b2c6867](https://github.com/protobufjs/protobuf.js/commit/b2c686721e3b63d092419fa1cbe58e1deb89534e))\n* add Edition 2023 Support ([60f3e51](https://github.com/protobufjs/protobuf.js/commit/60f3e51087ca2c247473410f39331e1c766aefef))\n* add Edition 2023 Support ([a656361](https://github.com/protobufjs/protobuf.js/commit/a6563617de04d510d6e8865eb6c5067f10247f64))\n* add Edition 2023 Support ([1af8454](https://github.com/protobufjs/protobuf.js/commit/1af8454538b63d58b822ea9d20b935f2ac9f158c))\n* add feature resolution ([a9ffc8a](https://github.com/protobufjs/protobuf.js/commit/a9ffc8a7b593209642fc9d89e884ac6c4e746494))\n* add feature resolution for protobuf editions ([547afa2](https://github.com/protobufjs/protobuf.js/commit/547afa26f76e22e5463a17aec082b0b60cd951d8))\n* api_converters_editions tests added and run successfully\" ([b4b5ca4](https://github.com/protobufjs/protobuf.js/commit/b4b5ca468fcde2082d65a72b508f18d07d75245c))\n* increase size of file that protobufjs CLI can process ([00d5f1a](https://github.com/protobufjs/protobuf.js/commit/00d5f1aca4d7959068f52fd11767c21b483e75bb))\n* increase size of file that protobufjs CLI can process ([d36ef0f](https://github.com/protobufjs/protobuf.js/commit/d36ef0faeae9a9ec655747cb650571bdd9b1243b))\n\n## [1.1.4](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.1.3...protobufjs-cli-v1.1.4) (2024-08-22)\n\n\n### Bug Fixes\n\n* include ([28e3334](https://github.com/protobufjs/protobuf.js/commit/28e333415d3c85687810e164125997d17baba0bd))\n\n## [1.1.3](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.1.2...protobufjs-cli-v1.1.3) (2024-08-16)\n\n\n### Bug Fixes\n\n* handle nullability for optional fields ([59569c1](https://github.com/protobufjs/protobuf.js/commit/59569c12c85c1c7b783ace9a71775b1d05a08e9c))\n\n## [1.1.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.1.1...protobufjs-cli-v1.1.2) (2023-08-21)\n\n\n### Bug Fixes\n\n* possible infinite loop when parsing option ([#1923](https://github.com/protobufjs/protobuf.js/issues/1923)) ([f2a8620](https://github.com/protobufjs/protobuf.js/commit/f2a86201799af5842e1339c22950abbb3db00f51))\n\n## [1.1.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.1.0...protobufjs-cli-v1.1.1) (2023-02-02)\n\n\n### Bug Fixes\n\n* **cli:** fix relative path to Google pb files ([#1859](https://github.com/protobufjs/protobuf.js/issues/1859)) ([e42eea4](https://github.com/protobufjs/protobuf.js/commit/e42eea4868b11f4a07934804a56683321ed191e2))\n\n## [1.1.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.0.2...protobufjs-cli-v1.1.0) (2023-01-24)\n\n\n### Features\n\n* **cli:** generate static files at the granularity of proto messages ([#1840](https://github.com/protobufjs/protobuf.js/issues/1840)) ([32f2d6a](https://github.com/protobufjs/protobuf.js/commit/32f2d6a68b27997bd0f7619998695a9fa7a4fd70))\n\n## [1.0.2](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.0.1...protobufjs-cli-v1.0.2) (2022-09-09)\n\n\n### Bug Fixes\n\n* add import long to the generated .d.ts ([#1802](https://github.com/protobufjs/protobuf.js/issues/1802)) ([7c27b5a](https://github.com/protobufjs/protobuf.js/commit/7c27b5ad5d161c9f3711aa053ca704f8e1224e90))\n\n## [1.0.1](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v1.0.0...protobufjs-cli-v1.0.1) (2022-08-26)\n\n\n### Bug Fixes\n\n* **deps:** update dependency glob to v8 ([#1750](https://github.com/protobufjs/protobuf.js/issues/1750)) ([8303a64](https://github.com/protobufjs/protobuf.js/commit/8303a648bc12dcea5aa8e7efa042de39011857f9))\n* remove unused `@types/long` ([#1785](https://github.com/protobufjs/protobuf.js/issues/1785)) ([0f4af83](https://github.com/protobufjs/protobuf.js/commit/0f4af83e4ed3cef1ec035c2833e0b06cab0bd87f))\n* **types:** update type deps ([#1776](https://github.com/protobufjs/protobuf.js/issues/1776)) ([d87978b](https://github.com/protobufjs/protobuf.js/commit/d87978b8eb2a176676c58379a89206b94a6d926a))\n\n## [1.0.0](https://github.com/protobufjs/protobuf.js/compare/protobufjs-cli-v0.1.0...protobufjs-cli-v1.0.0) (2022-07-08)\n\n\n### ⚠ BREAKING CHANGES\n\n* drop support for Node 4, 6, 8, 10 (#1764)\n* move command line tool to a new package named protobufjs-cli (#1234)\n\n### Features\n\n* add --no-service option for pbjs static target ([#1577](https://github.com/protobufjs/protobuf.js/issues/1577)) ([d01394a](https://github.com/protobufjs/protobuf.js/commit/d01394a1463062824c066b653aad53c449752202))\n* add alt-comment CLI option ([#1692](https://github.com/protobufjs/protobuf.js/issues/1692)) ([7558ef0](https://github.com/protobufjs/protobuf.js/commit/7558ef0f93177978272f68f1710144a26b63e525))\n* add getTypeUrl method to generated code ([#1463](https://github.com/protobufjs/protobuf.js/issues/1463)) ([d13d5d5](https://github.com/protobufjs/protobuf.js/commit/d13d5d5688052e366aa2e9169f50dfca376b32cf))\n* add null-defaults option ([#1611](https://github.com/protobufjs/protobuf.js/issues/1611)) ([6e713ba](https://github.com/protobufjs/protobuf.js/commit/6e713baf54bd987ae52cbf92a4f2742c70201dc0))\n* add support for buffer configuration ([#1372](https://github.com/protobufjs/protobuf.js/issues/1372)) ([101aa1a](https://github.com/protobufjs/protobuf.js/commit/101aa1a4f148516fdc83a74f54a229f06e24a5de))\n* allow message.getTypeUrl provide custom typeUrlPrefix ([#1762](https://github.com/protobufjs/protobuf.js/issues/1762)) ([8aad1dd](https://github.com/protobufjs/protobuf.js/commit/8aad1dd994b1fc1f23bd71adf3a81b7a5616b210))\n* move command line tool to a new package named protobufjs-cli ([#1234](https://github.com/protobufjs/protobuf.js/issues/1234)) ([da34f43](https://github.com/protobufjs/protobuf.js/commit/da34f43ccd51ad97017e139f137521782f5ef119))\n* prepare initial publication of cli ([#1752](https://github.com/protobufjs/protobuf.js/issues/1752)) ([64811d5](https://github.com/protobufjs/protobuf.js/commit/64811d5878c31e4a86a39da5fec6aea35da22fcd))\n* proto3 optional support ([#1584](https://github.com/protobufjs/protobuf.js/issues/1584)) ([6c4d307](https://github.com/protobufjs/protobuf.js/commit/6c4d30716a9a756dcdc21d64f9c9d069315fc5b1))\n* update dependencies / general cleanup ([#1356](https://github.com/protobufjs/protobuf.js/issues/1356)) ([42f49b4](https://github.com/protobufjs/protobuf.js/commit/42f49b43f692c24c2bc1ae081b4d1ad9fa173cd7))\n\n\n### Bug Fixes\n\n* **deps:** patch minimatch vulnerability ([#1704](https://github.com/protobufjs/protobuf.js/issues/1704)) ([bac61b8](https://github.com/protobufjs/protobuf.js/commit/bac61b8c2757804bbb9c5fa0f8bc6a7bcf0bb374))\n* drop support for Node 4, 6, 8, 10 ([#1764](https://github.com/protobufjs/protobuf.js/issues/1764)) ([50370dd](https://github.com/protobufjs/protobuf.js/commit/50370dd7747a0986e83ddbe51c54b97033af5ead))\n* es6 export enum ([#1446](https://github.com/protobufjs/protobuf.js/issues/1446)) ([9f33784](https://github.com/protobufjs/protobuf.js/commit/9f33784350b1efc2e774bbfc087cbd2c47828748))\n* fromObject should not initialize oneof members ([#1597](https://github.com/protobufjs/protobuf.js/issues/1597)) ([90afe44](https://github.com/protobufjs/protobuf.js/commit/90afe4412de8070b0c0681e5905a6e0213072a85))\n* proper relative path to protobufjs in cli ([#1753](https://github.com/protobufjs/protobuf.js/issues/1753)) ([a1d6029](https://github.com/protobufjs/protobuf.js/commit/a1d60292ecb22fcf89c493c562ae07ab10ef49c9))\n* typo in pbjs help text ([#1552](https://github.com/protobufjs/protobuf.js/issues/1552)) ([7f46dbe](https://github.com/protobufjs/protobuf.js/commit/7f46dbeb538a6277035a896e1ab5e1a070e28681))\n"
  },
  {
    "path": "cli/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n---\n\nCode generated by the command line utilities is owned by the owner\nof the input file used when generating it. This code is not\nstandalone and requires a support library to be linked with it. This\nsupport library is itself covered by the above license.\n"
  },
  {
    "path": "cli/README.md",
    "content": "protobufjs-cli\n==============\n[![npm](https://img.shields.io/npm/v/protobufjs-cli.svg)](https://www.npmjs.com/package/protobufjs-cli)\n\nCommand line interface (CLI) for [protobuf.js](https://github.com/dcodeIO/protobuf.js).\n\nThis can be used to translate between file formats and to generate static code as well as TypeScript definitions.\n\n* [pbjs for JavaScript](#pbjs-for-javascript)\n* [pbts for TypeScript](#pbts-for-typescript)\n* [Reflection vs. static code](#reflection-vs-static-code)\n* [Command line API](#command-line-api)<br />\n\n### pbjs for JavaScript\n\n```\nTranslates between file formats and generates static code.\n\n  -t, --target     Specifies the target format. Also accepts a path to require a custom target.\n\n                   json          JSON representation\n                   json-module   JSON representation as a module\n                   proto2        Protocol Buffers, Version 2\n                   proto3        Protocol Buffers, Version 3\n                   static        Static code without reflection (non-functional on its own)\n                   static-module Static code without reflection as a module\n\n  -p, --path       Adds a directory to the include path.\n\n  -o, --out        Saves to a file instead of writing to stdout.\n\n  --sparse         Exports only those types referenced from a main file (experimental).\n\n  Module targets only:\n\n  -w, --wrap       Specifies the wrapper to use. Also accepts a path to require a custom wrapper.\n\n                   default   Default wrapper supporting both CommonJS and AMD\n                   commonjs  CommonJS wrapper\n                   amd       AMD wrapper\n                   es6       ES6 wrapper (implies --es6)\n                   closure   A closure adding to protobuf.roots where protobuf is a global\n\n  -r, --root       Specifies an alternative protobuf.roots name.\n\n  -l, --lint       Linter configuration. Defaults to protobuf.js-compatible rules:\n\n                   eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins\n\n  --es6            Enables ES6 syntax (const/let instead of var)\n\n  Proto sources only:\n\n  --keep-case      Keeps field casing instead of converting to camel case.\n\n  Static targets only:\n\n  --no-create      Does not generate create functions used for reflection compatibility.\n  --no-encode      Does not generate encode functions.\n  --no-decode      Does not generate decode functions.\n  --no-verify      Does not generate verify functions.\n  --no-convert     Does not generate convert functions like from/toObject\n  --no-delimited   Does not generate delimited encode/decode functions.\n  --no-beautify    Does not beautify generated code.\n  --no-comments    Does not output any JSDoc comments.\n  --no-service     Does not output service classes.\n\n  --force-long     Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.\n  --force-number   Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields.\n  --force-message  Enforces the use of message instances instead of plain objects.\n  \n  --null-defaults  Default value for optional fields is null instead of zero value.\n  --null-semantics Make nullable fields match protobuf semantics (overrides --null-defaults).\n\nusage: pbjs [options] file1.proto file2.json ...  (or pipe)  other | pbjs [options] -\n```\n\nFor production environments it is recommended to bundle all your .proto files to a single .json file, which minimizes the number of network requests and avoids any parser overhead (hint: works with just the **light** library):\n\n```\n$> pbjs -t json file1.proto file2.proto > bundle.json\n```\n\nNow, either include this file in your final bundle:\n\n```js\nvar root = protobuf.Root.fromJSON(require(\"./bundle.json\"));\n```\n\nor load it the usual way:\n\n```js\nprotobuf.load(\"bundle.json\", function(err, root) {\n    ...\n});\n```\n\nGenerated static code, on the other hand, works with just the **minimal** library. For example\n\n```\n$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto\n```\n\nwill generate static code for definitions within `file1.proto` and `file2.proto` to a CommonJS module `compiled.js`.\n\n**ProTip!** Documenting your .proto files with `/** ... */`-blocks or (trailing) `/// ...` lines translates to generated static code.\n\n\n### pbts for TypeScript\n\n```\nGenerates TypeScript definitions from annotated JavaScript files.\n\n  -o, --out       Saves to a file instead of writing to stdout.\n\n  -g, --global    Name of the global object in browser environments, if any.\n\n  --no-comments   Does not output any JSDoc comments.\n\n  Internal flags:\n\n  -n, --name      Wraps everything in a module of the specified name.\n\n  -m, --main      Whether building the main library without any imports.\n\nusage: pbts [options] file1.js file2.js ...  (or)  other | pbts [options] -\n```\n\nPicking up on the example above, the following not only generates static code to a CommonJS module `compiled.js` but also its respective TypeScript definitions to `compiled.d.ts`:\n\n```\n$> pbjs -t static-module -w commonjs -o compiled.js file1.proto file2.proto\n$> pbts -o compiled.d.ts compiled.js\n```\n\nAdditionally, TypeScript definitions of static modules are compatible with their reflection-based counterparts (i.e. as exported by JSON modules), as long as the following conditions are met:\n\n1. Instead of using `new SomeMessage(...)`, always use `SomeMessage.create(...)` because reflection objects do not provide a constructor.\n2. Types, services and enums must start with an uppercase letter to become available as properties of the reflected types as well (i.e. to be able to use `MyMessage.MyEnum` instead of `root.lookup(\"MyMessage.MyEnum\")`).\n\nFor example, the following generates a JSON module `bundle.js` and a `bundle.d.ts`, but no static code:\n\n```\n$> pbjs -t json-module -w commonjs -o bundle.js file1.proto file2.proto\n$> pbjs -t static-module file1.proto file2.proto | pbts -o bundle.d.ts -\n```\n\n### Reflection vs. static code\n\nWhile using .proto files directly requires the full library respectively pure reflection/JSON the light library, pretty much all code but the relatively short descriptors is shared.\n\nStatic code, on the other hand, requires just the minimal library, but generates additional source code without any reflection features. This also implies that there is a break-even point where statically generated code becomes larger than descriptor-based code once the amount of code generated exceeds the size of the full respectively light library.\n\nThere is no significant difference performance-wise as the code generated statically is pretty much the same as generated at runtime and both are largely interchangeable as seen in the previous section.\n\n| Source | Library | Advantages | Tradeoffs\n|--------|---------|------------|-----------\n| .proto | full    | Easily editable<br />Interoperability with other libraries<br />No compile step | Some parsing and possibly network overhead\n| JSON   | light   | Easily editable<br />No parsing overhead<br />Single bundle (no network overhead) | protobuf.js specific<br />Has a compile step\n| static | minimal | Works where `eval` access is restricted<br />Fully documented<br />Small footprint for small protos | Can be hard to edit<br />No reflection<br />Has a compile step\n\n### Command line API\n\nBoth utilities can be used programmatically by providing command line arguments and a callback to their respective `main` functions:\n\n```js\nvar pbjs = require(\"protobufjs-cli/pbjs\"); // or require(\"protobufjs-cli\").pbjs / .pbts\n\npbjs.main([ \"--target\", \"json-module\", \"path/to/myproto.proto\" ], function(err, output) {\n    if (err)\n        throw err;\n    // do something with output\n});\n```\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "cli/bin/pbjs",
    "content": "#!/usr/bin/env node\nvar path = require(\"path\"),\n    cli  = require(path.join(__dirname, \"..\", \"pbjs.js\"));\nvar ret  = cli.main(process.argv.slice(2));\nif (typeof ret === 'number')\n    process.exit(ret);\n"
  },
  {
    "path": "cli/bin/pbts",
    "content": "#!/usr/bin/env node\nvar path = require(\"path\"),\n    cli  = require(path.join(__dirname, \"..\", \"pbts.js\"));\nvar ret  = cli.main(process.argv.slice(2));\nif (typeof ret === 'number')\n    process.exit(ret);\n"
  },
  {
    "path": "cli/index.d.ts",
    "content": "import * as pbjs from \"./pbjs.js\";\nimport * as pbts from \"./pbts.js\";\nexport { pbjs, pbts };\n"
  },
  {
    "path": "cli/index.js",
    "content": "\"use strict\";\nexports.pbjs = require(\"./pbjs\");\nexports.pbts = require(\"./pbts\");\n"
  },
  {
    "path": "cli/lib/tsd-jsdoc/LICENSE",
    "content": "The MIT License\n\nCopyright (c) 2016 Chad Engler\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE."
  },
  {
    "path": "cli/lib/tsd-jsdoc/README.md",
    "content": "protobuf.js fork of tsd-jsdoc\n=============================\n\nThis is a modified version of [tsd-jsdoc](https://github.com/englercj/tsd-jsdoc) v1.0.1 for use with protobuf.js, parked here so we can process issues and pull requests. The ultimate goal is to switch back to the a recent version of tsd-jsdoc once it meets our needs.\n\nOptions\n-------\n\n* **module: `string`**<br />\n  Wraps everything in a module of the specified name.\n\n* **private: `boolean`**<br />\n  Includes private members when set to `true`.\n\n* **comments: `boolean`**<br />\n  Skips comments when explicitly set to `false`.\n\n* **destination: `string|boolean`**<br />\n  Saves to the specified destination file or to console when set to `false`.\n\nSetting options on the command line\n-----------------------------------\nProviding `-q, --query <queryString>` on the command line will set respectively override existing options. Example: `-q module=protobufjs`\n"
  },
  {
    "path": "cli/lib/tsd-jsdoc/plugin.js",
    "content": "\"use strict\";\nexports.defineTags = function(dictionary) {\n\n    dictionary.defineTag(\"template\", {\n        mustHaveValue: true,\n        canHaveType: false,\n        canHaveName: false,\n        onTagged: function(doclet, tag) {\n            (doclet.templates || (doclet.templates = [])).push(tag.text);\n        }\n    });\n\n    dictionary.defineTag(\"tstype\", {\n        mustHaveValue: true,\n        canHaveType: false,\n        canHaveName: false,\n        onTagged: function(doclet, tag) {\n            doclet.tsType = tag.text;\n        }\n    });\n};\n"
  },
  {
    "path": "cli/lib/tsd-jsdoc/publish.js",
    "content": "\"use strict\";\n\nvar fs = require(\"fs\");\n\n// output stream\nvar out = null;\n\n// documentation data\nvar data = null;\n\n// already handled objects, by name\nvar seen = {};\n\n// indentation level\nvar indent = 0;\n\n// whether indent has been written for the current line yet\nvar indentWritten = false;\n\n// provided options\nvar options = {};\n\n// queued interfaces\nvar queuedInterfaces = [];\n\n// whether writing the first line\nvar firstLine = true;\n\n// JSDoc hook\nexports.publish = function publish(taffy, opts) {\n    options = opts || {};\n\n    // query overrides options\n    if (options.query)\n        Object.keys(options.query).forEach(function(key) {\n            if (key !== \"query\")\n                switch (options[key] = options.query[key]) {\n                    case \"true\":\n                        options[key] = true;\n                        break;\n                    case \"false\":\n                        options[key] = false;\n                        break;\n                    case \"null\":\n                        options[key] = null;\n                        break;\n                }\n        });\n\n    // remove undocumented\n    taffy({ undocumented: true }).remove();\n    taffy({ ignore: true }).remove();\n    taffy({ inherited: true }).remove();\n\n    // remove private\n    if (!options.private)\n        taffy({ access: \"private\" }).remove();\n\n    // setup output\n    out = options.destination\n        ? fs.createWriteStream(options.destination)\n        : process.stdout;\n\n    try {\n        // setup environment\n        data = taffy().get();\n        indent = 0;\n        indentWritten = false;\n        firstLine = true;\n\n        // wrap everything in a module if configured\n        if (options.module) {\n            writeln(\"export = \", options.module, \";\");\n            writeln();\n            writeln(\"declare namespace \", options.module, \" {\");\n            writeln();\n            ++indent;\n        }\n\n        // handle all\n        getChildrenOf(undefined).forEach(function(child) {\n            handleElement(child, null);\n        });\n\n        // process queued\n        while (queuedInterfaces.length) {\n            var element = queuedInterfaces.shift();\n            begin(element);\n            writeInterface(element);\n            writeln(\";\");\n        }\n\n        // end wrap\n        if (options.module) {\n            --indent;\n            writeln(\"}\");\n        }\n\n        // close file output\n        if (out !== process.stdout)\n            out.end();\n\n    } finally {\n        // gc environment objects\n        out = data = null;\n        seen = options = {};\n        queuedInterfaces = [];\n    }\n};\n\n//\n// Utility\n//\n\n// writes one or multiple strings\nfunction write() {\n    var s = Array.prototype.slice.call(arguments).join(\"\");\n    if (!indentWritten) {\n        for (var i = 0; i < indent; ++i)\n            s = \"    \" + s;\n        indentWritten = true;\n    }\n    out.write(s);\n    firstLine = false;\n}\n\n// writes zero or multiple strings, followed by a new line\nfunction writeln() {\n    var s = Array.prototype.slice.call(arguments).join(\"\");\n    if (s.length)\n        write(s, \"\\n\");\n    else if (!firstLine)\n        out.write(\"\\n\");\n    indentWritten = false;\n}\n\nvar keepTags = [\n    \"param\",\n    \"returns\",\n    \"throws\",\n    \"see\"\n];\n\n// parses a comment into text and tags\nfunction parseComment(comment) {\n    var lines = comment.replace(/^ *\\/\\*\\* *|^ *\\*\\/| *\\*\\/ *$|^ *\\* */mg, \"\").trim().split(/\\r?\\n|\\r/g); // property.description has just \"\\r\" ?!\n    var desc;\n    var text = [];\n    var tags = null;\n    for (var i = 0; i < lines.length; ++i) {\n        var match = /^@(\\w+)\\b/.exec(lines[i]);\n        if (match) {\n            if (!tags) {\n                tags = [];\n                desc = text;\n            }\n            text = [];\n            tags.push({ name: match[1], text: text });\n            lines[i] = lines[i].substring(match[1].length + 1).trim();\n        }\n        if (lines[i].length || text.length)\n            text.push(lines[i]);\n    }\n    return {\n        text: desc || text,\n        tags: tags || []\n    };\n}\n\n// writes a comment\nfunction writeComment(comment, otherwiseNewline) {\n    if (!comment || options.comments === false) {\n        if (otherwiseNewline)\n            writeln();\n        return;\n    }\n    if (typeof comment !== \"object\")\n        comment = parseComment(comment);\n    comment.tags = comment.tags.filter(function(tag) {\n        return keepTags.indexOf(tag.name) > -1 && (tag.name !== \"returns\" || tag.text[0] !== \"{undefined}\");\n    });\n    writeln();\n    if (!comment.tags.length && comment.text.length < 2) {\n        writeln(\"/** \" + comment.text[0] + \" */\");\n        return;\n    }\n    writeln(\"/**\");\n    comment.text.forEach(function(line) {\n        if (line.length)\n            writeln(\" * \", line);\n        else\n            writeln(\" *\");\n    });\n    comment.tags.forEach(function(tag) {\n        var started = false;\n        if (tag.text.length) {\n            tag.text.forEach(function(line, i) {\n                if (i > 0)\n                    write(\" * \");\n                else if (tag.name !== \"throws\")\n                    line = line.replace(/^\\{[^\\s]*} ?/, \"\");\n                if (!line.length)\n                    return;\n                if (!started) {\n                    write(\" * @\", tag.name, \" \");\n                    started = true;\n                }\n                writeln(line);\n            });\n        }\n    });\n    writeln(\" */\");\n}\n\n// recursively replaces all occurencies of re's match\nfunction replaceRecursive(name, re, fn) {\n    var found;\n\n    function replacer() {\n        found = true;\n        return fn.apply(null, arguments);\n    }\n\n    do {\n        found = false;\n        name = name.replace(re, replacer);\n    } while (found);\n    return name;\n}\n\n// tests if an element is considered to be a class or class-like\nfunction isClassLike(element) {\n    return isClass(element) || isInterface(element);\n}\n\n// tests if an element is considered to be a class\nfunction isClass(element) {\n    return element && element.kind === \"class\";\n}\n\n// tests if an element is considered to be an interface\nfunction isInterface(element) {\n    return element && (element.kind === \"interface\" || element.kind === \"mixin\");\n}\n\n// tests if an element is considered to be a namespace\nfunction isNamespace(element) {\n    return element && (element.kind === \"namespace\" || element.kind === \"module\");\n}\n\n// gets all children of the specified parent\nfunction getChildrenOf(parent) {\n    var memberof = parent ? parent.longname : undefined;\n    return data.filter(function(element) {\n        return element.memberof === memberof;\n    });\n}\n\n// gets the literal type of an element\nfunction getTypeOf(element) {\n    if (element.tsType)\n        return element.tsType.replace(/\\r?\\n|\\r/g, \"\\n\");\n    var name = \"any\";\n    var type = element.type;\n    if (type && type.names && type.names.length) {\n        if (type.names.length === 1)\n            name = element.type.names[0].trim();\n        else\n            name = \"(\" + element.type.names.join(\"|\") + \")\";\n    } else\n        return name;\n\n    // Replace catchalls with any\n    name = name.replace(/\\*|\\bmixed\\b/g, \"any\");\n\n    // Ensure upper case Object for map expressions below\n    name = name.replace(/\\bobject\\b/g, \"Object\");\n\n    // Correct Something.<Something> to Something<Something>\n    name = replaceRecursive(name, /\\b(?!Object|Array)([\\w$]+)\\.<([^>]*)>/gi, function($0, $1, $2) {\n        return $1 + \"<\" + $2 + \">\";\n    });\n\n    // Replace Array.<string> with string[]\n    name = replaceRecursive(name, /\\bArray\\.?<([^>]*)>/gi, function($0, $1) {\n        return $1 + \"[]\";\n    });\n\n    // Replace Object.<string,number> with { [k: string]: number }\n    name = replaceRecursive(name, /\\bObject\\.?<([^,]*), *([^>]*)>/gi, function($0, $1, $2) {\n        return \"{ [k: \" + $1 + \"]: \" + $2 + \" }\";\n    });\n\n    // Replace functions (there are no signatures) with Function\n    name = name.replace(/\\bfunction(?:\\(\\))?\\b/g, \"Function\");\n\n    // Convert plain Object back to just object\n    name = name.replace(/\\b(Object\\b(?!\\.))/g, function($0, $1) {\n        return $1.toLowerCase();\n    });\n\n    return name;\n}\n\n// begins writing the definition of the specified element\nfunction begin(element, is_interface) {\n    if (!seen[element.longname]) {\n        if (isClass(element)) {\n            var comment = parseComment(element.comment);\n            var classdesc = comment.tags.find(function(tag) { return tag.name === \"classdesc\"; });\n            if (classdesc) {\n                comment.text = classdesc.text;\n                comment.tags = [];\n            }\n            writeComment(comment, true);\n        } else\n            writeComment(element.comment, is_interface || isClassLike(element) || isNamespace(element) || element.isEnum || element.scope === \"global\");\n        seen[element.longname] = element;\n    } else\n        writeln();\n    // ????: something changed in JSDoc 3.6.0? so that @exports + @enum does\n    // no longer yield a 'global' scope, but is some sort of unscoped module\n    // element now. The additional condition added below works around this.\n    if ((element.scope === \"global\" || element.isEnum && element.scope === undefined) && !options.module)\n        write(\"export \");\n}\n\n// writes the function signature describing element\nfunction writeFunctionSignature(element, isConstructor, isTypeDef) {\n    write(\"(\");\n\n    var params = {};\n\n    // this type\n    if (element.this)\n        params[\"this\"] = {\n            type: element.this.replace(/^{|}$/g, \"\"),\n            optional: false\n        };\n\n    // parameter types\n    if (element.params)\n        element.params.forEach(function(param) {\n            var path = param.name.split(/\\./g);\n            if (path.length === 1)\n                params[param.name] = {\n                    type: getTypeOf(param),\n                    variable: param.variable === true,\n                    optional: param.optional === true,\n                    defaultValue: param.defaultvalue // Not used yet (TODO)\n                };\n            else // Property syntax (TODO)\n                params[path[0]].type = \"{ [k: string]: any }\";\n        });\n\n    var paramNames = Object.keys(params);\n    paramNames.forEach(function(name, i) {\n        var param = params[name];\n        var type = param.type;\n        if (param.variable) {\n            name = \"...\" + name;\n            type = param.type.charAt(0) === \"(\" ? \"any[]\" : param.type + \"[]\";\n        }\n        write(name, !param.variable && param.optional ? \"?: \" : \": \", type);\n        if (i < paramNames.length - 1)\n            write(\", \");\n    });\n\n    write(\")\");\n\n    // return type\n    if (!isConstructor) {\n        write(isTypeDef ? \" => \" : \": \");\n        var typeName;\n        if (element.returns && element.returns.length && (typeName = getTypeOf(element.returns[0])) !== \"undefined\")\n            write(typeName);\n        else\n            write(\"void\");\n    }\n}\n\n// writes (a typedef as) an interface\nfunction writeInterface(element) {\n    write(\"interface \", element.name);\n    writeInterfaceBody(element);\n    writeln();\n}\n\nfunction writeInterfaceBody(element) {\n    writeln(\"{\");\n    ++indent;\n    if (element.tsType)\n        writeln(element.tsType.replace(/\\r?\\n|\\r/g, \"\\n\"));\n    else if (element.properties && element.properties.length)\n        element.properties.forEach((property) => writeProperty(property));\n    --indent;\n    write(\"}\");\n}\n\nfunction writeProperty(property, declare) {\n    writeComment(property.description);\n    if (declare)\n        write(\"let \");\n    write(property.name);\n    if (property.optional)\n        write(\"?\");\n    writeln(\": \", getTypeOf(property), \";\");\n}\n\n//\n// Handlers\n//\n\n// handles a single element of any understood type\nfunction handleElement(element, parent) {\n    if (element.scope === \"inner\")\n        return false;\n\n    if (element.optional !== true && element.type && element.type.names && element.type.names.length) {\n        for (var i = 0; i < element.type.names.length; i++) {\n            if (element.type.names[i].toLowerCase() === \"undefined\") {\n                // This element is actually optional. Set optional to true and\n                // remove the 'undefined' type\n                element.optional = true;\n                element.type.names.splice(i, 1);\n                i--;\n            }\n        }\n    }\n\n    if (seen[element.longname])\n        return true;\n    if (isClassLike(element))\n        handleClass(element, parent);\n    else switch (element.kind) {\n        case \"module\":\n            if (element.isEnum) {\n                handleEnum(element, parent);\n                break;\n            }\n            // eslint-disable-next-line no-fallthrough\n        case \"namespace\":\n            handleNamespace(element, parent);\n            break;\n        case \"constant\":\n        case \"member\":\n            handleMember(element, parent);\n            break;\n        case \"function\":\n            handleFunction(element, parent);\n            break;\n        case \"typedef\":\n            handleTypeDef(element, parent);\n            break;\n        case \"package\":\n            break;\n    }\n    seen[element.longname] = element;\n    return true;\n}\n\n// handles (just) a namespace\nfunction handleNamespace(element/*, parent*/) {\n    var children = getChildrenOf(element);\n    if (!children.length)\n        return;\n    var first = true;\n    if (element.properties)\n        element.properties.forEach(function(property) {\n            if (!/^[$\\w]+$/.test(property.name)) // incompatible in namespace\n                return;\n            if (first) {\n                begin(element);\n                writeln(\"namespace \", element.name, \" {\");\n                ++indent;\n                first = false;\n            }\n            writeProperty(property, true);\n        });\n    children.forEach(function(child) {\n        if (child.scope === \"inner\" || seen[child.longname])\n            return;\n        if (first) {\n            begin(element);\n            writeln(\"namespace \", element.name, \" {\");\n            ++indent;\n            first = false;\n        }\n        handleElement(child, element);\n    });\n    if (!first) {\n        --indent;\n        writeln(\"}\");\n    }\n}\n\n// a filter function to remove any module references\nfunction notAModuleReference(ref) {\n    return ref.indexOf(\"module:\") === -1;\n}\n\n// handles a class or class-like\nfunction handleClass(element, parent) {\n    var is_interface = isInterface(element);\n    begin(element, is_interface);\n    if (is_interface)\n        write(\"interface \");\n    else {\n        if (element.virtual)\n            write(\"abstract \");\n        write(\"class \");\n    }\n    write(element.name);\n    if (element.templates && element.templates.length)\n        write(\"<\", element.templates.join(\", \"), \">\");\n    write(\" \");\n\n    // extended classes\n    if (element.augments) {\n        var augments = element.augments.filter(notAModuleReference);\n        if (augments.length)\n            write(\"extends \", augments[0], \" \");\n    }\n\n    // implemented interfaces\n    var impls = [];\n    if (element.implements)\n        Array.prototype.push.apply(impls, element.implements);\n    if (element.mixes)\n        Array.prototype.push.apply(impls, element.mixes);\n    impls = impls.filter(notAModuleReference);\n    if (impls.length)\n        write(\"implements \", impls.join(\", \"), \" \");\n\n    writeln(\"{\");\n    ++indent;\n\n    if (element.tsType)\n        writeln(element.tsType.replace(/\\r?\\n|\\r/g, \"\\n\"));\n\n    // constructor\n    if (!is_interface && !element.virtual)\n        handleFunction(element, parent, true);\n\n    // properties\n    if (is_interface && element.properties)\n        element.properties.forEach(function(property) {\n            writeProperty(property);\n        });\n\n    // class-compatible members\n    var incompatible = [];\n    getChildrenOf(element).forEach(function(child) {\n        if (isClassLike(child) || child.kind === \"module\" || child.kind === \"typedef\" || child.isEnum) {\n            incompatible.push(child);\n            return;\n        }\n        handleElement(child, element);\n    });\n\n    --indent;\n    writeln(\"}\");\n\n    // class-incompatible members\n    if (incompatible.length) {\n        writeln();\n        if (element.scope === \"global\" && !options.module)\n            write(\"export \");\n        writeln(\"namespace \", element.name, \" {\");\n        ++indent;\n        incompatible.forEach(function(child) {\n            handleElement(child, element);\n        });\n        --indent;\n        writeln(\"}\");\n    }\n}\n\n// handles an enum\nfunction handleEnum(element) {\n    begin(element);\n\n    var stringEnum = false;\n    element.properties.forEach(function(property) {\n        if (isNaN(property.defaultvalue)) {\n            stringEnum = true;\n        }\n    });\n    if (stringEnum) {\n        writeln(\"type \", element.name, \" =\");\n        ++indent;\n        element.properties.forEach(function(property, i) {\n            write(i === 0 ? \"\" : \"| \", JSON.stringify(property.defaultvalue));\n        });\n        --indent;\n        writeln(\";\");\n    } else {\n        writeln(\"enum \", element.name, \" {\");\n        ++indent;\n        element.properties.forEach(function(property, i) {\n            write(property.name);\n            if (property.defaultvalue !== undefined)\n                write(\" = \", JSON.stringify(property.defaultvalue));\n            if (i < element.properties.length - 1)\n                writeln(\",\");\n            else\n                writeln();\n        });\n        --indent;\n        writeln(\"}\");\n    }\n}\n\n// handles a namespace or class member\nfunction handleMember(element, parent) {\n    if (element.isEnum) {\n        handleEnum(element);\n        return;\n    }\n    begin(element);\n\n    var inClass = isClassLike(parent);\n    if (inClass) {\n        write(element.access || \"public\", \" \");\n        if (element.scope === \"static\")\n            write(\"static \");\n        if (element.readonly)\n            write(\"readonly \");\n    } else\n        write(element.kind === \"constant\" ? \"const \" : \"let \");\n\n    write(element.name);\n    if (element.optional)\n        write(\"?\");\n    write(\": \");\n\n    if (element.type && element.type.names && /^Object\\b/i.test(element.type.names[0]) && element.properties) {\n        writeln(\"{\");\n        ++indent;\n        element.properties.forEach(function(property, i) {\n            writeln(JSON.stringify(property.name), \": \", getTypeOf(property), i < element.properties.length - 1 ? \",\" : \"\");\n        });\n        --indent;\n        writeln(\"};\");\n    } else\n        writeln(getTypeOf(element), \";\");\n}\n\n// handles a function or method\nfunction handleFunction(element, parent, isConstructor) {\n    var insideClass = true;\n    if (isConstructor) {\n        writeComment(element.comment);\n        write(\"constructor\");\n    } else {\n        begin(element);\n        insideClass = isClassLike(parent);\n        if (insideClass) {\n            write(element.access || \"public\", \" \");\n            if (element.scope === \"static\")\n                write(\"static \");\n        } else\n            write(\"function \");\n        write(element.name);\n        if (element.templates && element.templates.length)\n            write(\"<\", element.templates.join(\", \"), \">\");\n    }\n    writeFunctionSignature(element, isConstructor, false);\n    writeln(\";\");\n    if (!insideClass)\n        handleNamespace(element);\n}\n\n// handles a type definition (not a real type)\nfunction handleTypeDef(element, parent) {\n    if (isInterface(element)) {\n        if (isClassLike(parent))\n            queuedInterfaces.push(element);\n        else {\n            begin(element);\n            writeInterface(element);\n        }\n    } else {\n        writeComment(element.comment, true);\n        write(\"type \", element.name);\n        if (element.templates && element.templates.length)\n            write(\"<\", element.templates.join(\", \"), \">\");\n        write(\" = \");\n        if (element.tsType)\n            write(element.tsType.replace(/\\r?\\n|\\r/g, \"\\n\"));\n        else {\n            var type = getTypeOf(element);\n            if (element.type && element.type.names.length === 1 && element.type.names[0] === \"function\")\n                writeFunctionSignature(element, false, true);\n            else if (type === \"object\") {\n                if (element.properties && element.properties.length)\n                    writeInterfaceBody(element);\n                else\n                    write(\"{}\");\n            } else\n                write(type);\n        }\n        writeln(\";\");\n    }\n}\n"
  },
  {
    "path": "cli/lib/tsd-jsdoc.json",
    "content": "{\n    \"tags\": {\n        \"allowUnknownTags\": false\n    },\n    \"plugins\": [\n        \"./tsd-jsdoc/plugin\"\n    ],\n    \"opts\": {\n        \"encoding\"      : \"utf8\",\n        \"recurse\"       : true,\n        \"lenient\"       : true,\n        \"template\"      : \"./tsd-jsdoc\",\n\n        \"private\"       : false,\n        \"comments\"      : true,\n        \"destination\"   : false\n    }\n}\n"
  },
  {
    "path": "cli/package.json",
    "content": "{\n  \"name\": \"protobufjs-cli\",\n  \"description\": \"Translates between file formats and generates static code as well as TypeScript definitions.\",\n  \"version\": \"2.0.1\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/protobufjs/protobuf.js.git\"\n  },\n  \"engines\": {\n    \"node\": \">=12.0.0\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"bin\": {\n    \"pbjs\": \"bin/pbjs\",\n    \"pbts\": \"bin/pbts\"\n  },\n  \"peerDependencies\": {\n    \"protobufjs\": \"^8.0.0\"\n  },\n  \"dependencies\": {\n    \"chalk\": \"^4.0.0\",\n    \"escodegen\": \"^1.13.0\",\n    \"espree\": \"^9.0.0\",\n    \"estraverse\": \"^5.1.0\",\n    \"glob\": \"^8.0.0\",\n    \"jsdoc\": \"^4.0.0\",\n    \"minimist\": \"^1.2.0\",\n    \"semver\": \"^7.1.2\",\n    \"tmp\": \"^0.2.1\",\n    \"uglify-js\": \"^3.7.7\"\n  },\n  \"devDependencies\": {\n    \"protobufjs\": \"file:..\"\n  }\n}\n"
  },
  {
    "path": "cli/pbjs.d.ts",
    "content": "type pbjsCallback = (err: Error|null, output?: string) => void;\n\n/**\n * Runs pbjs programmatically.\n * @param {string[]} args Command line arguments\n * @param {function(?Error, string=)} [callback] Optional completion callback\n * @returns {number|undefined} Exit code, if known\n */\nexport function main(args: string[], callback?: pbjsCallback): number|undefined;\n"
  },
  {
    "path": "cli/pbjs.js",
    "content": "\"use strict\";\nvar path     = require(\"path\"),\n    fs       = require(\"fs\"),\n    minimist = require(\"minimist\"),\n    chalk    = require(\"chalk\"),\n    pkg      = require(\"./package.json\"),\n    util     = require(\"./util\"),\n    glob     = require(\"glob\"),\n    protobuf = require(\"protobufjs\");\n\nvar targets  = util.requireAll(\"./targets\");\n\n/**\n * Runs pbjs programmatically.\n * @param {string[]} args Command line arguments\n * @param {function(?Error, string=)} [callback] Optional completion callback\n * @returns {number|undefined} Exit code, if known\n */\nexports.main = function main(args, callback) {\n    var lintDefault = \"eslint-disable \" + [\n        \"block-scoped-var\",\n        \"id-length\",\n        \"no-control-regex\",\n        \"no-magic-numbers\",\n        \"no-prototype-builtins\",\n        \"no-redeclare\",\n        \"no-shadow\",\n        \"no-var\",\n        \"sort-vars\"\n    ].join(\", \");\n    var argv = minimist(args, {\n        alias: {\n            target: \"t\",\n            out: \"o\",\n            path: \"p\",\n            wrap: \"w\",\n            root: \"r\",\n            lint: \"l\",\n            // backward compatibility:\n            \"force-long\": \"strict-long\",\n            \"force-message\": \"strict-message\"\n        },\n        string: [ \"target\", \"out\", \"path\", \"wrap\", \"dependency\", \"root\", \"lint\", \"filter\" ],\n        boolean: [ \"create\", \"encode\", \"decode\", \"verify\", \"convert\", \"delimited\", \"typeurl\", \"beautify\", \"comments\", \"service\", \"es6\", \"sparse\", \"keep-case\", \"alt-comment\", \"force-long\", \"force-number\", \"force-enum-string\", \"force-message\", \"null-defaults\", \"null-semantics\"],\n        default: {\n            target: \"json\",\n            create: true,\n            encode: true,\n            decode: true,\n            verify: true,\n            convert: true,\n            delimited: true,\n            typeurl: true,\n            beautify: true,\n            comments: true,\n            service: true,\n            es6: null,\n            lint: lintDefault,\n            \"keep-case\": false,\n            \"alt-comment\": false,\n            \"force-long\": false,\n            \"force-number\": false,\n            \"force-enum-string\": false,\n            \"force-message\": false,\n            \"null-defaults\": false,\n            \"null-semantics\": false\n        }\n    });\n\n    var target = targets[argv.target],\n        files  = argv._,\n        paths  = typeof argv.path === \"string\" ? [ argv.path ] : argv.path || [];\n\n    // alias hyphen args in camel case\n    Object.keys(argv).forEach(function(key) {\n        var camelKey = key.replace(/-([a-z])/g, function($0, $1) { return $1.toUpperCase(); });\n        if (camelKey !== key)\n            argv[camelKey] = argv[key];\n    });\n\n    // protobuf.js package directory contains additional, otherwise non-bundled google types\n    paths.push(path.relative(process.cwd(), path.join(__dirname, \"../protobufjs\")) || \".\");\n\n    if (!files.length) {\n        var descs = Object.keys(targets).filter(function(key) { return !targets[key].private; }).map(function(key) {\n            return \"                   \" + util.pad(key, 14, true) + targets[key].description;\n        });\n        if (callback)\n            callback(Error(\"usage\")); // eslint-disable-line callback-return\n        else\n            process.stderr.write([\n                \"protobuf.js v\" + pkg.version + \" CLI for JavaScript\",\n                \"\",\n                chalk.bold.white(\"Translates between file formats and generates static code.\"),\n                \"\",\n                \"  -t, --target     Specifies the target format. Also accepts a path to require a custom target.\",\n                \"\",\n                descs.join(\"\\n\"),\n                \"\",\n                \"  -p, --path       Adds a directory to the include path.\",\n                \"\",\n                \"  --filter         Set up a filter to configure only those messages you need and their dependencies to compile, this will effectively reduce the final file size\",\n                \"                   Set A json file path, Example of file content: {\\\"messageNames\\\":[\\\"mypackage.messageName1\\\", \\\"messageName2\\\"] } \",\n                \"\",\n                \"  -o, --out        Saves to a file instead of writing to stdout.\",\n                \"\",\n                \"  --sparse         Exports only those types referenced from a main file (experimental).\",\n                \"\",\n                chalk.bold.gray(\"  Module targets only:\"),\n                \"\",\n                \"  -w, --wrap       Specifies the wrapper to use. Also accepts a path to require a custom wrapper.\",\n                \"\",\n                \"                   default   Default wrapper supporting both CommonJS and AMD\",\n                \"                   commonjs  CommonJS wrapper\",\n                \"                   amd       AMD wrapper\",\n                \"                   es6       ES6 wrapper (implies --es6)\",\n                \"                   closure   A closure adding to protobuf.roots where protobuf is a global\",\n                \"\",\n                \"  --dependency     Specifies which version of protobuf to require. Accepts any valid module id\",\n                \"\",\n                \"  -r, --root       Specifies an alternative protobuf.roots name.\",\n                \"\",\n                \"  -l, --lint       Linter configuration. Defaults to protobuf.js-compatible rules:\",\n                \"\",\n                \"                   \" + lintDefault,\n                \"\",\n                \"  --es6            Enables ES6 syntax (const/let instead of var)\",\n                \"\",\n                chalk.bold.gray(\"  Proto sources only:\"),\n                \"\",\n                \"  --keep-case      Keeps field casing instead of converting to camel case.\",\n                \"  --alt-comment    Turns on an alternate comment parsing mode that preserves more comments.\",\n                \"\",\n                chalk.bold.gray(\"  Static targets only:\"),\n                \"\",\n                \"  --no-create      Does not generate create functions used for reflection compatibility.\",\n                \"  --no-encode      Does not generate encode functions.\",\n                \"  --no-decode      Does not generate decode functions.\",\n                \"  --no-verify      Does not generate verify functions.\",\n                \"  --no-convert     Does not generate convert functions like from/toObject\",\n                \"  --no-delimited   Does not generate delimited encode/decode functions.\",\n                \"  --no-typeurl     Does not generate getTypeUrl function.\",\n                \"  --no-beautify    Does not beautify generated code.\",\n                \"  --no-comments    Does not output any JSDoc comments.\",\n                \"  --no-service     Does not output service classes.\",\n                \"\",\n                \"  --force-long     Enforces the use of 'Long' for s-/u-/int64 and s-/fixed64 fields.\",\n                \"  --force-number   Enforces the use of 'number' for s-/u-/int64 and s-/fixed64 fields.\",\n                \"  --force-message  Enforces the use of message instances instead of plain objects.\",\n                \"\",\n                \"  --null-defaults  Default value for optional fields is null instead of zero value.\",\n                \"  --null-semantics Make nullable fields match protobuf semantics (overrides --null-defaults).\",\n                \"\",\n                \"usage: \" + chalk.bold.green(\"pbjs\") + \" [options] file1.proto file2.json ...\" + chalk.gray(\"  (or pipe)  \") + \"other | \" + chalk.bold.green(\"pbjs\") + \" [options] -\",\n                \"\"\n            ].join(\"\\n\"));\n        return 1;\n    }\n\n    if (typeof argv[\"strict-long\"] === \"boolean\")\n        argv[\"force-long\"] = argv[\"strict-long\"];\n\n    // Resolve glob expressions\n    for (var i = 0; i < files.length;) {\n        if (glob.hasMagic(files[i])) {\n            var matches = glob.sync(files[i]);\n            Array.prototype.splice.apply(files, [i, 1].concat(matches));\n            i += matches.length;\n        } else\n            ++i;\n    }\n\n    // Require custom target\n    if (!target)\n        target = require(path.resolve(process.cwd(), argv.target));\n\n    var root = new protobuf.Root();\n\n    var mainFiles = [];\n\n    // Search include paths when resolving imports\n    root.resolvePath = function pbjsResolvePath(origin, target) {\n        var normOrigin = protobuf.util.path.normalize(origin),\n            normTarget = protobuf.util.path.normalize(target);\n        if (!normOrigin)\n            mainFiles.push(normTarget);\n\n        var resolved = protobuf.util.path.resolve(normOrigin, normTarget, true);\n        var idx = resolved.lastIndexOf(\"google/protobuf/\");\n        if (idx > -1) {\n            var altname = resolved.substring(idx);\n            if (altname in protobuf.common)\n                resolved = altname;\n        }\n\n        if (fs.existsSync(resolved))\n            return resolved;\n\n        for (var i = 0; i < paths.length; ++i) {\n            var iresolved = protobuf.util.path.resolve(paths[i] + \"/\", target);\n            if (fs.existsSync(iresolved))\n                return iresolved;\n        }\n\n        return resolved;\n    };\n\n    // `--wrap es6` implies `--es6` but not the other way around. You can still use e.g. `--es6 --wrap commonjs`\n    if (argv.wrap === \"es6\") {\n        argv.es6 = true;\n    }\n\n    var parseOptions = {\n        \"keepCase\": argv[\"keep-case\"] || false,\n        \"alternateCommentMode\": argv[\"alt-comment\"] || false,\n    };\n\n    // Read from stdin\n    if (files.length === 1 && files[0] === \"-\") {\n        var data = [];\n        process.stdin.on(\"data\", function(chunk) {\n            data.push(chunk);\n        });\n        process.stdin.on(\"end\", function() {\n            var source = Buffer.concat(data).toString(\"utf8\");\n            try {\n                if (source.charAt(0) !== \"{\") {\n                    protobuf.parse.filename = \"-\";\n                    protobuf.parse(source, root, parseOptions);\n                } else {\n                    var json = JSON.parse(source);\n                    root.setOptions(json.options).addJSON(json);\n                }\n                callTarget();\n            } catch (err) {\n                if (callback) {\n                    callback(err);\n                    return;\n                }\n                throw err;\n            }\n        });\n\n    // Load from disk\n    } else {\n        try {\n            root.loadSync(files, parseOptions).resolveAll(); // sync is deterministic while async is not\n            if (argv.sparse)\n                sparsify(root);\n            callTarget();\n        } catch (err) {\n            if (callback) {\n                callback(err);\n                return undefined;\n            }\n            throw err;\n        }\n    }\n\n    function markReferenced(tobj) {\n        tobj.referenced = true;\n        // also mark a type's fields and oneofs\n        if (tobj.fieldsArray)\n            tobj.fieldsArray.forEach(function(fobj) {\n                fobj.referenced = true;\n            });\n        if (tobj.oneofsArray)\n            tobj.oneofsArray.forEach(function(oobj) {\n                oobj.referenced = true;\n            });\n        // also mark an extension field's extended type, but not its (other) fields\n        if (tobj.extensionField)\n            tobj.extensionField.parent.referenced = true;\n    }\n\n    function sparsify(root) {\n\n        // 1. mark directly or indirectly referenced objects\n        util.traverse(root, function(obj) {\n            if (!obj.filename)\n                return;\n            if (mainFiles.indexOf(obj.filename) > -1)\n                util.traverseResolved(obj, markReferenced);\n        });\n\n        // 2. empty unreferenced objects\n        util.traverse(root, function(obj) {\n            var parent = obj.parent;\n            if (!parent || obj.referenced) // root or referenced\n                return;\n            // remove unreferenced namespaces\n            if (obj instanceof protobuf.Namespace) {\n                var hasReferenced = false;\n                util.traverse(obj, function(iobj) {\n                    if (iobj.referenced)\n                        hasReferenced = true;\n                });\n                if (hasReferenced) { // replace with plain namespace if a namespace subclass\n                    if (obj instanceof protobuf.Type || obj instanceof protobuf.Service) {\n                        var robj = new protobuf.Namespace(obj.name, obj.options);\n                        robj.nested = obj.nested;\n                        parent.add(robj);\n                    }\n                } else // remove completely if nothing inside is referenced\n                    parent.remove(obj);\n\n            // remove everything else unreferenced\n            } else if (!(obj instanceof protobuf.Namespace))\n                parent.remove(obj);\n        });\n\n        // 3. validate that everything is fine\n        root.resolveAll();\n    }\n\n    function filterMessage() {\n        if (argv.filter) {\n            // This is a piece of degradable logic\n            try {\n                const needMessage = JSON.parse(fs.readFileSync(argv.filter));\n                util.filterMessage(root, needMessage);\n            } catch (error) {\n                process.stderr.write(`The filter not work, please check whether the file is correct: ${error.message}\\n`);\n            }\n        }\n    }\n\n    function callTarget() {\n        filterMessage();\n        target(root, argv, function targetCallback(err, output) {\n            if (err) {\n                if (callback)\n                    return callback(err);\n                throw err;\n            }\n            try {\n                if (argv.out)\n                    fs.writeFileSync(argv.out, output, { encoding: \"utf8\" });\n                else if (!callback)\n                    process.stdout.write(output, \"utf8\");\n                return callback\n                    ? callback(null, output)\n                    : undefined;\n            } catch (err) {\n                if (callback)\n                    return callback(err);\n                throw err;\n            }\n        });\n    }\n\n    return undefined;\n};\n"
  },
  {
    "path": "cli/pbts.d.ts",
    "content": "type pbtsCallback = (err: Error|null, output?: string) => void;\n\n/**\n * Runs pbts programmatically.\n * @param {string[]} args Command line arguments\n * @param {function(?Error, string=)} [callback] Optional completion callback\n * @returns {number|undefined} Exit code, if known\n */\nexport function main(args: string[], callback?: pbtsCallback): number|undefined;\n"
  },
  {
    "path": "cli/pbts.js",
    "content": "\"use strict\";\nvar child_process = require(\"child_process\"),\n    path     = require(\"path\"),\n    fs       = require(\"fs\"),\n    pkg      = require(\"./package.json\"),\n    minimist = require(\"minimist\"),\n    chalk    = require(\"chalk\"),\n    glob     = require(\"glob\"),\n    tmp      = require(\"tmp\");\n\n/**\n * Runs pbts programmatically.\n * @param {string[]} args Command line arguments\n * @param {function(?Error, string=)} [callback] Optional completion callback\n * @returns {number|undefined} Exit code, if known\n */\nexports.main = function(args, callback) {\n    var argv = minimist(args, {\n        alias: {\n            name: \"n\",\n            out : \"o\",\n            main: \"m\",\n            global: \"g\",\n            import: \"i\"\n        },\n        string: [ \"name\", \"out\", \"global\", \"import\" ],\n        boolean: [ \"comments\", \"main\" ],\n        default: {\n            comments: true,\n            main: false\n        }\n    });\n\n    var files  = argv._;\n\n    if (!files.length) {\n        if (callback)\n            callback(Error(\"usage\")); // eslint-disable-line callback-return\n        else\n            process.stderr.write([\n                \"protobuf.js v\" + pkg.version + \" CLI for TypeScript\",\n                \"\",\n                chalk.bold.white(\"Generates TypeScript definitions from annotated JavaScript files.\"),\n                \"\",\n                \"  -o, --out       Saves to a file instead of writing to stdout.\",\n                \"\",\n                \"  -g, --global    Name of the global object in browser environments, if any.\",\n                \"\",\n                \"  -i, --import    Comma delimited list of imports. Local names will equal camelCase of the basename.\",\n                \"\",\n                \"  --no-comments   Does not output any JSDoc comments.\",\n                \"\",\n                chalk.bold.gray(\"  Internal flags:\"),\n                \"\",\n                \"  -n, --name      Wraps everything in a module of the specified name.\",\n                \"\",\n                \"  -m, --main      Whether building the main library without any imports.\",\n                \"\",\n                \"usage: \" + chalk.bold.green(\"pbts\") + \" [options] file1.js file2.js ...\" + chalk.bold.gray(\"  (or)  \") + \"other | \" + chalk.bold.green(\"pbts\") + \" [options] -\",\n                \"\"\n            ].join(\"\\n\"));\n        return 1;\n    }\n\n    // Resolve glob expressions\n    for (var i = 0; i < files.length;) {\n        if (glob.hasMagic(files[i])) {\n            var matches = glob.sync(files[i]);\n            Array.prototype.splice.apply(files, [i, 1].concat(matches));\n            i += matches.length;\n        } else\n            ++i;\n    }\n\n    var cleanup = [];\n\n    // Read from stdin (to a temporary file)\n    if (files.length === 1 && files[0] === \"-\") {\n        var data = [];\n        process.stdin.on(\"data\", function(chunk) {\n            data.push(chunk);\n        });\n        process.stdin.on(\"end\", function() {\n            files[0] = tmp.tmpNameSync() + \".js\";\n            fs.writeFileSync(files[0], Buffer.concat(data));\n            cleanup.push(files[0]);\n            callJsdoc();\n        });\n\n    // Load from disk\n    } else {\n        callJsdoc();\n    }\n\n    function callJsdoc() {\n\n        // There is no proper API for jsdoc, so this executes the CLI and pipes the output\n        var basedir = path.join(__dirname, \".\");\n        var moduleName = argv.name || \"null\";\n        var nodePath = process.execPath;\n        var cmd = \"\\\"\" + nodePath + \"\\\" \\\"\" + require.resolve(\"jsdoc/jsdoc.js\") + \"\\\" -c \\\"\" + path.join(basedir, \"lib\", \"tsd-jsdoc.json\") + \"\\\" -q \\\"module=\" + encodeURIComponent(moduleName) + \"&comments=\" + Boolean(argv.comments) + \"\\\" \" + files.map(function(file) { return \"\\\"\" + file + \"\\\"\"; }).join(\" \");\n        var child = child_process.exec(cmd, {\n            cwd: process.cwd(),\n            argv0: \"node\",\n            stdio: \"pipe\",\n            maxBuffer: 1 << 26 // 67mb\n        });\n        var out = [];\n        var ended = false;\n        var closed = false;\n        child.stdout.on(\"data\", function(data) {\n            out.push(data);\n        });\n        child.stdout.on(\"end\", function() {\n            if (closed) finish();\n            else ended = true;\n        });\n        child.stderr.pipe(process.stderr);\n        child.on(\"close\", function(code) {\n            // clean up temporary files, no matter what\n            try { cleanup.forEach(fs.unlinkSync); } catch(e) {/**/} cleanup = [];\n\n            if (code) {\n                out = out.join(\"\").replace(/\\s*JSDoc \\d+\\.\\d+\\.\\d+ [^$]+/, \"\");\n                process.stderr.write(out);\n                var err = Error(\"code \" + code);\n                if (callback)\n                    return callback(err);\n                throw err;\n            }\n\n            if (ended) return finish();\n            closed = true;\n            return undefined;\n        });\n\n        function getImportName(importItem) {\n            return path.basename(importItem, \".js\").replace(/([-_~.+]\\w)/g, function(match) {\n                return match[1].toUpperCase();\n            });\n        }\n\n        function finish() {\n            var output = [];\n            if (argv.main)\n                output.push(\n                    \"// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.\",\n                    \"\"\n                );\n            if (argv.global)\n                output.push(\n                    \"export as namespace \" + argv.global + \";\",\n                    \"\"\n                );\n\n            if (!argv.main) {\n                // Ensure we have a usable array of imports\n                var importArray = typeof argv.import === \"string\" ? argv.import.split(\",\") : argv.import || [];\n\n                // Build an object of imports and paths\n                var imports = {\n                    $protobuf: \"protobufjs\"\n                };\n                importArray.forEach(function(importItem) {\n                    imports[getImportName(importItem)] = importItem;\n                });\n\n                // Write out the imports\n                Object.keys(imports).forEach(function(key) {\n                    output.push(\"import * as \" + key + \" from \\\"\" + imports[key] + \"\\\";\");\n                });\n\n                output.push(\"import Long = require(\\\"long\\\");\");\n            }\n\n            output = output.join(\"\\n\") + \"\\n\" + out.join(\"\");\n\n            try {\n                if (argv.out)\n                    fs.writeFileSync(argv.out, output, { encoding: \"utf8\" });\n                else if (!callback)\n                    process.stdout.write(output, \"utf8\");\n                return callback\n                    ? callback(null, output)\n                    : undefined;\n            } catch (err) {\n                if (callback)\n                    return callback(err);\n                throw err;\n            }\n        }\n    }\n\n    return undefined;\n};\n"
  },
  {
    "path": "cli/scripts/prepublish.js",
    "content": "\"use strict\";\n\nvar path = require(\"path\"),\n    fs   = require(\"fs\");\n\n// ensure LF on bin files\n[\n    path.join(__dirname, \"..\", \"bin\", \"pbjs\"),\n    path.join(__dirname, \"..\", \"bin\", \"pbts\")\n]\n.forEach(function(file) {\n    fs.writeFileSync(file, fs.readFileSync(file).toString(\"utf8\").replace(/\\r?\\n/g, \"\\n\"), \"utf8\");\n});\n"
  },
  {
    "path": "cli/targets/json-module.js",
    "content": "\"use strict\";\nmodule.exports = json_module;\n\nvar util = require(\"../util\");\n\nvar protobuf = require(\"protobufjs\");\n\njson_module.description = \"JSON representation as a module\";\n\nfunction jsonSafeProp(json) {\n    return json.replace(/^( +)\"(\\w+)\":/mg, function($0, $1, $2) {\n        return protobuf.util.safeProp($2).charAt(0) === \".\"\n            ? $1 + $2 + \":\"\n            : $0;\n    });\n}\n\nfunction json_module(root, options, callback) {\n    try {\n        var rootProp = protobuf.util.safeProp(options.root || \"default\");\n        var output = [\n            (options.es6 ? \"const\" : \"var\") + \" $root = ($protobuf.roots\" + rootProp + \" || ($protobuf.roots\" + rootProp + \" = new $protobuf.Root()))\\n\"\n        ];\n        if (root.options) {\n            var optionsJson = jsonSafeProp(JSON.stringify(root.options, null, 2));\n            output.push(\".setOptions(\" + optionsJson + \")\\n\");\n        }\n        var json = jsonSafeProp(JSON.stringify(root.nested, null, 2).trim());\n        output.push(\".addJSON(\" + json + \");\");\n        output = util.wrap(output.join(\"\"), protobuf.util.merge({ dependency: \"protobufjs/light\" }, options));\n        process.nextTick(function() {\n            callback(null, output);\n        });\n    } catch (e) {\n        return callback(e);\n    }\n    return undefined;\n}\n"
  },
  {
    "path": "cli/targets/json.js",
    "content": "\"use strict\";\nmodule.exports = json_target;\n\njson_target.description = \"JSON representation\";\n\nfunction json_target(root, options, callback) {\n    callback(null, JSON.stringify(root, null, 2));\n}\n"
  },
  {
    "path": "cli/targets/proto.js",
    "content": "\"use strict\";\nmodule.exports = proto_target;\n\nproto_target.private = true;\n\nvar protobuf = require(\"protobufjs\");\n\nvar Namespace  = protobuf.Namespace,\n    Enum       = protobuf.Enum,\n    Type       = protobuf.Type,\n    Field      = protobuf.Field,\n    OneOf      = protobuf.OneOf,\n    Service    = protobuf.Service,\n    Method     = protobuf.Method,\n    types      = protobuf.types,\n    util       = protobuf.util;\n\nfunction underScore(str) {\n    return str.substring(0,1)\n         + str.substring(1)\n               .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\n}\n\nvar out = [];\nvar indent = 0;\nvar first = false;\nvar syntax = 3;\n\nfunction proto_target(root, options, callback) {\n    if (options) {\n        switch (options.syntax) {\n            case undefined:\n            case \"proto3\":\n            case \"3\":\n                syntax = 3;\n                break;\n            case \"proto2\":\n            case \"2\":\n                syntax = 2;\n                break;\n            default:\n                return callback(Error(\"invalid syntax: \" + options.syntax));\n        }\n    }\n    indent = 0;\n    first = false;\n    try {\n        buildRoot(root);\n        return callback(null, out.join(\"\\n\"));\n    } catch (err) {\n        return callback(err);\n    } finally {\n        out = [];\n        syntax = 3;\n    }\n}\n\nfunction push(line) {\n    if (line === \"\")\n        out.push(\"\");\n    else {\n        var ind = \"\";\n        for (var i = 0; i < indent; ++i)\n            ind += \"    \";\n        out.push(ind + line);\n    }\n}\n\nfunction escape(str) {\n    return str.replace(/[\\\\\"']/g, \"\\\\$&\")\n              .replace(/\\r/g, \"\\\\r\")\n              .replace(/\\n/g, \"\\\\n\")\n              .replace(/\\u0000/g, \"\\\\0\"); // eslint-disable-line no-control-regex\n}\n\nfunction value(v) {\n    switch (typeof v) {\n        case \"boolean\":\n            return v ? \"true\" : \"false\";\n        case \"number\":\n            return v.toString();\n        default:\n            return \"\\\"\" + escape(String(v)) + \"\\\"\";\n    }\n}\n\nfunction buildRoot(root) {\n    root.resolveAll();\n    var pkg = [];\n    var ptr = root;\n    var repeat = true;\n    do {\n        var nested = ptr.nestedArray;\n        if (nested.length === 1 && nested[0] instanceof Namespace && !(nested[0] instanceof Type || nested[0] instanceof Service)) {\n            ptr = nested[0];\n            if (ptr !== root)\n                pkg.push(ptr.name);\n        } else\n            repeat = false;\n    } while (repeat);\n    out.push(\"syntax = \\\"proto\" + syntax + \"\\\";\");\n    if (pkg.length)\n        out.push(\"\", \"package \" + pkg.join(\".\") + \";\");\n\n    buildOptions(ptr);\n    ptr.nestedArray.forEach(build);\n}\n\nfunction build(object) {\n    if (object instanceof Enum)\n        buildEnum(object);\n    else if (object instanceof Type)\n        buildType(object);\n    else if (object instanceof Field)\n        buildField(object);\n    else if (object instanceof OneOf)\n        buildOneOf(object);\n    else if (object instanceof Service)\n        buildService(object);\n    else if (object instanceof Method)\n        buildMethod(object);\n    else\n        buildNamespace(object);\n}\n\nfunction buildNamespace(namespace) { // just a namespace, not a type etc.\n    push(\"\");\n    push(\"message \" + namespace.name + \" {\");\n    ++indent;\n    buildOptions(namespace);\n    consolidateExtends(namespace.nestedArray).remaining.forEach(build);\n    --indent;\n    push(\"}\");\n}\n\nfunction buildEnum(enm) {\n    push(\"\");\n    push(\"enum \" + enm.name + \" {\");\n    buildOptions(enm);\n    ++indent; first = true;\n    Object.keys(enm.values).forEach(function(name) {\n        var val = enm.values[name];\n        if (first) {\n            push(\"\");\n            first = false;\n        }\n        push(name + \" = \" + val + \";\");\n    });\n    --indent; first = false;\n    push(\"}\");\n}\n\nfunction buildRanges(keyword, ranges) {\n    if (ranges && ranges.length) {\n        var parts = [];\n        ranges.forEach(function(range) {\n            if (typeof range === \"string\")\n                parts.push(\"\\\"\" + escape(range) + \"\\\"\");\n            else if (range[0] === range[1])\n                parts.push(range[0]);\n            else\n                parts.push(range[0] + \" to \" + (range[1] === 0x1FFFFFFF ? \"max\" : range[1]));\n        });\n        push(\"\");\n        push(keyword + \" \" + parts.join(\", \") + \";\");\n    }\n}\n\nfunction buildType(type) {\n    if (type.group)\n        return; // built with the sister-field\n    push(\"\");\n    push(\"message \" + type.name + \" {\");\n    ++indent;\n    buildOptions(type);\n    type.oneofsArray.forEach(build);\n    first = true;\n    type.fieldsArray.forEach(build);\n    consolidateExtends(type.nestedArray).remaining.forEach(build);\n    buildRanges(\"extensions\", type.extensions);\n    buildRanges(\"reserved\", type.reserved);\n    --indent;\n    push(\"}\");\n}\n\nfunction buildField(field, passExtend) {\n    if (field.partOf && !field.partOf.isProto3Optional) {\n        return;\n    }\n    if (field.declaringField || field.extend !== undefined && !passExtend) {\n        return;\n    }\n    if (first) {\n        first = false;\n        push(\"\");\n    }\n    if (field.resolvedType && field.resolvedType.group) {\n        buildGroup(field);\n        return;\n    }\n    var sb = [];\n    if (field.map)\n        sb.push(\"map<\" + field.keyType + \", \" + field.type + \">\");\n    else if (field.repeated)\n        sb.push(\"repeated\", field.type);\n    else if (syntax === 2)\n        sb.push(field.required ? \"required\" : \"optional\", field.type);\n    else if (syntax === 3 && field.hasPresence)\n        sb.push(\"optional\", field.type);\n    else\n        sb.push(field.type);\n    sb.push(underScore(field.name), \"=\", field.id);\n    var opts = buildFieldOptions(field);\n    if (opts)\n        sb.push(opts);\n    push(sb.join(\" \") + \";\");\n}\n\nfunction buildGroup(field) {\n    push((field.rule || \"optional\") + \" group \" + field.resolvedType.name + \" = \" + field.id + \" {\");\n    ++indent;\n    buildOptions(field.resolvedType);\n    first = true;\n    field.resolvedType.fieldsArray.forEach(function(field) {\n        buildField(field);\n    });\n    --indent;\n    push(\"}\");\n}\n\nfunction buildFieldOptions(field) {\n    var keys = [];\n    if (field.options) {\n        keys = Object.keys(field.options);\n    }\n    var sb = [];\n    keys.forEach(function(key) {\n        if (key === \"proto3_optional\" || key === \"packed\" || key === \"features\") return;\n\n        var val = field.options[key];\n        switch (key) {\n            case \"default\":\n                if (syntax === 3)\n                    return;\n                // skip default (resolved) default values\n                if (field.long && !util.longNeq(field.defaultValue, types.defaults[field.type]) || !field.long && field.defaultValue === types.defaults[field.type])\n                    return;\n                // enum defaults specified as strings are type references and not enclosed in quotes\n                if (field.resolvedType instanceof Enum)\n                    break;\n                // otherwise fallthrough\n            default:\n                val = value(val);\n                break;\n        }\n        sb.push(key + \"=\" + val);\n    });\n    var packable = types.packed[field.resolvedType instanceof Enum ? \"int32\" : field.type];\n    if (packable !== undefined) {\n        if (field.packed && syntax === 2) {\n            sb.push(\"packed=true\");\n        } else if(!field.packed && syntax === 3) {\n            sb.push(\"packed=false\");\n        }\n    }\n    return sb.length\n        ? \"[\" + sb.join(\", \") + \"]\"\n        : null;\n}\n\nfunction consolidateExtends(nested) {\n    var ext = {};\n    nested = nested.filter(function(obj) {\n        if (!(obj instanceof Field) || obj.extend === undefined)\n            return true;\n        (ext[obj.extend] || (ext[obj.extend] = [])).push(obj);\n        return false;\n    });\n    Object.keys(ext).forEach(function(extend) {\n        push(\"\");\n        push(\"extend \" + extend + \" {\");\n        ++indent; first = true;\n        ext[extend].forEach(function(field) {\n            buildField(field, true);\n        });\n        --indent;\n        push(\"}\");\n    });\n    return {\n        remaining: nested\n    };\n}\n\nfunction buildOneOf(oneof) {\n    if (oneof.isProto3Optional) {\n        return;\n    }\n\n    push(\"\");\n    push(\"oneof \" + underScore(oneof.name) + \" {\");\n    ++indent; first = true;\n    oneof.oneof.forEach(function(fieldName) {\n        var field = oneof.parent.get(fieldName);\n        if (first) {\n            first = false;\n            push(\"\");\n        }\n        var opts = buildFieldOptions(field);\n        push(field.type + \" \" + underScore(field.name) + \" = \" + field.id + (opts ? \" \" + opts : \"\") + \";\");\n    });\n    --indent;\n    push(\"}\");\n}\n\nfunction buildService(service) {\n    push(\"service \" + service.name + \" {\");\n    ++indent;\n    service.methodsArray.forEach(build);\n    consolidateExtends(service.nestedArray).remaining.forEach(build);\n    --indent;\n    push(\"}\");\n}\n\nfunction buildMethod(method) {\n    push(method.type + \" \" + method.name + \" (\" + (method.requestStream ? \"stream \" : \"\") + method.requestType + \") returns (\" + (method.responseStream ? \"stream \" : \"\") + method.responseType + \");\");\n}\n\nfunction buildOptions(object, ignore = []) {\n    if (!object.options)\n        return;\n    first = true;\n    Object.keys(object.options).forEach(function(key) {\n        if (ignore.includes(key) || key === \"features\") return;\n        if (first) {\n            first = false;\n            push(\"\");\n        }\n        var val = object.options[key];\n        push(\"option \" + key + \" = \" + JSON.stringify(val) + \";\");\n    });\n}\n"
  },
  {
    "path": "cli/targets/proto2.js",
    "content": "\"use strict\";\nmodule.exports = proto2_target;\n\nvar protobuf = require(\"protobufjs\");\n\nproto2_target.description = \"Protocol Buffers, Version 2\";\n\nfunction proto2_target(root, options, callback) {\n    require(\"./proto\")(root, protobuf.util.merge(options, { syntax: \"proto2\" }), callback);\n}\n"
  },
  {
    "path": "cli/targets/proto3.js",
    "content": "\"use strict\";\nmodule.exports = proto3_target;\n\nvar protobuf = require(\"protobufjs\");\n\nproto3_target.description = \"Protocol Buffers, Version 3\";\n\nfunction proto3_target(root, options, callback) {\n    require(\"./proto\")(root, protobuf.util.merge(options, { syntax: \"proto3\" }), callback);\n}\n"
  },
  {
    "path": "cli/targets/static-module.js",
    "content": "\"use strict\";\nmodule.exports = static_module_target;\n\n// - The default wrapper supports AMD, CommonJS and the global scope (as window.root), in this order.\n// - You can specify a custom wrapper with the --wrap argument.\n// - CommonJS modules depend on the minimal build for reduced package size with browserify.\n// - AMD and global scope depend on the full library for now.\n\nvar util          = require(\"../util\"),\n    protobuf      = require(\"protobufjs\");\n\nstatic_module_target.description = \"Static code without reflection as a module\";\n\nfunction static_module_target(root, options, callback) {\n    require(\"./static\")(root, options, function(err, output) {\n        if (err) {\n            callback(err);\n            return;\n        }\n        try {\n            output = util.wrap(output, protobuf.util.merge({ dependency: \"protobufjs/minimal\" }, options));\n        } catch (e) {\n            callback(e);\n            return;\n        }\n        callback(null, output);\n    });\n}\n"
  },
  {
    "path": "cli/targets/static.js",
    "content": "\"use strict\";\nmodule.exports = static_target;\n\nvar UglifyJS   = require(\"uglify-js\"),\n    espree     = require(\"espree\"),\n    escodegen  = require(\"escodegen\"),\n    estraverse = require(\"estraverse\"),\n    protobuf   = require(\"protobufjs\");\n\nvar Type      = protobuf.Type,\n    Service   = protobuf.Service,\n    Enum      = protobuf.Enum,\n    Namespace = protobuf.Namespace,\n    util      = protobuf.util;\n\nvar out = [];\nvar indent = 0;\nvar config = {};\n\nstatic_target.description = \"Static code without reflection (non-functional on its own)\";\n\nfunction static_target(root, options, callback) {\n    config = options;\n    try {\n        var aliases = [];\n        if (config.decode)\n            aliases.push(\"Reader\");\n        if (config.encode)\n            aliases.push(\"Writer\");\n        aliases.push(\"util\");\n        if (aliases.length) {\n            if (config.comments)\n                push(\"// Common aliases\");\n            push((config.es6 ? \"const \" : \"var \") + aliases.map(function(name) { return \"$\" + name + \" = $protobuf.\" + name; }).join(\", \") + \";\");\n            push(\"\");\n        }\n        if (config.comments) {\n            if (root.comment) {\n                pushComment(\"@fileoverview \" + root.comment);\n                push(\"\");\n            }\n            push(\"// Exported root namespace\");\n        }\n        var rootProp = util.safeProp(config.root || \"default\");\n        push((config.es6 ? \"const\" : \"var\") + \" $root = $protobuf.roots\" + rootProp + \" || ($protobuf.roots\" + rootProp + \" = {});\");\n        buildNamespace(null, root);\n        return callback(null, out.join(\"\\n\"));\n    } catch (err) {\n        return callback(err);\n    } finally {\n        out = [];\n        indent = 0;\n        config = {};\n    }\n}\n\nfunction push(line) {\n    if (line === \"\")\n        return out.push(\"\");\n    var ind = \"\";\n    for (var i = 0; i < indent; ++i)\n        ind += \"    \";\n    return out.push(ind + line);\n}\n\nfunction pushComment(lines) {\n    if (!config.comments)\n        return;\n    var split = [];\n    for (var i = 0; i < lines.length; ++i)\n        if (lines[i] != null && lines[i].substring(0, 8) !== \"@exclude\")\n            Array.prototype.push.apply(split, lines[i].split(/\\r?\\n/g));\n    push(\"/**\");\n    split.forEach(function(line) {\n        if (line === null)\n            return;\n        push(\" * \" + line.replace(/\\*\\//g, \"* /\"));\n    });\n    push(\" */\");\n}\n\nfunction exportName(object, asInterface) {\n    if (asInterface) {\n        if (object.__interfaceName)\n            return object.__interfaceName;\n    } else if (object.__exportName)\n        return object.__exportName;\n    var parts = object.fullName.substring(1).split(\".\"),\n        i = 0;\n    while (i < parts.length)\n        parts[i] = escapeName(parts[i++]);\n    if (asInterface)\n        parts[i - 1] = \"I\" + parts[i - 1];\n    return object[asInterface ? \"__interfaceName\" : \"__exportName\"] = parts.join(\".\");\n}\n\nfunction escapeName(name) {\n    if (!name)\n        return \"$root\";\n    return util.isReserved(name) ? name + \"_\" : name;\n}\n\nfunction aOrAn(name) {\n    return ((/^[hH](?:ou|on|ei)/.test(name) || /^[aeiouAEIOU][a-z]/.test(name)) && !/^us/i.test(name)\n        ? \"an \"\n        : \"a \") + name;\n}\n\nfunction buildNamespace(ref, ns) {\n    if (!ns)\n        return;\n\n    if (ns instanceof Service && !config.service)\n        return;\n\n    if (ns.name !== \"\") {\n        push(\"\");\n        if (!ref && config.es6)\n            push(\"export const \" + escapeName(ns.name) + \" = \" + escapeName(ref) + \".\" + escapeName(ns.name) + \" = (() => {\");\n        else\n            push(escapeName(ref) + \".\" + escapeName(ns.name) + \" = (function() {\");\n        ++indent;\n    }\n\n    if (ns instanceof Type) {\n        buildType(undefined, ns);\n    } else if (ns instanceof Service)\n        buildService(undefined, ns);\n    else if (ns.name !== \"\") {\n        push(\"\");\n        pushComment([\n            ns.comment || \"Namespace \" + ns.name + \".\",\n            ns.parent instanceof protobuf.Root ? \"@exports \" + escapeName(ns.name) : \"@memberof \" + exportName(ns.parent),\n            \"@namespace\"\n        ]);\n        push((config.es6 ? \"const\" : \"var\") + \" \" + escapeName(ns.name) + \" = {};\");\n    }\n\n    ns.nestedArray.forEach(function(nested) {\n        if (nested instanceof Enum)\n            buildEnum(ns.name, nested);\n        else if (nested instanceof Namespace)\n            buildNamespace(ns.name, nested);\n    });\n    if (ns.name !== \"\") {\n        push(\"\");\n        push(\"return \" + escapeName(ns.name) + \";\");\n        --indent;\n        push(\"})();\");\n    }\n}\n\nvar reduceableBlockStatements = {\n    IfStatement: true,\n    ForStatement: true,\n    WhileStatement: true\n};\n\nvar shortVars = {\n    \"r\": \"reader\",\n    \"w\": \"writer\",\n    \"m\": \"message\",\n    \"t\": \"tag\",\n    \"l\": \"length\",\n    \"c\": \"end\", \"c2\": \"end2\",\n    \"k\": \"key\",\n    \"ks\": \"keys\", \"ks2\": \"keys2\",\n    \"e\": \"error\",\n    \"f\": \"impl\",\n    \"o\": \"options\",\n    \"d\": \"object\",\n    \"n\": \"long\",\n    \"p\": \"properties\"\n};\n\nfunction beautifyCode(code) {\n    // Add semicolons\n    code = UglifyJS.minify(code, {\n        compress: false,\n        mangle: false,\n        output: { beautify: true }\n    }).code;\n    // Properly beautify\n    var ast = espree.parse(code);\n    estraverse.replace(ast, {\n        enter: function(node, parent) {\n            // rename short vars\n            if (node.type === \"Identifier\" && (parent.property !== node || parent.computed) && shortVars[node.name])\n                return {\n                    \"type\": \"Identifier\",\n                    \"name\": shortVars[node.name]\n                };\n            // replace var with let if es6\n            if (config.es6 && node.type === \"VariableDeclaration\" && node.kind === \"var\") {\n                node.kind = \"let\";\n                return undefined;\n            }\n            // remove braces around block statements with a single child\n            if (node.type === \"BlockStatement\" && reduceableBlockStatements[parent.type] && node.body.length === 1)\n                return node.body[0];\n            return undefined;\n        }\n    });\n    code = escodegen.generate(ast, {\n        format: {\n            newline: \"\\n\",\n            quotes: \"double\"\n        }\n    });\n    // Add id, wireType comments\n    if (config.comments)\n        code = code.replace(/\\.uint32\\((\\d+)\\)/g, function($0, $1) {\n            var id = $1 >>> 3,\n                wireType = $1 & 7;\n            return \".uint32(/* id \" + id + \", wireType \" + wireType + \" =*/\" + $1 + \")\";\n        });\n    return code;\n}\n\nvar renameVars = {\n    \"Writer\": \"$Writer\",\n    \"Reader\": \"$Reader\",\n    \"util\": \"$util\"\n};\n\nfunction buildFunction(type, functionName, gen, scope) {\n    var code = gen.toString(functionName)\n        .replace(/((?!\\.)types\\[\\d+])(\\.values)/g, \"$1\"); // enums: use types[N] instead of reflected types[N].values\n\n    var ast = espree.parse(code);\n    /* eslint-disable no-extra-parens */\n    estraverse.replace(ast, {\n        enter: function(node, parent) {\n            // rename vars\n            if (\n                node.type === \"Identifier\" && renameVars[node.name]\n                && (\n                    (parent.type === \"MemberExpression\" && parent.object === node)\n                 || (parent.type === \"BinaryExpression\" && parent.right === node)\n                )\n            )\n                return {\n                    \"type\": \"Identifier\",\n                    \"name\": renameVars[node.name]\n                };\n            // replace this.ctor with the actual ctor\n            if (\n                node.type === \"MemberExpression\"\n             && node.object.type === \"ThisExpression\"\n             && node.property.type === \"Identifier\" && node.property.name === \"ctor\"\n            )\n                return {\n                    \"type\": \"Identifier\",\n                    \"name\": \"$root\" + type.fullName\n                };\n            // replace types[N] with the field's actual type\n            if (\n                node.type === \"MemberExpression\"\n             && node.object.type === \"Identifier\" && node.object.name === \"types\"\n             && node.property.type === \"Literal\"\n            )\n                return {\n                    \"type\": \"Identifier\",\n                    \"name\": \"$root\" + type.fieldsArray[node.property.value].resolvedType.fullName\n                };\n            return undefined;\n        }\n    });\n    /* eslint-enable no-extra-parens */\n    code = escodegen.generate(ast, {\n        format: {\n            newline: \"\\n\",\n            quotes: \"double\"\n        }\n    });\n\n    if (config.beautify)\n        code = beautifyCode(code);\n\n    code = code.replace(/ {4}/g, \"\\t\");\n\n    var hasScope = scope && Object.keys(scope).length,\n        isCtor = functionName === type.name;\n\n    if (hasScope) // remove unused scope vars\n        Object.keys(scope).forEach(function(key) {\n            if (!new RegExp(\"\\\\b(\" + key + \")\\\\b\", \"g\").test(code))\n                delete scope[key];\n        });\n\n    var lines = code.split(/\\n/g);\n    if (isCtor) // constructor\n        push(lines[0]);\n    else if (hasScope) // enclose in an iife\n        push(escapeName(type.name) + \".\" + escapeName(functionName) + \" = (function(\" + Object.keys(scope).map(escapeName).join(\", \") + \") { return \" + lines[0]);\n    else\n        push(escapeName(type.name) + \".\" + escapeName(functionName) + \" = \" + lines[0]);\n    lines.slice(1, lines.length - 1).forEach(function(line) {\n        var prev = indent;\n        var i = 0;\n        while (line.charAt(i++) === \"\\t\")\n            ++indent;\n        push(line.trim());\n        indent = prev;\n    });\n    if (isCtor)\n        push(\"}\");\n    else if (hasScope)\n        push(\"};})(\" + Object.keys(scope).map(function(key) { return scope[key]; }).join(\", \") + \");\");\n    else\n        push(\"};\");\n}\n\nfunction toJsType(field, parentIsInterface = false) {\n    var type;\n\n    // With null semantics, interfaces are composed from interfaces and messages from messages\n    // Without null semantics, child types depend on the --force-message flag\n    var asInterface = config[\"null-semantics\"]\n        ? parentIsInterface && !(field.resolvedType instanceof protobuf.Enum)\n        : !(field.resolvedType instanceof protobuf.Enum || config.forceMessage);\n\n    switch (field.type) {\n        case \"double\":\n        case \"float\":\n        case \"int32\":\n        case \"uint32\":\n        case \"sint32\":\n        case \"fixed32\":\n        case \"sfixed32\":\n            type = \"number\";\n            break;\n        case \"int64\":\n        case \"uint64\":\n        case \"sint64\":\n        case \"fixed64\":\n        case \"sfixed64\":\n            type = config.forceLong ? \"Long\" : config.forceNumber ? \"number\" : \"number|Long\";\n            break;\n        case \"bool\":\n            type = \"boolean\";\n            break;\n        case \"string\":\n            type = \"string\";\n            break;\n        case \"bytes\":\n            type = \"Uint8Array\";\n            break;\n        default:\n            if (field.resolve().resolvedType) {\n                type = exportName(field.resolvedType, asInterface);\n            }\n            else {\n                type = \"*\"; // should not happen\n            }\n            break;\n    }\n    if (field.map)\n        return \"Object.<string,\" + type + \">\";\n    if (field.repeated)\n        return \"Array.<\" + type + \">\";\n    return type;\n}\n\nfunction isNullable(field) {\n    return field.hasPresence && !field.required;\n}\n\nfunction buildType(ref, type) {\n\n    if (config.comments) {\n        var typeDef = [\n            \"Properties of \" + aOrAn(type.name) + \".\",\n            type.parent instanceof protobuf.Root ? \"@exports \" + escapeName(\"I\" + type.name) : \"@memberof \" + exportName(type.parent),\n            \"@interface \" + escapeName(\"I\" + type.name)\n        ];\n        type.fieldsArray.forEach(function(field) {\n            var prop = util.safeProp(field.name); // either .name or [\"name\"]\n            prop = prop.substring(1, prop.charAt(0) === \"[\" ? prop.length - 1 : prop.length);\n            var jsType = toJsType(field, /* parentIsInterface = */ true);\n            var nullable = false;\n            if (config[\"null-semantics\"]) {\n                // With semantic nulls, only explicit optional fields and one-of members can be set to null\n                // Implicit fields (proto3), maps and lists can be omitted, but if specified must be non-null\n                // Implicit fields will take their default value when the message is constructed\n                if (field.optional) {\n                    if (isNullable(field)) {\n                        jsType = jsType + \"|null|undefined\";\n                        nullable = true;\n                    }\n                    else {\n                        jsType = jsType + \"|undefined\";\n                        nullable = true;\n                    }\n                }\n            }\n            else {\n                // Without semantic nulls, everything is optional in proto3\n                // Do not allow |undefined to keep backwards compatibility\n                if (field.optional) {\n                    jsType = jsType + \"|null\";\n                    nullable = true;\n                }\n            }\n            typeDef.push(\"@property {\" + jsType + \"} \" + (nullable ? \"[\" + prop + \"]\" : prop) + \" \" + (field.comment || type.name + \" \" + field.name));\n        });\n        push(\"\");\n        pushComment(typeDef);\n    }\n\n    // constructor\n    push(\"\");\n    pushComment([\n        \"Constructs a new \" + type.name + \".\",\n        type.parent instanceof protobuf.Root ? \"@exports \" + escapeName(type.name) : \"@memberof \" + exportName(type.parent),\n        \"@classdesc \" + (type.comment || \"Represents \" + aOrAn(type.name) + \".\"),\n        config.comments ? \"@implements \" + escapeName(\"I\" + type.name) : null,\n        \"@constructor\",\n        \"@param {\" + exportName(type, true) + \"=} [\" + (config.beautify ? \"properties\" : \"p\") + \"] Properties to set\"\n    ]);\n    buildFunction(type, type.name, Type.generateConstructor(type));\n\n    // default values\n    var firstField = true;\n    type.fieldsArray.forEach(function(field) {\n        field.resolve();\n        var prop = util.safeProp(field.name);\n        if (config.comments) {\n            push(\"\");\n            var jsType = toJsType(field, /* parentIsInterface = */ false);\n            if (config[\"null-semantics\"]) {\n                // With semantic nulls, fields are nullable if they are explicitly optional or part of a one-of\n                // Maps, repeated values and fields with implicit defaults are never null after construction\n                // Members are never undefined, at a minimum they are initialized to null\n                if (isNullable(field)) {\n                    jsType = jsType + \"|null\";\n                }\n            }\n            else {\n                // Without semantic nulls, everything is optional in proto3\n                // Keep |undefined for backwards compatibility\n                if (field.optional && !field.map && !field.repeated && (field.resolvedType instanceof Type || config[\"null-defaults\"]) || field.partOf) {\n                    jsType = jsType + \"|null|undefined\";\n                }\n            }\n            pushComment([\n                field.comment || type.name + \" \" + field.name + \".\",\n                \"@member {\" + jsType + \"} \" + field.name,\n                \"@memberof \" + exportName(type),\n                \"@instance\"\n            ]);\n        } else if (firstField) {\n            push(\"\");\n            firstField = false;\n        }\n        // With semantic nulls, only explict optional fields and one-of members are null by default\n        // Otherwise use field.optional, which doesn't consider proto3, maps, repeated fields etc.\n        var nullDefault = config[\"null-semantics\"]\n            ? isNullable(field)\n            : field.optional && config[\"null-defaults\"];\n        if (field.repeated)\n            push(escapeName(type.name) + \".prototype\" + prop + \" = $util.emptyArray;\"); // overwritten in constructor\n        else if (field.map)\n            push(escapeName(type.name) + \".prototype\" + prop + \" = $util.emptyObject;\"); // overwritten in constructor\n        else if (field.partOf || nullDefault)\n            push(escapeName(type.name) + \".prototype\" + prop + \" = null;\"); // do not set default value for oneof members\n        else if (field.long)\n            push(escapeName(type.name) + \".prototype\" + prop + \" = $util.Long ? $util.Long.fromBits(\"\n                    + JSON.stringify(field.typeDefault.low) + \",\"\n                    + JSON.stringify(field.typeDefault.high) + \",\"\n                    + JSON.stringify(field.typeDefault.unsigned)\n                + \") : \" + field.typeDefault.toNumber(field.type.charAt(0) === \"u\") + \";\");\n        else if (field.bytes) {\n            push(escapeName(type.name) + \".prototype\" + prop + \" = $util.newBuffer(\" + JSON.stringify(Array.prototype.slice.call(field.typeDefault)) + \");\");\n        } else\n            push(escapeName(type.name) + \".prototype\" + prop + \" = \" + JSON.stringify(field.typeDefault) + \";\");\n    });\n\n    // virtual oneof fields\n    var firstOneOf = true;\n    type.oneofsArray.forEach(function(oneof) {\n        if (firstOneOf) {\n            firstOneOf = false;\n            push(\"\");\n            if (config.comments)\n                push(\"// OneOf field names bound to virtual getters and setters\");\n            push((config.es6 ? \"let\" : \"var\") + \" $oneOfFields;\");\n        }\n        oneof.resolve();\n        push(\"\");\n        if (oneof.isProto3Optional) {\n            push(\"// Virtual OneOf for proto3 optional field\");\n        }\n        else {\n            pushComment([\n                oneof.comment || type.name + \" \" + oneof.name + \".\",\n                \"@member {\" + oneof.oneof.map(JSON.stringify).join(\"|\") + \"|undefined} \" + escapeName(oneof.name),\n                \"@memberof \" + exportName(type),\n                \"@instance\"\n            ]);\n        }\n        push(\"Object.defineProperty(\" + escapeName(type.name) + \".prototype, \" + JSON.stringify(oneof.name) +\", {\");\n        ++indent;\n            push(\"get: $util.oneOfGetter($oneOfFields = [\" + oneof.oneof.map(JSON.stringify).join(\", \") + \"]),\");\n            push(\"set: $util.oneOfSetter($oneOfFields)\");\n        --indent;\n        push(\"});\");\n    });\n\n    if (config.create) {\n        push(\"\");\n        pushComment([\n            \"Creates a new \" + type.name + \" instance using the specified properties.\",\n            \"@function create\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {\" + exportName(type, true) + \"=} [properties] Properties to set\",\n            \"@returns {\" + exportName(type) + \"} \" + type.name + \" instance\"\n        ]);\n        push(escapeName(type.name) + \".create = function create(properties) {\");\n            ++indent;\n            push(\"return new \" + escapeName(type.name) + \"(properties);\");\n            --indent;\n        push(\"};\");\n    }\n\n    if (config.encode) {\n        push(\"\");\n        pushComment([\n            \"Encodes the specified \" + type.name + \" message. Does not implicitly {@link \" + exportName(type) + \".verify|verify} messages.\",\n            \"@function encode\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {\" + exportName(type, !config.forceMessage) + \"} \" + (config.beautify ? \"message\" : \"m\") + \" \" + type.name + \" message or plain object to encode\",\n            \"@param {$protobuf.Writer} [\" + (config.beautify ? \"writer\" : \"w\") + \"] Writer to encode to\",\n            \"@returns {$protobuf.Writer} Writer\"\n        ]);\n        buildFunction(type, \"encode\", protobuf.encoder(type));\n\n        if (config.delimited) {\n            push(\"\");\n            pushComment([\n                \"Encodes the specified \" + type.name + \" message, length delimited. Does not implicitly {@link \" + exportName(type) + \".verify|verify} messages.\",\n                \"@function encodeDelimited\",\n                \"@memberof \" + exportName(type),\n                \"@static\",\n                \"@param {\" + exportName(type, !config.forceMessage) + \"} message \" + type.name + \" message or plain object to encode\",\n                \"@param {$protobuf.Writer} [writer] Writer to encode to\",\n                \"@returns {$protobuf.Writer} Writer\"\n            ]);\n            push(escapeName(type.name) + \".encodeDelimited = function encodeDelimited(message, writer) {\");\n            ++indent;\n            push(\"return this.encode(message, writer).ldelim();\");\n            --indent;\n            push(\"};\");\n        }\n    }\n\n    if (config.decode) {\n        push(\"\");\n        pushComment([\n            \"Decodes \" + aOrAn(type.name) + \" message from the specified reader or buffer.\",\n            \"@function decode\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {$protobuf.Reader|Uint8Array} \" + (config.beautify ? \"reader\" : \"r\") + \" Reader or buffer to decode from\",\n            \"@param {number} [\" + (config.beautify ? \"length\" : \"l\") + \"] Message length if known beforehand\",\n            \"@returns {\" + exportName(type) + \"} \" + type.name,\n            \"@throws {Error} If the payload is not a reader or valid buffer\",\n            \"@throws {$protobuf.util.ProtocolError} If required fields are missing\"\n        ]);\n        buildFunction(type, \"decode\", protobuf.decoder(type));\n\n        if (config.delimited) {\n            push(\"\");\n            pushComment([\n                \"Decodes \" + aOrAn(type.name) + \" message from the specified reader or buffer, length delimited.\",\n                \"@function decodeDelimited\",\n                \"@memberof \" + exportName(type),\n                \"@static\",\n                \"@param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\",\n                \"@returns {\" + exportName(type) + \"} \" + type.name,\n                \"@throws {Error} If the payload is not a reader or valid buffer\",\n                \"@throws {$protobuf.util.ProtocolError} If required fields are missing\"\n            ]);\n            push(escapeName(type.name) + \".decodeDelimited = function decodeDelimited(reader) {\");\n            ++indent;\n                push(\"if (!(reader instanceof $Reader))\");\n                ++indent;\n                    push(\"reader = new $Reader(reader);\");\n                --indent;\n                push(\"return this.decode(reader, reader.uint32());\");\n            --indent;\n            push(\"};\");\n        }\n    }\n\n    if (config.verify) {\n        push(\"\");\n        pushComment([\n            \"Verifies \" + aOrAn(type.name) + \" message.\",\n            \"@function verify\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {Object.<string,*>} \" + (config.beautify ? \"message\" : \"m\") + \" Plain object to verify\",\n            \"@returns {string|null} `null` if valid, otherwise the reason why it is not\"\n        ]);\n        buildFunction(type, \"verify\", protobuf.verifier(type));\n    }\n\n    if (config.convert) {\n        push(\"\");\n        pushComment([\n            \"Creates \" + aOrAn(type.name) + \" message from a plain object. Also converts values to their respective internal types.\",\n            \"@function fromObject\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {Object.<string,*>} \" + (config.beautify ? \"object\" : \"d\") + \" Plain object\",\n            \"@returns {\" + exportName(type) + \"} \" + type.name\n        ]);\n        buildFunction(type, \"fromObject\", protobuf.converter.fromObject(type));\n\n        push(\"\");\n        pushComment([\n            \"Creates a plain object from \" + aOrAn(type.name) + \" message. Also converts values to other types if specified.\",\n            \"@function toObject\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {\" + exportName(type) + \"} \" + (config.beautify ? \"message\" : \"m\") + \" \" + type.name,\n            \"@param {$protobuf.IConversionOptions} [\" + (config.beautify ? \"options\" : \"o\") + \"] Conversion options\",\n            \"@returns {Object.<string,*>} Plain object\"\n        ]);\n        buildFunction(type, \"toObject\", protobuf.converter.toObject(type));\n\n        push(\"\");\n        pushComment([\n            \"Converts this \" + type.name + \" to JSON.\",\n            \"@function toJSON\",\n            \"@memberof \" + exportName(type),\n            \"@instance\",\n            \"@returns {Object.<string,*>} JSON object\"\n        ]);\n        push(escapeName(type.name) + \".prototype.toJSON = function toJSON() {\");\n        ++indent;\n            push(\"return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\");\n        --indent;\n        push(\"};\");\n    }\n\n    if (config.typeurl) {\n        push(\"\");\n        pushComment([\n            \"Gets the default type url for \" + type.name,\n            \"@function getTypeUrl\",\n            \"@memberof \" + exportName(type),\n            \"@static\",\n            \"@param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \\\"type.googleapis.com\\\")\",\n            \"@returns {string} The default type url\"\n        ]);\n        push(escapeName(type.name) + \".getTypeUrl = function getTypeUrl(typeUrlPrefix) {\");\n        ++indent;\n            push(\"if (typeUrlPrefix === undefined) {\");\n            ++indent;\n                push(\"typeUrlPrefix = \\\"type.googleapis.com\\\";\");\n            --indent;\n            push(\"}\");\n            push(\"return typeUrlPrefix + \\\"/\" + exportName(type) + \"\\\";\");\n        --indent;\n        push(\"};\");\n    }\n}\n\nfunction buildService(ref, service) {\n\n    push(\"\");\n    pushComment([\n        \"Constructs a new \" + service.name + \" service.\",\n        service.parent instanceof protobuf.Root ? \"@exports \" + escapeName(service.name) : \"@memberof \" + exportName(service.parent),\n        \"@classdesc \" + (service.comment || \"Represents \" + aOrAn(service.name)),\n        \"@extends $protobuf.rpc.Service\",\n        \"@constructor\",\n        \"@param {$protobuf.RPCImpl} rpcImpl RPC implementation\",\n        \"@param {boolean} [requestDelimited=false] Whether requests are length-delimited\",\n        \"@param {boolean} [responseDelimited=false] Whether responses are length-delimited\"\n    ]);\n    push(\"function \" + escapeName(service.name) + \"(rpcImpl, requestDelimited, responseDelimited) {\");\n    ++indent;\n    push(\"$protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\");\n    --indent;\n    push(\"}\");\n    push(\"\");\n    push(\"(\" + escapeName(service.name) + \".prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = \" + escapeName(service.name) + \";\");\n\n    if (config.create) {\n        push(\"\");\n        pushComment([\n            \"Creates new \" + service.name + \" service using the specified rpc implementation.\",\n            \"@function create\",\n            \"@memberof \" + exportName(service),\n            \"@static\",\n            \"@param {$protobuf.RPCImpl} rpcImpl RPC implementation\",\n            \"@param {boolean} [requestDelimited=false] Whether requests are length-delimited\",\n            \"@param {boolean} [responseDelimited=false] Whether responses are length-delimited\",\n            \"@returns {\" + escapeName(service.name) + \"} RPC service. Useful where requests and/or responses are streamed.\"\n        ]);\n        push(escapeName(service.name) + \".create = function create(rpcImpl, requestDelimited, responseDelimited) {\");\n            ++indent;\n            push(\"return new this(rpcImpl, requestDelimited, responseDelimited);\");\n            --indent;\n        push(\"};\");\n    }\n\n    service.methodsArray.forEach(function(method) {\n        method.resolve();\n        var lcName = protobuf.util.lcFirst(method.name),\n            cbName = escapeName(method.name + \"Callback\");\n        push(\"\");\n        pushComment([\n            \"Callback as used by {@link \" + exportName(service) + \"#\" + escapeName(lcName) + \"}.\",\n            // This is a more specialized version of protobuf.rpc.ServiceCallback\n            \"@memberof \" + exportName(service),\n            \"@typedef \" + cbName,\n            \"@type {function}\",\n            \"@param {Error|null} error Error, if any\",\n            \"@param {\" + exportName(method.resolvedResponseType) + \"} [response] \" + method.resolvedResponseType.name\n        ]);\n        push(\"\");\n        pushComment([\n            method.comment || \"Calls \" + method.name + \".\",\n            \"@function \" + lcName,\n            \"@memberof \" + exportName(service),\n            \"@instance\",\n            \"@param {\" + exportName(method.resolvedRequestType, !config.forceMessage) + \"} request \" + method.resolvedRequestType.name + \" message or plain object\",\n            \"@param {\" + exportName(service) + \".\" + cbName + \"} callback Node-style callback called with the error, if any, and \" + method.resolvedResponseType.name,\n            \"@returns {undefined}\",\n            \"@variation 1\"\n        ]);\n        push(\"Object.defineProperty(\" + escapeName(service.name) + \".prototype\" + util.safeProp(lcName) + \" = function \" + escapeName(lcName) + \"(request, callback) {\");\n            ++indent;\n            push(\"return this.rpcCall(\" + escapeName(lcName) + \", $root.\" + exportName(method.resolvedRequestType) + \", $root.\" + exportName(method.resolvedResponseType) + \", request, callback);\");\n            --indent;\n        push(\"}, \\\"name\\\", { value: \" + JSON.stringify(method.name) + \" });\");\n        if (config.comments)\n            push(\"\");\n        pushComment([\n            method.comment || \"Calls \" + method.name + \".\",\n            \"@function \" + lcName,\n            \"@memberof \" + exportName(service),\n            \"@instance\",\n            \"@param {\" + exportName(method.resolvedRequestType, !config.forceMessage) + \"} request \" + method.resolvedRequestType.name + \" message or plain object\",\n            \"@returns {Promise<\" + exportName(method.resolvedResponseType) + \">} Promise\",\n            \"@variation 2\"\n        ]);\n    });\n}\n\nfunction buildEnum(ref, enm) {\n\n    push(\"\");\n    var comment = [\n        enm.comment || enm.name + \" enum.\",\n        enm.parent instanceof protobuf.Root ? \"@exports \" + escapeName(enm.name) : \"@name \" + exportName(enm),\n        config.forceEnumString ? \"@enum {string}\" : \"@enum {number}\",\n    ];\n    Object.keys(enm.values).forEach(function(key) {\n        var val = config.forceEnumString ? key : enm.values[key];\n        comment.push((config.forceEnumString ? \"@property {string} \" : \"@property {number} \") + key + \"=\" + val + \" \" + (enm.comments[key] || key + \" value\"));\n    });\n    pushComment(comment);\n    if (!ref && config.es6)\n        push(\"export const \" + escapeName(enm.name) + \" = \" + escapeName(ref) + \".\" + escapeName(enm.name) + \" = (() => {\");\n    else\n        push(escapeName(ref) + \".\" + escapeName(enm.name) + \" = (function() {\");\n    ++indent;\n        push((config.es6 ? \"const\" : \"var\") + \" valuesById = {}, values = Object.create(valuesById);\");\n        var aliased = [];\n        Object.keys(enm.values).forEach(function(key) {\n            var valueId = enm.values[key];\n            var val = config.forceEnumString ? JSON.stringify(key) : valueId;\n            if (aliased.indexOf(valueId) > -1)\n                push(\"values[\" + JSON.stringify(key) + \"] = \" + val + \";\");\n            else {\n                push(\"values[valuesById[\" + valueId + \"] = \" + JSON.stringify(key) + \"] = \" + val + \";\");\n                aliased.push(valueId);\n            }\n        });\n        push(\"return values;\");\n    --indent;\n    push(\"})();\");\n}\n"
  },
  {
    "path": "cli/util.js",
    "content": "\"use strict\";\nvar fs       = require(\"fs\"),\n    path     = require(\"path\"),\n    protobuf = require(\"protobufjs\");\n\nfunction basenameCompare(a, b) {\n    var aa = String(a).replace(/\\.\\w+$/, \"\").split(/(-?\\d*\\.?\\d+)/g),\n        bb = String(b).replace(/\\.\\w+$/, \"\").split(/(-?\\d*\\.?\\d+)/g);\n    for (var i = 0, k = Math.min(aa.length, bb.length); i < k; i++) {\n        var x = parseFloat(aa[i]) || aa[i].toLowerCase(),\n            y = parseFloat(bb[i]) || bb[i].toLowerCase();\n        if (x < y)\n            return -1;\n        if (x > y)\n            return 1;\n    }\n    return a.length < b.length ? -1 : 0;\n}\n\nexports.requireAll = function requireAll(dirname) {\n    dirname   = path.join(__dirname, dirname);\n    var files = fs.readdirSync(dirname).sort(basenameCompare),\n        all = {};\n    files.forEach(function(file) {\n        var basename = path.basename(file, \".js\"),\n            extname  = path.extname(file);\n        if (extname === \".js\")\n            all[basename] = require(path.join(dirname, file));\n    });\n    return all;\n};\n\nexports.traverse = function traverse(current, fn) {\n    fn(current);\n    if (current.fieldsArray)\n        current.fieldsArray.forEach(function(field) {\n            traverse(field, fn);\n        });\n    if (current.oneofsArray)\n        current.oneofsArray.forEach(function(oneof) {\n            traverse(oneof, fn);\n        });\n    if (current.methodsArray)\n        current.methodsArray.forEach(function(method) {\n            traverse(method, fn);\n        });\n    if (current.nestedArray)\n        current.nestedArray.forEach(function(nested) {\n            traverse(nested, fn);\n        });\n};\n\nexports.traverseResolved = function traverseResolved(current, fn) {\n    fn(current);\n    if (current.resolvedType)\n        traverseResolved(current.resolvedType, fn);\n    if (current.resolvedKeyType)\n        traverseResolved(current.resolvedKeyType, fn);\n    if (current.resolvedRequestType)\n        traverseResolved(current.resolvedRequestType, fn);\n    if (current.resolvedResponseType)\n        traverseResolved(current.resolvedResponseType, fn);\n};\n\nexports.inspect = function inspect(object, indent) {\n    if (!object)\n        return \"\";\n    var chalk = require(\"chalk\");\n    var sb = [];\n    if (!indent)\n        indent = \"\";\n    var ind = indent ? indent.substring(0, indent.length - 2) + \"└ \" : \"\";\n    sb.push(\n        ind + chalk.bold(object.toString()) + (object.visible ? \" (visible)\" : \"\"),\n        indent + chalk.gray(\"parent: \") + object.parent\n    );\n    if (object instanceof protobuf.Field) {\n        if (object.extend !== undefined)\n            sb.push(indent + chalk.gray(\"extend: \") + object.extend);\n        if (object.partOf)\n            sb.push(indent + chalk.gray(\"oneof : \") + object.oneof);\n    }\n    sb.push(\"\");\n    if (object.fieldsArray)\n        object.fieldsArray.forEach(function(field) {\n            sb.push(inspect(field, indent + \"  \"));\n        });\n    if (object.oneofsArray)\n        object.oneofsArray.forEach(function(oneof) {\n            sb.push(inspect(oneof, indent + \"  \"));\n        });\n    if (object.methodsArray)\n        object.methodsArray.forEach(function(service) {\n            sb.push(inspect(service, indent + \"  \"));\n        });\n    if (object.nestedArray)\n        object.nestedArray.forEach(function(nested) {\n            sb.push(inspect(nested, indent + \"  \"));\n        });\n    return sb.join(\"\\n\");\n};\n\nexports.wrap = function(OUTPUT, options) {\n    var name = options.wrap || \"default\";\n    var wrap;\n    try {\n        // try built-in wrappers first\n        wrap = fs.readFileSync(path.join(__dirname, \"wrappers\", name + \".js\")).toString(\"utf8\");\n    } catch (e) {\n        // otherwise fetch the custom one\n        wrap = fs.readFileSync(path.resolve(process.cwd(), name)).toString(\"utf8\");\n    }\n    wrap = wrap.replace(/\\$DEPENDENCY/g, JSON.stringify(options.dependency || \"protobufjs\"));\n    wrap = wrap.replace(/( *)\\$OUTPUT;/, function($0, $1) {\n        return $1.length ? OUTPUT.replace(/^/mg, $1) : OUTPUT;\n    });\n    if (options.lint !== \"\")\n        wrap = \"/*\" + options.lint + \"*/\\n\" + wrap;\n    return wrap.replace(/\\r?\\n/g, \"\\n\");\n};\n\nexports.pad = function(str, len, l) {\n    while (str.length < len)\n        str = l ? str + \" \" : \" \" + str;\n    return str;\n};\n\n\n/**\n * DFS to get all message dependencies, cache in filterMap.\n * @param {Root} root  The protobuf root instance\n * @param {Message} message  The message need to process.\n * @param {Map} filterMap  The result of message you need and their dependencies.\n * @param {Map} flatMap  A flag to record whether the message was searched.\n * @returns {undefined}  Does not return a value\n */\nfunction dfsFilterMessageDependencies(root, message, filterMap, flatMap) {\n    if (message instanceof protobuf.Type) {\n        if (flatMap.get(`${message.fullName}`)) return;\n        flatMap.set(`${message.fullName}`, true);\n        for (var field of message.fieldsArray) {\n            if (field.resolvedType) {\n                // a nested message\n                if (field.resolvedType.parent.name === message.name) {\n                    var nestedMessage = message.nested[field.resolvedType.name];\n                    dfsFilterMessageDependencies(root, nestedMessage, filterMap, flatMap);\n                    continue;\n                }\n                var packageName = field.resolvedType.parent.name;\n                var typeName = field.resolvedType.name;\n                var fullName = packageName ? `${packageName}.${typeName}` : typeName;\n                doFilterMessage(root, { messageNames: [fullName] }, filterMap, flatMap, packageName);\n            }\n        }\n    }\n}\n\n/**\n * DFS to get all message you need and their dependencies, cache in filterMap.\n * @param {Root} root  The protobuf root instance\n * @param {object} needMessageConfig  Need message config:\n * @param {string[]} needMessageConfig.messageNames  The message names array in the root namespace you need to gen. example: [msg1, msg2]\n * @param {Map} filterMap The result of message you need and their dependencies.\n * @param {Map} flatMap A flag to record whether the message was searched.\n * @param {string} currentPackageName  Current package name\n * @returns {undefined}  Does not return a value\n */\nfunction doFilterMessage(root, needMessageConfig, filterMap, flatMap, currentPackageName) {\n    var needMessageNames = needMessageConfig.messageNames;\n\n    for (var messageFullName of needMessageNames) {\n        var nameSplit = messageFullName.split(\".\");\n        var packageName = \"\";\n        var messageName = \"\";\n        if (nameSplit.length > 1) {\n            packageName = nameSplit[0];\n            messageName = nameSplit[1];\n        } else {\n            messageName = nameSplit[0];\n        }\n\n        // in Namespace\n        if (packageName) {\n            var ns = root.nested[packageName];\n            if (!ns || !(ns instanceof protobuf.Namespace)) {\n                throw new Error(`package not foud ${currentPackageName}.${messageName}`);\n            }\n\n            doFilterMessage(root, { messageNames: [messageName] }, filterMap, flatMap, packageName);\n        } else {\n            var message = root.nested[messageName];\n\n            if (currentPackageName) {\n                message = root.nested[currentPackageName].nested[messageName];\n            }\n\n            if (!message) {\n                throw new Error(`message not foud ${currentPackageName}.${messageName}`);\n            }\n\n            var set = filterMap.get(currentPackageName);\n            if (!filterMap.has(currentPackageName)) {\n                set = new Set();\n                filterMap.set(currentPackageName, set);\n            }\n\n            set.add(messageName);\n\n            // dfs to find all dependencies\n            dfsFilterMessageDependencies(root, message, filterMap, flatMap, currentPackageName);\n        }\n    }\n}\n\n/**\n * filter the message you need and their dependencies, all others will be delete from root.\n * @param {Root} root  Root the protobuf root instance\n * @param {object} needMessageConfig  Need message config:\n * @param {string[]} needMessageConfig.messageNames  Tthe message names array in the root namespace you need to gen. example: [msg1, msg2]\n * @returns {boolean} True if a message should present in the generated files\n */\nexports.filterMessage = function (root, needMessageConfig) {\n    var filterMap = new Map();\n    var flatMap = new Map();\n    doFilterMessage(root, needMessageConfig, filterMap, flatMap, \"\");\n    root._nestedArray = root._nestedArray.filter(ns => {\n        if (ns instanceof protobuf.Type || ns instanceof protobuf.Enum) {\n            return filterMap.get(\"\").has(ns.name);\n        } else if (ns instanceof protobuf.Namespace) {\n            if (!filterMap.has(ns.name)) {\n                return false;\n            }\n            ns._nestedArray = ns._nestedArray.filter(nns => {\n                const nnsSet = filterMap.get(ns.name);\n                return nnsSet.has(nns.name);\n            });\n\n            return true;\n        }\n        return true;\n    });\n};\n\n"
  },
  {
    "path": "cli/wrappers/amd.js",
    "content": "define([$DEPENDENCY], function($protobuf) {\n    \"use strict\";\n\n    $OUTPUT;\n\n    return $root;\n});\n"
  },
  {
    "path": "cli/wrappers/closure.js",
    "content": "(function($protobuf) {\n    \"use strict\";\n\n    $OUTPUT;\n\n    return $root;\n})(protobuf);\n"
  },
  {
    "path": "cli/wrappers/commonjs.js",
    "content": "\"use strict\";\n\nvar $protobuf = require($DEPENDENCY);\n\n$OUTPUT;\n\nmodule.exports = $root;\n"
  },
  {
    "path": "cli/wrappers/default.js",
    "content": "(function(global, factory) { /* global define, require, module */\n\n    /* AMD */ if (typeof define === 'function' && define.amd)\n        define([$DEPENDENCY], factory);\n\n    /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports)\n        module.exports = factory(require($DEPENDENCY));\n\n})(this, function($protobuf) {\n    \"use strict\";\n\n    $OUTPUT;\n\n    return $root;\n});\n"
  },
  {
    "path": "cli/wrappers/es6.js",
    "content": "import * as $protobuf from $DEPENDENCY;\n\n$OUTPUT;\n\nexport { $root as default };\n"
  },
  {
    "path": "config/eslint.json",
    "content": "{\n    \"env\": {\n        \"node\": true,\n        \"browser\": true\n    },\n    \"globals\": {\n        \"ArrayBuffer\": true,\n        \"Uint8Array\": true,\n        \"Float32Array\": true,\n        \"Float64Array\": true,\n        \"define\": true,\n        \"global\": true,\n        \"XMLHttpRequest\": true,\n        \"Promise\": true\n    },\n    \"parserOptions\": {\n        \"ecmaVersion\": 6\n    },\n    \"extends\": \"eslint:recommended\",\n    \"rules\": {\n\n        // Possible errors\n        \"no-extra-parens\": 1,               // turned on as the daily lecture\n        \"no-prototype-builtins\": 1,\n        \"no-template-curly-in-string\": 1,\n        \"no-unsafe-negation\": 1,\n        \"valid-jsdoc\": 1,\n\n        // Best practices\n        \"accessor-pairs\": 1,\n        \"array-callback-return\": 1,\n        \"block-scoped-var\": 1,\n        \"class-methods-use-this\": 1,\n        \"complexity\": 0,                    // is sometimes necessary\n        \"consistent-return\": 1,\n        \"curly\": 0,                         // sometimes more braces than code\n        \"default-case\": 0,                  // just forces unnecessary code\n        \"dot-location\": 0,                  // looks nicer for chainables\n        \"dot-notation\": 0,                  // not compatible with some reserved properties\n        \"eqeqeq\": [1, \"allow-null\"],\n        \"guard-for-in\": 1,\n        \"no-alert\": 1,\n        \"no-caller\": 1,\n        \"no-cond-assign\": 0,\n        \"no-div-regex\": 1,\n        \"no-else-return\": 1,\n        \"no-empty-function\": 1,\n        \"no-eval\": 1,\n        \"no-extend-native\": 1,\n        \"no-extra-bind\": 1,\n        \"no-extra-label\": 1,\n        \"no-floating-decimal\": 1,\n        \"no-global-assign\": 1,\n        \"no-implicit-coercion\": 1,\n        \"no-implicit-globals\": 1,\n        \"no-implied-eval\": 1,\n        \"no-invalid-this\": 1,\n        \"no-iterator\": 1,\n        \"no-labels\": 1,\n        \"no-lone-blocks\": 1,\n        \"no-loop-func\": 1,\n        \"no-magic-numbers\": 0,              // it's actually fun to turn this on here\n        \"no-new-func\": 1,\n        \"no-new-wrappers\": 1,\n        \"no-new\": 1,\n        \"no-octal-escape\": 1,\n        \"no-param-reassign\": 0,             // is necessary for varargs functions\n        \"no-proto\": 1,\n        \"no-restricted-properties\": 1,\n        \"no-sequences\": 1,\n        \"no-script-url\": 1,\n        \"no-self-compare\": 1,\n        \"no-throw-literal\": 1,\n        \"no-unmodified-loop-condition\": 1,\n        \"no-unused-expressions\": [\"error\", { \"allowShortCircuit\": true }],\n        \"no-useless-call\": 1,\n        \"no-useless-concat\": 1,\n        \"no-useless-escape\": 1,\n        \"no-useless-return\": 1,\n        \"no-void\": 1,\n        \"no-warning-comments\": 1,\n        \"no-with\": 1,\n        \"radix\": 1,\n        \"vars-on-top\": 0,                   // makes code harder to read, not faster\n        \"wrap-iife\": 0,                     // used frequently where polyfilling\n        \"yoda\": 1,\n\n        // Strict mode\n        \"strict\": 1,\n\n        // Variables\n        \"init-declarations\": 0,             // because no-undef-init is on and we actually want undefineds\n        \"no-catch-shadow\": 0,               // no IE8 support anyway\n        \"no-label-var\": 1,\n        \"no-restricted-globals\": 1,\n        \"no-return-assign\": 0,              // can make sense.\n        \"no-shadow-restricted-names\": 1,\n        \"no-shadow\": 0,                     // this is javascript. it has forEach and all that stuff.\n        \"no-undef-init\": 1,\n        \"no-undef\": 2,\n        \"no-undefined\": 0,                  // produces shorter code when testing against this\n        \"no-use-before-define\": 0,          // can actually be used for a better overview, i.e. with module.exports\n        \"no-unused-vars\": 1,                // a warning is sufficient\n\n        // Node.js and CommonJS\n        \"callback-return\": 1,\n        \"global-require\": 0,                // only way to resolve cyclic references\n        \"handle-callback-err\": 1,\n        \"no-mixed-requires\": 1,\n        \"no-new-require\": 1,\n        \"no-path-concat\": 1,\n        \"no-process-env\": 1,\n        \"no-process-exit\": 1,\n        \"no-restricted-modules\": 1,\n        \"no-sync\": 0,                       // for loadSync\n\n        // Stylistic Issues\n        \"semi\": 1,                          // maybe next time\n        \"no-extra-semi\": 1,\n        \"quotes\": 1,                        // useful for gzip\n        \"no-trailing-spaces\": 1,\n        \"no-unneeded-ternary\": 1,\n        \"unicode-bom\": [2, \"never\"]\n\n        // ECMAScript 6                     // maybe next time\n    }\n}\n"
  },
  {
    "path": "config/jsdoc.json",
    "content": "{\n    \"tags\": {\n        \"allowUnknownTags\": true\n    },\n    \"source\": {\n        \"include\": [\n            \"./src/\",\n            \"./lib/aspromise/index.js\",\n            \"./lib/base64/index.js\",\n            \"./lib/codegen/index.js\",\n            \"./lib/eventemitter/index.js\",\n            \"./lib/fetch/index.js\",\n            \"./lib/inquire/index.js\",\n            \"./lib/path/index.js\",\n            \"./lib/pool/index.js\",\n            \"./lib/utf8/index.js\"\n        ],\n        \"exclude\": [],\n        \"includePattern\": \".+\\\\.js(doc)?$\",\n        \"excludePattern\": \"(^|\\\\/|\\\\\\\\)_\"\n    },\n    \"plugins\": [\n        \"./node_modules/jsdoc/plugins/markdown\"\n    ],\n    \"templates\": {\n        \"cleverLinks\"   : false,\n        \"monospaceLinks\": false,\n        \"default\"       : {\n            \"outputSourceFiles\" : false\n        },\n        \"applicationName\": \"protobuf.js\",\n        \"googleAnalytics\": \"UA-40277577-3\",\n        \"linenums\"      : true\n    },\n    \"markdown\"  : {\n        \"parser\"        : \"gfm\",\n        \"hardwrap\"      : true,\n        \"idInHeadings\"  : true\n    },\n    \"opts\": {\n        \"encoding\"      : \"utf8\",\n        \"recurse\"       : true,\n        \"private\"       : false,\n        \"lenient\"       : false,\n        \"destination\"   : \"./docs\",\n        \"template\"      : \"./node_modules/jaguarjs-jsdoc\",\n        \"sourceRoot\"    : \"https://github.com/dcodeIO/protobuf.js/blob/master/src/\",\n        \"repo\"          : \"https://github.com/dcodeIO/protobuf.js\"\n    }\n}"
  },
  {
    "path": "config/tslint.json",
    "content": "{\n    \"extends\": \"tslint:recommended\",\n    \"rules\": {\n        \"array-type\": [ true, \"array\" ],\n        \"no-namespace\": false,\n        \"interface-name\": [ false ],\n        \"interface-over-type-literal\": true,\n        \"no-empty-interface\": false,\n        \"max-line-length\": [ false ],\n        \"trailing-comma\": [ true, \"never\" ],\n        \"variable-name\": [ false ],\n        \"max-classes-per-file\": [ false ],\n        \"member-ordering\": [ false ],\n        \"object-literal-sort-keys\": false,\n        \"no-string-literal\": false,\n        \"prefer-const\": false,\n        \"adjacent-overload-signatures\": false,\n        \"no-shadowed-variable\": false,\n        \"ban-types\": [\n            true,\n            [\"Object\", \"Avoid using the `Object` type. Did you mean `object`?\"],\n            // [\"Function\", \"Avoid using the `Function` type. Prefer a specific function type, like `() => void`.\"],\n            [\"Boolean\", \"Avoid using the `Boolean` type. Did you mean `boolean`?\"],\n            [\"Number\", \"Avoid using the `Number` type. Did you mean `number`?\"],\n            [\"String\", \"Avoid using the `String` type. Did you mean `string`?\"],\n            [\"Symbol\", \"Avoid using the `Symbol` type. Did you mean `symbol`?\"]\n        ]\n    }\n}"
  },
  {
    "path": "examples/custom-get-set.js",
    "content": "// this example demonstrates a way to keep field casing (as defined within .proto files)\n// while still having virtual getters and setters for the camel cased counterparts.\n\n/*eslint-disable strict, no-console*/\nvar protobuf = require(\"..\");\n\nvar proto = \"syntax=\\\"proto3\\\";\\\nmessage MyMessage {\\\n  string some_field = 1;\\\n}\";\n\nvar root = protobuf.parse(proto, { keepCase: true }).root; // or use Root#load\n\n// converts a string from underscore notation to camel case\nfunction toCamelCase(str) {\n    return str.substring(0,1) + str.substring(1).replace(/_([a-z])(?=[a-z]|$)/g, function($0, $1) { return $1.toUpperCase(); });\n}\n\n// adds a virtual alias property\nfunction addAliasProperty(type, name, aliasName) {\n    if (aliasName !== name)\n        Object.defineProperty(type.ctor.prototype, aliasName, {\n            get: function() { return this[name]; },\n            set: function(value) { this[name] = value; }\n        });\n}\n\n// this function adds alternative getters and setters for the camel cased counterparts\n// to the runtime message's prototype (i.e. without having to register a custom class):\nfunction addVirtualCamelcaseFields(type) {\n    type.fieldsArray.forEach(function(field) {\n        addAliasProperty(type, field.name, toCamelCase(field.name));\n    });\n    type.oneofsArray.forEach(function(oneof) {\n        addAliasProperty(type, oneof.name, toCamelCase(oneof.name));\n    });\n    return type;\n}\n\nvar MyMessage = addVirtualCamelcaseFields(root.lookup(\"MyMessage\"));\n\nvar myMessage = MyMessage.create({\n    some_field /* or someField */: \"hello world\"\n});\n\nconsole.log(\n    \"someField:\", myMessage.someField,\n    \"\\nsome_field:\", myMessage.some_field,\n    \"\\nJSON:\", JSON.stringify(myMessage)\n);\n"
  },
  {
    "path": "examples/js-decorators.js",
    "content": "// This example shows how decorators can be used with plain JavaScript. It's otherwise identical to\n// the README example.\n\n/*eslint-disable strict, no-console*/\nvar protobuf = require(\"../light\");\n\nvar Type  = protobuf.Type,\n    Field = protobuf.Field,\n    OneOf = protobuf.OneOf;\n\nfunction AwesomeSubMessage(properties) {\n    protobuf.Message.call(this, properties);\n}\n\n(AwesomeSubMessage.prototype = Object.create(protobuf.Message)).constructor = AwesomeSubMessage;\n\nField.d(1, \"string\", \"optional\", \"awesome default string\")(AwesomeSubMessage.prototype, \"awesomeField\");\n\nvar AwesomeEnum = {\n    ONE: 1,\n    TWO: 2\n};\n\nType.d(\"SuperAwesomeMessage\")(AwesomeMessage);\nfunction AwesomeMessage(properties) {\n    protobuf.Message.call(this, properties);\n}\n\n(AwesomeMessage.prototype = Object.create(protobuf.Message)).constructor = AwesomeMessage;\n\nField.d(1, \"string\", \"optional\", \"awesome default string\")(AwesomeMessage.prototype, \"awesomeField\");\nField.d(2, AwesomeSubMessage)(AwesomeMessage.prototype, \"awesomeSubMessage\");\nField.d(3, AwesomeEnum, \"optional\", AwesomeEnum.ONE)(AwesomeMessage.prototype, \"awesomeEnum\");\nOneOf.d(\"awesomeSubMessage\", \"awesomeEnum\")(AwesomeMessage.prototype, \"which\");\n\n// example code\nvar message = new AwesomeMessage({ awesomeField: \"hello\" });\nvar buffer  = AwesomeMessage.encode(message).finish();\nvar decoded = AwesomeMessage.decode(buffer);\n\nconsole.log(decoded);\nconsole.log(\"internal name: \" + AwesomeMessage.$type.name);\n"
  },
  {
    "path": "examples/reader-writer.js",
    "content": "// this example demonstrates how to use the reader/writer interface directly to read and write the\n// protobuf wire format.\n\n/*eslint-disable strict, no-console*/\nvar protobuf = require(\"../runtime\"); // require(\"protobufjs/runtime\");\n\n// writing\nvar buffer = protobuf.Writer.create()\n    .uint32((1 << 3 | 2) >>> 0) // id 1, wireType 2\n    .string(\"hello world!\")\n    .finish();\n\n// reading\nvar reader = protobuf.Reader.create(buffer);\nwhile (reader.pos < reader.len) {\n    var tag = reader.uint32();\n    switch (/*id*/ tag >>> 3) {\n        case 1:\n            console.log(reader.string());\n            break;\n        default:\n            reader.skipType(/*wireType*/ tag & 7);\n            break;\n    }\n}\n"
  },
  {
    "path": "examples/streaming-rpc.js",
    "content": "// this example demonstrates how to consume a streaming rpc service.\n\n/*eslint-disable strict, no-console*/\nvar protobuf = require(\"..\");\n\n// Load a definition with services:\n\nvar root = protobuf.Root.fromJSON({\n    nested: {\n        Greeter: {\n            methods: {\n                \"SayHello\": {\n                    requestType: \"Hello\",\n                    requestStream: true,\n                    responseType: \"World\",\n                    responseStream: true\n                }\n            }\n        },\n        Hello: {\n            fields: {\n                name: {\n                    type: \"string\",\n                    id: 1\n                }\n            }\n        },\n        World: {\n            fields: {\n                message: {\n                    type: \"string\",\n                    id: 1\n                }\n            }\n        }\n    }\n});\n\n// Get its types:\n\nvar Greeter = root.lookup(\"Greeter\"),\n    Hello   = root.lookup(\"Hello\"),\n    World   = root.lookup(\"World\");\n\n// Provide a stream-aware RPC implementation:\n\nvar greeter = Greeter.create(/* rpcImpl */ (function() { // API documentation: Service#create\n    var ended = false;\n    return function myRPCImpl(method, requestData, callback) {\n        if (ended)\n            return;\n        if (!requestData) {\n            ended = true;\n            return;\n        }\n        // in a real-world scenario, the client would now send requestData to a server using some\n        // sort of transport layer (i.e. http), wait for responseData and call the callback.\n        performRequestOverTransportChannel(requestData, function(responseData) {\n            callback(null, responseData);\n        });\n    };\n})(), /* requestDelimited? */ true, /* responseDelimited? */ true);\n\n// examplary server-side code for the sake of this example\nfunction performRequestOverTransportChannel(requestData, callback) {\n    setTimeout(/* simulated delay */function() {\n        // 1. server decodes the request\n        var request = Hello.decodeDelimited(requestData);\n        // 2. server handles the request and creates a response\n        var response = { message: \"Hello \" + request.name };\n        setTimeout(/* simulated delay */function() {\n            // 3. server encodes and sends the response\n            callback(World.encodeDelimited(response).finish());\n        }, Math.random() * 250);\n    }, Math.random() * 250);\n}\n\n// Listen for events:\n\ngreeter.on(\"data\", function(response, method) {\n    console.log(\"data in \" + method.name + \":\", response.message);\n});\n\ngreeter.on(\"end\", function() {\n    console.log(\"end\");\n});\n\ngreeter.on(\"error\", function(err, method) {\n    console.log(\"error in \" + method.name + \":\", err);\n});\n\n// Call methods:\n\ngreeter.sayHello({ name: \"one\" });\ngreeter.sayHello(Hello.create({ name: \"two\" })); // or use runtime messages\n\n// Listen to and emit your own events if you like:\n\ngreeter.on(\"status\", function(code, text) {\n    console.log(\"custom status:\", code, text);\n});\n\ngreeter.emit(\"status\", 200, \"OK\");\n\n// And, if applicable, end the service when you are done:\n\nsetTimeout(function() {\n    greeter.end();\n    // ^ Signals rpcImpl that the service has been ended client-side by calling it with a null buffer.\n    //   Likewise, rpcImpl can also end the stream by calling its callback with an explicit null buffer.\n    greeter.sayHello({ name: \"three\" }, function(err) {\n        console.error(\"this should fail: \" + err.message);\n    });\n}, 501);\n"
  },
  {
    "path": "examples/traverse-types.js",
    "content": "// this example demonstrates how to traverse through a root instance by calling a custom function\n// for each message type within.\n\n/*eslint-disable strict, no-console*/\nvar protobuf = require(\"..\"); // require(\"protobufjs\");\n\n// traverse-types.proto\nvar proto = \"syntax=\\\"proto3\\\";\\\npackage example;\\\nmessage Foo {\\\n  string a = 1;\\\n}\\\nmessage Bar {\\\n  uint32 b = 1;\\\n  \\\n  message Inner {\\\n    bytes c = 1;\\\n  }\\\n}\";\n\n// the following is loading a string.\n// in a real application, it'd be more like protobuf.load(\"traverse-types.proto\", ...)\nprotobuf.parse.filename = \"traverse-types.proto\";\nvar root = protobuf.parse(proto).root;\n\nfunction traverseTypes(current, fn) {\n    if (current instanceof protobuf.Type) // and/or protobuf.Enum, protobuf.Service etc.\n        fn(current);\n    if (current.nestedArray)\n        current.nestedArray.forEach(function(nested) {\n            traverseTypes(nested, fn);\n        });\n}\n\ntraverseTypes(root, function(type) {\n    console.log(\n        type.constructor.className + \" \" + type.name\n        + \"\\n  fully qualified name: \" + type.fullName\n        + \"\\n  defined in: \" + type.filename\n        + \"\\n  parent: \" + type.parent + \" in \" + type.parent.filename\n    );\n});\n"
  },
  {
    "path": "ext/debug/README.md",
    "content": "protobufjs/ext/debug\n=========================\n\nExperimental debugging extension.\n"
  },
  {
    "path": "ext/debug/index.js",
    "content": "\"use strict\";\nvar protobuf = require(\"../..\");\n\n/**\n * Debugging utility functions. Only present in debug builds.\n * @namespace\n */\nvar debug = protobuf.debug = module.exports = {};\n\nvar codegen = protobuf.util.codegen;\n\nvar debugFnRe = /function ([^(]+)\\(([^)]*)\\) {/g;\n\n// Counts number of calls to any generated function\nfunction codegen_debug() {\n    codegen_debug.supported = codegen.supported;\n    codegen_debug.verbose = codegen.verbose;\n    var gen = codegen.apply(null, Array.prototype.slice.call(arguments));\n    gen.str = (function(str) { return function str_debug() {\n        return str.apply(null, Array.prototype.slice.call(arguments)).replace(debugFnRe, \"function $1($2) {\\n\\t$1.calls=($1.calls|0)+1\");\n    };})(gen.str);\n    return gen;\n}\n\n/**\n * Returns a list of unused types within the specified root.\n * @param {NamespaceBase} ns Namespace to search\n * @returns {Type[]} Unused types\n */\ndebug.unusedTypes = function unusedTypes(ns) {\n\n    /* istanbul ignore if */\n    if (!(ns instanceof protobuf.Namespace))\n        throw TypeError(\"ns must be a Namespace\");\n\n    /* istanbul ignore if */\n    if (!ns.nested)\n        return [];\n\n    var unused = [];\n    for (var names = Object.keys(ns.nested), i = 0; i < names.length; ++i) {\n        var nested = ns.nested[names[i]];\n        if (nested instanceof protobuf.Type) {\n            var calls = (nested.encode.calls|0)\n                      + (nested.decode.calls|0)\n                      + (nested.verify.calls|0)\n                      + (nested.toObject.calls|0)\n                      + (nested.fromObject.calls|0);\n            if (!calls)\n                unused.push(nested);\n        } else if (nested instanceof protobuf.Namespace)\n            Array.prototype.push.apply(unused, unusedTypes(nested));\n    }\n    return unused;\n};\n\n/**\n * Enables debugging extensions.\n * @returns {undefined}\n */\ndebug.enable = function enable() {\n    protobuf.util.codegen = codegen_debug;\n};\n\n/**\n * Disables debugging extensions.\n * @returns {undefined}\n */\ndebug.disable = function disable() {\n    protobuf.util.codegen = codegen;\n};\n"
  },
  {
    "path": "ext/descriptor/README.md",
    "content": "protobufjs/ext/descriptor\n=========================\n\nExperimental extension for interoperability with [descriptor.proto](https://github.com/google/protobuf/blob/master/src/google/protobuf/descriptor.proto) types.\n\nUsage\n-----\n\n```js\nvar protobuf   = require(\"protobufjs\"), // requires the full library\n    descriptor = require(\"protobufjs/ext/descriptor\");\n\nvar root = ...;\n\n// convert any existing root instance to the corresponding descriptor type\nvar descriptorMsg = root.toDescriptor(\"proto2\");\n// ^ returns a FileDescriptorSet message, see table below\n\n// encode to a descriptor buffer\nvar buffer = descriptor.FileDescriptorSet.encode(descriptorMsg).finish();\n\n// decode from a descriptor buffer\nvar decodedDescriptor = descriptor.FileDescriptorSet.decode(buffer);\n\n// convert any existing descriptor to a root instance\nroot = protobuf.Root.fromDescriptor(decodedDescriptor);\n// ^ expects a FileDescriptorSet message or buffer, see table below\n\n// and start all over again\n```\n\nAPI\n---\n\nThe extension adds `.fromDescriptor(descriptor[, syntax])` and `#toDescriptor([syntax])` methods to reflection objects and exports the `.google.protobuf` namespace of the internally used `Root` instance containing the following types present in descriptor.proto:\n\n| Descriptor type               | protobuf.js type | Remarks\n|-------------------------------|------------------|---------\n| **FileDescriptorSet**         | Root             |\n| FileDescriptorProto           |                  | dependencies are not supported\n| FileOptions                   |                  |\n| FileOptionsOptimizeMode       |                  |\n| SourceCodeInfo                |                  | not supported\n| SourceCodeInfoLocation        |                  |\n| GeneratedCodeInfo             |                  | not supported\n| GeneratedCodeInfoAnnotation   |                  |\n| **DescriptorProto**           | Type             |\n| MessageOptions                |                  |\n| DescriptorProtoExtensionRange |                  |\n| DescriptorProtoReservedRange  |                  |\n| **FieldDescriptorProto**      | Field            |\n| FieldDescriptorProtoLabel     |                  |\n| FieldDescriptorProtoType      |                  |\n| FieldOptions                  |                  |\n| FieldOptionsCType             |                  |\n| FieldOptionsJSType            |                  |\n| **OneofDescriptorProto**      | OneOf            |\n| OneofOptions                  |                  |\n| **EnumDescriptorProto**       | Enum             |\n| EnumOptions                   |                  |\n| EnumValueDescriptorProto      |                  |\n| EnumValueOptions              |                  | not supported\n| **ServiceDescriptorProto**    | Service          |\n| ServiceOptions                |                  |\n| **MethodDescriptorProto**     | Method           |\n| MethodOptions                 |                  |\n| UninterpretedOption           |                  | not supported\n| UninterpretedOptionNamePart   |                  |\n\nNote that not all features of descriptor.proto translate perfectly to a protobuf.js root instance. A root instance has only limited knowlege of packages or individual files for example, which is then compensated by guessing and generating fictional file names.\n\nWhen using TypeScript, the respective interface types can be used to reference specific message instances (i.e. `protobuf.Message<IDescriptorProto>`).\n"
  },
  {
    "path": "ext/descriptor/index.d.ts",
    "content": "import * as $protobuf from \"../..\";\nexport const FileDescriptorSet: $protobuf.Type;\n\nexport const FileDescriptorProto: $protobuf.Type;\n\nexport const DescriptorProto: $protobuf.Type & {\n    ExtensionRange: $protobuf.Type,\n    ReservedRange: $protobuf.Type\n};\n\nexport const FieldDescriptorProto: $protobuf.Type & {\n    Label: $protobuf.Enum,\n    Type: $protobuf.Enum\n};\n\nexport const OneofDescriptorProto: $protobuf.Type;\n\nexport const EnumDescriptorProto: $protobuf.Type;\n\nexport const ServiceDescriptorProto: $protobuf.Type;\n\nexport const EnumValueDescriptorProto: $protobuf.Type;\n\nexport const MethodDescriptorProto: $protobuf.Type;\n\nexport const FileOptions: $protobuf.Type & {\n    OptimizeMode: $protobuf.Enum\n};\n\nexport const MessageOptions: $protobuf.Type;\n\nexport const FieldOptions: $protobuf.Type & {\n    CType: $protobuf.Enum,\n    JSType: $protobuf.Enum\n};\n\nexport const OneofOptions: $protobuf.Type;\n\nexport const EnumOptions: $protobuf.Type;\n\nexport const EnumValueOptions: $protobuf.Type;\n\nexport const ServiceOptions: $protobuf.Type;\n\nexport const MethodOptions: $protobuf.Type;\n\nexport const UninterpretedOption: $protobuf.Type & {\n    NamePart: $protobuf.Type\n};\n\nexport const SourceCodeInfo: $protobuf.Type & {\n    Location: $protobuf.Type\n};\n\nexport const GeneratedCodeInfo: $protobuf.Type & {\n    Annotation: $protobuf.Type\n};\n\nexport interface IFileDescriptorSet {\n    file: IFileDescriptorProto[];\n}\n\nexport interface IFileDescriptorProto {\n    name?: string;\n    package?: string;\n    dependency?: any;\n    publicDependency?: any;\n    weakDependency?: any;\n    messageType?: IDescriptorProto[];\n    enumType?: IEnumDescriptorProto[];\n    service?: IServiceDescriptorProto[];\n    extension?: IFieldDescriptorProto[];\n    options?: IFileOptions;\n    sourceCodeInfo?: any;\n    syntax?: string;\n}\n\nexport interface IFileOptions {\n    javaPackage?: string;\n    javaOuterClassname?: string;\n    javaMultipleFiles?: boolean;\n    javaGenerateEqualsAndHash?: boolean;\n    javaStringCheckUtf8?: boolean;\n    optimizeFor?: IFileOptionsOptimizeMode;\n    goPackage?: string;\n    ccGenericServices?: boolean;\n    javaGenericServices?: boolean;\n    pyGenericServices?: boolean;\n    deprecated?: boolean;\n    ccEnableArenas?: boolean;\n    objcClassPrefix?: string;\n    csharpNamespace?: string;\n}\n\ntype IFileOptionsOptimizeMode = number;\n\nexport interface IDescriptorProto {\n    name?: string;\n    field?: IFieldDescriptorProto[];\n    extension?: IFieldDescriptorProto[];\n    nestedType?: IDescriptorProto[];\n    enumType?: IEnumDescriptorProto[];\n    extensionRange?: IDescriptorProtoExtensionRange[];\n    oneofDecl?: IOneofDescriptorProto[];\n    options?: IMessageOptions;\n    reservedRange?: IDescriptorProtoReservedRange[];\n    reservedName?: string[];\n}\n\nexport interface IMessageOptions {\n    mapEntry?: boolean;\n}\n\nexport interface IDescriptorProtoExtensionRange {\n    start?: number;\n    end?: number;\n}\n\nexport interface IDescriptorProtoReservedRange {\n    start?: number;\n    end?: number;\n}\n\nexport interface IFieldDescriptorProto {\n    name?: string;\n    number?: number;\n    label?: IFieldDescriptorProtoLabel;\n    type?: IFieldDescriptorProtoType;\n    typeName?: string;\n    extendee?: string;\n    defaultValue?: string;\n    oneofIndex?: number;\n    jsonName?: any;\n    options?: IFieldOptions;\n}\n\ntype IFieldDescriptorProtoLabel = number;\n\ntype IFieldDescriptorProtoType = number;\n\nexport interface IFieldOptions {\n    packed?: boolean;\n    jstype?: IFieldOptionsJSType;\n}\n\ntype IFieldOptionsJSType = number;\n\nexport interface IEnumDescriptorProto {\n    name?: string;\n    value?: IEnumValueDescriptorProto[];\n    options?: IEnumOptions;\n}\n\nexport interface IEnumValueDescriptorProto {\n    name?: string;\n    number?: number;\n    options?: any;\n}\n\nexport interface IEnumOptions {\n    allowAlias?: boolean;\n    deprecated?: boolean;\n}\n\nexport interface IOneofDescriptorProto {\n    name?: string;\n    options?: any;\n}\n\nexport interface IServiceDescriptorProto {\n    name?: string;\n    method?: IMethodDescriptorProto[];\n    options?: IServiceOptions;\n}\n\nexport interface IServiceOptions {\n    deprecated?: boolean;\n}\n\nexport interface IMethodDescriptorProto {\n    name?: string;\n    inputType?: string;\n    outputType?: string;\n    options?: IMethodOptions;\n    clientStreaming?: boolean;\n    serverStreaming?: boolean;\n}\n\nexport interface IMethodOptions {\n    deprecated?: boolean;\n}\n"
  },
  {
    "path": "ext/descriptor/index.js",
    "content": "\"use strict\";\nvar $protobuf = require(\"../..\");\nmodule.exports = exports = $protobuf.descriptor = $protobuf.Root.fromJSON(require(\"../../google/protobuf/descriptor.json\")).lookup(\".google.protobuf\");\n\nvar Namespace = $protobuf.Namespace,\n    Root      = $protobuf.Root,\n    Enum      = $protobuf.Enum,\n    Type      = $protobuf.Type,\n    Field     = $protobuf.Field,\n    MapField  = $protobuf.MapField,\n    OneOf     = $protobuf.OneOf,\n    Service   = $protobuf.Service,\n    Method    = $protobuf.Method;\n\n// --- Root ---\n\n/**\n * Properties of a FileDescriptorSet message.\n * @interface IFileDescriptorSet\n * @property {IFileDescriptorProto[]} file Files\n */\n\n/**\n * Properties of a FileDescriptorProto message.\n * @interface IFileDescriptorProto\n * @property {string} [name] File name\n * @property {string} [package] Package\n * @property {*} [dependency] Not supported\n * @property {*} [publicDependency] Not supported\n * @property {*} [weakDependency] Not supported\n * @property {IDescriptorProto[]} [messageType] Nested message types\n * @property {IEnumDescriptorProto[]} [enumType] Nested enums\n * @property {IServiceDescriptorProto[]} [service] Nested services\n * @property {IFieldDescriptorProto[]} [extension] Nested extension fields\n * @property {IFileOptions} [options] Options\n * @property {*} [sourceCodeInfo] Not supported\n * @property {string} [syntax=\"proto2\"] Syntax\n * @property {IEdition} [edition] Edition\n */\n\n/**\n * Values of the Edition enum.\n * @typedef IEdition\n * @type {number}\n * @property {number} EDITION_UNKNOWN=0\n * @property {number} EDITION_LEGACY=900\n * @property {number} EDITION_PROTO2=998\n * @property {number} EDITION_PROTO3=999\n * @property {number} EDITION_2023=1000\n * @property {number} EDITION_2024=1001\n * @property {number} EDITION_1_TEST_ONLY=1\n * @property {number} EDITION_2_TEST_ONLY=2\n * @property {number} EDITION_99997_TEST_ONLY=99997\n * @property {number} EDITION_99998_TEST_ONLY=99998\n * @property {number} EDITION_99998_TEST_ONLY=99999\n * @property {number} EDITION_MAX=2147483647\n */\n\n/**\n * Properties of a FileOptions message.\n * @interface IFileOptions\n * @property {string} [javaPackage]\n * @property {string} [javaOuterClassname]\n * @property {boolean} [javaMultipleFiles]\n * @property {boolean} [javaGenerateEqualsAndHash]\n * @property {boolean} [javaStringCheckUtf8]\n * @property {IFileOptionsOptimizeMode} [optimizeFor=1]\n * @property {string} [goPackage]\n * @property {boolean} [ccGenericServices]\n * @property {boolean} [javaGenericServices]\n * @property {boolean} [pyGenericServices]\n * @property {boolean} [deprecated]\n * @property {boolean} [ccEnableArenas]\n * @property {string} [objcClassPrefix]\n * @property {string} [csharpNamespace]\n */\n\n/**\n * Values of he FileOptions.OptimizeMode enum.\n * @typedef IFileOptionsOptimizeMode\n * @type {number}\n * @property {number} SPEED=1\n * @property {number} CODE_SIZE=2\n * @property {number} LITE_RUNTIME=3\n */\n\n/**\n * Creates a root from a descriptor set.\n * @param {IFileDescriptorSet|Reader|Uint8Array} descriptor Descriptor\n * @returns {Root} Root instance\n */\nRoot.fromDescriptor = function fromDescriptor(descriptor) {\n\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.FileDescriptorSet.decode(descriptor);\n\n    var root = new Root();\n\n    if (descriptor.file) {\n        var fileDescriptor,\n            filePackage;\n        for (var j = 0, i; j < descriptor.file.length; ++j) {\n            filePackage = root;\n            if ((fileDescriptor = descriptor.file[j])[\"package\"] && fileDescriptor[\"package\"].length)\n                filePackage = root.define(fileDescriptor[\"package\"]);\n            var edition = editionFromDescriptor(fileDescriptor);\n            if (fileDescriptor.name && fileDescriptor.name.length)\n                root.files.push(filePackage.filename = fileDescriptor.name);\n            if (fileDescriptor.messageType)\n                for (i = 0; i < fileDescriptor.messageType.length; ++i)\n                    filePackage.add(Type.fromDescriptor(fileDescriptor.messageType[i], edition));\n            if (fileDescriptor.enumType)\n                for (i = 0; i < fileDescriptor.enumType.length; ++i)\n                    filePackage.add(Enum.fromDescriptor(fileDescriptor.enumType[i], edition));\n            if (fileDescriptor.extension)\n                for (i = 0; i < fileDescriptor.extension.length; ++i)\n                    filePackage.add(Field.fromDescriptor(fileDescriptor.extension[i], edition));\n            if (fileDescriptor.service)\n                for (i = 0; i < fileDescriptor.service.length; ++i)\n                    filePackage.add(Service.fromDescriptor(fileDescriptor.service[i], edition));\n            var opts = fromDescriptorOptions(fileDescriptor.options, exports.FileOptions);\n            if (opts) {\n                var ks = Object.keys(opts);\n                for (i = 0; i < ks.length; ++i)\n                    filePackage.setOption(ks[i], opts[ks[i]]);\n            }\n        }\n    }\n\n    return root.resolveAll();\n};\n\n/**\n * Converts a root to a descriptor set.\n * @returns {Message<IFileDescriptorSet>} Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n */\nRoot.prototype.toDescriptor = function toDescriptor(edition) {\n    var set = exports.FileDescriptorSet.create();\n    Root_toDescriptorRecursive(this, set.file, edition);\n    return set;\n};\n\n// Traverses a namespace and assembles the descriptor set\nfunction Root_toDescriptorRecursive(ns, files, edition) {\n\n    // Create a new file\n    var file = exports.FileDescriptorProto.create({ name: ns.filename || (ns.fullName.substring(1).replace(/\\./g, \"_\") || \"root\") + \".proto\" });\n    editionToDescriptor(edition, file);\n    if (!(ns instanceof Root))\n        file[\"package\"] = ns.fullName.substring(1);\n\n    // Add nested types\n    for (var i = 0, nested; i < ns.nestedArray.length; ++i)\n        if ((nested = ns._nestedArray[i]) instanceof Type)\n            file.messageType.push(nested.toDescriptor(edition));\n        else if (nested instanceof Enum)\n            file.enumType.push(nested.toDescriptor());\n        else if (nested instanceof Field)\n            file.extension.push(nested.toDescriptor(edition));\n        else if (nested instanceof Service)\n            file.service.push(nested.toDescriptor());\n        else if (nested instanceof /* plain */ Namespace)\n            Root_toDescriptorRecursive(nested, files, edition); // requires new file\n\n    // Keep package-level options\n    file.options = toDescriptorOptions(ns.options, exports.FileOptions);\n\n    // And keep the file only if there is at least one nested object\n    if (file.messageType.length + file.enumType.length + file.extension.length + file.service.length)\n        files.push(file);\n}\n\n// --- Type ---\n\n/**\n * Properties of a DescriptorProto message.\n * @interface IDescriptorProto\n * @property {string} [name] Message type name\n * @property {IFieldDescriptorProto[]} [field] Fields\n * @property {IFieldDescriptorProto[]} [extension] Extension fields\n * @property {IDescriptorProto[]} [nestedType] Nested message types\n * @property {IEnumDescriptorProto[]} [enumType] Nested enums\n * @property {IDescriptorProtoExtensionRange[]} [extensionRange] Extension ranges\n * @property {IOneofDescriptorProto[]} [oneofDecl] Oneofs\n * @property {IMessageOptions} [options] Not supported\n * @property {IDescriptorProtoReservedRange[]} [reservedRange] Reserved ranges\n * @property {string[]} [reservedName] Reserved names\n */\n\n/**\n * Properties of a MessageOptions message.\n * @interface IMessageOptions\n * @property {boolean} [mapEntry=false] Whether this message is a map entry\n */\n\n/**\n * Properties of an ExtensionRange message.\n * @interface IDescriptorProtoExtensionRange\n * @property {number} [start] Start field id\n * @property {number} [end] End field id\n */\n\n/**\n * Properties of a ReservedRange message.\n * @interface IDescriptorProtoReservedRange\n * @property {number} [start] Start field id\n * @property {number} [end] End field id\n */\n\nvar unnamedMessageIndex = 0;\n\n/**\n * Creates a type from a descriptor.\n *\n * Warning: this is not safe to use with editions protos, since it discards relevant file context.\n *\n * @param {IDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n * @param {boolean} [nested=false] Whether or not this is a nested object\n * @returns {Type} Type instance\n */\nType.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.DescriptorProto.decode(descriptor);\n\n    // Create the message type\n    var type = new Type(descriptor.name.length ? descriptor.name : \"Type\" + unnamedMessageIndex++, fromDescriptorOptions(descriptor.options, exports.MessageOptions)),\n        i;\n\n    if (!nested)\n        type._edition = edition;\n\n    /* Oneofs */ if (descriptor.oneofDecl)\n        for (i = 0; i < descriptor.oneofDecl.length; ++i)\n            type.add(OneOf.fromDescriptor(descriptor.oneofDecl[i]));\n    /* Fields */ if (descriptor.field)\n        for (i = 0; i < descriptor.field.length; ++i) {\n            var field = Field.fromDescriptor(descriptor.field[i], edition, true);\n            type.add(field);\n            if (descriptor.field[i].hasOwnProperty(\"oneofIndex\")) // eslint-disable-line no-prototype-builtins\n                type.oneofsArray[descriptor.field[i].oneofIndex].add(field);\n        }\n    /* Extension fields */ if (descriptor.extension)\n        for (i = 0; i < descriptor.extension.length; ++i)\n            type.add(Field.fromDescriptor(descriptor.extension[i], edition, true));\n    /* Nested types */ if (descriptor.nestedType)\n        for (i = 0; i < descriptor.nestedType.length; ++i) {\n            type.add(Type.fromDescriptor(descriptor.nestedType[i], edition, true));\n            if (descriptor.nestedType[i].options && descriptor.nestedType[i].options.mapEntry)\n                type.setOption(\"map_entry\", true);\n        }\n    /* Nested enums */ if (descriptor.enumType)\n        for (i = 0; i < descriptor.enumType.length; ++i)\n            type.add(Enum.fromDescriptor(descriptor.enumType[i], edition, true));\n    /* Extension ranges */ if (descriptor.extensionRange && descriptor.extensionRange.length) {\n        type.extensions = [];\n        for (i = 0; i < descriptor.extensionRange.length; ++i)\n            type.extensions.push([ descriptor.extensionRange[i].start, descriptor.extensionRange[i].end ]);\n    }\n    /* Reserved... */ if (descriptor.reservedRange && descriptor.reservedRange.length || descriptor.reservedName && descriptor.reservedName.length) {\n        type.reserved = [];\n        /* Ranges */ if (descriptor.reservedRange)\n            for (i = 0; i < descriptor.reservedRange.length; ++i)\n                type.reserved.push([ descriptor.reservedRange[i].start, descriptor.reservedRange[i].end ]);\n        /* Names */ if (descriptor.reservedName)\n            for (i = 0; i < descriptor.reservedName.length; ++i)\n                type.reserved.push(descriptor.reservedName[i]);\n    }\n\n    return type;\n};\n\n/**\n * Converts a type to a descriptor.\n * @returns {Message<IDescriptorProto>} Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n */\nType.prototype.toDescriptor = function toDescriptor(edition) {\n    var descriptor = exports.DescriptorProto.create({ name: this.name }),\n        i;\n\n    /* Fields */ for (i = 0; i < this.fieldsArray.length; ++i) {\n        var fieldDescriptor;\n        descriptor.field.push(fieldDescriptor = this._fieldsArray[i].toDescriptor(edition));\n        if (this._fieldsArray[i] instanceof MapField) { // map fields are repeated FieldNameEntry\n            var keyType = toDescriptorType(this._fieldsArray[i].keyType, this._fieldsArray[i].resolvedKeyType, false),\n                valueType = toDescriptorType(this._fieldsArray[i].type, this._fieldsArray[i].resolvedType, false),\n                valueTypeName = valueType === /* type */ 11 || valueType === /* enum */ 14\n                    ? this._fieldsArray[i].resolvedType && shortname(this.parent, this._fieldsArray[i].resolvedType) || this._fieldsArray[i].type\n                    : undefined;\n            descriptor.nestedType.push(exports.DescriptorProto.create({\n                name: fieldDescriptor.typeName,\n                field: [\n                    exports.FieldDescriptorProto.create({ name: \"key\", number: 1, label: 1, type: keyType }), // can't reference a type or enum\n                    exports.FieldDescriptorProto.create({ name: \"value\", number: 2, label: 1, type: valueType, typeName: valueTypeName })\n                ],\n                options: exports.MessageOptions.create({ mapEntry: true })\n            }));\n        }\n    }\n    /* Oneofs */ for (i = 0; i < this.oneofsArray.length; ++i)\n        descriptor.oneofDecl.push(this._oneofsArray[i].toDescriptor());\n    /* Nested... */ for (i = 0; i < this.nestedArray.length; ++i) {\n        /* Extension fields */ if (this._nestedArray[i] instanceof Field)\n            descriptor.field.push(this._nestedArray[i].toDescriptor(edition));\n        /* Types */ else if (this._nestedArray[i] instanceof Type)\n            descriptor.nestedType.push(this._nestedArray[i].toDescriptor(edition));\n        /* Enums */ else if (this._nestedArray[i] instanceof Enum)\n            descriptor.enumType.push(this._nestedArray[i].toDescriptor());\n        // plain nested namespaces become packages instead in Root#toDescriptor\n    }\n    /* Extension ranges */ if (this.extensions)\n        for (i = 0; i < this.extensions.length; ++i)\n            descriptor.extensionRange.push(exports.DescriptorProto.ExtensionRange.create({ start: this.extensions[i][0], end: this.extensions[i][1] }));\n    /* Reserved... */ if (this.reserved)\n        for (i = 0; i < this.reserved.length; ++i)\n            /* Names */ if (typeof this.reserved[i] === \"string\")\n                descriptor.reservedName.push(this.reserved[i]);\n            /* Ranges */ else\n                descriptor.reservedRange.push(exports.DescriptorProto.ReservedRange.create({ start: this.reserved[i][0], end: this.reserved[i][1] }));\n\n    descriptor.options = toDescriptorOptions(this.options, exports.MessageOptions);\n\n    return descriptor;\n};\n\n// --- Field ---\n\n/**\n * Properties of a FieldDescriptorProto message.\n * @interface IFieldDescriptorProto\n * @property {string} [name] Field name\n * @property {number} [number] Field id\n * @property {IFieldDescriptorProtoLabel} [label] Field rule\n * @property {IFieldDescriptorProtoType} [type] Field basic type\n * @property {string} [typeName] Field type name\n * @property {string} [extendee] Extended type name\n * @property {string} [defaultValue] Literal default value\n * @property {number} [oneofIndex] Oneof index if part of a oneof\n * @property {*} [jsonName] Not supported\n * @property {IFieldOptions} [options] Field options\n */\n\n/**\n * Values of the FieldDescriptorProto.Label enum.\n * @typedef IFieldDescriptorProtoLabel\n * @type {number}\n * @property {number} LABEL_OPTIONAL=1\n * @property {number} LABEL_REQUIRED=2\n * @property {number} LABEL_REPEATED=3\n */\n\n/**\n * Values of the FieldDescriptorProto.Type enum.\n * @typedef IFieldDescriptorProtoType\n * @type {number}\n * @property {number} TYPE_DOUBLE=1\n * @property {number} TYPE_FLOAT=2\n * @property {number} TYPE_INT64=3\n * @property {number} TYPE_UINT64=4\n * @property {number} TYPE_INT32=5\n * @property {number} TYPE_FIXED64=6\n * @property {number} TYPE_FIXED32=7\n * @property {number} TYPE_BOOL=8\n * @property {number} TYPE_STRING=9\n * @property {number} TYPE_GROUP=10\n * @property {number} TYPE_MESSAGE=11\n * @property {number} TYPE_BYTES=12\n * @property {number} TYPE_UINT32=13\n * @property {number} TYPE_ENUM=14\n * @property {number} TYPE_SFIXED32=15\n * @property {number} TYPE_SFIXED64=16\n * @property {number} TYPE_SINT32=17\n * @property {number} TYPE_SINT64=18\n */\n\n/**\n * Properties of a FieldOptions message.\n * @interface IFieldOptions\n * @property {boolean} [packed] Whether packed or not (defaults to `false` for proto2 and `true` for proto3)\n * @property {IFieldOptionsJSType} [jstype] JavaScript value type (not used by protobuf.js)\n */\n\n/**\n * Values of the FieldOptions.JSType enum.\n * @typedef IFieldOptionsJSType\n * @type {number}\n * @property {number} JS_NORMAL=0\n * @property {number} JS_STRING=1\n * @property {number} JS_NUMBER=2\n */\n\n// copied here from parse.js\nvar numberRe = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/;\n\n/**\n * Creates a field from a descriptor.\n *\n * Warning: this is not safe to use with editions protos, since it discards relevant file context.\n *\n * @param {IFieldDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n * @param {boolean} [nested=false] Whether or not this is a top-level object\n * @returns {Field} Field instance\n */\nField.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {\n\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.DescriptorProto.decode(descriptor);\n\n    if (typeof descriptor.number !== \"number\")\n        throw Error(\"missing field id\");\n\n    // Rewire field type\n    var fieldType;\n    if (descriptor.typeName && descriptor.typeName.length)\n        fieldType = descriptor.typeName;\n    else\n        fieldType = fromDescriptorType(descriptor.type);\n\n    // Rewire field rule\n    var fieldRule;\n    switch (descriptor.label) {\n        // 0 is reserved for errors\n        case 1: fieldRule = undefined; break;\n        case 2: fieldRule = \"required\"; break;\n        case 3: fieldRule = \"repeated\"; break;\n        default: throw Error(\"illegal label: \" + descriptor.label);\n    }\n\n\tvar extendee = descriptor.extendee;\n\tif (descriptor.extendee !== undefined) {\n\t\textendee = extendee.length ? extendee : undefined;\n\t}\n    var field = new Field(\n        descriptor.name.length ? descriptor.name : \"field\" + descriptor.number,\n        descriptor.number,\n        fieldType,\n        fieldRule,\n        extendee\n    );\n\n    if (!nested)\n        field._edition = edition;\n\n    field.options = fromDescriptorOptions(descriptor.options, exports.FieldOptions);\n    if (descriptor.proto3_optional)\n        field.options.proto3_optional = true;\n\n    if (descriptor.defaultValue && descriptor.defaultValue.length) {\n        var defaultValue = descriptor.defaultValue;\n        switch (defaultValue) {\n            case \"true\": case \"TRUE\":\n                defaultValue = true;\n                break;\n            case \"false\": case \"FALSE\":\n                defaultValue = false;\n                break;\n            default:\n                var match = numberRe.exec(defaultValue);\n                if (match)\n                    defaultValue = parseInt(defaultValue); // eslint-disable-line radix\n                break;\n        }\n        field.setOption(\"default\", defaultValue);\n    }\n\n    if (packableDescriptorType(descriptor.type)) {\n        if (edition === \"proto3\") { // defaults to packed=true (internal preset is packed=true)\n            if (descriptor.options && !descriptor.options.packed)\n                field.setOption(\"packed\", false);\n        } else if ((!edition || edition === \"proto2\") && descriptor.options && descriptor.options.packed) // defaults to packed=false\n            field.setOption(\"packed\", true);\n    }\n\n    return field;\n};\n\n/**\n * Converts a field to a descriptor.\n * @returns {Message<IFieldDescriptorProto>} Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n */\nField.prototype.toDescriptor = function toDescriptor(edition) {\n    var descriptor = exports.FieldDescriptorProto.create({ name: this.name, number: this.id });\n\n    if (this.map) {\n\n        descriptor.type = 11; // message\n        descriptor.typeName = $protobuf.util.ucFirst(this.name); // fieldName -> FieldNameEntry (built in Type#toDescriptor)\n        descriptor.label = 3; // repeated\n\n    } else {\n\n        // Rewire field type\n        switch (descriptor.type = toDescriptorType(this.type, this.resolve().resolvedType, this.delimited)) {\n            case 10: // group\n            case 11: // type\n            case 14: // enum\n                descriptor.typeName = this.resolvedType ? shortname(this.parent, this.resolvedType) : this.type;\n                break;\n        }\n\n        // Rewire field rule\n        if (this.rule === \"repeated\") {\n            descriptor.label = 3;\n        } else if (this.required && edition === \"proto2\") {\n            descriptor.label = 2;\n        } else {\n            descriptor.label = 1;\n        }\n    }\n\n    // Handle extension field\n    descriptor.extendee = this.extensionField ? this.extensionField.parent.fullName : this.extend;\n\n    // Handle part of oneof (only meaningful for message types)\n    if (this.partOf && this.parent instanceof Type) {\n        if ((descriptor.oneofIndex = this.parent.oneofsArray.indexOf(this.partOf)) < 0)\n            throw Error(\"missing oneof\");\n    }\n\n    if (this.options) {\n        descriptor.options = toDescriptorOptions(this.options, exports.FieldOptions);\n        if (this.options[\"default\"] != null)\n            descriptor.defaultValue = String(this.options[\"default\"]);\n        if (this.options.proto3_optional)\n            descriptor.proto3_optional = true;\n    }\n\n    if (edition === \"proto3\") { // defaults to packed=true\n        if (!this.packed)\n            (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = false;\n    } else if ((!edition || edition === \"proto2\") && this.packed) // defaults to packed=false\n        (descriptor.options || (descriptor.options = exports.FieldOptions.create())).packed = true;\n\n    return descriptor;\n};\n\n// --- Enum ---\n\n/**\n * Properties of an EnumDescriptorProto message.\n * @interface IEnumDescriptorProto\n * @property {string} [name] Enum name\n * @property {IEnumValueDescriptorProto[]} [value] Enum values\n * @property {IEnumOptions} [options] Enum options\n */\n\n/**\n * Properties of an EnumValueDescriptorProto message.\n * @interface IEnumValueDescriptorProto\n * @property {string} [name] Name\n * @property {number} [number] Value\n * @property {*} [options] Not supported\n */\n\n/**\n * Properties of an EnumOptions message.\n * @interface IEnumOptions\n * @property {boolean} [allowAlias] Whether aliases are allowed\n * @property {boolean} [deprecated]\n */\n\nvar unnamedEnumIndex = 0;\n\n/**\n * Creates an enum from a descriptor.\n *\n * Warning: this is not safe to use with editions protos, since it discards relevant file context.\n *\n * @param {IEnumDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n * @param {boolean} [nested=false] Whether or not this is a top-level object\n * @returns {Enum} Enum instance\n */\nEnum.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {\n\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.EnumDescriptorProto.decode(descriptor);\n\n    // Construct values object\n    var values = {};\n    if (descriptor.value)\n        for (var i = 0; i < descriptor.value.length; ++i) {\n            var name  = descriptor.value[i].name,\n                value = descriptor.value[i].number || 0;\n            values[name && name.length ? name : \"NAME\" + value] = value;\n        }\n\n    var enm = new Enum(\n        descriptor.name && descriptor.name.length ? descriptor.name : \"Enum\" + unnamedEnumIndex++,\n        values,\n        fromDescriptorOptions(descriptor.options, exports.EnumOptions)\n    );\n\n    if (!nested)\n        enm._edition = edition;\n\n    return enm;\n};\n\n/**\n * Converts an enum to a descriptor.\n * @returns {Message<IEnumDescriptorProto>} Descriptor\n */\nEnum.prototype.toDescriptor = function toDescriptor() {\n\n    // Values\n    var values = [];\n    for (var i = 0, ks = Object.keys(this.values); i < ks.length; ++i)\n        values.push(exports.EnumValueDescriptorProto.create({ name: ks[i], number: this.values[ks[i]] }));\n\n    return exports.EnumDescriptorProto.create({\n        name: this.name,\n        value: values,\n        options: toDescriptorOptions(this.options, exports.EnumOptions)\n    });\n};\n\n// --- OneOf ---\n\n/**\n * Properties of a OneofDescriptorProto message.\n * @interface IOneofDescriptorProto\n * @property {string} [name] Oneof name\n * @property {*} [options] Not supported\n */\n\nvar unnamedOneofIndex = 0;\n\n/**\n * Creates a oneof from a descriptor.\n *\n * Warning: this is not safe to use with editions protos, since it discards relevant file context.\n *\n * @param {IOneofDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @returns {OneOf} OneOf instance\n */\nOneOf.fromDescriptor = function fromDescriptor(descriptor) {\n\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.OneofDescriptorProto.decode(descriptor);\n\n    return new OneOf(\n        // unnamedOneOfIndex is global, not per type, because we have no ref to a type here\n        descriptor.name && descriptor.name.length ? descriptor.name : \"oneof\" + unnamedOneofIndex++\n        // fromDescriptorOptions(descriptor.options, exports.OneofOptions) - only uninterpreted_option\n    );\n};\n\n/**\n * Converts a oneof to a descriptor.\n * @returns {Message<IOneofDescriptorProto>} Descriptor\n */\nOneOf.prototype.toDescriptor = function toDescriptor() {\n    return exports.OneofDescriptorProto.create({\n        name: this.name\n        // options: toDescriptorOptions(this.options, exports.OneofOptions) - only uninterpreted_option\n    });\n};\n\n// --- Service ---\n\n/**\n * Properties of a ServiceDescriptorProto message.\n * @interface IServiceDescriptorProto\n * @property {string} [name] Service name\n * @property {IMethodDescriptorProto[]} [method] Methods\n * @property {IServiceOptions} [options] Options\n */\n\n/**\n * Properties of a ServiceOptions message.\n * @interface IServiceOptions\n * @property {boolean} [deprecated]\n */\n\nvar unnamedServiceIndex = 0;\n\n/**\n * Creates a service from a descriptor.\n *\n * Warning: this is not safe to use with editions protos, since it discards relevant file context.\n *\n * @param {IServiceDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @param {string} [edition=\"proto2\"] The syntax or edition to use\n * @param {boolean} [nested=false] Whether or not this is a top-level object\n * @returns {Service} Service instance\n */\nService.fromDescriptor = function fromDescriptor(descriptor, edition, nested) {\n\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.ServiceDescriptorProto.decode(descriptor);\n\n    var service = new Service(descriptor.name && descriptor.name.length ? descriptor.name : \"Service\" + unnamedServiceIndex++, fromDescriptorOptions(descriptor.options, exports.ServiceOptions));\n    if (!nested)\n        service._edition = edition;\n    if (descriptor.method)\n        for (var i = 0; i < descriptor.method.length; ++i)\n            service.add(Method.fromDescriptor(descriptor.method[i]));\n\n    return service;\n};\n\n/**\n * Converts a service to a descriptor.\n * @returns {Message<IServiceDescriptorProto>} Descriptor\n */\nService.prototype.toDescriptor = function toDescriptor() {\n\n    // Methods\n    var methods = [];\n    for (var i = 0; i < this.methodsArray.length; ++i)\n        methods.push(this._methodsArray[i].toDescriptor());\n\n    return exports.ServiceDescriptorProto.create({\n        name: this.name,\n        method: methods,\n        options: toDescriptorOptions(this.options, exports.ServiceOptions)\n    });\n};\n\n// --- Method ---\n\n/**\n * Properties of a MethodDescriptorProto message.\n * @interface IMethodDescriptorProto\n * @property {string} [name] Method name\n * @property {string} [inputType] Request type name\n * @property {string} [outputType] Response type name\n * @property {IMethodOptions} [options] Not supported\n * @property {boolean} [clientStreaming=false] Whether requests are streamed\n * @property {boolean} [serverStreaming=false] Whether responses are streamed\n */\n\n/**\n * Properties of a MethodOptions message.\n *\n * Warning: this is not safe to use with editions protos, since it discards relevant file context.\n *\n * @interface IMethodOptions\n * @property {boolean} [deprecated]\n */\n\nvar unnamedMethodIndex = 0;\n\n/**\n * Creates a method from a descriptor.\n * @param {IMethodDescriptorProto|Reader|Uint8Array} descriptor Descriptor\n * @returns {Method} Reflected method instance\n */\nMethod.fromDescriptor = function fromDescriptor(descriptor) {\n\n    // Decode the descriptor message if specified as a buffer:\n    if (typeof descriptor.length === \"number\")\n        descriptor = exports.MethodDescriptorProto.decode(descriptor);\n\n    return new Method(\n        // unnamedMethodIndex is global, not per service, because we have no ref to a service here\n        descriptor.name && descriptor.name.length ? descriptor.name : \"Method\" + unnamedMethodIndex++,\n        \"rpc\",\n        descriptor.inputType,\n        descriptor.outputType,\n        Boolean(descriptor.clientStreaming),\n        Boolean(descriptor.serverStreaming),\n        fromDescriptorOptions(descriptor.options, exports.MethodOptions)\n    );\n};\n\n/**\n * Converts a method to a descriptor.\n * @returns {Message<IMethodDescriptorProto>} Descriptor\n */\nMethod.prototype.toDescriptor = function toDescriptor() {\n    return exports.MethodDescriptorProto.create({\n        name: this.name,\n        inputType: this.resolvedRequestType ? this.resolvedRequestType.fullName : this.requestType,\n        outputType: this.resolvedResponseType ? this.resolvedResponseType.fullName : this.responseType,\n        clientStreaming: this.requestStream,\n        serverStreaming: this.responseStream,\n        options: toDescriptorOptions(this.options, exports.MethodOptions)\n    });\n};\n\n// --- utility ---\n\n// Converts a descriptor type to a protobuf.js basic type\nfunction fromDescriptorType(type) {\n    switch (type) {\n        // 0 is reserved for errors\n        case 1: return \"double\";\n        case 2: return \"float\";\n        case 3: return \"int64\";\n        case 4: return \"uint64\";\n        case 5: return \"int32\";\n        case 6: return \"fixed64\";\n        case 7: return \"fixed32\";\n        case 8: return \"bool\";\n        case 9: return \"string\";\n        case 12: return \"bytes\";\n        case 13: return \"uint32\";\n        case 15: return \"sfixed32\";\n        case 16: return \"sfixed64\";\n        case 17: return \"sint32\";\n        case 18: return \"sint64\";\n    }\n    throw Error(\"illegal type: \" + type);\n}\n\n// Tests if a descriptor type is packable\nfunction packableDescriptorType(type) {\n    switch (type) {\n        case 1: // double\n        case 2: // float\n        case 3: // int64\n        case 4: // uint64\n        case 5: // int32\n        case 6: // fixed64\n        case 7: // fixed32\n        case 8: // bool\n        case 13: // uint32\n        case 14: // enum (!)\n        case 15: // sfixed32\n        case 16: // sfixed64\n        case 17: // sint32\n        case 18: // sint64\n            return true;\n    }\n    return false;\n}\n\n// Converts a protobuf.js basic type to a descriptor type\nfunction toDescriptorType(type, resolvedType, delimited) {\n    switch (type) {\n        // 0 is reserved for errors\n        case \"double\": return 1;\n        case \"float\": return 2;\n        case \"int64\": return 3;\n        case \"uint64\": return 4;\n        case \"int32\": return 5;\n        case \"fixed64\": return 6;\n        case \"fixed32\": return 7;\n        case \"bool\": return 8;\n        case \"string\": return 9;\n        case \"bytes\": return 12;\n        case \"uint32\": return 13;\n        case \"sfixed32\": return 15;\n        case \"sfixed64\": return 16;\n        case \"sint32\": return 17;\n        case \"sint64\": return 18;\n    }\n    if (resolvedType instanceof Enum)\n        return 14;\n    if (resolvedType instanceof Type)\n        return delimited ? 10 : 11;\n    throw Error(\"illegal type: \" + type);\n}\n\nfunction fromDescriptorOptionsRecursive(obj, type) {\n    var val = {};\n    for (var i = 0, field, key; i < type.fieldsArray.length; ++i) {\n        if ((key = (field = type._fieldsArray[i]).name) === \"uninterpretedOption\") continue;\n        if (!Object.prototype.hasOwnProperty.call(obj, key)) continue;\n\n        var newKey = underScore(key);\n        if (field.resolvedType instanceof Type) {\n            val[newKey] = fromDescriptorOptionsRecursive(obj[key], field.resolvedType);\n        } else if(field.resolvedType instanceof Enum) {\n            val[newKey] = field.resolvedType.valuesById[obj[key]];\n        } else {\n            val[newKey] = obj[key];\n        }\n    }\n    return val;\n}\n\n// Converts descriptor options to an options object\nfunction fromDescriptorOptions(options, type) {\n    if (!options)\n        return undefined;\n    return fromDescriptorOptionsRecursive(type.toObject(options), type);\n}\n\nfunction toDescriptorOptionsRecursive(obj, type) {\n    var val = {};\n    var keys = Object.keys(obj);\n    for (var i = 0; i < keys.length; ++i) {\n        var key = keys[i];\n        var newKey = $protobuf.util.camelCase(key);\n        if (!Object.prototype.hasOwnProperty.call(type.fields, newKey)) continue;\n        var field = type.fields[newKey];\n        if (field.resolvedType instanceof Type) {\n            val[newKey] = toDescriptorOptionsRecursive(obj[key], field.resolvedType);\n        } else {\n            val[newKey] = obj[key];\n        }\n        if (field.repeated && !Array.isArray(val[newKey])) {\n            val[newKey] = [val[newKey]];\n        }\n    }\n    return val;\n}\n\n// Converts an options object to descriptor options\nfunction toDescriptorOptions(options, type) {\n    if (!options)\n        return undefined;\n    return type.fromObject(toDescriptorOptionsRecursive(options, type));\n}\n\n// Calculates the shortest relative path from `from` to `to`.\nfunction shortname(from, to) {\n    var fromPath = from.fullName.split(\".\"),\n        toPath = to.fullName.split(\".\"),\n        i = 0,\n        j = 0,\n        k = toPath.length - 1;\n    if (!(from instanceof Root) && to instanceof Namespace)\n        while (i < fromPath.length && j < k && fromPath[i] === toPath[j]) {\n            var other = to.lookup(fromPath[i++], true);\n            if (other !== null && other !== to)\n                break;\n            ++j;\n        }\n    else\n        for (; i < fromPath.length && j < k && fromPath[i] === toPath[j]; ++i, ++j);\n    return toPath.slice(j).join(\".\");\n}\n\n// copied here from cli/targets/proto.js\nfunction underScore(str) {\n    return str.substring(0,1)\n         + str.substring(1)\n               .replace(/([A-Z])(?=[a-z]|$)/g, function($0, $1) { return \"_\" + $1.toLowerCase(); });\n}\n\nfunction editionFromDescriptor(fileDescriptor) {\n    if (fileDescriptor.syntax === \"editions\") {\n        switch(fileDescriptor.edition) {\n            case exports.Edition.EDITION_2023:\n                return \"2023\";\n            default:\n                throw new Error(\"Unsupported edition \" + fileDescriptor.edition);\n        }\n    }\n    if (fileDescriptor.syntax === \"proto3\") {\n        return \"proto3\";\n    }\n    return \"proto2\";\n}\n\nfunction editionToDescriptor(edition, fileDescriptor) {\n    if (!edition) return;\n    if (edition === \"proto2\" || edition === \"proto3\") {\n        fileDescriptor.syntax = edition;\n    } else {\n        fileDescriptor.syntax = \"editions\";\n        switch(edition) {\n            case \"2023\":\n                fileDescriptor.edition = exports.Edition.EDITION_2023;\n                break;\n            default:\n                throw new Error(\"Unsupported edition \" + edition);\n        }\n    }\n}\n\n// --- exports ---\n\n/**\n * Reflected file descriptor set.\n * @name FileDescriptorSet\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected file descriptor proto.\n * @name FileDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected descriptor proto.\n * @name DescriptorProto\n * @type {Type}\n * @property {Type} ExtensionRange\n * @property {Type} ReservedRange\n * @const\n * @tstype $protobuf.Type & {\n *     ExtensionRange: $protobuf.Type,\n *     ReservedRange: $protobuf.Type\n * }\n */\n\n/**\n * Reflected field descriptor proto.\n * @name FieldDescriptorProto\n * @type {Type}\n * @property {Enum} Label\n * @property {Enum} Type\n * @const\n * @tstype $protobuf.Type & {\n *     Label: $protobuf.Enum,\n *     Type: $protobuf.Enum\n * }\n */\n\n/**\n * Reflected oneof descriptor proto.\n * @name OneofDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum descriptor proto.\n * @name EnumDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected service descriptor proto.\n * @name ServiceDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum value descriptor proto.\n * @name EnumValueDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected method descriptor proto.\n * @name MethodDescriptorProto\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected file options.\n * @name FileOptions\n * @type {Type}\n * @property {Enum} OptimizeMode\n * @const\n * @tstype $protobuf.Type & {\n *     OptimizeMode: $protobuf.Enum\n * }\n */\n\n/**\n * Reflected message options.\n * @name MessageOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected field options.\n * @name FieldOptions\n * @type {Type}\n * @property {Enum} CType\n * @property {Enum} JSType\n * @const\n * @tstype $protobuf.Type & {\n *     CType: $protobuf.Enum,\n *     JSType: $protobuf.Enum\n * }\n */\n\n/**\n * Reflected oneof options.\n * @name OneofOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum options.\n * @name EnumOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected enum value options.\n * @name EnumValueOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected service options.\n * @name ServiceOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected method options.\n * @name MethodOptions\n * @type {Type}\n * @const\n * @tstype $protobuf.Type\n */\n\n/**\n * Reflected uninterpretet option.\n * @name UninterpretedOption\n * @type {Type}\n * @property {Type} NamePart\n * @const\n * @tstype $protobuf.Type & {\n *     NamePart: $protobuf.Type\n * }\n */\n\n/**\n * Reflected source code info.\n * @name SourceCodeInfo\n * @type {Type}\n * @property {Type} Location\n * @const\n * @tstype $protobuf.Type & {\n *     Location: $protobuf.Type\n * }\n */\n\n/**\n * Reflected generated code info.\n * @name GeneratedCodeInfo\n * @type {Type}\n * @property {Type} Annotation\n * @const\n * @tstype $protobuf.Type & {\n *     Annotation: $protobuf.Type\n * }\n */\n"
  },
  {
    "path": "ext/descriptor/test.js",
    "content": "/*eslint-disable no-console*/\n\"use strict\";\nvar protobuf   = require(\"../../\"),\n    descriptor = require(\".\");\n\n/* var proto = {\n    nested: {\n        Message: {\n            fields: {\n                foo: {\n                    type: \"string\",\n                    id: 1\n                }\n            },\n            nested: {\n                SubMessage: {\n                    fields: {}\n                }\n            }\n        },\n        Enum: {\n            values: {\n                ONE: 1,\n                TWO: 2\n            }\n        }\n    }\n}; */\n\n// var root = protobuf.Root.fromJSON(proto).resolveAll();\nvar root = protobuf.loadSync(\"tests/data/google/protobuf/descriptor.proto\").resolveAll();\n\n// console.log(\"Original proto\", JSON.stringify(root, null, 2));\n\nvar msg  = root.toDescriptor();\n\n// console.log(\"\\nDescriptor\", JSON.stringify(msg.toObject(), null, 2));\n\nvar buf  = descriptor.FileDescriptorSet.encode(msg).finish();\nvar root2 = protobuf.Root.fromDescriptor(buf, \"proto2\").resolveAll();\n\n// console.log(\"\\nDecoded proto\", JSON.stringify(root2, null, 2));\n\nvar diff = require(\"deep-diff\").diff(root.toJSON(), root2.toJSON());\nif (diff) {\n    diff.forEach(function(diff) {\n        console.log(diff.kind + \" @ \" + diff.path.join(\".\"));\n        console.log(\"lhs:\", typeof diff.lhs, diff.lhs);\n        console.log(\"rhs:\", typeof diff.rhs, diff.rhs);\n        console.log();\n    });\n    process.exitCode = 1;\n} else\n    console.log(\"no differences\");\n"
  },
  {
    "path": "google/LICENSE",
    "content": "Copyright 2014, Google Inc.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n    * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "google/README.md",
    "content": "This folder contains stripped and pre-parsed definitions of common Google types. These files are not used by protobuf.js directly but are here so you can use or include them where required.\n"
  },
  {
    "path": "google/api/annotations.json",
    "content": "{\n  \"nested\": {\n    \"google\": {\n      \"nested\": {\n        \"api\": {\n          \"nested\": {\n            \"http\": {\n              \"type\": \"HttpRule\",\n              \"id\": 72295728,\n              \"extend\": \"google.protobuf.MethodOptions\"\n            },\n            \"HttpRule\": {\n              \"oneofs\": {\n                \"pattern\": {\n                  \"oneof\": [\n                    \"get\",\n                    \"put\",\n                    \"post\",\n                    \"delete\",\n                    \"patch\",\n                    \"custom\"\n                  ]\n                }\n              },\n              \"fields\": {\n                \"get\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"put\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"post\": {\n                  \"type\": \"string\",\n                  \"id\": 4\n                },\n                \"delete\": {\n                  \"type\": \"string\",\n                  \"id\": 5\n                },\n                \"patch\": {\n                  \"type\": \"string\",\n                  \"id\": 6\n                },\n                \"custom\": {\n                  \"type\": \"CustomHttpPattern\",\n                  \"id\": 8\n                },\n                \"selector\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"body\": {\n                  \"type\": \"string\",\n                  \"id\": 7\n                },\n                \"additionalBindings\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"HttpRule\",\n                  \"id\": 11\n                }\n              }\n            }\n          }\n        },\n        \"protobuf\": {\n          \"nested\": {\n            \"MethodOptions\": {\n              \"fields\": {},\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "google/api/annotations.proto",
    "content": "syntax = \"proto3\";\n\npackage google.api;\n\nimport \"google/api/http.proto\";\nimport \"google/protobuf/descriptor.proto\";\n\nextend google.protobuf.MethodOptions {\n\n    HttpRule http = 72295728;\n}"
  },
  {
    "path": "google/api/http.json",
    "content": "{\n  \"nested\": {\n    \"google\": {\n      \"nested\": {\n        \"api\": {\n          \"nested\": {\n            \"Http\": {\n              \"fields\": {\n                \"rules\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"HttpRule\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"HttpRule\": {\n              \"oneofs\": {\n                \"pattern\": {\n                  \"oneof\": [\n                    \"get\",\n                    \"put\",\n                    \"post\",\n                    \"delete\",\n                    \"patch\",\n                    \"custom\"\n                  ]\n                }\n              },\n              \"fields\": {\n                \"get\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"put\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"post\": {\n                  \"type\": \"string\",\n                  \"id\": 4\n                },\n                \"delete\": {\n                  \"type\": \"string\",\n                  \"id\": 5\n                },\n                \"patch\": {\n                  \"type\": \"string\",\n                  \"id\": 6\n                },\n                \"custom\": {\n                  \"type\": \"CustomHttpPattern\",\n                  \"id\": 8\n                },\n                \"selector\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"body\": {\n                  \"type\": \"string\",\n                  \"id\": 7\n                },\n                \"additionalBindings\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"HttpRule\",\n                  \"id\": 11\n                }\n              }\n            },\n            \"CustomHttpPattern\": {\n              \"fields\": {\n                \"kind\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"path\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "google/api/http.proto",
    "content": "syntax = \"proto3\";\n\npackage google.api;\n\nmessage Http {\n\n    repeated HttpRule rules = 1;\n}\n\nmessage HttpRule {\n\n    oneof pattern {\n\n        string get = 2;\n        string put = 3;\n        string post = 4;\n        string delete = 5;\n        string patch = 6;\n        CustomHttpPattern custom = 8;\n    }\n\n    string selector = 1;\n    string body = 7;\n    repeated HttpRule additional_bindings = 11;\n}\n\nmessage CustomHttpPattern {\n\n    string kind = 1;\n    string path = 2;\n}"
  },
  {
    "path": "google/protobuf/api.json",
    "content": "{\n  \"nested\": {\n    \"google\": {\n      \"nested\": {\n        \"protobuf\": {\n          \"nested\": {\n            \"Api\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"methods\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Method\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Option\",\n                  \"id\": 3\n                },\n                \"version\": {\n                  \"type\": \"string\",\n                  \"id\": 4\n                },\n                \"sourceContext\": {\n                  \"type\": \"SourceContext\",\n                  \"id\": 5\n                },\n                \"mixins\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Mixin\",\n                  \"id\": 6\n                },\n                \"syntax\": {\n                  \"type\": \"Syntax\",\n                  \"id\": 7\n                }\n              }\n            },\n            \"Method\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"requestTypeUrl\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"requestStreaming\": {\n                  \"type\": \"bool\",\n                  \"id\": 3\n                },\n                \"responseTypeUrl\": {\n                  \"type\": \"string\",\n                  \"id\": 4\n                },\n                \"responseStreaming\": {\n                  \"type\": \"bool\",\n                  \"id\": 5\n                },\n                \"options\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Option\",\n                  \"id\": 6\n                },\n                \"syntax\": {\n                  \"type\": \"Syntax\",\n                  \"id\": 7\n                }\n              }\n            },\n            \"Mixin\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"root\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"SourceContext\": {\n              \"fields\": {\n                \"fileName\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"Option\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"value\": {\n                  \"type\": \"Any\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"Syntax\": {\n              \"values\": {\n                \"SYNTAX_PROTO2\": 0,\n                \"SYNTAX_PROTO3\": 1\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "google/protobuf/api.proto",
    "content": "syntax = \"proto3\";\n\npackage google.protobuf;\n\nimport \"google/protobuf/source_context.proto\";\nimport \"google/protobuf/type.proto\";\n\nmessage Api {\n\n    string name = 1;\n    repeated Method methods = 2;\n    repeated Option options = 3;\n    string version = 4;\n    SourceContext source_context = 5;\n    repeated Mixin mixins = 6;\n    Syntax syntax = 7;\n}\n\nmessage Method {\n\n    string name = 1;\n    string request_type_url = 2;\n    bool request_streaming = 3;\n    string response_type_url = 4;\n    bool response_streaming = 5;\n    repeated Option options = 6;\n    Syntax syntax = 7;\n}\n\nmessage Mixin {\n\n    string name = 1;\n    string root = 2;\n}"
  },
  {
    "path": "google/protobuf/descriptor.json",
    "content": "{\n  \"nested\": {\n    \"google\": {\n      \"nested\": {\n        \"protobuf\": {\n          \"options\": {\n            \"go_package\": \"google.golang.org/protobuf/types/descriptorpb\",\n            \"java_package\": \"com.google.protobuf\",\n            \"java_outer_classname\": \"DescriptorProtos\",\n            \"csharp_namespace\": \"Google.Protobuf.Reflection\",\n            \"objc_class_prefix\": \"GPB\",\n            \"cc_enable_arenas\": true,\n            \"optimize_for\": \"SPEED\"\n          },\n          \"nested\": {\n            \"FileDescriptorSet\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"file\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FileDescriptorProto\",\n                  \"id\": 1\n                }\n              },\n              \"extensions\": [\n                [\n                  536000000,\n                  536000000\n                ]\n              ]\n            },\n            \"Edition\": {\n              \"edition\": \"proto2\",\n              \"values\": {\n                \"EDITION_UNKNOWN\": 0,\n                \"EDITION_LEGACY\": 900,\n                \"EDITION_PROTO2\": 998,\n                \"EDITION_PROTO3\": 999,\n                \"EDITION_2023\": 1000,\n                \"EDITION_2024\": 1001,\n                \"EDITION_1_TEST_ONLY\": 1,\n                \"EDITION_2_TEST_ONLY\": 2,\n                \"EDITION_99997_TEST_ONLY\": 99997,\n                \"EDITION_99998_TEST_ONLY\": 99998,\n                \"EDITION_99999_TEST_ONLY\": 99999,\n                \"EDITION_MAX\": 2147483647\n              }\n            },\n            \"FileDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"package\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"dependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"publicDependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"int32\",\n                  \"id\": 10\n                },\n                \"weakDependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"int32\",\n                  \"id\": 11\n                },\n                \"optionDependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 15\n                },\n                \"messageType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"DescriptorProto\",\n                  \"id\": 4\n                },\n                \"enumType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumDescriptorProto\",\n                  \"id\": 5\n                },\n                \"service\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"ServiceDescriptorProto\",\n                  \"id\": 6\n                },\n                \"extension\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FieldDescriptorProto\",\n                  \"id\": 7\n                },\n                \"options\": {\n                  \"type\": \"FileOptions\",\n                  \"id\": 8\n                },\n                \"sourceCodeInfo\": {\n                  \"type\": \"SourceCodeInfo\",\n                  \"id\": 9\n                },\n                \"syntax\": {\n                  \"type\": \"string\",\n                  \"id\": 12\n                },\n                \"edition\": {\n                  \"type\": \"Edition\",\n                  \"id\": 14\n                }\n              }\n            },\n            \"DescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"field\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FieldDescriptorProto\",\n                  \"id\": 2\n                },\n                \"extension\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FieldDescriptorProto\",\n                  \"id\": 6\n                },\n                \"nestedType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"DescriptorProto\",\n                  \"id\": 3\n                },\n                \"enumType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumDescriptorProto\",\n                  \"id\": 4\n                },\n                \"extensionRange\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"ExtensionRange\",\n                  \"id\": 5\n                },\n                \"oneofDecl\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"OneofDescriptorProto\",\n                  \"id\": 8\n                },\n                \"options\": {\n                  \"type\": \"MessageOptions\",\n                  \"id\": 7\n                },\n                \"reservedRange\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"ReservedRange\",\n                  \"id\": 9\n                },\n                \"reservedName\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 10\n                },\n                \"visibility\": {\n                  \"type\": \"SymbolVisibility\",\n                  \"id\": 11\n                }\n              },\n              \"nested\": {\n                \"ExtensionRange\": {\n                  \"fields\": {\n                    \"start\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 2\n                    },\n                    \"options\": {\n                      \"type\": \"ExtensionRangeOptions\",\n                      \"id\": 3\n                    }\n                  }\n                },\n                \"ReservedRange\": {\n                  \"fields\": {\n                    \"start\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 2\n                    }\n                  }\n                }\n              }\n            },\n            \"ExtensionRangeOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                },\n                \"declaration\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Declaration\",\n                  \"id\": 2,\n                  \"options\": {\n                    \"retention\": \"RETENTION_SOURCE\"\n                  }\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 50\n                },\n                \"verification\": {\n                  \"type\": \"VerificationState\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"default\": \"UNVERIFIED\",\n                    \"retention\": \"RETENTION_SOURCE\"\n                  }\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"nested\": {\n                \"Declaration\": {\n                  \"fields\": {\n                    \"number\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    },\n                    \"fullName\": {\n                      \"type\": \"string\",\n                      \"id\": 2\n                    },\n                    \"type\": {\n                      \"type\": \"string\",\n                      \"id\": 3\n                    },\n                    \"reserved\": {\n                      \"type\": \"bool\",\n                      \"id\": 5\n                    },\n                    \"repeated\": {\n                      \"type\": \"bool\",\n                      \"id\": 6\n                    }\n                  },\n                  \"reserved\": [\n                    [\n                      4,\n                      4\n                    ]\n                  ]\n                },\n                \"VerificationState\": {\n                  \"values\": {\n                    \"DECLARATION\": 0,\n                    \"UNVERIFIED\": 1\n                  }\n                }\n              }\n            },\n            \"FieldDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"number\": {\n                  \"type\": \"int32\",\n                  \"id\": 3\n                },\n                \"label\": {\n                  \"type\": \"Label\",\n                  \"id\": 4\n                },\n                \"type\": {\n                  \"type\": \"Type\",\n                  \"id\": 5\n                },\n                \"typeName\": {\n                  \"type\": \"string\",\n                  \"id\": 6\n                },\n                \"extendee\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"defaultValue\": {\n                  \"type\": \"string\",\n                  \"id\": 7\n                },\n                \"oneofIndex\": {\n                  \"type\": \"int32\",\n                  \"id\": 9\n                },\n                \"jsonName\": {\n                  \"type\": \"string\",\n                  \"id\": 10\n                },\n                \"options\": {\n                  \"type\": \"FieldOptions\",\n                  \"id\": 8\n                },\n                \"proto3Optional\": {\n                  \"type\": \"bool\",\n                  \"id\": 17\n                }\n              },\n              \"nested\": {\n                \"Type\": {\n                  \"values\": {\n                    \"TYPE_DOUBLE\": 1,\n                    \"TYPE_FLOAT\": 2,\n                    \"TYPE_INT64\": 3,\n                    \"TYPE_UINT64\": 4,\n                    \"TYPE_INT32\": 5,\n                    \"TYPE_FIXED64\": 6,\n                    \"TYPE_FIXED32\": 7,\n                    \"TYPE_BOOL\": 8,\n                    \"TYPE_STRING\": 9,\n                    \"TYPE_GROUP\": 10,\n                    \"TYPE_MESSAGE\": 11,\n                    \"TYPE_BYTES\": 12,\n                    \"TYPE_UINT32\": 13,\n                    \"TYPE_ENUM\": 14,\n                    \"TYPE_SFIXED32\": 15,\n                    \"TYPE_SFIXED64\": 16,\n                    \"TYPE_SINT32\": 17,\n                    \"TYPE_SINT64\": 18\n                  }\n                },\n                \"Label\": {\n                  \"values\": {\n                    \"LABEL_OPTIONAL\": 1,\n                    \"LABEL_REPEATED\": 3,\n                    \"LABEL_REQUIRED\": 2\n                  }\n                }\n              }\n            },\n            \"OneofDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"options\": {\n                  \"type\": \"OneofOptions\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"EnumDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"value\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumValueDescriptorProto\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"type\": \"EnumOptions\",\n                  \"id\": 3\n                },\n                \"reservedRange\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumReservedRange\",\n                  \"id\": 4\n                },\n                \"reservedName\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 5\n                },\n                \"visibility\": {\n                  \"type\": \"SymbolVisibility\",\n                  \"id\": 6\n                }\n              },\n              \"nested\": {\n                \"EnumReservedRange\": {\n                  \"fields\": {\n                    \"start\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 2\n                    }\n                  }\n                }\n              }\n            },\n            \"EnumValueDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"number\": {\n                  \"type\": \"int32\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"type\": \"EnumValueOptions\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"ServiceDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"method\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"MethodDescriptorProto\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"type\": \"ServiceOptions\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"MethodDescriptorProto\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"inputType\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"outputType\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"options\": {\n                  \"type\": \"MethodOptions\",\n                  \"id\": 4\n                },\n                \"clientStreaming\": {\n                  \"type\": \"bool\",\n                  \"id\": 5\n                },\n                \"serverStreaming\": {\n                  \"type\": \"bool\",\n                  \"id\": 6\n                }\n              }\n            },\n            \"FileOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"javaPackage\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"javaOuterClassname\": {\n                  \"type\": \"string\",\n                  \"id\": 8\n                },\n                \"javaMultipleFiles\": {\n                  \"type\": \"bool\",\n                  \"id\": 10\n                },\n                \"javaGenerateEqualsAndHash\": {\n                  \"type\": \"bool\",\n                  \"id\": 20,\n                  \"options\": {\n                    \"deprecated\": true\n                  }\n                },\n                \"javaStringCheckUtf8\": {\n                  \"type\": \"bool\",\n                  \"id\": 27\n                },\n                \"optimizeFor\": {\n                  \"type\": \"OptimizeMode\",\n                  \"id\": 9,\n                  \"options\": {\n                    \"default\": \"SPEED\"\n                  }\n                },\n                \"goPackage\": {\n                  \"type\": \"string\",\n                  \"id\": 11\n                },\n                \"ccGenericServices\": {\n                  \"type\": \"bool\",\n                  \"id\": 16\n                },\n                \"javaGenericServices\": {\n                  \"type\": \"bool\",\n                  \"id\": 17\n                },\n                \"pyGenericServices\": {\n                  \"type\": \"bool\",\n                  \"id\": 18\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 23\n                },\n                \"ccEnableArenas\": {\n                  \"type\": \"bool\",\n                  \"id\": 31,\n                  \"options\": {\n                    \"default\": true\n                  }\n                },\n                \"objcClassPrefix\": {\n                  \"type\": \"string\",\n                  \"id\": 36\n                },\n                \"csharpNamespace\": {\n                  \"type\": \"string\",\n                  \"id\": 37\n                },\n                \"swiftPrefix\": {\n                  \"type\": \"string\",\n                  \"id\": 39\n                },\n                \"phpClassPrefix\": {\n                  \"type\": \"string\",\n                  \"id\": 40\n                },\n                \"phpNamespace\": {\n                  \"type\": \"string\",\n                  \"id\": 41\n                },\n                \"phpMetadataNamespace\": {\n                  \"type\": \"string\",\n                  \"id\": 44\n                },\n                \"rubyPackage\": {\n                  \"type\": \"string\",\n                  \"id\": 45\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 50\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  42,\n                  42\n                ],\n                [\n                  38,\n                  38\n                ],\n                \"php_generic_services\"\n              ],\n              \"nested\": {\n                \"OptimizeMode\": {\n                  \"values\": {\n                    \"SPEED\": 1,\n                    \"CODE_SIZE\": 2,\n                    \"LITE_RUNTIME\": 3\n                  }\n                }\n              }\n            },\n            \"MessageOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"messageSetWireFormat\": {\n                  \"type\": \"bool\",\n                  \"id\": 1\n                },\n                \"noStandardDescriptorAccessor\": {\n                  \"type\": \"bool\",\n                  \"id\": 2\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 3\n                },\n                \"mapEntry\": {\n                  \"type\": \"bool\",\n                  \"id\": 7\n                },\n                \"deprecatedLegacyJsonFieldConflicts\": {\n                  \"type\": \"bool\",\n                  \"id\": 11,\n                  \"options\": {\n                    \"deprecated\": true\n                  }\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 12\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  4,\n                  4\n                ],\n                [\n                  5,\n                  5\n                ],\n                [\n                  6,\n                  6\n                ],\n                [\n                  8,\n                  8\n                ],\n                [\n                  9,\n                  9\n                ]\n              ]\n            },\n            \"FieldOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"ctype\": {\n                  \"type\": \"CType\",\n                  \"id\": 1,\n                  \"options\": {\n                    \"default\": \"STRING\"\n                  }\n                },\n                \"packed\": {\n                  \"type\": \"bool\",\n                  \"id\": 2\n                },\n                \"jstype\": {\n                  \"type\": \"JSType\",\n                  \"id\": 6,\n                  \"options\": {\n                    \"default\": \"JS_NORMAL\"\n                  }\n                },\n                \"lazy\": {\n                  \"type\": \"bool\",\n                  \"id\": 5\n                },\n                \"unverifiedLazy\": {\n                  \"type\": \"bool\",\n                  \"id\": 15\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 3\n                },\n                \"weak\": {\n                  \"type\": \"bool\",\n                  \"id\": 10,\n                  \"options\": {\n                    \"deprecated\": true\n                  }\n                },\n                \"debugRedact\": {\n                  \"type\": \"bool\",\n                  \"id\": 16\n                },\n                \"retention\": {\n                  \"type\": \"OptionRetention\",\n                  \"id\": 17\n                },\n                \"targets\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"OptionTargetType\",\n                  \"id\": 19\n                },\n                \"editionDefaults\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EditionDefault\",\n                  \"id\": 20\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 21\n                },\n                \"featureSupport\": {\n                  \"type\": \"FeatureSupport\",\n                  \"id\": 22\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  4,\n                  4\n                ],\n                [\n                  18,\n                  18\n                ]\n              ],\n              \"nested\": {\n                \"CType\": {\n                  \"values\": {\n                    \"STRING\": 0,\n                    \"CORD\": 1,\n                    \"STRING_PIECE\": 2\n                  }\n                },\n                \"JSType\": {\n                  \"values\": {\n                    \"JS_NORMAL\": 0,\n                    \"JS_STRING\": 1,\n                    \"JS_NUMBER\": 2\n                  }\n                },\n                \"OptionRetention\": {\n                  \"values\": {\n                    \"RETENTION_UNKNOWN\": 0,\n                    \"RETENTION_RUNTIME\": 1,\n                    \"RETENTION_SOURCE\": 2\n                  }\n                },\n                \"OptionTargetType\": {\n                  \"values\": {\n                    \"TARGET_TYPE_UNKNOWN\": 0,\n                    \"TARGET_TYPE_FILE\": 1,\n                    \"TARGET_TYPE_EXTENSION_RANGE\": 2,\n                    \"TARGET_TYPE_MESSAGE\": 3,\n                    \"TARGET_TYPE_FIELD\": 4,\n                    \"TARGET_TYPE_ONEOF\": 5,\n                    \"TARGET_TYPE_ENUM\": 6,\n                    \"TARGET_TYPE_ENUM_ENTRY\": 7,\n                    \"TARGET_TYPE_SERVICE\": 8,\n                    \"TARGET_TYPE_METHOD\": 9\n                  }\n                },\n                \"EditionDefault\": {\n                  \"fields\": {\n                    \"edition\": {\n                      \"type\": \"Edition\",\n                      \"id\": 3\n                    },\n                    \"value\": {\n                      \"type\": \"string\",\n                      \"id\": 2\n                    }\n                  }\n                },\n                \"FeatureSupport\": {\n                  \"fields\": {\n                    \"editionIntroduced\": {\n                      \"type\": \"Edition\",\n                      \"id\": 1\n                    },\n                    \"editionDeprecated\": {\n                      \"type\": \"Edition\",\n                      \"id\": 2\n                    },\n                    \"deprecationWarning\": {\n                      \"type\": \"string\",\n                      \"id\": 3\n                    },\n                    \"editionRemoved\": {\n                      \"type\": \"Edition\",\n                      \"id\": 4\n                    }\n                  }\n                }\n              }\n            },\n            \"OneofOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 1\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"EnumOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"allowAlias\": {\n                  \"type\": \"bool\",\n                  \"id\": 2\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 3\n                },\n                \"deprecatedLegacyJsonFieldConflicts\": {\n                  \"type\": \"bool\",\n                  \"id\": 6,\n                  \"options\": {\n                    \"deprecated\": true\n                  }\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 7\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  5,\n                  5\n                ]\n              ]\n            },\n            \"EnumValueOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 1\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 2\n                },\n                \"debugRedact\": {\n                  \"type\": \"bool\",\n                  \"id\": 3\n                },\n                \"featureSupport\": {\n                  \"type\": \"FieldOptions.FeatureSupport\",\n                  \"id\": 4\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"ServiceOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 34\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 33\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"MethodOptions\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 33\n                },\n                \"idempotencyLevel\": {\n                  \"type\": \"IdempotencyLevel\",\n                  \"id\": 34,\n                  \"options\": {\n                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n                  }\n                },\n                \"features\": {\n                  \"type\": \"FeatureSet\",\n                  \"id\": 35\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"nested\": {\n                \"IdempotencyLevel\": {\n                  \"values\": {\n                    \"IDEMPOTENCY_UNKNOWN\": 0,\n                    \"NO_SIDE_EFFECTS\": 1,\n                    \"IDEMPOTENT\": 2\n                  }\n                }\n              }\n            },\n            \"UninterpretedOption\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"name\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"NamePart\",\n                  \"id\": 2\n                },\n                \"identifierValue\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"positiveIntValue\": {\n                  \"type\": \"uint64\",\n                  \"id\": 4\n                },\n                \"negativeIntValue\": {\n                  \"type\": \"int64\",\n                  \"id\": 5\n                },\n                \"doubleValue\": {\n                  \"type\": \"double\",\n                  \"id\": 6\n                },\n                \"stringValue\": {\n                  \"type\": \"bytes\",\n                  \"id\": 7\n                },\n                \"aggregateValue\": {\n                  \"type\": \"string\",\n                  \"id\": 8\n                }\n              },\n              \"nested\": {\n                \"NamePart\": {\n                  \"fields\": {\n                    \"namePart\": {\n                      \"rule\": \"required\",\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"isExtension\": {\n                      \"rule\": \"required\",\n                      \"type\": \"bool\",\n                      \"id\": 2\n                    }\n                  }\n                }\n              }\n            },\n            \"FeatureSet\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"fieldPresence\": {\n                  \"type\": \"FieldPresence\",\n                  \"id\": 1,\n                  \"options\": {\n                    \"retention\": \"RETENTION_RUNTIME\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2023\",\n                    \"edition_defaults.edition\": \"EDITION_2023\",\n                    \"edition_defaults.value\": \"EXPLICIT\"\n                  }\n                },\n                \"enumType\": {\n                  \"type\": \"EnumType\",\n                  \"id\": 2,\n                  \"options\": {\n                    \"retention\": \"RETENTION_RUNTIME\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2023\",\n                    \"edition_defaults.edition\": \"EDITION_PROTO3\",\n                    \"edition_defaults.value\": \"OPEN\"\n                  }\n                },\n                \"repeatedFieldEncoding\": {\n                  \"type\": \"RepeatedFieldEncoding\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"retention\": \"RETENTION_RUNTIME\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2023\",\n                    \"edition_defaults.edition\": \"EDITION_PROTO3\",\n                    \"edition_defaults.value\": \"PACKED\"\n                  }\n                },\n                \"utf8Validation\": {\n                  \"type\": \"Utf8Validation\",\n                  \"id\": 4,\n                  \"options\": {\n                    \"retention\": \"RETENTION_RUNTIME\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2023\",\n                    \"edition_defaults.edition\": \"EDITION_PROTO3\",\n                    \"edition_defaults.value\": \"VERIFY\"\n                  }\n                },\n                \"messageEncoding\": {\n                  \"type\": \"MessageEncoding\",\n                  \"id\": 5,\n                  \"options\": {\n                    \"retention\": \"RETENTION_RUNTIME\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2023\",\n                    \"edition_defaults.edition\": \"EDITION_LEGACY\",\n                    \"edition_defaults.value\": \"LENGTH_PREFIXED\"\n                  }\n                },\n                \"jsonFormat\": {\n                  \"type\": \"JsonFormat\",\n                  \"id\": 6,\n                  \"options\": {\n                    \"retention\": \"RETENTION_RUNTIME\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2023\",\n                    \"edition_defaults.edition\": \"EDITION_PROTO3\",\n                    \"edition_defaults.value\": \"ALLOW\"\n                  }\n                },\n                \"enforceNamingStyle\": {\n                  \"type\": \"EnforceNamingStyle\",\n                  \"id\": 7,\n                  \"options\": {\n                    \"retention\": \"RETENTION_SOURCE\",\n                    \"targets\": \"TARGET_TYPE_METHOD\",\n                    \"feature_support.edition_introduced\": \"EDITION_2024\",\n                    \"edition_defaults.edition\": \"EDITION_2024\",\n                    \"edition_defaults.value\": \"STYLE2024\"\n                  }\n                },\n                \"defaultSymbolVisibility\": {\n                  \"type\": \"VisibilityFeature.DefaultSymbolVisibility\",\n                  \"id\": 8,\n                  \"options\": {\n                    \"retention\": \"RETENTION_SOURCE\",\n                    \"targets\": \"TARGET_TYPE_FILE\",\n                    \"feature_support.edition_introduced\": \"EDITION_2024\",\n                    \"edition_defaults.edition\": \"EDITION_2024\",\n                    \"edition_defaults.value\": \"EXPORT_TOP_LEVEL\"\n                  }\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  9994\n                ],\n                [\n                  9995,\n                  9999\n                ],\n                [\n                  10000,\n                  10000\n                ]\n              ],\n              \"reserved\": [\n                [\n                  999,\n                  999\n                ]\n              ],\n              \"nested\": {\n                \"FieldPresence\": {\n                  \"values\": {\n                    \"FIELD_PRESENCE_UNKNOWN\": 0,\n                    \"EXPLICIT\": 1,\n                    \"IMPLICIT\": 2,\n                    \"LEGACY_REQUIRED\": 3\n                  }\n                },\n                \"EnumType\": {\n                  \"values\": {\n                    \"ENUM_TYPE_UNKNOWN\": 0,\n                    \"OPEN\": 1,\n                    \"CLOSED\": 2\n                  }\n                },\n                \"RepeatedFieldEncoding\": {\n                  \"values\": {\n                    \"REPEATED_FIELD_ENCODING_UNKNOWN\": 0,\n                    \"PACKED\": 1,\n                    \"EXPANDED\": 2\n                  }\n                },\n                \"Utf8Validation\": {\n                  \"values\": {\n                    \"UTF8_VALIDATION_UNKNOWN\": 0,\n                    \"VERIFY\": 2,\n                    \"NONE\": 3\n                  }\n                },\n                \"MessageEncoding\": {\n                  \"values\": {\n                    \"MESSAGE_ENCODING_UNKNOWN\": 0,\n                    \"LENGTH_PREFIXED\": 1,\n                    \"DELIMITED\": 2\n                  }\n                },\n                \"JsonFormat\": {\n                  \"values\": {\n                    \"JSON_FORMAT_UNKNOWN\": 0,\n                    \"ALLOW\": 1,\n                    \"LEGACY_BEST_EFFORT\": 2\n                  }\n                },\n                \"EnforceNamingStyle\": {\n                  \"values\": {\n                    \"ENFORCE_NAMING_STYLE_UNKNOWN\": 0,\n                    \"STYLE2024\": 1,\n                    \"STYLE_LEGACY\": 2\n                  }\n                },\n                \"VisibilityFeature\": {\n                  \"fields\": {},\n                  \"reserved\": [\n                    [\n                      1,\n                      536870911\n                    ]\n                  ],\n                  \"nested\": {\n                    \"DefaultSymbolVisibility\": {\n                      \"values\": {\n                        \"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN\": 0,\n                        \"EXPORT_ALL\": 1,\n                        \"EXPORT_TOP_LEVEL\": 2,\n                        \"LOCAL_ALL\": 3,\n                        \"STRICT\": 4\n                      }\n                    }\n                  }\n                }\n              }\n            },\n            \"FeatureSetDefaults\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"defaults\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FeatureSetEditionDefault\",\n                  \"id\": 1\n                },\n                \"minimumEdition\": {\n                  \"type\": \"Edition\",\n                  \"id\": 4\n                },\n                \"maximumEdition\": {\n                  \"type\": \"Edition\",\n                  \"id\": 5\n                }\n              },\n              \"nested\": {\n                \"FeatureSetEditionDefault\": {\n                  \"fields\": {\n                    \"edition\": {\n                      \"type\": \"Edition\",\n                      \"id\": 3\n                    },\n                    \"overridableFeatures\": {\n                      \"type\": \"FeatureSet\",\n                      \"id\": 4\n                    },\n                    \"fixedFeatures\": {\n                      \"type\": \"FeatureSet\",\n                      \"id\": 5\n                    }\n                  },\n                  \"reserved\": [\n                    [\n                      1,\n                      1\n                    ],\n                    [\n                      2,\n                      2\n                    ],\n                    \"features\"\n                  ]\n                }\n              }\n            },\n            \"SourceCodeInfo\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"location\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Location\",\n                  \"id\": 1\n                }\n              },\n              \"extensions\": [\n                [\n                  536000000,\n                  536000000\n                ]\n              ],\n              \"nested\": {\n                \"Location\": {\n                  \"fields\": {\n                    \"path\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"int32\",\n                      \"id\": 1,\n                      \"options\": {\n                        \"packed\": true\n                      }\n                    },\n                    \"span\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"int32\",\n                      \"id\": 2,\n                      \"options\": {\n                        \"packed\": true\n                      }\n                    },\n                    \"leadingComments\": {\n                      \"type\": \"string\",\n                      \"id\": 3\n                    },\n                    \"trailingComments\": {\n                      \"type\": \"string\",\n                      \"id\": 4\n                    },\n                    \"leadingDetachedComments\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"string\",\n                      \"id\": 6\n                    }\n                  }\n                }\n              }\n            },\n            \"GeneratedCodeInfo\": {\n              \"edition\": \"proto2\",\n              \"fields\": {\n                \"annotation\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Annotation\",\n                  \"id\": 1\n                }\n              },\n              \"nested\": {\n                \"Annotation\": {\n                  \"fields\": {\n                    \"path\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"int32\",\n                      \"id\": 1,\n                      \"options\": {\n                        \"packed\": true\n                      }\n                    },\n                    \"sourceFile\": {\n                      \"type\": \"string\",\n                      \"id\": 2\n                    },\n                    \"begin\": {\n                      \"type\": \"int32\",\n                      \"id\": 3\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 4\n                    },\n                    \"semantic\": {\n                      \"type\": \"Semantic\",\n                      \"id\": 5\n                    }\n                  },\n                  \"nested\": {\n                    \"Semantic\": {\n                      \"values\": {\n                        \"NONE\": 0,\n                        \"SET\": 1,\n                        \"ALIAS\": 2\n                      }\n                    }\n                  }\n                }\n              }\n            },\n            \"SymbolVisibility\": {\n              \"edition\": \"proto2\",\n              \"values\": {\n                \"VISIBILITY_UNSET\": 0,\n                \"VISIBILITY_LOCAL\": 1,\n                \"VISIBILITY_EXPORT\": 2\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "google/protobuf/descriptor.proto",
    "content": "syntax = \"proto2\";\n\npackage google.protobuf;\n\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"DescriptorProtos\";\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption objc_class_prefix = \"GPB\";\noption cc_enable_arenas = true;\noption optimize_for = \"SPEED\";\n\nmessage FileDescriptorSet {\n\n    repeated FileDescriptorProto file = 1;\n\n    extensions 536000000;\n}\n\nenum Edition {\n\n    EDITION_UNKNOWN = 0;\n    EDITION_LEGACY = 900;\n    EDITION_PROTO2 = 998;\n    EDITION_PROTO3 = 999;\n    EDITION_2023 = 1000;\n    EDITION_2024 = 1001;\n    EDITION_1_TEST_ONLY = 1;\n    EDITION_2_TEST_ONLY = 2;\n    EDITION_99997_TEST_ONLY = 99997;\n    EDITION_99998_TEST_ONLY = 99998;\n    EDITION_99999_TEST_ONLY = 99999;\n    EDITION_MAX = 2147483647;\n}\n\nmessage FileDescriptorProto {\n\n    optional string name = 1;\n    optional string package = 2;\n    repeated string dependency = 3;\n    repeated int32 public_dependency = 10;\n    repeated int32 weak_dependency = 11;\n    repeated string option_dependency = 15;\n    repeated DescriptorProto message_type = 4;\n    repeated EnumDescriptorProto enum_type = 5;\n    repeated ServiceDescriptorProto service = 6;\n    repeated FieldDescriptorProto extension = 7;\n    optional FileOptions options = 8;\n    optional SourceCodeInfo source_code_info = 9;\n    optional string syntax = 12;\n    optional Edition edition = 14;\n}\n\nmessage DescriptorProto {\n\n    optional string name = 1;\n    repeated FieldDescriptorProto field = 2;\n    repeated FieldDescriptorProto extension = 6;\n    repeated DescriptorProto nested_type = 3;\n    repeated EnumDescriptorProto enum_type = 4;\n    repeated ExtensionRange extension_range = 5;\n    repeated OneofDescriptorProto oneof_decl = 8;\n    optional MessageOptions options = 7;\n    repeated ReservedRange reserved_range = 9;\n    repeated string reserved_name = 10;\n    optional SymbolVisibility visibility = 11;\n\n    message ExtensionRange {\n\n        optional int32 start = 1;\n        optional int32 end = 2;\n        optional ExtensionRangeOptions options = 3;\n    }\n\n    message ReservedRange {\n\n        optional int32 start = 1;\n        optional int32 end = 2;\n    }\n}\n\nmessage ExtensionRangeOptions {\n\n    repeated UninterpretedOption uninterpreted_option = 999;\n    repeated Declaration declaration = 2 [retention=\"RETENTION_SOURCE\"];\n    optional FeatureSet features = 50;\n    optional VerificationState verification = 3 [default=UNVERIFIED, retention=\"RETENTION_SOURCE\"];\n\n    message Declaration {\n\n        optional int32 number = 1;\n        optional string full_name = 2;\n        optional string type = 3;\n        optional bool reserved = 5;\n        optional bool repeated = 6;\n\n        reserved 4;\n    }\n\n    enum VerificationState {\n\n        DECLARATION = 0;\n        UNVERIFIED = 1;\n    }\n\n    extensions 1000 to max;\n}\n\nmessage FieldDescriptorProto {\n\n    optional string name = 1;\n    optional int32 number = 3;\n    optional Label label = 4;\n    optional Type type = 5;\n    optional string type_name = 6;\n    optional string extendee = 2;\n    optional string default_value = 7;\n    optional int32 oneof_index = 9;\n    optional string json_name = 10;\n    optional FieldOptions options = 8;\n    optional bool proto3_optional = 17;\n\n    enum Type {\n\n        TYPE_DOUBLE = 1;\n        TYPE_FLOAT = 2;\n        TYPE_INT64 = 3;\n        TYPE_UINT64 = 4;\n        TYPE_INT32 = 5;\n        TYPE_FIXED64 = 6;\n        TYPE_FIXED32 = 7;\n        TYPE_BOOL = 8;\n        TYPE_STRING = 9;\n        TYPE_GROUP = 10;\n        TYPE_MESSAGE = 11;\n        TYPE_BYTES = 12;\n        TYPE_UINT32 = 13;\n        TYPE_ENUM = 14;\n        TYPE_SFIXED32 = 15;\n        TYPE_SFIXED64 = 16;\n        TYPE_SINT32 = 17;\n        TYPE_SINT64 = 18;\n    }\n\n    enum Label {\n\n        LABEL_OPTIONAL = 1;\n        LABEL_REPEATED = 3;\n        LABEL_REQUIRED = 2;\n    }\n}\n\nmessage OneofDescriptorProto {\n\n    optional string name = 1;\n    optional OneofOptions options = 2;\n}\n\nmessage EnumDescriptorProto {\n\n    optional string name = 1;\n    repeated EnumValueDescriptorProto value = 2;\n    optional EnumOptions options = 3;\n    repeated EnumReservedRange reserved_range = 4;\n    repeated string reserved_name = 5;\n    optional SymbolVisibility visibility = 6;\n\n    message EnumReservedRange {\n\n        optional int32 start = 1;\n        optional int32 end = 2;\n    }\n}\n\nmessage EnumValueDescriptorProto {\n\n    optional string name = 1;\n    optional int32 number = 2;\n    optional EnumValueOptions options = 3;\n}\n\nmessage ServiceDescriptorProto {\n\n    optional string name = 1;\n    repeated MethodDescriptorProto method = 2;\n    optional ServiceOptions options = 3;\n}\n\nmessage MethodDescriptorProto {\n\n    optional string name = 1;\n    optional string input_type = 2;\n    optional string output_type = 3;\n    optional MethodOptions options = 4;\n    optional bool client_streaming = 5;\n    optional bool server_streaming = 6;\n}\n\nmessage FileOptions {\n\n    optional string java_package = 1;\n    optional string java_outer_classname = 8;\n    optional bool java_multiple_files = 10;\n    optional bool java_generate_equals_and_hash = 20 [deprecated=true];\n    optional bool java_string_check_utf8 = 27;\n    optional OptimizeMode optimize_for = 9 [default=SPEED];\n    optional string go_package = 11;\n    optional bool cc_generic_services = 16;\n    optional bool java_generic_services = 17;\n    optional bool py_generic_services = 18;\n    optional bool deprecated = 23;\n    optional bool cc_enable_arenas = 31 [default=true];\n    optional string objc_class_prefix = 36;\n    optional string csharp_namespace = 37;\n    optional string swift_prefix = 39;\n    optional string php_class_prefix = 40;\n    optional string php_namespace = 41;\n    optional string php_metadata_namespace = 44;\n    optional string ruby_package = 45;\n    optional FeatureSet features = 50;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    enum OptimizeMode {\n\n        SPEED = 1;\n        CODE_SIZE = 2;\n        LITE_RUNTIME = 3;\n    }\n\n    extensions 1000 to max;\n\n    reserved 42, 38;\n    reserved \"php_generic_services\";\n}\n\nmessage MessageOptions {\n\n    optional bool message_set_wire_format = 1;\n    optional bool no_standard_descriptor_accessor = 2;\n    optional bool deprecated = 3;\n    optional bool map_entry = 7;\n    optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated=true];\n    optional FeatureSet features = 12;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    extensions 1000 to max;\n\n    reserved 4, 5, 6, 8, 9;\n}\n\nmessage FieldOptions {\n\n    optional CType ctype = 1 [default=STRING];\n    optional bool packed = 2;\n    optional JSType jstype = 6 [default=JS_NORMAL];\n    optional bool lazy = 5;\n    optional bool unverified_lazy = 15;\n    optional bool deprecated = 3;\n    optional bool weak = 10 [deprecated=true];\n    optional bool debug_redact = 16;\n    optional OptionRetention retention = 17;\n    repeated OptionTargetType targets = 19;\n    repeated EditionDefault edition_defaults = 20;\n    optional FeatureSet features = 21;\n    optional FeatureSupport feature_support = 22;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    enum CType {\n\n        STRING = 0;\n        CORD = 1;\n        STRING_PIECE = 2;\n    }\n\n    enum JSType {\n\n        JS_NORMAL = 0;\n        JS_STRING = 1;\n        JS_NUMBER = 2;\n    }\n\n    enum OptionRetention {\n\n        RETENTION_UNKNOWN = 0;\n        RETENTION_RUNTIME = 1;\n        RETENTION_SOURCE = 2;\n    }\n\n    enum OptionTargetType {\n\n        TARGET_TYPE_UNKNOWN = 0;\n        TARGET_TYPE_FILE = 1;\n        TARGET_TYPE_EXTENSION_RANGE = 2;\n        TARGET_TYPE_MESSAGE = 3;\n        TARGET_TYPE_FIELD = 4;\n        TARGET_TYPE_ONEOF = 5;\n        TARGET_TYPE_ENUM = 6;\n        TARGET_TYPE_ENUM_ENTRY = 7;\n        TARGET_TYPE_SERVICE = 8;\n        TARGET_TYPE_METHOD = 9;\n    }\n\n    message EditionDefault {\n\n        optional Edition edition = 3;\n        optional string value = 2;\n    }\n\n    message FeatureSupport {\n\n        optional Edition edition_introduced = 1;\n        optional Edition edition_deprecated = 2;\n        optional string deprecation_warning = 3;\n        optional Edition edition_removed = 4;\n    }\n\n    extensions 1000 to max;\n\n    reserved 4, 18;\n}\n\nmessage OneofOptions {\n\n    optional FeatureSet features = 1;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    extensions 1000 to max;\n}\n\nmessage EnumOptions {\n\n    optional bool allow_alias = 2;\n    optional bool deprecated = 3;\n    optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated=true];\n    optional FeatureSet features = 7;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    extensions 1000 to max;\n\n    reserved 5;\n}\n\nmessage EnumValueOptions {\n\n    optional bool deprecated = 1;\n    optional FeatureSet features = 2;\n    optional bool debug_redact = 3;\n    optional FieldOptions.FeatureSupport feature_support = 4;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    extensions 1000 to max;\n}\n\nmessage ServiceOptions {\n\n    optional FeatureSet features = 34;\n    optional bool deprecated = 33;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    extensions 1000 to max;\n}\n\nmessage MethodOptions {\n\n    optional bool deprecated = 33;\n    optional IdempotencyLevel idempotency_level = 34 [default=IDEMPOTENCY_UNKNOWN];\n    optional FeatureSet features = 35;\n    repeated UninterpretedOption uninterpreted_option = 999;\n\n    enum IdempotencyLevel {\n\n        IDEMPOTENCY_UNKNOWN = 0;\n        NO_SIDE_EFFECTS = 1;\n        IDEMPOTENT = 2;\n    }\n\n    extensions 1000 to max;\n}\n\nmessage UninterpretedOption {\n\n    repeated NamePart name = 2;\n    optional string identifier_value = 3;\n    optional uint64 positive_int_value = 4;\n    optional int64 negative_int_value = 5;\n    optional double double_value = 6;\n    optional bytes string_value = 7;\n    optional string aggregate_value = 8;\n\n    message NamePart {\n\n        required string name_part = 1;\n        required bool is_extension = 2;\n    }\n}\n\nmessage FeatureSet {\n\n    optional FieldPresence field_presence = 1 [retention=\"RETENTION_RUNTIME\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2023\", edition_defaults.edition=\"EDITION_2023\", edition_defaults.value=\"EXPLICIT\"];\n    optional EnumType enum_type = 2 [retention=\"RETENTION_RUNTIME\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2023\", edition_defaults.edition=\"EDITION_PROTO3\", edition_defaults.value=\"OPEN\"];\n    optional RepeatedFieldEncoding repeated_field_encoding = 3 [retention=\"RETENTION_RUNTIME\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2023\", edition_defaults.edition=\"EDITION_PROTO3\", edition_defaults.value=\"PACKED\"];\n    optional Utf8Validation utf8_validation = 4 [retention=\"RETENTION_RUNTIME\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2023\", edition_defaults.edition=\"EDITION_PROTO3\", edition_defaults.value=\"VERIFY\"];\n    optional MessageEncoding message_encoding = 5 [retention=\"RETENTION_RUNTIME\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2023\", edition_defaults.edition=\"EDITION_LEGACY\", edition_defaults.value=\"LENGTH_PREFIXED\"];\n    optional JsonFormat json_format = 6 [retention=\"RETENTION_RUNTIME\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2023\", edition_defaults.edition=\"EDITION_PROTO3\", edition_defaults.value=\"ALLOW\"];\n    optional EnforceNamingStyle enforce_naming_style = 7 [retention=\"RETENTION_SOURCE\", targets=\"TARGET_TYPE_METHOD\", feature_support.edition_introduced=\"EDITION_2024\", edition_defaults.edition=\"EDITION_2024\", edition_defaults.value=\"STYLE2024\"];\n    optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility = 8 [retention=\"RETENTION_SOURCE\", targets=\"TARGET_TYPE_FILE\", feature_support.edition_introduced=\"EDITION_2024\", edition_defaults.edition=\"EDITION_2024\", edition_defaults.value=\"EXPORT_TOP_LEVEL\"];\n\n    enum FieldPresence {\n\n        FIELD_PRESENCE_UNKNOWN = 0;\n        EXPLICIT = 1;\n        IMPLICIT = 2;\n        LEGACY_REQUIRED = 3;\n    }\n\n    enum EnumType {\n\n        ENUM_TYPE_UNKNOWN = 0;\n        OPEN = 1;\n        CLOSED = 2;\n    }\n\n    enum RepeatedFieldEncoding {\n\n        REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n        PACKED = 1;\n        EXPANDED = 2;\n    }\n\n    enum Utf8Validation {\n\n        UTF8_VALIDATION_UNKNOWN = 0;\n        VERIFY = 2;\n        NONE = 3;\n    }\n\n    enum MessageEncoding {\n\n        MESSAGE_ENCODING_UNKNOWN = 0;\n        LENGTH_PREFIXED = 1;\n        DELIMITED = 2;\n    }\n\n    enum JsonFormat {\n\n        JSON_FORMAT_UNKNOWN = 0;\n        ALLOW = 1;\n        LEGACY_BEST_EFFORT = 2;\n    }\n\n    enum EnforceNamingStyle {\n\n        ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n        STYLE2024 = 1;\n        STYLE_LEGACY = 2;\n    }\n\n    message VisibilityFeature {\n\n        enum DefaultSymbolVisibility {\n\n            DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n            EXPORT_ALL = 1;\n            EXPORT_TOP_LEVEL = 2;\n            LOCAL_ALL = 3;\n            STRICT = 4;\n        }\n\n        reserved 1 to max;\n    }\n\n    extensions 1000 to 9994, 9995 to 9999, 10000;\n\n    reserved 999;\n}\n\nmessage FeatureSetDefaults {\n\n    repeated FeatureSetEditionDefault defaults = 1;\n    optional Edition minimum_edition = 4;\n    optional Edition maximum_edition = 5;\n\n    message FeatureSetEditionDefault {\n\n        optional Edition edition = 3;\n        optional FeatureSet overridable_features = 4;\n        optional FeatureSet fixed_features = 5;\n\n        reserved 1, 2, \"features\";\n    }\n}\n\nmessage SourceCodeInfo {\n\n    repeated Location location = 1;\n\n    message Location {\n\n        repeated int32 path = 1 [packed=true];\n        repeated int32 span = 2 [packed=true];\n        optional string leading_comments = 3;\n        optional string trailing_comments = 4;\n        repeated string leading_detached_comments = 6;\n    }\n\n    extensions 536000000;\n}\n\nmessage GeneratedCodeInfo {\n\n    repeated Annotation annotation = 1;\n\n    message Annotation {\n\n        repeated int32 path = 1 [packed=true];\n        optional string source_file = 2;\n        optional int32 begin = 3;\n        optional int32 end = 4;\n        optional Semantic semantic = 5;\n\n        enum Semantic {\n\n            NONE = 0;\n            SET = 1;\n            ALIAS = 2;\n        }\n    }\n}\n\nenum SymbolVisibility {\n\n    VISIBILITY_UNSET = 0;\n    VISIBILITY_LOCAL = 1;\n    VISIBILITY_EXPORT = 2;\n}"
  },
  {
    "path": "google/protobuf/source_context.json",
    "content": "{\n  \"nested\": {\n    \"google\": {\n      \"nested\": {\n        \"protobuf\": {\n          \"nested\": {\n            \"SourceContext\": {\n              \"fields\": {\n                \"fileName\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "google/protobuf/source_context.proto",
    "content": "syntax = \"proto3\";\n\npackage google.protobuf;\n\nmessage SourceContext {\n    string file_name = 1;\n}\n"
  },
  {
    "path": "google/protobuf/type.json",
    "content": "{\n  \"nested\": {\n    \"google\": {\n      \"nested\": {\n        \"protobuf\": {\n          \"nested\": {\n            \"Type\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"fields\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Field\",\n                  \"id\": 2\n                },\n                \"oneofs\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"options\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Option\",\n                  \"id\": 4\n                },\n                \"sourceContext\": {\n                  \"type\": \"SourceContext\",\n                  \"id\": 5\n                },\n                \"syntax\": {\n                  \"type\": \"Syntax\",\n                  \"id\": 6\n                }\n              }\n            },\n            \"Field\": {\n              \"fields\": {\n                \"kind\": {\n                  \"type\": \"Kind\",\n                  \"id\": 1\n                },\n                \"cardinality\": {\n                  \"type\": \"Cardinality\",\n                  \"id\": 2\n                },\n                \"number\": {\n                  \"type\": \"int32\",\n                  \"id\": 3\n                },\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 4\n                },\n                \"typeUrl\": {\n                  \"type\": \"string\",\n                  \"id\": 6\n                },\n                \"oneofIndex\": {\n                  \"type\": \"int32\",\n                  \"id\": 7\n                },\n                \"packed\": {\n                  \"type\": \"bool\",\n                  \"id\": 8\n                },\n                \"options\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Option\",\n                  \"id\": 9\n                },\n                \"jsonName\": {\n                  \"type\": \"string\",\n                  \"id\": 10\n                },\n                \"defaultValue\": {\n                  \"type\": \"string\",\n                  \"id\": 11\n                }\n              },\n              \"nested\": {\n                \"Kind\": {\n                  \"values\": {\n                    \"TYPE_UNKNOWN\": 0,\n                    \"TYPE_DOUBLE\": 1,\n                    \"TYPE_FLOAT\": 2,\n                    \"TYPE_INT64\": 3,\n                    \"TYPE_UINT64\": 4,\n                    \"TYPE_INT32\": 5,\n                    \"TYPE_FIXED64\": 6,\n                    \"TYPE_FIXED32\": 7,\n                    \"TYPE_BOOL\": 8,\n                    \"TYPE_STRING\": 9,\n                    \"TYPE_GROUP\": 10,\n                    \"TYPE_MESSAGE\": 11,\n                    \"TYPE_BYTES\": 12,\n                    \"TYPE_UINT32\": 13,\n                    \"TYPE_ENUM\": 14,\n                    \"TYPE_SFIXED32\": 15,\n                    \"TYPE_SFIXED64\": 16,\n                    \"TYPE_SINT32\": 17,\n                    \"TYPE_SINT64\": 18\n                  }\n                },\n                \"Cardinality\": {\n                  \"values\": {\n                    \"CARDINALITY_UNKNOWN\": 0,\n                    \"CARDINALITY_OPTIONAL\": 1,\n                    \"CARDINALITY_REQUIRED\": 2,\n                    \"CARDINALITY_REPEATED\": 3\n                  }\n                }\n              }\n            },\n            \"Enum\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"enumvalue\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumValue\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Option\",\n                  \"id\": 3\n                },\n                \"sourceContext\": {\n                  \"type\": \"SourceContext\",\n                  \"id\": 4\n                },\n                \"syntax\": {\n                  \"type\": \"Syntax\",\n                  \"id\": 5\n                }\n              }\n            },\n            \"EnumValue\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"number\": {\n                  \"type\": \"int32\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Option\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"Option\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"value\": {\n                  \"type\": \"Any\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"Syntax\": {\n              \"values\": {\n                \"SYNTAX_PROTO2\": 0,\n                \"SYNTAX_PROTO3\": 1\n              }\n            },\n            \"Any\": {\n              \"fields\": {\n                \"type_url\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"value\": {\n                  \"type\": \"bytes\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"SourceContext\": {\n              \"fields\": {\n                \"fileName\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "google/protobuf/type.proto",
    "content": "syntax = \"proto3\";\n\npackage google.protobuf;\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/source_context.proto\";\n\nmessage Type {\n\n    string name = 1;\n    repeated Field fields = 2;\n    repeated string oneofs = 3;\n    repeated Option options = 4;\n    SourceContext source_context = 5;\n    Syntax syntax = 6;\n}\n\nmessage Field {\n\n    Kind kind = 1;\n    Cardinality cardinality = 2;\n    int32 number = 3;\n    string name = 4;\n    string type_url = 6;\n    int32 oneof_index = 7;\n    bool packed = 8;\n    repeated Option options = 9;\n    string json_name = 10;\n    string default_value = 11;\n\n    enum Kind {\n\n        TYPE_UNKNOWN = 0;\n        TYPE_DOUBLE = 1;\n        TYPE_FLOAT = 2;\n        TYPE_INT64 = 3;\n        TYPE_UINT64 = 4;\n        TYPE_INT32 = 5;\n        TYPE_FIXED64 = 6;\n        TYPE_FIXED32 = 7;\n        TYPE_BOOL = 8;\n        TYPE_STRING = 9;\n        TYPE_GROUP = 10;\n        TYPE_MESSAGE = 11;\n        TYPE_BYTES = 12;\n        TYPE_UINT32 = 13;\n        TYPE_ENUM = 14;\n        TYPE_SFIXED32 = 15;\n        TYPE_SFIXED64 = 16;\n        TYPE_SINT32 = 17;\n        TYPE_SINT64 = 18;\n    }\n\n    enum Cardinality {\n\n        CARDINALITY_UNKNOWN = 0;\n        CARDINALITY_OPTIONAL = 1;\n        CARDINALITY_REQUIRED = 2;\n        CARDINALITY_REPEATED = 3;\n    }\n}\n\nmessage Enum {\n\n    string name = 1;\n    repeated EnumValue enumvalue = 2;\n    repeated Option options = 3;\n    SourceContext source_context = 4;\n    Syntax syntax = 5;\n}\n\nmessage EnumValue {\n\n    string name = 1;\n    int32 number = 2;\n    repeated Option options = 3;\n}\n\nmessage Option {\n\n    string name = 1;\n    Any value = 2;\n}\n\nenum Syntax {\n\n    SYNTAX_PROTO2 = 0;\n    SYNTAX_PROTO3 = 1;\n}\n"
  },
  {
    "path": "index.d.ts",
    "content": "// DO NOT EDIT! This is a generated file. Edit the JSDoc in src/*.js instead and run 'npm run build:types'.\n\nexport as namespace protobuf;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param name Short name as in `google/protobuf/[name].proto` or full file name\n * @param json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n */\nexport function common(name: string, json: { [k: string]: any }): void;\n\nexport namespace common {\n\n    /** Properties of a google.protobuf.Any message. */\n    interface IAny {\n        typeUrl?: string;\n        bytes?: Uint8Array;\n    }\n\n    /** Properties of a google.protobuf.Duration message. */\n    interface IDuration {\n        seconds?: (number|Long);\n        nanos?: number;\n    }\n\n    /** Properties of a google.protobuf.Timestamp message. */\n    interface ITimestamp {\n        seconds?: (number|Long);\n        nanos?: number;\n    }\n\n    /** Properties of a google.protobuf.Empty message. */\n    interface IEmpty {\n    }\n\n    /** Properties of a google.protobuf.Struct message. */\n    interface IStruct {\n        fields?: { [k: string]: IValue };\n    }\n\n    /** Properties of a google.protobuf.Value message. */\n    interface IValue {\n        kind?: string;\n        nullValue?: 0;\n        numberValue?: number;\n        stringValue?: string;\n        boolValue?: boolean;\n        structValue?: IStruct;\n        listValue?: IListValue;\n    }\n\n    /** Properties of a google.protobuf.ListValue message. */\n    interface IListValue {\n        values?: IValue[];\n    }\n\n    /** Properties of a google.protobuf.DoubleValue message. */\n    interface IDoubleValue {\n        value?: number;\n    }\n\n    /** Properties of a google.protobuf.FloatValue message. */\n    interface IFloatValue {\n        value?: number;\n    }\n\n    /** Properties of a google.protobuf.Int64Value message. */\n    interface IInt64Value {\n        value?: (number|Long);\n    }\n\n    /** Properties of a google.protobuf.UInt64Value message. */\n    interface IUInt64Value {\n        value?: (number|Long);\n    }\n\n    /** Properties of a google.protobuf.Int32Value message. */\n    interface IInt32Value {\n        value?: number;\n    }\n\n    /** Properties of a google.protobuf.UInt32Value message. */\n    interface IUInt32Value {\n        value?: number;\n    }\n\n    /** Properties of a google.protobuf.BoolValue message. */\n    interface IBoolValue {\n        value?: boolean;\n    }\n\n    /** Properties of a google.protobuf.StringValue message. */\n    interface IStringValue {\n        value?: string;\n    }\n\n    /** Properties of a google.protobuf.BytesValue message. */\n    interface IBytesValue {\n        value?: Uint8Array;\n    }\n\n    /**\n     * Gets the root definition of the specified common proto file.\n     *\n     * Bundled definitions are:\n     * - google/protobuf/any.proto\n     * - google/protobuf/duration.proto\n     * - google/protobuf/empty.proto\n     * - google/protobuf/field_mask.proto\n     * - google/protobuf/struct.proto\n     * - google/protobuf/timestamp.proto\n     * - google/protobuf/wrappers.proto\n     *\n     * @param file Proto file name\n     * @returns Root definition or `null` if not defined\n     */\n    function get(file: string): (INamespace|null);\n}\n\n/** Runtime message from/to plain object converters. */\nexport namespace converter {\n\n    /**\n     * Generates a plain object to runtime message converter specific to the specified message type.\n     * @param mtype Message type\n     * @returns Codegen instance\n     */\n    function fromObject(mtype: Type): Codegen;\n\n    /**\n     * Generates a runtime message to plain object converter specific to the specified message type.\n     * @param mtype Message type\n     * @returns Codegen instance\n     */\n    function toObject(mtype: Type): Codegen;\n}\n\n/**\n * Generates a decoder specific to the specified message type.\n * @param mtype Message type\n * @returns Codegen instance\n */\nexport function decoder(mtype: Type): Codegen;\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param mtype Message type\n * @returns Codegen instance\n */\nexport function encoder(mtype: Type): Codegen;\n\n/** Reflected enum. */\nexport class Enum extends ReflectionObject {\n\n    /**\n     * Constructs a new enum instance.\n     * @param name Unique name within its namespace\n     * @param [values] Enum values as an object, by name\n     * @param [options] Declared options\n     * @param [comment] The comment for this enum\n     * @param [comments] The value comments for this enum\n     * @param [valuesOptions] The value options for this enum\n     */\n    constructor(name: string, values?: { [k: string]: number }, options?: { [k: string]: any }, comment?: string, comments?: { [k: string]: string }, valuesOptions?: ({ [k: string]: { [k: string]: any } }|undefined));\n\n    /** Enum values by id. */\n    public valuesById: { [k: number]: string };\n\n    /** Enum values by name. */\n    public values: { [k: string]: number };\n\n    /** Enum comment text. */\n    public comment: (string|null);\n\n    /** Value comment texts, if any. */\n    public comments: { [k: string]: string };\n\n    /** Values options, if any */\n    public valuesOptions?: { [k: string]: { [k: string]: any } };\n\n    /** Resolved values features, if any */\n    public _valuesFeatures?: { [k: string]: { [k: string]: any } };\n\n    /** Reserved ranges, if any. */\n    public reserved: (number[]|string)[];\n\n    /**\n     * Constructs an enum from an enum descriptor.\n     * @param name Enum name\n     * @param json Enum descriptor\n     * @returns Created enum\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: IEnum): Enum;\n\n    /**\n     * Converts this enum to an enum descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Enum descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IEnum;\n\n    /**\n     * Adds a value to this enum.\n     * @param name Value name\n     * @param id Value id\n     * @param [comment] Comment, if any\n     * @param {Object.<string, *>|undefined} [options] Options, if any\n     * @returns `this`\n     * @throws {TypeError} If arguments are invalid\n     * @throws {Error} If there is already a value with this name or id\n     */\n    public add(name: string, id: number, comment?: string, options?: ({ [k: string]: any }|undefined)): Enum;\n\n    /**\n     * Removes a value from this enum\n     * @param name Value name\n     * @returns `this`\n     * @throws {TypeError} If arguments are invalid\n     * @throws {Error} If `name` is not a name of this enum\n     */\n    public remove(name: string): Enum;\n\n    /**\n     * Tests if the specified id is reserved.\n     * @param id Id to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    public isReservedId(id: number): boolean;\n\n    /**\n     * Tests if the specified name is reserved.\n     * @param name Name to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    public isReservedName(name: string): boolean;\n}\n\n/** Enum descriptor. */\nexport interface IEnum {\n\n    /** Enum values */\n    values: { [k: string]: number };\n\n    /** Enum options */\n    options?: { [k: string]: any };\n}\n\n/** Reflected message field. */\nexport class Field extends FieldBase {\n\n    /**\n     * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n     * @param name Unique name within its namespace\n     * @param id Unique id within its namespace\n     * @param type Value type\n     * @param [rule=\"optional\"] Field rule\n     * @param [extend] Extended type if different from parent\n     * @param [options] Declared options\n     */\n    constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any });\n\n    /**\n     * Constructs a field from a field descriptor.\n     * @param name Field name\n     * @param json Field descriptor\n     * @returns Created field\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: IField): Field;\n\n    /** Determines whether this field is required. */\n    public readonly required: boolean;\n\n    /** Determines whether this field is not required. */\n    public readonly optional: boolean;\n\n    /**\n     * Determines whether this field uses tag-delimited encoding.  In proto2 this\n     * corresponded to group syntax.\n     */\n    public readonly delimited: boolean;\n\n    /** Determines whether this field is packed. Only relevant when repeated. */\n    public readonly packed: boolean;\n\n    /** Determines whether this field tracks presence. */\n    public readonly hasPresence: boolean;\n\n    /**\n     * Field decorator (TypeScript).\n     * @param fieldId Field id\n     * @param fieldType Field type\n     * @param [fieldRule=\"optional\"] Field rule\n     * @param [defaultValue] Default value\n     * @returns Decorator function\n     */\n    public static d<T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]>(fieldId: number, fieldType: (\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|object), fieldRule?: (\"optional\"|\"required\"|\"repeated\"), defaultValue?: T): FieldDecorator;\n\n    /**\n     * Field decorator (TypeScript).\n     * @param fieldId Field id\n     * @param fieldType Field type\n     * @param [fieldRule=\"optional\"] Field rule\n     * @returns Decorator function\n     */\n    public static d<T extends Message<T>>(fieldId: number, fieldType: (Constructor<T>|string), fieldRule?: (\"optional\"|\"required\"|\"repeated\")): FieldDecorator;\n}\n\n/** Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions. */\nexport class FieldBase extends ReflectionObject {\n\n    /**\n     * Not an actual constructor. Use {@link Field} instead.\n     * @param name Unique name within its namespace\n     * @param id Unique id within its namespace\n     * @param type Value type\n     * @param [rule=\"optional\"] Field rule\n     * @param [extend] Extended type if different from parent\n     * @param [options] Declared options\n     * @param [comment] Comment associated with this field\n     */\n    constructor(name: string, id: number, type: string, rule?: (string|{ [k: string]: any }), extend?: (string|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string);\n\n    /** Field type. */\n    public type: string;\n\n    /** Unique field id. */\n    public id: number;\n\n    /** Extended type if different from parent. */\n    public extend?: string;\n\n    /** Whether this field is repeated. */\n    public repeated: boolean;\n\n    /** Whether this field is a map or not. */\n    public map: boolean;\n\n    /** Message this field belongs to. */\n    public message: (Type|null);\n\n    /** OneOf this field belongs to, if any, */\n    public partOf: (OneOf|null);\n\n    /** The field type's default value. */\n    public typeDefault: any;\n\n    /** The field's default value on prototypes. */\n    public defaultValue: any;\n\n    /** Whether this field's value should be treated as a long. */\n    public long: boolean;\n\n    /** Whether this field's value is a buffer. */\n    public bytes: boolean;\n\n    /** Resolved type if not a basic type. */\n    public resolvedType: (Type|Enum|null);\n\n    /** Sister-field within the extended type if a declaring extension field. */\n    public extensionField: (Field|null);\n\n    /** Sister-field within the declaring namespace if an extended field. */\n    public declaringField: (Field|null);\n\n    /** Comment for this field. */\n    public comment: (string|null);\n\n    /**\n     * Converts this field to a field descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Field descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IField;\n\n    /**\n     * Resolves this field's type references.\n     * @returns `this`\n     * @throws {Error} If any reference cannot be resolved\n     */\n    public resolve(): Field;\n\n    /**\n     * Infers field features from legacy syntax that may have been specified differently.\n     * in older editions.\n     * @param edition The edition this proto is on, or undefined if pre-editions\n     * @returns The feature values to override\n     */\n    public _inferLegacyProtoFeatures(edition: (string|undefined)): object;\n}\n\n/** Field descriptor. */\nexport interface IField {\n\n    /** Field rule */\n    rule?: string;\n\n    /** Field type */\n    type: string;\n\n    /** Field id */\n    id: number;\n\n    /** Field options */\n    options?: { [k: string]: any };\n}\n\n/** Extension field descriptor. */\nexport interface IExtensionField extends IField {\n\n    /** Extended type */\n    extend: string;\n}\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @param prototype Target prototype\n * @param fieldName Field name\n */\ntype FieldDecorator = (prototype: object, fieldName: string) => void;\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @param error Error, if any, otherwise `null`\n * @param [root] Root, if there hasn't been an error\n */\ntype LoadCallback = (error: (Error|null), root?: Root) => void;\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param filename One or multiple files to load\n * @param root Root namespace, defaults to create a new one if omitted.\n * @param callback Callback function\n * @see {@link Root#load}\n */\nexport function load(filename: (string|string[]), root: Root, callback: LoadCallback): void;\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param filename One or multiple files to load\n * @param callback Callback function\n * @see {@link Root#load}\n */\nexport function load(filename: (string|string[]), callback: LoadCallback): void;\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @param filename One or multiple files to load\n * @param [root] Root namespace, defaults to create a new one if omitted.\n * @returns Promise\n * @see {@link Root#load}\n */\nexport function load(filename: (string|string[]), root?: Root): Promise<Root>;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param filename One or multiple files to load\n * @param [root] Root namespace, defaults to create a new one if omitted.\n * @returns Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nexport function loadSync(filename: (string|string[]), root?: Root): Root;\n\n/** Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`. */\nexport const build: string;\n\n/** Reconfigures the library according to the environment. */\nexport function configure(): void;\n\n/** Reflected map field. */\nexport class MapField extends FieldBase {\n\n    /**\n     * Constructs a new map field instance.\n     * @param name Unique name within its namespace\n     * @param id Unique id within its namespace\n     * @param keyType Key type\n     * @param type Value type\n     * @param [options] Declared options\n     * @param [comment] Comment associated with this field\n     */\n    constructor(name: string, id: number, keyType: string, type: string, options?: { [k: string]: any }, comment?: string);\n\n    /** Key type. */\n    public keyType: string;\n\n    /** Resolved key type if not a basic type. */\n    public resolvedKeyType: (ReflectionObject|null);\n\n    /**\n     * Constructs a map field from a map field descriptor.\n     * @param name Field name\n     * @param json Map field descriptor\n     * @returns Created map field\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: IMapField): MapField;\n\n    /**\n     * Converts this map field to a map field descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Map field descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IMapField;\n\n    /**\n     * Map field decorator (TypeScript).\n     * @param fieldId Field id\n     * @param fieldKeyType Field key type\n     * @param fieldValueType Field value type\n     * @returns Decorator function\n     */\n    public static d<T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }>(fieldId: number, fieldKeyType: (\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"), fieldValueType: (\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|object|Constructor<{}>)): FieldDecorator;\n}\n\n/** Map field descriptor. */\nexport interface IMapField extends IField {\n\n    /** Key type */\n    keyType: string;\n}\n\n/** Extension map field descriptor. */\nexport interface IExtensionMapField extends IMapField {\n\n    /** Extended type */\n    extend: string;\n}\n\n/** Abstract runtime message. */\nexport class Message<T extends object = object> {\n\n    /**\n     * Constructs a new message instance.\n     * @param [properties] Properties to set\n     */\n    constructor(properties?: Properties<T>);\n\n    /** Reference to the reflected type. */\n    public static readonly $type: Type;\n\n    /** Reference to the reflected type. */\n    public readonly $type: Type;\n\n    /**\n     * Creates a new message of this type using the specified properties.\n     * @param [properties] Properties to set\n     * @returns Message instance\n     */\n    public static create<T extends Message<T>>(this: Constructor<T>, properties?: { [k: string]: any }): Message<T>;\n\n    /**\n     * Encodes a message of this type.\n     * @param message Message to encode\n     * @param [writer] Writer to use\n     * @returns Writer\n     */\n    public static encode<T extends Message<T>>(this: Constructor<T>, message: (T|{ [k: string]: any }), writer?: Writer): Writer;\n\n    /**\n     * Encodes a message of this type preceeded by its length as a varint.\n     * @param message Message to encode\n     * @param [writer] Writer to use\n     * @returns Writer\n     */\n    public static encodeDelimited<T extends Message<T>>(this: Constructor<T>, message: (T|{ [k: string]: any }), writer?: Writer): Writer;\n\n    /**\n     * Decodes a message of this type.\n     * @param reader Reader or buffer to decode\n     * @returns Decoded message\n     */\n    public static decode<T extends Message<T>>(this: Constructor<T>, reader: (Reader|Uint8Array)): T;\n\n    /**\n     * Decodes a message of this type preceeded by its length as a varint.\n     * @param reader Reader or buffer to decode\n     * @returns Decoded message\n     */\n    public static decodeDelimited<T extends Message<T>>(this: Constructor<T>, reader: (Reader|Uint8Array)): T;\n\n    /**\n     * Verifies a message of this type.\n     * @param message Plain object to verify\n     * @returns `null` if valid, otherwise the reason why it is not\n     */\n    public static verify(message: { [k: string]: any }): (string|null);\n\n    /**\n     * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n     * @param object Plain object\n     * @returns Message instance\n     */\n    public static fromObject<T extends Message<T>>(this: Constructor<T>, object: { [k: string]: any }): T;\n\n    /**\n     * Creates a plain object from a message of this type. Also converts values to other types if specified.\n     * @param message Message instance\n     * @param [options] Conversion options\n     * @returns Plain object\n     */\n    public static toObject<T extends Message<T>>(this: Constructor<T>, message: T, options?: IConversionOptions): { [k: string]: any };\n\n    /**\n     * Converts this message to JSON.\n     * @returns JSON object\n     */\n    public toJSON(): { [k: string]: any };\n}\n\n/** Reflected service method. */\nexport class Method extends ReflectionObject {\n\n    /**\n     * Constructs a new service method instance.\n     * @param name Method name\n     * @param type Method type, usually `\"rpc\"`\n     * @param requestType Request message type\n     * @param responseType Response message type\n     * @param [requestStream] Whether the request is streamed\n     * @param [responseStream] Whether the response is streamed\n     * @param [options] Declared options\n     * @param [comment] The comment for this method\n     * @param [parsedOptions] Declared options, properly parsed into an object\n     */\n    constructor(name: string, type: (string|undefined), requestType: string, responseType: string, requestStream?: (boolean|{ [k: string]: any }), responseStream?: (boolean|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string, parsedOptions?: { [k: string]: any });\n\n    /** Method type. */\n    public type: string;\n\n    /** Request type. */\n    public requestType: string;\n\n    /** Whether requests are streamed or not. */\n    public requestStream?: boolean;\n\n    /** Response type. */\n    public responseType: string;\n\n    /** Whether responses are streamed or not. */\n    public responseStream?: boolean;\n\n    /** Resolved request type. */\n    public resolvedRequestType: (Type|null);\n\n    /** Resolved response type. */\n    public resolvedResponseType: (Type|null);\n\n    /** Comment for this method */\n    public comment: (string|null);\n\n    /** Options properly parsed into an object */\n    public parsedOptions: any;\n\n    /**\n     * Constructs a method from a method descriptor.\n     * @param name Method name\n     * @param json Method descriptor\n     * @returns Created method\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: IMethod): Method;\n\n    /**\n     * Converts this method to a method descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Method descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IMethod;\n}\n\n/** Method descriptor. */\nexport interface IMethod {\n\n    /** Method type */\n    type?: string;\n\n    /** Request type */\n    requestType: string;\n\n    /** Response type */\n    responseType: string;\n\n    /** Whether requests are streamed */\n    requestStream?: boolean;\n\n    /** Whether responses are streamed */\n    responseStream?: boolean;\n\n    /** Method options */\n    options?: { [k: string]: any };\n\n    /** Method comments */\n    comment: string;\n\n    /** Method options properly parsed into an object */\n    parsedOptions?: { [k: string]: any };\n}\n\n/** Reflected namespace. */\nexport class Namespace extends NamespaceBase {\n\n    /**\n     * Constructs a new namespace instance.\n     * @param name Namespace name\n     * @param [options] Declared options\n     */\n    constructor(name: string, options?: { [k: string]: any });\n\n    /**\n     * Constructs a namespace from JSON.\n     * @param name Namespace name\n     * @param json JSON object\n     * @returns Created namespace\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: { [k: string]: any }): Namespace;\n\n    /**\n     * Converts an array of reflection objects to JSON.\n     * @param array Object array\n     * @param [toJSONOptions] JSON conversion options\n     * @returns JSON object or `undefined` when array is empty\n     */\n    public static arrayToJSON(array: ReflectionObject[], toJSONOptions?: IToJSONOptions): ({ [k: string]: any }|undefined);\n\n    /**\n     * Tests if the specified id is reserved.\n     * @param reserved Array of reserved ranges and names\n     * @param id Id to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    public static isReservedId(reserved: ((number[]|string)[]|undefined), id: number): boolean;\n\n    /**\n     * Tests if the specified name is reserved.\n     * @param reserved Array of reserved ranges and names\n     * @param name Name to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    public static isReservedName(reserved: ((number[]|string)[]|undefined), name: string): boolean;\n}\n\n/** Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions. */\nexport abstract class NamespaceBase extends ReflectionObject {\n\n    /** Nested objects by name. */\n    public nested?: { [k: string]: ReflectionObject };\n\n    /** Whether or not objects contained in this namespace need feature resolution. */\n    protected _needsRecursiveFeatureResolution: boolean;\n\n    /** Whether or not objects contained in this namespace need a resolve. */\n    protected _needsRecursiveResolve: boolean;\n\n    /** Nested objects of this namespace as an array for iteration. */\n    public readonly nestedArray: ReflectionObject[];\n\n    /**\n     * Converts this namespace to a namespace descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Namespace descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): INamespace;\n\n    /**\n     * Adds nested objects to this namespace from nested object descriptors.\n     * @param nestedJson Any nested object descriptors\n     * @returns `this`\n     */\n    public addJSON(nestedJson: { [k: string]: AnyNestedObject }): Namespace;\n\n    /**\n     * Gets the nested object of the specified name.\n     * @param name Nested object name\n     * @returns The reflection object or `null` if it doesn't exist\n     */\n    public get(name: string): (ReflectionObject|null);\n\n    /**\n     * Gets the values of the nested {@link Enum|enum} of the specified name.\n     * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n     * @param name Nested enum name\n     * @returns Enum values\n     * @throws {Error} If there is no such enum\n     */\n    public getEnum(name: string): { [k: string]: number };\n\n    /**\n     * Adds a nested object to this namespace.\n     * @param object Nested object to add\n     * @returns `this`\n     * @throws {TypeError} If arguments are invalid\n     * @throws {Error} If there is already a nested object with this name\n     */\n    public add(object: ReflectionObject): Namespace;\n\n    /**\n     * Removes a nested object from this namespace.\n     * @param object Nested object to remove\n     * @returns `this`\n     * @throws {TypeError} If arguments are invalid\n     * @throws {Error} If `object` is not a member of this namespace\n     */\n    public remove(object: ReflectionObject): Namespace;\n\n    /**\n     * Defines additial namespaces within this one if not yet existing.\n     * @param path Path to create\n     * @param [json] Nested types to create from JSON\n     * @returns Pointer to the last namespace created or `this` if path is empty\n     */\n    public define(path: (string|string[]), json?: any): Namespace;\n\n    /**\n     * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n     * @returns `this`\n     */\n    public resolveAll(): Namespace;\n\n    /**\n     * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n     * @param path Path to look up\n     * @param filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n     * @param [parentAlreadyChecked=false] If known, whether the parent has already been checked\n     * @returns Looked up object or `null` if none could be found\n     */\n    public lookup(path: (string|string[]), filterTypes: (any|any[]), parentAlreadyChecked?: boolean): (ReflectionObject|null);\n\n    /**\n     * Looks up the reflection object at the specified path, relative to this namespace.\n     * @param path Path to look up\n     * @param [parentAlreadyChecked=false] Whether the parent has already been checked\n     * @returns Looked up object or `null` if none could be found\n     */\n    public lookup(path: (string|string[]), parentAlreadyChecked?: boolean): (ReflectionObject|null);\n\n    /**\n     * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n     * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n     * @param path Path to look up\n     * @returns Looked up type\n     * @throws {Error} If `path` does not point to a type\n     */\n    public lookupType(path: (string|string[])): Type;\n\n    /**\n     * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n     * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n     * @param path Path to look up\n     * @returns Looked up enum\n     * @throws {Error} If `path` does not point to an enum\n     */\n    public lookupEnum(path: (string|string[])): Enum;\n\n    /**\n     * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n     * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n     * @param path Path to look up\n     * @returns Looked up type or enum\n     * @throws {Error} If `path` does not point to a type or enum\n     */\n    public lookupTypeOrEnum(path: (string|string[])): Type;\n\n    /**\n     * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n     * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n     * @param path Path to look up\n     * @returns Looked up service\n     * @throws {Error} If `path` does not point to a service\n     */\n    public lookupService(path: (string|string[])): Service;\n}\n\n/** Namespace descriptor. */\nexport interface INamespace {\n\n    /** Namespace options */\n    options?: { [k: string]: any };\n\n    /** Nested object descriptors */\n    nested?: { [k: string]: AnyNestedObject };\n}\n\n/** Any extension field descriptor. */\ntype AnyExtensionField = (IExtensionField|IExtensionMapField);\n\n/** Any nested object descriptor. */\ntype AnyNestedObject = (IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf);\n\n/** Base class of all reflection objects. */\nexport abstract class ReflectionObject {\n\n    /** Options. */\n    public options?: { [k: string]: any };\n\n    /** Parsed Options. */\n    public parsedOptions?: { [k: string]: any[] };\n\n    /** Unique name within its namespace. */\n    public name: string;\n\n    /** Parent namespace. */\n    public parent: (Namespace|null);\n\n    /** Whether already resolved or not. */\n    public resolved: boolean;\n\n    /** Comment text, if any. */\n    public comment: (string|null);\n\n    /** Defining file name. */\n    public filename: (string|null);\n\n    /** Reference to the root namespace. */\n    public readonly root: Root;\n\n    /** Full name including leading dot. */\n    public readonly fullName: string;\n\n    /**\n     * Converts this reflection object to its descriptor representation.\n     * @returns Descriptor\n     */\n    public toJSON(): { [k: string]: any };\n\n    /**\n     * Called when this object is added to a parent.\n     * @param parent Parent added to\n     */\n    public onAdd(parent: ReflectionObject): void;\n\n    /**\n     * Called when this object is removed from a parent.\n     * @param parent Parent removed from\n     */\n    public onRemove(parent: ReflectionObject): void;\n\n    /**\n     * Resolves this objects type references.\n     * @returns `this`\n     */\n    public resolve(): ReflectionObject;\n\n    /**\n     * Resolves this objects editions features.\n     * @param edition The edition we're currently resolving for.\n     * @returns `this`\n     */\n    public _resolveFeaturesRecursive(edition: string): ReflectionObject;\n\n    /**\n     * Resolves child features from parent features\n     * @param edition The edition we're currently resolving for.\n     */\n    public _resolveFeatures(edition: string): void;\n\n    /**\n     * Infers features from legacy syntax that may have been specified differently.\n     * in older editions.\n     * @param edition The edition this proto is on, or undefined if pre-editions\n     * @returns The feature values to override\n     */\n    public _inferLegacyProtoFeatures(edition: (string|undefined)): object;\n\n    /**\n     * Gets an option value.\n     * @param name Option name\n     * @returns Option value or `undefined` if not set\n     */\n    public getOption(name: string): any;\n\n    /**\n     * Sets an option.\n     * @param name Option name\n     * @param value Option value\n     * @param [ifNotSet] Sets the option only if it isn't currently set\n     * @returns `this`\n     */\n    public setOption(name: string, value: any, ifNotSet?: (boolean|undefined)): ReflectionObject;\n\n    /**\n     * Sets a parsed option.\n     * @param name parsed Option name\n     * @param value Option value\n     * @param propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n     * @returns `this`\n     */\n    public setParsedOption(name: string, value: any, propName: string): ReflectionObject;\n\n    /**\n     * Sets multiple options.\n     * @param options Options to set\n     * @param [ifNotSet] Sets an option only if it isn't currently set\n     * @returns `this`\n     */\n    public setOptions(options: { [k: string]: any }, ifNotSet?: boolean): ReflectionObject;\n\n    /**\n     * Converts this instance to its string representation.\n     * @returns Class name[, space, full name]\n     */\n    public toString(): string;\n\n    /**\n     * Converts the edition this object is pinned to for JSON format.\n     * @returns The edition string for JSON representation\n     */\n    public _editionToJSON(): (string|undefined);\n}\n\n/** Reflected oneof. */\nexport class OneOf extends ReflectionObject {\n\n    /**\n     * Constructs a new oneof instance.\n     * @param name Oneof name\n     * @param [fieldNames] Field names\n     * @param [options] Declared options\n     * @param [comment] Comment associated with this field\n     */\n    constructor(name: string, fieldNames?: (string[]|{ [k: string]: any }), options?: { [k: string]: any }, comment?: string);\n\n    /** Field names that belong to this oneof. */\n    public oneof: string[];\n\n    /** Fields that belong to this oneof as an array for iteration. */\n    public readonly fieldsArray: Field[];\n\n    /** Comment for this field. */\n    public comment: (string|null);\n\n    /**\n     * Constructs a oneof from a oneof descriptor.\n     * @param name Oneof name\n     * @param json Oneof descriptor\n     * @returns Created oneof\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: IOneOf): OneOf;\n\n    /**\n     * Converts this oneof to a oneof descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Oneof descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IOneOf;\n\n    /**\n     * Adds a field to this oneof and removes it from its current parent, if any.\n     * @param field Field to add\n     * @returns `this`\n     */\n    public add(field: Field): OneOf;\n\n    /**\n     * Removes a field from this oneof and puts it back to the oneof's parent.\n     * @param field Field to remove\n     * @returns `this`\n     */\n    public remove(field: Field): OneOf;\n\n    /**\n     * Determines whether this field corresponds to a synthetic oneof created for\n     * a proto3 optional field.  No behavioral logic should depend on this, but it\n     * can be relevant for reflection.\n     */\n    public readonly isProto3Optional: boolean;\n\n    /**\n     * OneOf decorator (TypeScript).\n     * @param fieldNames Field names\n     * @returns Decorator function\n     */\n    public static d<T extends string>(...fieldNames: string[]): OneOfDecorator;\n}\n\n/** Oneof descriptor. */\nexport interface IOneOf {\n\n    /** Oneof field names */\n    oneof: string[];\n\n    /** Oneof options */\n    options?: { [k: string]: any };\n}\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @param prototype Target prototype\n * @param oneofName OneOf name\n */\ntype OneOfDecorator = (prototype: object, oneofName: string) => void;\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param source Source contents\n * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns Parser result\n */\nexport function parse(source: string, options?: IParseOptions): IParserResult;\n\n/** Result object returned from {@link parse}. */\nexport interface IParserResult {\n\n    /** Package name, if declared */\n    package: (string|undefined);\n\n    /** Imports, if any */\n    imports: (string[]|undefined);\n\n    /** Weak imports, if any */\n    weakImports: (string[]|undefined);\n\n    /** Populated root instance */\n    root: Root;\n}\n\n/** Options modifying the behavior of {@link parse}. */\nexport interface IParseOptions {\n\n    /** Keeps field casing instead of converting to camel case */\n    keepCase?: boolean;\n\n    /** Recognize double-slash comments in addition to doc-block comments. */\n    alternateCommentMode?: boolean;\n\n    /** Use trailing comment when both leading comment and trailing comment exist. */\n    preferTrailingComment?: boolean;\n}\n\n/** Options modifying the behavior of JSON serialization. */\nexport interface IToJSONOptions {\n\n    /** Serializes comments. */\n    keepComments?: boolean;\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param source Source contents\n * @param root Root to populate\n * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns Parser result\n */\nexport function parse(source: string, root: Root, options?: IParseOptions): IParserResult;\n\n/** Wire format reader using `Uint8Array` if available, otherwise `Array`. */\nexport class Reader {\n\n    /**\n     * Constructs a new reader instance using the specified buffer.\n     * @param buffer Buffer to read from\n     */\n    constructor(buffer: Uint8Array);\n\n    /** Read buffer. */\n    public buf: Uint8Array;\n\n    /** Read buffer position. */\n    public pos: number;\n\n    /** Read buffer length. */\n    public len: number;\n\n    /**\n     * Creates a new reader using the specified buffer.\n     * @param buffer Buffer to read from\n     * @returns A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n     * @throws {Error} If `buffer` is not a valid buffer\n     */\n    public static create(buffer: (Uint8Array|Buffer)): (Reader|BufferReader);\n\n    /**\n     * Reads a varint as an unsigned 32 bit value.\n     * @returns Value read\n     */\n    public uint32(): number;\n\n    /**\n     * Reads a varint as a signed 32 bit value.\n     * @returns Value read\n     */\n    public int32(): number;\n\n    /**\n     * Reads a zig-zag encoded varint as a signed 32 bit value.\n     * @returns Value read\n     */\n    public sint32(): number;\n\n    /**\n     * Reads a varint as a signed 64 bit value.\n     * @returns Value read\n     */\n    public int64(): Long;\n\n    /**\n     * Reads a varint as an unsigned 64 bit value.\n     * @returns Value read\n     */\n    public uint64(): Long;\n\n    /**\n     * Reads a zig-zag encoded varint as a signed 64 bit value.\n     * @returns Value read\n     */\n    public sint64(): Long;\n\n    /**\n     * Reads a varint as a boolean.\n     * @returns Value read\n     */\n    public bool(): boolean;\n\n    /**\n     * Reads fixed 32 bits as an unsigned 32 bit integer.\n     * @returns Value read\n     */\n    public fixed32(): number;\n\n    /**\n     * Reads fixed 32 bits as a signed 32 bit integer.\n     * @returns Value read\n     */\n    public sfixed32(): number;\n\n    /**\n     * Reads fixed 64 bits.\n     * @returns Value read\n     */\n    public fixed64(): Long;\n\n    /**\n     * Reads zig-zag encoded fixed 64 bits.\n     * @returns Value read\n     */\n    public sfixed64(): Long;\n\n    /**\n     * Reads a float (32 bit) as a number.\n     * @returns Value read\n     */\n    public float(): number;\n\n    /**\n     * Reads a double (64 bit float) as a number.\n     * @returns Value read\n     */\n    public double(): number;\n\n    /**\n     * Reads a sequence of bytes preceeded by its length as a varint.\n     * @returns Value read\n     */\n    public bytes(): Uint8Array;\n\n    /**\n     * Reads a string preceeded by its byte length as a varint.\n     * @returns Value read\n     */\n    public string(): string;\n\n    /**\n     * Skips the specified number of bytes if specified, otherwise skips a varint.\n     * @param [length] Length if known, otherwise a varint is assumed\n     * @returns `this`\n     */\n    public skip(length?: number): Reader;\n\n    /**\n     * Skips the next element of the specified wire type.\n     * @param wireType Wire type received\n     * @returns `this`\n     */\n    public skipType(wireType: number): Reader;\n}\n\n/** Wire format reader using node buffers. */\nexport class BufferReader extends Reader {\n\n    /**\n     * Constructs a new buffer reader instance.\n     * @param buffer Buffer to read from\n     */\n    constructor(buffer: Buffer);\n\n    /**\n     * Reads a sequence of bytes preceeded by its length as a varint.\n     * @returns Value read\n     */\n    public bytes(): Buffer;\n}\n\n/** Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together. */\nexport class Root extends NamespaceBase {\n\n    /**\n     * Constructs a new root namespace instance.\n     * @param [options] Top level options\n     */\n    constructor(options?: { [k: string]: any });\n\n    /** Deferred extension fields. */\n    public deferred: Field[];\n\n    /** Resolved file names of loaded files. */\n    public files: string[];\n\n    /**\n     * Loads a namespace descriptor into a root namespace.\n     * @param json Namespace descriptor\n     * @param [root] Root namespace, defaults to create a new one if omitted\n     * @returns Root namespace\n     */\n    public static fromJSON(json: INamespace, root?: Root): Root;\n\n    /**\n     * Resolves the path of an imported file, relative to the importing origin.\n     * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n     * @param origin The file name of the importing file\n     * @param target The file name being imported\n     * @returns Resolved path to `target` or `null` to skip the file\n     */\n    public resolvePath(origin: string, target: string): (string|null);\n\n    /**\n     * Fetch content from file path or url\n     * This method exists so you can override it with your own logic.\n     * @param path File path or url\n     * @param callback Callback function\n     */\n    public fetch(path: string, callback: FetchCallback): void;\n\n    /**\n     * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n     * @param filename Names of one or multiple files to load\n     * @param options Parse options\n     * @param callback Callback function\n     */\n    public load(filename: (string|string[]), options: IParseOptions, callback: LoadCallback): void;\n\n    /**\n     * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n     * @param filename Names of one or multiple files to load\n     * @param callback Callback function\n     */\n    public load(filename: (string|string[]), callback: LoadCallback): void;\n\n    /**\n     * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n     * @param filename Names of one or multiple files to load\n     * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n     * @returns Promise\n     */\n    public load(filename: (string|string[]), options?: IParseOptions): Promise<Root>;\n\n    /**\n     * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n     * @param filename Names of one or multiple files to load\n     * @param [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n     * @returns Root namespace\n     * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n     */\n    public loadSync(filename: (string|string[]), options?: IParseOptions): Root;\n}\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n */\nexport let roots: { [k: string]: Root };\n\n/** Streaming RPC helpers. */\nexport namespace rpc {\n\n    /**\n     * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n     *\n     * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n     * @param error Error, if any\n     * @param [response] Response message\n     */\n    type ServiceMethodCallback<TRes extends Message<TRes>> = (error: (Error|null), response?: TRes) => void;\n\n    /**\n     * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n     * @param request Request message or plain object\n     * @param [callback] Node-style callback called with the error, if any, and the response message\n     * @returns Promise if `callback` has been omitted, otherwise `undefined`\n     */\n    type ServiceMethod<TReq extends Message<TReq>, TRes extends Message<TRes>> = (request: (TReq|Properties<TReq>), callback?: rpc.ServiceMethodCallback<TRes>) => Promise<Message<TRes>>;\n\n    /** An RPC service as returned by {@link Service#create}. */\n    class Service extends util.EventEmitter {\n\n        /**\n         * Constructs a new RPC service instance.\n         * @param rpcImpl RPC implementation\n         * @param [requestDelimited=false] Whether requests are length-delimited\n         * @param [responseDelimited=false] Whether responses are length-delimited\n         */\n        constructor(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n\n        /** RPC implementation. Becomes `null` once the service is ended. */\n        public rpcImpl: (RPCImpl|null);\n\n        /** Whether requests are length-delimited. */\n        public requestDelimited: boolean;\n\n        /** Whether responses are length-delimited. */\n        public responseDelimited: boolean;\n\n        /**\n         * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n         * @param method Reflected or static method\n         * @param requestCtor Request constructor\n         * @param responseCtor Response constructor\n         * @param request Request message or plain object\n         * @param callback Service callback\n         */\n        public rpcCall<TReq extends Message<TReq>, TRes extends Message<TRes>>(method: (Method|rpc.ServiceMethod<TReq, TRes>), requestCtor: Constructor<TReq>, responseCtor: Constructor<TRes>, request: (TReq|Properties<TReq>), callback: rpc.ServiceMethodCallback<TRes>): void;\n\n        /**\n         * Ends this service and emits the `end` event.\n         * @param [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n         * @returns `this`\n         */\n        public end(endedByRPC?: boolean): rpc.Service;\n    }\n}\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @param method Reflected or static method being called\n * @param requestData Request data\n * @param callback Callback function\n */\ntype RPCImpl = (method: (Method|rpc.ServiceMethod<Message<{}>, Message<{}>>), requestData: Uint8Array, callback: RPCImplCallback) => void;\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @param error Error, if any, otherwise `null`\n * @param [response] Response data or `null` to signal end of stream, if there hasn't been an error\n */\ntype RPCImplCallback = (error: (Error|null), response?: (Uint8Array|null)) => void;\n\n/** Reflected service. */\nexport class Service extends NamespaceBase {\n\n    /**\n     * Constructs a new service instance.\n     * @param name Service name\n     * @param [options] Service options\n     * @throws {TypeError} If arguments are invalid\n     */\n    constructor(name: string, options?: { [k: string]: any });\n\n    /** Service methods. */\n    public methods: { [k: string]: Method };\n\n    /**\n     * Constructs a service from a service descriptor.\n     * @param name Service name\n     * @param json Service descriptor\n     * @returns Created service\n     * @throws {TypeError} If arguments are invalid\n     */\n    public static fromJSON(name: string, json: IService): Service;\n\n    /**\n     * Converts this service to a service descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Service descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IService;\n\n    /** Methods of this service as an array for iteration. */\n    public readonly methodsArray: Method[];\n\n    /**\n     * Creates a runtime service using the specified rpc implementation.\n     * @param rpcImpl RPC implementation\n     * @param [requestDelimited=false] Whether requests are length-delimited\n     * @param [responseDelimited=false] Whether responses are length-delimited\n     * @returns RPC service. Useful where requests and/or responses are streamed.\n     */\n    public create(rpcImpl: RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): rpc.Service;\n}\n\n/** Service descriptor. */\nexport interface IService extends INamespace {\n\n    /** Method descriptors */\n    methods: { [k: string]: IMethod };\n}\n\n/**\n * Gets the next token and advances.\n * @returns Next token or `null` on eof\n */\ntype TokenizerHandleNext = () => (string|null);\n\n/**\n * Peeks for the next token.\n * @returns Next token or `null` on eof\n */\ntype TokenizerHandlePeek = () => (string|null);\n\n/**\n * Pushes a token back to the stack.\n * @param token Token\n */\ntype TokenizerHandlePush = (token: string) => void;\n\n/**\n * Skips the next token.\n * @param expected Expected token\n * @param [optional=false] If optional\n * @returns Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\ntype TokenizerHandleSkip = (expected: string, optional?: boolean) => boolean;\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @param [line] Line number\n * @returns Comment text or `null` if none\n */\ntype TokenizerHandleCmnt = (line?: number) => (string|null);\n\n/** Handle object returned from {@link tokenize}. */\nexport interface ITokenizerHandle {\n\n    /** Gets the next token and advances (`null` on eof) */\n    next: TokenizerHandleNext;\n\n    /** Peeks for the next token (`null` on eof) */\n    peek: TokenizerHandlePeek;\n\n    /** Pushes a token back to the stack */\n    push: TokenizerHandlePush;\n\n    /** Skips a token, returns its presence and advances or, if non-optional and not present, throws */\n    skip: TokenizerHandleSkip;\n\n    /** Gets the comment on the previous line or the line comment on the specified line, if any */\n    cmnt: TokenizerHandleCmnt;\n\n    /** Current line number */\n    line: number;\n}\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param source Source contents\n * @param alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns Tokenizer handle\n */\nexport function tokenize(source: string, alternateCommentMode: boolean): ITokenizerHandle;\n\nexport namespace tokenize {\n\n    /**\n     * Unescapes a string.\n     * @param str String to unescape\n     * @returns Unescaped string\n     */\n    function unescape(str: string): string;\n}\n\n/** Reflected message type. */\nexport class Type extends NamespaceBase {\n\n    /**\n     * Constructs a new reflected message type instance.\n     * @param name Message name\n     * @param [options] Declared options\n     */\n    constructor(name: string, options?: { [k: string]: any });\n\n    /** Message fields. */\n    public fields: { [k: string]: Field };\n\n    /** Oneofs declared within this namespace, if any. */\n    public oneofs: { [k: string]: OneOf };\n\n    /** Extension ranges, if any. */\n    public extensions: number[][];\n\n    /** Reserved ranges, if any. */\n    public reserved: (number[]|string)[];\n\n    /** Message fields by id. */\n    public readonly fieldsById: { [k: number]: Field };\n\n    /** Fields of this message as an array for iteration. */\n    public readonly fieldsArray: Field[];\n\n    /** Oneofs of this message as an array for iteration. */\n    public readonly oneofsArray: OneOf[];\n\n    /**\n     * The registered constructor, if any registered, otherwise a generic constructor.\n     * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n     */\n    public ctor: Constructor<{}>;\n\n    /**\n     * Generates a constructor function for the specified type.\n     * @param mtype Message type\n     * @returns Codegen instance\n     */\n    public static generateConstructor(mtype: Type): Codegen;\n\n    /**\n     * Creates a message type from a message type descriptor.\n     * @param name Message name\n     * @param json Message type descriptor\n     * @returns Created message type\n     */\n    public static fromJSON(name: string, json: IType): Type;\n\n    /**\n     * Converts this message type to a message type descriptor.\n     * @param [toJSONOptions] JSON conversion options\n     * @returns Message type descriptor\n     */\n    public toJSON(toJSONOptions?: IToJSONOptions): IType;\n\n    /**\n     * Adds a nested object to this type.\n     * @param object Nested object to add\n     * @returns `this`\n     * @throws {TypeError} If arguments are invalid\n     * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n     */\n    public add(object: ReflectionObject): Type;\n\n    /**\n     * Removes a nested object from this type.\n     * @param object Nested object to remove\n     * @returns `this`\n     * @throws {TypeError} If arguments are invalid\n     * @throws {Error} If `object` is not a member of this type\n     */\n    public remove(object: ReflectionObject): Type;\n\n    /**\n     * Tests if the specified id is reserved.\n     * @param id Id to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    public isReservedId(id: number): boolean;\n\n    /**\n     * Tests if the specified name is reserved.\n     * @param name Name to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    public isReservedName(name: string): boolean;\n\n    /**\n     * Creates a new message of this type using the specified properties.\n     * @param [properties] Properties to set\n     * @returns Message instance\n     */\n    public create(properties?: { [k: string]: any }): Message<{}>;\n\n    /**\n     * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n     * @returns `this`\n     */\n    public setup(): Type;\n\n    /**\n     * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n     * @param message Message instance or plain object\n     * @param [writer] Writer to encode to\n     * @returns writer\n     */\n    public encode(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer;\n\n    /**\n     * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n     * @param message Message instance or plain object\n     * @param [writer] Writer to encode to\n     * @returns writer\n     */\n    public encodeDelimited(message: (Message<{}>|{ [k: string]: any }), writer?: Writer): Writer;\n\n    /**\n     * Decodes a message of this type.\n     * @param reader Reader or buffer to decode from\n     * @param [length] Length of the message, if known beforehand\n     * @returns Decoded message\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {util.ProtocolError<{}>} If required fields are missing\n     */\n    public decode(reader: (Reader|Uint8Array), length?: number): Message<{}>;\n\n    /**\n     * Decodes a message of this type preceeded by its byte length as a varint.\n     * @param reader Reader or buffer to decode from\n     * @returns Decoded message\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {util.ProtocolError} If required fields are missing\n     */\n    public decodeDelimited(reader: (Reader|Uint8Array)): Message<{}>;\n\n    /**\n     * Verifies that field values are valid and that required fields are present.\n     * @param message Plain object to verify\n     * @returns `null` if valid, otherwise the reason why it is not\n     */\n    public verify(message: { [k: string]: any }): (null|string);\n\n    /**\n     * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n     * @param object Plain object to convert\n     * @returns Message instance\n     */\n    public fromObject(object: { [k: string]: any }): Message<{}>;\n\n    /**\n     * Creates a plain object from a message of this type. Also converts values to other types if specified.\n     * @param message Message instance\n     * @param [options] Conversion options\n     * @returns Plain object\n     */\n    public toObject(message: Message<{}>, options?: IConversionOptions): { [k: string]: any };\n\n    /**\n     * Type decorator (TypeScript).\n     * @param [typeName] Type name, defaults to the constructor's name\n     * @returns Decorator function\n     */\n    public static d<T extends Message<T>>(typeName?: string): TypeDecorator<T>;\n}\n\n/** Message type descriptor. */\nexport interface IType extends INamespace {\n\n    /** Oneof descriptors */\n    oneofs?: { [k: string]: IOneOf };\n\n    /** Field descriptors */\n    fields: { [k: string]: IField };\n\n    /** Extension ranges */\n    extensions?: number[][];\n\n    /** Reserved ranges */\n    reserved?: (number[]|string)[];\n\n    /** Whether a legacy group or not */\n    group?: boolean;\n}\n\n/** Conversion options as used by {@link Type#toObject} and {@link Message.toObject}. */\nexport interface IConversionOptions {\n\n    /**\n     * Long conversion type.\n     * Valid values are `String` and `Number` (the global types).\n     * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n     */\n    longs?: Function;\n\n    /**\n     * Enum value conversion type.\n     * Only valid value is `String` (the global type).\n     * Defaults to copy the present value, which is the numeric id.\n     */\n    enums?: Function;\n\n    /**\n     * Bytes value conversion type.\n     * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n     * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n     */\n    bytes?: Function;\n\n    /** Also sets default values on the resulting object */\n    defaults?: boolean;\n\n    /** Sets empty arrays for missing repeated fields even if `defaults=false` */\n    arrays?: boolean;\n\n    /** Sets empty objects for missing map fields even if `defaults=false` */\n    objects?: boolean;\n\n    /** Includes virtual oneof properties set to the present field's name, if any */\n    oneofs?: boolean;\n\n    /** Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings */\n    json?: boolean;\n}\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @param target Target constructor\n */\ntype TypeDecorator<T extends Message<T>> = (target: Constructor<T>) => void;\n\n/** Common type constants. */\nexport namespace types {\n\n    /** Basic type wire types. */\n    const basic: {\n        \"double\": number,\n        \"float\": number,\n        \"int32\": number,\n        \"uint32\": number,\n        \"sint32\": number,\n        \"fixed32\": number,\n        \"sfixed32\": number,\n        \"int64\": number,\n        \"uint64\": number,\n        \"sint64\": number,\n        \"fixed64\": number,\n        \"sfixed64\": number,\n        \"bool\": number,\n        \"string\": number,\n        \"bytes\": number\n    };\n\n    /** Basic type defaults. */\n    const defaults: {\n        \"double\": number,\n        \"float\": number,\n        \"int32\": number,\n        \"uint32\": number,\n        \"sint32\": number,\n        \"fixed32\": number,\n        \"sfixed32\": number,\n        \"int64\": number,\n        \"uint64\": number,\n        \"sint64\": number,\n        \"fixed64\": number,\n        \"sfixed64\": number,\n        \"bool\": boolean,\n        \"string\": string,\n        \"bytes\": number[],\n        \"message\": null\n    };\n\n    /** Basic long type wire types. */\n    const long: {\n        \"int64\": number,\n        \"uint64\": number,\n        \"sint64\": number,\n        \"fixed64\": number,\n        \"sfixed64\": number\n    };\n\n    /** Allowed types for map keys with their associated wire type. */\n    const mapKey: {\n        \"int32\": number,\n        \"uint32\": number,\n        \"sint32\": number,\n        \"fixed32\": number,\n        \"sfixed32\": number,\n        \"int64\": number,\n        \"uint64\": number,\n        \"sint64\": number,\n        \"fixed64\": number,\n        \"sfixed64\": number,\n        \"bool\": number,\n        \"string\": number\n    };\n\n    /** Allowed types for packed repeated fields with their associated wire type. */\n    const packed: {\n        \"double\": number,\n        \"float\": number,\n        \"int32\": number,\n        \"uint32\": number,\n        \"sint32\": number,\n        \"fixed32\": number,\n        \"sfixed32\": number,\n        \"int64\": number,\n        \"uint64\": number,\n        \"sint64\": number,\n        \"fixed64\": number,\n        \"sfixed64\": number,\n        \"bool\": number\n    };\n}\n\n/** Constructor type. */\nexport interface Constructor<T> extends Function {\n    new(...params: any[]): T; prototype: T;\n}\n\n/** Properties type. */\ntype Properties<T> = { [P in keyof T]?: T[P] };\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n */\nexport interface Buffer extends Uint8Array {\n}\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n */\nexport interface Long {\n\n    /** Low bits */\n    low: number;\n\n    /** High bits */\n    high: number;\n\n    /** Whether unsigned or not */\n    unsigned: boolean;\n}\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @returns Set field name, if any\n */\ntype OneOfGetter = () => (string|undefined);\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @param value Field name\n */\ntype OneOfSetter = (value: (string|undefined)) => void;\n\n/** Various utility functions. */\nexport namespace util {\n\n    /** Helper class for working with the low and high bits of a 64 bit value. */\n    class LongBits {\n\n        /**\n         * Constructs new long bits.\n         * @param lo Low 32 bits, unsigned\n         * @param hi High 32 bits, unsigned\n         */\n        constructor(lo: number, hi: number);\n\n        /** Low bits. */\n        public lo: number;\n\n        /** High bits. */\n        public hi: number;\n\n        /** Zero bits. */\n        public static zero: util.LongBits;\n\n        /** Zero hash. */\n        public static zeroHash: string;\n\n        /**\n         * Constructs new long bits from the specified number.\n         * @param value Value\n         * @returns Instance\n         */\n        public static fromNumber(value: number): util.LongBits;\n\n        /**\n         * Constructs new long bits from a number, long or string.\n         * @param value Value\n         * @returns Instance\n         */\n        public static from(value: (Long|number|string)): util.LongBits;\n\n        /**\n         * Converts this long bits to a possibly unsafe JavaScript number.\n         * @param [unsigned=false] Whether unsigned or not\n         * @returns Possibly unsafe number\n         */\n        public toNumber(unsigned?: boolean): number;\n\n        /**\n         * Converts this long bits to a long.\n         * @param [unsigned=false] Whether unsigned or not\n         * @returns Long\n         */\n        public toLong(unsigned?: boolean): Long;\n\n        /**\n         * Constructs new long bits from the specified 8 characters long hash.\n         * @param hash Hash\n         * @returns Bits\n         */\n        public static fromHash(hash: string): util.LongBits;\n\n        /**\n         * Converts this long bits to a 8 characters long hash.\n         * @returns Hash\n         */\n        public toHash(): string;\n\n        /**\n         * Zig-zag encodes this long bits.\n         * @returns `this`\n         */\n        public zzEncode(): util.LongBits;\n\n        /**\n         * Zig-zag decodes this long bits.\n         * @returns `this`\n         */\n        public zzDecode(): util.LongBits;\n\n        /**\n         * Calculates the length of this longbits when encoded as a varint.\n         * @returns Length\n         */\n        public length(): number;\n    }\n\n    /** Whether running within node or not. */\n    let isNode: boolean;\n\n    /** Global object reference. */\n    let global: object;\n\n    /** An immuable empty array. */\n    const emptyArray: any[];\n\n    /** An immutable empty object. */\n    const emptyObject: object;\n\n    /**\n     * Tests if the specified value is an integer.\n     * @param value Value to test\n     * @returns `true` if the value is an integer\n     */\n    function isInteger(value: any): boolean;\n\n    /**\n     * Tests if the specified value is a string.\n     * @param value Value to test\n     * @returns `true` if the value is a string\n     */\n    function isString(value: any): boolean;\n\n    /**\n     * Tests if the specified value is a non-null object.\n     * @param value Value to test\n     * @returns `true` if the value is a non-null object\n     */\n    function isObject(value: any): boolean;\n\n    /**\n     * Checks if a property on a message is considered to be present.\n     * This is an alias of {@link util.isSet}.\n     * @param obj Plain object or message instance\n     * @param prop Property name\n     * @returns `true` if considered to be present, otherwise `false`\n     */\n    function isset(obj: object, prop: string): boolean;\n\n    /**\n     * Checks if a property on a message is considered to be present.\n     * @param obj Plain object or message instance\n     * @param prop Property name\n     * @returns `true` if considered to be present, otherwise `false`\n     */\n    function isSet(obj: object, prop: string): boolean;\n\n    /** Node's Buffer class if available. */\n    let Buffer: Constructor<Buffer>;\n\n    /**\n     * Creates a new buffer of whatever type supported by the environment.\n     * @param [sizeOrArray=0] Buffer size or number array\n     * @returns Buffer\n     */\n    function newBuffer(sizeOrArray?: (number|number[])): (Uint8Array|Buffer);\n\n    /** Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`. */\n    let Array: Constructor<Uint8Array>;\n\n    /** Long.js's Long class if available. */\n    let Long: Constructor<Long>;\n\n    /** Regular expression used to verify 2 bit (`bool`) map keys. */\n    const key2Re: RegExp;\n\n    /** Regular expression used to verify 32 bit (`int32` etc.) map keys. */\n    const key32Re: RegExp;\n\n    /** Regular expression used to verify 64 bit (`int64` etc.) map keys. */\n    const key64Re: RegExp;\n\n    /**\n     * Converts a number or long to an 8 characters long hash string.\n     * @param value Value to convert\n     * @returns Hash\n     */\n    function longToHash(value: (Long|number)): string;\n\n    /**\n     * Converts an 8 characters long hash string to a long or number.\n     * @param hash Hash\n     * @param [unsigned=false] Whether unsigned or not\n     * @returns Original value\n     */\n    function longFromHash(hash: string, unsigned?: boolean): (Long|number);\n\n    /**\n     * Merges the properties of the source object into the destination object.\n     * @param dst Destination object\n     * @param src Source object\n     * @param [ifNotSet=false] Merges only if the key is not already set\n     * @returns Destination object\n     */\n    function merge(dst: { [k: string]: any }, src: { [k: string]: any }, ifNotSet?: boolean): { [k: string]: any };\n\n    /**\n     * Converts the first character of a string to lower case.\n     * @param str String to convert\n     * @returns Converted string\n     */\n    function lcFirst(str: string): string;\n\n    /**\n     * Creates a custom error constructor.\n     * @param name Error name\n     * @returns Custom error constructor\n     */\n    function newError(name: string): Constructor<Error>;\n\n    /** Error subclass indicating a protocol specifc error. */\n    class ProtocolError<T extends Message<T>> extends Error {\n\n        /**\n         * Constructs a new protocol error.\n         * @param message Error message\n         * @param [properties] Additional properties\n         */\n        constructor(message: string, properties?: { [k: string]: any });\n\n        /** So far decoded message instance. */\n        public instance: Message<T>;\n    }\n\n    /**\n     * Builds a getter for a oneof's present field name.\n     * @param fieldNames Field names\n     * @returns Unbound getter\n     */\n    function oneOfGetter(fieldNames: string[]): OneOfGetter;\n\n    /**\n     * Builds a setter for a oneof's present field name.\n     * @param fieldNames Field names\n     * @returns Unbound setter\n     */\n    function oneOfSetter(fieldNames: string[]): OneOfSetter;\n\n    /**\n     * Default conversion options used for {@link Message#toJSON} implementations.\n     *\n     * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n     *\n     * - Longs become strings\n     * - Enums become string keys\n     * - Bytes become base64 encoded strings\n     * - (Sub-)Messages become plain objects\n     * - Maps become plain objects with all string keys\n     * - Repeated fields become arrays\n     * - NaN and Infinity for float and double fields become strings\n     *\n     * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n     */\n    let toJSONOptions: IConversionOptions;\n\n    /** Node's fs module if available. */\n    let fs: { [k: string]: any };\n\n    /**\n     * Converts an object's values to an array.\n     * @param object Object to convert\n     * @returns Converted array\n     */\n    function toArray(object: { [k: string]: any }): any[];\n\n    /**\n     * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n     * @param array Array to convert\n     * @returns Converted object\n     */\n    function toObject(array: any[]): { [k: string]: any };\n\n    /**\n     * Tests whether the specified name is a reserved word in JS.\n     * @param name Name to test\n     * @returns `true` if reserved, otherwise `false`\n     */\n    function isReserved(name: string): boolean;\n\n    /**\n     * Returns a safe property accessor for the specified property name.\n     * @param prop Property name\n     * @returns Safe accessor\n     */\n    function safeProp(prop: string): string;\n\n    /**\n     * Converts the first character of a string to upper case.\n     * @param str String to convert\n     * @returns Converted string\n     */\n    function ucFirst(str: string): string;\n\n    /**\n     * Converts a string to camel case.\n     * @param str String to convert\n     * @returns Converted string\n     */\n    function camelCase(str: string): string;\n\n    /**\n     * Compares reflected fields by id.\n     * @param a First field\n     * @param b Second field\n     * @returns Comparison value\n     */\n    function compareFieldsById(a: Field, b: Field): number;\n\n    /**\n     * Decorator helper for types (TypeScript).\n     * @param ctor Constructor function\n     * @param [typeName] Type name, defaults to the constructor's name\n     * @returns Reflected type\n     */\n    function decorateType<T extends Message<T>>(ctor: Constructor<T>, typeName?: string): Type;\n\n    /**\n     * Decorator helper for enums (TypeScript).\n     * @param object Enum object\n     * @returns Reflected enum\n     */\n    function decorateEnum(object: object): Enum;\n\n    /**\n     * Sets the value of a property by property path. If a value already exists, it is turned to an array\n     * @param dst Destination object\n     * @param path dot '.' delimited path of the property to set\n     * @param value the value to set\n     * @param [ifNotSet] Sets the option only if it isn't currently set\n     * @returns Destination object\n     */\n    function setProperty(dst: { [k: string]: any }, path: string, value: object, ifNotSet?: (boolean|undefined)): { [k: string]: any };\n\n    /** Decorator root (TypeScript). */\n    let decorateRoot: Root;\n\n    /**\n     * Returns a promise from a node-style callback function.\n     * @param fn Function to call\n     * @param ctx Function context\n     * @param params Function arguments\n     * @returns Promisified function\n     */\n    function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise<any>;\n\n    /** A minimal base64 implementation for number arrays. */\n    namespace base64 {\n\n        /**\n         * Calculates the byte length of a base64 encoded string.\n         * @param string Base64 encoded string\n         * @returns Byte length\n         */\n        function length(string: string): number;\n\n        /**\n         * Encodes a buffer to a base64 encoded string.\n         * @param buffer Source buffer\n         * @param start Source start\n         * @param end Source end\n         * @returns Base64 encoded string\n         */\n        function encode(buffer: Uint8Array, start: number, end: number): string;\n\n        /**\n         * Decodes a base64 encoded string to a buffer.\n         * @param string Source string\n         * @param buffer Destination buffer\n         * @param offset Destination offset\n         * @returns Number of bytes written\n         * @throws {Error} If encoding is invalid\n         */\n        function decode(string: string, buffer: Uint8Array, offset: number): number;\n\n        /**\n         * Tests if the specified string appears to be base64 encoded.\n         * @param string String to test\n         * @returns `true` if probably base64 encoded, otherwise false\n         */\n        function test(string: string): boolean;\n    }\n\n    /**\n     * Begins generating a function.\n     * @param functionParams Function parameter names\n     * @param [functionName] Function name if not anonymous\n     * @returns Appender that appends code to the function's body\n     */\n    function codegen(functionParams: string[], functionName?: string): Codegen;\n\n    namespace codegen {\n\n        /** When set to `true`, codegen will log generated code to console. Useful for debugging. */\n        let verbose: boolean;\n    }\n\n    /**\n     * Begins generating a function.\n     * @param [functionName] Function name if not anonymous\n     * @returns Appender that appends code to the function's body\n     */\n    function codegen(functionName?: string): Codegen;\n\n    /** A minimal event emitter. */\n    class EventEmitter {\n\n        /** Constructs a new event emitter instance. */\n        constructor();\n\n        /**\n         * Registers an event listener.\n         * @param evt Event name\n         * @param fn Listener\n         * @param [ctx] Listener context\n         * @returns `this`\n         */\n        public on(evt: string, fn: EventEmitterListener, ctx?: any): this;\n\n        /**\n         * Removes an event listener or any matching listeners if arguments are omitted.\n         * @param [evt] Event name. Removes all listeners if omitted.\n         * @param [fn] Listener to remove. Removes all listeners of `evt` if omitted.\n         * @returns `this`\n         */\n        public off(evt?: string, fn?: EventEmitterListener): this;\n\n        /**\n         * Emits an event by calling its listeners with the specified arguments.\n         * @param evt Event name\n         * @param args Arguments\n         * @returns `this`\n         */\n        public emit(evt: string, ...args: any[]): this;\n    }\n\n    /** Reads / writes floats / doubles from / to buffers. */\n    namespace float {\n\n        /**\n         * Writes a 32 bit float to a buffer using little endian byte order.\n         * @param val Value to write\n         * @param buf Target buffer\n         * @param pos Target buffer offset\n         */\n        function writeFloatLE(val: number, buf: Uint8Array, pos: number): void;\n\n        /**\n         * Writes a 32 bit float to a buffer using big endian byte order.\n         * @param val Value to write\n         * @param buf Target buffer\n         * @param pos Target buffer offset\n         */\n        function writeFloatBE(val: number, buf: Uint8Array, pos: number): void;\n\n        /**\n         * Reads a 32 bit float from a buffer using little endian byte order.\n         * @param buf Source buffer\n         * @param pos Source buffer offset\n         * @returns Value read\n         */\n        function readFloatLE(buf: Uint8Array, pos: number): number;\n\n        /**\n         * Reads a 32 bit float from a buffer using big endian byte order.\n         * @param buf Source buffer\n         * @param pos Source buffer offset\n         * @returns Value read\n         */\n        function readFloatBE(buf: Uint8Array, pos: number): number;\n\n        /**\n         * Writes a 64 bit double to a buffer using little endian byte order.\n         * @param val Value to write\n         * @param buf Target buffer\n         * @param pos Target buffer offset\n         */\n        function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void;\n\n        /**\n         * Writes a 64 bit double to a buffer using big endian byte order.\n         * @param val Value to write\n         * @param buf Target buffer\n         * @param pos Target buffer offset\n         */\n        function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void;\n\n        /**\n         * Reads a 64 bit double from a buffer using little endian byte order.\n         * @param buf Source buffer\n         * @param pos Source buffer offset\n         * @returns Value read\n         */\n        function readDoubleLE(buf: Uint8Array, pos: number): number;\n\n        /**\n         * Reads a 64 bit double from a buffer using big endian byte order.\n         * @param buf Source buffer\n         * @param pos Source buffer offset\n         * @returns Value read\n         */\n        function readDoubleBE(buf: Uint8Array, pos: number): number;\n    }\n\n    /**\n     * Fetches the contents of a file.\n     * @param filename File path or url\n     * @param options Fetch options\n     * @param callback Callback function\n     */\n    function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void;\n\n    /**\n     * Fetches the contents of a file.\n     * @param path File path or url\n     * @param callback Callback function\n     */\n    function fetch(path: string, callback: FetchCallback): void;\n\n    /**\n     * Fetches the contents of a file.\n     * @param path File path or url\n     * @param [options] Fetch options\n     * @returns Promise\n     */\n    function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>;\n\n    /**\n     * Requires a module only if available.\n     * @param moduleName Module to require\n     * @returns Required module if available and not empty, otherwise `null`\n     */\n    function inquire(moduleName: string): object;\n\n    /** A minimal path module to resolve Unix, Windows and URL paths alike. */\n    namespace path {\n\n        /**\n         * Tests if the specified path is absolute.\n         * @param path Path to test\n         * @returns `true` if path is absolute\n         */\n        function isAbsolute(path: string): boolean;\n\n        /**\n         * Normalizes the specified path.\n         * @param path Path to normalize\n         * @returns Normalized path\n         */\n        function normalize(path: string): string;\n\n        /**\n         * Resolves the specified include path against the specified origin path.\n         * @param originPath Path to the origin file\n         * @param includePath Include path relative to origin path\n         * @param [alreadyNormalized=false] `true` if both paths are already known to be normalized\n         * @returns Path to the include file\n         */\n        function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string;\n    }\n\n    /**\n     * A general purpose buffer pool.\n     * @param alloc Allocator\n     * @param slice Slicer\n     * @param [size=8192] Slab size\n     * @returns Pooled allocator\n     */\n    function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;\n\n    /** A minimal UTF8 implementation for number arrays. */\n    namespace utf8 {\n\n        /**\n         * Calculates the UTF8 byte length of a string.\n         * @param string String\n         * @returns Byte length\n         */\n        function length(string: string): number;\n\n        /**\n         * Reads UTF8 bytes as a string.\n         * @param buffer Source buffer\n         * @param start Source start\n         * @param end Source end\n         * @returns String read\n         */\n        function read(buffer: Uint8Array, start: number, end: number): string;\n\n        /**\n         * Writes a string as UTF8 bytes.\n         * @param string Source string\n         * @param buffer Destination buffer\n         * @param offset Destination offset\n         * @returns Bytes written\n         */\n        function write(string: string, buffer: Uint8Array, offset: number): number;\n    }\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param mtype Message type\n * @returns Codegen instance\n */\nexport function verifier(mtype: Type): Codegen;\n\n/** Wrappers for common types. */\nexport const wrappers: { [k: string]: IWrapper };\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @param object Plain object\n * @returns Message instance\n */\ntype WrapperFromObjectConverter = (this: Type, object: { [k: string]: any }) => Message<{}>;\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @param message Message instance\n * @param [options] Conversion options\n * @returns Plain object\n */\ntype WrapperToObjectConverter = (this: Type, message: Message<{}>, options?: IConversionOptions) => { [k: string]: any };\n\n/** Common type wrapper part of {@link wrappers}. */\nexport interface IWrapper {\n\n    /** From object converter */\n    fromObject?: WrapperFromObjectConverter;\n\n    /** To object converter */\n    toObject?: WrapperToObjectConverter;\n}\n\n/** Wire format writer using `Uint8Array` if available, otherwise `Array`. */\nexport class Writer {\n\n    /** Constructs a new writer instance. */\n    constructor();\n\n    /** Current length. */\n    public len: number;\n\n    /** Operations head. */\n    public head: object;\n\n    /** Operations tail */\n    public tail: object;\n\n    /** Linked forked states. */\n    public states: (object|null);\n\n    /**\n     * Creates a new writer.\n     * @returns A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n     */\n    public static create(): (BufferWriter|Writer);\n\n    /**\n     * Allocates a buffer of the specified size.\n     * @param size Buffer size\n     * @returns Buffer\n     */\n    public static alloc(size: number): Uint8Array;\n\n    /**\n     * Writes an unsigned 32 bit value as a varint.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public uint32(value: number): Writer;\n\n    /**\n     * Writes a signed 32 bit value as a varint.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public int32(value: number): Writer;\n\n    /**\n     * Writes a 32 bit value as a varint, zig-zag encoded.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public sint32(value: number): Writer;\n\n    /**\n     * Writes an unsigned 64 bit value as a varint.\n     * @param value Value to write\n     * @returns `this`\n     * @throws {TypeError} If `value` is a string and no long library is present.\n     */\n    public uint64(value: (Long|number|string)): Writer;\n\n    /**\n     * Writes a signed 64 bit value as a varint.\n     * @param value Value to write\n     * @returns `this`\n     * @throws {TypeError} If `value` is a string and no long library is present.\n     */\n    public int64(value: (Long|number|string)): Writer;\n\n    /**\n     * Writes a signed 64 bit value as a varint, zig-zag encoded.\n     * @param value Value to write\n     * @returns `this`\n     * @throws {TypeError} If `value` is a string and no long library is present.\n     */\n    public sint64(value: (Long|number|string)): Writer;\n\n    /**\n     * Writes a boolish value as a varint.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public bool(value: boolean): Writer;\n\n    /**\n     * Writes an unsigned 32 bit value as fixed 32 bits.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public fixed32(value: number): Writer;\n\n    /**\n     * Writes a signed 32 bit value as fixed 32 bits.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public sfixed32(value: number): Writer;\n\n    /**\n     * Writes an unsigned 64 bit value as fixed 64 bits.\n     * @param value Value to write\n     * @returns `this`\n     * @throws {TypeError} If `value` is a string and no long library is present.\n     */\n    public fixed64(value: (Long|number|string)): Writer;\n\n    /**\n     * Writes a signed 64 bit value as fixed 64 bits.\n     * @param value Value to write\n     * @returns `this`\n     * @throws {TypeError} If `value` is a string and no long library is present.\n     */\n    public sfixed64(value: (Long|number|string)): Writer;\n\n    /**\n     * Writes a float (32 bit).\n     * @param value Value to write\n     * @returns `this`\n     */\n    public float(value: number): Writer;\n\n    /**\n     * Writes a double (64 bit float).\n     * @param value Value to write\n     * @returns `this`\n     */\n    public double(value: number): Writer;\n\n    /**\n     * Writes a sequence of bytes.\n     * @param value Buffer or base64 encoded string to write\n     * @returns `this`\n     */\n    public bytes(value: (Uint8Array|string)): Writer;\n\n    /**\n     * Writes a string.\n     * @param value Value to write\n     * @returns `this`\n     */\n    public string(value: string): Writer;\n\n    /**\n     * Forks this writer's state by pushing it to a stack.\n     * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n     * @returns `this`\n     */\n    public fork(): Writer;\n\n    /**\n     * Resets this instance to the last state.\n     * @returns `this`\n     */\n    public reset(): Writer;\n\n    /**\n     * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n     * @returns `this`\n     */\n    public ldelim(): Writer;\n\n    /**\n     * Finishes the write operation.\n     * @returns Finished buffer\n     */\n    public finish(): Uint8Array;\n}\n\n/** Wire format writer using node buffers. */\nexport class BufferWriter extends Writer {\n\n    /** Constructs a new buffer writer instance. */\n    constructor();\n\n    /**\n     * Allocates a buffer of the specified size.\n     * @param size Buffer size\n     * @returns Buffer\n     */\n    public static alloc(size: number): Buffer;\n\n    /**\n     * Finishes the write operation.\n     * @returns Finished buffer\n     */\n    public finish(): Buffer;\n}\n\n/**\n * Callback as used by {@link util.asPromise}.\n * @param error Error, if any\n * @param params Additional arguments\n */\ntype asPromiseCallback = (error: (Error|null), ...params: any[]) => void;\n\n/**\n * Appends code to the function's body or finishes generation.\n * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\n * @param [formatParams] Format parameters\n * @returns Itself or the generated function if finished\n * @throws {Error} If format parameter counts do not match\n */\ntype Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function);\n\n/**\n * Event listener as used by {@link util.EventEmitter}.\n * @param args Arguments\n */\ntype EventEmitterListener = (...args: any[]) => void;\n\n/**\n * Node-style callback as used by {@link util.fetch}.\n * @param error Error, if any, otherwise `null`\n * @param [contents] File contents, if there hasn't been an error\n */\ntype FetchCallback = (error: Error, contents?: string) => void;\n\n/** Options as used by {@link util.fetch}. */\nexport interface IFetchOptions {\n\n    /** Whether expecting a binary response */\n    binary?: boolean;\n\n    /** If `true`, forces the use of XMLHttpRequest */\n    xhr?: boolean;\n}\n\n/**\n * An allocator as used by {@link util.pool}.\n * @param size Buffer size\n * @returns Buffer\n */\ntype PoolAllocator = (size: number) => Uint8Array;\n\n/**\n * A slicer as used by {@link util.pool}.\n * @param start Start offset\n * @param end End offset\n * @returns Buffer slice\n */\ntype PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;\n"
  },
  {
    "path": "index.js",
    "content": "// full library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index\");\n"
  },
  {
    "path": "lib/aspromise/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/aspromise/README.md",
    "content": "@protobufjs/aspromise\n=====================\n[![npm](https://img.shields.io/npm/v/@protobufjs/aspromise.svg)](https://www.npmjs.com/package/@protobufjs/aspromise)\n\nReturns a promise from a node-style callback function.\n\nAPI\n---\n\n* **asPromise(fn: `function`, ctx: `Object`, ...params: `*`): `Promise<*>`**<br />\n  Returns a promise from a node-style callback function.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/aspromise/index.d.ts",
    "content": "export = asPromise;\n\ntype asPromiseCallback = (error: Error | null, ...params: any[]) => {};\n\n/**\n * Returns a promise from a node-style callback function.\n * @memberof util\n * @param {asPromiseCallback} fn Function to call\n * @param {*} ctx Function context\n * @param {...*} params Function arguments\n * @returns {Promise<*>} Promisified function\n */\ndeclare function asPromise(fn: asPromiseCallback, ctx: any, ...params: any[]): Promise<any>;\n"
  },
  {
    "path": "lib/aspromise/index.js",
    "content": "\"use strict\";\nmodule.exports = asPromise;\n\n/**\n * Callback as used by {@link util.asPromise}.\n * @typedef asPromiseCallback\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {...*} params Additional arguments\n * @returns {undefined}\n */\n\n/**\n * Returns a promise from a node-style callback function.\n * @memberof util\n * @param {asPromiseCallback} fn Function to call\n * @param {*} ctx Function context\n * @param {...*} params Function arguments\n * @returns {Promise<*>} Promisified function\n */\nfunction asPromise(fn, ctx/*, varargs */) {\n    var params  = new Array(arguments.length - 1),\n        offset  = 0,\n        index   = 2,\n        pending = true;\n    while (index < arguments.length)\n        params[offset++] = arguments[index++];\n    return new Promise(function executor(resolve, reject) {\n        params[offset] = function callback(err/*, varargs */) {\n            if (pending) {\n                pending = false;\n                if (err)\n                    reject(err);\n                else {\n                    var params = new Array(arguments.length - 1),\n                        offset = 0;\n                    while (offset < params.length)\n                        params[offset++] = arguments[offset];\n                    resolve.apply(null, params);\n                }\n            }\n        };\n        try {\n            fn.apply(ctx || null, params);\n        } catch (err) {\n            if (pending) {\n                pending = false;\n                reject(err);\n            }\n        }\n    });\n}\n"
  },
  {
    "path": "lib/aspromise/package.json",
    "content": "{\n  \"name\": \"@protobufjs/aspromise\",\n  \"description\": \"Returns a promise from a node-style callback function.\",\n  \"version\": \"1.1.2\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}"
  },
  {
    "path": "lib/aspromise/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar asPromise = require(\"..\");\n\ntape.test(\"aspromise\", function(test) {\n\n    test.test(this.name + \" - resolve\", function(test) {\n\n        function fn(arg1, arg2, callback) {\n            test.equal(this, ctx, \"function should be called with this = ctx\");\n            test.equal(arg1, 1, \"function should be called with arg1 = 1\");\n            test.equal(arg2, 2, \"function should be called with arg2 = 2\");\n            callback(null, arg2);\n        }\n\n        var ctx = {};\n\n        var promise = asPromise(fn, ctx, 1, 2);\n        promise.then(function(arg2) {\n            test.equal(arg2, 2, \"promise should be resolved with arg2 = 2\");\n            test.end();\n        }).catch(function(err) {\n            test.fail(\"promise should not be rejected (\" + err + \")\");\n        });\n    });\n\n    test.test(this.name + \" - reject\", function(test) {\n\n        function fn(arg1, arg2, callback) {\n            test.equal(this, ctx, \"function should be called with this = ctx\");\n            test.equal(arg1, 1, \"function should be called with arg1 = 1\");\n            test.equal(arg2, 2, \"function should be called with arg2 = 2\");\n            callback(arg1);\n        }\n\n        var ctx = {};\n\n        var promise = asPromise(fn, ctx, 1, 2);\n        promise.then(function() {\n            test.fail(\"promise should not be resolved\");\n        }).catch(function(err) {\n            test.equal(err, 1, \"promise should be rejected with err = 1\");\n            test.end();\n        });\n    });\n\n    test.test(this.name + \" - resolve twice\", function(test) {\n\n        function fn(arg1, arg2, callback) {\n            test.equal(this, ctx, \"function should be called with this = ctx\");\n            test.equal(arg1, 1, \"function should be called with arg1 = 1\");\n            test.equal(arg2, 2, \"function should be called with arg2 = 2\");\n            callback(null, arg2);\n            callback(null, arg1);\n        }\n\n        var ctx = {};\n        var count = 0;\n\n        var promise = asPromise(fn, ctx, 1, 2);\n        promise.then(function(arg2) {\n            test.equal(arg2, 2, \"promise should be resolved with arg2 = 2\");\n            if (++count > 1)\n                test.fail(\"promise should not be resolved twice\");\n            test.end();\n        }).catch(function(err) {\n            test.fail(\"promise should not be rejected (\" + err + \")\");\n        });\n    });\n\n    test.test(this.name + \" - reject twice\", function(test) {\n\n        function fn(arg1, arg2, callback) {\n            test.equal(this, ctx, \"function should be called with this = ctx\");\n            test.equal(arg1, 1, \"function should be called with arg1 = 1\");\n            test.equal(arg2, 2, \"function should be called with arg2 = 2\");\n            callback(arg1);\n            callback(arg2);\n        }\n\n        var ctx = {};\n        var count = 0;\n\n        var promise = asPromise(fn, ctx, 1, 2);\n        promise.then(function() {\n            test.fail(\"promise should not be resolved\");\n        }).catch(function(err) {\n            test.equal(err, 1, \"promise should be rejected with err = 1\");\n            if (++count > 1)\n                test.fail(\"promise should not be rejected twice\");\n            test.end();\n        });\n    });\n\n    test.test(this.name + \" - reject error\", function(test) {\n\n        function fn(callback) {\n            test.ok(arguments.length === 1 && typeof callback === \"function\", \"function should be called with just a callback\");\n            throw 3;\n        }\n\n        var promise = asPromise(fn, null);\n        promise.then(function() {\n            test.fail(\"promise should not be resolved\");\n        }).catch(function(err) {\n            test.equal(err, 3, \"promise should be rejected with err = 3\");\n            test.end();\n        });\n    });\n\n    test.test(this.name + \" - reject and error\", function(test) {\n\n        function fn(callback) {\n            callback(3);\n            throw 4;\n        }\n\n        var count = 0;\n\n        var promise = asPromise(fn, null);\n        promise.then(function() {\n            test.fail(\"promise should not be resolved\");\n        }).catch(function(err) {\n            test.equal(err, 3, \"promise should be rejected with err = 3\");\n            if (++count > 1)\n                test.fail(\"promise should not be rejected twice\");\n            test.end();\n        });\n    });\n});\n"
  },
  {
    "path": "lib/base64/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/base64/README.md",
    "content": "@protobufjs/base64\n==================\n[![npm](https://img.shields.io/npm/v/@protobufjs/base64.svg)](https://www.npmjs.com/package/@protobufjs/base64)\n\nA minimal base64 implementation for number arrays.\n\nAPI\n---\n\n* **base64.length(string: `string`): `number`**<br />\n  Calculates the byte length of a base64 encoded string.\n\n* **base64.encode(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />\n  Encodes a buffer to a base64 encoded string.\n\n* **base64.decode(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />\n  Decodes a base64 encoded string to a buffer.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/base64/index.d.ts",
    "content": "/**\n * Calculates the byte length of a base64 encoded string.\n * @param {string} string Base64 encoded string\n * @returns {number} Byte length\n */\nexport function length(string: string): number;\n\n/**\n * Encodes a buffer to a base64 encoded string.\n * @param {Uint8Array} buffer Source buffer\n * @param {number} start Source start\n * @param {number} end Source end\n * @returns {string} Base64 encoded string\n */\nexport function encode(buffer: Uint8Array, start: number, end: number): string;\n\n/**\n * Decodes a base64 encoded string to a buffer.\n * @param {string} string Source string\n * @param {Uint8Array} buffer Destination buffer\n * @param {number} offset Destination offset\n * @returns {number} Number of bytes written\n * @throws {Error} If encoding is invalid\n */\nexport function decode(string: string, buffer: Uint8Array, offset: number): number;\n\n/**\n * Tests if the specified string appears to be base64 encoded.\n * @param {string} string String to test\n * @returns {boolean} `true` if it appears to be base64 encoded, otherwise false\n */\nexport function test(string: string): boolean;\n"
  },
  {
    "path": "lib/base64/index.js",
    "content": "\"use strict\";\n\n/**\n * A minimal base64 implementation for number arrays.\n * @memberof util\n * @namespace\n */\nvar base64 = exports;\n\n/**\n * Calculates the byte length of a base64 encoded string.\n * @param {string} string Base64 encoded string\n * @returns {number} Byte length\n */\nbase64.length = function length(string) {\n    var p = string.length;\n    if (!p)\n        return 0;\n    var n = 0;\n    while (--p % 4 > 1 && string.charAt(p) === \"=\")\n        ++n;\n    return Math.ceil(string.length * 3) / 4 - n;\n};\n\n// Base64 encoding table\nvar b64 = new Array(64);\n\n// Base64 decoding table\nvar s64 = new Array(123);\n\n// 65..90, 97..122, 48..57, 43, 47\nfor (var i = 0; i < 64;)\n    s64[b64[i] = i < 26 ? i + 65 : i < 52 ? i + 71 : i < 62 ? i - 4 : i - 59 | 43] = i++;\n\n/**\n * Encodes a buffer to a base64 encoded string.\n * @param {Uint8Array} buffer Source buffer\n * @param {number} start Source start\n * @param {number} end Source end\n * @returns {string} Base64 encoded string\n */\nbase64.encode = function encode(buffer, start, end) {\n    var parts = null,\n        chunk = [];\n    var i = 0, // output index\n        j = 0, // goto index\n        t;     // temporary\n    while (start < end) {\n        var b = buffer[start++];\n        switch (j) {\n            case 0:\n                chunk[i++] = b64[b >> 2];\n                t = (b & 3) << 4;\n                j = 1;\n                break;\n            case 1:\n                chunk[i++] = b64[t | b >> 4];\n                t = (b & 15) << 2;\n                j = 2;\n                break;\n            case 2:\n                chunk[i++] = b64[t | b >> 6];\n                chunk[i++] = b64[b & 63];\n                j = 0;\n                break;\n        }\n        if (i > 8191) {\n            (parts || (parts = [])).push(String.fromCharCode.apply(String, chunk));\n            i = 0;\n        }\n    }\n    if (j) {\n        chunk[i++] = b64[t];\n        chunk[i++] = 61;\n        if (j === 1)\n            chunk[i++] = 61;\n    }\n    if (parts) {\n        if (i)\n            parts.push(String.fromCharCode.apply(String, chunk.slice(0, i)));\n        return parts.join(\"\");\n    }\n    return String.fromCharCode.apply(String, chunk.slice(0, i));\n};\n\nvar invalidEncoding = \"invalid encoding\";\n\n/**\n * Decodes a base64 encoded string to a buffer.\n * @param {string} string Source string\n * @param {Uint8Array} buffer Destination buffer\n * @param {number} offset Destination offset\n * @returns {number} Number of bytes written\n * @throws {Error} If encoding is invalid\n */\nbase64.decode = function decode(string, buffer, offset) {\n    var start = offset;\n    var j = 0, // goto index\n        t;     // temporary\n    for (var i = 0; i < string.length;) {\n        var c = string.charCodeAt(i++);\n        if (c === 61 && j > 1)\n            break;\n        if ((c = s64[c]) === undefined)\n            throw Error(invalidEncoding);\n        switch (j) {\n            case 0:\n                t = c;\n                j = 1;\n                break;\n            case 1:\n                buffer[offset++] = t << 2 | (c & 48) >> 4;\n                t = c;\n                j = 2;\n                break;\n            case 2:\n                buffer[offset++] = (t & 15) << 4 | (c & 60) >> 2;\n                t = c;\n                j = 3;\n                break;\n            case 3:\n                buffer[offset++] = (t & 3) << 6 | c;\n                j = 0;\n                break;\n        }\n    }\n    if (j === 1)\n        throw Error(invalidEncoding);\n    return offset - start;\n};\n\n/**\n * Tests if the specified string appears to be base64 encoded.\n * @param {string} string String to test\n * @returns {boolean} `true` if probably base64 encoded, otherwise false\n */\nbase64.test = function test(string) {\n    return /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(string);\n};\n"
  },
  {
    "path": "lib/base64/package.json",
    "content": "{\n  \"name\": \"@protobufjs/base64\",\n  \"description\": \"A minimal base64 implementation for number arrays.\",\n  \"version\": \"1.1.2\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}"
  },
  {
    "path": "lib/base64/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar base64 = require(\"..\");\n\nvar strings = {\n    \"\": \"\",\n    \"a\": \"YQ==\",\n    \"ab\": \"YWI=\",\n    \"abcdefg\": \"YWJjZGVmZw==\",\n    \"abcdefgh\": \"YWJjZGVmZ2g=\",\n    \"abcdefghi\": \"YWJjZGVmZ2hp\"\n};\n\ntape.test(\"base64\", function(test) {\n\n    Object.keys(strings).forEach(function(str) {\n        var enc = strings[str];\n\n        test.equal(base64.test(enc), true, \"should detect '\" + enc + \"' to be base64 encoded\");\n\n        var len = base64.length(enc);\n        test.equal(len, str.length, \"should calculate '\" + enc + \"' as \" + str.length + \" bytes\");\n\n        var buf = new Array(len);\n        var len2 = base64.decode(enc, buf, 0);\n        test.equal(len2, len, \"should decode '\" + enc + \"' to \" + len + \" bytes\");\n\n        test.equal(String.fromCharCode.apply(String, buf), str, \"should decode '\" + enc + \"' to '\" + str + \"'\");\n\n        var enc2 = base64.encode(buf, 0, buf.length);\n        test.equal(enc2, enc, \"should encode '\" + str + \"' to '\" + enc + \"'\");\n\n    });\n\n    test.throws(function() {\n        var buf = new Array(10);\n        base64.decode(\"YQ!\", buf, 0);\n    }, Error, \"should throw if encoding is invalid\");\n\n    test.throws(function() {\n        var buf = new Array(10);\n        base64.decode(\"Y\", buf, 0);\n    }, Error, \"should throw if string is truncated\");\n\n    test.end();\n});\n"
  },
  {
    "path": "lib/codegen/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/codegen/README.md",
    "content": "@protobufjs/codegen\n===================\n[![npm](https://img.shields.io/npm/v/@protobufjs/codegen.svg)](https://www.npmjs.com/package/@protobufjs/codegen)\n\nA minimalistic code generation utility.\n\nAPI\n---\n\n* **codegen([functionParams: `string[]`], [functionName: string]): `Codegen`**<br />\n  Begins generating a function.\n\n* **codegen.verbose = `false`**<br />\n  When set to true, codegen will log generated code to console. Useful for debugging.\n\nInvoking **codegen** returns an appender function that appends code to the function's body and returns itself:\n\n* **Codegen(formatString: `string`, [...formatParams: `any`]): Codegen**<br />\n  Appends code to the function's body. The format string can contain placeholders specifying the types of inserted format parameters:\n\n  * `%d`: Number (integer or floating point value)\n  * `%f`: Floating point value\n  * `%i`: Integer value\n  * `%j`: JSON.stringify'ed value\n  * `%s`: String value\n  * `%%`: Percent sign<br />\n\n* **Codegen([scope: `Object.<string,*>`]): `Function`**<br />\n  Finishes the function and returns it.\n\n* **Codegen.toString([functionNameOverride: `string`]): `string`**<br />\n  Returns the function as a string.\n\nExample\n-------\n\n```js\nvar codegen = require(\"@protobufjs/codegen\");\n\nvar add = codegen([\"a\", \"b\"], \"add\") // A function with parameters \"a\" and \"b\" named \"add\"\n  (\"// awesome comment\")             // adds the line to the function's body\n  (\"return a + b - c + %d\", 1)       // replaces %d with 1 and adds the line to the body\n  ({ c: 1 });                        // adds \"c\" with a value of 1 to the function's scope\n\nconsole.log(add.toString()); // function add(a, b) { return a + b - c + 1 }\nconsole.log(add(1, 2));      // calculates 1 + 2 - 1 + 1 = 3\n```\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/codegen/index.d.ts",
    "content": "export = codegen;\n\n/**\n * Appends code to the function's body.\n * @param [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\n * @param [formatParams] Format parameters\n * @returns Itself or the generated function if finished\n * @throws {Error} If format parameter counts do not match\n */\ntype Codegen = (formatStringOrScope?: (string|{ [k: string]: any }), ...formatParams: any[]) => (Codegen|Function);\n\n/**\n * Begins generating a function.\n * @param functionParams Function parameter names\n * @param [functionName] Function name if not anonymous\n * @returns Appender that appends code to the function's body\n */\ndeclare function codegen(functionParams: string[], functionName?: string): Codegen;\n\n/**\n * Begins generating a function.\n * @param [functionName] Function name if not anonymous\n * @returns Appender that appends code to the function's body\n */\ndeclare function codegen(functionName?: string): Codegen;\n\ndeclare namespace codegen {\n\n    /** When set to `true`, codegen will log generated code to console. Useful for debugging. */\n    let verbose: boolean;\n}\n"
  },
  {
    "path": "lib/codegen/index.js",
    "content": "\"use strict\";\nmodule.exports = codegen;\n\n/**\n * Begins generating a function.\n * @memberof util\n * @param {string[]} functionParams Function parameter names\n * @param {string} [functionName] Function name if not anonymous\n * @returns {Codegen} Appender that appends code to the function's body\n */\nfunction codegen(functionParams, functionName) {\n\n    /* istanbul ignore if */\n    if (typeof functionParams === \"string\") {\n        functionName = functionParams;\n        functionParams = undefined;\n    }\n\n    var body = [];\n\n    /**\n     * Appends code to the function's body or finishes generation.\n     * @typedef Codegen\n     * @type {function}\n     * @param {string|Object.<string,*>} [formatStringOrScope] Format string or, to finish the function, an object of additional scope variables, if any\n     * @param {...*} [formatParams] Format parameters\n     * @returns {Codegen|Function} Itself or the generated function if finished\n     * @throws {Error} If format parameter counts do not match\n     */\n\n    function Codegen(formatStringOrScope) {\n        // note that explicit array handling below makes this ~50% faster\n\n        // finish the function\n        if (typeof formatStringOrScope !== \"string\") {\n            var source = toString();\n            if (codegen.verbose)\n                console.log(\"codegen: \" + source); // eslint-disable-line no-console\n            source = \"return \" + source;\n            if (formatStringOrScope) {\n                var scopeKeys   = Object.keys(formatStringOrScope),\n                    scopeParams = new Array(scopeKeys.length + 1),\n                    scopeValues = new Array(scopeKeys.length),\n                    scopeOffset = 0;\n                while (scopeOffset < scopeKeys.length) {\n                    scopeParams[scopeOffset] = scopeKeys[scopeOffset];\n                    scopeValues[scopeOffset] = formatStringOrScope[scopeKeys[scopeOffset++]];\n                }\n                scopeParams[scopeOffset] = source;\n                return Function.apply(null, scopeParams).apply(null, scopeValues); // eslint-disable-line no-new-func\n            }\n            return Function(source)(); // eslint-disable-line no-new-func\n        }\n\n        // otherwise append to body\n        var formatParams = new Array(arguments.length - 1),\n            formatOffset = 0;\n        while (formatOffset < formatParams.length)\n            formatParams[formatOffset] = arguments[++formatOffset];\n        formatOffset = 0;\n        formatStringOrScope = formatStringOrScope.replace(/%([%dfijs])/g, function replace($0, $1) {\n            var value = formatParams[formatOffset++];\n            switch ($1) {\n                case \"d\": case \"f\": return String(Number(value));\n                case \"i\": return String(Math.floor(value));\n                case \"j\": return JSON.stringify(value);\n                case \"s\": return String(value);\n            }\n            return \"%\";\n        });\n        if (formatOffset !== formatParams.length)\n            throw Error(\"parameter count mismatch\");\n        body.push(formatStringOrScope);\n        return Codegen;\n    }\n\n    function toString(functionNameOverride) {\n        return \"function \" + (functionNameOverride || functionName || \"\") + \"(\" + (functionParams && functionParams.join(\",\") || \"\") + \"){\\n  \" + body.join(\"\\n  \") + \"\\n}\";\n    }\n\n    Codegen.toString = toString;\n    return Codegen;\n}\n\n/**\n * Begins generating a function.\n * @memberof util\n * @function codegen\n * @param {string} [functionName] Function name if not anonymous\n * @returns {Codegen} Appender that appends code to the function's body\n * @variation 2\n */\n\n/**\n * When set to `true`, codegen will log generated code to console. Useful for debugging.\n * @name util.codegen.verbose\n * @type {boolean}\n */\ncodegen.verbose = false;\n"
  },
  {
    "path": "lib/codegen/package.json",
    "content": "{\n  \"name\": \"@protobufjs/codegen\",\n  \"description\": \"A minimalistic code generation utility.\",\n  \"version\": \"2.0.4\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\"\n}"
  },
  {
    "path": "lib/codegen/tests/index.js",
    "content": "var codegen = require(\"..\");\n\n// new require(\"benchmark\").Suite().add(\"add\", function() {\n\nvar add = codegen([\"a\", \"b\"], \"add\")\n  (\"// awesome comment\")\n  (\"return a + b - c + %d\", 1)\n  ({ c: 1 });\n\nif (add(1, 2) !== 3)\n  throw Error(\"failed\");\n\n// }).on(\"cycle\", function(event) { process.stdout.write(String(event.target) + \"\\n\"); }).run();\n"
  },
  {
    "path": "lib/deep-equal/LICENSE",
    "content": "This software is released under the MIT license:\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "lib/deep-equal/README.md",
    "content": "Forked [node-deep-equal](https://github.com/substack/node-deep-equal)@1.0.1 with monkey-patched buffer equality.\n\nLicense: MIT. Derived largely from node's assert module.\n"
  },
  {
    "path": "lib/deep-equal/index.js",
    "content": "var pSlice = Array.prototype.slice;\nvar objectKeys = require('./lib/keys.js');\nvar isArguments = require('./lib/is_arguments.js');\n\nvar deepEqual = module.exports = function (actual, expected, opts) {\n  if (!opts) opts = {};\n  // 7.1. All identical values are equivalent, as determined by ===.\n  if (actual === expected) {\n    return true;\n\n  } else if (actual instanceof Date && expected instanceof Date) {\n    return actual.getTime() === expected.getTime();\n\n  // 7.3. Other pairs that do not both pass typeof value == 'object',\n  // equivalence is determined by ==.\n  } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {\n    return opts.strict ? actual === expected : actual == expected;\n\n  // 7.4. For all other Object pairs, including Array objects, equivalence is\n  // determined by having the same number of owned properties (as verified\n  // with Object.prototype.hasOwnProperty.call), the same set of keys\n  // (although not necessarily the same order), equivalent values for every\n  // corresponding key, and an identical 'prototype' property. Note: this\n  // accounts for both named and indexed properties on Arrays.\n  } else {\n    return objEquiv(actual, expected, opts);\n  }\n}\n\nfunction isUndefinedOrNull(value) {\n  return value === null || value === undefined;\n}\n\nfunction isBuffer (x) {\n  if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;\n  // MONKEY PATCH: Support buffer, Uint8Array and Array alike\n  /* if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {\n    return false;\n  } */\n  if (x.length > 0 && typeof x[0] !== 'number') return false;\n  return true;\n}\n\nfunction objEquiv(a, b, opts) {\n  var i, key;\n  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))\n    return false;\n  // an identical 'prototype' property.\n  if (a.prototype !== b.prototype) return false;\n  //~~~I've managed to break Object.keys through screwy arguments passing.\n  //   Converting to array solves the problem.\n  if (isArguments(a)) {\n    if (!isArguments(b)) {\n      return false;\n    }\n    a = pSlice.call(a);\n    b = pSlice.call(b);\n    return deepEqual(a, b, opts);\n  }\n  if (isBuffer(a)) {\n    if (!isBuffer(b)) {\n      return false;\n    }\n    if (a.length !== b.length) return false;\n    for (i = 0; i < a.length; i++) {\n      if (a[i] !== b[i]) return false;\n    }\n    return true;\n  }\n  try {\n    var ka = objectKeys(a),\n        kb = objectKeys(b);\n  } catch (e) {//happens when one is a string literal and the other isn't\n    return false;\n  }\n  // having the same number of owned properties (keys incorporates\n  // hasOwnProperty)\n  if (ka.length != kb.length)\n    return false;\n  //the same set of keys (although not necessarily the same order),\n  ka.sort();\n  kb.sort();\n  //~~~cheap key test\n  for (i = ka.length - 1; i >= 0; i--) {\n    if (ka[i] != kb[i])\n      return false;\n  }\n  //equivalent values for every corresponding key, and\n  //~~~possibly expensive deep test\n  for (i = ka.length - 1; i >= 0; i--) {\n    key = ka[i];\n    if (!deepEqual(a[key], b[key], opts)) return false;\n  }\n  return typeof a === typeof b;\n}"
  },
  {
    "path": "lib/deep-equal/lib/is_arguments.js",
    "content": "var supportsArgumentsClass = (function(){\n  return Object.prototype.toString.call(arguments)\n})() == '[object Arguments]';\n\nexports = module.exports = supportsArgumentsClass ? supported : unsupported;\n\nexports.supported = supported;\nfunction supported(object) {\n  return Object.prototype.toString.call(object) == '[object Arguments]';\n};\n\nexports.unsupported = unsupported;\nfunction unsupported(object){\n  return object &&\n    typeof object == 'object' &&\n    typeof object.length == 'number' &&\n    Object.prototype.hasOwnProperty.call(object, 'callee') &&\n    !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||\n    false;\n};"
  },
  {
    "path": "lib/deep-equal/lib/keys.js",
    "content": "exports = module.exports = typeof Object.keys === 'function'\n  ? Object.keys : shim;\n\nexports.shim = shim;\nfunction shim (obj) {\n  var keys = [];\n  for (var key in obj) keys.push(key);\n  return keys;\n}"
  },
  {
    "path": "lib/eventemitter/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/eventemitter/README.md",
    "content": "@protobufjs/eventemitter\n========================\n[![npm](https://img.shields.io/npm/v/@protobufjs/eventemitter.svg)](https://www.npmjs.com/package/@protobufjs/eventemitter)\n\nA minimal event emitter.\n\nAPI\n---\n\n* **new EventEmitter()**<br />\n  Constructs a new event emitter instance.\n\n* **EventEmitter#on(evt: `string`, fn: `function`, [ctx: `Object`]): `EventEmitter`**<br />\n  Registers an event listener.\n\n* **EventEmitter#off([evt: `string`], [fn: `function`]): `EventEmitter`**<br />\n  Removes an event listener or any matching listeners if arguments are omitted.\n\n* **EventEmitter#emit(evt: `string`, ...args: `*`): `EventEmitter`**<br />\n  Emits an event by calling its listeners with the specified arguments.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/eventemitter/index.d.ts",
    "content": "export = EventEmitter;\n\ntype EventEmitterListener = (...args: any[]) => {};\n\n/**\n * Constructs a new event emitter instance.\n * @classdesc A minimal event emitter.\n * @memberof util\n * @constructor\n */\ndeclare class EventEmitter {\n\n    /**\n     * Constructs a new event emitter instance.\n     * @classdesc A minimal event emitter.\n     * @memberof util\n     * @constructor\n     */\n    constructor();\n\n    /**\n     * Registers an event listener.\n     * @param {string} evt Event name\n     * @param {EventEmitterListener} fn Listener\n     * @param {*} [ctx] Listener context\n     * @returns {this} `this`\n     */\n    public on(evt: string, fn: EventEmitterListener, ctx?: any): EventEmitter;\n\n    /**\n     * Removes an event listener or any matching listeners if arguments are omitted.\n     * @param {string} [evt] Event name. Removes all listeners if omitted.\n     * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\n     * @returns {this} `this`\n     */\n    public off(evt?: string, fn?: EventEmitterListener): EventEmitter;\n\n    /**\n     * Emits an event by calling its listeners with the specified arguments.\n     * @param {string} evt Event name\n     * @param {...*} args Arguments\n     * @returns {this} `this`\n     */\n    public emit(evt: string, ...args: any[]): EventEmitter;\n}\n"
  },
  {
    "path": "lib/eventemitter/index.js",
    "content": "\"use strict\";\nmodule.exports = EventEmitter;\n\n/**\n * Constructs a new event emitter instance.\n * @classdesc A minimal event emitter.\n * @memberof util\n * @constructor\n */\nfunction EventEmitter() {\n\n    /**\n     * Registered listeners.\n     * @type {Object.<string,*>}\n     * @private\n     */\n    this._listeners = {};\n}\n\n/**\n * Event listener as used by {@link util.EventEmitter}.\n * @typedef EventEmitterListener\n * @type {function}\n * @param {...*} args Arguments\n * @returns {undefined}\n */\n\n/**\n * Registers an event listener.\n * @param {string} evt Event name\n * @param {EventEmitterListener} fn Listener\n * @param {*} [ctx] Listener context\n * @returns {this} `this`\n */\nEventEmitter.prototype.on = function on(evt, fn, ctx) {\n    (this._listeners[evt] || (this._listeners[evt] = [])).push({\n        fn  : fn,\n        ctx : ctx || this\n    });\n    return this;\n};\n\n/**\n * Removes an event listener or any matching listeners if arguments are omitted.\n * @param {string} [evt] Event name. Removes all listeners if omitted.\n * @param {EventEmitterListener} [fn] Listener to remove. Removes all listeners of `evt` if omitted.\n * @returns {this} `this`\n */\nEventEmitter.prototype.off = function off(evt, fn) {\n    if (evt === undefined)\n        this._listeners = {};\n    else {\n        if (fn === undefined)\n            this._listeners[evt] = [];\n        else {\n            var listeners = this._listeners[evt];\n            for (var i = 0; i < listeners.length;)\n                if (listeners[i].fn === fn)\n                    listeners.splice(i, 1);\n                else\n                    ++i;\n        }\n    }\n    return this;\n};\n\n/**\n * Emits an event by calling its listeners with the specified arguments.\n * @param {string} evt Event name\n * @param {...*} args Arguments\n * @returns {this} `this`\n */\nEventEmitter.prototype.emit = function emit(evt) {\n    var listeners = this._listeners[evt];\n    if (listeners) {\n        var args = [],\n            i = 1;\n        for (; i < arguments.length;)\n            args.push(arguments[i++]);\n        for (i = 0; i < listeners.length;)\n            listeners[i].fn.apply(listeners[i++].ctx, args);\n    }\n    return this;\n};\n"
  },
  {
    "path": "lib/eventemitter/package.json",
    "content": "{\n  \"name\": \"@protobufjs/eventemitter\",\n  \"description\": \"A minimal event emitter.\",\n  \"version\": \"1.1.0\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}"
  },
  {
    "path": "lib/eventemitter/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar EventEmitter = require(\"..\");\n\ntape.test(\"eventemitter\", function(test) {\n\n    var ee = new EventEmitter();\n    var fn;\n    var ctx = {};\n\n    test.doesNotThrow(function() {\n        ee.emit(\"a\", 1);\n        ee.off();\n        ee.off(\"a\");\n        ee.off(\"a\", function() {});\n    }, \"should not throw if no listeners are registered\");\n    \n    test.equal(ee.on(\"a\", function(arg1) {\n        test.equal(this, ctx, \"should be called with this = ctx\");\n        test.equal(arg1, 1, \"should be called with arg1 = 1\");\n    }, ctx), ee, \"should return itself when registering events\");\n    ee.emit(\"a\", 1);\n\n    ee.off(\"a\");\n    test.same(ee._listeners, { a: [] }, \"should remove all listeners of the respective event when calling off(evt)\");\n\n    ee.off();\n    test.same(ee._listeners, {}, \"should remove all listeners when just calling off()\");\n\n    ee.on(\"a\", fn = function(arg1) {\n        test.equal(this, ctx, \"should be called with this = ctx\");\n        test.equal(arg1, 1, \"should be called with arg1 = 1\");\n    }, ctx).emit(\"a\", 1);\n\n    ee.off(\"a\", fn);\n    test.same(ee._listeners, { a: [] }, \"should remove the exact listener when calling off(evt, fn)\");\n\n    ee.on(\"a\", function() {\n        test.equal(this, ee, \"should be called with this = ee\");\n    }).emit(\"a\");\n\n    test.doesNotThrow(function() {\n        ee.off(\"a\", fn);\n    }, \"should not throw if no such listener is found\");\n\n    test.end();\n});\n"
  },
  {
    "path": "lib/fetch/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/fetch/README.md",
    "content": "@protobufjs/fetch\n=================\n[![npm](https://img.shields.io/npm/v/@protobufjs/fetch.svg)](https://www.npmjs.com/package/@protobufjs/fetch)\n\nFetches the contents of a file accross node and browsers.\n\nAPI\n---\n\n* **fetch(path: `string`, [options: { binary: boolean } ], [callback: `function(error: ?Error, [contents: string])`]): `Promise<string|Uint8Array>|undefined`**\n  Fetches the contents of a file.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/fetch/index.d.ts",
    "content": "export = fetch;\n\n/**\n * Node-style callback as used by {@link util.fetch}.\n * @typedef FetchCallback\n * @type {function}\n * @param {?Error} error Error, if any, otherwise `null`\n * @param {string} [contents] File contents, if there hasn't been an error\n * @returns {undefined}\n */\ntype FetchCallback = (error: Error, contents?: string) => void;\n\n/**\n * Options as used by {@link util.fetch}.\n * @typedef IFetchOptions\n * @type {Object}\n * @property {boolean} [binary=false] Whether expecting a binary response\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\n */\n\ninterface IFetchOptions {\n    binary?: boolean;\n    xhr?: boolean;\n}\n\n/**\n * Fetches the contents of a file.\n * @memberof util\n * @param {string} filename File path or url\n * @param {IFetchOptions} options Fetch options\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\ndeclare function fetch(filename: string, options: IFetchOptions, callback: FetchCallback): void;\n\n/**\n * Fetches the contents of a file.\n * @name util.fetch\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\ndeclare function fetch(path: string, callback: FetchCallback): void;\n\n/**\n * Fetches the contents of a file.\n * @name util.fetch\n * @function\n * @param {string} path File path or url\n * @param {IFetchOptions} [options] Fetch options\n * @returns {Promise<string|Uint8Array>} Promise\n * @variation 3\n */\ndeclare function fetch(path: string, options?: IFetchOptions): Promise<(string|Uint8Array)>;\n"
  },
  {
    "path": "lib/fetch/index.js",
    "content": "\"use strict\";\nmodule.exports = fetch;\n\nvar asPromise = require(\"@protobufjs/aspromise\"),\n    inquire   = require(\"@protobufjs/inquire\");\n\nvar fs = inquire(\"fs\");\n\n/**\n * Node-style callback as used by {@link util.fetch}.\n * @typedef FetchCallback\n * @type {function}\n * @param {?Error} error Error, if any, otherwise `null`\n * @param {string} [contents] File contents, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Options as used by {@link util.fetch}.\n * @interface IFetchOptions\n * @property {boolean} [binary=false] Whether expecting a binary response\n * @property {boolean} [xhr=false] If `true`, forces the use of XMLHttpRequest\n */\n\n/**\n * Fetches the contents of a file.\n * @memberof util\n * @param {string} filename File path or url\n * @param {IFetchOptions} options Fetch options\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nfunction fetch(filename, options, callback) {\n    if (typeof options === \"function\") {\n        callback = options;\n        options = {};\n    } else if (!options)\n        options = {};\n\n    if (!callback)\n        return asPromise(fetch, this, filename, options); // eslint-disable-line no-invalid-this\n\n    // if a node-like filesystem is present, try it first but fall back to XHR if nothing is found.\n    if (!options.xhr && fs && fs.readFile)\n        return fs.readFile(filename, function fetchReadFileCallback(err, contents) {\n            return err && typeof XMLHttpRequest !== \"undefined\"\n                ? fetch.xhr(filename, options, callback)\n                : err\n                ? callback(err)\n                : callback(null, options.binary ? contents : contents.toString(\"utf8\"));\n        });\n\n    // use the XHR version otherwise.\n    return fetch.xhr(filename, options, callback);\n}\n\n/**\n * Fetches the contents of a file.\n * @name util.fetch\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n\n/**\n * Fetches the contents of a file.\n * @name util.fetch\n * @function\n * @param {string} path File path or url\n * @param {IFetchOptions} [options] Fetch options\n * @returns {Promise<string|Uint8Array>} Promise\n * @variation 3\n */\n\n/**/\nfetch.xhr = function fetch_xhr(filename, options, callback) {\n    var xhr = new XMLHttpRequest();\n    xhr.onreadystatechange /* works everywhere */ = function fetchOnReadyStateChange() {\n\n        if (xhr.readyState !== 4)\n            return undefined;\n\n        // local cors security errors return status 0 / empty string, too. afaik this cannot be\n        // reliably distinguished from an actually empty file for security reasons. feel free\n        // to send a pull request if you are aware of a solution.\n        if (xhr.status !== 0 && xhr.status !== 200)\n            return callback(Error(\"status \" + xhr.status));\n\n        // if binary data is expected, make sure that some sort of array is returned, even if\n        // ArrayBuffers are not supported. the binary string fallback, however, is unsafe.\n        if (options.binary) {\n            var buffer = xhr.response;\n            if (!buffer) {\n                buffer = [];\n                for (var i = 0; i < xhr.responseText.length; ++i)\n                    buffer.push(xhr.responseText.charCodeAt(i) & 255);\n            }\n            return callback(null, typeof Uint8Array !== \"undefined\" ? new Uint8Array(buffer) : buffer);\n        }\n        return callback(null, xhr.responseText);\n    };\n\n    if (options.binary) {\n        // ref: https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Sending_and_Receiving_Binary_Data#Receiving_binary_data_in_older_browsers\n        if (\"overrideMimeType\" in xhr)\n            xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\n        xhr.responseType = \"arraybuffer\";\n    }\n\n    xhr.open(\"GET\", filename);\n    xhr.send();\n};\n"
  },
  {
    "path": "lib/fetch/package.json",
    "content": "{\n  \"name\": \"@protobufjs/fetch\",\n  \"description\": \"Fetches the contents of a file accross node and browsers.\",\n  \"version\": \"1.1.1\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"dependencies\": {\n    \"@protobufjs/aspromise\": \"^1.1.1\",\n    \"@protobufjs/inquire\": \"^1.1.0\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}"
  },
  {
    "path": "lib/fetch/tests/data/file.txt",
    "content": "file.txt"
  },
  {
    "path": "lib/fetch/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar fetch = require(\"..\");\n\ntape.test(\"fetch\", function(test) {\n\n    if (typeof Promise !== \"undefined\")\n        test.test(test.name + \" - promise\", function(test) {\n            var promise = fetch(\"NOTFOUND\");\n            test.plan(2);\n            test.ok(promise instanceof Promise, \"should return a promise if callback has been omitted\");\n            promise\n            .then(function() {\n                test.fail(\"should not resolve\");\n            })\n            .catch(function(err) {\n                test.ok(err, \"should reject with an error\");\n            });\n        });\n\n    test.test(test.name + \" - node fs\", function(test) {\n\n        test.test(test.name + \" - string\", function(test) {\n            test.plan(2);\n            fetch(require.resolve(\"./data/file.txt\"), function(err, contents) {\n                test.notOk(err, \"should not return an error\");\n                test.equal(contents, \"file.txt\", \"should return contents as a string\");\n            });\n        });\n\n        test.test(test.name + \" - binary\", function(test) {\n            test.plan(2);\n            fetch(require.resolve(\"./data/file.txt\"), { binary: true }, function(err, contents) {\n                test.notOk(err, \"should not return an error\");\n                test.same(contents, new Buffer(\"file.txt\", \"utf8\"), \"should return contents as a Buffer\");\n            });\n        });\n\n        test.test(test.name + \" - fallback\", function(test) {\n            test.plan(2);\n            global.XMLHttpRequest = fakeXHR(0);\n            fetch(\"file.txt\", function(err, contents) {\n                delete global.XMLHttpRequest;\n                test.notOk(err, \"should not return an error\");\n                test.same(contents, \"file.txt\", \"should return contents as a string\");\n            });\n        });\n\n        test.end();\n    });\n\n    test.test(test.name + \" - XMLHttpRequest\", function(test) {\n\n        test.test(test.name + \" - 404\", function(test) {\n            global.XMLHttpRequest = fakeXHR(404);\n            fetch(\"file.txt\", { xhr: true }, function(err) {\n                delete global.XMLHttpRequest;\n                test.ok(err, \"should return an error\");\n                test.end();\n            });\n        });\n\n        test.test(test.name + \" - string\", function(test) {\n            global.XMLHttpRequest = fakeXHR(0);\n            test.plan(2);\n            fetch(\"file.txt\", { xhr: true }, function(err, contents) {\n                delete global.XMLHttpRequest;\n                test.notOk(err, \"should not return an error\");\n                test.equal(contents, \"file.txt\", \"should return contents as a string\");\n            });\n        });\n\n        test.test(test.name + \" - binary\", function(test) {\n            global.XMLHttpRequest = fakeXHR(200);\n            test.plan(2);\n            fetch(\"file.txt\", { xhr: true, binary: true }, function(err, contents) {\n                delete global.XMLHttpRequest;\n                test.notOk(err, \"should not return an error\");\n                test.same(contents, new Uint8Array([0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74]), \"should return contents as an Uint8Array\");\n            });\n        });\n\n    });\n\n    test.test(test.name + \" - XMLHttpRequest (ancient)\", function(test) {\n\n        test.test(test.name + \" - string\", function(test) {\n            global.XMLHttpRequest = fakeXHR(0, true);\n            test.plan(2);\n            fetch(\"file.txt\", { xhr: true }, function(err, contents) {\n                delete global.XMLHttpRequest;\n                test.notOk(err, \"should not return an error\");\n                test.equal(contents, \"file.txt\", \"should return contents as a string\");\n            });\n        });\n\n        test.test(test.name + \" - binary\", function(test) {\n            global.XMLHttpRequest = fakeXHR(200, true);\n            var U8 = global.Uint8Array;\n            delete global.Uint8Array;\n            test.plan(2);\n            fetch(\"file.txt\", { xhr: true, binary: true }, function(err, contents) {\n                delete global.XMLHttpRequest;\n                global.Uint8Array = U8;\n                test.notOk(err, \"should not return an error\");\n                test.same(contents, [0x66, 0x69, 0x6c, 0x65, 0x2e, 0x74, 0x78, 0x74], \"should return contents as an Array\");\n            });\n        });\n\n    });\n\n});\n\nfunction fakeXHR(status, ancient) {\n\n    var UNSENT = 0,\n        OPENED = 1,\n        HEADERS_RECEIVED = 2,\n        LOADING = 3,\n        DONE = 4;\n\n    function XMLHttpRequest() {\n        this.status = 0;\n        this.readyState = UNSENT;\n    }\n    if (!ancient)\n        XMLHttpRequest.prototype.overrideMimeType = function(mimeType) {\n            this._mimeType = mimeType;\n        };\n    XMLHttpRequest.prototype.open = function open(method, path) {\n        this._method = method;\n        this._path = path;\n        this.readyState = OPENED;\n    };\n    XMLHttpRequest.prototype.send = function send() {\n        var self = this;\n        setTimeout(function() {\n            self.onreadystatechange(); // opened\n            self.readyState = HEADERS_RECEIVED;\n            self.onreadystatechange();\n            self.readyState = LOADING;\n            self.onreadystatechange();\n            self.readyState = DONE;\n            self.status = status;\n            if (self.responseType === \"arraybuffer\" && !ancient) {\n                var buf = new Buffer(self._path, \"utf8\");\n                var abuf = new ArrayBuffer(buf.length);\n                var view = new Uint8Array(abuf);\n                for (var i = 0; i < buf.length; ++i)\n                    view[i] = buf[i];\n                self.response = abuf;\n            } else\n                self.responseText = self._path;\n            self.onreadystatechange();\n        });\n    };\n    return XMLHttpRequest;\n}"
  },
  {
    "path": "lib/float/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/float/README.md",
    "content": "@protobufjs/float\n=================\n[![npm](https://img.shields.io/npm/v/@protobufjs/float.svg)](https://www.npmjs.com/package/@protobufjs/float)\n\nReads / writes floats / doubles from / to buffers in both modern and ancient browsers. Fast.\n\nAPI\n---\n\n* **writeFloatLE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\n  Writes a 32 bit float to a buffer using little endian byte order.\n\n* **writeFloatBE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\n  Writes a 32 bit float to a buffer using big endian byte order.\n\n* **readFloatLE(buf: `Uint8Array`, pos: `number`): `number`**<br />\n  Reads a 32 bit float from a buffer using little endian byte order.\n\n* **readFloatBE(buf: `Uint8Array`, pos: `number`): `number`**<br />\n  Reads a 32 bit float from a buffer using big endian byte order.\n\n* **writeDoubleLE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\n  Writes a 64 bit double to a buffer using little endian byte order.\n\n* **writeDoubleBE(val: `number`, buf: `Uint8Array`, pos: `number`)**<br />\n  Writes a 64 bit double to a buffer using big endian byte order.\n\n* **readDoubleLE(buf: `Uint8Array`, pos: `number`): `number`**<br />\n  Reads a 64 bit double from a buffer using little endian byte order.\n\n* **readDoubleBE(buf: `Uint8Array`, pos: `number`): `number`**<br />\n  Reads a 64 bit double from a buffer using big endian byte order.\n\nPerformance\n-----------\nThere is a simple benchmark included comparing raw read/write performance of this library (float), float's fallback for old browsers, the [ieee754](https://www.npmjs.com/package/ieee754) module and node's [buffer](https://nodejs.org/api/buffer.html). On an i7-2600k running node 6.9.1 it yields:\n\n```\nbenchmarking writeFloat performance ...\n\nfloat x 42,741,625 ops/sec ±1.75% (81 runs sampled)\nfloat (fallback) x 11,272,532 ops/sec ±1.12% (85 runs sampled)\nieee754 x 8,653,337 ops/sec ±1.18% (84 runs sampled)\nbuffer x 12,412,414 ops/sec ±1.41% (83 runs sampled)\nbuffer (noAssert) x 13,471,149 ops/sec ±1.09% (84 runs sampled)\n\n               float was fastest\n    float (fallback) was 73.5% slower\n             ieee754 was 79.6% slower\n              buffer was 70.9% slower\n   buffer (noAssert) was 68.3% slower\n\nbenchmarking readFloat performance ...\n\nfloat x 44,382,729 ops/sec ±1.70% (84 runs sampled)\nfloat (fallback) x 20,925,938 ops/sec ±0.86% (87 runs sampled)\nieee754 x 17,189,009 ops/sec ±1.01% (87 runs sampled)\nbuffer x 10,518,437 ops/sec ±1.04% (83 runs sampled)\nbuffer (noAssert) x 11,031,636 ops/sec ±1.15% (87 runs sampled)\n\n               float was fastest\n    float (fallback) was 52.5% slower\n             ieee754 was 61.0% slower\n              buffer was 76.1% slower\n   buffer (noAssert) was 75.0% slower\n\nbenchmarking writeDouble performance ...\n\nfloat x 38,624,906 ops/sec ±0.93% (83 runs sampled)\nfloat (fallback) x 10,457,811 ops/sec ±1.54% (85 runs sampled)\nieee754 x 7,681,130 ops/sec ±1.11% (83 runs sampled)\nbuffer x 12,657,876 ops/sec ±1.03% (83 runs sampled)\nbuffer (noAssert) x 13,372,795 ops/sec ±0.84% (85 runs sampled)\n\n               float was fastest\n    float (fallback) was 73.1% slower\n             ieee754 was 80.1% slower\n              buffer was 67.3% slower\n   buffer (noAssert) was 65.3% slower\n\nbenchmarking readDouble performance ...\n\nfloat x 40,527,888 ops/sec ±1.05% (84 runs sampled)\nfloat (fallback) x 18,696,480 ops/sec ±0.84% (86 runs sampled)\nieee754 x 14,074,028 ops/sec ±1.04% (87 runs sampled)\nbuffer x 10,092,367 ops/sec ±1.15% (84 runs sampled)\nbuffer (noAssert) x 10,623,793 ops/sec ±0.96% (84 runs sampled)\n\n               float was fastest\n    float (fallback) was 53.8% slower\n             ieee754 was 65.3% slower\n              buffer was 75.1% slower\n   buffer (noAssert) was 73.8% slower\n```\n\nTo run it yourself:\n\n```\n$> npm run bench\n```\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/float/bench/index.js",
    "content": "\"use strict\";\n\nvar float = require(\"..\"),\n    ieee754 = require(\"ieee754\"),\n    newSuite = require(\"./suite\");\n\nvar F32 = Float32Array;\nvar F64 = Float64Array;\ndelete global.Float32Array;\ndelete global.Float64Array;\nvar floatFallback = float({});\nglobal.Float32Array = F32;\nglobal.Float64Array = F64;\n\nvar buf = new Buffer(8);\n\nnewSuite(\"writeFloat\")\n.add(\"float\", function() {\n    float.writeFloatLE(0.1, buf, 0);\n})\n.add(\"float (fallback)\", function() {\n    floatFallback.writeFloatLE(0.1, buf, 0);\n})\n.add(\"ieee754\", function() {\n    ieee754.write(buf, 0.1, 0, true, 23, 4);\n})\n.add(\"buffer\", function() {\n    buf.writeFloatLE(0.1, 0);\n})\n.add(\"buffer (noAssert)\", function() {\n    buf.writeFloatLE(0.1, 0, true);\n})\n.run();\n\nnewSuite(\"readFloat\")\n.add(\"float\", function() {\n    float.readFloatLE(buf, 0);\n})\n.add(\"float (fallback)\", function() {\n    floatFallback.readFloatLE(buf, 0);\n})\n.add(\"ieee754\", function() {\n    ieee754.read(buf, 0, true, 23, 4);\n})\n.add(\"buffer\", function() {\n    buf.readFloatLE(0);\n})\n.add(\"buffer (noAssert)\", function() {\n    buf.readFloatLE(0, true);\n})\n.run();\n\nnewSuite(\"writeDouble\")\n.add(\"float\", function() {\n    float.writeDoubleLE(0.1, buf, 0);\n})\n.add(\"float (fallback)\", function() {\n    floatFallback.writeDoubleLE(0.1, buf, 0);\n})\n.add(\"ieee754\", function() {\n    ieee754.write(buf, 0.1, 0, true, 52, 8);\n})\n.add(\"buffer\", function() {\n    buf.writeDoubleLE(0.1, 0);\n})\n.add(\"buffer (noAssert)\", function() {\n    buf.writeDoubleLE(0.1, 0, true);\n})\n.run();\n\nnewSuite(\"readDouble\")\n.add(\"float\", function() {\n    float.readDoubleLE(buf, 0);\n})\n.add(\"float (fallback)\", function() {\n    floatFallback.readDoubleLE(buf, 0);\n})\n.add(\"ieee754\", function() {\n    ieee754.read(buf, 0, true, 52, 8);\n})\n.add(\"buffer\", function() {\n    buf.readDoubleLE(0);\n})\n.add(\"buffer (noAssert)\", function() {\n    buf.readDoubleLE(0, true);\n})\n.run();\n"
  },
  {
    "path": "lib/float/bench/suite.js",
    "content": "\"use strict\";\nmodule.exports = newSuite;\n\nvar benchmark = require(\"benchmark\"),\n    chalk     = require(\"chalk\");\n\nvar padSize = 20;\n\nfunction newSuite(name) {\n    var benches = [];\n    return new benchmark.Suite(name)\n    .on(\"add\", function(event) {\n        benches.push(event.target);\n    })\n    .on(\"start\", function() {\n        process.stdout.write(\"benchmarking \" + name + \" performance ...\\n\\n\");\n    })\n    .on(\"cycle\", function(event) {\n        process.stdout.write(String(event.target) + \"\\n\");\n    })\n    .on(\"complete\", function() {\n        if (benches.length > 1) {\n            var fastest = this.filter(\"fastest\"), // eslint-disable-line no-invalid-this\n                fastestHz = getHz(fastest[0]);\n            process.stdout.write(\"\\n\" + chalk.white(pad(fastest[0].name, padSize)) + \" was \" + chalk.green(\"fastest\") + \"\\n\");\n            benches.forEach(function(bench) {\n                if (fastest.indexOf(bench) === 0)\n                    return;\n                var hz = hz = getHz(bench);\n                var percent = (1 - hz / fastestHz) * 100;\n                process.stdout.write(chalk.white(pad(bench.name, padSize)) + \" was \" + chalk.red(percent.toFixed(1) + \"% slower\") + \"\\n\");\n            });\n        }\n        process.stdout.write(\"\\n\");\n    });\n}\n\nfunction getHz(bench) {\n    return 1 / (bench.stats.mean + bench.stats.moe);\n}\n\nfunction pad(str, len, l) {\n    while (str.length < len)\n        str = l ? str + \" \" : \" \" + str;\n    return str;\n}\n"
  },
  {
    "path": "lib/float/index.d.ts",
    "content": "/**\n * Writes a 32 bit float to a buffer using little endian byte order.\n * @name writeFloatLE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\nexport function writeFloatLE(val: number, buf: Uint8Array, pos: number): void;\n\n/**\n * Writes a 32 bit float to a buffer using big endian byte order.\n * @name writeFloatBE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\nexport function writeFloatBE(val: number, buf: Uint8Array, pos: number): void;\n\n/**\n * Reads a 32 bit float from a buffer using little endian byte order.\n * @name readFloatLE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\nexport function readFloatLE(buf: Uint8Array, pos: number): number;\n\n/**\n * Reads a 32 bit float from a buffer using big endian byte order.\n * @name readFloatBE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\nexport function readFloatBE(buf: Uint8Array, pos: number): number;\n\n/**\n * Writes a 64 bit double to a buffer using little endian byte order.\n * @name writeDoubleLE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\nexport function writeDoubleLE(val: number, buf: Uint8Array, pos: number): void;\n\n/**\n * Writes a 64 bit double to a buffer using big endian byte order.\n * @name writeDoubleBE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\nexport function writeDoubleBE(val: number, buf: Uint8Array, pos: number): void;\n\n/**\n * Reads a 64 bit double from a buffer using little endian byte order.\n * @name readDoubleLE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\nexport function readDoubleLE(buf: Uint8Array, pos: number): number;\n\n/**\n * Reads a 64 bit double from a buffer using big endian byte order.\n * @name readDoubleBE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\nexport function readDoubleBE(buf: Uint8Array, pos: number): number;\n"
  },
  {
    "path": "lib/float/index.js",
    "content": "\"use strict\";\n\nmodule.exports = factory(factory);\n\n/**\n * Reads / writes floats / doubles from / to buffers.\n * @name util.float\n * @namespace\n */\n\n/**\n * Writes a 32 bit float to a buffer using little endian byte order.\n * @name util.float.writeFloatLE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Writes a 32 bit float to a buffer using big endian byte order.\n * @name util.float.writeFloatBE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Reads a 32 bit float from a buffer using little endian byte order.\n * @name util.float.readFloatLE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n/**\n * Reads a 32 bit float from a buffer using big endian byte order.\n * @name util.float.readFloatBE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n/**\n * Writes a 64 bit double to a buffer using little endian byte order.\n * @name util.float.writeDoubleLE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Writes a 64 bit double to a buffer using big endian byte order.\n * @name util.float.writeDoubleBE\n * @function\n * @param {number} val Value to write\n * @param {Uint8Array} buf Target buffer\n * @param {number} pos Target buffer offset\n * @returns {undefined}\n */\n\n/**\n * Reads a 64 bit double from a buffer using little endian byte order.\n * @name util.float.readDoubleLE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n/**\n * Reads a 64 bit double from a buffer using big endian byte order.\n * @name util.float.readDoubleBE\n * @function\n * @param {Uint8Array} buf Source buffer\n * @param {number} pos Source buffer offset\n * @returns {number} Value read\n */\n\n// Factory function for the purpose of node-based testing in modified global environments\nfunction factory(exports) {\n\n    // float: typed array\n    if (typeof Float32Array !== \"undefined\") (function() {\n\n        var f32 = new Float32Array([ -0 ]),\n            f8b = new Uint8Array(f32.buffer),\n            le  = f8b[3] === 128;\n\n        function writeFloat_f32_cpy(val, buf, pos) {\n            f32[0] = val;\n            buf[pos    ] = f8b[0];\n            buf[pos + 1] = f8b[1];\n            buf[pos + 2] = f8b[2];\n            buf[pos + 3] = f8b[3];\n        }\n\n        function writeFloat_f32_rev(val, buf, pos) {\n            f32[0] = val;\n            buf[pos    ] = f8b[3];\n            buf[pos + 1] = f8b[2];\n            buf[pos + 2] = f8b[1];\n            buf[pos + 3] = f8b[0];\n        }\n\n        /* istanbul ignore next */\n        exports.writeFloatLE = le ? writeFloat_f32_cpy : writeFloat_f32_rev;\n        /* istanbul ignore next */\n        exports.writeFloatBE = le ? writeFloat_f32_rev : writeFloat_f32_cpy;\n\n        function readFloat_f32_cpy(buf, pos) {\n            f8b[0] = buf[pos    ];\n            f8b[1] = buf[pos + 1];\n            f8b[2] = buf[pos + 2];\n            f8b[3] = buf[pos + 3];\n            return f32[0];\n        }\n\n        function readFloat_f32_rev(buf, pos) {\n            f8b[3] = buf[pos    ];\n            f8b[2] = buf[pos + 1];\n            f8b[1] = buf[pos + 2];\n            f8b[0] = buf[pos + 3];\n            return f32[0];\n        }\n\n        /* istanbul ignore next */\n        exports.readFloatLE = le ? readFloat_f32_cpy : readFloat_f32_rev;\n        /* istanbul ignore next */\n        exports.readFloatBE = le ? readFloat_f32_rev : readFloat_f32_cpy;\n\n    // float: ieee754\n    })(); else (function() {\n\n        function writeFloat_ieee754(writeUint, val, buf, pos) {\n            var sign = val < 0 ? 1 : 0;\n            if (sign)\n                val = -val;\n            if (val === 0)\n                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos);\n            else if (isNaN(val))\n                writeUint(2143289344, buf, pos);\n            else if (val > 3.4028234663852886e+38) // +-Infinity\n                writeUint((sign << 31 | 2139095040) >>> 0, buf, pos);\n            else if (val < 1.1754943508222875e-38) // denormal\n                writeUint((sign << 31 | Math.round(val / 1.401298464324817e-45)) >>> 0, buf, pos);\n            else {\n                var exponent = Math.floor(Math.log(val) / Math.LN2),\n                    mantissa = Math.round(val * Math.pow(2, -exponent) * 8388608) & 8388607;\n                writeUint((sign << 31 | exponent + 127 << 23 | mantissa) >>> 0, buf, pos);\n            }\n        }\n\n        exports.writeFloatLE = writeFloat_ieee754.bind(null, writeUintLE);\n        exports.writeFloatBE = writeFloat_ieee754.bind(null, writeUintBE);\n\n        function readFloat_ieee754(readUint, buf, pos) {\n            var uint = readUint(buf, pos),\n                sign = (uint >> 31) * 2 + 1,\n                exponent = uint >>> 23 & 255,\n                mantissa = uint & 8388607;\n            return exponent === 255\n                ? mantissa\n                ? NaN\n                : sign * Infinity\n                : exponent === 0 // denormal\n                ? sign * 1.401298464324817e-45 * mantissa\n                : sign * Math.pow(2, exponent - 150) * (mantissa + 8388608);\n        }\n\n        exports.readFloatLE = readFloat_ieee754.bind(null, readUintLE);\n        exports.readFloatBE = readFloat_ieee754.bind(null, readUintBE);\n\n    })();\n\n    // double: typed array\n    if (typeof Float64Array !== \"undefined\") (function() {\n\n        var f64 = new Float64Array([-0]),\n            f8b = new Uint8Array(f64.buffer),\n            le  = f8b[7] === 128;\n\n        function writeDouble_f64_cpy(val, buf, pos) {\n            f64[0] = val;\n            buf[pos    ] = f8b[0];\n            buf[pos + 1] = f8b[1];\n            buf[pos + 2] = f8b[2];\n            buf[pos + 3] = f8b[3];\n            buf[pos + 4] = f8b[4];\n            buf[pos + 5] = f8b[5];\n            buf[pos + 6] = f8b[6];\n            buf[pos + 7] = f8b[7];\n        }\n\n        function writeDouble_f64_rev(val, buf, pos) {\n            f64[0] = val;\n            buf[pos    ] = f8b[7];\n            buf[pos + 1] = f8b[6];\n            buf[pos + 2] = f8b[5];\n            buf[pos + 3] = f8b[4];\n            buf[pos + 4] = f8b[3];\n            buf[pos + 5] = f8b[2];\n            buf[pos + 6] = f8b[1];\n            buf[pos + 7] = f8b[0];\n        }\n\n        /* istanbul ignore next */\n        exports.writeDoubleLE = le ? writeDouble_f64_cpy : writeDouble_f64_rev;\n        /* istanbul ignore next */\n        exports.writeDoubleBE = le ? writeDouble_f64_rev : writeDouble_f64_cpy;\n\n        function readDouble_f64_cpy(buf, pos) {\n            f8b[0] = buf[pos    ];\n            f8b[1] = buf[pos + 1];\n            f8b[2] = buf[pos + 2];\n            f8b[3] = buf[pos + 3];\n            f8b[4] = buf[pos + 4];\n            f8b[5] = buf[pos + 5];\n            f8b[6] = buf[pos + 6];\n            f8b[7] = buf[pos + 7];\n            return f64[0];\n        }\n\n        function readDouble_f64_rev(buf, pos) {\n            f8b[7] = buf[pos    ];\n            f8b[6] = buf[pos + 1];\n            f8b[5] = buf[pos + 2];\n            f8b[4] = buf[pos + 3];\n            f8b[3] = buf[pos + 4];\n            f8b[2] = buf[pos + 5];\n            f8b[1] = buf[pos + 6];\n            f8b[0] = buf[pos + 7];\n            return f64[0];\n        }\n\n        /* istanbul ignore next */\n        exports.readDoubleLE = le ? readDouble_f64_cpy : readDouble_f64_rev;\n        /* istanbul ignore next */\n        exports.readDoubleBE = le ? readDouble_f64_rev : readDouble_f64_cpy;\n\n    // double: ieee754\n    })(); else (function() {\n\n        function writeDouble_ieee754(writeUint, off0, off1, val, buf, pos) {\n            var sign = val < 0 ? 1 : 0;\n            if (sign)\n                val = -val;\n            if (val === 0) {\n                writeUint(0, buf, pos + off0);\n                writeUint(1 / val > 0 ? /* positive */ 0 : /* negative 0 */ 2147483648, buf, pos + off1);\n            } else if (isNaN(val)) {\n                writeUint(0, buf, pos + off0);\n                writeUint(2146959360, buf, pos + off1);\n            } else if (val > 1.7976931348623157e+308) { // +-Infinity\n                writeUint(0, buf, pos + off0);\n                writeUint((sign << 31 | 2146435072) >>> 0, buf, pos + off1);\n            } else {\n                var mantissa;\n                if (val < 2.2250738585072014e-308) { // denormal\n                    mantissa = val / 5e-324;\n                    writeUint(mantissa >>> 0, buf, pos + off0);\n                    writeUint((sign << 31 | mantissa / 4294967296) >>> 0, buf, pos + off1);\n                } else {\n                    var exponent = Math.floor(Math.log(val) / Math.LN2);\n                    if (exponent === 1024)\n                        exponent = 1023;\n                    mantissa = val * Math.pow(2, -exponent);\n                    writeUint(mantissa * 4503599627370496 >>> 0, buf, pos + off0);\n                    writeUint((sign << 31 | exponent + 1023 << 20 | mantissa * 1048576 & 1048575) >>> 0, buf, pos + off1);\n                }\n            }\n        }\n\n        exports.writeDoubleLE = writeDouble_ieee754.bind(null, writeUintLE, 0, 4);\n        exports.writeDoubleBE = writeDouble_ieee754.bind(null, writeUintBE, 4, 0);\n\n        function readDouble_ieee754(readUint, off0, off1, buf, pos) {\n            var lo = readUint(buf, pos + off0),\n                hi = readUint(buf, pos + off1);\n            var sign = (hi >> 31) * 2 + 1,\n                exponent = hi >>> 20 & 2047,\n                mantissa = 4294967296 * (hi & 1048575) + lo;\n            return exponent === 2047\n                ? mantissa\n                ? NaN\n                : sign * Infinity\n                : exponent === 0 // denormal\n                ? sign * 5e-324 * mantissa\n                : sign * Math.pow(2, exponent - 1075) * (mantissa + 4503599627370496);\n        }\n\n        exports.readDoubleLE = readDouble_ieee754.bind(null, readUintLE, 0, 4);\n        exports.readDoubleBE = readDouble_ieee754.bind(null, readUintBE, 4, 0);\n\n    })();\n\n    return exports;\n}\n\n// uint helpers\n\nfunction writeUintLE(val, buf, pos) {\n    buf[pos    ] =  val        & 255;\n    buf[pos + 1] =  val >>> 8  & 255;\n    buf[pos + 2] =  val >>> 16 & 255;\n    buf[pos + 3] =  val >>> 24;\n}\n\nfunction writeUintBE(val, buf, pos) {\n    buf[pos    ] =  val >>> 24;\n    buf[pos + 1] =  val >>> 16 & 255;\n    buf[pos + 2] =  val >>> 8  & 255;\n    buf[pos + 3] =  val        & 255;\n}\n\nfunction readUintLE(buf, pos) {\n    return (buf[pos    ]\n          | buf[pos + 1] << 8\n          | buf[pos + 2] << 16\n          | buf[pos + 3] << 24) >>> 0;\n}\n\nfunction readUintBE(buf, pos) {\n    return (buf[pos    ] << 24\n          | buf[pos + 1] << 16\n          | buf[pos + 2] << 8\n          | buf[pos + 3]) >>> 0;\n}\n"
  },
  {
    "path": "lib/float/package.json",
    "content": "{\n  \"name\": \"@protobufjs/float\",\n  \"description\": \"Reads / writes floats / doubles from / to buffers in both modern and ancient browsers.\",\n  \"version\": \"1.0.2\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"dependencies\": {},\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"benchmark\": \"^2.1.4\",\n    \"chalk\": \"^4.0.0\",\n    \"ieee754\": \"^1.1.8\",\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\",\n    \"bench\": \"node bench\"\n  }\n}"
  },
  {
    "path": "lib/float/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar float = require(\"..\");\n\ntape.test(\"float\", function(test) {\n\n    // default\n    test.test(test.name + \" - typed array\", function(test) {\n        runTest(float, test);\n    });\n\n    // ieee754\n    test.test(test.name + \" - fallback\", function(test) {\n        var F32 = global.Float32Array,\n            F64 = global.Float64Array;\n        delete global.Float32Array;\n        delete global.Float64Array;\n        runTest(float({}), test);\n        global.Float32Array = F32;\n        global.Float64Array = F64;\n    });\n});\n\nfunction runTest(float, test) {\n\n    var common = [\n        0,\n        -0,\n        Infinity,\n        -Infinity,\n        0.125,\n        1024.5,\n        -4096.5,\n        NaN\n    ];\n\n    test.test(test.name + \" - using 32 bits\", function(test) {\n        common.concat([\n            3.4028234663852886e+38,\n            1.1754943508222875e-38,\n            1.1754946310819804e-39\n        ])\n        .forEach(function(value) {\n            var strval = value === 0 && 1 / value < 0 ? \"-0\" : value.toString();\n            test.ok(\n                checkValue(value, 4, float.readFloatLE, float.writeFloatLE, Buffer.prototype.writeFloatLE),\n                \"should write and read back \" + strval + \" (32 bit LE)\"\n            );\n            test.ok(\n                checkValue(value, 4, float.readFloatBE, float.writeFloatBE, Buffer.prototype.writeFloatBE),\n                \"should write and read back \" + strval + \" (32 bit BE)\"\n            );\n        });\n        test.end();\n    });\n\n    test.test(test.name + \" - using 64 bits\", function(test) {\n        common.concat([\n            1.7976931348623157e+308,\n            2.2250738585072014e-308,\n            2.2250738585072014e-309\n        ])\n        .forEach(function(value) {\n            var strval = value === 0 && 1 / value < 0 ? \"-0\" : value.toString();\n            test.ok(\n                checkValue(value, 8, float.readDoubleLE, float.writeDoubleLE, Buffer.prototype.writeDoubleLE),\n                \"should write and read back \" + strval + \" (64 bit LE)\"\n            );\n            test.ok(\n                checkValue(value, 8, float.readDoubleBE, float.writeDoubleBE, Buffer.prototype.writeDoubleBE),\n                \"should write and read back \" + strval + \" (64 bit BE)\"\n            );\n        });\n        test.end();\n    });\n\n    test.end();\n}\n\nfunction checkValue(value, size, read, write, write_comp) {\n    var buffer = new Buffer(size);\n    write(value, buffer, 0);\n    var value_comp = read(buffer, 0);\n    var strval = value === 0 && 1 / value < 0 ? \"-0\" : value.toString();\n    if (value !== value) {\n        if (value_comp === value_comp)\n            return false;\n    } else if (value_comp !== value)\n        return false;\n\n    var buffer_comp = new Buffer(size);\n    write_comp.call(buffer_comp, value, 0);\n    for (var i = 0; i < size; ++i)\n        if (buffer[i] !== buffer_comp[i]) {\n            console.error(\">\", buffer, buffer_comp);\n            return false;\n        }\n\n    return true;\n}"
  },
  {
    "path": "lib/inquire/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/inquire/README.md",
    "content": "@protobufjs/inquire\n===================\n[![npm](https://img.shields.io/npm/v/@protobufjs/inquire.svg)](https://www.npmjs.com/package/@protobufjs/inquire)\n\nRequires a module only if available and hides the require call from bundlers.\n\nAPI\n---\n\n* **inquire(moduleName: `string`): `?Object`**<br />\n  Requires a module only if available.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/inquire/index.d.ts",
    "content": "export = inquire;\n\n/**\n * Requires a module only if available.\n * @memberof util\n * @param {string} moduleName Module to require\n * @returns {?Object} Required module if available and not empty, otherwise `null`\n */\ndeclare function inquire(moduleName: string): object;\n"
  },
  {
    "path": "lib/inquire/index.js",
    "content": "\"use strict\";\nmodule.exports = inquire;\n\n/**\n * Requires a module only if available.\n * @memberof util\n * @param {string} moduleName Module to require\n * @returns {?Object} Required module if available and not empty, otherwise `null`\n */\nfunction inquire(moduleName) {\n  try {\n    if (typeof require !== \"function\") {\n      return null;\n    }\n    var mod = require(moduleName);\n    if (mod && (mod.length || Object.keys(mod).length)) return mod;\n    return null;\n  } catch (err) {\n    // ignore\n    return null;\n  }\n}\n\n/*\n// maybe worth a shot to prevent renaming issues:\n// see: https://github.com/webpack/webpack/blob/master/lib/dependencies/CommonJsRequireDependencyParserPlugin.js\n// triggers on:\n// - expression require.cache\n// - expression require (???)\n// - call require\n// - call require:commonjs:item\n// - call require:commonjs:context\n\nObject.defineProperty(Function.prototype, \"__self\", { get: function() { return this; } });\nvar r = require.__self;\ndelete Function.prototype.__self;\n*/\n"
  },
  {
    "path": "lib/inquire/package.json",
    "content": "{\n  \"name\": \"@protobufjs/inquire\",\n  \"description\": \"Requires a module only if available and hides the require call from bundlers.\",\n  \"version\": \"1.1.0\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}"
  },
  {
    "path": "lib/inquire/tests/data/array.js",
    "content": "module.exports = [1];\n"
  },
  {
    "path": "lib/inquire/tests/data/emptyArray.js",
    "content": "module.exports = [];\n"
  },
  {
    "path": "lib/inquire/tests/data/emptyObject.js",
    "content": "module.exports = {};\n"
  },
  {
    "path": "lib/inquire/tests/data/object.js",
    "content": "module.exports = { a: 1 };\n"
  },
  {
    "path": "lib/inquire/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar inquire = require(\"..\");\n\ntape.test(\"inquire\", function(test) {\n\n    test.equal(inquire(\"buffer\").Buffer, Buffer, \"should be able to require \\\"buffer\\\"\");\n\n    test.equal(inquire(\"%invalid\"), null, \"should not be able to require \\\"%invalid\\\"\");\n\n    test.equal(inquire(\"./tests/data/emptyObject\"), null, \"should return null when requiring a module exporting an empty object\");\n\n    test.equal(inquire(\"./tests/data/emptyArray\"), null, \"should return null when requiring a module exporting an empty array\");\n\n    test.same(inquire(\"./tests/data/object\"), { a: 1 }, \"should return the object if a non-empty object\");\n\n    test.same(inquire(\"./tests/data/array\"), [ 1 ], \"should return the module if a non-empty array\");\n\n    test.end();\n});\n"
  },
  {
    "path": "lib/path/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/path/README.md",
    "content": "@protobufjs/path\n================\n[![npm](https://img.shields.io/npm/v/@protobufjs/path.svg)](https://www.npmjs.com/package/@protobufjs/path)\n\nA minimal path module to resolve Unix, Windows and URL paths alike.\n\nAPI\n---\n\n* **path.isAbsolute(path: `string`): `boolean`**<br />\n  Tests if the specified path is absolute.\n\n* **path.normalize(path: `string`): `string`**<br />\n  Normalizes the specified path.\n\n* **path.resolve(originPath: `string`, includePath: `string`, [alreadyNormalized=false: `boolean`]): `string`**<br />\n  Resolves the specified include path against the specified origin path.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/path/index.d.ts",
    "content": "/**\n * Tests if the specified path is absolute.\n * @param {string} path Path to test\n * @returns {boolean} `true` if path is absolute\n */\nexport function isAbsolute(path: string): boolean;\n\n/**\n * Normalizes the specified path.\n * @param {string} path Path to normalize\n * @returns {string} Normalized path\n */\nexport function normalize(path: string): string;\n\n/**\n * Resolves the specified include path against the specified origin path.\n * @param {string} originPath Path to the origin file\n * @param {string} includePath Include path relative to origin path\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\n * @returns {string} Path to the include file\n */\nexport function resolve(originPath: string, includePath: string, alreadyNormalized?: boolean): string;\n"
  },
  {
    "path": "lib/path/index.js",
    "content": "\"use strict\";\n\n/**\n * A minimal path module to resolve Unix, Windows and URL paths alike.\n * @memberof util\n * @namespace\n */\nvar path = exports;\n\nvar isAbsolute =\n/**\n * Tests if the specified path is absolute.\n * @param {string} path Path to test\n * @returns {boolean} `true` if path is absolute\n */\npath.isAbsolute = function isAbsolute(path) {\n    return /^(?:\\/|\\w+:|\\\\\\\\\\w+)/.test(path);\n};\n\nvar normalize =\n/**\n * Normalizes the specified path.\n * @param {string} path Path to normalize\n * @returns {string} Normalized path\n */\npath.normalize = function normalize(path) {\n    var firstTwoCharacters = path.substring(0,2);\n    var uncPrefix = \"\";\n    if (firstTwoCharacters === \"\\\\\\\\\") {\n        uncPrefix = firstTwoCharacters;\n        path = path.substring(2);\n    }\n\n    path = path.replace(/\\\\/g, \"/\")\n               .replace(/\\/{2,}/g, \"/\");\n    var parts    = path.split(\"/\"),\n        absolute = isAbsolute(path),\n        prefix   = \"\";\n    if (absolute)\n        prefix = parts.shift() + \"/\";\n    for (var i = 0; i < parts.length;) {\n        if (parts[i] === \"..\") {\n            if (i > 0 && parts[i - 1] !== \"..\")\n                parts.splice(--i, 2);\n            else if (absolute)\n                parts.splice(i, 1);\n            else\n                ++i;\n        } else if (parts[i] === \".\")\n            parts.splice(i, 1);\n        else\n            ++i;\n    }\n    return uncPrefix + prefix + parts.join(\"/\");\n};\n\n/**\n * Resolves the specified include path against the specified origin path.\n * @param {string} originPath Path to the origin file\n * @param {string} includePath Include path relative to origin path\n * @param {boolean} [alreadyNormalized=false] `true` if both paths are already known to be normalized\n * @returns {string} Path to the include file\n */\npath.resolve = function resolve(originPath, includePath, alreadyNormalized) {\n    if (!alreadyNormalized)\n        includePath = normalize(includePath);\n    if (isAbsolute(includePath))\n        return includePath;\n    if (!alreadyNormalized)\n        originPath = normalize(originPath);\n    return (originPath = originPath.replace(/(?:\\/|^)[^/]+$/, \"\")).length ? normalize(originPath + \"/\" + includePath) : includePath;\n};\n"
  },
  {
    "path": "lib/path/package.json",
    "content": "{\n  \"name\": \"@protobufjs/path\",\n  \"description\": \"A minimal path module to resolve Unix, Windows and URL paths alike.\",\n  \"version\": \"1.1.2\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}"
  },
  {
    "path": "lib/path/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar path = require(\"..\");\n\ntape.test(\"path\", function(test) {\n\n    test.ok(path.isAbsolute(\"X:\\\\some\\\\path\\\\file.js\"), \"should identify absolute windows paths\");\n    test.ok(path.isAbsolute(\"/some/path/file.js\"), \"should identify absolute unix paths\");\n\n    test.notOk(path.isAbsolute(\"some\\\\path\\\\file.js\"), \"should identify relative windows paths\");\n    test.notOk(path.isAbsolute(\"some/path/file.js\"), \"should identify relative unix paths\");\n\n    test.ok(path.isAbsolute(\"\\\\\\\\some-unc\\\\path\\\\file.js\"), \"should identify windows unc paths\");\n\n    var paths = [\n        {\n            actual: \"X:\\\\some\\\\..\\\\.\\\\path\\\\\\\\file.js\",\n            normal: \"X:/path/file.js\",\n            resolve: {\n                origin: \"X:/path/origin.js\",\n                expected: \"X:/path/file.js\"\n            }\n        }, {\n            actual: \"some\\\\..\\\\.\\\\path\\\\\\\\file.js\",\n            normal: \"path/file.js\",\n            resolve: {\n                origin: \"X:/path/origin.js\",\n                expected: \"X:/path/path/file.js\"\n            }\n        }, {\n            actual: \"/some/.././path//file.js\",\n            normal: \"/path/file.js\",\n            resolve: {\n                origin: \"/path/origin.js\",\n                expected: \"/path/file.js\"\n            }\n        }, {\n            actual: \"some/.././path//file.js\",\n            normal: \"path/file.js\",\n            resolve: {\n                origin: \"\",\n                expected: \"path/file.js\"\n            }\n        }, {\n            actual: \".././path//file.js\",\n            normal: \"../path/file.js\"\n        }, {\n            actual: \"/.././path//file.js\",\n            normal: \"/path/file.js\"\n        }, {\n            actual: \"\\\\\\\\some-unc\\\\path\\\\file.js\",\n            normal: \"\\\\\\\\some-unc/path/file.js\",\n            resolve: {\n                origin: \"\\\\\\\\some-unc\\\\path\\\\origin.js\",\n                expected: \"\\\\\\\\some-unc/path/file.js\"\n            }\n        }, {\n            actual: \"\\\\\\\\some-unc\\\\path\\\\..\\\\file.js\",\n            normal: \"\\\\\\\\some-unc/file.js\",\n            resolve: {\n                origin: \"\\\\\\\\some-unc\\\\path\\\\..\\\\origin.js\",\n                expected: \"\\\\\\\\some-unc/file.js\"\n            }\n        }\n    ];\n\n    paths.forEach(function(p) {\n        test.equal(path.normalize(p.actual), p.normal, \"should normalize \" + p.actual);\n        if (p.resolve) {\n            test.equal(path.resolve(p.resolve.origin, p.actual), p.resolve.expected, \"should resolve \" + p.actual);\n            test.equal(path.resolve(p.resolve.origin, p.normal, true), p.resolve.expected, \"should resolve \" + p.normal + \" (already normalized)\");\n        }\n    });\n\n    test.end();\n});\n"
  },
  {
    "path": "lib/polyfill.js",
    "content": "// This file exists for testing purposes but can also be used as a reference for polyfilling non-ES5 environments.\n// ref: https://github.com/inexorabletash/polyfill/blob/master/es5.js (public domain)\n\n// ES5 15.2.3.5 Object.create ( O [, Properties] )\nif (typeof Object.create !== \"function\") {\n  Object.create = function (prototype, properties) {\n    if (typeof prototype !== \"object\") { throw TypeError(); }\n    function Ctor() {}\n    Ctor.prototype = prototype;\n    var o = new Ctor();\n    if (prototype) { o.constructor = Ctor; }\n    if (properties !== undefined) {\n      if (properties !== Object(properties)) { throw TypeError(); }\n      Object.defineProperties(o, properties);\n    }\n    return o;\n  };\n}\n\n// ES 15.2.3.6 Object.defineProperty ( O, P, Attributes )\n// Partial support for most common case - getters, setters, and values\n(function() {\n  if (!Object.defineProperty ||\n      !(function () { try { Object.defineProperty({}, 'x', {}); return true; } catch (e) { return false; } } ())) {\n    var orig = Object.defineProperty;\n    Object.defineProperty = function (o, prop, desc) {\n      // In IE8 try built-in implementation for defining properties on DOM prototypes.\n      if (orig) { try { return orig(o, prop, desc); } catch (e) {} }\n\n      if (o !== Object(o)) { throw TypeError(\"Object.defineProperty called on non-object\"); }\n      if (Object.prototype.__defineGetter__ && ('get' in desc)) {\n        Object.prototype.__defineGetter__.call(o, prop, desc.get);\n      }\n      if (Object.prototype.__defineSetter__ && ('set' in desc)) {\n        Object.prototype.__defineSetter__.call(o, prop, desc.set);\n      }\n      if ('value' in desc) {\n        o[prop] = desc.value;\n      }\n      return o;\n    };\n  }\n}());\n\n// ES 15.2.3.7 Object.defineProperties ( O, Properties )\nif (typeof Object.defineProperties !== \"function\") {\n  Object.defineProperties = function (o, properties) {\n    if (o !== Object(o)) { throw TypeError(\"Object.defineProperties called on non-object\"); }\n    var name;\n    for (name in properties) {\n      if (Object.prototype.hasOwnProperty.call(properties, name)) {\n        Object.defineProperty(o, name, properties[name]);\n      }\n    }\n    return o;\n  };\n}\n\n// ES5 15.2.3.14 Object.keys ( O )\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/keys\nif (!Object.keys) {\n  Object.keys = function (o) {\n    if (o !== Object(o)) { throw TypeError('Object.keys called on non-object'); }\n    var ret = [], p;\n    for (p in o) {\n      if (Object.prototype.hasOwnProperty.call(o, p)) {\n        ret.push(p);\n      }\n    }\n    return ret;\n  };\n}\n\n// ES5 15.4.3.2 Array.isArray ( arg )\n// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray\nif (!Array.isArray)\n  Array.isArray = function (o) { return Boolean(o && Object.prototype.toString.call(Object(o)) === '[object Array]'); };\n\n// ES5 15.4.4.14 Array.prototype.indexOf ( searchElement [ , fromIndex ] )\n// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf\nif (!Array.prototype.indexOf) {\n  Array.prototype.indexOf = function (searchElement /*, fromIndex */) {\n    if (this === void 0 || this === null) { throw TypeError(); }\n\n    var t = Object(this);\n    var len = t.length >>> 0;\n    if (len === 0) { return -1; }\n\n    var n = 0;\n    if (arguments.length > 0) {\n      n = Number(arguments[1]);\n      if (isNaN(n)) {\n        n = 0;\n      } else if (n !== 0 && n !== (1 / 0) && n !== -(1 / 0)) {\n        n = (n > 0 || -1) * Math.floor(Math.abs(n));\n      }\n    }\n\n    if (n >= len) { return -1; }\n\n    var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n\n    for (; k < len; k++) {\n      if (k in t && t[k] === searchElement) {\n        return k;\n      }\n    }\n    return -1;\n  };\n}\n\n// ES5 15.4.4.18 Array.prototype.forEach ( callbackfn [ , thisArg ] )\n// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/forEach\nif (!Array.prototype.forEach) {\n  Array.prototype.forEach = function (fun /*, thisp */) {\n    if (this === void 0 || this === null) { throw TypeError(); }\n\n    var t = Object(this);\n    var len = t.length >>> 0;\n    if (typeof fun !== \"function\") { throw TypeError(); }\n\n    var thisp = arguments[1], i;\n    for (i = 0; i < len; i++) {\n      if (i in t) {\n        fun.call(thisp, t[i], i, t);\n      }\n    }\n  };\n}\n\n\n// ES5 15.4.4.19 Array.prototype.map ( callbackfn [ , thisArg ] )\n// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/Map\nif (!Array.prototype.map) {\n  Array.prototype.map = function (fun /*, thisp */) {\n    if (this === void 0 || this === null) { throw TypeError(); }\n\n    var t = Object(this);\n    var len = t.length >>> 0;\n    if (typeof fun !== \"function\") { throw TypeError(); }\n\n    var res = []; res.length = len;\n    var thisp = arguments[1], i;\n    for (i = 0; i < len; i++) {\n      if (i in t) {\n        res[i] = fun.call(thisp, t[i], i, t);\n      }\n    }\n\n    return res;\n  };\n}\n\n// ES5 15.4.4.20 Array.prototype.filter ( callbackfn [ , thisArg ] )\n// From https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/Filter\nif (!Array.prototype.filter) {\n  Array.prototype.filter = function (fun /*, thisp */) {\n    if (this === void 0 || this === null) { throw TypeError(); }\n\n    var t = Object(this);\n    var len = t.length >>> 0;\n    if (typeof fun !== \"function\") { throw TypeError(); }\n\n    var res = [];\n    var thisp = arguments[1], i;\n    for (i = 0; i < len; i++) {\n      if (i in t) {\n        var val = t[i]; // in case fun mutates this\n        if (fun.call(thisp, val, i, t)) {\n          res.push(val);\n        }\n      }\n    }\n\n    return res;\n  };\n}\n"
  },
  {
    "path": "lib/pool/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/pool/README.md",
    "content": "@protobufjs/pool\n================\n[![npm](https://img.shields.io/npm/v/@protobufjs/pool.svg)](https://www.npmjs.com/package/@protobufjs/pool)\n\nA general purpose buffer pool.\n\nAPI\n---\n\n* **pool(alloc: `function(size: number): Uint8Array`, slice: `function(this: Uint8Array, start: number, end: number): Uint8Array`, [size=8192: `number`]): `function(size: number): Uint8Array`**<br />\n  Creates a pooled allocator.\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/pool/index.d.ts",
    "content": "export = pool;\n\n/**\n * An allocator as used by {@link util.pool}.\n * @typedef PoolAllocator\n * @type {function}\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\ntype PoolAllocator = (size: number) => Uint8Array;\n\n/**\n * A slicer as used by {@link util.pool}.\n * @typedef PoolSlicer\n * @type {function}\n * @param {number} start Start offset\n * @param {number} end End offset\n * @returns {Uint8Array} Buffer slice\n * @this {Uint8Array}\n */\ntype PoolSlicer = (this: Uint8Array, start: number, end: number) => Uint8Array;\n\n/**\n * A general purpose buffer pool.\n * @memberof util\n * @function\n * @param {PoolAllocator} alloc Allocator\n * @param {PoolSlicer} slice Slicer\n * @param {number} [size=8192] Slab size\n * @returns {PoolAllocator} Pooled allocator\n */\ndeclare function pool(alloc: PoolAllocator, slice: PoolSlicer, size?: number): PoolAllocator;\n"
  },
  {
    "path": "lib/pool/index.js",
    "content": "\"use strict\";\nmodule.exports = pool;\n\n/**\n * An allocator as used by {@link util.pool}.\n * @typedef PoolAllocator\n * @type {function}\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\n\n/**\n * A slicer as used by {@link util.pool}.\n * @typedef PoolSlicer\n * @type {function}\n * @param {number} start Start offset\n * @param {number} end End offset\n * @returns {Uint8Array} Buffer slice\n * @this {Uint8Array}\n */\n\n/**\n * A general purpose buffer pool.\n * @memberof util\n * @function\n * @param {PoolAllocator} alloc Allocator\n * @param {PoolSlicer} slice Slicer\n * @param {number} [size=8192] Slab size\n * @returns {PoolAllocator} Pooled allocator\n */\nfunction pool(alloc, slice, size) {\n    var SIZE   = size || 8192;\n    var MAX    = SIZE >>> 1;\n    var slab   = null;\n    var offset = SIZE;\n    return function pool_alloc(size) {\n        if (size < 1 || size > MAX)\n            return alloc(size);\n        if (offset + size > SIZE) {\n            slab = alloc(SIZE);\n            offset = 0;\n        }\n        var buf = slice.call(slab, offset, offset += size);\n        if (offset & 7) // align to 32 bit\n            offset = (offset | 7) + 1;\n        return buf;\n    };\n}\n"
  },
  {
    "path": "lib/pool/package.json",
    "content": "{\n  \"name\": \"@protobufjs/pool\",\n  \"description\": \"A general purpose buffer pool.\",\n  \"version\": \"1.1.0\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}\n"
  },
  {
    "path": "lib/pool/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar pool = require(\"..\");\n\ntape.test(\"pool\", function(test) {\n\n    var alloc = pool(function(size) { return new Uint8Array(size); }, Uint8Array.prototype.subarray);\n\n    var buf1 = alloc(0);\n    test.equal(buf1.length, 0, \"should allocate a buffer of size 0\");\n\n    var buf2 = alloc(1);\n    test.equal(buf2.length, 1, \"should allocate a buffer of size 1 (initializes slab)\");\n\n    test.notEqual(buf2.buffer, buf1.buffer, \"should not reference the same backing buffer if previous buffer had size 0\");\n    test.equal(buf2.byteOffset, 0, \"should allocate at byteOffset 0 when using a new slab\");\n\n    buf1 = alloc(1);\n    test.equal(buf1.buffer, buf2.buffer, \"should reference the same backing buffer when allocating a chunk fitting into the slab\");\n    test.equal(buf1.byteOffset, 8, \"should align slices to 32 bit and this allocate at byteOffset 8\");\n\n    var buf3 = alloc(4097);\n    test.notEqual(buf3.buffer, buf2.buffer, \"should not reference the same backing buffer when allocating a buffer larger than half the backing buffer's size\");\n\n    buf2 = alloc(4096);\n    test.equal(buf2.buffer, buf1.buffer, \"should reference the same backing buffer when allocating a buffer smaller or equal than half the backing buffer's size\");\n\n    buf1 = alloc(4096);\n    test.notEqual(buf1.buffer, buf2.buffer, \"should not reference the same backing buffer when the slab is exhausted (initializes new slab)\");\n\n    test.end();\n});"
  },
  {
    "path": "lib/prelude.js",
    "content": "(function prelude(modules, cache, entries) {\n\n    // This is the prelude used to bundle protobuf.js for the browser. Wraps up the CommonJS\n    // sources through a conflict-free require shim and is again wrapped within an iife that\n    // provides a minification-friendly `undefined` var plus a global \"use strict\" directive\n    // so that minification can remove the directives of each module.\n\n    function $require(name) {\n        var $module = cache[name];\n        if (!$module)\n            modules[name][0].call($module = cache[name] = { exports: {} }, $require, $module, $module.exports);\n        return $module.exports;\n    }\n\n    var protobuf = $require(entries[0]);\n\n    // Expose globally\n    protobuf.util.global.protobuf = protobuf;\n\n    // Be nice to AMD\n    if (typeof define === \"function\" && define.amd)\n        define([\"long\"], function(Long) {\n            if (Long && Long.isLong) {\n                protobuf.util.Long = Long;\n                protobuf.configure();\n            }\n            return protobuf;\n        });\n\n    // Be nice to CommonJS\n    if (typeof module === \"object\" && module && module.exports)\n        module.exports = protobuf;\n\n})/* end of prelude */"
  },
  {
    "path": "lib/tape-adapter.js",
    "content": "var tape = require(\"tape\");\n\nvar Test = tape.Test;\n\n// some ancient environments have invalid own properties on buffers so that deepEqual doesn't work.\n// the following uses a monkey-patched deepEqual implementation for all kinds of number arrays.\n\nvar deepEqual = require(\"./deep-equal\");\n\nTest.prototype.deepEqual\n= Test.prototype.deepEquals\n= Test.prototype.isEquivalent\n= Test.prototype.same\n= function (a, b, msg, extra) {\n    this._assert(deepEqual(a, b, { strict: true }), {\n        message : msg || \"should be equivalent\",\n        operator : \"deepEqual\",\n        actual : a,\n        expected : b,\n        extra : extra\n    });\n};\n"
  },
  {
    "path": "lib/utf8/LICENSE",
    "content": "Copyright (c) 2016, Daniel Wirtz  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n* Redistributions of source code must retain the above copyright\n  notice, this list of conditions and the following disclaimer.\n* Redistributions in binary form must reproduce the above copyright\n  notice, this list of conditions and the following disclaimer in the\n  documentation and/or other materials provided with the distribution.\n* Neither the name of its author, nor the names of its contributors\n  may be used to endorse or promote products derived from this software\n  without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "lib/utf8/README.md",
    "content": "@protobufjs/utf8\n================\n[![npm](https://img.shields.io/npm/v/@protobufjs/utf8.svg)](https://www.npmjs.com/package/@protobufjs/utf8)\n\nA minimal UTF8 implementation for number arrays.\n\nAPI\n---\n\n* **utf8.length(string: `string`): `number`**<br />\n  Calculates the UTF8 byte length of a string.\n\n* **utf8.read(buffer: `Uint8Array`, start: `number`, end: `number`): `string`**<br />\n  Reads UTF8 bytes as a string.\n\n* **utf8.write(string: `string`, buffer: `Uint8Array`, offset: `number`): `number`**<br />\n  Writes a string as UTF8 bytes.\n\n\n**License:** [BSD 3-Clause License](https://opensource.org/licenses/BSD-3-Clause)\n"
  },
  {
    "path": "lib/utf8/index.d.ts",
    "content": "/**\n * Calculates the UTF8 byte length of a string.\n * @param {string} string String\n * @returns {number} Byte length\n */\nexport function length(string: string): number;\n\n/**\n * Reads UTF8 bytes as a string.\n * @param {Uint8Array} buffer Source buffer\n * @param {number} start Source start\n * @param {number} end Source end\n * @returns {string} String read\n */\nexport function read(buffer: Uint8Array, start: number, end: number): string;\n\n/**\n * Writes a string as UTF8 bytes.\n * @param {string} string Source string\n * @param {Uint8Array} buffer Destination buffer\n * @param {number} offset Destination offset\n * @returns {number} Bytes written\n */\nexport function write(string: string, buffer: Uint8Array, offset: number): number;\n"
  },
  {
    "path": "lib/utf8/index.js",
    "content": "\"use strict\";\n\n/**\n * A minimal UTF8 implementation for number arrays.\n * @memberof util\n * @namespace\n */\nvar utf8 = exports;\n\n/**\n * Calculates the UTF8 byte length of a string.\n * @param {string} string String\n * @returns {number} Byte length\n */\nutf8.length = function utf8_length(string) {\n    var len = 0,\n        c = 0;\n    for (var i = 0; i < string.length; ++i) {\n        c = string.charCodeAt(i);\n        if (c < 128)\n            len += 1;\n        else if (c < 2048)\n            len += 2;\n        else if ((c & 0xFC00) === 0xD800 && (string.charCodeAt(i + 1) & 0xFC00) === 0xDC00) {\n            ++i;\n            len += 4;\n        } else\n            len += 3;\n    }\n    return len;\n};\n\n/**\n * Reads UTF8 bytes as a string.\n * @param {Uint8Array} buffer Source buffer\n * @param {number} start Source start\n * @param {number} end Source end\n * @returns {string} String read\n */\nutf8.read = function utf8_read(buffer, start, end) {\n    if (end - start < 1) {\n        return \"\";\n    }\n\n    var str = \"\";\n    for (var i = start; i < end;) {\n        var t = buffer[i++];\n        if (t <= 0x7F) {\n            str += String.fromCharCode(t);\n        } else if (t >= 0xC0 && t < 0xE0) {\n            str += String.fromCharCode((t & 0x1F) << 6 | buffer[i++] & 0x3F);\n        } else if (t >= 0xE0 && t < 0xF0) {\n            str += String.fromCharCode((t & 0xF) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F);\n        } else if (t >= 0xF0) {\n            var t2 = ((t & 7) << 18 | (buffer[i++] & 0x3F) << 12 | (buffer[i++] & 0x3F) << 6 | buffer[i++] & 0x3F) - 0x10000;\n            str += String.fromCharCode(0xD800 + (t2 >> 10));\n            str += String.fromCharCode(0xDC00 + (t2 & 0x3FF));\n        }\n    }\n\n    return str;\n};\n\n/**\n * Writes a string as UTF8 bytes.\n * @param {string} string Source string\n * @param {Uint8Array} buffer Destination buffer\n * @param {number} offset Destination offset\n * @returns {number} Bytes written\n */\nutf8.write = function utf8_write(string, buffer, offset) {\n    var start = offset,\n        c1, // character 1\n        c2; // character 2\n    for (var i = 0; i < string.length; ++i) {\n        c1 = string.charCodeAt(i);\n        if (c1 < 128) {\n            buffer[offset++] = c1;\n        } else if (c1 < 2048) {\n            buffer[offset++] = c1 >> 6       | 192;\n            buffer[offset++] = c1       & 63 | 128;\n        } else if ((c1 & 0xFC00) === 0xD800 && ((c2 = string.charCodeAt(i + 1)) & 0xFC00) === 0xDC00) {\n            c1 = 0x10000 + ((c1 & 0x03FF) << 10) + (c2 & 0x03FF);\n            ++i;\n            buffer[offset++] = c1 >> 18      | 240;\n            buffer[offset++] = c1 >> 12 & 63 | 128;\n            buffer[offset++] = c1 >> 6  & 63 | 128;\n            buffer[offset++] = c1       & 63 | 128;\n        } else {\n            buffer[offset++] = c1 >> 12      | 224;\n            buffer[offset++] = c1 >> 6  & 63 | 128;\n            buffer[offset++] = c1       & 63 | 128;\n        }\n    }\n    return offset - start;\n};\n"
  },
  {
    "path": "lib/utf8/package.json",
    "content": "{\n  \"name\": \"@protobufjs/utf8\",\n  \"description\": \"A minimal UTF8 implementation for number arrays.\",\n  \"version\": \"1.1.0\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/dcodeIO/protobuf.js.git\"\n  },\n  \"license\": \"BSD-3-Clause\",\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"devDependencies\": {\n    \"istanbul\": \"^0.4.5\",\n    \"tape\": \"^5.0.0\"\n  },\n  \"scripts\": {\n    \"test\": \"tape tests/*.js\",\n    \"coverage\": \"istanbul cover node_modules/tape/bin/tape tests/*.js\"\n  }\n}\n"
  },
  {
    "path": "lib/utf8/tests/data/surrogate_pair_bug.txt",
    "content": "this file demonstrates a bug in the utf8_read function. xxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n📅\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\nzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz\n"
  },
  {
    "path": "lib/utf8/tests/data/utf8.txt",
    "content": "UTF-8 encoded sample plain-text file\n‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾\n\nMarkus Kuhn [ˈmaʳkʊs kuːn] <http://www.cl.cam.ac.uk/~mgk25/> — 2002-07-25 CC BY\n\n\nThe ASCII compatible UTF-8 encoding used in this plain-text file\nis defined in Unicode, ISO 10646-1, and RFC 2279.\n\n\nUsing Unicode/UTF-8, you can write in emails and source code things such as\n\nMathematics and sciences:\n\n  ∮ E⋅da = Q,  n → ∞, ∑ f(i) = ∏ g(i),      ⎧⎡⎛┌─────┐⎞⎤⎫\n                                            ⎪⎢⎜│a²+b³ ⎟⎥⎪\n  ∀x∈ℝ: ⌈x⌉ = −⌊−x⌋, α ∧ ¬β = ¬(¬α ∨ β),    ⎪⎢⎜│───── ⎟⎥⎪\n                                            ⎪⎢⎜⎷ c₈   ⎟⎥⎪\n  ℕ ⊆ ℕ₀ ⊂ ℤ ⊂ ℚ ⊂ ℝ ⊂ ℂ,                   ⎨⎢⎜       ⎟⎥⎬\n                                            ⎪⎢⎜ ∞     ⎟⎥⎪\n  ⊥ < a ≠ b ≡ c ≤ d ≪ ⊤ ⇒ (⟦A⟧ ⇔ ⟪B⟫),      ⎪⎢⎜ ⎲     ⎟⎥⎪\n                                            ⎪⎢⎜ ⎳aⁱ-bⁱ⎟⎥⎪\n  2H₂ + O₂ ⇌ 2H₂O, R = 4.7 kΩ, ⌀ 200 mm     ⎩⎣⎝i=1    ⎠⎦⎭\n\nLinguistics and dictionaries:\n\n  ði ıntəˈnæʃənəl fəˈnɛtık əsoʊsiˈeıʃn\n  Y [ˈʏpsilɔn], Yen [jɛn], Yoga [ˈjoːgɑ]\n\nAPL:\n\n  ((V⍳V)=⍳⍴V)/V←,V    ⌷←⍳→⍴∆∇⊃‾⍎⍕⌈\n\nNicer typography in plain text files:\n\n  ╔══════════════════════════════════════════╗\n  ║                                          ║\n  ║   • ‘single’ and “double” quotes         ║\n  ║                                          ║\n  ║   • Curly apostrophes: “We’ve been here” ║\n  ║                                          ║\n  ║   • Latin-1 apostrophe and accents: '´`  ║\n  ║                                          ║\n  ║   • ‚deutsche‘ „Anführungszeichen“       ║\n  ║                                          ║\n  ║   • †, ‡, ‰, •, 3–4, —, −5/+5, ™, …      ║\n  ║                                          ║\n  ║   • ASCII safety test: 1lI|, 0OD, 8B     ║\n  ║                      ╭─────────╮         ║\n  ║   • the euro symbol: │ 14.95 € │         ║\n  ║                      ╰─────────╯         ║\n  ╚══════════════════════════════════════════╝\n\nCombining characters:\n\n  STARGΛ̊TE SG-1, a = v̇ = r̈, a⃑ ⊥ b⃑\n\nGreek (in Polytonic):\n\n  The Greek anthem:\n\n  Σὲ γνωρίζω ἀπὸ τὴν κόψη\n  τοῦ σπαθιοῦ τὴν τρομερή,\n  σὲ γνωρίζω ἀπὸ τὴν ὄψη\n  ποὺ μὲ βία μετράει τὴ γῆ.\n\n  ᾿Απ᾿ τὰ κόκκαλα βγαλμένη\n  τῶν ῾Ελλήνων τὰ ἱερά\n  καὶ σὰν πρῶτα ἀνδρειωμένη\n  χαῖρε, ὦ χαῖρε, ᾿Ελευθεριά!\n\n  From a speech of Demosthenes in the 4th century BC:\n\n  Οὐχὶ ταὐτὰ παρίσταταί μοι γιγνώσκειν, ὦ ἄνδρες ᾿Αθηναῖοι,\n  ὅταν τ᾿ εἰς τὰ πράγματα ἀποβλέψω καὶ ὅταν πρὸς τοὺς\n  λόγους οὓς ἀκούω· τοὺς μὲν γὰρ λόγους περὶ τοῦ\n  τιμωρήσασθαι Φίλιππον ὁρῶ γιγνομένους, τὰ δὲ πράγματ᾿\n  εἰς τοῦτο προήκοντα,  ὥσθ᾿ ὅπως μὴ πεισόμεθ᾿ αὐτοὶ\n  πρότερον κακῶς σκέψασθαι δέον. οὐδέν οὖν ἄλλο μοι δοκοῦσιν\n  οἱ τὰ τοιαῦτα λέγοντες ἢ τὴν ὑπόθεσιν, περὶ ἧς βουλεύεσθαι,\n  οὐχὶ τὴν οὖσαν παριστάντες ὑμῖν ἁμαρτάνειν. ἐγὼ δέ, ὅτι μέν\n  ποτ᾿ ἐξῆν τῇ πόλει καὶ τὰ αὑτῆς ἔχειν ἀσφαλῶς καὶ Φίλιππον\n  τιμωρήσασθαι, καὶ μάλ᾿ ἀκριβῶς οἶδα· ἐπ᾿ ἐμοῦ γάρ, οὐ πάλαι\n  γέγονεν ταῦτ᾿ ἀμφότερα· νῦν μέντοι πέπεισμαι τοῦθ᾿ ἱκανὸν\n  προλαβεῖν ἡμῖν εἶναι τὴν πρώτην, ὅπως τοὺς συμμάχους\n  σώσομεν. ἐὰν γὰρ τοῦτο βεβαίως ὑπάρξῃ, τότε καὶ περὶ τοῦ\n  τίνα τιμωρήσεταί τις καὶ ὃν τρόπον ἐξέσται σκοπεῖν· πρὶν δὲ\n  τὴν ἀρχὴν ὀρθῶς ὑποθέσθαι, μάταιον ἡγοῦμαι περὶ τῆς\n  τελευτῆς ὁντινοῦν ποιεῖσθαι λόγον.\n\n  Δημοσθένους, Γ´ ᾿Ολυνθιακὸς\n\nGeorgian:\n\n  From a Unicode conference invitation:\n\n  გთხოვთ ახლავე გაიაროთ რეგისტრაცია Unicode-ის მეათე საერთაშორისო\n  კონფერენციაზე დასასწრებად, რომელიც გაიმართება 10-12 მარტს,\n  ქ. მაინცში, გერმანიაში. კონფერენცია შეჰკრებს ერთად მსოფლიოს\n  ექსპერტებს ისეთ დარგებში როგორიცაა ინტერნეტი და Unicode-ი,\n  ინტერნაციონალიზაცია და ლოკალიზაცია, Unicode-ის გამოყენება\n  ოპერაციულ სისტემებსა, და გამოყენებით პროგრამებში, შრიფტებში,\n  ტექსტების დამუშავებასა და მრავალენოვან კომპიუტერულ სისტემებში.\n\nRussian:\n\n  From a Unicode conference invitation:\n\n  Зарегистрируйтесь сейчас на Десятую Международную Конференцию по\n  Unicode, которая состоится 10-12 марта 1997 года в Майнце в Германии.\n  Конференция соберет широкий круг экспертов по  вопросам глобального\n  Интернета и Unicode, локализации и интернационализации, воплощению и\n  применению Unicode в различных операционных системах и программных\n  приложениях, шрифтах, верстке и многоязычных компьютерных системах.\n\nThai (UCS Level 2):\n\n  Excerpt from a poetry on The Romance of The Three Kingdoms (a Chinese\n  classic 'San Gua'):\n\n  [----------------------------|------------------------]\n    ๏ แผ่นดินฮั่นเสื่อมโทรมแสนสังเวช  พระปกเกศกองบู๊กู้ขึ้นใหม่\n  สิบสองกษัตริย์ก่อนหน้าแลถัดไป       สององค์ไซร้โง่เขลาเบาปัญญา\n    ทรงนับถือขันทีเป็นที่พึ่ง           บ้านเมืองจึงวิปริตเป็นนักหนา\n  โฮจิ๋นเรียกทัพทั่วหัวเมืองมา         หมายจะฆ่ามดชั่วตัวสำคัญ\n    เหมือนขับไสไล่เสือจากเคหา      รับหมาป่าเข้ามาเลยอาสัญ\n  ฝ่ายอ้องอุ้นยุแยกให้แตกกัน          ใช้สาวนั้นเป็นชนวนชื่นชวนใจ\n    พลันลิฉุยกุยกีกลับก่อเหตุ          ช่างอาเพศจริงหนาฟ้าร้องไห้\n  ต้องรบราฆ่าฟันจนบรรลัย           ฤๅหาใครค้ำชูกู้บรรลังก์ ฯ\n\n  (The above is a two-column text. If combining characters are handled\n  correctly, the lines of the second column should be aligned with the\n  | character above.)\n\nEthiopian:\n\n  Proverbs in the Amharic language:\n\n  ሰማይ አይታረስ ንጉሥ አይከሰስ።\n  ብላ ካለኝ እንደአባቴ በቆመጠኝ።\n  ጌጥ ያለቤቱ ቁምጥና ነው።\n  ደሀ በሕልሙ ቅቤ ባይጠጣ ንጣት በገደለው።\n  የአፍ ወለምታ በቅቤ አይታሽም።\n  አይጥ በበላ ዳዋ ተመታ።\n  ሲተረጉሙ ይደረግሙ።\n  ቀስ በቀስ፥ ዕንቁላል በእግሩ ይሄዳል።\n  ድር ቢያብር አንበሳ ያስር።\n  ሰው እንደቤቱ እንጅ እንደ ጉረቤቱ አይተዳደርም።\n  እግዜር የከፈተውን ጉሮሮ ሳይዘጋው አይድርም።\n  የጎረቤት ሌባ፥ ቢያዩት ይስቅ ባያዩት ያጠልቅ።\n  ሥራ ከመፍታት ልጄን ላፋታት።\n  ዓባይ ማደሪያ የለው፥ ግንድ ይዞ ይዞራል።\n  የእስላም አገሩ መካ የአሞራ አገሩ ዋርካ።\n  ተንጋሎ ቢተፉ ተመልሶ ባፉ።\n  ወዳጅህ ማር ቢሆን ጨርስህ አትላሰው።\n  እግርህን በፍራሽህ ልክ ዘርጋ።\n\nRunes:\n\n  ᚻᛖ ᚳᚹᚫᚦ ᚦᚫᛏ ᚻᛖ ᛒᚢᛞᛖ ᚩᚾ ᚦᚫᛗ ᛚᚪᚾᛞᛖ ᚾᚩᚱᚦᚹᛖᚪᚱᛞᚢᛗ ᚹᛁᚦ ᚦᚪ ᚹᛖᛥᚫ\n\n  (Old English, which transcribed into Latin reads 'He cwaeth that he\n  bude thaem lande northweardum with tha Westsae.' and means 'He said\n  that he lived in the northern land near the Western Sea.')\n\nBraille:\n\n  ⡌⠁⠧⠑ ⠼⠁⠒  ⡍⠜⠇⠑⠹⠰⠎ ⡣⠕⠌\n\n  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠙⠑⠁⠙⠒ ⠞⠕ ⠃⠑⠛⠔ ⠺⠊⠹⠲ ⡹⠻⠑ ⠊⠎ ⠝⠕ ⠙⠳⠃⠞\n  ⠱⠁⠞⠑⠧⠻ ⠁⠃⠳⠞ ⠹⠁⠞⠲ ⡹⠑ ⠗⠑⠛⠊⠌⠻ ⠕⠋ ⠙⠊⠎ ⠃⠥⠗⠊⠁⠇ ⠺⠁⠎\n  ⠎⠊⠛⠝⠫ ⠃⠹ ⠹⠑ ⠊⠇⠻⠛⠹⠍⠁⠝⠂ ⠹⠑ ⠊⠇⠻⠅⠂ ⠹⠑ ⠥⠝⠙⠻⠞⠁⠅⠻⠂\n  ⠁⠝⠙ ⠹⠑ ⠡⠊⠑⠋ ⠍⠳⠗⠝⠻⠲ ⡎⠊⠗⠕⠕⠛⠑ ⠎⠊⠛⠝⠫ ⠊⠞⠲ ⡁⠝⠙\n  ⡎⠊⠗⠕⠕⠛⠑⠰⠎ ⠝⠁⠍⠑ ⠺⠁⠎ ⠛⠕⠕⠙ ⠥⠏⠕⠝ ⠰⡡⠁⠝⠛⠑⠂ ⠋⠕⠗ ⠁⠝⠹⠹⠔⠛ ⠙⠑\n  ⠡⠕⠎⠑ ⠞⠕ ⠏⠥⠞ ⠙⠊⠎ ⠙⠁⠝⠙ ⠞⠕⠲\n\n  ⡕⠇⠙ ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲\n\n  ⡍⠔⠙⠖ ⡊ ⠙⠕⠝⠰⠞ ⠍⠑⠁⠝ ⠞⠕ ⠎⠁⠹ ⠹⠁⠞ ⡊ ⠅⠝⠪⠂ ⠕⠋ ⠍⠹\n  ⠪⠝ ⠅⠝⠪⠇⠫⠛⠑⠂ ⠱⠁⠞ ⠹⠻⠑ ⠊⠎ ⠏⠜⠞⠊⠊⠥⠇⠜⠇⠹ ⠙⠑⠁⠙ ⠁⠃⠳⠞\n  ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲ ⡊ ⠍⠊⠣⠞ ⠙⠁⠧⠑ ⠃⠑⠲ ⠔⠊⠇⠔⠫⠂ ⠍⠹⠎⠑⠇⠋⠂ ⠞⠕\n  ⠗⠑⠛⠜⠙ ⠁ ⠊⠕⠋⠋⠔⠤⠝⠁⠊⠇ ⠁⠎ ⠹⠑ ⠙⠑⠁⠙⠑⠌ ⠏⠊⠑⠊⠑ ⠕⠋ ⠊⠗⠕⠝⠍⠕⠝⠛⠻⠹\n  ⠔ ⠹⠑ ⠞⠗⠁⠙⠑⠲ ⡃⠥⠞ ⠹⠑ ⠺⠊⠎⠙⠕⠍ ⠕⠋ ⠳⠗ ⠁⠝⠊⠑⠌⠕⠗⠎\n  ⠊⠎ ⠔ ⠹⠑ ⠎⠊⠍⠊⠇⠑⠆ ⠁⠝⠙ ⠍⠹ ⠥⠝⠙⠁⠇⠇⠪⠫ ⠙⠁⠝⠙⠎\n  ⠩⠁⠇⠇ ⠝⠕⠞ ⠙⠊⠌⠥⠗⠃ ⠊⠞⠂ ⠕⠗ ⠹⠑ ⡊⠳⠝⠞⠗⠹⠰⠎ ⠙⠕⠝⠑ ⠋⠕⠗⠲ ⡹⠳\n  ⠺⠊⠇⠇ ⠹⠻⠑⠋⠕⠗⠑ ⠏⠻⠍⠊⠞ ⠍⠑ ⠞⠕ ⠗⠑⠏⠑⠁⠞⠂ ⠑⠍⠏⠙⠁⠞⠊⠊⠁⠇⠇⠹⠂ ⠹⠁⠞\n  ⡍⠜⠇⠑⠹ ⠺⠁⠎ ⠁⠎ ⠙⠑⠁⠙ ⠁⠎ ⠁ ⠙⠕⠕⠗⠤⠝⠁⠊⠇⠲\n\n  (The first couple of paragraphs of \"A Christmas Carol\" by Dickens)\n\nCompact font selection example text:\n\n  ABCDEFGHIJKLMNOPQRSTUVWXYZ /0123456789\n  abcdefghijklmnopqrstuvwxyz £©µÀÆÖÞßéöÿ\n  –—‘“”„†•…‰™œŠŸž€ ΑΒΓΔΩαβγδω АБВГДабвгд\n  ∀∂∈ℝ∧∪≡∞ ↑↗↨↻⇣ ┐┼╔╘░►☺♀ ﬁ�⑀₂ἠḂӥẄɐː⍎אԱა\n\nGreetings in various languages:\n\n  Hello world, Καλημέρα κόσμε, コンニチハ\n\nBox drawing alignment tests:                                          █\n                                                                      ▉\n  ╔══╦══╗  ┌──┬──┐  ╭──┬──╮  ╭──┬──╮  ┏━━┳━━┓  ┎┒┏┑   ╷  ╻ ┏┯┓ ┌┰┐    ▊ ╱╲╱╲╳╳╳\n  ║┌─╨─┐║  │╔═╧═╗│  │╒═╪═╕│  │╓─╁─╖│  ┃┌─╂─┐┃  ┗╃╄┙  ╶┼╴╺╋╸┠┼┨ ┝╋┥    ▋ ╲╱╲╱╳╳╳\n  ║│╲ ╱│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╿ │┃  ┍╅╆┓   ╵  ╹ ┗┷┛ └┸┘    ▌ ╱╲╱╲╳╳╳\n  ╠╡ ╳ ╞╣  ├╢   ╟┤  ├┼─┼─┼┤  ├╫─╂─╫┤  ┣┿╾┼╼┿┫  ┕┛┖┚     ┌┄┄┐ ╎ ┏┅┅┓ ┋ ▍ ╲╱╲╱╳╳╳\n  ║│╱ ╲│║  │║   ║│  ││ │ ││  │║ ┃ ║│  ┃│ ╽ │┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▎\n  ║└─╥─┘║  │╚═╤═╝│  │╘═╪═╛│  │╙─╀─╜│  ┃└─╂─┘┃  ░░▒▒▓▓██ ┊  ┆ ╎ ╏  ┇ ┋ ▏\n  ╚══╩══╝  └──┴──┘  ╰──┴──╯  ╰──┴──╯  ┗━━┻━━┛  ▗▄▖▛▀▜   └╌╌┘ ╎ ┗╍╍┛ ┋  ▁▂▃▄▅▆▇█\n                                               ▝▀▘▙▄▟\n\nSurrogates:\n\n𠜎 𠜱 𠝹 𠱓 𠱸 𠲖 𠳏 𠳕 𠴕 𠵼 𠵿 𠸎 𠸏 𠹷 𠺝 𠺢 𠻗 𠻹 𠻺 𠼭 𠼮 𠽌 𠾴 𠾼 𠿪 𡁜 𡁯 𡁵 𡁶 𡁻 𡃁\n𡃉 𡇙 𢃇 𢞵 𢫕 𢭃 𢯊 𢱑 𢱕 𢳂 𢴈 𢵌 𢵧 𢺳 𣲷 𤓓 𤶸 𤷪 𥄫 𦉘 𦟌 𦧲 𦧺 𧨾 𨅝 𨈇 𨋢 𨳊 𨳍 𨳒 𩶘\n"
  },
  {
    "path": "lib/utf8/tests/index.js",
    "content": "var tape = require(\"tape\");\n\nvar utf8 = require(\"..\");\n\nvar data = require(\"fs\").readFileSync(require.resolve(\"./data/utf8.txt\")),\n    dataStr = data.toString(\"utf8\");\n\nvar surrogatePairErr = require(\"fs\").readFileSync(require.resolve(\"./data/surrogate_pair_bug.txt\")),\n    surrogatePairErrStr = data.toString(\"utf8\");\n\ntape.test(\"utf8\", function(test) {\n\n    test.test(test.name + \" - length\", function(test) {\n        test.equal(utf8.length(\"\"), 0, \"should return a byte length of zero for an empty string\");\n\n        test.equal(utf8.length(dataStr), Buffer.byteLength(dataStr), \"should return the same byte length as node buffers\");\n\n        test.end();\n    });\n\n    test.test(test.name + \" - read\", function(test) {\n        var comp = utf8.read([], 0, 0);\n        test.equal(comp, \"\", \"should decode an empty buffer to an empty string\");\n\n        comp = utf8.read(data, 0, data.length);\n        test.equal(comp, data.toString(\"utf8\"), \"should decode to the same byte data as node buffers\");\n\n        var longData = Buffer.concat([data, data, data, data]);\n        comp = utf8.read(longData, 0, longData.length);\n        test.equal(comp, longData.toString(\"utf8\"), \"should decode to the same byte data as node buffers (long)\");\n\n        var chunkData = new Buffer(data.toString(\"utf8\").substring(0, 8192));\n        comp = utf8.read(chunkData, 0, chunkData.length);\n        test.equal(comp, chunkData.toString(\"utf8\"), \"should decode to the same byte data as node buffers (chunk size)\");\n\n        comp = utf8.read(surrogatePairErr, 0, surrogatePairErr.length);\n        test.equal(comp, surrogatePairErr.toString(\"utf8\"), \"should decode to the same byte data as node buffers (surrogate pair over chunk)\");\n\n        test.end();\n    });\n\n    test.test(test.name + \" - write\", function(test) {\n        var buf = new Buffer(0);\n        test.equal(utf8.write(\"\", buf, 0), 0, \"should encode an empty string to an empty buffer\");\n\n        var len = utf8.length(dataStr);\n        buf = new Buffer(len);\n        test.equal(utf8.write(dataStr, buf, 0), len, \"should encode to exactly \" + len + \" bytes\");\n\n        test.equal(buf.length, data.length, \"should encode to a buffer length equal to that of node buffers\");\n\n        for (var i = 0; i < buf.length; ++i) {\n            if (buf[i] !== data[i]) {\n                test.fail(\"should encode to the same buffer data as node buffers (offset \" + i + \")\");\n                return;\n            }\n        }\n        test.pass(\"should encode to the same buffer data as node buffers\");\n\n        test.end();\n    });\n\n});\n"
  },
  {
    "path": "light.d.ts",
    "content": "export as namespace protobuf;\nexport * from \"./index\";\n"
  },
  {
    "path": "light.js",
    "content": "// light library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-light\");"
  },
  {
    "path": "minimal.d.ts",
    "content": "export as namespace protobuf;\nexport * from \"./index\";\n"
  },
  {
    "path": "minimal.js",
    "content": "// minimal library entry point.\n\n\"use strict\";\nmodule.exports = require(\"./src/index-minimal\");\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"protobufjs\",\n  \"version\": \"8.0.1\",\n  \"versionScheme\": \"~\",\n  \"description\": \"Protocol Buffers for JavaScript (& TypeScript).\",\n  \"author\": \"Daniel Wirtz <dcode+protobufjs@dcode.io>\",\n  \"license\": \"BSD-3-Clause\",\n  \"repository\": \"protobufjs/protobuf.js\",\n  \"bugs\": \"https://github.com/protobufjs/protobuf.js/issues\",\n  \"homepage\": \"https://protobufjs.github.io/protobuf.js/\",\n  \"engines\": {\n    \"node\": \">=12.0.0\"\n  },\n  \"eslintConfig\": {\n    \"env\": {\n      \"es6\": true\n    },\n    \"parserOptions\": {\n      \"ecmaVersion\": 6\n    }\n  },\n  \"keywords\": [\n    \"protobuf\",\n    \"protocol-buffers\",\n    \"serialization\",\n    \"typescript\"\n  ],\n  \"main\": \"index.js\",\n  \"types\": \"index.d.ts\",\n  \"scripts\": {\n    \"bench\": \"node bench\",\n    \"build\": \"npm run build:bundle && npm run build:types\",\n    \"build:bundle\": \"gulp --gulpfile scripts/gulpfile.js\",\n    \"build:types\": \"node cli/bin/pbts --main --global protobuf --out index.d.ts src/ lib/aspromise/index.js lib/base64/index.js lib/codegen/index.js lib/eventemitter/index.js lib/float/index.js lib/fetch/index.js lib/inquire/index.js lib/path/index.js lib/pool/index.js lib/utf8/index.js\",\n    \"changelog\": \"node scripts/changelog -w\",\n    \"coverage\": \"npm run coverage:test && npm run coverage:report\",\n    \"coverage:test\": \"nyc --silent tape -r ./lib/tape-adapter tests/*.js tests/node/*.js\",\n    \"coverage:report\": \"nyc report --reporter=lcov --reporter=text\",\n    \"docs\": \"jsdoc -c config/jsdoc.json -R README.md --verbose --pedantic\",\n    \"lint\": \"npm run lint:sources && npm run lint:types\",\n    \"lint:sources\": \"eslint \\\"**/*.js\\\" -c config/eslint.json\",\n    \"lint:types\": \"tslint \\\"**/*.d.ts\\\" -e \\\"**/node_modules/**\\\" -t stylish -c config/tslint.json\",\n    \"pages\": \"node scripts/pages\",\n    \"prepublish\": \"cd cli && npm install && cd .. && npm run build\",\n    \"prepublishOnly\": \"cd cli && npm install && cd .. && npm run build\",\n    \"postinstall\": \"node scripts/postinstall\",\n    \"prof\": \"node bench/prof\",\n    \"test\": \"npm run test:sources && npm run test:types\",\n    \"test:sources\": \"tape -r ./lib/tape-adapter tests/*.js tests/node/*.js\",\n    \"test:types\": \"tsc tests/comp_typescript.ts --lib es2015 --esModuleInterop --strictNullChecks --experimentalDecorators --emitDecoratorMetadata && tsc tests/data/test.js.ts --lib es2015 --esModuleInterop --noEmit --strictNullChecks && tsc tests/data/*.ts --lib es2015 --esModuleInterop --noEmit --strictNullChecks\",\n    \"make\": \"npm run lint:sources && npm run build && npm run lint:types && node ./scripts/gentests.js && npm test\"\n  },\n  \"dependencies\": {\n    \"@protobufjs/aspromise\": \"^1.1.2\",\n    \"@protobufjs/base64\": \"^1.1.2\",\n    \"@protobufjs/codegen\": \"^2.0.4\",\n    \"@protobufjs/eventemitter\": \"^1.1.0\",\n    \"@protobufjs/fetch\": \"^1.1.0\",\n    \"@protobufjs/float\": \"^1.0.2\",\n    \"@protobufjs/inquire\": \"^1.1.0\",\n    \"@protobufjs/path\": \"^1.1.2\",\n    \"@protobufjs/pool\": \"^1.1.0\",\n    \"@protobufjs/utf8\": \"^1.1.0\",\n    \"@types/node\": \">=13.7.0\",\n    \"long\": \"^5.0.0\"\n  },\n  \"devDependencies\": {\n    \"benchmark\": \"^2.1.4\",\n    \"browserify\": \"^17.0.0\",\n    \"browserify-wrap\": \"^1.0.2\",\n    \"bundle-collapser\": \"^1.3.0\",\n    \"chalk\": \"^4.0.0\",\n    \"escodegen\": \"^1.13.0\",\n    \"eslint\": \"^8.15.0\",\n    \"espree\": \"^9.0.0\",\n    \"estraverse\": \"^5.1.0\",\n    \"gh-pages\": \"^4.0.0\",\n    \"git-raw-commits\": \"^2.0.3\",\n    \"git-semver-tags\": \"^4.0.0\",\n    \"google-protobuf\": \"^3.11.3\",\n    \"gulp\": \"^4.0.2\",\n    \"gulp-header\": \"^2.0.9\",\n    \"gulp-if\": \"^3.0.0\",\n    \"gulp-sourcemaps\": \"^3.0.0\",\n    \"gulp-uglify\": \"^3.0.2\",\n    \"jaguarjs-jsdoc\": \"github:dcodeIO/jaguarjs-jsdoc\",\n    \"jsdoc\": \"^4.0.0\",\n    \"minimist\": \"^1.2.0\",\n    \"nyc\": \"^15.0.0\",\n    \"reflect-metadata\": \"^0.1.13\",\n    \"tape\": \"^5.0.0\",\n    \"tslint\": \"^6.0.0\",\n    \"typescript\": \"^3.7.5\",\n    \"uglify-js\": \"^3.7.7\",\n    \"vinyl-buffer\": \"^1.0.1\",\n    \"vinyl-fs\": \"^3.0.3\",\n    \"vinyl-source-stream\": \"^2.0.0\"\n  },\n  \"files\": [\n    \"index.js\",\n    \"index.d.ts\",\n    \"light.d.ts\",\n    \"light.js\",\n    \"minimal.d.ts\",\n    \"minimal.js\",\n    \"package-lock.json\",\n    \"tsconfig.json\",\n    \"scripts/postinstall.js\",\n    \"dist/**\",\n    \"ext/**\",\n    \"google/**\",\n    \"src/**\"\n  ]\n}\n"
  },
  {
    "path": "release-please-config.json",
    "content": "{\n  \"bootstrap-sha\": \"6fc37d9ea3502cdc08ef988494c041aacd0f7e7f\",\n  \"packages\": {\n    \"cli\": {},\n    \".\": {}\n  }\n}"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"extends\": [\n    \"config:base\",\n    \"docker:disable\"\n  ],\n  \"pinVersions\": false,\n  \"rebaseStalePrs\": true,\n  \"schedule\": [\n    \"after 9am and before 3pm\"\n  ],\n  \"gitAuthor\": null,\n  \"packageRules\": [\n    {\n      \"extends\": \"packages:linters\",\n      \"groupName\": \"linters\"\n    }\n  ]\n}\n"
  },
  {
    "path": "scripts/bundle.js",
    "content": "\"use strict\";\nmodule.exports = bundle;\n\nvar fs         = require(\"fs\"),\n    path       = require(\"path\");\n\nvar browserify = require(\"browserify\");\n\nvar header     = require(\"gulp-header\");\nvar gulpif     = require(\"gulp-if\");\nvar sourcemaps = require(\"gulp-sourcemaps\");\nvar uglify     = require(\"gulp-uglify\");\n\nvar buffer     = require(\"vinyl-buffer\");\nvar vinylfs    = require(\"vinyl-fs\");\nvar source     = require(\"vinyl-source-stream\");\n\nvar pkg = require(path.join(__dirname, \"..\", \"package.json\"));\n\n/*eslint-disable no-template-curly-in-string*/\nvar license = [\n    \"/*!\",\n    \" * protobuf.js v${version} (c) 2016, daniel wirtz\",\n    \" * compiled ${date}\",\n    \" * licensed under the bsd-3-clause license\",\n    \" * see: https://github.com/dcodeio/protobuf.js for details\",\n    \" */\"\n].join(\"\\n\") + \"\\n\";\n/*eslint-enable no-template-curly-in-string*/\n\nvar prelude = fs.readFileSync(require.resolve(\"../lib/prelude.js\")).toString(\"utf8\");\n\n/**\n * Bundles the library.\n * @param {Object} options Bundler options\n * @param {string} options.entry Entry file\n * @param {string} options.target Target directory\n * @param {boolean} [options.compress=false] Whether to minify or not\n * @param {string[]} [options.exclude] Excluded source files\n * @returns {undefined}\n */\nfunction bundle(options) {\n    if (!options || !options.entry || !options.target)\n        throw TypeError(\"missing options\");\n    var bundler = browserify({\n        entries: options.entry,\n        insertGlobalVars: false,\n        detectGlobals: false,\n        debug: true,\n        prelude: prelude,\n        preludePath: \"./lib/prelude.js\"\n    })\n    .external(\"long\");\n    if (options.exclude)\n        options.exclude.forEach(bundler.exclude, bundler);\n    return bundler\n    .plugin(require(\"browserify-wrap\"), {\n        // undefined var and global strict-mode for uglify\n        prefix: \"(function(undefined){\\\"use strict\\\";\",\n        suffix: \"})();\"\n    })\n    .plugin(require(\"bundle-collapser/plugin\"))\n    .bundle()\n    .pipe(source(options.compress ? \"protobuf.min.js\" : \"protobuf.js\"))\n    .pipe(buffer())\n    .pipe(sourcemaps.init({ loadMaps: true }))\n            .pipe(\n                gulpif(options.compress, uglify({\n                    mangle: {\n                        eval: true,\n                        properties: {\n                            regex: /^_/\n                        }\n                    },\n                    compress: {\n                        keep_fargs: false,\n                        unsafe: true\n                    },\n                    output: {\n                        max_line_len: 0x7fffffff\n                    }\n                }))\n            )\n            .pipe(header(license, {\n                date: (new Date()).toUTCString().replace(\"GMT\", \"UTC\").toLowerCase(),\n                version: pkg.version\n            }))\n    .pipe(sourcemaps.write(\".\", { sourceRoot: \"\" }))\n    .pipe(vinylfs.dest(options.target))\n    .on(\"log\", console.log)\n    .on(\"error\", console.error);\n}\n"
  },
  {
    "path": "scripts/changelog.js",
    "content": "\"use strict\";\n\nvar path = require(\"path\"),\n    fs   = require(\"fs\");\n\nvar gitSemverTags = require(\"git-semver-tags\"),\n    gitRawCommits = require(\"git-raw-commits\"),\n    minimist      = require(\"minimist\");\n\nvar basedir = path.join(__dirname, \"..\");\nvar pkg = require(basedir + \"/package.json\");\n\nvar argv = minimist(process.argv, {\n    alias: {\n        tag    : \"t\",\n        write  : \"w\"\n    },\n    string: [ \"tag\" ],\n    boolean: [ \"write\" ],\n    default: {\n        tag: null,\n        write: false\n    }\n});\n\n// categories to be used in the future and regexes for lazy / older subjects\nvar validCategories = {\n    \"Breaking\": null,\n    \"Fixed\": /fix|properly|prevent|correctly/i,\n    \"New\": /added|initial/i,\n    \"CLI\": /pbjs|pbts|CLI/,\n    \"Docs\": /README/i,\n    \"Other\": null\n};\nvar breakingFallback = /removed|stripped|dropped/i;\n\nvar repo = \"https://github.com/protobufjs/protobuf.js\";\n\ngitSemverTags(function(err, tags) {\n    if (err)\n        throw err;\n\n    var categories = {};\n    Object.keys(validCategories).forEach(function(category) {\n        categories[category] = [];\n    });\n    var output = [];\n\n    var from = tags[0];\n    var to = \"HEAD\";\n    var tag;\n    if (argv.tag) {\n        var idx = tags.indexOf(argv.tag);\n        if (idx < 0)\n            throw Error(\"no such tag: \" + argv.tag);\n        from = tags[idx + 1];\n        tag = to = tags[idx];\n    } else\n        tag = pkg.version;\n\n    var commits = gitRawCommits({\n        from: from,\n        to: to,\n        merges: false,\n        format: \"%B%n#%H\"\n    });\n\n    commits.on(\"error\", function(err) {\n        throw err;\n    });\n\n    commits.on(\"data\", function(chunk) {\n        var message = chunk.toString(\"utf8\").trim();\n        var match = /##([0-9a-f]{40})$/.exec(message);\n        var hash;\n        if (match) {\n            message = message.substring(0, message.length - match[1].length).trim();\n            hash = match[1];\n        }\n        message.split(\";\").forEach(function(message) {\n            if (/^(Merge pull request |Post-merge)/.test(message))\n                return;\n            var match = /^(\\w+):/i.exec(message = message.trim());\n            var category;\n            if (match && match[1] in validCategories) {\n                category = match[1];\n                message = message.substring(match[1].length + 1).trim();\n            } else {\n                var keys = Object.keys(validCategories);\n                for (var i = 0; i < keys.length; ++i) {\n                    var re = validCategories[keys[i]];\n                    if (re && re.test(message)) {\n                        category = keys[i];\n                        break;\n                    }\n                }\n                message = message.replace(/^(\\w+):/i, \"\").trim();\n            }\n            if (!category) {\n                if (breakingFallback.test(message))\n                    category = \"Breaking\";\n                else\n                    category = \"Other\";\n            }\n            var nl = message.indexOf(\"\\n\");\n            if (nl > -1)\n                message = message.substring(0, nl).trim();\n            if (!hash || message.length < 12)\n                return;\n            message = message.replace(/\\[ci skip\\]/, \"\").trim();\n            categories[category].push({\n                text: message,\n                hash: hash\n            });\n        });\n    });\n\n    commits.on(\"end\", function() {\n        output.push(\"## [\" + tag + \"](\" + repo + \"/releases/tag/\" + tag + \")\\n\");\n        Object.keys(categories).forEach(function(category) {\n            var messages = categories[category];\n            if (!messages.length)\n                return;\n            output.push(\"\\n### \" + category + \"\\n\");\n            messages.forEach(function(message) {\n                var text = message.text.replace(/#(\\d+)/g, \"[#$1](\" + repo + \"/issues/$1)\");\n                output.push(\"[:hash:](\" + repo + \"/commit/\" + message.hash + \") \" + text + \"<br />\\n\");\n            });\n        });\n        var current;\n        try {\n            current = fs.readFileSync(basedir + \"/CHANGELOG.md\").toString(\"utf8\");\n        } catch (e) {\n            current = \"\";\n        }\n        var re = new RegExp(\"^## \\\\[\" + tag + \"\\\\]\");\n        if (re.test(current)) { // regenerated, replace\n            var pos = current.indexOf(\"## [\", 1);\n            if (pos > -1)\n                current = current.substring(pos).trim();\n            else\n                current = \"\";\n        }\n        var contents = output.join(\"\") + \"\\n\" + current;\n        if (argv.write)\n            fs.writeFileSync(basedir + \"/CHANGELOG.md\", contents, \"utf8\");\n        else\n            process.stdout.write(contents);\n    });\n});\n"
  },
  {
    "path": "scripts/gencommons.js",
    "content": "\"use strict\";\nvar pbjs = require(\"../cli/pbjs\");\n\n[\n    \"google/protobuf/api.proto\",\n    \"google/protobuf/descriptor.proto\",\n    \"google/protobuf/source_context.proto\",\n    \"google/protobuf/type.proto\",\n\n    \"google/api/annotations.proto\",\n    \"google/api/http.proto\"\n]\n.forEach(function(file) {\n    var out = file.replace(/\\.proto$/, \".json\");\n    pbjs.main([\n        \"--target\", \"json\",\n        \"--sparse\",\n        \"--out\", out,\n        file\n    ], function(err) {\n        if (err)\n            throw err;\n        process.stdout.write(\"pbjs: \" + file + \" -> \" + out + \"\\n\");\n    });\n});"
  },
  {
    "path": "scripts/gentests.js",
    "content": "\"use strict\";\nvar fs   = require(\"fs\"),\n    path = require(\"path\"),\n    pbjs = require(\"../cli/pbjs\"),\n    pbts = require(\"../cli/pbts\");\n\n[\n    { file: \"tests/data/comments.proto\", flags: [] },\n    { file: \"tests/data/convert.proto\", flags: [] },\n    { file: \"tests/data/mapbox/vector_tile.proto\", flags: [] },\n    { file: \"tests/data/package.proto\", flags: [] },\n    { file: \"tests/data/rpc.proto\", flags: [ \"es6\" ] },\n    { file: \"tests/data/rpc.proto\", flags: [] },\n    { file: \"tests/data/rpc-reserved.proto\", flags: [] },\n    { file: \"tests/data/test.proto\", flags: [] },\n    { file: \"tests/data/type_url.proto\", flags: [] },\n    { file: \"bench/data/bench.proto\", flags: [\"no-create\", \"no-verify\", \"no-delimited\", \"no-convert\", \"no-verify\", \"no-typeurl\", \"no-comments\"], out: \"bench/data/static_pbjs.js\" }\n]\n.forEach(function({ file, flags, out }) {\n    var basename = file.replace(/\\.proto$/, \"\");\n    if (!out)\n        out = [ basename ].concat(flags).join(\"-\") + \".js\";\n    pbjs.main([\n        \"--target\", \"static-module\",\n        \"--wrap\", flags.includes('es6') ? 'es6' : \"commonjs\",\n        \"--root\", \"test_\" + path.basename(basename, \".js\"),\n        file\n    ].concat(flags.map(function(flag) {\n        return \"--\" + flag;\n    })), function(err, output) {\n        if (err)\n            throw err;\n        var pathToProtobufjs = path.relative(path.dirname(out), \"minimal\").replace(/\\\\/g, \"/\");\n        fs.writeFileSync(out, output.replace(/\"protobufjs\\/minimal\"/g, JSON.stringify(pathToProtobufjs)));\n        process.stdout.write(\"pbjs: \" + file + \" -> \" + out + \"\\n\");\n        try {\n            require(path.join(__dirname, \"..\", out));\n        } catch (err) {\n            if (!flags.includes(\"es6\")) {\n                process.stderr.write(\"ERROR: \" + err.message + \"\\n\");\n            }\n        }\n    });\n});\n\nprocess.stdout.write(\"\\n\");\n\n[\n    { file: \"tests/data/comments.js\" },\n    { file: \"tests/data/convert.js\" },\n    { file: \"tests/data/mapbox/vector_tile.js\" },\n    { file: \"tests/data/package.js\" },\n    { file: \"tests/data/rpc.js\" },\n    { file: \"tests/data/rpc-es6.js\" },\n    { file: \"tests/data/rpc-reserved.js\" },\n    { file: \"tests/data/test.js\" },\n    { file: \"ext/descriptor/index.js\", ext: true }\n]\n.forEach(function({ file, ext }) {\n    var out = file.replace(/\\.js$/, \".d.ts\"),\n        args = [ \"--no-comments\" ];\n    pbts.main(args.concat(file), function(err, output) {\n        if (err)\n            throw err;\n        var pathToProtobufjs = path.relative(path.dirname(out), \"\").replace(/\\\\/g, \"/\");\n        output = output.replace(/\"protobufjs\"/g, JSON.stringify(pathToProtobufjs));\n        fs.writeFileSync(out, output);\n        process.stdout.write(\"pbts: \" + file + \" -> \" + out + \"\\n\");\n    });\n});\n"
  },
  {
    "path": "scripts/gulpfile.js",
    "content": "var gulp   = require(\"gulp\"),\n    bundle = require(\"./bundle\");\n\nfunction defineTask(name, entry, target) {\n    gulp.task(name + \"-bundle\", bundle.bind(this, {\n        entry    : entry,\n        target   : target\n    }));\n    gulp.task(name + \"-minify\", bundle.bind(this, {\n        entry    : entry,\n        target   : target,\n        compress : true\n    }));\n    gulp.task(name, gulp.series(\n        name + \"-bundle\",\n        name + \"-minify\"\n    ), function(done) { done(); });\n}\n\ndefineTask(\"full\"   , \"../src/index\"        , \"../dist\"        );\ndefineTask(\"light\"  , \"../src/index-light\"  , \"../dist/light\"  );\ndefineTask(\"minimal\", \"../src/index-minimal\", \"../dist/minimal\");\n\ngulp.task(\"default\", gulp.parallel(\n    \"full\",\n    \"light\",\n    \"minimal\"\n, function(done) { done(); }));\n\n/* var typedoc = require(\"gulp-typedoc\");\ngulp.task(\"typedoc\", function() {\n    return gulp\n        .src([\"../index.d.ts\"])\n        .pipe(typedoc({\n            module: \"commonjs\",\n            target: \"es5\",\n            mode: \"file\",\n            theme: \"default\",\n            includeDeclarations: true,\n            excludePrivate: true,\n            out: \"../tsdocs\",\n            name: \"protobuf.js\"\n        }))\n}); */\n\n"
  },
  {
    "path": "scripts/pages.js",
    "content": "/*eslint-disable no-console*/\n\"use strict\";\n\nvar ghpages = require(\"gh-pages\"),\n    path    = require(\"path\");\n\nghpages.publish(path.join(__dirname, \"..\", \"docs\"), {\n    logger: function(message) {\n        console.log(message);\n    }\n}, function(err) {\n    if (err)\n        console.error(err);\n    else\n        console.log(\"done\");\n});\n"
  },
  {
    "path": "scripts/postinstall.js",
    "content": "\"use strict\";\n\nvar path = require(\"path\"),\n    fs   = require(\"fs\"),\n    pkg  = require(path.join(__dirname, \"..\", \"package.json\"));\n\n// check version scheme used by dependents\nif (!pkg.versionScheme)\n    return;\n\nvar warn = process.stderr.isTTY\n    ? \"\\x1b[30m\\x1b[43mWARN\\x1b[0m \\x1b[35m\" + path.basename(process.argv[1], \".js\") + \"\\x1b[0m\"\n    : \"WARN \" + path.basename(process.argv[1], \".js\");\n\nvar basePkg;\ntry {\n    basePkg = JSON.parse(fs.readFileSync(path.join(__dirname, \"..\", \"..\", \"package.json\")));\n} catch (e) {\n    return;\n}\n\n[\n    \"dependencies\",\n    \"devDependencies\",\n    \"optionalDependencies\",\n    \"peerDependencies\"\n]\n.forEach(function(check) {\n    var version = basePkg && basePkg[check] && basePkg[check][pkg.name];\n    if (typeof version === \"string\" && version.charAt(0) !== pkg.versionScheme)\n        process.stderr.write(pkg.name + \" \" + warn + \" \" + pkg.name + \"@\" + version + \" is configured as a dependency of \" + basePkg.name + \". use \" + pkg.name + \"@\" + pkg.versionScheme + version.substring(1) + \" instead for API compatibility.\\n\");\n});\n"
  },
  {
    "path": "src/common.js",
    "content": "\"use strict\";\nmodule.exports = common;\n\nvar commonRe = /\\/|\\./;\n\n/**\n * Provides common type definitions.\n * Can also be used to provide additional google types or your own custom types.\n * @param {string} name Short name as in `google/protobuf/[name].proto` or full file name\n * @param {Object.<string,*>} json JSON definition within `google.protobuf` if a short name, otherwise the file's root definition\n * @returns {undefined}\n * @property {INamespace} google/protobuf/any.proto Any\n * @property {INamespace} google/protobuf/duration.proto Duration\n * @property {INamespace} google/protobuf/empty.proto Empty\n * @property {INamespace} google/protobuf/field_mask.proto FieldMask\n * @property {INamespace} google/protobuf/struct.proto Struct, Value, NullValue and ListValue\n * @property {INamespace} google/protobuf/timestamp.proto Timestamp\n * @property {INamespace} google/protobuf/wrappers.proto Wrappers\n * @example\n * // manually provides descriptor.proto (assumes google/protobuf/ namespace and .proto extension)\n * protobuf.common(\"descriptor\", descriptorJson);\n *\n * // manually provides a custom definition (uses my.foo namespace)\n * protobuf.common(\"my/foo/bar.proto\", myFooBarJson);\n */\nfunction common(name, json) {\n    if (!commonRe.test(name)) {\n        name = \"google/protobuf/\" + name + \".proto\";\n        json = { nested: { google: { nested: { protobuf: { nested: json } } } } };\n    }\n    common[name] = json;\n}\n\n// Not provided because of limited use (feel free to discuss or to provide yourself):\n//\n// google/protobuf/descriptor.proto\n// google/protobuf/source_context.proto\n// google/protobuf/type.proto\n//\n// Stripped and pre-parsed versions of these non-bundled files are instead available as part of\n// the repository or package within the google/protobuf directory.\n\ncommon(\"any\", {\n\n    /**\n     * Properties of a google.protobuf.Any message.\n     * @interface IAny\n     * @type {Object}\n     * @property {string} [typeUrl]\n     * @property {Uint8Array} [bytes]\n     * @memberof common\n     */\n    Any: {\n        fields: {\n            type_url: {\n                type: \"string\",\n                id: 1\n            },\n            value: {\n                type: \"bytes\",\n                id: 2\n            }\n        }\n    }\n});\n\nvar timeType;\n\ncommon(\"duration\", {\n\n    /**\n     * Properties of a google.protobuf.Duration message.\n     * @interface IDuration\n     * @type {Object}\n     * @property {number|Long} [seconds]\n     * @property {number} [nanos]\n     * @memberof common\n     */\n    Duration: timeType = {\n        fields: {\n            seconds: {\n                type: \"int64\",\n                id: 1\n            },\n            nanos: {\n                type: \"int32\",\n                id: 2\n            }\n        }\n    }\n});\n\ncommon(\"timestamp\", {\n\n    /**\n     * Properties of a google.protobuf.Timestamp message.\n     * @interface ITimestamp\n     * @type {Object}\n     * @property {number|Long} [seconds]\n     * @property {number} [nanos]\n     * @memberof common\n     */\n    Timestamp: timeType\n});\n\ncommon(\"empty\", {\n\n    /**\n     * Properties of a google.protobuf.Empty message.\n     * @interface IEmpty\n     * @memberof common\n     */\n    Empty: {\n        fields: {}\n    }\n});\n\ncommon(\"struct\", {\n\n    /**\n     * Properties of a google.protobuf.Struct message.\n     * @interface IStruct\n     * @type {Object}\n     * @property {Object.<string,IValue>} [fields]\n     * @memberof common\n     */\n    Struct: {\n        fields: {\n            fields: {\n                keyType: \"string\",\n                type: \"Value\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.Value message.\n     * @interface IValue\n     * @type {Object}\n     * @property {string} [kind]\n     * @property {0} [nullValue]\n     * @property {number} [numberValue]\n     * @property {string} [stringValue]\n     * @property {boolean} [boolValue]\n     * @property {IStruct} [structValue]\n     * @property {IListValue} [listValue]\n     * @memberof common\n     */\n    Value: {\n        oneofs: {\n            kind: {\n                oneof: [\n                    \"nullValue\",\n                    \"numberValue\",\n                    \"stringValue\",\n                    \"boolValue\",\n                    \"structValue\",\n                    \"listValue\"\n                ]\n            }\n        },\n        fields: {\n            nullValue: {\n                type: \"NullValue\",\n                id: 1\n            },\n            numberValue: {\n                type: \"double\",\n                id: 2\n            },\n            stringValue: {\n                type: \"string\",\n                id: 3\n            },\n            boolValue: {\n                type: \"bool\",\n                id: 4\n            },\n            structValue: {\n                type: \"Struct\",\n                id: 5\n            },\n            listValue: {\n                type: \"ListValue\",\n                id: 6\n            }\n        }\n    },\n\n    NullValue: {\n        values: {\n            NULL_VALUE: 0\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.ListValue message.\n     * @interface IListValue\n     * @type {Object}\n     * @property {Array.<IValue>} [values]\n     * @memberof common\n     */\n    ListValue: {\n        fields: {\n            values: {\n                rule: \"repeated\",\n                type: \"Value\",\n                id: 1\n            }\n        }\n    }\n});\n\ncommon(\"wrappers\", {\n\n    /**\n     * Properties of a google.protobuf.DoubleValue message.\n     * @interface IDoubleValue\n     * @type {Object}\n     * @property {number} [value]\n     * @memberof common\n     */\n    DoubleValue: {\n        fields: {\n            value: {\n                type: \"double\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.FloatValue message.\n     * @interface IFloatValue\n     * @type {Object}\n     * @property {number} [value]\n     * @memberof common\n     */\n    FloatValue: {\n        fields: {\n            value: {\n                type: \"float\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.Int64Value message.\n     * @interface IInt64Value\n     * @type {Object}\n     * @property {number|Long} [value]\n     * @memberof common\n     */\n    Int64Value: {\n        fields: {\n            value: {\n                type: \"int64\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.UInt64Value message.\n     * @interface IUInt64Value\n     * @type {Object}\n     * @property {number|Long} [value]\n     * @memberof common\n     */\n    UInt64Value: {\n        fields: {\n            value: {\n                type: \"uint64\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.Int32Value message.\n     * @interface IInt32Value\n     * @type {Object}\n     * @property {number} [value]\n     * @memberof common\n     */\n    Int32Value: {\n        fields: {\n            value: {\n                type: \"int32\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.UInt32Value message.\n     * @interface IUInt32Value\n     * @type {Object}\n     * @property {number} [value]\n     * @memberof common\n     */\n    UInt32Value: {\n        fields: {\n            value: {\n                type: \"uint32\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.BoolValue message.\n     * @interface IBoolValue\n     * @type {Object}\n     * @property {boolean} [value]\n     * @memberof common\n     */\n    BoolValue: {\n        fields: {\n            value: {\n                type: \"bool\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.StringValue message.\n     * @interface IStringValue\n     * @type {Object}\n     * @property {string} [value]\n     * @memberof common\n     */\n    StringValue: {\n        fields: {\n            value: {\n                type: \"string\",\n                id: 1\n            }\n        }\n    },\n\n    /**\n     * Properties of a google.protobuf.BytesValue message.\n     * @interface IBytesValue\n     * @type {Object}\n     * @property {Uint8Array} [value]\n     * @memberof common\n     */\n    BytesValue: {\n        fields: {\n            value: {\n                type: \"bytes\",\n                id: 1\n            }\n        }\n    }\n});\n\ncommon(\"field_mask\", {\n\n    /**\n     * Properties of a google.protobuf.FieldMask message.\n     * @interface IDoubleValue\n     * @type {Object}\n     * @property {number} [value]\n     * @memberof common\n     */\n    FieldMask: {\n        fields: {\n            paths: {\n                rule: \"repeated\",\n                type: \"string\",\n                id: 1\n            }\n        }\n    }\n});\n\n/**\n * Gets the root definition of the specified common proto file.\n *\n * Bundled definitions are:\n * - google/protobuf/any.proto\n * - google/protobuf/duration.proto\n * - google/protobuf/empty.proto\n * - google/protobuf/field_mask.proto\n * - google/protobuf/struct.proto\n * - google/protobuf/timestamp.proto\n * - google/protobuf/wrappers.proto\n *\n * @param {string} file Proto file name\n * @returns {INamespace|null} Root definition or `null` if not defined\n */\ncommon.get = function get(file) {\n    return common[file] || null;\n};\n"
  },
  {
    "path": "src/converter.js",
    "content": "\"use strict\";\n/**\n * Runtime message from/to plain object converters.\n * @namespace\n */\nvar converter = exports;\n\nvar Enum = require(\"./enum\"),\n    util = require(\"./util\");\n\n/**\n * Generates a partial value fromObject conveter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_fromObject(gen, field, fieldIndex, prop) {\n    var defaultAlreadyEmitted = false;\n    /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n    if (field.resolvedType) {\n        if (field.resolvedType instanceof Enum) { gen\n            (\"switch(d%s){\", prop);\n            for (var values = field.resolvedType.values, keys = Object.keys(values), i = 0; i < keys.length; ++i) {\n                // enum unknown values passthrough\n                if (values[keys[i]] === field.typeDefault && !defaultAlreadyEmitted) { gen\n                    (\"default:\")\n                        (\"if(typeof(d%s)===\\\"number\\\"){m%s=d%s;break}\", prop, prop, prop);\n                    if (!field.repeated) gen // fallback to default value only for\n                                             // arrays, to avoid leaving holes.\n                        (\"break\");           // for non-repeated fields, just ignore\n                    defaultAlreadyEmitted = true;\n                }\n                gen\n                (\"case%j:\", keys[i])\n                (\"case %i:\", values[keys[i]])\n                    (\"m%s=%j\", prop, values[keys[i]])\n                    (\"break\");\n            } gen\n            (\"}\");\n        } else gen\n            (\"if(typeof d%s!==\\\"object\\\")\", prop)\n                (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n            (\"m%s=types[%i].fromObject(d%s)\", prop, fieldIndex, prop);\n    } else {\n        var isUnsigned = false;\n        switch (field.type) {\n            case \"double\":\n            case \"float\": gen\n                (\"m%s=Number(d%s)\", prop, prop); // also catches \"NaN\", \"Infinity\"\n                break;\n            case \"uint32\":\n            case \"fixed32\": gen\n                (\"m%s=d%s>>>0\", prop, prop);\n                break;\n            case \"int32\":\n            case \"sint32\":\n            case \"sfixed32\": gen\n                (\"m%s=d%s|0\", prop, prop);\n                break;\n            case \"uint64\":\n                isUnsigned = true;\n                // eslint-disable-next-line no-fallthrough\n            case \"int64\":\n            case \"sint64\":\n            case \"fixed64\":\n            case \"sfixed64\": gen\n                (\"if(util.Long)\")\n                    (\"(m%s=util.Long.fromValue(d%s)).unsigned=%j\", prop, prop, isUnsigned)\n                (\"else if(typeof d%s===\\\"string\\\")\", prop)\n                    (\"m%s=parseInt(d%s,10)\", prop, prop)\n                (\"else if(typeof d%s===\\\"number\\\")\", prop)\n                    (\"m%s=d%s\", prop, prop)\n                (\"else if(typeof d%s===\\\"object\\\")\", prop)\n                    (\"m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)\", prop, prop, prop, isUnsigned ? \"true\" : \"\");\n                break;\n            case \"bytes\": gen\n                (\"if(typeof d%s===\\\"string\\\")\", prop)\n                    (\"util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)\", prop, prop, prop)\n                (\"else if(d%s.length >= 0)\", prop)\n                    (\"m%s=d%s\", prop, prop);\n                break;\n            case \"string\": gen\n                (\"m%s=String(d%s)\", prop, prop);\n                break;\n            case \"bool\": gen\n                (\"m%s=Boolean(d%s)\", prop, prop);\n                break;\n            /* default: gen\n                (\"m%s=d%s\", prop, prop);\n                break; */\n        }\n    }\n    return gen;\n    /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a plain object to runtime message converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.fromObject = function fromObject(mtype) {\n    /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n    var fields = mtype.fieldsArray;\n    var gen = util.codegen([\"d\"], mtype.name + \"$fromObject\")\n    (\"if(d instanceof this.ctor)\")\n        (\"return d\");\n    if (!fields.length) return gen\n    (\"return new this.ctor\");\n    gen\n    (\"var m=new this.ctor\");\n    for (var i = 0; i < fields.length; ++i) {\n        var field  = fields[i].resolve(),\n            prop   = util.safeProp(field.name);\n\n        // Map fields\n        if (field.map) { gen\n    (\"if(d%s){\", prop)\n        (\"if(typeof d%s!==\\\"object\\\")\", prop)\n            (\"throw TypeError(%j)\", field.fullName + \": object expected\")\n        (\"m%s={}\", prop)\n        (\"for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){\", prop);\n            genValuePartial_fromObject(gen, field, /* not sorted */ i, prop + \"[ks[i]]\")\n        (\"}\")\n    (\"}\");\n\n        // Repeated fields\n        } else if (field.repeated) { gen\n    (\"if(d%s){\", prop)\n        (\"if(!Array.isArray(d%s))\", prop)\n            (\"throw TypeError(%j)\", field.fullName + \": array expected\")\n        (\"m%s=[]\", prop)\n        (\"for(var i=0;i<d%s.length;++i){\", prop);\n            genValuePartial_fromObject(gen, field, /* not sorted */ i, prop + \"[i]\")\n        (\"}\")\n    (\"}\");\n\n        // Non-repeated fields\n        } else {\n            if (!(field.resolvedType instanceof Enum)) gen // no need to test for null/undefined if an enum (uses switch)\n    (\"if(d%s!=null){\", prop); // !== undefined && !== null\n        genValuePartial_fromObject(gen, field, /* not sorted */ i, prop);\n            if (!(field.resolvedType instanceof Enum)) gen\n    (\"}\");\n        }\n    } return gen\n    (\"return m\");\n    /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n};\n\n/**\n * Generates a partial value toObject converter.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} prop Property reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genValuePartial_toObject(gen, field, fieldIndex, prop) {\n    /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n    if (field.resolvedType) {\n        if (field.resolvedType instanceof Enum) gen\n            (\"d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s\", prop, fieldIndex, prop, prop, fieldIndex, prop, prop);\n        else gen\n            (\"d%s=types[%i].toObject(m%s,o)\", prop, fieldIndex, prop);\n    } else {\n        var isUnsigned = false;\n        switch (field.type) {\n            case \"double\":\n            case \"float\": gen\n            (\"d%s=o.json&&!isFinite(m%s)?String(m%s):m%s\", prop, prop, prop, prop);\n                break;\n            case \"uint64\":\n                isUnsigned = true;\n                // eslint-disable-next-line no-fallthrough\n            case \"int64\":\n            case \"sint64\":\n            case \"fixed64\":\n            case \"sfixed64\": gen\n            (\"if(typeof m%s===\\\"number\\\")\", prop)\n                (\"d%s=o.longs===String?String(m%s):m%s\", prop, prop, prop)\n            (\"else\") // Long-like\n                (\"d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s\", prop, prop, prop, prop, isUnsigned ? \"true\": \"\", prop);\n                break;\n            case \"bytes\": gen\n            (\"d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s\", prop, prop, prop, prop, prop);\n                break;\n            default: gen\n            (\"d%s=m%s\", prop, prop);\n                break;\n        }\n    }\n    return gen;\n    /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n\n/**\n * Generates a runtime message to plain object converter specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nconverter.toObject = function toObject(mtype) {\n    /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n    var fields = mtype.fieldsArray.slice().sort(util.compareFieldsById);\n    if (!fields.length)\n        return util.codegen()(\"return {}\");\n    var gen = util.codegen([\"m\", \"o\"], mtype.name + \"$toObject\")\n    (\"if(!o)\")\n        (\"o={}\")\n    (\"var d={}\");\n\n    var repeatedFields = [],\n        mapFields = [],\n        normalFields = [],\n        i = 0;\n    for (; i < fields.length; ++i)\n        if (!fields[i].partOf)\n            ( fields[i].resolve().repeated ? repeatedFields\n            : fields[i].map ? mapFields\n            : normalFields).push(fields[i]);\n\n    if (repeatedFields.length) { gen\n    (\"if(o.arrays||o.defaults){\");\n        for (i = 0; i < repeatedFields.length; ++i) gen\n        (\"d%s=[]\", util.safeProp(repeatedFields[i].name));\n        gen\n    (\"}\");\n    }\n\n    if (mapFields.length) { gen\n    (\"if(o.objects||o.defaults){\");\n        for (i = 0; i < mapFields.length; ++i) gen\n        (\"d%s={}\", util.safeProp(mapFields[i].name));\n        gen\n    (\"}\");\n    }\n\n    if (normalFields.length) { gen\n    (\"if(o.defaults){\");\n        for (i = 0; i < normalFields.length; ++i) {\n            var field = normalFields[i],\n                prop  = util.safeProp(field.name);\n            if (field.resolvedType instanceof Enum) gen\n        (\"d%s=o.enums===String?%j:%j\", prop, field.resolvedType.valuesById[field.typeDefault], field.typeDefault);\n            else if (field.long) gen\n        (\"if(util.Long){\")\n            (\"var n=new util.Long(%i,%i,%j)\", field.typeDefault.low, field.typeDefault.high, field.typeDefault.unsigned)\n            (\"d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n\", prop)\n        (\"}else\")\n            (\"d%s=o.longs===String?%j:%i\", prop, field.typeDefault.toString(), field.typeDefault.toNumber());\n            else if (field.bytes) {\n                var arrayDefault = \"[\" + Array.prototype.slice.call(field.typeDefault).join(\",\") + \"]\";\n                gen\n        (\"if(o.bytes===String)d%s=%j\", prop, String.fromCharCode.apply(String, field.typeDefault))\n        (\"else{\")\n            (\"d%s=%s\", prop, arrayDefault)\n            (\"if(o.bytes!==Array)d%s=util.newBuffer(d%s)\", prop, prop)\n        (\"}\");\n            } else gen\n        (\"d%s=%j\", prop, field.typeDefault); // also messages (=null)\n        } gen\n    (\"}\");\n    }\n    var hasKs2 = false;\n    for (i = 0; i < fields.length; ++i) {\n        var field = fields[i],\n            index = mtype._fieldsArray.indexOf(field),\n            prop  = util.safeProp(field.name);\n        if (field.map) {\n            if (!hasKs2) { hasKs2 = true; gen\n    (\"var ks2\");\n            } gen\n    (\"if(m%s&&(ks2=Object.keys(m%s)).length){\", prop, prop)\n        (\"d%s={}\", prop)\n        (\"for(var j=0;j<ks2.length;++j){\");\n            genValuePartial_toObject(gen, field, /* sorted */ index, prop + \"[ks2[j]]\")\n        (\"}\");\n        } else if (field.repeated) { gen\n    (\"if(m%s&&m%s.length){\", prop, prop)\n        (\"d%s=[]\", prop)\n        (\"for(var j=0;j<m%s.length;++j){\", prop);\n            genValuePartial_toObject(gen, field, /* sorted */ index, prop + \"[j]\")\n        (\"}\");\n        } else { gen\n    (\"if(m%s!=null&&m.hasOwnProperty(%j)){\", prop, field.name); // !== undefined && !== null\n        genValuePartial_toObject(gen, field, /* sorted */ index, prop);\n        if (field.partOf) gen\n        (\"if(o.oneofs)\")\n            (\"d%s=%j\", util.safeProp(field.partOf.name), field.name);\n        }\n        gen\n    (\"}\");\n    }\n    return gen\n    (\"return d\");\n    /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n};\n"
  },
  {
    "path": "src/decoder.js",
    "content": "\"use strict\";\nmodule.exports = decoder;\n\nvar Enum    = require(\"./enum\"),\n    types   = require(\"./types\"),\n    util    = require(\"./util\");\n\nfunction missing(field) {\n    return \"missing required '\" + field.name + \"'\";\n}\n\n/**\n * Generates a decoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction decoder(mtype) {\n    /* eslint-disable no-unexpected-multiline */\n    var gen = util.codegen([\"r\", \"l\", \"e\"], mtype.name + \"$decode\")\n    (\"if(!(r instanceof Reader))\")\n        (\"r=Reader.create(r)\")\n    (\"var c=l===undefined?r.len:r.pos+l,m=new this.ctor\" + (mtype.fieldsArray.filter(function(field) { return field.map; }).length ? \",k,value\" : \"\"))\n    (\"while(r.pos<c){\")\n        (\"var t=r.uint32()\")\n        (\"if(t===e)\")\n            (\"break\")\n        (\"switch(t>>>3){\");\n\n    var i = 0;\n    for (; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n        var field = mtype._fieldsArray[i].resolve(),\n            type  = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n            ref   = \"m\" + util.safeProp(field.name); gen\n            (\"case %i: {\", field.id);\n\n        // Map fields\n        if (field.map) { gen\n                (\"if(%s===util.emptyObject)\", ref)\n                    (\"%s={}\", ref)\n                (\"var c2 = r.uint32()+r.pos\");\n\n            if (types.defaults[field.keyType] !== undefined) gen\n                (\"k=%j\", types.defaults[field.keyType]);\n            else gen\n                (\"k=null\");\n\n            if (types.defaults[type] !== undefined) gen\n                (\"value=%j\", types.defaults[type]);\n            else gen\n                (\"value=null\");\n\n            gen\n                (\"while(r.pos<c2){\")\n                    (\"var tag2=r.uint32()\")\n                    (\"switch(tag2>>>3){\")\n                        (\"case 1: k=r.%s(); break\", field.keyType)\n                        (\"case 2:\");\n\n            if (types.basic[type] === undefined) gen\n                            (\"value=types[%i].decode(r,r.uint32())\", i); // can't be groups\n            else gen\n                            (\"value=r.%s()\", type);\n\n            gen\n                            (\"break\")\n                        (\"default:\")\n                            (\"r.skipType(tag2&7)\")\n                            (\"break\")\n                    (\"}\")\n                (\"}\");\n\n            if (types.long[field.keyType] !== undefined) gen\n                (\"%s[typeof k===\\\"object\\\"?util.longToHash(k):k]=value\", ref);\n            else gen\n                (\"%s[k]=value\", ref);\n\n        // Repeated fields\n        } else if (field.repeated) { gen\n\n                (\"if(!(%s&&%s.length))\", ref, ref)\n                    (\"%s=[]\", ref);\n\n            // Packable (always check for forward and backward compatiblity)\n            if (types.packed[type] !== undefined) gen\n                (\"if((t&7)===2){\")\n                    (\"var c2=r.uint32()+r.pos\")\n                    (\"while(r.pos<c2)\")\n                        (\"%s.push(r.%s())\", ref, type)\n                (\"}else\");\n\n            // Non-packed\n            if (types.basic[type] === undefined) gen(field.delimited\n                    ? \"%s.push(types[%i].decode(r,undefined,((t&~7)|4)))\"\n                    : \"%s.push(types[%i].decode(r,r.uint32()))\", ref, i);\n            else gen\n                    (\"%s.push(r.%s())\", ref, type);\n\n        // Non-repeated\n        } else if (types.basic[type] === undefined) gen(field.delimited\n                ? \"%s=types[%i].decode(r,undefined,((t&~7)|4))\"\n                : \"%s=types[%i].decode(r,r.uint32())\", ref, i);\n        else gen\n                (\"%s=r.%s()\", ref, type);\n        gen\n                (\"break\")\n            (\"}\");\n        // Unknown fields\n    } gen\n            (\"default:\")\n                (\"r.skipType(t&7)\")\n                (\"break\")\n\n        (\"}\")\n    (\"}\");\n\n    // Field presence\n    for (i = 0; i < mtype._fieldsArray.length; ++i) {\n        var rfield = mtype._fieldsArray[i];\n        if (rfield.required) gen\n    (\"if(!m.hasOwnProperty(%j))\", rfield.name)\n        (\"throw util.ProtocolError(%j,{instance:m})\", missing(rfield));\n    }\n\n    return gen\n    (\"return m\");\n    /* eslint-enable no-unexpected-multiline */\n}\n"
  },
  {
    "path": "src/encoder.js",
    "content": "\"use strict\";\nmodule.exports = encoder;\n\nvar Enum     = require(\"./enum\"),\n    types    = require(\"./types\"),\n    util     = require(\"./util\");\n\n/**\n * Generates a partial message type encoder.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genTypePartial(gen, field, fieldIndex, ref) {\n    return field.delimited\n        ? gen(\"types[%i].encode(%s,w.uint32(%i)).uint32(%i)\", fieldIndex, ref, (field.id << 3 | 3) >>> 0, (field.id << 3 | 4) >>> 0)\n        : gen(\"types[%i].encode(%s,w.uint32(%i).fork()).ldelim()\", fieldIndex, ref, (field.id << 3 | 2) >>> 0);\n}\n\n/**\n * Generates an encoder specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction encoder(mtype) {\n    /* eslint-disable no-unexpected-multiline, block-scoped-var, no-redeclare */\n    var gen = util.codegen([\"m\", \"w\"], mtype.name + \"$encode\")\n    (\"if(!w)\")\n        (\"w=Writer.create()\");\n\n    var i, ref;\n\n    // \"when a message is serialized its known fields should be written sequentially by field number\"\n    var fields = /* initializes */ mtype.fieldsArray.slice().sort(util.compareFieldsById);\n\n    for (var i = 0; i < fields.length; ++i) {\n        var field    = fields[i].resolve(),\n            index    = mtype._fieldsArray.indexOf(field),\n            type     = field.resolvedType instanceof Enum ? \"int32\" : field.type,\n            wireType = types.basic[type];\n            ref      = \"m\" + util.safeProp(field.name);\n\n        // Map fields\n        if (field.map) {\n            gen\n    (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j)){\", ref, field.name) // !== undefined && !== null\n        (\"for(var ks=Object.keys(%s),i=0;i<ks.length;++i){\", ref)\n            (\"w.uint32(%i).fork().uint32(%i).%s(ks[i])\", (field.id << 3 | 2) >>> 0, 8 | types.mapKey[field.keyType], field.keyType);\n            if (wireType === undefined) gen\n            (\"types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()\", index, ref); // can't be groups\n            else gen\n            (\".uint32(%i).%s(%s[ks[i]]).ldelim()\", 16 | wireType, type, ref);\n            gen\n        (\"}\")\n    (\"}\");\n\n            // Repeated fields\n        } else if (field.repeated) { gen\n    (\"if(%s!=null&&%s.length){\", ref, ref); // !== undefined && !== null\n\n            // Packed repeated\n            if (field.packed && types.packed[type] !== undefined) { gen\n\n        (\"w.uint32(%i).fork()\", (field.id << 3 | 2) >>> 0)\n        (\"for(var i=0;i<%s.length;++i)\", ref)\n            (\"w.%s(%s[i])\", type, ref)\n        (\"w.ldelim()\");\n\n            // Non-packed\n            } else { gen\n\n        (\"for(var i=0;i<%s.length;++i)\", ref);\n                if (wireType === undefined)\n            genTypePartial(gen, field, index, ref + \"[i]\");\n                else gen\n            (\"w.uint32(%i).%s(%s[i])\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n            } gen\n    (\"}\");\n\n        // Non-repeated\n        } else {\n            if (field.optional) gen\n    (\"if(%s!=null&&Object.hasOwnProperty.call(m,%j))\", ref, field.name); // !== undefined && !== null\n\n            if (wireType === undefined)\n        genTypePartial(gen, field, index, ref);\n            else gen\n        (\"w.uint32(%i).%s(%s)\", (field.id << 3 | wireType) >>> 0, type, ref);\n\n        }\n    }\n\n    return gen\n    (\"return w\");\n    /* eslint-enable no-unexpected-multiline, block-scoped-var, no-redeclare */\n}\n"
  },
  {
    "path": "src/enum.js",
    "content": "\"use strict\";\nmodule.exports = Enum;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Enum.prototype = Object.create(ReflectionObject.prototype)).constructor = Enum).className = \"Enum\";\n\nvar Namespace = require(\"./namespace\"),\n    util = require(\"./util\");\n\n/**\n * Constructs a new enum instance.\n * @classdesc Reflected enum.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {Object.<string,number>} [values] Enum values as an object, by name\n * @param {Object.<string,*>} [options] Declared options\n * @param {string} [comment] The comment for this enum\n * @param {Object.<string,string>} [comments] The value comments for this enum\n * @param {Object.<string,Object<string,*>>|undefined} [valuesOptions] The value options for this enum\n */\nfunction Enum(name, values, options, comment, comments, valuesOptions) {\n    ReflectionObject.call(this, name, options);\n\n    if (values && typeof values !== \"object\")\n        throw TypeError(\"values must be an object\");\n\n    /**\n     * Enum values by id.\n     * @type {Object.<number,string>}\n     */\n    this.valuesById = {};\n\n    /**\n     * Enum values by name.\n     * @type {Object.<string,number>}\n     */\n    this.values = Object.create(this.valuesById); // toJSON, marker\n\n    /**\n     * Enum comment text.\n     * @type {string|null}\n     */\n    this.comment = comment;\n\n    /**\n     * Value comment texts, if any.\n     * @type {Object.<string,string>}\n     */\n    this.comments = comments || {};\n\n    /**\n     * Values options, if any\n     * @type {Object<string, Object<string, *>>|undefined}\n     */\n    this.valuesOptions = valuesOptions;\n\n    /**\n     * Resolved values features, if any\n     * @type {Object<string, Object<string, *>>|undefined}\n     */\n    this._valuesFeatures = {};\n\n    /**\n     * Reserved ranges, if any.\n     * @type {Array.<number[]|string>}\n     */\n    this.reserved = undefined; // toJSON\n\n    // Note that values inherit valuesById on their prototype which makes them a TypeScript-\n    // compatible enum. This is used by pbts to write actual enum definitions that work for\n    // static and reflection code alike instead of emitting generic object definitions.\n\n    if (values)\n        for (var keys = Object.keys(values), i = 0; i < keys.length; ++i)\n            if (typeof values[keys[i]] === \"number\") // use forward entries only\n                this.valuesById[ this.values[keys[i]] = values[keys[i]] ] = keys[i];\n}\n\n/**\n * @override\n */\nEnum.prototype._resolveFeatures = function _resolveFeatures(edition) {\n    edition = this._edition || edition;\n    ReflectionObject.prototype._resolveFeatures.call(this, edition);\n\n    Object.keys(this.values).forEach(key => {\n        var parentFeaturesCopy = Object.assign({}, this._features);\n        this._valuesFeatures[key] = Object.assign(parentFeaturesCopy, this.valuesOptions && this.valuesOptions[key] && this.valuesOptions[key].features);\n    });\n\n    return this;\n};\n\n/**\n * Enum descriptor.\n * @interface IEnum\n * @property {Object.<string,number>} values Enum values\n * @property {Object.<string,*>} [options] Enum options\n */\n\n/**\n * Constructs an enum from an enum descriptor.\n * @param {string} name Enum name\n * @param {IEnum} json Enum descriptor\n * @returns {Enum} Created enum\n * @throws {TypeError} If arguments are invalid\n */\nEnum.fromJSON = function fromJSON(name, json) {\n    var enm = new Enum(name, json.values, json.options, json.comment, json.comments);\n    enm.reserved = json.reserved;\n    if (json.edition)\n        enm._edition = json.edition;\n    enm._defaultEdition = \"proto3\";  // For backwards-compatibility.\n    return enm;\n};\n\n/**\n * Converts this enum to an enum descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IEnum} Enum descriptor\n */\nEnum.prototype.toJSON = function toJSON(toJSONOptions) {\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"edition\"       , this._editionToJSON(),\n        \"options\"       , this.options,\n        \"valuesOptions\" , this.valuesOptions,\n        \"values\"        , this.values,\n        \"reserved\"      , this.reserved && this.reserved.length ? this.reserved : undefined,\n        \"comment\"       , keepComments ? this.comment : undefined,\n        \"comments\"      , keepComments ? this.comments : undefined\n    ]);\n};\n\n/**\n * Adds a value to this enum.\n * @param {string} name Value name\n * @param {number} id Value id\n * @param {string} [comment] Comment, if any\n * @param {Object.<string, *>|undefined} [options] Options, if any\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a value with this name or id\n */\nEnum.prototype.add = function add(name, id, comment, options) {\n    // utilized by the parser but not by .fromJSON\n\n    if (!util.isString(name))\n        throw TypeError(\"name must be a string\");\n\n    if (!util.isInteger(id))\n        throw TypeError(\"id must be an integer\");\n\n    if (this.values[name] !== undefined)\n        throw Error(\"duplicate name '\" + name + \"' in \" + this);\n\n    if (this.isReservedId(id))\n        throw Error(\"id \" + id + \" is reserved in \" + this);\n\n    if (this.isReservedName(name))\n        throw Error(\"name '\" + name + \"' is reserved in \" + this);\n\n    if (this.valuesById[id] !== undefined) {\n        if (!(this.options && this.options.allow_alias))\n            throw Error(\"duplicate id \" + id + \" in \" + this);\n        this.values[name] = id;\n    } else\n        this.valuesById[this.values[name] = id] = name;\n\n    if (options) {\n        if (this.valuesOptions === undefined)\n            this.valuesOptions = {};\n        this.valuesOptions[name] = options || null;\n    }\n\n    this.comments[name] = comment || null;\n    return this;\n};\n\n/**\n * Removes a value from this enum\n * @param {string} name Value name\n * @returns {Enum} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `name` is not a name of this enum\n */\nEnum.prototype.remove = function remove(name) {\n\n    if (!util.isString(name))\n        throw TypeError(\"name must be a string\");\n\n    var val = this.values[name];\n    if (val == null)\n        throw Error(\"name '\" + name + \"' does not exist in \" + this);\n\n    delete this.valuesById[val];\n    delete this.values[name];\n    delete this.comments[name];\n    if (this.valuesOptions)\n        delete this.valuesOptions[name];\n\n    return this;\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedId = function isReservedId(id) {\n    return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nEnum.prototype.isReservedName = function isReservedName(name) {\n    return Namespace.isReservedName(this.reserved, name);\n};\n"
  },
  {
    "path": "src/field.js",
    "content": "\"use strict\";\nmodule.exports = Field;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Field.prototype = Object.create(ReflectionObject.prototype)).constructor = Field).className = \"Field\";\n\nvar Enum  = require(\"./enum\"),\n    types = require(\"./types\"),\n    util  = require(\"./util\");\n\nvar Type; // cyclic\n\nvar ruleRe = /^required|optional|repeated$/;\n\n/**\n * Constructs a new message field instance. Note that {@link MapField|map fields} have their own class.\n * @name Field\n * @classdesc Reflected message field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.<string,*>} [rule=\"optional\"] Field rule\n * @param {string|Object.<string,*>} [extend] Extended type if different from parent\n * @param {Object.<string,*>} [options] Declared options\n */\n\n/**\n * Constructs a field from a field descriptor.\n * @param {string} name Field name\n * @param {IField} json Field descriptor\n * @returns {Field} Created field\n * @throws {TypeError} If arguments are invalid\n */\nField.fromJSON = function fromJSON(name, json) {\n    var field = new Field(name, json.id, json.type, json.rule, json.extend, json.options, json.comment);\n    if (json.edition)\n        field._edition = json.edition;\n    field._defaultEdition = \"proto3\";  // For backwards-compatibility.\n    return field;\n};\n\n/**\n * Not an actual constructor. Use {@link Field} instead.\n * @classdesc Base class of all reflected message fields. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports FieldBase\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} type Value type\n * @param {string|Object.<string,*>} [rule=\"optional\"] Field rule\n * @param {string|Object.<string,*>} [extend] Extended type if different from parent\n * @param {Object.<string,*>} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction Field(name, id, type, rule, extend, options, comment) {\n\n    if (util.isObject(rule)) {\n        comment = extend;\n        options = rule;\n        rule = extend = undefined;\n    } else if (util.isObject(extend)) {\n        comment = options;\n        options = extend;\n        extend = undefined;\n    }\n\n    ReflectionObject.call(this, name, options);\n\n    if (!util.isInteger(id) || id < 0)\n        throw TypeError(\"id must be a non-negative integer\");\n\n    if (!util.isString(type))\n        throw TypeError(\"type must be a string\");\n\n    if (rule !== undefined && !ruleRe.test(rule = rule.toString().toLowerCase()))\n        throw TypeError(\"rule must be a string rule\");\n\n    if (extend !== undefined && !util.isString(extend))\n        throw TypeError(\"extend must be a string\");\n\n    /**\n     * Field rule, if any.\n     * @type {string|undefined}\n     */\n    if (rule === \"proto3_optional\") {\n        rule = \"optional\";\n    }\n    this.rule = rule && rule !== \"optional\" ? rule : undefined; // toJSON\n\n    /**\n     * Field type.\n     * @type {string}\n     */\n    this.type = type; // toJSON\n\n    /**\n     * Unique field id.\n     * @type {number}\n     */\n    this.id = id; // toJSON, marker\n\n    /**\n     * Extended type if different from parent.\n     * @type {string|undefined}\n     */\n    this.extend = extend || undefined; // toJSON\n\n    /**\n     * Whether this field is repeated.\n     * @type {boolean}\n     */\n    this.repeated = rule === \"repeated\";\n\n    /**\n     * Whether this field is a map or not.\n     * @type {boolean}\n     */\n    this.map = false;\n\n    /**\n     * Message this field belongs to.\n     * @type {Type|null}\n     */\n    this.message = null;\n\n    /**\n     * OneOf this field belongs to, if any,\n     * @type {OneOf|null}\n     */\n    this.partOf = null;\n\n    /**\n     * The field type's default value.\n     * @type {*}\n     */\n    this.typeDefault = null;\n\n    /**\n     * The field's default value on prototypes.\n     * @type {*}\n     */\n    this.defaultValue = null;\n\n    /**\n     * Whether this field's value should be treated as a long.\n     * @type {boolean}\n     */\n    this.long = util.Long ? types.long[type] !== undefined : /* istanbul ignore next */ false;\n\n    /**\n     * Whether this field's value is a buffer.\n     * @type {boolean}\n     */\n    this.bytes = type === \"bytes\";\n\n    /**\n     * Resolved type if not a basic type.\n     * @type {Type|Enum|null}\n     */\n    this.resolvedType = null;\n\n    /**\n     * Sister-field within the extended type if a declaring extension field.\n     * @type {Field|null}\n     */\n    this.extensionField = null;\n\n    /**\n     * Sister-field within the declaring namespace if an extended field.\n     * @type {Field|null}\n     */\n    this.declaringField = null;\n\n    /**\n     * Comment for this field.\n     * @type {string|null}\n     */\n    this.comment = comment;\n}\n\n/**\n * Determines whether this field is required.\n * @name Field#required\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"required\", {\n    get: function() {\n        return this._features.field_presence === \"LEGACY_REQUIRED\";\n    }\n});\n\n/**\n * Determines whether this field is not required.\n * @name Field#optional\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"optional\", {\n    get: function() {\n        return !this.required;\n    }\n});\n\n/**\n * Determines whether this field uses tag-delimited encoding.  In proto2 this\n * corresponded to group syntax.\n * @name Field#delimited\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"delimited\", {\n    get: function() {\n        return this.resolvedType instanceof Type &&\n            this._features.message_encoding === \"DELIMITED\";\n    }\n});\n\n/**\n * Determines whether this field is packed. Only relevant when repeated.\n * @name Field#packed\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"packed\", {\n    get: function() {\n        return this._features.repeated_field_encoding === \"PACKED\";\n    }\n});\n\n/**\n * Determines whether this field tracks presence.\n * @name Field#hasPresence\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(Field.prototype, \"hasPresence\", {\n    get: function() {\n        if (this.repeated || this.map) {\n            return false;\n        }\n        return this.partOf || // oneofs\n            this.declaringField || this.extensionField || // extensions\n            this._features.field_presence !== \"IMPLICIT\";\n    }\n});\n\n/**\n * @override\n */\nField.prototype.setOption = function setOption(name, value, ifNotSet) {\n    return ReflectionObject.prototype.setOption.call(this, name, value, ifNotSet);\n};\n\n/**\n * Field descriptor.\n * @interface IField\n * @property {string} [rule=\"optional\"] Field rule\n * @property {string} type Field type\n * @property {number} id Field id\n * @property {Object.<string,*>} [options] Field options\n */\n\n/**\n * Extension field descriptor.\n * @interface IExtensionField\n * @extends IField\n * @property {string} extend Extended type\n */\n\n/**\n * Converts this field to a field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IField} Field descriptor\n */\nField.prototype.toJSON = function toJSON(toJSONOptions) {\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"edition\" , this._editionToJSON(),\n        \"rule\"    , this.rule !== \"optional\" && this.rule || undefined,\n        \"type\"    , this.type,\n        \"id\"      , this.id,\n        \"extend\"  , this.extend,\n        \"options\" , this.options,\n        \"comment\" , keepComments ? this.comment : undefined\n    ]);\n};\n\n/**\n * Resolves this field's type references.\n * @returns {Field} `this`\n * @throws {Error} If any reference cannot be resolved\n */\nField.prototype.resolve = function resolve() {\n\n    if (this.resolved)\n        return this;\n\n    if ((this.typeDefault = types.defaults[this.type]) === undefined) { // if not a basic type, resolve it\n        this.resolvedType = (this.declaringField ? this.declaringField.parent : this.parent).lookupTypeOrEnum(this.type);\n        if (this.resolvedType instanceof Type)\n            this.typeDefault = null;\n        else // instanceof Enum\n            this.typeDefault = this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]; // first defined\n    } else if (this.options && this.options.proto3_optional) {\n        // proto3 scalar value marked optional; should default to null\n        this.typeDefault = null;\n    }\n\n    // use explicitly set default value if present\n    if (this.options && this.options[\"default\"] != null) {\n        this.typeDefault = this.options[\"default\"];\n        if (this.resolvedType instanceof Enum && typeof this.typeDefault === \"string\")\n            this.typeDefault = this.resolvedType.values[this.typeDefault];\n    }\n\n    // remove unnecessary options\n    if (this.options) {\n        if (this.options.packed !== undefined && this.resolvedType && !(this.resolvedType instanceof Enum))\n            delete this.options.packed;\n        if (!Object.keys(this.options).length)\n            this.options = undefined;\n    }\n\n    // convert to internal data type if necesssary\n    if (this.long) {\n        this.typeDefault = util.Long.fromNumber(this.typeDefault, this.type.charAt(0) === \"u\");\n\n        /* istanbul ignore else */\n        if (Object.freeze)\n            Object.freeze(this.typeDefault); // long instances are meant to be immutable anyway (i.e. use small int cache that even requires it)\n\n    } else if (this.bytes && typeof this.typeDefault === \"string\") {\n        var buf;\n        if (util.base64.test(this.typeDefault))\n            util.base64.decode(this.typeDefault, buf = util.newBuffer(util.base64.length(this.typeDefault)), 0);\n        else\n            util.utf8.write(this.typeDefault, buf = util.newBuffer(util.utf8.length(this.typeDefault)), 0);\n        this.typeDefault = buf;\n    }\n\n    // take special care of maps and repeated fields\n    if (this.map)\n        this.defaultValue = util.emptyObject;\n    else if (this.repeated)\n        this.defaultValue = util.emptyArray;\n    else\n        this.defaultValue = this.typeDefault;\n\n    // ensure proper value on prototype\n    if (this.parent instanceof Type)\n        this.parent.ctor.prototype[this.name] = this.defaultValue;\n\n    return ReflectionObject.prototype.resolve.call(this);\n};\n\n/**\n * Infers field features from legacy syntax that may have been specified differently.\n * in older editions.\n * @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions\n * @returns {object} The feature values to override\n */\nField.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(edition) {\n    if (edition !== \"proto2\" && edition !== \"proto3\") {\n        return {};\n    }\n\n    var features = {};\n\n    if (this.rule === \"required\") {\n        features.field_presence = \"LEGACY_REQUIRED\";\n    }\n    if (this.parent && types.defaults[this.type] === undefined) {\n        // We can't use resolvedType because types may not have been resolved yet.  However,\n        // legacy groups are always in the same scope as the field so we don't have to do a\n        // full scan of the tree.\n        var type = this.parent.get(this.type.split(\".\").pop());\n        if (type && type instanceof Type && type.group) {\n            features.message_encoding = \"DELIMITED\";\n        }\n    }\n    if (this.getOption(\"packed\") === true) {\n        features.repeated_field_encoding = \"PACKED\";\n    } else if (this.getOption(\"packed\") === false) {\n        features.repeated_field_encoding = \"EXPANDED\";\n    }\n    return features;\n};\n\n/**\n * @override\n */\nField.prototype._resolveFeatures = function _resolveFeatures(edition) {\n    return ReflectionObject.prototype._resolveFeatures.call(this, this._edition || edition);\n};\n\n/**\n * Decorator function as returned by {@link Field.d} and {@link MapField.d} (TypeScript).\n * @typedef FieldDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} fieldName Field name\n * @returns {undefined}\n */\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"string\"|\"bool\"|\"bytes\"|Object} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @param {T} [defaultValue] Default value\n * @returns {FieldDecorator} Decorator function\n * @template T extends number | number[] | Long | Long[] | string | string[] | boolean | boolean[] | Uint8Array | Uint8Array[] | Buffer | Buffer[]\n */\nField.d = function decorateField(fieldId, fieldType, fieldRule, defaultValue) {\n\n    // submessage: decorate the submessage and use its name as the type\n    if (typeof fieldType === \"function\")\n        fieldType = util.decorateType(fieldType).name;\n\n    // enum reference: create a reflected copy of the enum and keep reuseing it\n    else if (fieldType && typeof fieldType === \"object\")\n        fieldType = util.decorateEnum(fieldType).name;\n\n    return function fieldDecorator(prototype, fieldName) {\n        util.decorateType(prototype.constructor)\n            .add(new Field(fieldName, fieldId, fieldType, fieldRule, { \"default\": defaultValue }));\n    };\n};\n\n/**\n * Field decorator (TypeScript).\n * @name Field.d\n * @function\n * @param {number} fieldId Field id\n * @param {Constructor<T>|string} fieldType Field type\n * @param {\"optional\"|\"required\"|\"repeated\"} [fieldRule=\"optional\"] Field rule\n * @returns {FieldDecorator} Decorator function\n * @template T extends Message<T>\n * @variation 2\n */\n// like Field.d but without a default value\n\n// Sets up cyclic dependencies (called in index-light)\nField._configure = function configure(Type_) {\n    Type = Type_;\n};\n"
  },
  {
    "path": "src/index-light.js",
    "content": "\"use strict\";\nvar protobuf = module.exports = require(\"./index-minimal\");\n\nprotobuf.build = \"light\";\n\n/**\n * A node-style callback as used by {@link load} and {@link Root#load}.\n * @typedef LoadCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Root} [root] Root, if there hasn't been an error\n * @returns {undefined}\n */\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} root Root namespace, defaults to create a new one if omitted.\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n */\nfunction load(filename, root, callback) {\n    if (typeof root === \"function\") {\n        callback = root;\n        root = new protobuf.Root();\n    } else if (!root)\n        root = new protobuf.Root();\n    return root.load(filename, callback);\n}\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and calls the callback.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @see {@link Root#load}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into a common root namespace and returns a promise.\n * @name load\n * @function\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Promise<Root>} Promise\n * @see {@link Root#load}\n * @variation 3\n */\n// function load(filename:string, [root:Root]):Promise<Root>\n\nprotobuf.load = load;\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into a common root namespace (node only).\n * @param {string|string[]} filename One or multiple files to load\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n * @see {@link Root#loadSync}\n */\nfunction loadSync(filename, root) {\n    if (!root)\n        root = new protobuf.Root();\n    return root.loadSync(filename);\n}\n\nprotobuf.loadSync = loadSync;\n\n// Serialization\nprotobuf.encoder          = require(\"./encoder\");\nprotobuf.decoder          = require(\"./decoder\");\nprotobuf.verifier         = require(\"./verifier\");\nprotobuf.converter        = require(\"./converter\");\n\n// Reflection\nprotobuf.ReflectionObject = require(\"./object\");\nprotobuf.Namespace        = require(\"./namespace\");\nprotobuf.Root             = require(\"./root\");\nprotobuf.Enum             = require(\"./enum\");\nprotobuf.Type             = require(\"./type\");\nprotobuf.Field            = require(\"./field\");\nprotobuf.OneOf            = require(\"./oneof\");\nprotobuf.MapField         = require(\"./mapfield\");\nprotobuf.Service          = require(\"./service\");\nprotobuf.Method           = require(\"./method\");\n\n// Runtime\nprotobuf.Message          = require(\"./message\");\nprotobuf.wrappers         = require(\"./wrappers\");\n\n// Utility\nprotobuf.types            = require(\"./types\");\nprotobuf.util             = require(\"./util\");\n\n// Set up possibly cyclic reflection dependencies\nprotobuf.ReflectionObject._configure(protobuf.Root);\nprotobuf.Namespace._configure(protobuf.Type, protobuf.Service, protobuf.Enum);\nprotobuf.Root._configure(protobuf.Type);\nprotobuf.Field._configure(protobuf.Type);\n"
  },
  {
    "path": "src/index-minimal.js",
    "content": "\"use strict\";\nvar protobuf = exports;\n\n/**\n * Build type, one of `\"full\"`, `\"light\"` or `\"minimal\"`.\n * @name build\n * @type {string}\n * @const\n */\nprotobuf.build = \"minimal\";\n\n// Serialization\nprotobuf.Writer       = require(\"./writer\");\nprotobuf.BufferWriter = require(\"./writer_buffer\");\nprotobuf.Reader       = require(\"./reader\");\nprotobuf.BufferReader = require(\"./reader_buffer\");\n\n// Utility\nprotobuf.util         = require(\"./util/minimal\");\nprotobuf.rpc          = require(\"./rpc\");\nprotobuf.roots        = require(\"./roots\");\nprotobuf.configure    = configure;\n\n/* istanbul ignore next */\n/**\n * Reconfigures the library according to the environment.\n * @returns {undefined}\n */\nfunction configure() {\n    protobuf.util._configure();\n    protobuf.Writer._configure(protobuf.BufferWriter);\n    protobuf.Reader._configure(protobuf.BufferReader);\n}\n\n// Set up buffer utility according to the environment\nconfigure();\n"
  },
  {
    "path": "src/index.js",
    "content": "\"use strict\";\nvar protobuf = module.exports = require(\"./index-light\");\n\nprotobuf.build = \"full\";\n\n// Parser\nprotobuf.tokenize         = require(\"./tokenize\");\nprotobuf.parse            = require(\"./parse\");\nprotobuf.common           = require(\"./common\");\n\n// Configure parser\nprotobuf.Root._configure(protobuf.Type, protobuf.parse, protobuf.common);\n"
  },
  {
    "path": "src/mapfield.js",
    "content": "\"use strict\";\nmodule.exports = MapField;\n\n// extends Field\nvar Field = require(\"./field\");\n((MapField.prototype = Object.create(Field.prototype)).constructor = MapField).className = \"MapField\";\n\nvar types   = require(\"./types\"),\n    util    = require(\"./util\");\n\n/**\n * Constructs a new map field instance.\n * @classdesc Reflected map field.\n * @extends FieldBase\n * @constructor\n * @param {string} name Unique name within its namespace\n * @param {number} id Unique id within its namespace\n * @param {string} keyType Key type\n * @param {string} type Value type\n * @param {Object.<string,*>} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction MapField(name, id, keyType, type, options, comment) {\n    Field.call(this, name, id, type, undefined, undefined, options, comment);\n\n    /* istanbul ignore if */\n    if (!util.isString(keyType))\n        throw TypeError(\"keyType must be a string\");\n\n    /**\n     * Key type.\n     * @type {string}\n     */\n    this.keyType = keyType; // toJSON, marker\n\n    /**\n     * Resolved key type if not a basic type.\n     * @type {ReflectionObject|null}\n     */\n    this.resolvedKeyType = null;\n\n    // Overrides Field#map\n    this.map = true;\n}\n\n/**\n * Map field descriptor.\n * @interface IMapField\n * @extends {IField}\n * @property {string} keyType Key type\n */\n\n/**\n * Extension map field descriptor.\n * @interface IExtensionMapField\n * @extends IMapField\n * @property {string} extend Extended type\n */\n\n/**\n * Constructs a map field from a map field descriptor.\n * @param {string} name Field name\n * @param {IMapField} json Map field descriptor\n * @returns {MapField} Created map field\n * @throws {TypeError} If arguments are invalid\n */\nMapField.fromJSON = function fromJSON(name, json) {\n    return new MapField(name, json.id, json.keyType, json.type, json.options, json.comment);\n};\n\n/**\n * Converts this map field to a map field descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMapField} Map field descriptor\n */\nMapField.prototype.toJSON = function toJSON(toJSONOptions) {\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"keyType\" , this.keyType,\n        \"type\"    , this.type,\n        \"id\"      , this.id,\n        \"extend\"  , this.extend,\n        \"options\" , this.options,\n        \"comment\" , keepComments ? this.comment : undefined\n    ]);\n};\n\n/**\n * @override\n */\nMapField.prototype.resolve = function resolve() {\n    if (this.resolved)\n        return this;\n\n    // Besides a value type, map fields have a key type that may be \"any scalar type except for floating point types and bytes\"\n    if (types.mapKey[this.keyType] === undefined)\n        throw Error(\"invalid key type: \" + this.keyType);\n\n    return Field.prototype.resolve.call(this);\n};\n\n/**\n * Map field decorator (TypeScript).\n * @name MapField.d\n * @function\n * @param {number} fieldId Field id\n * @param {\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"} fieldKeyType Field key type\n * @param {\"double\"|\"float\"|\"int32\"|\"uint32\"|\"sint32\"|\"fixed32\"|\"sfixed32\"|\"int64\"|\"uint64\"|\"sint64\"|\"fixed64\"|\"sfixed64\"|\"bool\"|\"string\"|\"bytes\"|Object|Constructor<{}>} fieldValueType Field value type\n * @returns {FieldDecorator} Decorator function\n * @template T extends { [key: string]: number | Long | string | boolean | Uint8Array | Buffer | number[] | Message<{}> }\n */\nMapField.d = function decorateMapField(fieldId, fieldKeyType, fieldValueType) {\n\n    // submessage value: decorate the submessage and use its name as the type\n    if (typeof fieldValueType === \"function\")\n        fieldValueType = util.decorateType(fieldValueType).name;\n\n    // enum reference value: create a reflected copy of the enum and keep reuseing it\n    else if (fieldValueType && typeof fieldValueType === \"object\")\n        fieldValueType = util.decorateEnum(fieldValueType).name;\n\n    return function mapFieldDecorator(prototype, fieldName) {\n        util.decorateType(prototype.constructor)\n            .add(new MapField(fieldName, fieldId, fieldKeyType, fieldValueType));\n    };\n};\n"
  },
  {
    "path": "src/message.js",
    "content": "\"use strict\";\nmodule.exports = Message;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new message instance.\n * @classdesc Abstract runtime message.\n * @constructor\n * @param {Properties<T>} [properties] Properties to set\n * @template T extends object = object\n */\nfunction Message(properties) {\n    // not used internally\n    if (properties)\n        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) {\n            var key = keys[i];\n            if (key === \"__proto__\")\n                continue;\n            this[key] = properties[key];\n        }\n}\n\n/**\n * Reference to the reflected type.\n * @name Message.$type\n * @type {Type}\n * @readonly\n */\n\n/**\n * Reference to the reflected type.\n * @name Message#$type\n * @type {Type}\n * @readonly\n */\n\n/*eslint-disable valid-jsdoc*/\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.<string,*>} [properties] Properties to set\n * @returns {Message<T>} Message instance\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.create = function create(properties) {\n    return this.$type.create(properties);\n};\n\n/**\n * Encodes a message of this type.\n * @param {T|Object.<string,*>} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.encode = function encode(message, writer) {\n    return this.$type.encode(message, writer);\n};\n\n/**\n * Encodes a message of this type preceeded by its length as a varint.\n * @param {T|Object.<string,*>} message Message to encode\n * @param {Writer} [writer] Writer to use\n * @returns {Writer} Writer\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.encodeDelimited = function encodeDelimited(message, writer) {\n    return this.$type.encodeDelimited(message, writer);\n};\n\n/**\n * Decodes a message of this type.\n * @name Message.decode\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.decode = function decode(reader) {\n    return this.$type.decode(reader);\n};\n\n/**\n * Decodes a message of this type preceeded by its length as a varint.\n * @name Message.decodeDelimited\n * @function\n * @param {Reader|Uint8Array} reader Reader or buffer to decode\n * @returns {T} Decoded message\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.decodeDelimited = function decodeDelimited(reader) {\n    return this.$type.decodeDelimited(reader);\n};\n\n/**\n * Verifies a message of this type.\n * @name Message.verify\n * @function\n * @param {Object.<string,*>} message Plain object to verify\n * @returns {string|null} `null` if valid, otherwise the reason why it is not\n */\nMessage.verify = function verify(message) {\n    return this.$type.verify(message);\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.<string,*>} object Plain object\n * @returns {T} Message instance\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.fromObject = function fromObject(object) {\n    return this.$type.fromObject(object);\n};\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {T} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.<string,*>} Plain object\n * @template T extends Message<T>\n * @this Constructor<T>\n */\nMessage.toObject = function toObject(message, options) {\n    return this.$type.toObject(message, options);\n};\n\n/**\n * Converts this message to JSON.\n * @returns {Object.<string,*>} JSON object\n */\nMessage.prototype.toJSON = function toJSON() {\n    return this.$type.toObject(this, util.toJSONOptions);\n};\n\n/*eslint-enable valid-jsdoc*/\n"
  },
  {
    "path": "src/method.js",
    "content": "\"use strict\";\nmodule.exports = Method;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Method.prototype = Object.create(ReflectionObject.prototype)).constructor = Method).className = \"Method\";\n\nvar util = require(\"./util\");\n\n/**\n * Constructs a new service method instance.\n * @classdesc Reflected service method.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Method name\n * @param {string|undefined} type Method type, usually `\"rpc\"`\n * @param {string} requestType Request message type\n * @param {string} responseType Response message type\n * @param {boolean|Object.<string,*>} [requestStream] Whether the request is streamed\n * @param {boolean|Object.<string,*>} [responseStream] Whether the response is streamed\n * @param {Object.<string,*>} [options] Declared options\n * @param {string} [comment] The comment for this method\n * @param {Object.<string,*>} [parsedOptions] Declared options, properly parsed into an object\n */\nfunction Method(name, type, requestType, responseType, requestStream, responseStream, options, comment, parsedOptions) {\n\n    /* istanbul ignore next */\n    if (util.isObject(requestStream)) {\n        options = requestStream;\n        requestStream = responseStream = undefined;\n    } else if (util.isObject(responseStream)) {\n        options = responseStream;\n        responseStream = undefined;\n    }\n\n    /* istanbul ignore if */\n    if (!(type === undefined || util.isString(type)))\n        throw TypeError(\"type must be a string\");\n\n    /* istanbul ignore if */\n    if (!util.isString(requestType))\n        throw TypeError(\"requestType must be a string\");\n\n    /* istanbul ignore if */\n    if (!util.isString(responseType))\n        throw TypeError(\"responseType must be a string\");\n\n    ReflectionObject.call(this, name, options);\n\n    /**\n     * Method type.\n     * @type {string}\n     */\n    this.type = type || \"rpc\"; // toJSON\n\n    /**\n     * Request type.\n     * @type {string}\n     */\n    this.requestType = requestType; // toJSON, marker\n\n    /**\n     * Whether requests are streamed or not.\n     * @type {boolean|undefined}\n     */\n    this.requestStream = requestStream ? true : undefined; // toJSON\n\n    /**\n     * Response type.\n     * @type {string}\n     */\n    this.responseType = responseType; // toJSON\n\n    /**\n     * Whether responses are streamed or not.\n     * @type {boolean|undefined}\n     */\n    this.responseStream = responseStream ? true : undefined; // toJSON\n\n    /**\n     * Resolved request type.\n     * @type {Type|null}\n     */\n    this.resolvedRequestType = null;\n\n    /**\n     * Resolved response type.\n     * @type {Type|null}\n     */\n    this.resolvedResponseType = null;\n\n    /**\n     * Comment for this method\n     * @type {string|null}\n     */\n    this.comment = comment;\n\n    /**\n     * Options properly parsed into an object\n     */\n    this.parsedOptions = parsedOptions;\n}\n\n/**\n * Method descriptor.\n * @interface IMethod\n * @property {string} [type=\"rpc\"] Method type\n * @property {string} requestType Request type\n * @property {string} responseType Response type\n * @property {boolean} [requestStream=false] Whether requests are streamed\n * @property {boolean} [responseStream=false] Whether responses are streamed\n * @property {Object.<string,*>} [options] Method options\n * @property {string} comment Method comments\n * @property {Object.<string,*>} [parsedOptions] Method options properly parsed into an object\n */\n\n/**\n * Constructs a method from a method descriptor.\n * @param {string} name Method name\n * @param {IMethod} json Method descriptor\n * @returns {Method} Created method\n * @throws {TypeError} If arguments are invalid\n */\nMethod.fromJSON = function fromJSON(name, json) {\n    return new Method(name, json.type, json.requestType, json.responseType, json.requestStream, json.responseStream, json.options, json.comment, json.parsedOptions);\n};\n\n/**\n * Converts this method to a method descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IMethod} Method descriptor\n */\nMethod.prototype.toJSON = function toJSON(toJSONOptions) {\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"type\"           , this.type !== \"rpc\" && /* istanbul ignore next */ this.type || undefined,\n        \"requestType\"    , this.requestType,\n        \"requestStream\"  , this.requestStream,\n        \"responseType\"   , this.responseType,\n        \"responseStream\" , this.responseStream,\n        \"options\"        , this.options,\n        \"comment\"        , keepComments ? this.comment : undefined,\n        \"parsedOptions\"  , this.parsedOptions,\n    ]);\n};\n\n/**\n * @override\n */\nMethod.prototype.resolve = function resolve() {\n\n    /* istanbul ignore if */\n    if (this.resolved)\n        return this;\n\n    this.resolvedRequestType = this.parent.lookupType(this.requestType);\n    this.resolvedResponseType = this.parent.lookupType(this.responseType);\n\n    return ReflectionObject.prototype.resolve.call(this);\n};\n"
  },
  {
    "path": "src/namespace.js",
    "content": "\"use strict\";\nmodule.exports = Namespace;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((Namespace.prototype = Object.create(ReflectionObject.prototype)).constructor = Namespace).className = \"Namespace\";\n\nvar Field    = require(\"./field\"),\n    util     = require(\"./util\"),\n    OneOf    = require(\"./oneof\");\n\nvar Type,    // cyclic\n    Service,\n    Enum;\n\n/**\n * Constructs a new namespace instance.\n * @name Namespace\n * @classdesc Reflected namespace.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.<string,*>} [options] Declared options\n */\n\n/**\n * Constructs a namespace from JSON.\n * @memberof Namespace\n * @function\n * @param {string} name Namespace name\n * @param {Object.<string,*>} json JSON object\n * @returns {Namespace} Created namespace\n * @throws {TypeError} If arguments are invalid\n */\nNamespace.fromJSON = function fromJSON(name, json) {\n    return new Namespace(name, json.options).addJSON(json.nested);\n};\n\n/**\n * Converts an array of reflection objects to JSON.\n * @memberof Namespace\n * @param {ReflectionObject[]} array Object array\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {Object.<string,*>|undefined} JSON object or `undefined` when array is empty\n */\nfunction arrayToJSON(array, toJSONOptions) {\n    if (!(array && array.length))\n        return undefined;\n    var obj = {};\n    for (var i = 0; i < array.length; ++i)\n        obj[array[i].name] = array[i].toJSON(toJSONOptions);\n    return obj;\n}\n\nNamespace.arrayToJSON = arrayToJSON;\n\n/**\n * Tests if the specified id is reserved.\n * @param {Array.<number[]|string>|undefined} reserved Array of reserved ranges and names\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedId = function isReservedId(reserved, id) {\n    if (reserved)\n        for (var i = 0; i < reserved.length; ++i)\n            if (typeof reserved[i] !== \"string\" && reserved[i][0] <= id && reserved[i][1] > id)\n                return true;\n    return false;\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {Array.<number[]|string>|undefined} reserved Array of reserved ranges and names\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nNamespace.isReservedName = function isReservedName(reserved, name) {\n    if (reserved)\n        for (var i = 0; i < reserved.length; ++i)\n            if (reserved[i] === name)\n                return true;\n    return false;\n};\n\n/**\n * Not an actual constructor. Use {@link Namespace} instead.\n * @classdesc Base class of all reflection objects containing nested objects. This is not an actual class but here for the sake of having consistent type definitions.\n * @exports NamespaceBase\n * @extends ReflectionObject\n * @abstract\n * @constructor\n * @param {string} name Namespace name\n * @param {Object.<string,*>} [options] Declared options\n * @see {@link Namespace}\n */\nfunction Namespace(name, options) {\n    ReflectionObject.call(this, name, options);\n\n    /**\n     * Nested objects by name.\n     * @type {Object.<string,ReflectionObject>|undefined}\n     */\n    this.nested = undefined; // toJSON\n\n    /**\n     * Cached nested objects as an array.\n     * @type {ReflectionObject[]|null}\n     * @private\n     */\n    this._nestedArray = null;\n\n    /**\n     * Cache lookup calls for any objects contains anywhere under this namespace.\n     * This drastically speeds up resolve for large cross-linked protos where the same\n     * types are looked up repeatedly.\n     * @type {Object.<string,ReflectionObject|null>}\n     * @private\n     */\n    this._lookupCache = {};\n\n    /**\n     * Whether or not objects contained in this namespace need feature resolution.\n     * @type {boolean}\n     * @protected\n     */\n    this._needsRecursiveFeatureResolution = true;\n\n    /**\n     * Whether or not objects contained in this namespace need a resolve.\n     * @type {boolean}\n     * @protected\n     */\n    this._needsRecursiveResolve = true;\n}\n\nfunction clearCache(namespace) {\n    namespace._nestedArray = null;\n    namespace._lookupCache = {};\n\n    // Also clear parent caches, since they include nested lookups.\n    var parent = namespace;\n    while(parent = parent.parent) {\n        parent._lookupCache = {};\n    }\n    return namespace;\n}\n\n/**\n * Nested objects of this namespace as an array for iteration.\n * @name NamespaceBase#nestedArray\n * @type {ReflectionObject[]}\n * @readonly\n */\nObject.defineProperty(Namespace.prototype, \"nestedArray\", {\n    get: function() {\n        return this._nestedArray || (this._nestedArray = util.toArray(this.nested));\n    }\n});\n\n/**\n * Namespace descriptor.\n * @interface INamespace\n * @property {Object.<string,*>} [options] Namespace options\n * @property {Object.<string,AnyNestedObject>} [nested] Nested object descriptors\n */\n\n/**\n * Any extension field descriptor.\n * @typedef AnyExtensionField\n * @type {IExtensionField|IExtensionMapField}\n */\n\n/**\n * Any nested object descriptor.\n * @typedef AnyNestedObject\n * @type {IEnum|IType|IService|AnyExtensionField|INamespace|IOneOf}\n */\n\n/**\n * Converts this namespace to a namespace descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {INamespace} Namespace descriptor\n */\nNamespace.prototype.toJSON = function toJSON(toJSONOptions) {\n    return util.toObject([\n        \"options\" , this.options,\n        \"nested\"  , arrayToJSON(this.nestedArray, toJSONOptions)\n    ]);\n};\n\n/**\n * Adds nested objects to this namespace from nested object descriptors.\n * @param {Object.<string,AnyNestedObject>} nestedJson Any nested object descriptors\n * @returns {Namespace} `this`\n */\nNamespace.prototype.addJSON = function addJSON(nestedJson) {\n    var ns = this;\n    /* istanbul ignore else */\n    if (nestedJson) {\n        for (var names = Object.keys(nestedJson), i = 0, nested; i < names.length; ++i) {\n            nested = nestedJson[names[i]];\n            ns.add( // most to least likely\n                ( nested.fields !== undefined\n                ? Type.fromJSON\n                : nested.values !== undefined\n                ? Enum.fromJSON\n                : nested.methods !== undefined\n                ? Service.fromJSON\n                : nested.id !== undefined\n                ? Field.fromJSON\n                : Namespace.fromJSON )(names[i], nested)\n            );\n        }\n    }\n    return this;\n};\n\n/**\n * Gets the nested object of the specified name.\n * @param {string} name Nested object name\n * @returns {ReflectionObject|null} The reflection object or `null` if it doesn't exist\n */\nNamespace.prototype.get = function get(name) {\n    return this.nested && this.nested[name]\n        || null;\n};\n\n/**\n * Gets the values of the nested {@link Enum|enum} of the specified name.\n * This methods differs from {@link Namespace#get|get} in that it returns an enum's values directly and throws instead of returning `null`.\n * @param {string} name Nested enum name\n * @returns {Object.<string,number>} Enum values\n * @throws {Error} If there is no such enum\n */\nNamespace.prototype.getEnum = function getEnum(name) {\n    if (this.nested && this.nested[name] instanceof Enum)\n        return this.nested[name].values;\n    throw Error(\"no such enum: \" + name);\n};\n\n/**\n * Adds a nested object to this namespace.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name\n */\nNamespace.prototype.add = function add(object) {\n\n    if (!(object instanceof Field && object.extend !== undefined || object instanceof Type  || object instanceof OneOf || object instanceof Enum || object instanceof Service || object instanceof Namespace))\n        throw TypeError(\"object must be a valid nested object\");\n\n    if (!this.nested)\n        this.nested = {};\n    else {\n        var prev = this.get(object.name);\n        if (prev) {\n            if (prev instanceof Namespace && object instanceof Namespace && !(prev instanceof Type || prev instanceof Service)) {\n                // replace plain namespace but keep existing nested elements and options\n                var nested = prev.nestedArray;\n                for (var i = 0; i < nested.length; ++i)\n                    object.add(nested[i]);\n                this.remove(prev);\n                if (!this.nested)\n                    this.nested = {};\n                object.setOptions(prev.options, true);\n\n            } else\n                throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n        }\n    }\n    this.nested[object.name] = object;\n\n    if (!(this instanceof Type || this instanceof Service || this instanceof Enum || this instanceof Field)) {\n        // This is a package or a root namespace.\n        if (!object._edition) {\n            // Make sure that some edition is set if it hasn't already been specified.\n            object._edition = object._defaultEdition;\n        }\n    }\n\n    this._needsRecursiveFeatureResolution = true;\n    this._needsRecursiveResolve = true;\n\n    // Also clear parent caches, since they need to recurse down.\n    var parent = this;\n    while(parent = parent.parent) {\n        parent._needsRecursiveFeatureResolution = true;\n        parent._needsRecursiveResolve = true;\n    }\n\n    object.onAdd(this);\n    return clearCache(this);\n};\n\n/**\n * Removes a nested object from this namespace.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Namespace} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this namespace\n */\nNamespace.prototype.remove = function remove(object) {\n\n    if (!(object instanceof ReflectionObject))\n        throw TypeError(\"object must be a ReflectionObject\");\n    if (object.parent !== this)\n        throw Error(object + \" is not a member of \" + this);\n\n    delete this.nested[object.name];\n    if (!Object.keys(this.nested).length)\n        this.nested = undefined;\n\n    object.onRemove(this);\n    return clearCache(this);\n};\n\n/**\n * Defines additial namespaces within this one if not yet existing.\n * @param {string|string[]} path Path to create\n * @param {*} [json] Nested types to create from JSON\n * @returns {Namespace} Pointer to the last namespace created or `this` if path is empty\n */\nNamespace.prototype.define = function define(path, json) {\n\n    if (util.isString(path))\n        path = path.split(\".\");\n    else if (!Array.isArray(path))\n        throw TypeError(\"illegal path\");\n    if (path && path.length && path[0] === \"\")\n        throw Error(\"path must be relative\");\n\n    var ptr = this;\n    while (path.length > 0) {\n        var part = path.shift();\n        if (ptr.nested && ptr.nested[part]) {\n            ptr = ptr.nested[part];\n            if (!(ptr instanceof Namespace))\n                throw Error(\"path conflicts with non-namespace objects\");\n        } else\n            ptr.add(ptr = new Namespace(part));\n    }\n    if (json)\n        ptr.addJSON(json);\n    return ptr;\n};\n\n/**\n * Resolves this namespace's and all its nested objects' type references. Useful to validate a reflection tree, but comes at a cost.\n * @returns {Namespace} `this`\n */\nNamespace.prototype.resolveAll = function resolveAll() {\n    if (!this._needsRecursiveResolve) return this;\n\n    this._resolveFeaturesRecursive(this._edition);\n\n    var nested = this.nestedArray, i = 0;\n    this.resolve();\n    while (i < nested.length)\n        if (nested[i] instanceof Namespace)\n            nested[i++].resolveAll();\n        else\n            nested[i++].resolve();\n    this._needsRecursiveResolve = false;\n    return this;\n};\n\n/**\n * @override\n */\nNamespace.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n    if (!this._needsRecursiveFeatureResolution) return this;\n    this._needsRecursiveFeatureResolution = false;\n\n    edition = this._edition || edition;\n\n    ReflectionObject.prototype._resolveFeaturesRecursive.call(this, edition);\n    this.nestedArray.forEach(nested => {\n        nested._resolveFeaturesRecursive(edition);\n    });\n    return this;\n};\n\n/**\n * Recursively looks up the reflection object matching the specified path in the scope of this namespace.\n * @param {string|string[]} path Path to look up\n * @param {*|Array.<*>} filterTypes Filter types, any combination of the constructors of `protobuf.Type`, `protobuf.Enum`, `protobuf.Service` etc.\n * @param {boolean} [parentAlreadyChecked=false] If known, whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n */\nNamespace.prototype.lookup = function lookup(path, filterTypes, parentAlreadyChecked) {\n    /* istanbul ignore next */\n    if (typeof filterTypes === \"boolean\") {\n        parentAlreadyChecked = filterTypes;\n        filterTypes = undefined;\n    } else if (filterTypes && !Array.isArray(filterTypes))\n        filterTypes = [ filterTypes ];\n\n    if (util.isString(path) && path.length) {\n        if (path === \".\")\n            return this.root;\n        path = path.split(\".\");\n    } else if (!path.length)\n        return this;\n\n    var flatPath = path.join(\".\");\n\n    // Start at root if path is absolute\n    if (path[0] === \"\")\n        return this.root.lookup(path.slice(1), filterTypes);\n\n    // Early bailout for objects with matching absolute paths\n    var found = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects[\".\" + flatPath];\n    if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {\n        return found;\n    }\n\n    // Do a regular lookup at this namespace and below\n    found = this._lookupImpl(path, flatPath);\n    if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {\n        return found;\n    }\n\n    if (parentAlreadyChecked)\n        return null;\n\n    // If there hasn't been a match, walk up the tree and look more broadly\n    var current = this;\n    while (current.parent) {\n        found = current.parent._lookupImpl(path, flatPath);\n        if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {\n            return found;\n        }\n        current = current.parent;\n    }\n    return null;\n};\n\n/**\n * Internal helper for lookup that handles searching just at this namespace and below along with caching.\n * @param {string[]} path Path to look up\n * @param {string} flatPath Flattened version of the path to use as a cache key\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @private\n */\nNamespace.prototype._lookupImpl = function lookup(path, flatPath) {\n    if(Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {\n        return this._lookupCache[flatPath];\n    }\n\n    // Test if the first part matches any nested object, and if so, traverse if path contains more\n    var found = this.get(path[0]);\n    var exact = null;\n    if (found) {\n        if (path.length === 1) {\n            exact = found;\n        } else if (found instanceof Namespace) {\n            path = path.slice(1);\n            exact = found._lookupImpl(path, path.join(\".\"));\n        }\n\n    // Otherwise try each nested namespace\n    } else {\n        for (var i = 0; i < this.nestedArray.length; ++i)\n            if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path, flatPath)))\n                exact = found;\n    }\n\n    // Set this even when null, so that when we walk up the tree we can quickly bail on repeated checks back down.\n    this._lookupCache[flatPath] = exact;\n    return exact;\n};\n\n/**\n * Looks up the reflection object at the specified path, relative to this namespace.\n * @name NamespaceBase#lookup\n * @function\n * @param {string|string[]} path Path to look up\n * @param {boolean} [parentAlreadyChecked=false] Whether the parent has already been checked\n * @returns {ReflectionObject|null} Looked up object or `null` if none could be found\n * @variation 2\n */\n// lookup(path: string, [parentAlreadyChecked: boolean])\n\n/**\n * Looks up the {@link Type|type} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type\n * @throws {Error} If `path` does not point to a type\n */\nNamespace.prototype.lookupType = function lookupType(path) {\n    var found = this.lookup(path, [ Type ]);\n    if (!found)\n        throw Error(\"no such type: \" + path);\n    return found;\n};\n\n/**\n * Looks up the values of the {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Enum} Looked up enum\n * @throws {Error} If `path` does not point to an enum\n */\nNamespace.prototype.lookupEnum = function lookupEnum(path) {\n    var found = this.lookup(path, [ Enum ]);\n    if (!found)\n        throw Error(\"no such Enum '\" + path + \"' in \" + this);\n    return found;\n};\n\n/**\n * Looks up the {@link Type|type} or {@link Enum|enum} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Type} Looked up type or enum\n * @throws {Error} If `path` does not point to a type or enum\n */\nNamespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path) {\n    var found = this.lookup(path, [ Type, Enum ]);\n    if (!found)\n        throw Error(\"no such Type or Enum '\" + path + \"' in \" + this);\n    return found;\n};\n\n/**\n * Looks up the {@link Service|service} at the specified path, relative to this namespace.\n * Besides its signature, this methods differs from {@link Namespace#lookup|lookup} in that it throws instead of returning `null`.\n * @param {string|string[]} path Path to look up\n * @returns {Service} Looked up service\n * @throws {Error} If `path` does not point to a service\n */\nNamespace.prototype.lookupService = function lookupService(path) {\n    var found = this.lookup(path, [ Service ]);\n    if (!found)\n        throw Error(\"no such Service '\" + path + \"' in \" + this);\n    return found;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nNamespace._configure = function(Type_, Service_, Enum_) {\n    Type    = Type_;\n    Service = Service_;\n    Enum    = Enum_;\n};\n"
  },
  {
    "path": "src/object.js",
    "content": "\"use strict\";\nmodule.exports = ReflectionObject;\n\nReflectionObject.className = \"ReflectionObject\";\n\nconst OneOf = require(\"./oneof\");\nvar util = require(\"./util\");\n\nvar Root; // cyclic\n\n/* eslint-disable no-warning-comments */\n// TODO: Replace with embedded proto.\nvar editions2024Defaults = {enum_type: \"OPEN\", field_presence: \"EXPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\", enforce_naming_style: \"STYLE2024\", default_symbol_visibility: \"EXPORT_TOP_LEVEL\" };\nvar editions2023Defaults = {enum_type: \"OPEN\", field_presence: \"EXPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\", enforce_naming_style: \"STYLE_LEGACY\", default_symbol_visibility: \"EXPORT_ALL\" };\nvar proto2Defaults = {enum_type: \"CLOSED\", field_presence: \"EXPLICIT\", json_format: \"LEGACY_BEST_EFFORT\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"EXPANDED\", utf8_validation: \"NONE\", enforce_naming_style: \"STYLE_LEGACY\", default_symbol_visibility: \"EXPORT_ALL\" };\nvar proto3Defaults = {enum_type: \"OPEN\", field_presence: \"IMPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\", enforce_naming_style: \"STYLE_LEGACY\", default_symbol_visibility: \"EXPORT_ALL\" };\n\n/**\n * Constructs a new reflection object instance.\n * @classdesc Base class of all reflection objects.\n * @constructor\n * @param {string} name Object name\n * @param {Object.<string,*>} [options] Declared options\n * @abstract\n */\nfunction ReflectionObject(name, options) {\n\n    if (!util.isString(name))\n        throw TypeError(\"name must be a string\");\n\n    if (options && !util.isObject(options))\n        throw TypeError(\"options must be an object\");\n\n    /**\n     * Options.\n     * @type {Object.<string,*>|undefined}\n     */\n    this.options = options; // toJSON\n\n    /**\n     * Parsed Options.\n     * @type {Array.<Object.<string,*>>|undefined}\n     */\n    this.parsedOptions = null;\n\n    /**\n     * Unique name within its namespace.\n     * @type {string}\n     */\n    this.name = name;\n\n    /**\n     * The edition specified for this object.  Only relevant for top-level objects.\n     * @type {string}\n     * @private\n     */\n    this._edition = null;\n\n    /**\n     * The default edition to use for this object if none is specified.  For legacy reasons,\n     * this is proto2 except in the JSON parsing case where it was proto3.\n     * @type {string}\n     * @private\n     */\n    this._defaultEdition = \"proto2\";\n\n    /**\n     * Resolved Features.\n     * @type {object}\n     * @private\n     */\n    this._features = {};\n\n    /**\n     * Whether or not features have been resolved.\n     * @type {boolean}\n     * @private\n     */\n    this._featuresResolved = false;\n\n    /**\n     * Parent namespace.\n     * @type {Namespace|null}\n     */\n    this.parent = null;\n\n    /**\n     * Whether already resolved or not.\n     * @type {boolean}\n     */\n    this.resolved = false;\n\n    /**\n     * Comment text, if any.\n     * @type {string|null}\n     */\n    this.comment = null;\n\n    /**\n     * Defining file name.\n     * @type {string|null}\n     */\n    this.filename = null;\n}\n\nObject.defineProperties(ReflectionObject.prototype, {\n\n    /**\n     * Reference to the root namespace.\n     * @name ReflectionObject#root\n     * @type {Root}\n     * @readonly\n     */\n    root: {\n        get: function() {\n            var ptr = this;\n            while (ptr.parent !== null)\n                ptr = ptr.parent;\n            return ptr;\n        }\n    },\n\n    /**\n     * Full name including leading dot.\n     * @name ReflectionObject#fullName\n     * @type {string}\n     * @readonly\n     */\n    fullName: {\n        get: function() {\n            var path = [ this.name ],\n                ptr = this.parent;\n            while (ptr) {\n                path.unshift(ptr.name);\n                ptr = ptr.parent;\n            }\n            return path.join(\".\");\n        }\n    }\n});\n\n/**\n * Converts this reflection object to its descriptor representation.\n * @returns {Object.<string,*>} Descriptor\n * @abstract\n */\nReflectionObject.prototype.toJSON = /* istanbul ignore next */ function toJSON() {\n    throw Error(); // not implemented, shouldn't happen\n};\n\n/**\n * Called when this object is added to a parent.\n * @param {ReflectionObject} parent Parent added to\n * @returns {undefined}\n */\nReflectionObject.prototype.onAdd = function onAdd(parent) {\n    if (this.parent && this.parent !== parent)\n        this.parent.remove(this);\n    this.parent = parent;\n    this.resolved = false;\n    var root = parent.root;\n    if (root instanceof Root)\n        root._handleAdd(this);\n};\n\n/**\n * Called when this object is removed from a parent.\n * @param {ReflectionObject} parent Parent removed from\n * @returns {undefined}\n */\nReflectionObject.prototype.onRemove = function onRemove(parent) {\n    var root = parent.root;\n    if (root instanceof Root)\n        root._handleRemove(this);\n    this.parent = null;\n    this.resolved = false;\n};\n\n/**\n * Resolves this objects type references.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.resolve = function resolve() {\n    if (this.resolved)\n        return this;\n    if (this.root instanceof Root)\n        this.resolved = true; // only if part of a root\n    return this;\n};\n\n/**\n * Resolves this objects editions features.\n * @param {string} edition The edition we're currently resolving for.\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n    return this._resolveFeatures(this._edition || edition);\n};\n\n/**\n * Resolves child features from parent features\n * @param {string} edition The edition we're currently resolving for.\n * @returns {undefined}\n */\nReflectionObject.prototype._resolveFeatures = function _resolveFeatures(edition) {\n    if (this._featuresResolved) {\n        return;\n    }\n\n    var defaults = {};\n\n    /* istanbul ignore if */\n    if (!edition) {\n        throw new Error(\"Unknown edition for \" + this.fullName);\n    }\n\n    var protoFeatures = Object.assign(this.options ? Object.assign({},  this.options.features) : {},\n        this._inferLegacyProtoFeatures(edition));\n\n    if (this._edition) {\n        // For a namespace marked with a specific edition, reset defaults.\n        /* istanbul ignore else */\n        if (edition === \"proto2\") {\n            defaults = Object.assign({}, proto2Defaults);\n        } else if (edition === \"proto3\") {\n            defaults = Object.assign({}, proto3Defaults);\n        } else if (edition === \"2023\") {\n            defaults = Object.assign({}, editions2023Defaults);\n        } else if (edition === \"2024\") {\n            defaults = Object.assign({}, editions2024Defaults);\n        } else {\n            throw new Error(\"Unknown edition: \" + edition);\n        }\n        this._features = Object.assign(defaults, protoFeatures || {});\n        this._featuresResolved = true;\n        return;\n    }\n\n    // fields in Oneofs aren't actually children of them, so we have to\n    // special-case it\n    /* istanbul ignore else */\n    if (this.partOf instanceof OneOf) {\n        var lexicalParentFeaturesCopy = Object.assign({}, this.partOf._features);\n        this._features = Object.assign(lexicalParentFeaturesCopy, protoFeatures || {});\n    } else if (this.declaringField) {\n        // Skip feature resolution of sister fields.\n    } else if (this.parent) {\n        var parentFeaturesCopy = Object.assign({}, this.parent._features);\n        this._features = Object.assign(parentFeaturesCopy, protoFeatures || {});\n    } else {\n        throw new Error(\"Unable to find a parent for \" + this.fullName);\n    }\n    if (this.extensionField) {\n        // Sister fields should have the same features as their extensions.\n        this.extensionField._features = this._features;\n    }\n    this._featuresResolved = true;\n};\n\n/**\n * Infers features from legacy syntax that may have been specified differently.\n * in older editions.\n * @param {string|undefined} edition The edition this proto is on, or undefined if pre-editions\n * @returns {object} The feature values to override\n */\nReflectionObject.prototype._inferLegacyProtoFeatures = function _inferLegacyProtoFeatures(/*edition*/) {\n    return {};\n};\n\n/**\n * Gets an option value.\n * @param {string} name Option name\n * @returns {*} Option value or `undefined` if not set\n */\nReflectionObject.prototype.getOption = function getOption(name) {\n    if (this.options)\n        return this.options[name];\n    return undefined;\n};\n\n/**\n * Sets an option.\n * @param {string} name Option name\n * @param {*} value Option value\n * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOption = function setOption(name, value, ifNotSet) {\n    if (!this.options)\n        this.options = {};\n    if (/^features\\./.test(name)) {\n        util.setProperty(this.options, name, value, ifNotSet);\n    } else if (!ifNotSet || this.options[name] === undefined) {\n        if (this.getOption(name) !== value) this.resolved = false;\n        this.options[name] = value;\n    }\n\n    return this;\n};\n\n/**\n * Sets a parsed option.\n * @param {string} name parsed Option name\n * @param {*} value Option value\n * @param {string} propName dot '.' delimited full path of property within the option to set. if undefined\\empty, will add a new option with that value\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setParsedOption = function setParsedOption(name, value, propName) {\n    if (!this.parsedOptions) {\n        this.parsedOptions = [];\n    }\n    var parsedOptions = this.parsedOptions;\n    if (propName) {\n        // If setting a sub property of an option then try to merge it\n        // with an existing option\n        var opt = parsedOptions.find(function (opt) {\n            return Object.prototype.hasOwnProperty.call(opt, name);\n        });\n        if (opt) {\n            // If we found an existing option - just merge the property value\n            // (If it's a feature, will just write over)\n            var newValue = opt[name];\n            util.setProperty(newValue, propName, value);\n        } else {\n            // otherwise, create a new option, set its property and add it to the list\n            opt = {};\n            opt[name] = util.setProperty({}, propName, value);\n            parsedOptions.push(opt);\n        }\n    } else {\n        // Always create a new option when setting the value of the option itself\n        var newOpt = {};\n        newOpt[name] = value;\n        parsedOptions.push(newOpt);\n    }\n\n    return this;\n};\n\n/**\n * Sets multiple options.\n * @param {Object.<string,*>} options Options to set\n * @param {boolean} [ifNotSet] Sets an option only if it isn't currently set\n * @returns {ReflectionObject} `this`\n */\nReflectionObject.prototype.setOptions = function setOptions(options, ifNotSet) {\n    if (options)\n        for (var keys = Object.keys(options), i = 0; i < keys.length; ++i)\n            this.setOption(keys[i], options[keys[i]], ifNotSet);\n    return this;\n};\n\n/**\n * Converts this instance to its string representation.\n * @returns {string} Class name[, space, full name]\n */\nReflectionObject.prototype.toString = function toString() {\n    var className = this.constructor.className,\n        fullName  = this.fullName;\n    if (fullName.length)\n        return className + \" \" + fullName;\n    return className;\n};\n\n/**\n * Converts the edition this object is pinned to for JSON format.\n * @returns {string|undefined} The edition string for JSON representation\n */\nReflectionObject.prototype._editionToJSON = function _editionToJSON() {\n    if (!this._edition || this._edition === \"proto3\") {\n        // Avoid emitting proto3 since we need to default to it for backwards\n        // compatibility anyway.\n        return undefined;\n    }\n    return this._edition;\n};\n\n// Sets up cyclic dependencies (called in index-light)\nReflectionObject._configure = function(Root_) {\n    Root = Root_;\n};\n"
  },
  {
    "path": "src/oneof.js",
    "content": "\"use strict\";\nmodule.exports = OneOf;\n\n// extends ReflectionObject\nvar ReflectionObject = require(\"./object\");\n((OneOf.prototype = Object.create(ReflectionObject.prototype)).constructor = OneOf).className = \"OneOf\";\n\nvar Field = require(\"./field\"),\n    util  = require(\"./util\");\n\n/**\n * Constructs a new oneof instance.\n * @classdesc Reflected oneof.\n * @extends ReflectionObject\n * @constructor\n * @param {string} name Oneof name\n * @param {string[]|Object.<string,*>} [fieldNames] Field names\n * @param {Object.<string,*>} [options] Declared options\n * @param {string} [comment] Comment associated with this field\n */\nfunction OneOf(name, fieldNames, options, comment) {\n    if (!Array.isArray(fieldNames)) {\n        options = fieldNames;\n        fieldNames = undefined;\n    }\n    ReflectionObject.call(this, name, options);\n\n    /* istanbul ignore if */\n    if (!(fieldNames === undefined || Array.isArray(fieldNames)))\n        throw TypeError(\"fieldNames must be an Array\");\n\n    /**\n     * Field names that belong to this oneof.\n     * @type {string[]}\n     */\n    this.oneof = fieldNames || []; // toJSON, marker\n\n    /**\n     * Fields that belong to this oneof as an array for iteration.\n     * @type {Field[]}\n     * @readonly\n     */\n    this.fieldsArray = []; // declared readonly for conformance, possibly not yet added to parent\n\n    /**\n     * Comment for this field.\n     * @type {string|null}\n     */\n    this.comment = comment;\n}\n\n/**\n * Oneof descriptor.\n * @interface IOneOf\n * @property {Array.<string>} oneof Oneof field names\n * @property {Object.<string,*>} [options] Oneof options\n */\n\n/**\n * Constructs a oneof from a oneof descriptor.\n * @param {string} name Oneof name\n * @param {IOneOf} json Oneof descriptor\n * @returns {OneOf} Created oneof\n * @throws {TypeError} If arguments are invalid\n */\nOneOf.fromJSON = function fromJSON(name, json) {\n    return new OneOf(name, json.oneof, json.options, json.comment);\n};\n\n/**\n * Converts this oneof to a oneof descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IOneOf} Oneof descriptor\n */\nOneOf.prototype.toJSON = function toJSON(toJSONOptions) {\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"options\" , this.options,\n        \"oneof\"   , this.oneof,\n        \"comment\" , keepComments ? this.comment : undefined\n    ]);\n};\n\n/**\n * Adds the fields of the specified oneof to the parent if not already done so.\n * @param {OneOf} oneof The oneof\n * @returns {undefined}\n * @inner\n * @ignore\n */\nfunction addFieldsToParent(oneof) {\n    if (oneof.parent)\n        for (var i = 0; i < oneof.fieldsArray.length; ++i)\n            if (!oneof.fieldsArray[i].parent)\n                oneof.parent.add(oneof.fieldsArray[i]);\n}\n\n/**\n * Adds a field to this oneof and removes it from its current parent, if any.\n * @param {Field} field Field to add\n * @returns {OneOf} `this`\n */\nOneOf.prototype.add = function add(field) {\n\n    /* istanbul ignore if */\n    if (!(field instanceof Field))\n        throw TypeError(\"field must be a Field\");\n\n    if (field.parent && field.parent !== this.parent)\n        field.parent.remove(field);\n    this.oneof.push(field.name);\n    this.fieldsArray.push(field);\n    field.partOf = this; // field.parent remains null\n    addFieldsToParent(this);\n    return this;\n};\n\n/**\n * Removes a field from this oneof and puts it back to the oneof's parent.\n * @param {Field} field Field to remove\n * @returns {OneOf} `this`\n */\nOneOf.prototype.remove = function remove(field) {\n\n    /* istanbul ignore if */\n    if (!(field instanceof Field))\n        throw TypeError(\"field must be a Field\");\n\n    var index = this.fieldsArray.indexOf(field);\n\n    /* istanbul ignore if */\n    if (index < 0)\n        throw Error(field + \" is not a member of \" + this);\n\n    this.fieldsArray.splice(index, 1);\n    index = this.oneof.indexOf(field.name);\n\n    /* istanbul ignore else */\n    if (index > -1) // theoretical\n        this.oneof.splice(index, 1);\n\n    field.partOf = null;\n    return this;\n};\n\n/**\n * @override\n */\nOneOf.prototype.onAdd = function onAdd(parent) {\n    ReflectionObject.prototype.onAdd.call(this, parent);\n    var self = this;\n    // Collect present fields\n    for (var i = 0; i < this.oneof.length; ++i) {\n        var field = parent.get(this.oneof[i]);\n        if (field && !field.partOf) {\n            field.partOf = self;\n            self.fieldsArray.push(field);\n        }\n    }\n    // Add not yet present fields\n    addFieldsToParent(this);\n};\n\n/**\n * @override\n */\nOneOf.prototype.onRemove = function onRemove(parent) {\n    for (var i = 0, field; i < this.fieldsArray.length; ++i)\n        if ((field = this.fieldsArray[i]).parent)\n            field.parent.remove(field);\n    ReflectionObject.prototype.onRemove.call(this, parent);\n};\n\n/**\n * Determines whether this field corresponds to a synthetic oneof created for\n * a proto3 optional field.  No behavioral logic should depend on this, but it\n * can be relevant for reflection.\n * @name OneOf#isProto3Optional\n * @type {boolean}\n * @readonly\n */\nObject.defineProperty(OneOf.prototype, \"isProto3Optional\", {\n    get: function() {\n        if (this.fieldsArray == null || this.fieldsArray.length !== 1) {\n            return false;\n        }\n\n        var field = this.fieldsArray[0];\n        return field.options != null && field.options[\"proto3_optional\"] === true;\n    }\n});\n\n/**\n * Decorator function as returned by {@link OneOf.d} (TypeScript).\n * @typedef OneOfDecorator\n * @type {function}\n * @param {Object} prototype Target prototype\n * @param {string} oneofName OneOf name\n * @returns {undefined}\n */\n\n/**\n * OneOf decorator (TypeScript).\n * @function\n * @param {...string} fieldNames Field names\n * @returns {OneOfDecorator} Decorator function\n * @template T extends string\n */\nOneOf.d = function decorateOneOf() {\n    var fieldNames = new Array(arguments.length),\n        index = 0;\n    while (index < arguments.length)\n        fieldNames[index] = arguments[index++];\n    return function oneOfDecorator(prototype, oneofName) {\n        util.decorateType(prototype.constructor)\n            .add(new OneOf(oneofName, fieldNames));\n        Object.defineProperty(prototype, oneofName, {\n            get: util.oneOfGetter(fieldNames),\n            set: util.oneOfSetter(fieldNames)\n        });\n    };\n};\n"
  },
  {
    "path": "src/parse.js",
    "content": "\"use strict\";\nmodule.exports = parse;\n\nparse.filename = null;\nparse.defaults = { keepCase: false };\n\nvar tokenize  = require(\"./tokenize\"),\n    Root      = require(\"./root\"),\n    Type      = require(\"./type\"),\n    Field     = require(\"./field\"),\n    MapField  = require(\"./mapfield\"),\n    OneOf     = require(\"./oneof\"),\n    Enum      = require(\"./enum\"),\n    Service   = require(\"./service\"),\n    Method    = require(\"./method\"),\n    ReflectionObject = require(\"./object\"),\n    types     = require(\"./types\"),\n    util      = require(\"./util\");\n\nvar base10Re    = /^[1-9][0-9]*$/,\n    base10NegRe = /^-?[1-9][0-9]*$/,\n    base16Re    = /^0[x][0-9a-fA-F]+$/,\n    base16NegRe = /^-?0[x][0-9a-fA-F]+$/,\n    base8Re     = /^0[0-7]+$/,\n    base8NegRe  = /^-?0[0-7]+$/,\n    numberRe    = /^(?![eE])[0-9]*(?:\\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,\n    nameRe      = /^[a-zA-Z_][a-zA-Z_0-9]*$/,\n    typeRefRe   = /^(?:\\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\\.[a-zA-Z_][a-zA-Z_0-9]*)*$/;\n\n/**\n * Result object returned from {@link parse}.\n * @interface IParserResult\n * @property {string|undefined} package Package name, if declared\n * @property {string[]|undefined} imports Imports, if any\n * @property {string[]|undefined} weakImports Weak imports, if any\n * @property {Root} root Populated root instance\n */\n\n/**\n * Options modifying the behavior of {@link parse}.\n * @interface IParseOptions\n * @property {boolean} [keepCase=false] Keeps field casing instead of converting to camel case\n * @property {boolean} [alternateCommentMode=false] Recognize double-slash comments in addition to doc-block comments.\n * @property {boolean} [preferTrailingComment=false] Use trailing comment when both leading comment and trailing comment exist.\n */\n\n/**\n * Options modifying the behavior of JSON serialization.\n * @interface IToJSONOptions\n * @property {boolean} [keepComments=false] Serializes comments.\n */\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @param {string} source Source contents\n * @param {Root} root Root to populate\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n */\nfunction parse(source, root, options) {\n    /* eslint-disable callback-return */\n    if (!(root instanceof Root)) {\n        options = root;\n        root = new Root();\n    }\n    if (!options)\n        options = parse.defaults;\n\n    var preferTrailingComment = options.preferTrailingComment || false;\n    var tn = tokenize(source, options.alternateCommentMode || false),\n        next = tn.next,\n        push = tn.push,\n        peek = tn.peek,\n        skip = tn.skip,\n        cmnt = tn.cmnt;\n\n    var head = true,\n        pkg,\n        imports,\n        weakImports,\n        edition = \"proto2\";\n\n    var ptr = root;\n\n    var topLevelObjects = [];\n    var topLevelOptions = {};\n\n    var applyCase = options.keepCase ? function(name) { return name; } : util.camelCase;\n\n    function resolveFileFeatures() {\n        topLevelObjects.forEach(obj => {\n            obj._edition = edition;\n            Object.keys(topLevelOptions).forEach(opt => {\n                if (obj.getOption(opt) !== undefined) return;\n                obj.setOption(opt, topLevelOptions[opt], true);\n            });\n        });\n    }\n\n    /* istanbul ignore next */\n    function illegal(token, name, insideTryCatch) {\n        var filename = parse.filename;\n        if (!insideTryCatch)\n            parse.filename = null;\n        return Error(\"illegal \" + (name || \"token\") + \" '\" + token + \"' (\" + (filename ? filename + \", \" : \"\") + \"line \" + tn.line + \")\");\n    }\n\n    function readString() {\n        var values = [],\n            token;\n        do {\n            /* istanbul ignore if */\n            if ((token = next()) !== \"\\\"\" && token !== \"'\")\n                throw illegal(token);\n\n            values.push(next());\n            skip(token);\n            token = peek();\n        } while (token === \"\\\"\" || token === \"'\");\n        return values.join(\"\");\n    }\n\n    function readValue(acceptTypeRef) {\n        var token = next();\n        switch (token) {\n            case \"'\":\n            case \"\\\"\":\n                push(token);\n                return readString();\n            case \"true\": case \"TRUE\":\n                return true;\n            case \"false\": case \"FALSE\":\n                return false;\n        }\n        try {\n            return parseNumber(token, /* insideTryCatch */ true);\n        } catch (e) {\n            /* istanbul ignore else */\n            if (acceptTypeRef && typeRefRe.test(token))\n                return token;\n\n            /* istanbul ignore next */\n            throw illegal(token, \"value\");\n        }\n    }\n\n    function readRanges(target, acceptStrings) {\n        var token, start;\n        do {\n            if (acceptStrings && ((token = peek()) === \"\\\"\" || token === \"'\")) {\n                var str = readString();\n                target.push(str);\n                if (edition >= 2023) {\n                    throw illegal(str, \"id\");\n                }\n            } else {\n                try {\n                    target.push([ start = parseId(next()), skip(\"to\", true) ? parseId(next()) : start ]);\n                } catch (err) {\n                    if (acceptStrings && typeRefRe.test(token) && edition >= 2023) {\n                        target.push(token);\n                    } else {\n                        throw err;\n                    }\n                }\n            }\n        } while (skip(\",\", true));\n        var dummy = {options: undefined};\n        dummy.setOption = function(name, value) {\n          if (this.options === undefined) this.options = {};\n          this.options[name] = value;\n        };\n        ifBlock(\n            dummy,\n            function parseRange_block(token) {\n              /* istanbul ignore else */\n              if (token === \"option\") {\n                parseOption(dummy, token);  // skip\n                skip(\";\");\n              } else\n                throw illegal(token);\n            },\n            function parseRange_line() {\n              parseInlineOptions(dummy);  // skip\n            });\n    }\n\n    function parseNumber(token, insideTryCatch) {\n        var sign = 1;\n        if (token.charAt(0) === \"-\") {\n            sign = -1;\n            token = token.substring(1);\n        }\n        switch (token) {\n            case \"inf\": case \"INF\": case \"Inf\":\n                return sign * Infinity;\n            case \"nan\": case \"NAN\": case \"Nan\": case \"NaN\":\n                return NaN;\n            case \"0\":\n                return 0;\n        }\n        if (base10Re.test(token))\n            return sign * parseInt(token, 10);\n        if (base16Re.test(token))\n            return sign * parseInt(token, 16);\n        if (base8Re.test(token))\n            return sign * parseInt(token, 8);\n\n        /* istanbul ignore else */\n        if (numberRe.test(token))\n            return sign * parseFloat(token);\n\n        /* istanbul ignore next */\n        throw illegal(token, \"number\", insideTryCatch);\n    }\n\n    function parseId(token, acceptNegative) {\n        switch (token) {\n            case \"max\": case \"MAX\": case \"Max\":\n                return 536870911;\n            case \"0\":\n                return 0;\n        }\n\n        /* istanbul ignore if */\n        if (!acceptNegative && token.charAt(0) === \"-\")\n            throw illegal(token, \"id\");\n\n        if (base10NegRe.test(token))\n            return parseInt(token, 10);\n        if (base16NegRe.test(token))\n            return parseInt(token, 16);\n\n        /* istanbul ignore else */\n        if (base8NegRe.test(token))\n            return parseInt(token, 8);\n\n        /* istanbul ignore next */\n        throw illegal(token, \"id\");\n    }\n\n    function parsePackage() {\n        /* istanbul ignore if */\n        if (pkg !== undefined)\n            throw illegal(\"package\");\n\n        pkg = next();\n\n        /* istanbul ignore if */\n        if (!typeRefRe.test(pkg))\n            throw illegal(pkg, \"name\");\n\n        ptr = ptr.define(pkg);\n\n        skip(\";\");\n    }\n\n    function parseImport() {\n        var token = peek();\n        var whichImports;\n        switch (token) {\n            case \"option\":\n                if (edition < \"2024\") {\n                    throw illegal(\"option\");\n                }\n                // Import options are only used for resolving options, which we don't\n                // do.  We can just throw them out.\n                next();\n                readString();\n                skip(\";\");\n                return;\n            case \"weak\":\n                whichImports = weakImports || (weakImports = []);\n                next();\n                break;\n            case \"public\":\n                next();\n                // eslint-disable-next-line no-fallthrough\n            default:\n                whichImports = imports || (imports = []);\n                break;\n        }\n        token = readString();\n        skip(\";\");\n        whichImports.push(token);\n    }\n\n    function parseSyntax() {\n        skip(\"=\");\n        edition = readString();\n\n        /* istanbul ignore if */\n        if (edition < 2023)\n            throw illegal(edition, \"syntax\");\n\n        skip(\";\");\n    }\n\n    function parseEdition() {\n        skip(\"=\");\n        edition = readString();\n        const supportedEditions = [\"2023\", \"2024\"];\n\n        /* istanbul ignore if */\n        if (!supportedEditions.includes(edition))\n            throw illegal(edition, \"edition\");\n\n        skip(\";\");\n    }\n\n\n    function parseCommon(parent, token) {\n        switch (token) {\n\n            case \"option\":\n                parseOption(parent, token);\n                skip(\";\");\n                return true;\n\n            case \"message\":\n                parseType(parent, token);\n                return true;\n\n            case \"enum\":\n                parseEnum(parent, token);\n                return true;\n\n            case \"export\":\n            case \"local\":\n                if (edition < \"2024\") {\n                    return false;\n                }\n                token = next();\n                if (token === \"export\" || token === \"local\") {\n                    return false;\n                }\n                if (token !== \"message\" && token !== \"enum\") {\n                    return false;\n                }\n                /* eslint-disable no-warning-comments */\n                // TODO: actually enforce visiblity modifiers like protoc does.\n                return parseCommon(parent, token);\n\n            case \"service\":\n                parseService(parent, token);\n                return true;\n\n            case \"extend\":\n                parseExtension(parent, token);\n                return true;\n        }\n        return false;\n    }\n\n    function ifBlock(obj, fnIf, fnElse) {\n        var trailingLine = tn.line;\n        if (obj) {\n            if(typeof obj.comment !== \"string\") {\n              obj.comment = cmnt(); // try block-type comment\n            }\n            obj.filename = parse.filename;\n        }\n        if (skip(\"{\", true)) {\n            var token;\n            while ((token = next()) !== \"}\")\n                fnIf(token);\n            skip(\";\", true);\n        } else {\n            if (fnElse)\n                fnElse();\n            skip(\";\");\n            if (obj && (typeof obj.comment !== \"string\" || preferTrailingComment))\n                obj.comment = cmnt(trailingLine) || obj.comment; // try line-type comment\n        }\n    }\n\n    function parseType(parent, token) {\n\n        /* istanbul ignore if */\n        if (!nameRe.test(token = next()))\n            throw illegal(token, \"type name\");\n\n        var type = new Type(token);\n        ifBlock(type, function parseType_block(token) {\n            if (parseCommon(type, token))\n                return;\n\n            switch (token) {\n\n                case \"map\":\n                    parseMapField(type, token);\n                    break;\n\n                case \"required\":\n                    if (edition !== \"proto2\")\n                        throw illegal(token);\n                /* eslint-disable no-fallthrough */\n                case \"repeated\":\n                    parseField(type, token);\n                    break;\n\n                case \"optional\":\n                    /* istanbul ignore if */\n                    if (edition === \"proto3\") {\n                        parseField(type, \"proto3_optional\");\n                    } else if (edition !== \"proto2\") {\n                        throw illegal(token);\n                    } else {\n                        parseField(type, \"optional\");\n                    }\n                    break;\n\n                case \"oneof\":\n                    parseOneOf(type, token);\n                    break;\n\n                case \"extensions\":\n                    readRanges(type.extensions || (type.extensions = []));\n                    break;\n\n                case \"reserved\":\n                    readRanges(type.reserved || (type.reserved = []), true);\n                    break;\n\n                default:\n                    /* istanbul ignore if */\n                    if (edition === \"proto2\" || !typeRefRe.test(token)) {\n                        throw illegal(token);\n                    }\n\n                    push(token);\n                    parseField(type, \"optional\");\n                    break;\n            }\n        });\n        parent.add(type);\n        if (parent === ptr) {\n            topLevelObjects.push(type);\n        }\n    }\n\n    function parseField(parent, rule, extend) {\n        var type = next();\n        if (type === \"group\") {\n            parseGroup(parent, rule);\n            return;\n        }\n        // Type names can consume multiple tokens, in multiple variants:\n        //    package.subpackage   field       tokens: \"package.subpackage\" [TYPE NAME ENDS HERE] \"field\"\n        //    package . subpackage field       tokens: \"package\" \".\" \"subpackage\" [TYPE NAME ENDS HERE] \"field\"\n        //    package.  subpackage field       tokens: \"package.\" \"subpackage\" [TYPE NAME ENDS HERE] \"field\"\n        //    package  .subpackage field       tokens: \"package\" \".subpackage\" [TYPE NAME ENDS HERE] \"field\"\n        // Keep reading tokens until we get a type name with no period at the end,\n        // and the next token does not start with a period.\n        while (type.endsWith(\".\") || peek().startsWith(\".\")) {\n            type += next();\n        }\n\n        /* istanbul ignore if */\n        if (!typeRefRe.test(type))\n            throw illegal(type, \"type\");\n\n        var name = next();\n\n        /* istanbul ignore if */\n\n        if (!nameRe.test(name))\n            throw illegal(name, \"name\");\n\n        name = applyCase(name);\n        skip(\"=\");\n\n        var field = new Field(name, parseId(next()), type, rule, extend);\n\n        ifBlock(field, function parseField_block(token) {\n\n            /* istanbul ignore else */\n            if (token === \"option\") {\n                parseOption(field, token);\n                skip(\";\");\n            } else\n                throw illegal(token);\n\n        }, function parseField_line() {\n            parseInlineOptions(field);\n        });\n\n        if (rule === \"proto3_optional\") {\n            // for proto3 optional fields, we create a single-member Oneof to mimic \"optional\" behavior\n            var oneof = new OneOf(\"_\" + name);\n            field.setOption(\"proto3_optional\", true);\n            oneof.add(field);\n            parent.add(oneof);\n        } else {\n            parent.add(field);\n        }\n        if (parent === ptr) {\n            topLevelObjects.push(field);\n        }\n    }\n\n    function parseGroup(parent, rule) {\n        if (edition >= 2023) {\n            throw illegal(\"group\");\n        }\n        var name = next();\n\n        /* istanbul ignore if */\n        if (!nameRe.test(name))\n            throw illegal(name, \"name\");\n\n        var fieldName = util.lcFirst(name);\n        if (name === fieldName)\n            name = util.ucFirst(name);\n        skip(\"=\");\n        var id = parseId(next());\n        var type = new Type(name);\n        type.group = true;\n        var field = new Field(fieldName, id, name, rule);\n        field.filename = parse.filename;\n        ifBlock(type, function parseGroup_block(token) {\n            switch (token) {\n\n                case \"option\":\n                    parseOption(type, token);\n                    skip(\";\");\n                    break;\n                case \"required\":\n                case \"repeated\":\n                    parseField(type, token);\n                    break;\n\n                case \"optional\":\n                    /* istanbul ignore if */\n                    if (edition === \"proto3\") {\n                        parseField(type, \"proto3_optional\");\n                    } else {\n                        parseField(type, \"optional\");\n                    }\n                    break;\n\n                case \"message\":\n                    parseType(type, token);\n                    break;\n\n                case \"enum\":\n                    parseEnum(type, token);\n                    break;\n\n                case \"reserved\":\n                    readRanges(type.reserved || (type.reserved = []), true);\n                    break;\n\n                case \"export\":\n                case \"local\":\n                    if (edition < \"2024\") {\n                        throw illegal(token);\n                    }\n                    token = next();\n                    switch (token) {\n                        case \"message\":\n                            parseType(type, token);\n                            break;\n                        case \"enum\":\n                            parseType(type, token);\n                            break;\n                        default:\n                            throw illegal(token);\n                    }\n                    break;\n\n                /* istanbul ignore next */\n                default:\n                    throw illegal(token); // there are no groups with proto3 semantics\n            }\n        });\n        parent.add(type)\n              .add(field);\n    }\n\n    function parseMapField(parent) {\n        skip(\"<\");\n        var keyType = next();\n\n        /* istanbul ignore if */\n        if (types.mapKey[keyType] === undefined)\n            throw illegal(keyType, \"type\");\n\n        skip(\",\");\n        var valueType = next();\n\n        /* istanbul ignore if */\n        if (!typeRefRe.test(valueType))\n            throw illegal(valueType, \"type\");\n\n        skip(\">\");\n        var name = next();\n\n        /* istanbul ignore if */\n        if (!nameRe.test(name))\n            throw illegal(name, \"name\");\n\n        skip(\"=\");\n        var field = new MapField(applyCase(name), parseId(next()), keyType, valueType);\n        ifBlock(field, function parseMapField_block(token) {\n\n            /* istanbul ignore else */\n            if (token === \"option\") {\n                parseOption(field, token);\n                skip(\";\");\n            } else\n                throw illegal(token);\n\n        }, function parseMapField_line() {\n            parseInlineOptions(field);\n        });\n        parent.add(field);\n    }\n\n    function parseOneOf(parent, token) {\n\n        /* istanbul ignore if */\n        if (!nameRe.test(token = next()))\n            throw illegal(token, \"name\");\n\n        var oneof = new OneOf(applyCase(token));\n        ifBlock(oneof, function parseOneOf_block(token) {\n            if (token === \"option\") {\n                parseOption(oneof, token);\n                skip(\";\");\n            } else {\n                push(token);\n                parseField(oneof, \"optional\");\n            }\n        });\n        parent.add(oneof);\n    }\n\n    function parseEnum(parent, token) {\n\n        /* istanbul ignore if */\n        if (!nameRe.test(token = next()))\n            throw illegal(token, \"name\");\n\n        var enm = new Enum(token);\n        ifBlock(enm, function parseEnum_block(token) {\n          switch(token) {\n            case \"option\":\n              parseOption(enm, token);\n              skip(\";\");\n              break;\n\n            case \"reserved\":\n              readRanges(enm.reserved || (enm.reserved = []), true);\n              if(enm.reserved === undefined) enm.reserved = [];\n              break;\n\n            default:\n              parseEnumValue(enm, token);\n          }\n        });\n        parent.add(enm);\n        if (parent === ptr) {\n            topLevelObjects.push(enm);\n        }\n    }\n\n    function parseEnumValue(parent, token) {\n\n        /* istanbul ignore if */\n        if (!nameRe.test(token))\n            throw illegal(token, \"name\");\n\n        skip(\"=\");\n        var value = parseId(next(), true),\n            dummy = {\n                options: undefined\n            };\n        dummy.getOption = function(name) {\n            return this.options[name];\n        };\n        dummy.setOption = function(name, value) {\n            ReflectionObject.prototype.setOption.call(dummy, name, value);\n        };\n        dummy.setParsedOption = function() {\n            return undefined;\n        };\n        ifBlock(dummy, function parseEnumValue_block(token) {\n\n            /* istanbul ignore else */\n            if (token === \"option\") {\n                parseOption(dummy, token); // skip\n                skip(\";\");\n            } else\n                throw illegal(token);\n\n        }, function parseEnumValue_line() {\n            parseInlineOptions(dummy); // skip\n        });\n        parent.add(token, value, dummy.comment, dummy.parsedOptions || dummy.options);\n    }\n\n    function parseOption(parent, token) {\n            var option;\n            var propName;\n            var isOption = true;\n            if (token === \"option\") {\n                token = next();\n            }\n\n            while (token !== \"=\") {\n                if (token === \"(\") {\n                    var parensValue = next();\n                    skip(\")\");\n                    token = \"(\" + parensValue + \")\";\n                }\n                if (isOption) {\n                    isOption = false;\n                    if (token.includes(\".\") && !token.includes(\"(\")) {\n                        var tokens = token.split(\".\");\n                        option = tokens[0] + \".\";\n                        token = tokens[1];\n                        continue;\n                    }\n                    option = token;\n                } else {\n                    propName = propName ? propName += token : token;\n                }\n                token = next();\n            }\n            var name = propName ? option.concat(propName) : option;\n            var optionValue = parseOptionValue(parent, name);\n            propName = propName && propName[0] === \".\" ? propName.slice(1) : propName;\n            option = option && option[option.length - 1] === \".\" ? option.slice(0, -1) : option;\n            setParsedOption(parent, option, optionValue, propName);\n    }\n\n    function parseOptionValue(parent, name) {\n        // { a: \"foo\" b { c: \"bar\" } }\n        if (skip(\"{\", true)) {\n            var objectResult = {};\n\n            while (!skip(\"}\", true)) {\n                /* istanbul ignore if */\n                if (!nameRe.test(token = next())) {\n                    throw illegal(token, \"name\");\n                }\n                if (token === null) {\n                  throw illegal(token, \"end of input\");\n                }\n\n                var value;\n                var propName = token;\n\n                skip(\":\", true);\n\n                if (peek() === \"{\") {\n                    // option (my_option) = {\n                    //     repeated_value: [ \"foo\", \"bar\" ]\n                    // };\n                    value = parseOptionValue(parent, name + \".\" + token);\n                } else if (peek() === \"[\") {\n                    value = [];\n                    var lastValue;\n                    if (skip(\"[\", true)) {\n                        do {\n                            lastValue = readValue(true);\n                            value.push(lastValue);\n                        } while (skip(\",\", true));\n                        skip(\"]\");\n                        if (typeof lastValue !== \"undefined\") {\n                            setOption(parent, name + \".\" + token, lastValue);\n                        }\n                    }\n                } else {\n                    value = readValue(true);\n                    setOption(parent, name + \".\" + token, value);\n                }\n\n                var prevValue = objectResult[propName];\n\n                if (prevValue)\n                    value = [].concat(prevValue).concat(value);\n\n                objectResult[propName] = value;\n\n                // Semicolons and commas can be optional\n                skip(\",\", true);\n                skip(\";\", true);\n            }\n\n            return objectResult;\n        }\n\n        var simpleValue = readValue(true);\n        setOption(parent, name, simpleValue);\n        return simpleValue;\n        // Does not enforce a delimiter to be universal\n    }\n\n    function setOption(parent, name, value) {\n        if (ptr === parent && /^features\\./.test(name)) {\n            topLevelOptions[name] = value;\n            return;\n        }\n        if (parent.setOption)\n            parent.setOption(name, value);\n    }\n\n    function setParsedOption(parent, name, value, propName) {\n        if (parent.setParsedOption)\n            parent.setParsedOption(name, value, propName);\n    }\n\n    function parseInlineOptions(parent) {\n        if (skip(\"[\", true)) {\n            do {\n                parseOption(parent, \"option\");\n            } while (skip(\",\", true));\n            skip(\"]\");\n        }\n        return parent;\n    }\n\n    function parseService(parent, token) {\n\n        /* istanbul ignore if */\n        if (!nameRe.test(token = next()))\n            throw illegal(token, \"service name\");\n\n        var service = new Service(token);\n        ifBlock(service, function parseService_block(token) {\n            if (parseCommon(service, token)) {\n                return;\n            }\n\n            /* istanbul ignore else */\n            if (token === \"rpc\")\n                parseMethod(service, token);\n            else\n                throw illegal(token);\n        });\n        parent.add(service);\n        if (parent === ptr) {\n            topLevelObjects.push(service);\n        }\n    }\n\n    function parseMethod(parent, token) {\n        // Get the comment of the preceding line now (if one exists) in case the\n        // method is defined across multiple lines.\n        var commentText = cmnt();\n\n        var type = token;\n\n        /* istanbul ignore if */\n        if (!nameRe.test(token = next()))\n            throw illegal(token, \"name\");\n\n        var name = token,\n            requestType, requestStream,\n            responseType, responseStream;\n\n        skip(\"(\");\n        if (skip(\"stream\", true))\n            requestStream = true;\n\n        /* istanbul ignore if */\n        if (!typeRefRe.test(token = next()))\n            throw illegal(token);\n\n        requestType = token;\n        skip(\")\"); skip(\"returns\"); skip(\"(\");\n        if (skip(\"stream\", true))\n            responseStream = true;\n\n        /* istanbul ignore if */\n        if (!typeRefRe.test(token = next()))\n            throw illegal(token);\n\n        responseType = token;\n        skip(\")\");\n\n        var method = new Method(name, type, requestType, responseType, requestStream, responseStream);\n        method.comment = commentText;\n        ifBlock(method, function parseMethod_block(token) {\n\n            /* istanbul ignore else */\n            if (token === \"option\") {\n                parseOption(method, token);\n                skip(\";\");\n            } else\n                throw illegal(token);\n\n        });\n        parent.add(method);\n    }\n\n    function parseExtension(parent, token) {\n\n        /* istanbul ignore if */\n        if (!typeRefRe.test(token = next()))\n            throw illegal(token, \"reference\");\n\n        var reference = token;\n        ifBlock(null, function parseExtension_block(token) {\n            switch (token) {\n\n                case \"required\":\n                case \"repeated\":\n                    parseField(parent, token, reference);\n                    break;\n\n                case \"optional\":\n                    /* istanbul ignore if */\n                    if (edition === \"proto3\") {\n                        parseField(parent, \"proto3_optional\", reference);\n                    } else {\n                        parseField(parent, \"optional\", reference);\n                    }\n                    break;\n\n                default:\n                    /* istanbul ignore if */\n                    if (edition === \"proto2\" || !typeRefRe.test(token))\n                        throw illegal(token);\n                    push(token);\n                    parseField(parent, \"optional\", reference);\n                    break;\n            }\n        });\n    }\n\n    var token;\n    while ((token = next()) !== null) {\n        switch (token) {\n\n            case \"package\":\n\n                /* istanbul ignore if */\n                if (!head)\n                    throw illegal(token);\n\n                parsePackage();\n                break;\n\n            case \"import\":\n\n                /* istanbul ignore if */\n                if (!head)\n                    throw illegal(token);\n\n                parseImport();\n                break;\n\n            case \"syntax\":\n\n                /* istanbul ignore if */\n                if (!head)\n                    throw illegal(token);\n\n                parseSyntax();\n                break;\n\n            case \"edition\":\n                /* istanbul ignore if */\n                if (!head)\n                    throw illegal(token);\n                parseEdition();\n                break;\n\n            case \"option\":\n                parseOption(ptr, token);\n                skip(\";\", true);\n                break;\n\n            default:\n\n                /* istanbul ignore else */\n                if (parseCommon(ptr, token)) {\n                    head = false;\n                    continue;\n                }\n\n                /* istanbul ignore next */\n                throw illegal(token);\n        }\n    }\n\n    resolveFileFeatures();\n\n    parse.filename = null;\n    return {\n        \"package\"     : pkg,\n        \"imports\"     : imports,\n         weakImports  : weakImports,\n         root         : root\n    };\n}\n\n/**\n * Parses the given .proto source and returns an object with the parsed contents.\n * @name parse\n * @function\n * @param {string} source Source contents\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {IParserResult} Parser result\n * @property {string} filename=null Currently processing file name for error reporting, if known\n * @property {IParseOptions} defaults Default {@link IParseOptions}\n * @variation 2\n */\n"
  },
  {
    "path": "src/reader.js",
    "content": "\"use strict\";\nmodule.exports = Reader;\n\nvar util      = require(\"./util/minimal\");\n\nvar BufferReader; // cyclic\n\nvar LongBits  = util.LongBits,\n    utf8      = util.utf8;\n\n/* istanbul ignore next */\nfunction indexOutOfRange(reader, writeLength) {\n    return RangeError(\"index out of range: \" + reader.pos + \" + \" + (writeLength || 1) + \" > \" + reader.len);\n}\n\n/**\n * Constructs a new reader instance using the specified buffer.\n * @classdesc Wire format reader using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n * @param {Uint8Array} buffer Buffer to read from\n */\nfunction Reader(buffer) {\n\n    /**\n     * Read buffer.\n     * @type {Uint8Array}\n     */\n    this.buf = buffer;\n\n    /**\n     * Read buffer position.\n     * @type {number}\n     */\n    this.pos = 0;\n\n    /**\n     * Read buffer length.\n     * @type {number}\n     */\n    this.len = buffer.length;\n}\n\nvar create_array = typeof Uint8Array !== \"undefined\"\n    ? function create_typed_array(buffer) {\n        if (buffer instanceof Uint8Array || Array.isArray(buffer))\n            return new Reader(buffer);\n        throw Error(\"illegal buffer\");\n    }\n    /* istanbul ignore next */\n    : function create_array(buffer) {\n        if (Array.isArray(buffer))\n            return new Reader(buffer);\n        throw Error(\"illegal buffer\");\n    };\n\nvar create = function create() {\n    return util.Buffer\n        ? function create_buffer_setup(buffer) {\n            return (Reader.create = function create_buffer(buffer) {\n                return util.Buffer.isBuffer(buffer)\n                    ? new BufferReader(buffer)\n                    /* istanbul ignore next */\n                    : create_array(buffer);\n            })(buffer);\n        }\n        /* istanbul ignore next */\n        : create_array;\n};\n\n/**\n * Creates a new reader using the specified buffer.\n * @function\n * @param {Uint8Array|Buffer} buffer Buffer to read from\n * @returns {Reader|BufferReader} A {@link BufferReader} if `buffer` is a Buffer, otherwise a {@link Reader}\n * @throws {Error} If `buffer` is not a valid buffer\n */\nReader.create = create();\n\nReader.prototype._slice = util.Array.prototype.subarray || /* istanbul ignore next */ util.Array.prototype.slice;\n\n/**\n * Reads a varint as an unsigned 32 bit value.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.uint32 = (function read_uint32_setup() {\n    var value = 4294967295; // optimizer type-hint, tends to deopt otherwise (?!)\n    return function read_uint32() {\n        value = (         this.buf[this.pos] & 127       ) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) <<  7) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) << 14) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] & 127) << 21) >>> 0; if (this.buf[this.pos++] < 128) return value;\n        value = (value | (this.buf[this.pos] &  15) << 28) >>> 0; if (this.buf[this.pos++] < 128) return value;\n\n        /* istanbul ignore if */\n        if ((this.pos += 5) > this.len) {\n            this.pos = this.len;\n            throw indexOutOfRange(this, 10);\n        }\n        return value;\n    };\n})();\n\n/**\n * Reads a varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.int32 = function read_int32() {\n    return this.uint32() | 0;\n};\n\n/**\n * Reads a zig-zag encoded varint as a signed 32 bit value.\n * @returns {number} Value read\n */\nReader.prototype.sint32 = function read_sint32() {\n    var value = this.uint32();\n    return value >>> 1 ^ -(value & 1) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readLongVarint() {\n    // tends to deopt with local vars for octet etc.\n    var bits = new LongBits(0, 0);\n    var i = 0;\n    if (this.len - this.pos > 4) { // fast route (lo)\n        for (; i < 4; ++i) {\n            // 1st..4th\n            bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n        // 5th\n        bits.lo = (bits.lo | (this.buf[this.pos] & 127) << 28) >>> 0;\n        bits.hi = (bits.hi | (this.buf[this.pos] & 127) >>  4) >>> 0;\n        if (this.buf[this.pos++] < 128)\n            return bits;\n        i = 0;\n    } else {\n        for (; i < 3; ++i) {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n            // 1st..3th\n            bits.lo = (bits.lo | (this.buf[this.pos] & 127) << i * 7) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n        // 4th\n        bits.lo = (bits.lo | (this.buf[this.pos++] & 127) << i * 7) >>> 0;\n        return bits;\n    }\n    if (this.len - this.pos > 4) { // fast route (hi)\n        for (; i < 5; ++i) {\n            // 6th..10th\n            bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n    } else {\n        for (; i < 5; ++i) {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n            // 6th..10th\n            bits.hi = (bits.hi | (this.buf[this.pos] & 127) << i * 7 + 3) >>> 0;\n            if (this.buf[this.pos++] < 128)\n                return bits;\n        }\n    }\n    /* istanbul ignore next */\n    throw Error(\"invalid varint encoding\");\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads a varint as a signed 64 bit value.\n * @name Reader#int64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as an unsigned 64 bit value.\n * @name Reader#uint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a zig-zag encoded varint as a signed 64 bit value.\n * @name Reader#sint64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a varint as a boolean.\n * @returns {boolean} Value read\n */\nReader.prototype.bool = function read_bool() {\n    return this.uint32() !== 0;\n};\n\nfunction readFixed32_end(buf, end) { // note that this uses `end`, not `pos`\n    return (buf[end - 4]\n          | buf[end - 3] << 8\n          | buf[end - 2] << 16\n          | buf[end - 1] << 24) >>> 0;\n}\n\n/**\n * Reads fixed 32 bits as an unsigned 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.fixed32 = function read_fixed32() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    return readFixed32_end(this.buf, this.pos += 4);\n};\n\n/**\n * Reads fixed 32 bits as a signed 32 bit integer.\n * @returns {number} Value read\n */\nReader.prototype.sfixed32 = function read_sfixed32() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    return readFixed32_end(this.buf, this.pos += 4) | 0;\n};\n\n/* eslint-disable no-invalid-this */\n\nfunction readFixed64(/* this: Reader */) {\n\n    /* istanbul ignore if */\n    if (this.pos + 8 > this.len)\n        throw indexOutOfRange(this, 8);\n\n    return new LongBits(readFixed32_end(this.buf, this.pos += 4), readFixed32_end(this.buf, this.pos += 4));\n}\n\n/* eslint-enable no-invalid-this */\n\n/**\n * Reads fixed 64 bits.\n * @name Reader#fixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads zig-zag encoded fixed 64 bits.\n * @name Reader#sfixed64\n * @function\n * @returns {Long} Value read\n */\n\n/**\n * Reads a float (32 bit) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.float = function read_float() {\n\n    /* istanbul ignore if */\n    if (this.pos + 4 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    var value = util.float.readFloatLE(this.buf, this.pos);\n    this.pos += 4;\n    return value;\n};\n\n/**\n * Reads a double (64 bit float) as a number.\n * @function\n * @returns {number} Value read\n */\nReader.prototype.double = function read_double() {\n\n    /* istanbul ignore if */\n    if (this.pos + 8 > this.len)\n        throw indexOutOfRange(this, 4);\n\n    var value = util.float.readDoubleLE(this.buf, this.pos);\n    this.pos += 8;\n    return value;\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @returns {Uint8Array} Value read\n */\nReader.prototype.bytes = function read_bytes() {\n    var length = this.uint32(),\n        start  = this.pos,\n        end    = this.pos + length;\n\n    /* istanbul ignore if */\n    if (end > this.len)\n        throw indexOutOfRange(this, length);\n\n    this.pos += length;\n    if (Array.isArray(this.buf)) // plain array\n        return this.buf.slice(start, end);\n\n    if (start === end) { // fix for IE 10/Win8 and others' subarray returning array of size 1\n        var nativeBuffer = util.Buffer;\n        return nativeBuffer\n            ? nativeBuffer.alloc(0)\n            : new this.buf.constructor(0);\n    }\n    return this._slice.call(this.buf, start, end);\n};\n\n/**\n * Reads a string preceeded by its byte length as a varint.\n * @returns {string} Value read\n */\nReader.prototype.string = function read_string() {\n    var bytes = this.bytes();\n    return utf8.read(bytes, 0, bytes.length);\n};\n\n/**\n * Skips the specified number of bytes if specified, otherwise skips a varint.\n * @param {number} [length] Length if known, otherwise a varint is assumed\n * @returns {Reader} `this`\n */\nReader.prototype.skip = function skip(length) {\n    if (typeof length === \"number\") {\n        /* istanbul ignore if */\n        if (this.pos + length > this.len)\n            throw indexOutOfRange(this, length);\n        this.pos += length;\n    } else {\n        do {\n            /* istanbul ignore if */\n            if (this.pos >= this.len)\n                throw indexOutOfRange(this);\n        } while (this.buf[this.pos++] & 128);\n    }\n    return this;\n};\n\n/**\n * Skips the next element of the specified wire type.\n * @param {number} wireType Wire type received\n * @returns {Reader} `this`\n */\nReader.prototype.skipType = function(wireType) {\n    switch (wireType) {\n        case 0:\n            this.skip();\n            break;\n        case 1:\n            this.skip(8);\n            break;\n        case 2:\n            this.skip(this.uint32());\n            break;\n        case 3:\n            while ((wireType = this.uint32() & 7) !== 4) {\n                this.skipType(wireType);\n            }\n            break;\n        case 5:\n            this.skip(4);\n            break;\n\n        /* istanbul ignore next */\n        default:\n            throw Error(\"invalid wire type \" + wireType + \" at offset \" + this.pos);\n    }\n    return this;\n};\n\nReader._configure = function(BufferReader_) {\n    BufferReader = BufferReader_;\n    Reader.create = create();\n    BufferReader._configure();\n\n    var fn = util.Long ? \"toLong\" : /* istanbul ignore next */ \"toNumber\";\n    util.merge(Reader.prototype, {\n\n        int64: function read_int64() {\n            return readLongVarint.call(this)[fn](false);\n        },\n\n        uint64: function read_uint64() {\n            return readLongVarint.call(this)[fn](true);\n        },\n\n        sint64: function read_sint64() {\n            return readLongVarint.call(this).zzDecode()[fn](false);\n        },\n\n        fixed64: function read_fixed64() {\n            return readFixed64.call(this)[fn](true);\n        },\n\n        sfixed64: function read_sfixed64() {\n            return readFixed64.call(this)[fn](false);\n        }\n\n    });\n};\n"
  },
  {
    "path": "src/reader_buffer.js",
    "content": "\"use strict\";\nmodule.exports = BufferReader;\n\n// extends Reader\nvar Reader = require(\"./reader\");\n(BufferReader.prototype = Object.create(Reader.prototype)).constructor = BufferReader;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer reader instance.\n * @classdesc Wire format reader using node buffers.\n * @extends Reader\n * @constructor\n * @param {Buffer} buffer Buffer to read from\n */\nfunction BufferReader(buffer) {\n    Reader.call(this, buffer);\n\n    /**\n     * Read buffer.\n     * @name BufferReader#buf\n     * @type {Buffer}\n     */\n}\n\nBufferReader._configure = function () {\n    /* istanbul ignore else */\n    if (util.Buffer)\n        BufferReader.prototype._slice = util.Buffer.prototype.slice;\n};\n\n\n/**\n * @override\n */\nBufferReader.prototype.string = function read_string_buffer() {\n    var len = this.uint32(); // modifies pos\n    return this.buf.utf8Slice\n        ? this.buf.utf8Slice(this.pos, this.pos = Math.min(this.pos + len, this.len))\n        : this.buf.toString(\"utf-8\", this.pos, this.pos = Math.min(this.pos + len, this.len));\n};\n\n/**\n * Reads a sequence of bytes preceeded by its length as a varint.\n * @name BufferReader#bytes\n * @function\n * @returns {Buffer} Value read\n */\n\nBufferReader._configure();\n"
  },
  {
    "path": "src/root.js",
    "content": "\"use strict\";\nmodule.exports = Root;\n\n// extends Namespace\nvar Namespace = require(\"./namespace\");\n((Root.prototype = Object.create(Namespace.prototype)).constructor = Root).className = \"Root\";\n\nvar Field   = require(\"./field\"),\n    Enum    = require(\"./enum\"),\n    OneOf   = require(\"./oneof\"),\n    util    = require(\"./util\");\n\nvar Type,   // cyclic\n    parse,  // might be excluded\n    common; // \"\n\n/**\n * Constructs a new root namespace instance.\n * @classdesc Root namespace wrapping all types, enums, services, sub-namespaces etc. that belong together.\n * @extends NamespaceBase\n * @constructor\n * @param {Object.<string,*>} [options] Top level options\n */\nfunction Root(options) {\n    Namespace.call(this, \"\", options);\n\n    /**\n     * Deferred extension fields.\n     * @type {Field[]}\n     */\n    this.deferred = [];\n\n    /**\n     * Resolved file names of loaded files.\n     * @type {string[]}\n     */\n    this.files = [];\n\n    /**\n     * Edition, defaults to proto2 if unspecified.\n     * @type {string}\n     * @private\n     */\n    this._edition = \"proto2\";\n\n    /**\n     * Global lookup cache of fully qualified names.\n     * @type {Object.<string,ReflectionObject>}\n     * @private\n     */\n    this._fullyQualifiedObjects = {};\n}\n\n/**\n * Loads a namespace descriptor into a root namespace.\n * @param {INamespace} json Namespace descriptor\n * @param {Root} [root] Root namespace, defaults to create a new one if omitted\n * @returns {Root} Root namespace\n */\nRoot.fromJSON = function fromJSON(json, root) {\n    if (!root)\n        root = new Root();\n    if (json.options)\n        root.setOptions(json.options);\n    return root.addJSON(json.nested).resolveAll();\n};\n\n/**\n * Resolves the path of an imported file, relative to the importing origin.\n * This method exists so you can override it with your own logic in case your imports are scattered over multiple directories.\n * @function\n * @param {string} origin The file name of the importing file\n * @param {string} target The file name being imported\n * @returns {string|null} Resolved path to `target` or `null` to skip the file\n */\nRoot.prototype.resolvePath = util.path.resolve;\n\n/**\n * Fetch content from file path or url\n * This method exists so you can override it with your own logic.\n * @function\n * @param {string} path File path or url\n * @param {FetchCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.fetch = util.fetch;\n\n// A symbol-like function to safely signal synchronous loading\n/* istanbul ignore next */\nfunction SYNC() {} // eslint-disable-line no-empty-function\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} options Parse options\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n */\nRoot.prototype.load = function load(filename, options, callback) {\n    if (typeof options === \"function\") {\n        callback = options;\n        options = undefined;\n    }\n    var self = this;\n    if (!callback) {\n        return util.asPromise(load, self, filename, options);\n    }\n\n    var sync = callback === SYNC; // undocumented\n\n    // Finishes loading by calling the callback (exactly once)\n    function finish(err, root) {\n        /* istanbul ignore if */\n        if (!callback) {\n            return;\n        }\n        if (sync) {\n            throw err;\n        }\n        if (root) {\n            root.resolveAll();\n        }\n        var cb = callback;\n        callback = null;\n        cb(err, root);\n    }\n\n    // Bundled definition existence checking\n    function getBundledFileName(filename) {\n        var idx = filename.lastIndexOf(\"google/protobuf/\");\n        if (idx > -1) {\n            var altname = filename.substring(idx);\n            if (altname in common) return altname;\n        }\n        return null;\n    }\n\n    // Processes a single file\n    function process(filename, source) {\n        try {\n            if (util.isString(source) && source.charAt(0) === \"{\")\n                source = JSON.parse(source);\n            if (!util.isString(source))\n                self.setOptions(source.options).addJSON(source.nested);\n            else {\n                parse.filename = filename;\n                var parsed = parse(source, self, options),\n                    resolved,\n                    i = 0;\n                if (parsed.imports)\n                    for (; i < parsed.imports.length; ++i)\n                        if (resolved = getBundledFileName(parsed.imports[i]) || self.resolvePath(filename, parsed.imports[i]))\n                            fetch(resolved);\n                if (parsed.weakImports)\n                    for (i = 0; i < parsed.weakImports.length; ++i)\n                        if (resolved = getBundledFileName(parsed.weakImports[i]) || self.resolvePath(filename, parsed.weakImports[i]))\n                            fetch(resolved, true);\n            }\n        } catch (err) {\n            finish(err);\n        }\n        if (!sync && !queued) {\n            finish(null, self); // only once anyway\n        }\n    }\n\n    // Fetches a single file\n    function fetch(filename, weak) {\n        filename = getBundledFileName(filename) || filename;\n\n        // Skip if already loaded / attempted\n        if (self.files.indexOf(filename) > -1) {\n            return;\n        }\n        self.files.push(filename);\n\n        // Shortcut bundled definitions\n        if (filename in common) {\n            if (sync) {\n                process(filename, common[filename]);\n            } else {\n                ++queued;\n                setTimeout(function() {\n                    --queued;\n                    process(filename, common[filename]);\n                });\n            }\n            return;\n        }\n\n        // Otherwise fetch from disk or network\n        if (sync) {\n            var source;\n            try {\n                source = util.fs.readFileSync(filename).toString(\"utf8\");\n            } catch (err) {\n                if (!weak)\n                    finish(err);\n                return;\n            }\n            process(filename, source);\n        } else {\n            ++queued;\n            self.fetch(filename, function(err, source) {\n                --queued;\n                /* istanbul ignore if */\n                if (!callback) {\n                    return; // terminated meanwhile\n                }\n                if (err) {\n                    /* istanbul ignore else */\n                    if (!weak)\n                        finish(err);\n                    else if (!queued) // can't be covered reliably\n                        finish(null, self);\n                    return;\n                }\n                process(filename, source);\n            });\n        }\n    }\n    var queued = 0;\n\n    // Assembling the root namespace doesn't require working type\n    // references anymore, so we can load everything in parallel\n    if (util.isString(filename)) {\n        filename = [ filename ];\n    }\n    for (var i = 0, resolved; i < filename.length; ++i)\n        if (resolved = self.resolvePath(\"\", filename[i]))\n            fetch(resolved);\n    if (sync) {\n        self.resolveAll();\n        return self;\n    }\n    if (!queued) {\n        finish(null, self);\n    }\n\n    return self;\n};\n// function load(filename:string, options:IParseOptions, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and calls the callback.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {LoadCallback} callback Callback function\n * @returns {undefined}\n * @variation 2\n */\n// function load(filename:string, callback:LoadCallback):undefined\n\n/**\n * Loads one or multiple .proto or preprocessed .json files into this root namespace and returns a promise.\n * @function Root#load\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Promise<Root>} Promise\n * @variation 3\n */\n// function load(filename:string, [options:IParseOptions]):Promise<Root>\n\n/**\n * Synchronously loads one or multiple .proto or preprocessed .json files into this root namespace (node only).\n * @function Root#loadSync\n * @param {string|string[]} filename Names of one or multiple files to load\n * @param {IParseOptions} [options] Parse options. Defaults to {@link parse.defaults} when omitted.\n * @returns {Root} Root namespace\n * @throws {Error} If synchronous fetching is not supported (i.e. in browsers) or if a file's syntax is invalid\n */\nRoot.prototype.loadSync = function loadSync(filename, options) {\n    if (!util.isNode)\n        throw Error(\"not supported\");\n    return this.load(filename, options, SYNC);\n};\n\n/**\n * @override\n */\nRoot.prototype.resolveAll = function resolveAll() {\n    if (!this._needsRecursiveResolve) return this;\n\n    if (this.deferred.length)\n        throw Error(\"unresolvable extensions: \" + this.deferred.map(function(field) {\n            return \"'extend \" + field.extend + \"' in \" + field.parent.fullName;\n        }).join(\", \"));\n    return Namespace.prototype.resolveAll.call(this);\n};\n\n// only uppercased (and thus conflict-free) children are exposed, see below\nvar exposeRe = /^[A-Z]/;\n\n/**\n * Handles a deferred declaring extension field by creating a sister field to represent it within its extended type.\n * @param {Root} root Root instance\n * @param {Field} field Declaring extension field witin the declaring type\n * @returns {boolean} `true` if successfully added to the extended type, `false` otherwise\n * @inner\n * @ignore\n */\nfunction tryHandleExtension(root, field) {\n    var extendedType = field.parent.lookup(field.extend);\n    if (extendedType) {\n        var sisterField = new Field(field.fullName, field.id, field.type, field.rule, undefined, field.options);\n        //do not allow to extend same field twice to prevent the error\n        if (extendedType.get(sisterField.name)) {\n            return true;\n        }\n        sisterField.declaringField = field;\n        field.extensionField = sisterField;\n        extendedType.add(sisterField);\n        return true;\n    }\n    return false;\n}\n\n/**\n * Called when any object is added to this root or its sub-namespaces.\n * @param {ReflectionObject} object Object added\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleAdd = function _handleAdd(object) {\n    if (object instanceof Field) {\n\n        if (/* an extension field (implies not part of a oneof) */ object.extend !== undefined && /* not already handled */ !object.extensionField)\n            if (!tryHandleExtension(this, object))\n                this.deferred.push(object);\n\n    } else if (object instanceof Enum) {\n\n        if (exposeRe.test(object.name))\n            object.parent[object.name] = object.values; // expose enum values as property of its parent\n\n    } else if (!(object instanceof OneOf)) /* everything else is a namespace */ {\n\n        if (object instanceof Type) // Try to handle any deferred extensions\n            for (var i = 0; i < this.deferred.length;)\n                if (tryHandleExtension(this, this.deferred[i]))\n                    this.deferred.splice(i, 1);\n                else\n                    ++i;\n        for (var j = 0; j < /* initializes */ object.nestedArray.length; ++j) // recurse into the namespace\n            this._handleAdd(object._nestedArray[j]);\n        if (exposeRe.test(object.name))\n            object.parent[object.name] = object; // expose namespace as property of its parent\n    }\n\n    if (object instanceof Type || object instanceof Enum || object instanceof Field) {\n        // Only store types and enums for quick lookup during resolve.\n        this._fullyQualifiedObjects[object.fullName] = object;\n    }\n\n    // The above also adds uppercased (and thus conflict-free) nested types, services and enums as\n    // properties of namespaces just like static code does. This allows using a .d.ts generated for\n    // a static module with reflection-based solutions where the condition is met.\n};\n\n/**\n * Called when any object is removed from this root or its sub-namespaces.\n * @param {ReflectionObject} object Object removed\n * @returns {undefined}\n * @private\n */\nRoot.prototype._handleRemove = function _handleRemove(object) {\n    if (object instanceof Field) {\n\n        if (/* an extension field */ object.extend !== undefined) {\n            if (/* already handled */ object.extensionField) { // remove its sister field\n                object.extensionField.parent.remove(object.extensionField);\n                object.extensionField = null;\n            } else { // cancel the extension\n                var index = this.deferred.indexOf(object);\n                /* istanbul ignore else */\n                if (index > -1)\n                    this.deferred.splice(index, 1);\n            }\n        }\n\n    } else if (object instanceof Enum) {\n\n        if (exposeRe.test(object.name))\n            delete object.parent[object.name]; // unexpose enum values\n\n    } else if (object instanceof Namespace) {\n\n        for (var i = 0; i < /* initializes */ object.nestedArray.length; ++i) // recurse into the namespace\n            this._handleRemove(object._nestedArray[i]);\n\n        if (exposeRe.test(object.name))\n            delete object.parent[object.name]; // unexpose namespaces\n\n    }\n\n    delete this._fullyQualifiedObjects[object.fullName];\n};\n\n// Sets up cyclic dependencies (called in index-light)\nRoot._configure = function(Type_, parse_, common_) {\n    Type   = Type_;\n    parse  = parse_;\n    common = common_;\n};\n"
  },
  {
    "path": "src/roots.js",
    "content": "\"use strict\";\nmodule.exports = {};\n\n/**\n * Named roots.\n * This is where pbjs stores generated structures (the option `-r, --root` specifies a name).\n * Can also be used manually to make roots available across modules.\n * @name roots\n * @type {Object.<string,Root>}\n * @example\n * // pbjs -r myroot -o compiled.js ...\n *\n * // in another module:\n * require(\"./compiled.js\");\n *\n * // in any subsequent module:\n * var root = protobuf.roots[\"myroot\"];\n */\n"
  },
  {
    "path": "src/rpc/service.js",
    "content": "\"use strict\";\nmodule.exports = Service;\n\nvar util = require(\"../util/minimal\");\n\n// Extends EventEmitter\n(Service.prototype = Object.create(util.EventEmitter.prototype)).constructor = Service;\n\n/**\n * A service method callback as used by {@link rpc.ServiceMethod|ServiceMethod}.\n *\n * Differs from {@link RPCImplCallback} in that it is an actual callback of a service method which may not return `response = null`.\n * @typedef rpc.ServiceMethodCallback\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {Error|null} error Error, if any\n * @param {TRes} [response] Response message\n * @returns {undefined}\n */\n\n/**\n * A service method part of a {@link rpc.Service} as created by {@link Service.create}.\n * @typedef rpc.ServiceMethod\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n * @type {function}\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} [callback] Node-style callback called with the error, if any, and the response message\n * @returns {Promise<Message<TRes>>} Promise if `callback` has been omitted, otherwise `undefined`\n */\n\n/**\n * Constructs a new RPC service instance.\n * @classdesc An RPC service as returned by {@link Service#create}.\n * @exports rpc.Service\n * @extends util.EventEmitter\n * @constructor\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n */\nfunction Service(rpcImpl, requestDelimited, responseDelimited) {\n\n    if (typeof rpcImpl !== \"function\")\n        throw TypeError(\"rpcImpl must be a function\");\n\n    util.EventEmitter.call(this);\n\n    /**\n     * RPC implementation. Becomes `null` once the service is ended.\n     * @type {RPCImpl|null}\n     */\n    this.rpcImpl = rpcImpl;\n\n    /**\n     * Whether requests are length-delimited.\n     * @type {boolean}\n     */\n    this.requestDelimited = Boolean(requestDelimited);\n\n    /**\n     * Whether responses are length-delimited.\n     * @type {boolean}\n     */\n    this.responseDelimited = Boolean(responseDelimited);\n}\n\n/**\n * Calls a service method through {@link rpc.Service#rpcImpl|rpcImpl}.\n * @param {Method|rpc.ServiceMethod<TReq,TRes>} method Reflected or static method\n * @param {Constructor<TReq>} requestCtor Request constructor\n * @param {Constructor<TRes>} responseCtor Response constructor\n * @param {TReq|Properties<TReq>} request Request message or plain object\n * @param {rpc.ServiceMethodCallback<TRes>} callback Service callback\n * @returns {undefined}\n * @template TReq extends Message<TReq>\n * @template TRes extends Message<TRes>\n */\nService.prototype.rpcCall = function rpcCall(method, requestCtor, responseCtor, request, callback) {\n\n    if (!request)\n        throw TypeError(\"request must be specified\");\n\n    var self = this;\n    if (!callback)\n        return util.asPromise(rpcCall, self, method, requestCtor, responseCtor, request);\n\n    if (!self.rpcImpl) {\n        setTimeout(function() { callback(Error(\"already ended\")); }, 0);\n        return undefined;\n    }\n\n    try {\n        return self.rpcImpl(\n            method,\n            requestCtor[self.requestDelimited ? \"encodeDelimited\" : \"encode\"](request).finish(),\n            function rpcCallback(err, response) {\n\n                if (err) {\n                    self.emit(\"error\", err, method);\n                    return callback(err);\n                }\n\n                if (response === null) {\n                    self.end(/* endedByRPC */ true);\n                    return undefined;\n                }\n\n                if (!(response instanceof responseCtor)) {\n                    try {\n                        response = responseCtor[self.responseDelimited ? \"decodeDelimited\" : \"decode\"](response);\n                    } catch (err) {\n                        self.emit(\"error\", err, method);\n                        return callback(err);\n                    }\n                }\n\n                self.emit(\"data\", response, method);\n                return callback(null, response);\n            }\n        );\n    } catch (err) {\n        self.emit(\"error\", err, method);\n        setTimeout(function() { callback(err); }, 0);\n        return undefined;\n    }\n};\n\n/**\n * Ends this service and emits the `end` event.\n * @param {boolean} [endedByRPC=false] Whether the service has been ended by the RPC implementation.\n * @returns {rpc.Service} `this`\n */\nService.prototype.end = function end(endedByRPC) {\n    if (this.rpcImpl) {\n        if (!endedByRPC) // signal end to rpcImpl\n            this.rpcImpl(null, null, null);\n        this.rpcImpl = null;\n        this.emit(\"end\").off();\n    }\n    return this;\n};\n"
  },
  {
    "path": "src/rpc.js",
    "content": "\"use strict\";\n\n/**\n * Streaming RPC helpers.\n * @namespace\n */\nvar rpc = exports;\n\n/**\n * RPC implementation passed to {@link Service#create} performing a service request on network level, i.e. by utilizing http requests or websockets.\n * @typedef RPCImpl\n * @type {function}\n * @param {Method|rpc.ServiceMethod<Message<{}>,Message<{}>>} method Reflected or static method being called\n * @param {Uint8Array} requestData Request data\n * @param {RPCImplCallback} callback Callback function\n * @returns {undefined}\n * @example\n * function rpcImpl(method, requestData, callback) {\n *     if (protobuf.util.lcFirst(method.name) !== \"myMethod\") // compatible with static code\n *         throw Error(\"no such method\");\n *     asynchronouslyObtainAResponse(requestData, function(err, responseData) {\n *         callback(err, responseData);\n *     });\n * }\n */\n\n/**\n * Node-style callback as used by {@link RPCImpl}.\n * @typedef RPCImplCallback\n * @type {function}\n * @param {Error|null} error Error, if any, otherwise `null`\n * @param {Uint8Array|null} [response] Response data or `null` to signal end of stream, if there hasn't been an error\n * @returns {undefined}\n */\n\nrpc.Service = require(\"./rpc/service\");\n"
  },
  {
    "path": "src/service.js",
    "content": "\"use strict\";\nmodule.exports = Service;\n\n// extends Namespace\nvar Namespace = require(\"./namespace\");\n((Service.prototype = Object.create(Namespace.prototype)).constructor = Service).className = \"Service\";\n\nvar Method = require(\"./method\"),\n    util   = require(\"./util\"),\n    rpc    = require(\"./rpc\");\n\n/**\n * Constructs a new service instance.\n * @classdesc Reflected service.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Service name\n * @param {Object.<string,*>} [options] Service options\n * @throws {TypeError} If arguments are invalid\n */\nfunction Service(name, options) {\n    Namespace.call(this, name, options);\n\n    /**\n     * Service methods.\n     * @type {Object.<string,Method>}\n     */\n    this.methods = {}; // toJSON, marker\n\n    /**\n     * Cached methods as an array.\n     * @type {Method[]|null}\n     * @private\n     */\n    this._methodsArray = null;\n}\n\n/**\n * Service descriptor.\n * @interface IService\n * @extends INamespace\n * @property {Object.<string,IMethod>} methods Method descriptors\n */\n\n/**\n * Constructs a service from a service descriptor.\n * @param {string} name Service name\n * @param {IService} json Service descriptor\n * @returns {Service} Created service\n * @throws {TypeError} If arguments are invalid\n */\nService.fromJSON = function fromJSON(name, json) {\n    var service = new Service(name, json.options);\n    /* istanbul ignore else */\n    if (json.methods)\n        for (var names = Object.keys(json.methods), i = 0; i < names.length; ++i)\n            service.add(Method.fromJSON(names[i], json.methods[names[i]]));\n    if (json.nested)\n        service.addJSON(json.nested);\n    if (json.edition)\n        service._edition = json.edition;\n    service.comment = json.comment;\n    service._defaultEdition = \"proto3\";  // For backwards-compatibility.\n    return service;\n};\n\n/**\n * Converts this service to a service descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IService} Service descriptor\n */\nService.prototype.toJSON = function toJSON(toJSONOptions) {\n    var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"edition\" , this._editionToJSON(),\n        \"options\" , inherited && inherited.options || undefined,\n        \"methods\" , Namespace.arrayToJSON(this.methodsArray, toJSONOptions) || /* istanbul ignore next */ {},\n        \"nested\"  , inherited && inherited.nested || undefined,\n        \"comment\" , keepComments ? this.comment : undefined\n    ]);\n};\n\n/**\n * Methods of this service as an array for iteration.\n * @name Service#methodsArray\n * @type {Method[]}\n * @readonly\n */\nObject.defineProperty(Service.prototype, \"methodsArray\", {\n    get: function() {\n        return this._methodsArray || (this._methodsArray = util.toArray(this.methods));\n    }\n});\n\nfunction clearCache(service) {\n    service._methodsArray = null;\n    return service;\n}\n\n/**\n * @override\n */\nService.prototype.get = function get(name) {\n    return this.methods[name]\n        || Namespace.prototype.get.call(this, name);\n};\n\n/**\n * @override\n */\nService.prototype.resolveAll = function resolveAll() {\n    if (!this._needsRecursiveResolve) return this;\n\n    Namespace.prototype.resolve.call(this);\n    var methods = this.methodsArray;\n    for (var i = 0; i < methods.length; ++i)\n        methods[i].resolve();\n    return this;\n};\n\n/**\n * @override\n */\nService.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n    if (!this._needsRecursiveFeatureResolution) return this;\n\n    edition = this._edition || edition;\n\n    Namespace.prototype._resolveFeaturesRecursive.call(this, edition);\n    this.methodsArray.forEach(method => {\n        method._resolveFeaturesRecursive(edition);\n    });\n    return this;\n};\n\n/**\n * @override\n */\nService.prototype.add = function add(object) {\n\n    /* istanbul ignore if */\n    if (this.get(object.name))\n        throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n    if (object instanceof Method) {\n        this.methods[object.name] = object;\n        object.parent = this;\n        return clearCache(this);\n    }\n    return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * @override\n */\nService.prototype.remove = function remove(object) {\n    if (object instanceof Method) {\n\n        /* istanbul ignore if */\n        if (this.methods[object.name] !== object)\n            throw Error(object + \" is not a member of \" + this);\n\n        delete this.methods[object.name];\n        object.parent = null;\n        return clearCache(this);\n    }\n    return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Creates a runtime service using the specified rpc implementation.\n * @param {RPCImpl} rpcImpl RPC implementation\n * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n * @returns {rpc.Service} RPC service. Useful where requests and/or responses are streamed.\n */\nService.prototype.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n    var rpcService = new rpc.Service(rpcImpl, requestDelimited, responseDelimited);\n    for (var i = 0, method; i < /* initializes */ this.methodsArray.length; ++i) {\n        var methodName = util.lcFirst((method = this._methodsArray[i]).resolve().name).replace(/[^$\\w_]/g, \"\");\n        rpcService[methodName] = util.codegen([\"r\",\"c\"], util.isReserved(methodName) ? methodName + \"_\" : methodName)(\"return this.rpcCall(m,q,s,r,c)\")({\n            m: method,\n            q: method.resolvedRequestType.ctor,\n            s: method.resolvedResponseType.ctor\n        });\n    }\n    return rpcService;\n};\n"
  },
  {
    "path": "src/tokenize.js",
    "content": "\"use strict\";\nmodule.exports = tokenize;\n\nvar delimRe        = /[\\s{}=;:[\\],'\"()<>]/g,\n    stringDoubleRe = /(?:\"([^\"\\\\]*(?:\\\\.[^\"\\\\]*)*)\")/g,\n    stringSingleRe = /(?:'([^'\\\\]*(?:\\\\.[^'\\\\]*)*)')/g;\n\nvar setCommentRe = /^ *[*/]+ */,\n    setCommentAltRe = /^\\s*\\*?\\/*/,\n    setCommentSplitRe = /\\n/g,\n    whitespaceRe = /\\s/,\n    unescapeRe = /\\\\(.?)/g;\n\nvar unescapeMap = {\n    \"0\": \"\\0\",\n    \"r\": \"\\r\",\n    \"n\": \"\\n\",\n    \"t\": \"\\t\"\n};\n\n/**\n * Unescapes a string.\n * @param {string} str String to unescape\n * @returns {string} Unescaped string\n * @property {Object.<string,string>} map Special characters map\n * @memberof tokenize\n */\nfunction unescape(str) {\n    return str.replace(unescapeRe, function($0, $1) {\n        switch ($1) {\n            case \"\\\\\":\n            case \"\":\n                return $1;\n            default:\n                return unescapeMap[$1] || \"\";\n        }\n    });\n}\n\ntokenize.unescape = unescape;\n\n/**\n * Gets the next token and advances.\n * @typedef TokenizerHandleNext\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Peeks for the next token.\n * @typedef TokenizerHandlePeek\n * @type {function}\n * @returns {string|null} Next token or `null` on eof\n */\n\n/**\n * Pushes a token back to the stack.\n * @typedef TokenizerHandlePush\n * @type {function}\n * @param {string} token Token\n * @returns {undefined}\n */\n\n/**\n * Skips the next token.\n * @typedef TokenizerHandleSkip\n * @type {function}\n * @param {string} expected Expected token\n * @param {boolean} [optional=false] If optional\n * @returns {boolean} Whether the token matched\n * @throws {Error} If the token didn't match and is not optional\n */\n\n/**\n * Gets the comment on the previous line or, alternatively, the line comment on the specified line.\n * @typedef TokenizerHandleCmnt\n * @type {function}\n * @param {number} [line] Line number\n * @returns {string|null} Comment text or `null` if none\n */\n\n/**\n * Handle object returned from {@link tokenize}.\n * @interface ITokenizerHandle\n * @property {TokenizerHandleNext} next Gets the next token and advances (`null` on eof)\n * @property {TokenizerHandlePeek} peek Peeks for the next token (`null` on eof)\n * @property {TokenizerHandlePush} push Pushes a token back to the stack\n * @property {TokenizerHandleSkip} skip Skips a token, returns its presence and advances or, if non-optional and not present, throws\n * @property {TokenizerHandleCmnt} cmnt Gets the comment on the previous line or the line comment on the specified line, if any\n * @property {number} line Current line number\n */\n\n/**\n * Tokenizes the given .proto source and returns an object with useful utility functions.\n * @param {string} source Source contents\n * @param {boolean} alternateCommentMode Whether we should activate alternate comment parsing mode.\n * @returns {ITokenizerHandle} Tokenizer handle\n */\nfunction tokenize(source, alternateCommentMode) {\n    /* eslint-disable callback-return */\n    source = source.toString();\n\n    var offset = 0,\n        length = source.length,\n        line = 1,\n        lastCommentLine = 0,\n        comments = {};\n\n    var stack = [];\n\n    var stringDelim = null;\n\n    /* istanbul ignore next */\n    /**\n     * Creates an error for illegal syntax.\n     * @param {string} subject Subject\n     * @returns {Error} Error created\n     * @inner\n     */\n    function illegal(subject) {\n        return Error(\"illegal \" + subject + \" (line \" + line + \")\");\n    }\n\n    /**\n     * Reads a string till its end.\n     * @returns {string} String read\n     * @inner\n     */\n    function readString() {\n        var re = stringDelim === \"'\" ? stringSingleRe : stringDoubleRe;\n        re.lastIndex = offset - 1;\n        var match = re.exec(source);\n        if (!match)\n            throw illegal(\"string\");\n        offset = re.lastIndex;\n        push(stringDelim);\n        stringDelim = null;\n        return unescape(match[1]);\n    }\n\n    /**\n     * Gets the character at `pos` within the source.\n     * @param {number} pos Position\n     * @returns {string} Character\n     * @inner\n     */\n    function charAt(pos) {\n        return source.charAt(pos);\n    }\n\n    /**\n     * Sets the current comment text.\n     * @param {number} start Start offset\n     * @param {number} end End offset\n     * @param {boolean} isLeading set if a leading comment\n     * @returns {undefined}\n     * @inner\n     */\n    function setComment(start, end, isLeading) {\n        var comment = {\n            type: source.charAt(start++),\n            lineEmpty: false,\n            leading: isLeading,\n        };\n        var lookback;\n        if (alternateCommentMode) {\n            lookback = 2;  // alternate comment parsing: \"//\" or \"/*\"\n        } else {\n            lookback = 3;  // \"///\" or \"/**\"\n        }\n        var commentOffset = start - lookback,\n            c;\n        do {\n            if (--commentOffset < 0 ||\n                    (c = source.charAt(commentOffset)) === \"\\n\") {\n                comment.lineEmpty = true;\n                break;\n            }\n        } while (c === \" \" || c === \"\\t\");\n        var lines = source\n            .substring(start, end)\n            .split(setCommentSplitRe);\n        for (var i = 0; i < lines.length; ++i)\n            lines[i] = lines[i]\n                .replace(alternateCommentMode ? setCommentAltRe : setCommentRe, \"\")\n                .trim();\n        comment.text = lines\n            .join(\"\\n\")\n            .trim();\n\n        comments[line] = comment;\n        lastCommentLine = line;\n    }\n\n    function isDoubleSlashCommentLine(startOffset) {\n        var endOffset = findEndOfLine(startOffset);\n\n        // see if remaining line matches comment pattern\n        var lineText = source.substring(startOffset, endOffset);\n        var isComment = /^\\s*\\/\\//.test(lineText);\n        return isComment;\n    }\n\n    function findEndOfLine(cursor) {\n        // find end of cursor's line\n        var endOffset = cursor;\n        while (endOffset < length && charAt(endOffset) !== \"\\n\") {\n            endOffset++;\n        }\n        return endOffset;\n    }\n\n    /**\n     * Obtains the next token.\n     * @returns {string|null} Next token or `null` on eof\n     * @inner\n     */\n    function next() {\n        if (stack.length > 0)\n            return stack.shift();\n        if (stringDelim)\n            return readString();\n        var repeat,\n            prev,\n            curr,\n            start,\n            isDoc,\n            isLeadingComment = offset === 0;\n        do {\n            if (offset === length)\n                return null;\n            repeat = false;\n            while (whitespaceRe.test(curr = charAt(offset))) {\n                if (curr === \"\\n\") {\n                    isLeadingComment = true;\n                    ++line;\n                }\n                if (++offset === length)\n                    return null;\n            }\n\n            if (charAt(offset) === \"/\") {\n                if (++offset === length) {\n                    throw illegal(\"comment\");\n                }\n                if (charAt(offset) === \"/\") { // Line\n                    if (!alternateCommentMode) {\n                        // check for triple-slash comment\n                        isDoc = charAt(start = offset + 1) === \"/\";\n\n                        while (charAt(++offset) !== \"\\n\") {\n                            if (offset === length) {\n                                return null;\n                            }\n                        }\n                        ++offset;\n                        if (isDoc) {\n                            setComment(start, offset - 1, isLeadingComment);\n                            // Trailing comment cannot not be multi-line,\n                            // so leading comment state should be reset to handle potential next comments\n                            isLeadingComment = true;\n                        }\n                        ++line;\n                        repeat = true;\n                    } else {\n                        // check for double-slash comments, consolidating consecutive lines\n                        start = offset;\n                        isDoc = false;\n                        if (isDoubleSlashCommentLine(offset - 1)) {\n                            isDoc = true;\n                            do {\n                                offset = findEndOfLine(offset);\n                                if (offset === length) {\n                                    break;\n                                }\n                                offset++;\n                                if (!isLeadingComment) {\n                                    // Trailing comment cannot not be multi-line\n                                    break;\n                                }\n                            } while (isDoubleSlashCommentLine(offset));\n                        } else {\n                            offset = Math.min(length, findEndOfLine(offset) + 1);\n                        }\n                        if (isDoc) {\n                            setComment(start, offset, isLeadingComment);\n                            isLeadingComment = true;\n                        }\n                        line++;\n                        repeat = true;\n                    }\n                } else if ((curr = charAt(offset)) === \"*\") { /* Block */\n                    // check for /** (regular comment mode) or /* (alternate comment mode)\n                    start = offset + 1;\n                    isDoc = alternateCommentMode || charAt(start) === \"*\";\n                    do {\n                        if (curr === \"\\n\") {\n                            ++line;\n                        }\n                        if (++offset === length) {\n                            throw illegal(\"comment\");\n                        }\n                        prev = curr;\n                        curr = charAt(offset);\n                    } while (prev !== \"*\" || curr !== \"/\");\n                    ++offset;\n                    if (isDoc) {\n                        setComment(start, offset - 2, isLeadingComment);\n                        isLeadingComment = true;\n                    }\n                    repeat = true;\n                } else {\n                    return \"/\";\n                }\n            }\n        } while (repeat);\n\n        // offset !== length if we got here\n\n        var end = offset;\n        delimRe.lastIndex = 0;\n        var delim = delimRe.test(charAt(end++));\n        if (!delim)\n            while (end < length && !delimRe.test(charAt(end)))\n                ++end;\n        var token = source.substring(offset, offset = end);\n        if (token === \"\\\"\" || token === \"'\")\n            stringDelim = token;\n        return token;\n    }\n\n    /**\n     * Pushes a token back to the stack.\n     * @param {string} token Token\n     * @returns {undefined}\n     * @inner\n     */\n    function push(token) {\n        stack.push(token);\n    }\n\n    /**\n     * Peeks for the next token.\n     * @returns {string|null} Token or `null` on eof\n     * @inner\n     */\n    function peek() {\n        if (!stack.length) {\n            var token = next();\n            if (token === null)\n                return null;\n            push(token);\n        }\n        return stack[0];\n    }\n\n    /**\n     * Skips a token.\n     * @param {string} expected Expected token\n     * @param {boolean} [optional=false] Whether the token is optional\n     * @returns {boolean} `true` when skipped, `false` if not\n     * @throws {Error} When a required token is not present\n     * @inner\n     */\n    function skip(expected, optional) {\n        var actual = peek(),\n            equals = actual === expected;\n        if (equals) {\n            next();\n            return true;\n        }\n        if (!optional)\n            throw illegal(\"token '\" + actual + \"', '\" + expected + \"' expected\");\n        return false;\n    }\n\n    /**\n     * Gets a comment.\n     * @param {number} [trailingLine] Line number if looking for a trailing comment\n     * @returns {string|null} Comment text\n     * @inner\n     */\n    function cmnt(trailingLine) {\n        var ret = null;\n        var comment;\n        if (trailingLine === undefined) {\n            comment = comments[line - 1];\n            delete comments[line - 1];\n            if (comment && (alternateCommentMode || comment.type === \"*\" || comment.lineEmpty)) {\n                ret = comment.leading ? comment.text : null;\n            }\n        } else {\n            /* istanbul ignore else */\n            if (lastCommentLine < trailingLine) {\n                peek();\n            }\n            comment = comments[trailingLine];\n            delete comments[trailingLine];\n            if (comment && !comment.lineEmpty && (alternateCommentMode || comment.type === \"/\")) {\n                ret = comment.leading ? null : comment.text;\n            }\n        }\n        return ret;\n    }\n\n    return Object.defineProperty({\n        next: next,\n        peek: peek,\n        push: push,\n        skip: skip,\n        cmnt: cmnt\n    }, \"line\", {\n        get: function() { return line; }\n    });\n    /* eslint-enable callback-return */\n}\n"
  },
  {
    "path": "src/type.js",
    "content": "\"use strict\";\nmodule.exports = Type;\n\n// extends Namespace\nvar Namespace = require(\"./namespace\");\n((Type.prototype = Object.create(Namespace.prototype)).constructor = Type).className = \"Type\";\n\nvar Enum      = require(\"./enum\"),\n    OneOf     = require(\"./oneof\"),\n    Field     = require(\"./field\"),\n    MapField  = require(\"./mapfield\"),\n    Service   = require(\"./service\"),\n    Message   = require(\"./message\"),\n    Reader    = require(\"./reader\"),\n    Writer    = require(\"./writer\"),\n    util      = require(\"./util\"),\n    encoder   = require(\"./encoder\"),\n    decoder   = require(\"./decoder\"),\n    verifier  = require(\"./verifier\"),\n    converter = require(\"./converter\"),\n    wrappers  = require(\"./wrappers\");\n\n/**\n * Constructs a new reflected message type instance.\n * @classdesc Reflected message type.\n * @extends NamespaceBase\n * @constructor\n * @param {string} name Message name\n * @param {Object.<string,*>} [options] Declared options\n */\nfunction Type(name, options) {\n    name = name.replace(/\\W/g, \"\");\n    Namespace.call(this, name, options);\n\n    /**\n     * Message fields.\n     * @type {Object.<string,Field>}\n     */\n    this.fields = {};  // toJSON, marker\n\n    /**\n     * Oneofs declared within this namespace, if any.\n     * @type {Object.<string,OneOf>}\n     */\n    this.oneofs = undefined; // toJSON\n\n    /**\n     * Extension ranges, if any.\n     * @type {number[][]}\n     */\n    this.extensions = undefined; // toJSON\n\n    /**\n     * Reserved ranges, if any.\n     * @type {Array.<number[]|string>}\n     */\n    this.reserved = undefined; // toJSON\n\n    /*?\n     * Whether this type is a legacy group.\n     * @type {boolean|undefined}\n     */\n    this.group = undefined; // toJSON\n\n    /**\n     * Cached fields by id.\n     * @type {Object.<number,Field>|null}\n     * @private\n     */\n    this._fieldsById = null;\n\n    /**\n     * Cached fields as an array.\n     * @type {Field[]|null}\n     * @private\n     */\n    this._fieldsArray = null;\n\n    /**\n     * Cached oneofs as an array.\n     * @type {OneOf[]|null}\n     * @private\n     */\n    this._oneofsArray = null;\n\n    /**\n     * Cached constructor.\n     * @type {Constructor<{}>}\n     * @private\n     */\n    this._ctor = null;\n}\n\nObject.defineProperties(Type.prototype, {\n\n    /**\n     * Message fields by id.\n     * @name Type#fieldsById\n     * @type {Object.<number,Field>}\n     * @readonly\n     */\n    fieldsById: {\n        get: function() {\n\n            /* istanbul ignore if */\n            if (this._fieldsById)\n                return this._fieldsById;\n\n            this._fieldsById = {};\n            for (var names = Object.keys(this.fields), i = 0; i < names.length; ++i) {\n                var field = this.fields[names[i]],\n                    id = field.id;\n\n                /* istanbul ignore if */\n                if (this._fieldsById[id])\n                    throw Error(\"duplicate id \" + id + \" in \" + this);\n\n                this._fieldsById[id] = field;\n            }\n            return this._fieldsById;\n        }\n    },\n\n    /**\n     * Fields of this message as an array for iteration.\n     * @name Type#fieldsArray\n     * @type {Field[]}\n     * @readonly\n     */\n    fieldsArray: {\n        get: function() {\n            return this._fieldsArray || (this._fieldsArray = util.toArray(this.fields));\n        }\n    },\n\n    /**\n     * Oneofs of this message as an array for iteration.\n     * @name Type#oneofsArray\n     * @type {OneOf[]}\n     * @readonly\n     */\n    oneofsArray: {\n        get: function() {\n            return this._oneofsArray || (this._oneofsArray = util.toArray(this.oneofs));\n        }\n    },\n\n    /**\n     * The registered constructor, if any registered, otherwise a generic constructor.\n     * Assigning a function replaces the internal constructor. If the function does not extend {@link Message} yet, its prototype will be setup accordingly and static methods will be populated. If it already extends {@link Message}, it will just replace the internal constructor.\n     * @name Type#ctor\n     * @type {Constructor<{}>}\n     */\n    ctor: {\n        get: function() {\n            return this._ctor || (this.ctor = Type.generateConstructor(this)());\n        },\n        set: function(ctor) {\n\n            // Ensure proper prototype\n            var prototype = ctor.prototype;\n            if (!(prototype instanceof Message)) {\n                (ctor.prototype = new Message()).constructor = ctor;\n                util.merge(ctor.prototype, prototype);\n            }\n\n            // Classes and messages reference their reflected type\n            ctor.$type = ctor.prototype.$type = this;\n\n            // Mix in static methods\n            util.merge(ctor, Message, true);\n\n            this._ctor = ctor;\n\n            // Messages have non-enumerable default values on their prototype\n            var i = 0;\n            for (; i < /* initializes */ this.fieldsArray.length; ++i)\n                this._fieldsArray[i].resolve(); // ensures a proper value\n\n            // Messages have non-enumerable getters and setters for each virtual oneof field\n            var ctorProperties = {};\n            for (i = 0; i < /* initializes */ this.oneofsArray.length; ++i)\n                ctorProperties[this._oneofsArray[i].resolve().name] = {\n                    get: util.oneOfGetter(this._oneofsArray[i].oneof),\n                    set: util.oneOfSetter(this._oneofsArray[i].oneof)\n                };\n            if (i)\n                Object.defineProperties(ctor.prototype, ctorProperties);\n        }\n    }\n});\n\n/**\n * Generates a constructor function for the specified type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nType.generateConstructor = function generateConstructor(mtype) {\n    /* eslint-disable no-unexpected-multiline */\n    var gen = util.codegen([\"p\"], mtype.name);\n    // explicitly initialize mutable object/array fields so that these aren't just inherited from the prototype\n    for (var i = 0, field; i < mtype.fieldsArray.length; ++i)\n        if ((field = mtype._fieldsArray[i]).map) gen\n            (\"this%s={}\", util.safeProp(field.name));\n        else if (field.repeated) gen\n            (\"this%s=[]\", util.safeProp(field.name));\n    return gen\n    (\"if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)\") // omit undefined or null\n        (\"this[ks[i]]=p[ks[i]]\");\n    /* eslint-enable no-unexpected-multiline */\n};\n\nfunction clearCache(type) {\n    type._fieldsById = type._fieldsArray = type._oneofsArray = null;\n    delete type.encode;\n    delete type.decode;\n    delete type.verify;\n    return type;\n}\n\n/**\n * Message type descriptor.\n * @interface IType\n * @extends INamespace\n * @property {Object.<string,IOneOf>} [oneofs] Oneof descriptors\n * @property {Object.<string,IField>} fields Field descriptors\n * @property {number[][]} [extensions] Extension ranges\n * @property {Array.<number[]|string>} [reserved] Reserved ranges\n * @property {boolean} [group=false] Whether a legacy group or not\n */\n\n/**\n * Creates a message type from a message type descriptor.\n * @param {string} name Message name\n * @param {IType} json Message type descriptor\n * @returns {Type} Created message type\n */\nType.fromJSON = function fromJSON(name, json) {\n    var type = new Type(name, json.options);\n    type.extensions = json.extensions;\n    type.reserved = json.reserved;\n    var names = Object.keys(json.fields),\n        i = 0;\n    for (; i < names.length; ++i)\n        type.add(\n            ( typeof json.fields[names[i]].keyType !== \"undefined\"\n            ? MapField.fromJSON\n            : Field.fromJSON )(names[i], json.fields[names[i]])\n        );\n    if (json.oneofs)\n        for (names = Object.keys(json.oneofs), i = 0; i < names.length; ++i)\n            type.add(OneOf.fromJSON(names[i], json.oneofs[names[i]]));\n    if (json.nested)\n        for (names = Object.keys(json.nested), i = 0; i < names.length; ++i) {\n            var nested = json.nested[names[i]];\n            type.add( // most to least likely\n                ( nested.id !== undefined\n                ? Field.fromJSON\n                : nested.fields !== undefined\n                ? Type.fromJSON\n                : nested.values !== undefined\n                ? Enum.fromJSON\n                : nested.methods !== undefined\n                ? Service.fromJSON\n                : Namespace.fromJSON )(names[i], nested)\n            );\n        }\n    if (json.extensions && json.extensions.length)\n        type.extensions = json.extensions;\n    if (json.reserved && json.reserved.length)\n        type.reserved = json.reserved;\n    if (json.group)\n        type.group = true;\n    if (json.comment)\n        type.comment = json.comment;\n    if (json.edition)\n        type._edition = json.edition;\n    type._defaultEdition = \"proto3\";  // For backwards-compatibility.\n    return type;\n};\n\n/**\n * Converts this message type to a message type descriptor.\n * @param {IToJSONOptions} [toJSONOptions] JSON conversion options\n * @returns {IType} Message type descriptor\n */\nType.prototype.toJSON = function toJSON(toJSONOptions) {\n    var inherited = Namespace.prototype.toJSON.call(this, toJSONOptions);\n    var keepComments = toJSONOptions ? Boolean(toJSONOptions.keepComments) : false;\n    return util.toObject([\n        \"edition\"    , this._editionToJSON(),\n        \"options\"    , inherited && inherited.options || undefined,\n        \"oneofs\"     , Namespace.arrayToJSON(this.oneofsArray, toJSONOptions),\n        \"fields\"     , Namespace.arrayToJSON(this.fieldsArray.filter(function(obj) { return !obj.declaringField; }), toJSONOptions) || {},\n        \"extensions\" , this.extensions && this.extensions.length ? this.extensions : undefined,\n        \"reserved\"   , this.reserved && this.reserved.length ? this.reserved : undefined,\n        \"group\"      , this.group || undefined,\n        \"nested\"     , inherited && inherited.nested || undefined,\n        \"comment\"    , keepComments ? this.comment : undefined\n    ]);\n};\n\n/**\n * @override\n */\nType.prototype.resolveAll = function resolveAll() {\n    if (!this._needsRecursiveResolve) return this;\n\n    Namespace.prototype.resolveAll.call(this);\n    var oneofs = this.oneofsArray; i = 0;\n    while (i < oneofs.length)\n        oneofs[i++].resolve();\n    var fields = this.fieldsArray, i = 0;\n    while (i < fields.length)\n        fields[i++].resolve();\n    return this;\n};\n\n/**\n * @override\n */\nType.prototype._resolveFeaturesRecursive = function _resolveFeaturesRecursive(edition) {\n    if (!this._needsRecursiveFeatureResolution) return this;\n\n    edition = this._edition || edition;\n\n    Namespace.prototype._resolveFeaturesRecursive.call(this, edition);\n    this.oneofsArray.forEach(oneof => {\n        oneof._resolveFeatures(edition);\n    });\n    this.fieldsArray.forEach(field => {\n        field._resolveFeatures(edition);\n    });\n    return this;\n};\n\n/**\n * @override\n */\nType.prototype.get = function get(name) {\n    return this.fields[name]\n        || this.oneofs && this.oneofs[name]\n        || this.nested && this.nested[name]\n        || null;\n};\n\n/**\n * Adds a nested object to this type.\n * @param {ReflectionObject} object Nested object to add\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If there is already a nested object with this name or, if a field, when there is already a field with this id\n */\nType.prototype.add = function add(object) {\n\n    if (this.get(object.name))\n        throw Error(\"duplicate name '\" + object.name + \"' in \" + this);\n\n    if (object instanceof Field && object.extend === undefined) {\n        // NOTE: Extension fields aren't actual fields on the declaring type, but nested objects.\n        // The root object takes care of adding distinct sister-fields to the respective extended\n        // type instead.\n\n        // avoids calling the getter if not absolutely necessary because it's called quite frequently\n        if (this._fieldsById ? /* istanbul ignore next */ this._fieldsById[object.id] : this.fieldsById[object.id])\n            throw Error(\"duplicate id \" + object.id + \" in \" + this);\n        if (this.isReservedId(object.id))\n            throw Error(\"id \" + object.id + \" is reserved in \" + this);\n        if (this.isReservedName(object.name))\n            throw Error(\"name '\" + object.name + \"' is reserved in \" + this);\n\n        if (object.parent)\n            object.parent.remove(object);\n        this.fields[object.name] = object;\n        object.message = this;\n        object.onAdd(this);\n        return clearCache(this);\n    }\n    if (object instanceof OneOf) {\n        if (!this.oneofs)\n            this.oneofs = {};\n        this.oneofs[object.name] = object;\n        object.onAdd(this);\n        return clearCache(this);\n    }\n    return Namespace.prototype.add.call(this, object);\n};\n\n/**\n * Removes a nested object from this type.\n * @param {ReflectionObject} object Nested object to remove\n * @returns {Type} `this`\n * @throws {TypeError} If arguments are invalid\n * @throws {Error} If `object` is not a member of this type\n */\nType.prototype.remove = function remove(object) {\n    if (object instanceof Field && object.extend === undefined) {\n        // See Type#add for the reason why extension fields are excluded here.\n\n        /* istanbul ignore if */\n        if (!this.fields || this.fields[object.name] !== object)\n            throw Error(object + \" is not a member of \" + this);\n\n        delete this.fields[object.name];\n        object.parent = null;\n        object.onRemove(this);\n        return clearCache(this);\n    }\n    if (object instanceof OneOf) {\n\n        /* istanbul ignore if */\n        if (!this.oneofs || this.oneofs[object.name] !== object)\n            throw Error(object + \" is not a member of \" + this);\n\n        delete this.oneofs[object.name];\n        object.parent = null;\n        object.onRemove(this);\n        return clearCache(this);\n    }\n    return Namespace.prototype.remove.call(this, object);\n};\n\n/**\n * Tests if the specified id is reserved.\n * @param {number} id Id to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedId = function isReservedId(id) {\n    return Namespace.isReservedId(this.reserved, id);\n};\n\n/**\n * Tests if the specified name is reserved.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nType.prototype.isReservedName = function isReservedName(name) {\n    return Namespace.isReservedName(this.reserved, name);\n};\n\n/**\n * Creates a new message of this type using the specified properties.\n * @param {Object.<string,*>} [properties] Properties to set\n * @returns {Message<{}>} Message instance\n */\nType.prototype.create = function create(properties) {\n    return new this.ctor(properties);\n};\n\n/**\n * Sets up {@link Type#encode|encode}, {@link Type#decode|decode} and {@link Type#verify|verify}.\n * @returns {Type} `this`\n */\nType.prototype.setup = function setup() {\n    // Sets up everything at once so that the prototype chain does not have to be re-evaluated\n    // multiple times (V8, soft-deopt prototype-check).\n\n    var fullName = this.fullName,\n        types    = [];\n    for (var i = 0; i < /* initializes */ this.fieldsArray.length; ++i)\n        types.push(this._fieldsArray[i].resolve().resolvedType);\n\n    // Replace setup methods with type-specific generated functions\n    this.encode = encoder(this)({\n        Writer : Writer,\n        types  : types,\n        util   : util\n    });\n    this.decode = decoder(this)({\n        Reader : Reader,\n        types  : types,\n        util   : util\n    });\n    this.verify = verifier(this)({\n        types : types,\n        util  : util\n    });\n    this.fromObject = converter.fromObject(this)({\n        types : types,\n        util  : util\n    });\n    this.toObject = converter.toObject(this)({\n        types : types,\n        util  : util\n    });\n\n    // Inject custom wrappers for common types\n    var wrapper = wrappers[fullName];\n    if (wrapper) {\n        var originalThis = Object.create(this);\n        // if (wrapper.fromObject) {\n            originalThis.fromObject = this.fromObject;\n            this.fromObject = wrapper.fromObject.bind(originalThis);\n        // }\n        // if (wrapper.toObject) {\n            originalThis.toObject = this.toObject;\n            this.toObject = wrapper.toObject.bind(originalThis);\n        // }\n    }\n\n    return this;\n};\n\n/**\n * Encodes a message of this type. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.<string,*>} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encode = function encode_setup(message, writer) {\n    return this.setup().encode(message, writer); // overrides this method\n};\n\n/**\n * Encodes a message of this type preceeded by its byte length as a varint. Does not implicitly {@link Type#verify|verify} messages.\n * @param {Message<{}>|Object.<string,*>} message Message instance or plain object\n * @param {Writer} [writer] Writer to encode to\n * @returns {Writer} writer\n */\nType.prototype.encodeDelimited = function encodeDelimited(message, writer) {\n    return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();\n};\n\n/**\n * Decodes a message of this type.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @param {number} [length] Length of the message, if known beforehand\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError<{}>} If required fields are missing\n */\nType.prototype.decode = function decode_setup(reader, length) {\n    return this.setup().decode(reader, length); // overrides this method\n};\n\n/**\n * Decodes a message of this type preceeded by its byte length as a varint.\n * @param {Reader|Uint8Array} reader Reader or buffer to decode from\n * @returns {Message<{}>} Decoded message\n * @throws {Error} If the payload is not a reader or valid buffer\n * @throws {util.ProtocolError} If required fields are missing\n */\nType.prototype.decodeDelimited = function decodeDelimited(reader) {\n    if (!(reader instanceof Reader))\n        reader = Reader.create(reader);\n    return this.decode(reader, reader.uint32());\n};\n\n/**\n * Verifies that field values are valid and that required fields are present.\n * @param {Object.<string,*>} message Plain object to verify\n * @returns {null|string} `null` if valid, otherwise the reason why it is not\n */\nType.prototype.verify = function verify_setup(message) {\n    return this.setup().verify(message); // overrides this method\n};\n\n/**\n * Creates a new message of this type from a plain object. Also converts values to their respective internal types.\n * @param {Object.<string,*>} object Plain object to convert\n * @returns {Message<{}>} Message instance\n */\nType.prototype.fromObject = function fromObject(object) {\n    return this.setup().fromObject(object);\n};\n\n/**\n * Conversion options as used by {@link Type#toObject} and {@link Message.toObject}.\n * @interface IConversionOptions\n * @property {Function} [longs] Long conversion type.\n * Valid values are `String` and `Number` (the global types).\n * Defaults to copy the present value, which is a possibly unsafe number without and a {@link Long} with a long library.\n * @property {Function} [enums] Enum value conversion type.\n * Only valid value is `String` (the global type).\n * Defaults to copy the present value, which is the numeric id.\n * @property {Function} [bytes] Bytes value conversion type.\n * Valid values are `Array` and (a base64 encoded) `String` (the global types).\n * Defaults to copy the present value, which usually is a Buffer under node and an Uint8Array in the browser.\n * @property {boolean} [defaults=false] Also sets default values on the resulting object\n * @property {boolean} [arrays=false] Sets empty arrays for missing repeated fields even if `defaults=false`\n * @property {boolean} [objects=false] Sets empty objects for missing map fields even if `defaults=false`\n * @property {boolean} [oneofs=false] Includes virtual oneof properties set to the present field's name, if any\n * @property {boolean} [json=false] Performs additional JSON compatibility conversions, i.e. NaN and Infinity to strings\n */\n\n/**\n * Creates a plain object from a message of this type. Also converts values to other types if specified.\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.<string,*>} Plain object\n */\nType.prototype.toObject = function toObject(message, options) {\n    return this.setup().toObject(message, options);\n};\n\n/**\n * Decorator function as returned by {@link Type.d} (TypeScript).\n * @typedef TypeDecorator\n * @type {function}\n * @param {Constructor<T>} target Target constructor\n * @returns {undefined}\n * @template T extends Message<T>\n */\n\n/**\n * Type decorator (TypeScript).\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {TypeDecorator<T>} Decorator function\n * @template T extends Message<T>\n */\nType.d = function decorateType(typeName) {\n    return function typeDecorator(target) {\n        util.decorateType(target, typeName);\n    };\n};\n"
  },
  {
    "path": "src/types.js",
    "content": "\"use strict\";\n\n/**\n * Common type constants.\n * @namespace\n */\nvar types = exports;\n\nvar util = require(\"./util\");\n\nvar s = [\n    \"double\",   // 0\n    \"float\",    // 1\n    \"int32\",    // 2\n    \"uint32\",   // 3\n    \"sint32\",   // 4\n    \"fixed32\",  // 5\n    \"sfixed32\", // 6\n    \"int64\",    // 7\n    \"uint64\",   // 8\n    \"sint64\",   // 9\n    \"fixed64\",  // 10\n    \"sfixed64\", // 11\n    \"bool\",     // 12\n    \"string\",   // 13\n    \"bytes\"     // 14\n];\n\nfunction bake(values, offset) {\n    var i = 0, o = {};\n    offset |= 0;\n    while (i < values.length) o[s[i + offset]] = values[i++];\n    return o;\n}\n\n/**\n * Basic type wire types.\n * @type {Object.<string,number>}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n * @property {number} bytes=2 Ldelim wire type\n */\ntypes.basic = bake([\n    /* double   */ 1,\n    /* float    */ 5,\n    /* int32    */ 0,\n    /* uint32   */ 0,\n    /* sint32   */ 0,\n    /* fixed32  */ 5,\n    /* sfixed32 */ 5,\n    /* int64    */ 0,\n    /* uint64   */ 0,\n    /* sint64   */ 0,\n    /* fixed64  */ 1,\n    /* sfixed64 */ 1,\n    /* bool     */ 0,\n    /* string   */ 2,\n    /* bytes    */ 2\n]);\n\n/**\n * Basic type defaults.\n * @type {Object.<string,*>}\n * @const\n * @property {number} double=0 Double default\n * @property {number} float=0 Float default\n * @property {number} int32=0 Int32 default\n * @property {number} uint32=0 Uint32 default\n * @property {number} sint32=0 Sint32 default\n * @property {number} fixed32=0 Fixed32 default\n * @property {number} sfixed32=0 Sfixed32 default\n * @property {number} int64=0 Int64 default\n * @property {number} uint64=0 Uint64 default\n * @property {number} sint64=0 Sint32 default\n * @property {number} fixed64=0 Fixed64 default\n * @property {number} sfixed64=0 Sfixed64 default\n * @property {boolean} bool=false Bool default\n * @property {string} string=\"\" String default\n * @property {Array.<number>} bytes=Array(0) Bytes default\n * @property {null} message=null Message default\n */\ntypes.defaults = bake([\n    /* double   */ 0,\n    /* float    */ 0,\n    /* int32    */ 0,\n    /* uint32   */ 0,\n    /* sint32   */ 0,\n    /* fixed32  */ 0,\n    /* sfixed32 */ 0,\n    /* int64    */ 0,\n    /* uint64   */ 0,\n    /* sint64   */ 0,\n    /* fixed64  */ 0,\n    /* sfixed64 */ 0,\n    /* bool     */ false,\n    /* string   */ \"\",\n    /* bytes    */ util.emptyArray,\n    /* message  */ null\n]);\n\n/**\n * Basic long type wire types.\n * @type {Object.<string,number>}\n * @const\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n */\ntypes.long = bake([\n    /* int64    */ 0,\n    /* uint64   */ 0,\n    /* sint64   */ 0,\n    /* fixed64  */ 1,\n    /* sfixed64 */ 1\n], 7);\n\n/**\n * Allowed types for map keys with their associated wire type.\n * @type {Object.<string,number>}\n * @const\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n * @property {number} string=2 Ldelim wire type\n */\ntypes.mapKey = bake([\n    /* int32    */ 0,\n    /* uint32   */ 0,\n    /* sint32   */ 0,\n    /* fixed32  */ 5,\n    /* sfixed32 */ 5,\n    /* int64    */ 0,\n    /* uint64   */ 0,\n    /* sint64   */ 0,\n    /* fixed64  */ 1,\n    /* sfixed64 */ 1,\n    /* bool     */ 0,\n    /* string   */ 2\n], 2);\n\n/**\n * Allowed types for packed repeated fields with their associated wire type.\n * @type {Object.<string,number>}\n * @const\n * @property {number} double=1 Fixed64 wire type\n * @property {number} float=5 Fixed32 wire type\n * @property {number} int32=0 Varint wire type\n * @property {number} uint32=0 Varint wire type\n * @property {number} sint32=0 Varint wire type\n * @property {number} fixed32=5 Fixed32 wire type\n * @property {number} sfixed32=5 Fixed32 wire type\n * @property {number} int64=0 Varint wire type\n * @property {number} uint64=0 Varint wire type\n * @property {number} sint64=0 Varint wire type\n * @property {number} fixed64=1 Fixed64 wire type\n * @property {number} sfixed64=1 Fixed64 wire type\n * @property {number} bool=0 Varint wire type\n */\ntypes.packed = bake([\n    /* double   */ 1,\n    /* float    */ 5,\n    /* int32    */ 0,\n    /* uint32   */ 0,\n    /* sint32   */ 0,\n    /* fixed32  */ 5,\n    /* sfixed32 */ 5,\n    /* int64    */ 0,\n    /* uint64   */ 0,\n    /* sint64   */ 0,\n    /* fixed64  */ 1,\n    /* sfixed64 */ 1,\n    /* bool     */ 0\n]);\n"
  },
  {
    "path": "src/typescript.jsdoc",
    "content": "/**\n * Constructor type.\n * @interface Constructor\n * @extends Function\n * @template T\n * @tstype new(...params: any[]): T; prototype: T;\n */\n\n/**\n * Properties type.\n * @typedef Properties\n * @template T\n * @type {Object.<string,*>}\n * @tstype { [P in keyof T]?: T[P] }\n */\n"
  },
  {
    "path": "src/util/longbits.js",
    "content": "\"use strict\";\nmodule.exports = LongBits;\n\nvar util = require(\"../util/minimal\");\n\n/**\n * Constructs new long bits.\n * @classdesc Helper class for working with the low and high bits of a 64 bit value.\n * @memberof util\n * @constructor\n * @param {number} lo Low 32 bits, unsigned\n * @param {number} hi High 32 bits, unsigned\n */\nfunction LongBits(lo, hi) {\n\n    // note that the casts below are theoretically unnecessary as of today, but older statically\n    // generated converter code might still call the ctor with signed 32bits. kept for compat.\n\n    /**\n     * Low bits.\n     * @type {number}\n     */\n    this.lo = lo >>> 0;\n\n    /**\n     * High bits.\n     * @type {number}\n     */\n    this.hi = hi >>> 0;\n}\n\n/**\n * Zero bits.\n * @memberof util.LongBits\n * @type {util.LongBits}\n */\nvar zero = LongBits.zero = new LongBits(0, 0);\n\nzero.toNumber = function() { return 0; };\nzero.zzEncode = zero.zzDecode = function() { return this; };\nzero.length = function() { return 1; };\n\n/**\n * Zero hash.\n * @memberof util.LongBits\n * @type {string}\n */\nvar zeroHash = LongBits.zeroHash = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n/**\n * Constructs new long bits from the specified number.\n * @param {number} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.fromNumber = function fromNumber(value) {\n    if (value === 0)\n        return zero;\n    var sign = value < 0;\n    if (sign)\n        value = -value;\n    var lo = value >>> 0,\n        hi = (value - lo) / 4294967296 >>> 0;\n    if (sign) {\n        hi = ~hi >>> 0;\n        lo = ~lo >>> 0;\n        if (++lo > 4294967295) {\n            lo = 0;\n            if (++hi > 4294967295)\n                hi = 0;\n        }\n    }\n    return new LongBits(lo, hi);\n};\n\n/**\n * Constructs new long bits from a number, long or string.\n * @param {Long|number|string} value Value\n * @returns {util.LongBits} Instance\n */\nLongBits.from = function from(value) {\n    if (typeof value === \"number\")\n        return LongBits.fromNumber(value);\n    if (util.isString(value)) {\n        /* istanbul ignore else */\n        if (util.Long)\n            value = util.Long.fromString(value);\n        else\n            return LongBits.fromNumber(parseInt(value, 10));\n    }\n    return value.low || value.high ? new LongBits(value.low >>> 0, value.high >>> 0) : zero;\n};\n\n/**\n * Converts this long bits to a possibly unsafe JavaScript number.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {number} Possibly unsafe number\n */\nLongBits.prototype.toNumber = function toNumber(unsigned) {\n    if (!unsigned && this.hi >>> 31) {\n        var lo = ~this.lo + 1 >>> 0,\n            hi = ~this.hi     >>> 0;\n        if (!lo)\n            hi = hi + 1 >>> 0;\n        return -(lo + hi * 4294967296);\n    }\n    return this.lo + this.hi * 4294967296;\n};\n\n/**\n * Converts this long bits to a long.\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long} Long\n */\nLongBits.prototype.toLong = function toLong(unsigned) {\n    return util.Long\n        ? new util.Long(this.lo | 0, this.hi | 0, Boolean(unsigned))\n        /* istanbul ignore next */\n        : { low: this.lo | 0, high: this.hi | 0, unsigned: Boolean(unsigned) };\n};\n\nvar charCodeAt = String.prototype.charCodeAt;\n\n/**\n * Constructs new long bits from the specified 8 characters long hash.\n * @param {string} hash Hash\n * @returns {util.LongBits} Bits\n */\nLongBits.fromHash = function fromHash(hash) {\n    if (hash === zeroHash)\n        return zero;\n    return new LongBits(\n        ( charCodeAt.call(hash, 0)\n        | charCodeAt.call(hash, 1) << 8\n        | charCodeAt.call(hash, 2) << 16\n        | charCodeAt.call(hash, 3) << 24) >>> 0\n    ,\n        ( charCodeAt.call(hash, 4)\n        | charCodeAt.call(hash, 5) << 8\n        | charCodeAt.call(hash, 6) << 16\n        | charCodeAt.call(hash, 7) << 24) >>> 0\n    );\n};\n\n/**\n * Converts this long bits to a 8 characters long hash.\n * @returns {string} Hash\n */\nLongBits.prototype.toHash = function toHash() {\n    return String.fromCharCode(\n        this.lo        & 255,\n        this.lo >>> 8  & 255,\n        this.lo >>> 16 & 255,\n        this.lo >>> 24      ,\n        this.hi        & 255,\n        this.hi >>> 8  & 255,\n        this.hi >>> 16 & 255,\n        this.hi >>> 24\n    );\n};\n\n/**\n * Zig-zag encodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzEncode = function zzEncode() {\n    var mask =   this.hi >> 31;\n    this.hi  = ((this.hi << 1 | this.lo >>> 31) ^ mask) >>> 0;\n    this.lo  = ( this.lo << 1                   ^ mask) >>> 0;\n    return this;\n};\n\n/**\n * Zig-zag decodes this long bits.\n * @returns {util.LongBits} `this`\n */\nLongBits.prototype.zzDecode = function zzDecode() {\n    var mask = -(this.lo & 1);\n    this.lo  = ((this.lo >>> 1 | this.hi << 31) ^ mask) >>> 0;\n    this.hi  = ( this.hi >>> 1                  ^ mask) >>> 0;\n    return this;\n};\n\n/**\n * Calculates the length of this longbits when encoded as a varint.\n * @returns {number} Length\n */\nLongBits.prototype.length = function length() {\n    var part0 =  this.lo,\n        part1 = (this.lo >>> 28 | this.hi << 4) >>> 0,\n        part2 =  this.hi >>> 24;\n    return part2 === 0\n         ? part1 === 0\n           ? part0 < 16384\n             ? part0 < 128 ? 1 : 2\n             : part0 < 2097152 ? 3 : 4\n           : part1 < 16384\n             ? part1 < 128 ? 5 : 6\n             : part1 < 2097152 ? 7 : 8\n         : part2 < 128 ? 9 : 10;\n};\n"
  },
  {
    "path": "src/util/minimal.js",
    "content": "\"use strict\";\nvar util = exports;\n\n// used to return a Promise where callback is omitted\nutil.asPromise = require(\"@protobufjs/aspromise\");\n\n// converts to / from base64 encoded strings\nutil.base64 = require(\"@protobufjs/base64\");\n\n// base class of rpc.Service\nutil.EventEmitter = require(\"@protobufjs/eventemitter\");\n\n// float handling accross browsers\nutil.float = require(\"@protobufjs/float\");\n\n// requires modules optionally and hides the call from bundlers\nutil.inquire = require(\"@protobufjs/inquire\");\n\n// converts to / from utf8 encoded strings\nutil.utf8 = require(\"@protobufjs/utf8\");\n\n// provides a node-like buffer pool in the browser\nutil.pool = require(\"@protobufjs/pool\");\n\n// utility to work with the low and high bits of a 64 bit value\nutil.LongBits = require(\"./longbits\");\n\n/**\n * Whether running within node or not.\n * @memberof util\n * @type {boolean}\n */\nutil.isNode = Boolean(typeof global !== \"undefined\"\n                   && global\n                   && global.process\n                   && global.process.versions\n                   && global.process.versions.node);\n\n/**\n * Global object reference.\n * @memberof util\n * @type {Object}\n */\nutil.global = util.isNode && global\n           || typeof window !== \"undefined\" && window\n           || typeof self   !== \"undefined\" && self\n           || this; // eslint-disable-line no-invalid-this\n\n/**\n * An immuable empty array.\n * @memberof util\n * @type {Array.<*>}\n * @const\n */\nutil.emptyArray = Object.freeze ? Object.freeze([]) : /* istanbul ignore next */ []; // used on prototypes\n\n/**\n * An immutable empty object.\n * @type {Object}\n * @const\n */\nutil.emptyObject = Object.freeze ? Object.freeze({}) : /* istanbul ignore next */ {}; // used on prototypes\n\n/**\n * Tests if the specified value is an integer.\n * @function\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is an integer\n */\nutil.isInteger = Number.isInteger || /* istanbul ignore next */ function isInteger(value) {\n    return typeof value === \"number\" && isFinite(value) && Math.floor(value) === value;\n};\n\n/**\n * Tests if the specified value is a string.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a string\n */\nutil.isString = function isString(value) {\n    return typeof value === \"string\" || value instanceof String;\n};\n\n/**\n * Tests if the specified value is a non-null object.\n * @param {*} value Value to test\n * @returns {boolean} `true` if the value is a non-null object\n */\nutil.isObject = function isObject(value) {\n    return value && typeof value === \"object\";\n};\n\n/**\n * Checks if a property on a message is considered to be present.\n * This is an alias of {@link util.isSet}.\n * @function\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isset =\n\n/**\n * Checks if a property on a message is considered to be present.\n * @param {Object} obj Plain object or message instance\n * @param {string} prop Property name\n * @returns {boolean} `true` if considered to be present, otherwise `false`\n */\nutil.isSet = function isSet(obj, prop) {\n    var value = obj[prop];\n    if (value != null && obj.hasOwnProperty(prop)) // eslint-disable-line eqeqeq, no-prototype-builtins\n        return typeof value !== \"object\" || (Array.isArray(value) ? value.length : Object.keys(value).length) > 0;\n    return false;\n};\n\n/**\n * Any compatible Buffer instance.\n * This is a minimal stand-alone definition of a Buffer instance. The actual type is that exported by node's typings.\n * @interface Buffer\n * @extends Uint8Array\n */\n\n/**\n * Node's Buffer class if available.\n * @type {Constructor<Buffer>}\n */\nutil.Buffer = (function() {\n    try {\n        var Buffer = util.inquire(\"buffer\").Buffer;\n        // refuse to use non-node buffers if not explicitly assigned (perf reasons):\n        return Buffer.prototype.utf8Write ? Buffer : /* istanbul ignore next */ null;\n    } catch (e) {\n        /* istanbul ignore next */\n        return null;\n    }\n})();\n\n// Internal alias of or polyfull for Buffer.from.\nutil._Buffer_from = null;\n\n// Internal alias of or polyfill for Buffer.allocUnsafe.\nutil._Buffer_allocUnsafe = null;\n\n/**\n * Creates a new buffer of whatever type supported by the environment.\n * @param {number|number[]} [sizeOrArray=0] Buffer size or number array\n * @returns {Uint8Array|Buffer} Buffer\n */\nutil.newBuffer = function newBuffer(sizeOrArray) {\n    /* istanbul ignore next */\n    return typeof sizeOrArray === \"number\"\n        ? util.Buffer\n            ? util._Buffer_allocUnsafe(sizeOrArray)\n            : new util.Array(sizeOrArray)\n        : util.Buffer\n            ? util._Buffer_from(sizeOrArray)\n            : typeof Uint8Array === \"undefined\"\n                ? sizeOrArray\n                : new Uint8Array(sizeOrArray);\n};\n\n/**\n * Array implementation used in the browser. `Uint8Array` if supported, otherwise `Array`.\n * @type {Constructor<Uint8Array>}\n */\nutil.Array = typeof Uint8Array !== \"undefined\" ? Uint8Array /* istanbul ignore next */ : Array;\n\n/**\n * Any compatible Long instance.\n * This is a minimal stand-alone definition of a Long instance. The actual type is that exported by long.js.\n * @interface Long\n * @property {number} low Low bits\n * @property {number} high High bits\n * @property {boolean} unsigned Whether unsigned or not\n */\n\n/**\n * Long.js's Long class if available.\n * @type {Constructor<Long>}\n */\nutil.Long = /* istanbul ignore next */ util.global.dcodeIO && /* istanbul ignore next */ util.global.dcodeIO.Long\n         || /* istanbul ignore next */ util.global.Long\n         || util.inquire(\"long\");\n\n/**\n * Regular expression used to verify 2 bit (`bool`) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key2Re = /^true|false|0|1$/;\n\n/**\n * Regular expression used to verify 32 bit (`int32` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key32Re = /^-?(?:0|[1-9][0-9]*)$/;\n\n/**\n * Regular expression used to verify 64 bit (`int64` etc.) map keys.\n * @type {RegExp}\n * @const\n */\nutil.key64Re = /^(?:[\\\\x00-\\\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;\n\n/**\n * Converts a number or long to an 8 characters long hash string.\n * @param {Long|number} value Value to convert\n * @returns {string} Hash\n */\nutil.longToHash = function longToHash(value) {\n    return value\n        ? util.LongBits.from(value).toHash()\n        : util.LongBits.zeroHash;\n};\n\n/**\n * Converts an 8 characters long hash string to a long or number.\n * @param {string} hash Hash\n * @param {boolean} [unsigned=false] Whether unsigned or not\n * @returns {Long|number} Original value\n */\nutil.longFromHash = function longFromHash(hash, unsigned) {\n    var bits = util.LongBits.fromHash(hash);\n    if (util.Long)\n        return util.Long.fromBits(bits.lo, bits.hi, unsigned);\n    return bits.toNumber(Boolean(unsigned));\n};\n\n/**\n * Merges the properties of the source object into the destination object.\n * @memberof util\n * @param {Object.<string,*>} dst Destination object\n * @param {Object.<string,*>} src Source object\n * @param {boolean} [ifNotSet=false] Merges only if the key is not already set\n * @returns {Object.<string,*>} Destination object\n */\nfunction merge(dst, src, ifNotSet) { // used by converters\n    for (var keys = Object.keys(src), i = 0; i < keys.length; ++i)\n        if (dst[keys[i]] === undefined || !ifNotSet)\n            dst[keys[i]] = src[keys[i]];\n    return dst;\n}\n\nutil.merge = merge;\n\n/**\n * Converts the first character of a string to lower case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.lcFirst = function lcFirst(str) {\n    return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/**\n * Creates a custom error constructor.\n * @memberof util\n * @param {string} name Error name\n * @returns {Constructor<Error>} Custom error constructor\n */\nfunction newError(name) {\n\n    function CustomError(message, properties) {\n\n        if (!(this instanceof CustomError))\n            return new CustomError(message, properties);\n\n        // Error.call(this, message);\n        // ^ just returns a new error instance because the ctor can be called as a function\n\n        Object.defineProperty(this, \"message\", { get: function() { return message; } });\n\n        /* istanbul ignore next */\n        if (Error.captureStackTrace) // node\n            Error.captureStackTrace(this, CustomError);\n        else\n            Object.defineProperty(this, \"stack\", { value: new Error().stack || \"\" });\n\n        if (properties)\n            merge(this, properties);\n    }\n\n    CustomError.prototype = Object.create(Error.prototype, {\n        constructor: {\n            value: CustomError,\n            writable: true,\n            enumerable: false,\n            configurable: true,\n        },\n        name: {\n            get: function get() { return name; },\n            set: undefined,\n            enumerable: false,\n            // configurable: false would accurately preserve the behavior of\n            // the original, but I'm guessing that was not intentional.\n            // For an actual error subclass, this property would\n            // be configurable.\n            configurable: true,\n        },\n        toString: {\n            value: function value() { return this.name + \": \" + this.message; },\n            writable: true,\n            enumerable: false,\n            configurable: true,\n        },\n    });\n\n    return CustomError;\n}\n\nutil.newError = newError;\n\n/**\n * Constructs a new protocol error.\n * @classdesc Error subclass indicating a protocol specifc error.\n * @memberof util\n * @extends Error\n * @template T extends Message<T>\n * @constructor\n * @param {string} message Error message\n * @param {Object.<string,*>} [properties] Additional properties\n * @example\n * try {\n *     MyMessage.decode(someBuffer); // throws if required fields are missing\n * } catch (e) {\n *     if (e instanceof ProtocolError && e.instance)\n *         console.log(\"decoded so far: \" + JSON.stringify(e.instance));\n * }\n */\nutil.ProtocolError = newError(\"ProtocolError\");\n\n/**\n * So far decoded message instance.\n * @name util.ProtocolError#instance\n * @type {Message<T>}\n */\n\n/**\n * A OneOf getter as returned by {@link util.oneOfGetter}.\n * @typedef OneOfGetter\n * @type {function}\n * @returns {string|undefined} Set field name, if any\n */\n\n/**\n * Builds a getter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfGetter} Unbound getter\n */\nutil.oneOfGetter = function getOneOf(fieldNames) {\n    var fieldMap = {};\n    for (var i = 0; i < fieldNames.length; ++i)\n        fieldMap[fieldNames[i]] = 1;\n\n    /**\n     * @returns {string|undefined} Set field name, if any\n     * @this Object\n     * @ignore\n     */\n    return function() { // eslint-disable-line consistent-return\n        for (var keys = Object.keys(this), i = keys.length - 1; i > -1; --i)\n            if (fieldMap[keys[i]] === 1 && this[keys[i]] !== undefined && this[keys[i]] !== null)\n                return keys[i];\n    };\n};\n\n/**\n * A OneOf setter as returned by {@link util.oneOfSetter}.\n * @typedef OneOfSetter\n * @type {function}\n * @param {string|undefined} value Field name\n * @returns {undefined}\n */\n\n/**\n * Builds a setter for a oneof's present field name.\n * @param {string[]} fieldNames Field names\n * @returns {OneOfSetter} Unbound setter\n */\nutil.oneOfSetter = function setOneOf(fieldNames) {\n\n    /**\n     * @param {string} name Field name\n     * @returns {undefined}\n     * @this Object\n     * @ignore\n     */\n    return function(name) {\n        for (var i = 0; i < fieldNames.length; ++i)\n            if (fieldNames[i] !== name)\n                delete this[fieldNames[i]];\n    };\n};\n\n/**\n * Default conversion options used for {@link Message#toJSON} implementations.\n *\n * These options are close to proto3's JSON mapping with the exception that internal types like Any are handled just like messages. More precisely:\n *\n * - Longs become strings\n * - Enums become string keys\n * - Bytes become base64 encoded strings\n * - (Sub-)Messages become plain objects\n * - Maps become plain objects with all string keys\n * - Repeated fields become arrays\n * - NaN and Infinity for float and double fields become strings\n *\n * @type {IConversionOptions}\n * @see https://developers.google.com/protocol-buffers/docs/proto3?hl=en#json\n */\nutil.toJSONOptions = {\n    longs: String,\n    enums: String,\n    bytes: String,\n    json: true\n};\n\n// Sets up buffer utility according to the environment (called in index-minimal)\nutil._configure = function() {\n    var Buffer = util.Buffer;\n    /* istanbul ignore if */\n    if (!Buffer) {\n        util._Buffer_from = util._Buffer_allocUnsafe = null;\n        return;\n    }\n    // because node 4.x buffers are incompatible & immutable\n    // see: https://github.com/dcodeIO/protobuf.js/pull/665\n    util._Buffer_from = Buffer.from !== Uint8Array.from && Buffer.from ||\n        /* istanbul ignore next */\n        function Buffer_from(value, encoding) {\n            return new Buffer(value, encoding);\n        };\n    util._Buffer_allocUnsafe = Buffer.allocUnsafe ||\n        /* istanbul ignore next */\n        function Buffer_allocUnsafe(size) {\n            return new Buffer(size);\n        };\n};\n"
  },
  {
    "path": "src/util.js",
    "content": "\"use strict\";\n\n/**\n * Various utility functions.\n * @namespace\n */\nvar util = module.exports = require(\"./util/minimal\");\n\nvar roots = require(\"./roots\");\n\nvar Type, // cyclic\n    Enum;\n\nutil.codegen = require(\"@protobufjs/codegen\");\nutil.fetch   = require(\"@protobufjs/fetch\");\nutil.path    = require(\"@protobufjs/path\");\n\n/**\n * Node's fs module if available.\n * @type {Object.<string,*>}\n */\nutil.fs = util.inquire(\"fs\");\n\n/**\n * Converts an object's values to an array.\n * @param {Object.<string,*>} object Object to convert\n * @returns {Array.<*>} Converted array\n */\nutil.toArray = function toArray(object) {\n    if (object) {\n        var keys  = Object.keys(object),\n            array = new Array(keys.length),\n            index = 0;\n        while (index < keys.length)\n            array[index] = object[keys[index++]];\n        return array;\n    }\n    return [];\n};\n\n/**\n * Converts an array of keys immediately followed by their respective value to an object, omitting undefined values.\n * @param {Array.<*>} array Array to convert\n * @returns {Object.<string,*>} Converted object\n */\nutil.toObject = function toObject(array) {\n    var object = {},\n        index  = 0;\n    while (index < array.length) {\n        var key = array[index++],\n            val = array[index++];\n        if (val !== undefined)\n            object[key] = val;\n    }\n    return object;\n};\n\nvar safePropBackslashRe = /\\\\/g,\n    safePropQuoteRe     = /\"/g;\n\n/**\n * Tests whether the specified name is a reserved word in JS.\n * @param {string} name Name to test\n * @returns {boolean} `true` if reserved, otherwise `false`\n */\nutil.isReserved = function isReserved(name) {\n    return /^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(name);\n};\n\n/**\n * Returns a safe property accessor for the specified property name.\n * @param {string} prop Property name\n * @returns {string} Safe accessor\n */\nutil.safeProp = function safeProp(prop) {\n    if (!/^[$\\w_]+$/.test(prop) || util.isReserved(prop))\n        return \"[\\\"\" + prop.replace(safePropBackslashRe, \"\\\\\\\\\").replace(safePropQuoteRe, \"\\\\\\\"\") + \"\\\"]\";\n    return \".\" + prop;\n};\n\n/**\n * Converts the first character of a string to upper case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.ucFirst = function ucFirst(str) {\n    return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\nvar camelCaseRe = /_([a-z])/g;\n\n/**\n * Converts a string to camel case.\n * @param {string} str String to convert\n * @returns {string} Converted string\n */\nutil.camelCase = function camelCase(str) {\n    return str.substring(0, 1)\n         + str.substring(1)\n               .replace(camelCaseRe, function($0, $1) { return $1.toUpperCase(); });\n};\n\n/**\n * Compares reflected fields by id.\n * @param {Field} a First field\n * @param {Field} b Second field\n * @returns {number} Comparison value\n */\nutil.compareFieldsById = function compareFieldsById(a, b) {\n    return a.id - b.id;\n};\n\n/**\n * Decorator helper for types (TypeScript).\n * @param {Constructor<T>} ctor Constructor function\n * @param {string} [typeName] Type name, defaults to the constructor's name\n * @returns {Type} Reflected type\n * @template T extends Message<T>\n * @property {Root} root Decorators root\n */\nutil.decorateType = function decorateType(ctor, typeName) {\n\n    /* istanbul ignore if */\n    if (ctor.$type) {\n        if (typeName && ctor.$type.name !== typeName) {\n            util.decorateRoot.remove(ctor.$type);\n            ctor.$type.name = typeName;\n            util.decorateRoot.add(ctor.$type);\n        }\n        return ctor.$type;\n    }\n\n    /* istanbul ignore next */\n    if (!Type)\n        Type = require(\"./type\");\n\n    var type = new Type(typeName || ctor.name);\n    util.decorateRoot.add(type);\n    type.ctor = ctor; // sets up .encode, .decode etc.\n    Object.defineProperty(ctor, \"$type\", { value: type, enumerable: false });\n    Object.defineProperty(ctor.prototype, \"$type\", { value: type, enumerable: false });\n    return type;\n};\n\nvar decorateEnumIndex = 0;\n\n/**\n * Decorator helper for enums (TypeScript).\n * @param {Object} object Enum object\n * @returns {Enum} Reflected enum\n */\nutil.decorateEnum = function decorateEnum(object) {\n\n    /* istanbul ignore if */\n    if (object.$type)\n        return object.$type;\n\n    /* istanbul ignore next */\n    if (!Enum)\n        Enum = require(\"./enum\");\n\n    var enm = new Enum(\"Enum\" + decorateEnumIndex++, object);\n    util.decorateRoot.add(enm);\n    Object.defineProperty(object, \"$type\", { value: enm, enumerable: false });\n    return enm;\n};\n\n\n/**\n * Sets the value of a property by property path. If a value already exists, it is turned to an array\n * @param {Object.<string,*>} dst Destination object\n * @param {string} path dot '.' delimited path of the property to set\n * @param {Object} value the value to set\n * @param {boolean|undefined} [ifNotSet] Sets the option only if it isn't currently set\n * @returns {Object.<string,*>} Destination object\n */\nutil.setProperty = function setProperty(dst, path, value, ifNotSet) {\n    function setProp(dst, path, value) {\n        var part = path.shift();\n        if (part === \"__proto__\" || part === \"prototype\") {\n          return dst;\n        }\n        if (path.length > 0) {\n            dst[part] = setProp(dst[part] || {}, path, value);\n        } else {\n            var prevValue = dst[part];\n            if (prevValue && ifNotSet)\n                return dst;\n            if (prevValue)\n                value = [].concat(prevValue).concat(value);\n            dst[part] = value;\n        }\n        return dst;\n    }\n\n    if (typeof dst !== \"object\")\n        throw TypeError(\"dst must be an object\");\n    if (!path)\n        throw TypeError(\"path must be specified\");\n\n    path = path.split(\".\");\n    return setProp(dst, path, value);\n};\n\n/**\n * Decorator root (TypeScript).\n * @name util.decorateRoot\n * @type {Root}\n * @readonly\n */\nObject.defineProperty(util, \"decorateRoot\", {\n    get: function() {\n        return roots[\"decorated\"] || (roots[\"decorated\"] = new (require(\"./root\"))());\n    }\n});\n"
  },
  {
    "path": "src/verifier.js",
    "content": "\"use strict\";\nmodule.exports = verifier;\n\nvar Enum      = require(\"./enum\"),\n    util      = require(\"./util\");\n\nfunction invalid(field, expected) {\n    return field.name + \": \" + expected + (field.repeated && expected !== \"array\" ? \"[]\" : field.map && expected !== \"object\" ? \"{k:\"+field.keyType+\"}\" : \"\") + \" expected\";\n}\n\n/**\n * Generates a partial value verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {number} fieldIndex Field index\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyValue(gen, field, fieldIndex, ref) {\n    /* eslint-disable no-unexpected-multiline */\n    if (field.resolvedType) {\n        if (field.resolvedType instanceof Enum) { gen\n            (\"switch(%s){\", ref)\n                (\"default:\")\n                    (\"return%j\", invalid(field, \"enum value\"));\n            for (var keys = Object.keys(field.resolvedType.values), j = 0; j < keys.length; ++j) gen\n                (\"case %i:\", field.resolvedType.values[keys[j]]);\n            gen\n                    (\"break\")\n            (\"}\");\n        } else {\n            gen\n            (\"{\")\n                (\"var e=types[%i].verify(%s);\", fieldIndex, ref)\n                (\"if(e)\")\n                    (\"return%j+e\", field.name + \".\")\n            (\"}\");\n        }\n    } else {\n        switch (field.type) {\n            case \"int32\":\n            case \"uint32\":\n            case \"sint32\":\n            case \"fixed32\":\n            case \"sfixed32\": gen\n                (\"if(!util.isInteger(%s))\", ref)\n                    (\"return%j\", invalid(field, \"integer\"));\n                break;\n            case \"int64\":\n            case \"uint64\":\n            case \"sint64\":\n            case \"fixed64\":\n            case \"sfixed64\": gen\n                (\"if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))\", ref, ref, ref, ref)\n                    (\"return%j\", invalid(field, \"integer|Long\"));\n                break;\n            case \"float\":\n            case \"double\": gen\n                (\"if(typeof %s!==\\\"number\\\")\", ref)\n                    (\"return%j\", invalid(field, \"number\"));\n                break;\n            case \"bool\": gen\n                (\"if(typeof %s!==\\\"boolean\\\")\", ref)\n                    (\"return%j\", invalid(field, \"boolean\"));\n                break;\n            case \"string\": gen\n                (\"if(!util.isString(%s))\", ref)\n                    (\"return%j\", invalid(field, \"string\"));\n                break;\n            case \"bytes\": gen\n                (\"if(!(%s&&typeof %s.length===\\\"number\\\"||util.isString(%s)))\", ref, ref, ref)\n                    (\"return%j\", invalid(field, \"buffer\"));\n                break;\n        }\n    }\n    return gen;\n    /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a partial key verifier.\n * @param {Codegen} gen Codegen instance\n * @param {Field} field Reflected field\n * @param {string} ref Variable reference\n * @returns {Codegen} Codegen instance\n * @ignore\n */\nfunction genVerifyKey(gen, field, ref) {\n    /* eslint-disable no-unexpected-multiline */\n    switch (field.keyType) {\n        case \"int32\":\n        case \"uint32\":\n        case \"sint32\":\n        case \"fixed32\":\n        case \"sfixed32\": gen\n            (\"if(!util.key32Re.test(%s))\", ref)\n                (\"return%j\", invalid(field, \"integer key\"));\n            break;\n        case \"int64\":\n        case \"uint64\":\n        case \"sint64\":\n        case \"fixed64\":\n        case \"sfixed64\": gen\n            (\"if(!util.key64Re.test(%s))\", ref) // see comment above: x is ok, d is not\n                (\"return%j\", invalid(field, \"integer|Long key\"));\n            break;\n        case \"bool\": gen\n            (\"if(!util.key2Re.test(%s))\", ref)\n                (\"return%j\", invalid(field, \"boolean key\"));\n            break;\n    }\n    return gen;\n    /* eslint-enable no-unexpected-multiline */\n}\n\n/**\n * Generates a verifier specific to the specified message type.\n * @param {Type} mtype Message type\n * @returns {Codegen} Codegen instance\n */\nfunction verifier(mtype) {\n    /* eslint-disable no-unexpected-multiline */\n\n    var gen = util.codegen([\"m\"], mtype.name + \"$verify\")\n    (\"if(typeof m!==\\\"object\\\"||m===null)\")\n        (\"return%j\", \"object expected\");\n    var oneofs = mtype.oneofsArray,\n        seenFirstField = {};\n    if (oneofs.length) gen\n    (\"var p={}\");\n\n    for (var i = 0; i < /* initializes */ mtype.fieldsArray.length; ++i) {\n        var field = mtype._fieldsArray[i].resolve(),\n            ref   = \"m\" + util.safeProp(field.name);\n\n        if (field.optional) gen\n        (\"if(%s!=null&&m.hasOwnProperty(%j)){\", ref, field.name); // !== undefined && !== null\n\n        // map fields\n        if (field.map) { gen\n            (\"if(!util.isObject(%s))\", ref)\n                (\"return%j\", invalid(field, \"object\"))\n            (\"var k=Object.keys(%s)\", ref)\n            (\"for(var i=0;i<k.length;++i){\");\n                genVerifyKey(gen, field, \"k[i]\");\n                genVerifyValue(gen, field, i, ref + \"[k[i]]\")\n            (\"}\");\n\n        // repeated fields\n        } else if (field.repeated) { gen\n            (\"if(!Array.isArray(%s))\", ref)\n                (\"return%j\", invalid(field, \"array\"))\n            (\"for(var i=0;i<%s.length;++i){\", ref);\n                genVerifyValue(gen, field, i, ref + \"[i]\")\n            (\"}\");\n\n        // required or present fields\n        } else {\n            if (field.partOf) {\n                var oneofProp = util.safeProp(field.partOf.name);\n                if (seenFirstField[field.partOf.name] === 1) gen\n            (\"if(p%s===1)\", oneofProp)\n                (\"return%j\", field.partOf.name + \": multiple values\");\n                seenFirstField[field.partOf.name] = 1;\n                gen\n            (\"p%s=1\", oneofProp);\n            }\n            genVerifyValue(gen, field, i, ref);\n        }\n        if (field.optional) gen\n        (\"}\");\n    }\n    return gen\n    (\"return null\");\n    /* eslint-enable no-unexpected-multiline */\n}"
  },
  {
    "path": "src/wrappers.js",
    "content": "\"use strict\";\n\n/**\n * Wrappers for common types.\n * @type {Object.<string,IWrapper>}\n * @const\n */\nvar wrappers = exports;\n\nvar Message = require(\"./message\");\n\n/**\n * From object converter part of an {@link IWrapper}.\n * @typedef WrapperFromObjectConverter\n * @type {function}\n * @param {Object.<string,*>} object Plain object\n * @returns {Message<{}>} Message instance\n * @this Type\n */\n\n/**\n * To object converter part of an {@link IWrapper}.\n * @typedef WrapperToObjectConverter\n * @type {function}\n * @param {Message<{}>} message Message instance\n * @param {IConversionOptions} [options] Conversion options\n * @returns {Object.<string,*>} Plain object\n * @this Type\n */\n\n/**\n * Common type wrapper part of {@link wrappers}.\n * @interface IWrapper\n * @property {WrapperFromObjectConverter} [fromObject] From object converter\n * @property {WrapperToObjectConverter} [toObject] To object converter\n */\n\n// Custom wrapper for Any\nwrappers[\".google.protobuf.Any\"] = {\n\n    fromObject: function(object) {\n\n        // unwrap value type if mapped\n        if (object && object[\"@type\"]) {\n             // Only use fully qualified type name after the last '/'\n            var name = object[\"@type\"].substring(object[\"@type\"].lastIndexOf(\"/\") + 1);\n            var type = this.lookup(name);\n            /* istanbul ignore else */\n            if (type) {\n                // type_url does not accept leading \".\"\n                var type_url = object[\"@type\"].charAt(0) === \".\" ?\n                    object[\"@type\"].slice(1) : object[\"@type\"];\n                // type_url prefix is optional, but path seperator is required\n                if (type_url.indexOf(\"/\") === -1) {\n                    type_url = \"/\" + type_url;\n                }\n                return this.create({\n                    type_url: type_url,\n                    value: type.encode(type.fromObject(object)).finish()\n                });\n            }\n        }\n\n        return this.fromObject(object);\n    },\n\n    toObject: function(message, options) {\n\n        // Default prefix\n        var googleApi = \"type.googleapis.com/\";\n        var prefix = \"\";\n        var name = \"\";\n\n        // decode value if requested and unmapped\n        if (options && options.json && message.type_url && message.value) {\n            // Only use fully qualified type name after the last '/'\n            name = message.type_url.substring(message.type_url.lastIndexOf(\"/\") + 1);\n            // Separate the prefix used\n            prefix = message.type_url.substring(0, message.type_url.lastIndexOf(\"/\") + 1);\n            var type = this.lookup(name);\n            /* istanbul ignore else */\n            if (type)\n                message = type.decode(message.value);\n        }\n\n        // wrap value if unmapped\n        if (!(message instanceof this.ctor) && message instanceof Message) {\n            var object = message.$type.toObject(message, options);\n            var messageName = message.$type.fullName[0] === \".\" ?\n                message.$type.fullName.slice(1) : message.$type.fullName;\n            // Default to type.googleapis.com prefix if no prefix is used\n            if (prefix === \"\") {\n                prefix = googleApi;\n            }\n            name = prefix + messageName;\n            object[\"@type\"] = name;\n            return object;\n        }\n\n        return this.toObject(message, options);\n    }\n};\n"
  },
  {
    "path": "src/writer.js",
    "content": "\"use strict\";\nmodule.exports = Writer;\n\nvar util      = require(\"./util/minimal\");\n\nvar BufferWriter; // cyclic\n\nvar LongBits  = util.LongBits,\n    base64    = util.base64,\n    utf8      = util.utf8;\n\n/**\n * Constructs a new writer operation instance.\n * @classdesc Scheduled writer operation.\n * @constructor\n * @param {function(*, Uint8Array, number)} fn Function to call\n * @param {number} len Value byte length\n * @param {*} val Value to write\n * @ignore\n */\nfunction Op(fn, len, val) {\n\n    /**\n     * Function to call.\n     * @type {function(Uint8Array, number, *)}\n     */\n    this.fn = fn;\n\n    /**\n     * Value byte length.\n     * @type {number}\n     */\n    this.len = len;\n\n    /**\n     * Next operation.\n     * @type {Writer.Op|undefined}\n     */\n    this.next = undefined;\n\n    /**\n     * Value to write.\n     * @type {*}\n     */\n    this.val = val; // type varies\n}\n\n/* istanbul ignore next */\nfunction noop() {} // eslint-disable-line no-empty-function\n\n/**\n * Constructs a new writer state instance.\n * @classdesc Copied writer state.\n * @memberof Writer\n * @constructor\n * @param {Writer} writer Writer to copy state from\n * @ignore\n */\nfunction State(writer) {\n\n    /**\n     * Current head.\n     * @type {Writer.Op}\n     */\n    this.head = writer.head;\n\n    /**\n     * Current tail.\n     * @type {Writer.Op}\n     */\n    this.tail = writer.tail;\n\n    /**\n     * Current buffer length.\n     * @type {number}\n     */\n    this.len = writer.len;\n\n    /**\n     * Next state.\n     * @type {State|null}\n     */\n    this.next = writer.states;\n}\n\n/**\n * Constructs a new writer instance.\n * @classdesc Wire format writer using `Uint8Array` if available, otherwise `Array`.\n * @constructor\n */\nfunction Writer() {\n\n    /**\n     * Current length.\n     * @type {number}\n     */\n    this.len = 0;\n\n    /**\n     * Operations head.\n     * @type {Object}\n     */\n    this.head = new Op(noop, 0, 0);\n\n    /**\n     * Operations tail\n     * @type {Object}\n     */\n    this.tail = this.head;\n\n    /**\n     * Linked forked states.\n     * @type {Object|null}\n     */\n    this.states = null;\n\n    // When a value is written, the writer calculates its byte length and puts it into a linked\n    // list of operations to perform when finish() is called. This both allows us to allocate\n    // buffers of the exact required size and reduces the amount of work we have to do compared\n    // to first calculating over objects and then encoding over objects. In our case, the encoding\n    // part is just a linked list walk calling operations with already prepared values.\n}\n\nvar create = function create() {\n    return util.Buffer\n        ? function create_buffer_setup() {\n            return (Writer.create = function create_buffer() {\n                return new BufferWriter();\n            })();\n        }\n        /* istanbul ignore next */\n        : function create_array() {\n            return new Writer();\n        };\n};\n\n/**\n * Creates a new writer.\n * @function\n * @returns {BufferWriter|Writer} A {@link BufferWriter} when Buffers are supported, otherwise a {@link Writer}\n */\nWriter.create = create();\n\n/**\n * Allocates a buffer of the specified size.\n * @param {number} size Buffer size\n * @returns {Uint8Array} Buffer\n */\nWriter.alloc = function alloc(size) {\n    return new util.Array(size);\n};\n\n// Use Uint8Array buffer pool in the browser, just like node does with buffers\n/* istanbul ignore else */\nif (util.Array !== Array)\n    Writer.alloc = util.pool(Writer.alloc, util.Array.prototype.subarray);\n\n/**\n * Pushes a new operation to the queue.\n * @param {function(Uint8Array, number, *)} fn Function to call\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @returns {Writer} `this`\n * @private\n */\nWriter.prototype._push = function push(fn, len, val) {\n    this.tail = this.tail.next = new Op(fn, len, val);\n    this.len += len;\n    return this;\n};\n\nfunction writeByte(val, buf, pos) {\n    buf[pos] = val & 255;\n}\n\nfunction writeVarint32(val, buf, pos) {\n    while (val > 127) {\n        buf[pos++] = val & 127 | 128;\n        val >>>= 7;\n    }\n    buf[pos] = val;\n}\n\n/**\n * Constructs a new varint writer operation instance.\n * @classdesc Scheduled varint writer operation.\n * @extends Op\n * @constructor\n * @param {number} len Value byte length\n * @param {number} val Value to write\n * @ignore\n */\nfunction VarintOp(len, val) {\n    this.len = len;\n    this.next = undefined;\n    this.val = val;\n}\n\nVarintOp.prototype = Object.create(Op.prototype);\nVarintOp.prototype.fn = writeVarint32;\n\n/**\n * Writes an unsigned 32 bit value as a varint.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.uint32 = function write_uint32(value) {\n    // here, the call to this.push has been inlined and a varint specific Op subclass is used.\n    // uint32 is by far the most frequently used operation and benefits significantly from this.\n    this.len += (this.tail = this.tail.next = new VarintOp(\n        (value = value >>> 0)\n                < 128       ? 1\n        : value < 16384     ? 2\n        : value < 2097152   ? 3\n        : value < 268435456 ? 4\n        :                     5,\n    value)).len;\n    return this;\n};\n\n/**\n * Writes a signed 32 bit value as a varint.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.int32 = function write_int32(value) {\n    return value < 0\n        ? this._push(writeVarint64, 10, LongBits.fromNumber(value)) // 10 bytes per spec\n        : this.uint32(value);\n};\n\n/**\n * Writes a 32 bit value as a varint, zig-zag encoded.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sint32 = function write_sint32(value) {\n    return this.uint32((value << 1 ^ value >> 31) >>> 0);\n};\n\nfunction writeVarint64(val, buf, pos) {\n    while (val.hi) {\n        buf[pos++] = val.lo & 127 | 128;\n        val.lo = (val.lo >>> 7 | val.hi << 25) >>> 0;\n        val.hi >>>= 7;\n    }\n    while (val.lo > 127) {\n        buf[pos++] = val.lo & 127 | 128;\n        val.lo = val.lo >>> 7;\n    }\n    buf[pos++] = val.lo;\n}\n\n/**\n * Writes an unsigned 64 bit value as a varint.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.uint64 = function write_uint64(value) {\n    var bits = LongBits.from(value);\n    return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a signed 64 bit value as a varint.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.int64 = Writer.prototype.uint64;\n\n/**\n * Writes a signed 64 bit value as a varint, zig-zag encoded.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sint64 = function write_sint64(value) {\n    var bits = LongBits.from(value).zzEncode();\n    return this._push(writeVarint64, bits.length(), bits);\n};\n\n/**\n * Writes a boolish value as a varint.\n * @param {boolean} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bool = function write_bool(value) {\n    return this._push(writeByte, 1, value ? 1 : 0);\n};\n\nfunction writeFixed32(val, buf, pos) {\n    buf[pos    ] =  val         & 255;\n    buf[pos + 1] =  val >>> 8   & 255;\n    buf[pos + 2] =  val >>> 16  & 255;\n    buf[pos + 3] =  val >>> 24;\n}\n\n/**\n * Writes an unsigned 32 bit value as fixed 32 bits.\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.fixed32 = function write_fixed32(value) {\n    return this._push(writeFixed32, 4, value >>> 0);\n};\n\n/**\n * Writes a signed 32 bit value as fixed 32 bits.\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.sfixed32 = Writer.prototype.fixed32;\n\n/**\n * Writes an unsigned 64 bit value as fixed 64 bits.\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.fixed64 = function write_fixed64(value) {\n    var bits = LongBits.from(value);\n    return this._push(writeFixed32, 4, bits.lo)._push(writeFixed32, 4, bits.hi);\n};\n\n/**\n * Writes a signed 64 bit value as fixed 64 bits.\n * @function\n * @param {Long|number|string} value Value to write\n * @returns {Writer} `this`\n * @throws {TypeError} If `value` is a string and no long library is present.\n */\nWriter.prototype.sfixed64 = Writer.prototype.fixed64;\n\n/**\n * Writes a float (32 bit).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.float = function write_float(value) {\n    return this._push(util.float.writeFloatLE, 4, value);\n};\n\n/**\n * Writes a double (64 bit float).\n * @function\n * @param {number} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.double = function write_double(value) {\n    return this._push(util.float.writeDoubleLE, 8, value);\n};\n\nvar writeBytes = util.Array.prototype.set\n    ? function writeBytes_set(val, buf, pos) {\n        buf.set(val, pos); // also works for plain array values\n    }\n    /* istanbul ignore next */\n    : function writeBytes_for(val, buf, pos) {\n        for (var i = 0; i < val.length; ++i)\n            buf[pos + i] = val[i];\n    };\n\n/**\n * Writes a sequence of bytes.\n * @param {Uint8Array|string} value Buffer or base64 encoded string to write\n * @returns {Writer} `this`\n */\nWriter.prototype.bytes = function write_bytes(value) {\n    var len = value.length >>> 0;\n    if (!len)\n        return this._push(writeByte, 1, 0);\n    if (util.isString(value)) {\n        var buf = Writer.alloc(len = base64.length(value));\n        base64.decode(value, buf, 0);\n        value = buf;\n    }\n    return this.uint32(len)._push(writeBytes, len, value);\n};\n\n/**\n * Writes a string.\n * @param {string} value Value to write\n * @returns {Writer} `this`\n */\nWriter.prototype.string = function write_string(value) {\n    var len = utf8.length(value);\n    return len\n        ? this.uint32(len)._push(utf8.write, len, value)\n        : this._push(writeByte, 1, 0);\n};\n\n/**\n * Forks this writer's state by pushing it to a stack.\n * Calling {@link Writer#reset|reset} or {@link Writer#ldelim|ldelim} resets the writer to the previous state.\n * @returns {Writer} `this`\n */\nWriter.prototype.fork = function fork() {\n    this.states = new State(this);\n    this.head = this.tail = new Op(noop, 0, 0);\n    this.len = 0;\n    return this;\n};\n\n/**\n * Resets this instance to the last state.\n * @returns {Writer} `this`\n */\nWriter.prototype.reset = function reset() {\n    if (this.states) {\n        this.head   = this.states.head;\n        this.tail   = this.states.tail;\n        this.len    = this.states.len;\n        this.states = this.states.next;\n    } else {\n        this.head = this.tail = new Op(noop, 0, 0);\n        this.len  = 0;\n    }\n    return this;\n};\n\n/**\n * Resets to the last state and appends the fork state's current write length as a varint followed by its operations.\n * @returns {Writer} `this`\n */\nWriter.prototype.ldelim = function ldelim() {\n    var head = this.head,\n        tail = this.tail,\n        len  = this.len;\n    this.reset().uint32(len);\n    if (len) {\n        this.tail.next = head.next; // skip noop\n        this.tail = tail;\n        this.len += len;\n    }\n    return this;\n};\n\n/**\n * Finishes the write operation.\n * @returns {Uint8Array} Finished buffer\n */\nWriter.prototype.finish = function finish() {\n    var head = this.head.next, // skip noop\n        buf  = this.constructor.alloc(this.len),\n        pos  = 0;\n    while (head) {\n        head.fn(head.val, buf, pos);\n        pos += head.len;\n        head = head.next;\n    }\n    // this.head = this.tail = null;\n    return buf;\n};\n\nWriter._configure = function(BufferWriter_) {\n    BufferWriter = BufferWriter_;\n    Writer.create = create();\n    BufferWriter._configure();\n};\n"
  },
  {
    "path": "src/writer_buffer.js",
    "content": "\"use strict\";\nmodule.exports = BufferWriter;\n\n// extends Writer\nvar Writer = require(\"./writer\");\n(BufferWriter.prototype = Object.create(Writer.prototype)).constructor = BufferWriter;\n\nvar util = require(\"./util/minimal\");\n\n/**\n * Constructs a new buffer writer instance.\n * @classdesc Wire format writer using node buffers.\n * @extends Writer\n * @constructor\n */\nfunction BufferWriter() {\n    Writer.call(this);\n}\n\nBufferWriter._configure = function () {\n    /**\n     * Allocates a buffer of the specified size.\n     * @function\n     * @param {number} size Buffer size\n     * @returns {Buffer} Buffer\n     */\n    BufferWriter.alloc = util._Buffer_allocUnsafe;\n\n    BufferWriter.writeBytesBuffer = util.Buffer && util.Buffer.prototype instanceof Uint8Array && util.Buffer.prototype.set.name === \"set\"\n        ? function writeBytesBuffer_set(val, buf, pos) {\n          buf.set(val, pos); // faster than copy (requires node >= 4 where Buffers extend Uint8Array and set is properly inherited)\n          // also works for plain array values\n        }\n        /* istanbul ignore next */\n        : function writeBytesBuffer_copy(val, buf, pos) {\n          if (val.copy) // Buffer values\n            val.copy(buf, pos, 0, val.length);\n          else for (var i = 0; i < val.length;) // plain array values\n            buf[pos++] = val[i++];\n        };\n};\n\n\n/**\n * @override\n */\nBufferWriter.prototype.bytes = function write_bytes_buffer(value) {\n    if (util.isString(value))\n        value = util._Buffer_from(value, \"base64\");\n    var len = value.length >>> 0;\n    this.uint32(len);\n    if (len)\n        this._push(BufferWriter.writeBytesBuffer, len, value);\n    return this;\n};\n\nfunction writeStringBuffer(val, buf, pos) {\n    if (val.length < 40) // plain js is faster for short strings (probably due to redundant assertions)\n        util.utf8.write(val, buf, pos);\n    else if (buf.utf8Write)\n        buf.utf8Write(val, pos);\n    else\n        buf.write(val, pos);\n}\n\n/**\n * @override\n */\nBufferWriter.prototype.string = function write_string_buffer(value) {\n    var len = util.Buffer.byteLength(value);\n    this.uint32(len);\n    if (len)\n        this._push(writeStringBuffer, len, value);\n    return this;\n};\n\n\n/**\n * Finishes the write operation.\n * @name BufferWriter#finish\n * @function\n * @returns {Buffer} Finished buffer\n */\n\nBufferWriter._configure();\n"
  },
  {
    "path": "tests/README.md",
    "content": "This folder contains all the tests, one per file.\n\nIt is essential that tests only use the cross-platform API that is also available in browsers:\n\n* Use `load`, not `loadSync`\n* Use `Reader.create`, not `BufferReader`\n* Use `Writer.create`, not `BufferWriter`\n* It is safe to use `Long`, but TypeScript tests must import the type from `\"long\"`\n\nIf it's absolutely inevitable for your test case to use node-specific features, you can still use this pattern:\n\n```js\nif (protobuf.util.isNode) {\n    // node-specific tests\n}\n```\n\n**Why?** Tests are run both under node.js and within all kinds of modern to ancient browsers automatically.\n"
  },
  {
    "path": "tests/api_Class.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"message Something {}\";\n\ntape.test(\"reflected classes\", function(test) {\n\n    var root = protobuf.parse(proto).root,\n        Something = root.lookup(\"Something\");\n\n    test.throws(function() {\n        protobuf.Class(\"a\");\n    }, TypeError, \"Class should throw if first argument is not a Type\");\n\n    test.throws(function() {\n        protobuf.Class(Something, \"a\");\n    }, TypeError, \"Class should throw if second argument is not a function\");\n\n    test.end();\n});"
  },
  {
    "path": "tests/api_common.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"common types\", function(test) {\n\n    protobuf.common(\"google/protobuf/foo.proto\", {\n        nested: {\n            google: {\n                nested: {\n                    protobuf: {\n                        nested: {\n                            Foo: {\n                                fields: {}\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    });\n\n    test.ok(protobuf.common[\"google/protobuf/foo.proto\"], \"should expose custom definitions\");\n    test.same(protobuf.common.get(\"google/protobuf/any.proto\"), protobuf.common[\"google/protobuf/any.proto\"], \"should also get() any definition\");\n    test.equal(protobuf.common.get(\"google/protobuf/doesntexist.proto\"), null, \"should return null from get() if there is no such definition\");\n    test.end();\n});"
  },
  {
    "path": "tests/api_converters.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf  = require(\"..\");\n\ntape.test(\"converters\", function(test) {\n\n    protobuf.load(\"tests/data/convert.proto\", function(err, root) {\n        if (err)\n            return test.fail(err.message);\n\n        var Message = root.lookup(\"Message\");\n\n        test.test(test.name + \" - Message#toObject\", function(test) {\n\n            test.plan(6);\n\n            test.test(test.name + \" - called with defaults = true\", function(test) {\n                var obj = Message.toObject(Message.create(), { defaults: true });\n\n                test.equal(obj.stringVal, \"\", \"should set stringVal\");\n                test.same(obj.stringRepeated, [], \"should set stringRepeated\");\n\n                test.same(obj.uint64Val, { low: 0, high: 0, unsigned: true }, \"should set uint64Val\");\n                test.same(obj.uint64Repeated, [], \"should set uint64Repeated\");\n\n                test.same(obj.bytesVal, protobuf.util.newBuffer(0), \"should set bytesVal\");\n                test.same(obj.bytesRepeated, [], \"should set bytesRepeated\");\n\n                test.equal(obj.enumVal, 1, \"should set enumVal to the first defined value\");\n                test.same(obj.enumRepeated, [], \"should set enumRepeated\");\n\n                test.same(obj.int64Map, {}, \"should set int64Map\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - called with defaults = undefined\", function(test) {\n                var obj = Message.toObject(Message.create());\n\n                test.equal(obj.stringVal, undefined, \"should not set stringVal\");\n                test.equal(obj.stringRepeated, undefined, \"should not set stringRepeated\");\n\n                test.equal(obj.uint64Val, undefined, \"should not set uint64Val\");\n                test.equal(obj.uint64Repeated, undefined, \"should not set uint64Repeated\");\n\n                test.equal(obj.bytesVal, undefined, \"should not set bytesVal\");\n                test.equal(obj.bytesRepeated, undefined, \"should not set bytesRepeated\");\n\n                test.equal(obj.enumVal, undefined, \"should not set enumVal\");\n                test.equal(obj.enumRepeated, undefined, \"should not set enumRepeated\");\n\n                test.equal(obj.int64Map, undefined, \"should not set int64 map\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - called with arrays = true\", function(test) {\n                var obj = Message.toObject(Message.create(), { arrays: true });\n\n                test.equal(obj.stringVal, undefined, \"should not set stringVal\");\n                test.same(obj.stringRepeated, [], \"should set stringRepeated\");\n\n                test.equal(obj.uint64Val, undefined, \"should not set uint64Val\");\n                test.same(obj.uint64Repeated, [], \"should set uint64Repeated\");\n\n                test.equal(obj.bytesVal, undefined, \"should not set bytesVal\");\n                test.same(obj.bytesRepeated, [], \"should set bytesRepeated\");\n\n                test.equal(obj.enumVal, undefined, \"should not set enumVal\");\n                test.same(obj.enumRepeated, [], \"should set enumRepeated\");\n\n                test.equal(obj.int64Map, undefined, \"should not set int64Map\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - called with objects = true\", function(test) {\n                var obj = Message.toObject(Message.create(), { objects: true });\n\n                test.equal(obj.stringVal, undefined, \"should not set stringVal\");\n                test.equal(obj.stringRepeated, undefined, \"should not set stringRepeated\");\n\n                test.equal(obj.uint64Val, undefined, \"should not set uint64Val\");\n                test.same(obj.uint64Repeated, undefined, \"should not set uint64Repeated\");\n\n                test.equal(obj.bytesVal, undefined, \"should not set bytesVal\");\n                test.same(obj.bytesRepeated, undefined, \"should not set bytesRepeated\");\n\n                test.equal(obj.enumVal, undefined, \"should not set enumVal\");\n                test.same(obj.enumRepeated, undefined, \"should not set enumRepeated\");\n\n                test.same(obj.int64Map, {}, \"should set int64Map\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should convert\", function(test) {\n                var buf = protobuf.util.newBuffer(3);\n                buf[0] = buf[1] = buf[2] = 49; // \"111\"\n                var msg = Message.create({\n                    uint64Val: protobuf.util.Long.fromNumber(1),\n                    uint64Repeated: [2, 3],\n                    bytesVal: buf,\n                    bytesRepeated: [buf, buf],\n                    enumVal: 2,\n                    enumRepeated: [1, 100, 2],\n                    int64Map: {\n                        a: protobuf.util.Long.fromNumber(2),\n                        b: protobuf.util.Long.fromNumber(3)\n                    }\n                });\n\n                var msgLongsToNumber = Message.toObject(msg, { longs: Number }),\n                    msgLongsToString = Message.toObject(msg, { longs: String });\n\n                test.same(Message.ctor.toObject(msg, { longs: Number}), msgLongsToNumber, \"should convert the same using the static and the instance method\");\n                test.same(Message.ctor.toObject(msg, { longs: String}), msgLongsToString, \"should convert the same using the static and the instance method\");\n\n                test.equal(msgLongsToNumber.uint64Val, 1, \"longs to numbers\");\n                test.equal(msgLongsToString.uint64Val, \"1\", \"longs to strings\");\n                test.same(msgLongsToNumber.int64Map, { a: 2, b: 3}, \"long map values to numbers\");\n                test.same(msgLongsToString.int64Map, { a: \"2\", b: \"3\"}, \"long map values to strings\");\n\n                test.equal(Object.prototype.toString.call(Message.toObject(msg, { bytes: Array }).bytesVal), \"[object Array]\", \"bytes to arrays\");\n                test.equal(Message.toObject(msg, { bytes: String }).bytesVal, \"MTEx\", \"bytes to base64 strings\");\n                if (protobuf.util.isNode)\n                    test.ok(Buffer.isBuffer(Message.toObject(msg, { bytes: Buffer }).bytesVal), \"bytes to buffers\");\n\n                test.equal(Message.toObject(msg, { enums: String }).enumVal, \"TWO\", \"enums to strings\");\n                test.equal(Message.toObject(msg, { enums: String }).enumRepeated[1], 100, \"enums to strings does not change unknown values\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - Message.toObject with empty buffers\", function(test) {\n                var msg = Message.create({\n                    bytesVal: protobuf.util.newBuffer(0),\n                });\n\n                test.equal(Message.toObject(msg, { bytes: String }).bytesVal, \"\", \"bytes to base64 strings\");\n\n                if (protobuf.util.isNode) {\n                    const bytesVal = Message.toObject(msg, { bytes: Buffer }).bytesVal; \n                    test.ok(Buffer.isBuffer(bytesVal), \"bytes to buffers\");\n                    test.equal(bytesVal.length, 0, \"empty buffer\");\n                }\n\n                test.end();\n            });            \n\n        });\n\n        test.test(test.name + \" - Message.fromObject\", function(test) {\n\n            var obj = {\n                uint64Val: 1,\n                uint64Repeated: [1, \"2\"],\n                bytesVal: \"MTEx\",\n                bytesRepeated: [\"MTEx\", [49, 49, 49]],\n                enumVal: \"ONE\",\n                enumRepeated: [2, \"TWO\", 100],\n                int64Map: {\n                    a: 2,\n                    b: \"3\"\n                }\n            };\n            var msg = Message.fromObject(obj);\n\n            test.same(Message.ctor.fromObject(obj), msg, \"should convert the same using the static and the instance method\");\n            test.equal(Message.fromObject(msg), msg, \"should just return the object if already a runtime message\");\n\n            var buf = protobuf.util.newBuffer(3);\n            buf[0] = buf[1] = buf[2] = 49; // \"111\"\n\n            test.same(msg.uint64Val, { low: 1, high: 0, unsigned: true }, \"should set uint64Val from a number\");\n            test.same(msg.uint64Repeated, [ { low: 1, high: 0, unsigned: true}, { low: 2, high: 0, unsigned: true } ], \"should set uint64Repeated from a number and a string\");\n            test.same(msg.bytesVal, buf, \"should set bytesVal from a base64 string\");\n            test.same(msg.bytesRepeated, [ buf, buf ], \"should set bytesRepeated from a base64 string and a plain array\");\n            test.equal(msg.enumVal, 1, \"should set enumVal from a string\");\n            test.same(msg.enumRepeated, [ 2, 2, 100 ], \"should set enumRepeated from a number and a string and preserve unknown value\");\n            test.same(msg.int64Map, { a: { low: 2, high: 0, unsigned: false }, b: { low: 3, high: 0, unsigned: false } }, \"should set int64Map from a number and a string\");\n\n            test.end();\n        });\n\n        test.test(test.name + \" - Message#toJSON\", function(test) {\n            var msg = Message.create();\n            msg.$type = {\n                toObject: function(obj, opt) {\n                    test.same(opt, protobuf.util.toJSONOptions, \"should use toJSONOptions with toJSON\");\n                    test.end();\n                }\n            };\n            msg.toJSON();\n        });\n\n        test.end();\n    });\n\n});\n"
  },
  {
    "path": "tests/api_enum.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"reflected enums\", function(test) {\n\n    var enm = new protobuf.Enum(\"Test\", {\n        a: 1,\n        b: 2,\n    });\n\n    var enm_allow_alias = new protobuf.Enum( 'AliasTest',\n    { a: 0 }, { allow_alias: true } );\n\n    test.throws(function() {\n        new protobuf.Enum(\"Test\", true);\n    }, TypeError, \"should throw if values is specified but not an object\");\n\n    test.same(enm.valuesById, {\n        1: \"a\",\n        2: \"b\"\n    }, \"should also expose their values by id\");\n\n    test.throws(function() {\n        enm.add(2, 2);\n    }, TypeError, \"should throw if name is not a string\");\n\n    test.throws(function() {\n        enm.add(\"c\", 1.5);\n    }, TypeError, \"should throw if id is not an integer\");\n\n    test.throws(function() {\n        enm.add(\"b\", 2);\n    }, Error, \"should throw if name is a duplicate\");\n\n    test.throws(function() {\n        enm.add(\"c\", 2);\n    }, Error, \"should throw if id is a duplicate, without allow_alias option\");\n\n    enm.add(\"c\", 3);\n    test.same(enm.values, {\n        a: 1,\n        b: 2,\n        c: 3\n    }, \"should allow adding new values\");\n    test.same(enm.valuesById, {\n        1: \"a\",\n        2: \"b\",\n        3: \"c\"\n    }, \"should also expose any new values by id\");\n\n    test.throws(function() {\n        enm.remove(1);\n    }, TypeError, \"should throw if name is not a string\");\n\n    test.throws(function() {\n        enm.remove(\"d\");\n    }, Error, \"should throw if name is not present\");\n\n    enm.remove(\"b\");\n    test.same(enm.values, {\n        a: 1,\n        c: 3\n    }, \"should allow removing existing values\");\n    test.same(enm.valuesById, {\n        1: \"a\",\n        3: \"c\"\n    }, \"should no longer expose any removed values by id\");\n\n    test.same(enm.toJSON(), {\n        values: {\n            a: 1,\n            c: 3\n        }\n    }, \"should export values to JSON\");\n\n    enm_allow_alias.add( 'b', 0 );\n    test.same( enm_allow_alias.values, {\n      a: 0,\n      b: 0\n    });\n\n    enm.add('e', 4, undefined, {'(test_option)': 'test_value'});\n    test.same( enm.valuesOptions, {\n        'e': {\n            '(test_option)': 'test_value'\n        }\n    });\n    enm.remove(\"e\");\n    test.same( enm.valuesOptions, {}, \"should clean up value options\");\n\n    enm.reserved = [[100,200], \"BAD_NAME\"];\n    test.throws(function() {\n        enm.add(\"d\", 101);\n    }, Error, \"should throw if id is a reserved number\");\n\n    test.throws(function() {\n        enm.add(\"BAD_NAME\", 5);\n    }, Error, \"should throw if id is a reserved name\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution legacy proto3\", function(test) {\n    var json = {\n        values: {\n            a: 0, b: 1\n        }\n    };\n    var messageJson = {\n        fields: {},\n        nested: { Enum: { values: {\n            a: 0, b:1\n        } } }\n    };\n    var root = new protobuf.Root();\n    var Enum = protobuf.Enum.fromJSON(\"Enum\", json);\n    var Message = protobuf.Type.fromJSON(\"Message\", messageJson)\n    var Nested = Message.nested.Enum;\n    root.add(Enum).add(Message).resolveAll();\n\n    test.same(Enum.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Message.toJSON(), messageJson, \"container JSON should roundtrip\");\n    test.same(Nested.toJSON(), messageJson.nested.Enum, \"nested JSON should roundtrip\");\n\n    test.equal(Enum._edition, \"proto3\", \"should infer proto3 syntax\");\n    test.equal(Enum._features.enum_type, \"OPEN\", \"should be open by default\");\n\n    test.equal(Nested._edition, null, \"should not set edition\");\n    test.equal(Nested._features.enum_type, \"OPEN\", \"should be open by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution proto2\", function(test) {\n    var json = {\n        edition: \"proto2\",\n        values: {\n            a: 0, b: 1\n        }\n    };\n    var messageJson = {\n        edition: \"proto2\",\n        fields: {},\n        nested: { Enum: { values: {\n            a: 0, b: 1\n        } } }\n    };\n    var root = new protobuf.Root();\n    var Enum = protobuf.Enum.fromJSON(\"Enum\", json);\n    var Message = protobuf.Type.fromJSON(\"Message\", messageJson)\n    var Nested = Message.nested.Enum;\n    root.add(Enum).add(Message).resolveAll();\n\n    test.same(Enum.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Message.toJSON(), messageJson, \"container JSON should roundtrip\");\n    test.same(Nested.toJSON(), messageJson.nested.Enum, \"nested JSON should roundtrip\");\n\n    test.equal(Enum._edition, \"proto2\", \"should set edition\");\n    test.equal(Enum._features.enum_type, \"CLOSED\", \"should be closed by default\");\n\n    test.equal(Nested._edition, null, \"should not set edition\");\n    test.equal(Nested._features.enum_type, \"CLOSED\", \"should be closed by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution legacy proto3\", function(test) {\n    var json = {\n        edition: \"2023\",\n        values: {\n            a: 0, b: 1\n        }\n    };\n    var messageJson = {\n        edition: \"2023\",\n        options: { features: { enum_type: \"CLOSED\" } },\n        fields: {},\n        nested: { Enum: { values: {\n            a: 0, b: 1\n        } } }\n    };\n    var root = new protobuf.Root();\n    var Enum = protobuf.Enum.fromJSON(\"Enum\", json);\n    var Message = protobuf.Type.fromJSON(\"Message\", messageJson)\n    var Nested = Message.nested.Enum;\n    root.add(Enum).add(Message).resolveAll();\n\n    test.same(Enum.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Message.toJSON(), messageJson, \"container JSON should roundtrip\");\n    test.same(Nested.toJSON(), messageJson.nested.Enum, \"nested JSON should roundtrip\");\n\n    test.equal(Enum._edition, \"2023\", \"should set edition\");\n    test.equal(Enum._features.enum_type, \"OPEN\", \"should be open by default\");\n\n    test.equal(Nested._edition, null, \"should not set edition\");\n    test.equal(Nested._features.enum_type, \"CLOSED\", \"should inherit override\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_field.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"reflected fields\", function(test) {\n\n    test.throws(function() {\n        new protobuf.Field(1);\n    }, TypeError, \"should throw if name is not a string\");\n\n    test.throws(function() {\n        new protobuf.Field(\"a\", 1.5);\n    }, TypeError, \"should throw if id is not an integer\");\n\n    test.throws(function() {\n        new protobuf.Field(\"a\", -5);\n    }, TypeError, \"should throw if id is negative\");\n\n    test.throws(function() {\n        new protobuf.Field(\"a\", 1, 5);\n    }, TypeError, \"should throw if type is not a string\");\n\n    test.throws(function() {\n        new protobuf.Field(\"a\", 1, \"uint32\", \"optiona\");\n    }, TypeError, \"should throw if rule is specified but not a rule string\");\n\n    test.throws(function() {\n        new protobuf.Field(\"a\", 1, \"uint32\", \"optional\", 1);\n    }, TypeError, \"should throw if extend is specified but not a string\");\n\n    test.throws(function() {\n        new protobuf.Field(\"a\", 1, \"uint32\", \"optional\", \"B\", true);\n    }, TypeError, \"should throw if options is specified but not an object\");\n\n    test.throws(function() {\n        var field = new protobuf.Field(\"a\", 1, \"UnDeFiNeD\");\n        new protobuf.Root().add(new protobuf.Type(\"A\").add(field));\n        field.resolve();\n    }, Error, \"should throw if type cannot be resolved\");\n\n    var root = new protobuf.Root(),\n        type,\n        field = new protobuf.Field(\"a\", 1, \"uint32\", /* rule */ undefined, /* skipped extend, */ /* options */ {});\n\n    test.same(field.toJSON(), {\n        type: \"uint32\",\n        id: 1,\n        options: {}\n    }, \"should export to JSON\");\n\n    root.add(\n        type = new protobuf.Type(\"Test\").add(\n            field = new protobuf.Field(\"a\", 1, \"Enm\", /* skipped rule and extend, */ { \"default\": \"ONE\" })\n        )\n    ).add(\n        new protobuf.Enum(\"Enm\", { \"ONE\": 1, \"TWO\": 2 })\n    ).resolveAll();\n\n    test.ok(field.resolvedType instanceof protobuf.Enum, \"should resolve to an enum\");\n\n    test.equal(field.typeDefault, 1, \"should recognize enum default values as strings\");\n\n    field.resolved = false;\n    field.options[\"default\"] = 2;\n    field.resolve();\n\n    test.equal(field.typeDefault, 2, \"should recognize enum default values as numbers\");\n\n    type.add(field = new protobuf.Field(\"b\", 2, \"bytes\", { default: \"dGVzdA==\"}));\n    field.resolve();\n\n    test.same(Array.prototype.slice.call(field.typeDefault), \"test\".split(\"\").map(function(c) { return c.charCodeAt(0); }), \"should recognize bytes default values as base64 encoded strings\");\n\n    field.resolved = false;\n    field.options[\"default\"] = \"teststr\"; // quirk: length not a multiple of 4 if using a subset of base64 chars\n    field.resolve();\n\n    test.same(Array.prototype.slice.call(field.typeDefault), \"teststr\".split(\"\").map(function(c) { return c.charCodeAt(0); }), \"should recognize bytes default values as strings\");\n\n    field.resolved = 2;\n    field.resolve();\n    test.equal(field.resolved, 2, \"should not resolve again if already resolved\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution legacy proto3\", function(test) {\n    var json = {\n        type: \"string\", id: 1000, extend: \"Message\"\n    };\n    var messageJson = {\n        fields: {\n            a: { type: \"string\", id: 1}\n        },\n        extensions: [[1, 100000]],    \n    };\n    var root = new protobuf.Root();\n    var ext = protobuf.Field.fromJSON(\"ext\", json);\n    var Message = protobuf.Type.fromJSON(\"Message\", messageJson)\n    var field = Message.fields.a;\n    root.add(ext).add(Message).resolveAll();\n\n    test.same(ext.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Message.toJSON(), messageJson, \"container JSON should roundtrip\");\n    test.same(field.toJSON(), messageJson.fields.a, \"nested JSON should roundtrip\");\n\n    test.equal(ext._edition, \"proto3\", \"should set edition\");\n    test.equal(ext._features.utf8_validation, \"VERIFY\", \"should verify by default\");\n    test.ok(ext.hasPresence, \"should have explicit presence\");\n\n    test.equal(field._edition, null, \"should not set edition\");\n    test.equal(ext._features.utf8_validation, \"VERIFY\", \"should verify by default\");\n    test.notOk(field.hasPresence, \"should be implicit by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution proto2\", function(test) {\n    var json = {\n        edition: \"proto2\",\n        type: \"string\", id: 1000, extend: \"Message\"\n    };\n    var messageJson = {\n        edition: \"proto2\",\n        fields: {\n            a: { type: \"string\", id: 1}\n        },\n        extensions: [[1, 100000]],    \n    };\n    var root = new protobuf.Root();\n    var ext = protobuf.Field.fromJSON(\"ext\", json);\n    var Message = protobuf.Type.fromJSON(\"Message\", messageJson)\n    var field = Message.fields.a;\n    root.add(ext).add(Message).resolveAll();\n\n    test.same(ext.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Message.toJSON(), messageJson, \"container JSON should roundtrip\");\n    test.same(field.toJSON(), messageJson.fields.a, \"nested JSON should roundtrip\");\n\n    test.equal(ext._edition, \"proto2\", \"should set edition\");\n    test.ok(ext.hasPresence, \"should have explicit presence\");\n    test.equal(ext._features.utf8_validation, \"NONE\", \"should not verify by default\");\n\n    test.equal(field._edition, null, \"should not set edition\");\n    test.ok(field.hasPresence, \"should be explicit by default\");\n    test.equal(ext._features.utf8_validation, \"NONE\", \"should not verify by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution editions\", function(test) {\n    var json = {\n        edition: \"2023\",\n        options: { features: { utf8_validation: \"NONE\" } },\n        type: \"string\", id: 1000, extend: \"Message\"\n    };\n    var messageJson = {\n        edition: \"2023\",\n        options: { features: { field_presence: \"IMPLICIT\" } },\n        fields: {\n            a: { type: \"string\", id: 1}\n        },\n        extensions: [[1, 100000]],    \n    };\n    var root = new protobuf.Root();\n    var ext = protobuf.Field.fromJSON(\"ext\", json);\n    var Message = protobuf.Type.fromJSON(\"Message\", messageJson)\n    var field = Message.fields.a;\n    root.add(ext).add(Message).resolveAll();\n\n    test.same(ext.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Message.toJSON(), messageJson, \"container JSON should roundtrip\");\n    test.same(field.toJSON(), messageJson.fields.a, \"nested JSON should roundtrip\");\n\n    test.equal(ext._edition, \"2023\", \"should set edition\");\n    test.ok(ext.hasPresence, \"should be explicit by default\");\n    test.equal(ext._features.utf8_validation, \"NONE\", \"should get file overrides\");\n\n    test.equal(field._edition, null, \"should not set edition\");\n    test.notOk(field.hasPresence, \"should get message overrides\");\n    test.equal(field._features.utf8_validation, \"VERIFY\", \"should verify by default\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_inheritance.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar objects = [\n    protobuf.Enum,\n    protobuf.Field,\n    protobuf.MapField,\n    protobuf.Method,\n    protobuf.Namespace,\n    protobuf.Root,\n    protobuf.Service,\n    protobuf.Type\n];\n\nvar namespaces = [\n    protobuf.Root,\n    protobuf.Service,\n    protobuf.Type\n];\n\nvar fields = [\n    protobuf.MapField\n];\n\ntape.test(\"inheritance\", function(test) {\n\n    objects.forEach(function(object) {\n        test.ok(object.prototype instanceof protobuf.ReflectionObject, object.className + \" should extend ReflectionObject\");\n    });\n\n    namespaces.forEach(function(ns) {\n        test.ok(ns.prototype instanceof protobuf.Namespace, ns.className + \" should extend Namespace\");\n    });\n\n    fields.forEach(function(field) {\n        test.ok(field.prototype instanceof protobuf.Field, field.className + \" should extend Field\");\n    });\n\n    test.end();\n\n});"
  },
  {
    "path": "tests/api_longbits.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\nvar LongBits = protobuf.util.LongBits;\nvar Long = protobuf.util.Long;\n\ntape.test(\"longbits\", function(test) {\n\n    test.test(test.name + \" - zero\", function(test) {\n        var zero = LongBits.zero;\n        test.equal(zero.lo, 0, \"should have low bits of 0\");\n        test.equal(zero.hi, 0, \"should have high bits of 0\");\n        test.equal(zero.toNumber(), 0, \"should convert to number 0 (signed)\");\n        test.equal(zero.toNumber(true), 0, \"should convert to number 0 (unsigned)\");\n        test.equal(zero.zzEncode(), zero, \"should return itself when zig-zag encoded\");\n        test.equal(zero.length(), 1, \"should return a byte length of 1\");\n        test.equal(LongBits.fromNumber(0), zero, \"should be returned by fromNumber(0)\");\n        test.equal(LongBits.from(0), zero, \"should be returned by from(0)\");\n        test.equal(LongBits.from(Long.ZERO), zero, \"should be returned by from(Long.ZERO)\");\n        test.same(zero.toLong(), Long.ZERO, \"should equal Long.ZERO (signed)\");\n        test.same(zero.toLong(true), Long.UZERO, \"should equal Long.UZERO (unsigned)\");\n        test.equal(zero.toHash(), \"\\0\\0\\0\\0\\0\\0\\0\\0\", \"should convert to a binary hash of 8x0\");\n        test.equal(protobuf.util.longToHash(0), \"\\0\\0\\0\\0\\0\\0\\0\\0\", \"should convert to a binary hash of 8x0 (number 0 through util.longToHash)\");\n        test.equal(LongBits.fromHash(\"\\0\\0\\0\\0\\0\\0\\0\\0\"), zero, \"should be returned for a binary hash of 8x0\");\n        protobuf.util.Long = null;\n        test.equal(protobuf.util.longFromHash(\"\\0\\0\\0\\0\\0\\0\\0\\0\"), 0, \"should be returned for a binary hash of 8x0 (number 0 through util.longFromHash)\");\n        protobuf.util.Long = Long;\n        test.end();\n    });\n\n    [\n        { low: 0, high: 0, unsigned: false, length: 1 },\n        { low: 0, high: 0, unsigned: true, length: 1 },\n        { low: (1 << 7) - 1, high: 0, unsigned: false, length: 1 },\n        { low: (1 << 7) - 1, high: 0, unsigned: true, length: 1 },\n        { low: (1 << 14) - 1, high: 0, unsigned: false, length: 2 },\n        { low: (1 << 14) - 1, high: 0, unsigned: true, length: 2 },\n        { low: (1 << 21) - 1, high: 0, unsigned: false, length: 3 },\n        { low: (1 << 21) - 1, high: 0, unsigned: true, length: 3 },\n        { low: (1 << 28) - 1, high: 0, unsigned: false, length: 4 },\n        { low: (1 << 28) - 1, high: 0, unsigned: true, length: 4 },\n        { low: -1, high: (1 << 3) - 1, unsigned: false, length: 5 },\n        { low: -1, high: (1 << 3) - 1, unsigned: true, length: 5 },\n        { low: -1, high: (1 << 10) - 1, unsigned: false, length: 6 },\n        { low: -1, high: (1 << 10) - 1, unsigned: true, length: 6 },\n        { low: -1, high: (1 << 17) - 1, unsigned: false, length: 7 },\n        { low: -1, high: (1 << 17) - 1, unsigned: true, length: 7 },\n        { low: -1, high: (1 << 24) - 1, unsigned: false, length: 8 },\n        { low: -1, high: (1 << 24) - 1, unsigned: true, length: 8 },\n        { low: -1, high: (1 << 31) - 1 | 0, unsigned: false, length: 9 },\n        { low: -1, high: (1 << 31) - 1 | 0, unsigned: true, length: 9 },\n        { low: -1, high: -1, unsigned: false, length: 10 },\n        { low: -1, high: -1, unsigned: true, length: 10 },\n        { low: 0, high: 1 << 31, unsigned: false, length: 10 },\n        { low: 0, high: 1 << 31, unsigned: true, length: 10 },\n        { low: 0, high: -1, unsigned: false, length: 10 }\n    ]\n    .forEach(function(value) {\n        var long = Long.fromValue(value);\n        test.equal(long.unsigned, value.unsigned, long + \" should be signed/unsigned\");\n        var bits = LongBits.from(value);\n        test.equal(bits.lo, long.low >>> 0, long + \" should have equal low bits\");\n        test.equal(bits.hi, long.high >>> 0, long + \" should have equal high bits\");\n        test.equal(bits.length(), value.length, long + \" should return an equal length\");\n        test.equal(bits.toNumber(value.unsigned), long.toNumber(), long + \" should convert to an equal number\");\n        var number = long.toNumber(value.unsigned);\n        if (number <= 9007199254740991 && number >= -9007199254740991)\n            test.same(LongBits.fromNumber(number), bits, long + \" should convert hence and forth equally (where safe)\");\n        test.same(bits.toLong(value.unsigned), long, long + \" should convert to an equal Long\");\n        var comp = String.fromCharCode.apply(String, long.toBytesLE());\n        test.equal(bits.toHash(), comp, long + \" should convert to an equal hash\");\n        test.equal(protobuf.util.longToHash(long), comp, long + \" should convert to an equal hash through util.longToHash\");\n        test.same(LongBits.fromHash(comp), bits, long + \" should convert back to an equal value\");\n        test.same(protobuf.util.longFromHash(comp, long.unsigned), long, long + \" should convert back to an equal value through util.longFromHash\");\n    });\n\n    var num = -4294967296 * 4294967296;\n    var bits = LongBits.fromNumber(num);\n    test.same(bits, { lo: 0, hi: 0 }, \"lo and hi should properly overflow when converting \" + num);\n\n    test.end();\n});"
  },
  {
    "path": "tests/api_mapfield.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar def = {\n    keyType: \"bytes\",\n    type: \"string\",\n    id: 1\n};\n\ntape.test(\"reflected map fields\", function(test) {\n\n    var field = protobuf.MapField.fromJSON(\"a\", def);\n    test.same(field.toJSON(), def, \"should construct from and convert back to JSON\");\n\n    test.throws(function() {\n        field.resolve();\n    }, Error, \"should throw for invalid key types\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_namespace.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar def = {};\n\nvar proto = \"package ns;\\\nenum Enm {\\\n    ONE = 1;\\\n    TWO = 2;\\\n}\\\nmessage Msg {\\\n    message Enm {}\\\n}\\\nservice Svc {}\";\n\ntape.test(\"reflected namespaces\", function(test) {\n\n    var ns = protobuf.Namespace.fromJSON(\"ns\", def);\n    test.same(ns.toJSON(), def, \"should construct from and convert back to JSON\");\n\n    var root = protobuf.parse(proto).root;\n    ns = root.lookup(\"ns\").resolveAll();\n    test.same(ns.getEnum(\"Enm\"), { ONE: 1, TWO: 2 }, \"should get enums\");\n\n    test.throws(function() {\n        ns.getEnum(\"Msg\");\n    }, Error, \"should throw when getting a message as an enum\");\n\n    test.throws(function() {\n        ns.getEnum(\"NOTFOUND\");\n    }, Error, \"should throw when getting null as an enum\");\n\n    test.ok(ns.lookupType(\"Msg\"), \"should lookup types\");\n\n    test.equal(ns.get(\"Msg\").lookupTypeOrEnum(\"Enm\"), ns.lookup(\".ns.Msg.Enm\"), \"should lookup the nearest type or enum\");\n\n    test.throws(function() {\n        ns.lookupType(\"Enm\");\n    }, Error, \"should throw when looking up an enum as a type\");\n\n    test.throws(function() {\n        ns.lookupType(\"NOTFOUND\");\n    }, Error, \"should throw when looking up null as a type\");\n\n    test.ok(ns.lookupEnum(\"Enm\"), \"should lookup enums\");\n\n    test.throws(function() {\n        ns.lookupEnum(\"Msg\");\n    }, Error, \"should throw when looking up a type as an enum\");\n\n    test.throws(function() {\n        ns.lookupEnum(\"NOTFOUND\");\n    }, Error, \"should throw when looking up null as an enum\");\n\n    test.ok(ns.lookupService(\"Svc\"), \"should lookup services\");\n\n    test.throws(function() {\n        ns.lookupService(\"Msg\");\n    }, Error, \"should throw when looking up a type as a service\");\n\n    test.throws(function() {\n        ns.lookupService(\"NOTFOUND\");\n    }, Error, \"should throw when looking up null as a service\");\n\n    test.equal(ns.lookup(\"\"), ns, \"should lookup itself for an empty path\");\n\n    test.equal(ns.lookup([]), ns, \"should lookup itself for []\");\n\n    test.ok(ns.lookup(\".\") instanceof protobuf.Root, \"should lookup root for .\");\n\n    test.ok(ns.lookup([\"\"]) instanceof protobuf.Root, \"should lookup root for [\\\"\\\"]\");\n\n    test.throws(function() {\n        ns.define(null);\n    }, \"should throw when path is not a string or array\");\n\n    test.throws(function() {\n        ns.define(\".sub\", {});\n    }, \"should throw when defining absolute .sub\");\n\n    test.throws(function() {\n        ns.define([\"\", \"sub\"], {});\n    }, \"should throw when defining absolute [\\\"\\\", \\\"sub\\\"]\");\n\n    var sub = ns.define(\"sub\", {});\n    test.equal(ns.lookup(\"sub\"), sub, \"should define sub namespaces\");\n\n    test.throws(function() {\n        ns.add(new protobuf.ReflectionObject(\"invalid\"));\n    }, TypeError, \"should throw when adding invalid nested objects\");\n\n    test.throws(function() {\n        ns.add(new protobuf.Enum(\"sub\"));\n    }, Error, \"should throw on duplicate names\");\n\n    sub = ns.define(\"sub.sub\");\n    test.equal(ns.lookup(\"sub.sub\"), sub, \"should define sub sub namespaces\");\n\n    test.throws(function() {\n        ns.remove(true);\n    }, TypeError, \"should throw when trying to remove non-reflection objects\");\n\n    test.throws(function() {\n        ns.remove(new protobuf.Enum(\"Enm\"));\n    }, Error, \"should throw when trying to remove non-children\");\n\n    test.throws(function() {\n        ns.add(new protobuf.Enum(\"MyEnum\", {}));\n        ns.define(\"MyEnum\");\n    }, Error, \"should throw when trying to define a path conflicting with non-namespace objects\");\n\n    ns = protobuf.Namespace.fromJSON(\"My\", {\n        nested: {\n            Message: { fields: {} },\n            Enum: { values: {} },\n            Service: { methods: {} },\n            extensionField: { type: \"string\", id: 1000, extend: \"Message\" },\n            Other: { nested: {} }\n        }\n    });\n    test.same(ns.toJSON(), {\n        nested: {\n            Message: { fields: {} },\n            Enum: { values: {} },\n            Service: { methods: {} },\n            extensionField: { extend: \"Message\", id: 1000, type: \"string\" },\n            Other: { }\n        }\n    }, \"should create from Type, Enum, Service, extension Field and Namespace JSON\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_object.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"reflection objects\", function(test) {\n\n    test.throws(function() { new protobuf.ReflectionObject(null); }, TypeError, \"should throw on construction if name is not a string\");\n    test.throws(function() { new protobuf.ReflectionObject(\"name\", true); }, TypeError, \"should throw on construction if options is not an object if not omitted\");\n\n    var obj = new protobuf.ReflectionObject(\"Test\");\n\n    obj.resolve();\n    test.equal(obj.resolved, false, \"should not resolve when not part of a root\");\n\n    obj.resolved = 2;\n    obj.resolve();\n    test.equal(obj.resolved, 2, \"should not resolve again when already resolved\");\n    obj.resolved = false;\n\n    obj.setOptions({ a: 1, b: 2 });\n    test.same(obj.options, { a: 1, b: 2 }, \"should set multiple options\");\n    obj.setOptions(undefined);\n    test.same(obj.options, { a: 1, b: 2 }, \"should accept undefined as options\");    \n    obj.setOption(\"c\", 3);\n    test.same(obj.options, { a: 1, b: 2, c: 3 }, \"should set single options\");\n\n    obj.setParsedOption(\"opt1\", {a: 1, b: 2});\n    test.same(obj.parsedOptions, [{\"opt1\": {a: 1, b: 2}}], \"should set single parsed option\");\n    obj.setParsedOption(\"opt1\", {a: 3, b: 4});\n    test.same(obj.parsedOptions, [{\"opt1\": {a: 1, b: 2}}, {\"opt1\": {a: 3, b: 4}}], \"should allow same option twice\");\n    obj.setParsedOption(\"opt2\", 1, \"x\");\n    test.same(obj.parsedOptions, [{\"opt1\": {a: 1, b: 2}}, {\"opt1\": {a: 3, b: 4}}, {\"opt2\": {x: 1}}], \"should create new option using property path\");\n    obj.setParsedOption(\"opt2\", 5, \"a.b\");\n    test.same(obj.parsedOptions, [{\"opt1\": {a: 1, b: 2}}, {\"opt1\": {a: 3, b: 4}}, {\"opt2\": {x: 1, a: {b :5}}}], \"should merge new property path in existing option\");\n    obj.setParsedOption(\"opt2\", 6, \"x\");\n    test.same(obj.parsedOptions, [{\"opt1\": {a: 1, b: 2}}, {\"opt1\": {a: 3, b: 4}}, {\"opt2\": {x: [1,6], a: {b :5}}}], \"should convert property to array when set more than once\");\n\n\n    test.equal(obj.toString(), \"ReflectionObject Test\", \"should convert to a string (even if not part of a root)\");\n    obj.name = \"\";\n    test.equal(obj.toString(), \"ReflectionObject\", \"should convert to a string even with no full name\");\n\n    test.end();\n});"
  },
  {
    "path": "tests/api_oneof.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar def = {\n    oneof: [\"a\", \"b\"],\n    options: {}\n};\n\nvar proto = \"syntax = \\\"proto3\\\";\\\nimport \\\"google/protobuf/descriptor.proto\\\";\\\nextend google.protobuf.FileOptions { optional int32 ecs_component_id = 50000;}\\\noption (ecs_component_id) = 1020;\\\nmessage Test {\\\n    oneof kind {\\\n        uint32 a = 1;\\\n        string b = 2;\\\n    }\\\n    bool c = 3;\\\n}\";\n\ntape.test(\"reflected oneofs\", function(test) {\n\n    var oneof = protobuf.OneOf.fromJSON(\"kind\", {\n        oneof: [\"a\", \"b\"],\n        options: {}\n    });\n    test.same(oneof.toJSON(), def, \"should construct from and convert back to JSON\");\n\n    var root = protobuf.parse(proto).root;\n    var Test = root.lookup(\"Test\");\n    var kind = Test.get(\"kind\");\n    var field = Test.get(\"c\");\n\n    kind.add(field);\n    test.same(kind.toJSON(), {\n        oneof: [\"a\", \"b\", \"c\"]\n    }, \"should allow adding fields\");\n    test.ok(Test.get(\"c\"), \"should still have the field on the parent\");\n\n    kind.remove(field);\n    test.same(kind.toJSON(), {\n        oneof: [\"a\", \"b\"]\n    }, \"should allow removing fields\");\n    test.ok(Test.get(\"c\"), \"should still have the field on the parent\");\n\n    var Test2 = new protobuf.Type(\"Test2\");\n    root.add(Test2);\n    Test2.add(field);\n    kind.add(field);\n    test.notOk(Test2.get(\"c\"), \"should remove the field from the previous parent\");\n\n    var looseField = new protobuf.Field(\"d\", 4, \"float\");\n    kind.add(looseField); // no parent\n    Test.remove(looseField);\n    Test.remove(kind);\n    test.same(Test.fields, {}, \"should remove all fields from the parent\");\n    test.same(kind.oneof, [\"a\",\"b\",\"c\",\"d\"], \"should still have the fields on the oneof\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_reader-writer-reuse.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"message A {\\\n    required uint32 a = 1;\\\n}\\\nmessage B {\\\n    required string b = 1;\\\n}\";\n\ntape.test(\"reusing\", function(test) {\n    var root = protobuf.parse(proto).root;\n\n    var A = root.lookup(\"A\"),\n        B = root.lookup(\"B\");\n\n    test.test(test.name + \" - a writer should write\", function(test) {\n\n        var writer = protobuf.Writer.create();\n\n        A.encodeDelimited({\n            a: 1\n        }, writer);\n\n        B.encodeDelimited({\n            b: \"a\"\n        }, writer);\n\n        var buffer = writer.finish();\n\n        test.equal(buffer[0], 2, \"length 2\");\n        test.equal(buffer[1], 8, \"id 1, wireType 0\");\n        test.equal(buffer[2], 1, \"number 1\");\n        test.equal(buffer[3], 3, \"length 3\");\n        test.equal(buffer[4], 10, \"id 1, wireType 2\");\n        test.equal(buffer[5], 1, \"length 1\");\n        test.equal(buffer[6], 97, \"string 'a'\");\n\n        var reader = protobuf.Reader.create(buffer);\n\n        test.test(test.name + \" - and a reader should\", function(test) {\n\n            var a = A.decodeDelimited(reader);\n            test.deepEqual(a, { a: 1 }, \"read back the first message\");\n\n            var b = B.decodeDelimited(reader);\n            test.deepEqual(b, { b: \"a\" }, \"read back the second message\");\n\n            test.equal(reader.pos, reader.len, \"consume the reader\");\n\n            test.end();\n        });\n\n        test.end();\n    });\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_root-deferred.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf  = require(\"..\"),\n    Namespace = protobuf.Namespace,\n    Type      = protobuf.Type,\n    Field     = protobuf.Field;\n\ntape.test(\"extension fields\", function(test) {\n\n    var root = new protobuf.Root({ noGoogleTypes: true }),\n        ns = new Namespace(\"my\"),\n        type = new Type(\"DeclaringType\"),\n        declaringField = new Field(\"declaringField\", 1, \"string\", \"optional\", \"ExtendedType\");\n    root.add(ns.add(type.add(declaringField)));\n\n    test.deepEqual(root.deferred[0], declaringField, \"should be deferred until their extended type can be resolved\");\n\n    var extendedType = new Type(\"ExtendedType\");\n    ns.add(extendedType);\n    var extensionField = extendedType.get(declaringField.fullName);\n    test.equal(extensionField, declaringField.extensionField, \"should become available once their extended type is known\");\n\n    type.remove(declaringField);\n    extensionField = extendedType.get(declaringField.fullName);\n    test.equal(extensionField, null, \"should become unavailable when their declaring field is removed\");\n\n    type.add(declaringField);\n    extensionField = extendedType.get(declaringField.fullName);\n    test.equal(extensionField, declaringField.extensionField, \"should become instantly available if their extended type is knwon\");\n\n    ns.remove(extendedType);\n    type.remove(declaringField);\n    type.add(declaringField);\n    test.throws(function() {\n        root.resolveAll();\n    }, Error, \"should throw on resolveAll if there are unresolvable extensions\");\n    type.remove(declaringField);\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_root-expose.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf  = require(\"..\");\n\ntape.test(\"exposure handlers\", function(test) {\n    var root = new protobuf.Root();\n\n    var ns = new protobuf.Namespace(\"MyNamespace\");\n    root.add(ns);\n    test.ok(root.MyNamespace, \"should expose namespaces on roots\");\n\n    var type = new protobuf.Type(\"MyType\");\n    ns.add(type);\n    test.ok(root.MyNamespace.MyType, \"should expose types on namespaces\");\n\n    var lcType = new protobuf.Type(\"myType\");\n    ns.add(lcType);\n    test.notOk(root.MyNamespace.myType, \"should not expose lower-cased types on namespaces\");\n\n    var enm = new protobuf.Enum(\"MyEnum\", {});\n    type.add(enm);\n    test.ok(root.MyNamespace.MyType.MyEnum, \"should expose enums on types\");\n\n    var lcEnm = new protobuf.Enum(\"myEnum\", {});\n    type.add(lcEnm);\n    test.notOk(root.MyNamespace.MyType.myEnum, \"should not expose lower-cased enums on types\");\n\n    ns.remove(type);\n    test.notOk(root.MyNamespace.MyType, \"should unexpose types on namespaces\");\n\n    type.remove(enm);\n    test.notOk(type.MyEnum, \"should unexpose enums on types, even if no longer part of a root\");\n\n    root.remove(ns);\n    test.notOk(root.MyNamespace, \"should unexpose namespaces on roots\");\n\n    test.end();\n});"
  },
  {
    "path": "tests/api_root.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar Root = protobuf.Root;\n\nvar def = {\n    nested: {},\n    options: { javaPackage: \"com.something\" }\n};\n\ntape.test(\"reflected roots\", function(test) {\n\n    test.test(test.name + \" - construct\", function(test) {\n        var root = Root.fromJSON(def);\n        test.ok(root instanceof Root, \"should construct from JSON\");\n        var root2 = Root.fromJSON(def, root);\n        test.equal(root2, root, \"should construct from JSON and reuse specified Root\");\n        test.end();\n    });\n\n    if (typeof Promise !== \"undefined\")\n    test.test(test.name + \" - promise\", function(test) {\n        var root = new Root();\n        var promise = root.load(\"tests/data/common.proto\");\n        test.ok(promise instanceof Promise, \"should return a Promise when loading without a callback\");\n        promise\n        .then(function() {\n            test.pass(\"should resolve\");\n            test.end();\n        })\n        .catch(function() {\n            test.fail(\"should not reject\");\n        });\n    });\n\n    test.test(test.name + \" - json\", function(test) {\n        var root = new Root();\n        test.plan(3);\n        root.load(\"tests/data/common.json\", function(err) {\n            if (err)\n                return test.fail(\"should not return an error when loading JSON files: \" + err.message);\n            test.ok(root.lookupType(\"google.protobuf.Any\"), \"should load JSON files\");\n            root.load(\"tests/data/common.json\", function(err) {\n                test.same(root.files, [ \"tests/data/common.json\" ], \"should not attempt to load the same file twice\");\n                test.notOk(err, \"should not return an error when loading files twice\");\n                test.end();\n            });\n        });\n    });\n\n    test.test(test.name + \" - weak\", function(test) {\n        var root = new Root();\n        test.plan(1);        \n        root.load([\"tests/data/weak.proto\"], function (err) {\n            test.notOk(err, \"should ignore missing weak imports\");\n            test.end();\n        });\n    });\n\n    test.test(test.name + \" - missing\", function(test) {\n        var root = new Root();\n        test.plan(1);\n        root.load(\"tests/data/NOTFOUND\", function(err) {\n            test.ok(err, \"should return an error when trying to load missing protos\");\n            test.end();\n        });\n    });\n\n    test.test(test.name + \" - missing import\", function(test) {\n        var root = new Root();\n        test.plan(2);\n        root.load(\"tests/data/badimport.proto\", function(err) {\n            test.ok(err, \"should return an error when an imported file does not exist\");\n            test.match(err.toString(), /nonexistent\\.proto/, \"should mention the file name which was not found\");\n            test.end();\n        });\n    });\n\n    test.test(test.name + \" - missing import, sync load\", function(test) {\n        var root = new Root();\n        test.plan(2);\n        try {\n            root.loadSync(\"tests/data/badimport.proto\");\n            root.resolveAll();\n        } catch (err) {\n            test.ok(err, \"should return an error when an imported file does not exist\");\n            test.match(err.toString(), /nonexistent\\.proto/, \"should mention the file name which was not found\");\n        }\n        test.end();\n    });\n\n    test.test(test.name + \" - skipped\", function(test) {\n        var root = new Root();\n        root.resolvePath = function() {\n            return null;\n        };\n        test.plan(1);\n        root.load(\"tests/data/NOTFOUND2\", function(err) {\n            test.notOk(err, \"should skip files without error when resolvePath returns null\");\n            test.end();\n        });\n    });\n\n    test.test(test.name + \" - skipped import\", function(test) {\n        var root = new Root();\n        root.resolvePath = function(origin, target) {\n            if (/weak\\.proto$/.test(target))\n                return protobuf.util.path.resolve(origin, target);\n            return null;\n        };\n        test.plan(1);\n        root.load(\"tests/data/weak.proto\", function(err) {\n            test.notOk(err, \"should skip files without error when resolvePath returns null\");\n            test.end();\n        });\n    });\n});\n\n\ntape.test(\"feature resolution legacy proto3\", function(test) {\n    var json = {\n        nested: { Message: {\n            fields: {\n                packed: { type: \"int32\", id: 2, rule: \"repeated\" },\n                unpacked: { type: \"int32\", id: 3, rule: \"repeated\", options: { packed: false } }\n            },\n            nested: { Nested: { fields: {\n                packed: { type: \"int32\", id: 2, rule: \"repeated\" },\n                unpacked: { type: \"int32\", id: 3, rule: \"repeated\", options: { packed: false } }\n            } } }\n        } }\n    };\n    var root = protobuf.Root.fromJSON(json);\n    var Type = root.lookup(\"Message\");\n    var Nested = Type.nested.Nested;\n\n    test.same(root.toJSON(), json, \"JSON should roundtrip\");\n\n    test.ok(Type.fields.packed.packed, \"should have packed encoding by default\");\n    test.notOk(Type.fields.unpacked.packed, \"should override expanded encoding\");\n\n    test.ok(Nested.fields.packed.packed, \"nested should have packed encoding by default\");\n    test.notOk(Nested.fields.unpacked.packed, \"nested should override expanded encoding\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution proto2\", function(test) {\n    var json = {\n        nested: { Message: {\n            edition: \"proto2\",\n            fields: {\n                packed: { type: \"int32\", id: 3, rule: \"repeated\", options: { packed: true } },\n                unpacked: { type: \"int32\", id: 4, rule: \"repeated\"}\n            },\n            nested: { Nested: { fields: {\n                packed: { type: \"int32\", id: 2, rule: \"repeated\", options: { packed: true } },\n                unpacked: { type: \"int32\", id: 3, rule: \"repeated\" }\n            } } }\n        } }\n    };\n    var root = protobuf.Root.fromJSON(json);\n    var Type = root.lookup(\"Message\");\n    var Nested = Type.nested.Nested;\n\n    test.same(root.toJSON(), json, \"JSON should roundtrip\");\n\n    test.ok(Type.fields.packed.packed, \"should override packed encoding\");\n    test.notOk(Type.fields.unpacked.packed, \"should have expanded encoding by default\");\n\n    test.notOk(Nested.fields.unpacked.packed, \"nested should have expanded encoding by default\");\n    test.ok(Nested.fields.packed.packed, \"nested should override packed encoding\");\n\n    test.end();\n});\n\n\ntape.test(\"feature resolution edition 2023\", function(test) {\n    var json = {\n        nested: { Message: {\n            edition: \"2023\",\n            options: { \"features\": { \"field_presence\": \"IMPLICIT\" } },\n            fields: {\n                explicit: { type: \"string\", id: 1, options: { \"features\": { \"field_presence\": \"EXPLICIT\" } } },\n                implicit: { type: \"string\", id: 2 },\n            },\n            nested: { Nested: { fields: {\n                explicit: { type: \"string\", id: 1, options: { \"features\": { \"field_presence\": \"EXPLICIT\" } } },\n                implicit: { type: \"string\", id: 2 },\n            } } }\n        } }\n    };\n    var root = protobuf.Root.fromJSON(json);\n    var Type = root.lookup(\"Message\");\n    var Nested = Type.nested.Nested;\n\n    test.same(root.toJSON(), json, \"JSON should roundtrip\");\n\n    test.ok(Type.fields.explicit.hasPresence, \"should have explicit presence\");\n    test.notOk(Type.fields.implicit.hasPresence, \"should have implicit presence\");\n\n    test.ok(Nested.fields.explicit.hasPresence, \"nested should have explicit presence\");\n    test.notOk(Nested.fields.implicit.hasPresence, \"nested should have implicit presence\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_service-rpc-streaming.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"runtime services\", function(test) {\n\n    // FIXME\n\n    protobuf.load(\"tests/data/rpc.proto\", function(err, root) {\n        if (err)\n            return test.fail(err.message);\n\n        var MyService  = root.lookup(\"MyService\"),\n            MyMethod   = MyService.get(\"MyMethod\").resolve(),\n            MyRequest  = MyMethod.resolvedRequestType,\n            MyResponse = MyMethod.resolvedResponseType;\n\n        var statusCodes = [200, 400];\n        var timesCalled = 0;\n       \n        MyService = root.lookup(\"MyService\");\n\n        test.plan(2);\n\n        test.test(test.name + \" - closed server-side\", function(test) {\n\n            function rpc(method, requestData, callback) {\n                if (++timesCalled < 3) {\n                    test.test(test.name + \" - should call the rpc impl with\", function(test) {\n                        test.equal(method, MyMethod, \"the reflected method\");\n                        test.ok(requestData.length, \"a buffer\");\n                        test.ok(typeof callback === \"function\", \"a callback function\");\n                        test.end();\n                    });\n                    test.test(test.name + \" - should call with a buffer that contains\", function(test) {\n                        test.equal(requestData[0], 3, \"ldelim 3\");\n                        test.equal(requestData[1], 10, \"id 1, wireType 2\");\n                        test.equal(requestData[2], 1, \"length 1\");\n                        test.equal(requestData[3], 0x2f, \"the original string\");\n                        test.end();\n                    });\n                    setTimeout(function() {\n                        var status = statusCodes.shift();\n                        callback(null, MyResponse.encode({\n                            status: status\n                        }).finish());\n                        if (status === 200)\n                            callback(null, null); // ended server-side\n                    });\n                } else {\n                    test.equal(requestData, null, \"should signal ended client-side\");\n                }\n            }\n\n            var service = MyService.create(rpc, true, false);\n            service.myMethod(MyRequest.create({\n                path: \"/\"\n            }), function(err, response) {\n                if (err)\n                    return test.fail(err.message);\n                test.ok(response instanceof MyResponse.ctor, \"should return an instance of MyResponse\");\n                test.deepEqual(response, {\n                    status: 200\n                }, \"should return status 200\");\n\n                test.end();\n            });\n        });\n\n        test.test(test.name + \" - closed client-side\", function(test) {\n\n            function rpc(method, requestData, callback) {\n                if (++timesCalled < 3) {\n                    test.test(test.name + \" - should call the rpc impl with\", function(test) {\n                        test.equal(method, MyMethod, \"the reflected method\");\n                        test.ok(requestData.length, \"a buffer\");\n                        test.ok(typeof callback === \"function\", \"a callback function\");\n                        test.end();\n                    });\n                    test.test(test.name + \" - should call with a buffer that contains\", function(test) {\n                        test.equal(requestData[0], 3, \"ldelim 3\");\n                        test.equal(requestData[1], 10, \"id 1, wireType 2\");\n                        test.equal(requestData[2], 1, \"length 1\");\n                        test.equal(requestData[3], 0x2f, \"the original string\");\n                        test.end();\n                    });\n                    setTimeout(function() {\n                        var status = statusCodes.shift();\n                        callback(null, MyResponse.encode({\n                            status: status\n                        }).finish());\n                        if (status === 200)\n                            callback(null, null); // ended server-side\n                    });\n                } else {\n                    test.equal(requestData, null, \"should signal ended client-side\");\n                }\n            }\n\n            var service = MyService.create(rpc, true, false);\n            service.myMethod(MyRequest.create({\n                path: \"/\"\n            }), function(err, response) {\n                if (err)\n                    return test.fail(err.message);\n                test.ok(response instanceof MyResponse.ctor, \"should return an instance of MyResponse\");\n                test.deepEqual(response, {\n                    status: 400\n                }, \"should return status 400\");\n                service.end(); // ended client-side\n\n                var count = 0,\n                    total = 1;\n\n                if (typeof Promise !== \"undefined\") {\n                    ++total;\n                    var promise = service.myMethod(MyRequest.create({ path: \"/\" }));\n                    promise.catch(function(err) {\n                        test.ok(err, \"should return an error if already ended (Promise)\");\n                        if (++count === total)\n                            test.end();\n                    });\n                    test.ok(promise instanceof Promise, \"should return a promise if callback has been omitted (even if already ended)\");\n                }\n\n                service.myMethod(MyRequest.create({ path: \"/\" }), function(err) {\n                    test.ok(err, \"should return an error if already ended\");\n                    if (++count === total)\n                        test.end();\n                });\n            });\n        });\n    });\n});\n\nfunction fakeRPC(test) {\n    function rpc(method, requestData, callback) {\n        if (++timesCalled < 3) {\n            test.test(test.name + \" - should call the rpc impl with\", function(test) {\n                test.equal(method, MyMethod, \"the reflected method\");\n                test.ok(requestData.length, \"a buffer\");\n                test.ok(typeof callback === \"function\", \"a callback function\");\n                test.end();\n            });\n            test.test(test.name + \" - should call with a buffer that contains\", function(test) {\n                test.equal(requestData[0], 3, \"ldelim 3\");\n                test.equal(requestData[1], 10, \"id 1, wireType 2\");\n                test.equal(requestData[2], 1, \"length 1\");\n                test.equal(requestData[3], 0x2f, \"the original string\");\n                test.end();\n            });\n            setTimeout(function() {\n                var status = statusCodes.shift();\n                callback(null, MyResponse.encode({\n                    status: status\n                }).finish());\n                if (status === 200)\n                    callback(null, null); // ended server-side\n            });\n        } else {\n            test.equal(requestData, null, \"should signal ended client-side\");\n        }\n    }\n    return rpc;\n}"
  },
  {
    "path": "tests/api_service-rpc.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"syntax = \\\"proto3\\\";\\\npackage myservice;\\\nmessage DoSomethingRequest {\\\n}\\\nmessage DoSomethingResponse {\\\n}\\\nservice MyService {\\\n  rpc DoSomething(DoSomethingRequest) returns (DoSomethingResponse) {\\\n    option (google.api.http) = {\\\n      get: \\\"/v1/dosomething\\\"\\\n    };\\\n  };\\\n}\";\n\ntape.test(\"reflected services\", function(test) {\n    var root = protobuf.parse(proto).root;\n\n    var myservice = root.lookup(\"myservice\").resolveAll(),\n        MyService = myservice.MyService,\n        DoSomethingRequest = myservice.DoSomethingRequest,\n        DoSomethingResponse = myservice.DoSomethingResponse,\n        DoSomething = MyService.get(\"DoSomething\");\n\n    test.throws(function() {\n        MyService.create();\n    }, TypeError, \"should throw if rpcImpl is not specified\");\n\n    function rpcImpl(method, requestData, callback) {\n        if (requestData) {\n            test.equal(method, DoSomething, \"rpcImpl should reference the correct method\");\n            test.ok(callback, \"rpcImpl should provide a callback\");\n            setTimeout(function() {\n                callback(null, DoSomethingResponse.create());\n            });\n        } else {\n            test.equal(method, null, \"rpcImpl should not reference a method when closed\");\n            test.equal(callback, null, \"rpcImpl should not provide a callback when closed\");\n        }\n    }\n\n    var service = MyService.create(rpcImpl);\n\n    test.throws(function() {\n        service.doSomething();\n    }, TypeError, \"should throw if request is not specified\");\n\n    test.test(test.name + \" - should propagate errors from rpcImpl\", function(test) {\n        var err = Error();\n        var service2 = MyService.create(function(method, requestData, callback) { callback(err); });\n        var count = 0;\n        service2.on(\"error\", function(err2) {\n            test.equal(err2, err, \"should emit the exact error\");\n            if (++count === 2)\n                test.end();\n        });\n        service2.doSomething({}, function(err2) {\n            test.equal(err2, err, \"should return the exact error\");\n            if (++count === 2)\n                test.end();\n        });\n    });\n\n    test.test(test.name + \" - should catch errors within rpcImpl\", function(test) {\n        var err = Error();\n        var service2 = MyService.create(function(method, requestData, callback) { throw err; });\n        var count = 0;\n        service2.on(\"error\", function(err2) {\n            test.equal(err2, err, \"should emit the exact error\");\n            if (++count === 2)\n                test.end();\n        });\n        service2.doSomething({}, function(err2) {\n            test.equal(err2, err, \"should return the exact error\");\n            if (++count === 2)\n                test.end();\n        });\n    });\n\n    test.test(test.name + \" - should return errors from decoding\", function(test) {\n        var service2 = MyService.create(function(method, requestData, callback) { callback(null, protobuf.util.newBuffer(0) ); }, true, true);\n        var count = 0;\n        service2.on(\"error\", function(err2) {\n            test.ok(err2, \"should emit the error\");\n            if (++count === 2)\n                test.end();\n        });\n        service2.doSomething({}, function(err2) {\n            test.ok(err2, \"should return the error\");\n            if (++count === 2)\n                test.end();\n        });\n    });\n\n    var dataEmitted = false;\n    service.on(\"data\", function(responseData) {\n        dataEmitted = true;\n        test.ok(responseData, \"should emit the data event\");\n    });\n    var endCalled = false;\n    service.on(\"end\", function() {\n        test.notOk(endCalled, \"should not emit the end event twice\");\n        endCalled = true;\n        test.pass(\"should call the end event\");\n        service.end();\n        test.end();\n    });\n    service.doSomething(DoSomethingRequest.create(), function(err, res) {\n        test.notOk(err, \"should not raise an error\");\n        test.ok(res instanceof DoSomethingResponse.ctor, \"should return a properly typed response\");\n        test.ok(dataEmitted, \"should have emitted the data event\");\n        service.end();\n    });\n    \n});"
  },
  {
    "path": "tests/api_service.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar def = {\n    methods: {},\n    nested: {\n        SomeEnum: {\n            values: {}\n        }\n    }\n};\n\nvar methodDef = {\n    requestType: \"MyRequest\",\n    requestStream: true,\n    responseType: \"MyResponse\",\n    responseStream: true,\n    options: {}\n};\n\ntape.test(\"reflected services\", function(test) {\n\n    var MyService = protobuf.Service.fromJSON(\"MyService\", def);\n    test.same(MyService.toJSON(), def, \"should construct without methods from and convert back to JSON\");\n\n    var MyMethod = protobuf.Method.fromJSON(\"MyMethod\", methodDef);\n    test.same(MyMethod.toJSON(), methodDef, \"should constructos methods from and convert back to JSON\");\n\n    MyService.add(MyMethod);\n    test.ok(MyService.get(\"MyMethod\"), \"should allow adding methods\");\n    var other = new protobuf.Enum(\"Other\", {});\n    MyService.add(other);\n    test.ok(MyService.get(\"Other\"), \"should allow adding other nested objects\");\n    MyService.remove(other);\n    test.notOk(MyService.get(\"Other\"), \"should allow removing other nested objects\");\n    MyService.remove(MyMethod);\n    test.notOk(MyService.get(\"Other\"), \"should allow removing methods\");\n    test.same(MyService.toJSON(), def, \"should convert to initial JSON afterwards\");\n\n    def.methods.MyMethod = methodDef;\n    MyService = protobuf.Service.fromJSON(\"MyService\", def);\n    test.same(MyService.toJSON(), def, \"should construct with methods from and convert back to JSON\");\n    MyMethod = MyService.get(\"MyMethod\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution legacy proto3\", function(test) {\n    var json = {\n        methods: {\n            Method: {\n                requestType: \"Empty\",\n                responseType: \"Empty\",\n            }\n        },\n        nested: {\n            Empty: { fields: {} }\n        }\n    };\n    var root = new protobuf.Root();\n    var Service = protobuf.Service.fromJSON(\"Service\", json);\n    root.add(Service).resolveAll();\n\n    var Method = Service.methods.Method;\n\n    test.same(Service.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Method.toJSON(), json.methods.Method, \"method JSON should roundtrip\");\n\n    test.equal(Service._edition, \"proto3\", \"should infer proto3 syntax\");\n    test.equal(Service._features.field_presence, \"IMPLICIT\", \"should have implicit presence by default\");\n\n    test.equal(Method._edition, null, \"should not infer proto3 syntax\");\n    test.equal(Method._features.field_presence, \"IMPLICIT\", \"should have implicit presence by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution proto2\", function(test) {\n    var json = {\n        edition: \"proto2\",\n        methods: {\n            Method: {\n                requestType: \"Empty\",\n                responseType: \"Empty\",\n            }\n        },\n        nested: {\n            Empty: { fields: {} }\n        }\n    };\n    var root = new protobuf.Root();\n    var Service = protobuf.Service.fromJSON(\"Service\", json);\n    root.add(Service).resolveAll();\n\n    var Method = Service.methods.Method;\n\n    test.same(Service.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Method.toJSON(), json.methods.Method, \"method JSON should roundtrip\");\n\n    test.equal(Service._edition, \"proto2\", \"should infer proto2 syntax\");\n    test.equal(Service._features.field_presence, \"EXPLICIT\", \"should have explicit presence by default\");\n\n    test.equal(Method._edition, null, \"should not infer proto2 syntax\");\n    test.equal(Method._features.field_presence, \"EXPLICIT\", \"should have explicit presence by default\");\n\n    test.end();\n});\n\n\ntape.test(\"feature resolution edition 2023\", function(test) {\n    var json = {\n        edition: \"2023\",\n        options: { features: { \"(foo)\": { \"bar\": \"VALUE\" } } },\n        methods: {\n            Method: {\n                requestType: \"Empty\",\n                responseType: \"Empty\",\n            }\n        },\n        nested: {\n            Empty: { fields: {} }\n        }\n    };\n    var root = new protobuf.Root();\n    var Service = protobuf.Service.fromJSON(\"Service\", json);\n    root.add(Service).resolveAll();\n\n    var Method = Service.methods.Method;\n    var Empty = Service.nested.Empty;\n\n    test.same(Service.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Method.toJSON(), json.methods.Method, \"method JSON should roundtrip\");\n\n    test.equal(Service._edition, \"2023\", \"should set edition\");\n    test.equal(Service._features.field_presence, \"EXPLICIT\", \"should have explicit presence by default\");\n    test.equal(Service._features[\"(foo)\"].bar, \"VALUE\", \"should get file features\");\n\n    test.equal(Method._edition, null, \"should not set edition\");\n    test.equal(Method._features.field_presence, \"EXPLICIT\", \"should have explicit presence by default\");\n    test.equal(Method._features[\"(foo)\"].bar, \"VALUE\", \"should get file features\");\n\n    test.equal(Empty._edition, null, \"should not set edition\");\n    test.equal(Empty._features.field_presence, \"EXPLICIT\", \"should have explicit presence by default\");\n    test.equal(Empty._features[\"(foo)\"].bar, \"VALUE\", \"should get file features\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_tokenize.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar tokenize = protobuf.tokenize;\n\ntape.test(\"tokenize\", function(test) {\n\n    test.test(test.name + \" - unescape\", function(test) {\n        test.equal(tokenize.unescape(\"\\\\\\\\0 \\\\\\0 \\\\0 \\0\"), \"\\\\0  \\0 \\0\", \"should propery unescape zero-sequences\");\n        test.equal(tokenize.unescape(\"\\\\\\t\\\\t\\\\r\\\\n\"), \"\\t\\r\\n\", \"should propery unescape tabs and line feeds\");\n        test.end();\n    });\n\n    test.ok(expect(\"\", [null]), \"should instantly finish for an empty source\");\n    test.ok(expect(\"'hello\\\\nworld'\", [\"'\", \"hello\\nworld\", \"'\", null]), \"should parse single quoted strings\");\n    test.ok(expect(\"\\\"hello\\\\nworld\\\"\", [\"\\\"\", \"hello\\nworld\", \"\\\"\", null]), \"should parse double quoted strings\");\n    test.ok(expectError(\"\\\"as\\\"d\\\"\"), \"should throw for invalid strings\");\n\n    var tn = tokenize(\"message Test {}\");\n    test.throws(function() {\n        tn.skip(\"somethingelse\", false);\n    }, Error, \"should throw when skipping non-optional tokens\");\n    test.doesNotThrow(function() {\n        tn.skip(\"somethingelse\", true);\n    }, Error, \"should not throw when skipping optional tokens\");\n\n    tn = tokenize(\"// line comment\");\n    test.equal(tn.next(), null, \"should skip line comments on a single line\");\n    tn = tokenize(\"a /// line comment\\n\");\n    tn.next();\n    test.equal(tn.cmnt(1), \"line comment\", \"should peek for trailing line comments\");\n    tn = tokenize(\"/* block comment */\");\n    test.equal(tn.next(), null, \"should skip block comments on a single line\");\n    tn = tokenize(\"/// line comment\\na\\n\");\n    tn.next();\n    test.equal(tn.cmnt(), \"line comment\", \"should keep leading comments around while on the next line\");\n    tn = tokenize(\"/// leading comment A\\na /// trailing comment A\\nb /// trailing comment B\\n\");\n    tn.next();\n    test.equal(tn.cmnt(), \"leading comment A\", \"should parse leading comment\");\n    test.equal(tn.cmnt(tn.line), \"trailing comment A\", \"should parse trailing comment\");\n    tn.next();\n    test.equal(tn.cmnt(), null, \"trailing comment should not be recognized as leading comment for next line\");\n    test.equal(tn.cmnt(tn.line), \"trailing comment B\", \"should parse trailing comment\");\n    tn = tokenize(\"/// leading comment A\\na /// trailing comment A\\n/// leading comment B\\nb /// trailing comment B\\n\");\n    tn.next();\n    test.equal(tn.cmnt(tn.line), \"trailing comment A\", \"trailing comment should not contain leading comment from next line\");\n    tn.next();\n    test.equal(tn.cmnt(), 'leading comment B', \"leading comment should be present after trailing comment\");\n\n    test.ok(expectError(\"something; /\"), \"should throw for unterminated line comments\");\n    test.ok(expectError(\"something; /* comment\"), \"should throw for unterminated block comments\");\n    test.ok(expectError(\"something; /* comment *\"), \"should throw for unterminated block comments\");\n    test.ok(expect(\"a / / b\", [\"a\", \"/\", \"/\", \"b\", null]), \"should not misinterpret single slashes as a comment\");\n\n    test.end();\n});\n\nfunction expect(proto, expected) {\n    var tn = tokenize(proto);\n    var token;\n    var actual = [];\n    do {\n        actual.push(token = tn.next());\n    } while (token !== null);\n    if (actual.length !== expected.length) {\n        // console.error(\"actual\", actual, \" != expected\" , expected);\n        return false;\n    }\n    for (var i = 0; i < expected.length; ++i)\n        if (actual[i] !== expected[i]) {\n            // console.error(\"actual\", actual, \" != expected\" , expected);\n            return false;\n        }\n    return true;\n}\n\nfunction expectError(proto) {\n    var tn = tokenize(proto);\n    try {\n        while (tn.next());\n        return null;\n    } catch (e) {\n        return e;\n    }\n}\n"
  },
  {
    "path": "tests/api_type.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar def = {\n    fields: {}\n};\n\nvar def2 = {\n    fields: {\n        a: {\n            type: \"uint32\",\n            id: 1\n        }\n    },\n    oneofs: {\n        kind: {\n            oneof: [\"a\"]\n        }\n    },\n    extensions: [[1000, 2000]],\n    reserved: [[900, 999], \"b\"],\n    nested: {\n        Type: {\n            values: { ONE: 1, TWO: 2 }\n        },\n        Service: {\n            methods: {}\n        }\n    },\n    options: {\n        custom: true\n    }\n};\n\ntape.test(\"reflected types\", function(test) {\n\n    var type = protobuf.Type.fromJSON(\"Test\", def);\n    test.same(type.toJSON(), def, \"should construct from and convert back to JSON\");\n    type = protobuf.Type.fromJSON(\"Test\", def2);\n    test.same(JSON.parse(JSON.stringify(type)), JSON.parse(JSON.stringify(def2)), \"should construct from and convert back to JSON (complex parsed)\");\n\n    function MyMessageAuto() {}\n    type.ctor = MyMessageAuto;\n    test.ok(MyMessageAuto.prototype instanceof protobuf.Message, \"should properly register a constructor through assignment\");\n    test.ok(typeof MyMessageAuto.encode === \"function\", \"should populate static methods on assigned constructors\");\n\n    function MyMessageManual() {}\n    MyMessageManual.prototype = Object.create(protobuf.Message.prototype);\n    type.ctor = MyMessageManual;\n    test.ok(MyMessageManual.prototype instanceof protobuf.Message, \"should properly register a constructor through assignment if already extending message\");\n    test.ok(typeof MyMessageManual.encode === \"function\", \"should populate static methods on assigned constructors\");\n\n    type = protobuf.Type.fromJSON(\"My\", {\n        fields: {\n            a: {\n                type: \"string\",\n                id: 1\n            }\n        },\n        reserved: [[900, 999], \"b\"],\n        nested: {\n            Type: { fields: {} },\n            Enum: { values: {} },\n            Service: { methods: {} },\n            extensionField: { type: \"string\", id: 1000, extend: \"Message\" },\n            Other: { nested: {} }\n        }\n    });\n    test.same(type.toJSON(), {\n        fields: {\n            a: { id: 1, type: \"string\" }\n        },\n        reserved: [[900, 999], \"b\"],\n        nested: {\n            Type: { fields: {} },\n            Enum: { values: {} },\n            Service: { methods: {} },\n            extensionField: { extend: \"Message\", id: 1000, type: \"string\" },\n            Other: { }\n        }\n    }, \"should create from Field, Type, Enum, Service, extension Field and Namespace JSON\");\n\n    test.throws(function() {\n        type.add(new protobuf.Enum(\"Enum\"));\n    }, Error, \"should throw when trying to add duplicate names\");\n\n    test.throws(function() {\n        type.add(new protobuf.Field(\"c\", 1, \"uint32\"));\n    }, Error, \"should throw when trying to add duplicate ids\");\n\n    test.throws(function() {\n        type.add(new protobuf.Field(\"c\", 900, \"uint32\"));\n    }, Error, \"should throw when trying to add reserved ids\");\n\n    test.throws(function() {\n        type.add(new protobuf.Field(\"b\", 2, \"uint32\"));\n    }, Error, \"should throw when trying to add reserved names\");\n\n\n    test.end();\n});\n\ntape.test(\"feature resolution legacy proto3\", function(test) {\n    var json = {\n        fields: {\n            regular: { type: \"string\", id: 1 },\n            packed: { type: \"int32\", id: 2, rule: \"repeated\" },\n            unpacked: { type: \"int32\", id: 3, rule: \"repeated\", options: { packed: false } }\n        },\n        nested: { Nested: { fields: {\n            regular: { type: \"string\", id: 1 },\n            packed: { type: \"int32\", id: 2, rule: \"repeated\" },\n            unpacked: { type: \"int32\", id: 3, rule: \"repeated\", options: { packed: false } }\n        } } }\n    };\n    var root = new protobuf.Root();\n    var Type = protobuf.Type.fromJSON(\"My\", json);\n    root.add(Type).resolveAll();\n\n    var Nested = Type.nested.Nested;\n\n    test.same(Type.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Nested.toJSON(), json.nested.Nested, \"nested JSON should roundtrip\");\n\n    test.equal(Type._edition, \"proto3\", \"should infer proto3 syntax\");\n    test.notOk(Type.fields.regular.hasPresence, \"should have implicit presence by default\");\n    test.ok(Type.fields.packed.packed, \"should have packed encoding by default\");\n    test.notOk(Type.fields.unpacked.packed, \"should override expanded encoding\");\n\n    test.equal(Nested._edition, null, \"should not infer proto3 syntax\");\n    test.notOk(Nested.fields.regular.hasPresence, \"nested should have implicit presence by default\");\n    test.ok(Nested.fields.packed.packed, \"nested should have packed encoding by default\");\n    test.notOk(Nested.fields.unpacked.packed, \"nested should override expanded encoding\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution proto2\", function(test) {\n    var json = {\n        edition: \"proto2\",\n        fields: {\n            regular: { type: \"string\", id: 1 },\n            required: { type: \"string\", id: 2, rule: \"required\" },\n            packed: { type: \"int32\", id: 3, rule: \"repeated\", options: { packed: true } },\n            unpacked: { type: \"int32\", id: 4, rule: \"repeated\"}\n        },\n        nested: { Nested: { fields: {\n            regular: { type: \"string\", id: 1 },\n            packed: { type: \"int32\", id: 2, rule: \"repeated\", options: { packed: true } },\n            unpacked: { type: \"int32\", id: 3, rule: \"repeated\" }\n        } } }\n    };\n    var root = new protobuf.Root();\n    var Type = protobuf.Type.fromJSON(\"My\", json);\n    root.add(Type).resolveAll();\n\n    var Nested = Type.nested.Nested;\n\n    test.same(Type.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Nested.toJSON(), json.nested.Nested, \"nested JSON should roundtrip\");\n\n    test.equal(Type._edition, \"proto2\", \"should set edition\");\n    test.ok(Type.fields.regular.hasPresence, \"should have explicit presence by default\");\n    test.ok(Type.fields.required.required, \"should have required fields\");\n    test.ok(Type.fields.packed.packed, \"should override packed encoding\");\n    test.notOk(Type.fields.unpacked.packed, \"should have expanded encoding by default\");\n\n    test.equal(Nested._edition, null, \"should not set edition\");\n    test.ok(Nested.fields.regular.hasPresence, \"nested should have explicit presence by default\");\n    test.notOk(Nested.fields.unpacked.packed, \"nested should have expanded encoding by default\");\n    test.ok(Nested.fields.packed.packed, \"nested should override packed encoding\");\n\n    test.end();\n});\n\n\ntape.test(\"feature resolution edition 2023\", function(test) {\n    var json = {\n        edition: \"2023\",\n        fields: {\n            explicit: { type: \"string\", id: 1 },\n            implicit: { type: \"string\", id: 2, options: { \"features\": { \"field_presence\": \"IMPLICIT\" } } },\n            required: { type: \"string\", id: 3, rule: \"required\", options: { \"features\": { \"field_presence\": \"LEGACY_REQUIRED\" } } },\n            packed: { type: \"int32\", id: 4, rule: \"repeated\" },\n            unpacked: { type: \"int32\", id: 5, rule: \"repeated\", options: { \"features\": { \"repeated_field_encoding\": \"EXPANDED\" } } }\n        },\n        nested: { Nested: { fields: {\n            explicit: { type: \"string\", id: 1 },\n            implicit: { type: \"string\", id: 2, options: { \"features\": { \"field_presence\": \"IMPLICIT\" } } },\n            packed: { type: \"int32\", id: 3, rule: \"repeated\" },\n            unpacked: { type: \"int32\", id: 4, rule: \"repeated\", options: { \"features\": { \"repeated_field_encoding\": \"EXPANDED\" } } }\n        } } }\n    };\n    var root = new protobuf.Root();\n    var Type = protobuf.Type.fromJSON(\"My\", json);\n    root.add(Type).resolveAll();\n\n    var Nested = Type.nested.Nested;\n\n    test.same(Type.toJSON(), json, \"JSON should roundtrip\");\n    test.same(Nested.toJSON(), json.nested.Nested, \"nested JSON should roundtrip\");\n\n    test.equal(Type._edition, \"2023\", \"should set edition\");\n    test.ok(Type.fields.explicit.hasPresence, \"should have explicit presence\");\n    test.notOk(Type.fields.implicit.hasPresence, \"should have implicit presence\");\n    test.ok(Type.fields.required.required, \"should have required presence\");\n    test.ok(Type.fields.packed.packed, \"should have packed encoding\");\n    test.notOk(Type.fields.unpacked.packed, \"should have expanded encoding\");\n\n    test.equal(Nested._edition, null, \"should not set edition\");\n    test.ok(Nested.fields.explicit.hasPresence, \"nested should have explicit presence\");\n    test.notOk(Nested.fields.implicit.hasPresence, \"nested should have implicit presence\");\n    test.ok(Nested.fields.packed.packed, \"nested should have packed encoding\");\n    test.notOk(Nested.fields.unpacked.packed, \"nested should have expanded encoding\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/api_util.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar util = protobuf.util;\n\ntape.test(\"util\", function(test) {\n\n    test.test(test.name + \" - merge\", function(test) {\n        var o = {};\n        util.merge(o, {});\n        test.same(o, {}, \"should do nothing if both objects are empty\");\n        util.merge(o, { a: 1 });\n        test.same(o, { a: 1 }, \"should merge non-existing keys\");\n        util.merge(o, { a: 2 });\n        test.same(o, { a: 2 }, \"should merge existing keys\");\n        util.merge(o, { a: 3 }, true);\n        test.same(o, { a: 2 }, \"should not merge existing keys\");\n        test.end();\n    });\n\n    test.test(test.name + \" - lcFirst\", function(test) {\n        test.equal(util.lcFirst(\"ABC\"), \"aBC\", \"should convert the first character to lower case\");\n        test.end();\n    });\n\n    test.test(test.name + \" - ucFirst\", function(test) {\n        test.equal(util.ucFirst(\"abc\"), \"Abc\", \"should convert the first character to upper case\");\n        test.end();\n    });\n\n    test.test(test.name + \" - isSet\", function(test) {\n        // note that encoders don't check for default values either\n        var neverPresent = [\n            [],\n            {},\n            undefined,\n            null\n        ];\n        neverPresent.forEach(function(value) {\n            var proto = {};\n            var instance = Object.create(proto);\n            proto.p = value;\n            instance.i = value;\n            test.notOk(util.isSet(proto, \"p\"), \"should return that \" + JSON.stringify(value) + \" on the prototype is not present\");\n            test.notOk(util.isSet(instance, \"i\"), \"should return that \" + JSON.stringify(value) + \" on the instance is not present\");\n        });\n        var cases = {\n            \"arrays\": [ [], [0] ],\n            \"objects\": [ {}, {a:1} ],\n            \"strings\": [ undefined, \"\" ],\n            \"numbers\": [ undefined, 0 ],\n            \"booleans\": [ undefined, false ]\n        };\n        Object.keys(cases).forEach(function(name) {\n            var empty = cases[name][0],\n                value = cases[name][1];\n            var proto = {};\n            var instance = Object.create(proto);\n            proto.pe = instance.ie = empty;\n            proto.p = instance.i = value;\n            if (empty !== undefined) { // not present anyway\n                test.notOk(util.isSet(instance, \"pe\"), \"should return that empty \" + name + \" on the prototype are not present\");\n                test.notOk(util.isSet(instance, \"ie\"), \"should return that empty \" + name + \" on the instance are not present\");\n            }\n            test.notOk(util.isSet(instance, \"p\"), \"should return that \" + name + \" on the prototype are not present\");\n            test.ok(util.isSet(instance, \"i\"), \"should return that \" + name + \" on the instance ARE present\");\n        });\n\n         test.end();\n    });\n\n    test.test(test.name + \" - setProperty\", function(test) {\n        var o = {};\n\n        test.throws(function() {\n            util.setProperty(5, 'prop1', 5);\n        }, TypeError, \"dst must be an object\");\n\n        test.throws(function () {\n            util.setProperty(o, '', 5);\n        }, TypeError, \"path must be specified\");\n\n        util.setProperty(o, 'prop1', 5);\n        test.same(o, {prop1: 5}, \"should set single property value\");\n\n        util.setProperty(o, 'prop1', 6);\n        test.same(o, {prop1: [5, 6]}, \"should convert to array if same property is set\");\n\n        util.setProperty(o, 'prop.subprop', { subsub: 5});\n        test.same(o, {prop1: [5, 6], prop: {subprop: {subsub: 5}}}, \"should handle nested properties properly\");\n\n        util.setProperty(o, 'prop.subprop.subsub', 6);\n        test.same(o, {prop1: [5, 6], prop: {subprop: {subsub: [5, 6]}}}, \"should convert to array nested property\");\n\n        util.setProperty(o, 'prop.subprop', { subsub2: 7});\n        test.same(o, {prop1: [5, 6], prop: {subprop: [{subsub: [5,6]}, {subsub2: 7}]}}, \"should convert nested properties to array\");\n        \n        util.setProperty({}, \"__proto__.test\", \"value\");\n        test.is({}.test, undefined);\n\n        util.setProperty({}, \"prototype.test\", \"value\");\n        test.is({}.test, undefined);\n\n        util.setProperty({}, \"constructor.prototype.test\", \"value\");\n        test.is({}.test, undefined);\n\n        test.end();\n    });\n\n    test.end();\n});"
  },
  {
    "path": "tests/api_writer-reader.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar Writer = protobuf.Writer,\n    Reader = protobuf.Reader;\n\ntape.test(\"writer & reader\", function(test) {\n\n    test.throws(function() {\n        Reader.create(1);\n    }, \"should throw when creating a Reader from something else than a buffer\");\n\n    test.doesNotThrow(function() {\n        Reader.create([]);\n    }, \"should not throw when creating a Reader from an array (comp)\");\n\n    // uint32, int32, sint32\n\n    var values = [\n        [ 0, [ 0 ] ],\n        [ 127, [ 127 ] ],\n        [ 128, [ 128, 1] ],\n        [ 16383, [ 255, 127 ] ],\n        [ 16384, [ 128, 128, 1] ],\n        [ 2097151, [ 255, 255, 127 ] ],\n        [ 2097152, [ 128, 128, 128, 1 ] ],\n        [ 268435455, [ 255, 255, 255, 127 ] ],\n        [ 268435456, [ 128, 128, 128, 128, 1 ] ],\n        [ 2147483647, [ 255, 255, 255, 255, 7 ] ]\n    ];\n    values.forEach(function(val) {\n         test.ok(expect(\"uint32\", val[0] >>> 0, val[1]), \"should write \" + val[0] + \" as an unsigned varint of length \" + val[1].length + \" and read it back equally\");\n         test.ok(expect(\"int32\", val[0] | 0, val[1]), \"should write \" + val[0] + \" as a signed varint of length \" + val[1].length + \" and read it back equally\");\n         var zzBaseVal = val[0] >>> 1 ^ -(val[0] & 1) | 0;\n         test.ok(expect(\"sint32\", zzBaseVal, val[1]), \"should write \" + zzBaseVal + \" as a signed zig-zag encoded varint of length \" + val[1].length + \" and read it back equally\");\n    });\n\n    test.ok(expect(\"uint32\", -1 >>> 0, [ 255, 255, 255, 255, 15 ]), \"should write -1 as an unsigned varint of length 5\");\n    test.ok(expect(\"int32\", -1, [ 255, 255, 255, 255, 255, 255, 255, 255, 255, 1 ]), \"should write -1 as a signed varint of length 10\");\n    test.ok(expect(\"sint32\", -1, [ 1 ]), \"should write -1 as a signed zig-zag encoded varint of length 1\");\n\n    // fixed32, sfixed32\n\n    if (typeof Uint32Array !== \"undefined\")\n        values.forEach(function(val) {\n            // the same for all sorts of writers anyway\n\n            var buffer = Writer.create().fixed32(val[0]).finish();\n            var comp = new Uint8Array(new Uint32Array([ val[0] ]).buffer);\n            test.same(Array.prototype.slice.call(buffer), Array.prototype.slice.call(comp), \"should write \" + val[0] + \" as fixed 32 bits\");\n            test.equal(Reader.create(buffer).fixed32(), val[0], \"should read back \"+ val[0] + \" equally\");\n\n            var signedVal = val[0] | 0;\n            buffer = Writer.create().sfixed32(signedVal).finish();\n            comp = new Uint8Array(new Uint32Array([ val[0] ]).buffer);\n            test.same(Array.prototype.slice.call(buffer), Array.prototype.slice.call(comp), \"should write \" + signedVal + \" as fixed 32 bits (signed)\");\n            test.equal(Reader.create(buffer).sfixed32(), signedVal, \"should read back \"+ signedVal + \" equally\");\n        });\n\n    test.ok(expect(\"fixed32\", 4294967295, [ 255, 255, 255, 255 ]), \"should write 4294967295 as fixed 32 bits\");\n    test.ok(expect(\"fixed32\", 4294967294, [ 254, 255, 255, 255 ]), \"should write 4294967294 as fixed 32 bits\");\n    test.ok(expect(\"sfixed32\", -1, [ 255, 255, 255, 255 ]), \"should write -1 as fixed 32 bits (signed)\");\n    test.ok(expect(\"sfixed32\", -2, [ 254, 255, 255, 255 ]), \"should write -2 as fixed 32 bits (signed)\");\n\n    // uint64, int64, sint64\n\n    protobuf.util.merge(values, [\n        [ 549755813887, [ 255, 255, 255, 255, 255, 15 ] ],\n        [ 140737488355327, [ 255, 255, 255, 255, 255, 255, 31 ] ]\n    ]);\n\n    test.ok(protobuf.util.Long, \"should use long.js\");\n    values.forEach(function(val) {\n        var longVal = protobuf.util.Long.fromNumber(val[0], false);\n        \n        test.ok(expect(\"uint64\", longVal, val[1]), \"should write \" + longVal + \" as an unsigned varint of length \" + val[1].length + \" and read it back equally\");\n        test.ok(expect(\"int64\", longVal, val[1]), \"should write \" + longVal + \" as a signed varint of length \" + val[1].length + \" and read it back equally\");\n        var zzBaseVal = longVal.shru(1).xor(longVal.and(1).negate());\n        test.ok(expect(\"sint64\", zzBaseVal, val[1]), \"should write \" + zzBaseVal + \" as a signed zig-zag encoded varint of length \" + val[1].length + \" and read it back equally\");\n    });\n\n    // fixed64, sfixed64 -> see also see comp_fixed/sfixed64 (grpc)\n\n    // TODO\n\n    // float, double -> see comp_float\n\n    // bool\n\n    test.ok(expect(\"bool\", true, [1]), \"should write true as a varint of length 1 and read it back equally\");\n    test.ok(expect(\"bool\", false, [0]), \"should write false as a varint of length 1 and read it back equally\");\n\n    // string, see also lib_utf8\n\n    test.ok(expect(\"string\", \"123\", [3,49,50,51]), \"should write \\\"123\\\" as a string prefixed with its length as a varint and read it back equally\");\n    test.ok(expect(\"string\", \"\", [0]), \"should write \\\"\\\" as a string prefixed with its length as a varint and read it back equally\");\n\n    // bytes\n\n    test.ok(expect(\"bytes\", [1,2,3], [3,1,2,3]), \"should write [1,2,3] as bytes prefixed with its length as a varint and read it back equally\");\n    test.ok(expect(\"bytes\", [], [0]), \"should write [] as bytes prefixed with its length as a varint and read it back equally\");\n    test.ok(expect(\"bytes\", \"MTIz\", [3,49,50,51]), \"should write MTIz as bytes prefixed with its length as a varint and read it back equally\");\n\n    // skipType\n\n    test.test(test.name + \" - should allow to skip\", function(test) {\n        var reader = Reader.create(Writer.create()\n            .uint32(1)\n            .double(0.1)\n            .string(\"123\")\n            .uint32(1 << 3 | 1).double(0.1).uint32(4)\n            .uint32(4)\n            .float(0.125)\n            .finish()\n        );\n        reader.skipType(0);\n        test.equal(reader.pos, 1, \"varints\");\n        reader.skipType(1);\n        test.equal(reader.pos, 9, \"fixed 64 bits\");\n        reader.skipType(2);\n        test.equal(reader.pos, 13, \"length delimited values\");\n        reader.skipType(3);\n        test.equal(reader.pos, 23, \"legacy groups\");\n        reader.skipType(3);\n        test.equal(reader.pos, 24, \"empty legacy groups\");\n        reader.skipType(5);\n        test.equal(reader.pos, 28, \"fixed 32 bits\");\n        test.end();\n    });\n\n    test.end();\n});\n\nfunction expect(type, value, expected, WriterToTest) {\n    if (!WriterToTest)\n        WriterToTest = Writer.create().constructor;\n    var writer = new WriterToTest();\n    var actual = writer[type](value).finish();\n    if (actual.length !== expected.length) {\n        console.error(\"actual\", Array.prototype.slice.call(actual), \"!= expected\", expected);\n        return false;\n    }\n    for (var i = 0; i < expected.length; ++i)\n        if (actual[i] !== expected[i]) {\n            console.error(\"actual\", Array.prototype.slice.call(actual), \"!= expected\", expected);\n            return false;\n        }\n    var longActual = protobuf.util.newBuffer(20);\n    for (var l = 0; l < actual.length; ++l)\n        longActual[l] = actual[l];\n    [ actual, longActual ] // also test readLongVarint fast route\n    .forEach(function(actual) {\n        var reader = Reader.create(actual);\n        var actualValue = reader[type]();\n        if (typeof actualValue === \"object\") { // buffer\n            var buf;\n            if (typeof value === \"string\") { // initial value is a base64 encoded string\n                buf = protobuf.util.newBuffer(protobuf.util.base64.length(value));\n                protobuf.util.base64.decode(value, buf, 0);\n            } else\n                buf = value;\n            if (buf.length !== actualValue.length)\n                return false;\n            for (var j = 0; j < buf.length; ++j)\n                if (actualValue[j] !== buf[j])\n                    return false;\n        } else if (actualValue !== value) {\n            console.error(\"actual value\", actualValue, \"!= expected\", value);\n            return false;\n        }\n    });\n    // also test browser writer if running under node\n    if (WriterToTest !== protobuf.Writer) {\n        if (!expect(type, value, expected, Writer)) {\n            console.error(\"in browser writer\");\n            return false;\n        }\n    }\n    return true;\n}"
  },
  {
    "path": "tests/cli.js",
    "content": "// A minimal test for pbjs tool targets.\n\nvar tape = require(\"tape\");\nvar path = require(\"path\");\nvar Module = require(\"module\");\nvar protobuf = require(\"..\");\nvar fs = require(\"fs\");\n\nfunction cliTest(test, testFunc) {\n    // pbjs does not seem to work with Node v4, so skip this test if we're running on it\n    if (process.versions.node.match(/^4\\./)) {\n        test.end();\n        return;\n    }\n\n    // Alter the require cache to make the cli/targets/static work since it requires \"protobufjs\"\n    // and we don't want to mess with \"npm link\"\n    var savedResolveFilename = Module._resolveFilename;\n    Module._resolveFilename = function(request, parent) { \n      if (request.startsWith(\"protobufjs\")) {\n        return request;\n      }\n      return savedResolveFilename(request, parent);\n    };\n    require.cache.protobufjs = require.cache[path.resolve(\"index.js\")];\n\n    try {\n        testFunc();\n    } finally {\n        // Rollback all the require() related mess we made\n        delete require.cache.protobufjs;\n        Module._resolveFilename = savedResolveFilename;\n    }\n}\n\ntape.test(\"pbjs generates static code\", function(test) {\n    cliTest(test, function() {\n        var root = protobuf.loadSync(\"tests/data/cli/test.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n            typeurl: true,\n        }, function(err, jsCode) {\n            test.error(err, 'static code generation worked');\n\n            // jsCode is the generated code; we'll eval it\n            // (since this is what we normally do with the code, right?)\n            // This is a test code. Do not use this in production.\n            var $protobuf = protobuf;\n            eval(jsCode);\n\n            var OneofContainer = protobuf.roots.default.OneofContainer;\n            var Message = protobuf.roots.default.Message;\n            test.ok(OneofContainer, \"type is loaded\");\n            test.ok(Message, \"type is loaded\");\n\n            // Check that fromObject and toObject work for plain object\n            var obj = {\n                messageInOneof: {\n                    value: 42,\n                },\n                regularField: \"abc\",\n                enumField: 0,\n            };\n            var obj1 = OneofContainer.toObject(OneofContainer.fromObject(obj));\n            test.deepEqual(obj, obj1, \"fromObject and toObject work for plain object\");\n\n            // Check that dynamic fromObject and toObject work for static instance\n            var root = protobuf.loadSync(\"tests/data/cli/test.proto\");\n            var OneofContainerDynamic = root.lookup(\"OneofContainer\");\n            var instance = new OneofContainer();\n            instance.messageInOneof = new Message();\n            instance.messageInOneof.value = 42;\n            instance.regularField = \"abc\";\n            instance.enumField = 0;\n            var instance1 = OneofContainerDynamic.toObject(OneofContainerDynamic.fromObject(instance));\n            test.deepEqual(instance, instance1, \"fromObject and toObject work for instance of the static type\");\n\n            // Check that getTypeUrl works\n            var defaultTypeUrl = Message.getTypeUrl();\n            var customTypeUrl = Message.getTypeUrl(\"example.com\");\n            test.equal(defaultTypeUrl, \"type.googleapis.com/Message\", \"getTypeUrl returns expected url\");\n            test.equal(customTypeUrl, \"example.com/Message\", \"getTypeUrl returns custom url\");\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"without null-defaults, absent optional fields have zero values\", function(test) {\n    cliTest(test, function() {\n        var root = protobuf.loadSync(\"tests/data/cli/null-defaults.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n        }, function(err, jsCode) {\n            test.error(err, 'static code generation worked');\n\n            // jsCode is the generated code; we'll eval it\n            // (since this is what we normally does with the code, right?)\n            // This is a test code. Do not use this in production.\n            var $protobuf = protobuf;\n            eval(jsCode);\n\n            var OptionalFields = protobuf.roots.default.OptionalFields;\n            test.ok(OptionalFields, \"type is loaded\");\n\n            // Check default values\n            var msg = OptionalFields.fromObject({});\n            test.equal(msg.a, null, \"default submessage is null\");\n            test.equal(msg.b, \"\", \"default string is empty\");\n            test.equal(msg.c, 0, \"default integer is 0\");\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"with null-defaults, absent optional fields have null values\", function(test) {\n    cliTest(test, function() {\n        var root = protobuf.loadSync(\"tests/data/cli/null-defaults.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n            \"null-defaults\": true,\n        }, function(err, jsCode) {\n            test.error(err, 'static code generation worked');\n\n            // jsCode is the generated code; we'll eval it\n            // (since this is what we normally does with the code, right?)\n            // This is a test code. Do not use this in production.\n            var $protobuf = protobuf;\n            eval(jsCode);\n\n            var OptionalFields = protobuf.roots.default.OptionalFields;\n            test.ok(OptionalFields, \"type is loaded\");\n\n            // Check default values\n            var msg = OptionalFields.fromObject({});\n            test.equal(msg.a, null, \"default submessage is null\");\n            test.equal(msg.b, null, \"default string is null\");\n            test.equal(msg.c, null, \"default integer is null\");\n\n            test.end();\n        });\n    });\n});\n\n\ntape.test(\"with --null-semantics, optional fields are handled correctly in proto2\", function(test) {\n    cliTest(test, function() {\n        var root = protobuf.loadSync(\"tests/data/cli/null-defaults.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n            comments: true,\n            \"null-semantics\": true,\n        }, function(err, jsCode) {\n\n            test.error(err, 'static code generation worked');\n\n            test.ok(jsCode.includes(\"@property {OptionalFields.ISubMessage|null|undefined} [a] OptionalFields a\"), \"Property for a should use an interface\")\n            test.ok(jsCode.includes(\"@member {OptionalFields.SubMessage|null} a\"), \"Member for a should use a message type\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.a = null;\"), \"Initializer for a should be null\")\n\n            test.ok(jsCode.includes(\"@property {number|null|undefined} [c] OptionalFields c\"), \"Property for c should be nullable\")\n            test.ok(jsCode.includes(\"@member {number|null} c\"), \"Member for c should be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.c = null;\"), \"Initializer for c should be null\")\n\n            test.ok(jsCode.includes(\"@property {number} d OptionalFields d\"), \"Property for d should not be nullable\")\n            test.ok(jsCode.includes(\"@member {number} d\"), \"Member for d should not be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.d = 0;\"), \"Initializer for d should be zero\")\n\n            test.end();\n        });\n    });\n});\n\n\ntape.test(\"with --null-semantics, optional fields are handled correctly in proto3\", function(test) {\n    cliTest(test, function() {\n        var root = protobuf.loadSync(\"tests/data/cli/null-defaults-proto3.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n            comments: true,\n            \"null-semantics\": true,\n        }, function(err, jsCode) {\n\n            test.error(err, 'static code generation worked');\n\n            test.ok(jsCode.includes(\"@property {OptionalFields.ISubMessage|null|undefined} [a] OptionalFields a\"), \"Property for a should use an interface\")\n            test.ok(jsCode.includes(\"@member {OptionalFields.SubMessage|null} a\"), \"Member for a should use a message type\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.a = null;\"), \"Initializer for a should be null\")\n\n            test.ok(jsCode.includes(\"@property {number|null|undefined} [c] OptionalFields c\"), \"Property for c should be nullable\")\n            test.ok(jsCode.includes(\"@member {number|null} c\"), \"Member for c should be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.c = null;\"), \"Initializer for c should be null\")\n\n            test.ok(jsCode.includes(\"@property {number|undefined} [d] OptionalFields d\"), \"Property for d should be optional but not nullable\")\n            test.ok(jsCode.includes(\"@member {number} d\"), \"Member for d should not be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.d = 0;\"), \"Initializer for d should be zero\")\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"with --null-semantics, optional fields are handled correctly in editions\", function(test) {\n    cliTest(test, function() {\n        var root = protobuf.loadSync(\"tests/data/cli/null-defaults-edition2023.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n            comments: true,\n            \"null-semantics\": true,\n        }, function(err, jsCode) {\n\n            test.error(err, 'static code generation worked');\n\n            test.ok(jsCode.includes(\"@property {OptionalFields.ISubMessage|null|undefined} [a] OptionalFields a\"), \"Property for a should use an interface\")\n            test.ok(jsCode.includes(\"@member {OptionalFields.SubMessage|null} a\"), \"Member for a should use a message type\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.a = null;\"), \"Initializer for a should be null\")\n\n            test.ok(jsCode.includes(\"@property {string|null|undefined} [e] OptionalFields e\"), \"Property for e should be nullable\")\n            test.ok(jsCode.includes(\"@member {string|null} e\"), \"Member for e should be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.e = null;\"), \"Initializer for e should be null\")\n\n            test.ok(jsCode.includes(\"@property {number} r OptionalFields r\"), \"Property for r should not be nullable\")\n            test.ok(jsCode.includes(\"@member {number} r\"), \"Member for r should not be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.r = 0;\"), \"Initializer for r should be zero\")\n\n            test.ok(jsCode.includes(\"@property {number|undefined} [i] OptionalFields i\"), \"Property for i should be optional but not nullable\")\n            test.ok(jsCode.includes(\"@member {number} i\"), \"Member for i should not be nullable\")\n            test.ok(jsCode.includes(\"OptionalFields.prototype.i = 0;\"), \"Initializer for i should be zero\")\n\n            test.end();\n        });\n    });\n});\n\n\ntape.test(\"pbjs generates static code with message filter\", function (test) {\n    cliTest(test, function () {\n        var root = protobuf.loadSync(\"tests/data/cli/test-filter.proto\");\n        root.resolveAll();\n\n        var staticTarget = require(\"../cli/targets/static\");\n        var util = require(\"../cli/util\");\n\n        const needMessageConfig = JSON.parse(fs.readFileSync(\"tests/data/cli/filter.json\"));\n\n        util.filterMessage(root, needMessageConfig);\n\n        staticTarget(root, {\n            create: true,\n            decode: true,\n            encode: true,\n            convert: true,\n            \"null-defaults\": true,\n        }, function (err, jsCode) {\n            test.error(err, 'static code generation worked');\n\n            // jsCode is the generated code; we'll eval it\n            // (since this is what we normally does with the code, right?)\n            // This is a test code. Do not use this in production.\n            var $protobuf = protobuf;\n            eval(jsCode);\n\n            var NeedMessage1 = protobuf.roots.default.filtertest.NeedMessage1;\n            var NeedMessage2 = protobuf.roots.default.filtertest.NeedMessage2;\n            var DependentMessage1 = protobuf.roots.default.filtertest.DependentMessage1;\n            var DependentMessageFromImport = protobuf.roots.default.DependentMessageFromImport;\n\n            var NotNeedMessageInRootFile = protobuf.roots.default.filtertest.NotNeedMessageInRootFile;\n            var NotNeedMessageInImportFile = protobuf.roots.default.NotNeedMessageInImportFile;\n\n            test.ok(NeedMessage1, \"NeedMessage1 is loaded\");\n            test.ok(NeedMessage2, \"NeedMessage2 is loaded\");\n            test.ok(DependentMessage1, \"DependentMessage1 is loaded\");\n            test.ok(DependentMessageFromImport, \"DependentMessageFromImport is loaded\");\n\n            test.notOk(NotNeedMessageInImportFile, \"NotNeedMessageInImportFile is not loaded\");\n            test.notOk(NotNeedMessageInRootFile, \"NotNeedMessageInRootFile is not loaded\");\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"proto3 roundtrip\", function(test) {\n    const proto = `syntax = \"proto3\";\n\nmessage OptionalFields {\n\n    optional SubMessage a = 1;\n    optional string b = 2;\n    repeated uint32 c = 3 [packed=false];\n    uint32 d = 4;\n\n    message SubMessage {\n\n        string a = 1;\n    }\n}`;\n    cliTest(test, function() {\n        var root = protobuf.parse(proto).root.resolveAll();\n        var protoTarget = require(\"../cli/targets/proto3\");\n\n        protoTarget(root, {}, function(err, output) {\n            test.error(err, 'proto code generation worked');\n\n            test.equal(output, proto);\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"proto2 roundtrip\", function(test) {\n    const proto = `syntax = \"proto2\";\n\nmessage OptionalFields {\n\n    optional OptionalFields a = 1;\n    required string b = 2;\n    repeated uint32 c = 3 [packed=true];\n    optional float d = 4 [default=0.1];\n    optional group OptionalGroup = 5 {\n\n        optional string a = 1;\n    }\n    repeated group RepeatedGroup = 6 {\n\n        optional string a = 1;\n    }\n    required group RequiredGroup = 7 {\n\n        optional string a = 1;\n    }\n}`;\n    cliTest(test, function() {\n        var root = protobuf.parse(proto).root.resolveAll();\n        var protoTarget = require(\"../cli/targets/proto2\");\n\n        protoTarget(root, {}, function(err, output) {\n            test.error(err, 'proto code generation worked');\n\n            test.equal(output, proto);\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"proto3 to proto2 valid\", function(test) {\n    const proto3 = `syntax = \"proto3\";\n\nmessage OptionalFields {\n    message SubMessage {\n        optional string a = 1;\n    }\n\n    optional SubMessage a = 1;\n    repeated int32 b = 2;\n    repeated uint32 c = 3 [packed=false];\n\n}`;\n    const proto2 = `syntax = \"proto2\";\n\nmessage OptionalFields {\n\n    optional SubMessage a = 1;\n    repeated int32 b = 2 [packed=true];\n    repeated uint32 c = 3;\n\n    message SubMessage {\n\n        optional string a = 1;\n    }\n}`;\n    cliTest(test, function() {\n        var root = protobuf.parse(proto3).root.resolveAll();\n        var protoTarget = require(\"../cli/targets/proto2\");\n\n        protoTarget(root, {}, function(err, output) {\n            test.error(err, 'proto code generation worked');\n\n            test.equal(output, proto2);\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"proto2 to proto3 valid\", function(test) {\n    const proto2 = `syntax = \"proto2\";\n\nmessage OptionalFields {\n    message SubMessage {\n        optional string a = 1;\n    }\n\n    optional SubMessage a = 1;\n    repeated int32 b = 2;\n    repeated uint32 c = 3 [packed=true];\n}`;\n    const proto3 = `syntax = \"proto3\";\n\nmessage OptionalFields {\n\n    optional SubMessage a = 1;\n    repeated int32 b = 2 [packed=false];\n    repeated uint32 c = 3;\n\n    message SubMessage {\n\n        optional string a = 1;\n    }\n}`;\n    cliTest(test, function() {\n        var root = protobuf.parse(proto2).root.resolveAll();\n        var protoTarget = require(\"../cli/targets/proto3\");\n\n        protoTarget(root, {}, function(err, output) {\n            test.error(err, 'proto code generation worked');\n\n            test.equal(output, proto3);\n\n            test.end();\n        });\n    });\n});\n\n\ntape.test(\"edition 2023 to proto2 valid\", function(test) {\n    const editions = `edition = \"2023\";\noption features.repeated_field_encoding = EXPANDED;\n\nmessage OptionalFields {\n    message SubMessage {\n        string a = 1 [features.field_presence = LEGACY_REQUIRED];\n    }\n\n    SubMessage a = 1;\n    repeated int32 b = 2 [features.repeated_field_encoding = PACKED];\n    repeated uint32 c = 3;\n}`;\n    const proto2 = `syntax = \"proto2\";\n\nmessage OptionalFields {\n\n    optional SubMessage a = 1;\n    repeated int32 b = 2 [packed=true];\n    repeated uint32 c = 3;\n\n    message SubMessage {\n\n        required string a = 1;\n    }\n}`;\n    cliTest(test, function() {\n        var root = protobuf.parse(editions).root.resolveAll();\n        var protoTarget = require(\"../cli/targets/proto2\");\n\n        protoTarget(root, {}, function(err, output) {\n            test.error(err, 'proto code generation worked');\n\n            test.equal(output, proto2);\n\n            test.end();\n        });\n    });\n});\n\ntape.test(\"edition 2023 to proto3 valid\", function(test) {\n    const editions = `edition = \"2023\";\noption features.repeated_field_encoding = EXPANDED;\n\nmessage OptionalFields {\n    message SubMessage {\n        string a = 1 [features.field_presence = IMPLICIT];\n    }\n\n    SubMessage a = 1;\n    repeated int32 b = 2 [features.repeated_field_encoding = PACKED];\n    repeated uint32 c = 3;\n}`;\n    const proto3 = `syntax = \"proto3\";\n\nmessage OptionalFields {\n\n    optional SubMessage a = 1;\n    repeated int32 b = 2;\n    repeated uint32 c = 3 [packed=false];\n\n    message SubMessage {\n\n        string a = 1;\n    }\n}`;\n    cliTest(test, function() {\n        var root = protobuf.parse(editions).root.resolveAll();\n        var protoTarget = require(\"../cli/targets/proto3\");\n\n        protoTarget(root, {}, function(err, output) {\n            test.error(err, 'proto code generation worked');\n\n            test.equal(output, proto3);\n\n            test.end();\n        });\n    });\n});\n"
  },
  {
    "path": "tests/comment_serialization.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"by default, drop comments through de/serialization\", function(test) {\n    test.plan(16);\n    protobuf.load(\"tests/data/comment_serialization.proto\", function(err, root) {\n        if (err) {\n            throw test.fail(err.message);\n        }\n\n        var copy = protobuf.Root.fromJSON(root.toJSON());\n        test.ok(root.lookup(\"TestMessage\").comment);\n        test.notOk(copy.lookup(\"TestMessage\").comment);\n        test.ok(root.lookup(\"TestMessage.testField\").comment);\n        test.notOk(copy.lookup(\"TestMessage.testField\").comment);\n        test.ok(root.lookup(\"TestMessage.testMap\").comment);\n        test.notOk(copy.lookup(\"TestMessage.testMap\").comment);\n        test.ok(root.lookup(\"TestMessage.testOneof\").comment);\n        test.notOk(copy.lookup(\"TestMessage.testOneof\").comment);\n\n        var rootService = root.lookupService(\"TestService\");\n        var copyService = copy.lookupService(\"TestService\");\n        test.ok(rootService.comment);\n        test.notOk(copyService.comment);\n        test.ok(rootService.methods[\"testMethod\"].comment);\n        test.notOk(copyService.methods[\"testMethod\"].comment);\n\n        var rootEnum = root.lookup(\"TestEnum\");\n        var copyEnum = copy.lookup(\"TestEnum\");\n        test.ok(rootEnum.comment);\n        test.notOk(copyEnum.comment);\n        test.ok(rootEnum.comments.VALUE);\n        test.notOk(copyEnum.comments.VALUE);\n\n        test.end();\n    });\n});\n\ntape.test(\"preserve comments through de/serialization if option set\", function(test) {\n    test.plan(8);\n    protobuf.load(\"tests/data/comment_serialization.proto\", function(err, root) {\n        if (err) {\n            throw test.fail(err.message);\n        }\n\n        var toJSONOptions = {keepComments: true};\n        var copy = protobuf.Root.fromJSON(root.toJSON(toJSONOptions));\n        test.equal(root.lookup(\"TestMessage\").comment, copy.lookup(\"TestMessage\").comment);\n        test.equal(root.lookup(\"TestMessage.testField\").comment, copy.lookup(\"TestMessage.testField\").comment);\n        test.equal(root.lookup(\"TestMessage.testMap\").comment, copy.lookup(\"TestMessage.testMap\").comment);\n        test.equal(root.lookup(\"TestMessage.testOneof\").comment, copy.lookup(\"TestMessage.testOneof\").comment);\n\n        var rootService = root.lookupService(\"TestService\");\n        var copyService = copy.lookupService(\"TestService\");\n        test.equal(rootService.comment, copyService.comment);\n        test.equal(rootService.methods[\"testMethod\"].comment, copyService.methods[\"testMethod\"].comment);\n\n        var rootEnum = root.lookup(\"TestEnum\");\n        var copyEnum = copy.lookup(\"TestEnum\");\n        test.equal(rootEnum.comment, copyEnum.comment);\n        test.equal(rootEnum.comments.VALUE, copyEnum.comments.VALUE);\n\n        test.end();\n    });\n});\n"
  },
  {
    "path": "tests/comp_ambiguous-names.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"syntax = \\\"proto3\\\";\\\nmessage A {\\\n  string whatever = 1;\\\n}\\\nmessage B {\\\n  A A = 1;\\\n}\";\n\ntape.test(\"ambiguous names\", function(test) {\n    protobuf.parse(proto);\n    test.pass(\"should parse without errors\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_bytes.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar oldBufferImpl = Buffer.alloc === undefined;\n\n// extends Buffer\n(CustomBuffer.prototype = Object.create(Buffer.prototype)).constructor = CustomBuffer;\n\nfunction CustomBuffer(arg, encodingOrOffset, length) {\n    Buffer.call(this, arg, encodingOrOffset, length);\n    CustomBuffer.toCustom(this);\n}\n\nCustomBuffer.isBuffer = Buffer.isBuffer.bind(Buffer);\n\nCustomBuffer.toCustom = function (b) {\n    b._isCustom = true;\n    return b;\n}\n\nCustomBuffer.isCustom = function (b) {\n    return !!b._isCustom;\n}\n\nCustomBuffer.from = function (valueOf, encodingOrOffset, length) {\n    return CustomBuffer.toCustom(oldBufferImpl\n        ?  new Buffer(valueOf, encodingOrOffset, length)\n        : Buffer.from(valueOf, encodingOrOffset, length)\n    );\n}\n\nCustomBuffer.alloc = function (size, fill, encoding) {\n    return CustomBuffer.toCustom(oldBufferImpl\n        ?  new Buffer(size, fill, encoding)\n        : Buffer.alloc(size, fill, encoding)\n    );\n}\n\nCustomBuffer.allocUnsafe = function (size) {\n    return CustomBuffer.toCustom(oldBufferImpl\n        ?  new Buffer(size)\n        : Buffer.allocUnsafe(size)\n    );\n}\n\nCustomBuffer.prototype.slice = function (start, end) {\n    return CustomBuffer.toCustom(this.slice(start, end));\n}\n\ntape.test(\"configure a custom encoder/decoder for bytes\", function(test) {\n    var oldBuffer = protobuf.util.Buffer;\n\n    protobuf.util.Buffer = CustomBuffer;\n    protobuf.configure();\n\n    var root = protobuf.Root.fromJSON({\n        nested: {\n            test: {\n                nested: {\n                    Test: {\n                        fields: {\n                            data: {\n                                type: \"bytes\",\n                                id: 1\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    });\n\n    var Test = root.lookup(\"test.Test\");\n\n    var buffer = Test.encode({\n        data: CustomBuffer.from('some-data')\n    }).finish();\n    test.ok(CustomBuffer.isCustom(buffer), \"should encode the message with a custom buffer\");\n\n    var decoded = Test.decode(buffer);\n    test.ok(CustomBuffer.isCustom(decoded.data), \"should decode `data` into a custom buffer\");\n\n    protobuf.util.Buffer = oldBuffer;\n    protobuf.configure();\n\n    test.end();\n\n});\n"
  },
  {
    "path": "tests/comp_empty-encode.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"empty messages\", function(test) {\n    var root = new protobuf.Root().addJSON({\n        \"Test\": {\n            fields: {}\n        }\n    });\n\n    var Test = root.lookup(\"Test\");\n\n    var buf = Test.encodeDelimited({}).finish();\n\n    test.equal(buf.length, 1, \"should encodeDelimited to a buffer of length 1\");\n    test.equal(buf[0], 0, \"should encodeDelimited a length of 0\");\n    \n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_empty-inner-fields.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"empty inner fields\", function(test) {\n    var root = protobuf.Root.fromJSON({\n        nested: {\n            Inner: {\n                fields: {\n                }\n            },\n            Outer: {\n                oneofs: {\n                    child: {\n                        oneof: [\"inner\"]\n                    }\n                },\n                fields: {\n                    inner: {\n                        id: 1,\n                        type: \"Inner\"\n                    }\n                }\n            }\n        }\n    });\n    var Outer = root.lookup(\"Outer\");\n    var msg = Outer.fromObject({\n        inner: {}\n    });\n    var buf = Outer.encode(msg).finish();\n    test.equal(buf.length, 2, \"should always be present on the wire\");\n    test.equal(buf[0], 1 << 3 | 2, \"should write id 1, wireType 2\");\n    test.equal(buf[1], 0, \"should write a length of 0\");\n    test.end();\n});"
  },
  {
    "path": "tests/comp_extend.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf  = require(\"..\");\n\nvar proto = \"syntax = \\\"proto3\\\";\\\nmessage A {\\\n    message B {\\\n        message One {\\\n            extensions 1000 to max;\\\n            reserved 900 to 999, 899, \\\"a\\\", 'b';\\\n        }\\\n    }\\\n    message C {\\\n        message Two {\\\n            extend B.One {\\\n                C.Two two = 1000;\\\n            }\\\n        }\\\n    }\\\n}\";\n\ntape.test(\"extensions\", function(test) {\n    var root = protobuf.parse(proto).root;\n    root.resolveAll();\n    test.pass(\"should parse and resolve without errors\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_fixed64-grpc.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"fixed64 (grpc)\", function(test) {\n\n    var root = protobuf.Root.fromJSON({\n        nested: {\n            test: {\n                nested: {\n                    Test: {\n                        fields: {\n                            int_64: {\n                                type: 'fixed64',\n                                id: 1\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    });\n\n    var Test = root.lookup(\"test.Test\");\n\n    var buffer = Test.encode({\n        int_64: '314159265358979'\n    }).finish();\n\n    test.equal(buffer.length, 9, \"should encode a total of 9 bytes\");\n    test.equal(buffer[0], 9, \"should encode id 1, wireType 1\");\n\n    var decoded = Test.decode(buffer);\n    // decoded.int_64 is a Long here, so this implicitly calls Long#toString:\n    test.ok(decoded.int_64 == '314159265358979', \"should decode back the original value\");\n\n    test.end();\n\n});\n"
  },
  {
    "path": "tests/comp_google_protobuf_any.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar root = new protobuf.Root().addJSON(protobuf.common[\"google/protobuf/any.proto\"].nested).addJSON({\n    Foo: {\n        fields: {\n            foo: {\n                id: 1,\n                type: \"google.protobuf.Any\"\n            }\n        }\n    },\n    Bar: {\n        fields: {\n            bar: {\n                id: 1,\n                type: \"string\"\n            }\n        }\n    }\n}).resolveAll();\n\nvar Any = root.lookupType(\"protobuf.Any\"),\n    Foo = root.lookupType(\".Foo\"),\n    Bar = root.lookupType(\".Bar\");\n\ntape.test(\"google.protobuf.Any\", function(test) {\n\n    var foo = Foo.fromObject({\n        foo: {\n            type_url: \"Bar\",\n            value: [1 << 3 | 2, 1, 97] // value = \"a\"\n        }\n    });\n    test.ok(foo.foo instanceof Any.ctor, \"should keep explicit Any in fromObject\");\n    test.same(foo.foo, { type_url: \"Bar\", value: [10, 1, 97] }, \"should keep explicit Any in fromObject properly\");\n\n    var obj = Foo.toObject(foo);\n    test.same(obj.foo, { type_url: \"Bar\", value: [10, 1, 97] }, \"should keep explicit Any in toObject properly\");\n\n    obj = Foo.toObject(foo, { json: true });\n    test.same(obj.foo, { \"@type\": \"type.googleapis.com/Bar\", bar: \"a\" }, \"should decode explicitly Any in toObject if requested\");\n\n    foo = Foo.fromObject({\n        foo: {\n            \"@type\": \".Bar\",\n            bar: \"a\"\n        }\n    });\n    test.ok(foo.foo instanceof Any.ctor, \"should convert to Any in fromObject\");\n    test.same(foo.foo, { type_url: \"/Bar\", value: protobuf.util.newBuffer([10, 1, 97]) }, \"should have correct Any object when converted with fromObject\");\n\n    var baz = Foo.fromObject({\n        foo: {\n            type_url: \"type.someurl.com/Bar\",\n            value: [1 << 3 | 2, 1, 97] // value = \"a\"\n        }\n    });\n    obj = Foo.toObject(baz, { json: true });\n    test.same(obj.foo, { \"@type\": \"type.someurl.com/Bar\", bar: \"a\" }, \"should keep prefix in type url\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_groups.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar protoRequired = \"message Test {\\\n    required group MyGroup = 1 {\\\n        option foo = \\\"bar\\\";\\\n        required uint32 a = 2;\\\n    };\\\n}\";\n\nvar protoRepeated = \"message Test {\\\n    repeated group MyGroup = 1 {\\\n        option foo = \\\"bar\\\";\\\n        required uint32 a = 2;\\\n    };\\\n}\";\n\ntape.test(\"legacy groups\", function(test) {\n    var root = protobuf.parse(protoRequired).root.resolveAll();\n\n    var Test = root.lookup(\"Test\");\n    var MyGroupType = Test.get(\"MyGroup\");\n    var MyGroupField = Test.get(\"myGroup\");\n    var msg = {\n        myGroup: {\n            a: 111\n        }\n    };\n    \n    test.ok(MyGroupType instanceof protobuf.Type && MyGroupField instanceof protobuf.Field, \"should parse to a type and a field\");\n    test.equal(MyGroupType.group, true, \"should have the group flag set on the type\");\n    test.equal(MyGroupField.delimited, true, \"should have the delimited flag set on the field\");\n    test.equal(MyGroupField.resolvedType, MyGroupType, \"should reference the type from the field\");\n    var json = MyGroupType.toJSON();\n    test.equal(json.group, true, \"should export group=true to JSON\");\n    var MyGroupType2 = protobuf.Type.fromJSON(\"MyGroup\", json);\n    test.equal(MyGroupType2.group, true, \"should import group=true from JSON\");\n    // NOTE: fromJSON alone does not add the sister-field.\n    // The parser does this explicitly and the field is part of the exported JSON itself.\n\n    test.test(test.name + \" - should encode required\", (function(Test, msg) { return function(test) {\n        var buf = Test.encode(msg).finish();\n        test.equal(buf.length, 4, \"a total of 4 bytes\");\n        test.equal(buf[0], 1 << 3 | 3, \"id 1, wireType 3\");\n        test.equal(buf[1], 2 << 3 | 0, \"id 2, wireType 0\");\n        test.equal(buf[2], 111, \"111\");\n        test.equal(buf[3], 1 << 3 | 4, \"id 1, wireType 4\");\n        test.same(Test.decode(buf), msg, \"and decode back the original message\");\n        test.end();\n    };})(Test, msg));\n\n    // Same but repeated\n    root = protobuf.parse(protoRepeated).root;\n    Test = root.resolveAll().lookup(\"Test\");\n    msg = {\n        myGroup: [{\n            a: 111\n        },{\n            a: 112\n        }]\n    };\n\n    test.test(test.name + \" - should encode repeated\", (function(Test, msg) { return function(test) {\n        var buf = Test.encode(msg).finish();\n        test.equal(buf.length, 8, \"a total of 8 bytes\");\n        test.equal(buf[0], 1 << 3 | 3, \"id 1, wireType 3\");\n        test.equal(buf[1], 2 << 3 | 0, \"id 2, wireType 0\");\n        test.equal(buf[2], 111, \"111\");\n        test.equal(buf[3], 1 << 3 | 4, \"id 1, wireType 4\");\n        test.equal(buf[4], 1 << 3 | 3, \"id 1, wireType 3\");\n        test.equal(buf[5], 2 << 3 | 0, \"id 2, wireType 0\");\n        test.equal(buf[6], 112, \"112\");\n        test.equal(buf[7], 1 << 3 | 4, \"id 1, wireType 4\");\n        test.same(Test.decode(buf), msg, \"and decode back the original message\");\n        test.end();\n    };})(Test, msg));\n\n    test.end();\n});\n\n\ntape.test(\"delimited encoding\", function(test) {\n    var root = protobuf.parse(`\n        edition = \"2023\";\n        message Message {\n            uint32 a = 2;\n        };\n        message Test {\n            Message msg = 1 [features.message_encoding = DELIMITED];\n        }\n    `).root.resolveAll();\n\n    var Test = root.lookup(\"Test\");\n    var Message = root.get(\"Message\");\n    var Field = Test.get(\"msg\");\n    var msg = {\n        msg: {\n            a: 111\n        }\n    };\n\n    test.ok(Message instanceof protobuf.Type && Field instanceof protobuf.Field, \"should parse to a type and a field\");\n    test.notOk(Message.group, \"should not have the group flag set on the type\");\n    test.ok(Field.delimited, \"should have the delimited flag set on the field\");\n    test.equal(Field.resolvedType, Message, \"should reference the type from the field\");\n\n    test.test(test.name + \" - should encode required\", (function(Test, msg) { return function(test) {\n        var buf = Test.encode(msg).finish();\n        test.equal(buf.length, 4, \"a total of 4 bytes\");\n        test.equal(buf[0], 1 << 3 | 3, \"id 1, wireType 3\");\n        test.equal(buf[1], 2 << 3 | 0, \"id 2, wireType 0\");\n        test.equal(buf[2], 111, \"111\");\n        test.equal(buf[3], 1 << 3 | 4, \"id 1, wireType 4\");\n        test.same(Test.decode(buf), msg, \"and decode back the original message\");\n        test.end();\n    };})(Test, msg));\n\n    // Same but repeated\n    root = protobuf.parse(`\n        edition = \"2023\";\n        message Message {\n            uint32 a = 2;\n        };\n        message Test {\n            repeated Message msg = 1 [features.message_encoding = DELIMITED];\n        }\n    `).root;\n    Test = root.resolveAll().lookup(\"Test\");\n    msg = {\n        msg: [{\n            a: 111\n        },{\n            a: 112\n        }]\n    };\n\n    test.test(test.name + \" - should encode repeated\", (function(Test, msg) { return function(test) {\n        var buf = Test.encode(msg).finish();\n        test.equal(buf.length, 8, \"a total of 8 bytes\");\n        test.equal(buf[0], 1 << 3 | 3, \"id 1, wireType 3\");\n        test.equal(buf[1], 2 << 3 | 0, \"id 2, wireType 0\");\n        test.equal(buf[2], 111, \"111\");\n        test.equal(buf[3], 1 << 3 | 4, \"id 1, wireType 4\");\n        test.equal(buf[4], 1 << 3 | 3, \"id 1, wireType 3\");\n        test.equal(buf[5], 2 << 3 | 0, \"id 2, wireType 0\");\n        test.equal(buf[6], 112, \"112\");\n        test.equal(buf[7], 1 << 3 | 4, \"id 1, wireType 4\");\n        test.same(Test.decode(buf), msg, \"and decode back the original message\");\n        test.end();\n    };})(Test, msg));\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_import_extend.js",
    "content": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar path = require(\"path\");\nvar tape = require(\"tape\");\nvar protobuf = require(\"../index\");\n\n// to extend Root\nvar descriptor = require(\"../ext/descriptor\");\n\ntape.test(\"extensions - proto2 to proto3\", function (test) {\n    // load document with extended field imported multiple times\n    var root = protobuf.loadSync(path.resolve(__dirname, \"data/test.proto\"));\n\n    // convert to Descriptor Set\n    var decodedDescriptorSet = root.toDescriptor(\"proto3\");\n\n    // load back from descriptor set\n    var root2 = protobuf.Root.fromDescriptor(decodedDescriptorSet);\n\n    var Simple1 = root2.lookup(\"Simple1\");\n    test.notOk(Simple1.fields.aString.required, \"required fields don't exist in proto3\");\n    test.notOk(Simple1.fields.aBoolean.hasPresence, \"presence is not preserved\");\n\n    test.pass(\"should parse and resolve without errors\");\n    test.end();\n});\n\ntape.test(\"extensions - proto2 roundtrip\", function (test) {\n    // load document with extended field imported multiple times\n    var root = protobuf.parse(`syntax = \"proto2\";\n\n        message Message {\n            optional string explicit = 1;\n            required string required = 2;\n            repeated int32 packed = 3 [packed = true];\n            repeated int32 unpacked = 4;\n            optional int32 repeated_options = 5 [targets = TARGET_TYPE_SERVICE, targets = TARGET_TYPE_FILE];\n        }\n    `).root.resolveAll();\n\n    // convert to Descriptor Set\n    var decodedDescriptorSet = root.toDescriptor(\"proto2\");\n\n    // load back from descriptor set\n    var root2 = protobuf.Root.fromDescriptor(decodedDescriptorSet);\n\n    test.same(root.toJSON(), root2.toJSON(), \"JSON should roundtrip\");\n\n    var Message = root2.lookup(\"Message\");\n    test.ok(Message.fields.required.required, \"required field preserved\");\n    test.ok(Message.fields.explicit.hasPresence, \"presence is preserved\");\n    test.ok(Message.fields.packed.packed, \"packed is preserved\");\n    test.notOk(Message.fields.unpacked.packed, \"expanded is preserved\");\n\n    test.end();\n});\n\ntape.test(\"extensions - proto3 roundtrip\", function (test) {\n    var root = protobuf.parse(`syntax = \"proto3\";\n\n        message Message {\n            optional string explicit = 1;\n            string implicit = 2;\n            repeated int32 packed = 3;\n            repeated int32 unpacked = 4 [packed = false];\n        }\n    `).root.resolveAll();\n\n    // convert to Descriptor Set\n    const decodedDescriptorSet = root.toDescriptor(\"proto3\");\n\n    // load back from descriptor set\n    const root2 = protobuf.Root.fromDescriptor(decodedDescriptorSet);\n\n    var Message = root2.lookup(\"Message\");\n\n    test.same(root2.toJSON(), root.toJSON(), \"JSON should roundtrip\");\n\n    test.ok(Message.fields.explicit.hasPresence, \"should have explicit presence\");\n    test.notOk(Message.fields.implicit.hasPresence, \"should have implicit presence\");\n    test.ok(Message.fields.packed.packed, \"packed is preserved\");\n    test.notOk(Message.fields.unpacked.packed, \"expanded is preserved\");\n\n    test.end();\n});\n\ntape.test(\"extensions - proto3 optional in extend toDescriptor\", function (test) {\n  var root = protobuf.parse(`syntax = \"proto3\";\n\n    message SomeMessage {\n      string foo = 1;\n    }\n\n    extend SomeMessage {\n      optional string bar = 2;\n    }\n  `).root.resolveAll();\n\n  var decodedDescriptorSet;\n  try {\n    decodedDescriptorSet = root.toDescriptor(\"proto3\");\n    test.pass(\"toDescriptor should not throw\");\n  } catch (err) {\n    test.fail(err);\n    test.end();\n    return;\n  }\n\n  test.ok(decodedDescriptorSet.file[0].extension && decodedDescriptorSet.file[0].extension.length === 1,\n    \"should include extension field\");\n\n  var ext = decodedDescriptorSet.file[0].extension[0];\n  test.equal(ext.name, \"bar\", \"extension field name is preserved\");\n  test.equal(ext.proto3_optional, true, \"proto3_optional flag is preserved\");\n\n  test.end();\n});\n\ntape.test(\"extensions - edition 2023 file roundtrip\", function (test) {\n    var json = {\n      nested: { Message: {\n          edition: \"2023\",\n          options: { \"features\": { \"field_presence\": \"IMPLICIT\" } },\n          fields: {\n              explicit: { type: \"string\", id: 1, options: { \"features\": { \"field_presence\": \"EXPLICIT\" } } },\n              implicit: { type: \"string\", id: 2 },\n              required: { type: \"string\", id: 3, options: { \"features\": { \"field_presence\": \"LEGACY_REQUIRED\" }} },\n          },\n          nested: { Nested: { fields: {\n              explicit: { type: \"string\", id: 1, options: { \"features\": { \"field_presence\": \"EXPLICIT\" } } },\n              implicit: { type: \"string\", id: 2 },\n          } } }\n      } }\n    };\n    var root = protobuf.Root.fromJSON(json);\n\n    // convert to Descriptor Set\n    const decodedDescriptorSet = root.toDescriptor(\"2023\");\n    \n    // load back from descriptor set\n    const root2 = protobuf.Root.fromDescriptor(decodedDescriptorSet);\n\n    var Type = root2.lookup(\"Message\");\n    var Nested = Type.nested.Nested;\n\n    test.same(root2.toJSON(), json, \"JSON should roundtrip\");\n\n    test.ok(Type.fields.explicit.hasPresence, \"should have explicit presence\");\n    test.notOk(Type.fields.implicit.hasPresence, \"should have implicit presence\");\n\n    test.ok(Nested.fields.explicit.hasPresence, \"nested should have explicit presence\");\n    test.notOk(Nested.fields.implicit.hasPresence, \"nested should have implicit presence\");\n\n    test.end();\n});\n\n\ntape.test(\"extensions - proto2 root-less type\", function (test) {\n    var Message = protobuf.Type.fromJSON(\"Message\", {\n      \"edition\": \"proto2\",\n      \"fields\": {\n        \"explicit\": {\n          \"type\": \"string\",\n          \"id\": 1\n        },\n        \"required\": {\n          \"rule\": \"required\",\n          \"type\": \"string\",\n          \"id\": 2\n        },\n        \"packed\": {\n          \"rule\": \"repeated\",\n          \"type\": \"int32\",\n          \"id\": 3,\n          \"options\": {\n            \"packed\": true\n          }\n        },\n        \"unpacked\": {\n          \"rule\": \"repeated\",\n          \"type\": \"int32\",\n          \"id\": 4\n        },\n        \"nested\": {\n          \"type\": \"Nested\",\n          \"id\": 5\n        }\n      },\n      \"nested\": {\n        \"Nested\": {\n          \"fields\": {\n            \"a\": {\n              \"type\": \"int32\",\n              \"id\": 1\n            }\n          }\n        }\n      }\n    }).resolveAll();\n\n    // convert to Descriptor Set\n    const decodedDescriptorSet = Message.toDescriptor(\"proto2\");\n    \n    // load back from descriptor set\n    const Message2 = protobuf.Type.fromDescriptor(decodedDescriptorSet, \"proto2\").resolveAll();\n\n    test.same(Message2.toJSON(), Message.toJSON(), \"JSON should roundtrip\");\n\n    test.ok(Message2.fields.explicit.hasPresence, \"should have explicit presence\");\n    test.ok(Message2.fields.required.required, \"should have required presence\");\n    test.ok(Message2.fields.packed.packed, \"should have packed encoding\");\n    test.notOk(Message2.fields.unpacked.packed, \"should have expanded encoding\");\n    test.same(Message2.fields.nested.resolvedType, Message2.nested.Nested, \"should have cross linkage\");\n\n    test.end();\n});\n\n\ntape.test(\"extensions - unsupported edition\", function (test) {\n    var json = {\n      nested: { Message: {\n          edition: \"2023\",\n          options: { \"features\": { \"field_presence\": \"IMPLICIT\" } },\n          fields: {\n              explicit: { type: \"string\", id: 1, options: { \"features\": { \"field_presence\": \"EXPLICIT\" } } },\n              implicit: { type: \"string\", id: 2 },\n          },\n          nested: { Nested: { fields: {\n              explicit: { type: \"string\", id: 1, options: { \"features\": { \"field_presence\": \"EXPLICIT\" } } },\n              implicit: { type: \"string\", id: 2 },\n          } } }\n      } }\n    };\n    var root = protobuf.Root.fromJSON(json);\n\n    // convert to Descriptor Set\n    test.throws(function() {\n        root.toDescriptor(\"2030\")\n    }, /Unsupported edition 2030/, \"unsupported edition output throws\");\n\n    const decodedDescriptorSet = root.toDescriptor(\"2023\");\n    decodedDescriptorSet.file[0].edition = descriptor.Edition.EDITION_99997_TEST_ONLY\n    \n    test.throws(function() {\n        protobuf.Root.fromDescriptor(decodedDescriptorSet)\n    }, /Unsupported edition 99997/, \"unsupported edition input throws\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_import_extend.ts",
    "content": "import path = require(\"path\");\nimport * as tape from \"tape\";\n\nimport * as protobuf from \"../index\";\nimport { IFileDescriptorSet } from \"../ext/descriptor\";\n// to extend Root\nrequire(\"../ext/descriptor\");\n\ninterface Descriptor {\n  toDescriptor(\n    protoVersion: string\n  ): protobuf.Message<IFileDescriptorSet> & IFileDescriptorSet;\n  fromDescriptor(\n    descriptor: IFileDescriptorSet | protobuf.Reader | Uint8Array\n  ): protobuf.Root;\n}\n\ntape.test(\"extensions\", function (test) {\n  // load document with extended field imported multiple times\n  const root = protobuf.loadSync(path.resolve(__dirname, \"data/test.proto\"));\n  root.resolveAll();\n\n  // convert to Descriptor Set\n  const decodedDescriptorSet = (root as unknown as Descriptor).toDescriptor(\n    \"proto3\"\n  );\n\n  // load back from descriptor set\n  const root2 = (protobuf.Root as unknown as Descriptor).fromDescriptor(\n    decodedDescriptorSet\n  );\n\n  test.pass(\"should parse and resolve without errors\");\n  test.end();\n});\n"
  },
  {
    "path": "tests/comp_jspb-test.js",
    "content": "var tape = require(\"tape\");\nvar protobuf  = require(\"..\");\n\ntape.test(\"jspb test proto\", function(test) {\n    var existingRoot = new protobuf.Root();\n    protobuf.load(\"tests/data/test.proto\", existingRoot, function(err, root) {\n        if (err)\n            return test.fail(err.message);\n\n        test.pass(\"should parse without errors\");\n        test.equal(root, existingRoot, \"should reuse existing root\");\n\n        test.doesNotThrow(function() {\n            root.resolveAll();\n            traverse(root);\n        }, \"should resolve all types and generate code for them without errors\");\n\n        test.end();\n    });\n\n});\n\nfunction traverse(ns) {\n    ns.nestedArray.forEach(function(nested) {\n        if (nested instanceof protobuf.Type)\n            nested.setup();\n        if (nested instanceof protobuf.Namespace)\n            traverse(nested);\n    });\n}\n"
  },
  {
    "path": "tests/comp_long-tags.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar root = protobuf.Root.fromJSON({\n    nested: {\n        Message: {\n            fields: {\n                val: {\n                    type: \"uint32\",\n                    id: 0x1FFFFFFF\n                }\n            }\n        }\n    }\n});\n\ntape.test(\"long tags\", function(test) {\n\n    var Message = root.lookup(\"Message\");\n    var message = { val: 1 };\n    var buf = Message.encode(message).finish();\n    \n    test.equal(buf[0], 0xf8, \"should write F8 (78)\");\n    test.equal(buf[1], 0xff, \"should write FF (7F)\");\n    test.equal(buf[2], 0xff, \"should write FF (7F)\");\n    test.equal(buf[3], 0xff, \"should write FF (7F)\");\n    test.equal(buf[4], 0x0f, \"should write 1111b\");\n    test.equal(buf[5], 1, \"should write value 1\");\n\n    var comp = Message.decode(buf);\n    test.deepEqual(comp, message, \"should decode back the original data\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_maps.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar root = protobuf.Root.fromJSON({\n    nested: {\n        Inner: {\n            fields: {\n                key: {\n                    type: \"string\",\n                    id: 1\n                },\n                values: {\n                    rule: \"repeated\",\n                    type: \"string\",\n                    id: 2\n                }\n            }\n        },\n        Outer: {\n            fields: {\n                value: {\n                    keyType: \"string\",\n                    type: \"Inner\",\n                    id: 1\n                }\n            }\n        }        \n    }\n});\n\nvar chars = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\nfunction randomString(len) {\n    var str = \"\";\n    for (var i = 0; i < len; ++i)\n        str += chars.charAt((Math.random() * chars.length)|0);\n    return str;\n}\n\nfunction randomMap() {\n    var map = {};\n    for (var i = 0; i < 10; ++i) {\n        var values = [];\n        for (var j = 0; j < 10; ++j)\n            values.push(randomString(10));\n        var key; do { key = randomString(10); } while(map[key]);\n        map[key] = {\n            key: randomString(10),\n            values: values\n        };\n    }\n    return map;\n}\n\ntape.test(\"maps\", function(test) {\n    var Inner = root.lookup(\"Inner\"),\n        Outer = root.lookup(\"Outer\");\n\n    test.test(test.name + \" - randomly generated\", function(test) {\n\n        var outer = { value: randomMap() };\n        var buf = Outer.encode(outer).finish();\n        var dec = Outer.decode(buf);\n\n        test.deepEqual(dec, outer, \"should decode back the original random map\");\n\n        test.end();\n    });\n\n    test.test(test.name + \" - specifically crafted\", function(test) {\n\n        var outer = {\n            value: {\n                b: {\n                    key: \"1\",\n                    values: [\"c\", \"d\"]\n                },\n                a: {\n                    key: \"2\",\n                    values: [\"a\", \"b\"]\n                }\n            }\n        };\n\n        var buf = Outer.encode(outer).finish();\n        verifyEncode(test, buf);\n\n        var dec = Outer.decode(buf);\n        test.deepEqual(dec, outer, \"should decode back the original map\");\n\n        test.end();\n    });\n\n    test.test(test.name + \" - omitted fields\", function(test) {\n\n        var mapRoot = protobuf.Root.fromJSON({\n            nested: {\n                MapMessage: {\n                    fields: {\n                        value: {\n                            keyType: \"int32\",\n                            type: \"string\",\n                            id: 1\n                        }\n                    }\n                }\n            }\n        });\n\n        var MapMessage = mapRoot.lookup(\"MapMessage\");\n\n        var value = {\n            value: {\n                0: ''\n            }\n        };\n        var dec;\n\n        // 1 <chunk> = message(1 <varint> = 0, 2 <chunk> = empty chunk)\n        dec = MapMessage.decode(Uint8Array.of(0x0a, 0x04, 0x08, 0x00, 0x12, 0x00));\n        test.deepEqual(dec, value, \"should correct decode the buffer without omitted fields\");\n\n        // 1 <chunk> = message(1 <varint> = 0)\n        dec = MapMessage.decode(Uint8Array.of(0x0a, 0x02, 0x08, 0x00));\n        test.deepEqual(dec, value, \"should correct decode the buffer with omitted value\");\n\n        // 1 <chunk> = message(2 <chunk> = empty chunk)\n        dec = MapMessage.decode(Uint8Array.of(0x0a, 0x02, 0x12, 0x00));\n        test.deepEqual(dec, value, \"should correct decode the buffer with omitted key\");\n\n        // 1 <chunk> = empty chunk\n        dec = MapMessage.decode(Uint8Array.of(0x0a, 0x00));\n        test.deepEqual(dec, value, \"should correct decode the buffer with both key and value omitted\");\n\n        test.end();\n    });\n\n    test.end();\n});\n\nfunction verifyEncode(test, buf) {\n    test.test(test.name + \" - should encode\", function(test) {\n        test.equal(buf.length, 32, \"a total of 30 bytes\");\n\n        // first kv:\n        /*\n            b: {\n                key: \"1\",\n                values: [\"c\", \"d\"]\n            },\n        */\n        test.equal(buf[ 0], 10, \"id 1, wireType 2\"); // Outer.value\n        test.equal(buf[ 1], 14, \"a length of 14\");\n        test.equal(buf[ 2], 10, \"id 1, wireType 2\"); //   Outer.value $key\n        test.equal(buf[ 3],  1, \"a length of 1\");\n        test.equal(buf[ 4], 98, \"'b'\");\n        test.equal(buf[ 5], 18, \"id 2, wireType 2\"); //   Outer.value $value\n        test.equal(buf[ 6],  9, \"a length of 9\");\n        test.equal(buf[ 7], 10, \"id 1, wireType 2\"); //     Inner.key\n        test.equal(buf[ 8],  1 , \"a length of 1\");\n        test.equal(buf[ 9], 49, \"'1'\");\n        test.equal(buf[10], 18, \"id 2, wireType 2\"); //     Inner.values (1)\n        test.equal(buf[11],  1, \"a length of 1\");\n        test.equal(buf[12], 99, \"'c'\");\n        test.equal(buf[13], 18, \"id 2, wireType 2\"); //     Inner.values (2)\n        test.equal(buf[14],  1, \"a length of 1\");\n        test.equal(buf[15],100, \"'d'\");\n\n        // second\n        test.equal(buf[16], 10, \"id 1, wireType 2\"); // Outer.value\n        // ...\n\n        test.end();\n    });\n}\n"
  },
  {
    "path": "tests/comp_negative-int32.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf  = require(\"..\");\n\ntape.test(\"negative int32 values\", function(test) {\n    var writer = protobuf.Writer.create();\n    writer.int32(-5615122);\n    var buf = writer.finish();\n\n    test.equal(buf.length, 10, \"should encode to 10 bytes\");\n\n    var reader = protobuf.Reader.create(buf);\n\n    test.equal(reader.int32(), -5615122, \"should decode from 10 bytes\");\n\n    test.equal(reader.pos, 10, \"should have consumed the entire test buffer\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_oneof.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"syntax = \\\"proto3\\\";\\\nmessage Message {\\\n    oneof kind {\\\n        string str = 1;\\\n        int32 num = 2;\\\n        Type enm = 4;\\\n    }\\\n    bool other = 3;\\\n}\\\nenum Type {\\\n    ONE = 1;\\\n    TWO = 2;\\\n}\";\n\ntape.test(\"oneofs\", function(test) {\n    var root = protobuf.parse(proto).root;\n\n    var Message = root.lookup(\"Message\");\n\n    var message = Message.create({\n        str: \"a\",\n        num: 1,\n        other: false\n    });\n\n    test.equal(message.num, 1, \"should initialize the last value\");\n    test.equal(message.kind, \"num\", \"should reference the last value\");\n    \n    message.kind = 'num';\n    test.notOk(message.hasOwnProperty('str'), \"should delete other values\");\n\n    message.str = \"a\";\n    message.kind = 'str';\n\n    test.notOk(message.hasOwnProperty('num'), \"should delete the previous value\");\n    test.equal(message.str, \"a\", \"should set the new value\");\n    test.equal(message.kind, \"str\", \"should reference the new value\");\n\n    message.num = 0; // default\n    message.kind = 'num';\n    test.notOk(message.hasOwnProperty('str'), \"should delete the previous value\");\n    test.equal(message.num, 0, \"should set the new value\");\n    test.equal(message.kind, \"num\", \"should reference the new value\");\n    test.equal(message.hasOwnProperty(\"num\"), true, \"should have the new value on the instance, not just the prototype\");\n\n    delete message.other;\n    var buf = Message.encode(message).finish();\n    test.equal(buf.length, 2, \"should write a total of 2 bytes\");\n    test.equal(buf[0], 16, \"should write id 1, wireType 0\");\n    test.equal(buf[1], 0, \"should write a value of 0\");\n\n    test.end();\n\n});\n"
  },
  {
    "path": "tests/comp_optional.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"syntax = \\\"proto3\\\";\\\n\\\nmessage Message {\\\n    int32 regular_int32 = 1;\\\n    optional int32 optional_int32 = 2;\\\n    oneof _oneof_int32 {\\\n        int32 oneof_int32 = 3;\\\n    }\\\n}\\\n\";\n\ntape.test(\"proto3 optional\", function(test) {\n    var root = protobuf.parse(proto).root;\n\n    var Message = root.lookup(\"Message\");\n    test.equal(Message.fields.optionalInt32.optional, true);\n    test.equal(Message.fields.optionalInt32.options.proto3_optional, true);\n    test.equal(Message.oneofs._optionalInt32.name, '_optionalInt32');\n    test.deepEqual(Message.oneofs._optionalInt32.oneof, ['optionalInt32']);\n\n    var m = Message.create({});\n    test.strictEqual(m.regularInt32, 0);\n    test.strictEqual(m.optionalInt32, null);\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_options-parse.js",
    "content": "var tape = require(\"tape\");\nvar protobuf = require(\"..\");\n\ntape.test(\"Options\", function (test) {\n    var root = protobuf.loadSync(\"tests/data/options_test.proto\");\n\n    test.test(test.name + \" - field options (Int)\", function (test) {\n        var TestFieldOptionsInt = root.lookup(\"TestFieldOptionsInt\");\n        test.equal(TestFieldOptionsInt.fields.field1.options[\"(fo_rep_int)\"], 2, \"should take second repeated int option\");\n        test.same(TestFieldOptionsInt.fields.field1.parsedOptions, [{\"(fo_rep_int)\": 1}, {\"(fo_rep_int)\": 2}], \"should take all repeated int option\");\n\n        test.equal(TestFieldOptionsInt.fields.field2.options[\"(fo_single_int)\"], 3, \"should correctly parse single int option\");\n        test.same(TestFieldOptionsInt.fields.field2.parsedOptions, [{\"(fo_single_int)\": 3}], \"should correctly parse single int option\");\n        test.end();\n    });\n\n    test.test(test.name + \" - message options (Int)\", function (test) {\n        var TestMessageOptionsInt = root.lookup(\"TestMessageOptionsInt\");\n        test.equal(TestMessageOptionsInt.options[\"(mo_rep_int)\"], 2, \"should take second repeated int message option\");\n        test.equal(TestMessageOptionsInt.options[\"(mo_single_int)\"], 3, \"should correctly parse single int message option\");\n        test.same(TestMessageOptionsInt.parsedOptions, [{\"(mo_rep_int)\": 1}, {\"(mo_rep_int)\": 2}, {\"(mo_single_int)\": 3}], \"should take all int message option\");\n        test.end();\n    });\n\n    test.test(test.name + \" - field options (Message)\", function (test) {\n        var TestFieldOptionsMsg = root.lookup(\"TestFieldOptionsMsg\");\n        test.equal(TestFieldOptionsMsg.fields.field1.options[\"(fo_rep_msg).value\"], 4, \"should take second repeated message option\");\n        test.equal(TestFieldOptionsMsg.fields.field1.options[\"(fo_rep_msg).rep_value\"], 6, \"should take second repeated int in second repeated option\");\n        test.same(TestFieldOptionsMsg.fields.field1.parsedOptions, [\n            {\"(fo_rep_msg)\": {value: 1, rep_value: [2, 3]}},\n            {\"(fo_rep_msg)\": {value: 4, rep_value: [5, 6]}}], \"should take all repeated message option\");\n        test.equal(TestFieldOptionsMsg.fields.field2.options[\"(fo_single_msg).value\"], 7, \"should correctly parse single msg option\");\n        test.equal(TestFieldOptionsMsg.fields.field2.options[\"(fo_single_msg).rep_value\"], 9, \"should take second repeated int in single msg option\");\n        test.same(TestFieldOptionsMsg.fields.field2.parsedOptions, [{\"(fo_single_msg)\": {value: 7, rep_value: [8,9]}}], \"should take all repeated message option\");\n        test.end();\n    });\n\n    test.test(test.name + \" - message options (Message)\", function (test) {\n        var TestMessageOptionsMsg = root.lookup(\"TestMessageOptionsMsg\");\n        test.equal(TestMessageOptionsMsg.options[\"(mo_rep_msg).value\"], 5, \"should take last repeated message option\");\n        test.equal(TestMessageOptionsMsg.options[\"(mo_rep_msg).rep_value\"], 8, \"should take last repeated int in last repeated option\");\n        test.equal(TestMessageOptionsMsg.options[\"(mo_single_msg).value\"], 7, \"should correctly parse single msg option\");\n        test.equal(TestMessageOptionsMsg.options[\"(mo_single_msg).rep_value\"], 9, \"should take second repeated int in single msg option\");\n        test.same(TestMessageOptionsMsg.parsedOptions, [\n            {\"(mo_rep_msg)\": {value: 1, rep_value: [2, 3]}},\n            {\"(mo_rep_msg)\": {value: 4, rep_value: [5, 6]}},\n            {\"(mo_rep_msg)\": {value: 5, rep_value: [7, 8]}},\n            {\"(mo_single_msg)\": {value: 7, rep_value: [8, 9]}},\n        ], \"should take all message options\");\n        test.end();\n    });\n\n    test.test(test.name + \" - field options (Nested)\", function (test) {\n        var TestFieldOptionsNested = root.lookup(\"TestFieldOptionsNested\");\n        test.equal(TestFieldOptionsNested.fields.field1.options[\"(fo_rep_msg).value\"], 1, \"should merge repeated options messages\");\n        test.equal(TestFieldOptionsNested.fields.field1.options[\"(fo_rep_msg).rep_value\"], 3, \"should parse in any order\");\n        test.equal(TestFieldOptionsNested.fields.field1.options[\"(fo_rep_msg).nested.nested.value\"], \"x\", \"should correctly parse nested field options\");\n        test.equal(TestFieldOptionsNested.fields.field1.options[\"(fo_rep_msg).rep_nested.value\"], \"z\", \"should take second repeated nested options\");\n        test.equal(TestFieldOptionsNested.fields.field1.options[\"(fo_rep_msg).nested.value\"], \"w\", \"should merge nested options\");\n        test.same(TestFieldOptionsNested.fields.field1.parsedOptions,[\n            {\"(fo_rep_msg)\": {value: 1, nested: { nested: { value: \"x\"}}, rep_nested: [{value: \"y\"},{value: \"z\"}], rep_value: 3}},\n            {\"(fo_rep_msg)\": { nested: { value: \"w\"}}},\n        ],\"should parse all options including nested\");\n\n        test.equal(TestFieldOptionsNested.fields.field2.options[\"(fo_single_msg).nested.value\"], \"x\", \"should correctly parse nested property name\");\n        test.equal(TestFieldOptionsNested.fields.field2.options[\"(fo_single_msg).rep_nested.value\"], \"y\", \"should take second repeated nested options\");\n        test.same(TestFieldOptionsNested.fields.field2.parsedOptions, [{\n            \"(fo_single_msg)\": {\n                nested: {value: \"x\"},\n                rep_nested: [{value: \"x\"}, {value: \"y\"}]\n            }\n        }\n        ], \"should parse single nested option correctly\");\n\n        test.equal(TestFieldOptionsNested.fields.field3.options[\"(fo_single_msg).nested.value\"], \"x\", \"should correctly parse nested field options\");\n        test.equal(TestFieldOptionsNested.fields.field3.options[\"(fo_single_msg).nested.nested.nested.value\"], \"y\", \"should correctly parse several nesting levels\");\n        test.same(TestFieldOptionsNested.fields.field3.parsedOptions, [{\n            \"(fo_single_msg)\": {\n                nested: {\n                    value: \"x\",\n                    nested: {nested: {value: \"y\"}}\n                }\n            }\n        }], \"should correctly parse several nesting levels\");\n\n        test.end();\n    });\n\n    test.test(test.name + \" - message options (Nested)\", function (test) {\n        var TestMessageOptionsNested = root.lookup(\"TestMessageOptionsNested\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_rep_msg).value\"], 1, \"should merge repeated options messages\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_rep_msg).rep_value\"], 3, \"should parse in any order\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_rep_msg).nested.nested.value\"], \"x\", \"should correctly parse nested field options\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_rep_msg).rep_nested.value\"], \"z\", \"should take second repeated nested options\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_rep_msg).nested.value\"], \"w\", \"should merge nested options\");\n\n        test.equal(TestMessageOptionsNested.options[\"(mo_single_msg).nested.value\"], \"x\", \"should correctly parse nested property name\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_single_msg).rep_nested.value\"], \"y\", \"should take second repeated nested options\");\n        test.equal(TestMessageOptionsNested.options[\"(mo_single_msg).rep_nested.nested.nested.value\"], \"y\", \"should correctly parse several nesting levels\");\n\n        test.same(TestMessageOptionsNested.parsedOptions, [\n            {\n                \"(mo_rep_msg)\": {\n                    value: 1,\n                    nested: {nested: {value: \"x\"}},\n                    rep_nested: [{value: \"y\"}, {value: \"z\"}],\n                    rep_value: 3\n                }\n            },\n            {\"(mo_rep_msg)\": {nested: {value: \"w\"}}},\n            {\n                \"(mo_single_msg)\": {\n                    nested: {value: \"x\"},\n                    rep_nested: [{value: \"x\", nested: {nested: {value: \"y\"}}}, {value: \"y\"}]\n                }\n            }\n        ], \"should correctly parse all nested message options\");\n        test.end();\n    });\n\n    test.test(test.name + \" - rpc options (Nested)\", function (test) {\n        var TestOptionsRpc = root.lookup(\"TestOptionsRpc\");\n        test.equal(TestOptionsRpc.options[\"(method_rep_msg).value\"], 1, \"should merge repeated options messages\");\n        test.equal(TestOptionsRpc.options[\"(method_rep_msg).rep_value\"], 3, \"should parse in any order\");\n        test.equal(TestOptionsRpc.options[\"(method_rep_msg).nested.nested.value\"], \"x\", \"should correctly parse nested field options\");\n        test.equal(TestOptionsRpc.options[\"(method_rep_msg).rep_nested.value\"], \"z\", \"should take second repeated nested options\");\n        test.equal(TestOptionsRpc.options[\"(method_rep_msg).nested.value\"], \"w\", \"should merge nested options\");\n\n        test.equal(TestOptionsRpc.options[\"(method_single_msg).nested.value\"], \"x\", \"should correctly parse nested property name\");\n        test.equal(TestOptionsRpc.options[\"(method_single_msg).rep_nested.value\"], \"y\", \"should take second repeated nested options\");\n        test.equal(TestOptionsRpc.options[\"(method_single_msg).rep_nested.nested.nested.value\"], \"y\", \"should correctly parse several nesting levels\");\n\n        var expectedParsedOptions = [\n            {\n                \"(method_rep_msg)\": {\n                    value: 1,\n                    nested: {nested: {value: \"x\"}},\n                    rep_nested: [{value: \"y\"}, {value: \"z\"}],\n                    rep_value: 3\n                }\n            },\n            {\"(method_rep_msg)\": {nested: {value: \"w\"}}},\n            {\n                \"(method_single_msg)\": {\n                    nested: {value: \"x\"},\n                    rep_nested: [{value: \"x\", nested: {nested: {value: \"y\"}}}, {value: \"y\"}]\n                }\n            }\n        ];\n\n        test.same(TestOptionsRpc.parsedOptions, expectedParsedOptions, \"should correctly parse all nested message options\");\n        var jsonTestOptionsRpc = TestOptionsRpc.toJSON();\n        test.same(jsonTestOptionsRpc.parsedOptions, expectedParsedOptions, \"should correctly store all nested method options in JSON\");\n        var rootFromJson = protobuf.Root.fromJSON(root.toJSON());\n        var TestOptionsRpcFromJson = rootFromJson.lookup(\"TestOptionsRpc\");\n        test.same(TestOptionsRpcFromJson.parsedOptions, expectedParsedOptions, \"should correctly read all nested method options from JSON\");\n        test.end();\n    });\n\n    test.test(test.name + \" - invalid option\", function (test) {\n        test.throws(() => { protobuf.parse(\"option (foo).whatever = {\")});\n        test.end();\n    });\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_options-textformat.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"syntax = \\\"proto3\\\";\\\nimport \\\"google/protobuf/descriptor.proto\\\";\\\nmessage MyOptions {\\\n  string a = 1;\\\n  string b = 2;\\\n}\\\nextend google.protobuf.FieldOptions {\\\n  MyOptions my_options = 50000;\\\n}\\\nextend google.protobuf.EnumValueOptions {\\\n  MyOptions my_value_option = 50001;\\\n}\\\nmessage Test {\\\n  string value = 1 [(my_options) = { a: \\\"foo\\\" b: \\\"bar\\\" }];\\\n  string value2 = 2 [(my_options) = { a: \\\"foo\\\" b { c: \\\"bar\\\" } }];\\\n  string value3 = 3 [(my_options) = { a: \\\"foo\\\", b: \\\"bar\\\" }];\\\n  string value4 = 4 [(my_options) = { a: \\\"foo\\\"; b: \\\"bar\\\" }];\\\n}\\\nenum TestEnum {\\\n  TEST_ITEM = 0 [(my_value_option) = { a: \\\"foo\\\", b: \\\"bar\\\" }];\\\n}\";\n\ntape.test(\"options in textformat\", function(test) {\n    var root = protobuf.parse(proto).root;\n    var Test = root.lookup(\"Test\");\n    var TestEnum = root.lookup(\"TestEnum\");\n    test.same(Test.fields.value.options, { \"(my_options).a\": \"foo\", \"(my_options).b\": \"bar\" }, \"should parse correctly\");\n    test.same(Test.fields.value2.options, { \"(my_options).a\": \"foo\", \"(my_options).b.c\": \"bar\" }, \"should parse correctly when nested\");\n    test.same(Test.fields.value3.options, { \"(my_options).a\": \"foo\", \"(my_options).b\": \"bar\" }, \"should parse correctly when comma-separated\");\n    test.same(Test.fields.value4.options, { \"(my_options).a\": \"foo\", \"(my_options).b\": \"bar\" }, \"should parse correctly when semicolon-separated\");\n    test.same(TestEnum.valuesOptions[\"TEST_ITEM\"], { \"(my_value_option).a\": \"foo\", \"(my_value_option).b\": \"bar\" }, \"should parse correctly in enum\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_options.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = `\nsyntax = \"proto3\";\n\noption (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {\n    info: {\n      title: \"Some info\";\n      version: \"0\";\n    };\n    host: \"some.host\";\n};\n\nmessage Message {\n    int32 regular_int32 = 1;\n    optional int32 optional_int32 = 2;\n    oneof _oneof_int32 {\n        int32 oneof_int32 = 3;\n    }\n    actionType action = 4 [ (validate.rules).enum = {\n        defined_only: true,\n        not_in: [ 0 ],\n        in: [\"google\",\"github\",\"azuread\"]\n    } ];\n}\n`;\n\ntape.test(\"complex options\", function (test) {\n  var root = protobuf.parse(proto).root;\n\n  test.deepEqual(root.parsedOptions[0], {\n    \"(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger)\": {\n      info: {\n        title: \"Some info\",\n        version: \"0\",\n      },\n      host: \"some.host\",\n    },\n  });\n\n  test.deepEqual(root.Message.fields.action.parsedOptions[0], {\n    \"(validate.rules)\": {\n      enum: {\n        defined_only: true,\n        not_in: [0],\n        in: [\"google\", \"github\", \"azuread\"],\n      },\n    },\n  });\n\n  test.end();\n});\n"
  },
  {
    "path": "tests/comp_packed-repeated.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar packedOption = \"message Test {\\\n  repeated uint32 a = 1 [packed = true];\\\n}\";\n\nvar unpackedOption = \"message Test {\\\n  repeated uint32 a = 1 [packed = false];\\\n}\";\n\nvar packedFeature = \"edition = \\\"2023\\\";\\\nmessage Test {\\\n  repeated uint32 a = 1 [features.repeated_field_encoding = PACKED];\\\n}\";\n\nvar unpackedFeature = \"edition = \\\"2023\\\";\\\nmessage Test {\\\n  repeated uint32 a = 1 [features.repeated_field_encoding = EXPANDED];\\\n}\";\n\nvar regular = \"message Test {\\\n  repeated uint32 a = 1;\\\n}\";\n\nvar msg = {\n    a: [1,2,3]\n};\n\ntape.test(\"packed repeated values roundtrip\", function(test) {\n    var root1 = protobuf.parse(packedOption).root.resolveAll(),\n        root2 = protobuf.parse(unpackedOption).root.resolveAll();\n    var Test1 = root1.lookup(\"Test\"),\n        Test2 = root2.lookup(\"Test\");\n\n    var dec1 = Test2.decode(Test1.encode(msg).finish());\n    test.same(dec1, msg, \"should decode packed even if defined non-packed\");\n    var dec2 = Test1.decode(Test2.encode(msg).finish());\n    test.same(dec2, msg, \"should decode non-packed even if defined packed\");\n\n    test.end();\n});\n\ntape.test(\"packed repeated values encode\", function(top) {\n    [\n        packedOption,\n        `syntax = \"proto3\";\\n` + regular,\n        `syntax = \"proto3\";\\n` + packedOption,\n        `edition = \"2023\";\\n` + regular,\n        packedFeature,\n    ].forEach(function(proto, index) {\n        tape.test(\"proto \" + index, function(test) {\n            var root = protobuf.parse(proto).root.resolveAll();\n            var Test = root.lookup(\"Test\");\n\n            var buf = Test.encode(msg).finish();\n            test.equal(buf.length, 5, \"a total of 4 bytes\");\n            test.equal(buf[0], 1 << 3 | 2, \"id 1, wireType 2\");\n            test.equal(buf[1], 3, \"length 3\");\n            test.equal(buf[2], 1, \"element 1\");\n            test.equal(buf[3], 2, \"element 2\");\n            test.equal(buf[4], 3, \"element 3\");\n\n            test.end();\n        });\n    });\n\n    top.end()\n});\n\ntape.test(\"packed repeated values encode\", function(top) {\n    [\n        unpackedOption,\n        regular,\n        `syntax = \"proto3\";\\n` + unpackedOption,\n        unpackedFeature,\n    ].forEach(function(proto, index) {\n        tape.test(\"proto \" + index, function(test) {\n            var root = protobuf.parse(proto).root.resolveAll();\n            var Test = root.lookup(\"Test\");\n\n            var buf = Test.encode(msg).finish();\n            test.equal(buf.length, 6, \"a total of 6 bytes\");\n            test.equal(buf[0], 1 << 3 | 0, \"id 1, wireType 0\");\n            test.equal(buf[1], 1, \"element 1\");\n            test.equal(buf[2], 1 << 3 | 0, \"id 1, wireType 0\");\n            test.equal(buf[3], 2, \"element 2\");\n            test.equal(buf[4], 1 << 3 | 0, \"id 1, wireType 0\");\n            test.equal(buf[5], 3, \"element 3\");\n\n            test.end()\n        });\n    });\n\n    top.end()\n});\n\ntape.test(\"packed unpackable fields\", function(test) {\n    var root = protobuf.parse(`message Test {\n      repeated Test a = 1 [packed = true];\n      repeated Test b = 2 [packed = true, foo = true];\n    }`).root.resolveAll();\n    var Test = root.lookup(\"Test\");\n\n    test.equal(Test.fields.a.options, undefined, \"should have no options\")\n    test.equal(Test.fields.b.options.packed, undefined, \"should have no packed option\")\n    test.equal(Test.fields.b.options.foo, true, \"should retain other option\")\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_parse-uncommon.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"uncommon statements\", function(test) {\n    test.plan(3);\n    protobuf.load(\"tests/data/uncommon.proto\", function(err, root) {\n        if (err || !root)\n            test.fail(err && err.message || \"should parse without errors\");\n        new protobuf.Root().load(\"tests/data/uncommon.proto\", { keepCase: true }, function(err, root) {\n            if (err || !root) {\n                test.fail(err && err.message || \"should parse without errors\");\n                return;\n            }\n            test.pass(\"should parse without errors\");\n            test.doesNotThrow(function() {\n                root.resolveAll();\n            }, \"should resolve without errors\");\n            test.doesNotThrow(function() {\n                traverseTypes(root, function(type) {\n                    type.setup();\n                });\n            }, \"should setup all types without errors\");\n            test.end();\n        });\n    });\n});\n\nfunction traverseTypes(current, fn) {\n    if (current instanceof protobuf.Type) // and/or protobuf.Enum, protobuf.Service etc.\n        fn(current);\n    if (current.nestedArray)\n        current.nestedArray.forEach(function(nested) {\n            traverseTypes(nested, fn);\n        });\n}\n\ntape.test(\"invalid lookup\", async function(test) {\n    try {\n        await protobuf.load(\"tests/data/invalid-lookup.proto\");\n        test.fail(\"should have thrown\");\n    } catch(err) {\n        test.match(err.message, /illegal token 'required'/, \"failed to parse\");\n    }\n});\n\n"
  },
  {
    "path": "tests/comp_repeated-message.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar proto = \"message Outer {\\\n    repeated Inner inner = 1;\\\n}\\\nmessage Inner {\\\n}\";\n\nvar msg = { inner: [{}, {}, {}] };\n\ntape.test(\"repeated messages\", function(test) {\n    var root = protobuf.parse(proto).root,\n        Outer = root.lookup(\"Outer\");\n    \n    var dec = Outer.decode(Outer.encode(msg).finish());\n    test.same(dec, msg, \"should encode and decode back to the original values\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/comp_sfixed64-grpc.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"sfixed64 (grpc)\", function(test) {\n\n    var root = protobuf.Root.fromJSON({\n        nested: {\n            test: {\n                nested: {\n                    Test: {\n                        fields: {\n                            int_64: {\n                                type: 'sfixed64',\n                                id: 1\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    });\n\n    var Test = root.lookup(\"test.Test\");\n\n    var buffer = Test.encode({\n        int_64: '-9095674951825889465'\n    }).finish();\n\n    test.equal(buffer.length, 9, \"should encode a total of 9 bytes\");\n    test.equal(buffer[0], 9, \"should encode id 1, wireType 1\");\n\n    var decoded = Test.decode(buffer);\n    test.ok(decoded.int_64 == '-9095674951825889465', \"should decode back the original value\");\n\n    test.end();\n\n});\n"
  },
  {
    "path": "tests/comp_typescript.js",
    "content": "\"use strict\";\n// test currently consists only of not throwing\nvar __extends = (this && this.__extends) || (function () {\n    var extendStatics = function (d, b) {\n        extendStatics = Object.setPrototypeOf ||\n            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n        return extendStatics(d, b);\n    };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n    if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nexports.__esModule = true;\nexports.AwesomeMessage = exports.AwesomeSubMessage = exports.AwesomeEnum = exports.Hello = void 0;\nvar __1 = require(\"..\");\n// Reflection\nvar root = __1.Root.fromJSON({\n    nested: {\n        Hello: {\n            fields: {\n                value: {\n                    rule: \"required\",\n                    type: \"string\",\n                    id: 1\n                }\n            }\n        }\n    }\n});\nvar HelloReflected = root.lookupType(\"Hello\");\nHelloReflected.create({ value: \"hi\" });\n// Custom classes\nvar Hello = /** @class */ (function (_super) {\n    __extends(Hello, _super);\n    function Hello() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    Hello.prototype.foo = function () {\n        this.value = \"hi\";\n        return this;\n    };\n    return Hello;\n}(__1.Message));\nexports.Hello = Hello;\nroot.lookupType(\"Hello\").ctor = Hello;\nHello.create({ value: \"hi\" });\nvar helloMessage = new Hello({ value: \"hi\" });\nvar helloBuffer = Hello.encode(helloMessage.foo()).finish();\nvar helloDecoded = Hello.decode(helloBuffer);\n// Decorators\nrequire(\"reflect-metadata\");\nvar AwesomeEnum;\n(function (AwesomeEnum) {\n    AwesomeEnum[AwesomeEnum[\"ONE\"] = 1] = \"ONE\";\n    AwesomeEnum[AwesomeEnum[\"TWO\"] = 2] = \"TWO\";\n})(AwesomeEnum = exports.AwesomeEnum || (exports.AwesomeEnum = {}));\nvar AwesomeSubMessage = /** @class */ (function (_super) {\n    __extends(AwesomeSubMessage, _super);\n    function AwesomeSubMessage() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    __decorate([\n        __1.Field.d(1, \"string\"),\n        __metadata(\"design:type\", String)\n    ], AwesomeSubMessage.prototype, \"awesomeString\");\n    __decorate([\n        __1.MapField.d(2, \"string\", \"string\"),\n        __metadata(\"design:type\", Object)\n    ], AwesomeSubMessage.prototype, \"awesomeMapString\");\n    __decorate([\n        __1.MapField.d(3, \"string\", AwesomeEnum),\n        __metadata(\"design:type\", Object)\n    ], AwesomeSubMessage.prototype, \"awesomeMapEnum\");\n    __decorate([\n        __1.MapField.d(4, \"string\", AwesomeSubMessage),\n        __metadata(\"design:type\", Object)\n    ], AwesomeSubMessage.prototype, \"awesomeMapMessage\");\n    return AwesomeSubMessage;\n}(__1.Message));\nexports.AwesomeSubMessage = AwesomeSubMessage;\nvar AwesomeMessage = /** @class */ (function (_super) {\n    __extends(AwesomeMessage, _super);\n    function AwesomeMessage() {\n        return _super !== null && _super.apply(this, arguments) || this;\n    }\n    __decorate([\n        __1.Field.d(1, \"string\", \"optional\", \"awesome default string\"),\n        __metadata(\"design:type\", String)\n    ], AwesomeMessage.prototype, \"awesomeField\");\n    __decorate([\n        __1.Field.d(2, AwesomeSubMessage),\n        __metadata(\"design:type\", AwesomeSubMessage)\n    ], AwesomeMessage.prototype, \"awesomeSubMessage\");\n    __decorate([\n        __1.Field.d(3, AwesomeEnum, \"optional\", AwesomeEnum.ONE),\n        __metadata(\"design:type\", Number)\n    ], AwesomeMessage.prototype, \"awesomeEnum\");\n    __decorate([\n        __1.OneOf.d(\"awesomeSubMessage\", \"awesomeEnum\"),\n        __metadata(\"design:type\", String)\n    ], AwesomeMessage.prototype, \"which\");\n    AwesomeMessage = __decorate([\n        __1.Type.d(\"SuperAwesomeMessage\")\n    ], AwesomeMessage);\n    return AwesomeMessage;\n}(__1.Message));\nexports.AwesomeMessage = AwesomeMessage;\nvar awesomeMessage = new AwesomeMessage({ awesomeField: \"hi\" });\nvar awesomeBuffer = AwesomeMessage.encode(awesomeMessage).finish();\nvar awesomeDecoded = AwesomeMessage.decode(awesomeBuffer);\n"
  },
  {
    "path": "tests/comp_typescript.ts",
    "content": "// test currently consists only of not throwing\n\nimport { Root, Message, Type, Field, MapField, OneOf } from \"..\";\n\n// Reflection\nconst root = Root.fromJSON({\n    nested: {\n        Hello: {\n            fields: {\n                value: {\n                    rule: \"required\",\n                    type: \"string\",\n                    id: 1\n                }\n            }\n        }\n    }\n});\nconst HelloReflected = root.lookupType(\"Hello\");\n\nHelloReflected.create({ value: \"hi\" });\n\n// Custom classes\n\nexport class Hello extends Message<Hello> {\n\n    public value: string; // for MessageProperties<T> coercion\n\n    public foo() {\n        this.value = \"hi\";\n        return this;\n    }\n}\n\nroot.lookupType(\"Hello\").ctor = Hello;\n\nHello.create({ value: \"hi\" });\nlet helloMessage = new Hello({ value: \"hi\" });\nlet helloBuffer  = Hello.encode(helloMessage.foo()).finish();\nlet helloDecoded = Hello.decode(helloBuffer);\n\n// Decorators\n\nimport \"reflect-metadata\";\n\nexport enum AwesomeEnum {\n  ONE = 1,\n  TWO = 2\n}\n\nexport class AwesomeSubMessage extends Message<AwesomeSubMessage> {\n\n  @Field.d(1, \"string\")\n  public awesomeString: string;\n\n  @MapField.d(2, \"string\", \"string\")\n  public awesomeMapString : { [key: string]: string };\n\n  @MapField.d(3, \"string\", AwesomeEnum)\n  public awesomeMapEnum : { [key: string]: string };\n\n  @MapField.d(4, \"string\", AwesomeSubMessage)\n  public awesomeMapMessage : { [key: string]: Message<AwesomeSubMessage> };\n\n}\n\n@Type.d(\"SuperAwesomeMessage\")\nexport class AwesomeMessage extends Message<AwesomeMessage> {\n\n  @Field.d(1, \"string\", \"optional\", \"awesome default string\")\n  public awesomeField: string;\n\n  @Field.d(2, AwesomeSubMessage)\n  public awesomeSubMessage: AwesomeSubMessage;\n\n  @Field.d(3, AwesomeEnum, \"optional\", AwesomeEnum.ONE)\n  public awesomeEnum: AwesomeEnum;\n\n  @OneOf.d(\"awesomeSubMessage\", \"awesomeEnum\")\n  public which: string;\n\n}\n\nlet awesomeMessage = new AwesomeMessage({ awesomeField: \"hi\" });\nlet awesomeBuffer  = AwesomeMessage.encode(awesomeMessage).finish();\nlet awesomeDecoded = AwesomeMessage.decode(awesomeBuffer);\n"
  },
  {
    "path": "tests/comp_whitespace-in-type.js",
    "content": "var tape = require(\"tape\");\nvar protobuf = require(\"..\");\n\ntape.test(\"parsing line breaks\", function (test) {\n\n    test.test(test.name + \" - field options (Int)\", function (test) {\n        var root = protobuf.loadSync(\"tests/data/whitespace-in-type.proto\");\n        var message = root.lookupType('some.really.long.name.which.does.not.really.make.any.sense.but.sometimes.we.still.see.stuff.like.this.WouldYouParseThisForMePlease');\n        test.equal(message.fields.field.type, 'some.really.long.name.which.does.not.really.make.any.sense.but.sometimes.we.still.see.stuff.like.this.Test');\n        test.end();\n    });\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/data/badimport.proto",
    "content": "syntax = \"proto3\";\n\nimport \"nonexistent.proto\";\n\nmessage Message {\n  NonExistent field = 1;\n}\n"
  },
  {
    "path": "tests/data/cli/filter.json",
    "content": "{\n  \"messageNames\": [\"filtertest.NeedMessage1\", \"filtertest.NeedMessage2\"]\n}"
  },
  {
    "path": "tests/data/cli/null-defaults-edition2023.proto",
    "content": "edition = \"2023\";\n\nmessage OptionalFields {\n  message SubMessage {\n    string a = 1 [features.field_presence = IMPLICIT];\n  }\n\n  SubMessage a = 1;\n  string e = 2;\n  uint32 r = 3 [features.field_presence = LEGACY_REQUIRED];\n  uint32 i = 4  [features.field_presence = IMPLICIT];\n}\n"
  },
  {
    "path": "tests/data/cli/null-defaults-proto3.proto",
    "content": "syntax = \"proto3\";\n\nmessage OptionalFields {\n  message SubMessage {\n    string a = 1;\n  }\n\n  optional SubMessage a = 1;\n  optional string b = 2;\n  optional uint32 c = 3;\n  uint32 d = 4;\n}\n"
  },
  {
    "path": "tests/data/cli/null-defaults.proto",
    "content": "syntax = \"proto2\";\n\nmessage OptionalFields {\n  message SubMessage {\n    required string a = 1;\n  }\n\n  optional SubMessage a = 1;\n  optional string b = 2;\n  optional uint32 c = 3;\n  required uint32 d = 4;\n}\n"
  },
  {
    "path": "tests/data/cli/test-filter-import.proto",
    "content": "\nmessage DependentMessageFromImport {\n  optional int32 test1 = 1;\n}\n\nmessage NotNeedMessageInImportFile {\n  optional int32 test1 = 1;\n}"
  },
  {
    "path": "tests/data/cli/test-filter.proto",
    "content": "package filtertest;\nimport \"./test-filter-import.proto\";\n\nmessage NeedMessage1 {\n  optional uint32 test1 = 1;\n  optional NeedMessage2 needMessage2 = 2;\n  optional DependentMessage1 dependentMessage1 = 3;\n  optional DependentMessageFromImport dependentMessage2 = 4;\n}\n\nmessage NeedMessage2 {\n  optional uint32 test1 = 1;\n}\n\nmessage DependentMessage1 {\n  optional uint32 test1 = 1;\n}\n\nmessage NotNeedMessageInRootFile {\n  optional uint32 test1 = 1;\n}"
  },
  {
    "path": "tests/data/cli/test.proto",
    "content": "syntax = \"proto3\";\n\nmessage Message {\n  int32 value = 1;\n}\n\nenum Enum {\n  option allow_alias = true;\n\n  UNSPECIFIED = 0;\n  DEFAULT = 0; // checking that an alias does not break things\n  SOMETHING = 1;\n}\n\nmessage OneofContainer {\n  oneof some_oneof {\n    string string_in_oneof = 1;\n    Message message_in_oneof = 2;\n  }\n  string regular_field = 3;\n  Enum enum_field = 4;\n}\n"
  },
  {
    "path": "tests/data/comment_serialization.proto",
    "content": "syntax = \"proto3\";\n\n/// message comment\nmessage TestMessage {\n    /// field comment\n    string testField = 1;\n\n    /// map field comment\n    map<string, string> testMap = 2;\n\n    /// oneof field comment\n    oneof testOneof {\n        /// oneof string comment\n        string testOneofString = 3;\n        /// oneof bool comment\n        bool testOneofBool = 4;\n    }\n}\n\n/// service comment\nservice TestService {\n  /// method comment\n  rpc testMethod(TestMessage) returns (TestMessage) {}\n}\n\n/// enum comment\nenum TestEnum {\n    /// enum value comment\n    VALUE = 1;\n}\n"
  },
  {
    "path": "tests/data/comments-alternate-parse.proto",
    "content": "/**\n * File with alternate comment syntax.\n * This file uses double slash and regular star-slash comment styles for doc\n * strings.\n */\n\nsyntax = \"proto3\";\n\n// Message with\n// a\n// multi-line comment.\nmessage Test1 {\n\n    /**\n     * Field with a doc-block comment.\n     */\n    string field1 = 1;\n\n    // Field with a single-line comment starting with two slashes.\n    uint32 field2 = 2;\n\n    /// Field with a single-line comment starting with three slashes.\n    bool field3 = 3;\n\n    /* Field with a single-line slash-star comment. */\n    bool field4 = 4;\n\n    bool field5 = 5; // Field with a trailing single-line two-slash comment.\n\n    bool field6 = 6; /// Field with a trailing single-line three-slash comment.\n\n    bool field7 = 7; /* Field with a trailing single-line slash-star comment. */\n\n    bool field8 = 8;\n\n    // Field with a\n    // multi-line comment.\n    bool field9 = 9;\n\n    /**\n     * Field with a\n     * multi-line doc-block comment.\n     */\n    string field10 = 10;\n\n    // Field with both block comment\n    string field11 = 11; // and trailing comment.\n    string field12 = 12; // Trailing comment in last line should not be recognized as leading comment for this field.\n}\n\n/* Message\n   with\n   a multiline plain slash-star\n   comment.\n*/\nmessage Test2 {\n}\n\n/*\n * Message\n * with\n * a\n * comment and stars.\n */\nenum Test3 {\n\n    /** Value with a comment. */\n    ONE = 1;\n\n    // Value with a single-line comment.\n    TWO = 2;\n\n    /// Value with a triple-slash comment.\n    THREE = 3;  // ignored\n\n    FOUR = 4; /// Other value with a comment.\n\n    // Leading comment for value with both types of comments after field with trailing comment.\n    FIVE = 5; // Trailing comment for value with both types of comments after field with trailing comment.\n}\n\n// Single line comment,\n/*\nfollowed by a block comment, followed by a newline. (issue #1616)\n*/\nmessage Test4 {\n}\n\n                      // line comment with\n                      // whitespace in front\nmessage Test5 {\n}\n              \n// Multiple\n          // different\n    // comments\n    /*\nwith strange whitespace\n*/\nmessage Test6 {\n}\n\nservice ServiceTest {\n    // My method does things\n    rpc SingleLineMethod (MyRequest) returns (MyResponse);\n\n    // TwoLineMethodWithComment documentation\n    rpc TwoLineMethodWithComment (MyRequest)\n      returns (MyResponse);\n\n    // Very very long method\n    rpc\n      ThreeLine012345678901234567890123456712345671234567123456783927483923473892837489238749832432874983274983274983274(MyRequest)\n      returns (MyResponse);\n\n    // Random comment\n\n    rpc TwoLineMethodNoComment (MyRequest)\n      returns (MyResponse);\n}\n\nmessage MyRequest {\n    string path = 1;\n}\n\nmessage MyResponse {\n    int32 status = 2;\n}\n"
  },
  {
    "path": "tests/data/comments.d.ts",
    "content": "import * as $protobuf from \"../..\";\nexport interface ITest1 {\n    field1?: (string|null);\n    field2?: (number|null);\n    field3?: (boolean|null);\n}\n\nexport class Test1 implements ITest1 {\n    constructor(properties?: ITest1);\n    public field1: string;\n    public field2: number;\n    public field3: boolean;\n    public static create(properties?: ITest1): Test1;\n    public static encode(message: ITest1, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: ITest1, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Test1;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Test1;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): Test1;\n    public static toObject(message: Test1, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport interface ITest2 {\n}\n\nexport class Test2 implements ITest2 {\n    constructor(properties?: ITest2);\n    public static create(properties?: ITest2): Test2;\n    public static encode(message: ITest2, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: ITest2, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Test2;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Test2;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): Test2;\n    public static toObject(message: Test2, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport enum Test3 {\n    ONE = 1,\n    TWO = 2,\n    THREE = 3,\n    FOUR = 4,\n    FIVE = 5\n}\n"
  },
  {
    "path": "tests/data/comments.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_comments || ($protobuf.roots.test_comments = {});\n\n$root.Test1 = (function() {\n\n    /**\n     * Properties of a Test1.\n     * @exports ITest1\n     * @interface ITest1\n     * @property {string|null} [field1] Field with a comment.\n     * @property {number|null} [field2] Test1 field2\n     * @property {boolean|null} [field3] Field with a comment and a <a href=\"http://example.com/foo/\">link</a>\n     */\n\n    /**\n     * Constructs a new Test1.\n     * @exports Test1\n     * @classdesc Message\n     * with\n     * a\n     * comment.\n     * @implements ITest1\n     * @constructor\n     * @param {ITest1=} [properties] Properties to set\n     */\n    function Test1(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * Field with a comment.\n     * @member {string} field1\n     * @memberof Test1\n     * @instance\n     */\n    Test1.prototype.field1 = \"\";\n\n    /**\n     * Test1 field2.\n     * @member {number} field2\n     * @memberof Test1\n     * @instance\n     */\n    Test1.prototype.field2 = 0;\n\n    /**\n     * Field with a comment and a <a href=\"http://example.com/foo/\">link</a>\n     * @member {boolean} field3\n     * @memberof Test1\n     * @instance\n     */\n    Test1.prototype.field3 = false;\n\n    /**\n     * Creates a new Test1 instance using the specified properties.\n     * @function create\n     * @memberof Test1\n     * @static\n     * @param {ITest1=} [properties] Properties to set\n     * @returns {Test1} Test1 instance\n     */\n    Test1.create = function create(properties) {\n        return new Test1(properties);\n    };\n\n    /**\n     * Encodes the specified Test1 message. Does not implicitly {@link Test1.verify|verify} messages.\n     * @function encode\n     * @memberof Test1\n     * @static\n     * @param {ITest1} message Test1 message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Test1.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.field1 != null && Object.hasOwnProperty.call(message, \"field1\"))\n            writer.uint32(/* id 1, wireType 2 =*/10).string(message.field1);\n        if (message.field2 != null && Object.hasOwnProperty.call(message, \"field2\"))\n            writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.field2);\n        if (message.field3 != null && Object.hasOwnProperty.call(message, \"field3\"))\n            writer.uint32(/* id 3, wireType 0 =*/24).bool(message.field3);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified Test1 message, length delimited. Does not implicitly {@link Test1.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof Test1\n     * @static\n     * @param {ITest1} message Test1 message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Test1.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a Test1 message from the specified reader or buffer.\n     * @function decode\n     * @memberof Test1\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {Test1} Test1\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Test1.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Test1();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.field1 = reader.string();\n                break;\n            case 2:\n                message.field2 = reader.uint32();\n                break;\n            case 3:\n                message.field3 = reader.bool();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a Test1 message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof Test1\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {Test1} Test1\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Test1.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a Test1 message.\n     * @function verify\n     * @memberof Test1\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    Test1.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.field1 != null && message.hasOwnProperty(\"field1\"))\n            if (!$util.isString(message.field1))\n                return \"field1: string expected\";\n        if (message.field2 != null && message.hasOwnProperty(\"field2\"))\n            if (!$util.isInteger(message.field2))\n                return \"field2: integer expected\";\n        if (message.field3 != null && message.hasOwnProperty(\"field3\"))\n            if (typeof message.field3 !== \"boolean\")\n                return \"field3: boolean expected\";\n        return null;\n    };\n\n    /**\n     * Creates a Test1 message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof Test1\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {Test1} Test1\n     */\n    Test1.fromObject = function fromObject(object) {\n        if (object instanceof $root.Test1)\n            return object;\n        var message = new $root.Test1();\n        if (object.field1 != null)\n            message.field1 = String(object.field1);\n        if (object.field2 != null)\n            message.field2 = object.field2 >>> 0;\n        if (object.field3 != null)\n            message.field3 = Boolean(object.field3);\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a Test1 message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof Test1\n     * @static\n     * @param {Test1} message Test1\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    Test1.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.defaults) {\n            object.field1 = \"\";\n            object.field2 = 0;\n            object.field3 = false;\n        }\n        if (message.field1 != null && message.hasOwnProperty(\"field1\"))\n            object.field1 = message.field1;\n        if (message.field2 != null && message.hasOwnProperty(\"field2\"))\n            object.field2 = message.field2;\n        if (message.field3 != null && message.hasOwnProperty(\"field3\"))\n            object.field3 = message.field3;\n        return object;\n    };\n\n    /**\n     * Converts this Test1 to JSON.\n     * @function toJSON\n     * @memberof Test1\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    Test1.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for Test1\n     * @function getTypeUrl\n     * @memberof Test1\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    Test1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/Test1\";\n    };\n\n    return Test1;\n})();\n\n$root.Test2 = (function() {\n\n    /**\n     * Properties of a Test2.\n     * @exports ITest2\n     * @interface ITest2\n     */\n\n    /**\n     * Constructs a new Test2.\n     * @exports Test2\n     * @classdesc Represents a Test2.\n     * @implements ITest2\n     * @constructor\n     * @param {ITest2=} [properties] Properties to set\n     */\n    function Test2(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * Creates a new Test2 instance using the specified properties.\n     * @function create\n     * @memberof Test2\n     * @static\n     * @param {ITest2=} [properties] Properties to set\n     * @returns {Test2} Test2 instance\n     */\n    Test2.create = function create(properties) {\n        return new Test2(properties);\n    };\n\n    /**\n     * Encodes the specified Test2 message. Does not implicitly {@link Test2.verify|verify} messages.\n     * @function encode\n     * @memberof Test2\n     * @static\n     * @param {ITest2} message Test2 message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Test2.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        return writer;\n    };\n\n    /**\n     * Encodes the specified Test2 message, length delimited. Does not implicitly {@link Test2.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof Test2\n     * @static\n     * @param {ITest2} message Test2 message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Test2.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a Test2 message from the specified reader or buffer.\n     * @function decode\n     * @memberof Test2\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {Test2} Test2\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Test2.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Test2();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a Test2 message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof Test2\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {Test2} Test2\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Test2.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a Test2 message.\n     * @function verify\n     * @memberof Test2\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    Test2.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        return null;\n    };\n\n    /**\n     * Creates a Test2 message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof Test2\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {Test2} Test2\n     */\n    Test2.fromObject = function fromObject(object) {\n        if (object instanceof $root.Test2)\n            return object;\n        return new $root.Test2();\n    };\n\n    /**\n     * Creates a plain object from a Test2 message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof Test2\n     * @static\n     * @param {Test2} message Test2\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    Test2.toObject = function toObject() {\n        return {};\n    };\n\n    /**\n     * Converts this Test2 to JSON.\n     * @function toJSON\n     * @memberof Test2\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    Test2.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for Test2\n     * @function getTypeUrl\n     * @memberof Test2\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    Test2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/Test2\";\n    };\n\n    return Test2;\n})();\n\n/**\n * Test3 enum.\n * @exports Test3\n * @enum {number}\n * @property {number} ONE=1 Value with a comment.\n * @property {number} TWO=2 TWO value\n * @property {number} THREE=3 Preferred value with a comment.\n * @property {number} FOUR=4 Other value with a comment.\n * @property {number} FIVE=5 Leading comment for value with both types of comments after field with trailing comment.\n */\n$root.Test3 = (function() {\n    var valuesById = {}, values = Object.create(valuesById);\n    values[valuesById[1] = \"ONE\"] = 1;\n    values[valuesById[2] = \"TWO\"] = 2;\n    values[valuesById[3] = \"THREE\"] = 3;\n    values[valuesById[4] = \"FOUR\"] = 4;\n    values[valuesById[5] = \"FIVE\"] = 5;\n    return values;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/comments.proto",
    "content": "/**\n * File with a comment. (TODO)\n */\n\nsyntax = \"proto3\";\n\n/**\n * Message\n * with\na\n ** comment.\n */\nmessage Test1 { /// not a valid comment\n\n    /**\n     * Field with a comment.\n     */\n    string field1 = 1;\n\n    // Field with no comment.\n    uint32 field2 = 2;\n\n    bool field3 = 3; /// Field with a comment and a <a href=\"http://example.com/foo/\">link</a>\n}\n\n// Message\n// with\n// no\n// comment.\nmessage Test2 {\n}\n\n/*\n * Message\n * with\n * no\n * comment\n */\nenum Test3 {\n\n    /** Value with a comment. */\n    ONE = 1;\n\n    // Value with no comment.\n    TWO = 2;\n\n    /// Preferred value with a comment.\n    THREE = 3; /// Value with a comment.\n\n    FOUR = 4; /// Other value with a comment.\n\n    /// Leading comment for value with both types of comments after field with trailing comment.\n    FIVE = 5; /// Trailing comment for value with both types of comments after field with trailing comment.\n}\n"
  },
  {
    "path": "tests/data/common.json",
    "content": "{\n  \"nested\": {\n    \"Something\": {\n      \"fields\": {}\n    },\n    \"google\": {\n      \"nested\": {\n        \"protobuf\": {\n          \"nested\": {\n            \"Any\": {\n              \"fields\": {\n                \"type_url\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"value\": {\n                  \"type\": \"bytes\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"Duration\": {\n              \"fields\": {\n                \"seconds\": {\n                  \"type\": \"int64\",\n                  \"id\": 1\n                },\n                \"nanos\": {\n                  \"type\": \"int32\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"Empty\": {\n              \"fields\": {}\n            },\n            \"Struct\": {\n              \"fields\": {\n                \"fields\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"Value\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"Value\": {\n              \"oneofs\": {\n                \"kind\": {\n                  \"oneof\": [\n                    \"nullValue\",\n                    \"numberValue\",\n                    \"stringValue\",\n                    \"boolValue\",\n                    \"structValue\",\n                    \"listValue\"\n                  ]\n                }\n              },\n              \"fields\": {\n                \"nullValue\": {\n                  \"type\": \"NullValue\",\n                  \"id\": 1\n                },\n                \"numberValue\": {\n                  \"type\": \"double\",\n                  \"id\": 2\n                },\n                \"stringValue\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"boolValue\": {\n                  \"type\": \"bool\",\n                  \"id\": 4\n                },\n                \"structValue\": {\n                  \"type\": \"Struct\",\n                  \"id\": 5\n                },\n                \"listValue\": {\n                  \"type\": \"ListValue\",\n                  \"id\": 6\n                }\n              }\n            },\n            \"NullValue\": {\n              \"values\": {\n                \"NULL_VALUE\": 0\n              }\n            },\n            \"ListValue\": {\n              \"fields\": {\n                \"values\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Value\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"Timestamp\": {\n              \"fields\": {\n                \"seconds\": {\n                  \"type\": \"int64\",\n                  \"id\": 1\n                },\n                \"nanos\": {\n                  \"type\": \"int32\",\n                  \"id\": 2\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}"
  },
  {
    "path": "tests/data/common.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/empty.proto\";\nimport \"google/protobuf/struct.proto\";\nimport \"google/protobuf/timestamp.proto\";\n\nmessage Something {\n}\n"
  },
  {
    "path": "tests/data/convert.d.ts",
    "content": "import * as $protobuf from \"../..\";\nimport Long from \"long\";\n\nexport interface IMessage {\n    stringVal?: (string|null);\n    stringRepeated?: (string[]|null);\n    uint64Val?: (number|Long|null);\n    uint64Repeated?: ((number|Long)[]|null);\n    bytesVal?: (Uint8Array|null);\n    bytesRepeated?: (Uint8Array[]|null);\n    enumVal?: (Message.SomeEnum|null);\n    enumRepeated?: (Message.SomeEnum[]|null);\n    int64Map?: ({ [k: string]: (number|Long) }|null);\n}\n\nexport class Message implements IMessage {\n    constructor(properties?: IMessage);\n    public stringVal: string;\n    public stringRepeated: string[];\n    public uint64Val: (number|Long);\n    public uint64Repeated: (number|Long)[];\n    public bytesVal: Uint8Array;\n    public bytesRepeated: Uint8Array[];\n    public enumVal: Message.SomeEnum;\n    public enumRepeated: Message.SomeEnum[];\n    public int64Map: { [k: string]: (number|Long) };\n    public static create(properties?: IMessage): Message;\n    public static encode(message: IMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Message;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Message;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): Message;\n    public static toObject(message: Message, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport namespace Message {\n\n    enum SomeEnum {\n        ONE = 1,\n        TWO = 2\n    }\n}\n"
  },
  {
    "path": "tests/data/convert.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_convert || ($protobuf.roots.test_convert = {});\n\n$root.Message = (function() {\n\n    /**\n     * Properties of a Message.\n     * @exports IMessage\n     * @interface IMessage\n     * @property {string|null} [stringVal] Message stringVal\n     * @property {Array.<string>|null} [stringRepeated] Message stringRepeated\n     * @property {number|Long|null} [uint64Val] Message uint64Val\n     * @property {Array.<number|Long>|null} [uint64Repeated] Message uint64Repeated\n     * @property {Uint8Array|null} [bytesVal] Message bytesVal\n     * @property {Array.<Uint8Array>|null} [bytesRepeated] Message bytesRepeated\n     * @property {Message.SomeEnum|null} [enumVal] Message enumVal\n     * @property {Array.<Message.SomeEnum>|null} [enumRepeated] Message enumRepeated\n     * @property {Object.<string,number|Long>|null} [int64Map] Message int64Map\n     */\n\n    /**\n     * Constructs a new Message.\n     * @exports Message\n     * @classdesc Represents a Message.\n     * @implements IMessage\n     * @constructor\n     * @param {IMessage=} [properties] Properties to set\n     */\n    function Message(properties) {\n        this.stringRepeated = [];\n        this.uint64Repeated = [];\n        this.bytesRepeated = [];\n        this.enumRepeated = [];\n        this.int64Map = {};\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * Message stringVal.\n     * @member {string} stringVal\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.stringVal = \"\";\n\n    /**\n     * Message stringRepeated.\n     * @member {Array.<string>} stringRepeated\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.stringRepeated = $util.emptyArray;\n\n    /**\n     * Message uint64Val.\n     * @member {number|Long} uint64Val\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.uint64Val = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n    /**\n     * Message uint64Repeated.\n     * @member {Array.<number|Long>} uint64Repeated\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.uint64Repeated = $util.emptyArray;\n\n    /**\n     * Message bytesVal.\n     * @member {Uint8Array} bytesVal\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.bytesVal = $util.newBuffer([]);\n\n    /**\n     * Message bytesRepeated.\n     * @member {Array.<Uint8Array>} bytesRepeated\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.bytesRepeated = $util.emptyArray;\n\n    /**\n     * Message enumVal.\n     * @member {Message.SomeEnum} enumVal\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.enumVal = 1;\n\n    /**\n     * Message enumRepeated.\n     * @member {Array.<Message.SomeEnum>} enumRepeated\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.enumRepeated = $util.emptyArray;\n\n    /**\n     * Message int64Map.\n     * @member {Object.<string,number|Long>} int64Map\n     * @memberof Message\n     * @instance\n     */\n    Message.prototype.int64Map = $util.emptyObject;\n\n    /**\n     * Creates a new Message instance using the specified properties.\n     * @function create\n     * @memberof Message\n     * @static\n     * @param {IMessage=} [properties] Properties to set\n     * @returns {Message} Message instance\n     */\n    Message.create = function create(properties) {\n        return new Message(properties);\n    };\n\n    /**\n     * Encodes the specified Message message. Does not implicitly {@link Message.verify|verify} messages.\n     * @function encode\n     * @memberof Message\n     * @static\n     * @param {IMessage} message Message message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Message.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.stringVal != null && Object.hasOwnProperty.call(message, \"stringVal\"))\n            writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringVal);\n        if (message.stringRepeated != null && message.stringRepeated.length)\n            for (var i = 0; i < message.stringRepeated.length; ++i)\n                writer.uint32(/* id 2, wireType 2 =*/18).string(message.stringRepeated[i]);\n        if (message.uint64Val != null && Object.hasOwnProperty.call(message, \"uint64Val\"))\n            writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.uint64Val);\n        if (message.uint64Repeated != null && message.uint64Repeated.length) {\n            writer.uint32(/* id 4, wireType 2 =*/34).fork();\n            for (var i = 0; i < message.uint64Repeated.length; ++i)\n                writer.uint64(message.uint64Repeated[i]);\n            writer.ldelim();\n        }\n        if (message.bytesVal != null && Object.hasOwnProperty.call(message, \"bytesVal\"))\n            writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.bytesVal);\n        if (message.bytesRepeated != null && message.bytesRepeated.length)\n            for (var i = 0; i < message.bytesRepeated.length; ++i)\n                writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.bytesRepeated[i]);\n        if (message.enumVal != null && Object.hasOwnProperty.call(message, \"enumVal\"))\n            writer.uint32(/* id 7, wireType 0 =*/56).int32(message.enumVal);\n        if (message.enumRepeated != null && message.enumRepeated.length) {\n            writer.uint32(/* id 8, wireType 2 =*/66).fork();\n            for (var i = 0; i < message.enumRepeated.length; ++i)\n                writer.int32(message.enumRepeated[i]);\n            writer.ldelim();\n        }\n        if (message.int64Map != null && Object.hasOwnProperty.call(message, \"int64Map\"))\n            for (var keys = Object.keys(message.int64Map), i = 0; i < keys.length; ++i)\n                writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.int64Map[keys[i]]).ldelim();\n        return writer;\n    };\n\n    /**\n     * Encodes the specified Message message, length delimited. Does not implicitly {@link Message.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof Message\n     * @static\n     * @param {IMessage} message Message message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Message.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a Message message from the specified reader or buffer.\n     * @function decode\n     * @memberof Message\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {Message} Message\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Message.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Message(), key, value;\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.stringVal = reader.string();\n                break;\n            case 2:\n                if (!(message.stringRepeated && message.stringRepeated.length))\n                    message.stringRepeated = [];\n                message.stringRepeated.push(reader.string());\n                break;\n            case 3:\n                message.uint64Val = reader.uint64();\n                break;\n            case 4:\n                if (!(message.uint64Repeated && message.uint64Repeated.length))\n                    message.uint64Repeated = [];\n                if ((tag & 7) === 2) {\n                    var end2 = reader.uint32() + reader.pos;\n                    while (reader.pos < end2)\n                        message.uint64Repeated.push(reader.uint64());\n                } else\n                    message.uint64Repeated.push(reader.uint64());\n                break;\n            case 5:\n                message.bytesVal = reader.bytes();\n                break;\n            case 6:\n                if (!(message.bytesRepeated && message.bytesRepeated.length))\n                    message.bytesRepeated = [];\n                message.bytesRepeated.push(reader.bytes());\n                break;\n            case 7:\n                message.enumVal = reader.int32();\n                break;\n            case 8:\n                if (!(message.enumRepeated && message.enumRepeated.length))\n                    message.enumRepeated = [];\n                if ((tag & 7) === 2) {\n                    var end2 = reader.uint32() + reader.pos;\n                    while (reader.pos < end2)\n                        message.enumRepeated.push(reader.int32());\n                } else\n                    message.enumRepeated.push(reader.int32());\n                break;\n            case 9:\n                if (message.int64Map === $util.emptyObject)\n                    message.int64Map = {};\n                var end2 = reader.uint32() + reader.pos;\n                key = \"\";\n                value = 0;\n                while (reader.pos < end2) {\n                    var tag2 = reader.uint32();\n                    switch (tag2 >>> 3) {\n                    case 1:\n                        key = reader.string();\n                        break;\n                    case 2:\n                        value = reader.int64();\n                        break;\n                    default:\n                        reader.skipType(tag2 & 7);\n                        break;\n                    }\n                }\n                message.int64Map[key] = value;\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a Message message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof Message\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {Message} Message\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Message.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a Message message.\n     * @function verify\n     * @memberof Message\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    Message.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.stringVal != null && message.hasOwnProperty(\"stringVal\"))\n            if (!$util.isString(message.stringVal))\n                return \"stringVal: string expected\";\n        if (message.stringRepeated != null && message.hasOwnProperty(\"stringRepeated\")) {\n            if (!Array.isArray(message.stringRepeated))\n                return \"stringRepeated: array expected\";\n            for (var i = 0; i < message.stringRepeated.length; ++i)\n                if (!$util.isString(message.stringRepeated[i]))\n                    return \"stringRepeated: string[] expected\";\n        }\n        if (message.uint64Val != null && message.hasOwnProperty(\"uint64Val\"))\n            if (!$util.isInteger(message.uint64Val) && !(message.uint64Val && $util.isInteger(message.uint64Val.low) && $util.isInteger(message.uint64Val.high)))\n                return \"uint64Val: integer|Long expected\";\n        if (message.uint64Repeated != null && message.hasOwnProperty(\"uint64Repeated\")) {\n            if (!Array.isArray(message.uint64Repeated))\n                return \"uint64Repeated: array expected\";\n            for (var i = 0; i < message.uint64Repeated.length; ++i)\n                if (!$util.isInteger(message.uint64Repeated[i]) && !(message.uint64Repeated[i] && $util.isInteger(message.uint64Repeated[i].low) && $util.isInteger(message.uint64Repeated[i].high)))\n                    return \"uint64Repeated: integer|Long[] expected\";\n        }\n        if (message.bytesVal != null && message.hasOwnProperty(\"bytesVal\"))\n            if (!(message.bytesVal && typeof message.bytesVal.length === \"number\" || $util.isString(message.bytesVal)))\n                return \"bytesVal: buffer expected\";\n        if (message.bytesRepeated != null && message.hasOwnProperty(\"bytesRepeated\")) {\n            if (!Array.isArray(message.bytesRepeated))\n                return \"bytesRepeated: array expected\";\n            for (var i = 0; i < message.bytesRepeated.length; ++i)\n                if (!(message.bytesRepeated[i] && typeof message.bytesRepeated[i].length === \"number\" || $util.isString(message.bytesRepeated[i])))\n                    return \"bytesRepeated: buffer[] expected\";\n        }\n        if (message.enumVal != null && message.hasOwnProperty(\"enumVal\"))\n            switch (message.enumVal) {\n            default:\n                return \"enumVal: enum value expected\";\n            case 1:\n            case 2:\n                break;\n            }\n        if (message.enumRepeated != null && message.hasOwnProperty(\"enumRepeated\")) {\n            if (!Array.isArray(message.enumRepeated))\n                return \"enumRepeated: array expected\";\n            for (var i = 0; i < message.enumRepeated.length; ++i)\n                switch (message.enumRepeated[i]) {\n                default:\n                    return \"enumRepeated: enum value[] expected\";\n                case 1:\n                case 2:\n                    break;\n                }\n        }\n        if (message.int64Map != null && message.hasOwnProperty(\"int64Map\")) {\n            if (!$util.isObject(message.int64Map))\n                return \"int64Map: object expected\";\n            var key = Object.keys(message.int64Map);\n            for (var i = 0; i < key.length; ++i)\n                if (!$util.isInteger(message.int64Map[key[i]]) && !(message.int64Map[key[i]] && $util.isInteger(message.int64Map[key[i]].low) && $util.isInteger(message.int64Map[key[i]].high)))\n                    return \"int64Map: integer|Long{k:string} expected\";\n        }\n        return null;\n    };\n\n    /**\n     * Creates a Message message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof Message\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {Message} Message\n     */\n    Message.fromObject = function fromObject(object) {\n        if (object instanceof $root.Message)\n            return object;\n        var message = new $root.Message();\n        if (object.stringVal != null)\n            message.stringVal = String(object.stringVal);\n        if (object.stringRepeated) {\n            if (!Array.isArray(object.stringRepeated))\n                throw TypeError(\".Message.stringRepeated: array expected\");\n            message.stringRepeated = [];\n            for (var i = 0; i < object.stringRepeated.length; ++i)\n                message.stringRepeated[i] = String(object.stringRepeated[i]);\n        }\n        if (object.uint64Val != null)\n            if ($util.Long)\n                (message.uint64Val = $util.Long.fromValue(object.uint64Val)).unsigned = true;\n            else if (typeof object.uint64Val === \"string\")\n                message.uint64Val = parseInt(object.uint64Val, 10);\n            else if (typeof object.uint64Val === \"number\")\n                message.uint64Val = object.uint64Val;\n            else if (typeof object.uint64Val === \"object\")\n                message.uint64Val = new $util.LongBits(object.uint64Val.low >>> 0, object.uint64Val.high >>> 0).toNumber(true);\n        if (object.uint64Repeated) {\n            if (!Array.isArray(object.uint64Repeated))\n                throw TypeError(\".Message.uint64Repeated: array expected\");\n            message.uint64Repeated = [];\n            for (var i = 0; i < object.uint64Repeated.length; ++i)\n                if ($util.Long)\n                    (message.uint64Repeated[i] = $util.Long.fromValue(object.uint64Repeated[i])).unsigned = true;\n                else if (typeof object.uint64Repeated[i] === \"string\")\n                    message.uint64Repeated[i] = parseInt(object.uint64Repeated[i], 10);\n                else if (typeof object.uint64Repeated[i] === \"number\")\n                    message.uint64Repeated[i] = object.uint64Repeated[i];\n                else if (typeof object.uint64Repeated[i] === \"object\")\n                    message.uint64Repeated[i] = new $util.LongBits(object.uint64Repeated[i].low >>> 0, object.uint64Repeated[i].high >>> 0).toNumber(true);\n        }\n        if (object.bytesVal != null)\n            if (typeof object.bytesVal === \"string\")\n                $util.base64.decode(object.bytesVal, message.bytesVal = $util.newBuffer($util.base64.length(object.bytesVal)), 0);\n            else if (object.bytesVal.length >= 0)\n                message.bytesVal = object.bytesVal;\n        if (object.bytesRepeated) {\n            if (!Array.isArray(object.bytesRepeated))\n                throw TypeError(\".Message.bytesRepeated: array expected\");\n            message.bytesRepeated = [];\n            for (var i = 0; i < object.bytesRepeated.length; ++i)\n                if (typeof object.bytesRepeated[i] === \"string\")\n                    $util.base64.decode(object.bytesRepeated[i], message.bytesRepeated[i] = $util.newBuffer($util.base64.length(object.bytesRepeated[i])), 0);\n                else if (object.bytesRepeated[i].length >= 0)\n                    message.bytesRepeated[i] = object.bytesRepeated[i];\n        }\n        switch (object.enumVal) {\n        case \"ONE\":\n        case 1:\n            message.enumVal = 1;\n            break;\n        case \"TWO\":\n        case 2:\n            message.enumVal = 2;\n            break;\n        }\n        if (object.enumRepeated) {\n            if (!Array.isArray(object.enumRepeated))\n                throw TypeError(\".Message.enumRepeated: array expected\");\n            message.enumRepeated = [];\n            for (var i = 0; i < object.enumRepeated.length; ++i)\n                switch (object.enumRepeated[i]) {\n                default:\n                case \"ONE\":\n                case 1:\n                    message.enumRepeated[i] = 1;\n                    break;\n                case \"TWO\":\n                case 2:\n                    message.enumRepeated[i] = 2;\n                    break;\n                }\n        }\n        if (object.int64Map) {\n            if (typeof object.int64Map !== \"object\")\n                throw TypeError(\".Message.int64Map: object expected\");\n            message.int64Map = {};\n            for (var keys = Object.keys(object.int64Map), i = 0; i < keys.length; ++i)\n                if ($util.Long)\n                    (message.int64Map[keys[i]] = $util.Long.fromValue(object.int64Map[keys[i]])).unsigned = false;\n                else if (typeof object.int64Map[keys[i]] === \"string\")\n                    message.int64Map[keys[i]] = parseInt(object.int64Map[keys[i]], 10);\n                else if (typeof object.int64Map[keys[i]] === \"number\")\n                    message.int64Map[keys[i]] = object.int64Map[keys[i]];\n                else if (typeof object.int64Map[keys[i]] === \"object\")\n                    message.int64Map[keys[i]] = new $util.LongBits(object.int64Map[keys[i]].low >>> 0, object.int64Map[keys[i]].high >>> 0).toNumber();\n        }\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a Message message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof Message\n     * @static\n     * @param {Message} message Message\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    Message.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.arrays || options.defaults) {\n            object.stringRepeated = [];\n            object.uint64Repeated = [];\n            object.bytesRepeated = [];\n            object.enumRepeated = [];\n        }\n        if (options.objects || options.defaults)\n            object.int64Map = {};\n        if (options.defaults) {\n            object.stringVal = \"\";\n            if ($util.Long) {\n                var long = new $util.Long(0, 0, true);\n                object.uint64Val = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n            } else\n                object.uint64Val = options.longs === String ? \"0\" : 0;\n            if (options.bytes === String)\n                object.bytesVal = \"\";\n            else {\n                object.bytesVal = [];\n                if (options.bytes !== Array)\n                    object.bytesVal = $util.newBuffer(object.bytesVal);\n            }\n            object.enumVal = options.enums === String ? \"ONE\" : 1;\n        }\n        if (message.stringVal != null && message.hasOwnProperty(\"stringVal\"))\n            object.stringVal = message.stringVal;\n        if (message.stringRepeated && message.stringRepeated.length) {\n            object.stringRepeated = [];\n            for (var j = 0; j < message.stringRepeated.length; ++j)\n                object.stringRepeated[j] = message.stringRepeated[j];\n        }\n        if (message.uint64Val != null && message.hasOwnProperty(\"uint64Val\"))\n            if (typeof message.uint64Val === \"number\")\n                object.uint64Val = options.longs === String ? String(message.uint64Val) : message.uint64Val;\n            else\n                object.uint64Val = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Val) : options.longs === Number ? new $util.LongBits(message.uint64Val.low >>> 0, message.uint64Val.high >>> 0).toNumber(true) : message.uint64Val;\n        if (message.uint64Repeated && message.uint64Repeated.length) {\n            object.uint64Repeated = [];\n            for (var j = 0; j < message.uint64Repeated.length; ++j)\n                if (typeof message.uint64Repeated[j] === \"number\")\n                    object.uint64Repeated[j] = options.longs === String ? String(message.uint64Repeated[j]) : message.uint64Repeated[j];\n                else\n                    object.uint64Repeated[j] = options.longs === String ? $util.Long.prototype.toString.call(message.uint64Repeated[j]) : options.longs === Number ? new $util.LongBits(message.uint64Repeated[j].low >>> 0, message.uint64Repeated[j].high >>> 0).toNumber(true) : message.uint64Repeated[j];\n        }\n        if (message.bytesVal != null && message.hasOwnProperty(\"bytesVal\"))\n            object.bytesVal = options.bytes === String ? $util.base64.encode(message.bytesVal, 0, message.bytesVal.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesVal) : message.bytesVal;\n        if (message.bytesRepeated && message.bytesRepeated.length) {\n            object.bytesRepeated = [];\n            for (var j = 0; j < message.bytesRepeated.length; ++j)\n                object.bytesRepeated[j] = options.bytes === String ? $util.base64.encode(message.bytesRepeated[j], 0, message.bytesRepeated[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesRepeated[j]) : message.bytesRepeated[j];\n        }\n        if (message.enumVal != null && message.hasOwnProperty(\"enumVal\"))\n            object.enumVal = options.enums === String ? $root.Message.SomeEnum[message.enumVal] : message.enumVal;\n        if (message.enumRepeated && message.enumRepeated.length) {\n            object.enumRepeated = [];\n            for (var j = 0; j < message.enumRepeated.length; ++j)\n                object.enumRepeated[j] = options.enums === String ? $root.Message.SomeEnum[message.enumRepeated[j]] : message.enumRepeated[j];\n        }\n        var keys2;\n        if (message.int64Map && (keys2 = Object.keys(message.int64Map)).length) {\n            object.int64Map = {};\n            for (var j = 0; j < keys2.length; ++j)\n                if (typeof message.int64Map[keys2[j]] === \"number\")\n                    object.int64Map[keys2[j]] = options.longs === String ? String(message.int64Map[keys2[j]]) : message.int64Map[keys2[j]];\n                else\n                    object.int64Map[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.int64Map[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.int64Map[keys2[j]].low >>> 0, message.int64Map[keys2[j]].high >>> 0).toNumber() : message.int64Map[keys2[j]];\n        }\n        return object;\n    };\n\n    /**\n     * Converts this Message to JSON.\n     * @function toJSON\n     * @memberof Message\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    Message.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for Message\n     * @function getTypeUrl\n     * @memberof Message\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/Message\";\n    };\n\n    /**\n     * SomeEnum enum.\n     * @name Message.SomeEnum\n     * @enum {number}\n     * @property {number} ONE=1 ONE value\n     * @property {number} TWO=2 TWO value\n     */\n    Message.SomeEnum = (function() {\n        var valuesById = {}, values = Object.create(valuesById);\n        values[valuesById[1] = \"ONE\"] = 1;\n        values[valuesById[2] = \"TWO\"] = 2;\n        return values;\n    })();\n\n    return Message;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/convert.proto",
    "content": "syntax = \"proto3\";\n\nmessage Message {\n\n    string string_val = 1;\n    repeated string string_repeated = 2;\n\n    uint64 uint64_val = 3;\n    repeated uint64 uint64_repeated = 4;\n\n    bytes bytes_val = 5;\n    repeated bytes bytes_repeated = 6;\n\n    SomeEnum enum_val = 7;\n    repeated SomeEnum enum_repeated = 8;\n\n    enum SomeEnum {\n        ONE = 1;\n        TWO = 2;\n    }\n\n    map<string,int64> int64_map = 9;\n}\n"
  },
  {
    "path": "tests/data/feature-resolution.proto",
    "content": "edition = \"2023\";\n\noption features.amazing_feature = A;\noption (mo_single_msg).nested.value = \"x\";\nservice MyService {\n    option features.amazing_feature = E;\n    message MyRequest {};\n    message MyResponse {};\n    rpc MyMethod (MyRequest) returns (MyResponse) {\n        option features.amazing_feature = L;\n    };\n}\n\nmessage Message {\n    option features.amazing_feature = B;\n\n    string string_val = 1;\n    string string_repeated = 2 [features.amazing_feature = F];\n\n    uint64 uint64_val = 3;\n    uint64 uint64_repeated = 4;\n\n    bytes bytes_val = 5;\n    bytes bytes_repeated = 6;\n\n    SomeEnum enum_val = 7;\n    SomeEnum enum_repeated = 8;\n\n    extensions 10 to 100;\n    extend Message {\n        int32 bar = 10 [features.amazing_feature = I];\n    }\n\n    message Nested {\n        option features.amazing_feature = H;\n        int64 count = 9;\n    }\n\n    enum SomeEnumInMessage {\n        option features.amazing_feature = G;\n        ONE = 11;\n        TWO = 12;\n    }\n    \n    oneof SomeOneOf {\n        option features.amazing_feature = J;\n        int32 a = 13;\n        string b = 14;\n    }\n\n    map<string,int64> int64_map = 15;\n}\n\nextend Message {\n    int32 bar = 16 [features.amazing_feature = D];\n}\n\nenum SomeEnum {\n    option features.amazing_feature = C;\n    ONE = 1 [features.amazing_feature = K];\n    TWO = 2;\n}"
  },
  {
    "path": "tests/data/google/protobuf/LICENSE",
    "content": "Copyright 2014, Google Inc.  All rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\nnotice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above\ncopyright notice, this list of conditions and the following disclaimer\nin the documentation and/or other materials provided with the\ndistribution.\n    * Neither the name of Google Inc. nor the names of its\ncontributors may be used to endorse or promote products derived from\nthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "tests/data/google/protobuf/descriptor.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: kenton@google.com (Kenton Varda)\n//  Based on original Protocol Buffers design by\n//  Sanjay Ghemawat, Jeff Dean, and others.\n//\n// The messages in this file describe the definitions found in .proto files.\n// A valid .proto file can be translated directly to a FileDescriptorProto\n// without any other information (e.g. without reading its imports).\n\nsyntax = \"proto2\";\n\npackage google.protobuf;\n\noption go_package = \"google.golang.org/protobuf/types/descriptorpb\";\noption java_package = \"com.google.protobuf\";\noption java_outer_classname = \"DescriptorProtos\";\noption csharp_namespace = \"Google.Protobuf.Reflection\";\noption objc_class_prefix = \"GPB\";\noption cc_enable_arenas = true;\n\n// descriptor.proto must be optimized for speed because reflection-based\n// algorithms don't work during bootstrapping.\noption optimize_for = SPEED;\n\n// The protocol compiler can output a FileDescriptorSet containing the .proto\n// files it parses.\nmessage FileDescriptorSet {\n  repeated FileDescriptorProto file = 1;\n\n  // Extensions for tooling.\n  extensions 536000000 [declaration = {\n    number: 536000000\n    type: \".buf.descriptor.v1.FileDescriptorSetExtension\"\n    full_name: \".buf.descriptor.v1.buf_file_descriptor_set_extension\"\n  }];\n}\n\n// The full set of known editions.\nenum Edition {\n  // A placeholder for an unknown edition value.\n  EDITION_UNKNOWN = 0;\n\n  // A placeholder edition for specifying default behaviors *before* a feature\n  // was first introduced.  This is effectively an \"infinite past\".\n  EDITION_LEGACY = 900;\n\n  // Legacy syntax \"editions\".  These pre-date editions, but behave much like\n  // distinct editions.  These can't be used to specify the edition of proto\n  // files, but feature definitions must supply proto2/proto3 defaults for\n  // backwards compatibility.\n  EDITION_PROTO2 = 998;\n  EDITION_PROTO3 = 999;\n\n  // Editions that have been released.  The specific values are arbitrary and\n  // should not be depended on, but they will always be time-ordered for easy\n  // comparison.\n  EDITION_2023 = 1000;\n  EDITION_2024 = 1001;\n\n  // Placeholder editions for testing feature resolution.  These should not be\n  // used or relied on outside of tests.\n  EDITION_1_TEST_ONLY = 1;\n  EDITION_2_TEST_ONLY = 2;\n  EDITION_99997_TEST_ONLY = 99997;\n  EDITION_99998_TEST_ONLY = 99998;\n  EDITION_99999_TEST_ONLY = 99999;\n\n  // Placeholder for specifying unbounded edition support.  This should only\n  // ever be used by plugins that can expect to never require any changes to\n  // support a new edition.\n  EDITION_MAX = 0x7FFFFFFF;\n}\n\n// Describes a complete .proto file.\nmessage FileDescriptorProto {\n  optional string name = 1;     // file name, relative to root of source tree\n  optional string package = 2;  // e.g. \"foo\", \"foo.bar\", etc.\n\n  // Names of files imported by this file.\n  repeated string dependency = 3;\n  // Indexes of the public imported files in the dependency list above.\n  repeated int32 public_dependency = 10;\n  // Indexes of the weak imported files in the dependency list.\n  // For Google-internal migration only. Do not use.\n  repeated int32 weak_dependency = 11;\n\n  // Names of files imported by this file purely for the purpose of providing\n  // option extensions. These are excluded from the dependency list above.\n  repeated string option_dependency = 15;\n\n  // All top-level definitions in this file.\n  repeated DescriptorProto message_type = 4;\n  repeated EnumDescriptorProto enum_type = 5;\n  repeated ServiceDescriptorProto service = 6;\n  repeated FieldDescriptorProto extension = 7;\n\n  optional FileOptions options = 8;\n\n  // This field contains optional information about the original source code.\n  // You may safely remove this entire field without harming runtime\n  // functionality of the descriptors -- the information is needed only by\n  // development tools.\n  optional SourceCodeInfo source_code_info = 9;\n\n  // The syntax of the proto file.\n  // The supported values are \"proto2\", \"proto3\", and \"editions\".\n  //\n  // If `edition` is present, this value must be \"editions\".\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional string syntax = 12;\n\n  // The edition of the proto file.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional Edition edition = 14;\n}\n\n// Describes a message type.\nmessage DescriptorProto {\n  optional string name = 1;\n\n  repeated FieldDescriptorProto field = 2;\n  repeated FieldDescriptorProto extension = 6;\n\n  repeated DescriptorProto nested_type = 3;\n  repeated EnumDescriptorProto enum_type = 4;\n\n  message ExtensionRange {\n    optional int32 start = 1;  // Inclusive.\n    optional int32 end = 2;    // Exclusive.\n\n    optional ExtensionRangeOptions options = 3;\n  }\n  repeated ExtensionRange extension_range = 5;\n\n  repeated OneofDescriptorProto oneof_decl = 8;\n\n  optional MessageOptions options = 7;\n\n  // Range of reserved tag numbers. Reserved tag numbers may not be used by\n  // fields or extension ranges in the same message. Reserved ranges may\n  // not overlap.\n  message ReservedRange {\n    optional int32 start = 1;  // Inclusive.\n    optional int32 end = 2;    // Exclusive.\n  }\n  repeated ReservedRange reserved_range = 9;\n  // Reserved field names, which may not be used by fields in the same message.\n  // A given name may only be reserved once.\n  repeated string reserved_name = 10;\n\n  // Support for `export` and `local` keywords on enums.\n  optional SymbolVisibility visibility = 11;\n}\n\nmessage ExtensionRangeOptions {\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  message Declaration {\n    // The extension number declared within the extension range.\n    optional int32 number = 1;\n\n    // The fully-qualified name of the extension field. There must be a leading\n    // dot in front of the full name.\n    optional string full_name = 2;\n\n    // The fully-qualified type name of the extension field. Unlike\n    // Metadata.type, Declaration.type must have a leading dot for messages\n    // and enums.\n    optional string type = 3;\n\n    // If true, indicates that the number is reserved in the extension range,\n    // and any extension field with the number will fail to compile. Set this\n    // when a declared extension field is deleted.\n    optional bool reserved = 5;\n\n    // If true, indicates that the extension must be defined as repeated.\n    // Otherwise the extension must be defined as optional.\n    optional bool repeated = 6;\n\n    reserved 4;  // removed is_repeated\n  }\n\n  // For external users: DO NOT USE. We are in the process of open sourcing\n  // extension declaration and executing internal cleanups before it can be\n  // used externally.\n  repeated Declaration declaration = 2 [retention = RETENTION_SOURCE];\n\n  // Any features defined in the specific edition.\n  optional FeatureSet features = 50;\n\n  // The verification state of the extension range.\n  enum VerificationState {\n    // All the extensions of the range must be declared.\n    DECLARATION = 0;\n    UNVERIFIED = 1;\n  }\n\n  // The verification state of the range.\n  // TODO: flip the default to DECLARATION once all empty ranges\n  // are marked as UNVERIFIED.\n  optional VerificationState verification = 3\n      [default = UNVERIFIED, retention = RETENTION_SOURCE];\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\n// Describes a field within a message.\nmessage FieldDescriptorProto {\n  enum Type {\n    // 0 is reserved for errors.\n    // Order is weird for historical reasons.\n    TYPE_DOUBLE = 1;\n    TYPE_FLOAT = 2;\n    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT64 if\n    // negative values are likely.\n    TYPE_INT64 = 3;\n    TYPE_UINT64 = 4;\n    // Not ZigZag encoded.  Negative numbers take 10 bytes.  Use TYPE_SINT32 if\n    // negative values are likely.\n    TYPE_INT32 = 5;\n    TYPE_FIXED64 = 6;\n    TYPE_FIXED32 = 7;\n    TYPE_BOOL = 8;\n    TYPE_STRING = 9;\n    // Tag-delimited aggregate.\n    // Group type is deprecated and not supported after google.protobuf. However, Proto3\n    // implementations should still be able to parse the group wire format and\n    // treat group fields as unknown fields.  In Editions, the group wire format\n    // can be enabled via the `message_encoding` feature.\n    TYPE_GROUP = 10;\n    TYPE_MESSAGE = 11;  // Length-delimited aggregate.\n\n    // New in version 2.\n    TYPE_BYTES = 12;\n    TYPE_UINT32 = 13;\n    TYPE_ENUM = 14;\n    TYPE_SFIXED32 = 15;\n    TYPE_SFIXED64 = 16;\n    TYPE_SINT32 = 17;  // Uses ZigZag encoding.\n    TYPE_SINT64 = 18;  // Uses ZigZag encoding.\n  }\n\n  enum Label {\n    // 0 is reserved for errors\n    LABEL_OPTIONAL = 1;\n    LABEL_REPEATED = 3;\n    // The required label is only allowed in google.protobuf.  In proto3 and Editions\n    // it's explicitly prohibited.  In Editions, the `field_presence` feature\n    // can be used to get this behavior.\n    LABEL_REQUIRED = 2;\n  }\n\n  optional string name = 1;\n  optional int32 number = 3;\n  optional Label label = 4;\n\n  // If type_name is set, this need not be set.  If both this and type_name\n  // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP.\n  optional Type type = 5;\n\n  // For message and enum types, this is the name of the type.  If the name\n  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping\n  // rules are used to find the type (i.e. first the nested types within this\n  // message are searched, then within the parent, on up to the root\n  // namespace).\n  optional string type_name = 6;\n\n  // For extensions, this is the name of the type being extended.  It is\n  // resolved in the same manner as type_name.\n  optional string extendee = 2;\n\n  // For numeric types, contains the original text representation of the value.\n  // For booleans, \"true\" or \"false\".\n  // For strings, contains the default text contents (not escaped in any way).\n  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.\n  optional string default_value = 7;\n\n  // If set, gives the index of a oneof in the containing type's oneof_decl\n  // list.  This field is a member of that oneof.\n  optional int32 oneof_index = 9;\n\n  // JSON name of this field. The value is set by protocol compiler. If the\n  // user has set a \"json_name\" option on this field, that option's value\n  // will be used. Otherwise, it's deduced from the field's name by converting\n  // it to camelCase.\n  optional string json_name = 10;\n\n  optional FieldOptions options = 8;\n\n  // If true, this is a proto3 \"optional\". When a proto3 field is optional, it\n  // tracks presence regardless of field type.\n  //\n  // When proto3_optional is true, this field must belong to a oneof to signal\n  // to old proto3 clients that presence is tracked for this field. This oneof\n  // is known as a \"synthetic\" oneof, and this field must be its sole member\n  // (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs\n  // exist in the descriptor only, and do not generate any API. Synthetic oneofs\n  // must be ordered after all \"real\" oneofs.\n  //\n  // For message fields, proto3_optional doesn't create any semantic change,\n  // since non-repeated message fields always track presence. However it still\n  // indicates the semantic detail of whether the user wrote \"optional\" or not.\n  // This can be useful for round-tripping the .proto file. For consistency we\n  // give message fields a synthetic oneof also, even though it is not required\n  // to track presence. This is especially important because the parser can't\n  // tell if a field is a message or an enum, so it must always create a\n  // synthetic oneof.\n  //\n  // Proto2 optional fields do not set this flag, because they already indicate\n  // optional with `LABEL_OPTIONAL`.\n  optional bool proto3_optional = 17;\n}\n\n// Describes a oneof.\nmessage OneofDescriptorProto {\n  optional string name = 1;\n  optional OneofOptions options = 2;\n}\n\n// Describes an enum type.\nmessage EnumDescriptorProto {\n  optional string name = 1;\n\n  repeated EnumValueDescriptorProto value = 2;\n\n  optional EnumOptions options = 3;\n\n  // Range of reserved numeric values. Reserved values may not be used by\n  // entries in the same enum. Reserved ranges may not overlap.\n  //\n  // Note that this is distinct from DescriptorProto.ReservedRange in that it\n  // is inclusive such that it can appropriately represent the entire int32\n  // domain.\n  message EnumReservedRange {\n    optional int32 start = 1;  // Inclusive.\n    optional int32 end = 2;    // Inclusive.\n  }\n\n  // Range of reserved numeric values. Reserved numeric values may not be used\n  // by enum values in the same enum declaration. Reserved ranges may not\n  // overlap.\n  repeated EnumReservedRange reserved_range = 4;\n\n  // Reserved enum value names, which may not be reused. A given name may only\n  // be reserved once.\n  repeated string reserved_name = 5;\n\n  // Support for `export` and `local` keywords on enums.\n  optional SymbolVisibility visibility = 6;\n}\n\n// Describes a value within an enum.\nmessage EnumValueDescriptorProto {\n  optional string name = 1;\n  optional int32 number = 2;\n\n  optional EnumValueOptions options = 3;\n}\n\n// Describes a service.\nmessage ServiceDescriptorProto {\n  optional string name = 1;\n  repeated MethodDescriptorProto method = 2;\n\n  optional ServiceOptions options = 3;\n}\n\n// Describes a method of a service.\nmessage MethodDescriptorProto {\n  optional string name = 1;\n\n  // Input and output type names.  These are resolved in the same way as\n  // FieldDescriptorProto.type_name, but must refer to a message type.\n  optional string input_type = 2;\n  optional string output_type = 3;\n\n  optional MethodOptions options = 4;\n\n  // Identifies if client streams multiple client messages\n  optional bool client_streaming = 5 [default = false];\n  // Identifies if server streams multiple server messages\n  optional bool server_streaming = 6 [default = false];\n}\n\n// ===================================================================\n// Options\n\n// Each of the definitions above may have \"options\" attached.  These are\n// just annotations which may cause code to be generated slightly differently\n// or may contain hints for code that manipulates protocol messages.\n//\n// Clients may define custom options as extensions of the *Options messages.\n// These extensions may not yet be known at parsing time, so the parser cannot\n// store the values in them.  Instead it stores them in a field in the *Options\n// message called uninterpreted_option. This field must have the same name\n// across all *Options messages. We then use this field to populate the\n// extensions when we build a descriptor, at which point all protos have been\n// parsed and so all extensions are known.\n//\n// Extension numbers for custom options may be chosen as follows:\n// * For options which will only be used within a single application or\n//   organization, or for experimental options, use field numbers 50000\n//   through 99999.  It is up to you to ensure that you do not use the\n//   same number for multiple options.\n// * For options which will be published and used publicly by multiple\n//   independent entities, e-mail protobuf-global-extension-registry@google.com\n//   to reserve extension numbers. Simply provide your project name (e.g.\n//   Objective-C plugin) and your project website (if available) -- there's no\n//   need to explain how you intend to use them. Usually you only need one\n//   extension number. You can declare multiple options with only one extension\n//   number by putting them in a sub-message. See the Custom Options section of\n//   the docs for examples:\n//   https://developers.google.com/protocol-buffers/docs/proto#options\n//   If this turns out to be popular, a web service will be set up\n//   to automatically assign option numbers.\n\nmessage FileOptions {\n\n  // Sets the Java package where classes generated from this .proto will be\n  // placed.  By default, the proto package is used, but this is often\n  // inappropriate because proto packages do not normally start with backwards\n  // domain names.\n  optional string java_package = 1;\n\n  // Controls the name of the wrapper Java class generated for the .proto file.\n  // That class will always contain the .proto file's getDescriptor() method as\n  // well as any top-level extensions defined in the .proto file.\n  // If java_multiple_files is disabled, then all the other classes from the\n  // .proto file will be nested inside the single wrapper outer class.\n  optional string java_outer_classname = 8;\n\n  // If enabled, then the Java code generator will generate a separate .java\n  // file for each top-level message, enum, and service defined in the .proto\n  // file.  Thus, these types will *not* be nested inside the wrapper class\n  // named by java_outer_classname.  However, the wrapper class will still be\n  // generated to contain the file's getDescriptor() method as well as any\n  // top-level extensions defined in the file.\n  optional bool java_multiple_files = 10 [default = false];\n\n  // This option does nothing.\n  optional bool java_generate_equals_and_hash = 20 [deprecated=true];\n\n  // A proto2 file can set this to true to opt in to UTF-8 checking for Java,\n  // which will throw an exception if invalid UTF-8 is parsed from the wire or\n  // assigned to a string field.\n  //\n  // TODO: clarify exactly what kinds of field types this option\n  // applies to, and update these docs accordingly.\n  //\n  // Proto3 files already perform these checks. Setting the option explicitly to\n  // false has no effect: it cannot be used to opt proto3 files out of UTF-8\n  // checks.\n  optional bool java_string_check_utf8 = 27 [default = false];\n\n  // Generated classes can be optimized for speed or code size.\n  enum OptimizeMode {\n    SPEED = 1;         // Generate complete code for parsing, serialization,\n                       // etc.\n    CODE_SIZE = 2;     // Use ReflectionOps to implement these methods.\n    LITE_RUNTIME = 3;  // Generate code using MessageLite and the lite runtime.\n  }\n  optional OptimizeMode optimize_for = 9 [default = SPEED];\n\n  // Sets the Go package where structs generated from this .proto will be\n  // placed. If omitted, the Go package will be derived from the following:\n  //   - The basename of the package import path, if provided.\n  //   - Otherwise, the package statement in the .proto file, if present.\n  //   - Otherwise, the basename of the .proto file, without extension.\n  optional string go_package = 11;\n\n  // Should generic services be generated in each language?  \"Generic\" services\n  // are not specific to any particular RPC system.  They are generated by the\n  // main code generators in each language (without additional plugins).\n  // Generic services were the only kind of service generation supported by\n  // early versions of google.protobuf.\n  //\n  // Generic services are now considered deprecated in favor of using plugins\n  // that generate code specific to your particular RPC system.  Therefore,\n  // these default to false.  Old code which depends on generic services should\n  // explicitly set them to true.\n  optional bool cc_generic_services = 16 [default = false];\n  optional bool java_generic_services = 17 [default = false];\n  optional bool py_generic_services = 18 [default = false];\n  reserved 42;  // removed php_generic_services\n  reserved \"php_generic_services\";\n\n  // Is this file deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for everything in the file, or it will be completely ignored; in the very\n  // least, this is a formalization for deprecating files.\n  optional bool deprecated = 23 [default = false];\n\n  // Enables the use of arenas for the proto messages in this file. This applies\n  // only to generated classes for C++.\n  optional bool cc_enable_arenas = 31 [default = true];\n\n  // Sets the objective c class prefix which is prepended to all objective c\n  // generated classes from this .proto. There is no default.\n  optional string objc_class_prefix = 36;\n\n  // Namespace for generated classes; defaults to the package.\n  optional string csharp_namespace = 37;\n\n  // By default Swift generators will take the proto package and CamelCase it\n  // replacing '.' with underscore and use that to prefix the types/symbols\n  // defined. When this options is provided, they will use this value instead\n  // to prefix the types/symbols defined.\n  optional string swift_prefix = 39;\n\n  // Sets the php class prefix which is prepended to all php generated classes\n  // from this .proto. Default is empty.\n  optional string php_class_prefix = 40;\n\n  // Use this option to change the namespace of php generated classes. Default\n  // is empty. When this option is empty, the package name will be used for\n  // determining the namespace.\n  optional string php_namespace = 41;\n\n  // Use this option to change the namespace of php generated metadata classes.\n  // Default is empty. When this option is empty, the proto file name will be\n  // used for determining the namespace.\n  optional string php_metadata_namespace = 44;\n\n  // Use this option to change the package of ruby generated classes. Default\n  // is empty. When this option is not set, the package name will be used for\n  // determining the ruby package.\n  optional string ruby_package = 45;\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 50;\n\n  // The parser stores options it doesn't recognize here.\n  // See the documentation for the \"Options\" section above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message.\n  // See the documentation for the \"Options\" section above.\n  extensions 1000 to max;\n\n  reserved 38;\n}\n\nmessage MessageOptions {\n  // Set true to use the old proto1 MessageSet wire format for extensions.\n  // This is provided for backwards-compatibility with the MessageSet wire\n  // format.  You should not use this for any other reason:  It's less\n  // efficient, has fewer features, and is more complicated.\n  //\n  // The message must be defined exactly as follows:\n  //   message Foo {\n  //     option message_set_wire_format = true;\n  //     extensions 4 to max;\n  //   }\n  // Note that the message cannot have any defined fields; MessageSets only\n  // have extensions.\n  //\n  // All extensions of your type must be singular messages; e.g. they cannot\n  // be int32s, enums, or repeated messages.\n  //\n  // Because this is an option, the above two restrictions are not enforced by\n  // the protocol compiler.\n  optional bool message_set_wire_format = 1 [default = false];\n\n  // Disables the generation of the standard \"descriptor()\" accessor, which can\n  // conflict with a field of the same name.  This is meant to make migration\n  // from proto1 easier; new code should avoid fields named \"descriptor\".\n  optional bool no_standard_descriptor_accessor = 2 [default = false];\n\n  // Is this message deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the message, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating messages.\n  optional bool deprecated = 3 [default = false];\n\n  reserved 4, 5, 6;\n\n  // Whether the message is an automatically generated map entry type for the\n  // maps field.\n  //\n  // For maps fields:\n  //     map<KeyType, ValueType> map_field = 1;\n  // The parsed descriptor looks like:\n  //     message MapFieldEntry {\n  //         option map_entry = true;\n  //         optional KeyType key = 1;\n  //         optional ValueType value = 2;\n  //     }\n  //     repeated MapFieldEntry map_field = 1;\n  //\n  // Implementations may choose not to generate the map_entry=true message, but\n  // use a native map in the target language to hold the keys and values.\n  // The reflection APIs in such implementations still need to work as\n  // if the field is a repeated message field.\n  //\n  // NOTE: Do not set the option in .proto files. Always use the maps syntax\n  // instead. The option should only be implicitly set by the proto compiler\n  // parser.\n  optional bool map_entry = 7;\n\n  reserved 8;  // javalite_serializable\n  reserved 9;  // javanano_as_lite\n\n  // Enable the legacy handling of JSON field name conflicts.  This lowercases\n  // and strips underscored from the fields before comparison in proto3 only.\n  // The new behavior takes `json_name` into account and applies to proto2 as\n  // well.\n  //\n  // This should only be used as a temporary measure against broken builds due\n  // to the change in behavior for JSON field name conflicts.\n  //\n  // TODO This is legacy behavior we plan to remove once downstream\n  // teams have had time to migrate.\n  optional bool deprecated_legacy_json_field_conflicts = 11 [deprecated = true];\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 12;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage FieldOptions {\n  // NOTE: ctype is deprecated. Use `features.(pb.cpp).string_type` instead.\n  // The ctype option instructs the C++ code generator to use a different\n  // representation of the field than it normally would.  See the specific\n  // options below.  This option is only implemented to support use of\n  // [ctype=CORD] and [ctype=STRING] (the default) on non-repeated fields of\n  // type \"bytes\" in the open source release.\n  // TODO: make ctype actually deprecated.\n  optional CType ctype = 1 [/*deprecated = true,*/ default = STRING];\n  enum CType {\n    // Default mode.\n    STRING = 0;\n\n    // The option [ctype=CORD] may be applied to a non-repeated field of type\n    // \"bytes\". It indicates that in C++, the data should be stored in a Cord\n    // instead of a string.  For very large strings, this may reduce memory\n    // fragmentation. It may also allow better performance when parsing from a\n    // Cord, or when parsing with aliasing enabled, as the parsed Cord may then\n    // alias the original buffer.\n    CORD = 1;\n\n    STRING_PIECE = 2;\n  }\n  // The packed option can be enabled for repeated primitive fields to enable\n  // a more efficient representation on the wire. Rather than repeatedly\n  // writing the tag and type for each element, the entire array is encoded as\n  // a single length-delimited blob. In proto3, only explicit setting it to\n  // false will avoid using packed encoding.  This option is prohibited in\n  // Editions, but the `repeated_field_encoding` feature can be used to control\n  // the behavior.\n  optional bool packed = 2;\n\n  // The jstype option determines the JavaScript type used for values of the\n  // field.  The option is permitted only for 64 bit integral and fixed types\n  // (int64, uint64, sint64, fixed64, sfixed64).  A field with jstype JS_STRING\n  // is represented as JavaScript string, which avoids loss of precision that\n  // can happen when a large value is converted to a floating point JavaScript.\n  // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to\n  // use the JavaScript \"number\" type.  The behavior of the default option\n  // JS_NORMAL is implementation dependent.\n  //\n  // This option is an enum to permit additional types to be added, e.g.\n  // goog.math.Integer.\n  optional JSType jstype = 6 [default = JS_NORMAL];\n  enum JSType {\n    // Use the default type.\n    JS_NORMAL = 0;\n\n    // Use JavaScript strings.\n    JS_STRING = 1;\n\n    // Use JavaScript numbers.\n    JS_NUMBER = 2;\n  }\n\n  // Should this field be parsed lazily?  Lazy applies only to message-type\n  // fields.  It means that when the outer message is initially parsed, the\n  // inner message's contents will not be parsed but instead stored in encoded\n  // form.  The inner message will actually be parsed when it is first accessed.\n  //\n  // This is only a hint.  Implementations are free to choose whether to use\n  // eager or lazy parsing regardless of the value of this option.  However,\n  // setting this option true suggests that the protocol author believes that\n  // using lazy parsing on this field is worth the additional bookkeeping\n  // overhead typically needed to implement it.\n  //\n  // This option does not affect the public interface of any generated code;\n  // all method signatures remain the same.  Furthermore, thread-safety of the\n  // interface is not affected by this option; const methods remain safe to\n  // call from multiple threads concurrently, while non-const methods continue\n  // to require exclusive access.\n  //\n  // Note that lazy message fields are still eagerly verified to check\n  // ill-formed wireformat or missing required fields. Calling IsInitialized()\n  // on the outer message would fail if the inner message has missing required\n  // fields. Failed verification would result in parsing failure (except when\n  // uninitialized messages are acceptable).\n  optional bool lazy = 5 [default = false];\n\n  // unverified_lazy does no correctness checks on the byte stream. This should\n  // only be used where lazy with verification is prohibitive for performance\n  // reasons.\n  optional bool unverified_lazy = 15 [default = false];\n\n  // Is this field deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for accessors, or it will be completely ignored; in the very least, this\n  // is a formalization for deprecating fields.\n  optional bool deprecated = 3 [default = false];\n\n  // DEPRECATED. DO NOT USE!\n  // For Google-internal migration only. Do not use.\n  optional bool weak = 10 [default = false, deprecated = true];\n\n  // Indicate that the field value should not be printed out when using debug\n  // formats, e.g. when the field contains sensitive credentials.\n  optional bool debug_redact = 16 [default = false];\n\n  // If set to RETENTION_SOURCE, the option will be omitted from the binary.\n  enum OptionRetention {\n    RETENTION_UNKNOWN = 0;\n    RETENTION_RUNTIME = 1;\n    RETENTION_SOURCE = 2;\n  }\n\n  optional OptionRetention retention = 17;\n\n  // This indicates the types of entities that the field may apply to when used\n  // as an option. If it is unset, then the field may be freely used as an\n  // option on any kind of entity.\n  enum OptionTargetType {\n    TARGET_TYPE_UNKNOWN = 0;\n    TARGET_TYPE_FILE = 1;\n    TARGET_TYPE_EXTENSION_RANGE = 2;\n    TARGET_TYPE_MESSAGE = 3;\n    TARGET_TYPE_FIELD = 4;\n    TARGET_TYPE_ONEOF = 5;\n    TARGET_TYPE_ENUM = 6;\n    TARGET_TYPE_ENUM_ENTRY = 7;\n    TARGET_TYPE_SERVICE = 8;\n    TARGET_TYPE_METHOD = 9;\n  }\n\n  repeated OptionTargetType targets = 19;\n\n  message EditionDefault {\n    optional Edition edition = 3;\n    optional string value = 2;  // Textproto value.\n  }\n  repeated EditionDefault edition_defaults = 20;\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 21;\n\n  // Information about the support window of a feature.\n  message FeatureSupport {\n    // The edition that this feature was first available in.  In editions\n    // earlier than this one, the default assigned to EDITION_LEGACY will be\n    // used, and proto files will not be able to override it.\n    optional Edition edition_introduced = 1;\n\n    // The edition this feature becomes deprecated in.  Using this after this\n    // edition may trigger warnings.\n    optional Edition edition_deprecated = 2;\n\n    // The deprecation warning text if this feature is used after the edition it\n    // was marked deprecated in.\n    optional string deprecation_warning = 3;\n\n    // The edition this feature is no longer available in.  In editions after\n    // this one, the last default assigned will be used, and proto files will\n    // not be able to override it.\n    optional Edition edition_removed = 4;\n  }\n  optional FeatureSupport feature_support = 22;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n\n  reserved 4;   // removed jtype\n  reserved 18;  // reserve target, target_obsolete_do_not_use\n}\n\nmessage OneofOptions {\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 1;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage EnumOptions {\n\n  // Set this option to true to allow mapping different tag names to the same\n  // value.\n  optional bool allow_alias = 2;\n\n  // Is this enum deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the enum, or it will be completely ignored; in the very least, this\n  // is a formalization for deprecating enums.\n  optional bool deprecated = 3 [default = false];\n\n  reserved 5;  // javanano_as_lite\n\n  // Enable the legacy handling of JSON field name conflicts.  This lowercases\n  // and strips underscored from the fields before comparison in proto3 only.\n  // The new behavior takes `json_name` into account and applies to proto2 as\n  // well.\n  // TODO Remove this legacy behavior once downstream teams have\n  // had time to migrate.\n  optional bool deprecated_legacy_json_field_conflicts = 6 [deprecated = true];\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 7;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage EnumValueOptions {\n  // Is this enum value deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the enum value, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating enum values.\n  optional bool deprecated = 1 [default = false];\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 2;\n\n  // Indicate that fields annotated with this enum value should not be printed\n  // out when using debug formats, e.g. when the field contains sensitive\n  // credentials.\n  optional bool debug_redact = 3 [default = false];\n\n  // Information about the support window of a feature value.\n  optional FieldOptions.FeatureSupport feature_support = 4;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage ServiceOptions {\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 34;\n\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n\n  // Is this service deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the service, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating services.\n  optional bool deprecated = 33 [default = false];\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\nmessage MethodOptions {\n\n  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC\n  //   framework.  We apologize for hoarding these numbers to ourselves, but\n  //   we were already using them long before we decided to release Protocol\n  //   Buffers.\n\n  // Is this method deprecated?\n  // Depending on the target platform, this can emit Deprecated annotations\n  // for the method, or it will be completely ignored; in the very least,\n  // this is a formalization for deprecating methods.\n  optional bool deprecated = 33 [default = false];\n\n  // Is this method side-effect-free (or safe in HTTP parlance), or idempotent,\n  // or neither? HTTP based RPC implementation may choose GET verb for safe\n  // methods, and PUT verb for idempotent methods instead of the default POST.\n  enum IdempotencyLevel {\n    IDEMPOTENCY_UNKNOWN = 0;\n    NO_SIDE_EFFECTS = 1;  // implies idempotent\n    IDEMPOTENT = 2;       // idempotent, but may have side effects\n  }\n  optional IdempotencyLevel idempotency_level = 34\n      [default = IDEMPOTENCY_UNKNOWN];\n\n  // Any features defined in the specific edition.\n  // WARNING: This field should only be used by protobuf plugins or special\n  // cases like the proto compiler. Other uses are discouraged and\n  // developers should rely on the protoreflect APIs for their client language.\n  optional FeatureSet features = 35;\n\n  // The parser stores options it doesn't recognize here. See above.\n  repeated UninterpretedOption uninterpreted_option = 999;\n\n  // Clients can define custom options in extensions of this message. See above.\n  extensions 1000 to max;\n}\n\n// A message representing a option the parser does not recognize. This only\n// appears in options protos created by the compiler::Parser class.\n// DescriptorPool resolves these when building Descriptor objects. Therefore,\n// options protos in descriptor objects (e.g. returned by Descriptor::options(),\n// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions\n// in them.\nmessage UninterpretedOption {\n  // The name of the uninterpreted option.  Each string represents a segment in\n  // a dot-separated name.  is_extension is true iff a segment represents an\n  // extension (denoted with parentheses in options specs in .proto files).\n  // E.g.,{ [\"foo\", false], [\"bar.baz\", true], [\"moo\", false] } represents\n  // \"foo.(bar.baz).moo\".\n  message NamePart {\n    required string name_part = 1;\n    required bool is_extension = 2;\n  }\n  repeated NamePart name = 2;\n\n  // The value of the uninterpreted option, in whatever type the tokenizer\n  // identified it as during parsing. Exactly one of these should be set.\n  optional string identifier_value = 3;\n  optional uint64 positive_int_value = 4;\n  optional int64 negative_int_value = 5;\n  optional double double_value = 6;\n  optional bytes string_value = 7;\n  optional string aggregate_value = 8;\n}\n\n// ===================================================================\n// Features\n\n// TODO Enums in C++ gencode (and potentially other languages) are\n// not well scoped.  This means that each of the feature enums below can clash\n// with each other.  The short names we've chosen maximize call-site\n// readability, but leave us very open to this scenario.  A future feature will\n// be designed and implemented to handle this, hopefully before we ever hit a\n// conflict here.\nmessage FeatureSet {\n  enum FieldPresence {\n    FIELD_PRESENCE_UNKNOWN = 0;\n    EXPLICIT = 1;\n    IMPLICIT = 2;\n    LEGACY_REQUIRED = 3;\n  }\n  optional FieldPresence field_presence = 1 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    feature_support = {\n      edition_introduced: EDITION_2023,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"EXPLICIT\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"IMPLICIT\" },\n    edition_defaults = { edition: EDITION_2023, value: \"EXPLICIT\" }\n  ];\n\n  enum EnumType {\n    ENUM_TYPE_UNKNOWN = 0;\n    OPEN = 1;\n    CLOSED = 2;\n  }\n  optional EnumType enum_type = 2 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE,\n    feature_support = {\n      edition_introduced: EDITION_2023,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"CLOSED\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"OPEN\" }\n  ];\n\n  enum RepeatedFieldEncoding {\n    REPEATED_FIELD_ENCODING_UNKNOWN = 0;\n    PACKED = 1;\n    EXPANDED = 2;\n  }\n  optional RepeatedFieldEncoding repeated_field_encoding = 3 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    feature_support = {\n      edition_introduced: EDITION_2023,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"EXPANDED\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"PACKED\" }\n  ];\n\n  enum Utf8Validation {\n    UTF8_VALIDATION_UNKNOWN = 0;\n    VERIFY = 2;\n    NONE = 3;\n    reserved 1;\n  }\n  optional Utf8Validation utf8_validation = 4 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    feature_support = {\n      edition_introduced: EDITION_2023,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"NONE\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"VERIFY\" }\n  ];\n\n  enum MessageEncoding {\n    MESSAGE_ENCODING_UNKNOWN = 0;\n    LENGTH_PREFIXED = 1;\n    DELIMITED = 2;\n  }\n  optional MessageEncoding message_encoding = 5 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_FILE,\n    feature_support = {\n      edition_introduced: EDITION_2023,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"LENGTH_PREFIXED\" }\n  ];\n\n  enum JsonFormat {\n    JSON_FORMAT_UNKNOWN = 0;\n    ALLOW = 1;\n    LEGACY_BEST_EFFORT = 2;\n  }\n  optional JsonFormat json_format = 6 [\n    retention = RETENTION_RUNTIME,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_FILE,\n    feature_support = {\n      edition_introduced: EDITION_2023,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"LEGACY_BEST_EFFORT\" },\n    edition_defaults = { edition: EDITION_PROTO3, value: \"ALLOW\" }\n  ];\n\n  enum EnforceNamingStyle {\n    ENFORCE_NAMING_STYLE_UNKNOWN = 0;\n    STYLE2024 = 1;\n    STYLE_LEGACY = 2;\n  }\n  optional EnforceNamingStyle enforce_naming_style = 7 [\n    retention = RETENTION_SOURCE,\n    targets = TARGET_TYPE_FILE,\n    targets = TARGET_TYPE_EXTENSION_RANGE,\n    targets = TARGET_TYPE_MESSAGE,\n    targets = TARGET_TYPE_FIELD,\n    targets = TARGET_TYPE_ONEOF,\n    targets = TARGET_TYPE_ENUM,\n    targets = TARGET_TYPE_ENUM_ENTRY,\n    targets = TARGET_TYPE_SERVICE,\n    targets = TARGET_TYPE_METHOD,\n    feature_support = {\n      edition_introduced: EDITION_2024,\n    },\n    edition_defaults = { edition: EDITION_LEGACY, value: \"STYLE_LEGACY\" },\n    edition_defaults = { edition: EDITION_2024, value: \"STYLE2024\" }\n  ];\n\n  message VisibilityFeature {\n    enum DefaultSymbolVisibility {\n      DEFAULT_SYMBOL_VISIBILITY_UNKNOWN = 0;\n\n      // Default pre-EDITION_2024, all UNSET visibility are export.\n      EXPORT_ALL = 1;\n\n      // All top-level symbols default to export, nested default to local.\n      EXPORT_TOP_LEVEL = 2;\n\n      // All symbols default to local.\n      LOCAL_ALL = 3;\n\n      // All symbols local by default. Nested types cannot be exported.\n      // With special case caveat for message { enum {} reserved 1 to max; }\n      // This is the recommended setting for new protos.\n      STRICT = 4;\n    }\n    reserved 1 to max;\n  }\n  optional VisibilityFeature.DefaultSymbolVisibility default_symbol_visibility =\n      8 [\n        retention = RETENTION_SOURCE,\n        targets = TARGET_TYPE_FILE,\n        feature_support = {\n          edition_introduced: EDITION_2024,\n        },\n        edition_defaults = { edition: EDITION_LEGACY, value: \"EXPORT_ALL\" },\n        edition_defaults = { edition: EDITION_2024, value: \"EXPORT_TOP_LEVEL\" }\n      ];\n\n  reserved 999;\n\n  extensions 1000 to 9994 [\n    declaration = {\n      number: 1000,\n      full_name: \".pb.cpp\",\n      type: \".pb.CppFeatures\"\n    },\n    declaration = {\n      number: 1001,\n      full_name: \".pb.java\",\n      type: \".pb.JavaFeatures\"\n    },\n    declaration = { number: 1002, full_name: \".pb.go\", type: \".pb.GoFeatures\" },\n    declaration = {\n      number: 1003,\n      full_name: \".pb.python\",\n      type: \".pb.PythonFeatures\"\n    },\n    declaration = {\n      number: 9989,\n      full_name: \".pb.java_mutable\",\n      type: \".pb.JavaMutableFeatures\"\n    },\n    declaration = {\n      number: 9990,\n      full_name: \".pb.proto1\",\n      type: \".pb.Proto1Features\"\n    }\n  ];\n\n  extensions 9995 to 9999;  // For internal testing\n  extensions 10000;         // for https://github.com/bufbuild/protobuf-es\n}\n\n// A compiled specification for the defaults of a set of features.  These\n// messages are generated from FeatureSet extensions and can be used to seed\n// feature resolution. The resolution with this object becomes a simple search\n// for the closest matching edition, followed by proto merges.\nmessage FeatureSetDefaults {\n  // A map from every known edition with a unique set of defaults to its\n  // defaults. Not all editions may be contained here.  For a given edition,\n  // the defaults at the closest matching edition ordered at or before it should\n  // be used.  This field must be in strict ascending order by edition.\n  message FeatureSetEditionDefault {\n    optional Edition edition = 3;\n\n    // Defaults of features that can be overridden in this edition.\n    optional FeatureSet overridable_features = 4;\n\n    // Defaults of features that can't be overridden in this edition.\n    optional FeatureSet fixed_features = 5;\n\n    reserved 1, 2;\n    reserved \"features\";\n  }\n  repeated FeatureSetEditionDefault defaults = 1;\n\n  // The minimum supported edition (inclusive) when this was constructed.\n  // Editions before this will not have defaults.\n  optional Edition minimum_edition = 4;\n\n  // The maximum known edition (inclusive) when this was constructed. Editions\n  // after this will not have reliable defaults.\n  optional Edition maximum_edition = 5;\n}\n\n// ===================================================================\n// Optional source code info\n\n// Encapsulates information about the original source file from which a\n// FileDescriptorProto was generated.\nmessage SourceCodeInfo {\n  // A Location identifies a piece of source code in a .proto file which\n  // corresponds to a particular definition.  This information is intended\n  // to be useful to IDEs, code indexers, documentation generators, and similar\n  // tools.\n  //\n  // For example, say we have a file like:\n  //   message Foo {\n  //     optional string foo = 1;\n  //   }\n  // Let's look at just the field definition:\n  //   optional string foo = 1;\n  //   ^       ^^     ^^  ^  ^^^\n  //   a       bc     de  f  ghi\n  // We have the following locations:\n  //   span   path               represents\n  //   [a,i)  [ 4, 0, 2, 0 ]     The whole field definition.\n  //   [a,b)  [ 4, 0, 2, 0, 4 ]  The label (optional).\n  //   [c,d)  [ 4, 0, 2, 0, 5 ]  The type (string).\n  //   [e,f)  [ 4, 0, 2, 0, 1 ]  The name (foo).\n  //   [g,h)  [ 4, 0, 2, 0, 3 ]  The number (1).\n  //\n  // Notes:\n  // - A location may refer to a repeated field itself (i.e. not to any\n  //   particular index within it).  This is used whenever a set of elements are\n  //   logically enclosed in a single code segment.  For example, an entire\n  //   extend block (possibly containing multiple extension definitions) will\n  //   have an outer location whose path refers to the \"extensions\" repeated\n  //   field without an index.\n  // - Multiple locations may have the same path.  This happens when a single\n  //   logical declaration is spread out across multiple places.  The most\n  //   obvious example is the \"extend\" block again -- there may be multiple\n  //   extend blocks in the same scope, each of which will have the same path.\n  // - A location's span is not always a subset of its parent's span.  For\n  //   example, the \"extendee\" of an extension declaration appears at the\n  //   beginning of the \"extend\" block and is shared by all extensions within\n  //   the block.\n  // - Just because a location's span is a subset of some other location's span\n  //   does not mean that it is a descendant.  For example, a \"group\" defines\n  //   both a type and a field in a single declaration.  Thus, the locations\n  //   corresponding to the type and field and their components will overlap.\n  // - Code which tries to interpret locations should probably be designed to\n  //   ignore those that it doesn't understand, as more types of locations could\n  //   be recorded in the future.\n  repeated Location location = 1;\n  message Location {\n    // Identifies which part of the FileDescriptorProto was defined at this\n    // location.\n    //\n    // Each element is a field number or an index.  They form a path from\n    // the root FileDescriptorProto to the place where the definition appears.\n    // For example, this path:\n    //   [ 4, 3, 2, 7, 1 ]\n    // refers to:\n    //   file.message_type(3)  // 4, 3\n    //       .field(7)         // 2, 7\n    //       .name()           // 1\n    // This is because FileDescriptorProto.message_type has field number 4:\n    //   repeated DescriptorProto message_type = 4;\n    // and DescriptorProto.field has field number 2:\n    //   repeated FieldDescriptorProto field = 2;\n    // and FieldDescriptorProto.name has field number 1:\n    //   optional string name = 1;\n    //\n    // Thus, the above path gives the location of a field name.  If we removed\n    // the last element:\n    //   [ 4, 3, 2, 7 ]\n    // this path refers to the whole field declaration (from the beginning\n    // of the label to the terminating semicolon).\n    repeated int32 path = 1 [packed = true];\n\n    // Always has exactly three or four elements: start line, start column,\n    // end line (optional, otherwise assumed same as start line), end column.\n    // These are packed into a single field for efficiency.  Note that line\n    // and column numbers are zero-based -- typically you will want to add\n    // 1 to each before displaying to a user.\n    repeated int32 span = 2 [packed = true];\n\n    // If this SourceCodeInfo represents a complete declaration, these are any\n    // comments appearing before and after the declaration which appear to be\n    // attached to the declaration.\n    //\n    // A series of line comments appearing on consecutive lines, with no other\n    // tokens appearing on those lines, will be treated as a single comment.\n    //\n    // leading_detached_comments will keep paragraphs of comments that appear\n    // before (but not connected to) the current element. Each paragraph,\n    // separated by empty lines, will be one comment element in the repeated\n    // field.\n    //\n    // Only the comment content is provided; comment markers (e.g. //) are\n    // stripped out.  For block comments, leading whitespace and an asterisk\n    // will be stripped from the beginning of each line other than the first.\n    // Newlines are included in the output.\n    //\n    // Examples:\n    //\n    //   optional int32 foo = 1;  // Comment attached to foo.\n    //   // Comment attached to bar.\n    //   optional int32 bar = 2;\n    //\n    //   optional string baz = 3;\n    //   // Comment attached to baz.\n    //   // Another line attached to baz.\n    //\n    //   // Comment attached to moo.\n    //   //\n    //   // Another line attached to moo.\n    //   optional double moo = 4;\n    //\n    //   // Detached comment for corge. This is not leading or trailing comments\n    //   // to moo or corge because there are blank lines separating it from\n    //   // both.\n    //\n    //   // Detached comment for corge paragraph 2.\n    //\n    //   optional string corge = 5;\n    //   /* Block comment attached\n    //    * to corge.  Leading asterisks\n    //    * will be removed. */\n    //   /* Block comment attached to\n    //    * grault. */\n    //   optional int32 grault = 6;\n    //\n    //   // ignored detached comments.\n    optional string leading_comments = 3;\n    optional string trailing_comments = 4;\n    repeated string leading_detached_comments = 6;\n  }\n\n  // Extensions for tooling.\n  extensions 536000000 [declaration = {\n    number: 536000000\n    type: \".buf.descriptor.v1.SourceCodeInfoExtension\"\n    full_name: \".buf.descriptor.v1.buf_source_code_info_extension\"\n  }];\n}\n\n// Describes the relationship between generated code and its original source\n// file. A GeneratedCodeInfo message is associated with only one generated\n// source file, but may contain references to different source .proto files.\nmessage GeneratedCodeInfo {\n  // An Annotation connects some span of text in generated code to an element\n  // of its generating .proto file.\n  repeated Annotation annotation = 1;\n  message Annotation {\n    // Identifies the element in the original source .proto file. This field\n    // is formatted the same as SourceCodeInfo.Location.path.\n    repeated int32 path = 1 [packed = true];\n\n    // Identifies the filesystem path to the original source .proto.\n    optional string source_file = 2;\n\n    // Identifies the starting offset in bytes in the generated code\n    // that relates to the identified object.\n    optional int32 begin = 3;\n\n    // Identifies the ending offset in bytes in the generated code that\n    // relates to the identified object. The end offset should be one past\n    // the last relevant byte (so the length of the text = end - begin).\n    optional int32 end = 4;\n\n    // Represents the identified object's effect on the element in the original\n    // .proto file.\n    enum Semantic {\n      // There is no effect or the effect is indescribable.\n      NONE = 0;\n      // The element is set or otherwise mutated.\n      SET = 1;\n      // An alias to the element is returned.\n      ALIAS = 2;\n    }\n    optional Semantic semantic = 5;\n  }\n}\n\n// Describes the 'visibility' of a symbol with respect to the proto import\n// system. Symbols can only be imported when the visibility rules do not prevent\n// it (ex: local symbols cannot be imported).  Visibility modifiers can only set\n// on `message` and `enum` as they are the only types available to be referenced\n// from other files.\nenum SymbolVisibility {\n  VISIBILITY_UNSET = 0;\n  VISIBILITY_LOCAL = 1;\n  VISIBILITY_EXPORT = 2;\n}"
  },
  {
    "path": "tests/data/import-option-bad.proto",
    "content": "edition = \"2024\";\n\nimport option \"nonexistent.proto\";\n\noption features.(pb.nonexistent).foo = BAR;\n\nmessage Foo {\n  string legacy = 1;\n}"
  },
  {
    "path": "tests/data/invalid-lookup.proto",
    "content": "syntax = \"proto3\";\n\npackage test;\n\nservice MyService {\n  rpc MyMethod (InvalidMessage) returns (stream InvalidMessage) {};\n}\n\nmessage InvalidMessage {\n  required bad_field = 1;\n}"
  },
  {
    "path": "tests/data/invalid.json",
    "content": "{\n    \"nested\": {\n        \"Test\": {\n            \"fields\": {\n"
  },
  {
    "path": "tests/data/invalid.proto",
    "content": "message Test {"
  },
  {
    "path": "tests/data/issue936.proto",
    "content": "message Meta {\n  extensions 10 to 20;\n}\n\nextend Meta {\n  required string workflow_id = 10;\n  required string task_id = 11;\n}\n"
  },
  {
    "path": "tests/data/mapbox/LICENSE",
    "content": "Copyright (c) 2016, Mapbox\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n  list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n  this list of conditions and the following disclaimer in the documentation\n  and/or other materials provided with the distribution.\n\n* Neither the name of pbf nor the names of its\n  contributors may be used to endorse or promote products derived from\n  this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "tests/data/mapbox/vector_tile.d.ts",
    "content": "import * as $protobuf from \"../../..\";\nimport Long from \"long\";\n\nexport namespace vector_tile {\n\n    interface ITile {\n        layers?: (vector_tile.Tile.ILayer[]|null);\n    }\n\n    class Tile implements ITile {\n        constructor(properties?: vector_tile.ITile);\n        public layers: vector_tile.Tile.ILayer[];\n        public static create(properties?: vector_tile.ITile): vector_tile.Tile;\n        public static encode(message: vector_tile.ITile, writer?: $protobuf.Writer): $protobuf.Writer;\n        public static encodeDelimited(message: vector_tile.ITile, writer?: $protobuf.Writer): $protobuf.Writer;\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vector_tile.Tile;\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vector_tile.Tile;\n        public static verify(message: { [k: string]: any }): (string|null);\n        public static fromObject(object: { [k: string]: any }): vector_tile.Tile;\n        public static toObject(message: vector_tile.Tile, options?: $protobuf.IConversionOptions): { [k: string]: any };\n        public toJSON(): { [k: string]: any };\n        public static getTypeUrl(typeUrlPrefix?: string): string;\n    }\n\n    namespace Tile {\n\n        enum GeomType {\n            UNKNOWN = 0,\n            POINT = 1,\n            LINESTRING = 2,\n            POLYGON = 3\n        }\n\n        interface IValue {\n            stringValue?: (string|null);\n            floatValue?: (number|null);\n            doubleValue?: (number|null);\n            intValue?: (number|Long|null);\n            uintValue?: (number|Long|null);\n            sintValue?: (number|Long|null);\n            boolValue?: (boolean|null);\n        }\n\n        class Value implements IValue {\n            constructor(properties?: vector_tile.Tile.IValue);\n            public stringValue: string;\n            public floatValue: number;\n            public doubleValue: number;\n            public intValue: (number|Long);\n            public uintValue: (number|Long);\n            public sintValue: (number|Long);\n            public boolValue: boolean;\n            public static create(properties?: vector_tile.Tile.IValue): vector_tile.Tile.Value;\n            public static encode(message: vector_tile.Tile.IValue, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: vector_tile.Tile.IValue, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vector_tile.Tile.Value;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vector_tile.Tile.Value;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): vector_tile.Tile.Value;\n            public static toObject(message: vector_tile.Tile.Value, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IFeature {\n            id?: (number|Long|null);\n            tags?: (number[]|null);\n            type?: (vector_tile.Tile.GeomType|null);\n            geometry?: (number[]|null);\n        }\n\n        class Feature implements IFeature {\n            constructor(properties?: vector_tile.Tile.IFeature);\n            public id: (number|Long);\n            public tags: number[];\n            public type: vector_tile.Tile.GeomType;\n            public geometry: number[];\n            public static create(properties?: vector_tile.Tile.IFeature): vector_tile.Tile.Feature;\n            public static encode(message: vector_tile.Tile.IFeature, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: vector_tile.Tile.IFeature, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vector_tile.Tile.Feature;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vector_tile.Tile.Feature;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): vector_tile.Tile.Feature;\n            public static toObject(message: vector_tile.Tile.Feature, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ILayer {\n            version: number;\n            name: string;\n            features?: (vector_tile.Tile.IFeature[]|null);\n            keys?: (string[]|null);\n            values?: (vector_tile.Tile.IValue[]|null);\n            extent?: (number|null);\n        }\n\n        class Layer implements ILayer {\n            constructor(properties?: vector_tile.Tile.ILayer);\n            public version: number;\n            public name: string;\n            public features: vector_tile.Tile.IFeature[];\n            public keys: string[];\n            public values: vector_tile.Tile.IValue[];\n            public extent: number;\n            public static create(properties?: vector_tile.Tile.ILayer): vector_tile.Tile.Layer;\n            public static encode(message: vector_tile.Tile.ILayer, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: vector_tile.Tile.ILayer, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): vector_tile.Tile.Layer;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): vector_tile.Tile.Layer;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): vector_tile.Tile.Layer;\n            public static toObject(message: vector_tile.Tile.Layer, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n    }\n}\n"
  },
  {
    "path": "tests/data/mapbox/vector_tile.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_vector_tile || ($protobuf.roots.test_vector_tile = {});\n\n$root.vector_tile = (function() {\n\n    /**\n     * Namespace vector_tile.\n     * @exports vector_tile\n     * @namespace\n     */\n    var vector_tile = {};\n\n    vector_tile.Tile = (function() {\n\n        /**\n         * Properties of a Tile.\n         * @memberof vector_tile\n         * @interface ITile\n         * @property {Array.<vector_tile.Tile.ILayer>|null} [layers] Tile layers\n         */\n\n        /**\n         * Constructs a new Tile.\n         * @memberof vector_tile\n         * @classdesc Represents a Tile.\n         * @implements ITile\n         * @constructor\n         * @param {vector_tile.ITile=} [properties] Properties to set\n         */\n        function Tile(properties) {\n            this.layers = [];\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * Tile layers.\n         * @member {Array.<vector_tile.Tile.ILayer>} layers\n         * @memberof vector_tile.Tile\n         * @instance\n         */\n        Tile.prototype.layers = $util.emptyArray;\n\n        /**\n         * Creates a new Tile instance using the specified properties.\n         * @function create\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {vector_tile.ITile=} [properties] Properties to set\n         * @returns {vector_tile.Tile} Tile instance\n         */\n        Tile.create = function create(properties) {\n            return new Tile(properties);\n        };\n\n        /**\n         * Encodes the specified Tile message. Does not implicitly {@link vector_tile.Tile.verify|verify} messages.\n         * @function encode\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {vector_tile.ITile} message Tile message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        Tile.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.layers != null && message.layers.length)\n                for (var i = 0; i < message.layers.length; ++i)\n                    $root.vector_tile.Tile.Layer.encode(message.layers[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n            return writer;\n        };\n\n        /**\n         * Encodes the specified Tile message, length delimited. Does not implicitly {@link vector_tile.Tile.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {vector_tile.ITile} message Tile message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        Tile.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a Tile message from the specified reader or buffer.\n         * @function decode\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {vector_tile.Tile} Tile\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        Tile.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vector_tile.Tile();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 3:\n                    if (!(message.layers && message.layers.length))\n                        message.layers = [];\n                    message.layers.push($root.vector_tile.Tile.Layer.decode(reader, reader.uint32()));\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a Tile message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {vector_tile.Tile} Tile\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        Tile.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a Tile message.\n         * @function verify\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        Tile.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.layers != null && message.hasOwnProperty(\"layers\")) {\n                if (!Array.isArray(message.layers))\n                    return \"layers: array expected\";\n                for (var i = 0; i < message.layers.length; ++i) {\n                    var error = $root.vector_tile.Tile.Layer.verify(message.layers[i]);\n                    if (error)\n                        return \"layers.\" + error;\n                }\n            }\n            return null;\n        };\n\n        /**\n         * Creates a Tile message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {vector_tile.Tile} Tile\n         */\n        Tile.fromObject = function fromObject(object) {\n            if (object instanceof $root.vector_tile.Tile)\n                return object;\n            var message = new $root.vector_tile.Tile();\n            if (object.layers) {\n                if (!Array.isArray(object.layers))\n                    throw TypeError(\".vector_tile.Tile.layers: array expected\");\n                message.layers = [];\n                for (var i = 0; i < object.layers.length; ++i) {\n                    if (typeof object.layers[i] !== \"object\")\n                        throw TypeError(\".vector_tile.Tile.layers: object expected\");\n                    message.layers[i] = $root.vector_tile.Tile.Layer.fromObject(object.layers[i]);\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a Tile message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {vector_tile.Tile} message Tile\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        Tile.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.arrays || options.defaults)\n                object.layers = [];\n            if (message.layers && message.layers.length) {\n                object.layers = [];\n                for (var j = 0; j < message.layers.length; ++j)\n                    object.layers[j] = $root.vector_tile.Tile.Layer.toObject(message.layers[j], options);\n            }\n            return object;\n        };\n\n        /**\n         * Converts this Tile to JSON.\n         * @function toJSON\n         * @memberof vector_tile.Tile\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        Tile.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        /**\n         * Gets the default type url for Tile\n         * @function getTypeUrl\n         * @memberof vector_tile.Tile\n         * @static\n         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n         * @returns {string} The default type url\n         */\n        Tile.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n            if (typeUrlPrefix === undefined) {\n                typeUrlPrefix = \"type.googleapis.com\";\n            }\n            return typeUrlPrefix + \"/vector_tile.Tile\";\n        };\n\n        /**\n         * GeomType enum.\n         * @name vector_tile.Tile.GeomType\n         * @enum {number}\n         * @property {number} UNKNOWN=0 UNKNOWN value\n         * @property {number} POINT=1 POINT value\n         * @property {number} LINESTRING=2 LINESTRING value\n         * @property {number} POLYGON=3 POLYGON value\n         */\n        Tile.GeomType = (function() {\n            var valuesById = {}, values = Object.create(valuesById);\n            values[valuesById[0] = \"UNKNOWN\"] = 0;\n            values[valuesById[1] = \"POINT\"] = 1;\n            values[valuesById[2] = \"LINESTRING\"] = 2;\n            values[valuesById[3] = \"POLYGON\"] = 3;\n            return values;\n        })();\n\n        Tile.Value = (function() {\n\n            /**\n             * Properties of a Value.\n             * @memberof vector_tile.Tile\n             * @interface IValue\n             * @property {string|null} [stringValue] Value stringValue\n             * @property {number|null} [floatValue] Value floatValue\n             * @property {number|null} [doubleValue] Value doubleValue\n             * @property {number|Long|null} [intValue] Value intValue\n             * @property {number|Long|null} [uintValue] Value uintValue\n             * @property {number|Long|null} [sintValue] Value sintValue\n             * @property {boolean|null} [boolValue] Value boolValue\n             */\n\n            /**\n             * Constructs a new Value.\n             * @memberof vector_tile.Tile\n             * @classdesc Represents a Value.\n             * @implements IValue\n             * @constructor\n             * @param {vector_tile.Tile.IValue=} [properties] Properties to set\n             */\n            function Value(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Value stringValue.\n             * @member {string} stringValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.stringValue = \"\";\n\n            /**\n             * Value floatValue.\n             * @member {number} floatValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.floatValue = 0;\n\n            /**\n             * Value doubleValue.\n             * @member {number} doubleValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.doubleValue = 0;\n\n            /**\n             * Value intValue.\n             * @member {number|Long} intValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.intValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n            /**\n             * Value uintValue.\n             * @member {number|Long} uintValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.uintValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n            /**\n             * Value sintValue.\n             * @member {number|Long} sintValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.sintValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n            /**\n             * Value boolValue.\n             * @member {boolean} boolValue\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             */\n            Value.prototype.boolValue = false;\n\n            /**\n             * Creates a new Value instance using the specified properties.\n             * @function create\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {vector_tile.Tile.IValue=} [properties] Properties to set\n             * @returns {vector_tile.Tile.Value} Value instance\n             */\n            Value.create = function create(properties) {\n                return new Value(properties);\n            };\n\n            /**\n             * Encodes the specified Value message. Does not implicitly {@link vector_tile.Tile.Value.verify|verify} messages.\n             * @function encode\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {vector_tile.Tile.IValue} message Value message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Value.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.stringValue != null && Object.hasOwnProperty.call(message, \"stringValue\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringValue);\n                if (message.floatValue != null && Object.hasOwnProperty.call(message, \"floatValue\"))\n                    writer.uint32(/* id 2, wireType 5 =*/21).float(message.floatValue);\n                if (message.doubleValue != null && Object.hasOwnProperty.call(message, \"doubleValue\"))\n                    writer.uint32(/* id 3, wireType 1 =*/25).double(message.doubleValue);\n                if (message.intValue != null && Object.hasOwnProperty.call(message, \"intValue\"))\n                    writer.uint32(/* id 4, wireType 0 =*/32).int64(message.intValue);\n                if (message.uintValue != null && Object.hasOwnProperty.call(message, \"uintValue\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.uintValue);\n                if (message.sintValue != null && Object.hasOwnProperty.call(message, \"sintValue\"))\n                    writer.uint32(/* id 6, wireType 0 =*/48).sint64(message.sintValue);\n                if (message.boolValue != null && Object.hasOwnProperty.call(message, \"boolValue\"))\n                    writer.uint32(/* id 7, wireType 0 =*/56).bool(message.boolValue);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Value message, length delimited. Does not implicitly {@link vector_tile.Tile.Value.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {vector_tile.Tile.IValue} message Value message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Value.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Value message from the specified reader or buffer.\n             * @function decode\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {vector_tile.Tile.Value} Value\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Value.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vector_tile.Tile.Value();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.stringValue = reader.string();\n                        break;\n                    case 2:\n                        message.floatValue = reader.float();\n                        break;\n                    case 3:\n                        message.doubleValue = reader.double();\n                        break;\n                    case 4:\n                        message.intValue = reader.int64();\n                        break;\n                    case 5:\n                        message.uintValue = reader.uint64();\n                        break;\n                    case 6:\n                        message.sintValue = reader.sint64();\n                        break;\n                    case 7:\n                        message.boolValue = reader.bool();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a Value message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {vector_tile.Tile.Value} Value\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Value.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Value message.\n             * @function verify\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Value.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    if (!$util.isString(message.stringValue))\n                        return \"stringValue: string expected\";\n                if (message.floatValue != null && message.hasOwnProperty(\"floatValue\"))\n                    if (typeof message.floatValue !== \"number\")\n                        return \"floatValue: number expected\";\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    if (typeof message.doubleValue !== \"number\")\n                        return \"doubleValue: number expected\";\n                if (message.intValue != null && message.hasOwnProperty(\"intValue\"))\n                    if (!$util.isInteger(message.intValue) && !(message.intValue && $util.isInteger(message.intValue.low) && $util.isInteger(message.intValue.high)))\n                        return \"intValue: integer|Long expected\";\n                if (message.uintValue != null && message.hasOwnProperty(\"uintValue\"))\n                    if (!$util.isInteger(message.uintValue) && !(message.uintValue && $util.isInteger(message.uintValue.low) && $util.isInteger(message.uintValue.high)))\n                        return \"uintValue: integer|Long expected\";\n                if (message.sintValue != null && message.hasOwnProperty(\"sintValue\"))\n                    if (!$util.isInteger(message.sintValue) && !(message.sintValue && $util.isInteger(message.sintValue.low) && $util.isInteger(message.sintValue.high)))\n                        return \"sintValue: integer|Long expected\";\n                if (message.boolValue != null && message.hasOwnProperty(\"boolValue\"))\n                    if (typeof message.boolValue !== \"boolean\")\n                        return \"boolValue: boolean expected\";\n                return null;\n            };\n\n            /**\n             * Creates a Value message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {vector_tile.Tile.Value} Value\n             */\n            Value.fromObject = function fromObject(object) {\n                if (object instanceof $root.vector_tile.Tile.Value)\n                    return object;\n                var message = new $root.vector_tile.Tile.Value();\n                if (object.stringValue != null)\n                    message.stringValue = String(object.stringValue);\n                if (object.floatValue != null)\n                    message.floatValue = Number(object.floatValue);\n                if (object.doubleValue != null)\n                    message.doubleValue = Number(object.doubleValue);\n                if (object.intValue != null)\n                    if ($util.Long)\n                        (message.intValue = $util.Long.fromValue(object.intValue)).unsigned = false;\n                    else if (typeof object.intValue === \"string\")\n                        message.intValue = parseInt(object.intValue, 10);\n                    else if (typeof object.intValue === \"number\")\n                        message.intValue = object.intValue;\n                    else if (typeof object.intValue === \"object\")\n                        message.intValue = new $util.LongBits(object.intValue.low >>> 0, object.intValue.high >>> 0).toNumber();\n                if (object.uintValue != null)\n                    if ($util.Long)\n                        (message.uintValue = $util.Long.fromValue(object.uintValue)).unsigned = true;\n                    else if (typeof object.uintValue === \"string\")\n                        message.uintValue = parseInt(object.uintValue, 10);\n                    else if (typeof object.uintValue === \"number\")\n                        message.uintValue = object.uintValue;\n                    else if (typeof object.uintValue === \"object\")\n                        message.uintValue = new $util.LongBits(object.uintValue.low >>> 0, object.uintValue.high >>> 0).toNumber(true);\n                if (object.sintValue != null)\n                    if ($util.Long)\n                        (message.sintValue = $util.Long.fromValue(object.sintValue)).unsigned = false;\n                    else if (typeof object.sintValue === \"string\")\n                        message.sintValue = parseInt(object.sintValue, 10);\n                    else if (typeof object.sintValue === \"number\")\n                        message.sintValue = object.sintValue;\n                    else if (typeof object.sintValue === \"object\")\n                        message.sintValue = new $util.LongBits(object.sintValue.low >>> 0, object.sintValue.high >>> 0).toNumber();\n                if (object.boolValue != null)\n                    message.boolValue = Boolean(object.boolValue);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a Value message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {vector_tile.Tile.Value} message Value\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Value.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.stringValue = \"\";\n                    object.floatValue = 0;\n                    object.doubleValue = 0;\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, false);\n                        object.intValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.intValue = options.longs === String ? \"0\" : 0;\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, true);\n                        object.uintValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.uintValue = options.longs === String ? \"0\" : 0;\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, false);\n                        object.sintValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.sintValue = options.longs === String ? \"0\" : 0;\n                    object.boolValue = false;\n                }\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    object.stringValue = message.stringValue;\n                if (message.floatValue != null && message.hasOwnProperty(\"floatValue\"))\n                    object.floatValue = options.json && !isFinite(message.floatValue) ? String(message.floatValue) : message.floatValue;\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;\n                if (message.intValue != null && message.hasOwnProperty(\"intValue\"))\n                    if (typeof message.intValue === \"number\")\n                        object.intValue = options.longs === String ? String(message.intValue) : message.intValue;\n                    else\n                        object.intValue = options.longs === String ? $util.Long.prototype.toString.call(message.intValue) : options.longs === Number ? new $util.LongBits(message.intValue.low >>> 0, message.intValue.high >>> 0).toNumber() : message.intValue;\n                if (message.uintValue != null && message.hasOwnProperty(\"uintValue\"))\n                    if (typeof message.uintValue === \"number\")\n                        object.uintValue = options.longs === String ? String(message.uintValue) : message.uintValue;\n                    else\n                        object.uintValue = options.longs === String ? $util.Long.prototype.toString.call(message.uintValue) : options.longs === Number ? new $util.LongBits(message.uintValue.low >>> 0, message.uintValue.high >>> 0).toNumber(true) : message.uintValue;\n                if (message.sintValue != null && message.hasOwnProperty(\"sintValue\"))\n                    if (typeof message.sintValue === \"number\")\n                        object.sintValue = options.longs === String ? String(message.sintValue) : message.sintValue;\n                    else\n                        object.sintValue = options.longs === String ? $util.Long.prototype.toString.call(message.sintValue) : options.longs === Number ? new $util.LongBits(message.sintValue.low >>> 0, message.sintValue.high >>> 0).toNumber() : message.sintValue;\n                if (message.boolValue != null && message.hasOwnProperty(\"boolValue\"))\n                    object.boolValue = message.boolValue;\n                return object;\n            };\n\n            /**\n             * Converts this Value to JSON.\n             * @function toJSON\n             * @memberof vector_tile.Tile.Value\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Value.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Value\n             * @function getTypeUrl\n             * @memberof vector_tile.Tile.Value\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Value.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/vector_tile.Tile.Value\";\n            };\n\n            return Value;\n        })();\n\n        Tile.Feature = (function() {\n\n            /**\n             * Properties of a Feature.\n             * @memberof vector_tile.Tile\n             * @interface IFeature\n             * @property {number|Long|null} [id] Feature id\n             * @property {Array.<number>|null} [tags] Feature tags\n             * @property {vector_tile.Tile.GeomType|null} [type] Feature type\n             * @property {Array.<number>|null} [geometry] Feature geometry\n             */\n\n            /**\n             * Constructs a new Feature.\n             * @memberof vector_tile.Tile\n             * @classdesc Represents a Feature.\n             * @implements IFeature\n             * @constructor\n             * @param {vector_tile.Tile.IFeature=} [properties] Properties to set\n             */\n            function Feature(properties) {\n                this.tags = [];\n                this.geometry = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Feature id.\n             * @member {number|Long} id\n             * @memberof vector_tile.Tile.Feature\n             * @instance\n             */\n            Feature.prototype.id = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n            /**\n             * Feature tags.\n             * @member {Array.<number>} tags\n             * @memberof vector_tile.Tile.Feature\n             * @instance\n             */\n            Feature.prototype.tags = $util.emptyArray;\n\n            /**\n             * Feature type.\n             * @member {vector_tile.Tile.GeomType} type\n             * @memberof vector_tile.Tile.Feature\n             * @instance\n             */\n            Feature.prototype.type = 0;\n\n            /**\n             * Feature geometry.\n             * @member {Array.<number>} geometry\n             * @memberof vector_tile.Tile.Feature\n             * @instance\n             */\n            Feature.prototype.geometry = $util.emptyArray;\n\n            /**\n             * Creates a new Feature instance using the specified properties.\n             * @function create\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {vector_tile.Tile.IFeature=} [properties] Properties to set\n             * @returns {vector_tile.Tile.Feature} Feature instance\n             */\n            Feature.create = function create(properties) {\n                return new Feature(properties);\n            };\n\n            /**\n             * Encodes the specified Feature message. Does not implicitly {@link vector_tile.Tile.Feature.verify|verify} messages.\n             * @function encode\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {vector_tile.Tile.IFeature} message Feature message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Feature.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.id != null && Object.hasOwnProperty.call(message, \"id\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.id);\n                if (message.tags != null && message.tags.length) {\n                    writer.uint32(/* id 2, wireType 2 =*/18).fork();\n                    for (var i = 0; i < message.tags.length; ++i)\n                        writer.uint32(message.tags[i]);\n                    writer.ldelim();\n                }\n                if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type);\n                if (message.geometry != null && message.geometry.length) {\n                    writer.uint32(/* id 4, wireType 2 =*/34).fork();\n                    for (var i = 0; i < message.geometry.length; ++i)\n                        writer.uint32(message.geometry[i]);\n                    writer.ldelim();\n                }\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Feature message, length delimited. Does not implicitly {@link vector_tile.Tile.Feature.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {vector_tile.Tile.IFeature} message Feature message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Feature.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Feature message from the specified reader or buffer.\n             * @function decode\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {vector_tile.Tile.Feature} Feature\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Feature.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vector_tile.Tile.Feature();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.id = reader.uint64();\n                        break;\n                    case 2:\n                        if (!(message.tags && message.tags.length))\n                            message.tags = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.tags.push(reader.uint32());\n                        } else\n                            message.tags.push(reader.uint32());\n                        break;\n                    case 3:\n                        message.type = reader.int32();\n                        break;\n                    case 4:\n                        if (!(message.geometry && message.geometry.length))\n                            message.geometry = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.geometry.push(reader.uint32());\n                        } else\n                            message.geometry.push(reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a Feature message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {vector_tile.Tile.Feature} Feature\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Feature.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Feature message.\n             * @function verify\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Feature.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.id != null && message.hasOwnProperty(\"id\"))\n                    if (!$util.isInteger(message.id) && !(message.id && $util.isInteger(message.id.low) && $util.isInteger(message.id.high)))\n                        return \"id: integer|Long expected\";\n                if (message.tags != null && message.hasOwnProperty(\"tags\")) {\n                    if (!Array.isArray(message.tags))\n                        return \"tags: array expected\";\n                    for (var i = 0; i < message.tags.length; ++i)\n                        if (!$util.isInteger(message.tags[i]))\n                            return \"tags: integer[] expected\";\n                }\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    switch (message.type) {\n                    default:\n                        return \"type: enum value expected\";\n                    case 0:\n                    case 1:\n                    case 2:\n                    case 3:\n                        break;\n                    }\n                if (message.geometry != null && message.hasOwnProperty(\"geometry\")) {\n                    if (!Array.isArray(message.geometry))\n                        return \"geometry: array expected\";\n                    for (var i = 0; i < message.geometry.length; ++i)\n                        if (!$util.isInteger(message.geometry[i]))\n                            return \"geometry: integer[] expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates a Feature message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {vector_tile.Tile.Feature} Feature\n             */\n            Feature.fromObject = function fromObject(object) {\n                if (object instanceof $root.vector_tile.Tile.Feature)\n                    return object;\n                var message = new $root.vector_tile.Tile.Feature();\n                if (object.id != null)\n                    if ($util.Long)\n                        (message.id = $util.Long.fromValue(object.id)).unsigned = true;\n                    else if (typeof object.id === \"string\")\n                        message.id = parseInt(object.id, 10);\n                    else if (typeof object.id === \"number\")\n                        message.id = object.id;\n                    else if (typeof object.id === \"object\")\n                        message.id = new $util.LongBits(object.id.low >>> 0, object.id.high >>> 0).toNumber(true);\n                if (object.tags) {\n                    if (!Array.isArray(object.tags))\n                        throw TypeError(\".vector_tile.Tile.Feature.tags: array expected\");\n                    message.tags = [];\n                    for (var i = 0; i < object.tags.length; ++i)\n                        message.tags[i] = object.tags[i] >>> 0;\n                }\n                switch (object.type) {\n                case \"UNKNOWN\":\n                case 0:\n                    message.type = 0;\n                    break;\n                case \"POINT\":\n                case 1:\n                    message.type = 1;\n                    break;\n                case \"LINESTRING\":\n                case 2:\n                    message.type = 2;\n                    break;\n                case \"POLYGON\":\n                case 3:\n                    message.type = 3;\n                    break;\n                }\n                if (object.geometry) {\n                    if (!Array.isArray(object.geometry))\n                        throw TypeError(\".vector_tile.Tile.Feature.geometry: array expected\");\n                    message.geometry = [];\n                    for (var i = 0; i < object.geometry.length; ++i)\n                        message.geometry[i] = object.geometry[i] >>> 0;\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a Feature message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {vector_tile.Tile.Feature} message Feature\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Feature.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.tags = [];\n                    object.geometry = [];\n                }\n                if (options.defaults) {\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, true);\n                        object.id = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.id = options.longs === String ? \"0\" : 0;\n                    object.type = options.enums === String ? \"UNKNOWN\" : 0;\n                }\n                if (message.id != null && message.hasOwnProperty(\"id\"))\n                    if (typeof message.id === \"number\")\n                        object.id = options.longs === String ? String(message.id) : message.id;\n                    else\n                        object.id = options.longs === String ? $util.Long.prototype.toString.call(message.id) : options.longs === Number ? new $util.LongBits(message.id.low >>> 0, message.id.high >>> 0).toNumber(true) : message.id;\n                if (message.tags && message.tags.length) {\n                    object.tags = [];\n                    for (var j = 0; j < message.tags.length; ++j)\n                        object.tags[j] = message.tags[j];\n                }\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    object.type = options.enums === String ? $root.vector_tile.Tile.GeomType[message.type] : message.type;\n                if (message.geometry && message.geometry.length) {\n                    object.geometry = [];\n                    for (var j = 0; j < message.geometry.length; ++j)\n                        object.geometry[j] = message.geometry[j];\n                }\n                return object;\n            };\n\n            /**\n             * Converts this Feature to JSON.\n             * @function toJSON\n             * @memberof vector_tile.Tile.Feature\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Feature.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Feature\n             * @function getTypeUrl\n             * @memberof vector_tile.Tile.Feature\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Feature.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/vector_tile.Tile.Feature\";\n            };\n\n            return Feature;\n        })();\n\n        Tile.Layer = (function() {\n\n            /**\n             * Properties of a Layer.\n             * @memberof vector_tile.Tile\n             * @interface ILayer\n             * @property {number} version Layer version\n             * @property {string} name Layer name\n             * @property {Array.<vector_tile.Tile.IFeature>|null} [features] Layer features\n             * @property {Array.<string>|null} [keys] Layer keys\n             * @property {Array.<vector_tile.Tile.IValue>|null} [values] Layer values\n             * @property {number|null} [extent] Layer extent\n             */\n\n            /**\n             * Constructs a new Layer.\n             * @memberof vector_tile.Tile\n             * @classdesc Represents a Layer.\n             * @implements ILayer\n             * @constructor\n             * @param {vector_tile.Tile.ILayer=} [properties] Properties to set\n             */\n            function Layer(properties) {\n                this.features = [];\n                this.keys = [];\n                this.values = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Layer version.\n             * @member {number} version\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             */\n            Layer.prototype.version = 1;\n\n            /**\n             * Layer name.\n             * @member {string} name\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             */\n            Layer.prototype.name = \"\";\n\n            /**\n             * Layer features.\n             * @member {Array.<vector_tile.Tile.IFeature>} features\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             */\n            Layer.prototype.features = $util.emptyArray;\n\n            /**\n             * Layer keys.\n             * @member {Array.<string>} keys\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             */\n            Layer.prototype.keys = $util.emptyArray;\n\n            /**\n             * Layer values.\n             * @member {Array.<vector_tile.Tile.IValue>} values\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             */\n            Layer.prototype.values = $util.emptyArray;\n\n            /**\n             * Layer extent.\n             * @member {number} extent\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             */\n            Layer.prototype.extent = 4096;\n\n            /**\n             * Creates a new Layer instance using the specified properties.\n             * @function create\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {vector_tile.Tile.ILayer=} [properties] Properties to set\n             * @returns {vector_tile.Tile.Layer} Layer instance\n             */\n            Layer.create = function create(properties) {\n                return new Layer(properties);\n            };\n\n            /**\n             * Encodes the specified Layer message. Does not implicitly {@link vector_tile.Tile.Layer.verify|verify} messages.\n             * @function encode\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {vector_tile.Tile.ILayer} message Layer message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Layer.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.features != null && message.features.length)\n                    for (var i = 0; i < message.features.length; ++i)\n                        $root.vector_tile.Tile.Feature.encode(message.features[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.keys != null && message.keys.length)\n                    for (var i = 0; i < message.keys.length; ++i)\n                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.keys[i]);\n                if (message.values != null && message.values.length)\n                    for (var i = 0; i < message.values.length; ++i)\n                        $root.vector_tile.Tile.Value.encode(message.values[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.extent != null && Object.hasOwnProperty.call(message, \"extent\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.extent);\n                writer.uint32(/* id 15, wireType 0 =*/120).uint32(message.version);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Layer message, length delimited. Does not implicitly {@link vector_tile.Tile.Layer.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {vector_tile.Tile.ILayer} message Layer message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Layer.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Layer message from the specified reader or buffer.\n             * @function decode\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {vector_tile.Tile.Layer} Layer\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Layer.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vector_tile.Tile.Layer();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 15:\n                        message.version = reader.uint32();\n                        break;\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.features && message.features.length))\n                            message.features = [];\n                        message.features.push($root.vector_tile.Tile.Feature.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        if (!(message.keys && message.keys.length))\n                            message.keys = [];\n                        message.keys.push(reader.string());\n                        break;\n                    case 4:\n                        if (!(message.values && message.values.length))\n                            message.values = [];\n                        message.values.push($root.vector_tile.Tile.Value.decode(reader, reader.uint32()));\n                        break;\n                    case 5:\n                        message.extent = reader.uint32();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"version\"))\n                    throw $util.ProtocolError(\"missing required 'version'\", { instance: message });\n                if (!message.hasOwnProperty(\"name\"))\n                    throw $util.ProtocolError(\"missing required 'name'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a Layer message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {vector_tile.Tile.Layer} Layer\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Layer.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Layer message.\n             * @function verify\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Layer.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (!$util.isInteger(message.version))\n                    return \"version: integer expected\";\n                if (!$util.isString(message.name))\n                    return \"name: string expected\";\n                if (message.features != null && message.hasOwnProperty(\"features\")) {\n                    if (!Array.isArray(message.features))\n                        return \"features: array expected\";\n                    for (var i = 0; i < message.features.length; ++i) {\n                        var error = $root.vector_tile.Tile.Feature.verify(message.features[i]);\n                        if (error)\n                            return \"features.\" + error;\n                    }\n                }\n                if (message.keys != null && message.hasOwnProperty(\"keys\")) {\n                    if (!Array.isArray(message.keys))\n                        return \"keys: array expected\";\n                    for (var i = 0; i < message.keys.length; ++i)\n                        if (!$util.isString(message.keys[i]))\n                            return \"keys: string[] expected\";\n                }\n                if (message.values != null && message.hasOwnProperty(\"values\")) {\n                    if (!Array.isArray(message.values))\n                        return \"values: array expected\";\n                    for (var i = 0; i < message.values.length; ++i) {\n                        var error = $root.vector_tile.Tile.Value.verify(message.values[i]);\n                        if (error)\n                            return \"values.\" + error;\n                    }\n                }\n                if (message.extent != null && message.hasOwnProperty(\"extent\"))\n                    if (!$util.isInteger(message.extent))\n                        return \"extent: integer expected\";\n                return null;\n            };\n\n            /**\n             * Creates a Layer message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {vector_tile.Tile.Layer} Layer\n             */\n            Layer.fromObject = function fromObject(object) {\n                if (object instanceof $root.vector_tile.Tile.Layer)\n                    return object;\n                var message = new $root.vector_tile.Tile.Layer();\n                if (object.version != null)\n                    message.version = object.version >>> 0;\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.features) {\n                    if (!Array.isArray(object.features))\n                        throw TypeError(\".vector_tile.Tile.Layer.features: array expected\");\n                    message.features = [];\n                    for (var i = 0; i < object.features.length; ++i) {\n                        if (typeof object.features[i] !== \"object\")\n                            throw TypeError(\".vector_tile.Tile.Layer.features: object expected\");\n                        message.features[i] = $root.vector_tile.Tile.Feature.fromObject(object.features[i]);\n                    }\n                }\n                if (object.keys) {\n                    if (!Array.isArray(object.keys))\n                        throw TypeError(\".vector_tile.Tile.Layer.keys: array expected\");\n                    message.keys = [];\n                    for (var i = 0; i < object.keys.length; ++i)\n                        message.keys[i] = String(object.keys[i]);\n                }\n                if (object.values) {\n                    if (!Array.isArray(object.values))\n                        throw TypeError(\".vector_tile.Tile.Layer.values: array expected\");\n                    message.values = [];\n                    for (var i = 0; i < object.values.length; ++i) {\n                        if (typeof object.values[i] !== \"object\")\n                            throw TypeError(\".vector_tile.Tile.Layer.values: object expected\");\n                        message.values[i] = $root.vector_tile.Tile.Value.fromObject(object.values[i]);\n                    }\n                }\n                if (object.extent != null)\n                    message.extent = object.extent >>> 0;\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a Layer message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {vector_tile.Tile.Layer} message Layer\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Layer.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.features = [];\n                    object.keys = [];\n                    object.values = [];\n                }\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.extent = 4096;\n                    object.version = 1;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.features && message.features.length) {\n                    object.features = [];\n                    for (var j = 0; j < message.features.length; ++j)\n                        object.features[j] = $root.vector_tile.Tile.Feature.toObject(message.features[j], options);\n                }\n                if (message.keys && message.keys.length) {\n                    object.keys = [];\n                    for (var j = 0; j < message.keys.length; ++j)\n                        object.keys[j] = message.keys[j];\n                }\n                if (message.values && message.values.length) {\n                    object.values = [];\n                    for (var j = 0; j < message.values.length; ++j)\n                        object.values[j] = $root.vector_tile.Tile.Value.toObject(message.values[j], options);\n                }\n                if (message.extent != null && message.hasOwnProperty(\"extent\"))\n                    object.extent = message.extent;\n                if (message.version != null && message.hasOwnProperty(\"version\"))\n                    object.version = message.version;\n                return object;\n            };\n\n            /**\n             * Converts this Layer to JSON.\n             * @function toJSON\n             * @memberof vector_tile.Tile.Layer\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Layer.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Layer\n             * @function getTypeUrl\n             * @memberof vector_tile.Tile.Layer\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Layer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/vector_tile.Tile.Layer\";\n            };\n\n            return Layer;\n        })();\n\n        return Tile;\n    })();\n\n    return vector_tile;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/mapbox/vector_tile.proto",
    "content": "syntax = \"proto2\";\n\npackage vector_tile;\n\nmessage Tile {\n\n    enum GeomType {\n\n        UNKNOWN = 0;\n        POINT = 1;\n        LINESTRING = 2;\n        POLYGON = 3;\n    }\n\n    message Value {\n\n        optional string string_value = 1;\n        optional float float_value = 2;\n        optional double double_value = 3;\n        optional int64 int_value = 4;\n        optional uint64 uint_value = 5;\n        optional sint64 sint_value = 6;\n        optional bool bool_value = 7;\n        extensions 8 to max;\n    }\n\n    message Feature {\n\n        optional uint64 id = 1 [ default = 0 ];\n        repeated uint32 tags = 2 [ packed = true ];\n        optional GeomType type = 3 [ default = UNKNOWN ];\n        repeated uint32 geometry = 4 [ packed = true ];\n    }\n\n    message Layer {\n\n        required uint32 version = 15 [ default = 1 ];\n        required string name = 1;\n        repeated Feature features = 2;\n        repeated string keys = 3;\n        repeated Value values = 4;\n        optional uint32 extent = 5 [ default = 4096 ];\n        extensions 16 to max;\n    }\n\n    repeated Layer layers = 3;\n\n    extensions 16 to 8191;\n}\n"
  },
  {
    "path": "tests/data/options_test.proto",
    "content": "syntax = \"proto3\";\n\nimport \"google/protobuf/descriptor.proto\";\n\npackage test;\n\n//Simple int32 based options (both single and repeated)\n//for fields and messages\n\nextend google.protobuf.FieldOptions {\n    repeated int32 fo_rep_int = 50000;\n    int32 fo_single_int = 50001;\n}\n\nextend google.protobuf.MessageOptions {\n    repeated int32 mo_rep_int = 50000;\n    int32 mo_single_int = 50001;\n}\n\nmessage TestFieldOptionsInt {\n    string field1 = 2 [(fo_rep_int) = 1, (fo_rep_int) = 2];\n    string field2 = 1 [(fo_single_int) = 3];\n}\n\nmessage TestMessageOptionsInt {\n    option (mo_rep_int) = 1;\n    option (mo_rep_int) = 2;\n    option (mo_single_int) = 3;\n}\n\n//Message based options including nested sub messages (both single and repeated)\n//for fields and messages\n\nmessage Msg {\n    int32 value = 1;\n    repeated int32 rep_value = 2;\n    SubMsg nested = 3;\n    repeated SubMsg rep_nested = 4;\n}\n\nmessage SubMsg {\n    string value = 1;\n    SubMsg nested = 2;\n}\n\nextend google.protobuf.FieldOptions {\n    repeated Msg fo_rep_msg = 50002;\n    Msg fo_single_msg = 50003;\n}\n\nextend google.protobuf.MessageOptions {\n    repeated Msg mo_rep_msg = 50002;\n    Msg mo_single_msg = 50003;\n}\n\nextend google.protobuf.MethodOptions {\n    repeated Msg method_rep_msg = 50002;\n    Msg method_single_msg = 50003;\n}\n\nmessage TestFieldOptionsMsg {\n    string field1 = 1 [(fo_rep_msg) = {value: 1 rep_value: 2 rep_value: 3}, (fo_rep_msg) = {value: 4 rep_value: 5 rep_value: 6}];\n    string field2 = 2 [(fo_single_msg).value = 7, (fo_single_msg).rep_value = 8, (fo_single_msg).rep_value = 9];\n}\n\nmessage TestMessageOptionsMsg {\n    option (mo_rep_msg) = {\n        value: 1\n        rep_value: 2\n        rep_value: 3\n    };\n    option (mo_rep_msg) = {\n        value: 4\n        rep_value: 5\n        rep_value: 6\n    };\n    option (mo_rep_msg) = {\n        value: 5\n        rep_value: [ 7, 8 ]\n    };\n    option (mo_single_msg).value = 7;\n    option (mo_single_msg).rep_value = 8;\n    option (mo_single_msg).rep_value = 9;\n}\n\nmessage TestFieldOptionsNested {\n    string field1 = 1 [(fo_rep_msg) = {value: 1 nested { nested {value: \"x\"} } rep_nested { value: \"y\"} rep_nested { value: \"z\" } rep_value: 3}, (fo_rep_msg) = { nested { value: \"w\" }}];\n    string field2 = 2 [(fo_single_msg).nested.value = \"x\", (fo_single_msg).rep_nested = {value : \"x\"}, (fo_single_msg).rep_nested = {value : \"y\"}];\n    string field3 = 3 [(fo_single_msg).nested = {value: \"x\" nested {nested{value: \"y\"}}}];\n}\n\nmessage TestMessageOptionsNested {\n    option (mo_rep_msg) = {\n        value: 1\n        nested {\n            nested {\n                value: \"x\"\n            }\n        }\n        rep_nested {\n            value: \"y\"\n        }\n        rep_nested {\n            value: \"z\"\n        }\n        rep_value: 3\n    };\n    option (mo_rep_msg) = {\n        nested {\n            value: \"w\"\n        }\n    };\n    option (mo_single_msg).nested.value = \"x\";\n    option (mo_single_msg).rep_nested = {value : \"x\" nested {nested{value: \"y\"}}};\n    option (mo_single_msg).rep_nested = {value : \"y\"};\n}\n\nservice TestOptionsService {\n    rpc TestOptionsRpc(Msg) returns (Msg) {\n        option (method_rep_msg) = {\n            value: 1\n            nested {\n                nested {\n                    value: \"x\"\n                }\n            }\n            rep_nested {\n                value: \"y\"\n            }\n            rep_nested {\n                value: \"z\"\n            }\n            rep_value: 3\n        };\n        option (method_rep_msg) = {\n            nested {\n                value: \"w\"\n            }\n        };\n        option (method_single_msg).nested.value = \"x\";\n        option (method_single_msg).rep_nested = {value : \"x\" nested {nested{value: \"y\"}}};\n        option (method_single_msg).rep_nested = {value : \"y\"};\n    }\n}\n"
  },
  {
    "path": "tests/data/package.d.ts",
    "content": "import * as $protobuf from \"../..\";\nexport interface IPackage {\n    name?: (string|null);\n    version?: (string|null);\n    versionScheme?: (string|null);\n    description?: (string|null);\n    author?: (string|null);\n    license?: (string|null);\n    repository?: (Package.IRepository|null);\n    bugs?: (string|null);\n    homepage?: (string|null);\n    keywords?: (string[]|null);\n    main?: (string|null);\n    bin?: ({ [k: string]: string }|null);\n    scripts?: ({ [k: string]: string }|null);\n    dependencies?: ({ [k: string]: string }|null);\n    devDependencies?: ({ [k: string]: string }|null);\n    types?: (string|null);\n    cliDependencies?: (string[]|null);\n}\n\nexport class Package implements IPackage {\n    constructor(properties?: IPackage);\n    public name: string;\n    public version: string;\n    public versionScheme: string;\n    public description: string;\n    public author: string;\n    public license: string;\n    public repository?: (Package.IRepository|null);\n    public bugs: string;\n    public homepage: string;\n    public keywords: string[];\n    public main: string;\n    public bin: { [k: string]: string };\n    public scripts: { [k: string]: string };\n    public dependencies: { [k: string]: string };\n    public devDependencies: { [k: string]: string };\n    public types: string;\n    public cliDependencies: string[];\n    public static create(properties?: IPackage): Package;\n    public static encode(message: IPackage, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IPackage, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Package;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Package;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): Package;\n    public static toObject(message: Package, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport namespace Package {\n\n    interface IRepository {\n        type?: (string|null);\n        url?: (string|null);\n    }\n\n    class Repository implements IRepository {\n        constructor(properties?: Package.IRepository);\n        public type: string;\n        public url: string;\n        public static create(properties?: Package.IRepository): Package.Repository;\n        public static encode(message: Package.IRepository, writer?: $protobuf.Writer): $protobuf.Writer;\n        public static encodeDelimited(message: Package.IRepository, writer?: $protobuf.Writer): $protobuf.Writer;\n        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): Package.Repository;\n        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): Package.Repository;\n        public static verify(message: { [k: string]: any }): (string|null);\n        public static fromObject(object: { [k: string]: any }): Package.Repository;\n        public static toObject(message: Package.Repository, options?: $protobuf.IConversionOptions): { [k: string]: any };\n        public toJSON(): { [k: string]: any };\n        public static getTypeUrl(typeUrlPrefix?: string): string;\n    }\n}\n"
  },
  {
    "path": "tests/data/package.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_package || ($protobuf.roots.test_package = {});\n\n$root.Package = (function() {\n\n    /**\n     * Properties of a Package.\n     * @exports IPackage\n     * @interface IPackage\n     * @property {string|null} [name] Package name\n     * @property {string|null} [version] Package version\n     * @property {string|null} [versionScheme] Package versionScheme\n     * @property {string|null} [description] Package description\n     * @property {string|null} [author] Package author\n     * @property {string|null} [license] Package license\n     * @property {Package.IRepository|null} [repository] Package repository\n     * @property {string|null} [bugs] Package bugs\n     * @property {string|null} [homepage] Package homepage\n     * @property {Array.<string>|null} [keywords] Package keywords\n     * @property {string|null} [main] Package main\n     * @property {Object.<string,string>|null} [bin] Package bin\n     * @property {Object.<string,string>|null} [scripts] Package scripts\n     * @property {Object.<string,string>|null} [dependencies] Package dependencies\n     * @property {Object.<string,string>|null} [devDependencies] Package devDependencies\n     * @property {string|null} [types] Package types\n     * @property {Array.<string>|null} [cliDependencies] Package cliDependencies\n     */\n\n    /**\n     * Constructs a new Package.\n     * @exports Package\n     * @classdesc Represents a Package.\n     * @implements IPackage\n     * @constructor\n     * @param {IPackage=} [properties] Properties to set\n     */\n    function Package(properties) {\n        this.keywords = [];\n        this.bin = {};\n        this.scripts = {};\n        this.dependencies = {};\n        this.devDependencies = {};\n        this.cliDependencies = [];\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * Package name.\n     * @member {string} name\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.name = \"\";\n\n    /**\n     * Package version.\n     * @member {string} version\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.version = \"\";\n\n    /**\n     * Package versionScheme.\n     * @member {string} versionScheme\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.versionScheme = \"\";\n\n    /**\n     * Package description.\n     * @member {string} description\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.description = \"\";\n\n    /**\n     * Package author.\n     * @member {string} author\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.author = \"\";\n\n    /**\n     * Package license.\n     * @member {string} license\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.license = \"\";\n\n    /**\n     * Package repository.\n     * @member {Package.IRepository|null|undefined} repository\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.repository = null;\n\n    /**\n     * Package bugs.\n     * @member {string} bugs\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.bugs = \"\";\n\n    /**\n     * Package homepage.\n     * @member {string} homepage\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.homepage = \"\";\n\n    /**\n     * Package keywords.\n     * @member {Array.<string>} keywords\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.keywords = $util.emptyArray;\n\n    /**\n     * Package main.\n     * @member {string} main\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.main = \"\";\n\n    /**\n     * Package bin.\n     * @member {Object.<string,string>} bin\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.bin = $util.emptyObject;\n\n    /**\n     * Package scripts.\n     * @member {Object.<string,string>} scripts\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.scripts = $util.emptyObject;\n\n    /**\n     * Package dependencies.\n     * @member {Object.<string,string>} dependencies\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.dependencies = $util.emptyObject;\n\n    /**\n     * Package devDependencies.\n     * @member {Object.<string,string>} devDependencies\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.devDependencies = $util.emptyObject;\n\n    /**\n     * Package types.\n     * @member {string} types\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.types = \"\";\n\n    /**\n     * Package cliDependencies.\n     * @member {Array.<string>} cliDependencies\n     * @memberof Package\n     * @instance\n     */\n    Package.prototype.cliDependencies = $util.emptyArray;\n\n    /**\n     * Creates a new Package instance using the specified properties.\n     * @function create\n     * @memberof Package\n     * @static\n     * @param {IPackage=} [properties] Properties to set\n     * @returns {Package} Package instance\n     */\n    Package.create = function create(properties) {\n        return new Package(properties);\n    };\n\n    /**\n     * Encodes the specified Package message. Does not implicitly {@link Package.verify|verify} messages.\n     * @function encode\n     * @memberof Package\n     * @static\n     * @param {IPackage} message Package message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Package.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n            writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n        if (message.version != null && Object.hasOwnProperty.call(message, \"version\"))\n            writer.uint32(/* id 2, wireType 2 =*/18).string(message.version);\n        if (message.description != null && Object.hasOwnProperty.call(message, \"description\"))\n            writer.uint32(/* id 3, wireType 2 =*/26).string(message.description);\n        if (message.author != null && Object.hasOwnProperty.call(message, \"author\"))\n            writer.uint32(/* id 4, wireType 2 =*/34).string(message.author);\n        if (message.license != null && Object.hasOwnProperty.call(message, \"license\"))\n            writer.uint32(/* id 5, wireType 2 =*/42).string(message.license);\n        if (message.repository != null && Object.hasOwnProperty.call(message, \"repository\"))\n            $root.Package.Repository.encode(message.repository, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n        if (message.bugs != null && Object.hasOwnProperty.call(message, \"bugs\"))\n            writer.uint32(/* id 7, wireType 2 =*/58).string(message.bugs);\n        if (message.homepage != null && Object.hasOwnProperty.call(message, \"homepage\"))\n            writer.uint32(/* id 8, wireType 2 =*/66).string(message.homepage);\n        if (message.keywords != null && message.keywords.length)\n            for (var i = 0; i < message.keywords.length; ++i)\n                writer.uint32(/* id 9, wireType 2 =*/74).string(message.keywords[i]);\n        if (message.main != null && Object.hasOwnProperty.call(message, \"main\"))\n            writer.uint32(/* id 10, wireType 2 =*/82).string(message.main);\n        if (message.bin != null && Object.hasOwnProperty.call(message, \"bin\"))\n            for (var keys = Object.keys(message.bin), i = 0; i < keys.length; ++i)\n                writer.uint32(/* id 11, wireType 2 =*/90).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.bin[keys[i]]).ldelim();\n        if (message.scripts != null && Object.hasOwnProperty.call(message, \"scripts\"))\n            for (var keys = Object.keys(message.scripts), i = 0; i < keys.length; ++i)\n                writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.scripts[keys[i]]).ldelim();\n        if (message.dependencies != null && Object.hasOwnProperty.call(message, \"dependencies\"))\n            for (var keys = Object.keys(message.dependencies), i = 0; i < keys.length; ++i)\n                writer.uint32(/* id 13, wireType 2 =*/106).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.dependencies[keys[i]]).ldelim();\n        if (message.devDependencies != null && Object.hasOwnProperty.call(message, \"devDependencies\"))\n            for (var keys = Object.keys(message.devDependencies), i = 0; i < keys.length; ++i)\n                writer.uint32(/* id 15, wireType 2 =*/122).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.devDependencies[keys[i]]).ldelim();\n        if (message.types != null && Object.hasOwnProperty.call(message, \"types\"))\n            writer.uint32(/* id 17, wireType 2 =*/138).string(message.types);\n        if (message.cliDependencies != null && message.cliDependencies.length)\n            for (var i = 0; i < message.cliDependencies.length; ++i)\n                writer.uint32(/* id 18, wireType 2 =*/146).string(message.cliDependencies[i]);\n        if (message.versionScheme != null && Object.hasOwnProperty.call(message, \"versionScheme\"))\n            writer.uint32(/* id 19, wireType 2 =*/154).string(message.versionScheme);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified Package message, length delimited. Does not implicitly {@link Package.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof Package\n     * @static\n     * @param {IPackage} message Package message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    Package.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a Package message from the specified reader or buffer.\n     * @function decode\n     * @memberof Package\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {Package} Package\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Package.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Package(), key, value;\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.name = reader.string();\n                break;\n            case 2:\n                message.version = reader.string();\n                break;\n            case 19:\n                message.versionScheme = reader.string();\n                break;\n            case 3:\n                message.description = reader.string();\n                break;\n            case 4:\n                message.author = reader.string();\n                break;\n            case 5:\n                message.license = reader.string();\n                break;\n            case 6:\n                message.repository = $root.Package.Repository.decode(reader, reader.uint32());\n                break;\n            case 7:\n                message.bugs = reader.string();\n                break;\n            case 8:\n                message.homepage = reader.string();\n                break;\n            case 9:\n                if (!(message.keywords && message.keywords.length))\n                    message.keywords = [];\n                message.keywords.push(reader.string());\n                break;\n            case 10:\n                message.main = reader.string();\n                break;\n            case 11:\n                if (message.bin === $util.emptyObject)\n                    message.bin = {};\n                var end2 = reader.uint32() + reader.pos;\n                key = \"\";\n                value = \"\";\n                while (reader.pos < end2) {\n                    var tag2 = reader.uint32();\n                    switch (tag2 >>> 3) {\n                    case 1:\n                        key = reader.string();\n                        break;\n                    case 2:\n                        value = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag2 & 7);\n                        break;\n                    }\n                }\n                message.bin[key] = value;\n                break;\n            case 12:\n                if (message.scripts === $util.emptyObject)\n                    message.scripts = {};\n                var end2 = reader.uint32() + reader.pos;\n                key = \"\";\n                value = \"\";\n                while (reader.pos < end2) {\n                    var tag2 = reader.uint32();\n                    switch (tag2 >>> 3) {\n                    case 1:\n                        key = reader.string();\n                        break;\n                    case 2:\n                        value = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag2 & 7);\n                        break;\n                    }\n                }\n                message.scripts[key] = value;\n                break;\n            case 13:\n                if (message.dependencies === $util.emptyObject)\n                    message.dependencies = {};\n                var end2 = reader.uint32() + reader.pos;\n                key = \"\";\n                value = \"\";\n                while (reader.pos < end2) {\n                    var tag2 = reader.uint32();\n                    switch (tag2 >>> 3) {\n                    case 1:\n                        key = reader.string();\n                        break;\n                    case 2:\n                        value = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag2 & 7);\n                        break;\n                    }\n                }\n                message.dependencies[key] = value;\n                break;\n            case 15:\n                if (message.devDependencies === $util.emptyObject)\n                    message.devDependencies = {};\n                var end2 = reader.uint32() + reader.pos;\n                key = \"\";\n                value = \"\";\n                while (reader.pos < end2) {\n                    var tag2 = reader.uint32();\n                    switch (tag2 >>> 3) {\n                    case 1:\n                        key = reader.string();\n                        break;\n                    case 2:\n                        value = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag2 & 7);\n                        break;\n                    }\n                }\n                message.devDependencies[key] = value;\n                break;\n            case 17:\n                message.types = reader.string();\n                break;\n            case 18:\n                if (!(message.cliDependencies && message.cliDependencies.length))\n                    message.cliDependencies = [];\n                message.cliDependencies.push(reader.string());\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a Package message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof Package\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {Package} Package\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    Package.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a Package message.\n     * @function verify\n     * @memberof Package\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    Package.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.name != null && message.hasOwnProperty(\"name\"))\n            if (!$util.isString(message.name))\n                return \"name: string expected\";\n        if (message.version != null && message.hasOwnProperty(\"version\"))\n            if (!$util.isString(message.version))\n                return \"version: string expected\";\n        if (message.versionScheme != null && message.hasOwnProperty(\"versionScheme\"))\n            if (!$util.isString(message.versionScheme))\n                return \"versionScheme: string expected\";\n        if (message.description != null && message.hasOwnProperty(\"description\"))\n            if (!$util.isString(message.description))\n                return \"description: string expected\";\n        if (message.author != null && message.hasOwnProperty(\"author\"))\n            if (!$util.isString(message.author))\n                return \"author: string expected\";\n        if (message.license != null && message.hasOwnProperty(\"license\"))\n            if (!$util.isString(message.license))\n                return \"license: string expected\";\n        if (message.repository != null && message.hasOwnProperty(\"repository\")) {\n            var error = $root.Package.Repository.verify(message.repository);\n            if (error)\n                return \"repository.\" + error;\n        }\n        if (message.bugs != null && message.hasOwnProperty(\"bugs\"))\n            if (!$util.isString(message.bugs))\n                return \"bugs: string expected\";\n        if (message.homepage != null && message.hasOwnProperty(\"homepage\"))\n            if (!$util.isString(message.homepage))\n                return \"homepage: string expected\";\n        if (message.keywords != null && message.hasOwnProperty(\"keywords\")) {\n            if (!Array.isArray(message.keywords))\n                return \"keywords: array expected\";\n            for (var i = 0; i < message.keywords.length; ++i)\n                if (!$util.isString(message.keywords[i]))\n                    return \"keywords: string[] expected\";\n        }\n        if (message.main != null && message.hasOwnProperty(\"main\"))\n            if (!$util.isString(message.main))\n                return \"main: string expected\";\n        if (message.bin != null && message.hasOwnProperty(\"bin\")) {\n            if (!$util.isObject(message.bin))\n                return \"bin: object expected\";\n            var key = Object.keys(message.bin);\n            for (var i = 0; i < key.length; ++i)\n                if (!$util.isString(message.bin[key[i]]))\n                    return \"bin: string{k:string} expected\";\n        }\n        if (message.scripts != null && message.hasOwnProperty(\"scripts\")) {\n            if (!$util.isObject(message.scripts))\n                return \"scripts: object expected\";\n            var key = Object.keys(message.scripts);\n            for (var i = 0; i < key.length; ++i)\n                if (!$util.isString(message.scripts[key[i]]))\n                    return \"scripts: string{k:string} expected\";\n        }\n        if (message.dependencies != null && message.hasOwnProperty(\"dependencies\")) {\n            if (!$util.isObject(message.dependencies))\n                return \"dependencies: object expected\";\n            var key = Object.keys(message.dependencies);\n            for (var i = 0; i < key.length; ++i)\n                if (!$util.isString(message.dependencies[key[i]]))\n                    return \"dependencies: string{k:string} expected\";\n        }\n        if (message.devDependencies != null && message.hasOwnProperty(\"devDependencies\")) {\n            if (!$util.isObject(message.devDependencies))\n                return \"devDependencies: object expected\";\n            var key = Object.keys(message.devDependencies);\n            for (var i = 0; i < key.length; ++i)\n                if (!$util.isString(message.devDependencies[key[i]]))\n                    return \"devDependencies: string{k:string} expected\";\n        }\n        if (message.types != null && message.hasOwnProperty(\"types\"))\n            if (!$util.isString(message.types))\n                return \"types: string expected\";\n        if (message.cliDependencies != null && message.hasOwnProperty(\"cliDependencies\")) {\n            if (!Array.isArray(message.cliDependencies))\n                return \"cliDependencies: array expected\";\n            for (var i = 0; i < message.cliDependencies.length; ++i)\n                if (!$util.isString(message.cliDependencies[i]))\n                    return \"cliDependencies: string[] expected\";\n        }\n        return null;\n    };\n\n    /**\n     * Creates a Package message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof Package\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {Package} Package\n     */\n    Package.fromObject = function fromObject(object) {\n        if (object instanceof $root.Package)\n            return object;\n        var message = new $root.Package();\n        if (object.name != null)\n            message.name = String(object.name);\n        if (object.version != null)\n            message.version = String(object.version);\n        if (object.versionScheme != null)\n            message.versionScheme = String(object.versionScheme);\n        if (object.description != null)\n            message.description = String(object.description);\n        if (object.author != null)\n            message.author = String(object.author);\n        if (object.license != null)\n            message.license = String(object.license);\n        if (object.repository != null) {\n            if (typeof object.repository !== \"object\")\n                throw TypeError(\".Package.repository: object expected\");\n            message.repository = $root.Package.Repository.fromObject(object.repository);\n        }\n        if (object.bugs != null)\n            message.bugs = String(object.bugs);\n        if (object.homepage != null)\n            message.homepage = String(object.homepage);\n        if (object.keywords) {\n            if (!Array.isArray(object.keywords))\n                throw TypeError(\".Package.keywords: array expected\");\n            message.keywords = [];\n            for (var i = 0; i < object.keywords.length; ++i)\n                message.keywords[i] = String(object.keywords[i]);\n        }\n        if (object.main != null)\n            message.main = String(object.main);\n        if (object.bin) {\n            if (typeof object.bin !== \"object\")\n                throw TypeError(\".Package.bin: object expected\");\n            message.bin = {};\n            for (var keys = Object.keys(object.bin), i = 0; i < keys.length; ++i)\n                message.bin[keys[i]] = String(object.bin[keys[i]]);\n        }\n        if (object.scripts) {\n            if (typeof object.scripts !== \"object\")\n                throw TypeError(\".Package.scripts: object expected\");\n            message.scripts = {};\n            for (var keys = Object.keys(object.scripts), i = 0; i < keys.length; ++i)\n                message.scripts[keys[i]] = String(object.scripts[keys[i]]);\n        }\n        if (object.dependencies) {\n            if (typeof object.dependencies !== \"object\")\n                throw TypeError(\".Package.dependencies: object expected\");\n            message.dependencies = {};\n            for (var keys = Object.keys(object.dependencies), i = 0; i < keys.length; ++i)\n                message.dependencies[keys[i]] = String(object.dependencies[keys[i]]);\n        }\n        if (object.devDependencies) {\n            if (typeof object.devDependencies !== \"object\")\n                throw TypeError(\".Package.devDependencies: object expected\");\n            message.devDependencies = {};\n            for (var keys = Object.keys(object.devDependencies), i = 0; i < keys.length; ++i)\n                message.devDependencies[keys[i]] = String(object.devDependencies[keys[i]]);\n        }\n        if (object.types != null)\n            message.types = String(object.types);\n        if (object.cliDependencies) {\n            if (!Array.isArray(object.cliDependencies))\n                throw TypeError(\".Package.cliDependencies: array expected\");\n            message.cliDependencies = [];\n            for (var i = 0; i < object.cliDependencies.length; ++i)\n                message.cliDependencies[i] = String(object.cliDependencies[i]);\n        }\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a Package message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof Package\n     * @static\n     * @param {Package} message Package\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    Package.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.arrays || options.defaults) {\n            object.keywords = [];\n            object.cliDependencies = [];\n        }\n        if (options.objects || options.defaults) {\n            object.bin = {};\n            object.scripts = {};\n            object.dependencies = {};\n            object.devDependencies = {};\n        }\n        if (options.defaults) {\n            object.name = \"\";\n            object.version = \"\";\n            object.description = \"\";\n            object.author = \"\";\n            object.license = \"\";\n            object.repository = null;\n            object.bugs = \"\";\n            object.homepage = \"\";\n            object.main = \"\";\n            object.types = \"\";\n            object.versionScheme = \"\";\n        }\n        if (message.name != null && message.hasOwnProperty(\"name\"))\n            object.name = message.name;\n        if (message.version != null && message.hasOwnProperty(\"version\"))\n            object.version = message.version;\n        if (message.description != null && message.hasOwnProperty(\"description\"))\n            object.description = message.description;\n        if (message.author != null && message.hasOwnProperty(\"author\"))\n            object.author = message.author;\n        if (message.license != null && message.hasOwnProperty(\"license\"))\n            object.license = message.license;\n        if (message.repository != null && message.hasOwnProperty(\"repository\"))\n            object.repository = $root.Package.Repository.toObject(message.repository, options);\n        if (message.bugs != null && message.hasOwnProperty(\"bugs\"))\n            object.bugs = message.bugs;\n        if (message.homepage != null && message.hasOwnProperty(\"homepage\"))\n            object.homepage = message.homepage;\n        if (message.keywords && message.keywords.length) {\n            object.keywords = [];\n            for (var j = 0; j < message.keywords.length; ++j)\n                object.keywords[j] = message.keywords[j];\n        }\n        if (message.main != null && message.hasOwnProperty(\"main\"))\n            object.main = message.main;\n        var keys2;\n        if (message.bin && (keys2 = Object.keys(message.bin)).length) {\n            object.bin = {};\n            for (var j = 0; j < keys2.length; ++j)\n                object.bin[keys2[j]] = message.bin[keys2[j]];\n        }\n        if (message.scripts && (keys2 = Object.keys(message.scripts)).length) {\n            object.scripts = {};\n            for (var j = 0; j < keys2.length; ++j)\n                object.scripts[keys2[j]] = message.scripts[keys2[j]];\n        }\n        if (message.dependencies && (keys2 = Object.keys(message.dependencies)).length) {\n            object.dependencies = {};\n            for (var j = 0; j < keys2.length; ++j)\n                object.dependencies[keys2[j]] = message.dependencies[keys2[j]];\n        }\n        if (message.devDependencies && (keys2 = Object.keys(message.devDependencies)).length) {\n            object.devDependencies = {};\n            for (var j = 0; j < keys2.length; ++j)\n                object.devDependencies[keys2[j]] = message.devDependencies[keys2[j]];\n        }\n        if (message.types != null && message.hasOwnProperty(\"types\"))\n            object.types = message.types;\n        if (message.cliDependencies && message.cliDependencies.length) {\n            object.cliDependencies = [];\n            for (var j = 0; j < message.cliDependencies.length; ++j)\n                object.cliDependencies[j] = message.cliDependencies[j];\n        }\n        if (message.versionScheme != null && message.hasOwnProperty(\"versionScheme\"))\n            object.versionScheme = message.versionScheme;\n        return object;\n    };\n\n    /**\n     * Converts this Package to JSON.\n     * @function toJSON\n     * @memberof Package\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    Package.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for Package\n     * @function getTypeUrl\n     * @memberof Package\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    Package.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/Package\";\n    };\n\n    Package.Repository = (function() {\n\n        /**\n         * Properties of a Repository.\n         * @memberof Package\n         * @interface IRepository\n         * @property {string|null} [type] Repository type\n         * @property {string|null} [url] Repository url\n         */\n\n        /**\n         * Constructs a new Repository.\n         * @memberof Package\n         * @classdesc Represents a Repository.\n         * @implements IRepository\n         * @constructor\n         * @param {Package.IRepository=} [properties] Properties to set\n         */\n        function Repository(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * Repository type.\n         * @member {string} type\n         * @memberof Package.Repository\n         * @instance\n         */\n        Repository.prototype.type = \"\";\n\n        /**\n         * Repository url.\n         * @member {string} url\n         * @memberof Package.Repository\n         * @instance\n         */\n        Repository.prototype.url = \"\";\n\n        /**\n         * Creates a new Repository instance using the specified properties.\n         * @function create\n         * @memberof Package.Repository\n         * @static\n         * @param {Package.IRepository=} [properties] Properties to set\n         * @returns {Package.Repository} Repository instance\n         */\n        Repository.create = function create(properties) {\n            return new Repository(properties);\n        };\n\n        /**\n         * Encodes the specified Repository message. Does not implicitly {@link Package.Repository.verify|verify} messages.\n         * @function encode\n         * @memberof Package.Repository\n         * @static\n         * @param {Package.IRepository} message Repository message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        Repository.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.type);\n            if (message.url != null && Object.hasOwnProperty.call(message, \"url\"))\n                writer.uint32(/* id 2, wireType 2 =*/18).string(message.url);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified Repository message, length delimited. Does not implicitly {@link Package.Repository.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof Package.Repository\n         * @static\n         * @param {Package.IRepository} message Repository message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        Repository.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a Repository message from the specified reader or buffer.\n         * @function decode\n         * @memberof Package.Repository\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {Package.Repository} Repository\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        Repository.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.Package.Repository();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.type = reader.string();\n                    break;\n                case 2:\n                    message.url = reader.string();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a Repository message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof Package.Repository\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {Package.Repository} Repository\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        Repository.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a Repository message.\n         * @function verify\n         * @memberof Package.Repository\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        Repository.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.type != null && message.hasOwnProperty(\"type\"))\n                if (!$util.isString(message.type))\n                    return \"type: string expected\";\n            if (message.url != null && message.hasOwnProperty(\"url\"))\n                if (!$util.isString(message.url))\n                    return \"url: string expected\";\n            return null;\n        };\n\n        /**\n         * Creates a Repository message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof Package.Repository\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {Package.Repository} Repository\n         */\n        Repository.fromObject = function fromObject(object) {\n            if (object instanceof $root.Package.Repository)\n                return object;\n            var message = new $root.Package.Repository();\n            if (object.type != null)\n                message.type = String(object.type);\n            if (object.url != null)\n                message.url = String(object.url);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a Repository message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof Package.Repository\n         * @static\n         * @param {Package.Repository} message Repository\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        Repository.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults) {\n                object.type = \"\";\n                object.url = \"\";\n            }\n            if (message.type != null && message.hasOwnProperty(\"type\"))\n                object.type = message.type;\n            if (message.url != null && message.hasOwnProperty(\"url\"))\n                object.url = message.url;\n            return object;\n        };\n\n        /**\n         * Converts this Repository to JSON.\n         * @function toJSON\n         * @memberof Package.Repository\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        Repository.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        /**\n         * Gets the default type url for Repository\n         * @function getTypeUrl\n         * @memberof Package.Repository\n         * @static\n         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n         * @returns {string} The default type url\n         */\n        Repository.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n            if (typeUrlPrefix === undefined) {\n                typeUrlPrefix = \"type.googleapis.com\";\n            }\n            return typeUrlPrefix + \"/Package.Repository\";\n        };\n\n        return Repository;\n    })();\n\n    return Package;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/package.proto",
    "content": "syntax = \"proto3\";\n\nmessage Package {\n    string name = 1;\n    string version = 2;\n    string versionScheme = 19;\n    string description = 3;\n    string author = 4;\n    string license = 5;\n\n    message Repository {\n        string type = 1;\n        string url = 2;\n    }\n\n    Repository repository = 6;\n    string bugs = 7;\n    string homepage = 8;\n    repeated string keywords = 9;\n    string main = 10;\n    map<string, string> bin = 11;\n    map<string, string> scripts = 12;\n    map<string, string> dependencies = 13;\n    // map<string, string> optionalDependencies = 14;\n    map<string, string> devDependencies = 15;\n    // map<string, bool>   browser = 16;\n    string types = 17;\n    repeated string cliDependencies = 18;\n}\n"
  },
  {
    "path": "tests/data/rpc-es6.d.ts",
    "content": "import * as $protobuf from \"../..\";\nexport class MyService extends $protobuf.rpc.Service {\n    constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n    public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;\n    public myMethod(request: IMyRequest, callback: MyService.MyMethodCallback): void;\n    public myMethod(request: IMyRequest): Promise<MyResponse>;\n}\n\nexport namespace MyService {\n\n    type MyMethodCallback = (error: (Error|null), response?: MyResponse) => void;\n}\n\nexport interface IMyRequest {\n    path?: (string|null);\n}\n\nexport class MyRequest implements IMyRequest {\n    constructor(properties?: IMyRequest);\n    public path: string;\n    public static create(properties?: IMyRequest): MyRequest;\n    public static encode(message: IMyRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMyRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MyRequest;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MyRequest;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): MyRequest;\n    public static toObject(message: MyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport interface IMyResponse {\n    status?: (number|null);\n}\n\nexport class MyResponse implements IMyResponse {\n    constructor(properties?: IMyResponse);\n    public status: number;\n    public static create(properties?: IMyResponse): MyResponse;\n    public static encode(message: IMyResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMyResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MyResponse;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MyResponse;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): MyResponse;\n    public static toObject(message: MyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n"
  },
  {
    "path": "tests/data/rpc-es6.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\nimport * as $protobuf from \"../../minimal\";\n\n// Common aliases\nconst $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nconst $root = $protobuf.roots.test_rpc || ($protobuf.roots.test_rpc = {});\n\nexport const MyService = $root.MyService = (() => {\n\n    /**\n     * Constructs a new MyService service.\n     * @exports MyService\n     * @classdesc Represents a MyService\n     * @extends $protobuf.rpc.Service\n     * @constructor\n     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n     */\n    function MyService(rpcImpl, requestDelimited, responseDelimited) {\n        $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n    }\n\n    (MyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MyService;\n\n    /**\n     * Creates new MyService service using the specified rpc implementation.\n     * @function create\n     * @memberof MyService\n     * @static\n     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n     * @returns {MyService} RPC service. Useful where requests and/or responses are streamed.\n     */\n    MyService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n        return new this(rpcImpl, requestDelimited, responseDelimited);\n    };\n\n    /**\n     * Callback as used by {@link MyService#myMethod}.\n     * @memberof MyService\n     * @typedef MyMethodCallback\n     * @type {function}\n     * @param {Error|null} error Error, if any\n     * @param {MyResponse} [response] MyResponse\n     */\n\n    /**\n     * Calls MyMethod.\n     * @function myMethod\n     * @memberof MyService\n     * @instance\n     * @param {IMyRequest} request MyRequest message or plain object\n     * @param {MyService.MyMethodCallback} callback Node-style callback called with the error, if any, and MyResponse\n     * @returns {undefined}\n     * @variation 1\n     */\n    Object.defineProperty(MyService.prototype.myMethod = function myMethod(request, callback) {\n        return this.rpcCall(myMethod, $root.MyRequest, $root.MyResponse, request, callback);\n    }, \"name\", { value: \"MyMethod\" });\n\n    /**\n     * Calls MyMethod.\n     * @function myMethod\n     * @memberof MyService\n     * @instance\n     * @param {IMyRequest} request MyRequest message or plain object\n     * @returns {Promise<MyResponse>} Promise\n     * @variation 2\n     */\n\n    return MyService;\n})();\n\nexport const MyRequest = $root.MyRequest = (() => {\n\n    /**\n     * Properties of a MyRequest.\n     * @exports IMyRequest\n     * @interface IMyRequest\n     * @property {string|null} [path] MyRequest path\n     */\n\n    /**\n     * Constructs a new MyRequest.\n     * @exports MyRequest\n     * @classdesc Represents a MyRequest.\n     * @implements IMyRequest\n     * @constructor\n     * @param {IMyRequest=} [properties] Properties to set\n     */\n    function MyRequest(properties) {\n        if (properties)\n            for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * MyRequest path.\n     * @member {string} path\n     * @memberof MyRequest\n     * @instance\n     */\n    MyRequest.prototype.path = \"\";\n\n    /**\n     * Creates a new MyRequest instance using the specified properties.\n     * @function create\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest=} [properties] Properties to set\n     * @returns {MyRequest} MyRequest instance\n     */\n    MyRequest.create = function create(properties) {\n        return new MyRequest(properties);\n    };\n\n    /**\n     * Encodes the specified MyRequest message. Does not implicitly {@link MyRequest.verify|verify} messages.\n     * @function encode\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest} message MyRequest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyRequest.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.path != null && Object.hasOwnProperty.call(message, \"path\"))\n            writer.uint32(/* id 1, wireType 2 =*/10).string(message.path);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified MyRequest message, length delimited. Does not implicitly {@link MyRequest.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest} message MyRequest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyRequest.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a MyRequest message from the specified reader or buffer.\n     * @function decode\n     * @memberof MyRequest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {MyRequest} MyRequest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyRequest.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        let end = length === undefined ? reader.len : reader.pos + length, message = new $root.MyRequest();\n        while (reader.pos < end) {\n            let tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.path = reader.string();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a MyRequest message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof MyRequest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {MyRequest} MyRequest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyRequest.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a MyRequest message.\n     * @function verify\n     * @memberof MyRequest\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    MyRequest.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.path != null && message.hasOwnProperty(\"path\"))\n            if (!$util.isString(message.path))\n                return \"path: string expected\";\n        return null;\n    };\n\n    /**\n     * Creates a MyRequest message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof MyRequest\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {MyRequest} MyRequest\n     */\n    MyRequest.fromObject = function fromObject(object) {\n        if (object instanceof $root.MyRequest)\n            return object;\n        let message = new $root.MyRequest();\n        if (object.path != null)\n            message.path = String(object.path);\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a MyRequest message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof MyRequest\n     * @static\n     * @param {MyRequest} message MyRequest\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    MyRequest.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        let object = {};\n        if (options.defaults)\n            object.path = \"\";\n        if (message.path != null && message.hasOwnProperty(\"path\"))\n            object.path = message.path;\n        return object;\n    };\n\n    /**\n     * Converts this MyRequest to JSON.\n     * @function toJSON\n     * @memberof MyRequest\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    MyRequest.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for MyRequest\n     * @function getTypeUrl\n     * @memberof MyRequest\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    MyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/MyRequest\";\n    };\n\n    return MyRequest;\n})();\n\nexport const MyResponse = $root.MyResponse = (() => {\n\n    /**\n     * Properties of a MyResponse.\n     * @exports IMyResponse\n     * @interface IMyResponse\n     * @property {number|null} [status] MyResponse status\n     */\n\n    /**\n     * Constructs a new MyResponse.\n     * @exports MyResponse\n     * @classdesc Represents a MyResponse.\n     * @implements IMyResponse\n     * @constructor\n     * @param {IMyResponse=} [properties] Properties to set\n     */\n    function MyResponse(properties) {\n        if (properties)\n            for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * MyResponse status.\n     * @member {number} status\n     * @memberof MyResponse\n     * @instance\n     */\n    MyResponse.prototype.status = 0;\n\n    /**\n     * Creates a new MyResponse instance using the specified properties.\n     * @function create\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse=} [properties] Properties to set\n     * @returns {MyResponse} MyResponse instance\n     */\n    MyResponse.create = function create(properties) {\n        return new MyResponse(properties);\n    };\n\n    /**\n     * Encodes the specified MyResponse message. Does not implicitly {@link MyResponse.verify|verify} messages.\n     * @function encode\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse} message MyResponse message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyResponse.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.status != null && Object.hasOwnProperty.call(message, \"status\"))\n            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified MyResponse message, length delimited. Does not implicitly {@link MyResponse.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse} message MyResponse message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyResponse.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a MyResponse message from the specified reader or buffer.\n     * @function decode\n     * @memberof MyResponse\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {MyResponse} MyResponse\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyResponse.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        let end = length === undefined ? reader.len : reader.pos + length, message = new $root.MyResponse();\n        while (reader.pos < end) {\n            let tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 2:\n                message.status = reader.int32();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a MyResponse message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof MyResponse\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {MyResponse} MyResponse\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyResponse.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a MyResponse message.\n     * @function verify\n     * @memberof MyResponse\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    MyResponse.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.status != null && message.hasOwnProperty(\"status\"))\n            if (!$util.isInteger(message.status))\n                return \"status: integer expected\";\n        return null;\n    };\n\n    /**\n     * Creates a MyResponse message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof MyResponse\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {MyResponse} MyResponse\n     */\n    MyResponse.fromObject = function fromObject(object) {\n        if (object instanceof $root.MyResponse)\n            return object;\n        let message = new $root.MyResponse();\n        if (object.status != null)\n            message.status = object.status | 0;\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a MyResponse message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof MyResponse\n     * @static\n     * @param {MyResponse} message MyResponse\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    MyResponse.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        let object = {};\n        if (options.defaults)\n            object.status = 0;\n        if (message.status != null && message.hasOwnProperty(\"status\"))\n            object.status = message.status;\n        return object;\n    };\n\n    /**\n     * Converts this MyResponse to JSON.\n     * @function toJSON\n     * @memberof MyResponse\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    MyResponse.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for MyResponse\n     * @function getTypeUrl\n     * @memberof MyResponse\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    MyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/MyResponse\";\n    };\n\n    return MyResponse;\n})();\n\nexport { $root as default };\n"
  },
  {
    "path": "tests/data/rpc-reserved.d.ts",
    "content": "import * as $protobuf from \"../..\";\nexport class MyService extends $protobuf.rpc.Service {\n    constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n    public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;\n    public delete(request: IMyRequest, callback: MyService.DeleteCallback): void;\n    public delete(request: IMyRequest): Promise<MyResponse>;\n}\n\nexport namespace MyService {\n\n    type DeleteCallback = (error: (Error|null), response?: MyResponse) => void;\n}\n\nexport interface IMyRequest {\n    path?: (string|null);\n}\n\nexport class MyRequest implements IMyRequest {\n    constructor(properties?: IMyRequest);\n    public path: string;\n    public static create(properties?: IMyRequest): MyRequest;\n    public static encode(message: IMyRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMyRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MyRequest;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MyRequest;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): MyRequest;\n    public static toObject(message: MyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport interface IMyResponse {\n    status?: (number|null);\n}\n\nexport class MyResponse implements IMyResponse {\n    constructor(properties?: IMyResponse);\n    public status: number;\n    public static create(properties?: IMyResponse): MyResponse;\n    public static encode(message: IMyResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMyResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MyResponse;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MyResponse;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): MyResponse;\n    public static toObject(message: MyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n"
  },
  {
    "path": "tests/data/rpc-reserved.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots[\"test_rpc-reserved\"] || ($protobuf.roots[\"test_rpc-reserved\"] = {});\n\n$root.MyService = (function() {\n\n    /**\n     * Constructs a new MyService service.\n     * @exports MyService\n     * @classdesc Represents a MyService\n     * @extends $protobuf.rpc.Service\n     * @constructor\n     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n     */\n    function MyService(rpcImpl, requestDelimited, responseDelimited) {\n        $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n    }\n\n    (MyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MyService;\n\n    /**\n     * Creates new MyService service using the specified rpc implementation.\n     * @function create\n     * @memberof MyService\n     * @static\n     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n     * @returns {MyService} RPC service. Useful where requests and/or responses are streamed.\n     */\n    MyService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n        return new this(rpcImpl, requestDelimited, responseDelimited);\n    };\n\n    /**\n     * Callback as used by {@link MyService#delete_}.\n     * @memberof MyService\n     * @typedef DeleteCallback\n     * @type {function}\n     * @param {Error|null} error Error, if any\n     * @param {MyResponse} [response] MyResponse\n     */\n\n    /**\n     * Calls Delete.\n     * @function delete\n     * @memberof MyService\n     * @instance\n     * @param {IMyRequest} request MyRequest message or plain object\n     * @param {MyService.DeleteCallback} callback Node-style callback called with the error, if any, and MyResponse\n     * @returns {undefined}\n     * @variation 1\n     */\n    Object.defineProperty(MyService.prototype[\"delete\"] = function delete_(request, callback) {\n        return this.rpcCall(delete_, $root.MyRequest, $root.MyResponse, request, callback);\n    }, \"name\", { value: \"Delete\" });\n\n    /**\n     * Calls Delete.\n     * @function delete\n     * @memberof MyService\n     * @instance\n     * @param {IMyRequest} request MyRequest message or plain object\n     * @returns {Promise<MyResponse>} Promise\n     * @variation 2\n     */\n\n    return MyService;\n})();\n\n$root.MyRequest = (function() {\n\n    /**\n     * Properties of a MyRequest.\n     * @exports IMyRequest\n     * @interface IMyRequest\n     * @property {string|null} [path] MyRequest path\n     */\n\n    /**\n     * Constructs a new MyRequest.\n     * @exports MyRequest\n     * @classdesc Represents a MyRequest.\n     * @implements IMyRequest\n     * @constructor\n     * @param {IMyRequest=} [properties] Properties to set\n     */\n    function MyRequest(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * MyRequest path.\n     * @member {string} path\n     * @memberof MyRequest\n     * @instance\n     */\n    MyRequest.prototype.path = \"\";\n\n    /**\n     * Creates a new MyRequest instance using the specified properties.\n     * @function create\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest=} [properties] Properties to set\n     * @returns {MyRequest} MyRequest instance\n     */\n    MyRequest.create = function create(properties) {\n        return new MyRequest(properties);\n    };\n\n    /**\n     * Encodes the specified MyRequest message. Does not implicitly {@link MyRequest.verify|verify} messages.\n     * @function encode\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest} message MyRequest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyRequest.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.path != null && Object.hasOwnProperty.call(message, \"path\"))\n            writer.uint32(/* id 1, wireType 2 =*/10).string(message.path);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified MyRequest message, length delimited. Does not implicitly {@link MyRequest.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest} message MyRequest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyRequest.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a MyRequest message from the specified reader or buffer.\n     * @function decode\n     * @memberof MyRequest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {MyRequest} MyRequest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyRequest.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MyRequest();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.path = reader.string();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a MyRequest message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof MyRequest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {MyRequest} MyRequest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyRequest.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a MyRequest message.\n     * @function verify\n     * @memberof MyRequest\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    MyRequest.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.path != null && message.hasOwnProperty(\"path\"))\n            if (!$util.isString(message.path))\n                return \"path: string expected\";\n        return null;\n    };\n\n    /**\n     * Creates a MyRequest message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof MyRequest\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {MyRequest} MyRequest\n     */\n    MyRequest.fromObject = function fromObject(object) {\n        if (object instanceof $root.MyRequest)\n            return object;\n        var message = new $root.MyRequest();\n        if (object.path != null)\n            message.path = String(object.path);\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a MyRequest message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof MyRequest\n     * @static\n     * @param {MyRequest} message MyRequest\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    MyRequest.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.defaults)\n            object.path = \"\";\n        if (message.path != null && message.hasOwnProperty(\"path\"))\n            object.path = message.path;\n        return object;\n    };\n\n    /**\n     * Converts this MyRequest to JSON.\n     * @function toJSON\n     * @memberof MyRequest\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    MyRequest.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for MyRequest\n     * @function getTypeUrl\n     * @memberof MyRequest\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    MyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/MyRequest\";\n    };\n\n    return MyRequest;\n})();\n\n$root.MyResponse = (function() {\n\n    /**\n     * Properties of a MyResponse.\n     * @exports IMyResponse\n     * @interface IMyResponse\n     * @property {number|null} [status] MyResponse status\n     */\n\n    /**\n     * Constructs a new MyResponse.\n     * @exports MyResponse\n     * @classdesc Represents a MyResponse.\n     * @implements IMyResponse\n     * @constructor\n     * @param {IMyResponse=} [properties] Properties to set\n     */\n    function MyResponse(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * MyResponse status.\n     * @member {number} status\n     * @memberof MyResponse\n     * @instance\n     */\n    MyResponse.prototype.status = 0;\n\n    /**\n     * Creates a new MyResponse instance using the specified properties.\n     * @function create\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse=} [properties] Properties to set\n     * @returns {MyResponse} MyResponse instance\n     */\n    MyResponse.create = function create(properties) {\n        return new MyResponse(properties);\n    };\n\n    /**\n     * Encodes the specified MyResponse message. Does not implicitly {@link MyResponse.verify|verify} messages.\n     * @function encode\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse} message MyResponse message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyResponse.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.status != null && Object.hasOwnProperty.call(message, \"status\"))\n            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified MyResponse message, length delimited. Does not implicitly {@link MyResponse.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse} message MyResponse message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyResponse.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a MyResponse message from the specified reader or buffer.\n     * @function decode\n     * @memberof MyResponse\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {MyResponse} MyResponse\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyResponse.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MyResponse();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 2:\n                message.status = reader.int32();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a MyResponse message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof MyResponse\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {MyResponse} MyResponse\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyResponse.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a MyResponse message.\n     * @function verify\n     * @memberof MyResponse\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    MyResponse.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.status != null && message.hasOwnProperty(\"status\"))\n            if (!$util.isInteger(message.status))\n                return \"status: integer expected\";\n        return null;\n    };\n\n    /**\n     * Creates a MyResponse message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof MyResponse\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {MyResponse} MyResponse\n     */\n    MyResponse.fromObject = function fromObject(object) {\n        if (object instanceof $root.MyResponse)\n            return object;\n        var message = new $root.MyResponse();\n        if (object.status != null)\n            message.status = object.status | 0;\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a MyResponse message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof MyResponse\n     * @static\n     * @param {MyResponse} message MyResponse\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    MyResponse.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.defaults)\n            object.status = 0;\n        if (message.status != null && message.hasOwnProperty(\"status\"))\n            object.status = message.status;\n        return object;\n    };\n\n    /**\n     * Converts this MyResponse to JSON.\n     * @function toJSON\n     * @memberof MyResponse\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    MyResponse.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for MyResponse\n     * @function getTypeUrl\n     * @memberof MyResponse\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    MyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/MyResponse\";\n    };\n\n    return MyResponse;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/rpc-reserved.proto",
    "content": "syntax = \"proto3\";\n\nservice MyService {\n  rpc Delete (MyRequest) returns (MyResponse);\n}\n\nmessage MyRequest {\n  string path = 1;\n}\n\nmessage MyResponse {\n  int32 status = 2;\n}\n"
  },
  {
    "path": "tests/data/rpc.d.ts",
    "content": "import * as $protobuf from \"../..\";\nexport class MyService extends $protobuf.rpc.Service {\n    constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean);\n    public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): MyService;\n    public myMethod(request: IMyRequest, callback: MyService.MyMethodCallback): void;\n    public myMethod(request: IMyRequest): Promise<MyResponse>;\n}\n\nexport namespace MyService {\n\n    type MyMethodCallback = (error: (Error|null), response?: MyResponse) => void;\n}\n\nexport interface IMyRequest {\n    path?: (string|null);\n}\n\nexport class MyRequest implements IMyRequest {\n    constructor(properties?: IMyRequest);\n    public path: string;\n    public static create(properties?: IMyRequest): MyRequest;\n    public static encode(message: IMyRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMyRequest, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MyRequest;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MyRequest;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): MyRequest;\n    public static toObject(message: MyRequest, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n\nexport interface IMyResponse {\n    status?: (number|null);\n}\n\nexport class MyResponse implements IMyResponse {\n    constructor(properties?: IMyResponse);\n    public status: number;\n    public static create(properties?: IMyResponse): MyResponse;\n    public static encode(message: IMyResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static encodeDelimited(message: IMyResponse, writer?: $protobuf.Writer): $protobuf.Writer;\n    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): MyResponse;\n    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): MyResponse;\n    public static verify(message: { [k: string]: any }): (string|null);\n    public static fromObject(object: { [k: string]: any }): MyResponse;\n    public static toObject(message: MyResponse, options?: $protobuf.IConversionOptions): { [k: string]: any };\n    public toJSON(): { [k: string]: any };\n    public static getTypeUrl(typeUrlPrefix?: string): string;\n}\n"
  },
  {
    "path": "tests/data/rpc.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_rpc || ($protobuf.roots.test_rpc = {});\n\n$root.MyService = (function() {\n\n    /**\n     * Constructs a new MyService service.\n     * @exports MyService\n     * @classdesc Represents a MyService\n     * @extends $protobuf.rpc.Service\n     * @constructor\n     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n     */\n    function MyService(rpcImpl, requestDelimited, responseDelimited) {\n        $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited);\n    }\n\n    (MyService.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = MyService;\n\n    /**\n     * Creates new MyService service using the specified rpc implementation.\n     * @function create\n     * @memberof MyService\n     * @static\n     * @param {$protobuf.RPCImpl} rpcImpl RPC implementation\n     * @param {boolean} [requestDelimited=false] Whether requests are length-delimited\n     * @param {boolean} [responseDelimited=false] Whether responses are length-delimited\n     * @returns {MyService} RPC service. Useful where requests and/or responses are streamed.\n     */\n    MyService.create = function create(rpcImpl, requestDelimited, responseDelimited) {\n        return new this(rpcImpl, requestDelimited, responseDelimited);\n    };\n\n    /**\n     * Callback as used by {@link MyService#myMethod}.\n     * @memberof MyService\n     * @typedef MyMethodCallback\n     * @type {function}\n     * @param {Error|null} error Error, if any\n     * @param {MyResponse} [response] MyResponse\n     */\n\n    /**\n     * Calls MyMethod.\n     * @function myMethod\n     * @memberof MyService\n     * @instance\n     * @param {IMyRequest} request MyRequest message or plain object\n     * @param {MyService.MyMethodCallback} callback Node-style callback called with the error, if any, and MyResponse\n     * @returns {undefined}\n     * @variation 1\n     */\n    Object.defineProperty(MyService.prototype.myMethod = function myMethod(request, callback) {\n        return this.rpcCall(myMethod, $root.MyRequest, $root.MyResponse, request, callback);\n    }, \"name\", { value: \"MyMethod\" });\n\n    /**\n     * Calls MyMethod.\n     * @function myMethod\n     * @memberof MyService\n     * @instance\n     * @param {IMyRequest} request MyRequest message or plain object\n     * @returns {Promise<MyResponse>} Promise\n     * @variation 2\n     */\n\n    return MyService;\n})();\n\n$root.MyRequest = (function() {\n\n    /**\n     * Properties of a MyRequest.\n     * @exports IMyRequest\n     * @interface IMyRequest\n     * @property {string|null} [path] MyRequest path\n     */\n\n    /**\n     * Constructs a new MyRequest.\n     * @exports MyRequest\n     * @classdesc Represents a MyRequest.\n     * @implements IMyRequest\n     * @constructor\n     * @param {IMyRequest=} [properties] Properties to set\n     */\n    function MyRequest(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * MyRequest path.\n     * @member {string} path\n     * @memberof MyRequest\n     * @instance\n     */\n    MyRequest.prototype.path = \"\";\n\n    /**\n     * Creates a new MyRequest instance using the specified properties.\n     * @function create\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest=} [properties] Properties to set\n     * @returns {MyRequest} MyRequest instance\n     */\n    MyRequest.create = function create(properties) {\n        return new MyRequest(properties);\n    };\n\n    /**\n     * Encodes the specified MyRequest message. Does not implicitly {@link MyRequest.verify|verify} messages.\n     * @function encode\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest} message MyRequest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyRequest.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.path != null && Object.hasOwnProperty.call(message, \"path\"))\n            writer.uint32(/* id 1, wireType 2 =*/10).string(message.path);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified MyRequest message, length delimited. Does not implicitly {@link MyRequest.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof MyRequest\n     * @static\n     * @param {IMyRequest} message MyRequest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyRequest.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a MyRequest message from the specified reader or buffer.\n     * @function decode\n     * @memberof MyRequest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {MyRequest} MyRequest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyRequest.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MyRequest();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.path = reader.string();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a MyRequest message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof MyRequest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {MyRequest} MyRequest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyRequest.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a MyRequest message.\n     * @function verify\n     * @memberof MyRequest\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    MyRequest.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.path != null && message.hasOwnProperty(\"path\"))\n            if (!$util.isString(message.path))\n                return \"path: string expected\";\n        return null;\n    };\n\n    /**\n     * Creates a MyRequest message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof MyRequest\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {MyRequest} MyRequest\n     */\n    MyRequest.fromObject = function fromObject(object) {\n        if (object instanceof $root.MyRequest)\n            return object;\n        var message = new $root.MyRequest();\n        if (object.path != null)\n            message.path = String(object.path);\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a MyRequest message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof MyRequest\n     * @static\n     * @param {MyRequest} message MyRequest\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    MyRequest.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.defaults)\n            object.path = \"\";\n        if (message.path != null && message.hasOwnProperty(\"path\"))\n            object.path = message.path;\n        return object;\n    };\n\n    /**\n     * Converts this MyRequest to JSON.\n     * @function toJSON\n     * @memberof MyRequest\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    MyRequest.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for MyRequest\n     * @function getTypeUrl\n     * @memberof MyRequest\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    MyRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/MyRequest\";\n    };\n\n    return MyRequest;\n})();\n\n$root.MyResponse = (function() {\n\n    /**\n     * Properties of a MyResponse.\n     * @exports IMyResponse\n     * @interface IMyResponse\n     * @property {number|null} [status] MyResponse status\n     */\n\n    /**\n     * Constructs a new MyResponse.\n     * @exports MyResponse\n     * @classdesc Represents a MyResponse.\n     * @implements IMyResponse\n     * @constructor\n     * @param {IMyResponse=} [properties] Properties to set\n     */\n    function MyResponse(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * MyResponse status.\n     * @member {number} status\n     * @memberof MyResponse\n     * @instance\n     */\n    MyResponse.prototype.status = 0;\n\n    /**\n     * Creates a new MyResponse instance using the specified properties.\n     * @function create\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse=} [properties] Properties to set\n     * @returns {MyResponse} MyResponse instance\n     */\n    MyResponse.create = function create(properties) {\n        return new MyResponse(properties);\n    };\n\n    /**\n     * Encodes the specified MyResponse message. Does not implicitly {@link MyResponse.verify|verify} messages.\n     * @function encode\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse} message MyResponse message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyResponse.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.status != null && Object.hasOwnProperty.call(message, \"status\"))\n            writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status);\n        return writer;\n    };\n\n    /**\n     * Encodes the specified MyResponse message, length delimited. Does not implicitly {@link MyResponse.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof MyResponse\n     * @static\n     * @param {IMyResponse} message MyResponse message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    MyResponse.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a MyResponse message from the specified reader or buffer.\n     * @function decode\n     * @memberof MyResponse\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {MyResponse} MyResponse\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyResponse.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.MyResponse();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 2:\n                message.status = reader.int32();\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a MyResponse message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof MyResponse\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {MyResponse} MyResponse\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    MyResponse.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a MyResponse message.\n     * @function verify\n     * @memberof MyResponse\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    MyResponse.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.status != null && message.hasOwnProperty(\"status\"))\n            if (!$util.isInteger(message.status))\n                return \"status: integer expected\";\n        return null;\n    };\n\n    /**\n     * Creates a MyResponse message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof MyResponse\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {MyResponse} MyResponse\n     */\n    MyResponse.fromObject = function fromObject(object) {\n        if (object instanceof $root.MyResponse)\n            return object;\n        var message = new $root.MyResponse();\n        if (object.status != null)\n            message.status = object.status | 0;\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a MyResponse message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof MyResponse\n     * @static\n     * @param {MyResponse} message MyResponse\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    MyResponse.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.defaults)\n            object.status = 0;\n        if (message.status != null && message.hasOwnProperty(\"status\"))\n            object.status = message.status;\n        return object;\n    };\n\n    /**\n     * Converts this MyResponse to JSON.\n     * @function toJSON\n     * @memberof MyResponse\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    MyResponse.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for MyResponse\n     * @function getTypeUrl\n     * @memberof MyResponse\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    MyResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/MyResponse\";\n    };\n\n    return MyResponse;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/rpc.proto",
    "content": "syntax = \"proto3\";\n\nservice MyService {\n    rpc MyMethod (MyRequest) returns (MyResponse);\n}\n\nmessage MyRequest {\n    string path = 1;\n}\n\nmessage MyResponse {\n    int32 status = 2;\n}\n"
  },
  {
    "path": "tests/data/rpc.ts",
    "content": "import * as test from \"./rpc.js\";\n"
  },
  {
    "path": "tests/data/test.d.ts",
    "content": "import * as $protobuf from \"../..\";\nimport Long from \"long\";\n\nexport namespace jspb {\n\n    namespace test {\n\n        interface IEmpty {\n        }\n\n        class Empty implements IEmpty {\n            constructor(properties?: jspb.test.IEmpty);\n            public static create(properties?: jspb.test.IEmpty): jspb.test.Empty;\n            public static encode(message: jspb.test.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IEmpty, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Empty;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Empty;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.Empty;\n            public static toObject(message: jspb.test.Empty, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        enum OuterEnum {\n            FOO = 1,\n            BAR = 2\n        }\n\n        interface IEnumContainer {\n            outerEnum?: (jspb.test.OuterEnum|null);\n        }\n\n        class EnumContainer implements IEnumContainer {\n            constructor(properties?: jspb.test.IEnumContainer);\n            public outerEnum: jspb.test.OuterEnum;\n            public static create(properties?: jspb.test.IEnumContainer): jspb.test.EnumContainer;\n            public static encode(message: jspb.test.IEnumContainer, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IEnumContainer, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.EnumContainer;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.EnumContainer;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.EnumContainer;\n            public static toObject(message: jspb.test.EnumContainer, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ISimple1 {\n            aString: string;\n            aRepeatedString?: (string[]|null);\n            aBoolean?: (boolean|null);\n        }\n\n        class Simple1 implements ISimple1 {\n            constructor(properties?: jspb.test.ISimple1);\n            public aString: string;\n            public aRepeatedString: string[];\n            public aBoolean: boolean;\n            public static create(properties?: jspb.test.ISimple1): jspb.test.Simple1;\n            public static encode(message: jspb.test.ISimple1, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ISimple1, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Simple1;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Simple1;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.Simple1;\n            public static toObject(message: jspb.test.Simple1, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ISimple2 {\n            aString: string;\n            aRepeatedString?: (string[]|null);\n        }\n\n        class Simple2 implements ISimple2 {\n            constructor(properties?: jspb.test.ISimple2);\n            public aString: string;\n            public aRepeatedString: string[];\n            public static create(properties?: jspb.test.ISimple2): jspb.test.Simple2;\n            public static encode(message: jspb.test.ISimple2, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ISimple2, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Simple2;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Simple2;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.Simple2;\n            public static toObject(message: jspb.test.Simple2, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ISpecialCases {\n            normal: string;\n            \"default\": string;\n            \"function\": string;\n            \"var\": string;\n        }\n\n        class SpecialCases implements ISpecialCases {\n            constructor(properties?: jspb.test.ISpecialCases);\n            public normal: string;\n            public default: string;\n            public function: string;\n            public var: string;\n            public static create(properties?: jspb.test.ISpecialCases): jspb.test.SpecialCases;\n            public static encode(message: jspb.test.ISpecialCases, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ISpecialCases, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.SpecialCases;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.SpecialCases;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.SpecialCases;\n            public static toObject(message: jspb.test.SpecialCases, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IOptionalFields {\n            aString?: (string|null);\n            aBool: boolean;\n            aNestedMessage?: (jspb.test.OptionalFields.INested|null);\n            aRepeatedMessage?: (jspb.test.OptionalFields.INested[]|null);\n            aRepeatedString?: (string[]|null);\n        }\n\n        class OptionalFields implements IOptionalFields {\n            constructor(properties?: jspb.test.IOptionalFields);\n            public aString: string;\n            public aBool: boolean;\n            public aNestedMessage?: (jspb.test.OptionalFields.INested|null);\n            public aRepeatedMessage: jspb.test.OptionalFields.INested[];\n            public aRepeatedString: string[];\n            public static create(properties?: jspb.test.IOptionalFields): jspb.test.OptionalFields;\n            public static encode(message: jspb.test.IOptionalFields, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IOptionalFields, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OptionalFields;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.OptionalFields;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.OptionalFields;\n            public static toObject(message: jspb.test.OptionalFields, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace OptionalFields {\n\n            interface INested {\n                anInt?: (number|null);\n            }\n\n            class Nested implements INested {\n                constructor(properties?: jspb.test.OptionalFields.INested);\n                public anInt: number;\n                public static create(properties?: jspb.test.OptionalFields.INested): jspb.test.OptionalFields.Nested;\n                public static encode(message: jspb.test.OptionalFields.INested, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.OptionalFields.INested, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OptionalFields.Nested;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.OptionalFields.Nested;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.OptionalFields.Nested;\n                public static toObject(message: jspb.test.OptionalFields.Nested, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface IHasExtensions {\n            str1?: (string|null);\n            str2?: (string|null);\n            str3?: (string|null);\n            \".jspb.test.IsExtension.extField\"?: (jspb.test.IIsExtension|null);\n            \".jspb.test.IndirectExtension.simple\"?: (jspb.test.ISimple1|null);\n            \".jspb.test.IndirectExtension.str\"?: (string|null);\n            \".jspb.test.IndirectExtension.repeatedStr\"?: (string[]|null);\n            \".jspb.test.IndirectExtension.repeatedSimple\"?: (jspb.test.ISimple1[]|null);\n            \".jspb.test.simple1\"?: (jspb.test.ISimple1|null);\n        }\n\n        class HasExtensions implements IHasExtensions {\n            constructor(properties?: jspb.test.IHasExtensions);\n            public str1: string;\n            public str2: string;\n            public str3: string;\n            public static create(properties?: jspb.test.IHasExtensions): jspb.test.HasExtensions;\n            public static encode(message: jspb.test.IHasExtensions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IHasExtensions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.HasExtensions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.HasExtensions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.HasExtensions;\n            public static toObject(message: jspb.test.HasExtensions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IComplex {\n            aString: string;\n            anOutOfOrderBool: boolean;\n            aNestedMessage?: (jspb.test.Complex.INested|null);\n            aRepeatedMessage?: (jspb.test.Complex.INested[]|null);\n            aRepeatedString?: (string[]|null);\n        }\n\n        class Complex implements IComplex {\n            constructor(properties?: jspb.test.IComplex);\n            public aString: string;\n            public anOutOfOrderBool: boolean;\n            public aNestedMessage?: (jspb.test.Complex.INested|null);\n            public aRepeatedMessage: jspb.test.Complex.INested[];\n            public aRepeatedString: string[];\n            public static create(properties?: jspb.test.IComplex): jspb.test.Complex;\n            public static encode(message: jspb.test.IComplex, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IComplex, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Complex;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Complex;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.Complex;\n            public static toObject(message: jspb.test.Complex, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace Complex {\n\n            interface INested {\n                anInt: number;\n            }\n\n            class Nested implements INested {\n                constructor(properties?: jspb.test.Complex.INested);\n                public anInt: number;\n                public static create(properties?: jspb.test.Complex.INested): jspb.test.Complex.Nested;\n                public static encode(message: jspb.test.Complex.INested, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.Complex.INested, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Complex.Nested;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Complex.Nested;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.Complex.Nested;\n                public static toObject(message: jspb.test.Complex.Nested, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface IOuterMessage {\n        }\n\n        class OuterMessage implements IOuterMessage {\n            constructor(properties?: jspb.test.IOuterMessage);\n            public static create(properties?: jspb.test.IOuterMessage): jspb.test.OuterMessage;\n            public static encode(message: jspb.test.IOuterMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IOuterMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OuterMessage;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.OuterMessage;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.OuterMessage;\n            public static toObject(message: jspb.test.OuterMessage, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace OuterMessage {\n\n            interface IComplex {\n                innerComplexField?: (number|null);\n            }\n\n            class Complex implements IComplex {\n                constructor(properties?: jspb.test.OuterMessage.IComplex);\n                public innerComplexField: number;\n                public static create(properties?: jspb.test.OuterMessage.IComplex): jspb.test.OuterMessage.Complex;\n                public static encode(message: jspb.test.OuterMessage.IComplex, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.OuterMessage.IComplex, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.OuterMessage.Complex;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.OuterMessage.Complex;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.OuterMessage.Complex;\n                public static toObject(message: jspb.test.OuterMessage.Complex, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface IIsExtension {\n            ext1?: (string|null);\n        }\n\n        class IsExtension implements IIsExtension {\n            constructor(properties?: jspb.test.IIsExtension);\n            public ext1: string;\n            public static create(properties?: jspb.test.IIsExtension): jspb.test.IsExtension;\n            public static encode(message: jspb.test.IIsExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IIsExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.IsExtension;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.IsExtension;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.IsExtension;\n            public static toObject(message: jspb.test.IsExtension, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IIndirectExtension {\n        }\n\n        class IndirectExtension implements IIndirectExtension {\n            constructor(properties?: jspb.test.IIndirectExtension);\n            public static create(properties?: jspb.test.IIndirectExtension): jspb.test.IndirectExtension;\n            public static encode(message: jspb.test.IIndirectExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IIndirectExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.IndirectExtension;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.IndirectExtension;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.IndirectExtension;\n            public static toObject(message: jspb.test.IndirectExtension, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IDefaultValues {\n            stringField?: (string|null);\n            boolField?: (boolean|null);\n            intField?: (number|Long|null);\n            enumField?: (jspb.test.DefaultValues.Enum|null);\n            emptyField?: (string|null);\n            bytesField?: (Uint8Array|null);\n        }\n\n        class DefaultValues implements IDefaultValues {\n            constructor(properties?: jspb.test.IDefaultValues);\n            public stringField: string;\n            public boolField: boolean;\n            public intField: (number|Long);\n            public enumField: jspb.test.DefaultValues.Enum;\n            public emptyField: string;\n            public bytesField: Uint8Array;\n            public static create(properties?: jspb.test.IDefaultValues): jspb.test.DefaultValues;\n            public static encode(message: jspb.test.IDefaultValues, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IDefaultValues, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.DefaultValues;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.DefaultValues;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.DefaultValues;\n            public static toObject(message: jspb.test.DefaultValues, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace DefaultValues {\n\n            enum Enum {\n                E1 = 13,\n                E2 = 77\n            }\n        }\n\n        interface IFloatingPointFields {\n            optionalFloatField?: (number|null);\n            requiredFloatField: number;\n            repeatedFloatField?: (number[]|null);\n            defaultFloatField?: (number|null);\n            optionalDoubleField?: (number|null);\n            requiredDoubleField: number;\n            repeatedDoubleField?: (number[]|null);\n            defaultDoubleField?: (number|null);\n        }\n\n        class FloatingPointFields implements IFloatingPointFields {\n            constructor(properties?: jspb.test.IFloatingPointFields);\n            public optionalFloatField: number;\n            public requiredFloatField: number;\n            public repeatedFloatField: number[];\n            public defaultFloatField: number;\n            public optionalDoubleField: number;\n            public requiredDoubleField: number;\n            public repeatedDoubleField: number[];\n            public defaultDoubleField: number;\n            public static create(properties?: jspb.test.IFloatingPointFields): jspb.test.FloatingPointFields;\n            public static encode(message: jspb.test.IFloatingPointFields, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IFloatingPointFields, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.FloatingPointFields;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.FloatingPointFields;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.FloatingPointFields;\n            public static toObject(message: jspb.test.FloatingPointFields, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestClone {\n            str?: (string|null);\n            simple1?: (jspb.test.ISimple1|null);\n            simple2?: (jspb.test.ISimple1[]|null);\n            bytesField?: (Uint8Array|null);\n            unused?: (string|null);\n            \".jspb.test.CloneExtension.extField\"?: (jspb.test.ICloneExtension|null);\n        }\n\n        class TestClone implements ITestClone {\n            constructor(properties?: jspb.test.ITestClone);\n            public str: string;\n            public simple1?: (jspb.test.ISimple1|null);\n            public simple2: jspb.test.ISimple1[];\n            public bytesField: Uint8Array;\n            public unused: string;\n            public static create(properties?: jspb.test.ITestClone): jspb.test.TestClone;\n            public static encode(message: jspb.test.ITestClone, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestClone, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestClone;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestClone;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestClone;\n            public static toObject(message: jspb.test.TestClone, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ICloneExtension {\n            ext?: (string|null);\n        }\n\n        class CloneExtension implements ICloneExtension {\n            constructor(properties?: jspb.test.ICloneExtension);\n            public ext: string;\n            public static create(properties?: jspb.test.ICloneExtension): jspb.test.CloneExtension;\n            public static encode(message: jspb.test.ICloneExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ICloneExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.CloneExtension;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.CloneExtension;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.CloneExtension;\n            public static toObject(message: jspb.test.CloneExtension, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestGroup {\n            repeatedGroup?: (jspb.test.TestGroup.IRepeatedGroup[]|null);\n            requiredGroup: jspb.test.TestGroup.IRequiredGroup;\n            optionalGroup?: (jspb.test.TestGroup.IOptionalGroup|null);\n            id?: (string|null);\n            requiredSimple: jspb.test.ISimple2;\n            optionalSimple?: (jspb.test.ISimple2|null);\n        }\n\n        class TestGroup implements ITestGroup {\n            constructor(properties?: jspb.test.ITestGroup);\n            public repeatedGroup: jspb.test.TestGroup.IRepeatedGroup[];\n            public requiredGroup: jspb.test.TestGroup.IRequiredGroup;\n            public optionalGroup?: (jspb.test.TestGroup.IOptionalGroup|null);\n            public id: string;\n            public requiredSimple: jspb.test.ISimple2;\n            public optionalSimple?: (jspb.test.ISimple2|null);\n            public static create(properties?: jspb.test.ITestGroup): jspb.test.TestGroup;\n            public static encode(message: jspb.test.ITestGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestGroup;\n            public static toObject(message: jspb.test.TestGroup, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace TestGroup {\n\n            interface IRepeatedGroup {\n                id: string;\n                someBool?: (boolean[]|null);\n            }\n\n            class RepeatedGroup implements IRepeatedGroup {\n                constructor(properties?: jspb.test.TestGroup.IRepeatedGroup);\n                public id: string;\n                public someBool: boolean[];\n                public static create(properties?: jspb.test.TestGroup.IRepeatedGroup): jspb.test.TestGroup.RepeatedGroup;\n                public static encode(message: jspb.test.TestGroup.IRepeatedGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.TestGroup.IRepeatedGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup.RepeatedGroup;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup.RepeatedGroup;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.TestGroup.RepeatedGroup;\n                public static toObject(message: jspb.test.TestGroup.RepeatedGroup, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n\n            interface IRequiredGroup {\n                id: string;\n            }\n\n            class RequiredGroup implements IRequiredGroup {\n                constructor(properties?: jspb.test.TestGroup.IRequiredGroup);\n                public id: string;\n                public static create(properties?: jspb.test.TestGroup.IRequiredGroup): jspb.test.TestGroup.RequiredGroup;\n                public static encode(message: jspb.test.TestGroup.IRequiredGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.TestGroup.IRequiredGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup.RequiredGroup;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup.RequiredGroup;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.TestGroup.RequiredGroup;\n                public static toObject(message: jspb.test.TestGroup.RequiredGroup, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n\n            interface IOptionalGroup {\n                id: string;\n            }\n\n            class OptionalGroup implements IOptionalGroup {\n                constructor(properties?: jspb.test.TestGroup.IOptionalGroup);\n                public id: string;\n                public static create(properties?: jspb.test.TestGroup.IOptionalGroup): jspb.test.TestGroup.OptionalGroup;\n                public static encode(message: jspb.test.TestGroup.IOptionalGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.TestGroup.IOptionalGroup, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup.OptionalGroup;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup.OptionalGroup;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.TestGroup.OptionalGroup;\n                public static toObject(message: jspb.test.TestGroup.OptionalGroup, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface ITestGroup1 {\n            group?: (jspb.test.TestGroup.IRepeatedGroup|null);\n        }\n\n        class TestGroup1 implements ITestGroup1 {\n            constructor(properties?: jspb.test.ITestGroup1);\n            public group?: (jspb.test.TestGroup.IRepeatedGroup|null);\n            public static create(properties?: jspb.test.ITestGroup1): jspb.test.TestGroup1;\n            public static encode(message: jspb.test.ITestGroup1, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestGroup1, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestGroup1;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestGroup1;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestGroup1;\n            public static toObject(message: jspb.test.TestGroup1, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestReservedNames {\n            extension?: (number|null);\n            \".jspb.test.TestReservedNamesExtension.foo\"?: (number|null);\n        }\n\n        class TestReservedNames implements ITestReservedNames {\n            constructor(properties?: jspb.test.ITestReservedNames);\n            public extension: number;\n            public static create(properties?: jspb.test.ITestReservedNames): jspb.test.TestReservedNames;\n            public static encode(message: jspb.test.ITestReservedNames, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestReservedNames, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestReservedNames;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestReservedNames;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestReservedNames;\n            public static toObject(message: jspb.test.TestReservedNames, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestReservedNamesExtension {\n        }\n\n        class TestReservedNamesExtension implements ITestReservedNamesExtension {\n            constructor(properties?: jspb.test.ITestReservedNamesExtension);\n            public static create(properties?: jspb.test.ITestReservedNamesExtension): jspb.test.TestReservedNamesExtension;\n            public static encode(message: jspb.test.ITestReservedNamesExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestReservedNamesExtension, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestReservedNamesExtension;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestReservedNamesExtension;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestReservedNamesExtension;\n            public static toObject(message: jspb.test.TestReservedNamesExtension, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestMessageWithOneof {\n            pone?: (string|null);\n            pthree?: (string|null);\n            rone?: (jspb.test.ITestMessageWithOneof|null);\n            rtwo?: (string|null);\n            normalField?: (boolean|null);\n            repeatedField?: (string[]|null);\n            aone?: (number|null);\n            atwo?: (number|null);\n            bone?: (number|null);\n            btwo?: (number|null);\n        }\n\n        class TestMessageWithOneof implements ITestMessageWithOneof {\n            constructor(properties?: jspb.test.ITestMessageWithOneof);\n            public pone?: (string|null);\n            public pthree?: (string|null);\n            public rone?: (jspb.test.ITestMessageWithOneof|null);\n            public rtwo?: (string|null);\n            public normalField: boolean;\n            public repeatedField: string[];\n            public aone?: (number|null);\n            public atwo?: (number|null);\n            public bone?: (number|null);\n            public btwo?: (number|null);\n            public partialOneof?: (\"pone\"|\"pthree\");\n            public recursiveOneof?: (\"rone\"|\"rtwo\");\n            public defaultOneofA?: (\"aone\"|\"atwo\");\n            public defaultOneofB?: (\"bone\"|\"btwo\");\n            public static create(properties?: jspb.test.ITestMessageWithOneof): jspb.test.TestMessageWithOneof;\n            public static encode(message: jspb.test.ITestMessageWithOneof, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestMessageWithOneof, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestMessageWithOneof;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestMessageWithOneof;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestMessageWithOneof;\n            public static toObject(message: jspb.test.TestMessageWithOneof, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestEndsWithBytes {\n            value?: (number|null);\n            data?: (Uint8Array|null);\n        }\n\n        class TestEndsWithBytes implements ITestEndsWithBytes {\n            constructor(properties?: jspb.test.ITestEndsWithBytes);\n            public value: number;\n            public data: Uint8Array;\n            public static create(properties?: jspb.test.ITestEndsWithBytes): jspb.test.TestEndsWithBytes;\n            public static encode(message: jspb.test.ITestEndsWithBytes, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestEndsWithBytes, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestEndsWithBytes;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestEndsWithBytes;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestEndsWithBytes;\n            public static toObject(message: jspb.test.TestEndsWithBytes, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface ITestMapFieldsNoBinary {\n            mapStringString?: ({ [k: string]: string }|null);\n            mapStringInt32?: ({ [k: string]: number }|null);\n            mapStringInt64?: ({ [k: string]: (number|Long) }|null);\n            mapStringBool?: ({ [k: string]: boolean }|null);\n            mapStringDouble?: ({ [k: string]: number }|null);\n            mapStringEnum?: ({ [k: string]: jspb.test.MapValueEnumNoBinary }|null);\n            mapStringMsg?: ({ [k: string]: jspb.test.IMapValueMessageNoBinary }|null);\n            mapInt32String?: ({ [k: string]: string }|null);\n            mapInt64String?: ({ [k: string]: string }|null);\n            mapBoolString?: ({ [k: string]: string }|null);\n            testMapFields?: (jspb.test.ITestMapFieldsNoBinary|null);\n            mapStringTestmapfields?: ({ [k: string]: jspb.test.ITestMapFieldsNoBinary }|null);\n        }\n\n        class TestMapFieldsNoBinary implements ITestMapFieldsNoBinary {\n            constructor(properties?: jspb.test.ITestMapFieldsNoBinary);\n            public mapStringString: { [k: string]: string };\n            public mapStringInt32: { [k: string]: number };\n            public mapStringInt64: { [k: string]: (number|Long) };\n            public mapStringBool: { [k: string]: boolean };\n            public mapStringDouble: { [k: string]: number };\n            public mapStringEnum: { [k: string]: jspb.test.MapValueEnumNoBinary };\n            public mapStringMsg: { [k: string]: jspb.test.IMapValueMessageNoBinary };\n            public mapInt32String: { [k: string]: string };\n            public mapInt64String: { [k: string]: string };\n            public mapBoolString: { [k: string]: string };\n            public testMapFields?: (jspb.test.ITestMapFieldsNoBinary|null);\n            public mapStringTestmapfields: { [k: string]: jspb.test.ITestMapFieldsNoBinary };\n            public static create(properties?: jspb.test.ITestMapFieldsNoBinary): jspb.test.TestMapFieldsNoBinary;\n            public static encode(message: jspb.test.ITestMapFieldsNoBinary, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.ITestMapFieldsNoBinary, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.TestMapFieldsNoBinary;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.TestMapFieldsNoBinary;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.TestMapFieldsNoBinary;\n            public static toObject(message: jspb.test.TestMapFieldsNoBinary, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        enum MapValueEnumNoBinary {\n            MAP_VALUE_FOO_NOBINARY = 0,\n            MAP_VALUE_BAR_NOBINARY = 1,\n            MAP_VALUE_BAZ_NOBINARY = 2\n        }\n\n        interface IMapValueMessageNoBinary {\n            foo?: (number|null);\n        }\n\n        class MapValueMessageNoBinary implements IMapValueMessageNoBinary {\n            constructor(properties?: jspb.test.IMapValueMessageNoBinary);\n            public foo: number;\n            public static create(properties?: jspb.test.IMapValueMessageNoBinary): jspb.test.MapValueMessageNoBinary;\n            public static encode(message: jspb.test.IMapValueMessageNoBinary, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IMapValueMessageNoBinary, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.MapValueMessageNoBinary;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.MapValueMessageNoBinary;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.MapValueMessageNoBinary;\n            public static toObject(message: jspb.test.MapValueMessageNoBinary, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IDeeply {\n        }\n\n        class Deeply implements IDeeply {\n            constructor(properties?: jspb.test.IDeeply);\n            public static create(properties?: jspb.test.IDeeply): jspb.test.Deeply;\n            public static encode(message: jspb.test.IDeeply, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: jspb.test.IDeeply, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Deeply;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Deeply;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): jspb.test.Deeply;\n            public static toObject(message: jspb.test.Deeply, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace Deeply {\n\n            interface INested {\n            }\n\n            class Nested implements INested {\n                constructor(properties?: jspb.test.Deeply.INested);\n                public static create(properties?: jspb.test.Deeply.INested): jspb.test.Deeply.Nested;\n                public static encode(message: jspb.test.Deeply.INested, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: jspb.test.Deeply.INested, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Deeply.Nested;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Deeply.Nested;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): jspb.test.Deeply.Nested;\n                public static toObject(message: jspb.test.Deeply.Nested, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n\n            namespace Nested {\n\n                interface IMessage {\n                    count?: (number|null);\n                }\n\n                class Message implements IMessage {\n                    constructor(properties?: jspb.test.Deeply.Nested.IMessage);\n                    public count: number;\n                    public static create(properties?: jspb.test.Deeply.Nested.IMessage): jspb.test.Deeply.Nested.Message;\n                    public static encode(message: jspb.test.Deeply.Nested.IMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n                    public static encodeDelimited(message: jspb.test.Deeply.Nested.IMessage, writer?: $protobuf.Writer): $protobuf.Writer;\n                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): jspb.test.Deeply.Nested.Message;\n                    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): jspb.test.Deeply.Nested.Message;\n                    public static verify(message: { [k: string]: any }): (string|null);\n                    public static fromObject(object: { [k: string]: any }): jspb.test.Deeply.Nested.Message;\n                    public static toObject(message: jspb.test.Deeply.Nested.Message, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                    public toJSON(): { [k: string]: any };\n                    public static getTypeUrl(typeUrlPrefix?: string): string;\n                }\n            }\n        }\n    }\n}\n\nexport namespace google {\n\n    namespace protobuf {\n\n        interface IFileDescriptorSet {\n            file?: (google.protobuf.IFileDescriptorProto[]|null);\n        }\n\n        class FileDescriptorSet implements IFileDescriptorSet {\n            constructor(properties?: google.protobuf.IFileDescriptorSet);\n            public file: google.protobuf.IFileDescriptorProto[];\n            public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet;\n            public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet;\n            public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IFileDescriptorProto {\n            name?: (string|null);\n            \"package\"?: (string|null);\n            dependency?: (string[]|null);\n            publicDependency?: (number[]|null);\n            weakDependency?: (number[]|null);\n            messageType?: (google.protobuf.IDescriptorProto[]|null);\n            enumType?: (google.protobuf.IEnumDescriptorProto[]|null);\n            service?: (google.protobuf.IServiceDescriptorProto[]|null);\n            extension?: (google.protobuf.IFieldDescriptorProto[]|null);\n            options?: (google.protobuf.IFileOptions|null);\n            sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null);\n            syntax?: (string|null);\n        }\n\n        class FileDescriptorProto implements IFileDescriptorProto {\n            constructor(properties?: google.protobuf.IFileDescriptorProto);\n            public name: string;\n            public package: string;\n            public dependency: string[];\n            public publicDependency: number[];\n            public weakDependency: number[];\n            public messageType: google.protobuf.IDescriptorProto[];\n            public enumType: google.protobuf.IEnumDescriptorProto[];\n            public service: google.protobuf.IServiceDescriptorProto[];\n            public extension: google.protobuf.IFieldDescriptorProto[];\n            public options?: (google.protobuf.IFileOptions|null);\n            public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null);\n            public syntax: string;\n            public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto;\n            public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto;\n            public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IDescriptorProto {\n            name?: (string|null);\n            field?: (google.protobuf.IFieldDescriptorProto[]|null);\n            extension?: (google.protobuf.IFieldDescriptorProto[]|null);\n            nestedType?: (google.protobuf.IDescriptorProto[]|null);\n            enumType?: (google.protobuf.IEnumDescriptorProto[]|null);\n            extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null);\n            oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null);\n            options?: (google.protobuf.IMessageOptions|null);\n            reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null);\n            reservedName?: (string[]|null);\n        }\n\n        class DescriptorProto implements IDescriptorProto {\n            constructor(properties?: google.protobuf.IDescriptorProto);\n            public name: string;\n            public field: google.protobuf.IFieldDescriptorProto[];\n            public extension: google.protobuf.IFieldDescriptorProto[];\n            public nestedType: google.protobuf.IDescriptorProto[];\n            public enumType: google.protobuf.IEnumDescriptorProto[];\n            public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[];\n            public oneofDecl: google.protobuf.IOneofDescriptorProto[];\n            public options?: (google.protobuf.IMessageOptions|null);\n            public reservedRange: google.protobuf.DescriptorProto.IReservedRange[];\n            public reservedName: string[];\n            public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto;\n            public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto;\n            public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace DescriptorProto {\n\n            interface IExtensionRange {\n                start?: (number|null);\n                end?: (number|null);\n            }\n\n            class ExtensionRange implements IExtensionRange {\n                constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange);\n                public start: number;\n                public end: number;\n                public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange;\n                public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange;\n                public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n\n            interface IReservedRange {\n                start?: (number|null);\n                end?: (number|null);\n            }\n\n            class ReservedRange implements IReservedRange {\n                constructor(properties?: google.protobuf.DescriptorProto.IReservedRange);\n                public start: number;\n                public end: number;\n                public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange;\n                public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange;\n                public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface IFieldDescriptorProto {\n            name?: (string|null);\n            number?: (number|null);\n            label?: (google.protobuf.FieldDescriptorProto.Label|null);\n            type?: (google.protobuf.FieldDescriptorProto.Type|null);\n            typeName?: (string|null);\n            extendee?: (string|null);\n            defaultValue?: (string|null);\n            oneofIndex?: (number|null);\n            jsonName?: (string|null);\n            options?: (google.protobuf.IFieldOptions|null);\n        }\n\n        class FieldDescriptorProto implements IFieldDescriptorProto {\n            constructor(properties?: google.protobuf.IFieldDescriptorProto);\n            public name: string;\n            public number: number;\n            public label: google.protobuf.FieldDescriptorProto.Label;\n            public type: google.protobuf.FieldDescriptorProto.Type;\n            public typeName: string;\n            public extendee: string;\n            public defaultValue: string;\n            public oneofIndex: number;\n            public jsonName: string;\n            public options?: (google.protobuf.IFieldOptions|null);\n            public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto;\n            public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto;\n            public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace FieldDescriptorProto {\n\n            enum Type {\n                TYPE_DOUBLE = 1,\n                TYPE_FLOAT = 2,\n                TYPE_INT64 = 3,\n                TYPE_UINT64 = 4,\n                TYPE_INT32 = 5,\n                TYPE_FIXED64 = 6,\n                TYPE_FIXED32 = 7,\n                TYPE_BOOL = 8,\n                TYPE_STRING = 9,\n                TYPE_GROUP = 10,\n                TYPE_MESSAGE = 11,\n                TYPE_BYTES = 12,\n                TYPE_UINT32 = 13,\n                TYPE_ENUM = 14,\n                TYPE_SFIXED32 = 15,\n                TYPE_SFIXED64 = 16,\n                TYPE_SINT32 = 17,\n                TYPE_SINT64 = 18\n            }\n\n            enum Label {\n                LABEL_OPTIONAL = 1,\n                LABEL_REQUIRED = 2,\n                LABEL_REPEATED = 3\n            }\n        }\n\n        interface IOneofDescriptorProto {\n            name?: (string|null);\n            options?: (google.protobuf.IOneofOptions|null);\n        }\n\n        class OneofDescriptorProto implements IOneofDescriptorProto {\n            constructor(properties?: google.protobuf.IOneofDescriptorProto);\n            public name: string;\n            public options?: (google.protobuf.IOneofOptions|null);\n            public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto;\n            public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto;\n            public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IEnumDescriptorProto {\n            name?: (string|null);\n            value?: (google.protobuf.IEnumValueDescriptorProto[]|null);\n            options?: (google.protobuf.IEnumOptions|null);\n        }\n\n        class EnumDescriptorProto implements IEnumDescriptorProto {\n            constructor(properties?: google.protobuf.IEnumDescriptorProto);\n            public name: string;\n            public value: google.protobuf.IEnumValueDescriptorProto[];\n            public options?: (google.protobuf.IEnumOptions|null);\n            public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto;\n            public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto;\n            public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IEnumValueDescriptorProto {\n            name?: (string|null);\n            number?: (number|null);\n            options?: (google.protobuf.IEnumValueOptions|null);\n        }\n\n        class EnumValueDescriptorProto implements IEnumValueDescriptorProto {\n            constructor(properties?: google.protobuf.IEnumValueDescriptorProto);\n            public name: string;\n            public number: number;\n            public options?: (google.protobuf.IEnumValueOptions|null);\n            public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto;\n            public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto;\n            public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IServiceDescriptorProto {\n            name?: (string|null);\n            method?: (google.protobuf.IMethodDescriptorProto[]|null);\n            options?: (google.protobuf.IServiceOptions|null);\n        }\n\n        class ServiceDescriptorProto implements IServiceDescriptorProto {\n            constructor(properties?: google.protobuf.IServiceDescriptorProto);\n            public name: string;\n            public method: google.protobuf.IMethodDescriptorProto[];\n            public options?: (google.protobuf.IServiceOptions|null);\n            public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto;\n            public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto;\n            public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IMethodDescriptorProto {\n            name?: (string|null);\n            inputType?: (string|null);\n            outputType?: (string|null);\n            options?: (google.protobuf.IMethodOptions|null);\n            clientStreaming?: (boolean|null);\n            serverStreaming?: (boolean|null);\n        }\n\n        class MethodDescriptorProto implements IMethodDescriptorProto {\n            constructor(properties?: google.protobuf.IMethodDescriptorProto);\n            public name: string;\n            public inputType: string;\n            public outputType: string;\n            public options?: (google.protobuf.IMethodOptions|null);\n            public clientStreaming: boolean;\n            public serverStreaming: boolean;\n            public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto;\n            public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto;\n            public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IFileOptions {\n            javaPackage?: (string|null);\n            javaOuterClassname?: (string|null);\n            javaMultipleFiles?: (boolean|null);\n            javaGenerateEqualsAndHash?: (boolean|null);\n            javaStringCheckUtf8?: (boolean|null);\n            optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null);\n            goPackage?: (string|null);\n            ccGenericServices?: (boolean|null);\n            javaGenericServices?: (boolean|null);\n            pyGenericServices?: (boolean|null);\n            deprecated?: (boolean|null);\n            ccEnableArenas?: (boolean|null);\n            objcClassPrefix?: (string|null);\n            csharpNamespace?: (string|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class FileOptions implements IFileOptions {\n            constructor(properties?: google.protobuf.IFileOptions);\n            public javaPackage: string;\n            public javaOuterClassname: string;\n            public javaMultipleFiles: boolean;\n            public javaGenerateEqualsAndHash: boolean;\n            public javaStringCheckUtf8: boolean;\n            public optimizeFor: google.protobuf.FileOptions.OptimizeMode;\n            public goPackage: string;\n            public ccGenericServices: boolean;\n            public javaGenericServices: boolean;\n            public pyGenericServices: boolean;\n            public deprecated: boolean;\n            public ccEnableArenas: boolean;\n            public objcClassPrefix: string;\n            public csharpNamespace: string;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions;\n            public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions;\n            public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace FileOptions {\n\n            enum OptimizeMode {\n                SPEED = 1,\n                CODE_SIZE = 2,\n                LITE_RUNTIME = 3\n            }\n        }\n\n        interface IMessageOptions {\n            messageSetWireFormat?: (boolean|null);\n            noStandardDescriptorAccessor?: (boolean|null);\n            deprecated?: (boolean|null);\n            mapEntry?: (boolean|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class MessageOptions implements IMessageOptions {\n            constructor(properties?: google.protobuf.IMessageOptions);\n            public messageSetWireFormat: boolean;\n            public noStandardDescriptorAccessor: boolean;\n            public deprecated: boolean;\n            public mapEntry: boolean;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions;\n            public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions;\n            public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IFieldOptions {\n            ctype?: (google.protobuf.FieldOptions.CType|null);\n            packed?: (boolean|null);\n            jstype?: (google.protobuf.FieldOptions.JSType|null);\n            lazy?: (boolean|null);\n            deprecated?: (boolean|null);\n            weak?: (boolean|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class FieldOptions implements IFieldOptions {\n            constructor(properties?: google.protobuf.IFieldOptions);\n            public ctype: google.protobuf.FieldOptions.CType;\n            public packed: boolean;\n            public jstype: google.protobuf.FieldOptions.JSType;\n            public lazy: boolean;\n            public deprecated: boolean;\n            public weak: boolean;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions;\n            public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions;\n            public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace FieldOptions {\n\n            enum CType {\n                STRING = 0,\n                CORD = 1,\n                STRING_PIECE = 2\n            }\n\n            enum JSType {\n                JS_NORMAL = 0,\n                JS_STRING = 1,\n                JS_NUMBER = 2\n            }\n        }\n\n        interface IOneofOptions {\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class OneofOptions implements IOneofOptions {\n            constructor(properties?: google.protobuf.IOneofOptions);\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions;\n            public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions;\n            public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IEnumOptions {\n            allowAlias?: (boolean|null);\n            deprecated?: (boolean|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n            \".jspb.test.IsExtension.simpleOption\"?: (string|null);\n        }\n\n        class EnumOptions implements IEnumOptions {\n            constructor(properties?: google.protobuf.IEnumOptions);\n            public allowAlias: boolean;\n            public deprecated: boolean;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions;\n            public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions;\n            public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IEnumValueOptions {\n            deprecated?: (boolean|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class EnumValueOptions implements IEnumValueOptions {\n            constructor(properties?: google.protobuf.IEnumValueOptions);\n            public deprecated: boolean;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions;\n            public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions;\n            public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IServiceOptions {\n            deprecated?: (boolean|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class ServiceOptions implements IServiceOptions {\n            constructor(properties?: google.protobuf.IServiceOptions);\n            public deprecated: boolean;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions;\n            public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions;\n            public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        interface IMethodOptions {\n            deprecated?: (boolean|null);\n            idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null);\n            uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null);\n        }\n\n        class MethodOptions implements IMethodOptions {\n            constructor(properties?: google.protobuf.IMethodOptions);\n            public deprecated: boolean;\n            public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel;\n            public uninterpretedOption: google.protobuf.IUninterpretedOption[];\n            public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions;\n            public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions;\n            public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace MethodOptions {\n\n            enum IdempotencyLevel {\n                IDEMPOTENCY_UNKNOWN = 0,\n                NO_SIDE_EFFECTS = 1,\n                IDEMPOTENT = 2\n            }\n        }\n\n        interface IUninterpretedOption {\n            name?: (google.protobuf.UninterpretedOption.INamePart[]|null);\n            identifierValue?: (string|null);\n            positiveIntValue?: (number|Long|null);\n            negativeIntValue?: (number|Long|null);\n            doubleValue?: (number|null);\n            stringValue?: (Uint8Array|null);\n            aggregateValue?: (string|null);\n        }\n\n        class UninterpretedOption implements IUninterpretedOption {\n            constructor(properties?: google.protobuf.IUninterpretedOption);\n            public name: google.protobuf.UninterpretedOption.INamePart[];\n            public identifierValue: string;\n            public positiveIntValue: (number|Long);\n            public negativeIntValue: (number|Long);\n            public doubleValue: number;\n            public stringValue: Uint8Array;\n            public aggregateValue: string;\n            public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption;\n            public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption;\n            public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace UninterpretedOption {\n\n            interface INamePart {\n                namePart: string;\n                isExtension: boolean;\n            }\n\n            class NamePart implements INamePart {\n                constructor(properties?: google.protobuf.UninterpretedOption.INamePart);\n                public namePart: string;\n                public isExtension: boolean;\n                public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart;\n                public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart;\n                public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface ISourceCodeInfo {\n            location?: (google.protobuf.SourceCodeInfo.ILocation[]|null);\n        }\n\n        class SourceCodeInfo implements ISourceCodeInfo {\n            constructor(properties?: google.protobuf.ISourceCodeInfo);\n            public location: google.protobuf.SourceCodeInfo.ILocation[];\n            public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo;\n            public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo;\n            public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace SourceCodeInfo {\n\n            interface ILocation {\n                path?: (number[]|null);\n                span?: (number[]|null);\n                leadingComments?: (string|null);\n                trailingComments?: (string|null);\n                leadingDetachedComments?: (string[]|null);\n            }\n\n            class Location implements ILocation {\n                constructor(properties?: google.protobuf.SourceCodeInfo.ILocation);\n                public path: number[];\n                public span: number[];\n                public leadingComments: string;\n                public trailingComments: string;\n                public leadingDetachedComments: string[];\n                public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location;\n                public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location;\n                public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n\n        interface IGeneratedCodeInfo {\n            annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null);\n        }\n\n        class GeneratedCodeInfo implements IGeneratedCodeInfo {\n            constructor(properties?: google.protobuf.IGeneratedCodeInfo);\n            public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[];\n            public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo;\n            public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer;\n            public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo;\n            public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo;\n            public static verify(message: { [k: string]: any }): (string|null);\n            public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo;\n            public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };\n            public toJSON(): { [k: string]: any };\n            public static getTypeUrl(typeUrlPrefix?: string): string;\n        }\n\n        namespace GeneratedCodeInfo {\n\n            interface IAnnotation {\n                path?: (number[]|null);\n                sourceFile?: (string|null);\n                begin?: (number|null);\n                end?: (number|null);\n            }\n\n            class Annotation implements IAnnotation {\n                constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation);\n                public path: number[];\n                public sourceFile: string;\n                public begin: number;\n                public end: number;\n                public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation;\n                public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer;\n                public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation;\n                public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation;\n                public static verify(message: { [k: string]: any }): (string|null);\n                public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation;\n                public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any };\n                public toJSON(): { [k: string]: any };\n                public static getTypeUrl(typeUrlPrefix?: string): string;\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "tests/data/test.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_test || ($protobuf.roots.test_test = {});\n\n$root.jspb = (function() {\n\n    /**\n     * Namespace jspb.\n     * @exports jspb\n     * @namespace\n     */\n    var jspb = {};\n\n    jspb.test = (function() {\n\n        /**\n         * Namespace test.\n         * @memberof jspb\n         * @namespace\n         */\n        var test = {};\n\n        test.Empty = (function() {\n\n            /**\n             * Properties of an Empty.\n             * @memberof jspb.test\n             * @interface IEmpty\n             */\n\n            /**\n             * Constructs a new Empty.\n             * @memberof jspb.test\n             * @classdesc Represents an Empty.\n             * @implements IEmpty\n             * @constructor\n             * @param {jspb.test.IEmpty=} [properties] Properties to set\n             */\n            function Empty(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Creates a new Empty instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {jspb.test.IEmpty=} [properties] Properties to set\n             * @returns {jspb.test.Empty} Empty instance\n             */\n            Empty.create = function create(properties) {\n                return new Empty(properties);\n            };\n\n            /**\n             * Encodes the specified Empty message. Does not implicitly {@link jspb.test.Empty.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {jspb.test.IEmpty} message Empty message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Empty.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Empty message, length delimited. Does not implicitly {@link jspb.test.Empty.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {jspb.test.IEmpty} message Empty message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Empty.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an Empty message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.Empty} Empty\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Empty.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Empty();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an Empty message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.Empty} Empty\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Empty.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an Empty message.\n             * @function verify\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Empty.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                return null;\n            };\n\n            /**\n             * Creates an Empty message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.Empty} Empty\n             */\n            Empty.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.Empty)\n                    return object;\n                return new $root.jspb.test.Empty();\n            };\n\n            /**\n             * Creates a plain object from an Empty message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {jspb.test.Empty} message Empty\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Empty.toObject = function toObject() {\n                return {};\n            };\n\n            /**\n             * Converts this Empty to JSON.\n             * @function toJSON\n             * @memberof jspb.test.Empty\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Empty.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Empty\n             * @function getTypeUrl\n             * @memberof jspb.test.Empty\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Empty.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.Empty\";\n            };\n\n            return Empty;\n        })();\n\n        /**\n         * OuterEnum enum.\n         * @name jspb.test.OuterEnum\n         * @enum {number}\n         * @property {number} FOO=1 FOO value\n         * @property {number} BAR=2 BAR value\n         */\n        test.OuterEnum = (function() {\n            var valuesById = {}, values = Object.create(valuesById);\n            values[valuesById[1] = \"FOO\"] = 1;\n            values[valuesById[2] = \"BAR\"] = 2;\n            return values;\n        })();\n\n        test.EnumContainer = (function() {\n\n            /**\n             * Properties of an EnumContainer.\n             * @memberof jspb.test\n             * @interface IEnumContainer\n             * @property {jspb.test.OuterEnum|null} [outerEnum] EnumContainer outerEnum\n             */\n\n            /**\n             * Constructs a new EnumContainer.\n             * @memberof jspb.test\n             * @classdesc Represents an EnumContainer.\n             * @implements IEnumContainer\n             * @constructor\n             * @param {jspb.test.IEnumContainer=} [properties] Properties to set\n             */\n            function EnumContainer(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumContainer outerEnum.\n             * @member {jspb.test.OuterEnum} outerEnum\n             * @memberof jspb.test.EnumContainer\n             * @instance\n             */\n            EnumContainer.prototype.outerEnum = 1;\n\n            /**\n             * Creates a new EnumContainer instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {jspb.test.IEnumContainer=} [properties] Properties to set\n             * @returns {jspb.test.EnumContainer} EnumContainer instance\n             */\n            EnumContainer.create = function create(properties) {\n                return new EnumContainer(properties);\n            };\n\n            /**\n             * Encodes the specified EnumContainer message. Does not implicitly {@link jspb.test.EnumContainer.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {jspb.test.IEnumContainer} message EnumContainer message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumContainer.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.outerEnum != null && Object.hasOwnProperty.call(message, \"outerEnum\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.outerEnum);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumContainer message, length delimited. Does not implicitly {@link jspb.test.EnumContainer.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {jspb.test.IEnumContainer} message EnumContainer message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumContainer.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumContainer message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.EnumContainer} EnumContainer\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumContainer.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.EnumContainer();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.outerEnum = reader.int32();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumContainer message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.EnumContainer} EnumContainer\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumContainer.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumContainer message.\n             * @function verify\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumContainer.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.outerEnum != null && message.hasOwnProperty(\"outerEnum\"))\n                    switch (message.outerEnum) {\n                    default:\n                        return \"outerEnum: enum value expected\";\n                    case 1:\n                    case 2:\n                        break;\n                    }\n                return null;\n            };\n\n            /**\n             * Creates an EnumContainer message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.EnumContainer} EnumContainer\n             */\n            EnumContainer.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.EnumContainer)\n                    return object;\n                var message = new $root.jspb.test.EnumContainer();\n                switch (object.outerEnum) {\n                case \"FOO\":\n                case 1:\n                    message.outerEnum = 1;\n                    break;\n                case \"BAR\":\n                case 2:\n                    message.outerEnum = 2;\n                    break;\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumContainer message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {jspb.test.EnumContainer} message EnumContainer\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumContainer.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.outerEnum = options.enums === String ? \"FOO\" : 1;\n                if (message.outerEnum != null && message.hasOwnProperty(\"outerEnum\"))\n                    object.outerEnum = options.enums === String ? $root.jspb.test.OuterEnum[message.outerEnum] : message.outerEnum;\n                return object;\n            };\n\n            /**\n             * Converts this EnumContainer to JSON.\n             * @function toJSON\n             * @memberof jspb.test.EnumContainer\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumContainer.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for EnumContainer\n             * @function getTypeUrl\n             * @memberof jspb.test.EnumContainer\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            EnumContainer.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.EnumContainer\";\n            };\n\n            return EnumContainer;\n        })();\n\n        test.Simple1 = (function() {\n\n            /**\n             * Properties of a Simple1.\n             * @memberof jspb.test\n             * @interface ISimple1\n             * @property {string} aString Simple1 aString\n             * @property {Array.<string>|null} [aRepeatedString] Simple1 aRepeatedString\n             * @property {boolean|null} [aBoolean] Simple1 aBoolean\n             */\n\n            /**\n             * Constructs a new Simple1.\n             * @memberof jspb.test\n             * @classdesc Represents a Simple1.\n             * @implements ISimple1\n             * @constructor\n             * @param {jspb.test.ISimple1=} [properties] Properties to set\n             */\n            function Simple1(properties) {\n                this.aRepeatedString = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Simple1 aString.\n             * @member {string} aString\n             * @memberof jspb.test.Simple1\n             * @instance\n             */\n            Simple1.prototype.aString = \"\";\n\n            /**\n             * Simple1 aRepeatedString.\n             * @member {Array.<string>} aRepeatedString\n             * @memberof jspb.test.Simple1\n             * @instance\n             */\n            Simple1.prototype.aRepeatedString = $util.emptyArray;\n\n            /**\n             * Simple1 aBoolean.\n             * @member {boolean} aBoolean\n             * @memberof jspb.test.Simple1\n             * @instance\n             */\n            Simple1.prototype.aBoolean = false;\n\n            /**\n             * Creates a new Simple1 instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {jspb.test.ISimple1=} [properties] Properties to set\n             * @returns {jspb.test.Simple1} Simple1 instance\n             */\n            Simple1.create = function create(properties) {\n                return new Simple1(properties);\n            };\n\n            /**\n             * Encodes the specified Simple1 message. Does not implicitly {@link jspb.test.Simple1.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {jspb.test.ISimple1} message Simple1 message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Simple1.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString);\n                if (message.aRepeatedString != null && message.aRepeatedString.length)\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.aRepeatedString[i]);\n                if (message.aBoolean != null && Object.hasOwnProperty.call(message, \"aBoolean\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.aBoolean);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Simple1 message, length delimited. Does not implicitly {@link jspb.test.Simple1.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {jspb.test.ISimple1} message Simple1 message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Simple1.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Simple1 message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.Simple1} Simple1\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Simple1.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Simple1();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.aString = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.aRepeatedString && message.aRepeatedString.length))\n                            message.aRepeatedString = [];\n                        message.aRepeatedString.push(reader.string());\n                        break;\n                    case 3:\n                        message.aBoolean = reader.bool();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"aString\"))\n                    throw $util.ProtocolError(\"missing required 'aString'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a Simple1 message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.Simple1} Simple1\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Simple1.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Simple1 message.\n             * @function verify\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Simple1.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (!$util.isString(message.aString))\n                    return \"aString: string expected\";\n                if (message.aRepeatedString != null && message.hasOwnProperty(\"aRepeatedString\")) {\n                    if (!Array.isArray(message.aRepeatedString))\n                        return \"aRepeatedString: array expected\";\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        if (!$util.isString(message.aRepeatedString[i]))\n                            return \"aRepeatedString: string[] expected\";\n                }\n                if (message.aBoolean != null && message.hasOwnProperty(\"aBoolean\"))\n                    if (typeof message.aBoolean !== \"boolean\")\n                        return \"aBoolean: boolean expected\";\n                return null;\n            };\n\n            /**\n             * Creates a Simple1 message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.Simple1} Simple1\n             */\n            Simple1.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.Simple1)\n                    return object;\n                var message = new $root.jspb.test.Simple1();\n                if (object.aString != null)\n                    message.aString = String(object.aString);\n                if (object.aRepeatedString) {\n                    if (!Array.isArray(object.aRepeatedString))\n                        throw TypeError(\".jspb.test.Simple1.aRepeatedString: array expected\");\n                    message.aRepeatedString = [];\n                    for (var i = 0; i < object.aRepeatedString.length; ++i)\n                        message.aRepeatedString[i] = String(object.aRepeatedString[i]);\n                }\n                if (object.aBoolean != null)\n                    message.aBoolean = Boolean(object.aBoolean);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a Simple1 message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {jspb.test.Simple1} message Simple1\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Simple1.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.aRepeatedString = [];\n                if (options.defaults) {\n                    object.aString = \"\";\n                    object.aBoolean = false;\n                }\n                if (message.aString != null && message.hasOwnProperty(\"aString\"))\n                    object.aString = message.aString;\n                if (message.aRepeatedString && message.aRepeatedString.length) {\n                    object.aRepeatedString = [];\n                    for (var j = 0; j < message.aRepeatedString.length; ++j)\n                        object.aRepeatedString[j] = message.aRepeatedString[j];\n                }\n                if (message.aBoolean != null && message.hasOwnProperty(\"aBoolean\"))\n                    object.aBoolean = message.aBoolean;\n                return object;\n            };\n\n            /**\n             * Converts this Simple1 to JSON.\n             * @function toJSON\n             * @memberof jspb.test.Simple1\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Simple1.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Simple1\n             * @function getTypeUrl\n             * @memberof jspb.test.Simple1\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Simple1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.Simple1\";\n            };\n\n            return Simple1;\n        })();\n\n        test.Simple2 = (function() {\n\n            /**\n             * Properties of a Simple2.\n             * @memberof jspb.test\n             * @interface ISimple2\n             * @property {string} aString Simple2 aString\n             * @property {Array.<string>|null} [aRepeatedString] Simple2 aRepeatedString\n             */\n\n            /**\n             * Constructs a new Simple2.\n             * @memberof jspb.test\n             * @classdesc Represents a Simple2.\n             * @implements ISimple2\n             * @constructor\n             * @param {jspb.test.ISimple2=} [properties] Properties to set\n             */\n            function Simple2(properties) {\n                this.aRepeatedString = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Simple2 aString.\n             * @member {string} aString\n             * @memberof jspb.test.Simple2\n             * @instance\n             */\n            Simple2.prototype.aString = \"\";\n\n            /**\n             * Simple2 aRepeatedString.\n             * @member {Array.<string>} aRepeatedString\n             * @memberof jspb.test.Simple2\n             * @instance\n             */\n            Simple2.prototype.aRepeatedString = $util.emptyArray;\n\n            /**\n             * Creates a new Simple2 instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {jspb.test.ISimple2=} [properties] Properties to set\n             * @returns {jspb.test.Simple2} Simple2 instance\n             */\n            Simple2.create = function create(properties) {\n                return new Simple2(properties);\n            };\n\n            /**\n             * Encodes the specified Simple2 message. Does not implicitly {@link jspb.test.Simple2.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {jspb.test.ISimple2} message Simple2 message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Simple2.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString);\n                if (message.aRepeatedString != null && message.aRepeatedString.length)\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.aRepeatedString[i]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Simple2 message, length delimited. Does not implicitly {@link jspb.test.Simple2.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {jspb.test.ISimple2} message Simple2 message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Simple2.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Simple2 message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.Simple2} Simple2\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Simple2.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Simple2();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.aString = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.aRepeatedString && message.aRepeatedString.length))\n                            message.aRepeatedString = [];\n                        message.aRepeatedString.push(reader.string());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"aString\"))\n                    throw $util.ProtocolError(\"missing required 'aString'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a Simple2 message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.Simple2} Simple2\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Simple2.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Simple2 message.\n             * @function verify\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Simple2.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (!$util.isString(message.aString))\n                    return \"aString: string expected\";\n                if (message.aRepeatedString != null && message.hasOwnProperty(\"aRepeatedString\")) {\n                    if (!Array.isArray(message.aRepeatedString))\n                        return \"aRepeatedString: array expected\";\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        if (!$util.isString(message.aRepeatedString[i]))\n                            return \"aRepeatedString: string[] expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates a Simple2 message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.Simple2} Simple2\n             */\n            Simple2.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.Simple2)\n                    return object;\n                var message = new $root.jspb.test.Simple2();\n                if (object.aString != null)\n                    message.aString = String(object.aString);\n                if (object.aRepeatedString) {\n                    if (!Array.isArray(object.aRepeatedString))\n                        throw TypeError(\".jspb.test.Simple2.aRepeatedString: array expected\");\n                    message.aRepeatedString = [];\n                    for (var i = 0; i < object.aRepeatedString.length; ++i)\n                        message.aRepeatedString[i] = String(object.aRepeatedString[i]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a Simple2 message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {jspb.test.Simple2} message Simple2\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Simple2.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.aRepeatedString = [];\n                if (options.defaults)\n                    object.aString = \"\";\n                if (message.aString != null && message.hasOwnProperty(\"aString\"))\n                    object.aString = message.aString;\n                if (message.aRepeatedString && message.aRepeatedString.length) {\n                    object.aRepeatedString = [];\n                    for (var j = 0; j < message.aRepeatedString.length; ++j)\n                        object.aRepeatedString[j] = message.aRepeatedString[j];\n                }\n                return object;\n            };\n\n            /**\n             * Converts this Simple2 to JSON.\n             * @function toJSON\n             * @memberof jspb.test.Simple2\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Simple2.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Simple2\n             * @function getTypeUrl\n             * @memberof jspb.test.Simple2\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Simple2.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.Simple2\";\n            };\n\n            return Simple2;\n        })();\n\n        test.SpecialCases = (function() {\n\n            /**\n             * Properties of a SpecialCases.\n             * @memberof jspb.test\n             * @interface ISpecialCases\n             * @property {string} normal SpecialCases normal\n             * @property {string} \"default\" SpecialCases default\n             * @property {string} \"function\" SpecialCases function\n             * @property {string} \"var\" SpecialCases var\n             */\n\n            /**\n             * Constructs a new SpecialCases.\n             * @memberof jspb.test\n             * @classdesc Represents a SpecialCases.\n             * @implements ISpecialCases\n             * @constructor\n             * @param {jspb.test.ISpecialCases=} [properties] Properties to set\n             */\n            function SpecialCases(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * SpecialCases normal.\n             * @member {string} normal\n             * @memberof jspb.test.SpecialCases\n             * @instance\n             */\n            SpecialCases.prototype.normal = \"\";\n\n            /**\n             * SpecialCases default.\n             * @member {string} default\n             * @memberof jspb.test.SpecialCases\n             * @instance\n             */\n            SpecialCases.prototype[\"default\"] = \"\";\n\n            /**\n             * SpecialCases function.\n             * @member {string} function\n             * @memberof jspb.test.SpecialCases\n             * @instance\n             */\n            SpecialCases.prototype[\"function\"] = \"\";\n\n            /**\n             * SpecialCases var.\n             * @member {string} var\n             * @memberof jspb.test.SpecialCases\n             * @instance\n             */\n            SpecialCases.prototype[\"var\"] = \"\";\n\n            /**\n             * Creates a new SpecialCases instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {jspb.test.ISpecialCases=} [properties] Properties to set\n             * @returns {jspb.test.SpecialCases} SpecialCases instance\n             */\n            SpecialCases.create = function create(properties) {\n                return new SpecialCases(properties);\n            };\n\n            /**\n             * Encodes the specified SpecialCases message. Does not implicitly {@link jspb.test.SpecialCases.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {jspb.test.ISpecialCases} message SpecialCases message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            SpecialCases.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.normal);\n                writer.uint32(/* id 2, wireType 2 =*/18).string(message[\"default\"]);\n                writer.uint32(/* id 3, wireType 2 =*/26).string(message[\"function\"]);\n                writer.uint32(/* id 4, wireType 2 =*/34).string(message[\"var\"]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified SpecialCases message, length delimited. Does not implicitly {@link jspb.test.SpecialCases.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {jspb.test.ISpecialCases} message SpecialCases message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            SpecialCases.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a SpecialCases message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.SpecialCases} SpecialCases\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            SpecialCases.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.SpecialCases();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.normal = reader.string();\n                        break;\n                    case 2:\n                        message[\"default\"] = reader.string();\n                        break;\n                    case 3:\n                        message[\"function\"] = reader.string();\n                        break;\n                    case 4:\n                        message[\"var\"] = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"normal\"))\n                    throw $util.ProtocolError(\"missing required 'normal'\", { instance: message });\n                if (!message.hasOwnProperty(\"default\"))\n                    throw $util.ProtocolError(\"missing required 'default'\", { instance: message });\n                if (!message.hasOwnProperty(\"function\"))\n                    throw $util.ProtocolError(\"missing required 'function'\", { instance: message });\n                if (!message.hasOwnProperty(\"var\"))\n                    throw $util.ProtocolError(\"missing required 'var'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a SpecialCases message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.SpecialCases} SpecialCases\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            SpecialCases.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a SpecialCases message.\n             * @function verify\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            SpecialCases.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (!$util.isString(message.normal))\n                    return \"normal: string expected\";\n                if (!$util.isString(message[\"default\"]))\n                    return \"default: string expected\";\n                if (!$util.isString(message[\"function\"]))\n                    return \"function: string expected\";\n                if (!$util.isString(message[\"var\"]))\n                    return \"var: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a SpecialCases message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.SpecialCases} SpecialCases\n             */\n            SpecialCases.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.SpecialCases)\n                    return object;\n                var message = new $root.jspb.test.SpecialCases();\n                if (object.normal != null)\n                    message.normal = String(object.normal);\n                if (object[\"default\"] != null)\n                    message[\"default\"] = String(object[\"default\"]);\n                if (object[\"function\"] != null)\n                    message[\"function\"] = String(object[\"function\"]);\n                if (object[\"var\"] != null)\n                    message[\"var\"] = String(object[\"var\"]);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a SpecialCases message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {jspb.test.SpecialCases} message SpecialCases\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            SpecialCases.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.normal = \"\";\n                    object[\"default\"] = \"\";\n                    object[\"function\"] = \"\";\n                    object[\"var\"] = \"\";\n                }\n                if (message.normal != null && message.hasOwnProperty(\"normal\"))\n                    object.normal = message.normal;\n                if (message[\"default\"] != null && message.hasOwnProperty(\"default\"))\n                    object[\"default\"] = message[\"default\"];\n                if (message[\"function\"] != null && message.hasOwnProperty(\"function\"))\n                    object[\"function\"] = message[\"function\"];\n                if (message[\"var\"] != null && message.hasOwnProperty(\"var\"))\n                    object[\"var\"] = message[\"var\"];\n                return object;\n            };\n\n            /**\n             * Converts this SpecialCases to JSON.\n             * @function toJSON\n             * @memberof jspb.test.SpecialCases\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            SpecialCases.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for SpecialCases\n             * @function getTypeUrl\n             * @memberof jspb.test.SpecialCases\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            SpecialCases.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.SpecialCases\";\n            };\n\n            return SpecialCases;\n        })();\n\n        test.OptionalFields = (function() {\n\n            /**\n             * Properties of an OptionalFields.\n             * @memberof jspb.test\n             * @interface IOptionalFields\n             * @property {string|null} [aString] OptionalFields aString\n             * @property {boolean} aBool OptionalFields aBool\n             * @property {jspb.test.OptionalFields.INested|null} [aNestedMessage] OptionalFields aNestedMessage\n             * @property {Array.<jspb.test.OptionalFields.INested>|null} [aRepeatedMessage] OptionalFields aRepeatedMessage\n             * @property {Array.<string>|null} [aRepeatedString] OptionalFields aRepeatedString\n             */\n\n            /**\n             * Constructs a new OptionalFields.\n             * @memberof jspb.test\n             * @classdesc Represents an OptionalFields.\n             * @implements IOptionalFields\n             * @constructor\n             * @param {jspb.test.IOptionalFields=} [properties] Properties to set\n             */\n            function OptionalFields(properties) {\n                this.aRepeatedMessage = [];\n                this.aRepeatedString = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * OptionalFields aString.\n             * @member {string} aString\n             * @memberof jspb.test.OptionalFields\n             * @instance\n             */\n            OptionalFields.prototype.aString = \"\";\n\n            /**\n             * OptionalFields aBool.\n             * @member {boolean} aBool\n             * @memberof jspb.test.OptionalFields\n             * @instance\n             */\n            OptionalFields.prototype.aBool = false;\n\n            /**\n             * OptionalFields aNestedMessage.\n             * @member {jspb.test.OptionalFields.INested|null|undefined} aNestedMessage\n             * @memberof jspb.test.OptionalFields\n             * @instance\n             */\n            OptionalFields.prototype.aNestedMessage = null;\n\n            /**\n             * OptionalFields aRepeatedMessage.\n             * @member {Array.<jspb.test.OptionalFields.INested>} aRepeatedMessage\n             * @memberof jspb.test.OptionalFields\n             * @instance\n             */\n            OptionalFields.prototype.aRepeatedMessage = $util.emptyArray;\n\n            /**\n             * OptionalFields aRepeatedString.\n             * @member {Array.<string>} aRepeatedString\n             * @memberof jspb.test.OptionalFields\n             * @instance\n             */\n            OptionalFields.prototype.aRepeatedString = $util.emptyArray;\n\n            /**\n             * Creates a new OptionalFields instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {jspb.test.IOptionalFields=} [properties] Properties to set\n             * @returns {jspb.test.OptionalFields} OptionalFields instance\n             */\n            OptionalFields.create = function create(properties) {\n                return new OptionalFields(properties);\n            };\n\n            /**\n             * Encodes the specified OptionalFields message. Does not implicitly {@link jspb.test.OptionalFields.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {jspb.test.IOptionalFields} message OptionalFields message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OptionalFields.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.aString != null && Object.hasOwnProperty.call(message, \"aString\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString);\n                writer.uint32(/* id 2, wireType 0 =*/16).bool(message.aBool);\n                if (message.aNestedMessage != null && Object.hasOwnProperty.call(message, \"aNestedMessage\"))\n                    $root.jspb.test.OptionalFields.Nested.encode(message.aNestedMessage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                if (message.aRepeatedMessage != null && message.aRepeatedMessage.length)\n                    for (var i = 0; i < message.aRepeatedMessage.length; ++i)\n                        $root.jspb.test.OptionalFields.Nested.encode(message.aRepeatedMessage[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.aRepeatedString != null && message.aRepeatedString.length)\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        writer.uint32(/* id 5, wireType 2 =*/42).string(message.aRepeatedString[i]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified OptionalFields message, length delimited. Does not implicitly {@link jspb.test.OptionalFields.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {jspb.test.IOptionalFields} message OptionalFields message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OptionalFields.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an OptionalFields message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.OptionalFields} OptionalFields\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OptionalFields.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.OptionalFields();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.aString = reader.string();\n                        break;\n                    case 2:\n                        message.aBool = reader.bool();\n                        break;\n                    case 3:\n                        message.aNestedMessage = $root.jspb.test.OptionalFields.Nested.decode(reader, reader.uint32());\n                        break;\n                    case 4:\n                        if (!(message.aRepeatedMessage && message.aRepeatedMessage.length))\n                            message.aRepeatedMessage = [];\n                        message.aRepeatedMessage.push($root.jspb.test.OptionalFields.Nested.decode(reader, reader.uint32()));\n                        break;\n                    case 5:\n                        if (!(message.aRepeatedString && message.aRepeatedString.length))\n                            message.aRepeatedString = [];\n                        message.aRepeatedString.push(reader.string());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"aBool\"))\n                    throw $util.ProtocolError(\"missing required 'aBool'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes an OptionalFields message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.OptionalFields} OptionalFields\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OptionalFields.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an OptionalFields message.\n             * @function verify\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            OptionalFields.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.aString != null && message.hasOwnProperty(\"aString\"))\n                    if (!$util.isString(message.aString))\n                        return \"aString: string expected\";\n                if (typeof message.aBool !== \"boolean\")\n                    return \"aBool: boolean expected\";\n                if (message.aNestedMessage != null && message.hasOwnProperty(\"aNestedMessage\")) {\n                    var error = $root.jspb.test.OptionalFields.Nested.verify(message.aNestedMessage);\n                    if (error)\n                        return \"aNestedMessage.\" + error;\n                }\n                if (message.aRepeatedMessage != null && message.hasOwnProperty(\"aRepeatedMessage\")) {\n                    if (!Array.isArray(message.aRepeatedMessage))\n                        return \"aRepeatedMessage: array expected\";\n                    for (var i = 0; i < message.aRepeatedMessage.length; ++i) {\n                        var error = $root.jspb.test.OptionalFields.Nested.verify(message.aRepeatedMessage[i]);\n                        if (error)\n                            return \"aRepeatedMessage.\" + error;\n                    }\n                }\n                if (message.aRepeatedString != null && message.hasOwnProperty(\"aRepeatedString\")) {\n                    if (!Array.isArray(message.aRepeatedString))\n                        return \"aRepeatedString: array expected\";\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        if (!$util.isString(message.aRepeatedString[i]))\n                            return \"aRepeatedString: string[] expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates an OptionalFields message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.OptionalFields} OptionalFields\n             */\n            OptionalFields.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.OptionalFields)\n                    return object;\n                var message = new $root.jspb.test.OptionalFields();\n                if (object.aString != null)\n                    message.aString = String(object.aString);\n                if (object.aBool != null)\n                    message.aBool = Boolean(object.aBool);\n                if (object.aNestedMessage != null) {\n                    if (typeof object.aNestedMessage !== \"object\")\n                        throw TypeError(\".jspb.test.OptionalFields.aNestedMessage: object expected\");\n                    message.aNestedMessage = $root.jspb.test.OptionalFields.Nested.fromObject(object.aNestedMessage);\n                }\n                if (object.aRepeatedMessage) {\n                    if (!Array.isArray(object.aRepeatedMessage))\n                        throw TypeError(\".jspb.test.OptionalFields.aRepeatedMessage: array expected\");\n                    message.aRepeatedMessage = [];\n                    for (var i = 0; i < object.aRepeatedMessage.length; ++i) {\n                        if (typeof object.aRepeatedMessage[i] !== \"object\")\n                            throw TypeError(\".jspb.test.OptionalFields.aRepeatedMessage: object expected\");\n                        message.aRepeatedMessage[i] = $root.jspb.test.OptionalFields.Nested.fromObject(object.aRepeatedMessage[i]);\n                    }\n                }\n                if (object.aRepeatedString) {\n                    if (!Array.isArray(object.aRepeatedString))\n                        throw TypeError(\".jspb.test.OptionalFields.aRepeatedString: array expected\");\n                    message.aRepeatedString = [];\n                    for (var i = 0; i < object.aRepeatedString.length; ++i)\n                        message.aRepeatedString[i] = String(object.aRepeatedString[i]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an OptionalFields message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {jspb.test.OptionalFields} message OptionalFields\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            OptionalFields.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.aRepeatedMessage = [];\n                    object.aRepeatedString = [];\n                }\n                if (options.defaults) {\n                    object.aString = \"\";\n                    object.aBool = false;\n                    object.aNestedMessage = null;\n                }\n                if (message.aString != null && message.hasOwnProperty(\"aString\"))\n                    object.aString = message.aString;\n                if (message.aBool != null && message.hasOwnProperty(\"aBool\"))\n                    object.aBool = message.aBool;\n                if (message.aNestedMessage != null && message.hasOwnProperty(\"aNestedMessage\"))\n                    object.aNestedMessage = $root.jspb.test.OptionalFields.Nested.toObject(message.aNestedMessage, options);\n                if (message.aRepeatedMessage && message.aRepeatedMessage.length) {\n                    object.aRepeatedMessage = [];\n                    for (var j = 0; j < message.aRepeatedMessage.length; ++j)\n                        object.aRepeatedMessage[j] = $root.jspb.test.OptionalFields.Nested.toObject(message.aRepeatedMessage[j], options);\n                }\n                if (message.aRepeatedString && message.aRepeatedString.length) {\n                    object.aRepeatedString = [];\n                    for (var j = 0; j < message.aRepeatedString.length; ++j)\n                        object.aRepeatedString[j] = message.aRepeatedString[j];\n                }\n                return object;\n            };\n\n            /**\n             * Converts this OptionalFields to JSON.\n             * @function toJSON\n             * @memberof jspb.test.OptionalFields\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            OptionalFields.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for OptionalFields\n             * @function getTypeUrl\n             * @memberof jspb.test.OptionalFields\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            OptionalFields.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.OptionalFields\";\n            };\n\n            OptionalFields.Nested = (function() {\n\n                /**\n                 * Properties of a Nested.\n                 * @memberof jspb.test.OptionalFields\n                 * @interface INested\n                 * @property {number|null} [anInt] Nested anInt\n                 */\n\n                /**\n                 * Constructs a new Nested.\n                 * @memberof jspb.test.OptionalFields\n                 * @classdesc Represents a Nested.\n                 * @implements INested\n                 * @constructor\n                 * @param {jspb.test.OptionalFields.INested=} [properties] Properties to set\n                 */\n                function Nested(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Nested anInt.\n                 * @member {number} anInt\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @instance\n                 */\n                Nested.prototype.anInt = 0;\n\n                /**\n                 * Creates a new Nested instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {jspb.test.OptionalFields.INested=} [properties] Properties to set\n                 * @returns {jspb.test.OptionalFields.Nested} Nested instance\n                 */\n                Nested.create = function create(properties) {\n                    return new Nested(properties);\n                };\n\n                /**\n                 * Encodes the specified Nested message. Does not implicitly {@link jspb.test.OptionalFields.Nested.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {jspb.test.OptionalFields.INested} message Nested message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Nested.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.anInt != null && Object.hasOwnProperty.call(message, \"anInt\"))\n                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.anInt);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Nested message, length delimited. Does not implicitly {@link jspb.test.OptionalFields.Nested.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {jspb.test.OptionalFields.INested} message Nested message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Nested.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a Nested message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.OptionalFields.Nested} Nested\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Nested.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.OptionalFields.Nested();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.anInt = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a Nested message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.OptionalFields.Nested} Nested\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Nested.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a Nested message.\n                 * @function verify\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Nested.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.anInt != null && message.hasOwnProperty(\"anInt\"))\n                        if (!$util.isInteger(message.anInt))\n                            return \"anInt: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a Nested message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.OptionalFields.Nested} Nested\n                 */\n                Nested.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.OptionalFields.Nested)\n                        return object;\n                    var message = new $root.jspb.test.OptionalFields.Nested();\n                    if (object.anInt != null)\n                        message.anInt = object.anInt | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a Nested message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {jspb.test.OptionalFields.Nested} message Nested\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Nested.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults)\n                        object.anInt = 0;\n                    if (message.anInt != null && message.hasOwnProperty(\"anInt\"))\n                        object.anInt = message.anInt;\n                    return object;\n                };\n\n                /**\n                 * Converts this Nested to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Nested.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for Nested\n                 * @function getTypeUrl\n                 * @memberof jspb.test.OptionalFields.Nested\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                Nested.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.OptionalFields.Nested\";\n                };\n\n                return Nested;\n            })();\n\n            return OptionalFields;\n        })();\n\n        test.HasExtensions = (function() {\n\n            /**\n             * Properties of a HasExtensions.\n             * @memberof jspb.test\n             * @interface IHasExtensions\n             * @property {string|null} [str1] HasExtensions str1\n             * @property {string|null} [str2] HasExtensions str2\n             * @property {string|null} [str3] HasExtensions str3\n             * @property {jspb.test.IIsExtension|null} [\".jspb.test.IsExtension.extField\"] HasExtensions .jspb.test.IsExtension.extField\n             * @property {jspb.test.ISimple1|null} [\".jspb.test.IndirectExtension.simple\"] HasExtensions .jspb.test.IndirectExtension.simple\n             * @property {string|null} [\".jspb.test.IndirectExtension.str\"] HasExtensions .jspb.test.IndirectExtension.str\n             * @property {Array.<string>|null} [\".jspb.test.IndirectExtension.repeatedStr\"] HasExtensions .jspb.test.IndirectExtension.repeatedStr\n             * @property {Array.<jspb.test.ISimple1>|null} [\".jspb.test.IndirectExtension.repeatedSimple\"] HasExtensions .jspb.test.IndirectExtension.repeatedSimple\n             * @property {jspb.test.ISimple1|null} [\".jspb.test.simple1\"] HasExtensions .jspb.test.simple1\n             */\n\n            /**\n             * Constructs a new HasExtensions.\n             * @memberof jspb.test\n             * @classdesc Represents a HasExtensions.\n             * @implements IHasExtensions\n             * @constructor\n             * @param {jspb.test.IHasExtensions=} [properties] Properties to set\n             */\n            function HasExtensions(properties) {\n                this[\".jspb.test.IndirectExtension.repeatedStr\"] = [];\n                this[\".jspb.test.IndirectExtension.repeatedSimple\"] = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * HasExtensions str1.\n             * @member {string} str1\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype.str1 = \"\";\n\n            /**\n             * HasExtensions str2.\n             * @member {string} str2\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype.str2 = \"\";\n\n            /**\n             * HasExtensions str3.\n             * @member {string} str3\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype.str3 = \"\";\n\n            /**\n             * HasExtensions .jspb.test.IsExtension.extField.\n             * @member {jspb.test.IIsExtension|null|undefined} .jspb.test.IsExtension.extField\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype[\".jspb.test.IsExtension.extField\"] = null;\n\n            /**\n             * HasExtensions .jspb.test.IndirectExtension.simple.\n             * @member {jspb.test.ISimple1|null|undefined} .jspb.test.IndirectExtension.simple\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype[\".jspb.test.IndirectExtension.simple\"] = null;\n\n            /**\n             * HasExtensions .jspb.test.IndirectExtension.str.\n             * @member {string} .jspb.test.IndirectExtension.str\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype[\".jspb.test.IndirectExtension.str\"] = \"\";\n\n            /**\n             * HasExtensions .jspb.test.IndirectExtension.repeatedStr.\n             * @member {Array.<string>} .jspb.test.IndirectExtension.repeatedStr\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype[\".jspb.test.IndirectExtension.repeatedStr\"] = $util.emptyArray;\n\n            /**\n             * HasExtensions .jspb.test.IndirectExtension.repeatedSimple.\n             * @member {Array.<jspb.test.ISimple1>} .jspb.test.IndirectExtension.repeatedSimple\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype[\".jspb.test.IndirectExtension.repeatedSimple\"] = $util.emptyArray;\n\n            /**\n             * HasExtensions .jspb.test.simple1.\n             * @member {jspb.test.ISimple1|null|undefined} .jspb.test.simple1\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             */\n            HasExtensions.prototype[\".jspb.test.simple1\"] = null;\n\n            /**\n             * Creates a new HasExtensions instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {jspb.test.IHasExtensions=} [properties] Properties to set\n             * @returns {jspb.test.HasExtensions} HasExtensions instance\n             */\n            HasExtensions.create = function create(properties) {\n                return new HasExtensions(properties);\n            };\n\n            /**\n             * Encodes the specified HasExtensions message. Does not implicitly {@link jspb.test.HasExtensions.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {jspb.test.IHasExtensions} message HasExtensions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            HasExtensions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.str1 != null && Object.hasOwnProperty.call(message, \"str1\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.str1);\n                if (message.str2 != null && Object.hasOwnProperty.call(message, \"str2\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.str2);\n                if (message.str3 != null && Object.hasOwnProperty.call(message, \"str3\"))\n                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.str3);\n                if (message[\".jspb.test.IsExtension.extField\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.IsExtension.extField\"))\n                    $root.jspb.test.IsExtension.encode(message[\".jspb.test.IsExtension.extField\"], writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim();\n                if (message[\".jspb.test.IndirectExtension.simple\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.IndirectExtension.simple\"))\n                    $root.jspb.test.Simple1.encode(message[\".jspb.test.IndirectExtension.simple\"], writer.uint32(/* id 101, wireType 2 =*/810).fork()).ldelim();\n                if (message[\".jspb.test.IndirectExtension.str\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.IndirectExtension.str\"))\n                    writer.uint32(/* id 102, wireType 2 =*/818).string(message[\".jspb.test.IndirectExtension.str\"]);\n                if (message[\".jspb.test.IndirectExtension.repeatedStr\"] != null && message[\".jspb.test.IndirectExtension.repeatedStr\"].length)\n                    for (var i = 0; i < message[\".jspb.test.IndirectExtension.repeatedStr\"].length; ++i)\n                        writer.uint32(/* id 103, wireType 2 =*/826).string(message[\".jspb.test.IndirectExtension.repeatedStr\"][i]);\n                if (message[\".jspb.test.IndirectExtension.repeatedSimple\"] != null && message[\".jspb.test.IndirectExtension.repeatedSimple\"].length)\n                    for (var i = 0; i < message[\".jspb.test.IndirectExtension.repeatedSimple\"].length; ++i)\n                        $root.jspb.test.Simple1.encode(message[\".jspb.test.IndirectExtension.repeatedSimple\"][i], writer.uint32(/* id 104, wireType 2 =*/834).fork()).ldelim();\n                if (message[\".jspb.test.simple1\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.simple1\"))\n                    $root.jspb.test.Simple1.encode(message[\".jspb.test.simple1\"], writer.uint32(/* id 105, wireType 2 =*/842).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified HasExtensions message, length delimited. Does not implicitly {@link jspb.test.HasExtensions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {jspb.test.IHasExtensions} message HasExtensions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            HasExtensions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a HasExtensions message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.HasExtensions} HasExtensions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            HasExtensions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.HasExtensions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.str1 = reader.string();\n                        break;\n                    case 2:\n                        message.str2 = reader.string();\n                        break;\n                    case 3:\n                        message.str3 = reader.string();\n                        break;\n                    case 100:\n                        message[\".jspb.test.IsExtension.extField\"] = $root.jspb.test.IsExtension.decode(reader, reader.uint32());\n                        break;\n                    case 101:\n                        message[\".jspb.test.IndirectExtension.simple\"] = $root.jspb.test.Simple1.decode(reader, reader.uint32());\n                        break;\n                    case 102:\n                        message[\".jspb.test.IndirectExtension.str\"] = reader.string();\n                        break;\n                    case 103:\n                        if (!(message[\".jspb.test.IndirectExtension.repeatedStr\"] && message[\".jspb.test.IndirectExtension.repeatedStr\"].length))\n                            message[\".jspb.test.IndirectExtension.repeatedStr\"] = [];\n                        message[\".jspb.test.IndirectExtension.repeatedStr\"].push(reader.string());\n                        break;\n                    case 104:\n                        if (!(message[\".jspb.test.IndirectExtension.repeatedSimple\"] && message[\".jspb.test.IndirectExtension.repeatedSimple\"].length))\n                            message[\".jspb.test.IndirectExtension.repeatedSimple\"] = [];\n                        message[\".jspb.test.IndirectExtension.repeatedSimple\"].push($root.jspb.test.Simple1.decode(reader, reader.uint32()));\n                        break;\n                    case 105:\n                        message[\".jspb.test.simple1\"] = $root.jspb.test.Simple1.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a HasExtensions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.HasExtensions} HasExtensions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            HasExtensions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a HasExtensions message.\n             * @function verify\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            HasExtensions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.str1 != null && message.hasOwnProperty(\"str1\"))\n                    if (!$util.isString(message.str1))\n                        return \"str1: string expected\";\n                if (message.str2 != null && message.hasOwnProperty(\"str2\"))\n                    if (!$util.isString(message.str2))\n                        return \"str2: string expected\";\n                if (message.str3 != null && message.hasOwnProperty(\"str3\"))\n                    if (!$util.isString(message.str3))\n                        return \"str3: string expected\";\n                if (message[\".jspb.test.IsExtension.extField\"] != null && message.hasOwnProperty(\".jspb.test.IsExtension.extField\")) {\n                    var error = $root.jspb.test.IsExtension.verify(message[\".jspb.test.IsExtension.extField\"]);\n                    if (error)\n                        return \".jspb.test.IsExtension.extField.\" + error;\n                }\n                if (message[\".jspb.test.IndirectExtension.simple\"] != null && message.hasOwnProperty(\".jspb.test.IndirectExtension.simple\")) {\n                    var error = $root.jspb.test.Simple1.verify(message[\".jspb.test.IndirectExtension.simple\"]);\n                    if (error)\n                        return \".jspb.test.IndirectExtension.simple.\" + error;\n                }\n                if (message[\".jspb.test.IndirectExtension.str\"] != null && message.hasOwnProperty(\".jspb.test.IndirectExtension.str\"))\n                    if (!$util.isString(message[\".jspb.test.IndirectExtension.str\"]))\n                        return \".jspb.test.IndirectExtension.str: string expected\";\n                if (message[\".jspb.test.IndirectExtension.repeatedStr\"] != null && message.hasOwnProperty(\".jspb.test.IndirectExtension.repeatedStr\")) {\n                    if (!Array.isArray(message[\".jspb.test.IndirectExtension.repeatedStr\"]))\n                        return \".jspb.test.IndirectExtension.repeatedStr: array expected\";\n                    for (var i = 0; i < message[\".jspb.test.IndirectExtension.repeatedStr\"].length; ++i)\n                        if (!$util.isString(message[\".jspb.test.IndirectExtension.repeatedStr\"][i]))\n                            return \".jspb.test.IndirectExtension.repeatedStr: string[] expected\";\n                }\n                if (message[\".jspb.test.IndirectExtension.repeatedSimple\"] != null && message.hasOwnProperty(\".jspb.test.IndirectExtension.repeatedSimple\")) {\n                    if (!Array.isArray(message[\".jspb.test.IndirectExtension.repeatedSimple\"]))\n                        return \".jspb.test.IndirectExtension.repeatedSimple: array expected\";\n                    for (var i = 0; i < message[\".jspb.test.IndirectExtension.repeatedSimple\"].length; ++i) {\n                        var error = $root.jspb.test.Simple1.verify(message[\".jspb.test.IndirectExtension.repeatedSimple\"][i]);\n                        if (error)\n                            return \".jspb.test.IndirectExtension.repeatedSimple.\" + error;\n                    }\n                }\n                if (message[\".jspb.test.simple1\"] != null && message.hasOwnProperty(\".jspb.test.simple1\")) {\n                    var error = $root.jspb.test.Simple1.verify(message[\".jspb.test.simple1\"]);\n                    if (error)\n                        return \".jspb.test.simple1.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a HasExtensions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.HasExtensions} HasExtensions\n             */\n            HasExtensions.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.HasExtensions)\n                    return object;\n                var message = new $root.jspb.test.HasExtensions();\n                if (object.str1 != null)\n                    message.str1 = String(object.str1);\n                if (object.str2 != null)\n                    message.str2 = String(object.str2);\n                if (object.str3 != null)\n                    message.str3 = String(object.str3);\n                if (object[\".jspb.test.IsExtension.extField\"] != null) {\n                    if (typeof object[\".jspb.test.IsExtension.extField\"] !== \"object\")\n                        throw TypeError(\".jspb.test.HasExtensions..jspb.test.IsExtension.extField: object expected\");\n                    message[\".jspb.test.IsExtension.extField\"] = $root.jspb.test.IsExtension.fromObject(object[\".jspb.test.IsExtension.extField\"]);\n                }\n                if (object[\".jspb.test.IndirectExtension.simple\"] != null) {\n                    if (typeof object[\".jspb.test.IndirectExtension.simple\"] !== \"object\")\n                        throw TypeError(\".jspb.test.HasExtensions..jspb.test.IndirectExtension.simple: object expected\");\n                    message[\".jspb.test.IndirectExtension.simple\"] = $root.jspb.test.Simple1.fromObject(object[\".jspb.test.IndirectExtension.simple\"]);\n                }\n                if (object[\".jspb.test.IndirectExtension.str\"] != null)\n                    message[\".jspb.test.IndirectExtension.str\"] = String(object[\".jspb.test.IndirectExtension.str\"]);\n                if (object[\".jspb.test.IndirectExtension.repeatedStr\"]) {\n                    if (!Array.isArray(object[\".jspb.test.IndirectExtension.repeatedStr\"]))\n                        throw TypeError(\".jspb.test.HasExtensions..jspb.test.IndirectExtension.repeatedStr: array expected\");\n                    message[\".jspb.test.IndirectExtension.repeatedStr\"] = [];\n                    for (var i = 0; i < object[\".jspb.test.IndirectExtension.repeatedStr\"].length; ++i)\n                        message[\".jspb.test.IndirectExtension.repeatedStr\"][i] = String(object[\".jspb.test.IndirectExtension.repeatedStr\"][i]);\n                }\n                if (object[\".jspb.test.IndirectExtension.repeatedSimple\"]) {\n                    if (!Array.isArray(object[\".jspb.test.IndirectExtension.repeatedSimple\"]))\n                        throw TypeError(\".jspb.test.HasExtensions..jspb.test.IndirectExtension.repeatedSimple: array expected\");\n                    message[\".jspb.test.IndirectExtension.repeatedSimple\"] = [];\n                    for (var i = 0; i < object[\".jspb.test.IndirectExtension.repeatedSimple\"].length; ++i) {\n                        if (typeof object[\".jspb.test.IndirectExtension.repeatedSimple\"][i] !== \"object\")\n                            throw TypeError(\".jspb.test.HasExtensions..jspb.test.IndirectExtension.repeatedSimple: object expected\");\n                        message[\".jspb.test.IndirectExtension.repeatedSimple\"][i] = $root.jspb.test.Simple1.fromObject(object[\".jspb.test.IndirectExtension.repeatedSimple\"][i]);\n                    }\n                }\n                if (object[\".jspb.test.simple1\"] != null) {\n                    if (typeof object[\".jspb.test.simple1\"] !== \"object\")\n                        throw TypeError(\".jspb.test.HasExtensions..jspb.test.simple1: object expected\");\n                    message[\".jspb.test.simple1\"] = $root.jspb.test.Simple1.fromObject(object[\".jspb.test.simple1\"]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a HasExtensions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {jspb.test.HasExtensions} message HasExtensions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            HasExtensions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object[\".jspb.test.IndirectExtension.repeatedStr\"] = [];\n                    object[\".jspb.test.IndirectExtension.repeatedSimple\"] = [];\n                }\n                if (options.defaults) {\n                    object.str1 = \"\";\n                    object.str2 = \"\";\n                    object.str3 = \"\";\n                    object[\".jspb.test.IsExtension.extField\"] = null;\n                    object[\".jspb.test.IndirectExtension.simple\"] = null;\n                    object[\".jspb.test.IndirectExtension.str\"] = \"\";\n                    object[\".jspb.test.simple1\"] = null;\n                }\n                if (message.str1 != null && message.hasOwnProperty(\"str1\"))\n                    object.str1 = message.str1;\n                if (message.str2 != null && message.hasOwnProperty(\"str2\"))\n                    object.str2 = message.str2;\n                if (message.str3 != null && message.hasOwnProperty(\"str3\"))\n                    object.str3 = message.str3;\n                if (message[\".jspb.test.IsExtension.extField\"] != null && message.hasOwnProperty(\".jspb.test.IsExtension.extField\"))\n                    object[\".jspb.test.IsExtension.extField\"] = $root.jspb.test.IsExtension.toObject(message[\".jspb.test.IsExtension.extField\"], options);\n                if (message[\".jspb.test.IndirectExtension.simple\"] != null && message.hasOwnProperty(\".jspb.test.IndirectExtension.simple\"))\n                    object[\".jspb.test.IndirectExtension.simple\"] = $root.jspb.test.Simple1.toObject(message[\".jspb.test.IndirectExtension.simple\"], options);\n                if (message[\".jspb.test.IndirectExtension.str\"] != null && message.hasOwnProperty(\".jspb.test.IndirectExtension.str\"))\n                    object[\".jspb.test.IndirectExtension.str\"] = message[\".jspb.test.IndirectExtension.str\"];\n                if (message[\".jspb.test.IndirectExtension.repeatedStr\"] && message[\".jspb.test.IndirectExtension.repeatedStr\"].length) {\n                    object[\".jspb.test.IndirectExtension.repeatedStr\"] = [];\n                    for (var j = 0; j < message[\".jspb.test.IndirectExtension.repeatedStr\"].length; ++j)\n                        object[\".jspb.test.IndirectExtension.repeatedStr\"][j] = message[\".jspb.test.IndirectExtension.repeatedStr\"][j];\n                }\n                if (message[\".jspb.test.IndirectExtension.repeatedSimple\"] && message[\".jspb.test.IndirectExtension.repeatedSimple\"].length) {\n                    object[\".jspb.test.IndirectExtension.repeatedSimple\"] = [];\n                    for (var j = 0; j < message[\".jspb.test.IndirectExtension.repeatedSimple\"].length; ++j)\n                        object[\".jspb.test.IndirectExtension.repeatedSimple\"][j] = $root.jspb.test.Simple1.toObject(message[\".jspb.test.IndirectExtension.repeatedSimple\"][j], options);\n                }\n                if (message[\".jspb.test.simple1\"] != null && message.hasOwnProperty(\".jspb.test.simple1\"))\n                    object[\".jspb.test.simple1\"] = $root.jspb.test.Simple1.toObject(message[\".jspb.test.simple1\"], options);\n                return object;\n            };\n\n            /**\n             * Converts this HasExtensions to JSON.\n             * @function toJSON\n             * @memberof jspb.test.HasExtensions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            HasExtensions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for HasExtensions\n             * @function getTypeUrl\n             * @memberof jspb.test.HasExtensions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            HasExtensions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.HasExtensions\";\n            };\n\n            return HasExtensions;\n        })();\n\n        test.Complex = (function() {\n\n            /**\n             * Properties of a Complex.\n             * @memberof jspb.test\n             * @interface IComplex\n             * @property {string} aString Complex aString\n             * @property {boolean} anOutOfOrderBool Complex anOutOfOrderBool\n             * @property {jspb.test.Complex.INested|null} [aNestedMessage] Complex aNestedMessage\n             * @property {Array.<jspb.test.Complex.INested>|null} [aRepeatedMessage] Complex aRepeatedMessage\n             * @property {Array.<string>|null} [aRepeatedString] Complex aRepeatedString\n             */\n\n            /**\n             * Constructs a new Complex.\n             * @memberof jspb.test\n             * @classdesc Represents a Complex.\n             * @implements IComplex\n             * @constructor\n             * @param {jspb.test.IComplex=} [properties] Properties to set\n             */\n            function Complex(properties) {\n                this.aRepeatedMessage = [];\n                this.aRepeatedString = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Complex aString.\n             * @member {string} aString\n             * @memberof jspb.test.Complex\n             * @instance\n             */\n            Complex.prototype.aString = \"\";\n\n            /**\n             * Complex anOutOfOrderBool.\n             * @member {boolean} anOutOfOrderBool\n             * @memberof jspb.test.Complex\n             * @instance\n             */\n            Complex.prototype.anOutOfOrderBool = false;\n\n            /**\n             * Complex aNestedMessage.\n             * @member {jspb.test.Complex.INested|null|undefined} aNestedMessage\n             * @memberof jspb.test.Complex\n             * @instance\n             */\n            Complex.prototype.aNestedMessage = null;\n\n            /**\n             * Complex aRepeatedMessage.\n             * @member {Array.<jspb.test.Complex.INested>} aRepeatedMessage\n             * @memberof jspb.test.Complex\n             * @instance\n             */\n            Complex.prototype.aRepeatedMessage = $util.emptyArray;\n\n            /**\n             * Complex aRepeatedString.\n             * @member {Array.<string>} aRepeatedString\n             * @memberof jspb.test.Complex\n             * @instance\n             */\n            Complex.prototype.aRepeatedString = $util.emptyArray;\n\n            /**\n             * Creates a new Complex instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {jspb.test.IComplex=} [properties] Properties to set\n             * @returns {jspb.test.Complex} Complex instance\n             */\n            Complex.create = function create(properties) {\n                return new Complex(properties);\n            };\n\n            /**\n             * Encodes the specified Complex message. Does not implicitly {@link jspb.test.Complex.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {jspb.test.IComplex} message Complex message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Complex.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.aString);\n                if (message.aNestedMessage != null && Object.hasOwnProperty.call(message, \"aNestedMessage\"))\n                    $root.jspb.test.Complex.Nested.encode(message.aNestedMessage, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.aRepeatedMessage != null && message.aRepeatedMessage.length)\n                    for (var i = 0; i < message.aRepeatedMessage.length; ++i)\n                        $root.jspb.test.Complex.Nested.encode(message.aRepeatedMessage[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.aRepeatedString != null && message.aRepeatedString.length)\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        writer.uint32(/* id 7, wireType 2 =*/58).string(message.aRepeatedString[i]);\n                writer.uint32(/* id 9, wireType 0 =*/72).bool(message.anOutOfOrderBool);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Complex message, length delimited. Does not implicitly {@link jspb.test.Complex.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {jspb.test.IComplex} message Complex message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Complex.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Complex message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.Complex} Complex\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Complex.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Complex();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.aString = reader.string();\n                        break;\n                    case 9:\n                        message.anOutOfOrderBool = reader.bool();\n                        break;\n                    case 4:\n                        message.aNestedMessage = $root.jspb.test.Complex.Nested.decode(reader, reader.uint32());\n                        break;\n                    case 5:\n                        if (!(message.aRepeatedMessage && message.aRepeatedMessage.length))\n                            message.aRepeatedMessage = [];\n                        message.aRepeatedMessage.push($root.jspb.test.Complex.Nested.decode(reader, reader.uint32()));\n                        break;\n                    case 7:\n                        if (!(message.aRepeatedString && message.aRepeatedString.length))\n                            message.aRepeatedString = [];\n                        message.aRepeatedString.push(reader.string());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"aString\"))\n                    throw $util.ProtocolError(\"missing required 'aString'\", { instance: message });\n                if (!message.hasOwnProperty(\"anOutOfOrderBool\"))\n                    throw $util.ProtocolError(\"missing required 'anOutOfOrderBool'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a Complex message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.Complex} Complex\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Complex.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Complex message.\n             * @function verify\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Complex.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (!$util.isString(message.aString))\n                    return \"aString: string expected\";\n                if (typeof message.anOutOfOrderBool !== \"boolean\")\n                    return \"anOutOfOrderBool: boolean expected\";\n                if (message.aNestedMessage != null && message.hasOwnProperty(\"aNestedMessage\")) {\n                    var error = $root.jspb.test.Complex.Nested.verify(message.aNestedMessage);\n                    if (error)\n                        return \"aNestedMessage.\" + error;\n                }\n                if (message.aRepeatedMessage != null && message.hasOwnProperty(\"aRepeatedMessage\")) {\n                    if (!Array.isArray(message.aRepeatedMessage))\n                        return \"aRepeatedMessage: array expected\";\n                    for (var i = 0; i < message.aRepeatedMessage.length; ++i) {\n                        var error = $root.jspb.test.Complex.Nested.verify(message.aRepeatedMessage[i]);\n                        if (error)\n                            return \"aRepeatedMessage.\" + error;\n                    }\n                }\n                if (message.aRepeatedString != null && message.hasOwnProperty(\"aRepeatedString\")) {\n                    if (!Array.isArray(message.aRepeatedString))\n                        return \"aRepeatedString: array expected\";\n                    for (var i = 0; i < message.aRepeatedString.length; ++i)\n                        if (!$util.isString(message.aRepeatedString[i]))\n                            return \"aRepeatedString: string[] expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates a Complex message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.Complex} Complex\n             */\n            Complex.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.Complex)\n                    return object;\n                var message = new $root.jspb.test.Complex();\n                if (object.aString != null)\n                    message.aString = String(object.aString);\n                if (object.anOutOfOrderBool != null)\n                    message.anOutOfOrderBool = Boolean(object.anOutOfOrderBool);\n                if (object.aNestedMessage != null) {\n                    if (typeof object.aNestedMessage !== \"object\")\n                        throw TypeError(\".jspb.test.Complex.aNestedMessage: object expected\");\n                    message.aNestedMessage = $root.jspb.test.Complex.Nested.fromObject(object.aNestedMessage);\n                }\n                if (object.aRepeatedMessage) {\n                    if (!Array.isArray(object.aRepeatedMessage))\n                        throw TypeError(\".jspb.test.Complex.aRepeatedMessage: array expected\");\n                    message.aRepeatedMessage = [];\n                    for (var i = 0; i < object.aRepeatedMessage.length; ++i) {\n                        if (typeof object.aRepeatedMessage[i] !== \"object\")\n                            throw TypeError(\".jspb.test.Complex.aRepeatedMessage: object expected\");\n                        message.aRepeatedMessage[i] = $root.jspb.test.Complex.Nested.fromObject(object.aRepeatedMessage[i]);\n                    }\n                }\n                if (object.aRepeatedString) {\n                    if (!Array.isArray(object.aRepeatedString))\n                        throw TypeError(\".jspb.test.Complex.aRepeatedString: array expected\");\n                    message.aRepeatedString = [];\n                    for (var i = 0; i < object.aRepeatedString.length; ++i)\n                        message.aRepeatedString[i] = String(object.aRepeatedString[i]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a Complex message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {jspb.test.Complex} message Complex\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Complex.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.aRepeatedMessage = [];\n                    object.aRepeatedString = [];\n                }\n                if (options.defaults) {\n                    object.aString = \"\";\n                    object.aNestedMessage = null;\n                    object.anOutOfOrderBool = false;\n                }\n                if (message.aString != null && message.hasOwnProperty(\"aString\"))\n                    object.aString = message.aString;\n                if (message.aNestedMessage != null && message.hasOwnProperty(\"aNestedMessage\"))\n                    object.aNestedMessage = $root.jspb.test.Complex.Nested.toObject(message.aNestedMessage, options);\n                if (message.aRepeatedMessage && message.aRepeatedMessage.length) {\n                    object.aRepeatedMessage = [];\n                    for (var j = 0; j < message.aRepeatedMessage.length; ++j)\n                        object.aRepeatedMessage[j] = $root.jspb.test.Complex.Nested.toObject(message.aRepeatedMessage[j], options);\n                }\n                if (message.aRepeatedString && message.aRepeatedString.length) {\n                    object.aRepeatedString = [];\n                    for (var j = 0; j < message.aRepeatedString.length; ++j)\n                        object.aRepeatedString[j] = message.aRepeatedString[j];\n                }\n                if (message.anOutOfOrderBool != null && message.hasOwnProperty(\"anOutOfOrderBool\"))\n                    object.anOutOfOrderBool = message.anOutOfOrderBool;\n                return object;\n            };\n\n            /**\n             * Converts this Complex to JSON.\n             * @function toJSON\n             * @memberof jspb.test.Complex\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Complex.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Complex\n             * @function getTypeUrl\n             * @memberof jspb.test.Complex\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Complex.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.Complex\";\n            };\n\n            Complex.Nested = (function() {\n\n                /**\n                 * Properties of a Nested.\n                 * @memberof jspb.test.Complex\n                 * @interface INested\n                 * @property {number} anInt Nested anInt\n                 */\n\n                /**\n                 * Constructs a new Nested.\n                 * @memberof jspb.test.Complex\n                 * @classdesc Represents a Nested.\n                 * @implements INested\n                 * @constructor\n                 * @param {jspb.test.Complex.INested=} [properties] Properties to set\n                 */\n                function Nested(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Nested anInt.\n                 * @member {number} anInt\n                 * @memberof jspb.test.Complex.Nested\n                 * @instance\n                 */\n                Nested.prototype.anInt = 0;\n\n                /**\n                 * Creates a new Nested instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {jspb.test.Complex.INested=} [properties] Properties to set\n                 * @returns {jspb.test.Complex.Nested} Nested instance\n                 */\n                Nested.create = function create(properties) {\n                    return new Nested(properties);\n                };\n\n                /**\n                 * Encodes the specified Nested message. Does not implicitly {@link jspb.test.Complex.Nested.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {jspb.test.Complex.INested} message Nested message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Nested.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.anInt);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Nested message, length delimited. Does not implicitly {@link jspb.test.Complex.Nested.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {jspb.test.Complex.INested} message Nested message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Nested.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a Nested message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.Complex.Nested} Nested\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Nested.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Complex.Nested();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 2:\n                            message.anInt = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    if (!message.hasOwnProperty(\"anInt\"))\n                        throw $util.ProtocolError(\"missing required 'anInt'\", { instance: message });\n                    return message;\n                };\n\n                /**\n                 * Decodes a Nested message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.Complex.Nested} Nested\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Nested.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a Nested message.\n                 * @function verify\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Nested.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (!$util.isInteger(message.anInt))\n                        return \"anInt: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a Nested message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.Complex.Nested} Nested\n                 */\n                Nested.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.Complex.Nested)\n                        return object;\n                    var message = new $root.jspb.test.Complex.Nested();\n                    if (object.anInt != null)\n                        message.anInt = object.anInt | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a Nested message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {jspb.test.Complex.Nested} message Nested\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Nested.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults)\n                        object.anInt = 0;\n                    if (message.anInt != null && message.hasOwnProperty(\"anInt\"))\n                        object.anInt = message.anInt;\n                    return object;\n                };\n\n                /**\n                 * Converts this Nested to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.Complex.Nested\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Nested.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for Nested\n                 * @function getTypeUrl\n                 * @memberof jspb.test.Complex.Nested\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                Nested.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.Complex.Nested\";\n                };\n\n                return Nested;\n            })();\n\n            return Complex;\n        })();\n\n        test.OuterMessage = (function() {\n\n            /**\n             * Properties of an OuterMessage.\n             * @memberof jspb.test\n             * @interface IOuterMessage\n             */\n\n            /**\n             * Constructs a new OuterMessage.\n             * @memberof jspb.test\n             * @classdesc Represents an OuterMessage.\n             * @implements IOuterMessage\n             * @constructor\n             * @param {jspb.test.IOuterMessage=} [properties] Properties to set\n             */\n            function OuterMessage(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Creates a new OuterMessage instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {jspb.test.IOuterMessage=} [properties] Properties to set\n             * @returns {jspb.test.OuterMessage} OuterMessage instance\n             */\n            OuterMessage.create = function create(properties) {\n                return new OuterMessage(properties);\n            };\n\n            /**\n             * Encodes the specified OuterMessage message. Does not implicitly {@link jspb.test.OuterMessage.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {jspb.test.IOuterMessage} message OuterMessage message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OuterMessage.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified OuterMessage message, length delimited. Does not implicitly {@link jspb.test.OuterMessage.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {jspb.test.IOuterMessage} message OuterMessage message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OuterMessage.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an OuterMessage message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.OuterMessage} OuterMessage\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OuterMessage.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.OuterMessage();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an OuterMessage message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.OuterMessage} OuterMessage\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OuterMessage.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an OuterMessage message.\n             * @function verify\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            OuterMessage.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                return null;\n            };\n\n            /**\n             * Creates an OuterMessage message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.OuterMessage} OuterMessage\n             */\n            OuterMessage.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.OuterMessage)\n                    return object;\n                return new $root.jspb.test.OuterMessage();\n            };\n\n            /**\n             * Creates a plain object from an OuterMessage message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {jspb.test.OuterMessage} message OuterMessage\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            OuterMessage.toObject = function toObject() {\n                return {};\n            };\n\n            /**\n             * Converts this OuterMessage to JSON.\n             * @function toJSON\n             * @memberof jspb.test.OuterMessage\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            OuterMessage.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for OuterMessage\n             * @function getTypeUrl\n             * @memberof jspb.test.OuterMessage\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            OuterMessage.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.OuterMessage\";\n            };\n\n            OuterMessage.Complex = (function() {\n\n                /**\n                 * Properties of a Complex.\n                 * @memberof jspb.test.OuterMessage\n                 * @interface IComplex\n                 * @property {number|null} [innerComplexField] Complex innerComplexField\n                 */\n\n                /**\n                 * Constructs a new Complex.\n                 * @memberof jspb.test.OuterMessage\n                 * @classdesc Represents a Complex.\n                 * @implements IComplex\n                 * @constructor\n                 * @param {jspb.test.OuterMessage.IComplex=} [properties] Properties to set\n                 */\n                function Complex(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Complex innerComplexField.\n                 * @member {number} innerComplexField\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @instance\n                 */\n                Complex.prototype.innerComplexField = 0;\n\n                /**\n                 * Creates a new Complex instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {jspb.test.OuterMessage.IComplex=} [properties] Properties to set\n                 * @returns {jspb.test.OuterMessage.Complex} Complex instance\n                 */\n                Complex.create = function create(properties) {\n                    return new Complex(properties);\n                };\n\n                /**\n                 * Encodes the specified Complex message. Does not implicitly {@link jspb.test.OuterMessage.Complex.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {jspb.test.OuterMessage.IComplex} message Complex message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Complex.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.innerComplexField != null && Object.hasOwnProperty.call(message, \"innerComplexField\"))\n                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.innerComplexField);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Complex message, length delimited. Does not implicitly {@link jspb.test.OuterMessage.Complex.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {jspb.test.OuterMessage.IComplex} message Complex message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Complex.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a Complex message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.OuterMessage.Complex} Complex\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Complex.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.OuterMessage.Complex();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.innerComplexField = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a Complex message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.OuterMessage.Complex} Complex\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Complex.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a Complex message.\n                 * @function verify\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Complex.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.innerComplexField != null && message.hasOwnProperty(\"innerComplexField\"))\n                        if (!$util.isInteger(message.innerComplexField))\n                            return \"innerComplexField: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a Complex message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.OuterMessage.Complex} Complex\n                 */\n                Complex.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.OuterMessage.Complex)\n                        return object;\n                    var message = new $root.jspb.test.OuterMessage.Complex();\n                    if (object.innerComplexField != null)\n                        message.innerComplexField = object.innerComplexField | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a Complex message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {jspb.test.OuterMessage.Complex} message Complex\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Complex.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults)\n                        object.innerComplexField = 0;\n                    if (message.innerComplexField != null && message.hasOwnProperty(\"innerComplexField\"))\n                        object.innerComplexField = message.innerComplexField;\n                    return object;\n                };\n\n                /**\n                 * Converts this Complex to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Complex.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for Complex\n                 * @function getTypeUrl\n                 * @memberof jspb.test.OuterMessage.Complex\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                Complex.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.OuterMessage.Complex\";\n                };\n\n                return Complex;\n            })();\n\n            return OuterMessage;\n        })();\n\n        test.IsExtension = (function() {\n\n            /**\n             * Properties of an IsExtension.\n             * @memberof jspb.test\n             * @interface IIsExtension\n             * @property {string|null} [ext1] IsExtension ext1\n             */\n\n            /**\n             * Constructs a new IsExtension.\n             * @memberof jspb.test\n             * @classdesc Represents an IsExtension.\n             * @implements IIsExtension\n             * @constructor\n             * @param {jspb.test.IIsExtension=} [properties] Properties to set\n             */\n            function IsExtension(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * IsExtension ext1.\n             * @member {string} ext1\n             * @memberof jspb.test.IsExtension\n             * @instance\n             */\n            IsExtension.prototype.ext1 = \"\";\n\n            /**\n             * Creates a new IsExtension instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {jspb.test.IIsExtension=} [properties] Properties to set\n             * @returns {jspb.test.IsExtension} IsExtension instance\n             */\n            IsExtension.create = function create(properties) {\n                return new IsExtension(properties);\n            };\n\n            /**\n             * Encodes the specified IsExtension message. Does not implicitly {@link jspb.test.IsExtension.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {jspb.test.IIsExtension} message IsExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            IsExtension.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.ext1 != null && Object.hasOwnProperty.call(message, \"ext1\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.ext1);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified IsExtension message, length delimited. Does not implicitly {@link jspb.test.IsExtension.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {jspb.test.IIsExtension} message IsExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            IsExtension.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an IsExtension message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.IsExtension} IsExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            IsExtension.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.IsExtension();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.ext1 = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an IsExtension message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.IsExtension} IsExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            IsExtension.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an IsExtension message.\n             * @function verify\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            IsExtension.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.ext1 != null && message.hasOwnProperty(\"ext1\"))\n                    if (!$util.isString(message.ext1))\n                        return \"ext1: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates an IsExtension message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.IsExtension} IsExtension\n             */\n            IsExtension.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.IsExtension)\n                    return object;\n                var message = new $root.jspb.test.IsExtension();\n                if (object.ext1 != null)\n                    message.ext1 = String(object.ext1);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an IsExtension message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {jspb.test.IsExtension} message IsExtension\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            IsExtension.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.ext1 = \"\";\n                if (message.ext1 != null && message.hasOwnProperty(\"ext1\"))\n                    object.ext1 = message.ext1;\n                return object;\n            };\n\n            /**\n             * Converts this IsExtension to JSON.\n             * @function toJSON\n             * @memberof jspb.test.IsExtension\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            IsExtension.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for IsExtension\n             * @function getTypeUrl\n             * @memberof jspb.test.IsExtension\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            IsExtension.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.IsExtension\";\n            };\n\n            return IsExtension;\n        })();\n\n        test.IndirectExtension = (function() {\n\n            /**\n             * Properties of an IndirectExtension.\n             * @memberof jspb.test\n             * @interface IIndirectExtension\n             */\n\n            /**\n             * Constructs a new IndirectExtension.\n             * @memberof jspb.test\n             * @classdesc Represents an IndirectExtension.\n             * @implements IIndirectExtension\n             * @constructor\n             * @param {jspb.test.IIndirectExtension=} [properties] Properties to set\n             */\n            function IndirectExtension(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Creates a new IndirectExtension instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {jspb.test.IIndirectExtension=} [properties] Properties to set\n             * @returns {jspb.test.IndirectExtension} IndirectExtension instance\n             */\n            IndirectExtension.create = function create(properties) {\n                return new IndirectExtension(properties);\n            };\n\n            /**\n             * Encodes the specified IndirectExtension message. Does not implicitly {@link jspb.test.IndirectExtension.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {jspb.test.IIndirectExtension} message IndirectExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            IndirectExtension.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified IndirectExtension message, length delimited. Does not implicitly {@link jspb.test.IndirectExtension.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {jspb.test.IIndirectExtension} message IndirectExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            IndirectExtension.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an IndirectExtension message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.IndirectExtension} IndirectExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            IndirectExtension.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.IndirectExtension();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an IndirectExtension message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.IndirectExtension} IndirectExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            IndirectExtension.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an IndirectExtension message.\n             * @function verify\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            IndirectExtension.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                return null;\n            };\n\n            /**\n             * Creates an IndirectExtension message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.IndirectExtension} IndirectExtension\n             */\n            IndirectExtension.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.IndirectExtension)\n                    return object;\n                return new $root.jspb.test.IndirectExtension();\n            };\n\n            /**\n             * Creates a plain object from an IndirectExtension message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {jspb.test.IndirectExtension} message IndirectExtension\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            IndirectExtension.toObject = function toObject() {\n                return {};\n            };\n\n            /**\n             * Converts this IndirectExtension to JSON.\n             * @function toJSON\n             * @memberof jspb.test.IndirectExtension\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            IndirectExtension.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for IndirectExtension\n             * @function getTypeUrl\n             * @memberof jspb.test.IndirectExtension\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            IndirectExtension.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.IndirectExtension\";\n            };\n\n            return IndirectExtension;\n        })();\n\n        test.DefaultValues = (function() {\n\n            /**\n             * Properties of a DefaultValues.\n             * @memberof jspb.test\n             * @interface IDefaultValues\n             * @property {string|null} [stringField] DefaultValues stringField\n             * @property {boolean|null} [boolField] DefaultValues boolField\n             * @property {number|Long|null} [intField] DefaultValues intField\n             * @property {jspb.test.DefaultValues.Enum|null} [enumField] DefaultValues enumField\n             * @property {string|null} [emptyField] DefaultValues emptyField\n             * @property {Uint8Array|null} [bytesField] DefaultValues bytesField\n             */\n\n            /**\n             * Constructs a new DefaultValues.\n             * @memberof jspb.test\n             * @classdesc Represents a DefaultValues.\n             * @implements IDefaultValues\n             * @constructor\n             * @param {jspb.test.IDefaultValues=} [properties] Properties to set\n             */\n            function DefaultValues(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * DefaultValues stringField.\n             * @member {string} stringField\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             */\n            DefaultValues.prototype.stringField = \"default<>abc\";\n\n            /**\n             * DefaultValues boolField.\n             * @member {boolean} boolField\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             */\n            DefaultValues.prototype.boolField = true;\n\n            /**\n             * DefaultValues intField.\n             * @member {number|Long} intField\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             */\n            DefaultValues.prototype.intField = $util.Long ? $util.Long.fromBits(11,0,false) : 11;\n\n            /**\n             * DefaultValues enumField.\n             * @member {jspb.test.DefaultValues.Enum} enumField\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             */\n            DefaultValues.prototype.enumField = 13;\n\n            /**\n             * DefaultValues emptyField.\n             * @member {string} emptyField\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             */\n            DefaultValues.prototype.emptyField = \"\";\n\n            /**\n             * DefaultValues bytesField.\n             * @member {Uint8Array} bytesField\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             */\n            DefaultValues.prototype.bytesField = $util.newBuffer([109,111,111]);\n\n            /**\n             * Creates a new DefaultValues instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {jspb.test.IDefaultValues=} [properties] Properties to set\n             * @returns {jspb.test.DefaultValues} DefaultValues instance\n             */\n            DefaultValues.create = function create(properties) {\n                return new DefaultValues(properties);\n            };\n\n            /**\n             * Encodes the specified DefaultValues message. Does not implicitly {@link jspb.test.DefaultValues.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {jspb.test.IDefaultValues} message DefaultValues message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            DefaultValues.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.stringField != null && Object.hasOwnProperty.call(message, \"stringField\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.stringField);\n                if (message.boolField != null && Object.hasOwnProperty.call(message, \"boolField\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.boolField);\n                if (message.intField != null && Object.hasOwnProperty.call(message, \"intField\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).int64(message.intField);\n                if (message.enumField != null && Object.hasOwnProperty.call(message, \"enumField\"))\n                    writer.uint32(/* id 4, wireType 0 =*/32).int32(message.enumField);\n                if (message.emptyField != null && Object.hasOwnProperty.call(message, \"emptyField\"))\n                    writer.uint32(/* id 6, wireType 2 =*/50).string(message.emptyField);\n                if (message.bytesField != null && Object.hasOwnProperty.call(message, \"bytesField\"))\n                    writer.uint32(/* id 8, wireType 2 =*/66).bytes(message.bytesField);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified DefaultValues message, length delimited. Does not implicitly {@link jspb.test.DefaultValues.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {jspb.test.IDefaultValues} message DefaultValues message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            DefaultValues.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a DefaultValues message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.DefaultValues} DefaultValues\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            DefaultValues.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.DefaultValues();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.stringField = reader.string();\n                        break;\n                    case 2:\n                        message.boolField = reader.bool();\n                        break;\n                    case 3:\n                        message.intField = reader.int64();\n                        break;\n                    case 4:\n                        message.enumField = reader.int32();\n                        break;\n                    case 6:\n                        message.emptyField = reader.string();\n                        break;\n                    case 8:\n                        message.bytesField = reader.bytes();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a DefaultValues message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.DefaultValues} DefaultValues\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            DefaultValues.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a DefaultValues message.\n             * @function verify\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            DefaultValues.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                    if (!$util.isString(message.stringField))\n                        return \"stringField: string expected\";\n                if (message.boolField != null && message.hasOwnProperty(\"boolField\"))\n                    if (typeof message.boolField !== \"boolean\")\n                        return \"boolField: boolean expected\";\n                if (message.intField != null && message.hasOwnProperty(\"intField\"))\n                    if (!$util.isInteger(message.intField) && !(message.intField && $util.isInteger(message.intField.low) && $util.isInteger(message.intField.high)))\n                        return \"intField: integer|Long expected\";\n                if (message.enumField != null && message.hasOwnProperty(\"enumField\"))\n                    switch (message.enumField) {\n                    default:\n                        return \"enumField: enum value expected\";\n                    case 13:\n                    case 77:\n                        break;\n                    }\n                if (message.emptyField != null && message.hasOwnProperty(\"emptyField\"))\n                    if (!$util.isString(message.emptyField))\n                        return \"emptyField: string expected\";\n                if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                    if (!(message.bytesField && typeof message.bytesField.length === \"number\" || $util.isString(message.bytesField)))\n                        return \"bytesField: buffer expected\";\n                return null;\n            };\n\n            /**\n             * Creates a DefaultValues message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.DefaultValues} DefaultValues\n             */\n            DefaultValues.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.DefaultValues)\n                    return object;\n                var message = new $root.jspb.test.DefaultValues();\n                if (object.stringField != null)\n                    message.stringField = String(object.stringField);\n                if (object.boolField != null)\n                    message.boolField = Boolean(object.boolField);\n                if (object.intField != null)\n                    if ($util.Long)\n                        (message.intField = $util.Long.fromValue(object.intField)).unsigned = false;\n                    else if (typeof object.intField === \"string\")\n                        message.intField = parseInt(object.intField, 10);\n                    else if (typeof object.intField === \"number\")\n                        message.intField = object.intField;\n                    else if (typeof object.intField === \"object\")\n                        message.intField = new $util.LongBits(object.intField.low >>> 0, object.intField.high >>> 0).toNumber();\n                switch (object.enumField) {\n                case \"E1\":\n                case 13:\n                    message.enumField = 13;\n                    break;\n                case \"E2\":\n                case 77:\n                    message.enumField = 77;\n                    break;\n                }\n                if (object.emptyField != null)\n                    message.emptyField = String(object.emptyField);\n                if (object.bytesField != null)\n                    if (typeof object.bytesField === \"string\")\n                        $util.base64.decode(object.bytesField, message.bytesField = $util.newBuffer($util.base64.length(object.bytesField)), 0);\n                    else if (object.bytesField.length >= 0)\n                        message.bytesField = object.bytesField;\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a DefaultValues message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {jspb.test.DefaultValues} message DefaultValues\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            DefaultValues.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.stringField = \"default<>abc\";\n                    object.boolField = true;\n                    if ($util.Long) {\n                        var long = new $util.Long(11, 0, false);\n                        object.intField = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.intField = options.longs === String ? \"11\" : 11;\n                    object.enumField = options.enums === String ? \"E1\" : 13;\n                    object.emptyField = \"\";\n                    if (options.bytes === String)\n                        object.bytesField = \"moo\";\n                    else {\n                        object.bytesField = [\n                            109,\n                            111,\n                            111\n                        ];\n                        if (options.bytes !== Array)\n                            object.bytesField = $util.newBuffer(object.bytesField);\n                    }\n                }\n                if (message.stringField != null && message.hasOwnProperty(\"stringField\"))\n                    object.stringField = message.stringField;\n                if (message.boolField != null && message.hasOwnProperty(\"boolField\"))\n                    object.boolField = message.boolField;\n                if (message.intField != null && message.hasOwnProperty(\"intField\"))\n                    if (typeof message.intField === \"number\")\n                        object.intField = options.longs === String ? String(message.intField) : message.intField;\n                    else\n                        object.intField = options.longs === String ? $util.Long.prototype.toString.call(message.intField) : options.longs === Number ? new $util.LongBits(message.intField.low >>> 0, message.intField.high >>> 0).toNumber() : message.intField;\n                if (message.enumField != null && message.hasOwnProperty(\"enumField\"))\n                    object.enumField = options.enums === String ? $root.jspb.test.DefaultValues.Enum[message.enumField] : message.enumField;\n                if (message.emptyField != null && message.hasOwnProperty(\"emptyField\"))\n                    object.emptyField = message.emptyField;\n                if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                    object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField;\n                return object;\n            };\n\n            /**\n             * Converts this DefaultValues to JSON.\n             * @function toJSON\n             * @memberof jspb.test.DefaultValues\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            DefaultValues.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for DefaultValues\n             * @function getTypeUrl\n             * @memberof jspb.test.DefaultValues\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            DefaultValues.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.DefaultValues\";\n            };\n\n            /**\n             * Enum enum.\n             * @name jspb.test.DefaultValues.Enum\n             * @enum {number}\n             * @property {number} E1=13 E1 value\n             * @property {number} E2=77 E2 value\n             */\n            DefaultValues.Enum = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[13] = \"E1\"] = 13;\n                values[valuesById[77] = \"E2\"] = 77;\n                return values;\n            })();\n\n            return DefaultValues;\n        })();\n\n        test.FloatingPointFields = (function() {\n\n            /**\n             * Properties of a FloatingPointFields.\n             * @memberof jspb.test\n             * @interface IFloatingPointFields\n             * @property {number|null} [optionalFloatField] FloatingPointFields optionalFloatField\n             * @property {number} requiredFloatField FloatingPointFields requiredFloatField\n             * @property {Array.<number>|null} [repeatedFloatField] FloatingPointFields repeatedFloatField\n             * @property {number|null} [defaultFloatField] FloatingPointFields defaultFloatField\n             * @property {number|null} [optionalDoubleField] FloatingPointFields optionalDoubleField\n             * @property {number} requiredDoubleField FloatingPointFields requiredDoubleField\n             * @property {Array.<number>|null} [repeatedDoubleField] FloatingPointFields repeatedDoubleField\n             * @property {number|null} [defaultDoubleField] FloatingPointFields defaultDoubleField\n             */\n\n            /**\n             * Constructs a new FloatingPointFields.\n             * @memberof jspb.test\n             * @classdesc Represents a FloatingPointFields.\n             * @implements IFloatingPointFields\n             * @constructor\n             * @param {jspb.test.IFloatingPointFields=} [properties] Properties to set\n             */\n            function FloatingPointFields(properties) {\n                this.repeatedFloatField = [];\n                this.repeatedDoubleField = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FloatingPointFields optionalFloatField.\n             * @member {number} optionalFloatField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.optionalFloatField = 0;\n\n            /**\n             * FloatingPointFields requiredFloatField.\n             * @member {number} requiredFloatField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.requiredFloatField = 0;\n\n            /**\n             * FloatingPointFields repeatedFloatField.\n             * @member {Array.<number>} repeatedFloatField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.repeatedFloatField = $util.emptyArray;\n\n            /**\n             * FloatingPointFields defaultFloatField.\n             * @member {number} defaultFloatField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.defaultFloatField = 2;\n\n            /**\n             * FloatingPointFields optionalDoubleField.\n             * @member {number} optionalDoubleField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.optionalDoubleField = 0;\n\n            /**\n             * FloatingPointFields requiredDoubleField.\n             * @member {number} requiredDoubleField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.requiredDoubleField = 0;\n\n            /**\n             * FloatingPointFields repeatedDoubleField.\n             * @member {Array.<number>} repeatedDoubleField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.repeatedDoubleField = $util.emptyArray;\n\n            /**\n             * FloatingPointFields defaultDoubleField.\n             * @member {number} defaultDoubleField\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             */\n            FloatingPointFields.prototype.defaultDoubleField = 2;\n\n            /**\n             * Creates a new FloatingPointFields instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {jspb.test.IFloatingPointFields=} [properties] Properties to set\n             * @returns {jspb.test.FloatingPointFields} FloatingPointFields instance\n             */\n            FloatingPointFields.create = function create(properties) {\n                return new FloatingPointFields(properties);\n            };\n\n            /**\n             * Encodes the specified FloatingPointFields message. Does not implicitly {@link jspb.test.FloatingPointFields.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {jspb.test.IFloatingPointFields} message FloatingPointFields message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FloatingPointFields.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.optionalFloatField != null && Object.hasOwnProperty.call(message, \"optionalFloatField\"))\n                    writer.uint32(/* id 1, wireType 5 =*/13).float(message.optionalFloatField);\n                writer.uint32(/* id 2, wireType 5 =*/21).float(message.requiredFloatField);\n                if (message.repeatedFloatField != null && message.repeatedFloatField.length)\n                    for (var i = 0; i < message.repeatedFloatField.length; ++i)\n                        writer.uint32(/* id 3, wireType 5 =*/29).float(message.repeatedFloatField[i]);\n                if (message.defaultFloatField != null && Object.hasOwnProperty.call(message, \"defaultFloatField\"))\n                    writer.uint32(/* id 4, wireType 5 =*/37).float(message.defaultFloatField);\n                if (message.optionalDoubleField != null && Object.hasOwnProperty.call(message, \"optionalDoubleField\"))\n                    writer.uint32(/* id 5, wireType 1 =*/41).double(message.optionalDoubleField);\n                writer.uint32(/* id 6, wireType 1 =*/49).double(message.requiredDoubleField);\n                if (message.repeatedDoubleField != null && message.repeatedDoubleField.length)\n                    for (var i = 0; i < message.repeatedDoubleField.length; ++i)\n                        writer.uint32(/* id 7, wireType 1 =*/57).double(message.repeatedDoubleField[i]);\n                if (message.defaultDoubleField != null && Object.hasOwnProperty.call(message, \"defaultDoubleField\"))\n                    writer.uint32(/* id 8, wireType 1 =*/65).double(message.defaultDoubleField);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FloatingPointFields message, length delimited. Does not implicitly {@link jspb.test.FloatingPointFields.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {jspb.test.IFloatingPointFields} message FloatingPointFields message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FloatingPointFields.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FloatingPointFields message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.FloatingPointFields} FloatingPointFields\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FloatingPointFields.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.FloatingPointFields();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.optionalFloatField = reader.float();\n                        break;\n                    case 2:\n                        message.requiredFloatField = reader.float();\n                        break;\n                    case 3:\n                        if (!(message.repeatedFloatField && message.repeatedFloatField.length))\n                            message.repeatedFloatField = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.repeatedFloatField.push(reader.float());\n                        } else\n                            message.repeatedFloatField.push(reader.float());\n                        break;\n                    case 4:\n                        message.defaultFloatField = reader.float();\n                        break;\n                    case 5:\n                        message.optionalDoubleField = reader.double();\n                        break;\n                    case 6:\n                        message.requiredDoubleField = reader.double();\n                        break;\n                    case 7:\n                        if (!(message.repeatedDoubleField && message.repeatedDoubleField.length))\n                            message.repeatedDoubleField = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.repeatedDoubleField.push(reader.double());\n                        } else\n                            message.repeatedDoubleField.push(reader.double());\n                        break;\n                    case 8:\n                        message.defaultDoubleField = reader.double();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"requiredFloatField\"))\n                    throw $util.ProtocolError(\"missing required 'requiredFloatField'\", { instance: message });\n                if (!message.hasOwnProperty(\"requiredDoubleField\"))\n                    throw $util.ProtocolError(\"missing required 'requiredDoubleField'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a FloatingPointFields message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.FloatingPointFields} FloatingPointFields\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FloatingPointFields.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FloatingPointFields message.\n             * @function verify\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FloatingPointFields.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.optionalFloatField != null && message.hasOwnProperty(\"optionalFloatField\"))\n                    if (typeof message.optionalFloatField !== \"number\")\n                        return \"optionalFloatField: number expected\";\n                if (typeof message.requiredFloatField !== \"number\")\n                    return \"requiredFloatField: number expected\";\n                if (message.repeatedFloatField != null && message.hasOwnProperty(\"repeatedFloatField\")) {\n                    if (!Array.isArray(message.repeatedFloatField))\n                        return \"repeatedFloatField: array expected\";\n                    for (var i = 0; i < message.repeatedFloatField.length; ++i)\n                        if (typeof message.repeatedFloatField[i] !== \"number\")\n                            return \"repeatedFloatField: number[] expected\";\n                }\n                if (message.defaultFloatField != null && message.hasOwnProperty(\"defaultFloatField\"))\n                    if (typeof message.defaultFloatField !== \"number\")\n                        return \"defaultFloatField: number expected\";\n                if (message.optionalDoubleField != null && message.hasOwnProperty(\"optionalDoubleField\"))\n                    if (typeof message.optionalDoubleField !== \"number\")\n                        return \"optionalDoubleField: number expected\";\n                if (typeof message.requiredDoubleField !== \"number\")\n                    return \"requiredDoubleField: number expected\";\n                if (message.repeatedDoubleField != null && message.hasOwnProperty(\"repeatedDoubleField\")) {\n                    if (!Array.isArray(message.repeatedDoubleField))\n                        return \"repeatedDoubleField: array expected\";\n                    for (var i = 0; i < message.repeatedDoubleField.length; ++i)\n                        if (typeof message.repeatedDoubleField[i] !== \"number\")\n                            return \"repeatedDoubleField: number[] expected\";\n                }\n                if (message.defaultDoubleField != null && message.hasOwnProperty(\"defaultDoubleField\"))\n                    if (typeof message.defaultDoubleField !== \"number\")\n                        return \"defaultDoubleField: number expected\";\n                return null;\n            };\n\n            /**\n             * Creates a FloatingPointFields message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.FloatingPointFields} FloatingPointFields\n             */\n            FloatingPointFields.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.FloatingPointFields)\n                    return object;\n                var message = new $root.jspb.test.FloatingPointFields();\n                if (object.optionalFloatField != null)\n                    message.optionalFloatField = Number(object.optionalFloatField);\n                if (object.requiredFloatField != null)\n                    message.requiredFloatField = Number(object.requiredFloatField);\n                if (object.repeatedFloatField) {\n                    if (!Array.isArray(object.repeatedFloatField))\n                        throw TypeError(\".jspb.test.FloatingPointFields.repeatedFloatField: array expected\");\n                    message.repeatedFloatField = [];\n                    for (var i = 0; i < object.repeatedFloatField.length; ++i)\n                        message.repeatedFloatField[i] = Number(object.repeatedFloatField[i]);\n                }\n                if (object.defaultFloatField != null)\n                    message.defaultFloatField = Number(object.defaultFloatField);\n                if (object.optionalDoubleField != null)\n                    message.optionalDoubleField = Number(object.optionalDoubleField);\n                if (object.requiredDoubleField != null)\n                    message.requiredDoubleField = Number(object.requiredDoubleField);\n                if (object.repeatedDoubleField) {\n                    if (!Array.isArray(object.repeatedDoubleField))\n                        throw TypeError(\".jspb.test.FloatingPointFields.repeatedDoubleField: array expected\");\n                    message.repeatedDoubleField = [];\n                    for (var i = 0; i < object.repeatedDoubleField.length; ++i)\n                        message.repeatedDoubleField[i] = Number(object.repeatedDoubleField[i]);\n                }\n                if (object.defaultDoubleField != null)\n                    message.defaultDoubleField = Number(object.defaultDoubleField);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FloatingPointFields message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {jspb.test.FloatingPointFields} message FloatingPointFields\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FloatingPointFields.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.repeatedFloatField = [];\n                    object.repeatedDoubleField = [];\n                }\n                if (options.defaults) {\n                    object.optionalFloatField = 0;\n                    object.requiredFloatField = 0;\n                    object.defaultFloatField = 2;\n                    object.optionalDoubleField = 0;\n                    object.requiredDoubleField = 0;\n                    object.defaultDoubleField = 2;\n                }\n                if (message.optionalFloatField != null && message.hasOwnProperty(\"optionalFloatField\"))\n                    object.optionalFloatField = options.json && !isFinite(message.optionalFloatField) ? String(message.optionalFloatField) : message.optionalFloatField;\n                if (message.requiredFloatField != null && message.hasOwnProperty(\"requiredFloatField\"))\n                    object.requiredFloatField = options.json && !isFinite(message.requiredFloatField) ? String(message.requiredFloatField) : message.requiredFloatField;\n                if (message.repeatedFloatField && message.repeatedFloatField.length) {\n                    object.repeatedFloatField = [];\n                    for (var j = 0; j < message.repeatedFloatField.length; ++j)\n                        object.repeatedFloatField[j] = options.json && !isFinite(message.repeatedFloatField[j]) ? String(message.repeatedFloatField[j]) : message.repeatedFloatField[j];\n                }\n                if (message.defaultFloatField != null && message.hasOwnProperty(\"defaultFloatField\"))\n                    object.defaultFloatField = options.json && !isFinite(message.defaultFloatField) ? String(message.defaultFloatField) : message.defaultFloatField;\n                if (message.optionalDoubleField != null && message.hasOwnProperty(\"optionalDoubleField\"))\n                    object.optionalDoubleField = options.json && !isFinite(message.optionalDoubleField) ? String(message.optionalDoubleField) : message.optionalDoubleField;\n                if (message.requiredDoubleField != null && message.hasOwnProperty(\"requiredDoubleField\"))\n                    object.requiredDoubleField = options.json && !isFinite(message.requiredDoubleField) ? String(message.requiredDoubleField) : message.requiredDoubleField;\n                if (message.repeatedDoubleField && message.repeatedDoubleField.length) {\n                    object.repeatedDoubleField = [];\n                    for (var j = 0; j < message.repeatedDoubleField.length; ++j)\n                        object.repeatedDoubleField[j] = options.json && !isFinite(message.repeatedDoubleField[j]) ? String(message.repeatedDoubleField[j]) : message.repeatedDoubleField[j];\n                }\n                if (message.defaultDoubleField != null && message.hasOwnProperty(\"defaultDoubleField\"))\n                    object.defaultDoubleField = options.json && !isFinite(message.defaultDoubleField) ? String(message.defaultDoubleField) : message.defaultDoubleField;\n                return object;\n            };\n\n            /**\n             * Converts this FloatingPointFields to JSON.\n             * @function toJSON\n             * @memberof jspb.test.FloatingPointFields\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FloatingPointFields.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for FloatingPointFields\n             * @function getTypeUrl\n             * @memberof jspb.test.FloatingPointFields\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            FloatingPointFields.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.FloatingPointFields\";\n            };\n\n            return FloatingPointFields;\n        })();\n\n        test.TestClone = (function() {\n\n            /**\n             * Properties of a TestClone.\n             * @memberof jspb.test\n             * @interface ITestClone\n             * @property {string|null} [str] TestClone str\n             * @property {jspb.test.ISimple1|null} [simple1] TestClone simple1\n             * @property {Array.<jspb.test.ISimple1>|null} [simple2] TestClone simple2\n             * @property {Uint8Array|null} [bytesField] TestClone bytesField\n             * @property {string|null} [unused] TestClone unused\n             * @property {jspb.test.ICloneExtension|null} [\".jspb.test.CloneExtension.extField\"] TestClone .jspb.test.CloneExtension.extField\n             */\n\n            /**\n             * Constructs a new TestClone.\n             * @memberof jspb.test\n             * @classdesc Represents a TestClone.\n             * @implements ITestClone\n             * @constructor\n             * @param {jspb.test.ITestClone=} [properties] Properties to set\n             */\n            function TestClone(properties) {\n                this.simple2 = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestClone str.\n             * @member {string} str\n             * @memberof jspb.test.TestClone\n             * @instance\n             */\n            TestClone.prototype.str = \"\";\n\n            /**\n             * TestClone simple1.\n             * @member {jspb.test.ISimple1|null|undefined} simple1\n             * @memberof jspb.test.TestClone\n             * @instance\n             */\n            TestClone.prototype.simple1 = null;\n\n            /**\n             * TestClone simple2.\n             * @member {Array.<jspb.test.ISimple1>} simple2\n             * @memberof jspb.test.TestClone\n             * @instance\n             */\n            TestClone.prototype.simple2 = $util.emptyArray;\n\n            /**\n             * TestClone bytesField.\n             * @member {Uint8Array} bytesField\n             * @memberof jspb.test.TestClone\n             * @instance\n             */\n            TestClone.prototype.bytesField = $util.newBuffer([]);\n\n            /**\n             * TestClone unused.\n             * @member {string} unused\n             * @memberof jspb.test.TestClone\n             * @instance\n             */\n            TestClone.prototype.unused = \"\";\n\n            /**\n             * TestClone .jspb.test.CloneExtension.extField.\n             * @member {jspb.test.ICloneExtension|null|undefined} .jspb.test.CloneExtension.extField\n             * @memberof jspb.test.TestClone\n             * @instance\n             */\n            TestClone.prototype[\".jspb.test.CloneExtension.extField\"] = null;\n\n            /**\n             * Creates a new TestClone instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {jspb.test.ITestClone=} [properties] Properties to set\n             * @returns {jspb.test.TestClone} TestClone instance\n             */\n            TestClone.create = function create(properties) {\n                return new TestClone(properties);\n            };\n\n            /**\n             * Encodes the specified TestClone message. Does not implicitly {@link jspb.test.TestClone.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {jspb.test.ITestClone} message TestClone message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestClone.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.str != null && Object.hasOwnProperty.call(message, \"str\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.str);\n                if (message.simple1 != null && Object.hasOwnProperty.call(message, \"simple1\"))\n                    $root.jspb.test.Simple1.encode(message.simple1, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                if (message.simple2 != null && message.simple2.length)\n                    for (var i = 0; i < message.simple2.length; ++i)\n                        $root.jspb.test.Simple1.encode(message.simple2[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.bytesField != null && Object.hasOwnProperty.call(message, \"bytesField\"))\n                    writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.bytesField);\n                if (message.unused != null && Object.hasOwnProperty.call(message, \"unused\"))\n                    writer.uint32(/* id 7, wireType 2 =*/58).string(message.unused);\n                if (message[\".jspb.test.CloneExtension.extField\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.CloneExtension.extField\"))\n                    $root.jspb.test.CloneExtension.encode(message[\".jspb.test.CloneExtension.extField\"], writer.uint32(/* id 100, wireType 2 =*/802).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestClone message, length delimited. Does not implicitly {@link jspb.test.TestClone.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {jspb.test.ITestClone} message TestClone message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestClone.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestClone message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestClone} TestClone\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestClone.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestClone();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.str = reader.string();\n                        break;\n                    case 3:\n                        message.simple1 = $root.jspb.test.Simple1.decode(reader, reader.uint32());\n                        break;\n                    case 5:\n                        if (!(message.simple2 && message.simple2.length))\n                            message.simple2 = [];\n                        message.simple2.push($root.jspb.test.Simple1.decode(reader, reader.uint32()));\n                        break;\n                    case 6:\n                        message.bytesField = reader.bytes();\n                        break;\n                    case 7:\n                        message.unused = reader.string();\n                        break;\n                    case 100:\n                        message[\".jspb.test.CloneExtension.extField\"] = $root.jspb.test.CloneExtension.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestClone message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestClone} TestClone\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestClone.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestClone message.\n             * @function verify\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestClone.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.str != null && message.hasOwnProperty(\"str\"))\n                    if (!$util.isString(message.str))\n                        return \"str: string expected\";\n                if (message.simple1 != null && message.hasOwnProperty(\"simple1\")) {\n                    var error = $root.jspb.test.Simple1.verify(message.simple1);\n                    if (error)\n                        return \"simple1.\" + error;\n                }\n                if (message.simple2 != null && message.hasOwnProperty(\"simple2\")) {\n                    if (!Array.isArray(message.simple2))\n                        return \"simple2: array expected\";\n                    for (var i = 0; i < message.simple2.length; ++i) {\n                        var error = $root.jspb.test.Simple1.verify(message.simple2[i]);\n                        if (error)\n                            return \"simple2.\" + error;\n                    }\n                }\n                if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                    if (!(message.bytesField && typeof message.bytesField.length === \"number\" || $util.isString(message.bytesField)))\n                        return \"bytesField: buffer expected\";\n                if (message.unused != null && message.hasOwnProperty(\"unused\"))\n                    if (!$util.isString(message.unused))\n                        return \"unused: string expected\";\n                if (message[\".jspb.test.CloneExtension.extField\"] != null && message.hasOwnProperty(\".jspb.test.CloneExtension.extField\")) {\n                    var error = $root.jspb.test.CloneExtension.verify(message[\".jspb.test.CloneExtension.extField\"]);\n                    if (error)\n                        return \".jspb.test.CloneExtension.extField.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a TestClone message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestClone} TestClone\n             */\n            TestClone.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestClone)\n                    return object;\n                var message = new $root.jspb.test.TestClone();\n                if (object.str != null)\n                    message.str = String(object.str);\n                if (object.simple1 != null) {\n                    if (typeof object.simple1 !== \"object\")\n                        throw TypeError(\".jspb.test.TestClone.simple1: object expected\");\n                    message.simple1 = $root.jspb.test.Simple1.fromObject(object.simple1);\n                }\n                if (object.simple2) {\n                    if (!Array.isArray(object.simple2))\n                        throw TypeError(\".jspb.test.TestClone.simple2: array expected\");\n                    message.simple2 = [];\n                    for (var i = 0; i < object.simple2.length; ++i) {\n                        if (typeof object.simple2[i] !== \"object\")\n                            throw TypeError(\".jspb.test.TestClone.simple2: object expected\");\n                        message.simple2[i] = $root.jspb.test.Simple1.fromObject(object.simple2[i]);\n                    }\n                }\n                if (object.bytesField != null)\n                    if (typeof object.bytesField === \"string\")\n                        $util.base64.decode(object.bytesField, message.bytesField = $util.newBuffer($util.base64.length(object.bytesField)), 0);\n                    else if (object.bytesField.length >= 0)\n                        message.bytesField = object.bytesField;\n                if (object.unused != null)\n                    message.unused = String(object.unused);\n                if (object[\".jspb.test.CloneExtension.extField\"] != null) {\n                    if (typeof object[\".jspb.test.CloneExtension.extField\"] !== \"object\")\n                        throw TypeError(\".jspb.test.TestClone..jspb.test.CloneExtension.extField: object expected\");\n                    message[\".jspb.test.CloneExtension.extField\"] = $root.jspb.test.CloneExtension.fromObject(object[\".jspb.test.CloneExtension.extField\"]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestClone message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {jspb.test.TestClone} message TestClone\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestClone.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.simple2 = [];\n                if (options.defaults) {\n                    object.str = \"\";\n                    object.simple1 = null;\n                    if (options.bytes === String)\n                        object.bytesField = \"\";\n                    else {\n                        object.bytesField = [];\n                        if (options.bytes !== Array)\n                            object.bytesField = $util.newBuffer(object.bytesField);\n                    }\n                    object.unused = \"\";\n                    object[\".jspb.test.CloneExtension.extField\"] = null;\n                }\n                if (message.str != null && message.hasOwnProperty(\"str\"))\n                    object.str = message.str;\n                if (message.simple1 != null && message.hasOwnProperty(\"simple1\"))\n                    object.simple1 = $root.jspb.test.Simple1.toObject(message.simple1, options);\n                if (message.simple2 && message.simple2.length) {\n                    object.simple2 = [];\n                    for (var j = 0; j < message.simple2.length; ++j)\n                        object.simple2[j] = $root.jspb.test.Simple1.toObject(message.simple2[j], options);\n                }\n                if (message.bytesField != null && message.hasOwnProperty(\"bytesField\"))\n                    object.bytesField = options.bytes === String ? $util.base64.encode(message.bytesField, 0, message.bytesField.length) : options.bytes === Array ? Array.prototype.slice.call(message.bytesField) : message.bytesField;\n                if (message.unused != null && message.hasOwnProperty(\"unused\"))\n                    object.unused = message.unused;\n                if (message[\".jspb.test.CloneExtension.extField\"] != null && message.hasOwnProperty(\".jspb.test.CloneExtension.extField\"))\n                    object[\".jspb.test.CloneExtension.extField\"] = $root.jspb.test.CloneExtension.toObject(message[\".jspb.test.CloneExtension.extField\"], options);\n                return object;\n            };\n\n            /**\n             * Converts this TestClone to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestClone\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestClone.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestClone\n             * @function getTypeUrl\n             * @memberof jspb.test.TestClone\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestClone.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestClone\";\n            };\n\n            return TestClone;\n        })();\n\n        test.CloneExtension = (function() {\n\n            /**\n             * Properties of a CloneExtension.\n             * @memberof jspb.test\n             * @interface ICloneExtension\n             * @property {string|null} [ext] CloneExtension ext\n             */\n\n            /**\n             * Constructs a new CloneExtension.\n             * @memberof jspb.test\n             * @classdesc Represents a CloneExtension.\n             * @implements ICloneExtension\n             * @constructor\n             * @param {jspb.test.ICloneExtension=} [properties] Properties to set\n             */\n            function CloneExtension(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * CloneExtension ext.\n             * @member {string} ext\n             * @memberof jspb.test.CloneExtension\n             * @instance\n             */\n            CloneExtension.prototype.ext = \"\";\n\n            /**\n             * Creates a new CloneExtension instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {jspb.test.ICloneExtension=} [properties] Properties to set\n             * @returns {jspb.test.CloneExtension} CloneExtension instance\n             */\n            CloneExtension.create = function create(properties) {\n                return new CloneExtension(properties);\n            };\n\n            /**\n             * Encodes the specified CloneExtension message. Does not implicitly {@link jspb.test.CloneExtension.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {jspb.test.ICloneExtension} message CloneExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            CloneExtension.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.ext != null && Object.hasOwnProperty.call(message, \"ext\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.ext);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified CloneExtension message, length delimited. Does not implicitly {@link jspb.test.CloneExtension.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {jspb.test.ICloneExtension} message CloneExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            CloneExtension.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a CloneExtension message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.CloneExtension} CloneExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            CloneExtension.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.CloneExtension();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 2:\n                        message.ext = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a CloneExtension message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.CloneExtension} CloneExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            CloneExtension.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a CloneExtension message.\n             * @function verify\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            CloneExtension.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.ext != null && message.hasOwnProperty(\"ext\"))\n                    if (!$util.isString(message.ext))\n                        return \"ext: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a CloneExtension message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.CloneExtension} CloneExtension\n             */\n            CloneExtension.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.CloneExtension)\n                    return object;\n                var message = new $root.jspb.test.CloneExtension();\n                if (object.ext != null)\n                    message.ext = String(object.ext);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a CloneExtension message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {jspb.test.CloneExtension} message CloneExtension\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            CloneExtension.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.ext = \"\";\n                if (message.ext != null && message.hasOwnProperty(\"ext\"))\n                    object.ext = message.ext;\n                return object;\n            };\n\n            /**\n             * Converts this CloneExtension to JSON.\n             * @function toJSON\n             * @memberof jspb.test.CloneExtension\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            CloneExtension.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for CloneExtension\n             * @function getTypeUrl\n             * @memberof jspb.test.CloneExtension\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            CloneExtension.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.CloneExtension\";\n            };\n\n            return CloneExtension;\n        })();\n\n        test.TestGroup = (function() {\n\n            /**\n             * Properties of a TestGroup.\n             * @memberof jspb.test\n             * @interface ITestGroup\n             * @property {Array.<jspb.test.TestGroup.IRepeatedGroup>|null} [repeatedGroup] TestGroup repeatedGroup\n             * @property {jspb.test.TestGroup.IRequiredGroup} requiredGroup TestGroup requiredGroup\n             * @property {jspb.test.TestGroup.IOptionalGroup|null} [optionalGroup] TestGroup optionalGroup\n             * @property {string|null} [id] TestGroup id\n             * @property {jspb.test.ISimple2} requiredSimple TestGroup requiredSimple\n             * @property {jspb.test.ISimple2|null} [optionalSimple] TestGroup optionalSimple\n             */\n\n            /**\n             * Constructs a new TestGroup.\n             * @memberof jspb.test\n             * @classdesc Represents a TestGroup.\n             * @implements ITestGroup\n             * @constructor\n             * @param {jspb.test.ITestGroup=} [properties] Properties to set\n             */\n            function TestGroup(properties) {\n                this.repeatedGroup = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestGroup repeatedGroup.\n             * @member {Array.<jspb.test.TestGroup.IRepeatedGroup>} repeatedGroup\n             * @memberof jspb.test.TestGroup\n             * @instance\n             */\n            TestGroup.prototype.repeatedGroup = $util.emptyArray;\n\n            /**\n             * TestGroup requiredGroup.\n             * @member {jspb.test.TestGroup.IRequiredGroup} requiredGroup\n             * @memberof jspb.test.TestGroup\n             * @instance\n             */\n            TestGroup.prototype.requiredGroup = null;\n\n            /**\n             * TestGroup optionalGroup.\n             * @member {jspb.test.TestGroup.IOptionalGroup|null|undefined} optionalGroup\n             * @memberof jspb.test.TestGroup\n             * @instance\n             */\n            TestGroup.prototype.optionalGroup = null;\n\n            /**\n             * TestGroup id.\n             * @member {string} id\n             * @memberof jspb.test.TestGroup\n             * @instance\n             */\n            TestGroup.prototype.id = \"\";\n\n            /**\n             * TestGroup requiredSimple.\n             * @member {jspb.test.ISimple2} requiredSimple\n             * @memberof jspb.test.TestGroup\n             * @instance\n             */\n            TestGroup.prototype.requiredSimple = null;\n\n            /**\n             * TestGroup optionalSimple.\n             * @member {jspb.test.ISimple2|null|undefined} optionalSimple\n             * @memberof jspb.test.TestGroup\n             * @instance\n             */\n            TestGroup.prototype.optionalSimple = null;\n\n            /**\n             * Creates a new TestGroup instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {jspb.test.ITestGroup=} [properties] Properties to set\n             * @returns {jspb.test.TestGroup} TestGroup instance\n             */\n            TestGroup.create = function create(properties) {\n                return new TestGroup(properties);\n            };\n\n            /**\n             * Encodes the specified TestGroup message. Does not implicitly {@link jspb.test.TestGroup.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {jspb.test.ITestGroup} message TestGroup message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestGroup.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.repeatedGroup != null && message.repeatedGroup.length)\n                    for (var i = 0; i < message.repeatedGroup.length; ++i)\n                        $root.jspb.test.TestGroup.RepeatedGroup.encode(message.repeatedGroup[i], writer.uint32(/* id 1, wireType 3 =*/11)).uint32(/* id 1, wireType 4 =*/12);\n                $root.jspb.test.TestGroup.RequiredGroup.encode(message.requiredGroup, writer.uint32(/* id 2, wireType 3 =*/19)).uint32(/* id 2, wireType 4 =*/20);\n                if (message.optionalGroup != null && Object.hasOwnProperty.call(message, \"optionalGroup\"))\n                    $root.jspb.test.TestGroup.OptionalGroup.encode(message.optionalGroup, writer.uint32(/* id 3, wireType 3 =*/27)).uint32(/* id 3, wireType 4 =*/28);\n                if (message.id != null && Object.hasOwnProperty.call(message, \"id\"))\n                    writer.uint32(/* id 4, wireType 2 =*/34).string(message.id);\n                $root.jspb.test.Simple2.encode(message.requiredSimple, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.optionalSimple != null && Object.hasOwnProperty.call(message, \"optionalSimple\"))\n                    $root.jspb.test.Simple2.encode(message.optionalSimple, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestGroup message, length delimited. Does not implicitly {@link jspb.test.TestGroup.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {jspb.test.ITestGroup} message TestGroup message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestGroup.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestGroup message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestGroup} TestGroup\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestGroup.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestGroup();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.repeatedGroup && message.repeatedGroup.length))\n                            message.repeatedGroup = [];\n                        message.repeatedGroup.push($root.jspb.test.TestGroup.RepeatedGroup.decode(reader));\n                        break;\n                    case 2:\n                        message.requiredGroup = $root.jspb.test.TestGroup.RequiredGroup.decode(reader);\n                        break;\n                    case 3:\n                        message.optionalGroup = $root.jspb.test.TestGroup.OptionalGroup.decode(reader);\n                        break;\n                    case 4:\n                        message.id = reader.string();\n                        break;\n                    case 5:\n                        message.requiredSimple = $root.jspb.test.Simple2.decode(reader, reader.uint32());\n                        break;\n                    case 6:\n                        message.optionalSimple = $root.jspb.test.Simple2.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                if (!message.hasOwnProperty(\"requiredGroup\"))\n                    throw $util.ProtocolError(\"missing required 'requiredGroup'\", { instance: message });\n                if (!message.hasOwnProperty(\"requiredSimple\"))\n                    throw $util.ProtocolError(\"missing required 'requiredSimple'\", { instance: message });\n                return message;\n            };\n\n            /**\n             * Decodes a TestGroup message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestGroup} TestGroup\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestGroup.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestGroup message.\n             * @function verify\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestGroup.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.repeatedGroup != null && message.hasOwnProperty(\"repeatedGroup\")) {\n                    if (!Array.isArray(message.repeatedGroup))\n                        return \"repeatedGroup: array expected\";\n                    for (var i = 0; i < message.repeatedGroup.length; ++i) {\n                        var error = $root.jspb.test.TestGroup.RepeatedGroup.verify(message.repeatedGroup[i]);\n                        if (error)\n                            return \"repeatedGroup.\" + error;\n                    }\n                }\n                {\n                    var error = $root.jspb.test.TestGroup.RequiredGroup.verify(message.requiredGroup);\n                    if (error)\n                        return \"requiredGroup.\" + error;\n                }\n                if (message.optionalGroup != null && message.hasOwnProperty(\"optionalGroup\")) {\n                    var error = $root.jspb.test.TestGroup.OptionalGroup.verify(message.optionalGroup);\n                    if (error)\n                        return \"optionalGroup.\" + error;\n                }\n                if (message.id != null && message.hasOwnProperty(\"id\"))\n                    if (!$util.isString(message.id))\n                        return \"id: string expected\";\n                {\n                    var error = $root.jspb.test.Simple2.verify(message.requiredSimple);\n                    if (error)\n                        return \"requiredSimple.\" + error;\n                }\n                if (message.optionalSimple != null && message.hasOwnProperty(\"optionalSimple\")) {\n                    var error = $root.jspb.test.Simple2.verify(message.optionalSimple);\n                    if (error)\n                        return \"optionalSimple.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a TestGroup message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestGroup} TestGroup\n             */\n            TestGroup.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestGroup)\n                    return object;\n                var message = new $root.jspb.test.TestGroup();\n                if (object.repeatedGroup) {\n                    if (!Array.isArray(object.repeatedGroup))\n                        throw TypeError(\".jspb.test.TestGroup.repeatedGroup: array expected\");\n                    message.repeatedGroup = [];\n                    for (var i = 0; i < object.repeatedGroup.length; ++i) {\n                        if (typeof object.repeatedGroup[i] !== \"object\")\n                            throw TypeError(\".jspb.test.TestGroup.repeatedGroup: object expected\");\n                        message.repeatedGroup[i] = $root.jspb.test.TestGroup.RepeatedGroup.fromObject(object.repeatedGroup[i]);\n                    }\n                }\n                if (object.requiredGroup != null) {\n                    if (typeof object.requiredGroup !== \"object\")\n                        throw TypeError(\".jspb.test.TestGroup.requiredGroup: object expected\");\n                    message.requiredGroup = $root.jspb.test.TestGroup.RequiredGroup.fromObject(object.requiredGroup);\n                }\n                if (object.optionalGroup != null) {\n                    if (typeof object.optionalGroup !== \"object\")\n                        throw TypeError(\".jspb.test.TestGroup.optionalGroup: object expected\");\n                    message.optionalGroup = $root.jspb.test.TestGroup.OptionalGroup.fromObject(object.optionalGroup);\n                }\n                if (object.id != null)\n                    message.id = String(object.id);\n                if (object.requiredSimple != null) {\n                    if (typeof object.requiredSimple !== \"object\")\n                        throw TypeError(\".jspb.test.TestGroup.requiredSimple: object expected\");\n                    message.requiredSimple = $root.jspb.test.Simple2.fromObject(object.requiredSimple);\n                }\n                if (object.optionalSimple != null) {\n                    if (typeof object.optionalSimple !== \"object\")\n                        throw TypeError(\".jspb.test.TestGroup.optionalSimple: object expected\");\n                    message.optionalSimple = $root.jspb.test.Simple2.fromObject(object.optionalSimple);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestGroup message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {jspb.test.TestGroup} message TestGroup\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestGroup.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.repeatedGroup = [];\n                if (options.defaults) {\n                    object.requiredGroup = null;\n                    object.optionalGroup = null;\n                    object.id = \"\";\n                    object.requiredSimple = null;\n                    object.optionalSimple = null;\n                }\n                if (message.repeatedGroup && message.repeatedGroup.length) {\n                    object.repeatedGroup = [];\n                    for (var j = 0; j < message.repeatedGroup.length; ++j)\n                        object.repeatedGroup[j] = $root.jspb.test.TestGroup.RepeatedGroup.toObject(message.repeatedGroup[j], options);\n                }\n                if (message.requiredGroup != null && message.hasOwnProperty(\"requiredGroup\"))\n                    object.requiredGroup = $root.jspb.test.TestGroup.RequiredGroup.toObject(message.requiredGroup, options);\n                if (message.optionalGroup != null && message.hasOwnProperty(\"optionalGroup\"))\n                    object.optionalGroup = $root.jspb.test.TestGroup.OptionalGroup.toObject(message.optionalGroup, options);\n                if (message.id != null && message.hasOwnProperty(\"id\"))\n                    object.id = message.id;\n                if (message.requiredSimple != null && message.hasOwnProperty(\"requiredSimple\"))\n                    object.requiredSimple = $root.jspb.test.Simple2.toObject(message.requiredSimple, options);\n                if (message.optionalSimple != null && message.hasOwnProperty(\"optionalSimple\"))\n                    object.optionalSimple = $root.jspb.test.Simple2.toObject(message.optionalSimple, options);\n                return object;\n            };\n\n            /**\n             * Converts this TestGroup to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestGroup\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestGroup.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestGroup\n             * @function getTypeUrl\n             * @memberof jspb.test.TestGroup\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestGroup\";\n            };\n\n            TestGroup.RepeatedGroup = (function() {\n\n                /**\n                 * Properties of a RepeatedGroup.\n                 * @memberof jspb.test.TestGroup\n                 * @interface IRepeatedGroup\n                 * @property {string} id RepeatedGroup id\n                 * @property {Array.<boolean>|null} [someBool] RepeatedGroup someBool\n                 */\n\n                /**\n                 * Constructs a new RepeatedGroup.\n                 * @memberof jspb.test.TestGroup\n                 * @classdesc Represents a RepeatedGroup.\n                 * @implements IRepeatedGroup\n                 * @constructor\n                 * @param {jspb.test.TestGroup.IRepeatedGroup=} [properties] Properties to set\n                 */\n                function RepeatedGroup(properties) {\n                    this.someBool = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * RepeatedGroup id.\n                 * @member {string} id\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @instance\n                 */\n                RepeatedGroup.prototype.id = \"\";\n\n                /**\n                 * RepeatedGroup someBool.\n                 * @member {Array.<boolean>} someBool\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @instance\n                 */\n                RepeatedGroup.prototype.someBool = $util.emptyArray;\n\n                /**\n                 * Creates a new RepeatedGroup instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IRepeatedGroup=} [properties] Properties to set\n                 * @returns {jspb.test.TestGroup.RepeatedGroup} RepeatedGroup instance\n                 */\n                RepeatedGroup.create = function create(properties) {\n                    return new RepeatedGroup(properties);\n                };\n\n                /**\n                 * Encodes the specified RepeatedGroup message. Does not implicitly {@link jspb.test.TestGroup.RepeatedGroup.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IRepeatedGroup} message RepeatedGroup message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                RepeatedGroup.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);\n                    if (message.someBool != null && message.someBool.length)\n                        for (var i = 0; i < message.someBool.length; ++i)\n                            writer.uint32(/* id 2, wireType 0 =*/16).bool(message.someBool[i]);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified RepeatedGroup message, length delimited. Does not implicitly {@link jspb.test.TestGroup.RepeatedGroup.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IRepeatedGroup} message RepeatedGroup message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                RepeatedGroup.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a RepeatedGroup message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.TestGroup.RepeatedGroup} RepeatedGroup\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                RepeatedGroup.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestGroup.RepeatedGroup();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        if ((tag & 7) === 4)\n                            break;\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.id = reader.string();\n                            break;\n                        case 2:\n                            if (!(message.someBool && message.someBool.length))\n                                message.someBool = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.someBool.push(reader.bool());\n                            } else\n                                message.someBool.push(reader.bool());\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    if (!message.hasOwnProperty(\"id\"))\n                        throw $util.ProtocolError(\"missing required 'id'\", { instance: message });\n                    return message;\n                };\n\n                /**\n                 * Decodes a RepeatedGroup message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.TestGroup.RepeatedGroup} RepeatedGroup\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                RepeatedGroup.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a RepeatedGroup message.\n                 * @function verify\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                RepeatedGroup.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (!$util.isString(message.id))\n                        return \"id: string expected\";\n                    if (message.someBool != null && message.hasOwnProperty(\"someBool\")) {\n                        if (!Array.isArray(message.someBool))\n                            return \"someBool: array expected\";\n                        for (var i = 0; i < message.someBool.length; ++i)\n                            if (typeof message.someBool[i] !== \"boolean\")\n                                return \"someBool: boolean[] expected\";\n                    }\n                    return null;\n                };\n\n                /**\n                 * Creates a RepeatedGroup message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.TestGroup.RepeatedGroup} RepeatedGroup\n                 */\n                RepeatedGroup.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.TestGroup.RepeatedGroup)\n                        return object;\n                    var message = new $root.jspb.test.TestGroup.RepeatedGroup();\n                    if (object.id != null)\n                        message.id = String(object.id);\n                    if (object.someBool) {\n                        if (!Array.isArray(object.someBool))\n                            throw TypeError(\".jspb.test.TestGroup.RepeatedGroup.someBool: array expected\");\n                        message.someBool = [];\n                        for (var i = 0; i < object.someBool.length; ++i)\n                            message.someBool[i] = Boolean(object.someBool[i]);\n                    }\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a RepeatedGroup message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.RepeatedGroup} message RepeatedGroup\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                RepeatedGroup.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults)\n                        object.someBool = [];\n                    if (options.defaults)\n                        object.id = \"\";\n                    if (message.id != null && message.hasOwnProperty(\"id\"))\n                        object.id = message.id;\n                    if (message.someBool && message.someBool.length) {\n                        object.someBool = [];\n                        for (var j = 0; j < message.someBool.length; ++j)\n                            object.someBool[j] = message.someBool[j];\n                    }\n                    return object;\n                };\n\n                /**\n                 * Converts this RepeatedGroup to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                RepeatedGroup.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for RepeatedGroup\n                 * @function getTypeUrl\n                 * @memberof jspb.test.TestGroup.RepeatedGroup\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                RepeatedGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.TestGroup.RepeatedGroup\";\n                };\n\n                return RepeatedGroup;\n            })();\n\n            TestGroup.RequiredGroup = (function() {\n\n                /**\n                 * Properties of a RequiredGroup.\n                 * @memberof jspb.test.TestGroup\n                 * @interface IRequiredGroup\n                 * @property {string} id RequiredGroup id\n                 */\n\n                /**\n                 * Constructs a new RequiredGroup.\n                 * @memberof jspb.test.TestGroup\n                 * @classdesc Represents a RequiredGroup.\n                 * @implements IRequiredGroup\n                 * @constructor\n                 * @param {jspb.test.TestGroup.IRequiredGroup=} [properties] Properties to set\n                 */\n                function RequiredGroup(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * RequiredGroup id.\n                 * @member {string} id\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @instance\n                 */\n                RequiredGroup.prototype.id = \"\";\n\n                /**\n                 * Creates a new RequiredGroup instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IRequiredGroup=} [properties] Properties to set\n                 * @returns {jspb.test.TestGroup.RequiredGroup} RequiredGroup instance\n                 */\n                RequiredGroup.create = function create(properties) {\n                    return new RequiredGroup(properties);\n                };\n\n                /**\n                 * Encodes the specified RequiredGroup message. Does not implicitly {@link jspb.test.TestGroup.RequiredGroup.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IRequiredGroup} message RequiredGroup message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                RequiredGroup.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified RequiredGroup message, length delimited. Does not implicitly {@link jspb.test.TestGroup.RequiredGroup.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IRequiredGroup} message RequiredGroup message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                RequiredGroup.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a RequiredGroup message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.TestGroup.RequiredGroup} RequiredGroup\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                RequiredGroup.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestGroup.RequiredGroup();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        if ((tag & 7) === 4)\n                            break;\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.id = reader.string();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    if (!message.hasOwnProperty(\"id\"))\n                        throw $util.ProtocolError(\"missing required 'id'\", { instance: message });\n                    return message;\n                };\n\n                /**\n                 * Decodes a RequiredGroup message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.TestGroup.RequiredGroup} RequiredGroup\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                RequiredGroup.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a RequiredGroup message.\n                 * @function verify\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                RequiredGroup.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (!$util.isString(message.id))\n                        return \"id: string expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a RequiredGroup message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.TestGroup.RequiredGroup} RequiredGroup\n                 */\n                RequiredGroup.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.TestGroup.RequiredGroup)\n                        return object;\n                    var message = new $root.jspb.test.TestGroup.RequiredGroup();\n                    if (object.id != null)\n                        message.id = String(object.id);\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a RequiredGroup message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.RequiredGroup} message RequiredGroup\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                RequiredGroup.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults)\n                        object.id = \"\";\n                    if (message.id != null && message.hasOwnProperty(\"id\"))\n                        object.id = message.id;\n                    return object;\n                };\n\n                /**\n                 * Converts this RequiredGroup to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                RequiredGroup.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for RequiredGroup\n                 * @function getTypeUrl\n                 * @memberof jspb.test.TestGroup.RequiredGroup\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                RequiredGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.TestGroup.RequiredGroup\";\n                };\n\n                return RequiredGroup;\n            })();\n\n            TestGroup.OptionalGroup = (function() {\n\n                /**\n                 * Properties of an OptionalGroup.\n                 * @memberof jspb.test.TestGroup\n                 * @interface IOptionalGroup\n                 * @property {string} id OptionalGroup id\n                 */\n\n                /**\n                 * Constructs a new OptionalGroup.\n                 * @memberof jspb.test.TestGroup\n                 * @classdesc Represents an OptionalGroup.\n                 * @implements IOptionalGroup\n                 * @constructor\n                 * @param {jspb.test.TestGroup.IOptionalGroup=} [properties] Properties to set\n                 */\n                function OptionalGroup(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * OptionalGroup id.\n                 * @member {string} id\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @instance\n                 */\n                OptionalGroup.prototype.id = \"\";\n\n                /**\n                 * Creates a new OptionalGroup instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IOptionalGroup=} [properties] Properties to set\n                 * @returns {jspb.test.TestGroup.OptionalGroup} OptionalGroup instance\n                 */\n                OptionalGroup.create = function create(properties) {\n                    return new OptionalGroup(properties);\n                };\n\n                /**\n                 * Encodes the specified OptionalGroup message. Does not implicitly {@link jspb.test.TestGroup.OptionalGroup.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IOptionalGroup} message OptionalGroup message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                OptionalGroup.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.id);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified OptionalGroup message, length delimited. Does not implicitly {@link jspb.test.TestGroup.OptionalGroup.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.IOptionalGroup} message OptionalGroup message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                OptionalGroup.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes an OptionalGroup message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.TestGroup.OptionalGroup} OptionalGroup\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                OptionalGroup.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestGroup.OptionalGroup();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        if ((tag & 7) === 4)\n                            break;\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.id = reader.string();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    if (!message.hasOwnProperty(\"id\"))\n                        throw $util.ProtocolError(\"missing required 'id'\", { instance: message });\n                    return message;\n                };\n\n                /**\n                 * Decodes an OptionalGroup message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.TestGroup.OptionalGroup} OptionalGroup\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                OptionalGroup.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies an OptionalGroup message.\n                 * @function verify\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                OptionalGroup.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (!$util.isString(message.id))\n                        return \"id: string expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates an OptionalGroup message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.TestGroup.OptionalGroup} OptionalGroup\n                 */\n                OptionalGroup.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.TestGroup.OptionalGroup)\n                        return object;\n                    var message = new $root.jspb.test.TestGroup.OptionalGroup();\n                    if (object.id != null)\n                        message.id = String(object.id);\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an OptionalGroup message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {jspb.test.TestGroup.OptionalGroup} message OptionalGroup\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                OptionalGroup.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults)\n                        object.id = \"\";\n                    if (message.id != null && message.hasOwnProperty(\"id\"))\n                        object.id = message.id;\n                    return object;\n                };\n\n                /**\n                 * Converts this OptionalGroup to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                OptionalGroup.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for OptionalGroup\n                 * @function getTypeUrl\n                 * @memberof jspb.test.TestGroup.OptionalGroup\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                OptionalGroup.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.TestGroup.OptionalGroup\";\n                };\n\n                return OptionalGroup;\n            })();\n\n            return TestGroup;\n        })();\n\n        test.TestGroup1 = (function() {\n\n            /**\n             * Properties of a TestGroup1.\n             * @memberof jspb.test\n             * @interface ITestGroup1\n             * @property {jspb.test.TestGroup.IRepeatedGroup|null} [group] TestGroup1 group\n             */\n\n            /**\n             * Constructs a new TestGroup1.\n             * @memberof jspb.test\n             * @classdesc Represents a TestGroup1.\n             * @implements ITestGroup1\n             * @constructor\n             * @param {jspb.test.ITestGroup1=} [properties] Properties to set\n             */\n            function TestGroup1(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestGroup1 group.\n             * @member {jspb.test.TestGroup.IRepeatedGroup|null|undefined} group\n             * @memberof jspb.test.TestGroup1\n             * @instance\n             */\n            TestGroup1.prototype.group = null;\n\n            /**\n             * Creates a new TestGroup1 instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {jspb.test.ITestGroup1=} [properties] Properties to set\n             * @returns {jspb.test.TestGroup1} TestGroup1 instance\n             */\n            TestGroup1.create = function create(properties) {\n                return new TestGroup1(properties);\n            };\n\n            /**\n             * Encodes the specified TestGroup1 message. Does not implicitly {@link jspb.test.TestGroup1.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {jspb.test.ITestGroup1} message TestGroup1 message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestGroup1.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.group != null && Object.hasOwnProperty.call(message, \"group\"))\n                    $root.jspb.test.TestGroup.RepeatedGroup.encode(message.group, writer.uint32(/* id 1, wireType 3 =*/11)).uint32(/* id 1, wireType 4 =*/12);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestGroup1 message, length delimited. Does not implicitly {@link jspb.test.TestGroup1.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {jspb.test.ITestGroup1} message TestGroup1 message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestGroup1.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestGroup1 message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestGroup1} TestGroup1\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestGroup1.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestGroup1();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.group = $root.jspb.test.TestGroup.RepeatedGroup.decode(reader);\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestGroup1 message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestGroup1} TestGroup1\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestGroup1.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestGroup1 message.\n             * @function verify\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestGroup1.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.group != null && message.hasOwnProperty(\"group\")) {\n                    var error = $root.jspb.test.TestGroup.RepeatedGroup.verify(message.group);\n                    if (error)\n                        return \"group.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a TestGroup1 message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestGroup1} TestGroup1\n             */\n            TestGroup1.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestGroup1)\n                    return object;\n                var message = new $root.jspb.test.TestGroup1();\n                if (object.group != null) {\n                    if (typeof object.group !== \"object\")\n                        throw TypeError(\".jspb.test.TestGroup1.group: object expected\");\n                    message.group = $root.jspb.test.TestGroup.RepeatedGroup.fromObject(object.group);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestGroup1 message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {jspb.test.TestGroup1} message TestGroup1\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestGroup1.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.group = null;\n                if (message.group != null && message.hasOwnProperty(\"group\"))\n                    object.group = $root.jspb.test.TestGroup.RepeatedGroup.toObject(message.group, options);\n                return object;\n            };\n\n            /**\n             * Converts this TestGroup1 to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestGroup1\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestGroup1.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestGroup1\n             * @function getTypeUrl\n             * @memberof jspb.test.TestGroup1\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestGroup1.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestGroup1\";\n            };\n\n            return TestGroup1;\n        })();\n\n        test.TestReservedNames = (function() {\n\n            /**\n             * Properties of a TestReservedNames.\n             * @memberof jspb.test\n             * @interface ITestReservedNames\n             * @property {number|null} [extension] TestReservedNames extension\n             * @property {number|null} [\".jspb.test.TestReservedNamesExtension.foo\"] TestReservedNames .jspb.test.TestReservedNamesExtension.foo\n             */\n\n            /**\n             * Constructs a new TestReservedNames.\n             * @memberof jspb.test\n             * @classdesc Represents a TestReservedNames.\n             * @implements ITestReservedNames\n             * @constructor\n             * @param {jspb.test.ITestReservedNames=} [properties] Properties to set\n             */\n            function TestReservedNames(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestReservedNames extension.\n             * @member {number} extension\n             * @memberof jspb.test.TestReservedNames\n             * @instance\n             */\n            TestReservedNames.prototype.extension = 0;\n\n            /**\n             * TestReservedNames .jspb.test.TestReservedNamesExtension.foo.\n             * @member {number} .jspb.test.TestReservedNamesExtension.foo\n             * @memberof jspb.test.TestReservedNames\n             * @instance\n             */\n            TestReservedNames.prototype[\".jspb.test.TestReservedNamesExtension.foo\"] = 0;\n\n            /**\n             * Creates a new TestReservedNames instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {jspb.test.ITestReservedNames=} [properties] Properties to set\n             * @returns {jspb.test.TestReservedNames} TestReservedNames instance\n             */\n            TestReservedNames.create = function create(properties) {\n                return new TestReservedNames(properties);\n            };\n\n            /**\n             * Encodes the specified TestReservedNames message. Does not implicitly {@link jspb.test.TestReservedNames.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {jspb.test.ITestReservedNames} message TestReservedNames message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestReservedNames.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.extension != null && Object.hasOwnProperty.call(message, \"extension\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.extension);\n                if (message[\".jspb.test.TestReservedNamesExtension.foo\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.TestReservedNamesExtension.foo\"))\n                    writer.uint32(/* id 10, wireType 0 =*/80).int32(message[\".jspb.test.TestReservedNamesExtension.foo\"]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestReservedNames message, length delimited. Does not implicitly {@link jspb.test.TestReservedNames.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {jspb.test.ITestReservedNames} message TestReservedNames message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestReservedNames.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestReservedNames message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestReservedNames} TestReservedNames\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestReservedNames.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestReservedNames();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.extension = reader.int32();\n                        break;\n                    case 10:\n                        message[\".jspb.test.TestReservedNamesExtension.foo\"] = reader.int32();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestReservedNames message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestReservedNames} TestReservedNames\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestReservedNames.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestReservedNames message.\n             * @function verify\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestReservedNames.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.extension != null && message.hasOwnProperty(\"extension\"))\n                    if (!$util.isInteger(message.extension))\n                        return \"extension: integer expected\";\n                if (message[\".jspb.test.TestReservedNamesExtension.foo\"] != null && message.hasOwnProperty(\".jspb.test.TestReservedNamesExtension.foo\"))\n                    if (!$util.isInteger(message[\".jspb.test.TestReservedNamesExtension.foo\"]))\n                        return \".jspb.test.TestReservedNamesExtension.foo: integer expected\";\n                return null;\n            };\n\n            /**\n             * Creates a TestReservedNames message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestReservedNames} TestReservedNames\n             */\n            TestReservedNames.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestReservedNames)\n                    return object;\n                var message = new $root.jspb.test.TestReservedNames();\n                if (object.extension != null)\n                    message.extension = object.extension | 0;\n                if (object[\".jspb.test.TestReservedNamesExtension.foo\"] != null)\n                    message[\".jspb.test.TestReservedNamesExtension.foo\"] = object[\".jspb.test.TestReservedNamesExtension.foo\"] | 0;\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestReservedNames message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {jspb.test.TestReservedNames} message TestReservedNames\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestReservedNames.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.extension = 0;\n                    object[\".jspb.test.TestReservedNamesExtension.foo\"] = 0;\n                }\n                if (message.extension != null && message.hasOwnProperty(\"extension\"))\n                    object.extension = message.extension;\n                if (message[\".jspb.test.TestReservedNamesExtension.foo\"] != null && message.hasOwnProperty(\".jspb.test.TestReservedNamesExtension.foo\"))\n                    object[\".jspb.test.TestReservedNamesExtension.foo\"] = message[\".jspb.test.TestReservedNamesExtension.foo\"];\n                return object;\n            };\n\n            /**\n             * Converts this TestReservedNames to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestReservedNames\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestReservedNames.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestReservedNames\n             * @function getTypeUrl\n             * @memberof jspb.test.TestReservedNames\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestReservedNames.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestReservedNames\";\n            };\n\n            return TestReservedNames;\n        })();\n\n        test.TestReservedNamesExtension = (function() {\n\n            /**\n             * Properties of a TestReservedNamesExtension.\n             * @memberof jspb.test\n             * @interface ITestReservedNamesExtension\n             */\n\n            /**\n             * Constructs a new TestReservedNamesExtension.\n             * @memberof jspb.test\n             * @classdesc Represents a TestReservedNamesExtension.\n             * @implements ITestReservedNamesExtension\n             * @constructor\n             * @param {jspb.test.ITestReservedNamesExtension=} [properties] Properties to set\n             */\n            function TestReservedNamesExtension(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Creates a new TestReservedNamesExtension instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {jspb.test.ITestReservedNamesExtension=} [properties] Properties to set\n             * @returns {jspb.test.TestReservedNamesExtension} TestReservedNamesExtension instance\n             */\n            TestReservedNamesExtension.create = function create(properties) {\n                return new TestReservedNamesExtension(properties);\n            };\n\n            /**\n             * Encodes the specified TestReservedNamesExtension message. Does not implicitly {@link jspb.test.TestReservedNamesExtension.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {jspb.test.ITestReservedNamesExtension} message TestReservedNamesExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestReservedNamesExtension.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestReservedNamesExtension message, length delimited. Does not implicitly {@link jspb.test.TestReservedNamesExtension.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {jspb.test.ITestReservedNamesExtension} message TestReservedNamesExtension message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestReservedNamesExtension.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestReservedNamesExtension message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestReservedNamesExtension} TestReservedNamesExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestReservedNamesExtension.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestReservedNamesExtension();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestReservedNamesExtension message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestReservedNamesExtension} TestReservedNamesExtension\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestReservedNamesExtension.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestReservedNamesExtension message.\n             * @function verify\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestReservedNamesExtension.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                return null;\n            };\n\n            /**\n             * Creates a TestReservedNamesExtension message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestReservedNamesExtension} TestReservedNamesExtension\n             */\n            TestReservedNamesExtension.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestReservedNamesExtension)\n                    return object;\n                return new $root.jspb.test.TestReservedNamesExtension();\n            };\n\n            /**\n             * Creates a plain object from a TestReservedNamesExtension message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {jspb.test.TestReservedNamesExtension} message TestReservedNamesExtension\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestReservedNamesExtension.toObject = function toObject() {\n                return {};\n            };\n\n            /**\n             * Converts this TestReservedNamesExtension to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestReservedNamesExtension.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestReservedNamesExtension\n             * @function getTypeUrl\n             * @memberof jspb.test.TestReservedNamesExtension\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestReservedNamesExtension.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestReservedNamesExtension\";\n            };\n\n            return TestReservedNamesExtension;\n        })();\n\n        test.TestMessageWithOneof = (function() {\n\n            /**\n             * Properties of a TestMessageWithOneof.\n             * @memberof jspb.test\n             * @interface ITestMessageWithOneof\n             * @property {string|null} [pone] TestMessageWithOneof pone\n             * @property {string|null} [pthree] TestMessageWithOneof pthree\n             * @property {jspb.test.ITestMessageWithOneof|null} [rone] TestMessageWithOneof rone\n             * @property {string|null} [rtwo] TestMessageWithOneof rtwo\n             * @property {boolean|null} [normalField] TestMessageWithOneof normalField\n             * @property {Array.<string>|null} [repeatedField] TestMessageWithOneof repeatedField\n             * @property {number|null} [aone] TestMessageWithOneof aone\n             * @property {number|null} [atwo] TestMessageWithOneof atwo\n             * @property {number|null} [bone] TestMessageWithOneof bone\n             * @property {number|null} [btwo] TestMessageWithOneof btwo\n             */\n\n            /**\n             * Constructs a new TestMessageWithOneof.\n             * @memberof jspb.test\n             * @classdesc Represents a TestMessageWithOneof.\n             * @implements ITestMessageWithOneof\n             * @constructor\n             * @param {jspb.test.ITestMessageWithOneof=} [properties] Properties to set\n             */\n            function TestMessageWithOneof(properties) {\n                this.repeatedField = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestMessageWithOneof pone.\n             * @member {string|null|undefined} pone\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.pone = null;\n\n            /**\n             * TestMessageWithOneof pthree.\n             * @member {string|null|undefined} pthree\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.pthree = null;\n\n            /**\n             * TestMessageWithOneof rone.\n             * @member {jspb.test.ITestMessageWithOneof|null|undefined} rone\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.rone = null;\n\n            /**\n             * TestMessageWithOneof rtwo.\n             * @member {string|null|undefined} rtwo\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.rtwo = null;\n\n            /**\n             * TestMessageWithOneof normalField.\n             * @member {boolean} normalField\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.normalField = false;\n\n            /**\n             * TestMessageWithOneof repeatedField.\n             * @member {Array.<string>} repeatedField\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.repeatedField = $util.emptyArray;\n\n            /**\n             * TestMessageWithOneof aone.\n             * @member {number|null|undefined} aone\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.aone = null;\n\n            /**\n             * TestMessageWithOneof atwo.\n             * @member {number|null|undefined} atwo\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.atwo = null;\n\n            /**\n             * TestMessageWithOneof bone.\n             * @member {number|null|undefined} bone\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.bone = null;\n\n            /**\n             * TestMessageWithOneof btwo.\n             * @member {number|null|undefined} btwo\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            TestMessageWithOneof.prototype.btwo = null;\n\n            // OneOf field names bound to virtual getters and setters\n            var $oneOfFields;\n\n            /**\n             * TestMessageWithOneof partialOneof.\n             * @member {\"pone\"|\"pthree\"|undefined} partialOneof\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            Object.defineProperty(TestMessageWithOneof.prototype, \"partialOneof\", {\n                get: $util.oneOfGetter($oneOfFields = [\"pone\", \"pthree\"]),\n                set: $util.oneOfSetter($oneOfFields)\n            });\n\n            /**\n             * TestMessageWithOneof recursiveOneof.\n             * @member {\"rone\"|\"rtwo\"|undefined} recursiveOneof\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            Object.defineProperty(TestMessageWithOneof.prototype, \"recursiveOneof\", {\n                get: $util.oneOfGetter($oneOfFields = [\"rone\", \"rtwo\"]),\n                set: $util.oneOfSetter($oneOfFields)\n            });\n\n            /**\n             * TestMessageWithOneof defaultOneofA.\n             * @member {\"aone\"|\"atwo\"|undefined} defaultOneofA\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            Object.defineProperty(TestMessageWithOneof.prototype, \"defaultOneofA\", {\n                get: $util.oneOfGetter($oneOfFields = [\"aone\", \"atwo\"]),\n                set: $util.oneOfSetter($oneOfFields)\n            });\n\n            /**\n             * TestMessageWithOneof defaultOneofB.\n             * @member {\"bone\"|\"btwo\"|undefined} defaultOneofB\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             */\n            Object.defineProperty(TestMessageWithOneof.prototype, \"defaultOneofB\", {\n                get: $util.oneOfGetter($oneOfFields = [\"bone\", \"btwo\"]),\n                set: $util.oneOfSetter($oneOfFields)\n            });\n\n            /**\n             * Creates a new TestMessageWithOneof instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {jspb.test.ITestMessageWithOneof=} [properties] Properties to set\n             * @returns {jspb.test.TestMessageWithOneof} TestMessageWithOneof instance\n             */\n            TestMessageWithOneof.create = function create(properties) {\n                return new TestMessageWithOneof(properties);\n            };\n\n            /**\n             * Encodes the specified TestMessageWithOneof message. Does not implicitly {@link jspb.test.TestMessageWithOneof.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {jspb.test.ITestMessageWithOneof} message TestMessageWithOneof message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestMessageWithOneof.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.pone != null && Object.hasOwnProperty.call(message, \"pone\"))\n                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.pone);\n                if (message.pthree != null && Object.hasOwnProperty.call(message, \"pthree\"))\n                    writer.uint32(/* id 5, wireType 2 =*/42).string(message.pthree);\n                if (message.rone != null && Object.hasOwnProperty.call(message, \"rone\"))\n                    $root.jspb.test.TestMessageWithOneof.encode(message.rone, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                if (message.rtwo != null && Object.hasOwnProperty.call(message, \"rtwo\"))\n                    writer.uint32(/* id 7, wireType 2 =*/58).string(message.rtwo);\n                if (message.normalField != null && Object.hasOwnProperty.call(message, \"normalField\"))\n                    writer.uint32(/* id 8, wireType 0 =*/64).bool(message.normalField);\n                if (message.repeatedField != null && message.repeatedField.length)\n                    for (var i = 0; i < message.repeatedField.length; ++i)\n                        writer.uint32(/* id 9, wireType 2 =*/74).string(message.repeatedField[i]);\n                if (message.aone != null && Object.hasOwnProperty.call(message, \"aone\"))\n                    writer.uint32(/* id 10, wireType 0 =*/80).int32(message.aone);\n                if (message.atwo != null && Object.hasOwnProperty.call(message, \"atwo\"))\n                    writer.uint32(/* id 11, wireType 0 =*/88).int32(message.atwo);\n                if (message.bone != null && Object.hasOwnProperty.call(message, \"bone\"))\n                    writer.uint32(/* id 12, wireType 0 =*/96).int32(message.bone);\n                if (message.btwo != null && Object.hasOwnProperty.call(message, \"btwo\"))\n                    writer.uint32(/* id 13, wireType 0 =*/104).int32(message.btwo);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestMessageWithOneof message, length delimited. Does not implicitly {@link jspb.test.TestMessageWithOneof.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {jspb.test.ITestMessageWithOneof} message TestMessageWithOneof message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestMessageWithOneof.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestMessageWithOneof message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestMessageWithOneof} TestMessageWithOneof\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestMessageWithOneof.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestMessageWithOneof();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 3:\n                        message.pone = reader.string();\n                        break;\n                    case 5:\n                        message.pthree = reader.string();\n                        break;\n                    case 6:\n                        message.rone = $root.jspb.test.TestMessageWithOneof.decode(reader, reader.uint32());\n                        break;\n                    case 7:\n                        message.rtwo = reader.string();\n                        break;\n                    case 8:\n                        message.normalField = reader.bool();\n                        break;\n                    case 9:\n                        if (!(message.repeatedField && message.repeatedField.length))\n                            message.repeatedField = [];\n                        message.repeatedField.push(reader.string());\n                        break;\n                    case 10:\n                        message.aone = reader.int32();\n                        break;\n                    case 11:\n                        message.atwo = reader.int32();\n                        break;\n                    case 12:\n                        message.bone = reader.int32();\n                        break;\n                    case 13:\n                        message.btwo = reader.int32();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestMessageWithOneof message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestMessageWithOneof} TestMessageWithOneof\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestMessageWithOneof.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestMessageWithOneof message.\n             * @function verify\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestMessageWithOneof.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                var properties = {};\n                if (message.pone != null && message.hasOwnProperty(\"pone\")) {\n                    properties.partialOneof = 1;\n                    if (!$util.isString(message.pone))\n                        return \"pone: string expected\";\n                }\n                if (message.pthree != null && message.hasOwnProperty(\"pthree\")) {\n                    if (properties.partialOneof === 1)\n                        return \"partialOneof: multiple values\";\n                    properties.partialOneof = 1;\n                    if (!$util.isString(message.pthree))\n                        return \"pthree: string expected\";\n                }\n                if (message.rone != null && message.hasOwnProperty(\"rone\")) {\n                    properties.recursiveOneof = 1;\n                    {\n                        var error = $root.jspb.test.TestMessageWithOneof.verify(message.rone);\n                        if (error)\n                            return \"rone.\" + error;\n                    }\n                }\n                if (message.rtwo != null && message.hasOwnProperty(\"rtwo\")) {\n                    if (properties.recursiveOneof === 1)\n                        return \"recursiveOneof: multiple values\";\n                    properties.recursiveOneof = 1;\n                    if (!$util.isString(message.rtwo))\n                        return \"rtwo: string expected\";\n                }\n                if (message.normalField != null && message.hasOwnProperty(\"normalField\"))\n                    if (typeof message.normalField !== \"boolean\")\n                        return \"normalField: boolean expected\";\n                if (message.repeatedField != null && message.hasOwnProperty(\"repeatedField\")) {\n                    if (!Array.isArray(message.repeatedField))\n                        return \"repeatedField: array expected\";\n                    for (var i = 0; i < message.repeatedField.length; ++i)\n                        if (!$util.isString(message.repeatedField[i]))\n                            return \"repeatedField: string[] expected\";\n                }\n                if (message.aone != null && message.hasOwnProperty(\"aone\")) {\n                    properties.defaultOneofA = 1;\n                    if (!$util.isInteger(message.aone))\n                        return \"aone: integer expected\";\n                }\n                if (message.atwo != null && message.hasOwnProperty(\"atwo\")) {\n                    if (properties.defaultOneofA === 1)\n                        return \"defaultOneofA: multiple values\";\n                    properties.defaultOneofA = 1;\n                    if (!$util.isInteger(message.atwo))\n                        return \"atwo: integer expected\";\n                }\n                if (message.bone != null && message.hasOwnProperty(\"bone\")) {\n                    properties.defaultOneofB = 1;\n                    if (!$util.isInteger(message.bone))\n                        return \"bone: integer expected\";\n                }\n                if (message.btwo != null && message.hasOwnProperty(\"btwo\")) {\n                    if (properties.defaultOneofB === 1)\n                        return \"defaultOneofB: multiple values\";\n                    properties.defaultOneofB = 1;\n                    if (!$util.isInteger(message.btwo))\n                        return \"btwo: integer expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates a TestMessageWithOneof message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestMessageWithOneof} TestMessageWithOneof\n             */\n            TestMessageWithOneof.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestMessageWithOneof)\n                    return object;\n                var message = new $root.jspb.test.TestMessageWithOneof();\n                if (object.pone != null)\n                    message.pone = String(object.pone);\n                if (object.pthree != null)\n                    message.pthree = String(object.pthree);\n                if (object.rone != null) {\n                    if (typeof object.rone !== \"object\")\n                        throw TypeError(\".jspb.test.TestMessageWithOneof.rone: object expected\");\n                    message.rone = $root.jspb.test.TestMessageWithOneof.fromObject(object.rone);\n                }\n                if (object.rtwo != null)\n                    message.rtwo = String(object.rtwo);\n                if (object.normalField != null)\n                    message.normalField = Boolean(object.normalField);\n                if (object.repeatedField) {\n                    if (!Array.isArray(object.repeatedField))\n                        throw TypeError(\".jspb.test.TestMessageWithOneof.repeatedField: array expected\");\n                    message.repeatedField = [];\n                    for (var i = 0; i < object.repeatedField.length; ++i)\n                        message.repeatedField[i] = String(object.repeatedField[i]);\n                }\n                if (object.aone != null)\n                    message.aone = object.aone | 0;\n                if (object.atwo != null)\n                    message.atwo = object.atwo | 0;\n                if (object.bone != null)\n                    message.bone = object.bone | 0;\n                if (object.btwo != null)\n                    message.btwo = object.btwo | 0;\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestMessageWithOneof message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {jspb.test.TestMessageWithOneof} message TestMessageWithOneof\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestMessageWithOneof.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.repeatedField = [];\n                if (options.defaults)\n                    object.normalField = false;\n                if (message.pone != null && message.hasOwnProperty(\"pone\")) {\n                    object.pone = message.pone;\n                    if (options.oneofs)\n                        object.partialOneof = \"pone\";\n                }\n                if (message.pthree != null && message.hasOwnProperty(\"pthree\")) {\n                    object.pthree = message.pthree;\n                    if (options.oneofs)\n                        object.partialOneof = \"pthree\";\n                }\n                if (message.rone != null && message.hasOwnProperty(\"rone\")) {\n                    object.rone = $root.jspb.test.TestMessageWithOneof.toObject(message.rone, options);\n                    if (options.oneofs)\n                        object.recursiveOneof = \"rone\";\n                }\n                if (message.rtwo != null && message.hasOwnProperty(\"rtwo\")) {\n                    object.rtwo = message.rtwo;\n                    if (options.oneofs)\n                        object.recursiveOneof = \"rtwo\";\n                }\n                if (message.normalField != null && message.hasOwnProperty(\"normalField\"))\n                    object.normalField = message.normalField;\n                if (message.repeatedField && message.repeatedField.length) {\n                    object.repeatedField = [];\n                    for (var j = 0; j < message.repeatedField.length; ++j)\n                        object.repeatedField[j] = message.repeatedField[j];\n                }\n                if (message.aone != null && message.hasOwnProperty(\"aone\")) {\n                    object.aone = message.aone;\n                    if (options.oneofs)\n                        object.defaultOneofA = \"aone\";\n                }\n                if (message.atwo != null && message.hasOwnProperty(\"atwo\")) {\n                    object.atwo = message.atwo;\n                    if (options.oneofs)\n                        object.defaultOneofA = \"atwo\";\n                }\n                if (message.bone != null && message.hasOwnProperty(\"bone\")) {\n                    object.bone = message.bone;\n                    if (options.oneofs)\n                        object.defaultOneofB = \"bone\";\n                }\n                if (message.btwo != null && message.hasOwnProperty(\"btwo\")) {\n                    object.btwo = message.btwo;\n                    if (options.oneofs)\n                        object.defaultOneofB = \"btwo\";\n                }\n                return object;\n            };\n\n            /**\n             * Converts this TestMessageWithOneof to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestMessageWithOneof\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestMessageWithOneof.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestMessageWithOneof\n             * @function getTypeUrl\n             * @memberof jspb.test.TestMessageWithOneof\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestMessageWithOneof.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestMessageWithOneof\";\n            };\n\n            return TestMessageWithOneof;\n        })();\n\n        test.TestEndsWithBytes = (function() {\n\n            /**\n             * Properties of a TestEndsWithBytes.\n             * @memberof jspb.test\n             * @interface ITestEndsWithBytes\n             * @property {number|null} [value] TestEndsWithBytes value\n             * @property {Uint8Array|null} [data] TestEndsWithBytes data\n             */\n\n            /**\n             * Constructs a new TestEndsWithBytes.\n             * @memberof jspb.test\n             * @classdesc Represents a TestEndsWithBytes.\n             * @implements ITestEndsWithBytes\n             * @constructor\n             * @param {jspb.test.ITestEndsWithBytes=} [properties] Properties to set\n             */\n            function TestEndsWithBytes(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestEndsWithBytes value.\n             * @member {number} value\n             * @memberof jspb.test.TestEndsWithBytes\n             * @instance\n             */\n            TestEndsWithBytes.prototype.value = 0;\n\n            /**\n             * TestEndsWithBytes data.\n             * @member {Uint8Array} data\n             * @memberof jspb.test.TestEndsWithBytes\n             * @instance\n             */\n            TestEndsWithBytes.prototype.data = $util.newBuffer([]);\n\n            /**\n             * Creates a new TestEndsWithBytes instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {jspb.test.ITestEndsWithBytes=} [properties] Properties to set\n             * @returns {jspb.test.TestEndsWithBytes} TestEndsWithBytes instance\n             */\n            TestEndsWithBytes.create = function create(properties) {\n                return new TestEndsWithBytes(properties);\n            };\n\n            /**\n             * Encodes the specified TestEndsWithBytes message. Does not implicitly {@link jspb.test.TestEndsWithBytes.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {jspb.test.ITestEndsWithBytes} message TestEndsWithBytes message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestEndsWithBytes.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.value != null && Object.hasOwnProperty.call(message, \"value\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value);\n                if (message.data != null && Object.hasOwnProperty.call(message, \"data\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.data);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestEndsWithBytes message, length delimited. Does not implicitly {@link jspb.test.TestEndsWithBytes.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {jspb.test.ITestEndsWithBytes} message TestEndsWithBytes message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestEndsWithBytes.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestEndsWithBytes message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestEndsWithBytes} TestEndsWithBytes\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestEndsWithBytes.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestEndsWithBytes();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.value = reader.int32();\n                        break;\n                    case 2:\n                        message.data = reader.bytes();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestEndsWithBytes message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestEndsWithBytes} TestEndsWithBytes\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestEndsWithBytes.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestEndsWithBytes message.\n             * @function verify\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestEndsWithBytes.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.value != null && message.hasOwnProperty(\"value\"))\n                    if (!$util.isInteger(message.value))\n                        return \"value: integer expected\";\n                if (message.data != null && message.hasOwnProperty(\"data\"))\n                    if (!(message.data && typeof message.data.length === \"number\" || $util.isString(message.data)))\n                        return \"data: buffer expected\";\n                return null;\n            };\n\n            /**\n             * Creates a TestEndsWithBytes message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestEndsWithBytes} TestEndsWithBytes\n             */\n            TestEndsWithBytes.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestEndsWithBytes)\n                    return object;\n                var message = new $root.jspb.test.TestEndsWithBytes();\n                if (object.value != null)\n                    message.value = object.value | 0;\n                if (object.data != null)\n                    if (typeof object.data === \"string\")\n                        $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);\n                    else if (object.data.length >= 0)\n                        message.data = object.data;\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestEndsWithBytes message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {jspb.test.TestEndsWithBytes} message TestEndsWithBytes\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestEndsWithBytes.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.value = 0;\n                    if (options.bytes === String)\n                        object.data = \"\";\n                    else {\n                        object.data = [];\n                        if (options.bytes !== Array)\n                            object.data = $util.newBuffer(object.data);\n                    }\n                }\n                if (message.value != null && message.hasOwnProperty(\"value\"))\n                    object.value = message.value;\n                if (message.data != null && message.hasOwnProperty(\"data\"))\n                    object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;\n                return object;\n            };\n\n            /**\n             * Converts this TestEndsWithBytes to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestEndsWithBytes\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestEndsWithBytes.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestEndsWithBytes\n             * @function getTypeUrl\n             * @memberof jspb.test.TestEndsWithBytes\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestEndsWithBytes.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestEndsWithBytes\";\n            };\n\n            return TestEndsWithBytes;\n        })();\n\n        test.TestMapFieldsNoBinary = (function() {\n\n            /**\n             * Properties of a TestMapFieldsNoBinary.\n             * @memberof jspb.test\n             * @interface ITestMapFieldsNoBinary\n             * @property {Object.<string,string>|null} [mapStringString] TestMapFieldsNoBinary mapStringString\n             * @property {Object.<string,number>|null} [mapStringInt32] TestMapFieldsNoBinary mapStringInt32\n             * @property {Object.<string,number|Long>|null} [mapStringInt64] TestMapFieldsNoBinary mapStringInt64\n             * @property {Object.<string,boolean>|null} [mapStringBool] TestMapFieldsNoBinary mapStringBool\n             * @property {Object.<string,number>|null} [mapStringDouble] TestMapFieldsNoBinary mapStringDouble\n             * @property {Object.<string,jspb.test.MapValueEnumNoBinary>|null} [mapStringEnum] TestMapFieldsNoBinary mapStringEnum\n             * @property {Object.<string,jspb.test.IMapValueMessageNoBinary>|null} [mapStringMsg] TestMapFieldsNoBinary mapStringMsg\n             * @property {Object.<string,string>|null} [mapInt32String] TestMapFieldsNoBinary mapInt32String\n             * @property {Object.<string,string>|null} [mapInt64String] TestMapFieldsNoBinary mapInt64String\n             * @property {Object.<string,string>|null} [mapBoolString] TestMapFieldsNoBinary mapBoolString\n             * @property {jspb.test.ITestMapFieldsNoBinary|null} [testMapFields] TestMapFieldsNoBinary testMapFields\n             * @property {Object.<string,jspb.test.ITestMapFieldsNoBinary>|null} [mapStringTestmapfields] TestMapFieldsNoBinary mapStringTestmapfields\n             */\n\n            /**\n             * Constructs a new TestMapFieldsNoBinary.\n             * @memberof jspb.test\n             * @classdesc Represents a TestMapFieldsNoBinary.\n             * @implements ITestMapFieldsNoBinary\n             * @constructor\n             * @param {jspb.test.ITestMapFieldsNoBinary=} [properties] Properties to set\n             */\n            function TestMapFieldsNoBinary(properties) {\n                this.mapStringString = {};\n                this.mapStringInt32 = {};\n                this.mapStringInt64 = {};\n                this.mapStringBool = {};\n                this.mapStringDouble = {};\n                this.mapStringEnum = {};\n                this.mapStringMsg = {};\n                this.mapInt32String = {};\n                this.mapInt64String = {};\n                this.mapBoolString = {};\n                this.mapStringTestmapfields = {};\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * TestMapFieldsNoBinary mapStringString.\n             * @member {Object.<string,string>} mapStringString\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringString = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapStringInt32.\n             * @member {Object.<string,number>} mapStringInt32\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringInt32 = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapStringInt64.\n             * @member {Object.<string,number|Long>} mapStringInt64\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringInt64 = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapStringBool.\n             * @member {Object.<string,boolean>} mapStringBool\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringBool = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapStringDouble.\n             * @member {Object.<string,number>} mapStringDouble\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringDouble = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapStringEnum.\n             * @member {Object.<string,jspb.test.MapValueEnumNoBinary>} mapStringEnum\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringEnum = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapStringMsg.\n             * @member {Object.<string,jspb.test.IMapValueMessageNoBinary>} mapStringMsg\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringMsg = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapInt32String.\n             * @member {Object.<string,string>} mapInt32String\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapInt32String = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapInt64String.\n             * @member {Object.<string,string>} mapInt64String\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapInt64String = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary mapBoolString.\n             * @member {Object.<string,string>} mapBoolString\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapBoolString = $util.emptyObject;\n\n            /**\n             * TestMapFieldsNoBinary testMapFields.\n             * @member {jspb.test.ITestMapFieldsNoBinary|null|undefined} testMapFields\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.testMapFields = null;\n\n            /**\n             * TestMapFieldsNoBinary mapStringTestmapfields.\n             * @member {Object.<string,jspb.test.ITestMapFieldsNoBinary>} mapStringTestmapfields\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             */\n            TestMapFieldsNoBinary.prototype.mapStringTestmapfields = $util.emptyObject;\n\n            /**\n             * Creates a new TestMapFieldsNoBinary instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {jspb.test.ITestMapFieldsNoBinary=} [properties] Properties to set\n             * @returns {jspb.test.TestMapFieldsNoBinary} TestMapFieldsNoBinary instance\n             */\n            TestMapFieldsNoBinary.create = function create(properties) {\n                return new TestMapFieldsNoBinary(properties);\n            };\n\n            /**\n             * Encodes the specified TestMapFieldsNoBinary message. Does not implicitly {@link jspb.test.TestMapFieldsNoBinary.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {jspb.test.ITestMapFieldsNoBinary} message TestMapFieldsNoBinary message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestMapFieldsNoBinary.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.mapStringString != null && Object.hasOwnProperty.call(message, \"mapStringString\"))\n                    for (var keys = Object.keys(message.mapStringString), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapStringString[keys[i]]).ldelim();\n                if (message.mapStringInt32 != null && Object.hasOwnProperty.call(message, \"mapStringInt32\"))\n                    for (var keys = Object.keys(message.mapStringInt32), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 2, wireType 2 =*/18).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mapStringInt32[keys[i]]).ldelim();\n                if (message.mapStringInt64 != null && Object.hasOwnProperty.call(message, \"mapStringInt64\"))\n                    for (var keys = Object.keys(message.mapStringInt64), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int64(message.mapStringInt64[keys[i]]).ldelim();\n                if (message.mapStringBool != null && Object.hasOwnProperty.call(message, \"mapStringBool\"))\n                    for (var keys = Object.keys(message.mapStringBool), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).bool(message.mapStringBool[keys[i]]).ldelim();\n                if (message.mapStringDouble != null && Object.hasOwnProperty.call(message, \"mapStringDouble\"))\n                    for (var keys = Object.keys(message.mapStringDouble), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 1 =*/17).double(message.mapStringDouble[keys[i]]).ldelim();\n                if (message.mapStringEnum != null && Object.hasOwnProperty.call(message, \"mapStringEnum\"))\n                    for (var keys = Object.keys(message.mapStringEnum), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 6, wireType 2 =*/50).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.mapStringEnum[keys[i]]).ldelim();\n                if (message.mapStringMsg != null && Object.hasOwnProperty.call(message, \"mapStringMsg\"))\n                    for (var keys = Object.keys(message.mapStringMsg), i = 0; i < keys.length; ++i) {\n                        writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);\n                        $root.jspb.test.MapValueMessageNoBinary.encode(message.mapStringMsg[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();\n                    }\n                if (message.mapInt32String != null && Object.hasOwnProperty.call(message, \"mapInt32String\"))\n                    for (var keys = Object.keys(message.mapInt32String), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 8, wireType 2 =*/66).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapInt32String[keys[i]]).ldelim();\n                if (message.mapInt64String != null && Object.hasOwnProperty.call(message, \"mapInt64String\"))\n                    for (var keys = Object.keys(message.mapInt64String), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 9, wireType 2 =*/74).fork().uint32(/* id 1, wireType 0 =*/8).int64(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapInt64String[keys[i]]).ldelim();\n                if (message.mapBoolString != null && Object.hasOwnProperty.call(message, \"mapBoolString\"))\n                    for (var keys = Object.keys(message.mapBoolString), i = 0; i < keys.length; ++i)\n                        writer.uint32(/* id 10, wireType 2 =*/82).fork().uint32(/* id 1, wireType 0 =*/8).bool(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.mapBoolString[keys[i]]).ldelim();\n                if (message.testMapFields != null && Object.hasOwnProperty.call(message, \"testMapFields\"))\n                    $root.jspb.test.TestMapFieldsNoBinary.encode(message.testMapFields, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();\n                if (message.mapStringTestmapfields != null && Object.hasOwnProperty.call(message, \"mapStringTestmapfields\"))\n                    for (var keys = Object.keys(message.mapStringTestmapfields), i = 0; i < keys.length; ++i) {\n                        writer.uint32(/* id 12, wireType 2 =*/98).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]);\n                        $root.jspb.test.TestMapFieldsNoBinary.encode(message.mapStringTestmapfields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim();\n                    }\n                return writer;\n            };\n\n            /**\n             * Encodes the specified TestMapFieldsNoBinary message, length delimited. Does not implicitly {@link jspb.test.TestMapFieldsNoBinary.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {jspb.test.ITestMapFieldsNoBinary} message TestMapFieldsNoBinary message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            TestMapFieldsNoBinary.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a TestMapFieldsNoBinary message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.TestMapFieldsNoBinary} TestMapFieldsNoBinary\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestMapFieldsNoBinary.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.TestMapFieldsNoBinary(), key, value;\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (message.mapStringString === $util.emptyObject)\n                            message.mapStringString = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = \"\";\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = reader.string();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringString[key] = value;\n                        break;\n                    case 2:\n                        if (message.mapStringInt32 === $util.emptyObject)\n                            message.mapStringInt32 = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = 0;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = reader.int32();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringInt32[key] = value;\n                        break;\n                    case 3:\n                        if (message.mapStringInt64 === $util.emptyObject)\n                            message.mapStringInt64 = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = 0;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = reader.int64();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringInt64[key] = value;\n                        break;\n                    case 4:\n                        if (message.mapStringBool === $util.emptyObject)\n                            message.mapStringBool = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = false;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = reader.bool();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringBool[key] = value;\n                        break;\n                    case 5:\n                        if (message.mapStringDouble === $util.emptyObject)\n                            message.mapStringDouble = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = 0;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = reader.double();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringDouble[key] = value;\n                        break;\n                    case 6:\n                        if (message.mapStringEnum === $util.emptyObject)\n                            message.mapStringEnum = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = 0;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = reader.int32();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringEnum[key] = value;\n                        break;\n                    case 7:\n                        if (message.mapStringMsg === $util.emptyObject)\n                            message.mapStringMsg = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = null;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = $root.jspb.test.MapValueMessageNoBinary.decode(reader, reader.uint32());\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringMsg[key] = value;\n                        break;\n                    case 8:\n                        if (message.mapInt32String === $util.emptyObject)\n                            message.mapInt32String = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = 0;\n                        value = \"\";\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.int32();\n                                break;\n                            case 2:\n                                value = reader.string();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapInt32String[key] = value;\n                        break;\n                    case 9:\n                        if (message.mapInt64String === $util.emptyObject)\n                            message.mapInt64String = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = 0;\n                        value = \"\";\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.int64();\n                                break;\n                            case 2:\n                                value = reader.string();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapInt64String[typeof key === \"object\" ? $util.longToHash(key) : key] = value;\n                        break;\n                    case 10:\n                        if (message.mapBoolString === $util.emptyObject)\n                            message.mapBoolString = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = false;\n                        value = \"\";\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.bool();\n                                break;\n                            case 2:\n                                value = reader.string();\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapBoolString[key] = value;\n                        break;\n                    case 11:\n                        message.testMapFields = $root.jspb.test.TestMapFieldsNoBinary.decode(reader, reader.uint32());\n                        break;\n                    case 12:\n                        if (message.mapStringTestmapfields === $util.emptyObject)\n                            message.mapStringTestmapfields = {};\n                        var end2 = reader.uint32() + reader.pos;\n                        key = \"\";\n                        value = null;\n                        while (reader.pos < end2) {\n                            var tag2 = reader.uint32();\n                            switch (tag2 >>> 3) {\n                            case 1:\n                                key = reader.string();\n                                break;\n                            case 2:\n                                value = $root.jspb.test.TestMapFieldsNoBinary.decode(reader, reader.uint32());\n                                break;\n                            default:\n                                reader.skipType(tag2 & 7);\n                                break;\n                            }\n                        }\n                        message.mapStringTestmapfields[key] = value;\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a TestMapFieldsNoBinary message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.TestMapFieldsNoBinary} TestMapFieldsNoBinary\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            TestMapFieldsNoBinary.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a TestMapFieldsNoBinary message.\n             * @function verify\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            TestMapFieldsNoBinary.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.mapStringString != null && message.hasOwnProperty(\"mapStringString\")) {\n                    if (!$util.isObject(message.mapStringString))\n                        return \"mapStringString: object expected\";\n                    var key = Object.keys(message.mapStringString);\n                    for (var i = 0; i < key.length; ++i)\n                        if (!$util.isString(message.mapStringString[key[i]]))\n                            return \"mapStringString: string{k:string} expected\";\n                }\n                if (message.mapStringInt32 != null && message.hasOwnProperty(\"mapStringInt32\")) {\n                    if (!$util.isObject(message.mapStringInt32))\n                        return \"mapStringInt32: object expected\";\n                    var key = Object.keys(message.mapStringInt32);\n                    for (var i = 0; i < key.length; ++i)\n                        if (!$util.isInteger(message.mapStringInt32[key[i]]))\n                            return \"mapStringInt32: integer{k:string} expected\";\n                }\n                if (message.mapStringInt64 != null && message.hasOwnProperty(\"mapStringInt64\")) {\n                    if (!$util.isObject(message.mapStringInt64))\n                        return \"mapStringInt64: object expected\";\n                    var key = Object.keys(message.mapStringInt64);\n                    for (var i = 0; i < key.length; ++i)\n                        if (!$util.isInteger(message.mapStringInt64[key[i]]) && !(message.mapStringInt64[key[i]] && $util.isInteger(message.mapStringInt64[key[i]].low) && $util.isInteger(message.mapStringInt64[key[i]].high)))\n                            return \"mapStringInt64: integer|Long{k:string} expected\";\n                }\n                if (message.mapStringBool != null && message.hasOwnProperty(\"mapStringBool\")) {\n                    if (!$util.isObject(message.mapStringBool))\n                        return \"mapStringBool: object expected\";\n                    var key = Object.keys(message.mapStringBool);\n                    for (var i = 0; i < key.length; ++i)\n                        if (typeof message.mapStringBool[key[i]] !== \"boolean\")\n                            return \"mapStringBool: boolean{k:string} expected\";\n                }\n                if (message.mapStringDouble != null && message.hasOwnProperty(\"mapStringDouble\")) {\n                    if (!$util.isObject(message.mapStringDouble))\n                        return \"mapStringDouble: object expected\";\n                    var key = Object.keys(message.mapStringDouble);\n                    for (var i = 0; i < key.length; ++i)\n                        if (typeof message.mapStringDouble[key[i]] !== \"number\")\n                            return \"mapStringDouble: number{k:string} expected\";\n                }\n                if (message.mapStringEnum != null && message.hasOwnProperty(\"mapStringEnum\")) {\n                    if (!$util.isObject(message.mapStringEnum))\n                        return \"mapStringEnum: object expected\";\n                    var key = Object.keys(message.mapStringEnum);\n                    for (var i = 0; i < key.length; ++i)\n                        switch (message.mapStringEnum[key[i]]) {\n                        default:\n                            return \"mapStringEnum: enum value{k:string} expected\";\n                        case 0:\n                        case 1:\n                        case 2:\n                            break;\n                        }\n                }\n                if (message.mapStringMsg != null && message.hasOwnProperty(\"mapStringMsg\")) {\n                    if (!$util.isObject(message.mapStringMsg))\n                        return \"mapStringMsg: object expected\";\n                    var key = Object.keys(message.mapStringMsg);\n                    for (var i = 0; i < key.length; ++i) {\n                        var error = $root.jspb.test.MapValueMessageNoBinary.verify(message.mapStringMsg[key[i]]);\n                        if (error)\n                            return \"mapStringMsg.\" + error;\n                    }\n                }\n                if (message.mapInt32String != null && message.hasOwnProperty(\"mapInt32String\")) {\n                    if (!$util.isObject(message.mapInt32String))\n                        return \"mapInt32String: object expected\";\n                    var key = Object.keys(message.mapInt32String);\n                    for (var i = 0; i < key.length; ++i) {\n                        if (!$util.key32Re.test(key[i]))\n                            return \"mapInt32String: integer key{k:int32} expected\";\n                        if (!$util.isString(message.mapInt32String[key[i]]))\n                            return \"mapInt32String: string{k:int32} expected\";\n                    }\n                }\n                if (message.mapInt64String != null && message.hasOwnProperty(\"mapInt64String\")) {\n                    if (!$util.isObject(message.mapInt64String))\n                        return \"mapInt64String: object expected\";\n                    var key = Object.keys(message.mapInt64String);\n                    for (var i = 0; i < key.length; ++i) {\n                        if (!$util.key64Re.test(key[i]))\n                            return \"mapInt64String: integer|Long key{k:int64} expected\";\n                        if (!$util.isString(message.mapInt64String[key[i]]))\n                            return \"mapInt64String: string{k:int64} expected\";\n                    }\n                }\n                if (message.mapBoolString != null && message.hasOwnProperty(\"mapBoolString\")) {\n                    if (!$util.isObject(message.mapBoolString))\n                        return \"mapBoolString: object expected\";\n                    var key = Object.keys(message.mapBoolString);\n                    for (var i = 0; i < key.length; ++i) {\n                        if (!$util.key2Re.test(key[i]))\n                            return \"mapBoolString: boolean key{k:bool} expected\";\n                        if (!$util.isString(message.mapBoolString[key[i]]))\n                            return \"mapBoolString: string{k:bool} expected\";\n                    }\n                }\n                if (message.testMapFields != null && message.hasOwnProperty(\"testMapFields\")) {\n                    var error = $root.jspb.test.TestMapFieldsNoBinary.verify(message.testMapFields);\n                    if (error)\n                        return \"testMapFields.\" + error;\n                }\n                if (message.mapStringTestmapfields != null && message.hasOwnProperty(\"mapStringTestmapfields\")) {\n                    if (!$util.isObject(message.mapStringTestmapfields))\n                        return \"mapStringTestmapfields: object expected\";\n                    var key = Object.keys(message.mapStringTestmapfields);\n                    for (var i = 0; i < key.length; ++i) {\n                        var error = $root.jspb.test.TestMapFieldsNoBinary.verify(message.mapStringTestmapfields[key[i]]);\n                        if (error)\n                            return \"mapStringTestmapfields.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a TestMapFieldsNoBinary message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.TestMapFieldsNoBinary} TestMapFieldsNoBinary\n             */\n            TestMapFieldsNoBinary.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.TestMapFieldsNoBinary)\n                    return object;\n                var message = new $root.jspb.test.TestMapFieldsNoBinary();\n                if (object.mapStringString) {\n                    if (typeof object.mapStringString !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringString: object expected\");\n                    message.mapStringString = {};\n                    for (var keys = Object.keys(object.mapStringString), i = 0; i < keys.length; ++i)\n                        message.mapStringString[keys[i]] = String(object.mapStringString[keys[i]]);\n                }\n                if (object.mapStringInt32) {\n                    if (typeof object.mapStringInt32 !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringInt32: object expected\");\n                    message.mapStringInt32 = {};\n                    for (var keys = Object.keys(object.mapStringInt32), i = 0; i < keys.length; ++i)\n                        message.mapStringInt32[keys[i]] = object.mapStringInt32[keys[i]] | 0;\n                }\n                if (object.mapStringInt64) {\n                    if (typeof object.mapStringInt64 !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringInt64: object expected\");\n                    message.mapStringInt64 = {};\n                    for (var keys = Object.keys(object.mapStringInt64), i = 0; i < keys.length; ++i)\n                        if ($util.Long)\n                            (message.mapStringInt64[keys[i]] = $util.Long.fromValue(object.mapStringInt64[keys[i]])).unsigned = false;\n                        else if (typeof object.mapStringInt64[keys[i]] === \"string\")\n                            message.mapStringInt64[keys[i]] = parseInt(object.mapStringInt64[keys[i]], 10);\n                        else if (typeof object.mapStringInt64[keys[i]] === \"number\")\n                            message.mapStringInt64[keys[i]] = object.mapStringInt64[keys[i]];\n                        else if (typeof object.mapStringInt64[keys[i]] === \"object\")\n                            message.mapStringInt64[keys[i]] = new $util.LongBits(object.mapStringInt64[keys[i]].low >>> 0, object.mapStringInt64[keys[i]].high >>> 0).toNumber();\n                }\n                if (object.mapStringBool) {\n                    if (typeof object.mapStringBool !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringBool: object expected\");\n                    message.mapStringBool = {};\n                    for (var keys = Object.keys(object.mapStringBool), i = 0; i < keys.length; ++i)\n                        message.mapStringBool[keys[i]] = Boolean(object.mapStringBool[keys[i]]);\n                }\n                if (object.mapStringDouble) {\n                    if (typeof object.mapStringDouble !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringDouble: object expected\");\n                    message.mapStringDouble = {};\n                    for (var keys = Object.keys(object.mapStringDouble), i = 0; i < keys.length; ++i)\n                        message.mapStringDouble[keys[i]] = Number(object.mapStringDouble[keys[i]]);\n                }\n                if (object.mapStringEnum) {\n                    if (typeof object.mapStringEnum !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringEnum: object expected\");\n                    message.mapStringEnum = {};\n                    for (var keys = Object.keys(object.mapStringEnum), i = 0; i < keys.length; ++i)\n                        switch (object.mapStringEnum[keys[i]]) {\n                        case \"MAP_VALUE_FOO_NOBINARY\":\n                        case 0:\n                            message.mapStringEnum[keys[i]] = 0;\n                            break;\n                        case \"MAP_VALUE_BAR_NOBINARY\":\n                        case 1:\n                            message.mapStringEnum[keys[i]] = 1;\n                            break;\n                        case \"MAP_VALUE_BAZ_NOBINARY\":\n                        case 2:\n                            message.mapStringEnum[keys[i]] = 2;\n                            break;\n                        }\n                }\n                if (object.mapStringMsg) {\n                    if (typeof object.mapStringMsg !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringMsg: object expected\");\n                    message.mapStringMsg = {};\n                    for (var keys = Object.keys(object.mapStringMsg), i = 0; i < keys.length; ++i) {\n                        if (typeof object.mapStringMsg[keys[i]] !== \"object\")\n                            throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringMsg: object expected\");\n                        message.mapStringMsg[keys[i]] = $root.jspb.test.MapValueMessageNoBinary.fromObject(object.mapStringMsg[keys[i]]);\n                    }\n                }\n                if (object.mapInt32String) {\n                    if (typeof object.mapInt32String !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapInt32String: object expected\");\n                    message.mapInt32String = {};\n                    for (var keys = Object.keys(object.mapInt32String), i = 0; i < keys.length; ++i)\n                        message.mapInt32String[keys[i]] = String(object.mapInt32String[keys[i]]);\n                }\n                if (object.mapInt64String) {\n                    if (typeof object.mapInt64String !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapInt64String: object expected\");\n                    message.mapInt64String = {};\n                    for (var keys = Object.keys(object.mapInt64String), i = 0; i < keys.length; ++i)\n                        message.mapInt64String[keys[i]] = String(object.mapInt64String[keys[i]]);\n                }\n                if (object.mapBoolString) {\n                    if (typeof object.mapBoolString !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapBoolString: object expected\");\n                    message.mapBoolString = {};\n                    for (var keys = Object.keys(object.mapBoolString), i = 0; i < keys.length; ++i)\n                        message.mapBoolString[keys[i]] = String(object.mapBoolString[keys[i]]);\n                }\n                if (object.testMapFields != null) {\n                    if (typeof object.testMapFields !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.testMapFields: object expected\");\n                    message.testMapFields = $root.jspb.test.TestMapFieldsNoBinary.fromObject(object.testMapFields);\n                }\n                if (object.mapStringTestmapfields) {\n                    if (typeof object.mapStringTestmapfields !== \"object\")\n                        throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringTestmapfields: object expected\");\n                    message.mapStringTestmapfields = {};\n                    for (var keys = Object.keys(object.mapStringTestmapfields), i = 0; i < keys.length; ++i) {\n                        if (typeof object.mapStringTestmapfields[keys[i]] !== \"object\")\n                            throw TypeError(\".jspb.test.TestMapFieldsNoBinary.mapStringTestmapfields: object expected\");\n                        message.mapStringTestmapfields[keys[i]] = $root.jspb.test.TestMapFieldsNoBinary.fromObject(object.mapStringTestmapfields[keys[i]]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a TestMapFieldsNoBinary message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {jspb.test.TestMapFieldsNoBinary} message TestMapFieldsNoBinary\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            TestMapFieldsNoBinary.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.objects || options.defaults) {\n                    object.mapStringString = {};\n                    object.mapStringInt32 = {};\n                    object.mapStringInt64 = {};\n                    object.mapStringBool = {};\n                    object.mapStringDouble = {};\n                    object.mapStringEnum = {};\n                    object.mapStringMsg = {};\n                    object.mapInt32String = {};\n                    object.mapInt64String = {};\n                    object.mapBoolString = {};\n                    object.mapStringTestmapfields = {};\n                }\n                if (options.defaults)\n                    object.testMapFields = null;\n                var keys2;\n                if (message.mapStringString && (keys2 = Object.keys(message.mapStringString)).length) {\n                    object.mapStringString = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringString[keys2[j]] = message.mapStringString[keys2[j]];\n                }\n                if (message.mapStringInt32 && (keys2 = Object.keys(message.mapStringInt32)).length) {\n                    object.mapStringInt32 = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringInt32[keys2[j]] = message.mapStringInt32[keys2[j]];\n                }\n                if (message.mapStringInt64 && (keys2 = Object.keys(message.mapStringInt64)).length) {\n                    object.mapStringInt64 = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        if (typeof message.mapStringInt64[keys2[j]] === \"number\")\n                            object.mapStringInt64[keys2[j]] = options.longs === String ? String(message.mapStringInt64[keys2[j]]) : message.mapStringInt64[keys2[j]];\n                        else\n                            object.mapStringInt64[keys2[j]] = options.longs === String ? $util.Long.prototype.toString.call(message.mapStringInt64[keys2[j]]) : options.longs === Number ? new $util.LongBits(message.mapStringInt64[keys2[j]].low >>> 0, message.mapStringInt64[keys2[j]].high >>> 0).toNumber() : message.mapStringInt64[keys2[j]];\n                }\n                if (message.mapStringBool && (keys2 = Object.keys(message.mapStringBool)).length) {\n                    object.mapStringBool = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringBool[keys2[j]] = message.mapStringBool[keys2[j]];\n                }\n                if (message.mapStringDouble && (keys2 = Object.keys(message.mapStringDouble)).length) {\n                    object.mapStringDouble = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringDouble[keys2[j]] = options.json && !isFinite(message.mapStringDouble[keys2[j]]) ? String(message.mapStringDouble[keys2[j]]) : message.mapStringDouble[keys2[j]];\n                }\n                if (message.mapStringEnum && (keys2 = Object.keys(message.mapStringEnum)).length) {\n                    object.mapStringEnum = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringEnum[keys2[j]] = options.enums === String ? $root.jspb.test.MapValueEnumNoBinary[message.mapStringEnum[keys2[j]]] : message.mapStringEnum[keys2[j]];\n                }\n                if (message.mapStringMsg && (keys2 = Object.keys(message.mapStringMsg)).length) {\n                    object.mapStringMsg = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringMsg[keys2[j]] = $root.jspb.test.MapValueMessageNoBinary.toObject(message.mapStringMsg[keys2[j]], options);\n                }\n                if (message.mapInt32String && (keys2 = Object.keys(message.mapInt32String)).length) {\n                    object.mapInt32String = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapInt32String[keys2[j]] = message.mapInt32String[keys2[j]];\n                }\n                if (message.mapInt64String && (keys2 = Object.keys(message.mapInt64String)).length) {\n                    object.mapInt64String = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapInt64String[keys2[j]] = message.mapInt64String[keys2[j]];\n                }\n                if (message.mapBoolString && (keys2 = Object.keys(message.mapBoolString)).length) {\n                    object.mapBoolString = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapBoolString[keys2[j]] = message.mapBoolString[keys2[j]];\n                }\n                if (message.testMapFields != null && message.hasOwnProperty(\"testMapFields\"))\n                    object.testMapFields = $root.jspb.test.TestMapFieldsNoBinary.toObject(message.testMapFields, options);\n                if (message.mapStringTestmapfields && (keys2 = Object.keys(message.mapStringTestmapfields)).length) {\n                    object.mapStringTestmapfields = {};\n                    for (var j = 0; j < keys2.length; ++j)\n                        object.mapStringTestmapfields[keys2[j]] = $root.jspb.test.TestMapFieldsNoBinary.toObject(message.mapStringTestmapfields[keys2[j]], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this TestMapFieldsNoBinary to JSON.\n             * @function toJSON\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            TestMapFieldsNoBinary.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for TestMapFieldsNoBinary\n             * @function getTypeUrl\n             * @memberof jspb.test.TestMapFieldsNoBinary\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            TestMapFieldsNoBinary.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.TestMapFieldsNoBinary\";\n            };\n\n            return TestMapFieldsNoBinary;\n        })();\n\n        /**\n         * MapValueEnumNoBinary enum.\n         * @name jspb.test.MapValueEnumNoBinary\n         * @enum {number}\n         * @property {number} MAP_VALUE_FOO_NOBINARY=0 MAP_VALUE_FOO_NOBINARY value\n         * @property {number} MAP_VALUE_BAR_NOBINARY=1 MAP_VALUE_BAR_NOBINARY value\n         * @property {number} MAP_VALUE_BAZ_NOBINARY=2 MAP_VALUE_BAZ_NOBINARY value\n         */\n        test.MapValueEnumNoBinary = (function() {\n            var valuesById = {}, values = Object.create(valuesById);\n            values[valuesById[0] = \"MAP_VALUE_FOO_NOBINARY\"] = 0;\n            values[valuesById[1] = \"MAP_VALUE_BAR_NOBINARY\"] = 1;\n            values[valuesById[2] = \"MAP_VALUE_BAZ_NOBINARY\"] = 2;\n            return values;\n        })();\n\n        test.MapValueMessageNoBinary = (function() {\n\n            /**\n             * Properties of a MapValueMessageNoBinary.\n             * @memberof jspb.test\n             * @interface IMapValueMessageNoBinary\n             * @property {number|null} [foo] MapValueMessageNoBinary foo\n             */\n\n            /**\n             * Constructs a new MapValueMessageNoBinary.\n             * @memberof jspb.test\n             * @classdesc Represents a MapValueMessageNoBinary.\n             * @implements IMapValueMessageNoBinary\n             * @constructor\n             * @param {jspb.test.IMapValueMessageNoBinary=} [properties] Properties to set\n             */\n            function MapValueMessageNoBinary(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MapValueMessageNoBinary foo.\n             * @member {number} foo\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @instance\n             */\n            MapValueMessageNoBinary.prototype.foo = 0;\n\n            /**\n             * Creates a new MapValueMessageNoBinary instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {jspb.test.IMapValueMessageNoBinary=} [properties] Properties to set\n             * @returns {jspb.test.MapValueMessageNoBinary} MapValueMessageNoBinary instance\n             */\n            MapValueMessageNoBinary.create = function create(properties) {\n                return new MapValueMessageNoBinary(properties);\n            };\n\n            /**\n             * Encodes the specified MapValueMessageNoBinary message. Does not implicitly {@link jspb.test.MapValueMessageNoBinary.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {jspb.test.IMapValueMessageNoBinary} message MapValueMessageNoBinary message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MapValueMessageNoBinary.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.foo != null && Object.hasOwnProperty.call(message, \"foo\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.foo);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MapValueMessageNoBinary message, length delimited. Does not implicitly {@link jspb.test.MapValueMessageNoBinary.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {jspb.test.IMapValueMessageNoBinary} message MapValueMessageNoBinary message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MapValueMessageNoBinary.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MapValueMessageNoBinary message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.MapValueMessageNoBinary} MapValueMessageNoBinary\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MapValueMessageNoBinary.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.MapValueMessageNoBinary();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.foo = reader.int32();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MapValueMessageNoBinary message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.MapValueMessageNoBinary} MapValueMessageNoBinary\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MapValueMessageNoBinary.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MapValueMessageNoBinary message.\n             * @function verify\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MapValueMessageNoBinary.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.foo != null && message.hasOwnProperty(\"foo\"))\n                    if (!$util.isInteger(message.foo))\n                        return \"foo: integer expected\";\n                return null;\n            };\n\n            /**\n             * Creates a MapValueMessageNoBinary message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.MapValueMessageNoBinary} MapValueMessageNoBinary\n             */\n            MapValueMessageNoBinary.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.MapValueMessageNoBinary)\n                    return object;\n                var message = new $root.jspb.test.MapValueMessageNoBinary();\n                if (object.foo != null)\n                    message.foo = object.foo | 0;\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MapValueMessageNoBinary message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {jspb.test.MapValueMessageNoBinary} message MapValueMessageNoBinary\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MapValueMessageNoBinary.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults)\n                    object.foo = 0;\n                if (message.foo != null && message.hasOwnProperty(\"foo\"))\n                    object.foo = message.foo;\n                return object;\n            };\n\n            /**\n             * Converts this MapValueMessageNoBinary to JSON.\n             * @function toJSON\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MapValueMessageNoBinary.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for MapValueMessageNoBinary\n             * @function getTypeUrl\n             * @memberof jspb.test.MapValueMessageNoBinary\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            MapValueMessageNoBinary.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.MapValueMessageNoBinary\";\n            };\n\n            return MapValueMessageNoBinary;\n        })();\n\n        test.Deeply = (function() {\n\n            /**\n             * Properties of a Deeply.\n             * @memberof jspb.test\n             * @interface IDeeply\n             */\n\n            /**\n             * Constructs a new Deeply.\n             * @memberof jspb.test\n             * @classdesc Represents a Deeply.\n             * @implements IDeeply\n             * @constructor\n             * @param {jspb.test.IDeeply=} [properties] Properties to set\n             */\n            function Deeply(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * Creates a new Deeply instance using the specified properties.\n             * @function create\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {jspb.test.IDeeply=} [properties] Properties to set\n             * @returns {jspb.test.Deeply} Deeply instance\n             */\n            Deeply.create = function create(properties) {\n                return new Deeply(properties);\n            };\n\n            /**\n             * Encodes the specified Deeply message. Does not implicitly {@link jspb.test.Deeply.verify|verify} messages.\n             * @function encode\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {jspb.test.IDeeply} message Deeply message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Deeply.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified Deeply message, length delimited. Does not implicitly {@link jspb.test.Deeply.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {jspb.test.IDeeply} message Deeply message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            Deeply.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a Deeply message from the specified reader or buffer.\n             * @function decode\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {jspb.test.Deeply} Deeply\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Deeply.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Deeply();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a Deeply message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {jspb.test.Deeply} Deeply\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            Deeply.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a Deeply message.\n             * @function verify\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            Deeply.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                return null;\n            };\n\n            /**\n             * Creates a Deeply message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {jspb.test.Deeply} Deeply\n             */\n            Deeply.fromObject = function fromObject(object) {\n                if (object instanceof $root.jspb.test.Deeply)\n                    return object;\n                return new $root.jspb.test.Deeply();\n            };\n\n            /**\n             * Creates a plain object from a Deeply message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {jspb.test.Deeply} message Deeply\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            Deeply.toObject = function toObject() {\n                return {};\n            };\n\n            /**\n             * Converts this Deeply to JSON.\n             * @function toJSON\n             * @memberof jspb.test.Deeply\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            Deeply.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for Deeply\n             * @function getTypeUrl\n             * @memberof jspb.test.Deeply\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            Deeply.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/jspb.test.Deeply\";\n            };\n\n            Deeply.Nested = (function() {\n\n                /**\n                 * Properties of a Nested.\n                 * @memberof jspb.test.Deeply\n                 * @interface INested\n                 */\n\n                /**\n                 * Constructs a new Nested.\n                 * @memberof jspb.test.Deeply\n                 * @classdesc Represents a Nested.\n                 * @implements INested\n                 * @constructor\n                 * @param {jspb.test.Deeply.INested=} [properties] Properties to set\n                 */\n                function Nested(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Creates a new Nested instance using the specified properties.\n                 * @function create\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {jspb.test.Deeply.INested=} [properties] Properties to set\n                 * @returns {jspb.test.Deeply.Nested} Nested instance\n                 */\n                Nested.create = function create(properties) {\n                    return new Nested(properties);\n                };\n\n                /**\n                 * Encodes the specified Nested message. Does not implicitly {@link jspb.test.Deeply.Nested.verify|verify} messages.\n                 * @function encode\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {jspb.test.Deeply.INested} message Nested message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Nested.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Nested message, length delimited. Does not implicitly {@link jspb.test.Deeply.Nested.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {jspb.test.Deeply.INested} message Nested message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Nested.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a Nested message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {jspb.test.Deeply.Nested} Nested\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Nested.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Deeply.Nested();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a Nested message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {jspb.test.Deeply.Nested} Nested\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Nested.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a Nested message.\n                 * @function verify\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Nested.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a Nested message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {jspb.test.Deeply.Nested} Nested\n                 */\n                Nested.fromObject = function fromObject(object) {\n                    if (object instanceof $root.jspb.test.Deeply.Nested)\n                        return object;\n                    return new $root.jspb.test.Deeply.Nested();\n                };\n\n                /**\n                 * Creates a plain object from a Nested message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {jspb.test.Deeply.Nested} message Nested\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Nested.toObject = function toObject() {\n                    return {};\n                };\n\n                /**\n                 * Converts this Nested to JSON.\n                 * @function toJSON\n                 * @memberof jspb.test.Deeply.Nested\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Nested.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for Nested\n                 * @function getTypeUrl\n                 * @memberof jspb.test.Deeply.Nested\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                Nested.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/jspb.test.Deeply.Nested\";\n                };\n\n                Nested.Message = (function() {\n\n                    /**\n                     * Properties of a Message.\n                     * @memberof jspb.test.Deeply.Nested\n                     * @interface IMessage\n                     * @property {number|null} [count] Message count\n                     */\n\n                    /**\n                     * Constructs a new Message.\n                     * @memberof jspb.test.Deeply.Nested\n                     * @classdesc Represents a Message.\n                     * @implements IMessage\n                     * @constructor\n                     * @param {jspb.test.Deeply.Nested.IMessage=} [properties] Properties to set\n                     */\n                    function Message(properties) {\n                        if (properties)\n                            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                                if (properties[keys[i]] != null)\n                                    this[keys[i]] = properties[keys[i]];\n                    }\n\n                    /**\n                     * Message count.\n                     * @member {number} count\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @instance\n                     */\n                    Message.prototype.count = 0;\n\n                    /**\n                     * Creates a new Message instance using the specified properties.\n                     * @function create\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {jspb.test.Deeply.Nested.IMessage=} [properties] Properties to set\n                     * @returns {jspb.test.Deeply.Nested.Message} Message instance\n                     */\n                    Message.create = function create(properties) {\n                        return new Message(properties);\n                    };\n\n                    /**\n                     * Encodes the specified Message message. Does not implicitly {@link jspb.test.Deeply.Nested.Message.verify|verify} messages.\n                     * @function encode\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {jspb.test.Deeply.Nested.IMessage} message Message message or plain object to encode\n                     * @param {$protobuf.Writer} [writer] Writer to encode to\n                     * @returns {$protobuf.Writer} Writer\n                     */\n                    Message.encode = function encode(message, writer) {\n                        if (!writer)\n                            writer = $Writer.create();\n                        if (message.count != null && Object.hasOwnProperty.call(message, \"count\"))\n                            writer.uint32(/* id 1, wireType 0 =*/8).int32(message.count);\n                        return writer;\n                    };\n\n                    /**\n                     * Encodes the specified Message message, length delimited. Does not implicitly {@link jspb.test.Deeply.Nested.Message.verify|verify} messages.\n                     * @function encodeDelimited\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {jspb.test.Deeply.Nested.IMessage} message Message message or plain object to encode\n                     * @param {$protobuf.Writer} [writer] Writer to encode to\n                     * @returns {$protobuf.Writer} Writer\n                     */\n                    Message.encodeDelimited = function encodeDelimited(message, writer) {\n                        return this.encode(message, writer).ldelim();\n                    };\n\n                    /**\n                     * Decodes a Message message from the specified reader or buffer.\n                     * @function decode\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                     * @param {number} [length] Message length if known beforehand\n                     * @returns {jspb.test.Deeply.Nested.Message} Message\n                     * @throws {Error} If the payload is not a reader or valid buffer\n                     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                     */\n                    Message.decode = function decode(reader, length) {\n                        if (!(reader instanceof $Reader))\n                            reader = $Reader.create(reader);\n                        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.jspb.test.Deeply.Nested.Message();\n                        while (reader.pos < end) {\n                            var tag = reader.uint32();\n                            switch (tag >>> 3) {\n                            case 1:\n                                message.count = reader.int32();\n                                break;\n                            default:\n                                reader.skipType(tag & 7);\n                                break;\n                            }\n                        }\n                        return message;\n                    };\n\n                    /**\n                     * Decodes a Message message from the specified reader or buffer, length delimited.\n                     * @function decodeDelimited\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                     * @returns {jspb.test.Deeply.Nested.Message} Message\n                     * @throws {Error} If the payload is not a reader or valid buffer\n                     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                     */\n                    Message.decodeDelimited = function decodeDelimited(reader) {\n                        if (!(reader instanceof $Reader))\n                            reader = new $Reader(reader);\n                        return this.decode(reader, reader.uint32());\n                    };\n\n                    /**\n                     * Verifies a Message message.\n                     * @function verify\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {Object.<string,*>} message Plain object to verify\n                     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                     */\n                    Message.verify = function verify(message) {\n                        if (typeof message !== \"object\" || message === null)\n                            return \"object expected\";\n                        if (message.count != null && message.hasOwnProperty(\"count\"))\n                            if (!$util.isInteger(message.count))\n                                return \"count: integer expected\";\n                        return null;\n                    };\n\n                    /**\n                     * Creates a Message message from a plain object. Also converts values to their respective internal types.\n                     * @function fromObject\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {Object.<string,*>} object Plain object\n                     * @returns {jspb.test.Deeply.Nested.Message} Message\n                     */\n                    Message.fromObject = function fromObject(object) {\n                        if (object instanceof $root.jspb.test.Deeply.Nested.Message)\n                            return object;\n                        var message = new $root.jspb.test.Deeply.Nested.Message();\n                        if (object.count != null)\n                            message.count = object.count | 0;\n                        return message;\n                    };\n\n                    /**\n                     * Creates a plain object from a Message message. Also converts values to other types if specified.\n                     * @function toObject\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {jspb.test.Deeply.Nested.Message} message Message\n                     * @param {$protobuf.IConversionOptions} [options] Conversion options\n                     * @returns {Object.<string,*>} Plain object\n                     */\n                    Message.toObject = function toObject(message, options) {\n                        if (!options)\n                            options = {};\n                        var object = {};\n                        if (options.defaults)\n                            object.count = 0;\n                        if (message.count != null && message.hasOwnProperty(\"count\"))\n                            object.count = message.count;\n                        return object;\n                    };\n\n                    /**\n                     * Converts this Message to JSON.\n                     * @function toJSON\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @instance\n                     * @returns {Object.<string,*>} JSON object\n                     */\n                    Message.prototype.toJSON = function toJSON() {\n                        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                    };\n\n                    /**\n                     * Gets the default type url for Message\n                     * @function getTypeUrl\n                     * @memberof jspb.test.Deeply.Nested.Message\n                     * @static\n                     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                     * @returns {string} The default type url\n                     */\n                    Message.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                        if (typeUrlPrefix === undefined) {\n                            typeUrlPrefix = \"type.googleapis.com\";\n                        }\n                        return typeUrlPrefix + \"/jspb.test.Deeply.Nested.Message\";\n                    };\n\n                    return Message;\n                })();\n\n                return Nested;\n            })();\n\n            return Deeply;\n        })();\n\n        return test;\n    })();\n\n    return jspb;\n})();\n\n$root.google = (function() {\n\n    /**\n     * Namespace google.\n     * @exports google\n     * @namespace\n     */\n    var google = {};\n\n    google.protobuf = (function() {\n\n        /**\n         * Namespace protobuf.\n         * @memberof google\n         * @namespace\n         */\n        var protobuf = {};\n\n        protobuf.FileDescriptorSet = (function() {\n\n            /**\n             * Properties of a FileDescriptorSet.\n             * @memberof google.protobuf\n             * @interface IFileDescriptorSet\n             * @property {Array.<google.protobuf.IFileDescriptorProto>|null} [file] FileDescriptorSet file\n             */\n\n            /**\n             * Constructs a new FileDescriptorSet.\n             * @memberof google.protobuf\n             * @classdesc Represents a FileDescriptorSet.\n             * @implements IFileDescriptorSet\n             * @constructor\n             * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set\n             */\n            function FileDescriptorSet(properties) {\n                this.file = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FileDescriptorSet file.\n             * @member {Array.<google.protobuf.IFileDescriptorProto>} file\n             * @memberof google.protobuf.FileDescriptorSet\n             * @instance\n             */\n            FileDescriptorSet.prototype.file = $util.emptyArray;\n\n            /**\n             * Creates a new FileDescriptorSet instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance\n             */\n            FileDescriptorSet.create = function create(properties) {\n                return new FileDescriptorSet(properties);\n            };\n\n            /**\n             * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorSet.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.file != null && message.file.length)\n                    for (var i = 0; i < message.file.length; ++i)\n                        $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FileDescriptorSet message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorSet.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorSet();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.file && message.file.length))\n                            message.file = [];\n                        message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FileDescriptorSet message.\n             * @function verify\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FileDescriptorSet.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.file != null && message.hasOwnProperty(\"file\")) {\n                    if (!Array.isArray(message.file))\n                        return \"file: array expected\";\n                    for (var i = 0; i < message.file.length; ++i) {\n                        var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]);\n                        if (error)\n                            return \"file.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet\n             */\n            FileDescriptorSet.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FileDescriptorSet)\n                    return object;\n                var message = new $root.google.protobuf.FileDescriptorSet();\n                if (object.file) {\n                    if (!Array.isArray(object.file))\n                        throw TypeError(\".google.protobuf.FileDescriptorSet.file: array expected\");\n                    message.file = [];\n                    for (var i = 0; i < object.file.length; ++i) {\n                        if (typeof object.file[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorSet.file: object expected\");\n                        message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FileDescriptorSet.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.file = [];\n                if (message.file && message.file.length) {\n                    object.file = [];\n                    for (var j = 0; j < message.file.length; ++j)\n                        object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this FileDescriptorSet to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FileDescriptorSet\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FileDescriptorSet.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for FileDescriptorSet\n             * @function getTypeUrl\n             * @memberof google.protobuf.FileDescriptorSet\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            FileDescriptorSet.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.FileDescriptorSet\";\n            };\n\n            return FileDescriptorSet;\n        })();\n\n        protobuf.FileDescriptorProto = (function() {\n\n            /**\n             * Properties of a FileDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IFileDescriptorProto\n             * @property {string|null} [name] FileDescriptorProto name\n             * @property {string|null} [\"package\"] FileDescriptorProto package\n             * @property {Array.<string>|null} [dependency] FileDescriptorProto dependency\n             * @property {Array.<number>|null} [publicDependency] FileDescriptorProto publicDependency\n             * @property {Array.<number>|null} [weakDependency] FileDescriptorProto weakDependency\n             * @property {Array.<google.protobuf.IDescriptorProto>|null} [messageType] FileDescriptorProto messageType\n             * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] FileDescriptorProto enumType\n             * @property {Array.<google.protobuf.IServiceDescriptorProto>|null} [service] FileDescriptorProto service\n             * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] FileDescriptorProto extension\n             * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options\n             * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo\n             * @property {string|null} [syntax] FileDescriptorProto syntax\n             */\n\n            /**\n             * Constructs a new FileDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a FileDescriptorProto.\n             * @implements IFileDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set\n             */\n            function FileDescriptorProto(properties) {\n                this.dependency = [];\n                this.publicDependency = [];\n                this.weakDependency = [];\n                this.messageType = [];\n                this.enumType = [];\n                this.service = [];\n                this.extension = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FileDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.name = \"\";\n\n            /**\n             * FileDescriptorProto package.\n             * @member {string} package\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype[\"package\"] = \"\";\n\n            /**\n             * FileDescriptorProto dependency.\n             * @member {Array.<string>} dependency\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.dependency = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto publicDependency.\n             * @member {Array.<number>} publicDependency\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.publicDependency = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto weakDependency.\n             * @member {Array.<number>} weakDependency\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.weakDependency = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto messageType.\n             * @member {Array.<google.protobuf.IDescriptorProto>} messageType\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.messageType = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto enumType.\n             * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.enumType = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto service.\n             * @member {Array.<google.protobuf.IServiceDescriptorProto>} service\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.service = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto extension.\n             * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.extension = $util.emptyArray;\n\n            /**\n             * FileDescriptorProto options.\n             * @member {google.protobuf.IFileOptions|null|undefined} options\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.options = null;\n\n            /**\n             * FileDescriptorProto sourceCodeInfo.\n             * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.sourceCodeInfo = null;\n\n            /**\n             * FileDescriptorProto syntax.\n             * @member {string} syntax\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             */\n            FileDescriptorProto.prototype.syntax = \"\";\n\n            /**\n             * Creates a new FileDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance\n             */\n            FileDescriptorProto.create = function create(properties) {\n                return new FileDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message[\"package\"] != null && Object.hasOwnProperty.call(message, \"package\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message[\"package\"]);\n                if (message.dependency != null && message.dependency.length)\n                    for (var i = 0; i < message.dependency.length; ++i)\n                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]);\n                if (message.messageType != null && message.messageType.length)\n                    for (var i = 0; i < message.messageType.length; ++i)\n                        $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.enumType != null && message.enumType.length)\n                    for (var i = 0; i < message.enumType.length; ++i)\n                        $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.service != null && message.service.length)\n                    for (var i = 0; i < message.service.length; ++i)\n                        $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                if (message.extension != null && message.extension.length)\n                    for (var i = 0; i < message.extension.length; ++i)\n                        $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n                if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, \"sourceCodeInfo\"))\n                    $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n                if (message.publicDependency != null && message.publicDependency.length)\n                    for (var i = 0; i < message.publicDependency.length; ++i)\n                        writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]);\n                if (message.weakDependency != null && message.weakDependency.length)\n                    for (var i = 0; i < message.weakDependency.length; ++i)\n                        writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]);\n                if (message.syntax != null && Object.hasOwnProperty.call(message, \"syntax\"))\n                    writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FileDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message[\"package\"] = reader.string();\n                        break;\n                    case 3:\n                        if (!(message.dependency && message.dependency.length))\n                            message.dependency = [];\n                        message.dependency.push(reader.string());\n                        break;\n                    case 10:\n                        if (!(message.publicDependency && message.publicDependency.length))\n                            message.publicDependency = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.publicDependency.push(reader.int32());\n                        } else\n                            message.publicDependency.push(reader.int32());\n                        break;\n                    case 11:\n                        if (!(message.weakDependency && message.weakDependency.length))\n                            message.weakDependency = [];\n                        if ((tag & 7) === 2) {\n                            var end2 = reader.uint32() + reader.pos;\n                            while (reader.pos < end2)\n                                message.weakDependency.push(reader.int32());\n                        } else\n                            message.weakDependency.push(reader.int32());\n                        break;\n                    case 4:\n                        if (!(message.messageType && message.messageType.length))\n                            message.messageType = [];\n                        message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 5:\n                        if (!(message.enumType && message.enumType.length))\n                            message.enumType = [];\n                        message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 6:\n                        if (!(message.service && message.service.length))\n                            message.service = [];\n                        message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 7:\n                        if (!(message.extension && message.extension.length))\n                            message.extension = [];\n                        message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 8:\n                        message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32());\n                        break;\n                    case 9:\n                        message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32());\n                        break;\n                    case 12:\n                        message.syntax = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FileDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FileDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n                    if (!$util.isString(message[\"package\"]))\n                        return \"package: string expected\";\n                if (message.dependency != null && message.hasOwnProperty(\"dependency\")) {\n                    if (!Array.isArray(message.dependency))\n                        return \"dependency: array expected\";\n                    for (var i = 0; i < message.dependency.length; ++i)\n                        if (!$util.isString(message.dependency[i]))\n                            return \"dependency: string[] expected\";\n                }\n                if (message.publicDependency != null && message.hasOwnProperty(\"publicDependency\")) {\n                    if (!Array.isArray(message.publicDependency))\n                        return \"publicDependency: array expected\";\n                    for (var i = 0; i < message.publicDependency.length; ++i)\n                        if (!$util.isInteger(message.publicDependency[i]))\n                            return \"publicDependency: integer[] expected\";\n                }\n                if (message.weakDependency != null && message.hasOwnProperty(\"weakDependency\")) {\n                    if (!Array.isArray(message.weakDependency))\n                        return \"weakDependency: array expected\";\n                    for (var i = 0; i < message.weakDependency.length; ++i)\n                        if (!$util.isInteger(message.weakDependency[i]))\n                            return \"weakDependency: integer[] expected\";\n                }\n                if (message.messageType != null && message.hasOwnProperty(\"messageType\")) {\n                    if (!Array.isArray(message.messageType))\n                        return \"messageType: array expected\";\n                    for (var i = 0; i < message.messageType.length; ++i) {\n                        var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]);\n                        if (error)\n                            return \"messageType.\" + error;\n                    }\n                }\n                if (message.enumType != null && message.hasOwnProperty(\"enumType\")) {\n                    if (!Array.isArray(message.enumType))\n                        return \"enumType: array expected\";\n                    for (var i = 0; i < message.enumType.length; ++i) {\n                        var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);\n                        if (error)\n                            return \"enumType.\" + error;\n                    }\n                }\n                if (message.service != null && message.hasOwnProperty(\"service\")) {\n                    if (!Array.isArray(message.service))\n                        return \"service: array expected\";\n                    for (var i = 0; i < message.service.length; ++i) {\n                        var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]);\n                        if (error)\n                            return \"service.\" + error;\n                    }\n                }\n                if (message.extension != null && message.hasOwnProperty(\"extension\")) {\n                    if (!Array.isArray(message.extension))\n                        return \"extension: array expected\";\n                    for (var i = 0; i < message.extension.length; ++i) {\n                        var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);\n                        if (error)\n                            return \"extension.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.FileOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\")) {\n                    var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo);\n                    if (error)\n                        return \"sourceCodeInfo.\" + error;\n                }\n                if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n                    if (!$util.isString(message.syntax))\n                        return \"syntax: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto\n             */\n            FileDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FileDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.FileDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object[\"package\"] != null)\n                    message[\"package\"] = String(object[\"package\"]);\n                if (object.dependency) {\n                    if (!Array.isArray(object.dependency))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.dependency: array expected\");\n                    message.dependency = [];\n                    for (var i = 0; i < object.dependency.length; ++i)\n                        message.dependency[i] = String(object.dependency[i]);\n                }\n                if (object.publicDependency) {\n                    if (!Array.isArray(object.publicDependency))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.publicDependency: array expected\");\n                    message.publicDependency = [];\n                    for (var i = 0; i < object.publicDependency.length; ++i)\n                        message.publicDependency[i] = object.publicDependency[i] | 0;\n                }\n                if (object.weakDependency) {\n                    if (!Array.isArray(object.weakDependency))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.weakDependency: array expected\");\n                    message.weakDependency = [];\n                    for (var i = 0; i < object.weakDependency.length; ++i)\n                        message.weakDependency[i] = object.weakDependency[i] | 0;\n                }\n                if (object.messageType) {\n                    if (!Array.isArray(object.messageType))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.messageType: array expected\");\n                    message.messageType = [];\n                    for (var i = 0; i < object.messageType.length; ++i) {\n                        if (typeof object.messageType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.messageType: object expected\");\n                        message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]);\n                    }\n                }\n                if (object.enumType) {\n                    if (!Array.isArray(object.enumType))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.enumType: array expected\");\n                    message.enumType = [];\n                    for (var i = 0; i < object.enumType.length; ++i) {\n                        if (typeof object.enumType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.enumType: object expected\");\n                        message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);\n                    }\n                }\n                if (object.service) {\n                    if (!Array.isArray(object.service))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.service: array expected\");\n                    message.service = [];\n                    for (var i = 0; i < object.service.length; ++i) {\n                        if (typeof object.service[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.service: object expected\");\n                        message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]);\n                    }\n                }\n                if (object.extension) {\n                    if (!Array.isArray(object.extension))\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.extension: array expected\");\n                    message.extension = [];\n                    for (var i = 0; i < object.extension.length; ++i) {\n                        if (typeof object.extension[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileDescriptorProto.extension: object expected\");\n                        message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.FileOptions.fromObject(object.options);\n                }\n                if (object.sourceCodeInfo != null) {\n                    if (typeof object.sourceCodeInfo !== \"object\")\n                        throw TypeError(\".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected\");\n                    message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo);\n                }\n                if (object.syntax != null)\n                    message.syntax = String(object.syntax);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FileDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.dependency = [];\n                    object.messageType = [];\n                    object.enumType = [];\n                    object.service = [];\n                    object.extension = [];\n                    object.publicDependency = [];\n                    object.weakDependency = [];\n                }\n                if (options.defaults) {\n                    object.name = \"\";\n                    object[\"package\"] = \"\";\n                    object.options = null;\n                    object.sourceCodeInfo = null;\n                    object.syntax = \"\";\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message[\"package\"] != null && message.hasOwnProperty(\"package\"))\n                    object[\"package\"] = message[\"package\"];\n                if (message.dependency && message.dependency.length) {\n                    object.dependency = [];\n                    for (var j = 0; j < message.dependency.length; ++j)\n                        object.dependency[j] = message.dependency[j];\n                }\n                if (message.messageType && message.messageType.length) {\n                    object.messageType = [];\n                    for (var j = 0; j < message.messageType.length; ++j)\n                        object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options);\n                }\n                if (message.enumType && message.enumType.length) {\n                    object.enumType = [];\n                    for (var j = 0; j < message.enumType.length; ++j)\n                        object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);\n                }\n                if (message.service && message.service.length) {\n                    object.service = [];\n                    for (var j = 0; j < message.service.length; ++j)\n                        object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options);\n                }\n                if (message.extension && message.extension.length) {\n                    object.extension = [];\n                    for (var j = 0; j < message.extension.length; ++j)\n                        object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.FileOptions.toObject(message.options, options);\n                if (message.sourceCodeInfo != null && message.hasOwnProperty(\"sourceCodeInfo\"))\n                    object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options);\n                if (message.publicDependency && message.publicDependency.length) {\n                    object.publicDependency = [];\n                    for (var j = 0; j < message.publicDependency.length; ++j)\n                        object.publicDependency[j] = message.publicDependency[j];\n                }\n                if (message.weakDependency && message.weakDependency.length) {\n                    object.weakDependency = [];\n                    for (var j = 0; j < message.weakDependency.length; ++j)\n                        object.weakDependency[j] = message.weakDependency[j];\n                }\n                if (message.syntax != null && message.hasOwnProperty(\"syntax\"))\n                    object.syntax = message.syntax;\n                return object;\n            };\n\n            /**\n             * Converts this FileDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FileDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FileDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for FileDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.FileDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            FileDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.FileDescriptorProto\";\n            };\n\n            return FileDescriptorProto;\n        })();\n\n        protobuf.DescriptorProto = (function() {\n\n            /**\n             * Properties of a DescriptorProto.\n             * @memberof google.protobuf\n             * @interface IDescriptorProto\n             * @property {string|null} [name] DescriptorProto name\n             * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [field] DescriptorProto field\n             * @property {Array.<google.protobuf.IFieldDescriptorProto>|null} [extension] DescriptorProto extension\n             * @property {Array.<google.protobuf.IDescriptorProto>|null} [nestedType] DescriptorProto nestedType\n             * @property {Array.<google.protobuf.IEnumDescriptorProto>|null} [enumType] DescriptorProto enumType\n             * @property {Array.<google.protobuf.DescriptorProto.IExtensionRange>|null} [extensionRange] DescriptorProto extensionRange\n             * @property {Array.<google.protobuf.IOneofDescriptorProto>|null} [oneofDecl] DescriptorProto oneofDecl\n             * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options\n             * @property {Array.<google.protobuf.DescriptorProto.IReservedRange>|null} [reservedRange] DescriptorProto reservedRange\n             * @property {Array.<string>|null} [reservedName] DescriptorProto reservedName\n             */\n\n            /**\n             * Constructs a new DescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a DescriptorProto.\n             * @implements IDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set\n             */\n            function DescriptorProto(properties) {\n                this.field = [];\n                this.extension = [];\n                this.nestedType = [];\n                this.enumType = [];\n                this.extensionRange = [];\n                this.oneofDecl = [];\n                this.reservedRange = [];\n                this.reservedName = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * DescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.name = \"\";\n\n            /**\n             * DescriptorProto field.\n             * @member {Array.<google.protobuf.IFieldDescriptorProto>} field\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.field = $util.emptyArray;\n\n            /**\n             * DescriptorProto extension.\n             * @member {Array.<google.protobuf.IFieldDescriptorProto>} extension\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.extension = $util.emptyArray;\n\n            /**\n             * DescriptorProto nestedType.\n             * @member {Array.<google.protobuf.IDescriptorProto>} nestedType\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.nestedType = $util.emptyArray;\n\n            /**\n             * DescriptorProto enumType.\n             * @member {Array.<google.protobuf.IEnumDescriptorProto>} enumType\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.enumType = $util.emptyArray;\n\n            /**\n             * DescriptorProto extensionRange.\n             * @member {Array.<google.protobuf.DescriptorProto.IExtensionRange>} extensionRange\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.extensionRange = $util.emptyArray;\n\n            /**\n             * DescriptorProto oneofDecl.\n             * @member {Array.<google.protobuf.IOneofDescriptorProto>} oneofDecl\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.oneofDecl = $util.emptyArray;\n\n            /**\n             * DescriptorProto options.\n             * @member {google.protobuf.IMessageOptions|null|undefined} options\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.options = null;\n\n            /**\n             * DescriptorProto reservedRange.\n             * @member {Array.<google.protobuf.DescriptorProto.IReservedRange>} reservedRange\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.reservedRange = $util.emptyArray;\n\n            /**\n             * DescriptorProto reservedName.\n             * @member {Array.<string>} reservedName\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             */\n            DescriptorProto.prototype.reservedName = $util.emptyArray;\n\n            /**\n             * Creates a new DescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto instance\n             */\n            DescriptorProto.create = function create(properties) {\n                return new DescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            DescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.field != null && message.field.length)\n                    for (var i = 0; i < message.field.length; ++i)\n                        $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.nestedType != null && message.nestedType.length)\n                    for (var i = 0; i < message.nestedType.length; ++i)\n                        $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                if (message.enumType != null && message.enumType.length)\n                    for (var i = 0; i < message.enumType.length; ++i)\n                        $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.extensionRange != null && message.extensionRange.length)\n                    for (var i = 0; i < message.extensionRange.length; ++i)\n                        $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();\n                if (message.extension != null && message.extension.length)\n                    for (var i = 0; i < message.extension.length; ++i)\n                        $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();\n                if (message.oneofDecl != null && message.oneofDecl.length)\n                    for (var i = 0; i < message.oneofDecl.length; ++i)\n                        $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n                if (message.reservedRange != null && message.reservedRange.length)\n                    for (var i = 0; i < message.reservedRange.length; ++i)\n                        $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();\n                if (message.reservedName != null && message.reservedName.length)\n                    for (var i = 0; i < message.reservedName.length; ++i)\n                        writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a DescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            DescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.field && message.field.length))\n                            message.field = [];\n                        message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 6:\n                        if (!(message.extension && message.extension.length))\n                            message.extension = [];\n                        message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        if (!(message.nestedType && message.nestedType.length))\n                            message.nestedType = [];\n                        message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 4:\n                        if (!(message.enumType && message.enumType.length))\n                            message.enumType = [];\n                        message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 5:\n                        if (!(message.extensionRange && message.extensionRange.length))\n                            message.extensionRange = [];\n                        message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32()));\n                        break;\n                    case 8:\n                        if (!(message.oneofDecl && message.oneofDecl.length))\n                            message.oneofDecl = [];\n                        message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 7:\n                        message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32());\n                        break;\n                    case 9:\n                        if (!(message.reservedRange && message.reservedRange.length))\n                            message.reservedRange = [];\n                        message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32()));\n                        break;\n                    case 10:\n                        if (!(message.reservedName && message.reservedName.length))\n                            message.reservedName = [];\n                        message.reservedName.push(reader.string());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a DescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            DescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a DescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            DescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.field != null && message.hasOwnProperty(\"field\")) {\n                    if (!Array.isArray(message.field))\n                        return \"field: array expected\";\n                    for (var i = 0; i < message.field.length; ++i) {\n                        var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]);\n                        if (error)\n                            return \"field.\" + error;\n                    }\n                }\n                if (message.extension != null && message.hasOwnProperty(\"extension\")) {\n                    if (!Array.isArray(message.extension))\n                        return \"extension: array expected\";\n                    for (var i = 0; i < message.extension.length; ++i) {\n                        var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]);\n                        if (error)\n                            return \"extension.\" + error;\n                    }\n                }\n                if (message.nestedType != null && message.hasOwnProperty(\"nestedType\")) {\n                    if (!Array.isArray(message.nestedType))\n                        return \"nestedType: array expected\";\n                    for (var i = 0; i < message.nestedType.length; ++i) {\n                        var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]);\n                        if (error)\n                            return \"nestedType.\" + error;\n                    }\n                }\n                if (message.enumType != null && message.hasOwnProperty(\"enumType\")) {\n                    if (!Array.isArray(message.enumType))\n                        return \"enumType: array expected\";\n                    for (var i = 0; i < message.enumType.length; ++i) {\n                        var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]);\n                        if (error)\n                            return \"enumType.\" + error;\n                    }\n                }\n                if (message.extensionRange != null && message.hasOwnProperty(\"extensionRange\")) {\n                    if (!Array.isArray(message.extensionRange))\n                        return \"extensionRange: array expected\";\n                    for (var i = 0; i < message.extensionRange.length; ++i) {\n                        var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]);\n                        if (error)\n                            return \"extensionRange.\" + error;\n                    }\n                }\n                if (message.oneofDecl != null && message.hasOwnProperty(\"oneofDecl\")) {\n                    if (!Array.isArray(message.oneofDecl))\n                        return \"oneofDecl: array expected\";\n                    for (var i = 0; i < message.oneofDecl.length; ++i) {\n                        var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]);\n                        if (error)\n                            return \"oneofDecl.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.MessageOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                if (message.reservedRange != null && message.hasOwnProperty(\"reservedRange\")) {\n                    if (!Array.isArray(message.reservedRange))\n                        return \"reservedRange: array expected\";\n                    for (var i = 0; i < message.reservedRange.length; ++i) {\n                        var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]);\n                        if (error)\n                            return \"reservedRange.\" + error;\n                    }\n                }\n                if (message.reservedName != null && message.hasOwnProperty(\"reservedName\")) {\n                    if (!Array.isArray(message.reservedName))\n                        return \"reservedName: array expected\";\n                    for (var i = 0; i < message.reservedName.length; ++i)\n                        if (!$util.isString(message.reservedName[i]))\n                            return \"reservedName: string[] expected\";\n                }\n                return null;\n            };\n\n            /**\n             * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.DescriptorProto} DescriptorProto\n             */\n            DescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.DescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.DescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.field) {\n                    if (!Array.isArray(object.field))\n                        throw TypeError(\".google.protobuf.DescriptorProto.field: array expected\");\n                    message.field = [];\n                    for (var i = 0; i < object.field.length; ++i) {\n                        if (typeof object.field[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.field: object expected\");\n                        message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]);\n                    }\n                }\n                if (object.extension) {\n                    if (!Array.isArray(object.extension))\n                        throw TypeError(\".google.protobuf.DescriptorProto.extension: array expected\");\n                    message.extension = [];\n                    for (var i = 0; i < object.extension.length; ++i) {\n                        if (typeof object.extension[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.extension: object expected\");\n                        message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]);\n                    }\n                }\n                if (object.nestedType) {\n                    if (!Array.isArray(object.nestedType))\n                        throw TypeError(\".google.protobuf.DescriptorProto.nestedType: array expected\");\n                    message.nestedType = [];\n                    for (var i = 0; i < object.nestedType.length; ++i) {\n                        if (typeof object.nestedType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.nestedType: object expected\");\n                        message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]);\n                    }\n                }\n                if (object.enumType) {\n                    if (!Array.isArray(object.enumType))\n                        throw TypeError(\".google.protobuf.DescriptorProto.enumType: array expected\");\n                    message.enumType = [];\n                    for (var i = 0; i < object.enumType.length; ++i) {\n                        if (typeof object.enumType[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.enumType: object expected\");\n                        message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]);\n                    }\n                }\n                if (object.extensionRange) {\n                    if (!Array.isArray(object.extensionRange))\n                        throw TypeError(\".google.protobuf.DescriptorProto.extensionRange: array expected\");\n                    message.extensionRange = [];\n                    for (var i = 0; i < object.extensionRange.length; ++i) {\n                        if (typeof object.extensionRange[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.extensionRange: object expected\");\n                        message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]);\n                    }\n                }\n                if (object.oneofDecl) {\n                    if (!Array.isArray(object.oneofDecl))\n                        throw TypeError(\".google.protobuf.DescriptorProto.oneofDecl: array expected\");\n                    message.oneofDecl = [];\n                    for (var i = 0; i < object.oneofDecl.length; ++i) {\n                        if (typeof object.oneofDecl[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.oneofDecl: object expected\");\n                        message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.DescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.MessageOptions.fromObject(object.options);\n                }\n                if (object.reservedRange) {\n                    if (!Array.isArray(object.reservedRange))\n                        throw TypeError(\".google.protobuf.DescriptorProto.reservedRange: array expected\");\n                    message.reservedRange = [];\n                    for (var i = 0; i < object.reservedRange.length; ++i) {\n                        if (typeof object.reservedRange[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.DescriptorProto.reservedRange: object expected\");\n                        message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]);\n                    }\n                }\n                if (object.reservedName) {\n                    if (!Array.isArray(object.reservedName))\n                        throw TypeError(\".google.protobuf.DescriptorProto.reservedName: array expected\");\n                    message.reservedName = [];\n                    for (var i = 0; i < object.reservedName.length; ++i)\n                        message.reservedName[i] = String(object.reservedName[i]);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {google.protobuf.DescriptorProto} message DescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            DescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults) {\n                    object.field = [];\n                    object.nestedType = [];\n                    object.enumType = [];\n                    object.extensionRange = [];\n                    object.extension = [];\n                    object.oneofDecl = [];\n                    object.reservedRange = [];\n                    object.reservedName = [];\n                }\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.field && message.field.length) {\n                    object.field = [];\n                    for (var j = 0; j < message.field.length; ++j)\n                        object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options);\n                }\n                if (message.nestedType && message.nestedType.length) {\n                    object.nestedType = [];\n                    for (var j = 0; j < message.nestedType.length; ++j)\n                        object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options);\n                }\n                if (message.enumType && message.enumType.length) {\n                    object.enumType = [];\n                    for (var j = 0; j < message.enumType.length; ++j)\n                        object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options);\n                }\n                if (message.extensionRange && message.extensionRange.length) {\n                    object.extensionRange = [];\n                    for (var j = 0; j < message.extensionRange.length; ++j)\n                        object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options);\n                }\n                if (message.extension && message.extension.length) {\n                    object.extension = [];\n                    for (var j = 0; j < message.extension.length; ++j)\n                        object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options);\n                if (message.oneofDecl && message.oneofDecl.length) {\n                    object.oneofDecl = [];\n                    for (var j = 0; j < message.oneofDecl.length; ++j)\n                        object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options);\n                }\n                if (message.reservedRange && message.reservedRange.length) {\n                    object.reservedRange = [];\n                    for (var j = 0; j < message.reservedRange.length; ++j)\n                        object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options);\n                }\n                if (message.reservedName && message.reservedName.length) {\n                    object.reservedName = [];\n                    for (var j = 0; j < message.reservedName.length; ++j)\n                        object.reservedName[j] = message.reservedName[j];\n                }\n                return object;\n            };\n\n            /**\n             * Converts this DescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.DescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            DescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for DescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.DescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            DescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.DescriptorProto\";\n            };\n\n            DescriptorProto.ExtensionRange = (function() {\n\n                /**\n                 * Properties of an ExtensionRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @interface IExtensionRange\n                 * @property {number|null} [start] ExtensionRange start\n                 * @property {number|null} [end] ExtensionRange end\n                 */\n\n                /**\n                 * Constructs a new ExtensionRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @classdesc Represents an ExtensionRange.\n                 * @implements IExtensionRange\n                 * @constructor\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set\n                 */\n                function ExtensionRange(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * ExtensionRange start.\n                 * @member {number} start\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @instance\n                 */\n                ExtensionRange.prototype.start = 0;\n\n                /**\n                 * ExtensionRange end.\n                 * @member {number} end\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @instance\n                 */\n                ExtensionRange.prototype.end = 0;\n\n                /**\n                 * Creates a new ExtensionRange instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance\n                 */\n                ExtensionRange.create = function create(properties) {\n                    return new ExtensionRange(properties);\n                };\n\n                /**\n                 * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ExtensionRange.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.start != null && Object.hasOwnProperty.call(message, \"start\"))\n                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n                    if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes an ExtensionRange message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ExtensionRange.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ExtensionRange();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.start = reader.int32();\n                            break;\n                        case 2:\n                            message.end = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes an ExtensionRange message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ExtensionRange.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies an ExtensionRange message.\n                 * @function verify\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                ExtensionRange.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        if (!$util.isInteger(message.start))\n                            return \"start: integer expected\";\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        if (!$util.isInteger(message.end))\n                            return \"end: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange\n                 */\n                ExtensionRange.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange)\n                        return object;\n                    var message = new $root.google.protobuf.DescriptorProto.ExtensionRange();\n                    if (object.start != null)\n                        message.start = object.start | 0;\n                    if (object.end != null)\n                        message.end = object.end | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                ExtensionRange.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults) {\n                        object.start = 0;\n                        object.end = 0;\n                    }\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        object.start = message.start;\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        object.end = message.end;\n                    return object;\n                };\n\n                /**\n                 * Converts this ExtensionRange to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                ExtensionRange.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for ExtensionRange\n                 * @function getTypeUrl\n                 * @memberof google.protobuf.DescriptorProto.ExtensionRange\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                ExtensionRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/google.protobuf.DescriptorProto.ExtensionRange\";\n                };\n\n                return ExtensionRange;\n            })();\n\n            DescriptorProto.ReservedRange = (function() {\n\n                /**\n                 * Properties of a ReservedRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @interface IReservedRange\n                 * @property {number|null} [start] ReservedRange start\n                 * @property {number|null} [end] ReservedRange end\n                 */\n\n                /**\n                 * Constructs a new ReservedRange.\n                 * @memberof google.protobuf.DescriptorProto\n                 * @classdesc Represents a ReservedRange.\n                 * @implements IReservedRange\n                 * @constructor\n                 * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set\n                 */\n                function ReservedRange(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * ReservedRange start.\n                 * @member {number} start\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @instance\n                 */\n                ReservedRange.prototype.start = 0;\n\n                /**\n                 * ReservedRange end.\n                 * @member {number} end\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @instance\n                 */\n                ReservedRange.prototype.end = 0;\n\n                /**\n                 * Creates a new ReservedRange instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance\n                 */\n                ReservedRange.create = function create(properties) {\n                    return new ReservedRange(properties);\n                };\n\n                /**\n                 * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ReservedRange.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.start != null && Object.hasOwnProperty.call(message, \"start\"))\n                        writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start);\n                    if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n                        writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                ReservedRange.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a ReservedRange message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ReservedRange.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DescriptorProto.ReservedRange();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.start = reader.int32();\n                            break;\n                        case 2:\n                            message.end = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a ReservedRange message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                ReservedRange.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a ReservedRange message.\n                 * @function verify\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                ReservedRange.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        if (!$util.isInteger(message.start))\n                            return \"start: integer expected\";\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        if (!$util.isInteger(message.end))\n                            return \"end: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange\n                 */\n                ReservedRange.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange)\n                        return object;\n                    var message = new $root.google.protobuf.DescriptorProto.ReservedRange();\n                    if (object.start != null)\n                        message.start = object.start | 0;\n                    if (object.end != null)\n                        message.end = object.end | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a ReservedRange message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                ReservedRange.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults) {\n                        object.start = 0;\n                        object.end = 0;\n                    }\n                    if (message.start != null && message.hasOwnProperty(\"start\"))\n                        object.start = message.start;\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        object.end = message.end;\n                    return object;\n                };\n\n                /**\n                 * Converts this ReservedRange to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                ReservedRange.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for ReservedRange\n                 * @function getTypeUrl\n                 * @memberof google.protobuf.DescriptorProto.ReservedRange\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                ReservedRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/google.protobuf.DescriptorProto.ReservedRange\";\n                };\n\n                return ReservedRange;\n            })();\n\n            return DescriptorProto;\n        })();\n\n        protobuf.FieldDescriptorProto = (function() {\n\n            /**\n             * Properties of a FieldDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IFieldDescriptorProto\n             * @property {string|null} [name] FieldDescriptorProto name\n             * @property {number|null} [number] FieldDescriptorProto number\n             * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label\n             * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type\n             * @property {string|null} [typeName] FieldDescriptorProto typeName\n             * @property {string|null} [extendee] FieldDescriptorProto extendee\n             * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue\n             * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex\n             * @property {string|null} [jsonName] FieldDescriptorProto jsonName\n             * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options\n             */\n\n            /**\n             * Constructs a new FieldDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a FieldDescriptorProto.\n             * @implements IFieldDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set\n             */\n            function FieldDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FieldDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.name = \"\";\n\n            /**\n             * FieldDescriptorProto number.\n             * @member {number} number\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.number = 0;\n\n            /**\n             * FieldDescriptorProto label.\n             * @member {google.protobuf.FieldDescriptorProto.Label} label\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.label = 1;\n\n            /**\n             * FieldDescriptorProto type.\n             * @member {google.protobuf.FieldDescriptorProto.Type} type\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.type = 1;\n\n            /**\n             * FieldDescriptorProto typeName.\n             * @member {string} typeName\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.typeName = \"\";\n\n            /**\n             * FieldDescriptorProto extendee.\n             * @member {string} extendee\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.extendee = \"\";\n\n            /**\n             * FieldDescriptorProto defaultValue.\n             * @member {string} defaultValue\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.defaultValue = \"\";\n\n            /**\n             * FieldDescriptorProto oneofIndex.\n             * @member {number} oneofIndex\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.oneofIndex = 0;\n\n            /**\n             * FieldDescriptorProto jsonName.\n             * @member {string} jsonName\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.jsonName = \"\";\n\n            /**\n             * FieldDescriptorProto options.\n             * @member {google.protobuf.IFieldOptions|null|undefined} options\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             */\n            FieldDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new FieldDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance\n             */\n            FieldDescriptorProto.create = function create(properties) {\n                return new FieldDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.extendee != null && Object.hasOwnProperty.call(message, \"extendee\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee);\n                if (message.number != null && Object.hasOwnProperty.call(message, \"number\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number);\n                if (message.label != null && Object.hasOwnProperty.call(message, \"label\"))\n                    writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label);\n                if (message.type != null && Object.hasOwnProperty.call(message, \"type\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type);\n                if (message.typeName != null && Object.hasOwnProperty.call(message, \"typeName\"))\n                    writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName);\n                if (message.defaultValue != null && Object.hasOwnProperty.call(message, \"defaultValue\"))\n                    writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue);\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim();\n                if (message.oneofIndex != null && Object.hasOwnProperty.call(message, \"oneofIndex\"))\n                    writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex);\n                if (message.jsonName != null && Object.hasOwnProperty.call(message, \"jsonName\"))\n                    writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FieldDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 3:\n                        message.number = reader.int32();\n                        break;\n                    case 4:\n                        message.label = reader.int32();\n                        break;\n                    case 5:\n                        message.type = reader.int32();\n                        break;\n                    case 6:\n                        message.typeName = reader.string();\n                        break;\n                    case 2:\n                        message.extendee = reader.string();\n                        break;\n                    case 7:\n                        message.defaultValue = reader.string();\n                        break;\n                    case 9:\n                        message.oneofIndex = reader.int32();\n                        break;\n                    case 10:\n                        message.jsonName = reader.string();\n                        break;\n                    case 8:\n                        message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FieldDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FieldDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    if (!$util.isInteger(message.number))\n                        return \"number: integer expected\";\n                if (message.label != null && message.hasOwnProperty(\"label\"))\n                    switch (message.label) {\n                    default:\n                        return \"label: enum value expected\";\n                    case 1:\n                    case 2:\n                    case 3:\n                        break;\n                    }\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    switch (message.type) {\n                    default:\n                        return \"type: enum value expected\";\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                    case 10:\n                    case 11:\n                    case 12:\n                    case 13:\n                    case 14:\n                    case 15:\n                    case 16:\n                    case 17:\n                    case 18:\n                        break;\n                    }\n                if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n                    if (!$util.isString(message.typeName))\n                        return \"typeName: string expected\";\n                if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n                    if (!$util.isString(message.extendee))\n                        return \"extendee: string expected\";\n                if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n                    if (!$util.isString(message.defaultValue))\n                        return \"defaultValue: string expected\";\n                if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n                    if (!$util.isInteger(message.oneofIndex))\n                        return \"oneofIndex: integer expected\";\n                if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n                    if (!$util.isString(message.jsonName))\n                        return \"jsonName: string expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.FieldOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto\n             */\n            FieldDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FieldDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.FieldDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.number != null)\n                    message.number = object.number | 0;\n                switch (object.label) {\n                case \"LABEL_OPTIONAL\":\n                case 1:\n                    message.label = 1;\n                    break;\n                case \"LABEL_REQUIRED\":\n                case 2:\n                    message.label = 2;\n                    break;\n                case \"LABEL_REPEATED\":\n                case 3:\n                    message.label = 3;\n                    break;\n                }\n                switch (object.type) {\n                case \"TYPE_DOUBLE\":\n                case 1:\n                    message.type = 1;\n                    break;\n                case \"TYPE_FLOAT\":\n                case 2:\n                    message.type = 2;\n                    break;\n                case \"TYPE_INT64\":\n                case 3:\n                    message.type = 3;\n                    break;\n                case \"TYPE_UINT64\":\n                case 4:\n                    message.type = 4;\n                    break;\n                case \"TYPE_INT32\":\n                case 5:\n                    message.type = 5;\n                    break;\n                case \"TYPE_FIXED64\":\n                case 6:\n                    message.type = 6;\n                    break;\n                case \"TYPE_FIXED32\":\n                case 7:\n                    message.type = 7;\n                    break;\n                case \"TYPE_BOOL\":\n                case 8:\n                    message.type = 8;\n                    break;\n                case \"TYPE_STRING\":\n                case 9:\n                    message.type = 9;\n                    break;\n                case \"TYPE_GROUP\":\n                case 10:\n                    message.type = 10;\n                    break;\n                case \"TYPE_MESSAGE\":\n                case 11:\n                    message.type = 11;\n                    break;\n                case \"TYPE_BYTES\":\n                case 12:\n                    message.type = 12;\n                    break;\n                case \"TYPE_UINT32\":\n                case 13:\n                    message.type = 13;\n                    break;\n                case \"TYPE_ENUM\":\n                case 14:\n                    message.type = 14;\n                    break;\n                case \"TYPE_SFIXED32\":\n                case 15:\n                    message.type = 15;\n                    break;\n                case \"TYPE_SFIXED64\":\n                case 16:\n                    message.type = 16;\n                    break;\n                case \"TYPE_SINT32\":\n                case 17:\n                    message.type = 17;\n                    break;\n                case \"TYPE_SINT64\":\n                case 18:\n                    message.type = 18;\n                    break;\n                }\n                if (object.typeName != null)\n                    message.typeName = String(object.typeName);\n                if (object.extendee != null)\n                    message.extendee = String(object.extendee);\n                if (object.defaultValue != null)\n                    message.defaultValue = String(object.defaultValue);\n                if (object.oneofIndex != null)\n                    message.oneofIndex = object.oneofIndex | 0;\n                if (object.jsonName != null)\n                    message.jsonName = String(object.jsonName);\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.FieldDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.FieldOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FieldDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.extendee = \"\";\n                    object.number = 0;\n                    object.label = options.enums === String ? \"LABEL_OPTIONAL\" : 1;\n                    object.type = options.enums === String ? \"TYPE_DOUBLE\" : 1;\n                    object.typeName = \"\";\n                    object.defaultValue = \"\";\n                    object.options = null;\n                    object.oneofIndex = 0;\n                    object.jsonName = \"\";\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.extendee != null && message.hasOwnProperty(\"extendee\"))\n                    object.extendee = message.extendee;\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    object.number = message.number;\n                if (message.label != null && message.hasOwnProperty(\"label\"))\n                    object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label;\n                if (message.type != null && message.hasOwnProperty(\"type\"))\n                    object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type;\n                if (message.typeName != null && message.hasOwnProperty(\"typeName\"))\n                    object.typeName = message.typeName;\n                if (message.defaultValue != null && message.hasOwnProperty(\"defaultValue\"))\n                    object.defaultValue = message.defaultValue;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options);\n                if (message.oneofIndex != null && message.hasOwnProperty(\"oneofIndex\"))\n                    object.oneofIndex = message.oneofIndex;\n                if (message.jsonName != null && message.hasOwnProperty(\"jsonName\"))\n                    object.jsonName = message.jsonName;\n                return object;\n            };\n\n            /**\n             * Converts this FieldDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FieldDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for FieldDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.FieldDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            FieldDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.FieldDescriptorProto\";\n            };\n\n            /**\n             * Type enum.\n             * @name google.protobuf.FieldDescriptorProto.Type\n             * @enum {number}\n             * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value\n             * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value\n             * @property {number} TYPE_INT64=3 TYPE_INT64 value\n             * @property {number} TYPE_UINT64=4 TYPE_UINT64 value\n             * @property {number} TYPE_INT32=5 TYPE_INT32 value\n             * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value\n             * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value\n             * @property {number} TYPE_BOOL=8 TYPE_BOOL value\n             * @property {number} TYPE_STRING=9 TYPE_STRING value\n             * @property {number} TYPE_GROUP=10 TYPE_GROUP value\n             * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value\n             * @property {number} TYPE_BYTES=12 TYPE_BYTES value\n             * @property {number} TYPE_UINT32=13 TYPE_UINT32 value\n             * @property {number} TYPE_ENUM=14 TYPE_ENUM value\n             * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value\n             * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value\n             * @property {number} TYPE_SINT32=17 TYPE_SINT32 value\n             * @property {number} TYPE_SINT64=18 TYPE_SINT64 value\n             */\n            FieldDescriptorProto.Type = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[1] = \"TYPE_DOUBLE\"] = 1;\n                values[valuesById[2] = \"TYPE_FLOAT\"] = 2;\n                values[valuesById[3] = \"TYPE_INT64\"] = 3;\n                values[valuesById[4] = \"TYPE_UINT64\"] = 4;\n                values[valuesById[5] = \"TYPE_INT32\"] = 5;\n                values[valuesById[6] = \"TYPE_FIXED64\"] = 6;\n                values[valuesById[7] = \"TYPE_FIXED32\"] = 7;\n                values[valuesById[8] = \"TYPE_BOOL\"] = 8;\n                values[valuesById[9] = \"TYPE_STRING\"] = 9;\n                values[valuesById[10] = \"TYPE_GROUP\"] = 10;\n                values[valuesById[11] = \"TYPE_MESSAGE\"] = 11;\n                values[valuesById[12] = \"TYPE_BYTES\"] = 12;\n                values[valuesById[13] = \"TYPE_UINT32\"] = 13;\n                values[valuesById[14] = \"TYPE_ENUM\"] = 14;\n                values[valuesById[15] = \"TYPE_SFIXED32\"] = 15;\n                values[valuesById[16] = \"TYPE_SFIXED64\"] = 16;\n                values[valuesById[17] = \"TYPE_SINT32\"] = 17;\n                values[valuesById[18] = \"TYPE_SINT64\"] = 18;\n                return values;\n            })();\n\n            /**\n             * Label enum.\n             * @name google.protobuf.FieldDescriptorProto.Label\n             * @enum {number}\n             * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value\n             * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value\n             * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value\n             */\n            FieldDescriptorProto.Label = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[1] = \"LABEL_OPTIONAL\"] = 1;\n                values[valuesById[2] = \"LABEL_REQUIRED\"] = 2;\n                values[valuesById[3] = \"LABEL_REPEATED\"] = 3;\n                return values;\n            })();\n\n            return FieldDescriptorProto;\n        })();\n\n        protobuf.OneofDescriptorProto = (function() {\n\n            /**\n             * Properties of an OneofDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IOneofDescriptorProto\n             * @property {string|null} [name] OneofDescriptorProto name\n             * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options\n             */\n\n            /**\n             * Constructs a new OneofDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents an OneofDescriptorProto.\n             * @implements IOneofDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set\n             */\n            function OneofDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * OneofDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @instance\n             */\n            OneofDescriptorProto.prototype.name = \"\";\n\n            /**\n             * OneofDescriptorProto options.\n             * @member {google.protobuf.IOneofOptions|null|undefined} options\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @instance\n             */\n            OneofDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new OneofDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance\n             */\n            OneofDescriptorProto.create = function create(properties) {\n                return new OneofDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an OneofDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an OneofDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            OneofDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.OneofOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto\n             */\n            OneofDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.OneofDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.OneofDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.OneofDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.OneofOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            OneofDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this OneofDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            OneofDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for OneofDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.OneofDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            OneofDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.OneofDescriptorProto\";\n            };\n\n            return OneofDescriptorProto;\n        })();\n\n        protobuf.EnumDescriptorProto = (function() {\n\n            /**\n             * Properties of an EnumDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IEnumDescriptorProto\n             * @property {string|null} [name] EnumDescriptorProto name\n             * @property {Array.<google.protobuf.IEnumValueDescriptorProto>|null} [value] EnumDescriptorProto value\n             * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options\n             */\n\n            /**\n             * Constructs a new EnumDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumDescriptorProto.\n             * @implements IEnumDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set\n             */\n            function EnumDescriptorProto(properties) {\n                this.value = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             */\n            EnumDescriptorProto.prototype.name = \"\";\n\n            /**\n             * EnumDescriptorProto value.\n             * @member {Array.<google.protobuf.IEnumValueDescriptorProto>} value\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             */\n            EnumDescriptorProto.prototype.value = $util.emptyArray;\n\n            /**\n             * EnumDescriptorProto options.\n             * @member {google.protobuf.IEnumOptions|null|undefined} options\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             */\n            EnumDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new EnumDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance\n             */\n            EnumDescriptorProto.create = function create(properties) {\n                return new EnumDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.value != null && message.value.length)\n                    for (var i = 0; i < message.value.length; ++i)\n                        $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.value && message.value.length))\n                            message.value = [];\n                        message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.value != null && message.hasOwnProperty(\"value\")) {\n                    if (!Array.isArray(message.value))\n                        return \"value: array expected\";\n                    for (var i = 0; i < message.value.length; ++i) {\n                        var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]);\n                        if (error)\n                            return \"value.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.EnumOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto\n             */\n            EnumDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.EnumDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.value) {\n                    if (!Array.isArray(object.value))\n                        throw TypeError(\".google.protobuf.EnumDescriptorProto.value: array expected\");\n                    message.value = [];\n                    for (var i = 0; i < object.value.length; ++i) {\n                        if (typeof object.value[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.EnumDescriptorProto.value: object expected\");\n                        message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.EnumDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.EnumOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.value = [];\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.value && message.value.length) {\n                    object.value = [];\n                    for (var j = 0; j < message.value.length; ++j)\n                        object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this EnumDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for EnumDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.EnumDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            EnumDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.EnumDescriptorProto\";\n            };\n\n            return EnumDescriptorProto;\n        })();\n\n        protobuf.EnumValueDescriptorProto = (function() {\n\n            /**\n             * Properties of an EnumValueDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IEnumValueDescriptorProto\n             * @property {string|null} [name] EnumValueDescriptorProto name\n             * @property {number|null} [number] EnumValueDescriptorProto number\n             * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options\n             */\n\n            /**\n             * Constructs a new EnumValueDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumValueDescriptorProto.\n             * @implements IEnumValueDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set\n             */\n            function EnumValueDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumValueDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             */\n            EnumValueDescriptorProto.prototype.name = \"\";\n\n            /**\n             * EnumValueDescriptorProto number.\n             * @member {number} number\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             */\n            EnumValueDescriptorProto.prototype.number = 0;\n\n            /**\n             * EnumValueDescriptorProto options.\n             * @member {google.protobuf.IEnumValueOptions|null|undefined} options\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             */\n            EnumValueDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new EnumValueDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance\n             */\n            EnumValueDescriptorProto.create = function create(properties) {\n                return new EnumValueDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.number != null && Object.hasOwnProperty.call(message, \"number\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number);\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumValueDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message.number = reader.int32();\n                        break;\n                    case 3:\n                        message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumValueDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumValueDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    if (!$util.isInteger(message.number))\n                        return \"number: integer expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.EnumValueOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto\n             */\n            EnumValueDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumValueDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.EnumValueDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.number != null)\n                    message.number = object.number | 0;\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.EnumValueDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumValueDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.number = 0;\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.number != null && message.hasOwnProperty(\"number\"))\n                    object.number = message.number;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this EnumValueDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumValueDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for EnumValueDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.EnumValueDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            EnumValueDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.EnumValueDescriptorProto\";\n            };\n\n            return EnumValueDescriptorProto;\n        })();\n\n        protobuf.ServiceDescriptorProto = (function() {\n\n            /**\n             * Properties of a ServiceDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IServiceDescriptorProto\n             * @property {string|null} [name] ServiceDescriptorProto name\n             * @property {Array.<google.protobuf.IMethodDescriptorProto>|null} [method] ServiceDescriptorProto method\n             * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options\n             */\n\n            /**\n             * Constructs a new ServiceDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a ServiceDescriptorProto.\n             * @implements IServiceDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set\n             */\n            function ServiceDescriptorProto(properties) {\n                this.method = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * ServiceDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             */\n            ServiceDescriptorProto.prototype.name = \"\";\n\n            /**\n             * ServiceDescriptorProto method.\n             * @member {Array.<google.protobuf.IMethodDescriptorProto>} method\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             */\n            ServiceDescriptorProto.prototype.method = $util.emptyArray;\n\n            /**\n             * ServiceDescriptorProto options.\n             * @member {google.protobuf.IServiceOptions|null|undefined} options\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             */\n            ServiceDescriptorProto.prototype.options = null;\n\n            /**\n             * Creates a new ServiceDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance\n             */\n            ServiceDescriptorProto.create = function create(properties) {\n                return new ServiceDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.method != null && message.method.length)\n                    for (var i = 0; i < message.method.length; ++i)\n                        $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a ServiceDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        if (!(message.method && message.method.length))\n                            message.method = [];\n                        message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32());\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a ServiceDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            ServiceDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.method != null && message.hasOwnProperty(\"method\")) {\n                    if (!Array.isArray(message.method))\n                        return \"method: array expected\";\n                    for (var i = 0; i < message.method.length; ++i) {\n                        var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]);\n                        if (error)\n                            return \"method.\" + error;\n                    }\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.ServiceOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                return null;\n            };\n\n            /**\n             * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto\n             */\n            ServiceDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.ServiceDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.ServiceDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.method) {\n                    if (!Array.isArray(object.method))\n                        throw TypeError(\".google.protobuf.ServiceDescriptorProto.method: array expected\");\n                    message.method = [];\n                    for (var i = 0; i < object.method.length; ++i) {\n                        if (typeof object.method[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.ServiceDescriptorProto.method: object expected\");\n                        message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]);\n                    }\n                }\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.ServiceDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options);\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            ServiceDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.method = [];\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.options = null;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.method && message.method.length) {\n                    object.method = [];\n                    for (var j = 0; j < message.method.length; ++j)\n                        object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options);\n                }\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options);\n                return object;\n            };\n\n            /**\n             * Converts this ServiceDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            ServiceDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for ServiceDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.ServiceDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            ServiceDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.ServiceDescriptorProto\";\n            };\n\n            return ServiceDescriptorProto;\n        })();\n\n        protobuf.MethodDescriptorProto = (function() {\n\n            /**\n             * Properties of a MethodDescriptorProto.\n             * @memberof google.protobuf\n             * @interface IMethodDescriptorProto\n             * @property {string|null} [name] MethodDescriptorProto name\n             * @property {string|null} [inputType] MethodDescriptorProto inputType\n             * @property {string|null} [outputType] MethodDescriptorProto outputType\n             * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options\n             * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming\n             * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming\n             */\n\n            /**\n             * Constructs a new MethodDescriptorProto.\n             * @memberof google.protobuf\n             * @classdesc Represents a MethodDescriptorProto.\n             * @implements IMethodDescriptorProto\n             * @constructor\n             * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set\n             */\n            function MethodDescriptorProto(properties) {\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MethodDescriptorProto name.\n             * @member {string} name\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.name = \"\";\n\n            /**\n             * MethodDescriptorProto inputType.\n             * @member {string} inputType\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.inputType = \"\";\n\n            /**\n             * MethodDescriptorProto outputType.\n             * @member {string} outputType\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.outputType = \"\";\n\n            /**\n             * MethodDescriptorProto options.\n             * @member {google.protobuf.IMethodOptions|null|undefined} options\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.options = null;\n\n            /**\n             * MethodDescriptorProto clientStreaming.\n             * @member {boolean} clientStreaming\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.clientStreaming = false;\n\n            /**\n             * MethodDescriptorProto serverStreaming.\n             * @member {boolean} serverStreaming\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             */\n            MethodDescriptorProto.prototype.serverStreaming = false;\n\n            /**\n             * Creates a new MethodDescriptorProto instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance\n             */\n            MethodDescriptorProto.create = function create(properties) {\n                return new MethodDescriptorProto(properties);\n            };\n\n            /**\n             * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodDescriptorProto.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && Object.hasOwnProperty.call(message, \"name\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.name);\n                if (message.inputType != null && Object.hasOwnProperty.call(message, \"inputType\"))\n                    writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType);\n                if (message.outputType != null && Object.hasOwnProperty.call(message, \"outputType\"))\n                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType);\n                if (message.options != null && Object.hasOwnProperty.call(message, \"options\"))\n                    $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();\n                if (message.clientStreaming != null && Object.hasOwnProperty.call(message, \"clientStreaming\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming);\n                if (message.serverStreaming != null && Object.hasOwnProperty.call(message, \"serverStreaming\"))\n                    writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MethodDescriptorProto message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodDescriptorProto.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodDescriptorProto();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.name = reader.string();\n                        break;\n                    case 2:\n                        message.inputType = reader.string();\n                        break;\n                    case 3:\n                        message.outputType = reader.string();\n                        break;\n                    case 4:\n                        message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32());\n                        break;\n                    case 5:\n                        message.clientStreaming = reader.bool();\n                        break;\n                    case 6:\n                        message.serverStreaming = reader.bool();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MethodDescriptorProto message.\n             * @function verify\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MethodDescriptorProto.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    if (!$util.isString(message.name))\n                        return \"name: string expected\";\n                if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n                    if (!$util.isString(message.inputType))\n                        return \"inputType: string expected\";\n                if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n                    if (!$util.isString(message.outputType))\n                        return \"outputType: string expected\";\n                if (message.options != null && message.hasOwnProperty(\"options\")) {\n                    var error = $root.google.protobuf.MethodOptions.verify(message.options);\n                    if (error)\n                        return \"options.\" + error;\n                }\n                if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n                    if (typeof message.clientStreaming !== \"boolean\")\n                        return \"clientStreaming: boolean expected\";\n                if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n                    if (typeof message.serverStreaming !== \"boolean\")\n                        return \"serverStreaming: boolean expected\";\n                return null;\n            };\n\n            /**\n             * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto\n             */\n            MethodDescriptorProto.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.MethodDescriptorProto)\n                    return object;\n                var message = new $root.google.protobuf.MethodDescriptorProto();\n                if (object.name != null)\n                    message.name = String(object.name);\n                if (object.inputType != null)\n                    message.inputType = String(object.inputType);\n                if (object.outputType != null)\n                    message.outputType = String(object.outputType);\n                if (object.options != null) {\n                    if (typeof object.options !== \"object\")\n                        throw TypeError(\".google.protobuf.MethodDescriptorProto.options: object expected\");\n                    message.options = $root.google.protobuf.MethodOptions.fromObject(object.options);\n                }\n                if (object.clientStreaming != null)\n                    message.clientStreaming = Boolean(object.clientStreaming);\n                if (object.serverStreaming != null)\n                    message.serverStreaming = Boolean(object.serverStreaming);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MethodDescriptorProto.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.defaults) {\n                    object.name = \"\";\n                    object.inputType = \"\";\n                    object.outputType = \"\";\n                    object.options = null;\n                    object.clientStreaming = false;\n                    object.serverStreaming = false;\n                }\n                if (message.name != null && message.hasOwnProperty(\"name\"))\n                    object.name = message.name;\n                if (message.inputType != null && message.hasOwnProperty(\"inputType\"))\n                    object.inputType = message.inputType;\n                if (message.outputType != null && message.hasOwnProperty(\"outputType\"))\n                    object.outputType = message.outputType;\n                if (message.options != null && message.hasOwnProperty(\"options\"))\n                    object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options);\n                if (message.clientStreaming != null && message.hasOwnProperty(\"clientStreaming\"))\n                    object.clientStreaming = message.clientStreaming;\n                if (message.serverStreaming != null && message.hasOwnProperty(\"serverStreaming\"))\n                    object.serverStreaming = message.serverStreaming;\n                return object;\n            };\n\n            /**\n             * Converts this MethodDescriptorProto to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MethodDescriptorProto.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for MethodDescriptorProto\n             * @function getTypeUrl\n             * @memberof google.protobuf.MethodDescriptorProto\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            MethodDescriptorProto.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.MethodDescriptorProto\";\n            };\n\n            return MethodDescriptorProto;\n        })();\n\n        protobuf.FileOptions = (function() {\n\n            /**\n             * Properties of a FileOptions.\n             * @memberof google.protobuf\n             * @interface IFileOptions\n             * @property {string|null} [javaPackage] FileOptions javaPackage\n             * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname\n             * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles\n             * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash\n             * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8\n             * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor\n             * @property {string|null} [goPackage] FileOptions goPackage\n             * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices\n             * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices\n             * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices\n             * @property {boolean|null} [deprecated] FileOptions deprecated\n             * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas\n             * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix\n             * @property {string|null} [csharpNamespace] FileOptions csharpNamespace\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FileOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new FileOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a FileOptions.\n             * @implements IFileOptions\n             * @constructor\n             * @param {google.protobuf.IFileOptions=} [properties] Properties to set\n             */\n            function FileOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FileOptions javaPackage.\n             * @member {string} javaPackage\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaPackage = \"\";\n\n            /**\n             * FileOptions javaOuterClassname.\n             * @member {string} javaOuterClassname\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaOuterClassname = \"\";\n\n            /**\n             * FileOptions javaMultipleFiles.\n             * @member {boolean} javaMultipleFiles\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaMultipleFiles = false;\n\n            /**\n             * FileOptions javaGenerateEqualsAndHash.\n             * @member {boolean} javaGenerateEqualsAndHash\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaGenerateEqualsAndHash = false;\n\n            /**\n             * FileOptions javaStringCheckUtf8.\n             * @member {boolean} javaStringCheckUtf8\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaStringCheckUtf8 = false;\n\n            /**\n             * FileOptions optimizeFor.\n             * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.optimizeFor = 1;\n\n            /**\n             * FileOptions goPackage.\n             * @member {string} goPackage\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.goPackage = \"\";\n\n            /**\n             * FileOptions ccGenericServices.\n             * @member {boolean} ccGenericServices\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.ccGenericServices = false;\n\n            /**\n             * FileOptions javaGenericServices.\n             * @member {boolean} javaGenericServices\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.javaGenericServices = false;\n\n            /**\n             * FileOptions pyGenericServices.\n             * @member {boolean} pyGenericServices\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.pyGenericServices = false;\n\n            /**\n             * FileOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.deprecated = false;\n\n            /**\n             * FileOptions ccEnableArenas.\n             * @member {boolean} ccEnableArenas\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.ccEnableArenas = false;\n\n            /**\n             * FileOptions objcClassPrefix.\n             * @member {string} objcClassPrefix\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.objcClassPrefix = \"\";\n\n            /**\n             * FileOptions csharpNamespace.\n             * @member {string} csharpNamespace\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.csharpNamespace = \"\";\n\n            /**\n             * FileOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             */\n            FileOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new FileOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.IFileOptions=} [properties] Properties to set\n             * @returns {google.protobuf.FileOptions} FileOptions instance\n             */\n            FileOptions.create = function create(properties) {\n                return new FileOptions(properties);\n            };\n\n            /**\n             * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.javaPackage != null && Object.hasOwnProperty.call(message, \"javaPackage\"))\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage);\n                if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, \"javaOuterClassname\"))\n                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname);\n                if (message.optimizeFor != null && Object.hasOwnProperty.call(message, \"optimizeFor\"))\n                    writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor);\n                if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, \"javaMultipleFiles\"))\n                    writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles);\n                if (message.goPackage != null && Object.hasOwnProperty.call(message, \"goPackage\"))\n                    writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage);\n                if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, \"ccGenericServices\"))\n                    writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices);\n                if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, \"javaGenericServices\"))\n                    writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices);\n                if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, \"pyGenericServices\"))\n                    writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices);\n                if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, \"javaGenerateEqualsAndHash\"))\n                    writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash);\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated);\n                if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, \"javaStringCheckUtf8\"))\n                    writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8);\n                if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, \"ccEnableArenas\"))\n                    writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas);\n                if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, \"objcClassPrefix\"))\n                    writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix);\n                if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, \"csharpNamespace\"))\n                    writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FileOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FileOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FileOptions} FileOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FileOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.javaPackage = reader.string();\n                        break;\n                    case 8:\n                        message.javaOuterClassname = reader.string();\n                        break;\n                    case 10:\n                        message.javaMultipleFiles = reader.bool();\n                        break;\n                    case 20:\n                        message.javaGenerateEqualsAndHash = reader.bool();\n                        break;\n                    case 27:\n                        message.javaStringCheckUtf8 = reader.bool();\n                        break;\n                    case 9:\n                        message.optimizeFor = reader.int32();\n                        break;\n                    case 11:\n                        message.goPackage = reader.string();\n                        break;\n                    case 16:\n                        message.ccGenericServices = reader.bool();\n                        break;\n                    case 17:\n                        message.javaGenericServices = reader.bool();\n                        break;\n                    case 18:\n                        message.pyGenericServices = reader.bool();\n                        break;\n                    case 23:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 31:\n                        message.ccEnableArenas = reader.bool();\n                        break;\n                    case 36:\n                        message.objcClassPrefix = reader.string();\n                        break;\n                    case 37:\n                        message.csharpNamespace = reader.string();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FileOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FileOptions} FileOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FileOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FileOptions message.\n             * @function verify\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FileOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n                    if (!$util.isString(message.javaPackage))\n                        return \"javaPackage: string expected\";\n                if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n                    if (!$util.isString(message.javaOuterClassname))\n                        return \"javaOuterClassname: string expected\";\n                if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n                    if (typeof message.javaMultipleFiles !== \"boolean\")\n                        return \"javaMultipleFiles: boolean expected\";\n                if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n                    if (typeof message.javaGenerateEqualsAndHash !== \"boolean\")\n                        return \"javaGenerateEqualsAndHash: boolean expected\";\n                if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n                    if (typeof message.javaStringCheckUtf8 !== \"boolean\")\n                        return \"javaStringCheckUtf8: boolean expected\";\n                if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n                    switch (message.optimizeFor) {\n                    default:\n                        return \"optimizeFor: enum value expected\";\n                    case 1:\n                    case 2:\n                    case 3:\n                        break;\n                    }\n                if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n                    if (!$util.isString(message.goPackage))\n                        return \"goPackage: string expected\";\n                if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n                    if (typeof message.ccGenericServices !== \"boolean\")\n                        return \"ccGenericServices: boolean expected\";\n                if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n                    if (typeof message.javaGenericServices !== \"boolean\")\n                        return \"javaGenericServices: boolean expected\";\n                if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n                    if (typeof message.pyGenericServices !== \"boolean\")\n                        return \"pyGenericServices: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n                    if (typeof message.ccEnableArenas !== \"boolean\")\n                        return \"ccEnableArenas: boolean expected\";\n                if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n                    if (!$util.isString(message.objcClassPrefix))\n                        return \"objcClassPrefix: string expected\";\n                if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n                    if (!$util.isString(message.csharpNamespace))\n                        return \"csharpNamespace: string expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FileOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FileOptions} FileOptions\n             */\n            FileOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FileOptions)\n                    return object;\n                var message = new $root.google.protobuf.FileOptions();\n                if (object.javaPackage != null)\n                    message.javaPackage = String(object.javaPackage);\n                if (object.javaOuterClassname != null)\n                    message.javaOuterClassname = String(object.javaOuterClassname);\n                if (object.javaMultipleFiles != null)\n                    message.javaMultipleFiles = Boolean(object.javaMultipleFiles);\n                if (object.javaGenerateEqualsAndHash != null)\n                    message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash);\n                if (object.javaStringCheckUtf8 != null)\n                    message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8);\n                switch (object.optimizeFor) {\n                case \"SPEED\":\n                case 1:\n                    message.optimizeFor = 1;\n                    break;\n                case \"CODE_SIZE\":\n                case 2:\n                    message.optimizeFor = 2;\n                    break;\n                case \"LITE_RUNTIME\":\n                case 3:\n                    message.optimizeFor = 3;\n                    break;\n                }\n                if (object.goPackage != null)\n                    message.goPackage = String(object.goPackage);\n                if (object.ccGenericServices != null)\n                    message.ccGenericServices = Boolean(object.ccGenericServices);\n                if (object.javaGenericServices != null)\n                    message.javaGenericServices = Boolean(object.javaGenericServices);\n                if (object.pyGenericServices != null)\n                    message.pyGenericServices = Boolean(object.pyGenericServices);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.ccEnableArenas != null)\n                    message.ccEnableArenas = Boolean(object.ccEnableArenas);\n                if (object.objcClassPrefix != null)\n                    message.objcClassPrefix = String(object.objcClassPrefix);\n                if (object.csharpNamespace != null)\n                    message.csharpNamespace = String(object.csharpNamespace);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.FileOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FileOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FileOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {google.protobuf.FileOptions} message FileOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FileOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.javaPackage = \"\";\n                    object.javaOuterClassname = \"\";\n                    object.optimizeFor = options.enums === String ? \"SPEED\" : 1;\n                    object.javaMultipleFiles = false;\n                    object.goPackage = \"\";\n                    object.ccGenericServices = false;\n                    object.javaGenericServices = false;\n                    object.pyGenericServices = false;\n                    object.javaGenerateEqualsAndHash = false;\n                    object.deprecated = false;\n                    object.javaStringCheckUtf8 = false;\n                    object.ccEnableArenas = false;\n                    object.objcClassPrefix = \"\";\n                    object.csharpNamespace = \"\";\n                }\n                if (message.javaPackage != null && message.hasOwnProperty(\"javaPackage\"))\n                    object.javaPackage = message.javaPackage;\n                if (message.javaOuterClassname != null && message.hasOwnProperty(\"javaOuterClassname\"))\n                    object.javaOuterClassname = message.javaOuterClassname;\n                if (message.optimizeFor != null && message.hasOwnProperty(\"optimizeFor\"))\n                    object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor;\n                if (message.javaMultipleFiles != null && message.hasOwnProperty(\"javaMultipleFiles\"))\n                    object.javaMultipleFiles = message.javaMultipleFiles;\n                if (message.goPackage != null && message.hasOwnProperty(\"goPackage\"))\n                    object.goPackage = message.goPackage;\n                if (message.ccGenericServices != null && message.hasOwnProperty(\"ccGenericServices\"))\n                    object.ccGenericServices = message.ccGenericServices;\n                if (message.javaGenericServices != null && message.hasOwnProperty(\"javaGenericServices\"))\n                    object.javaGenericServices = message.javaGenericServices;\n                if (message.pyGenericServices != null && message.hasOwnProperty(\"pyGenericServices\"))\n                    object.pyGenericServices = message.pyGenericServices;\n                if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty(\"javaGenerateEqualsAndHash\"))\n                    object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.javaStringCheckUtf8 != null && message.hasOwnProperty(\"javaStringCheckUtf8\"))\n                    object.javaStringCheckUtf8 = message.javaStringCheckUtf8;\n                if (message.ccEnableArenas != null && message.hasOwnProperty(\"ccEnableArenas\"))\n                    object.ccEnableArenas = message.ccEnableArenas;\n                if (message.objcClassPrefix != null && message.hasOwnProperty(\"objcClassPrefix\"))\n                    object.objcClassPrefix = message.objcClassPrefix;\n                if (message.csharpNamespace != null && message.hasOwnProperty(\"csharpNamespace\"))\n                    object.csharpNamespace = message.csharpNamespace;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this FileOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FileOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FileOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for FileOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.FileOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            FileOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.FileOptions\";\n            };\n\n            /**\n             * OptimizeMode enum.\n             * @name google.protobuf.FileOptions.OptimizeMode\n             * @enum {number}\n             * @property {number} SPEED=1 SPEED value\n             * @property {number} CODE_SIZE=2 CODE_SIZE value\n             * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value\n             */\n            FileOptions.OptimizeMode = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[1] = \"SPEED\"] = 1;\n                values[valuesById[2] = \"CODE_SIZE\"] = 2;\n                values[valuesById[3] = \"LITE_RUNTIME\"] = 3;\n                return values;\n            })();\n\n            return FileOptions;\n        })();\n\n        protobuf.MessageOptions = (function() {\n\n            /**\n             * Properties of a MessageOptions.\n             * @memberof google.protobuf\n             * @interface IMessageOptions\n             * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat\n             * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor\n             * @property {boolean|null} [deprecated] MessageOptions deprecated\n             * @property {boolean|null} [mapEntry] MessageOptions mapEntry\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MessageOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new MessageOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a MessageOptions.\n             * @implements IMessageOptions\n             * @constructor\n             * @param {google.protobuf.IMessageOptions=} [properties] Properties to set\n             */\n            function MessageOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MessageOptions messageSetWireFormat.\n             * @member {boolean} messageSetWireFormat\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.messageSetWireFormat = false;\n\n            /**\n             * MessageOptions noStandardDescriptorAccessor.\n             * @member {boolean} noStandardDescriptorAccessor\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.noStandardDescriptorAccessor = false;\n\n            /**\n             * MessageOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.deprecated = false;\n\n            /**\n             * MessageOptions mapEntry.\n             * @member {boolean} mapEntry\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.mapEntry = false;\n\n            /**\n             * MessageOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             */\n            MessageOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new MessageOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.IMessageOptions=} [properties] Properties to set\n             * @returns {google.protobuf.MessageOptions} MessageOptions instance\n             */\n            MessageOptions.create = function create(properties) {\n                return new MessageOptions(properties);\n            };\n\n            /**\n             * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MessageOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, \"messageSetWireFormat\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat);\n                if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, \"noStandardDescriptorAccessor\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor);\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n                if (message.mapEntry != null && Object.hasOwnProperty.call(message, \"mapEntry\"))\n                    writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MessageOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MessageOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.MessageOptions} MessageOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MessageOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MessageOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.messageSetWireFormat = reader.bool();\n                        break;\n                    case 2:\n                        message.noStandardDescriptorAccessor = reader.bool();\n                        break;\n                    case 3:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 7:\n                        message.mapEntry = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MessageOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.MessageOptions} MessageOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MessageOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MessageOptions message.\n             * @function verify\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MessageOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n                    if (typeof message.messageSetWireFormat !== \"boolean\")\n                        return \"messageSetWireFormat: boolean expected\";\n                if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n                    if (typeof message.noStandardDescriptorAccessor !== \"boolean\")\n                        return \"noStandardDescriptorAccessor: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n                    if (typeof message.mapEntry !== \"boolean\")\n                        return \"mapEntry: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.MessageOptions} MessageOptions\n             */\n            MessageOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.MessageOptions)\n                    return object;\n                var message = new $root.google.protobuf.MessageOptions();\n                if (object.messageSetWireFormat != null)\n                    message.messageSetWireFormat = Boolean(object.messageSetWireFormat);\n                if (object.noStandardDescriptorAccessor != null)\n                    message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.mapEntry != null)\n                    message.mapEntry = Boolean(object.mapEntry);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.MessageOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.MessageOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MessageOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {google.protobuf.MessageOptions} message MessageOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MessageOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.messageSetWireFormat = false;\n                    object.noStandardDescriptorAccessor = false;\n                    object.deprecated = false;\n                    object.mapEntry = false;\n                }\n                if (message.messageSetWireFormat != null && message.hasOwnProperty(\"messageSetWireFormat\"))\n                    object.messageSetWireFormat = message.messageSetWireFormat;\n                if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty(\"noStandardDescriptorAccessor\"))\n                    object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.mapEntry != null && message.hasOwnProperty(\"mapEntry\"))\n                    object.mapEntry = message.mapEntry;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this MessageOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.MessageOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MessageOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for MessageOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.MessageOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            MessageOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.MessageOptions\";\n            };\n\n            return MessageOptions;\n        })();\n\n        protobuf.FieldOptions = (function() {\n\n            /**\n             * Properties of a FieldOptions.\n             * @memberof google.protobuf\n             * @interface IFieldOptions\n             * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype\n             * @property {boolean|null} [packed] FieldOptions packed\n             * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype\n             * @property {boolean|null} [lazy] FieldOptions lazy\n             * @property {boolean|null} [deprecated] FieldOptions deprecated\n             * @property {boolean|null} [weak] FieldOptions weak\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] FieldOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new FieldOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a FieldOptions.\n             * @implements IFieldOptions\n             * @constructor\n             * @param {google.protobuf.IFieldOptions=} [properties] Properties to set\n             */\n            function FieldOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * FieldOptions ctype.\n             * @member {google.protobuf.FieldOptions.CType} ctype\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.ctype = 0;\n\n            /**\n             * FieldOptions packed.\n             * @member {boolean} packed\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.packed = false;\n\n            /**\n             * FieldOptions jstype.\n             * @member {google.protobuf.FieldOptions.JSType} jstype\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.jstype = 0;\n\n            /**\n             * FieldOptions lazy.\n             * @member {boolean} lazy\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.lazy = false;\n\n            /**\n             * FieldOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.deprecated = false;\n\n            /**\n             * FieldOptions weak.\n             * @member {boolean} weak\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.weak = false;\n\n            /**\n             * FieldOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             */\n            FieldOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new FieldOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.IFieldOptions=} [properties] Properties to set\n             * @returns {google.protobuf.FieldOptions} FieldOptions instance\n             */\n            FieldOptions.create = function create(properties) {\n                return new FieldOptions(properties);\n            };\n\n            /**\n             * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.ctype != null && Object.hasOwnProperty.call(message, \"ctype\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype);\n                if (message.packed != null && Object.hasOwnProperty.call(message, \"packed\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed);\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n                if (message.lazy != null && Object.hasOwnProperty.call(message, \"lazy\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy);\n                if (message.jstype != null && Object.hasOwnProperty.call(message, \"jstype\"))\n                    writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype);\n                if (message.weak != null && Object.hasOwnProperty.call(message, \"weak\"))\n                    writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            FieldOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a FieldOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.FieldOptions} FieldOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FieldOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.ctype = reader.int32();\n                        break;\n                    case 2:\n                        message.packed = reader.bool();\n                        break;\n                    case 6:\n                        message.jstype = reader.int32();\n                        break;\n                    case 5:\n                        message.lazy = reader.bool();\n                        break;\n                    case 3:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 10:\n                        message.weak = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a FieldOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.FieldOptions} FieldOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            FieldOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a FieldOptions message.\n             * @function verify\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            FieldOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n                    switch (message.ctype) {\n                    default:\n                        return \"ctype: enum value expected\";\n                    case 0:\n                    case 1:\n                    case 2:\n                        break;\n                    }\n                if (message.packed != null && message.hasOwnProperty(\"packed\"))\n                    if (typeof message.packed !== \"boolean\")\n                        return \"packed: boolean expected\";\n                if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n                    switch (message.jstype) {\n                    default:\n                        return \"jstype: enum value expected\";\n                    case 0:\n                    case 1:\n                    case 2:\n                        break;\n                    }\n                if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n                    if (typeof message.lazy !== \"boolean\")\n                        return \"lazy: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.weak != null && message.hasOwnProperty(\"weak\"))\n                    if (typeof message.weak !== \"boolean\")\n                        return \"weak: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.FieldOptions} FieldOptions\n             */\n            FieldOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.FieldOptions)\n                    return object;\n                var message = new $root.google.protobuf.FieldOptions();\n                switch (object.ctype) {\n                case \"STRING\":\n                case 0:\n                    message.ctype = 0;\n                    break;\n                case \"CORD\":\n                case 1:\n                    message.ctype = 1;\n                    break;\n                case \"STRING_PIECE\":\n                case 2:\n                    message.ctype = 2;\n                    break;\n                }\n                if (object.packed != null)\n                    message.packed = Boolean(object.packed);\n                switch (object.jstype) {\n                case \"JS_NORMAL\":\n                case 0:\n                    message.jstype = 0;\n                    break;\n                case \"JS_STRING\":\n                case 1:\n                    message.jstype = 1;\n                    break;\n                case \"JS_NUMBER\":\n                case 2:\n                    message.jstype = 2;\n                    break;\n                }\n                if (object.lazy != null)\n                    message.lazy = Boolean(object.lazy);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.weak != null)\n                    message.weak = Boolean(object.weak);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.FieldOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.FieldOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a FieldOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {google.protobuf.FieldOptions} message FieldOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            FieldOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.ctype = options.enums === String ? \"STRING\" : 0;\n                    object.packed = false;\n                    object.deprecated = false;\n                    object.lazy = false;\n                    object.jstype = options.enums === String ? \"JS_NORMAL\" : 0;\n                    object.weak = false;\n                }\n                if (message.ctype != null && message.hasOwnProperty(\"ctype\"))\n                    object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype;\n                if (message.packed != null && message.hasOwnProperty(\"packed\"))\n                    object.packed = message.packed;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.lazy != null && message.hasOwnProperty(\"lazy\"))\n                    object.lazy = message.lazy;\n                if (message.jstype != null && message.hasOwnProperty(\"jstype\"))\n                    object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype;\n                if (message.weak != null && message.hasOwnProperty(\"weak\"))\n                    object.weak = message.weak;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this FieldOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.FieldOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            FieldOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for FieldOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.FieldOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.FieldOptions\";\n            };\n\n            /**\n             * CType enum.\n             * @name google.protobuf.FieldOptions.CType\n             * @enum {number}\n             * @property {number} STRING=0 STRING value\n             * @property {number} CORD=1 CORD value\n             * @property {number} STRING_PIECE=2 STRING_PIECE value\n             */\n            FieldOptions.CType = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[0] = \"STRING\"] = 0;\n                values[valuesById[1] = \"CORD\"] = 1;\n                values[valuesById[2] = \"STRING_PIECE\"] = 2;\n                return values;\n            })();\n\n            /**\n             * JSType enum.\n             * @name google.protobuf.FieldOptions.JSType\n             * @enum {number}\n             * @property {number} JS_NORMAL=0 JS_NORMAL value\n             * @property {number} JS_STRING=1 JS_STRING value\n             * @property {number} JS_NUMBER=2 JS_NUMBER value\n             */\n            FieldOptions.JSType = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[0] = \"JS_NORMAL\"] = 0;\n                values[valuesById[1] = \"JS_STRING\"] = 1;\n                values[valuesById[2] = \"JS_NUMBER\"] = 2;\n                return values;\n            })();\n\n            return FieldOptions;\n        })();\n\n        protobuf.OneofOptions = (function() {\n\n            /**\n             * Properties of an OneofOptions.\n             * @memberof google.protobuf\n             * @interface IOneofOptions\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] OneofOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new OneofOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents an OneofOptions.\n             * @implements IOneofOptions\n             * @constructor\n             * @param {google.protobuf.IOneofOptions=} [properties] Properties to set\n             */\n            function OneofOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * OneofOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.OneofOptions\n             * @instance\n             */\n            OneofOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new OneofOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.IOneofOptions=} [properties] Properties to set\n             * @returns {google.protobuf.OneofOptions} OneofOptions instance\n             */\n            OneofOptions.create = function create(properties) {\n                return new OneofOptions(properties);\n            };\n\n            /**\n             * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            OneofOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an OneofOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.OneofOptions} OneofOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.OneofOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an OneofOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.OneofOptions} OneofOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            OneofOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an OneofOptions message.\n             * @function verify\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            OneofOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.OneofOptions} OneofOptions\n             */\n            OneofOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.OneofOptions)\n                    return object;\n                var message = new $root.google.protobuf.OneofOptions();\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.OneofOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.OneofOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an OneofOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {google.protobuf.OneofOptions} message OneofOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            OneofOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this OneofOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.OneofOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            OneofOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for OneofOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.OneofOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            OneofOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.OneofOptions\";\n            };\n\n            return OneofOptions;\n        })();\n\n        protobuf.EnumOptions = (function() {\n\n            /**\n             * Properties of an EnumOptions.\n             * @memberof google.protobuf\n             * @interface IEnumOptions\n             * @property {boolean|null} [allowAlias] EnumOptions allowAlias\n             * @property {boolean|null} [deprecated] EnumOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumOptions uninterpretedOption\n             * @property {string|null} [\".jspb.test.IsExtension.simpleOption\"] EnumOptions .jspb.test.IsExtension.simpleOption\n             */\n\n            /**\n             * Constructs a new EnumOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumOptions.\n             * @implements IEnumOptions\n             * @constructor\n             * @param {google.protobuf.IEnumOptions=} [properties] Properties to set\n             */\n            function EnumOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumOptions allowAlias.\n             * @member {boolean} allowAlias\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype.allowAlias = false;\n\n            /**\n             * EnumOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype.deprecated = false;\n\n            /**\n             * EnumOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * EnumOptions .jspb.test.IsExtension.simpleOption.\n             * @member {string} .jspb.test.IsExtension.simpleOption\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             */\n            EnumOptions.prototype[\".jspb.test.IsExtension.simpleOption\"] = \"\";\n\n            /**\n             * Creates a new EnumOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.IEnumOptions=} [properties] Properties to set\n             * @returns {google.protobuf.EnumOptions} EnumOptions instance\n             */\n            EnumOptions.create = function create(properties) {\n                return new EnumOptions(properties);\n            };\n\n            /**\n             * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.allowAlias != null && Object.hasOwnProperty.call(message, \"allowAlias\"))\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias);\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                if (message[\".jspb.test.IsExtension.simpleOption\"] != null && Object.hasOwnProperty.call(message, \".jspb.test.IsExtension.simpleOption\"))\n                    writer.uint32(/* id 42113038, wireType 2 =*/336904306).string(message[\".jspb.test.IsExtension.simpleOption\"]);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumOptions} EnumOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 2:\n                        message.allowAlias = reader.bool();\n                        break;\n                    case 3:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    case 42113038:\n                        message[\".jspb.test.IsExtension.simpleOption\"] = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumOptions} EnumOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumOptions message.\n             * @function verify\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n                    if (typeof message.allowAlias !== \"boolean\")\n                        return \"allowAlias: boolean expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                if (message[\".jspb.test.IsExtension.simpleOption\"] != null && message.hasOwnProperty(\".jspb.test.IsExtension.simpleOption\"))\n                    if (!$util.isString(message[\".jspb.test.IsExtension.simpleOption\"]))\n                        return \".jspb.test.IsExtension.simpleOption: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumOptions} EnumOptions\n             */\n            EnumOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumOptions)\n                    return object;\n                var message = new $root.google.protobuf.EnumOptions();\n                if (object.allowAlias != null)\n                    message.allowAlias = Boolean(object.allowAlias);\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.EnumOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.EnumOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                if (object[\".jspb.test.IsExtension.simpleOption\"] != null)\n                    message[\".jspb.test.IsExtension.simpleOption\"] = String(object[\".jspb.test.IsExtension.simpleOption\"]);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {google.protobuf.EnumOptions} message EnumOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.allowAlias = false;\n                    object.deprecated = false;\n                    object[\".jspb.test.IsExtension.simpleOption\"] = \"\";\n                }\n                if (message.allowAlias != null && message.hasOwnProperty(\"allowAlias\"))\n                    object.allowAlias = message.allowAlias;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                if (message[\".jspb.test.IsExtension.simpleOption\"] != null && message.hasOwnProperty(\".jspb.test.IsExtension.simpleOption\"))\n                    object[\".jspb.test.IsExtension.simpleOption\"] = message[\".jspb.test.IsExtension.simpleOption\"];\n                return object;\n            };\n\n            /**\n             * Converts this EnumOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for EnumOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.EnumOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            EnumOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.EnumOptions\";\n            };\n\n            return EnumOptions;\n        })();\n\n        protobuf.EnumValueOptions = (function() {\n\n            /**\n             * Properties of an EnumValueOptions.\n             * @memberof google.protobuf\n             * @interface IEnumValueOptions\n             * @property {boolean|null} [deprecated] EnumValueOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] EnumValueOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new EnumValueOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents an EnumValueOptions.\n             * @implements IEnumValueOptions\n             * @constructor\n             * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set\n             */\n            function EnumValueOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * EnumValueOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.EnumValueOptions\n             * @instance\n             */\n            EnumValueOptions.prototype.deprecated = false;\n\n            /**\n             * EnumValueOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.EnumValueOptions\n             * @instance\n             */\n            EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new EnumValueOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance\n             */\n            EnumValueOptions.create = function create(properties) {\n                return new EnumValueOptions(properties);\n            };\n\n            /**\n             * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an EnumValueOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.EnumValueOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            EnumValueOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an EnumValueOptions message.\n             * @function verify\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            EnumValueOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.EnumValueOptions} EnumValueOptions\n             */\n            EnumValueOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.EnumValueOptions)\n                    return object;\n                var message = new $root.google.protobuf.EnumValueOptions();\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.EnumValueOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.EnumValueOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {google.protobuf.EnumValueOptions} message EnumValueOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            EnumValueOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults)\n                    object.deprecated = false;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this EnumValueOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.EnumValueOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            EnumValueOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for EnumValueOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.EnumValueOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            EnumValueOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.EnumValueOptions\";\n            };\n\n            return EnumValueOptions;\n        })();\n\n        protobuf.ServiceOptions = (function() {\n\n            /**\n             * Properties of a ServiceOptions.\n             * @memberof google.protobuf\n             * @interface IServiceOptions\n             * @property {boolean|null} [deprecated] ServiceOptions deprecated\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] ServiceOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new ServiceOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a ServiceOptions.\n             * @implements IServiceOptions\n             * @constructor\n             * @param {google.protobuf.IServiceOptions=} [properties] Properties to set\n             */\n            function ServiceOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * ServiceOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             */\n            ServiceOptions.prototype.deprecated = false;\n\n            /**\n             * ServiceOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             */\n            ServiceOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new ServiceOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.IServiceOptions=} [properties] Properties to set\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions instance\n             */\n            ServiceOptions.create = function create(properties) {\n                return new ServiceOptions(properties);\n            };\n\n            /**\n             * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a ServiceOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ServiceOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 33:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a ServiceOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            ServiceOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a ServiceOptions message.\n             * @function verify\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            ServiceOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.ServiceOptions} ServiceOptions\n             */\n            ServiceOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.ServiceOptions)\n                    return object;\n                var message = new $root.google.protobuf.ServiceOptions();\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.ServiceOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.ServiceOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {google.protobuf.ServiceOptions} message ServiceOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            ServiceOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults)\n                    object.deprecated = false;\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this ServiceOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.ServiceOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            ServiceOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for ServiceOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.ServiceOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            ServiceOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.ServiceOptions\";\n            };\n\n            return ServiceOptions;\n        })();\n\n        protobuf.MethodOptions = (function() {\n\n            /**\n             * Properties of a MethodOptions.\n             * @memberof google.protobuf\n             * @interface IMethodOptions\n             * @property {boolean|null} [deprecated] MethodOptions deprecated\n             * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel\n             * @property {Array.<google.protobuf.IUninterpretedOption>|null} [uninterpretedOption] MethodOptions uninterpretedOption\n             */\n\n            /**\n             * Constructs a new MethodOptions.\n             * @memberof google.protobuf\n             * @classdesc Represents a MethodOptions.\n             * @implements IMethodOptions\n             * @constructor\n             * @param {google.protobuf.IMethodOptions=} [properties] Properties to set\n             */\n            function MethodOptions(properties) {\n                this.uninterpretedOption = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * MethodOptions deprecated.\n             * @member {boolean} deprecated\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             */\n            MethodOptions.prototype.deprecated = false;\n\n            /**\n             * MethodOptions idempotencyLevel.\n             * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             */\n            MethodOptions.prototype.idempotencyLevel = 0;\n\n            /**\n             * MethodOptions uninterpretedOption.\n             * @member {Array.<google.protobuf.IUninterpretedOption>} uninterpretedOption\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             */\n            MethodOptions.prototype.uninterpretedOption = $util.emptyArray;\n\n            /**\n             * Creates a new MethodOptions instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.IMethodOptions=} [properties] Properties to set\n             * @returns {google.protobuf.MethodOptions} MethodOptions instance\n             */\n            MethodOptions.create = function create(properties) {\n                return new MethodOptions(properties);\n            };\n\n            /**\n             * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodOptions.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.deprecated != null && Object.hasOwnProperty.call(message, \"deprecated\"))\n                    writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated);\n                if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, \"idempotencyLevel\"))\n                    writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel);\n                if (message.uninterpretedOption != null && message.uninterpretedOption.length)\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            MethodOptions.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a MethodOptions message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.MethodOptions} MethodOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodOptions.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.MethodOptions();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 33:\n                        message.deprecated = reader.bool();\n                        break;\n                    case 34:\n                        message.idempotencyLevel = reader.int32();\n                        break;\n                    case 999:\n                        if (!(message.uninterpretedOption && message.uninterpretedOption.length))\n                            message.uninterpretedOption = [];\n                        message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a MethodOptions message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.MethodOptions} MethodOptions\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            MethodOptions.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a MethodOptions message.\n             * @function verify\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            MethodOptions.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    if (typeof message.deprecated !== \"boolean\")\n                        return \"deprecated: boolean expected\";\n                if (message.idempotencyLevel != null && message.hasOwnProperty(\"idempotencyLevel\"))\n                    switch (message.idempotencyLevel) {\n                    default:\n                        return \"idempotencyLevel: enum value expected\";\n                    case 0:\n                    case 1:\n                    case 2:\n                        break;\n                    }\n                if (message.uninterpretedOption != null && message.hasOwnProperty(\"uninterpretedOption\")) {\n                    if (!Array.isArray(message.uninterpretedOption))\n                        return \"uninterpretedOption: array expected\";\n                    for (var i = 0; i < message.uninterpretedOption.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]);\n                        if (error)\n                            return \"uninterpretedOption.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.MethodOptions} MethodOptions\n             */\n            MethodOptions.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.MethodOptions)\n                    return object;\n                var message = new $root.google.protobuf.MethodOptions();\n                if (object.deprecated != null)\n                    message.deprecated = Boolean(object.deprecated);\n                switch (object.idempotencyLevel) {\n                case \"IDEMPOTENCY_UNKNOWN\":\n                case 0:\n                    message.idempotencyLevel = 0;\n                    break;\n                case \"NO_SIDE_EFFECTS\":\n                case 1:\n                    message.idempotencyLevel = 1;\n                    break;\n                case \"IDEMPOTENT\":\n                case 2:\n                    message.idempotencyLevel = 2;\n                    break;\n                }\n                if (object.uninterpretedOption) {\n                    if (!Array.isArray(object.uninterpretedOption))\n                        throw TypeError(\".google.protobuf.MethodOptions.uninterpretedOption: array expected\");\n                    message.uninterpretedOption = [];\n                    for (var i = 0; i < object.uninterpretedOption.length; ++i) {\n                        if (typeof object.uninterpretedOption[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.MethodOptions.uninterpretedOption: object expected\");\n                        message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a MethodOptions message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {google.protobuf.MethodOptions} message MethodOptions\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            MethodOptions.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.uninterpretedOption = [];\n                if (options.defaults) {\n                    object.deprecated = false;\n                    object.idempotencyLevel = options.enums === String ? \"IDEMPOTENCY_UNKNOWN\" : 0;\n                }\n                if (message.deprecated != null && message.hasOwnProperty(\"deprecated\"))\n                    object.deprecated = message.deprecated;\n                if (message.idempotencyLevel != null && message.hasOwnProperty(\"idempotencyLevel\"))\n                    object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel;\n                if (message.uninterpretedOption && message.uninterpretedOption.length) {\n                    object.uninterpretedOption = [];\n                    for (var j = 0; j < message.uninterpretedOption.length; ++j)\n                        object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this MethodOptions to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.MethodOptions\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            MethodOptions.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for MethodOptions\n             * @function getTypeUrl\n             * @memberof google.protobuf.MethodOptions\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            MethodOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.MethodOptions\";\n            };\n\n            /**\n             * IdempotencyLevel enum.\n             * @name google.protobuf.MethodOptions.IdempotencyLevel\n             * @enum {number}\n             * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value\n             * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value\n             * @property {number} IDEMPOTENT=2 IDEMPOTENT value\n             */\n            MethodOptions.IdempotencyLevel = (function() {\n                var valuesById = {}, values = Object.create(valuesById);\n                values[valuesById[0] = \"IDEMPOTENCY_UNKNOWN\"] = 0;\n                values[valuesById[1] = \"NO_SIDE_EFFECTS\"] = 1;\n                values[valuesById[2] = \"IDEMPOTENT\"] = 2;\n                return values;\n            })();\n\n            return MethodOptions;\n        })();\n\n        protobuf.UninterpretedOption = (function() {\n\n            /**\n             * Properties of an UninterpretedOption.\n             * @memberof google.protobuf\n             * @interface IUninterpretedOption\n             * @property {Array.<google.protobuf.UninterpretedOption.INamePart>|null} [name] UninterpretedOption name\n             * @property {string|null} [identifierValue] UninterpretedOption identifierValue\n             * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue\n             * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue\n             * @property {number|null} [doubleValue] UninterpretedOption doubleValue\n             * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue\n             * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue\n             */\n\n            /**\n             * Constructs a new UninterpretedOption.\n             * @memberof google.protobuf\n             * @classdesc Represents an UninterpretedOption.\n             * @implements IUninterpretedOption\n             * @constructor\n             * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set\n             */\n            function UninterpretedOption(properties) {\n                this.name = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * UninterpretedOption name.\n             * @member {Array.<google.protobuf.UninterpretedOption.INamePart>} name\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.name = $util.emptyArray;\n\n            /**\n             * UninterpretedOption identifierValue.\n             * @member {string} identifierValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.identifierValue = \"\";\n\n            /**\n             * UninterpretedOption positiveIntValue.\n             * @member {number|Long} positiveIntValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0;\n\n            /**\n             * UninterpretedOption negativeIntValue.\n             * @member {number|Long} negativeIntValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0;\n\n            /**\n             * UninterpretedOption doubleValue.\n             * @member {number} doubleValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.doubleValue = 0;\n\n            /**\n             * UninterpretedOption stringValue.\n             * @member {Uint8Array} stringValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.stringValue = $util.newBuffer([]);\n\n            /**\n             * UninterpretedOption aggregateValue.\n             * @member {string} aggregateValue\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             */\n            UninterpretedOption.prototype.aggregateValue = \"\";\n\n            /**\n             * Creates a new UninterpretedOption instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance\n             */\n            UninterpretedOption.create = function create(properties) {\n                return new UninterpretedOption(properties);\n            };\n\n            /**\n             * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            UninterpretedOption.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.name != null && message.name.length)\n                    for (var i = 0; i < message.name.length; ++i)\n                        $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();\n                if (message.identifierValue != null && Object.hasOwnProperty.call(message, \"identifierValue\"))\n                    writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue);\n                if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, \"positiveIntValue\"))\n                    writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue);\n                if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, \"negativeIntValue\"))\n                    writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue);\n                if (message.doubleValue != null && Object.hasOwnProperty.call(message, \"doubleValue\"))\n                    writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue);\n                if (message.stringValue != null && Object.hasOwnProperty.call(message, \"stringValue\"))\n                    writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue);\n                if (message.aggregateValue != null && Object.hasOwnProperty.call(message, \"aggregateValue\"))\n                    writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue);\n                return writer;\n            };\n\n            /**\n             * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes an UninterpretedOption message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            UninterpretedOption.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 2:\n                        if (!(message.name && message.name.length))\n                            message.name = [];\n                        message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32()));\n                        break;\n                    case 3:\n                        message.identifierValue = reader.string();\n                        break;\n                    case 4:\n                        message.positiveIntValue = reader.uint64();\n                        break;\n                    case 5:\n                        message.negativeIntValue = reader.int64();\n                        break;\n                    case 6:\n                        message.doubleValue = reader.double();\n                        break;\n                    case 7:\n                        message.stringValue = reader.bytes();\n                        break;\n                    case 8:\n                        message.aggregateValue = reader.string();\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            UninterpretedOption.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies an UninterpretedOption message.\n             * @function verify\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            UninterpretedOption.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.name != null && message.hasOwnProperty(\"name\")) {\n                    if (!Array.isArray(message.name))\n                        return \"name: array expected\";\n                    for (var i = 0; i < message.name.length; ++i) {\n                        var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]);\n                        if (error)\n                            return \"name.\" + error;\n                    }\n                }\n                if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n                    if (!$util.isString(message.identifierValue))\n                        return \"identifierValue: string expected\";\n                if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n                    if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high)))\n                        return \"positiveIntValue: integer|Long expected\";\n                if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n                    if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high)))\n                        return \"negativeIntValue: integer|Long expected\";\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    if (typeof message.doubleValue !== \"number\")\n                        return \"doubleValue: number expected\";\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    if (!(message.stringValue && typeof message.stringValue.length === \"number\" || $util.isString(message.stringValue)))\n                        return \"stringValue: buffer expected\";\n                if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n                    if (!$util.isString(message.aggregateValue))\n                        return \"aggregateValue: string expected\";\n                return null;\n            };\n\n            /**\n             * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.UninterpretedOption} UninterpretedOption\n             */\n            UninterpretedOption.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.UninterpretedOption)\n                    return object;\n                var message = new $root.google.protobuf.UninterpretedOption();\n                if (object.name) {\n                    if (!Array.isArray(object.name))\n                        throw TypeError(\".google.protobuf.UninterpretedOption.name: array expected\");\n                    message.name = [];\n                    for (var i = 0; i < object.name.length; ++i) {\n                        if (typeof object.name[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.UninterpretedOption.name: object expected\");\n                        message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]);\n                    }\n                }\n                if (object.identifierValue != null)\n                    message.identifierValue = String(object.identifierValue);\n                if (object.positiveIntValue != null)\n                    if ($util.Long)\n                        (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true;\n                    else if (typeof object.positiveIntValue === \"string\")\n                        message.positiveIntValue = parseInt(object.positiveIntValue, 10);\n                    else if (typeof object.positiveIntValue === \"number\")\n                        message.positiveIntValue = object.positiveIntValue;\n                    else if (typeof object.positiveIntValue === \"object\")\n                        message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true);\n                if (object.negativeIntValue != null)\n                    if ($util.Long)\n                        (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false;\n                    else if (typeof object.negativeIntValue === \"string\")\n                        message.negativeIntValue = parseInt(object.negativeIntValue, 10);\n                    else if (typeof object.negativeIntValue === \"number\")\n                        message.negativeIntValue = object.negativeIntValue;\n                    else if (typeof object.negativeIntValue === \"object\")\n                        message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber();\n                if (object.doubleValue != null)\n                    message.doubleValue = Number(object.doubleValue);\n                if (object.stringValue != null)\n                    if (typeof object.stringValue === \"string\")\n                        $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0);\n                    else if (object.stringValue.length >= 0)\n                        message.stringValue = object.stringValue;\n                if (object.aggregateValue != null)\n                    message.aggregateValue = String(object.aggregateValue);\n                return message;\n            };\n\n            /**\n             * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {google.protobuf.UninterpretedOption} message UninterpretedOption\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            UninterpretedOption.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.name = [];\n                if (options.defaults) {\n                    object.identifierValue = \"\";\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, true);\n                        object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.positiveIntValue = options.longs === String ? \"0\" : 0;\n                    if ($util.Long) {\n                        var long = new $util.Long(0, 0, false);\n                        object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;\n                    } else\n                        object.negativeIntValue = options.longs === String ? \"0\" : 0;\n                    object.doubleValue = 0;\n                    if (options.bytes === String)\n                        object.stringValue = \"\";\n                    else {\n                        object.stringValue = [];\n                        if (options.bytes !== Array)\n                            object.stringValue = $util.newBuffer(object.stringValue);\n                    }\n                    object.aggregateValue = \"\";\n                }\n                if (message.name && message.name.length) {\n                    object.name = [];\n                    for (var j = 0; j < message.name.length; ++j)\n                        object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options);\n                }\n                if (message.identifierValue != null && message.hasOwnProperty(\"identifierValue\"))\n                    object.identifierValue = message.identifierValue;\n                if (message.positiveIntValue != null && message.hasOwnProperty(\"positiveIntValue\"))\n                    if (typeof message.positiveIntValue === \"number\")\n                        object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue;\n                    else\n                        object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue;\n                if (message.negativeIntValue != null && message.hasOwnProperty(\"negativeIntValue\"))\n                    if (typeof message.negativeIntValue === \"number\")\n                        object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue;\n                    else\n                        object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue;\n                if (message.doubleValue != null && message.hasOwnProperty(\"doubleValue\"))\n                    object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue;\n                if (message.stringValue != null && message.hasOwnProperty(\"stringValue\"))\n                    object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue;\n                if (message.aggregateValue != null && message.hasOwnProperty(\"aggregateValue\"))\n                    object.aggregateValue = message.aggregateValue;\n                return object;\n            };\n\n            /**\n             * Converts this UninterpretedOption to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.UninterpretedOption\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            UninterpretedOption.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for UninterpretedOption\n             * @function getTypeUrl\n             * @memberof google.protobuf.UninterpretedOption\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            UninterpretedOption.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.UninterpretedOption\";\n            };\n\n            UninterpretedOption.NamePart = (function() {\n\n                /**\n                 * Properties of a NamePart.\n                 * @memberof google.protobuf.UninterpretedOption\n                 * @interface INamePart\n                 * @property {string} namePart NamePart namePart\n                 * @property {boolean} isExtension NamePart isExtension\n                 */\n\n                /**\n                 * Constructs a new NamePart.\n                 * @memberof google.protobuf.UninterpretedOption\n                 * @classdesc Represents a NamePart.\n                 * @implements INamePart\n                 * @constructor\n                 * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set\n                 */\n                function NamePart(properties) {\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * NamePart namePart.\n                 * @member {string} namePart\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @instance\n                 */\n                NamePart.prototype.namePart = \"\";\n\n                /**\n                 * NamePart isExtension.\n                 * @member {boolean} isExtension\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @instance\n                 */\n                NamePart.prototype.isExtension = false;\n\n                /**\n                 * Creates a new NamePart instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance\n                 */\n                NamePart.create = function create(properties) {\n                    return new NamePart(properties);\n                };\n\n                /**\n                 * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                NamePart.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart);\n                    writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                NamePart.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a NamePart message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                NamePart.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UninterpretedOption.NamePart();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            message.namePart = reader.string();\n                            break;\n                        case 2:\n                            message.isExtension = reader.bool();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    if (!message.hasOwnProperty(\"namePart\"))\n                        throw $util.ProtocolError(\"missing required 'namePart'\", { instance: message });\n                    if (!message.hasOwnProperty(\"isExtension\"))\n                        throw $util.ProtocolError(\"missing required 'isExtension'\", { instance: message });\n                    return message;\n                };\n\n                /**\n                 * Decodes a NamePart message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                NamePart.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a NamePart message.\n                 * @function verify\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                NamePart.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (!$util.isString(message.namePart))\n                        return \"namePart: string expected\";\n                    if (typeof message.isExtension !== \"boolean\")\n                        return \"isExtension: boolean expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates a NamePart message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart\n                 */\n                NamePart.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart)\n                        return object;\n                    var message = new $root.google.protobuf.UninterpretedOption.NamePart();\n                    if (object.namePart != null)\n                        message.namePart = String(object.namePart);\n                    if (object.isExtension != null)\n                        message.isExtension = Boolean(object.isExtension);\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a NamePart message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                NamePart.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.defaults) {\n                        object.namePart = \"\";\n                        object.isExtension = false;\n                    }\n                    if (message.namePart != null && message.hasOwnProperty(\"namePart\"))\n                        object.namePart = message.namePart;\n                    if (message.isExtension != null && message.hasOwnProperty(\"isExtension\"))\n                        object.isExtension = message.isExtension;\n                    return object;\n                };\n\n                /**\n                 * Converts this NamePart to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                NamePart.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for NamePart\n                 * @function getTypeUrl\n                 * @memberof google.protobuf.UninterpretedOption.NamePart\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                NamePart.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/google.protobuf.UninterpretedOption.NamePart\";\n                };\n\n                return NamePart;\n            })();\n\n            return UninterpretedOption;\n        })();\n\n        protobuf.SourceCodeInfo = (function() {\n\n            /**\n             * Properties of a SourceCodeInfo.\n             * @memberof google.protobuf\n             * @interface ISourceCodeInfo\n             * @property {Array.<google.protobuf.SourceCodeInfo.ILocation>|null} [location] SourceCodeInfo location\n             */\n\n            /**\n             * Constructs a new SourceCodeInfo.\n             * @memberof google.protobuf\n             * @classdesc Represents a SourceCodeInfo.\n             * @implements ISourceCodeInfo\n             * @constructor\n             * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set\n             */\n            function SourceCodeInfo(properties) {\n                this.location = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * SourceCodeInfo location.\n             * @member {Array.<google.protobuf.SourceCodeInfo.ILocation>} location\n             * @memberof google.protobuf.SourceCodeInfo\n             * @instance\n             */\n            SourceCodeInfo.prototype.location = $util.emptyArray;\n\n            /**\n             * Creates a new SourceCodeInfo instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance\n             */\n            SourceCodeInfo.create = function create(properties) {\n                return new SourceCodeInfo(properties);\n            };\n\n            /**\n             * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            SourceCodeInfo.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.location != null && message.location.length)\n                    for (var i = 0; i < message.location.length; ++i)\n                        $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a SourceCodeInfo message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            SourceCodeInfo.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.location && message.location.length))\n                            message.location = [];\n                        message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a SourceCodeInfo message.\n             * @function verify\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            SourceCodeInfo.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.location != null && message.hasOwnProperty(\"location\")) {\n                    if (!Array.isArray(message.location))\n                        return \"location: array expected\";\n                    for (var i = 0; i < message.location.length; ++i) {\n                        var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]);\n                        if (error)\n                            return \"location.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo\n             */\n            SourceCodeInfo.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.SourceCodeInfo)\n                    return object;\n                var message = new $root.google.protobuf.SourceCodeInfo();\n                if (object.location) {\n                    if (!Array.isArray(object.location))\n                        throw TypeError(\".google.protobuf.SourceCodeInfo.location: array expected\");\n                    message.location = [];\n                    for (var i = 0; i < object.location.length; ++i) {\n                        if (typeof object.location[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.location: object expected\");\n                        message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            SourceCodeInfo.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.location = [];\n                if (message.location && message.location.length) {\n                    object.location = [];\n                    for (var j = 0; j < message.location.length; ++j)\n                        object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this SourceCodeInfo to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.SourceCodeInfo\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            SourceCodeInfo.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for SourceCodeInfo\n             * @function getTypeUrl\n             * @memberof google.protobuf.SourceCodeInfo\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            SourceCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.SourceCodeInfo\";\n            };\n\n            SourceCodeInfo.Location = (function() {\n\n                /**\n                 * Properties of a Location.\n                 * @memberof google.protobuf.SourceCodeInfo\n                 * @interface ILocation\n                 * @property {Array.<number>|null} [path] Location path\n                 * @property {Array.<number>|null} [span] Location span\n                 * @property {string|null} [leadingComments] Location leadingComments\n                 * @property {string|null} [trailingComments] Location trailingComments\n                 * @property {Array.<string>|null} [leadingDetachedComments] Location leadingDetachedComments\n                 */\n\n                /**\n                 * Constructs a new Location.\n                 * @memberof google.protobuf.SourceCodeInfo\n                 * @classdesc Represents a Location.\n                 * @implements ILocation\n                 * @constructor\n                 * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set\n                 */\n                function Location(properties) {\n                    this.path = [];\n                    this.span = [];\n                    this.leadingDetachedComments = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Location path.\n                 * @member {Array.<number>} path\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.path = $util.emptyArray;\n\n                /**\n                 * Location span.\n                 * @member {Array.<number>} span\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.span = $util.emptyArray;\n\n                /**\n                 * Location leadingComments.\n                 * @member {string} leadingComments\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.leadingComments = \"\";\n\n                /**\n                 * Location trailingComments.\n                 * @member {string} trailingComments\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.trailingComments = \"\";\n\n                /**\n                 * Location leadingDetachedComments.\n                 * @member {Array.<string>} leadingDetachedComments\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 */\n                Location.prototype.leadingDetachedComments = $util.emptyArray;\n\n                /**\n                 * Creates a new Location instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location instance\n                 */\n                Location.create = function create(properties) {\n                    return new Location(properties);\n                };\n\n                /**\n                 * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Location.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.path != null && message.path.length) {\n                        writer.uint32(/* id 1, wireType 2 =*/10).fork();\n                        for (var i = 0; i < message.path.length; ++i)\n                            writer.int32(message.path[i]);\n                        writer.ldelim();\n                    }\n                    if (message.span != null && message.span.length) {\n                        writer.uint32(/* id 2, wireType 2 =*/18).fork();\n                        for (var i = 0; i < message.span.length; ++i)\n                            writer.int32(message.span[i]);\n                        writer.ldelim();\n                    }\n                    if (message.leadingComments != null && Object.hasOwnProperty.call(message, \"leadingComments\"))\n                        writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments);\n                    if (message.trailingComments != null && Object.hasOwnProperty.call(message, \"trailingComments\"))\n                        writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments);\n                    if (message.leadingDetachedComments != null && message.leadingDetachedComments.length)\n                        for (var i = 0; i < message.leadingDetachedComments.length; ++i)\n                            writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Location.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes a Location message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Location.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.SourceCodeInfo.Location();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            if (!(message.path && message.path.length))\n                                message.path = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.path.push(reader.int32());\n                            } else\n                                message.path.push(reader.int32());\n                            break;\n                        case 2:\n                            if (!(message.span && message.span.length))\n                                message.span = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.span.push(reader.int32());\n                            } else\n                                message.span.push(reader.int32());\n                            break;\n                        case 3:\n                            message.leadingComments = reader.string();\n                            break;\n                        case 4:\n                            message.trailingComments = reader.string();\n                            break;\n                        case 6:\n                            if (!(message.leadingDetachedComments && message.leadingDetachedComments.length))\n                                message.leadingDetachedComments = [];\n                            message.leadingDetachedComments.push(reader.string());\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes a Location message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Location.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies a Location message.\n                 * @function verify\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Location.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.path != null && message.hasOwnProperty(\"path\")) {\n                        if (!Array.isArray(message.path))\n                            return \"path: array expected\";\n                        for (var i = 0; i < message.path.length; ++i)\n                            if (!$util.isInteger(message.path[i]))\n                                return \"path: integer[] expected\";\n                    }\n                    if (message.span != null && message.hasOwnProperty(\"span\")) {\n                        if (!Array.isArray(message.span))\n                            return \"span: array expected\";\n                        for (var i = 0; i < message.span.length; ++i)\n                            if (!$util.isInteger(message.span[i]))\n                                return \"span: integer[] expected\";\n                    }\n                    if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n                        if (!$util.isString(message.leadingComments))\n                            return \"leadingComments: string expected\";\n                    if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n                        if (!$util.isString(message.trailingComments))\n                            return \"trailingComments: string expected\";\n                    if (message.leadingDetachedComments != null && message.hasOwnProperty(\"leadingDetachedComments\")) {\n                        if (!Array.isArray(message.leadingDetachedComments))\n                            return \"leadingDetachedComments: array expected\";\n                        for (var i = 0; i < message.leadingDetachedComments.length; ++i)\n                            if (!$util.isString(message.leadingDetachedComments[i]))\n                                return \"leadingDetachedComments: string[] expected\";\n                    }\n                    return null;\n                };\n\n                /**\n                 * Creates a Location message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.SourceCodeInfo.Location} Location\n                 */\n                Location.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.SourceCodeInfo.Location)\n                        return object;\n                    var message = new $root.google.protobuf.SourceCodeInfo.Location();\n                    if (object.path) {\n                        if (!Array.isArray(object.path))\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.Location.path: array expected\");\n                        message.path = [];\n                        for (var i = 0; i < object.path.length; ++i)\n                            message.path[i] = object.path[i] | 0;\n                    }\n                    if (object.span) {\n                        if (!Array.isArray(object.span))\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.Location.span: array expected\");\n                        message.span = [];\n                        for (var i = 0; i < object.span.length; ++i)\n                            message.span[i] = object.span[i] | 0;\n                    }\n                    if (object.leadingComments != null)\n                        message.leadingComments = String(object.leadingComments);\n                    if (object.trailingComments != null)\n                        message.trailingComments = String(object.trailingComments);\n                    if (object.leadingDetachedComments) {\n                        if (!Array.isArray(object.leadingDetachedComments))\n                            throw TypeError(\".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected\");\n                        message.leadingDetachedComments = [];\n                        for (var i = 0; i < object.leadingDetachedComments.length; ++i)\n                            message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]);\n                    }\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from a Location message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {google.protobuf.SourceCodeInfo.Location} message Location\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Location.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults) {\n                        object.path = [];\n                        object.span = [];\n                        object.leadingDetachedComments = [];\n                    }\n                    if (options.defaults) {\n                        object.leadingComments = \"\";\n                        object.trailingComments = \"\";\n                    }\n                    if (message.path && message.path.length) {\n                        object.path = [];\n                        for (var j = 0; j < message.path.length; ++j)\n                            object.path[j] = message.path[j];\n                    }\n                    if (message.span && message.span.length) {\n                        object.span = [];\n                        for (var j = 0; j < message.span.length; ++j)\n                            object.span[j] = message.span[j];\n                    }\n                    if (message.leadingComments != null && message.hasOwnProperty(\"leadingComments\"))\n                        object.leadingComments = message.leadingComments;\n                    if (message.trailingComments != null && message.hasOwnProperty(\"trailingComments\"))\n                        object.trailingComments = message.trailingComments;\n                    if (message.leadingDetachedComments && message.leadingDetachedComments.length) {\n                        object.leadingDetachedComments = [];\n                        for (var j = 0; j < message.leadingDetachedComments.length; ++j)\n                            object.leadingDetachedComments[j] = message.leadingDetachedComments[j];\n                    }\n                    return object;\n                };\n\n                /**\n                 * Converts this Location to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Location.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for Location\n                 * @function getTypeUrl\n                 * @memberof google.protobuf.SourceCodeInfo.Location\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                Location.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/google.protobuf.SourceCodeInfo.Location\";\n                };\n\n                return Location;\n            })();\n\n            return SourceCodeInfo;\n        })();\n\n        protobuf.GeneratedCodeInfo = (function() {\n\n            /**\n             * Properties of a GeneratedCodeInfo.\n             * @memberof google.protobuf\n             * @interface IGeneratedCodeInfo\n             * @property {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>|null} [annotation] GeneratedCodeInfo annotation\n             */\n\n            /**\n             * Constructs a new GeneratedCodeInfo.\n             * @memberof google.protobuf\n             * @classdesc Represents a GeneratedCodeInfo.\n             * @implements IGeneratedCodeInfo\n             * @constructor\n             * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set\n             */\n            function GeneratedCodeInfo(properties) {\n                this.annotation = [];\n                if (properties)\n                    for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                        if (properties[keys[i]] != null)\n                            this[keys[i]] = properties[keys[i]];\n            }\n\n            /**\n             * GeneratedCodeInfo annotation.\n             * @member {Array.<google.protobuf.GeneratedCodeInfo.IAnnotation>} annotation\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @instance\n             */\n            GeneratedCodeInfo.prototype.annotation = $util.emptyArray;\n\n            /**\n             * Creates a new GeneratedCodeInfo instance using the specified properties.\n             * @function create\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance\n             */\n            GeneratedCodeInfo.create = function create(properties) {\n                return new GeneratedCodeInfo(properties);\n            };\n\n            /**\n             * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n             * @function encode\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GeneratedCodeInfo.encode = function encode(message, writer) {\n                if (!writer)\n                    writer = $Writer.create();\n                if (message.annotation != null && message.annotation.length)\n                    for (var i = 0; i < message.annotation.length; ++i)\n                        $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n                return writer;\n            };\n\n            /**\n             * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages.\n             * @function encodeDelimited\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode\n             * @param {$protobuf.Writer} [writer] Writer to encode to\n             * @returns {$protobuf.Writer} Writer\n             */\n            GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) {\n                return this.encode(message, writer).ldelim();\n            };\n\n            /**\n             * Decodes a GeneratedCodeInfo message from the specified reader or buffer.\n             * @function decode\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @param {number} [length] Message length if known beforehand\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GeneratedCodeInfo.decode = function decode(reader, length) {\n                if (!(reader instanceof $Reader))\n                    reader = $Reader.create(reader);\n                var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo();\n                while (reader.pos < end) {\n                    var tag = reader.uint32();\n                    switch (tag >>> 3) {\n                    case 1:\n                        if (!(message.annotation && message.annotation.length))\n                            message.annotation = [];\n                        message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32()));\n                        break;\n                    default:\n                        reader.skipType(tag & 7);\n                        break;\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited.\n             * @function decodeDelimited\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n             * @throws {Error} If the payload is not a reader or valid buffer\n             * @throws {$protobuf.util.ProtocolError} If required fields are missing\n             */\n            GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) {\n                if (!(reader instanceof $Reader))\n                    reader = new $Reader(reader);\n                return this.decode(reader, reader.uint32());\n            };\n\n            /**\n             * Verifies a GeneratedCodeInfo message.\n             * @function verify\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {Object.<string,*>} message Plain object to verify\n             * @returns {string|null} `null` if valid, otherwise the reason why it is not\n             */\n            GeneratedCodeInfo.verify = function verify(message) {\n                if (typeof message !== \"object\" || message === null)\n                    return \"object expected\";\n                if (message.annotation != null && message.hasOwnProperty(\"annotation\")) {\n                    if (!Array.isArray(message.annotation))\n                        return \"annotation: array expected\";\n                    for (var i = 0; i < message.annotation.length; ++i) {\n                        var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]);\n                        if (error)\n                            return \"annotation.\" + error;\n                    }\n                }\n                return null;\n            };\n\n            /**\n             * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types.\n             * @function fromObject\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {Object.<string,*>} object Plain object\n             * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo\n             */\n            GeneratedCodeInfo.fromObject = function fromObject(object) {\n                if (object instanceof $root.google.protobuf.GeneratedCodeInfo)\n                    return object;\n                var message = new $root.google.protobuf.GeneratedCodeInfo();\n                if (object.annotation) {\n                    if (!Array.isArray(object.annotation))\n                        throw TypeError(\".google.protobuf.GeneratedCodeInfo.annotation: array expected\");\n                    message.annotation = [];\n                    for (var i = 0; i < object.annotation.length; ++i) {\n                        if (typeof object.annotation[i] !== \"object\")\n                            throw TypeError(\".google.protobuf.GeneratedCodeInfo.annotation: object expected\");\n                        message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]);\n                    }\n                }\n                return message;\n            };\n\n            /**\n             * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified.\n             * @function toObject\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo\n             * @param {$protobuf.IConversionOptions} [options] Conversion options\n             * @returns {Object.<string,*>} Plain object\n             */\n            GeneratedCodeInfo.toObject = function toObject(message, options) {\n                if (!options)\n                    options = {};\n                var object = {};\n                if (options.arrays || options.defaults)\n                    object.annotation = [];\n                if (message.annotation && message.annotation.length) {\n                    object.annotation = [];\n                    for (var j = 0; j < message.annotation.length; ++j)\n                        object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options);\n                }\n                return object;\n            };\n\n            /**\n             * Converts this GeneratedCodeInfo to JSON.\n             * @function toJSON\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @instance\n             * @returns {Object.<string,*>} JSON object\n             */\n            GeneratedCodeInfo.prototype.toJSON = function toJSON() {\n                return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n            };\n\n            /**\n             * Gets the default type url for GeneratedCodeInfo\n             * @function getTypeUrl\n             * @memberof google.protobuf.GeneratedCodeInfo\n             * @static\n             * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n             * @returns {string} The default type url\n             */\n            GeneratedCodeInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                if (typeUrlPrefix === undefined) {\n                    typeUrlPrefix = \"type.googleapis.com\";\n                }\n                return typeUrlPrefix + \"/google.protobuf.GeneratedCodeInfo\";\n            };\n\n            GeneratedCodeInfo.Annotation = (function() {\n\n                /**\n                 * Properties of an Annotation.\n                 * @memberof google.protobuf.GeneratedCodeInfo\n                 * @interface IAnnotation\n                 * @property {Array.<number>|null} [path] Annotation path\n                 * @property {string|null} [sourceFile] Annotation sourceFile\n                 * @property {number|null} [begin] Annotation begin\n                 * @property {number|null} [end] Annotation end\n                 */\n\n                /**\n                 * Constructs a new Annotation.\n                 * @memberof google.protobuf.GeneratedCodeInfo\n                 * @classdesc Represents an Annotation.\n                 * @implements IAnnotation\n                 * @constructor\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set\n                 */\n                function Annotation(properties) {\n                    this.path = [];\n                    if (properties)\n                        for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                            if (properties[keys[i]] != null)\n                                this[keys[i]] = properties[keys[i]];\n                }\n\n                /**\n                 * Annotation path.\n                 * @member {Array.<number>} path\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.path = $util.emptyArray;\n\n                /**\n                 * Annotation sourceFile.\n                 * @member {string} sourceFile\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.sourceFile = \"\";\n\n                /**\n                 * Annotation begin.\n                 * @member {number} begin\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.begin = 0;\n\n                /**\n                 * Annotation end.\n                 * @member {number} end\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 */\n                Annotation.prototype.end = 0;\n\n                /**\n                 * Creates a new Annotation instance using the specified properties.\n                 * @function create\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance\n                 */\n                Annotation.create = function create(properties) {\n                    return new Annotation(properties);\n                };\n\n                /**\n                 * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n                 * @function encode\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Annotation.encode = function encode(message, writer) {\n                    if (!writer)\n                        writer = $Writer.create();\n                    if (message.path != null && message.path.length) {\n                        writer.uint32(/* id 1, wireType 2 =*/10).fork();\n                        for (var i = 0; i < message.path.length; ++i)\n                            writer.int32(message.path[i]);\n                        writer.ldelim();\n                    }\n                    if (message.sourceFile != null && Object.hasOwnProperty.call(message, \"sourceFile\"))\n                        writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile);\n                    if (message.begin != null && Object.hasOwnProperty.call(message, \"begin\"))\n                        writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin);\n                    if (message.end != null && Object.hasOwnProperty.call(message, \"end\"))\n                        writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end);\n                    return writer;\n                };\n\n                /**\n                 * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages.\n                 * @function encodeDelimited\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode\n                 * @param {$protobuf.Writer} [writer] Writer to encode to\n                 * @returns {$protobuf.Writer} Writer\n                 */\n                Annotation.encodeDelimited = function encodeDelimited(message, writer) {\n                    return this.encode(message, writer).ldelim();\n                };\n\n                /**\n                 * Decodes an Annotation message from the specified reader or buffer.\n                 * @function decode\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @param {number} [length] Message length if known beforehand\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Annotation.decode = function decode(reader, length) {\n                    if (!(reader instanceof $Reader))\n                        reader = $Reader.create(reader);\n                    var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();\n                    while (reader.pos < end) {\n                        var tag = reader.uint32();\n                        switch (tag >>> 3) {\n                        case 1:\n                            if (!(message.path && message.path.length))\n                                message.path = [];\n                            if ((tag & 7) === 2) {\n                                var end2 = reader.uint32() + reader.pos;\n                                while (reader.pos < end2)\n                                    message.path.push(reader.int32());\n                            } else\n                                message.path.push(reader.int32());\n                            break;\n                        case 2:\n                            message.sourceFile = reader.string();\n                            break;\n                        case 3:\n                            message.begin = reader.int32();\n                            break;\n                        case 4:\n                            message.end = reader.int32();\n                            break;\n                        default:\n                            reader.skipType(tag & 7);\n                            break;\n                        }\n                    }\n                    return message;\n                };\n\n                /**\n                 * Decodes an Annotation message from the specified reader or buffer, length delimited.\n                 * @function decodeDelimited\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n                 * @throws {Error} If the payload is not a reader or valid buffer\n                 * @throws {$protobuf.util.ProtocolError} If required fields are missing\n                 */\n                Annotation.decodeDelimited = function decodeDelimited(reader) {\n                    if (!(reader instanceof $Reader))\n                        reader = new $Reader(reader);\n                    return this.decode(reader, reader.uint32());\n                };\n\n                /**\n                 * Verifies an Annotation message.\n                 * @function verify\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {Object.<string,*>} message Plain object to verify\n                 * @returns {string|null} `null` if valid, otherwise the reason why it is not\n                 */\n                Annotation.verify = function verify(message) {\n                    if (typeof message !== \"object\" || message === null)\n                        return \"object expected\";\n                    if (message.path != null && message.hasOwnProperty(\"path\")) {\n                        if (!Array.isArray(message.path))\n                            return \"path: array expected\";\n                        for (var i = 0; i < message.path.length; ++i)\n                            if (!$util.isInteger(message.path[i]))\n                                return \"path: integer[] expected\";\n                    }\n                    if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n                        if (!$util.isString(message.sourceFile))\n                            return \"sourceFile: string expected\";\n                    if (message.begin != null && message.hasOwnProperty(\"begin\"))\n                        if (!$util.isInteger(message.begin))\n                            return \"begin: integer expected\";\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        if (!$util.isInteger(message.end))\n                            return \"end: integer expected\";\n                    return null;\n                };\n\n                /**\n                 * Creates an Annotation message from a plain object. Also converts values to their respective internal types.\n                 * @function fromObject\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {Object.<string,*>} object Plain object\n                 * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation\n                 */\n                Annotation.fromObject = function fromObject(object) {\n                    if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation)\n                        return object;\n                    var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation();\n                    if (object.path) {\n                        if (!Array.isArray(object.path))\n                            throw TypeError(\".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected\");\n                        message.path = [];\n                        for (var i = 0; i < object.path.length; ++i)\n                            message.path[i] = object.path[i] | 0;\n                    }\n                    if (object.sourceFile != null)\n                        message.sourceFile = String(object.sourceFile);\n                    if (object.begin != null)\n                        message.begin = object.begin | 0;\n                    if (object.end != null)\n                        message.end = object.end | 0;\n                    return message;\n                };\n\n                /**\n                 * Creates a plain object from an Annotation message. Also converts values to other types if specified.\n                 * @function toObject\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation\n                 * @param {$protobuf.IConversionOptions} [options] Conversion options\n                 * @returns {Object.<string,*>} Plain object\n                 */\n                Annotation.toObject = function toObject(message, options) {\n                    if (!options)\n                        options = {};\n                    var object = {};\n                    if (options.arrays || options.defaults)\n                        object.path = [];\n                    if (options.defaults) {\n                        object.sourceFile = \"\";\n                        object.begin = 0;\n                        object.end = 0;\n                    }\n                    if (message.path && message.path.length) {\n                        object.path = [];\n                        for (var j = 0; j < message.path.length; ++j)\n                            object.path[j] = message.path[j];\n                    }\n                    if (message.sourceFile != null && message.hasOwnProperty(\"sourceFile\"))\n                        object.sourceFile = message.sourceFile;\n                    if (message.begin != null && message.hasOwnProperty(\"begin\"))\n                        object.begin = message.begin;\n                    if (message.end != null && message.hasOwnProperty(\"end\"))\n                        object.end = message.end;\n                    return object;\n                };\n\n                /**\n                 * Converts this Annotation to JSON.\n                 * @function toJSON\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @instance\n                 * @returns {Object.<string,*>} JSON object\n                 */\n                Annotation.prototype.toJSON = function toJSON() {\n                    return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n                };\n\n                /**\n                 * Gets the default type url for Annotation\n                 * @function getTypeUrl\n                 * @memberof google.protobuf.GeneratedCodeInfo.Annotation\n                 * @static\n                 * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n                 * @returns {string} The default type url\n                 */\n                Annotation.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n                    if (typeUrlPrefix === undefined) {\n                        typeUrlPrefix = \"type.googleapis.com\";\n                    }\n                    return typeUrlPrefix + \"/google.protobuf.GeneratedCodeInfo.Annotation\";\n                };\n\n                return Annotation;\n            })();\n\n            return GeneratedCodeInfo;\n        })();\n\n        return protobuf;\n    })();\n\n    return google;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/test.js.ts",
    "content": "import * as protobuf from \"../..\";\nimport * as test from \"./test\";\n\n// should encode an object implementing the interface\nlet mInterface: test.jspb.test.ISimple1 = { aString: \"a-string\", aRepeatedString: [ \"a\", \"repeated\", \"string\" ], aBoolean: true };\nlet mInterfaceWriter: protobuf.Writer = test.jspb.test.Simple1.encode(mInterface);\n\n// should encode a message\nlet mMessage: test.jspb.test.Simple1 = test.jspb.test.Simple1.create(mInterface);\nlet mMessageWritter: protobuf.Writer = test.jspb.test.Simple1.encode(mMessage);\n\n// should allow to assign a message to an interface\nmInterface = mMessage;\n\n// should not allow to assign an interface to a message\n// mMessage = mInterface;\n\n// should always decode to a message, not an interface\nlet dMessage: test.jspb.test.Simple1 = test.jspb.test.Simple1.decode(mInterfaceWriter.finish());\n"
  },
  {
    "path": "tests/data/test.json",
    "content": "{\n  \"options\": {\n    \"java_package\": \"com.google.apps.jspb.proto\",\n    \"java_multiple_files\": true\n  },\n  \"nested\": {\n    \"jspb\": {\n      \"nested\": {\n        \"test\": {\n          \"nested\": {\n            \"Empty\": {\n              \"fields\": {}\n            },\n            \"OuterEnum\": {\n              \"values\": {\n                \"FOO\": 1,\n                \"BAR\": 2\n              }\n            },\n            \"EnumContainer\": {\n              \"fields\": {\n                \"outerEnum\": {\n                  \"type\": \"OuterEnum\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"Simple1\": {\n              \"fields\": {\n                \"aString\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"aRepeatedString\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"aBoolean\": {\n                  \"type\": \"bool\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"Simple2\": {\n              \"fields\": {\n                \"aString\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"aRepeatedString\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"SpecialCases\": {\n              \"fields\": {\n                \"normal\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"default\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"function\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"var\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 4\n                }\n              }\n            },\n            \"OptionalFields\": {\n              \"fields\": {\n                \"aString\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"aBool\": {\n                  \"rule\": \"required\",\n                  \"type\": \"bool\",\n                  \"id\": 2\n                },\n                \"aNestedMessage\": {\n                  \"type\": \"Nested\",\n                  \"id\": 3\n                },\n                \"aRepeatedMessage\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Nested\",\n                  \"id\": 4\n                },\n                \"aRepeatedString\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 5\n                }\n              },\n              \"nested\": {\n                \"Nested\": {\n                  \"fields\": {\n                    \"anInt\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    }\n                  }\n                }\n              }\n            },\n            \"HasExtensions\": {\n              \"fields\": {\n                \"str1\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"str2\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"str3\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                }\n              },\n              \"extensions\": [\n                [\n                  10,\n                  536870911\n                ]\n              ]\n            },\n            \"Complex\": {\n              \"fields\": {\n                \"aString\": {\n                  \"rule\": \"required\",\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"anOutOfOrderBool\": {\n                  \"rule\": \"required\",\n                  \"type\": \"bool\",\n                  \"id\": 9\n                },\n                \"aNestedMessage\": {\n                  \"type\": \"Nested\",\n                  \"id\": 4\n                },\n                \"aRepeatedMessage\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Nested\",\n                  \"id\": 5\n                },\n                \"aRepeatedString\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 7\n                }\n              },\n              \"nested\": {\n                \"Nested\": {\n                  \"fields\": {\n                    \"anInt\": {\n                      \"rule\": \"required\",\n                      \"type\": \"int32\",\n                      \"id\": 2\n                    }\n                  }\n                }\n              }\n            },\n            \"OuterMessage\": {\n              \"fields\": {},\n              \"nested\": {\n                \"Complex\": {\n                  \"fields\": {\n                    \"innerComplexField\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    }\n                  }\n                }\n              }\n            },\n            \"IsExtension\": {\n              \"fields\": {\n                \"ext1\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                }\n              },\n              \"nested\": {\n                \"extField\": {\n                  \"type\": \"IsExtension\",\n                  \"id\": 100,\n                  \"extend\": \"HasExtensions\"\n                },\n                \"simpleOption\": {\n                  \"type\": \"string\",\n                  \"id\": 42113038,\n                  \"extend\": \"google.protobuf.EnumOptions\"\n                }\n              }\n            },\n            \"IndirectExtension\": {\n              \"fields\": {},\n              \"nested\": {\n                \"simple\": {\n                  \"type\": \"Simple1\",\n                  \"id\": 101,\n                  \"extend\": \"HasExtensions\"\n                },\n                \"str\": {\n                  \"type\": \"string\",\n                  \"id\": 102,\n                  \"extend\": \"HasExtensions\"\n                },\n                \"repeatedStr\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 103,\n                  \"extend\": \"HasExtensions\"\n                },\n                \"repeatedSimple\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Simple1\",\n                  \"id\": 104,\n                  \"extend\": \"HasExtensions\"\n                }\n              }\n            },\n            \"simple1\": {\n              \"type\": \"Simple1\",\n              \"id\": 105,\n              \"extend\": \"HasExtensions\"\n            },\n            \"DefaultValues\": {\n              \"fields\": {\n                \"stringField\": {\n                  \"type\": \"string\",\n                  \"id\": 1,\n                  \"options\": {\n                    \"default\": \"default<>abc\"\n                  }\n                },\n                \"boolField\": {\n                  \"type\": \"bool\",\n                  \"id\": 2,\n                  \"options\": {\n                    \"default\": true\n                  }\n                },\n                \"intField\": {\n                  \"type\": \"int64\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"default\": 11\n                  }\n                },\n                \"enumField\": {\n                  \"type\": \"Enum\",\n                  \"id\": 4,\n                  \"options\": {\n                    \"default\": \"E1\"\n                  }\n                },\n                \"emptyField\": {\n                  \"type\": \"string\",\n                  \"id\": 6,\n                  \"options\": {\n                    \"default\": \"\"\n                  }\n                },\n                \"bytesField\": {\n                  \"type\": \"bytes\",\n                  \"id\": 8,\n                  \"options\": {\n                    \"default\": \"moo\"\n                  }\n                }\n              },\n              \"nested\": {\n                \"Enum\": {\n                  \"values\": {\n                    \"E1\": 13,\n                    \"E2\": 77\n                  }\n                }\n              }\n            },\n            \"FloatingPointFields\": {\n              \"fields\": {\n                \"optionalFloatField\": {\n                  \"type\": \"float\",\n                  \"id\": 1\n                },\n                \"requiredFloatField\": {\n                  \"rule\": \"required\",\n                  \"type\": \"float\",\n                  \"id\": 2\n                },\n                \"repeatedFloatField\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"float\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"packed\": false\n                  }\n                },\n                \"defaultFloatField\": {\n                  \"type\": \"float\",\n                  \"id\": 4,\n                  \"options\": {\n                    \"default\": 2\n                  }\n                },\n                \"optionalDoubleField\": {\n                  \"type\": \"double\",\n                  \"id\": 5\n                },\n                \"requiredDoubleField\": {\n                  \"rule\": \"required\",\n                  \"type\": \"double\",\n                  \"id\": 6\n                },\n                \"repeatedDoubleField\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"double\",\n                  \"id\": 7,\n                  \"options\": {\n                    \"packed\": false\n                  }\n                },\n                \"defaultDoubleField\": {\n                  \"type\": \"double\",\n                  \"id\": 8,\n                  \"options\": {\n                    \"default\": 2\n                  }\n                }\n              }\n            },\n            \"TestClone\": {\n              \"fields\": {\n                \"str\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"simple1\": {\n                  \"type\": \"Simple1\",\n                  \"id\": 3\n                },\n                \"simple2\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Simple1\",\n                  \"id\": 5\n                },\n                \"bytesField\": {\n                  \"type\": \"bytes\",\n                  \"id\": 6\n                },\n                \"unused\": {\n                  \"type\": \"string\",\n                  \"id\": 7\n                }\n              },\n              \"extensions\": [\n                [\n                  10,\n                  536870911\n                ]\n              ]\n            },\n            \"CloneExtension\": {\n              \"fields\": {\n                \"ext\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                }\n              },\n              \"nested\": {\n                \"extField\": {\n                  \"type\": \"CloneExtension\",\n                  \"id\": 100,\n                  \"extend\": \"TestClone\"\n                }\n              }\n            },\n            \"TestGroup\": {\n              \"fields\": {\n                \"repeatedGroup\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"RepeatedGroup\",\n                  \"id\": 1\n                },\n                \"requiredGroup\": {\n                  \"rule\": \"required\",\n                  \"type\": \"RequiredGroup\",\n                  \"id\": 2\n                },\n                \"optionalGroup\": {\n                  \"type\": \"OptionalGroup\",\n                  \"id\": 3\n                },\n                \"messageInGroup\": {\n                  \"type\": \"MessageInGroup\",\n                  \"id\": 4\n                },\n                \"enumInGroup\": {\n                  \"type\": \"EnumInGroup\",\n                  \"id\": 5\n                },\n                \"id\": {\n                  \"type\": \"string\",\n                  \"id\": 6\n                },\n                \"requiredSimple\": {\n                  \"rule\": \"required\",\n                  \"type\": \"Simple2\",\n                  \"id\": 7\n                },\n                \"optionalSimple\": {\n                  \"type\": \"Simple2\",\n                  \"id\": 8\n                }\n              },\n              \"nested\": {\n                \"RepeatedGroup\": {\n                  \"fields\": {\n                    \"id\": {\n                      \"rule\": \"required\",\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"someBool\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"bool\",\n                      \"id\": 2,\n                      \"options\": {\n                        \"packed\": false\n                      }\n                    }\n                  },\n                  \"group\": true\n                },\n                \"RequiredGroup\": {\n                  \"fields\": {\n                    \"id\": {\n                      \"rule\": \"required\",\n                      \"type\": \"string\",\n                      \"id\": 1\n                    }\n                  },\n                  \"group\": true\n                },\n                \"OptionalGroup\": {\n                  \"fields\": {\n                    \"id\": {\n                      \"rule\": \"required\",\n                      \"type\": \"string\",\n                      \"id\": 1\n                    }\n                  },\n                  \"group\": true\n                },\n                \"MessageInGroup\": {\n                  \"fields\": {\n                    \"id\": {\n                      \"rule\": \"required\",\n                      \"type\": \"NetedMessage\",\n                      \"id\": 1\n                    }\n                  },\n                  \"nested\": {\n                    \"NetedMessage\": {\n                      \"fields\": {\n                        \"id\": {\n                          \"rule\": \"optional\",\n                          \"type\": \"string\",\n                          \"id\": 1\n                        }\n                      }\n                    }\n                  },\n                  \"group\": true\n                },\n                \"EnumInGroup\": {\n                  \"fields\": {\n                    \"id\": {\n                      \"rule\": \"required\",\n                      \"type\": \"NestedEnum\",\n                      \"id\": 1\n                    }\n                  },\n                  \"nested\": {\n                    \"NestedEnum\": {\n                      \"values\": {\n                        \"first\": 0,\n                        \"second\": 1\n                      }\n                    }\n                  },\n                  \"group\": true\n                }\n              }\n            },\n            \"TestGroup1\": {\n              \"fields\": {\n                \"group\": {\n                  \"type\": \"TestGroup.RepeatedGroup\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"TestReservedNames\": {\n              \"fields\": {\n                \"extension\": {\n                  \"type\": \"int32\",\n                  \"id\": 1\n                }\n              },\n              \"extensions\": [\n                [\n                  10,\n                  536870911\n                ]\n              ]\n            },\n            \"TestReservedNamesExtension\": {\n              \"fields\": {},\n              \"nested\": {\n                \"foo\": {\n                  \"type\": \"int32\",\n                  \"id\": 10,\n                  \"extend\": \"TestReservedNames\"\n                }\n              }\n            },\n            \"TestMessageWithOneof\": {\n              \"oneofs\": {\n                \"partialOneof\": {\n                  \"oneof\": [\n                    \"pone\",\n                    \"pthree\"\n                  ]\n                },\n                \"recursiveOneof\": {\n                  \"oneof\": [\n                    \"rone\",\n                    \"rtwo\"\n                  ]\n                },\n                \"defaultOneofA\": {\n                  \"oneof\": [\n                    \"aone\",\n                    \"atwo\"\n                  ]\n                },\n                \"defaultOneofB\": {\n                  \"oneof\": [\n                    \"bone\",\n                    \"btwo\"\n                  ]\n                }\n              },\n              \"fields\": {\n                \"pone\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"pthree\": {\n                  \"type\": \"string\",\n                  \"id\": 5\n                },\n                \"rone\": {\n                  \"type\": \"TestMessageWithOneof\",\n                  \"id\": 6\n                },\n                \"rtwo\": {\n                  \"type\": \"string\",\n                  \"id\": 7\n                },\n                \"normalField\": {\n                  \"type\": \"bool\",\n                  \"id\": 8\n                },\n                \"repeatedField\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 9\n                },\n                \"aone\": {\n                  \"type\": \"int32\",\n                  \"id\": 10,\n                  \"options\": {\n                    \"default\": 1234\n                  }\n                },\n                \"atwo\": {\n                  \"type\": \"int32\",\n                  \"id\": 11\n                },\n                \"bone\": {\n                  \"type\": \"int32\",\n                  \"id\": 12\n                },\n                \"btwo\": {\n                  \"type\": \"int32\",\n                  \"id\": 13,\n                  \"options\": {\n                    \"default\": 1234\n                  }\n                }\n              }\n            },\n            \"TestEndsWithBytes\": {\n              \"fields\": {\n                \"value\": {\n                  \"type\": \"int32\",\n                  \"id\": 1\n                },\n                \"data\": {\n                  \"type\": \"bytes\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"TestMapFieldsNoBinary\": {\n              \"fields\": {\n                \"mapStringString\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"mapStringInt32\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"int32\",\n                  \"id\": 2\n                },\n                \"mapStringInt64\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"int64\",\n                  \"id\": 3\n                },\n                \"mapStringBool\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"bool\",\n                  \"id\": 4\n                },\n                \"mapStringDouble\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"double\",\n                  \"id\": 5\n                },\n                \"mapStringEnum\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"MapValueEnumNoBinary\",\n                  \"id\": 6\n                },\n                \"mapStringMsg\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"MapValueMessageNoBinary\",\n                  \"id\": 7\n                },\n                \"mapInt32String\": {\n                  \"keyType\": \"int32\",\n                  \"type\": \"string\",\n                  \"id\": 8\n                },\n                \"mapInt64String\": {\n                  \"keyType\": \"int64\",\n                  \"type\": \"string\",\n                  \"id\": 9\n                },\n                \"mapBoolString\": {\n                  \"keyType\": \"bool\",\n                  \"type\": \"string\",\n                  \"id\": 10\n                },\n                \"testMapFields\": {\n                  \"type\": \"TestMapFieldsNoBinary\",\n                  \"id\": 11\n                },\n                \"mapStringTestmapfields\": {\n                  \"keyType\": \"string\",\n                  \"type\": \"TestMapFieldsNoBinary\",\n                  \"id\": 12\n                }\n              }\n            },\n            \"MapValueEnumNoBinary\": {\n              \"values\": {\n                \"MAP_VALUE_FOO_NOBINARY\": 0,\n                \"MAP_VALUE_BAR_NOBINARY\": 1,\n                \"MAP_VALUE_BAZ_NOBINARY\": 2\n              }\n            },\n            \"MapValueMessageNoBinary\": {\n              \"fields\": {\n                \"foo\": {\n                  \"type\": \"int32\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"Deeply\": {\n              \"fields\": {},\n              \"nested\": {\n                \"Nested\": {\n                  \"fields\": {},\n                  \"nested\": {\n                    \"Message\": {\n                      \"fields\": {\n                        \"count\": {\n                          \"type\": \"int32\",\n                          \"id\": 1\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    },\n    \"google\": {\n      \"nested\": {\n        \"protobuf\": {\n          \"options\": {\n            \"go_package\": \"descriptor\",\n            \"java_package\": \"com.google.protobuf\",\n            \"java_outer_classname\": \"DescriptorProtos\",\n            \"csharp_namespace\": \"Google.Protobuf.Reflection\",\n            \"objc_class_prefix\": \"GPB\",\n            \"optimize_for\": \"SPEED\"\n          },\n          \"nested\": {\n            \"FileDescriptorSet\": {\n              \"fields\": {\n                \"file\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FileDescriptorProto\",\n                  \"id\": 1\n                }\n              }\n            },\n            \"FileDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"package\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"dependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"publicDependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"int32\",\n                  \"id\": 10,\n                  \"options\": {\n                    \"packed\": false\n                  }\n                },\n                \"weakDependency\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"int32\",\n                  \"id\": 11,\n                  \"options\": {\n                    \"packed\": false\n                  }\n                },\n                \"messageType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"DescriptorProto\",\n                  \"id\": 4\n                },\n                \"enumType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumDescriptorProto\",\n                  \"id\": 5\n                },\n                \"service\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"ServiceDescriptorProto\",\n                  \"id\": 6\n                },\n                \"extension\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FieldDescriptorProto\",\n                  \"id\": 7\n                },\n                \"options\": {\n                  \"type\": \"FileOptions\",\n                  \"id\": 8\n                },\n                \"sourceCodeInfo\": {\n                  \"type\": \"SourceCodeInfo\",\n                  \"id\": 9\n                },\n                \"syntax\": {\n                  \"type\": \"string\",\n                  \"id\": 12\n                }\n              }\n            },\n            \"DescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"field\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FieldDescriptorProto\",\n                  \"id\": 2\n                },\n                \"extension\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"FieldDescriptorProto\",\n                  \"id\": 6\n                },\n                \"nestedType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"DescriptorProto\",\n                  \"id\": 3\n                },\n                \"enumType\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumDescriptorProto\",\n                  \"id\": 4\n                },\n                \"extensionRange\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"ExtensionRange\",\n                  \"id\": 5\n                },\n                \"oneofDecl\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"OneofDescriptorProto\",\n                  \"id\": 8\n                },\n                \"options\": {\n                  \"type\": \"MessageOptions\",\n                  \"id\": 7\n                },\n                \"reservedRange\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"ReservedRange\",\n                  \"id\": 9\n                },\n                \"reservedName\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"string\",\n                  \"id\": 10\n                }\n              },\n              \"nested\": {\n                \"ExtensionRange\": {\n                  \"fields\": {\n                    \"start\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 2\n                    }\n                  }\n                },\n                \"ReservedRange\": {\n                  \"fields\": {\n                    \"start\": {\n                      \"type\": \"int32\",\n                      \"id\": 1\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 2\n                    }\n                  }\n                }\n              }\n            },\n            \"FieldDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"number\": {\n                  \"type\": \"int32\",\n                  \"id\": 3\n                },\n                \"label\": {\n                  \"type\": \"Label\",\n                  \"id\": 4\n                },\n                \"type\": {\n                  \"type\": \"Type\",\n                  \"id\": 5\n                },\n                \"typeName\": {\n                  \"type\": \"string\",\n                  \"id\": 6\n                },\n                \"extendee\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"defaultValue\": {\n                  \"type\": \"string\",\n                  \"id\": 7\n                },\n                \"oneofIndex\": {\n                  \"type\": \"int32\",\n                  \"id\": 9\n                },\n                \"jsonName\": {\n                  \"type\": \"string\",\n                  \"id\": 10\n                },\n                \"options\": {\n                  \"type\": \"FieldOptions\",\n                  \"id\": 8\n                }\n              },\n              \"nested\": {\n                \"Type\": {\n                  \"values\": {\n                    \"TYPE_DOUBLE\": 1,\n                    \"TYPE_FLOAT\": 2,\n                    \"TYPE_INT64\": 3,\n                    \"TYPE_UINT64\": 4,\n                    \"TYPE_INT32\": 5,\n                    \"TYPE_FIXED64\": 6,\n                    \"TYPE_FIXED32\": 7,\n                    \"TYPE_BOOL\": 8,\n                    \"TYPE_STRING\": 9,\n                    \"TYPE_GROUP\": 10,\n                    \"TYPE_MESSAGE\": 11,\n                    \"TYPE_BYTES\": 12,\n                    \"TYPE_UINT32\": 13,\n                    \"TYPE_ENUM\": 14,\n                    \"TYPE_SFIXED32\": 15,\n                    \"TYPE_SFIXED64\": 16,\n                    \"TYPE_SINT32\": 17,\n                    \"TYPE_SINT64\": 18\n                  }\n                },\n                \"Label\": {\n                  \"values\": {\n                    \"LABEL_OPTIONAL\": 1,\n                    \"LABEL_REQUIRED\": 2,\n                    \"LABEL_REPEATED\": 3\n                  }\n                }\n              }\n            },\n            \"OneofDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"options\": {\n                  \"type\": \"OneofOptions\",\n                  \"id\": 2\n                }\n              }\n            },\n            \"EnumDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"value\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"EnumValueDescriptorProto\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"type\": \"EnumOptions\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"EnumValueDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"number\": {\n                  \"type\": \"int32\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"type\": \"EnumValueOptions\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"ServiceDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"method\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"MethodDescriptorProto\",\n                  \"id\": 2\n                },\n                \"options\": {\n                  \"type\": \"ServiceOptions\",\n                  \"id\": 3\n                }\n              }\n            },\n            \"MethodDescriptorProto\": {\n              \"fields\": {\n                \"name\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"inputType\": {\n                  \"type\": \"string\",\n                  \"id\": 2\n                },\n                \"outputType\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"options\": {\n                  \"type\": \"MethodOptions\",\n                  \"id\": 4\n                },\n                \"clientStreaming\": {\n                  \"type\": \"bool\",\n                  \"id\": 5,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"serverStreaming\": {\n                  \"type\": \"bool\",\n                  \"id\": 6,\n                  \"options\": {\n                    \"default\": false\n                  }\n                }\n              }\n            },\n            \"FileOptions\": {\n              \"fields\": {\n                \"javaPackage\": {\n                  \"type\": \"string\",\n                  \"id\": 1\n                },\n                \"javaOuterClassname\": {\n                  \"type\": \"string\",\n                  \"id\": 8\n                },\n                \"javaMultipleFiles\": {\n                  \"type\": \"bool\",\n                  \"id\": 10,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"javaGenerateEqualsAndHash\": {\n                  \"type\": \"bool\",\n                  \"id\": 20,\n                  \"options\": {\n                    \"deprecated\": true\n                  }\n                },\n                \"javaStringCheckUtf8\": {\n                  \"type\": \"bool\",\n                  \"id\": 27,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"optimizeFor\": {\n                  \"type\": \"OptimizeMode\",\n                  \"id\": 9,\n                  \"options\": {\n                    \"default\": \"SPEED\"\n                  }\n                },\n                \"goPackage\": {\n                  \"type\": \"string\",\n                  \"id\": 11\n                },\n                \"ccGenericServices\": {\n                  \"type\": \"bool\",\n                  \"id\": 16,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"javaGenericServices\": {\n                  \"type\": \"bool\",\n                  \"id\": 17,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"pyGenericServices\": {\n                  \"type\": \"bool\",\n                  \"id\": 18,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 23,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"ccEnableArenas\": {\n                  \"type\": \"bool\",\n                  \"id\": 31,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"objcClassPrefix\": {\n                  \"type\": \"string\",\n                  \"id\": 36\n                },\n                \"csharpNamespace\": {\n                  \"type\": \"string\",\n                  \"id\": 37\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  38,\n                  38\n                ]\n              ],\n              \"nested\": {\n                \"OptimizeMode\": {\n                  \"values\": {\n                    \"SPEED\": 1,\n                    \"CODE_SIZE\": 2,\n                    \"LITE_RUNTIME\": 3\n                  }\n                }\n              }\n            },\n            \"MessageOptions\": {\n              \"fields\": {\n                \"messageSetWireFormat\": {\n                  \"type\": \"bool\",\n                  \"id\": 1,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"noStandardDescriptorAccessor\": {\n                  \"type\": \"bool\",\n                  \"id\": 2,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"mapEntry\": {\n                  \"type\": \"bool\",\n                  \"id\": 7\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  8,\n                  8\n                ]\n              ]\n            },\n            \"FieldOptions\": {\n              \"fields\": {\n                \"ctype\": {\n                  \"type\": \"CType\",\n                  \"id\": 1,\n                  \"options\": {\n                    \"default\": \"STRING\"\n                  }\n                },\n                \"packed\": {\n                  \"type\": \"bool\",\n                  \"id\": 2\n                },\n                \"jstype\": {\n                  \"type\": \"JSType\",\n                  \"id\": 6,\n                  \"options\": {\n                    \"default\": \"JS_NORMAL\"\n                  }\n                },\n                \"lazy\": {\n                  \"type\": \"bool\",\n                  \"id\": 5,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"weak\": {\n                  \"type\": \"bool\",\n                  \"id\": 10,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"reserved\": [\n                [\n                  4,\n                  4\n                ]\n              ],\n              \"nested\": {\n                \"CType\": {\n                  \"values\": {\n                    \"STRING\": 0,\n                    \"CORD\": 1,\n                    \"STRING_PIECE\": 2\n                  }\n                },\n                \"JSType\": {\n                  \"values\": {\n                    \"JS_NORMAL\": 0,\n                    \"JS_STRING\": 1,\n                    \"JS_NUMBER\": 2\n                  }\n                }\n              }\n            },\n            \"OneofOptions\": {\n              \"fields\": {\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"EnumOptions\": {\n              \"fields\": {\n                \"allowAlias\": {\n                  \"type\": \"bool\",\n                  \"id\": 2\n                },\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 3,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"EnumValueOptions\": {\n              \"fields\": {\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 1,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"ServiceOptions\": {\n              \"fields\": {\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 33,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ]\n            },\n            \"MethodOptions\": {\n              \"fields\": {\n                \"deprecated\": {\n                  \"type\": \"bool\",\n                  \"id\": 33,\n                  \"options\": {\n                    \"default\": false\n                  }\n                },\n                \"idempotencyLevel\": {\n                  \"type\": \"IdempotencyLevel\",\n                  \"id\": 34,\n                  \"options\": {\n                    \"default\": \"IDEMPOTENCY_UNKNOWN\"\n                  }\n                },\n                \"uninterpretedOption\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"UninterpretedOption\",\n                  \"id\": 999\n                }\n              },\n              \"extensions\": [\n                [\n                  1000,\n                  536870911\n                ]\n              ],\n              \"nested\": {\n                \"IdempotencyLevel\": {\n                  \"values\": {\n                    \"IDEMPOTENCY_UNKNOWN\": 0,\n                    \"NO_SIDE_EFFECTS\": 1,\n                    \"IDEMPOTENT\": 2\n                  }\n                }\n              }\n            },\n            \"UninterpretedOption\": {\n              \"fields\": {\n                \"name\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"NamePart\",\n                  \"id\": 2\n                },\n                \"identifierValue\": {\n                  \"type\": \"string\",\n                  \"id\": 3\n                },\n                \"positiveIntValue\": {\n                  \"type\": \"uint64\",\n                  \"id\": 4\n                },\n                \"negativeIntValue\": {\n                  \"type\": \"int64\",\n                  \"id\": 5\n                },\n                \"doubleValue\": {\n                  \"type\": \"double\",\n                  \"id\": 6\n                },\n                \"stringValue\": {\n                  \"type\": \"bytes\",\n                  \"id\": 7\n                },\n                \"aggregateValue\": {\n                  \"type\": \"string\",\n                  \"id\": 8\n                }\n              },\n              \"nested\": {\n                \"NamePart\": {\n                  \"fields\": {\n                    \"namePart\": {\n                      \"rule\": \"required\",\n                      \"type\": \"string\",\n                      \"id\": 1\n                    },\n                    \"isExtension\": {\n                      \"rule\": \"required\",\n                      \"type\": \"bool\",\n                      \"id\": 2\n                    }\n                  }\n                }\n              }\n            },\n            \"SourceCodeInfo\": {\n              \"fields\": {\n                \"location\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Location\",\n                  \"id\": 1\n                }\n              },\n              \"nested\": {\n                \"Location\": {\n                  \"fields\": {\n                    \"path\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"int32\",\n                      \"id\": 1,\n                      \"options\": {\n                        \"packed\": true\n                      }\n                    },\n                    \"span\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"int32\",\n                      \"id\": 2,\n                      \"options\": {\n                        \"packed\": true\n                      }\n                    },\n                    \"leadingComments\": {\n                      \"type\": \"string\",\n                      \"id\": 3\n                    },\n                    \"trailingComments\": {\n                      \"type\": \"string\",\n                      \"id\": 4\n                    },\n                    \"leadingDetachedComments\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"string\",\n                      \"id\": 6\n                    }\n                  }\n                }\n              }\n            },\n            \"GeneratedCodeInfo\": {\n              \"fields\": {\n                \"annotation\": {\n                  \"rule\": \"repeated\",\n                  \"type\": \"Annotation\",\n                  \"id\": 1\n                }\n              },\n              \"nested\": {\n                \"Annotation\": {\n                  \"fields\": {\n                    \"path\": {\n                      \"rule\": \"repeated\",\n                      \"type\": \"int32\",\n                      \"id\": 1,\n                      \"options\": {\n                        \"packed\": true\n                      }\n                    },\n                    \"sourceFile\": {\n                      \"type\": \"string\",\n                      \"id\": 2\n                    },\n                    \"begin\": {\n                      \"type\": \"int32\",\n                      \"id\": 3\n                    },\n                    \"end\": {\n                      \"type\": \"int32\",\n                      \"id\": 4\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "tests/data/test.proto",
    "content": "// Protocol Buffers - Google's data interchange format\n// Copyright 2008 Google Inc.  All rights reserved.\n// https://developers.google.com/protocol-buffers/\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n//     * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n//     * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// Author: mwr@google.com (Mark Rawling)\n\nsyntax = \"proto2\";\n\noption java_package = \"com.google.apps.jspb.proto\";\n\nimport \"google/protobuf/descriptor.proto\";\n\npackage jspb.test;\n\nmessage Empty {\n}\n\nenum OuterEnum {\n  FOO = 1;\n  BAR = 2;\n}\n\nmessage EnumContainer {\n  optional OuterEnum outer_enum = 1;\n}\n\nmessage Simple1 {\n  required string a_string = 1;\n  repeated string a_repeated_string = 2;\n  optional bool a_boolean = 3;\n}\n\n// A message that differs from Simple1 only by name\nmessage Simple2 {\n  required string a_string = 1;\n  repeated string a_repeated_string = 2;\n}\n\nmessage SpecialCases {\n  required string normal = 1;\n  // Examples of Js reserved names that are converted to pb_<name>.\n  required string default = 2;\n  required string function = 3;\n  required string var = 4;\n}\n\nmessage OptionalFields {\n  message Nested {\n    optional int32 an_int = 1;\n  }\n  optional string a_string = 1;\n  required bool a_bool = 2;\n  optional Nested a_nested_message = 3;\n  repeated Nested a_repeated_message = 4;\n  repeated string a_repeated_string = 5;\n}\n\nmessage HasExtensions {\n  optional string str1 = 1;\n  optional string str2 = 2;\n  optional string str3 = 3;\n  extensions 10 to max;\n}\n\nmessage Complex {\n  message Nested {\n    required int32 an_int = 2;\n  }\n  required string a_string = 1;\n  required bool an_out_of_order_bool = 9;\n  optional Nested a_nested_message = 4;\n  repeated Nested a_repeated_message = 5;\n  repeated string a_repeated_string = 7;\n}\n\nmessage OuterMessage {\n  // Make sure this doesn't conflict with the other Complex message.\n  message Complex {\n    optional int32 inner_complex_field = 1;\n  }\n}\n\nmessage IsExtension {\n  extend HasExtensions {\n    optional IsExtension ext_field = 100;\n  }\n  optional string ext1 = 1;\n\n  // Extensions of proto2 Descriptor messages will be ignored.\n  extend google.protobuf.EnumOptions {\n    optional string simple_option = 42113038;\n  }\n}\n\nmessage IndirectExtension {\n  extend HasExtensions {\n    optional Simple1 simple = 101;\n    optional string str = 102;\n    repeated string repeated_str = 103;\n    repeated Simple1 repeated_simple = 104;\n  }\n}\n\nextend HasExtensions {\n  optional Simple1 simple1 = 105;\n}\n\nmessage DefaultValues {\n  enum Enum {\n    E1 = 13;\n    E2 = 77;\n  }\n  optional string string_field = 1 [default=\"default<>\\'\\\"abc\"];\n  optional bool bool_field = 2 [default=true];\n  optional int64 int_field = 3 [default=11];\n  optional Enum enum_field = 4 [default=E1];\n  optional string empty_field = 6 [default=\"\"];\n  optional bytes bytes_field = 8 [default=\"moo\"]; // Base64 encoding is \"bW9v\"\n}\n\nmessage FloatingPointFields {\n  optional float optional_float_field = 1;\n  required float required_float_field = 2;\n  repeated float repeated_float_field = 3;\n  optional float default_float_field = 4 [default = 2.0];\n  optional double optional_double_field = 5;\n  required double required_double_field = 6;\n  repeated double repeated_double_field = 7;\n  optional double default_double_field = 8 [default = 2.0];\n}\n\nmessage TestClone {\n  optional string str = 1;\n  optional Simple1 simple1 = 3;\n  repeated Simple1 simple2 = 5;\n  optional bytes bytes_field = 6;\n  optional string unused = 7;\n  extensions 10 to max;\n}\n\nmessage CloneExtension {\n  extend TestClone {\n    optional CloneExtension ext_field = 100;\n  }\n  optional string ext = 2;\n}\n\nmessage TestGroup {\n  repeated group RepeatedGroup = 1 {\n    required string id = 1;\n    repeated bool some_bool = 2;\n  }\n  required group RequiredGroup = 2 {\n    required string id = 1;\n  }\n  optional group OptionalGroup = 3 {\n    required string id = 1;\n  }\n  optional group MessageInGroup = 4 {\n    message NestedMessage {\n      optional string id = 1;\n    }\n    required NestedMessage id = 1;\n  }\n  optional group EnumInGroup = 5 {\n    enum NestedEnum {\n      first = 0;\n      second = 1;\n    }\n    required NestedEnum id = 1;\n  }\n  optional string id = 6;\n  required Simple2 required_simple = 7;\n  optional Simple2 optional_simple = 8;\n}\n\nmessage TestGroup1 {\n  optional TestGroup.RepeatedGroup group = 1;\n}\n\nmessage TestReservedNames {\n  optional int32 extension = 1;\n  extensions 10 to max;\n}\n\nmessage TestReservedNamesExtension {\n  extend TestReservedNames {\n    optional int32 foo = 10;\n  }\n}\n\nmessage TestMessageWithOneof {\n\n  oneof partial_oneof {\n    string pone = 3;\n    string pthree = 5;\n  }\n\n  oneof recursive_oneof {\n    TestMessageWithOneof rone = 6;\n    string rtwo = 7;\n  }\n\n  optional bool normal_field = 8;\n  repeated string repeated_field = 9;\n\n  oneof default_oneof_a {\n    int32 aone = 10 [default = 1234];\n    int32 atwo = 11;\n  }\n\n  oneof default_oneof_b {\n    int32 bone = 12;\n    int32 btwo = 13 [default = 1234];\n  }\n}\n\nmessage TestEndsWithBytes {\n  optional int32 value = 1;\n  optional bytes data = 2;\n}\n\nmessage TestMapFieldsNoBinary {\n  map<string, string> map_string_string = 1;\n  map<string, int32> map_string_int32 = 2;\n  map<string, int64> map_string_int64 = 3;\n  map<string, bool> map_string_bool = 4;\n  map<string, double> map_string_double = 5;\n  map<string, MapValueEnumNoBinary> map_string_enum = 6;\n  map<string, MapValueMessageNoBinary> map_string_msg = 7;\n\n  map<int32, string> map_int32_string = 8;\n  map<int64, string> map_int64_string = 9;\n  map<bool, string> map_bool_string = 10;\n\n  optional TestMapFieldsNoBinary test_map_fields = 11;\n  map<string, TestMapFieldsNoBinary> map_string_testmapfields = 12;\n}\n\nenum MapValueEnumNoBinary {\n  MAP_VALUE_FOO_NOBINARY = 0;\n  MAP_VALUE_BAR_NOBINARY = 1;\n  MAP_VALUE_BAZ_NOBINARY = 2;\n}\n\nmessage MapValueMessageNoBinary {\n  optional int32 foo = 1;\n}\n\nmessage Deeply {\n  message Nested {\n    message Message {\n      optional int32 count = 1;\n    }\n  }\n}\n\noption java_multiple_files = true;\n"
  },
  {
    "path": "tests/data/type_url.js",
    "content": "/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/\n\"use strict\";\n\nvar $protobuf = require(\"../../minimal\");\n\n// Common aliases\nvar $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;\n\n// Exported root namespace\nvar $root = $protobuf.roots.test_type_url || ($protobuf.roots.test_type_url = {});\n\n$root.TypeUrlTest = (function() {\n\n    /**\n     * Properties of a TypeUrlTest.\n     * @exports ITypeUrlTest\n     * @interface ITypeUrlTest\n     * @property {TypeUrlTest.INested|null} [nested] TypeUrlTest nested\n     */\n\n    /**\n     * Constructs a new TypeUrlTest.\n     * @exports TypeUrlTest\n     * @classdesc Represents a TypeUrlTest.\n     * @implements ITypeUrlTest\n     * @constructor\n     * @param {ITypeUrlTest=} [properties] Properties to set\n     */\n    function TypeUrlTest(properties) {\n        if (properties)\n            for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                if (properties[keys[i]] != null)\n                    this[keys[i]] = properties[keys[i]];\n    }\n\n    /**\n     * TypeUrlTest nested.\n     * @member {TypeUrlTest.INested|null|undefined} nested\n     * @memberof TypeUrlTest\n     * @instance\n     */\n    TypeUrlTest.prototype.nested = null;\n\n    /**\n     * Creates a new TypeUrlTest instance using the specified properties.\n     * @function create\n     * @memberof TypeUrlTest\n     * @static\n     * @param {ITypeUrlTest=} [properties] Properties to set\n     * @returns {TypeUrlTest} TypeUrlTest instance\n     */\n    TypeUrlTest.create = function create(properties) {\n        return new TypeUrlTest(properties);\n    };\n\n    /**\n     * Encodes the specified TypeUrlTest message. Does not implicitly {@link TypeUrlTest.verify|verify} messages.\n     * @function encode\n     * @memberof TypeUrlTest\n     * @static\n     * @param {ITypeUrlTest} message TypeUrlTest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TypeUrlTest.encode = function encode(message, writer) {\n        if (!writer)\n            writer = $Writer.create();\n        if (message.nested != null && Object.hasOwnProperty.call(message, \"nested\"))\n            $root.TypeUrlTest.Nested.encode(message.nested, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();\n        return writer;\n    };\n\n    /**\n     * Encodes the specified TypeUrlTest message, length delimited. Does not implicitly {@link TypeUrlTest.verify|verify} messages.\n     * @function encodeDelimited\n     * @memberof TypeUrlTest\n     * @static\n     * @param {ITypeUrlTest} message TypeUrlTest message or plain object to encode\n     * @param {$protobuf.Writer} [writer] Writer to encode to\n     * @returns {$protobuf.Writer} Writer\n     */\n    TypeUrlTest.encodeDelimited = function encodeDelimited(message, writer) {\n        return this.encode(message, writer).ldelim();\n    };\n\n    /**\n     * Decodes a TypeUrlTest message from the specified reader or buffer.\n     * @function decode\n     * @memberof TypeUrlTest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @param {number} [length] Message length if known beforehand\n     * @returns {TypeUrlTest} TypeUrlTest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TypeUrlTest.decode = function decode(reader, length) {\n        if (!(reader instanceof $Reader))\n            reader = $Reader.create(reader);\n        var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TypeUrlTest();\n        while (reader.pos < end) {\n            var tag = reader.uint32();\n            switch (tag >>> 3) {\n            case 1:\n                message.nested = $root.TypeUrlTest.Nested.decode(reader, reader.uint32());\n                break;\n            default:\n                reader.skipType(tag & 7);\n                break;\n            }\n        }\n        return message;\n    };\n\n    /**\n     * Decodes a TypeUrlTest message from the specified reader or buffer, length delimited.\n     * @function decodeDelimited\n     * @memberof TypeUrlTest\n     * @static\n     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n     * @returns {TypeUrlTest} TypeUrlTest\n     * @throws {Error} If the payload is not a reader or valid buffer\n     * @throws {$protobuf.util.ProtocolError} If required fields are missing\n     */\n    TypeUrlTest.decodeDelimited = function decodeDelimited(reader) {\n        if (!(reader instanceof $Reader))\n            reader = new $Reader(reader);\n        return this.decode(reader, reader.uint32());\n    };\n\n    /**\n     * Verifies a TypeUrlTest message.\n     * @function verify\n     * @memberof TypeUrlTest\n     * @static\n     * @param {Object.<string,*>} message Plain object to verify\n     * @returns {string|null} `null` if valid, otherwise the reason why it is not\n     */\n    TypeUrlTest.verify = function verify(message) {\n        if (typeof message !== \"object\" || message === null)\n            return \"object expected\";\n        if (message.nested != null && message.hasOwnProperty(\"nested\")) {\n            var error = $root.TypeUrlTest.Nested.verify(message.nested);\n            if (error)\n                return \"nested.\" + error;\n        }\n        return null;\n    };\n\n    /**\n     * Creates a TypeUrlTest message from a plain object. Also converts values to their respective internal types.\n     * @function fromObject\n     * @memberof TypeUrlTest\n     * @static\n     * @param {Object.<string,*>} object Plain object\n     * @returns {TypeUrlTest} TypeUrlTest\n     */\n    TypeUrlTest.fromObject = function fromObject(object) {\n        if (object instanceof $root.TypeUrlTest)\n            return object;\n        var message = new $root.TypeUrlTest();\n        if (object.nested != null) {\n            if (typeof object.nested !== \"object\")\n                throw TypeError(\".TypeUrlTest.nested: object expected\");\n            message.nested = $root.TypeUrlTest.Nested.fromObject(object.nested);\n        }\n        return message;\n    };\n\n    /**\n     * Creates a plain object from a TypeUrlTest message. Also converts values to other types if specified.\n     * @function toObject\n     * @memberof TypeUrlTest\n     * @static\n     * @param {TypeUrlTest} message TypeUrlTest\n     * @param {$protobuf.IConversionOptions} [options] Conversion options\n     * @returns {Object.<string,*>} Plain object\n     */\n    TypeUrlTest.toObject = function toObject(message, options) {\n        if (!options)\n            options = {};\n        var object = {};\n        if (options.defaults)\n            object.nested = null;\n        if (message.nested != null && message.hasOwnProperty(\"nested\"))\n            object.nested = $root.TypeUrlTest.Nested.toObject(message.nested, options);\n        return object;\n    };\n\n    /**\n     * Converts this TypeUrlTest to JSON.\n     * @function toJSON\n     * @memberof TypeUrlTest\n     * @instance\n     * @returns {Object.<string,*>} JSON object\n     */\n    TypeUrlTest.prototype.toJSON = function toJSON() {\n        return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n    };\n\n    /**\n     * Gets the default type url for TypeUrlTest\n     * @function getTypeUrl\n     * @memberof TypeUrlTest\n     * @static\n     * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n     * @returns {string} The default type url\n     */\n    TypeUrlTest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n        if (typeUrlPrefix === undefined) {\n            typeUrlPrefix = \"type.googleapis.com\";\n        }\n        return typeUrlPrefix + \"/TypeUrlTest\";\n    };\n\n    TypeUrlTest.Nested = (function() {\n\n        /**\n         * Properties of a Nested.\n         * @memberof TypeUrlTest\n         * @interface INested\n         * @property {string|null} [a] Nested a\n         */\n\n        /**\n         * Constructs a new Nested.\n         * @memberof TypeUrlTest\n         * @classdesc Represents a Nested.\n         * @implements INested\n         * @constructor\n         * @param {TypeUrlTest.INested=} [properties] Properties to set\n         */\n        function Nested(properties) {\n            if (properties)\n                for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)\n                    if (properties[keys[i]] != null)\n                        this[keys[i]] = properties[keys[i]];\n        }\n\n        /**\n         * Nested a.\n         * @member {string} a\n         * @memberof TypeUrlTest.Nested\n         * @instance\n         */\n        Nested.prototype.a = \"\";\n\n        /**\n         * Creates a new Nested instance using the specified properties.\n         * @function create\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {TypeUrlTest.INested=} [properties] Properties to set\n         * @returns {TypeUrlTest.Nested} Nested instance\n         */\n        Nested.create = function create(properties) {\n            return new Nested(properties);\n        };\n\n        /**\n         * Encodes the specified Nested message. Does not implicitly {@link TypeUrlTest.Nested.verify|verify} messages.\n         * @function encode\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {TypeUrlTest.INested} message Nested message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        Nested.encode = function encode(message, writer) {\n            if (!writer)\n                writer = $Writer.create();\n            if (message.a != null && Object.hasOwnProperty.call(message, \"a\"))\n                writer.uint32(/* id 1, wireType 2 =*/10).string(message.a);\n            return writer;\n        };\n\n        /**\n         * Encodes the specified Nested message, length delimited. Does not implicitly {@link TypeUrlTest.Nested.verify|verify} messages.\n         * @function encodeDelimited\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {TypeUrlTest.INested} message Nested message or plain object to encode\n         * @param {$protobuf.Writer} [writer] Writer to encode to\n         * @returns {$protobuf.Writer} Writer\n         */\n        Nested.encodeDelimited = function encodeDelimited(message, writer) {\n            return this.encode(message, writer).ldelim();\n        };\n\n        /**\n         * Decodes a Nested message from the specified reader or buffer.\n         * @function decode\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @param {number} [length] Message length if known beforehand\n         * @returns {TypeUrlTest.Nested} Nested\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        Nested.decode = function decode(reader, length) {\n            if (!(reader instanceof $Reader))\n                reader = $Reader.create(reader);\n            var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TypeUrlTest.Nested();\n            while (reader.pos < end) {\n                var tag = reader.uint32();\n                switch (tag >>> 3) {\n                case 1:\n                    message.a = reader.string();\n                    break;\n                default:\n                    reader.skipType(tag & 7);\n                    break;\n                }\n            }\n            return message;\n        };\n\n        /**\n         * Decodes a Nested message from the specified reader or buffer, length delimited.\n         * @function decodeDelimited\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from\n         * @returns {TypeUrlTest.Nested} Nested\n         * @throws {Error} If the payload is not a reader or valid buffer\n         * @throws {$protobuf.util.ProtocolError} If required fields are missing\n         */\n        Nested.decodeDelimited = function decodeDelimited(reader) {\n            if (!(reader instanceof $Reader))\n                reader = new $Reader(reader);\n            return this.decode(reader, reader.uint32());\n        };\n\n        /**\n         * Verifies a Nested message.\n         * @function verify\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {Object.<string,*>} message Plain object to verify\n         * @returns {string|null} `null` if valid, otherwise the reason why it is not\n         */\n        Nested.verify = function verify(message) {\n            if (typeof message !== \"object\" || message === null)\n                return \"object expected\";\n            if (message.a != null && message.hasOwnProperty(\"a\"))\n                if (!$util.isString(message.a))\n                    return \"a: string expected\";\n            return null;\n        };\n\n        /**\n         * Creates a Nested message from a plain object. Also converts values to their respective internal types.\n         * @function fromObject\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {Object.<string,*>} object Plain object\n         * @returns {TypeUrlTest.Nested} Nested\n         */\n        Nested.fromObject = function fromObject(object) {\n            if (object instanceof $root.TypeUrlTest.Nested)\n                return object;\n            var message = new $root.TypeUrlTest.Nested();\n            if (object.a != null)\n                message.a = String(object.a);\n            return message;\n        };\n\n        /**\n         * Creates a plain object from a Nested message. Also converts values to other types if specified.\n         * @function toObject\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {TypeUrlTest.Nested} message Nested\n         * @param {$protobuf.IConversionOptions} [options] Conversion options\n         * @returns {Object.<string,*>} Plain object\n         */\n        Nested.toObject = function toObject(message, options) {\n            if (!options)\n                options = {};\n            var object = {};\n            if (options.defaults)\n                object.a = \"\";\n            if (message.a != null && message.hasOwnProperty(\"a\"))\n                object.a = message.a;\n            return object;\n        };\n\n        /**\n         * Converts this Nested to JSON.\n         * @function toJSON\n         * @memberof TypeUrlTest.Nested\n         * @instance\n         * @returns {Object.<string,*>} JSON object\n         */\n        Nested.prototype.toJSON = function toJSON() {\n            return this.constructor.toObject(this, $protobuf.util.toJSONOptions);\n        };\n\n        /**\n         * Gets the default type url for Nested\n         * @function getTypeUrl\n         * @memberof TypeUrlTest.Nested\n         * @static\n         * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default \"type.googleapis.com\")\n         * @returns {string} The default type url\n         */\n        Nested.getTypeUrl = function getTypeUrl(typeUrlPrefix) {\n            if (typeUrlPrefix === undefined) {\n                typeUrlPrefix = \"type.googleapis.com\";\n            }\n            return typeUrlPrefix + \"/TypeUrlTest.Nested\";\n        };\n\n        return Nested;\n    })();\n\n    return TypeUrlTest;\n})();\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/data/type_url.proto",
    "content": "syntax = \"proto3\";\n\nmessage TypeUrlTest {\n    message Nested {\n        string a = 1;\n    }\n    Nested nested = 1;\n}\n"
  },
  {
    "path": "tests/data/uncommon.proto",
    "content": "package uncommon;\n\nimport public 'common.proto';\n\nsyntax = 'proto3';\n\noption java_package = 'com.google.protobuf';\n\nmessage Test;\n\nmessage Test2 {\n    float hex = 0x1 [default=0x1];\n    float oct = 02 [default=02];\n    float zero = 3 [default=0];\n    float inf = 4 [default=inf];\n    float nan = 5 [default=nan];\n\n    /** pre */\n    repeated group lower = 6 {}; /// post\n\n    /** pre */\n    map<string,string> ambiguousComments = 7; /// post\n\n    string str = 8 {\n        option default = \"a\";\n    }\n\n    map<string,string> strmap = 9 {\n        option (custom) = \"\";\n    };\n\n    map<uint64,Test> longmap = 10;\n\n    int32 optionTest = 11 [(my_options) = { a: \"foo\" b {} }];\n\n    /** pre */\n    oneof kind;\n    oneof kind2; /// post\n\n    /** pre */\n    oneof kind3 {\n        option (custom) = \"\"; /// post\n    };\n\n    option (custom) = -42;\n\n    extend Test;\n    extend Test{};\n    extend Test{required int32 a=1;} // not validated by the parser\n    extend Test{Test inner_ext=1000;} // not validated by the parser\n\n    extensions 1000 to 1999 [declaration = {\n        number: 1000\n        full_name: 'uncommon.Test.inner_ext'\n        type: 'uncommon.Test'\n    }];\n};\n\nenum Test3;\n\nenum Test4{\n    option (custom).foo = \"\";\n    ONE = 1 [foo=\"bar\"];\n    TWO = 2 [(my_options) = { a: \"foo\" b { c: \"bar\" } }];\n    THREE = 3 {\n        option (custom).bar = \"\";\n    };\n};\n\nenum Test4_1{\n    OPTION = 1;\n}\n\nenum ReservedEnum{\n    RESERVED_UNKNOWN = 0;\n\n    reserved 1 to 5;\n    reserved \"abc\", \"INVALID\";\n    reserved 10;\n    reserved 11 to 20 {\n        option foo = true;\n    }\n}\n\nservice Test5;\n\nservice Test6 { option (custom).bar = \"\";\n    message DoSomethingRequest;\n    message DoSomethingResponse;\n\n    rpc DoSomething(stream DoSomethingRequest) returns (stream DoSomethingResponse){ option (custom).foo2 = \"\"; };\n    /** pre */\n    rpc DoSomethingElse(   stream DoSomethingRequest  ) returns (DoSomethingResponse); /// post\n    rpc DoSomethingEntirelyDifferent(DoSomethingRequest  ) returns (   stream DoSomethingResponse ); /// post\n};\n\nmessage Test7 {\n  repeated group RepeatedGroup = 1 {\n    optional string id = 2;\n    reserved 3;\n    optional string info = 4;\n  }\n}\n"
  },
  {
    "path": "tests/data/weak-other.proto",
    "content": "import weak \"NOT_FOUND2\";\n"
  },
  {
    "path": "tests/data/weak.proto",
    "content": "import \"google/protobuf/any.proto\";\nimport weak \"NOT_FOUND\";\nimport \"weak-other.proto\";\n"
  },
  {
    "path": "tests/data/whitespace-in-type.proto",
    "content": "syntax = \"proto3\";\n\npackage some.really.long.name.which.does.not.really.make.any.sense.but.sometimes.we.still.see.stuff.like.this;\n\nmessage WouldYouParseThisForMePlease {\n  optional some.really.long. name . which . does .not\n    .really.make.any. sense.but.\n    sometimes.we.still\n    .\n    see.stuff .like.this\n    .Test field = 1;\n}\n\nmessage Test {\n  string field = 1;\n}\n"
  },
  {
    "path": "tests/docs_comments.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"proto comments\", function(test) {\n    test.plan(11);\n    protobuf.load(\"tests/data/comments.proto\", function(err, root) {\n        if (err)\n            throw test.fail(err.message);\n\n        test.equal(root.lookup(\"Test1\").comment, \"Message\\nwith\\na\\ncomment.\", \"should parse /**-blocks\");\n        test.equal(root.lookup(\"Test2\").comment, null, \"should not parse //-blocks\");\n        test.equal(root.lookup(\"Test3\").comment, null, \"should not parse /*-blocks\");\n\n        test.equal(root.lookup(\"Test1.field1\").comment, \"Field with a comment.\", \"should parse blocks for message fields\");\n        test.equal(root.lookup(\"Test1.field2\").comment, null, \"should not parse lines for message fields\");\n        test.equal(root.lookup(\"Test1.field3\").comment, \"Field with a comment and a <a href=\\\"http://example.com/foo/\\\">link</a>\", \"should parse triple-slash lines for message fields\");\n\n        test.equal(root.lookup(\"Test3\").comments.ONE, \"Value with a comment.\", \"should parse blocks for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.TWO, null, \"should not parse lines for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.THREE, \"Preferred value with a comment.\", \"should parse lines for enum values and prefer on top over trailing\");\n        test.equal(root.lookup(\"Test3\").comments.FOUR, \"Other value with a comment.\", \"should not confuse previous trailing comments with comments for the next field\");\n        test.equal(root.lookup(\"Test3\").comments.FIVE, \"Leading comment for value with both types of comments after field with trailing comment.\", \"should not confuse previous field with trailing comment when leading comment is present\");\n\n        test.end();\n    });\n});\n\ntape.test(\"proto comments with trailing comment preferred\", function(test) {\n    test.plan(11);\n    var options = {preferTrailingComment: true};\n    var root = new protobuf.Root();\n    root.load(\"tests/data/comments.proto\", options, function(err, root) {\n        if (err)\n            throw test.fail(err.message);\n\n        test.equal(root.lookup(\"Test1\").comment, \"Message\\nwith\\na\\ncomment.\", \"should parse /**-blocks\");\n        test.equal(root.lookup(\"Test2\").comment, null, \"should not parse //-blocks\");\n        test.equal(root.lookup(\"Test3\").comment, null, \"should not parse /*-blocks\");\n\n        test.equal(root.lookup(\"Test1.field1\").comment, \"Field with a comment.\", \"should parse blocks for message fields\");\n        test.equal(root.lookup(\"Test1.field2\").comment, null, \"should not parse lines for message fields\");\n        test.equal(root.lookup(\"Test1.field3\").comment, \"Field with a comment and a <a href=\\\"http://example.com/foo/\\\">link</a>\", \"should parse triple-slash lines for message fields\");\n\n        test.equal(root.lookup(\"Test3\").comments.ONE, \"Value with a comment.\", \"should parse blocks for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.TWO, null, \"should not parse lines for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.THREE, \"Value with a comment.\", \"should prefer trailing comment when preferTrailingComment option enabled\");\n        test.equal(root.lookup(\"Test3\").comments.FOUR, \"Other value with a comment.\", \"should not confuse previous trailing comments with comments for the next field\");\n        test.equal(root.lookup(\"Test3\").comments.FIVE, \"Trailing comment for value with both types of comments after field with trailing comment.\", \"should not confuse previous field with trailing comment when leading comment is present\");\n\n        test.end();\n    });\n});\n"
  },
  {
    "path": "tests/docs_comments_alternate_parse.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"proto comments in alternate-parse mode\", function(test) {\n    test.plan(27);\n    var options = {alternateCommentMode: true};\n    var root = new protobuf.Root();\n    root.load(\"tests/data/comments-alternate-parse.proto\", options, function(err, root) {\n        if (err)\n            throw test.fail(err.message);\n\n        test.equal(root.lookup(\"Test1\").comment, \"Message with\\na\\nmulti-line comment.\", \"should parse double-slash multiline comment\");\n        test.equal(root.lookup(\"Test2\").comment, \"Message\\nwith\\na multiline plain slash-star\\ncomment.\", \"should parse slash-star multiline comment\");\n        test.equal(root.lookup(\"Test3\").comment, \"Message\\nwith\\na\\ncomment and stars.\", \"should parse doc-block multiline comment\");\n        test.equal(root.lookup(\"Test4\").comment, \"followed by a block comment, followed by a newline. (issue #1616)\", \"should parse double slash comment followed by block comment\");\n        test.equal(root.lookup(\"Test5\").comment, \"line comment with\\nwhitespace in front\", \"should ignore leading whitespace when parsing line comments\");\n        test.equal(root.lookup(\"Test6\").comment, \"with strange whitespace\", \"should parse block comment preceeded by double slash comments with leading whitespace\");\n\n        test.equal(root.lookup(\"Test1.field1\").comment, \"Field with a doc-block comment.\", \"should parse doc-block field comment\");\n        test.equal(root.lookup(\"Test1.field2\").comment, \"Field with a single-line comment starting with two slashes.\", \"should parse double-slash field comment\");\n        test.equal(root.lookup(\"Test1.field3\").comment, \"Field with a single-line comment starting with three slashes.\", \"should parse triple-slash field comment\");\n        test.equal(root.lookup(\"Test1.field4\").comment, \"Field with a single-line slash-star comment.\", \"should parse single-line slash-star field comment\");\n        test.equal(root.lookup(\"Test1.field5\").comment, \"Field with a trailing single-line two-slash comment.\", \"should parse trailing double-slash comment\");\n        test.equal(root.lookup(\"Test1.field6\").comment, \"Field with a trailing single-line three-slash comment.\", \"should parse trailing triple-slash comment\");\n        test.equal(root.lookup(\"Test1.field7\").comment, \"Field with a trailing single-line slash-star comment.\", \"should parse trailing slash-star comment\");\n        test.equal(root.lookup(\"Test1.field8\").comment, null, \"should parse no comment\");\n        test.equal(root.lookup(\"Test1.field9\").comment, \"Field with a\\nmulti-line comment.\", \"should parse multiline double-slash field comment\");\n        test.equal(root.lookup(\"Test1.field10\").comment, \"Field with a\\nmulti-line doc-block comment.\", \"should parse multiline doc-block field comment\");\n        test.equal(root.lookup(\"Test1.field11\").comment, \"Field with both block comment\", \"should parse both trailing comment and trailing comment\");\n        test.equal(root.lookup(\"Test1.field12\").comment, \"Trailing comment in last line should not be recognized as leading comment for this field.\", \"trailing comment in last line should not be recognized as leading comment for this field\");\n\n        test.equal(root.lookup(\"Test3\").comments.ONE, \"Value with a comment.\", \"should parse blocks for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.TWO, \"Value with a single-line comment.\", \"should parse double-slash comments for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.THREE, \"Value with a triple-slash comment.\", \"should parse lines for enum values and prefer on top over trailing\");\n        test.equal(root.lookup(\"Test3\").comments.FOUR, \"Other value with a comment.\", \"should not confuse previous trailing comments with comments for the next field\");\n        test.equal(root.lookup(\"Test3\").comments.FIVE, \"Leading comment for value with both types of comments after field with trailing comment.\", \"should not confuse previous field with trailing comment when leading comment is present\");\n\n        test.equal(root.lookup(\"ServiceTest.SingleLineMethod\").comment, 'My method does things');\n        test.equal(root.lookup(\"ServiceTest.TwoLineMethodWithComment\").comment, 'TwoLineMethodWithComment documentation');\n        test.equal(root.lookup(\"ServiceTest.ThreeLine012345678901234567890123456712345671234567123456783927483923473892837489238749832432874983274983274983274\").comment, 'Very very long method');\n        test.equal(root.lookup(\"ServiceTest.TwoLineMethodNoComment\").comment, null);\n\n        test.end();\n    });\n});\n\ntape.test(\"proto comments in alternate-parse mode with trailing comment preferred\", function(test) {\n    test.plan(24);\n    var options = {alternateCommentMode: true, preferTrailingComment: true};\n    var root = new protobuf.Root();\n    root.load(\"tests/data/comments-alternate-parse.proto\", options, function(err, root) {\n        if (err)\n            throw test.fail(err.message);\n\n        test.equal(root.lookup(\"Test1\").comment, \"Message with\\na\\nmulti-line comment.\", \"should parse double-slash multiline comment\");\n        test.equal(root.lookup(\"Test2\").comment, \"Message\\nwith\\na multiline plain slash-star\\ncomment.\", \"should parse slash-star multiline comment\");\n        test.equal(root.lookup(\"Test3\").comment, \"Message\\nwith\\na\\ncomment and stars.\", \"should parse doc-block multiline comment\");\n\n        test.equal(root.lookup(\"Test1.field1\").comment, \"Field with a doc-block comment.\", \"should parse doc-block field comment\");\n        test.equal(root.lookup(\"Test1.field2\").comment, \"Field with a single-line comment starting with two slashes.\", \"should parse double-slash field comment\");\n        test.equal(root.lookup(\"Test1.field3\").comment, \"Field with a single-line comment starting with three slashes.\", \"should parse triple-slash field comment\");\n        test.equal(root.lookup(\"Test1.field4\").comment, \"Field with a single-line slash-star comment.\", \"should parse single-line slash-star field comment\");\n        test.equal(root.lookup(\"Test1.field5\").comment, \"Field with a trailing single-line two-slash comment.\", \"should parse trailing double-slash comment\");\n        test.equal(root.lookup(\"Test1.field6\").comment, \"Field with a trailing single-line three-slash comment.\", \"should parse trailing triple-slash comment\");\n        test.equal(root.lookup(\"Test1.field7\").comment, \"Field with a trailing single-line slash-star comment.\", \"should parse trailing slash-star comment\");\n        test.equal(root.lookup(\"Test1.field8\").comment, null, \"should parse no comment\");\n        test.equal(root.lookup(\"Test1.field9\").comment, \"Field with a\\nmulti-line comment.\", \"should parse multiline double-slash field comment\");\n        test.equal(root.lookup(\"Test1.field10\").comment, \"Field with a\\nmulti-line doc-block comment.\", \"should parse multiline doc-block field comment\");\n        test.equal(root.lookup(\"Test1.field11\").comment, \"and trailing comment.\", \"should parse both trailing comment and trailing comment\");\n        test.equal(root.lookup(\"Test1.field12\").comment, \"Trailing comment in last line should not be recognized as leading comment for this field.\", \"trailing comment in last line should not be recognized as leading comment for this field\");\n\n        test.equal(root.lookup(\"Test3\").comments.ONE, \"Value with a comment.\", \"should parse blocks for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.TWO, \"Value with a single-line comment.\", \"should parse double-slash comments for enum values\");\n        test.equal(root.lookup(\"Test3\").comments.THREE, \"ignored\", \"should prefer trailing comment when preferTrailingComment option enabled\");\n        test.equal(root.lookup(\"Test3\").comments.FOUR, \"Other value with a comment.\", \"should not confuse previous trailing comments with comments for the next field\");\n        test.equal(root.lookup(\"Test3\").comments.FIVE, \"Trailing comment for value with both types of comments after field with trailing comment.\", \"should not confuse previous field with trailing comment when leading comment is present\");\n\n        test.equal(root.lookup(\"ServiceTest.SingleLineMethod\").comment, 'My method does things');\n        test.equal(root.lookup(\"ServiceTest.TwoLineMethodWithComment\").comment, 'TwoLineMethodWithComment documentation');\n        test.equal(root.lookup(\"ServiceTest.ThreeLine012345678901234567890123456712345671234567123456783927483923473892837489238749832432874983274983274983274\").comment, 'Very very long method');\n        test.equal(root.lookup(\"ServiceTest.TwoLineMethodNoComment\").comment, null);\n\n        test.end();\n    });\n});\n"
  },
  {
    "path": "tests/feature_grammar.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"editions required keyword\", function(test) {\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n    message A {\\\n        required uint32 a = 1;\\\n    }`);\n    }, /Error: illegal token 'required'/);\n    \n    test.end();\n});\n\ntape.test(\"editions optional keyword\", function(test) {\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        message A {\\\n        optional uint32 a = 1;\\\n    }`);\n    }, /Error: illegal token 'optional'/);\n\n    test.end();\n});\n\ntape.test(\"editions group keyword\", function(test) {\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        message A {\\\n            group uint32 a = 1;\\\n        }`);\n    }, /Error: illegal token 'group'/);\n\n    test.end();\n});\n\ntape.test(\"editions no quote\", function(test) {\n    test.ok(protobuf.parse(`edition = \"2023\";\n    message Foo {\n        reserved bar, baz;\n    }`));\n    \n    test.end();\n});\n\n\ntape.test(\"edition 2023 reserved\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n    message Foo {\n        reserved bar, baz;\n    }`).root.resolveAll();\n    test.same(root.Foo.reserved, [\"bar\", \"baz\"], \"reserved fields should be parsed\");\n\n    root = protobuf.parse(`edition = \"2023\";\n    enum Foo {\n        reserved BAR, BAZ_BAZ;\n    }`).root.resolveAll();\n    test.same(root.nested.Foo.reserved, [\"BAR\", \"BAZ_BAZ\"], \"reserved values should be parsed\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        message Foo {\n            reserved \"bar\", \"baz\";\n        }`);\n    }, /Error: illegal id 'bar'/, \"reserved field strings should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        enum Foo {\n            reserved \"BAR\", \"BAZ\";\n        }`);\n    }, /Error: illegal id 'BAR'/, \"reserved enum value strings should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`syntax = \"proto3\";\n        message Foo {\n            reserved bar, baz;\n        }`);\n    }, /Error: illegal id 'bar'/, \"reserved field strings should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`syntax = \"proto3\";\n        enum Foo {\n            reserved BAR, BAZ;\n        }`);\n    }, /Error: illegal id 'BAR'/, \"reserved enum value strings should be banned\");\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/feature_resolution_editions.js",
    "content": "/*\nedition = \"2023\";\n\noption features.amazing_feature = A;\noption (mo_single_msg).nested.value = \"x\";\nservice MyService {\n    option features.amazing_feature = E;\n    message MyRequest {};\n    message MyResponse {};\n    rpc MyMethod (MyRequest) returns (MyResponse) {\n        option features.amazing_feature = L;\n    };\n}\n\nmessage Message {\n    option features.amazing_feature = B;\n\n    string string_val = 1;\n    string string_repeated = 2 [features.amazing_feature = F];\n\n    uint64 uint64_val = 3;\n    uint64 uint64_repeated = 4;\n\n    bytes bytes_val = 5;\n    bytes bytes_repeated = 6;\n\n    SomeEnum enum_val = 7;\n    SomeEnum enum_repeated = 8;\n\n    extensions 10 to 100;\n    extend Message {\n        int32 bar = 10 [features.amazing_feature = I];\n    }\n\n    message Nested {\n        option features.amazing_feature = H;\n        int64 count = 9;\n    }\n\n    enum SomeEnumInMessage {\n        option features.amazing_feature = G;\n        ONE = 11;\n        TWO = 12;\n    }\n    \n    oneof SomeOneOf {\n        option features.amazing_feature = J;\n        int32 a = 13;\n        string b = 14;\n    }\n\n    map<string,int64> int64_map = 15;\n}\n\nextend Message {\n    int32 bar = 16 [features.amazing_feature = D];\n}\n\nenum SomeEnum {\n    option features.amazing_feature = C;\n    ONE = 1 [features.amazing_feature = K];\n    TWO = 2;\n}\n*/\nvar tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar protoEditions2024 = `edition = \"2024\";  message Foo {}`;\nvar protoEditions2023 = `edition = \"2023\";  message Foo {}`;\n\nvar proto2 = `syntax = \"proto2\";  message Foo {}`;\n\nvar proto3 = `syntax = \"proto3\";  message Foo {}`;\n\nvar editions2024Defaults = {enum_type: \"OPEN\", field_presence: \"EXPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\", enforce_naming_style: \"STYLE2024\", default_symbol_visibility: \"EXPORT_TOP_LEVEL\" };\nvar editions2023Defaults = {enum_type: \"OPEN\", field_presence: \"EXPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\", enforce_naming_style: \"STYLE_LEGACY\", default_symbol_visibility: \"EXPORT_ALL\" };\nvar proto2Defaults = {enum_type: \"CLOSED\", field_presence: \"EXPLICIT\", json_format: \"LEGACY_BEST_EFFORT\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"EXPANDED\", utf8_validation: \"NONE\", enforce_naming_style: \"STYLE_LEGACY\", default_symbol_visibility: \"EXPORT_ALL\" };\nvar proto3Defaults = {enum_type: \"OPEN\", field_presence: \"IMPLICIT\", json_format: \"ALLOW\", message_encoding: \"LENGTH_PREFIXED\", repeated_field_encoding: \"PACKED\", utf8_validation: \"VERIFY\", enforce_naming_style: \"STYLE_LEGACY\", default_symbol_visibility: \"EXPORT_ALL\" };\n\ntape.test(\"feature resolution defaults\", function(test) {\n    var rootEditions = protobuf.parse(protoEditions2024).root;\n    rootEditions.resolveAll();\n    test.same(rootEditions.Foo._features, editions2024Defaults);\n\n    var rootProto2 = protobuf.parse(proto2).root;\n    rootProto2.resolveAll();\n    test.same(rootProto2.Foo._features, proto2Defaults);\n\n    var rootProto3 = protobuf.parse(proto3).root;\n    rootProto3.resolveAll();\n    test.same(rootProto3.Foo._features, proto3Defaults);\n\n    test.end();\n})\n\ntape.test(\"unresolved feature options\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n\n    message Message {\n        option features.enum_type = CLOSED;\n        string string_val = 1;\n        string string_repeated = 2;\n    }`).root.resolveAll();\n\n    test.same(root.lookup(\"Message\").options.features, {\n        \"enum_type\": \"CLOSED\",\n        \"json_format\": \"LEGACY_BEST_EFFORT\",\n        \"(abc)\": { \"d_e\": \"deeply_nested_false\" },\n    });\n\n    test.end();\n});\n\ntape.test(\"aggregate feature parsing\", function(test) {\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n    option features = {\n        utf8_validation: VERIFY\n        json_format: LEGACY_BEST_EFFORT\n        field_presence: IMPLICIT\n    };\n\n    message Message {\n        option features = {\n            utf8_validation: NONE\n            enum_type: OPEN\n        };\n        string string_val = 1;\n        string string_repeated = 2 [features = { enum_type: CLOSED field_presence: LEGACY_REQUIRED }];\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"Message\").fields.stringRepeated._features, {\n        enum_type: 'CLOSED',\n        field_presence: 'LEGACY_REQUIRED',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\"\n    })\n    \n    test.end();\n});\n\ntape.test(\"feature resolution inheritance file to message\", function(test) {\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n\n    message Message {\n        string string_val = 1;\n        string string_repeated = 2 [features.enum_type = CLOSED];\n    }`).root.resolveAll();\n\n    // Should flip enum_type from default setting, inherit from Message,\n    // and keep everything else\n    test.same(rootEditionsOverriden.lookup(\"Message\").fields.stringRepeated._features, {\n        enum_type: 'CLOSED',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' }\n    })\n    \n    test.end();\n});\n\ntape.test(\"feature resolution inheritance message to field\", function(test) {\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n\n    message Message {\n        option features.json_format = LEGACY_BEST_EFFORT;\n        option features.(abc).d_e = deeply_nested_false;\n        string string_val = 1;\n        string string_repeated = 2 [features.enum_type = CLOSED];\n    }`).root.resolveAll();\n\n    // Should flip enum_type from default setting, inherit from Message,\n    // and keep everything else\n    test.same(rootEditionsOverriden.lookup(\"Message\").fields.stringRepeated._features, {\n        enum_type: 'CLOSED',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' }\n    })\n    \n    test.end();\n});\n\ntape.test(\"feature resolution inheritance message to nested message\", function(test) {\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\"; \n    message Message {\n        option features.json_format = LEGACY_BEST_EFFORT;\n        option features.(abc).d_e = deeply_nested_false;\n        string string_val = 1;\n        string string_repeated = 2 [features.enum_type = CLOSED];\n\n    message Nested {\n        option features.(abc).d_e = deeply_nested_true;\n        option features.field_presence = IMPLICIT;\n        int64 count = 9;\n    }\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"Message\").lookup(\"Nested\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_true' } \n    });\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance enum to enum value\", function(test) {\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n\n    option features.(abc).d_e = deeply_nested_false;\n    message Message {\n        enum SomeEnum {\n            option features.field_presence = IMPLICIT;\n            ONE = 1 [features.repeated_field_encoding = EXPANDED];\n            TWO = 2;\n        }\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookupEnum(\"SomeEnum\")._valuesFeatures[\"ONE\"], {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'EXPANDED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.same(rootEditionsOverriden.lookupEnum(\"SomeEnum\")._valuesFeatures[\"TWO\"], {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' }\n    });\n\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance message to oneofs\", function(test) {\n\n    var rootEditionsOverriden = protobuf.parse(`\n    edition = \"2023\";\n    option features.(abc).d_e = deeply_nested_false;\n    message Message {\n        option features.json_format = LEGACY_BEST_EFFORT;\n        oneof SomeOneOf {\n            int32 a = 13;\n            string b = 14;\n        }\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"SomeOneOf\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\n\ntape.test(\"feature resolution inheritance oneofs\", function(test) {\n\n    var rootEditionsOverriden = protobuf.parse(`\n    edition = \"2023\";\n    option features.(abc).d_e = deeply_nested_false;\n    message Message {\n        oneof SomeOneOf {\n            option features.json_format = LEGACY_BEST_EFFORT;\n            int32 a = 13;\n            string b = 14 [features.json_format = ALLOW];\n        }\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"SomeOneOf\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' }\n    })\n\n    test.same(rootEditionsOverriden.lookup(\"SomeOneOf\").fieldsArray.find(x => x.name === 'b')._features, {\n        enum_type: 'OPEN',\n        field_presence: 'EXPLICIT',\n        json_format: 'ALLOW',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance file to extensions\", function(test) {\n\n    var rootEditionsOverriden = protobuf.parse(`\n    edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n\n    extend Message {\n        int32 bar = 10 [features.utf8_validation = NONE];\n    }\n    message Message {\n        option features.field_presence = IMPLICIT;\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\".bar\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance message to extensions\", function(test) {\n\n    var rootEditionsOverriden = protobuf.parse(`\n    edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n\n    message Message {\n        option features.utf8_validation = NONE;\n        extend Message {\n            int32 bar = 10 [features.field_presence = IMPLICIT];\n        }\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\".bar\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance message to enum\", function(test) {\n\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n    message Message {\n        option features.utf8_validation = NONE;\n        enum SomeEnum {\n            ONE = 1 [features.field_presence = IMPLICIT];\n            TWO = 2;\n        }\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"Message\").lookup(\"SomeEnum\")._valuesFeatures[\"ONE\"], {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.same(rootEditionsOverriden.lookup(\"Message\").lookup(\"SomeEnum\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance file to enum\", function(test) {\n\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n    enum SomeEnum {\n        option features.utf8_validation = NONE;\n        ONE = 1;\n        TWO = 2;\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"SomeEnum\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'EXPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\ntape.test(\"feature resolution inheritance file to service and service to method\", function(test) {\n    var rootEditionsOverriden = protobuf.parse(`edition = \"2023\";\n    option features.json_format = LEGACY_BEST_EFFORT;\n    option features.(abc).d_e = deeply_nested_false;\n    service MyService {\n        option features.field_presence = IMPLICIT;\n        message MyRequest {};\n        message MyResponse {};\n        rpc MyMethod (MyRequest) returns (MyResponse) {\n            option features.utf8_validation = NONE;\n        };\n    }`).root.resolveAll();\n\n    test.same(rootEditionsOverriden.lookup(\"MyService\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'VERIFY',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.same(rootEditionsOverriden.lookup(\"MyService\").lookup(\"MyMethod\")._features, {\n        enum_type: 'OPEN',\n        field_presence: 'IMPLICIT',\n        json_format: 'LEGACY_BEST_EFFORT',\n        message_encoding: 'LENGTH_PREFIXED',\n        repeated_field_encoding: 'PACKED',\n        utf8_validation: 'NONE',\n        enforce_naming_style: \"STYLE_LEGACY\",\n        default_symbol_visibility: \"EXPORT_ALL\",\n        '(abc)': { d_e: 'deeply_nested_false' } \n    })\n\n    test.end();\n});\n\ntape.test(\"feature resolution editions precedence\", function(test) {\n    protobuf.load(\"tests/data/feature-resolution.proto\", function(err, root) {\n        if (err)\n            throw test.fail(err.message);\n\n        test.same(root.lookup(\"Message\").lookupEnum(\"SomeEnumInMessage\")._features,\n        {\n            enum_type: 'OPEN',\n            field_presence: 'EXPLICIT',\n            json_format: 'ALLOW',\n            message_encoding: 'LENGTH_PREFIXED',\n            repeated_field_encoding: 'PACKED',\n            utf8_validation: 'VERIFY',\n            enforce_naming_style: \"STYLE_LEGACY\",\n            default_symbol_visibility: \"EXPORT_ALL\",\n            amazing_feature: 'G'\n        })\n        test.end();\n    });\n});\n\ntape.test(\"feature resolution extension sister\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n        message A {\n            message B {\n                message One {\n                    extensions 1000 to max;\n                    reserved 900 to 999, 899, a, b;\n                }\n            }\n            message C {\n                option features.repeated_field_encoding = EXPANDED;\n                message Two {\n                    extend B.One {\n                        repeated int32 ext = 1000 [features.fake = 2];\n                    }\n                }\n            }\n    }`).root.resolveAll();\n    var extension = root.lookup(\"A.C.Two\").nested.ext;\n    var sister = root.lookup(\"A.B.One\").fields[\".A.C.Two.ext\"];\n\n    test.notOk(extension.packed);\n    test.notOk(sister.packed);\n    test.equal(extension._features.repeated_field_encoding, \"EXPANDED\");\n    test.equal(extension._features.fake, 2);\n    test.equal(sister._features.repeated_field_encoding, \"EXPANDED\");\n    test.equal(sister._features.fake, 2);\n\n    test.end();\n});\n\ntape.test(\"feature resolution inferred proto2 repeated encoding\", function(test) {\n    var root = protobuf.parse(`syntax = \"proto2\";\n    message Message {\n        repeated int32 default = 1;\n        repeated int32 packed = 2 [packed = true];\n        repeated int32 unpacked = 3 [packed = false];\n    }`).root.resolveAll();\n\n    var msg = root.lookup(\"Message\");\n    test.notOk(msg.fields.default.packed)\n    test.equal(msg.fields.default._features.repeated_field_encoding, \"EXPANDED\")\n    test.ok(msg.fields.packed.packed)\n    test.equal(msg.fields.packed._features.repeated_field_encoding, \"PACKED\")\n    test.notOk(msg.fields.unpacked.packed)\n    test.equal(msg.fields.unpacked._features.repeated_field_encoding, \"EXPANDED\")\n\n    test.end();\n});\n\ntape.test(\"feature resolution inferred proto3 repeated encoding\", function(test) {\n    var root = protobuf.parse(`syntax = \"proto3\";\n    message Message {\n        repeated int32 default = 1;\n        repeated int32 packed = 2 [packed = true];\n        repeated int32 unpacked = 3 [packed = false];\n    }`).root.resolveAll();\n\n    var msg = root.lookup(\"Message\");\n    test.ok(msg.fields.default.packed)\n    test.equal(msg.fields.default._features.repeated_field_encoding, \"PACKED\")\n    test.ok(msg.fields.packed.packed)\n    test.equal(msg.fields.packed._features.repeated_field_encoding, \"PACKED\")\n    test.notOk(msg.fields.unpacked.packed)\n    test.equal(msg.fields.unpacked._features.repeated_field_encoding, \"EXPANDED\")\n\n    test.end();\n});\n\n\ntape.test(\"feature resolution inferred proto2 presence\", function(test) {\n    var root = protobuf.parse(`syntax = \"proto2\";\n    message Message {\n        optional int32 default = 1;\n        required int32 required = 2;\n        repeated int32 repeated = 3;\n    }`).root.resolveAll();\n\n    var msg = root.lookup(\"Message\");\n    test.ok(msg.fields.default.optional);\n    test.notOk(msg.fields.default.required);\n    test.ok(msg.fields.default.hasPresence);\n    test.notOk(msg.fields.required.optional);\n    test.ok(msg.fields.required.required);\n    test.equal(msg.fields.required._features.field_presence, \"LEGACY_REQUIRED\");\n    test.notOk(msg.fields.repeated.hasPresence, \"repeated fields never have presence\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution mixed syntax different package\", function(test) {\n    var root = protobuf.parse(`syntax = \"proto2\";\n    package proto2;\n    message Message {\n        optional int32 default = 1;\n        required int32 required = 2;\n        repeated int32 unpacked = 3;\n    }`).root;\n    protobuf.parse(`syntax = \"proto3\";\n    package proto3;\n    message Message {\n        optional int32 explicit = 1;\n        int32 implicit = 2;\n        repeated int32 packed = 3;\n    }`, root);\n    root.resolveAll();\n\n    var proto2 = root.lookup(\"proto2.Message\");\n    test.ok(proto2.fields.default.hasPresence, \"proto2 uses explicit presence\");\n    test.ok(proto2.fields.required.required, \"proto2 has required fields\");\n    test.notOk(proto2.fields.unpacked.packed, \"proto2 is expanded by default\");\n\n    var proto3 = root.lookup(\"proto3.Message\");\n    test.ok(proto3.fields.explicit.hasPresence, \"proto3 optional has explicit presence\");\n    test.notOk(proto3.fields.implicit.hasPresence, \"proto3 is implicit presence by default\");\n    test.ok(proto3.fields.packed.packed, \"proto3 is packed by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution mixed file features different package\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n    package expanded;\n    option features.repeated_field_encoding = EXPANDED;\n    message Message {\n        repeated int32 expanded = 1;\n        repeated int32 packed = 2 [features.repeated_field_encoding = PACKED];\n    }`).root;\n    protobuf.parse(`edition = \"2023\";\n    package packed;\n    option features.repeated_field_encoding = PACKED;\n    message Message {\n        repeated int32 packed = 1;\n        repeated int32 expanded = 2 [features.repeated_field_encoding = EXPANDED];\n    }`, root);\n    root.resolveAll();\n\n    var expanded = root.lookup(\"expanded.Message\");\n    test.notOk(expanded.fields.expanded.packed, \"expanded by default\");\n    test.ok(expanded.fields.packed.packed, \"packed override\");\n\n    var packed = root.lookup(\"packed.Message\");\n    test.ok(packed.fields.packed.packed, \"packed by default\");\n    test.notOk(packed.fields.expanded.packed, \"expanded override\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution mixed file features same package\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n    option features.repeated_field_encoding = EXPANDED;\n    message Message1 {\n        repeated int32 expanded = 1;\n        int32 explicit = 2;\n    }`).root;\n    protobuf.parse(`edition = \"2023\";\n    option features.field_presence = IMPLICIT;\n    message Message2 {\n        repeated int32 packed = 1;\n        int32 implicit = 3;\n    }`, root);\n    root.resolveAll();\n\n    var msg1 = root.lookup(\"Message1\");\n    test.notOk(msg1.fields.expanded.packed, \"expanded by default\");\n    test.ok(msg1.fields.explicit.hasPresence, \"explicit by default\");\n\n    var msg2 = root.lookup(\"Message2\");\n    test.ok(msg2.fields.packed.packed, \"packed by default\");\n    test.notOk(msg2.fields.implicit.hasPresence, \"implicit by default\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution mixed file features same package\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n    option features.repeated_field_encoding = EXPANDED;\n    message Message1 {\n        repeated int32 expanded = 1;\n        repeated int32 packed = 2 [features.repeated_field_encoding = PACKED];\n    }`).root;\n    protobuf.parse(`edition = \"2023\";\n    option features.repeated_field_encoding = PACKED;\n    message Message2 {\n        repeated int32 packed = 1;\n        repeated int32 expanded = 2 [features.repeated_field_encoding = EXPANDED];\n    }`, root);\n    root.resolveAll();\n\n    var expanded = root.lookup(\"Message1\");\n    test.notOk(expanded.fields.expanded.packed, \"expanded by default\");\n    test.ok(expanded.fields.packed.packed, \"packed override\");\n\n    var packed = root.lookup(\"Message2\");\n    test.ok(packed.fields.packed.packed, \"packed by default\");\n    test.notOk(packed.fields.expanded.packed, \"expanded override\");\n\n    test.end();\n});\n\ntape.test(\"feature resolution mixed syntax same package\", function(test) {\n    var root = protobuf.parse(`syntax = \"proto2\";\n    message Message2 {\n        optional int32 default = 1;\n        required int32 required = 2;\n        repeated int32 unpacked = 3;\n    }`).root;\n    protobuf.parse(`syntax = \"proto3\";\n    message Message3 {\n        optional int32 explicit = 1;\n        int32 implicit = 2;\n        repeated int32 packed = 3;\n    }`, root);\n    root.resolveAll();\n\n    var proto2 = root.lookup(\"Message2\");\n    test.ok(proto2.fields.default.hasPresence, \"proto2 uses explicit presence\");\n    test.ok(proto2.fields.required.required, \"proto2 has required fields\");\n    test.notOk(proto2.fields.unpacked.packed, \"proto2 is expanded by default\");\n\n    var proto3 = root.lookup(\"Message3\");\n    test.ok(proto3.fields.explicit.hasPresence, \"proto3 optional has explicit presence\");\n    test.notOk(proto3.fields.implicit.hasPresence, \"proto3 is implicit presence by default\");\n    test.ok(proto3.fields.packed.packed, \"proto3 is packed by default\");\n\n    test.end();\n});\n\n"
  },
  {
    "path": "tests/gen_type_url.js",
    "content": "var tape = require(\"tape\");\n\nvar TypeUrlTest = require(\"./data/type_url\").TypeUrlTest;\n\ntape.test(\"getTypeUrl method\", function(test) {\n    test.equal(TypeUrlTest.getTypeUrl(), \"type.googleapis.com/TypeUrlTest\", \"should have a valid type url\");\n    test.equal(TypeUrlTest.Nested.getTypeUrl(), \"type.googleapis.com/TypeUrlTest.Nested\", \"nested messages should have a valid type url\");\n    test.equal(TypeUrlTest.getTypeUrl(\"example.com\"), \"example.com/TypeUrlTest\", \"should have a valid type url override\");\n    test.equal(TypeUrlTest.Nested.getTypeUrl(\"example.com\"), \"example.com/TypeUrlTest.Nested\", \"nested messages should have a valid type url override\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/lib_aspromise.js",
    "content": "if (typeof Promise !== \"undefined\")\n    require(\"../lib/aspromise/tests\");\n"
  },
  {
    "path": "tests/lib_base64.js",
    "content": "require(\"../lib/base64/tests\");\n"
  },
  {
    "path": "tests/lib_codegen.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\ntape.test(\"codegen\", function(test) {\n    test.equal(protobuf.util.codegen.verbose, false, \"should not be verbose by default\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/lib_eventemitter.js",
    "content": "require(\"../lib/eventemitter/tests\");\n"
  },
  {
    "path": "tests/lib_inquire.js",
    "content": "var protobuf = require(\"..\");\n\nif (protobuf.util.isNode)\n    require(\"../lib/inquire/tests\");\n"
  },
  {
    "path": "tests/lib_path.js",
    "content": "require(\"../lib/path/tests\");\n"
  },
  {
    "path": "tests/lib_pool.js",
    "content": "if (typeof Uint8Array !== \"undefined\")\n    require(\"../lib/pool/tests\");\n"
  },
  {
    "path": "tests/node/api_load-sync.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"../..\");\n\ntape.test(\"load sync\", function(test) {\n    var root = protobuf.loadSync(\"tests/data/common.proto\");\n\n    test.ok(root.lookup(\"Something\"), \"should parse message Something\");\n\n    test.throws(function() {\n        protobuf.loadSync(\"tests/data/__NOTFOUND__\", root);\n    }, Error, \"should throw if not found\");\n\n    var isNode = protobuf.util.isNode;\n    try {\n        protobuf.util.isNode = false;\n        test.throws(function() {\n            protobuf.loadSync(\"tests/data/common.proto\");\n        }, \"should throw when not running under node\");\n    } finally {\n        protobuf.util.isNode = isNode;\n    }\n\n    test.throws(function() {\n        protobuf.loadSync(\"tests/data/invalid.proto\");\n    }, Error, \"should throw when trying to load an invalid proto\");\n\n    test.throws(function() {\n        protobuf.loadSync(\"tests/data/invalid.json\");\n    }, Error, \"should throw when trying to load invalid json\");\n\n    root = protobuf.loadSync(\"tests/data/weak.proto\");\n    test.ok(root.files.indexOf(\"tests/data/NOT_FOUND\") > -1, \"should ignore missing weak protos and remember them\");\n    test.ok(root.files.indexOf(\"google/protobuf/any.proto\") > -1, \"should still load other protos when ignoring weak protos\");\n\n    test.end();\n});\n\ntape.test(\"should load bundled definitions even if resolvePath method was overrided\", function(test) {\n    var protoFilePath = \"tests/data/common.proto\";\n    var root = new protobuf.Root();\n    root.resolvePath = (origin, target) => origin === \"\" && target === protoFilePath ? target : null;\n\n    root.loadSync(protoFilePath);\n\n    test.ok(root.lookup(\"Something\"), \"should parse message Something\");\n    test.end();\n});\n"
  },
  {
    "path": "tests/node/comp_loaders.js",
    "content": "var fs   = require(\"fs\"),\n    path = require(\"path\"),\n    vm   = require(\"vm\"),\n    long = require(\"long\"),\n    tape = require(\"tape\");\n\nvar distPath = path.join(__dirname, \"..\", \"..\", \"dist\");\n\n[\n    {\n        name: \"full\",\n        data: fs.readFileSync(path.join(distPath, \"protobuf.min.js\")).toString(\"utf8\")\n    },\n    {\n        name: \"light\",\n        data: fs.readFileSync(path.join(distPath, \"light/protobuf.min.js\")).toString(\"utf8\")\n    },\n    {\n        name: \"minimal\",\n        data: fs.readFileSync(path.join(distPath, \"minimal/protobuf.min.js\")).toString(\"utf8\")\n    }\n]\n.forEach(function(dist) {\n\n    tape.test(dist.name + \" build\", function(test) {\n\n        test.test(test.name + \" - script tags\", function(test) {\n            var sandbox;\n\n            var dcodeIO = { Long: long };\n\n            vm.runInNewContext(dist.data, sandbox = {\n                window: {\n                    dcodeIO: dcodeIO\n                },\n                dcodeIO: dcodeIO\n            });\n\n            test.ok(sandbox.window.protobuf, \"should load the library as a global\");\n            test.ok(sandbox.window.protobuf.util.Long, \"should load long.js to util\");\n            test.end();\n        });\n\n        test.test(test.name + \" - webworkers\", function(test) {\n            var sandbox;\n\n            var dcodeIO = { Long: long };\n\n            vm.runInNewContext(dist.data, sandbox = {\n                self: {\n                    dcodeIO: dcodeIO\n                },\n                dcodeIO: dcodeIO\n            });\n\n            test.ok(sandbox.self.protobuf, \"should load the library as a global\");\n            test.ok(sandbox.self.protobuf.util.Long, \"should load long.js to util\");\n            test.end();\n        });\n\n        test.test(test.name + \" - amd loaders\", function(test) {\n            var sandbox;\n\n            function fakeDefine(deps, factory) {\n                test.same(deps, [ \"long\" ], \"should request long.js as a dependency\");\n                test.notOk(sandbox.window.protobuf.util.Long, \"should not have loaded long.js before calling the factory function\");\n                factory(long);\n                test.ok(sandbox.window.protobuf.util.Long, \"should have loaded long.js after calling the factory function\");\n            }\n            fakeDefine.amd = true;\n\n            vm.runInNewContext(dist.data, sandbox = {\n                define: fakeDefine,\n                window: {},\n                require: undefined,\n                console: console\n            });\n\n            test.ok(sandbox.window.protobuf, \"should load the library as a global\");\n            test.end();\n\n        });\n\n    });\n\n});\n\n// commonjs uses ./src\n"
  },
  {
    "path": "tests/node/lib_fetch.js",
    "content": "require(\"../../lib/fetch/tests\"); // requires fs\n"
  },
  {
    "path": "tests/node/lib_float.js",
    "content": "require(\"../../lib/float/tests\"); // requires node for modified global envs\n"
  },
  {
    "path": "tests/node/lib_utf8.js",
    "content": "require(\"../../lib/utf8/tests\"); // requires fs to load the test file\n"
  },
  {
    "path": "tests/other_basics-debug.js",
    "content": "/* var tape = require(\"tape\");\n\nvar protobuf = require(\"../debug\");\n\ntape.test(\"google.protobuf.Any type\", function(test) {\n    protobuf.debug.enable();\n    protobuf.load(\"tests/data/common.proto\", function(err, root) {\n        if (err)\n            return test.fail(err.message);\n\n        var google_protobuf = root.resolveAll().lookup(\"google.protobuf\");\n        test.ok(google_protobuf.Any, \"should expose Any as a property on the reflected google.protobuf namespace\");\n\n        var Any = root.lookup(\"google.protobuf.Any\");\n\n        test.ok(Any instanceof protobuf.Type, \"should extend Type\");\n\n        var valueBuffer = protobuf.util.newBuffer(1);\n        valueBuffer[0] = 0;\n        var any = Any.create({\n            type_url: \"some.type\",\n            value: valueBuffer\n        });\n\n        test.test(test.name + \" - instances\", function(test) {\n\n            test.ok(any instanceof protobuf.Message, \"should extend Message\");\n            test.deepEqual(any, {\n                type_url: \"some.type\",\n                value: valueBuffer\n            }, \"should be populated with the contents we provided\");\n\n            var writer = Any.encode(any),\n                buf;\n\n            function verifyEncode(test, buf) {\n                test.equal(buf[0]    , 1 << 3 | 2, \"a tag with id 1, wire type 2\");\n                test.equal(buf[1]    , 9         , \"a field length of 9\");\n                test.equal(buf[11]   , 2 << 3 | 2, \"a tag with id 2, wire type 2\");\n                test.equal(buf[12]   , 1         , \"a field length of 1\");\n                test.equal(buf.length, 14        , \"14 bytes in total\");\n            }\n\n            test.test(test.name + \" - should encode\", function(test) {\n                \n                writer = Any.encode(any);\n                buf = writer.finish();\n\n                verifyEncode(test, buf);\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should decode\", function(test) {\n\n                var msg = Any.decode(buf);\n\n                test.deepEqual(msg, any, \"an equal message\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should encodeDelimited\", function(test) {\n\n                writer = Any.encodeDelimited(any);\n                buf = writer.finish();\n                \n                test.equal(buf[0]    , 14        , \"a length of 14\");\n                test.equal(buf[1]    , 1 << 3 | 2, \"a tag with id 1, wire type 2\");\n                test.equal(buf[2]    , 9         , \"a field length of 9\");\n                test.equal(buf[12]   , 2 << 3 | 2, \"a tag with id 2, wire type 2\");\n                test.equal(buf[13]   , 1         , \"a field length of 1\");\n                test.equal(buf.length, 15        , \"15 bytes in total\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should decodeDelimited\", function(test) {\n\n                var msg = Any.decodeDelimited(buf);\n                test.deepEqual(msg, any, \"an equal message\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - debug\", function(test) {\n                var unused = protobuf.debug.unusedTypes(root).map(function(type) { return type.fullName; });\n                test.same(unused, [\n                    \".Something\",\n                    \".google.protobuf.Duration\",\n                    \".google.protobuf.Empty\",\n                    \".google.protobuf.Struct\",\n                    \".google.protobuf.Value\",\n                    \".google.protobuf.ListValue\",\n                    \".google.protobuf.Timestamp\"\n                ], \"should recognize unused types (all but .google.protobuf.Any)\");\n                \n                protobuf.debug.disable();\n                test.end();\n            });\n\n            test.end();\n        });\n\n        test.end();\n\n    });\n}); */"
  },
  {
    "path": "tests/other_bench.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\"),\n    util = protobuf.util;\n\ntape.test(\"bench.proto and bench.json\", function(test) {\n    test.plan(4);\n    protobuf.load(\"bench/data/bench.proto\", undefined, function(err, root) { // no require.resolve to support browsers\n        if (err)\n            return test.fail(err.message);\n\n        var Test = root.lookup(\"Test\");\n\n        var data = require(\"../bench/data/bench.json\");\n\n        test.equal(Test.verify(data), null, \"should verify our test data\");\n        test.equal(Test.ctor.verify(data), null, \"should verify our test data (static)\");\n\n        var decoded = Test.decode(Test.encode(data).finish());\n        test.deepEqual(decoded, data, \"should reproduce the original data when encoded and decoded again\");\n\n        test.deepEqual(Test.toObject(decoded), data, \"should convert back to the original object\");\n\n        test.end();\n    });\n});"
  },
  {
    "path": "tests/other_classes.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\"),\n    Message  = protobuf.Message;\n\ntape.test(\"google.protobuf.Any class\", function(test) {\n\n    test.plan(1);\n\n    protobuf.load(\"tests/data/common.proto\", function(err, root) {\n        if (err)\n            return test.fail(err.message);\n\n        function Any(properties) {\n            Message.call(this, properties);\n        }\n        root.lookup(\"google.protobuf.Any\").ctor = Any;\n\n        var valueBuffer = protobuf.util.newBuffer(1);\n        valueBuffer[0] = 0;\n        var any = new Any({\n            type_url: \"some.type\",\n            value: valueBuffer\n        });\n\n        test.test(test.name + \" - instances\", function(test) {\n\n            test.ok(any instanceof protobuf.Message, \"should extend Message\");\n            test.ok(any instanceof Any, \"should extend the custom class\");\n            test.deepEqual(any, {\n                type_url: \"some.type\",\n                value: valueBuffer\n            }, \"should be populated with the contents we provided\");\n\n            var buf;\n\n            test.test(test.name + \" - should encode\", function(test) {\n\n                buf = Any.encode(any).finish();\n\n                test.equal(buf[0]    , 1 << 3 | 2, \"a tag with id 1, wire type 2\");\n                test.equal(buf[1]    , 9         , \"a field length of 9\");\n                test.equal(buf[11]   , 2 << 3 | 2, \"a tag with id 2, wire type 2\");\n                test.equal(buf[12]   , 1         , \"a field length of 1\");\n                test.equal(buf.length, 14        , \"14 bytes in total\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should decode\", function(test) {\n\n                msg = Any.decode(buf);\n                test.ok(msg instanceof Any, \"to an object that extends the custom class\");\n                test.deepEqual(msg, any, \"an equal message\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should encodeDelimited\", function(test) {\n\n                buf = Any.encodeDelimited(any).finish();\n\n                test.equal(buf[0]    , 14        , \"a length of 14\");\n                test.equal(buf[1]    , 1 << 3 | 2, \"a tag with id 1, wire type 2\");\n                test.equal(buf[2]    , 9         , \"a field length of 9\");\n                test.equal(buf[12]   , 2 << 3 | 2, \"a tag with id 2, wire type 2\");\n                test.equal(buf[13]   , 1         , \"a field length of 1\");\n                test.equal(buf.length, 15        , \"15 bytes in total\");\n\n                test.end();\n            });\n\n            test.test(test.name + \" - should decodeDelimited\", function(test) {\n\n                msg = Any.decodeDelimited(buf);\n                test.ok(msg instanceof Any, \"to an object that extends the custom class\");\n                test.deepEqual(msg, any, \"an equal message\");\n\n                test.end();\n            });\n\n            test.end();\n        });\n    });\n});\n"
  },
  {
    "path": "tests/other_node-or-browser.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar util = protobuf.util;\n\nif (util.isNode)\n    tape.test(\"under node.js\", function(test) {\n        test.ok(util.fs && util.fs.readFile, \"the fs module should be available\");\n        test.ok(util.Long && util.Long.isLong, \"the long module should be available\");\n        test.end();\n    });\nelse\n    tape.test(\"in the browser\", function(test) {\n        test.ok(util.fs === null, \"the fs module should not be available\");\n        test.ok(util.Long && util.Long.isLong, \"the long module should be available to test cases\");\n        test.end();\n    });\n"
  },
  {
    "path": "tests/other_protocolerror.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\nvar ProtocolError = protobuf.util.ProtocolError;\n\ntape.test(\"a protocol error\", function(test) {\n\n    test.ok(ProtocolError(\"test1\") instanceof ProtocolError, \"should construct by calling the constructor as a function\");\n    test.ok(new ProtocolError(\"test2\") instanceof ProtocolError, \"should construct by using the 'new' keyword\");\n\n    var root = new protobuf.Root().add(\n        new protobuf.Type(\"Test\").add(\n            new protobuf.Field(\"foo\", 1, \"uint32\", \"optional\")\n        ).add(\n            new protobuf.Field(\"bar\", 2, \"string\", \"required\")\n        )\n    ).resolveAll();\n    \n    var Test = root.lookup(\"Test\");\n    var buf  = protobuf.util.newBuffer(2);\n    buf[0] = 1 << 3 | 0;\n    buf[1] = 0x02;\n    test.ok(root.Test.fields.foo.hasPresence);\n\n    try {\n        Test.decode(buf);\n        test.fail(\"should be thrown if a message is missing required fields\");\n    } catch (e) {\n        test.ok(e instanceof ProtocolError, \"should be thrown if a message is missing required fields\");\n        test.ok(e.message, \"should have an error message\");\n        test.ok(typeof e.stack === \"string\", \"should have a stack trace (empty string if not supported)\");\n        test.equal(e.name, \"ProtocolError\", \"should have the correct name\");\n        test.ok(/^ProtocolError: /.test(e.toString()), \"should correctly convert toString\");\n        test.same(e.instance, {\n            foo: 2\n        }, \"should still return the so far decoded message\");\n    }\n\n    test.end();\n\n});\n"
  },
  {
    "path": "tests/parse_editions.js",
    "content": "var tape = require(\"tape\");\n\nvar protobuf = require(\"..\");\n\n\ntape.test(\"invalid edition\", function(test) {\n    test.throws(function() {\n        protobuf.parse(`edition = \"2022\"; message A {}`);\n    }, Error, /Error: illegal edition '2022'/, \"unknown past edition should be rejected\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2030\"; message A {}`);\n    }, Error, /Error: illegal edition '2030'/, \"unknown future edition should be rejected\");\n    \n    test.end();\n});\n\ntape.test(\"edition 2023 banned keywords\", function(test) {\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n    message A {\\\n        required uint32 a = 1;\\\n    }`);\n    }, Error,  /Error: illegal token 'required'/, \"required should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        message A {\\\n        optional uint32 a = 1;\\\n    }`);\n    }, Error, /Error: illegal token 'optional'/, \"optional should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        message A {\\\n        group uint32 a = 1;\\\n    }`);\n    }, Error, /Error: illegal token 'group'/);\n\n    test.end();\n});\n\ntape.test(\"edition 2023 reserved\", function(test) {\n    var root = protobuf.parse(`edition = \"2023\";\n    message Foo {\n        reserved bar, baz;\n    }`).root.resolveAll();\n    test.same(root.Foo.reserved, [\"bar\", \"baz\"], \"reserved fields should be parsed\");\n\n    root = protobuf.parse(`edition = \"2023\";\n    enum Foo {\n        reserved BAR, BAZ_BAZ;\n    }`).root.resolveAll();\n    test.same(root.nested.Foo.reserved, [\"BAR\", \"BAZ_BAZ\"], \"reserved values should be parsed\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        message Foo {\n            reserved \"bar\", \"baz\";\n        }`);\n    }, /Error: illegal id 'bar'/, \"reserved field strings should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\";\n        enum Foo {\n            reserved \"BAR\", \"BAZ\";\n        }`);\n    }, /Error: illegal id 'BAR'/, \"reserved enum value strings should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`syntax = \"proto3\";\n        message Foo {\n            reserved bar, baz;\n        }`);\n    }, /Error: illegal id 'bar'/, \"reserved field strings should be banned\");\n\n    test.throws(function() {\n        protobuf.parse(`syntax = \"proto3\";\n        enum Foo {\n            reserved BAR, BAZ;\n        }`);\n    }, /Error: illegal id 'BAR'/, \"reserved enum value strings should be banned\");\n\n    test.end();\n});\n\ntape.test(\"edition 2024 visibility\", function(test) {\n    test.ok(protobuf.parse(`edition = \"2024\"; export message Foo {}`), \"messages should allow export modifier\");;\n    test.ok(protobuf.parse(`edition = \"2024\"; export enum Foo {}`), \"enums should allow export modifier\");;\n    test.ok(protobuf.parse(`edition = \"2024\"; local message Foo {}`), \"messages should allow local modifier\");;\n    test.ok(protobuf.parse(`edition = \"2024\"; local enum Foo {}`), \"enums should allow local modifier\");;\n    test.ok(protobuf.parse(`edition = \"2024\";\n        message Foo {\n            export message Export {}\n            local message Local {}\n        }`), \"nested messages should allow visibility modifiers\");;\n    test.ok(protobuf.parse(`edition = \"2024\";\n        message Foo {\n            export enum Export {}\n            local enum Local {}\n        }`), \"nested enums should allow visibility modifiers\");;\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\"; export message Foo {}`)\n    }, /Error: illegal token 'export'/, \"export should be banned before edition 2024\");\n    test.throws(function() {\n        protobuf.parse(`edition = \"2024\"; export service Foo {}`)\n    }, /Error: illegal token 'export'/, \"export should be banned on services\");\n    test.throws(function() {\n        protobuf.parse(`edition = \"2024\";\n            message Empty {}\n            service Foo {\n                export rpc Method(Empty) returns (Empty);\n            }`)\n    }, /Error: illegal token 'export'/, \"export should be banned on methods\");\n    test.throws(function() {\n        protobuf.parse(`edition = \"2024\"; export option foo = 1;`)\n    }, /Error: illegal token 'export'/, \"export should be banned on options\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\"; local message Foo {}`)\n    }, /Error: illegal token 'local'/, \"local should be banned before edition 2024\");\n    test.throws(function() {\n        protobuf.parse(`edition = \"2024\"; local service Foo {}`)\n    }, /Error: illegal token 'local'/, \"local should be banned on services\");\n    test.throws(function() {\n        protobuf.parse(`edition = \"2024\";\n            message Empty {}\n            service Foo {\n                local rpc Method(Empty) returns (Empty);\n            }`)\n    }, /Error: illegal token 'local'/, \"local should be banned on methods\");\n    test.throws(function() {\n        protobuf.parse(`edition = \"2024\"; local option foo = 1;`)\n    }, /Error: illegal token 'local'/, \"local should be banned on options\");\n\n    test.end();\n});\n\n\ntape.test(\"edition 2024 import option\", function(test) {\n    test.same(protobuf.parse(`edition = \"2024\"; import \"foo.proto\";`).imports, [\"foo.proto\"], \"regular options should fetch\");\n    test.equals(protobuf.parse(`edition = \"2024\"; import option \"foo.proto\";`).imports, undefined, \"import option should not fetch\");\n    test.same(protobuf.parse(`edition = \"2024\";\n        import option \"foo.proto\";\n        import \"bar.proto\";\n        import option \"foo2.proto\";\n    `).imports, [\"bar.proto\"], \"multiple import options should not fetch\");\n\n    test.throws(function() {\n        protobuf.parse(`edition = \"2023\"; import option \"foo.proto\";`);\n    }, /Error: illegal token 'option'/, \"import option should be banned before edition 2024\");\n\n    var root = new protobuf.Root();\n    root.loadSync(\"tests/data/import-option-bad.proto\");\n    root.resolveAll();\n\n    test.end();\n});\n"
  },
  {
    "path": "tests/split/root.js",
    "content": "/*eslint-disable block-scoped-var, no-redeclare, no-control-regex, no-prototype-builtins*/\n\"use strict\";\n\nvar $protobuf = require(\"protobufjs\");\n\nvar $root = ($protobuf.roots.split || ($protobuf.roots.split = new $protobuf.Root()))\n.setOptions({\n  \"(foo)\": \"bar\"\n})\n.addJSON({\n  com: {\n    nested: {\n      Outer: {\n        fields: {\n          inner: {\n            type: \"Inner\",\n            id: 1\n          },\n          other: {\n            type: \"Other\",\n            id: 2\n          }\n        },\n        nested: {\n          Inner: {\n            fields: {}\n          }\n        }\n      },\n      Other: {\n        fields: {\n          \"var\": {\n            rule: \"required\",\n            type: \"uint32\",\n            id: 1\n          }\n        }\n      }\n    }\n  }\n});\n\nmodule.exports = $root;\n"
  },
  {
    "path": "tests/split/test.proto",
    "content": "option (foo) = \"bar\";\n\npackage com;\n\nmessage Outer {\n    optional Inner inner = 1;\n    optional Other other = 2;\n\n    message Inner {\n    }\n}\n\nmessage Other {\n    required uint32 var = 1;\n}"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"ES5\",\n        \"experimentalDecorators\": true,\n        \"emitDecoratorMetadata\": true,\n        \"esModuleInterop\": true\n    }\n}\n"
  }
]