@genai-fi/nanogpt 0.19.0 → 0.20.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 (482) hide show
  1. package/package.json +9 -10
  2. package/dist/Generator.d.ts +0 -82
  3. package/dist/Generator.js +0 -11941
  4. package/dist/RealDiv-CGwv0liw.js +0 -365
  5. package/dist/Reshape-BW__R4mZ.js +0 -79
  6. package/dist/Reshape-CPBkTIH2.js +0 -14
  7. package/dist/TeachableLLM.d.ts +0 -70
  8. package/dist/TeachableLLM.js +0 -273
  9. package/dist/Trainer.d.ts +0 -43
  10. package/dist/Trainer.js +0 -244
  11. package/dist/_commonjsHelpers-ByX85dGu.js +0 -33
  12. package/dist/axis_util-GTVlo58H.js +0 -55
  13. package/dist/backend.d.ts +0 -2
  14. package/dist/backend.js +0 -13
  15. package/dist/backend_util-GaFarB78.js +0 -425
  16. package/dist/backend_webgpu-BqASlsbV.js +0 -545
  17. package/dist/binary_op_util-pKXltfxI.js +0 -192
  18. package/dist/broadcast_to-eS93CCN_.js +0 -28
  19. package/dist/checks/appendCache.d.ts +0 -1
  20. package/dist/checks/appendCache.js +0 -22
  21. package/dist/checks/attentionMask.d.ts +0 -1
  22. package/dist/checks/attentionMask.js +0 -37
  23. package/dist/checks/check.d.ts +0 -9
  24. package/dist/checks/check.js +0 -20
  25. package/dist/checks/gelu.d.ts +0 -1
  26. package/dist/checks/gelu.js +0 -18
  27. package/dist/checks/index.d.ts +0 -26
  28. package/dist/checks/index.js +0 -28
  29. package/dist/checks/matMulGelu.d.ts +0 -1
  30. package/dist/checks/matMulGelu.js +0 -28
  31. package/dist/checks/normRMS.d.ts +0 -1
  32. package/dist/checks/normRMS.js +0 -16
  33. package/dist/checks/normRMSGrad.d.ts +0 -1
  34. package/dist/checks/normRMSGrad.js +0 -12
  35. package/dist/checks/packUnpack.d.ts +0 -1
  36. package/dist/checks/packUnpack.js +0 -18
  37. package/dist/checks/qkv.d.ts +0 -1
  38. package/dist/checks/qkv.js +0 -34
  39. package/dist/checks/rope.d.ts +0 -1
  40. package/dist/checks/rope.js +0 -36
  41. package/dist/checks/weights.d.ts +0 -14
  42. package/dist/checks/weights.js +0 -31
  43. package/dist/clip_by_value-DDA7rrcT.js +0 -12
  44. package/dist/complex-DI35Q-gW.js +0 -11
  45. package/dist/complex_util-Yc1A_gV1.js +0 -55
  46. package/dist/concat-CAQpCret.js +0 -17
  47. package/dist/concat_util-D18dJ4fD.js +0 -22
  48. package/dist/data/docx.d.ts +0 -2
  49. package/dist/data/docx.js +0 -15
  50. package/dist/data/parquet.d.ts +0 -2
  51. package/dist/data/parquet.js +0 -17
  52. package/dist/data/pdf.d.ts +0 -2
  53. package/dist/data/pdf.js +0 -14
  54. package/dist/data/textLoader.d.ts +0 -7
  55. package/dist/data/textLoader.js +0 -108
  56. package/dist/dataset-CGGp1z9P.js +0 -1124
  57. package/dist/dropout_util--NxWuYg2.js +0 -27
  58. package/dist/expand_dims-Bkd1YD5x.js +0 -11
  59. package/dist/exports_initializers-CYzKLjN7.js +0 -7
  60. package/dist/floor-BQtb-Azg.js +0 -9
  61. package/dist/gather-qIqEqaGn.js +0 -9
  62. package/dist/gelu-B220X1Go.js +0 -26
  63. package/dist/gpgpu_math-BwvV12df.js +0 -2022
  64. package/dist/index-CUXkjxiT.js +0 -3516
  65. package/dist/index-CieiGp4Y.js +0 -349
  66. package/dist/index-CjOWnMXP.js +0 -7308
  67. package/dist/index-Cp39cXWe.js +0 -1016
  68. package/dist/index-D5v913EJ.js +0 -4
  69. package/dist/index-DmeWGGmS.js +0 -1074
  70. package/dist/index-DvYrXKkX.js +0 -113
  71. package/dist/index-Ksja3su6.js +0 -151
  72. package/dist/index-xuotMAFm.js +0 -118
  73. package/dist/inference/types.d.ts +0 -16
  74. package/dist/inference/types.js +0 -1
  75. package/dist/jszip.min-BZhlzntC.js +0 -2313
  76. package/dist/kernel_funcs_utils-pq0CK9co.js +0 -306
  77. package/dist/layers/BaseLayer.d.ts +0 -44
  78. package/dist/layers/BaseLayer.js +0 -74
  79. package/dist/layers/CausalSelfAttention.d.ts +0 -39
  80. package/dist/layers/CausalSelfAttention.js +0 -86
  81. package/dist/layers/LoRA.d.ts +0 -14
  82. package/dist/layers/LoRA.js +0 -58
  83. package/dist/layers/MLP.d.ts +0 -17
  84. package/dist/layers/MLP.js +0 -44
  85. package/dist/layers/PositionEmbedding.d.ts +0 -8
  86. package/dist/layers/PositionEmbedding.js +0 -31
  87. package/dist/layers/RMSNorm.d.ts +0 -12
  88. package/dist/layers/RMSNorm.js +0 -22
  89. package/dist/layers/RoPECache.d.ts +0 -18
  90. package/dist/layers/RoPECache.js +0 -50
  91. package/dist/layers/TiedEmbedding.d.ts +0 -13
  92. package/dist/layers/TiedEmbedding.js +0 -36
  93. package/dist/layers/TransformerBlock.d.ts +0 -27
  94. package/dist/layers/TransformerBlock.js +0 -40
  95. package/dist/layers/WeightStore.d.ts +0 -20
  96. package/dist/layers/WeightStore.js +0 -76
  97. package/dist/loader/load.d.ts +0 -6
  98. package/dist/loader/load.js +0 -68
  99. package/dist/loader/loadHF.d.ts +0 -8
  100. package/dist/loader/loadHF.js +0 -22
  101. package/dist/loader/loadTransformers.d.ts +0 -4
  102. package/dist/loader/loadTransformers.js +0 -44
  103. package/dist/loader/loadZipMeta.d.ts +0 -3
  104. package/dist/loader/loadZipMeta.js +0 -16
  105. package/dist/loader/newZipLoad.d.ts +0 -3
  106. package/dist/loader/newZipLoad.js +0 -31
  107. package/dist/loader/oldZipLoad.d.ts +0 -9
  108. package/dist/loader/oldZipLoad.js +0 -80
  109. package/dist/loader/save.d.ts +0 -16
  110. package/dist/loader/save.js +0 -90
  111. package/dist/loader/types.d.ts +0 -67
  112. package/dist/loader/types.js +0 -1
  113. package/dist/main.d.ts +0 -50
  114. package/dist/main.js +0 -109
  115. package/dist/matMul16-BcVC_E62.js +0 -80
  116. package/dist/matMulGelu-JNLZqKQp.js +0 -163
  117. package/dist/mat_mul-DhG0Newp.js +0 -11
  118. package/dist/mod-CSdCpRjf.js +0 -11
  119. package/dist/models/NanoGPTV1.d.ts +0 -16
  120. package/dist/models/NanoGPTV1.js +0 -99
  121. package/dist/models/NanoGPTV2.d.ts +0 -16
  122. package/dist/models/NanoGPTV2.js +0 -90
  123. package/dist/models/config.d.ts +0 -27
  124. package/dist/models/config.js +0 -50
  125. package/dist/models/factory.d.ts +0 -3
  126. package/dist/models/factory.js +0 -16
  127. package/dist/models/model.d.ts +0 -44
  128. package/dist/models/model.js +0 -134
  129. package/dist/non_max_suppression_impl-B2W7YjZB.js +0 -102
  130. package/dist/not_equal-hurPF26l.js +0 -64
  131. package/dist/ones-BytntneX.js +0 -14
  132. package/dist/ops/adamAdjust.d.ts +0 -2
  133. package/dist/ops/adamAdjust.js +0 -9
  134. package/dist/ops/adamMoments.d.ts +0 -2
  135. package/dist/ops/adamMoments.js +0 -9
  136. package/dist/ops/add16.d.ts +0 -2
  137. package/dist/ops/add16.js +0 -9
  138. package/dist/ops/appendCache.d.ts +0 -2
  139. package/dist/ops/appendCache.js +0 -22
  140. package/dist/ops/attentionMask.d.ts +0 -2
  141. package/dist/ops/attentionMask.js +0 -10
  142. package/dist/ops/concat16.d.ts +0 -2
  143. package/dist/ops/concat16.js +0 -9
  144. package/dist/ops/cpu/adamAdjust.d.ts +0 -1
  145. package/dist/ops/cpu/adamAdjust.js +0 -18
  146. package/dist/ops/cpu/adamMoments.d.ts +0 -1
  147. package/dist/ops/cpu/adamMoments.js +0 -16
  148. package/dist/ops/cpu/appendCache.d.ts +0 -1
  149. package/dist/ops/cpu/appendCache.js +0 -23
  150. package/dist/ops/cpu/attentionMask.d.ts +0 -1
  151. package/dist/ops/cpu/attentionMask.js +0 -22
  152. package/dist/ops/cpu/fusedSoftmax.d.ts +0 -9
  153. package/dist/ops/cpu/fusedSoftmax.js +0 -29
  154. package/dist/ops/cpu/gatherSub.d.ts +0 -1
  155. package/dist/ops/cpu/gatherSub.js +0 -18
  156. package/dist/ops/cpu/gelu.d.ts +0 -1
  157. package/dist/ops/cpu/gelu.js +0 -40
  158. package/dist/ops/cpu/matMul16.d.ts +0 -1
  159. package/dist/ops/cpu/matMul16.js +0 -15
  160. package/dist/ops/cpu/matMulGelu.d.ts +0 -1
  161. package/dist/ops/cpu/matMulGelu.js +0 -53
  162. package/dist/ops/cpu/matMulMul.d.ts +0 -1
  163. package/dist/ops/cpu/matMulMul.js +0 -23
  164. package/dist/ops/cpu/mulDropout.d.ts +0 -1
  165. package/dist/ops/cpu/mulDropout.js +0 -23
  166. package/dist/ops/cpu/normRMS.d.ts +0 -1
  167. package/dist/ops/cpu/normRMS.js +0 -39
  168. package/dist/ops/cpu/qkv.d.ts +0 -5
  169. package/dist/ops/cpu/qkv.js +0 -41
  170. package/dist/ops/cpu/rope.d.ts +0 -6
  171. package/dist/ops/cpu/rope.js +0 -38
  172. package/dist/ops/cpu/scatterSub.d.ts +0 -1
  173. package/dist/ops/cpu/scatterSub.js +0 -23
  174. package/dist/ops/dot16.d.ts +0 -2
  175. package/dist/ops/dot16.js +0 -42
  176. package/dist/ops/dropout.d.ts +0 -2
  177. package/dist/ops/dropout.js +0 -14
  178. package/dist/ops/dropout16.d.ts +0 -2
  179. package/dist/ops/dropout16.js +0 -25
  180. package/dist/ops/gatherSub.d.ts +0 -2
  181. package/dist/ops/gatherSub.js +0 -9
  182. package/dist/ops/gelu.d.ts +0 -3
  183. package/dist/ops/gelu.js +0 -8
  184. package/dist/ops/globalNorm.d.ts +0 -2
  185. package/dist/ops/globalNorm.js +0 -13
  186. package/dist/ops/grads/add16.d.ts +0 -1
  187. package/dist/ops/grads/add16.js +0 -26
  188. package/dist/ops/grads/attentionMask.d.ts +0 -1
  189. package/dist/ops/grads/attentionMask.js +0 -21
  190. package/dist/ops/grads/dropout16.d.ts +0 -1
  191. package/dist/ops/grads/dropout16.js +0 -2
  192. package/dist/ops/grads/gelu.d.ts +0 -2
  193. package/dist/ops/grads/gelu.js +0 -5
  194. package/dist/ops/grads/matMul16.d.ts +0 -2
  195. package/dist/ops/grads/matMul16.js +0 -9
  196. package/dist/ops/grads/matMulGelu.d.ts +0 -1
  197. package/dist/ops/grads/matMulGelu.js +0 -17
  198. package/dist/ops/grads/mul16.d.ts +0 -1
  199. package/dist/ops/grads/mul16.js +0 -4
  200. package/dist/ops/grads/normRMS.d.ts +0 -3
  201. package/dist/ops/grads/normRMS.js +0 -33
  202. package/dist/ops/grads/pack16.d.ts +0 -2
  203. package/dist/ops/grads/pack16.js +0 -6
  204. package/dist/ops/grads/qkv.d.ts +0 -3
  205. package/dist/ops/grads/qkv.js +0 -34
  206. package/dist/ops/grads/rope.d.ts +0 -2
  207. package/dist/ops/grads/rope.js +0 -5
  208. package/dist/ops/grads/softmax16.d.ts +0 -2
  209. package/dist/ops/grads/softmax16.js +0 -25
  210. package/dist/ops/grads/unpack16.d.ts +0 -2
  211. package/dist/ops/grads/unpack16.js +0 -5
  212. package/dist/ops/grads/utils.d.ts +0 -4
  213. package/dist/ops/grads/utils.js +0 -14
  214. package/dist/ops/log.d.ts +0 -0
  215. package/dist/ops/log.js +0 -1
  216. package/dist/ops/matMul16.d.ts +0 -15
  217. package/dist/ops/matMul16.js +0 -13
  218. package/dist/ops/matMulGelu.d.ts +0 -3
  219. package/dist/ops/matMulGelu.js +0 -14
  220. package/dist/ops/matMulMul.d.ts +0 -2
  221. package/dist/ops/matMulMul.js +0 -9
  222. package/dist/ops/mul16.d.ts +0 -2
  223. package/dist/ops/mul16.js +0 -39
  224. package/dist/ops/mulDrop.d.ts +0 -2
  225. package/dist/ops/mulDrop.js +0 -9
  226. package/dist/ops/normRMS.d.ts +0 -2
  227. package/dist/ops/normRMS.js +0 -19
  228. package/dist/ops/pack16.d.ts +0 -2
  229. package/dist/ops/pack16.js +0 -5
  230. package/dist/ops/qkv.d.ts +0 -2
  231. package/dist/ops/qkv.js +0 -10
  232. package/dist/ops/reshape16.d.ts +0 -2
  233. package/dist/ops/reshape16.js +0 -41
  234. package/dist/ops/rope.d.ts +0 -3
  235. package/dist/ops/rope.js +0 -7
  236. package/dist/ops/scatterSub.d.ts +0 -2
  237. package/dist/ops/scatterSub.js +0 -9
  238. package/dist/ops/slice16.d.ts +0 -2
  239. package/dist/ops/slice16.js +0 -9
  240. package/dist/ops/softmax16.d.ts +0 -2
  241. package/dist/ops/softmax16.js +0 -9
  242. package/dist/ops/sub16.d.ts +0 -2
  243. package/dist/ops/sub16.js +0 -8
  244. package/dist/ops/sum16.d.ts +0 -2
  245. package/dist/ops/sum16.js +0 -13
  246. package/dist/ops/transpose16.d.ts +0 -3
  247. package/dist/ops/transpose16.js +0 -40
  248. package/dist/ops/unpack16.d.ts +0 -2
  249. package/dist/ops/unpack16.js +0 -6
  250. package/dist/ops/webgl/adamAdjust.d.ts +0 -1
  251. package/dist/ops/webgl/adamAdjust.js +0 -49
  252. package/dist/ops/webgl/adamMoments.d.ts +0 -1
  253. package/dist/ops/webgl/adamMoments.js +0 -40
  254. package/dist/ops/webgl/appendCache.d.ts +0 -1
  255. package/dist/ops/webgl/appendCache.js +0 -44
  256. package/dist/ops/webgl/attentionMask.d.ts +0 -1
  257. package/dist/ops/webgl/attentionMask.js +0 -45
  258. package/dist/ops/webgl/dropout16.d.ts +0 -1
  259. package/dist/ops/webgl/dropout16.js +0 -11
  260. package/dist/ops/webgl/fusedSoftmax.d.ts +0 -11
  261. package/dist/ops/webgl/fusedSoftmax.js +0 -80
  262. package/dist/ops/webgl/gatherSub.d.ts +0 -1
  263. package/dist/ops/webgl/gatherSub.js +0 -27
  264. package/dist/ops/webgl/gelu.d.ts +0 -2
  265. package/dist/ops/webgl/gelu.js +0 -50
  266. package/dist/ops/webgl/log.d.ts +0 -17
  267. package/dist/ops/webgl/log.js +0 -23
  268. package/dist/ops/webgl/matMul16.d.ts +0 -1
  269. package/dist/ops/webgl/matMul16.js +0 -45
  270. package/dist/ops/webgl/matMulGelu.d.ts +0 -21
  271. package/dist/ops/webgl/matMulGelu.js +0 -9
  272. package/dist/ops/webgl/matMulMul.d.ts +0 -14
  273. package/dist/ops/webgl/matMulMul.js +0 -28
  274. package/dist/ops/webgl/mulDropout.d.ts +0 -1
  275. package/dist/ops/webgl/mulDropout.js +0 -41
  276. package/dist/ops/webgl/normRMS.d.ts +0 -1
  277. package/dist/ops/webgl/normRMS.js +0 -93
  278. package/dist/ops/webgl/qkv.d.ts +0 -1
  279. package/dist/ops/webgl/qkv.js +0 -46
  280. package/dist/ops/webgl/rope.d.ts +0 -1
  281. package/dist/ops/webgl/rope.js +0 -56
  282. package/dist/ops/webgl/scatterSub.d.ts +0 -1
  283. package/dist/ops/webgl/scatterSub.js +0 -27
  284. package/dist/ops/webgpu/adamAdjust.d.ts +0 -1
  285. package/dist/ops/webgpu/adamAdjust.js +0 -57
  286. package/dist/ops/webgpu/adamMoments.d.ts +0 -1
  287. package/dist/ops/webgpu/adamMoments.js +0 -60
  288. package/dist/ops/webgpu/add16.d.ts +0 -1
  289. package/dist/ops/webgpu/add16.js +0 -13
  290. package/dist/ops/webgpu/appendCache.d.ts +0 -1
  291. package/dist/ops/webgpu/appendCache.js +0 -105
  292. package/dist/ops/webgpu/attentionMask.d.ts +0 -1
  293. package/dist/ops/webgpu/attentionMask.js +0 -26
  294. package/dist/ops/webgpu/attentionMask32_program.d.ts +0 -19
  295. package/dist/ops/webgpu/attentionMask32_program.js +0 -54
  296. package/dist/ops/webgpu/clipScale.d.ts +0 -1
  297. package/dist/ops/webgpu/clipScale.js +0 -58
  298. package/dist/ops/webgpu/concat16.d.ts +0 -19
  299. package/dist/ops/webgpu/concat16.js +0 -126
  300. package/dist/ops/webgpu/dropout16.d.ts +0 -1
  301. package/dist/ops/webgpu/dropout16.js +0 -51
  302. package/dist/ops/webgpu/gatherSub.d.ts +0 -1
  303. package/dist/ops/webgpu/gatherSub.js +0 -39
  304. package/dist/ops/webgpu/gelu.d.ts +0 -14
  305. package/dist/ops/webgpu/gelu.js +0 -141
  306. package/dist/ops/webgpu/index.d.ts +0 -0
  307. package/dist/ops/webgpu/index.js +0 -26
  308. package/dist/ops/webgpu/matMul16.d.ts +0 -1
  309. package/dist/ops/webgpu/matMul16.js +0 -65
  310. package/dist/ops/webgpu/matMul16_program.d.ts +0 -42
  311. package/dist/ops/webgpu/matMul16_program.js +0 -343
  312. package/dist/ops/webgpu/mul16.d.ts +0 -1
  313. package/dist/ops/webgpu/mul16.js +0 -13
  314. package/dist/ops/webgpu/norm2.d.ts +0 -1
  315. package/dist/ops/webgpu/norm2.js +0 -76
  316. package/dist/ops/webgpu/normRMS.d.ts +0 -1
  317. package/dist/ops/webgpu/normRMS.js +0 -34
  318. package/dist/ops/webgpu/normRMS16_program.d.ts +0 -10
  319. package/dist/ops/webgpu/normRMS16_program.js +0 -25
  320. package/dist/ops/webgpu/normRMS32_program.d.ts +0 -10
  321. package/dist/ops/webgpu/normRMS32_program.js +0 -25
  322. package/dist/ops/webgpu/normRMSGrad.d.ts +0 -1
  323. package/dist/ops/webgpu/normRMSGrad.js +0 -284
  324. package/dist/ops/webgpu/pack16.d.ts +0 -1
  325. package/dist/ops/webgpu/pack16.js +0 -18
  326. package/dist/ops/webgpu/pack16_program.d.ts +0 -19
  327. package/dist/ops/webgpu/pack16_program.js +0 -92
  328. package/dist/ops/webgpu/qkv.d.ts +0 -1
  329. package/dist/ops/webgpu/qkv.js +0 -24
  330. package/dist/ops/webgpu/rope.d.ts +0 -1
  331. package/dist/ops/webgpu/rope.js +0 -135
  332. package/dist/ops/webgpu/scatterSub.d.ts +0 -1
  333. package/dist/ops/webgpu/scatterSub.js +0 -40
  334. package/dist/ops/webgpu/slice16.d.ts +0 -7
  335. package/dist/ops/webgpu/slice16.js +0 -69
  336. package/dist/ops/webgpu/softmax16.d.ts +0 -17
  337. package/dist/ops/webgpu/softmax16.js +0 -21
  338. package/dist/ops/webgpu/softmax16_program.d.ts +0 -13
  339. package/dist/ops/webgpu/softmax16_program.js +0 -73
  340. package/dist/ops/webgpu/softmax16_subgroup_program.d.ts +0 -17
  341. package/dist/ops/webgpu/softmax16_subgroup_program.js +0 -75
  342. package/dist/ops/webgpu/softmax16grad.d.ts +0 -1
  343. package/dist/ops/webgpu/softmax16grad.js +0 -37
  344. package/dist/ops/webgpu/sub16.d.ts +0 -1
  345. package/dist/ops/webgpu/sub16.js +0 -13
  346. package/dist/ops/webgpu/sum16.d.ts +0 -1
  347. package/dist/ops/webgpu/sum16.js +0 -38
  348. package/dist/ops/webgpu/transpose16.d.ts +0 -1
  349. package/dist/ops/webgpu/transpose16.js +0 -34
  350. package/dist/ops/webgpu/transpose16_program.d.ts +0 -16
  351. package/dist/ops/webgpu/transpose16_program.js +0 -50
  352. package/dist/ops/webgpu/transpose16_shared_program.d.ts +0 -15
  353. package/dist/ops/webgpu/transpose16_shared_program.js +0 -70
  354. package/dist/ops/webgpu/unpack16.d.ts +0 -1
  355. package/dist/ops/webgpu/unpack16.js +0 -48
  356. package/dist/ops/webgpu/utils/binary_op.d.ts +0 -35
  357. package/dist/ops/webgpu/utils/binary_op.js +0 -139
  358. package/dist/ops/webgpu/utils/deviceInfo.d.ts +0 -7
  359. package/dist/ops/webgpu/utils/deviceInfo.js +0 -11
  360. package/dist/ops/webgpu/utils/reductions.d.ts +0 -43
  361. package/dist/ops/webgpu/utils/reductions.js +0 -275
  362. package/dist/ops-CsXeTq1P.js +0 -476
  363. package/dist/pack16-bqltoUlR.js +0 -39
  364. package/dist/papaparse.min-C0cScC2i.js +0 -418
  365. package/dist/parquet-Bqjmp2vo.js +0 -44231
  366. package/dist/patches/webgpu_backend.d.ts +0 -18
  367. package/dist/patches/webgpu_backend.js +0 -56
  368. package/dist/patches/webgpu_base.d.ts +0 -21
  369. package/dist/patches/webgpu_base.js +0 -34
  370. package/dist/patches/webgpu_program.d.ts +0 -36
  371. package/dist/patches/webgpu_program.js +0 -400
  372. package/dist/pdf-NIhmP3sq.js +0 -19477
  373. package/dist/rand_util-CZ7yLoUm.js +0 -50
  374. package/dist/random_normal-IBRrha8a.js +0 -14
  375. package/dist/random_width-DN5ZtQkM.js +0 -9796
  376. package/dist/range-C-CjF-LI.js +0 -10
  377. package/dist/relu-J_X6MUzx.js +0 -9
  378. package/dist/reshape-BDOuCSNW.js +0 -9
  379. package/dist/resize_nearest_neighbor-BojqlfRe.js +0 -150
  380. package/dist/rope-DcrZM_e6.js +0 -24
  381. package/dist/scatter_nd_util-ByNJaL6I.js +0 -46
  382. package/dist/segment_util-Dasb2Zaf.js +0 -43
  383. package/dist/selu_util-BLhIqRkw.js +0 -44
  384. package/dist/shared-3agzAqQ_.js +0 -53
  385. package/dist/shared-CagdqkLh.js +0 -2143
  386. package/dist/slice-BzS11Qh0.js +0 -12
  387. package/dist/slice_util-CC35pLmT.js +0 -153
  388. package/dist/softmax-D4q1LJN7.js +0 -12
  389. package/dist/split-C2Sj255c.js +0 -9
  390. package/dist/squeeze-ho4wLUek.js +0 -10
  391. package/dist/stack-DudVrtmG.js +0 -11
  392. package/dist/step-BTxPtq1r.js +0 -261
  393. package/dist/sum-BpiwSWvg.js +0 -11
  394. package/dist/tensor-BWFldCso.js +0 -8
  395. package/dist/tensor1d-LMGMIUlr.js +0 -11
  396. package/dist/tensor2d-BnXMKScO.js +0 -14
  397. package/dist/tensor4d-C6UCG_u8.js +0 -14
  398. package/dist/tfjs_backend-BGnG-ppu.js +0 -654
  399. package/dist/tile-CFy-xTO6.js +0 -11
  400. package/dist/tokeniser/BaseTokeniser.d.ts +0 -33
  401. package/dist/tokeniser/BaseTokeniser.js +0 -124
  402. package/dist/tokeniser/CharTokeniser.d.ts +0 -24
  403. package/dist/tokeniser/CharTokeniser.js +0 -107
  404. package/dist/tokeniser/bpe.d.ts +0 -28
  405. package/dist/tokeniser/bpe.js +0 -173
  406. package/dist/tokeniser/messages.d.ts +0 -61
  407. package/dist/tokeniser/messages.js +0 -1
  408. package/dist/tokeniser/type.d.ts +0 -34
  409. package/dist/tokeniser/type.js +0 -1
  410. package/dist/training/AdamW.d.ts +0 -36
  411. package/dist/training/AdamW.js +0 -138
  412. package/dist/training/BasicTrainer.d.ts +0 -63
  413. package/dist/training/BasicTrainer.js +0 -265
  414. package/dist/training/DatasetBuilder.d.ts +0 -26
  415. package/dist/training/DatasetBuilder.js +0 -86
  416. package/dist/training/Evaluator.d.ts +0 -19
  417. package/dist/training/Evaluator.js +0 -39
  418. package/dist/training/LRScheduler.d.ts +0 -12
  419. package/dist/training/LRScheduler.js +0 -34
  420. package/dist/training/PreTrainer.d.ts +0 -11
  421. package/dist/training/PreTrainer.js +0 -20
  422. package/dist/training/SFTTrainer.d.ts +0 -12
  423. package/dist/training/SFTTrainer.js +0 -22
  424. package/dist/training/loss.d.ts +0 -3
  425. package/dist/training/loss.js +0 -24
  426. package/dist/training/orthoGrad.d.ts +0 -2
  427. package/dist/training/orthoGrad.js +0 -10
  428. package/dist/training/sparseCrossEntropy.d.ts +0 -7
  429. package/dist/training/sparseCrossEntropy.js +0 -69
  430. package/dist/training/tasks/ConversationTask.d.ts +0 -18
  431. package/dist/training/tasks/ConversationTask.js +0 -40
  432. package/dist/training/tasks/PretrainingTask.d.ts +0 -17
  433. package/dist/training/tasks/PretrainingTask.js +0 -47
  434. package/dist/training/tasks/StartSentenceTask.d.ts +0 -18
  435. package/dist/training/tasks/StartSentenceTask.js +0 -49
  436. package/dist/training/tasks/Task.d.ts +0 -22
  437. package/dist/training/tasks/Task.js +0 -68
  438. package/dist/training/tasks/splitter.d.ts +0 -5
  439. package/dist/training/tasks/splitter.js +0 -21
  440. package/dist/training/types.d.ts +0 -78
  441. package/dist/training/types.js +0 -1
  442. package/dist/training/validation.d.ts +0 -17
  443. package/dist/training/validation.js +0 -84
  444. package/dist/transpose-9kRxIXWR.js +0 -36
  445. package/dist/unsorted_segment_sum-DJvk5xnh.js +0 -277
  446. package/dist/utilities/arrayClose.d.ts +0 -1
  447. package/dist/utilities/arrayClose.js +0 -20
  448. package/dist/utilities/datasetID.d.ts +0 -2
  449. package/dist/utilities/datasetID.js +0 -21
  450. package/dist/utilities/dummy.d.ts +0 -9
  451. package/dist/utilities/dummy.js +0 -43
  452. package/dist/utilities/multinomialCPU.d.ts +0 -2
  453. package/dist/utilities/multinomialCPU.js +0 -13
  454. package/dist/utilities/naming.d.ts +0 -4
  455. package/dist/utilities/naming.js +0 -1
  456. package/dist/utilities/packed.d.ts +0 -4
  457. package/dist/utilities/packed.js +0 -15
  458. package/dist/utilities/parameters.d.ts +0 -11
  459. package/dist/utilities/parameters.js +0 -57
  460. package/dist/utilities/performance.d.ts +0 -2
  461. package/dist/utilities/performance.js +0 -16
  462. package/dist/utilities/profile.d.ts +0 -17
  463. package/dist/utilities/profile.js +0 -38
  464. package/dist/utilities/safetensors.d.ts +0 -3
  465. package/dist/utilities/safetensors.js +0 -83
  466. package/dist/utilities/sentences.d.ts +0 -5
  467. package/dist/utilities/sentences.js +0 -41
  468. package/dist/utilities/tokenParse.d.ts +0 -1
  469. package/dist/utilities/tokenParse.js +0 -21
  470. package/dist/utilities/topP.d.ts +0 -1
  471. package/dist/utilities/topP.js +0 -13
  472. package/dist/utilities/waitForModel.d.ts +0 -2
  473. package/dist/utilities/waitForModel.js +0 -12
  474. package/dist/utilities/weights.d.ts +0 -12
  475. package/dist/utilities/weights.js +0 -45
  476. package/dist/utilities/yielder.d.ts +0 -1
  477. package/dist/utilities/yielder.js +0 -7
  478. package/dist/variable-Ck482e3n.js +0 -7
  479. package/dist/webgpu_program-B4HmApL1.js +0 -525
  480. package/dist/webgpu_util-DYlGSwOJ.js +0 -64
  481. package/dist/zeros-DvZpK8s6.js +0 -13
  482. package/dist/zeros_like-CWjDdwr-.js +0 -721
