@likec4/language-server 1.47.0 → 1.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/LICENSE +1 -1
  2. package/browser/package.json +2 -2
  3. package/browser-worker/package.json +2 -2
  4. package/bundled/package.json +4 -0
  5. package/dist/LikeC4LanguageServices.d.mts +4 -0
  6. package/dist/LikeC4LanguageServices.mjs +3 -0
  7. package/dist/_chunks/ConfigurableLayouter.mjs +1956 -0
  8. package/dist/_chunks/LikeC4LanguageServices.d.mts +1978 -0
  9. package/dist/_chunks/LikeC4LanguageServices.mjs +725 -0
  10. package/dist/_chunks/ast.d.mts +1444 -0
  11. package/dist/_chunks/ast.mjs +2375 -0
  12. package/dist/_chunks/ast2.mjs +176 -0
  13. package/dist/_chunks/common-exports.mjs +0 -0
  14. package/dist/_chunks/filesystem.mjs +58 -0
  15. package/dist/_chunks/grammar.mjs +8 -0
  16. package/dist/_chunks/icons.mjs +5211 -0
  17. package/dist/_chunks/libs/@hono/node-server.mjs +436 -0
  18. package/dist/_chunks/libs/@msgpack/msgpack.mjs +805 -0
  19. package/dist/_chunks/libs/eventemitter3.mjs +243 -0
  20. package/dist/_chunks/libs/fast-equals.mjs +446 -0
  21. package/dist/_chunks/libs/hono.mjs +1829 -0
  22. package/dist/_chunks/libs/p-queue.mjs +449 -0
  23. package/dist/_chunks/libs/parse-ms.mjs +36 -0
  24. package/dist/_chunks/libs/picomatch.mjs +1673 -0
  25. package/dist/_chunks/libs/pretty-ms.mjs +80 -0
  26. package/dist/_chunks/libs/remeda.mjs +482 -0
  27. package/dist/_chunks/libs/strip-indent.mjs +15 -0
  28. package/dist/_chunks/libs/ufo.mjs +166 -0
  29. package/dist/_chunks/likec4lib.mjs +9 -0
  30. package/dist/_chunks/mcp.mjs +33 -0
  31. package/dist/_chunks/module.mjs +28 -0
  32. package/dist/_chunks/module2.mjs +6576 -0
  33. package/dist/_chunks/protocol.d.mts +311 -0
  34. package/dist/_chunks/protocol.mjs +78 -0
  35. package/dist/_chunks/rolldown-runtime.mjs +42 -0
  36. package/dist/ast.d.mts +4 -0
  37. package/dist/ast.mjs +4 -0
  38. package/dist/browser-worker.d.mts +1 -0
  39. package/dist/browser-worker.mjs +6 -0
  40. package/dist/browser.d.mts +11 -0
  41. package/dist/browser.mjs +27 -0
  42. package/dist/bundled.d.mts +28 -0
  43. package/dist/bundled.mjs +51 -4853
  44. package/dist/common-exports.d.mts +4 -0
  45. package/dist/common-exports.mjs +5 -0
  46. package/dist/filesystem/index.d.mts +4 -0
  47. package/dist/filesystem/index.mjs +3 -0
  48. package/dist/generated/ast.d.mts +2 -0
  49. package/dist/generated/ast.mjs +3 -0
  50. package/dist/generated/grammar.d.mts +6 -0
  51. package/dist/generated/grammar.mjs +3 -0
  52. package/dist/generated/module.d.mts +14 -0
  53. package/dist/generated/module.mjs +3 -0
  54. package/dist/generated-lib/icons.d.mts +4 -0
  55. package/dist/generated-lib/icons.mjs +3 -0
  56. package/dist/index.d.mts +4 -0
  57. package/dist/index.mjs +48 -0
  58. package/dist/likec4lib.d.mts +9 -0
  59. package/dist/likec4lib.mjs +4 -0
  60. package/dist/mcp/index.d.mts +4 -0
  61. package/dist/mcp/index.mjs +3 -0
  62. package/dist/module.d.mts +4 -0
  63. package/dist/module.mjs +3 -0
  64. package/dist/protocol.d.mts +2 -0
  65. package/dist/protocol.mjs +3 -0
  66. package/likec4lib/package.json +2 -2
  67. package/package.json +106 -63
  68. package/protocol/package.json +2 -2
  69. package/dist/LikeC4LanguageServices.d.ts +0 -115
  70. package/dist/LikeC4LanguageServices.js +0 -164
  71. package/dist/Rpc.d.ts +0 -9
  72. package/dist/Rpc.js +0 -276
  73. package/dist/ast.d.ts +0 -226
  74. package/dist/ast.js +0 -264
  75. package/dist/browser-worker.d.ts +0 -1
  76. package/dist/browser-worker.js +0 -4
  77. package/dist/browser.d.ts +0 -10
  78. package/dist/browser.js +0 -34
  79. package/dist/bundled.d.ts +0 -8
  80. package/dist/bundled.js +0 -44
  81. package/dist/documentation/documentation-provider.d.ts +0 -8
  82. package/dist/documentation/documentation-provider.js +0 -51
  83. package/dist/documentation/index.d.ts +0 -1
  84. package/dist/documentation/index.js +0 -1
  85. package/dist/empty.d.ts +0 -2
  86. package/dist/empty.js +0 -2
  87. package/dist/filesystem/ChokidarWatcher.d.ts +0 -19
  88. package/dist/filesystem/ChokidarWatcher.js +0 -133
  89. package/dist/filesystem/FileSystemWatcher.d.ts +0 -19
  90. package/dist/filesystem/FileSystemWatcher.js +0 -14
  91. package/dist/filesystem/LikeC4FileSystem.d.ts +0 -3
  92. package/dist/filesystem/LikeC4FileSystem.js +0 -140
  93. package/dist/filesystem/index.d.ts +0 -55
  94. package/dist/filesystem/index.js +0 -29
  95. package/dist/formatting/LikeC4Formatter.d.ts +0 -59
  96. package/dist/formatting/LikeC4Formatter.js +0 -637
  97. package/dist/formatting/utils.d.ts +0 -6
  98. package/dist/formatting/utils.js +0 -18
  99. package/dist/generated/ast.d.ts +0 -1411
  100. package/dist/generated/ast.js +0 -2207
  101. package/dist/generated/grammar.d.ts +0 -6
  102. package/dist/generated/grammar.js +0 -7
  103. package/dist/generated/module.d.ts +0 -14
  104. package/dist/generated/module.js +0 -27
  105. package/dist/generated-lib/icons.d.ts +0 -1
  106. package/dist/generated-lib/icons.js +0 -18
  107. package/dist/index.d.ts +0 -37
  108. package/dist/index.js +0 -54
  109. package/dist/likec4lib.d.ts +0 -6
  110. package/dist/likec4lib.js +0 -7
  111. package/dist/logger.d.ts +0 -17
  112. package/dist/logger.js +0 -81
  113. package/dist/lsp/CodeActionProvider.d.ts +0 -14
  114. package/dist/lsp/CodeActionProvider.js +0 -33
  115. package/dist/lsp/CodeLensProvider.d.ts +0 -9
  116. package/dist/lsp/CodeLensProvider.js +0 -44
  117. package/dist/lsp/CompletionProvider.d.ts +0 -13
  118. package/dist/lsp/CompletionProvider.js +0 -238
  119. package/dist/lsp/DocumentHighlightProvider.d.ts +0 -9
  120. package/dist/lsp/DocumentHighlightProvider.js +0 -10
  121. package/dist/lsp/DocumentLinkProvider.d.ts +0 -11
  122. package/dist/lsp/DocumentLinkProvider.js +0 -58
  123. package/dist/lsp/DocumentSymbolProvider.d.ts +0 -33
  124. package/dist/lsp/DocumentSymbolProvider.js +0 -317
  125. package/dist/lsp/HoverProvider.d.ts +0 -10
  126. package/dist/lsp/HoverProvider.js +0 -106
  127. package/dist/lsp/RenameProvider.d.ts +0 -5
  128. package/dist/lsp/RenameProvider.js +0 -6
  129. package/dist/lsp/SemanticTokenProvider.d.ts +0 -19
  130. package/dist/lsp/SemanticTokenProvider.js +0 -305
  131. package/dist/lsp/index.d.ts +0 -8
  132. package/dist/lsp/index.js +0 -9
  133. package/dist/mcp/MCPServerFactory.d.ts +0 -8
  134. package/dist/mcp/MCPServerFactory.js +0 -73
  135. package/dist/mcp/NoopLikeC4MCPServer.d.ts +0 -9
  136. package/dist/mcp/NoopLikeC4MCPServer.js +0 -17
  137. package/dist/mcp/interfaces.d.ts +0 -13
  138. package/dist/mcp/interfaces.js +0 -4
  139. package/dist/mcp/server/StdioLikeC4MCPServer.d.ts +0 -16
  140. package/dist/mcp/server/StdioLikeC4MCPServer.js +0 -51
  141. package/dist/mcp/server/StreamableLikeC4MCPServer.d.ts +0 -16
  142. package/dist/mcp/server/StreamableLikeC4MCPServer.js +0 -121
  143. package/dist/mcp/server/WithMCPServer.d.ts +0 -4
  144. package/dist/mcp/server/WithMCPServer.js +0 -54
  145. package/dist/mcp/tools/_common.d.ts +0 -88
  146. package/dist/mcp/tools/_common.js +0 -49
  147. package/dist/mcp/tools/find-relationships.d.ts +0 -202
  148. package/dist/mcp/tools/find-relationships.js +0 -150
  149. package/dist/mcp/tools/list-projects.d.ts +0 -194
  150. package/dist/mcp/tools/list-projects.js +0 -62
  151. package/dist/mcp/tools/open-view.d.ts +0 -200
  152. package/dist/mcp/tools/open-view.js +0 -52
  153. package/dist/mcp/tools/read-deployment.d.ts +0 -200
  154. package/dist/mcp/tools/read-deployment.js +0 -150
  155. package/dist/mcp/tools/read-element.d.ts +0 -200
  156. package/dist/mcp/tools/read-element.js +0 -218
  157. package/dist/mcp/tools/read-project-summary.d.ts +0 -198
  158. package/dist/mcp/tools/read-project-summary.js +0 -176
  159. package/dist/mcp/tools/read-view.d.ts +0 -200
  160. package/dist/mcp/tools/read-view.js +0 -203
  161. package/dist/mcp/tools/search-element.d.ts +0 -198
  162. package/dist/mcp/tools/search-element.js +0 -177
  163. package/dist/mcp/utils.d.ts +0 -18
  164. package/dist/mcp/utils.js +0 -48
  165. package/dist/model/builder/MergedExtends.d.ts +0 -13
  166. package/dist/model/builder/MergedExtends.js +0 -74
  167. package/dist/model/builder/MergedSpecification.d.ts +0 -32
  168. package/dist/model/builder/MergedSpecification.js +0 -175
  169. package/dist/model/builder/buildModel.d.ts +0 -16
  170. package/dist/model/builder/buildModel.js +0 -245
  171. package/dist/model/deployments-index.d.ts +0 -10
  172. package/dist/model/deployments-index.js +0 -102
  173. package/dist/model/fqn-index.d.ts +0 -61
  174. package/dist/model/fqn-index.js +0 -253
  175. package/dist/model/index.d.ts +0 -6
  176. package/dist/model/index.js +0 -6
  177. package/dist/model/model-builder.d.ts +0 -54
  178. package/dist/model/model-builder.js +0 -233
  179. package/dist/model/model-locator.d.ts +0 -39
  180. package/dist/model/model-locator.js +0 -240
  181. package/dist/model/model-parser-where.d.ts +0 -4
  182. package/dist/model/model-parser-where.js +0 -81
  183. package/dist/model/model-parser.d.ts +0 -645
  184. package/dist/model/model-parser.js +0 -133
  185. package/dist/model/parser/Base.d.ts +0 -69
  186. package/dist/model/parser/Base.js +0 -382
  187. package/dist/model/parser/DeploymentModelParser.d.ts +0 -71
  188. package/dist/model/parser/DeploymentModelParser.js +0 -176
  189. package/dist/model/parser/DeploymentViewParser.d.ts +0 -75
  190. package/dist/model/parser/DeploymentViewParser.js +0 -86
  191. package/dist/model/parser/FqnRefParser.d.ts +0 -66
  192. package/dist/model/parser/FqnRefParser.js +0 -382
  193. package/dist/model/parser/GlobalsParser.d.ts +0 -109
  194. package/dist/model/parser/GlobalsParser.js +0 -84
  195. package/dist/model/parser/ImportsParser.d.ts +0 -46
  196. package/dist/model/parser/ImportsParser.js +0 -24
  197. package/dist/model/parser/ModelParser.d.ts +0 -71
  198. package/dist/model/parser/ModelParser.js +0 -209
  199. package/dist/model/parser/PredicatesParser.d.ts +0 -75
  200. package/dist/model/parser/PredicatesParser.js +0 -45
  201. package/dist/model/parser/SpecificationParser.d.ts +0 -53
  202. package/dist/model/parser/SpecificationParser.js +0 -113
  203. package/dist/model/parser/ValueConverter.d.ts +0 -4
  204. package/dist/model/parser/ValueConverter.js +0 -12
  205. package/dist/model/parser/ViewsParser.d.ts +0 -112
  206. package/dist/model/parser/ViewsParser.js +0 -492
  207. package/dist/model-change/ModelChanges.d.ts +0 -18
  208. package/dist/model-change/ModelChanges.js +0 -129
  209. package/dist/model-change/changeElementStyle.d.ts +0 -16
  210. package/dist/model-change/changeElementStyle.js +0 -134
  211. package/dist/model-change/changeViewLayout.d.ts +0 -12
  212. package/dist/model-change/changeViewLayout.js +0 -28
  213. package/dist/model-change/removeManualLayoutV1.d.ts +0 -7
  214. package/dist/model-change/removeManualLayoutV1.js +0 -27
  215. package/dist/module.d.ts +0 -92
  216. package/dist/module.js +0 -143
  217. package/dist/protocol.d.ts +0 -289
  218. package/dist/protocol.js +0 -123
  219. package/dist/references/index.d.ts +0 -3
  220. package/dist/references/index.js +0 -3
  221. package/dist/references/name-provider.d.ts +0 -9
  222. package/dist/references/name-provider.js +0 -37
  223. package/dist/references/scope-computation.d.ts +0 -20
  224. package/dist/references/scope-computation.js +0 -288
  225. package/dist/references/scope-provider.d.ts +0 -40
  226. package/dist/references/scope-provider.js +0 -239
  227. package/dist/shared/NodeKindProvider.d.ts +0 -15
  228. package/dist/shared/NodeKindProvider.js +0 -57
  229. package/dist/shared/WorkspaceSymbolProvider.d.ts +0 -3
  230. package/dist/shared/WorkspaceSymbolProvider.js +0 -3
  231. package/dist/shared/index.d.ts +0 -2
  232. package/dist/shared/index.js +0 -2
  233. package/dist/test/index.d.ts +0 -1
  234. package/dist/test/index.js +0 -1
  235. package/dist/test/testServices.d.ts +0 -64
  236. package/dist/test/testServices.js +0 -210
  237. package/dist/utils/disposable.d.ts +0 -8
  238. package/dist/utils/disposable.js +0 -26
  239. package/dist/utils/elementRef.d.ts +0 -11
  240. package/dist/utils/elementRef.js +0 -33
  241. package/dist/utils/fqnRef.d.ts +0 -11
  242. package/dist/utils/fqnRef.js +0 -63
  243. package/dist/utils/index.d.ts +0 -11
  244. package/dist/utils/index.js +0 -35
  245. package/dist/utils/printDocs.d.ts +0 -2
  246. package/dist/utils/printDocs.js +0 -1
  247. package/dist/utils/projectId.d.ts +0 -4
  248. package/dist/utils/projectId.js +0 -16
  249. package/dist/utils/stringHash.d.ts +0 -1
  250. package/dist/utils/stringHash.js +0 -5
  251. package/dist/validation/DocumentValidator.d.ts +0 -11
  252. package/dist/validation/DocumentValidator.js +0 -17
  253. package/dist/validation/_shared.d.ts +0 -3
  254. package/dist/validation/_shared.js +0 -26
  255. package/dist/validation/deployment-checks.d.ts +0 -7
  256. package/dist/validation/deployment-checks.js +0 -140
  257. package/dist/validation/dynamic-view.d.ts +0 -6
  258. package/dist/validation/dynamic-view.js +0 -67
  259. package/dist/validation/element-ref.d.ts +0 -4
  260. package/dist/validation/element-ref.js +0 -12
  261. package/dist/validation/element.d.ts +0 -4
  262. package/dist/validation/element.js +0 -49
  263. package/dist/validation/imports.d.ts +0 -4
  264. package/dist/validation/imports.js +0 -46
  265. package/dist/validation/index.d.ts +0 -15
  266. package/dist/validation/index.js +0 -167
  267. package/dist/validation/property-checks.d.ts +0 -7
  268. package/dist/validation/property-checks.js +0 -108
  269. package/dist/validation/relation.d.ts +0 -6
  270. package/dist/validation/relation.js +0 -141
  271. package/dist/validation/specification.d.ts +0 -12
  272. package/dist/validation/specification.js +0 -190
  273. package/dist/validation/view-checks.d.ts +0 -4
  274. package/dist/validation/view-checks.js +0 -46
  275. package/dist/validation/view-predicates/fqn-expr-with.d.ts +0 -4
  276. package/dist/validation/view-predicates/fqn-expr-with.js +0 -43
  277. package/dist/validation/view-predicates/fqn-ref-expr.d.ts +0 -4
  278. package/dist/validation/view-predicates/fqn-ref-expr.js +0 -51
  279. package/dist/validation/view-predicates/incoming.d.ts +0 -4
  280. package/dist/validation/view-predicates/incoming.js +0 -16
  281. package/dist/validation/view-predicates/index.d.ts +0 -6
  282. package/dist/validation/view-predicates/index.js +0 -6
  283. package/dist/validation/view-predicates/outgoing.d.ts +0 -4
  284. package/dist/validation/view-predicates/outgoing.js +0 -20
  285. package/dist/validation/view-predicates/relation-expr.d.ts +0 -4
  286. package/dist/validation/view-predicates/relation-expr.js +0 -46
  287. package/dist/validation/view-predicates/relation-with.d.ts +0 -4
  288. package/dist/validation/view-predicates/relation-with.js +0 -16
  289. package/dist/validation/view.d.ts +0 -4
  290. package/dist/validation/view.js +0 -42
  291. package/dist/view-utils/assignNavigateTo.d.ts +0 -2
  292. package/dist/view-utils/assignNavigateTo.js +0 -27
  293. package/dist/view-utils/index.d.ts +0 -2
  294. package/dist/view-utils/index.js +0 -2
  295. package/dist/view-utils/manual-layout.d.ts +0 -13
  296. package/dist/view-utils/manual-layout.js +0 -149
  297. package/dist/views/ConfigurableLayouter.d.ts +0 -7
  298. package/dist/views/ConfigurableLayouter.js +0 -51
  299. package/dist/views/LikeC4ManualLayouts.d.ts +0 -42
  300. package/dist/views/LikeC4ManualLayouts.js +0 -209
  301. package/dist/views/LikeC4Views.d.ts +0 -89
  302. package/dist/views/LikeC4Views.js +0 -216
  303. package/dist/views/index.d.ts +0 -4
  304. package/dist/views/index.js +0 -11
  305. package/dist/workspace/AstNodeDescriptionProvider.d.ts +0 -7
  306. package/dist/workspace/AstNodeDescriptionProvider.js +0 -18
  307. package/dist/workspace/IndexManager.d.ts +0 -10
  308. package/dist/workspace/IndexManager.js +0 -26
  309. package/dist/workspace/LangiumDocuments.d.ts +0 -29
  310. package/dist/workspace/LangiumDocuments.js +0 -104
  311. package/dist/workspace/ProjectsManager.d.ts +0 -134
  312. package/dist/workspace/ProjectsManager.js +0 -610
  313. package/dist/workspace/WorkspaceManager.d.ts +0 -31
  314. package/dist/workspace/WorkspaceManager.js +0 -132
  315. package/dist/workspace/index.d.ts +0 -5
  316. package/dist/workspace/index.js +0 -5