@@ -1,1016 +0,0 @@
1
- var fr = {}, O = {};
2
- O.byteLength = Mr;
3
- O.toByteArray = Dr;
4
- O.fromByteArray = Or;
5
- var _ = [], T = [], Nr = typeof Uint8Array < "u" ? Uint8Array : Array, X = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
- for (var D = 0, br = X.length; D < br; ++D)
7
- _[D] = X[D], T[X.charCodeAt(D)] = D;
8
- T[45] = 62;
9
- T[95] = 63;
10
- function cr(p) {
11
- var c = p.length;
12
- if (c % 4 > 0)
13
- throw new Error("Invalid string. Length must be a multiple of 4");
14
- var a = p.indexOf("=");
15
- a === -1 && (a = c);
16
- var x = a === c ? 0 : 4 - a % 4;
17
- return [a, x];
18
- }
19
- function Mr(p) {
20
- var c = cr(p), a = c[0], x = c[1];
21
- return (a + x) * 3 / 4 - x;
22
- }
23
- function kr(p, c, a) {
24
- return (c + a) * 3 / 4 - a;
25
- }
26
- function Dr(p) {
27
- var c, a = cr(p), x = a[0], w = a[1], f = new Nr(kr(p, x, w)), l = 0, m = w > 0 ? x - 4 : x, B;
28
- for (B = 0; B < m; B += 4)
29
- c = T[p.charCodeAt(B)] << 18 | T[p.charCodeAt(B + 1)] << 12 | T[p.charCodeAt(B + 2)] << 6 | T[p.charCodeAt(B + 3)], f[l++] = c >> 16 & 255, f[l++] = c >> 8 & 255, f[l++] = c & 255;
30
- return w === 2 && (c = T[p.charCodeAt(B)] << 2 | T[p.charCodeAt(B + 1)] >> 4, f[l++] = c & 255), w === 1 && (c = T[p.charCodeAt(B)] << 10 | T[p.charCodeAt(B + 1)] << 4 | T[p.charCodeAt(B + 2)] >> 2, f[l++] = c >> 8 & 255, f[l++] = c & 255), f;
31
- }
32
- function Pr(p) {
33
- return _[p >> 18 & 63] + _[p >> 12 & 63] + _[p >> 6 & 63] + _[p & 63];
34
- }
35
- function $r(p, c, a) {
36
- for (var x, w = [], f = c; f < a; f += 3)
37
- x = (p[f] << 16 & 16711680) + (p[f + 1] << 8 & 65280) + (p[f + 2] & 255), w.push(Pr(x));
38
- return w.join("");
39
- }
40
- function Or(p) {
41
- for (var c, a = p.length, x = a % 3, w = [], f = 16383, l = 0, m = a - x; l < m; l += f)
42
- w.push($r(p, l, l + f > m ? m : l + f));
43
- return x === 1 ? (c = p[a - 1], w.push(
44
- _[c >> 2] + _[c << 4 & 63] + "=="
45
- )) : x === 2 && (c = (p[a - 2] << 8) + p[a - 1], w.push(
46
- _[c >> 10] + _[c >> 4 & 63] + _[c << 2 & 63] + "="
47
- )), w.join("");
48
- }
49
- var J = {};
50
- J.read = function(p, c, a, x, w) {
51
- var f, l, m = w * 8 - x - 1, B = (1 << m) - 1, F = B >> 1, o = -7, A = a ? w - 1 : 0, S = a ? -1 : 1, R = p[c + A];
52
- for (A += S, f = R & (1 << -o) - 1, R >>= -o, o += m; o > 0; f = f * 256 + p[c + A], A += S, o -= 8)
53
- ;
54
- for (l = f & (1 << -o) - 1, f >>= -o, o += x; o > 0; l = l * 256 + p[c + A], A += S, o -= 8)
55
- ;
56
- if (f === 0)
57
- f = 1 - F;
58
- else {
59
- if (f === B)
60
- return l ? NaN : (R ? -1 : 1) * (1 / 0);
61
- l = l + Math.pow(2, x), f = f - F;
62
- }
63
- return (R ? -1 : 1) * l * Math.pow(2, f - x);
64
- };
65
- J.write = function(p, c, a, x, w, f) {
66
- var l, m, B, F = f * 8 - w - 1, o = (1 << F) - 1, A = o >> 1, S = w === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, R = x ? 0 : f - 1, N = x ? 1 : -1, G = c < 0 || c === 0 && 1 / c < 0 ? 1 : 0;
67
- for (c = Math.abs(c), isNaN(c) || c === 1 / 0 ? (m = isNaN(c) ? 1 : 0, l = o) : (l = Math.floor(Math.log(c) / Math.LN2), c * (B = Math.pow(2, -l)) < 1 && (l--, B *= 2), l + A >= 1 ? c += S / B : c += S * Math.pow(2, 1 - A), c * B >= 2 && (l++, B /= 2), l + A >= o ? (m = 0, l = o) : l + A >= 1 ? (m = (c * B - 1) * Math.pow(2, w), l = l + A) : (m = c * Math.pow(2, A - 1) * Math.pow(2, w), l = 0)); w >= 8; p[a + R] = m & 255, R += N, m /= 256, w -= 8)
68
- ;
69
- for (l = l << w | m, F += w; F > 0; p[a + R] = l & 255, R += N, l /= 256, F -= 8)
70
- ;
71
- p[a + R - N] |= G * 128;
72
- };
73
- (function(p) {
74
- const c = O, a = J, x = typeof Symbol == "function" && typeof Symbol.for == "function" ? /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom") : null;
75
- p.Buffer = o, p.SlowBuffer = sr, p.INSPECT_MAX_BYTES = 50;
76
- const w = 2147483647;
77
- p.kMaxLength = w;
78
- const { Uint8Array: f, ArrayBuffer: l, SharedArrayBuffer: m } = globalThis;
79
- o.TYPED_ARRAY_SUPPORT = B(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
80
- "This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
81
- );
82
- function B() {
83
- try {
84
- const i = new f(1), r = { foo: function() {
85
- return 42;
86
- } };
87
- return Object.setPrototypeOf(r, f.prototype), Object.setPrototypeOf(i, r), i.foo() === 42;
88
- } catch {
89
- return !1;
90
- }
91
- }
92
- Object.defineProperty(o.prototype, "parent", {
93
- enumerable: !0,
94
- get: function() {
95
- if (o.isBuffer(this))
96
- return this.buffer;
97
- }
98
- }), Object.defineProperty(o.prototype, "offset", {
99
- enumerable: !0,
100
- get: function() {
101
- if (o.isBuffer(this))
102
- return this.byteOffset;
103
- }
104
- });
105
- function F(i) {
106
- if (i > w)
107
- throw new RangeError('The value "' + i + '" is invalid for option "size"');
108
- const r = new f(i);
109
- return Object.setPrototypeOf(r, o.prototype), r;
110
- }
111
- function o(i, r, t) {
112
- if (typeof i == "number") {
113
- if (typeof r == "string")
114
- throw new TypeError(
115
- 'The "string" argument must be of type string. Received type number'
116
- );
117
- return N(i);
118
- }
119
- return A(i, r, t);
120
- }
121
- o.poolSize = 8192;
122
- function A(i, r, t) {
123
- if (typeof i == "string")
124
- return G(i, r);
125
- if (l.isView(i))
126
- return pr(i);
127
- if (i == null)
128
- throw new TypeError(
129
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
130
- );
131
- if (C(i, l) || i && C(i.buffer, l) || typeof m < "u" && (C(i, m) || i && C(i.buffer, m)))
132
- return W(i, r, t);
133
- if (typeof i == "number")
134
- throw new TypeError(
135
- 'The "value" argument must not be of type number. Received type number'
136
- );
137
- const n = i.valueOf && i.valueOf();
138
- if (n != null && n !== i)
139
- return o.from(n, r, t);
140
- const e = lr(i);
141
- if (e) return e;
142
- if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
143
- return o.from(i[Symbol.toPrimitive]("string"), r, t);
144
- throw new TypeError(
145
- "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
146
- );
147
- }
148
- o.from = function(i, r, t) {
149
- return A(i, r, t);
150
- }, Object.setPrototypeOf(o.prototype, f.prototype), Object.setPrototypeOf(o, f);
151
- function S(i) {
152
- if (typeof i != "number")
153
- throw new TypeError('"size" argument must be of type number');
154
- if (i < 0)
155
- throw new RangeError('The value "' + i + '" is invalid for option "size"');
156
- }
157
- function R(i, r, t) {
158
- return S(i), i <= 0 ? F(i) : r !== void 0 ? typeof t == "string" ? F(i).fill(r, t) : F(i).fill(r) : F(i);
159
- }
160
- o.alloc = function(i, r, t) {
161
- return R(i, r, t);
162
- };
163
- function N(i) {
164
- return S(i), F(i < 0 ? 0 : j(i) | 0);
165
- }
166
- o.allocUnsafe = function(i) {
167
- return N(i);
168
- }, o.allocUnsafeSlow = function(i) {
169
- return N(i);
170
- };
171
- function G(i, r) {
172
- if ((typeof r != "string" || r === "") && (r = "utf8"), !o.isEncoding(r))
173
- throw new TypeError("Unknown encoding: " + r);
174
- const t = z(i, r) | 0;
175
- let n = F(t);
176
- const e = n.write(i, r);
177
- return e !== t && (n = n.slice(0, e)), n;
178
- }
179
- function Y(i) {
180
- const r = i.length < 0 ? 0 : j(i.length) | 0, t = F(r);
181
- for (let n = 0; n < r; n += 1)
182
- t[n] = i[n] & 255;
183
- return t;
184
- }
185
- function pr(i) {
186
- if (C(i, f)) {
187
- const r = new f(i);
188
- return W(r.buffer, r.byteOffset, r.byteLength);
189
- }
190
- return Y(i);
191
- }
192
- function W(i, r, t) {
193
- if (r < 0 || i.byteLength < r)
194
- throw new RangeError('"offset" is outside of buffer bounds');
195
- if (i.byteLength < r + (t || 0))
196
- throw new RangeError('"length" is outside of buffer bounds');
197
- let n;
198
- return r === void 0 && t === void 0 ? n = new f(i) : t === void 0 ? n = new f(i, r) : n = new f(i, r, t), Object.setPrototypeOf(n, o.prototype), n;
199
- }
200
- function lr(i) {
201
- if (o.isBuffer(i)) {
202
- const r = j(i.length) | 0, t = F(r);
203
- return t.length === 0 || i.copy(t, 0, 0, r), t;
204
- }
205
- if (i.length !== void 0)
206
- return typeof i.length != "number" || V(i.length) ? F(0) : Y(i);
207
- if (i.type === "Buffer" && Array.isArray(i.data))
208
- return Y(i.data);
209
- }
210
- function j(i) {
211
- if (i >= w)
212
- throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + w.toString(16) + " bytes");
213
- return i | 0;
214
- }
215
- function sr(i) {
216
- return +i != i && (i = 0), o.alloc(+i);
217
- }
218
- o.isBuffer = function(r) {
219
- return r != null && r._isBuffer === !0 && r !== o.prototype;
220
- }, o.compare = function(r, t) {
221
- if (C(r, f) && (r = o.from(r, r.offset, r.byteLength)), C(t, f) && (t = o.from(t, t.offset, t.byteLength)), !o.isBuffer(r) || !o.isBuffer(t))
222
- throw new TypeError(
223
- 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
224
- );
225
- if (r === t) return 0;
226
- let n = r.length, e = t.length;
227
- for (let u = 0, h = Math.min(n, e); u < h; ++u)
228
- if (r[u] !== t[u]) {
229
- n = r[u], e = t[u];
230
- break;
231
- }
232
- return n < e ? -1 : e < n ? 1 : 0;
233
- }, o.isEncoding = function(r) {
234
- switch (String(r).toLowerCase()) {
235
- case "hex":
236
- case "utf8":
237
- case "utf-8":
238
- case "ascii":
239
- case "latin1":
240
- case "binary":
241
- case "base64":
242
- case "ucs2":
243
- case "ucs-2":
244
- case "utf16le":
245
- case "utf-16le":
246
- return !0;
247
- default:
248
- return !1;
249
- }
250
- }, o.concat = function(r, t) {
251
- if (!Array.isArray(r))
252
- throw new TypeError('"list" argument must be an Array of Buffers');
253
- if (r.length === 0)
254
- return o.alloc(0);
255
- let n;
256
- if (t === void 0)
257
- for (t = 0, n = 0; n < r.length; ++n)
258
- t += r[n].length;
259
- const e = o.allocUnsafe(t);
260
- let u = 0;
261
- for (n = 0; n < r.length; ++n) {
262
- let h = r[n];
263
- if (C(h, f))
264
- u + h.length > e.length ? (o.isBuffer(h) || (h = o.from(h)), h.copy(e, u)) : f.prototype.set.call(
265
- e,
266
- h,
267
- u
268
- );
269
- else if (o.isBuffer(h))
270
- h.copy(e, u);
271
- else
272
- throw new TypeError('"list" argument must be an Array of Buffers');
273
- u += h.length;
274
- }
275
- return e;
276
- };
277
- function z(i, r) {
278
- if (o.isBuffer(i))
279
- return i.length;
280
- if (l.isView(i) || C(i, l))
281
- return i.byteLength;
282
- if (typeof i != "string")
283
- throw new TypeError(
284
- 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
285
- );
286
- const t = i.length, n = arguments.length > 2 && arguments[2] === !0;
287
- if (!n && t === 0) return 0;
288
- let e = !1;
289
- for (; ; )
290
- switch (r) {
291
- case "ascii":
292
- case "latin1":
293
- case "binary":
294
- return t;
295
- case "utf8":
296
- case "utf-8":
297
- return H(i).length;
298
- case "ucs2":
299
- case "ucs-2":
300
- case "utf16le":
301
- case "utf-16le":
302
- return t * 2;
303
- case "hex":
304
- return t >>> 1;
305
- case "base64":
306
- return hr(i).length;
307
- default:
308
- if (e)
309
- return n ? -1 : H(i).length;
310
- r = ("" + r).toLowerCase(), e = !0;
311
- }
312
- }
313
- o.byteLength = z;
314
- function ar(i, r, t) {
315
- let n = !1;
316
- if ((r === void 0 || r < 0) && (r = 0), r > this.length || ((t === void 0 || t > this.length) && (t = this.length), t <= 0) || (t >>>= 0, r >>>= 0, t <= r))
317
- return "";
318
- for (i || (i = "utf8"); ; )
319
- switch (i) {
320
- case "hex":
321
- return Fr(this, r, t);
322
- case "utf8":
323
- case "utf-8":
324
- return Q(this, r, t);
325
- case "ascii":
326
- return mr(this, r, t);
327
- case "latin1":
328
- case "binary":
329
- return Ir(this, r, t);
330
- case "base64":
331
- return dr(this, r, t);
332
- case "ucs2":
333
- case "ucs-2":
334
- case "utf16le":
335
- case "utf-16le":
336
- return Ar(this, r, t);
337
- default:
338
- if (n) throw new TypeError("Unknown encoding: " + i);
339
- i = (i + "").toLowerCase(), n = !0;
340
- }
341
- }
342
- o.prototype._isBuffer = !0;
343
- function b(i, r, t) {
344
- const n = i[r];
345
- i[r] = i[t], i[t] = n;
346
- }
347
- o.prototype.swap16 = function() {
348
- const r = this.length;
349
- if (r % 2 !== 0)
350
- throw new RangeError("Buffer size must be a multiple of 16-bits");
351
- for (let t = 0; t < r; t += 2)
352
- b(this, t, t + 1);
353
- return this;
354
- }, o.prototype.swap32 = function() {
355
- const r = this.length;
356
- if (r % 4 !== 0)
357
- throw new RangeError("Buffer size must be a multiple of 32-bits");
358
- for (let t = 0; t < r; t += 4)
359
- b(this, t, t + 3), b(this, t + 1, t + 2);
360
- return this;
361
- }, o.prototype.swap64 = function() {
362
- const r = this.length;
363
- if (r % 8 !== 0)
364
- throw new RangeError("Buffer size must be a multiple of 64-bits");
365
- for (let t = 0; t < r; t += 8)
366
- b(this, t, t + 7), b(this, t + 1, t + 6), b(this, t + 2, t + 5), b(this, t + 3, t + 4);
367
- return this;
368
- }, o.prototype.toString = function() {
369
- const r = this.length;
370
- return r === 0 ? "" : arguments.length === 0 ? Q(this, 0, r) : ar.apply(this, arguments);
371
- }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(r) {
372
- if (!o.isBuffer(r)) throw new TypeError("Argument must be a Buffer");
373
- return this === r ? !0 : o.compare(this, r) === 0;
374
- }, o.prototype.inspect = function() {
375
- let r = "";
376
- const t = p.INSPECT_MAX_BYTES;
377
- return r = this.toString("hex", 0, t).replace(/(.{2})/g, "$1 ").trim(), this.length > t && (r += " ... "), "<Buffer " + r + ">";
378
- }, x && (o.prototype[x] = o.prototype.inspect), o.prototype.compare = function(r, t, n, e, u) {
379
- if (C(r, f) && (r = o.from(r, r.offset, r.byteLength)), !o.isBuffer(r))
380
- throw new TypeError(
381
- 'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof r
382
- );
383
- if (t === void 0 && (t = 0), n === void 0 && (n = r ? r.length : 0), e === void 0 && (e = 0), u === void 0 && (u = this.length), t < 0 || n > r.length || e < 0 || u > this.length)
384
- throw new RangeError("out of range index");
385
- if (e >= u && t >= n)
386
- return 0;
387
- if (e >= u)
388
- return -1;
389
- if (t >= n)
390
- return 1;
391
- if (t >>>= 0, n >>>= 0, e >>>= 0, u >>>= 0, this === r) return 0;
392
- let h = u - e, s = n - t;
393
- const d = Math.min(h, s), E = this.slice(e, u), g = r.slice(t, n);
394
- for (let y = 0; y < d; ++y)
395
- if (E[y] !== g[y]) {
396
- h = E[y], s = g[y];
397
- break;
398
- }
399
- return h < s ? -1 : s < h ? 1 : 0;
400
- };
401
- function K(i, r, t, n, e) {
402
- if (i.length === 0) return -1;
403
- if (typeof t == "string" ? (n = t, t = 0) : t > 2147483647 ? t = 2147483647 : t < -2147483648 && (t = -2147483648), t = +t, V(t) && (t = e ? 0 : i.length - 1), t < 0 && (t = i.length + t), t >= i.length) {
404
- if (e) return -1;
405
- t = i.length - 1;
406
- } else if (t < 0)
407
- if (e) t = 0;
408
- else return -1;
409
- if (typeof r == "string" && (r = o.from(r, n)), o.isBuffer(r))
410
- return r.length === 0 ? -1 : Z(i, r, t, n, e);
411
- if (typeof r == "number")
412
- return r = r & 255, typeof f.prototype.indexOf == "function" ? e ? f.prototype.indexOf.call(i, r, t) : f.prototype.lastIndexOf.call(i, r, t) : Z(i, [r], t, n, e);
413
- throw new TypeError("val must be string, number or Buffer");
414
- }
415
- function Z(i, r, t, n, e) {
416
- let u = 1, h = i.length, s = r.length;
417
- if (n !== void 0 && (n = String(n).toLowerCase(), n === "ucs2" || n === "ucs-2" || n === "utf16le" || n === "utf-16le")) {
418
- if (i.length < 2 || r.length < 2)
419
- return -1;
420
- u = 2, h /= 2, s /= 2, t /= 2;
421
- }
422
- function d(g, y) {
423
- return u === 1 ? g[y] : g.readUInt16BE(y * u);
424
- }
425
- let E;
426
- if (e) {
427
- let g = -1;
428
- for (E = t; E < h; E++)
429
- if (d(i, E) === d(r, g === -1 ? 0 : E - g)) {
430
- if (g === -1 && (g = E), E - g + 1 === s) return g * u;
431
- } else
432
- g !== -1 && (E -= E - g), g = -1;
433
- } else
434
- for (t + s > h && (t = h - s), E = t; E >= 0; E--) {
435
- let g = !0;
436
- for (let y = 0; y < s; y++)
437
- if (d(i, E + y) !== d(r, y)) {
438
- g = !1;
439
- break;
440
- }
441
- if (g) return E;
442
- }
443
- return -1;
444
- }
445
- o.prototype.includes = function(r, t, n) {
446
- return this.indexOf(r, t, n) !== -1;
447
- }, o.prototype.indexOf = function(r, t, n) {
448
- return K(this, r, t, n, !0);
449
- }, o.prototype.lastIndexOf = function(r, t, n) {
450
- return K(this, r, t, n, !1);
451
- };
452
- function wr(i, r, t, n) {
453
- t = Number(t) || 0;
454
- const e = i.length - t;
455
- n ? (n = Number(n), n > e && (n = e)) : n = e;
456
- const u = r.length;
457
- n > u / 2 && (n = u / 2);
458
- let h;
459
- for (h = 0; h < n; ++h) {
460
- const s = parseInt(r.substr(h * 2, 2), 16);
461
- if (V(s)) return h;
462
- i[t + h] = s;
463
- }
464
- return h;
465
- }
466
- function yr(i, r, t, n) {
467
- return $(H(r, i.length - t), i, t, n);
468
- }
469
- function xr(i, r, t, n) {
470
- return $(Cr(r), i, t, n);
471
- }
472
- function Br(i, r, t, n) {
473
- return $(hr(r), i, t, n);
474
- }
475
- function Er(i, r, t, n) {
476
- return $(_r(r, i.length - t), i, t, n);
477
- }
478
- o.prototype.write = function(r, t, n, e) {
479
- if (t === void 0)
480
- e = "utf8", n = this.length, t = 0;
481
- else if (n === void 0 && typeof t == "string")
482
- e = t, n = this.length, t = 0;
483
- else if (isFinite(t))
484
- t = t >>> 0, isFinite(n) ? (n = n >>> 0, e === void 0 && (e = "utf8")) : (e = n, n = void 0);
485
- else
486
- throw new Error(
487
- "Buffer.write(string, encoding, offset[, length]) is no longer supported"
488
- );
489
- const u = this.length - t;
490
- if ((n === void 0 || n > u) && (n = u), r.length > 0 && (n < 0 || t < 0) || t > this.length)
491
- throw new RangeError("Attempt to write outside buffer bounds");
492
- e || (e = "utf8");
493
- let h = !1;
494
- for (; ; )
495
- switch (e) {
496
- case "hex":
497
- return wr(this, r, t, n);
498
- case "utf8":
499
- case "utf-8":
500
- return yr(this, r, t, n);
501
- case "ascii":
502
- case "latin1":
503
- case "binary":
504
- return xr(this, r, t, n);
505
- case "base64":
506
- return Br(this, r, t, n);
507
- case "ucs2":
508
- case "ucs-2":
509
- case "utf16le":
510
- case "utf-16le":
511
- return Er(this, r, t, n);
512
- default:
513
- if (h) throw new TypeError("Unknown encoding: " + e);
514
- e = ("" + e).toLowerCase(), h = !0;
515
- }
516
- }, o.prototype.toJSON = function() {
517
- return {
518
- type: "Buffer",
519
- data: Array.prototype.slice.call(this._arr || this, 0)
520
- };
521
- };
522
- function dr(i, r, t) {
523
- return r === 0 && t === i.length ? c.fromByteArray(i) : c.fromByteArray(i.slice(r, t));
524
- }
525
- function Q(i, r, t) {
526
- t = Math.min(i.length, t);
527
- const n = [];
528
- let e = r;
529
- for (; e < t; ) {
530
- const u = i[e];
531
- let h = null, s = u > 239 ? 4 : u > 223 ? 3 : u > 191 ? 2 : 1;
532
- if (e + s <= t) {
533
- let d, E, g, y;
534
- switch (s) {
535
- case 1:
536
- u < 128 && (h = u);
537
- break;
538
- case 2:
539
- d = i[e + 1], (d & 192) === 128 && (y = (u & 31) << 6 | d & 63, y > 127 && (h = y));
540
- break;
541
- case 3:
542
- d = i[e + 1], E = i[e + 2], (d & 192) === 128 && (E & 192) === 128 && (y = (u & 15) << 12 | (d & 63) << 6 | E & 63, y > 2047 && (y < 55296 || y > 57343) && (h = y));
543
- break;
544
- case 4:
545
- d = i[e + 1], E = i[e + 2], g = i[e + 3], (d & 192) === 128 && (E & 192) === 128 && (g & 192) === 128 && (y = (u & 15) << 18 | (d & 63) << 12 | (E & 63) << 6 | g & 63, y > 65535 && y < 1114112 && (h = y));
546
- }
547
- }
548
- h === null ? (h = 65533, s = 1) : h > 65535 && (h -= 65536, n.push(h >>> 10 & 1023 | 55296), h = 56320 | h & 1023), n.push(h), e += s;
549
- }
550
- return gr(n);
551
- }
552
- const v = 4096;
553
- function gr(i) {
554
- const r = i.length;
555
- if (r <= v)
556
- return String.fromCharCode.apply(String, i);
557
- let t = "", n = 0;
558
- for (; n < r; )
559
- t += String.fromCharCode.apply(
560
- String,
561
- i.slice(n, n += v)
562
- );
563
- return t;
564
- }
565
- function mr(i, r, t) {
566
- let n = "";
567
- t = Math.min(i.length, t);
568
- for (let e = r; e < t; ++e)
569
- n += String.fromCharCode(i[e] & 127);
570
- return n;
571
- }
572
- function Ir(i, r, t) {
573
- let n = "";
574
- t = Math.min(i.length, t);
575
- for (let e = r; e < t; ++e)
576
- n += String.fromCharCode(i[e]);
577
- return n;
578
- }
579
- function Fr(i, r, t) {
580
- const n = i.length;
581
- (!r || r < 0) && (r = 0), (!t || t < 0 || t > n) && (t = n);
582
- let e = "";
583
- for (let u = r; u < t; ++u)
584
- e += Sr[i[u]];
585
- return e;
586
- }
587
- function Ar(i, r, t) {
588
- const n = i.slice(r, t);
589
- let e = "";
590
- for (let u = 0; u < n.length - 1; u += 2)
591
- e += String.fromCharCode(n[u] + n[u + 1] * 256);
592
- return e;
593
- }
594
- o.prototype.slice = function(r, t) {
595
- const n = this.length;
596
- r = ~~r, t = t === void 0 ? n : ~~t, r < 0 ? (r += n, r < 0 && (r = 0)) : r > n && (r = n), t < 0 ? (t += n, t < 0 && (t = 0)) : t > n && (t = n), t < r && (t = r);
597
- const e = this.subarray(r, t);
598
- return Object.setPrototypeOf(e, o.prototype), e;
599
- };
600
- function I(i, r, t) {
601
- if (i % 1 !== 0 || i < 0) throw new RangeError("offset is not uint");
602
- if (i + r > t) throw new RangeError("Trying to access beyond buffer length");
603
- }
604
- o.prototype.readUintLE = o.prototype.readUIntLE = function(r, t, n) {
605
- r = r >>> 0, t = t >>> 0, n || I(r, t, this.length);
606
- let e = this[r], u = 1, h = 0;
607
- for (; ++h < t && (u *= 256); )
608
- e += this[r + h] * u;
609
- return e;
610
- }, o.prototype.readUintBE = o.prototype.readUIntBE = function(r, t, n) {
611
- r = r >>> 0, t = t >>> 0, n || I(r, t, this.length);
612
- let e = this[r + --t], u = 1;
613
- for (; t > 0 && (u *= 256); )
614
- e += this[r + --t] * u;
615
- return e;
616
- }, o.prototype.readUint8 = o.prototype.readUInt8 = function(r, t) {
617
- return r = r >>> 0, t || I(r, 1, this.length), this[r];
618
- }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(r, t) {
619
- return r = r >>> 0, t || I(r, 2, this.length), this[r] | this[r + 1] << 8;
620
- }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(r, t) {
621
- return r = r >>> 0, t || I(r, 2, this.length), this[r] << 8 | this[r + 1];
622
- }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(r, t) {
623
- return r = r >>> 0, t || I(r, 4, this.length), (this[r] | this[r + 1] << 8 | this[r + 2] << 16) + this[r + 3] * 16777216;
624
- }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(r, t) {
625
- return r = r >>> 0, t || I(r, 4, this.length), this[r] * 16777216 + (this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3]);
626
- }, o.prototype.readBigUInt64LE = L(function(r) {
627
- r = r >>> 0, k(r, "offset");
628
- const t = this[r], n = this[r + 7];
629
- (t === void 0 || n === void 0) && P(r, this.length - 8);
630
- const e = t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24, u = this[++r] + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + n * 2 ** 24;
631
- return BigInt(e) + (BigInt(u) << BigInt(32));
632
- }), o.prototype.readBigUInt64BE = L(function(r) {
633
- r = r >>> 0, k(r, "offset");
634
- const t = this[r], n = this[r + 7];
635
- (t === void 0 || n === void 0) && P(r, this.length - 8);
636
- const e = t * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r], u = this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + n;
637
- return (BigInt(e) << BigInt(32)) + BigInt(u);
638
- }), o.prototype.readIntLE = function(r, t, n) {
639
- r = r >>> 0, t = t >>> 0, n || I(r, t, this.length);
640
- let e = this[r], u = 1, h = 0;
641
- for (; ++h < t && (u *= 256); )
642
- e += this[r + h] * u;
643
- return u *= 128, e >= u && (e -= Math.pow(2, 8 * t)), e;
644
- }, o.prototype.readIntBE = function(r, t, n) {
645
- r = r >>> 0, t = t >>> 0, n || I(r, t, this.length);
646
- let e = t, u = 1, h = this[r + --e];
647
- for (; e > 0 && (u *= 256); )
648
- h += this[r + --e] * u;
649
- return u *= 128, h >= u && (h -= Math.pow(2, 8 * t)), h;
650
- }, o.prototype.readInt8 = function(r, t) {
651
- return r = r >>> 0, t || I(r, 1, this.length), this[r] & 128 ? (255 - this[r] + 1) * -1 : this[r];
652
- }, o.prototype.readInt16LE = function(r, t) {
653
- r = r >>> 0, t || I(r, 2, this.length);
654
- const n = this[r] | this[r + 1] << 8;
655
- return n & 32768 ? n | 4294901760 : n;
656
- }, o.prototype.readInt16BE = function(r, t) {
657
- r = r >>> 0, t || I(r, 2, this.length);
658
- const n = this[r + 1] | this[r] << 8;
659
- return n & 32768 ? n | 4294901760 : n;
660
- }, o.prototype.readInt32LE = function(r, t) {
661
- return r = r >>> 0, t || I(r, 4, this.length), this[r] | this[r + 1] << 8 | this[r + 2] << 16 | this[r + 3] << 24;
662
- }, o.prototype.readInt32BE = function(r, t) {
663
- return r = r >>> 0, t || I(r, 4, this.length), this[r] << 24 | this[r + 1] << 16 | this[r + 2] << 8 | this[r + 3];
664
- }, o.prototype.readBigInt64LE = L(function(r) {
665
- r = r >>> 0, k(r, "offset");
666
- const t = this[r], n = this[r + 7];
667
- (t === void 0 || n === void 0) && P(r, this.length - 8);
668
- const e = this[r + 4] + this[r + 5] * 2 ** 8 + this[r + 6] * 2 ** 16 + (n << 24);
669
- return (BigInt(e) << BigInt(32)) + BigInt(t + this[++r] * 2 ** 8 + this[++r] * 2 ** 16 + this[++r] * 2 ** 24);
670
- }), o.prototype.readBigInt64BE = L(function(r) {
671
- r = r >>> 0, k(r, "offset");
672
- const t = this[r], n = this[r + 7];
673
- (t === void 0 || n === void 0) && P(r, this.length - 8);
674
- const e = (t << 24) + // Overflow
675
- this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + this[++r];
676
- return (BigInt(e) << BigInt(32)) + BigInt(this[++r] * 2 ** 24 + this[++r] * 2 ** 16 + this[++r] * 2 ** 8 + n);
677
- }), o.prototype.readFloatLE = function(r, t) {
678
- return r = r >>> 0, t || I(r, 4, this.length), a.read(this, r, !0, 23, 4);
679
- }, o.prototype.readFloatBE = function(r, t) {
680
- return r = r >>> 0, t || I(r, 4, this.length), a.read(this, r, !1, 23, 4);
681
- }, o.prototype.readDoubleLE = function(r, t) {
682
- return r = r >>> 0, t || I(r, 8, this.length), a.read(this, r, !0, 52, 8);
683
- }, o.prototype.readDoubleBE = function(r, t) {
684
- return r = r >>> 0, t || I(r, 8, this.length), a.read(this, r, !1, 52, 8);
685
- };
686
- function U(i, r, t, n, e, u) {
687
- if (!o.isBuffer(i)) throw new TypeError('"buffer" argument must be a Buffer instance');
688
- if (r > e || r < u) throw new RangeError('"value" argument is out of bounds');
689
- if (t + n > i.length) throw new RangeError("Index out of range");
690
- }
691
- o.prototype.writeUintLE = o.prototype.writeUIntLE = function(r, t, n, e) {
692
- if (r = +r, t = t >>> 0, n = n >>> 0, !e) {
693
- const s = Math.pow(2, 8 * n) - 1;
694
- U(this, r, t, n, s, 0);
695
- }
696
- let u = 1, h = 0;
697
- for (this[t] = r & 255; ++h < n && (u *= 256); )
698
- this[t + h] = r / u & 255;
699
- return t + n;
700
- }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(r, t, n, e) {
701
- if (r = +r, t = t >>> 0, n = n >>> 0, !e) {
702
- const s = Math.pow(2, 8 * n) - 1;
703
- U(this, r, t, n, s, 0);
704
- }
705
- let u = n - 1, h = 1;
706
- for (this[t + u] = r & 255; --u >= 0 && (h *= 256); )
707
- this[t + u] = r / h & 255;
708
- return t + n;
709
- }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(r, t, n) {
710
- return r = +r, t = t >>> 0, n || U(this, r, t, 1, 255, 0), this[t] = r & 255, t + 1;
711
- }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(r, t, n) {
712
- return r = +r, t = t >>> 0, n || U(this, r, t, 2, 65535, 0), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
713
- }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(r, t, n) {
714
- return r = +r, t = t >>> 0, n || U(this, r, t, 2, 65535, 0), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
715
- }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(r, t, n) {
716
- return r = +r, t = t >>> 0, n || U(this, r, t, 4, 4294967295, 0), this[t + 3] = r >>> 24, this[t + 2] = r >>> 16, this[t + 1] = r >>> 8, this[t] = r & 255, t + 4;
717
- }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(r, t, n) {
718
- return r = +r, t = t >>> 0, n || U(this, r, t, 4, 4294967295, 0), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
719
- };
720
- function rr(i, r, t, n, e) {
721
- ur(r, n, e, i, t, 7);
722
- let u = Number(r & BigInt(4294967295));
723
- i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u, u = u >> 8, i[t++] = u;
724
- let h = Number(r >> BigInt(32) & BigInt(4294967295));
725
- return i[t++] = h, h = h >> 8, i[t++] = h, h = h >> 8, i[t++] = h, h = h >> 8, i[t++] = h, t;
726
- }
727
- function tr(i, r, t, n, e) {
728
- ur(r, n, e, i, t, 7);
729
- let u = Number(r & BigInt(4294967295));
730
- i[t + 7] = u, u = u >> 8, i[t + 6] = u, u = u >> 8, i[t + 5] = u, u = u >> 8, i[t + 4] = u;
731
- let h = Number(r >> BigInt(32) & BigInt(4294967295));
732
- return i[t + 3] = h, h = h >> 8, i[t + 2] = h, h = h >> 8, i[t + 1] = h, h = h >> 8, i[t] = h, t + 8;
733
- }
734
- o.prototype.writeBigUInt64LE = L(function(r, t = 0) {
735
- return rr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
736
- }), o.prototype.writeBigUInt64BE = L(function(r, t = 0) {
737
- return tr(this, r, t, BigInt(0), BigInt("0xffffffffffffffff"));
738
- }), o.prototype.writeIntLE = function(r, t, n, e) {
739
- if (r = +r, t = t >>> 0, !e) {
740
- const d = Math.pow(2, 8 * n - 1);
741
- U(this, r, t, n, d - 1, -d);
742
- }
743
- let u = 0, h = 1, s = 0;
744
- for (this[t] = r & 255; ++u < n && (h *= 256); )
745
- r < 0 && s === 0 && this[t + u - 1] !== 0 && (s = 1), this[t + u] = (r / h >> 0) - s & 255;
746
- return t + n;
747
- }, o.prototype.writeIntBE = function(r, t, n, e) {
748
- if (r = +r, t = t >>> 0, !e) {
749
- const d = Math.pow(2, 8 * n - 1);
750
- U(this, r, t, n, d - 1, -d);
751
- }
752
- let u = n - 1, h = 1, s = 0;
753
- for (this[t + u] = r & 255; --u >= 0 && (h *= 256); )
754
- r < 0 && s === 0 && this[t + u + 1] !== 0 && (s = 1), this[t + u] = (r / h >> 0) - s & 255;
755
- return t + n;
756
- }, o.prototype.writeInt8 = function(r, t, n) {
757
- return r = +r, t = t >>> 0, n || U(this, r, t, 1, 127, -128), r < 0 && (r = 255 + r + 1), this[t] = r & 255, t + 1;
758
- }, o.prototype.writeInt16LE = function(r, t, n) {
759
- return r = +r, t = t >>> 0, n || U(this, r, t, 2, 32767, -32768), this[t] = r & 255, this[t + 1] = r >>> 8, t + 2;
760
- }, o.prototype.writeInt16BE = function(r, t, n) {
761
- return r = +r, t = t >>> 0, n || U(this, r, t, 2, 32767, -32768), this[t] = r >>> 8, this[t + 1] = r & 255, t + 2;
762
- }, o.prototype.writeInt32LE = function(r, t, n) {
763
- return r = +r, t = t >>> 0, n || U(this, r, t, 4, 2147483647, -2147483648), this[t] = r & 255, this[t + 1] = r >>> 8, this[t + 2] = r >>> 16, this[t + 3] = r >>> 24, t + 4;
764
- }, o.prototype.writeInt32BE = function(r, t, n) {
765
- return r = +r, t = t >>> 0, n || U(this, r, t, 4, 2147483647, -2147483648), r < 0 && (r = 4294967295 + r + 1), this[t] = r >>> 24, this[t + 1] = r >>> 16, this[t + 2] = r >>> 8, this[t + 3] = r & 255, t + 4;
766
- }, o.prototype.writeBigInt64LE = L(function(r, t = 0) {
767
- return rr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
768
- }), o.prototype.writeBigInt64BE = L(function(r, t = 0) {
769
- return tr(this, r, t, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
770
- });
771
- function ir(i, r, t, n, e, u) {
772
- if (t + n > i.length) throw new RangeError("Index out of range");
773
- if (t < 0) throw new RangeError("Index out of range");
774
- }
775
- function nr(i, r, t, n, e) {
776
- return r = +r, t = t >>> 0, e || ir(i, r, t, 4), a.write(i, r, t, n, 23, 4), t + 4;
777
- }
778
- o.prototype.writeFloatLE = function(r, t, n) {
779
- return nr(this, r, t, !0, n);
780
- }, o.prototype.writeFloatBE = function(r, t, n) {
781
- return nr(this, r, t, !1, n);
782
- };
783
- function er(i, r, t, n, e) {
784
- return r = +r, t = t >>> 0, e || ir(i, r, t, 8), a.write(i, r, t, n, 52, 8), t + 8;
785
- }
786
- o.prototype.writeDoubleLE = function(r, t, n) {
787
- return er(this, r, t, !0, n);
788
- }, o.prototype.writeDoubleBE = function(r, t, n) {
789
- return er(this, r, t, !1, n);
790
- }, o.prototype.copy = function(r, t, n, e) {
791
- if (!o.isBuffer(r)) throw new TypeError("argument should be a Buffer");
792
- if (n || (n = 0), !e && e !== 0 && (e = this.length), t >= r.length && (t = r.length), t || (t = 0), e > 0 && e < n && (e = n), e === n || r.length === 0 || this.length === 0) return 0;
793
- if (t < 0)
794
- throw new RangeError("targetStart out of bounds");
795
- if (n < 0 || n >= this.length) throw new RangeError("Index out of range");
796
- if (e < 0) throw new RangeError("sourceEnd out of bounds");
797
- e > this.length && (e = this.length), r.length - t < e - n && (e = r.length - t + n);
798
- const u = e - n;
799
- return this === r && typeof f.prototype.copyWithin == "function" ? this.copyWithin(t, n, e) : f.prototype.set.call(
800
- r,
801
- this.subarray(n, e),
802
- t
803
- ), u;
804
- }, o.prototype.fill = function(r, t, n, e) {
805
- if (typeof r == "string") {
806
- if (typeof t == "string" ? (e = t, t = 0, n = this.length) : typeof n == "string" && (e = n, n = this.length), e !== void 0 && typeof e != "string")
807
- throw new TypeError("encoding must be a string");
808
- if (typeof e == "string" && !o.isEncoding(e))
809
- throw new TypeError("Unknown encoding: " + e);
810
- if (r.length === 1) {
811
- const h = r.charCodeAt(0);
812
- (e === "utf8" && h < 128 || e === "latin1") && (r = h);
813
- }
814
- } else typeof r == "number" ? r = r & 255 : typeof r == "boolean" && (r = Number(r));
815
- if (t < 0 || this.length < t || this.length < n)
816
- throw new RangeError("Out of range index");
817
- if (n <= t)
818
- return this;
819
- t = t >>> 0, n = n === void 0 ? this.length : n >>> 0, r || (r = 0);
820
- let u;
821
- if (typeof r == "number")
822
- for (u = t; u < n; ++u)
823
- this[u] = r;
824
- else {
825
- const h = o.isBuffer(r) ? r : o.from(r, e), s = h.length;
826
- if (s === 0)
827
- throw new TypeError('The value "' + r + '" is invalid for argument "value"');
828
- for (u = 0; u < n - t; ++u)
829
- this[u + t] = h[u % s];
830
- }
831
- return this;
832
- };
833
- const M = {};
834
- function q(i, r, t) {
835
- M[i] = class extends t {
836
- constructor() {
837
- super(), Object.defineProperty(this, "message", {
838
- value: r.apply(this, arguments),
839
- writable: !0,
840
- configurable: !0
841
- }), this.name = `${this.name} [${i}]`, this.stack, delete this.name;
842
- }
843
- get code() {
844
- return i;
845
- }
846
- set code(e) {
847
- Object.defineProperty(this, "code", {
848
- configurable: !0,
849
- enumerable: !0,
850
- value: e,
851
- writable: !0
852
- });
853
- }
854
- toString() {
855
- return `${this.name} [${i}]: ${this.message}`;
856
- }
857
- };
858
- }
859
- q(
860
- "ERR_BUFFER_OUT_OF_BOUNDS",
861
- function(i) {
862
- return i ? `${i} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
863
- },
864
- RangeError
865
- ), q(
866
- "ERR_INVALID_ARG_TYPE",
867
- function(i, r) {
868
- return `The "${i}" argument must be of type number. Received type ${typeof r}`;
869
- },
870
- TypeError
871
- ), q(
872
- "ERR_OUT_OF_RANGE",
873
- function(i, r, t) {
874
- let n = `The value of "${i}" is out of range.`, e = t;
875
- return Number.isInteger(t) && Math.abs(t) > 2 ** 32 ? e = or(String(t)) : typeof t == "bigint" && (e = String(t), (t > BigInt(2) ** BigInt(32) || t < -(BigInt(2) ** BigInt(32))) && (e = or(e)), e += "n"), n += ` It must be ${r}. Received ${e}`, n;
876
- },
877
- RangeError
878
- );
879
- function or(i) {
880
- let r = "", t = i.length;
881
- const n = i[0] === "-" ? 1 : 0;
882
- for (; t >= n + 4; t -= 3)
883
- r = `_${i.slice(t - 3, t)}${r}`;
884
- return `${i.slice(0, t)}${r}`;
885
- }
886
- function Ur(i, r, t) {
887
- k(r, "offset"), (i[r] === void 0 || i[r + t] === void 0) && P(r, i.length - (t + 1));
888
- }
889
- function ur(i, r, t, n, e, u) {
890
- if (i > t || i < r) {
891
- const h = typeof r == "bigint" ? "n" : "";
892
- let s;
893
- throw r === 0 || r === BigInt(0) ? s = `>= 0${h} and < 2${h} ** ${(u + 1) * 8}${h}` : s = `>= -(2${h} ** ${(u + 1) * 8 - 1}${h}) and < 2 ** ${(u + 1) * 8 - 1}${h}`, new M.ERR_OUT_OF_RANGE("value", s, i);
894
- }
895
- Ur(n, e, u);
896
- }
897
- function k(i, r) {
898
- if (typeof i != "number")
899
- throw new M.ERR_INVALID_ARG_TYPE(r, "number", i);
900
- }
901
- function P(i, r, t) {
902
- throw Math.floor(i) !== i ? (k(i, t), new M.ERR_OUT_OF_RANGE("offset", "an integer", i)) : r < 0 ? new M.ERR_BUFFER_OUT_OF_BOUNDS() : new M.ERR_OUT_OF_RANGE(
903
- "offset",
904
- `>= 0 and <= ${r}`,
905
- i
906
- );
907
- }
908
- const Rr = /[^+/0-9A-Za-z-_]/g;
909
- function Tr(i) {
910
- if (i = i.split("=")[0], i = i.trim().replace(Rr, ""), i.length < 2) return "";
911
- for (; i.length % 4 !== 0; )
912
- i = i + "=";
913
- return i;
914
- }
915
- function H(i, r) {
916
- r = r || 1 / 0;
917
- let t;
918
- const n = i.length;
919
- let e = null;
920
- const u = [];
921
- for (let h = 0; h < n; ++h) {
922
- if (t = i.charCodeAt(h), t > 55295 && t < 57344) {
923
- if (!e) {
924
- if (t > 56319) {
925
- (r -= 3) > -1 && u.push(239, 191, 189);
926
- continue;
927
- } else if (h + 1 === n) {
928
- (r -= 3) > -1 && u.push(239, 191, 189);
929
- continue;
930
- }
931
- e = t;
932
- continue;
933
- }
934
- if (t < 56320) {
935
- (r -= 3) > -1 && u.push(239, 191, 189), e = t;
936
- continue;
937
- }
938
- t = (e - 55296 << 10 | t - 56320) + 65536;
939
- } else e && (r -= 3) > -1 && u.push(239, 191, 189);
940
- if (e = null, t < 128) {
941
- if ((r -= 1) < 0) break;
942
- u.push(t);
943
- } else if (t < 2048) {
944
- if ((r -= 2) < 0) break;
945
- u.push(
946
- t >> 6 | 192,
947
- t & 63 | 128
948
- );
949
- } else if (t < 65536) {
950
- if ((r -= 3) < 0) break;
951
- u.push(
952
- t >> 12 | 224,
953
- t >> 6 & 63 | 128,
954
- t & 63 | 128
955
- );
956
- } else if (t < 1114112) {
957
- if ((r -= 4) < 0) break;
958
- u.push(
959
- t >> 18 | 240,
960
- t >> 12 & 63 | 128,
961
- t >> 6 & 63 | 128,
962
- t & 63 | 128
963
- );
964
- } else
965
- throw new Error("Invalid code point");
966
- }
967
- return u;
968
- }
969
- function Cr(i) {
970
- const r = [];
971
- for (let t = 0; t < i.length; ++t)
972
- r.push(i.charCodeAt(t) & 255);
973
- return r;
974
- }
975
- function _r(i, r) {
976
- let t, n, e;
977
- const u = [];
978
- for (let h = 0; h < i.length && !((r -= 2) < 0); ++h)
979
- t = i.charCodeAt(h), n = t >> 8, e = t % 256, u.push(e), u.push(n);
980
- return u;
981
- }
982
- function hr(i) {
983
- return c.toByteArray(Tr(i));
984
- }
985
- function $(i, r, t, n) {
986
- let e;
987
- for (e = 0; e < n && !(e + t >= r.length || e >= i.length); ++e)
988
- r[e + t] = i[e];
989
- return e;
990
- }
991
- function C(i, r) {
992
- return i instanceof r || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === r.name;
993
- }
994
- function V(i) {
995
- return i !== i;
996
- }
997
- const Sr = (function() {
998
- const i = "0123456789abcdef", r = new Array(256);
999
- for (let t = 0; t < 16; ++t) {
1000
- const n = t * 16;
1001
- for (let e = 0; e < 16; ++e)
1002
- r[n + e] = i[t] + i[e];
1003
- }
1004
- return r;
1005
- })();
1006
- function L(i) {
1007
- return typeof BigInt > "u" ? Lr : i;
1008
- }
1009
- function Lr() {
1010
- throw new Error("BigInt not supported");
1011
- }
1012
- })(fr);
1013
- const Yr = fr.Buffer;
1014
- export {
1015
- Yr as B
1016
- };