@@ -0,0 +1,805 @@
1
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/utils/utf8.mjs
2
+ const sharedTextEncoder = new TextEncoder();
3
+ const CHUNK_SIZE = 4096;
4
+ function utf8DecodeJs(bytes, inputOffset, byteLength) {
5
+ let offset = inputOffset;
6
+ const end = offset + byteLength;
7
+ const units = [];
8
+ let result = "";
9
+ while (offset < end) {
10
+ const byte1 = bytes[offset++];
11
+ if ((byte1 & 128) === 0) units.push(byte1);
12
+ else if ((byte1 & 224) === 192) {
13
+ const byte2 = bytes[offset++] & 63;
14
+ units.push((byte1 & 31) << 6 | byte2);
15
+ } else if ((byte1 & 240) === 224) {
16
+ const byte2 = bytes[offset++] & 63;
17
+ const byte3 = bytes[offset++] & 63;
18
+ units.push((byte1 & 31) << 12 | byte2 << 6 | byte3);
19
+ } else if ((byte1 & 248) === 240) {
20
+ const byte2 = bytes[offset++] & 63;
21
+ const byte3 = bytes[offset++] & 63;
22
+ const byte4 = bytes[offset++] & 63;
23
+ let unit = (byte1 & 7) << 18 | byte2 << 12 | byte3 << 6 | byte4;
24
+ if (unit > 65535) {
25
+ unit -= 65536;
26
+ units.push(unit >>> 10 & 1023 | 55296);
27
+ unit = 56320 | unit & 1023;
28
+ }
29
+ units.push(unit);
30
+ } else units.push(byte1);
31
+ if (units.length >= CHUNK_SIZE) {
32
+ result += String.fromCharCode(...units);
33
+ units.length = 0;
34
+ }
35
+ }
36
+ if (units.length > 0) result += String.fromCharCode(...units);
37
+ return result;
38
+ }
39
+ const sharedTextDecoder = new TextDecoder();
40
+ const TEXT_DECODER_THRESHOLD = 200;
41
+ function utf8DecodeTD(bytes, inputOffset, byteLength) {
42
+ const stringBytes = bytes.subarray(inputOffset, inputOffset + byteLength);
43
+ return sharedTextDecoder.decode(stringBytes);
44
+ }
45
+ function utf8Decode(bytes, inputOffset, byteLength) {
46
+ if (byteLength > TEXT_DECODER_THRESHOLD) return utf8DecodeTD(bytes, inputOffset, byteLength);
47
+ else return utf8DecodeJs(bytes, inputOffset, byteLength);
48
+ }
49
+
50
+ //#endregion
51
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/ExtData.mjs
52
+ /**
53
+ * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.
54
+ */
55
+ var ExtData = class {
56
+ constructor(type, data) {
57
+ this.type = type;
58
+ this.data = data;
59
+ }
60
+ };
61
+
62
+ //#endregion
63
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/DecodeError.mjs
64
+ var DecodeError = class DecodeError extends Error {
65
+ constructor(message) {
66
+ super(message);
67
+ const proto = Object.create(DecodeError.prototype);
68
+ Object.setPrototypeOf(this, proto);
69
+ Object.defineProperty(this, "name", {
70
+ configurable: true,
71
+ enumerable: false,
72
+ value: DecodeError.name
73
+ });
74
+ }
75
+ };
76
+
77
+ //#endregion
78
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/utils/int.mjs
79
+ const UINT32_MAX = 4294967295;
80
+ function setInt64(view, offset, value) {
81
+ const high = Math.floor(value / 4294967296);
82
+ const low = value;
83
+ view.setUint32(offset, high);
84
+ view.setUint32(offset + 4, low);
85
+ }
86
+ function getInt64(view, offset) {
87
+ const high = view.getInt32(offset);
88
+ const low = view.getUint32(offset + 4);
89
+ return high * 4294967296 + low;
90
+ }
91
+ function getUint64(view, offset) {
92
+ const high = view.getUint32(offset);
93
+ const low = view.getUint32(offset + 4);
94
+ return high * 4294967296 + low;
95
+ }
96
+
97
+ //#endregion
98
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/timestamp.mjs
99
+ const EXT_TIMESTAMP = -1;
100
+ const TIMESTAMP32_MAX_SEC = 4294967295;
101
+ const TIMESTAMP64_MAX_SEC = 17179869183;
102
+ function encodeTimeSpecToTimestamp({ sec, nsec }) {
103
+ if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
104
+ const rv = new Uint8Array(4);
105
+ new DataView(rv.buffer).setUint32(0, sec);
106
+ return rv;
107
+ } else {
108
+ const secHigh = sec / 4294967296;
109
+ const secLow = sec & 4294967295;
110
+ const rv = new Uint8Array(8);
111
+ const view = new DataView(rv.buffer);
112
+ view.setUint32(0, nsec << 2 | secHigh & 3);
113
+ view.setUint32(4, secLow);
114
+ return rv;
115
+ }
116
+ else {
117
+ const rv = new Uint8Array(12);
118
+ const view = new DataView(rv.buffer);
119
+ view.setUint32(0, nsec);
120
+ setInt64(view, 4, sec);
121
+ return rv;
122
+ }
123
+ }
124
+ function encodeDateToTimeSpec(date) {
125
+ const msec = date.getTime();
126
+ const sec = Math.floor(msec / 1e3);
127
+ const nsec = (msec - sec * 1e3) * 1e6;
128
+ const nsecInSec = Math.floor(nsec / 1e9);
129
+ return {
130
+ sec: sec + nsecInSec,
131
+ nsec: nsec - nsecInSec * 1e9
132
+ };
133
+ }
134
+ function encodeTimestampExtension(object) {
135
+ if (object instanceof Date) return encodeTimeSpecToTimestamp(encodeDateToTimeSpec(object));
136
+ else return null;
137
+ }
138
+ function decodeTimestampToTimeSpec(data) {
139
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
140
+ switch (data.byteLength) {
141
+ case 4: return {
142
+ sec: view.getUint32(0),
143
+ nsec: 0
144
+ };
145
+ case 8: {
146
+ const nsec30AndSecHigh2 = view.getUint32(0);
147
+ const secLow32 = view.getUint32(4);
148
+ return {
149
+ sec: (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32,
150
+ nsec: nsec30AndSecHigh2 >>> 2
151
+ };
152
+ }
153
+ case 12: return {
154
+ sec: getInt64(view, 4),
155
+ nsec: view.getUint32(0)
156
+ };
157
+ default: throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);
158
+ }
159
+ }
160
+ function decodeTimestampExtension(data) {
161
+ const timeSpec = decodeTimestampToTimeSpec(data);
162
+ return /* @__PURE__ */ new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
163
+ }
164
+ const timestampExtension = {
165
+ type: EXT_TIMESTAMP,
166
+ encode: encodeTimestampExtension,
167
+ decode: decodeTimestampExtension
168
+ };
169
+
170
+ //#endregion
171
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/ExtensionCodec.mjs
172
+ var ExtensionCodec = class {
173
+ constructor() {
174
+ this.builtInEncoders = [];
175
+ this.builtInDecoders = [];
176
+ this.encoders = [];
177
+ this.decoders = [];
178
+ this.register(timestampExtension);
179
+ }
180
+ register({ type, encode, decode }) {
181
+ if (type >= 0) {
182
+ this.encoders[type] = encode;
183
+ this.decoders[type] = decode;
184
+ } else {
185
+ const index = -1 - type;
186
+ this.builtInEncoders[index] = encode;
187
+ this.builtInDecoders[index] = decode;
188
+ }
189
+ }
190
+ tryToEncode(object, context) {
191
+ for (let i = 0; i < this.builtInEncoders.length; i++) {
192
+ const encodeExt = this.builtInEncoders[i];
193
+ if (encodeExt != null) {
194
+ const data = encodeExt(object, context);
195
+ if (data != null) return new ExtData(-1 - i, data);
196
+ }
197
+ }
198
+ for (let i = 0; i < this.encoders.length; i++) {
199
+ const encodeExt = this.encoders[i];
200
+ if (encodeExt != null) {
201
+ const data = encodeExt(object, context);
202
+ if (data != null) return new ExtData(i, data);
203
+ }
204
+ }
205
+ if (object instanceof ExtData) return object;
206
+ return null;
207
+ }
208
+ decode(data, type, context) {
209
+ const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
210
+ if (decodeExt) return decodeExt(data, type, context);
211
+ else return new ExtData(type, data);
212
+ }
213
+ };
214
+ ExtensionCodec.defaultCodec = new ExtensionCodec();
215
+
216
+ //#endregion
217
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/utils/typedArrays.mjs
218
+ function isArrayBufferLike(buffer) {
219
+ return buffer instanceof ArrayBuffer || typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer;
220
+ }
221
+ function ensureUint8Array(buffer) {
222
+ if (buffer instanceof Uint8Array) return buffer;
223
+ else if (ArrayBuffer.isView(buffer)) return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
224
+ else if (isArrayBufferLike(buffer)) return new Uint8Array(buffer);
225
+ else return Uint8Array.from(buffer);
226
+ }
227
+
228
+ //#endregion
229
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/utils/prettyByte.mjs
230
+ function prettyByte(byte) {
231
+ return `${byte < 0 ? "-" : ""}0x${Math.abs(byte).toString(16).padStart(2, "0")}`;
232
+ }
233
+
234
+ //#endregion
235
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/CachedKeyDecoder.mjs
236
+ const DEFAULT_MAX_KEY_LENGTH = 16;
237
+ const DEFAULT_MAX_LENGTH_PER_KEY = 16;
238
+ var CachedKeyDecoder = class {
239
+ constructor(maxKeyLength = DEFAULT_MAX_KEY_LENGTH, maxLengthPerKey = DEFAULT_MAX_LENGTH_PER_KEY) {
240
+ this.hit = 0;
241
+ this.miss = 0;
242
+ this.maxKeyLength = maxKeyLength;
243
+ this.maxLengthPerKey = maxLengthPerKey;
244
+ this.caches = [];
245
+ for (let i = 0; i < this.maxKeyLength; i++) this.caches.push([]);
246
+ }
247
+ canBeCached(byteLength) {
248
+ return byteLength > 0 && byteLength <= this.maxKeyLength;
249
+ }
250
+ find(bytes, inputOffset, byteLength) {
251
+ const records = this.caches[byteLength - 1];
252
+ FIND_CHUNK: for (const record of records) {
253
+ const recordBytes = record.bytes;
254
+ for (let j = 0; j < byteLength; j++) if (recordBytes[j] !== bytes[inputOffset + j]) continue FIND_CHUNK;
255
+ return record.str;
256
+ }
257
+ return null;
258
+ }
259
+ store(bytes, value) {
260
+ const records = this.caches[bytes.length - 1];
261
+ const record = {
262
+ bytes,
263
+ str: value
264
+ };
265
+ if (records.length >= this.maxLengthPerKey) records[Math.random() * records.length | 0] = record;
266
+ else records.push(record);
267
+ }
268
+ decode(bytes, inputOffset, byteLength) {
269
+ const cachedValue = this.find(bytes, inputOffset, byteLength);
270
+ if (cachedValue != null) {
271
+ this.hit++;
272
+ return cachedValue;
273
+ }
274
+ this.miss++;
275
+ const str = utf8DecodeJs(bytes, inputOffset, byteLength);
276
+ const slicedCopyOfBytes = Uint8Array.prototype.slice.call(bytes, inputOffset, inputOffset + byteLength);
277
+ this.store(slicedCopyOfBytes, str);
278
+ return str;
279
+ }
280
+ };
281
+
282
+ //#endregion
283
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/Decoder.mjs
284
+ const STATE_ARRAY = "array";
285
+ const STATE_MAP_KEY = "map_key";
286
+ const STATE_MAP_VALUE = "map_value";
287
+ const mapKeyConverter = (key) => {
288
+ if (typeof key === "string" || typeof key === "number") return key;
289
+ throw new DecodeError("The type of key must be string or number but " + typeof key);
290
+ };
291
+ var StackPool = class {
292
+ constructor() {
293
+ this.stack = [];
294
+ this.stackHeadPosition = -1;
295
+ }
296
+ get length() {
297
+ return this.stackHeadPosition + 1;
298
+ }
299
+ top() {
300
+ return this.stack[this.stackHeadPosition];
301
+ }
302
+ pushArrayState(size) {
303
+ const state = this.getUninitializedStateFromPool();
304
+ state.type = STATE_ARRAY;
305
+ state.position = 0;
306
+ state.size = size;
307
+ state.array = new Array(size);
308
+ }
309
+ pushMapState(size) {
310
+ const state = this.getUninitializedStateFromPool();
311
+ state.type = STATE_MAP_KEY;
312
+ state.readCount = 0;
313
+ state.size = size;
314
+ state.map = {};
315
+ }
316
+ getUninitializedStateFromPool() {
317
+ this.stackHeadPosition++;
318
+ if (this.stackHeadPosition === this.stack.length) this.stack.push({
319
+ type: void 0,
320
+ size: 0,
321
+ array: void 0,
322
+ position: 0,
323
+ readCount: 0,
324
+ map: void 0,
325
+ key: null
326
+ });
327
+ return this.stack[this.stackHeadPosition];
328
+ }
329
+ release(state) {
330
+ if (this.stack[this.stackHeadPosition] !== state) throw new Error("Invalid stack state. Released state is not on top of the stack.");
331
+ if (state.type === STATE_ARRAY) {
332
+ const partialState = state;
333
+ partialState.size = 0;
334
+ partialState.array = void 0;
335
+ partialState.position = 0;
336
+ partialState.type = void 0;
337
+ }
338
+ if (state.type === STATE_MAP_KEY || state.type === STATE_MAP_VALUE) {
339
+ const partialState = state;
340
+ partialState.size = 0;
341
+ partialState.map = void 0;
342
+ partialState.readCount = 0;
343
+ partialState.type = void 0;
344
+ }
345
+ this.stackHeadPosition--;
346
+ }
347
+ reset() {
348
+ this.stack.length = 0;
349
+ this.stackHeadPosition = -1;
350
+ }
351
+ };
352
+ const HEAD_BYTE_REQUIRED = -1;
353
+ const EMPTY_VIEW = /* @__PURE__ */ new DataView(/* @__PURE__ */ new ArrayBuffer(0));
354
+ const EMPTY_BYTES = new Uint8Array(EMPTY_VIEW.buffer);
355
+ try {
356
+ EMPTY_VIEW.getInt8(0);
357
+ } catch (e) {
358
+ if (!(e instanceof RangeError)) throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access");
359
+ }
360
+ const MORE_DATA = /* @__PURE__ */ new RangeError("Insufficient data");
361
+ const sharedCachedKeyDecoder = new CachedKeyDecoder();
362
+ var Decoder = class Decoder {
363
+ constructor(options) {
364
+ this.totalPos = 0;
365
+ this.pos = 0;
366
+ this.view = EMPTY_VIEW;
367
+ this.bytes = EMPTY_BYTES;
368
+ this.headByte = HEAD_BYTE_REQUIRED;
369
+ this.stack = new StackPool();
370
+ this.entered = false;
371
+ this.extensionCodec = options?.extensionCodec ?? ExtensionCodec.defaultCodec;
372
+ this.context = options?.context;
373
+ this.useBigInt64 = options?.useBigInt64 ?? false;
374
+ this.rawStrings = options?.rawStrings ?? false;
375
+ this.maxStrLength = options?.maxStrLength ?? UINT32_MAX;
376
+ this.maxBinLength = options?.maxBinLength ?? UINT32_MAX;
377
+ this.maxArrayLength = options?.maxArrayLength ?? UINT32_MAX;
378
+ this.maxMapLength = options?.maxMapLength ?? UINT32_MAX;
379
+ this.maxExtLength = options?.maxExtLength ?? UINT32_MAX;
380
+ this.keyDecoder = options?.keyDecoder !== void 0 ? options.keyDecoder : sharedCachedKeyDecoder;
381
+ this.mapKeyConverter = options?.mapKeyConverter ?? mapKeyConverter;
382
+ }
383
+ clone() {
384
+ return new Decoder({
385
+ extensionCodec: this.extensionCodec,
386
+ context: this.context,
387
+ useBigInt64: this.useBigInt64,
388
+ rawStrings: this.rawStrings,
389
+ maxStrLength: this.maxStrLength,
390
+ maxBinLength: this.maxBinLength,
391
+ maxArrayLength: this.maxArrayLength,
392
+ maxMapLength: this.maxMapLength,
393
+ maxExtLength: this.maxExtLength,
394
+ keyDecoder: this.keyDecoder
395
+ });
396
+ }
397
+ reinitializeState() {
398
+ this.totalPos = 0;
399
+ this.headByte = HEAD_BYTE_REQUIRED;
400
+ this.stack.reset();
401
+ }
402
+ setBuffer(buffer) {
403
+ const bytes = ensureUint8Array(buffer);
404
+ this.bytes = bytes;
405
+ this.view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
406
+ this.pos = 0;
407
+ }
408
+ appendBuffer(buffer) {
409
+ if (this.headByte === HEAD_BYTE_REQUIRED && !this.hasRemaining(1)) this.setBuffer(buffer);
410
+ else {
411
+ const remainingData = this.bytes.subarray(this.pos);
412
+ const newData = ensureUint8Array(buffer);
413
+ const newBuffer = new Uint8Array(remainingData.length + newData.length);
414
+ newBuffer.set(remainingData);
415
+ newBuffer.set(newData, remainingData.length);
416
+ this.setBuffer(newBuffer);
417
+ }
418
+ }
419
+ hasRemaining(size) {
420
+ return this.view.byteLength - this.pos >= size;
421
+ }
422
+ createExtraByteError(posToShow) {
423
+ const { view, pos } = this;
424
+ return /* @__PURE__ */ new RangeError(`Extra ${view.byteLength - pos} of ${view.byteLength} byte(s) found at buffer[${posToShow}]`);
425
+ }
426
+ /**
427
+ * @throws {@link DecodeError}
428
+ * @throws {@link RangeError}
429
+ */
430
+ decode(buffer) {
431
+ if (this.entered) return this.clone().decode(buffer);
432
+ try {
433
+ this.entered = true;
434
+ this.reinitializeState();
435
+ this.setBuffer(buffer);
436
+ const object = this.doDecodeSync();
437
+ if (this.hasRemaining(1)) throw this.createExtraByteError(this.pos);
438
+ return object;
439
+ } finally {
440
+ this.entered = false;
441
+ }
442
+ }
443
+ *decodeMulti(buffer) {
444
+ if (this.entered) {
445
+ yield* this.clone().decodeMulti(buffer);
446
+ return;
447
+ }
448
+ try {
449
+ this.entered = true;
450
+ this.reinitializeState();
451
+ this.setBuffer(buffer);
452
+ while (this.hasRemaining(1)) yield this.doDecodeSync();
453
+ } finally {
454
+ this.entered = false;
455
+ }
456
+ }
457
+ async decodeAsync(stream) {
458
+ if (this.entered) return this.clone().decodeAsync(stream);
459
+ try {
460
+ this.entered = true;
461
+ let decoded = false;
462
+ let object;
463
+ for await (const buffer of stream) {
464
+ if (decoded) {
465
+ this.entered = false;
466
+ throw this.createExtraByteError(this.totalPos);
467
+ }
468
+ this.appendBuffer(buffer);
469
+ try {
470
+ object = this.doDecodeSync();
471
+ decoded = true;
472
+ } catch (e) {
473
+ if (!(e instanceof RangeError)) throw e;
474
+ }
475
+ this.totalPos += this.pos;
476
+ }
477
+ if (decoded) {
478
+ if (this.hasRemaining(1)) throw this.createExtraByteError(this.totalPos);
479
+ return object;
480
+ }
481
+ const { headByte, pos, totalPos } = this;
482
+ throw new RangeError(`Insufficient data in parsing ${prettyByte(headByte)} at ${totalPos} (${pos} in the current buffer)`);
483
+ } finally {
484
+ this.entered = false;
485
+ }
486
+ }
487
+ decodeArrayStream(stream) {
488
+ return this.decodeMultiAsync(stream, true);
489
+ }
490
+ decodeStream(stream) {
491
+ return this.decodeMultiAsync(stream, false);
492
+ }
493
+ async *decodeMultiAsync(stream, isArray) {
494
+ if (this.entered) {
495
+ yield* this.clone().decodeMultiAsync(stream, isArray);
496
+ return;
497
+ }
498
+ try {
499
+ this.entered = true;
500
+ let isArrayHeaderRequired = isArray;
501
+ let arrayItemsLeft = -1;
502
+ for await (const buffer of stream) {
503
+ if (isArray && arrayItemsLeft === 0) throw this.createExtraByteError(this.totalPos);
504
+ this.appendBuffer(buffer);
505
+ if (isArrayHeaderRequired) {
506
+ arrayItemsLeft = this.readArraySize();
507
+ isArrayHeaderRequired = false;
508
+ this.complete();
509
+ }
510
+ try {
511
+ while (true) {
512
+ yield this.doDecodeSync();
513
+ if (--arrayItemsLeft === 0) break;
514
+ }
515
+ } catch (e) {
516
+ if (!(e instanceof RangeError)) throw e;
517
+ }
518
+ this.totalPos += this.pos;
519
+ }
520
+ } finally {
521
+ this.entered = false;
522
+ }
523
+ }
524
+ doDecodeSync() {
525
+ DECODE: while (true) {
526
+ const headByte = this.readHeadByte();
527
+ let object;
528
+ if (headByte >= 224) object = headByte - 256;
529
+ else if (headByte < 192) if (headByte < 128) object = headByte;
530
+ else if (headByte < 144) {
531
+ const size = headByte - 128;
532
+ if (size !== 0) {
533
+ this.pushMapState(size);
534
+ this.complete();
535
+ continue DECODE;
536
+ } else object = {};
537
+ } else if (headByte < 160) {
538
+ const size = headByte - 144;
539
+ if (size !== 0) {
540
+ this.pushArrayState(size);
541
+ this.complete();
542
+ continue DECODE;
543
+ } else object = [];
544
+ } else {
545
+ const byteLength = headByte - 160;
546
+ object = this.decodeString(byteLength, 0);
547
+ }
548
+ else if (headByte === 192) object = null;
549
+ else if (headByte === 194) object = false;
550
+ else if (headByte === 195) object = true;
551
+ else if (headByte === 202) object = this.readF32();
552
+ else if (headByte === 203) object = this.readF64();
553
+ else if (headByte === 204) object = this.readU8();
554
+ else if (headByte === 205) object = this.readU16();
555
+ else if (headByte === 206) object = this.readU32();
556
+ else if (headByte === 207) if (this.useBigInt64) object = this.readU64AsBigInt();
557
+ else object = this.readU64();
558
+ else if (headByte === 208) object = this.readI8();
559
+ else if (headByte === 209) object = this.readI16();
560
+ else if (headByte === 210) object = this.readI32();
561
+ else if (headByte === 211) if (this.useBigInt64) object = this.readI64AsBigInt();
562
+ else object = this.readI64();
563
+ else if (headByte === 217) {
564
+ const byteLength = this.lookU8();
565
+ object = this.decodeString(byteLength, 1);
566
+ } else if (headByte === 218) {
567
+ const byteLength = this.lookU16();
568
+ object = this.decodeString(byteLength, 2);
569
+ } else if (headByte === 219) {
570
+ const byteLength = this.lookU32();
571
+ object = this.decodeString(byteLength, 4);
572
+ } else if (headByte === 220) {
573
+ const size = this.readU16();
574
+ if (size !== 0) {
575
+ this.pushArrayState(size);
576
+ this.complete();
577
+ continue DECODE;
578
+ } else object = [];
579
+ } else if (headByte === 221) {
580
+ const size = this.readU32();
581
+ if (size !== 0) {
582
+ this.pushArrayState(size);
583
+ this.complete();
584
+ continue DECODE;
585
+ } else object = [];
586
+ } else if (headByte === 222) {
587
+ const size = this.readU16();
588
+ if (size !== 0) {
589
+ this.pushMapState(size);
590
+ this.complete();
591
+ continue DECODE;
592
+ } else object = {};
593
+ } else if (headByte === 223) {
594
+ const size = this.readU32();
595
+ if (size !== 0) {
596
+ this.pushMapState(size);
597
+ this.complete();
598
+ continue DECODE;
599
+ } else object = {};
600
+ } else if (headByte === 196) {
601
+ const size = this.lookU8();
602
+ object = this.decodeBinary(size, 1);
603
+ } else if (headByte === 197) {
604
+ const size = this.lookU16();
605
+ object = this.decodeBinary(size, 2);
606
+ } else if (headByte === 198) {
607
+ const size = this.lookU32();
608
+ object = this.decodeBinary(size, 4);
609
+ } else if (headByte === 212) object = this.decodeExtension(1, 0);
610
+ else if (headByte === 213) object = this.decodeExtension(2, 0);
611
+ else if (headByte === 214) object = this.decodeExtension(4, 0);
612
+ else if (headByte === 215) object = this.decodeExtension(8, 0);
613
+ else if (headByte === 216) object = this.decodeExtension(16, 0);
614
+ else if (headByte === 199) {
615
+ const size = this.lookU8();
616
+ object = this.decodeExtension(size, 1);
617
+ } else if (headByte === 200) {
618
+ const size = this.lookU16();
619
+ object = this.decodeExtension(size, 2);
620
+ } else if (headByte === 201) {
621
+ const size = this.lookU32();
622
+ object = this.decodeExtension(size, 4);
623
+ } else throw new DecodeError(`Unrecognized type byte: ${prettyByte(headByte)}`);
624
+ this.complete();
625
+ const stack = this.stack;
626
+ while (stack.length > 0) {
627
+ const state = stack.top();
628
+ if (state.type === STATE_ARRAY) {
629
+ state.array[state.position] = object;
630
+ state.position++;
631
+ if (state.position === state.size) {
632
+ object = state.array;
633
+ stack.release(state);
634
+ } else continue DECODE;
635
+ } else if (state.type === STATE_MAP_KEY) {
636
+ if (object === "__proto__") throw new DecodeError("The key __proto__ is not allowed");
637
+ state.key = this.mapKeyConverter(object);
638
+ state.type = STATE_MAP_VALUE;
639
+ continue DECODE;
640
+ } else {
641
+ state.map[state.key] = object;
642
+ state.readCount++;
643
+ if (state.readCount === state.size) {
644
+ object = state.map;
645
+ stack.release(state);
646
+ } else {
647
+ state.key = null;
648
+ state.type = STATE_MAP_KEY;
649
+ continue DECODE;
650
+ }
651
+ }
652
+ }
653
+ return object;
654
+ }
655
+ }
656
+ readHeadByte() {
657
+ if (this.headByte === HEAD_BYTE_REQUIRED) this.headByte = this.readU8();
658
+ return this.headByte;
659
+ }
660
+ complete() {
661
+ this.headByte = HEAD_BYTE_REQUIRED;
662
+ }
663
+ readArraySize() {
664
+ const headByte = this.readHeadByte();
665
+ switch (headByte) {
666
+ case 220: return this.readU16();
667
+ case 221: return this.readU32();
668
+ default: if (headByte < 160) return headByte - 144;
669
+ else throw new DecodeError(`Unrecognized array type byte: ${prettyByte(headByte)}`);
670
+ }
671
+ }
672
+ pushMapState(size) {
673
+ if (size > this.maxMapLength) throw new DecodeError(`Max length exceeded: map length (${size}) > maxMapLengthLength (${this.maxMapLength})`);
674
+ this.stack.pushMapState(size);
675
+ }
676
+ pushArrayState(size) {
677
+ if (size > this.maxArrayLength) throw new DecodeError(`Max length exceeded: array length (${size}) > maxArrayLength (${this.maxArrayLength})`);
678
+ this.stack.pushArrayState(size);
679
+ }
680
+ decodeString(byteLength, headerOffset) {
681
+ if (!this.rawStrings || this.stateIsMapKey()) return this.decodeUtf8String(byteLength, headerOffset);
682
+ return this.decodeBinary(byteLength, headerOffset);
683
+ }
684
+ /**
685
+ * @throws {@link RangeError}
686
+ */
687
+ decodeUtf8String(byteLength, headerOffset) {
688
+ if (byteLength > this.maxStrLength) throw new DecodeError(`Max length exceeded: UTF-8 byte length (${byteLength}) > maxStrLength (${this.maxStrLength})`);
689
+ if (this.bytes.byteLength < this.pos + headerOffset + byteLength) throw MORE_DATA;
690
+ const offset = this.pos + headerOffset;
691
+ let object;
692
+ if (this.stateIsMapKey() && this.keyDecoder?.canBeCached(byteLength)) object = this.keyDecoder.decode(this.bytes, offset, byteLength);
693
+ else object = utf8Decode(this.bytes, offset, byteLength);
694
+ this.pos += headerOffset + byteLength;
695
+ return object;
696
+ }
697
+ stateIsMapKey() {
698
+ if (this.stack.length > 0) return this.stack.top().type === STATE_MAP_KEY;
699
+ return false;
700
+ }
701
+ /**
702
+ * @throws {@link RangeError}
703
+ */
704
+ decodeBinary(byteLength, headOffset) {
705
+ if (byteLength > this.maxBinLength) throw new DecodeError(`Max length exceeded: bin length (${byteLength}) > maxBinLength (${this.maxBinLength})`);
706
+ if (!this.hasRemaining(byteLength + headOffset)) throw MORE_DATA;
707
+ const offset = this.pos + headOffset;
708
+ const object = this.bytes.subarray(offset, offset + byteLength);
709
+ this.pos += headOffset + byteLength;
710
+ return object;
711
+ }
712
+ decodeExtension(size, headOffset) {
713
+ if (size > this.maxExtLength) throw new DecodeError(`Max length exceeded: ext length (${size}) > maxExtLength (${this.maxExtLength})`);
714
+ const extType = this.view.getInt8(this.pos + headOffset);
715
+ const data = this.decodeBinary(size, headOffset + 1);
716
+ return this.extensionCodec.decode(data, extType, this.context);
717
+ }
718
+ lookU8() {
719
+ return this.view.getUint8(this.pos);
720
+ }
721
+ lookU16() {
722
+ return this.view.getUint16(this.pos);
723
+ }
724
+ lookU32() {
725
+ return this.view.getUint32(this.pos);
726
+ }
727
+ readU8() {
728
+ const value = this.view.getUint8(this.pos);
729
+ this.pos++;
730
+ return value;
731
+ }
732
+ readI8() {
733
+ const value = this.view.getInt8(this.pos);
734
+ this.pos++;
735
+ return value;
736
+ }
737
+ readU16() {
738
+ const value = this.view.getUint16(this.pos);
739
+ this.pos += 2;
740
+ return value;
741
+ }
742
+ readI16() {
743
+ const value = this.view.getInt16(this.pos);
744
+ this.pos += 2;
745
+ return value;
746
+ }
747
+ readU32() {
748
+ const value = this.view.getUint32(this.pos);
749
+ this.pos += 4;
750
+ return value;
751
+ }
752
+ readI32() {
753
+ const value = this.view.getInt32(this.pos);
754
+ this.pos += 4;
755
+ return value;
756
+ }
757
+ readU64() {
758
+ const value = getUint64(this.view, this.pos);
759
+ this.pos += 8;
760
+ return value;
761
+ }
762
+ readI64() {
763
+ const value = getInt64(this.view, this.pos);
764
+ this.pos += 8;
765
+ return value;
766
+ }
767
+ readU64AsBigInt() {
768
+ const value = this.view.getBigUint64(this.pos);
769
+ this.pos += 8;
770
+ return value;
771
+ }
772
+ readI64AsBigInt() {
773
+ const value = this.view.getBigInt64(this.pos);
774
+ this.pos += 8;
775
+ return value;
776
+ }
777
+ readF32() {
778
+ const value = this.view.getFloat32(this.pos);
779
+ this.pos += 4;
780
+ return value;
781
+ }
782
+ readF64() {
783
+ const value = this.view.getFloat64(this.pos);
784
+ this.pos += 8;
785
+ return value;
786
+ }
787
+ };
788
+
789
+ //#endregion
790
+ //#region ../../node_modules/.pnpm/@msgpack+msgpack@3.1.2/node_modules/@msgpack/msgpack/dist.esm/decode.mjs
791
+ /**
792
+ * It decodes a single MessagePack object in a buffer.
793
+ *
794
+ * This is a synchronous decoding function.
795
+ * See other variants for asynchronous decoding: {@link decodeAsync}, {@link decodeMultiStream}, or {@link decodeArrayStream}.
796
+ *
797
+ * @throws {@link RangeError} if the buffer is incomplete, including the case where the buffer is empty.
798
+ * @throws {@link DecodeError} if the buffer contains invalid data.
799
+ */
800
+ function decode(buffer, options) {
801
+ return new Decoder(options).decode(buffer);
802
+ }
803
+
804
+ //#endregion
805
+ export { decode as t };