@caspian2026/agent-sdk 0.0.24 → 0.0.26

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 (362) hide show
  1. package/dist/gateway/index.js +98 -22
  2. package/dist/gateway/worker.js +196 -47
  3. package/dist/sdk/query.cjs +2 -362
  4. package/dist/sdk/query.js +2 -367
  5. package/package.json +4 -6
  6. package/dist/chunk-05kvhzd7.js +0 -3561
  7. package/dist/chunk-07069jq1.js +0 -30
  8. package/dist/chunk-0731m51q.js +0 -8
  9. package/dist/chunk-08bspa4b.js +0 -673
  10. package/dist/chunk-0brkf8q8.js +0 -89
  11. package/dist/chunk-0n843xh7.js +0 -261
  12. package/dist/chunk-0nbp5jwx.js +0 -8583
  13. package/dist/chunk-0nj16az9.js +0 -169
  14. package/dist/chunk-0paqc2yw.js +0 -15
  15. package/dist/chunk-0q6b50ps.js +0 -111
  16. package/dist/chunk-0r5bb9j4.js +0 -477
  17. package/dist/chunk-0rpz1wgn.js +0 -1030
  18. package/dist/chunk-0t81d427.js +0 -41
  19. package/dist/chunk-0vaw02wq.js +0 -24
  20. package/dist/chunk-0vkfrmqm.js +0 -690
  21. package/dist/chunk-0vp3wfab.js +0 -12
  22. package/dist/chunk-0vr10742.js +0 -1809
  23. package/dist/chunk-0xjaqda8.js +0 -1124
  24. package/dist/chunk-13ehyphg.js +0 -223
  25. package/dist/chunk-15jsw9bb.js +0 -349
  26. package/dist/chunk-16m7eyyw.js +0 -1385
  27. package/dist/chunk-1ae3nt9j.js +0 -31
  28. package/dist/chunk-1gq4r3v1.js +0 -308
  29. package/dist/chunk-1gx78081.js +0 -66
  30. package/dist/chunk-1h2famwb.js +0 -49
  31. package/dist/chunk-1n546sfg.js +0 -200
  32. package/dist/chunk-1qg06d60.js +0 -494
  33. package/dist/chunk-1t0rqstn.js +0 -146
  34. package/dist/chunk-1z8p2eqd.js +0 -40
  35. package/dist/chunk-1zjh9cc5.js +0 -266
  36. package/dist/chunk-20ahkkrb.js +0 -132
  37. package/dist/chunk-21pbfch8.js +0 -105
  38. package/dist/chunk-26wtxbdc.js +0 -13870
  39. package/dist/chunk-2fwze72g.js +0 -24
  40. package/dist/chunk-2gcbr1c7.js +0 -107
  41. package/dist/chunk-2grc1yr8.js +0 -654
  42. package/dist/chunk-2gzv8nrw.js +0 -205
  43. package/dist/chunk-2r212cvt.js +0 -253
  44. package/dist/chunk-2s74bt6e.js +0 -317
  45. package/dist/chunk-2v385w7r.js +0 -7422
  46. package/dist/chunk-2wtkvpp2.js +0 -167
  47. package/dist/chunk-31rsspfr.js +0 -418
  48. package/dist/chunk-3c25bcsw.js +0 -17
  49. package/dist/chunk-3jm08aaw.js +0 -91
  50. package/dist/chunk-3mgywd32.js +0 -8
  51. package/dist/chunk-3nk79af8.js +0 -8
  52. package/dist/chunk-3v4sk2py.js +0 -101
  53. package/dist/chunk-3vwft0eh.js +0 -349
  54. package/dist/chunk-3vy1jt9p.js +0 -1010
  55. package/dist/chunk-3wvqzq9w.js +0 -92
  56. package/dist/chunk-3wvv2s8d.js +0 -336
  57. package/dist/chunk-4060b3s2.js +0 -108
  58. package/dist/chunk-434e0vh4.js +0 -275
  59. package/dist/chunk-46dm23zs.js +0 -344
  60. package/dist/chunk-4bh4qs70.js +0 -209
  61. package/dist/chunk-4cxzbqws.js +0 -94
  62. package/dist/chunk-4jm600zv.js +0 -13
  63. package/dist/chunk-4k9d7gxv.js +0 -118
  64. package/dist/chunk-4nc3t6ms.js +0 -396
  65. package/dist/chunk-4pbx3g7s.js +0 -26
  66. package/dist/chunk-4qhh8bpa.js +0 -54
  67. package/dist/chunk-4v63px9y.js +0 -133
  68. package/dist/chunk-4xnnzt3j.js +0 -74
  69. package/dist/chunk-4zchh01h.js +0 -201
  70. package/dist/chunk-5216fha8.js +0 -1163
  71. package/dist/chunk-55raexh7.js +0 -14358
  72. package/dist/chunk-5bffhf64.js +0 -81
  73. package/dist/chunk-5ccdsxgy.js +0 -74
  74. package/dist/chunk-5ddh2hyn.js +0 -91
  75. package/dist/chunk-5e6ncq5j.js +0 -61
  76. package/dist/chunk-5ekyhb1w.js +0 -422
  77. package/dist/chunk-5fy4r8rv.js +0 -52
  78. package/dist/chunk-5h5kx2jd.js +0 -34
  79. package/dist/chunk-5mbgdvyz.js +0 -847
  80. package/dist/chunk-5n1jc02d.js +0 -87
  81. package/dist/chunk-5pysjah8.js +0 -1543
  82. package/dist/chunk-5ssfz438.js +0 -323
  83. package/dist/chunk-5z28bqne.js +0 -6748
  84. package/dist/chunk-603y0mmg.js +0 -50
  85. package/dist/chunk-62v5kkff.js +0 -90
  86. package/dist/chunk-64c1avct.js +0 -13
  87. package/dist/chunk-64r16v22.js +0 -162
  88. package/dist/chunk-64smdx4a.js +0 -418
  89. package/dist/chunk-66zry909.js +0 -11
  90. package/dist/chunk-68ffk5qa.js +0 -14
  91. package/dist/chunk-69n11zng.js +0 -436
  92. package/dist/chunk-6dj5t602.js +0 -341
  93. package/dist/chunk-6dngjwkh.js +0 -63
  94. package/dist/chunk-6nsd9606.js +0 -790
  95. package/dist/chunk-6pkh8frk.js +0 -253
  96. package/dist/chunk-6qcmt5eb.js +0 -251
  97. package/dist/chunk-6ww7451s.js +0 -60
  98. package/dist/chunk-6xgb0kqz.js +0 -90
  99. package/dist/chunk-72ys9m07.js +0 -121
  100. package/dist/chunk-741sgvtx.js +0 -121
  101. package/dist/chunk-7aw745vx.js +0 -40175
  102. package/dist/chunk-7c8b8cfb.js +0 -219
  103. package/dist/chunk-7mwt4e1z.js +0 -234
  104. package/dist/chunk-7sgtxrsc.js +0 -1059
  105. package/dist/chunk-7wm5s02e.js +0 -216
  106. package/dist/chunk-7xyswgjh.js +0 -8
  107. package/dist/chunk-80a197ez.js +0 -1438
  108. package/dist/chunk-83hfzbx3.js +0 -10
  109. package/dist/chunk-8akrsgad.js +0 -55
  110. package/dist/chunk-8g5pe1gr.js +0 -37
  111. package/dist/chunk-8s07t4k7.js +0 -40
  112. package/dist/chunk-8yhf030a.js +0 -69
  113. package/dist/chunk-928tzaa8.js +0 -107
  114. package/dist/chunk-949pjzj9.js +0 -266
  115. package/dist/chunk-9aycd4z9.js +0 -490
  116. package/dist/chunk-9bzqvsz5.js +0 -211
  117. package/dist/chunk-9q3xfy27.js +0 -460
  118. package/dist/chunk-9vzg1360.js +0 -153
  119. package/dist/chunk-9wbh8n1y.js +0 -63
  120. package/dist/chunk-9x5zgy22.js +0 -12
  121. package/dist/chunk-9zdj4ypz.js +0 -206
  122. package/dist/chunk-a0bvcgyd.js +0 -127
  123. package/dist/chunk-a4m3yr2q.js +0 -117
  124. package/dist/chunk-a8jd4gee.js +0 -227
  125. package/dist/chunk-ase86y73.js +0 -15
  126. package/dist/chunk-atfzpm6r.js +0 -325
  127. package/dist/chunk-awqsddp2.js +0 -338
  128. package/dist/chunk-awrgzpk6.js +0 -29
  129. package/dist/chunk-b0kf00ff.js +0 -637
  130. package/dist/chunk-b1kcd3ss.js +0 -27
  131. package/dist/chunk-b4hy21c4.js +0 -140
  132. package/dist/chunk-b9mkm8mg.js +0 -111
  133. package/dist/chunk-bdjx14rd.js +0 -594
  134. package/dist/chunk-bfb41q9h.js +0 -295
  135. package/dist/chunk-bg4x9ex0.js +0 -21
  136. package/dist/chunk-bh5zqvyc.js +0 -36
  137. package/dist/chunk-bn0zv2y2.js +0 -1154
  138. package/dist/chunk-bn7t681c.js +0 -2669
  139. package/dist/chunk-br4wgffc.js +0 -393
  140. package/dist/chunk-brjd9zmk.js +0 -42
  141. package/dist/chunk-byfawrfx.js +0 -121
  142. package/dist/chunk-c6sjhj89.js +0 -1284
  143. package/dist/chunk-c7jwbe76.js +0 -29030
  144. package/dist/chunk-cdef9v7b.js +0 -27
  145. package/dist/chunk-cdz5yb0r.js +0 -57
  146. package/dist/chunk-cevq1787.js +0 -2718
  147. package/dist/chunk-cgfdkzhb.js +0 -12
  148. package/dist/chunk-cgqw4x5z.js +0 -155
  149. package/dist/chunk-cmmmc8e0.js +0 -212
  150. package/dist/chunk-cnsj3vq2.js +0 -35
  151. package/dist/chunk-cxrktb5g.js +0 -51
  152. package/dist/chunk-cyhrb0bk.js +0 -251
  153. package/dist/chunk-d23rmn8r.js +0 -62
  154. package/dist/chunk-d4mdda98.js +0 -94
  155. package/dist/chunk-dcwp94cj.js +0 -152
  156. package/dist/chunk-ddsjkqs4.js +0 -39
  157. package/dist/chunk-ddv56j39.js +0 -148
  158. package/dist/chunk-dfq6pbq7.js +0 -5822
  159. package/dist/chunk-dfzkwynj.js +0 -5368
  160. package/dist/chunk-dkgkd8b7.js +0 -516
  161. package/dist/chunk-dpnmf0pq.js +0 -312
  162. package/dist/chunk-dygx7vcc.js +0 -226
  163. package/dist/chunk-e0abab5b.js +0 -445
  164. package/dist/chunk-e5qhvhjy.js +0 -168
  165. package/dist/chunk-e60y6r1n.js +0 -20
  166. package/dist/chunk-e68kgvcq.js +0 -79
  167. package/dist/chunk-e9w9zc0g.js +0 -392
  168. package/dist/chunk-ecj9w6tm.js +0 -558
  169. package/dist/chunk-ehtwnxpg.js +0 -1591
  170. package/dist/chunk-eqp1rfft.js +0 -17
  171. package/dist/chunk-etdt1xz3.js +0 -19
  172. package/dist/chunk-ewadzrm8.js +0 -103
  173. package/dist/chunk-f03s83vj.js +0 -91
  174. package/dist/chunk-f3kk0p3s.js +0 -150
  175. package/dist/chunk-f3pjerx4.js +0 -4265
  176. package/dist/chunk-f6h5weh6.js +0 -61
  177. package/dist/chunk-fajg8x36.js +0 -8158
  178. package/dist/chunk-fbv4apne.js +0 -51
  179. package/dist/chunk-fcynwjpm.js +0 -1072
  180. package/dist/chunk-fdvaf6nn.js +0 -20
  181. package/dist/chunk-feyzykye.js +0 -10
  182. package/dist/chunk-ff85rwvc.js +0 -180
  183. package/dist/chunk-fqak69ft.js +0 -458
  184. package/dist/chunk-fxdkbabd.js +0 -195
  185. package/dist/chunk-fyc5fepv.js +0 -10
  186. package/dist/chunk-g78c6ztj.js +0 -89
  187. package/dist/chunk-g8ee7yza.js +0 -105
  188. package/dist/chunk-g9f19ttm.js +0 -15
  189. package/dist/chunk-gcktsbxb.js +0 -77
  190. package/dist/chunk-gdwdqewd.js +0 -19
  191. package/dist/chunk-gg55fns0.js +0 -6440
  192. package/dist/chunk-gnpt1t6q.js +0 -209364
  193. package/dist/chunk-gsbw2j2b.js +0 -276
  194. package/dist/chunk-gybt680f.js +0 -9114
  195. package/dist/chunk-gz1e8y1w.js +0 -33
  196. package/dist/chunk-gz7vn2gg.js +0 -114
  197. package/dist/chunk-h0d5eat0.js +0 -101
  198. package/dist/chunk-h27tjbp3.js +0 -33118
  199. package/dist/chunk-h2yy8k4c.js +0 -58
  200. package/dist/chunk-h5acpdqt.js +0 -103
  201. package/dist/chunk-h63r8vps.js +0 -2840
  202. package/dist/chunk-h64x5b04.js +0 -860
  203. package/dist/chunk-h92snc84.js +0 -420
  204. package/dist/chunk-h9n54swm.js +0 -27
  205. package/dist/chunk-hafcrnpc.js +0 -145
  206. package/dist/chunk-hakdhagh.js +0 -16606
  207. package/dist/chunk-hk4phsaw.js +0 -388
  208. package/dist/chunk-hph1bmqw.js +0 -65
  209. package/dist/chunk-hvnztnp3.js +0 -71
  210. package/dist/chunk-hwfknpxv.js +0 -39
  211. package/dist/chunk-j2xxd002.js +0 -1052
  212. package/dist/chunk-j3qbygme.js +0 -105
  213. package/dist/chunk-j5bth84e.js +0 -97
  214. package/dist/chunk-j64ga6ta.js +0 -8035
  215. package/dist/chunk-jbwgyskk.js +0 -385
  216. package/dist/chunk-jd32zbps.js +0 -15
  217. package/dist/chunk-jdhkh2bb.js +0 -618
  218. package/dist/chunk-jeqcwgt7.js +0 -177
  219. package/dist/chunk-jf75p9ap.js +0 -445
  220. package/dist/chunk-jgvk0za1.js +0 -260
  221. package/dist/chunk-jhpaevah.js +0 -565
  222. package/dist/chunk-jmjwrbwd.js +0 -635
  223. package/dist/chunk-jpdbfwvq.js +0 -100
  224. package/dist/chunk-jps4m6sz.js +0 -183
  225. package/dist/chunk-jwf0s51s.js +0 -867
  226. package/dist/chunk-jxge4dgh.js +0 -83
  227. package/dist/chunk-jz71gv95.js +0 -1161
  228. package/dist/chunk-jzthz1bx.js +0 -15
  229. package/dist/chunk-jzvd2ycp.js +0 -120
  230. package/dist/chunk-k0p9w03v.js +0 -4957
  231. package/dist/chunk-k4dcreh0.js +0 -442
  232. package/dist/chunk-k7akhwkn.js +0 -151
  233. package/dist/chunk-k8vp0atq.js +0 -2331
  234. package/dist/chunk-kgd7gfvk.js +0 -407
  235. package/dist/chunk-km5ycg1j.js +0 -87
  236. package/dist/chunk-kvyrxzj8.js +0 -26
  237. package/dist/chunk-kwekc97v.js +0 -18
  238. package/dist/chunk-ky1z78ve.js +0 -119
  239. package/dist/chunk-mcws22k3.js +0 -42
  240. package/dist/chunk-mjazvyd8.js +0 -528
  241. package/dist/chunk-mswx2nma.js +0 -103
  242. package/dist/chunk-mz6a0phh.js +0 -2962
  243. package/dist/chunk-n2tg12hg.js +0 -374
  244. package/dist/chunk-n3fv4ya7.js +0 -146
  245. package/dist/chunk-n4eabmqd.js +0 -93
  246. package/dist/chunk-n4tx7baq.js +0 -193
  247. package/dist/chunk-n6g4jbeh.js +0 -289
  248. package/dist/chunk-n6wzfxf1.js +0 -100
  249. package/dist/chunk-ndcmqfkv.js +0 -244
  250. package/dist/chunk-netzwgv1.js +0 -154
  251. package/dist/chunk-nhcg04jt.js +0 -120
  252. package/dist/chunk-nhsm3ntd.js +0 -439
  253. package/dist/chunk-njev89d1.js +0 -2335
  254. package/dist/chunk-nmgj86tt.js +0 -24
  255. package/dist/chunk-ns7x6xam.js +0 -22820
  256. package/dist/chunk-p7vkh4wx.js +0 -15
  257. package/dist/chunk-p8na2wwp.js +0 -14
  258. package/dist/chunk-p97fd5af.js +0 -684
  259. package/dist/chunk-pe3rkfp2.js +0 -74
  260. package/dist/chunk-pgtnj1mt.js +0 -705
  261. package/dist/chunk-phmnkw9y.js +0 -283
  262. package/dist/chunk-pnds7g1q.js +0 -130
  263. package/dist/chunk-ppwjyveh.js +0 -8
  264. package/dist/chunk-pqqxdk5f.js +0 -543
  265. package/dist/chunk-ps49ymvj.js +0 -43
  266. package/dist/chunk-pwwa7s62.js +0 -11
  267. package/dist/chunk-q3hfrat2.js +0 -313
  268. package/dist/chunk-qajrkk97.js +0 -298
  269. package/dist/chunk-qatfdxvd.js +0 -34
  270. package/dist/chunk-qb5qcctj.js +0 -206
  271. package/dist/chunk-qb6k2afy.js +0 -153
  272. package/dist/chunk-qgk93a75.js +0 -85
  273. package/dist/chunk-qkczt8cr.js +0 -24
  274. package/dist/chunk-qn1be1vf.js +0 -267
  275. package/dist/chunk-qnfx3qtx.js +0 -617
  276. package/dist/chunk-qnwne2m4.js +0 -87
  277. package/dist/chunk-qp2qdcda.js +0 -100
  278. package/dist/chunk-qpp3wwh5.js +0 -697
  279. package/dist/chunk-r0bx1gc7.js +0 -174
  280. package/dist/chunk-radnwk8x.js +0 -107
  281. package/dist/chunk-rkv5jq0y.js +0 -71
  282. package/dist/chunk-rmbbmd3s.js +0 -68
  283. package/dist/chunk-rmgbs5an.js +0 -640
  284. package/dist/chunk-rn0v1hk8.js +0 -34
  285. package/dist/chunk-rnxctq9p.js +0 -1646
  286. package/dist/chunk-rtd39n81.js +0 -95
  287. package/dist/chunk-s8gy4ky9.js +0 -122
  288. package/dist/chunk-s8kj6ajy.js +0 -32
  289. package/dist/chunk-sd36yzx8.js +0 -954
  290. package/dist/chunk-sdenh194.js +0 -121
  291. package/dist/chunk-sdtqp75c.js +0 -55
  292. package/dist/chunk-sedbc8ep.js +0 -212
  293. package/dist/chunk-sfrb15b2.js +0 -321
  294. package/dist/chunk-sgpmpn90.js +0 -35
  295. package/dist/chunk-sh02d2qn.js +0 -38
  296. package/dist/chunk-shd4yhsf.js +0 -32
  297. package/dist/chunk-shkycj1q.js +0 -178
  298. package/dist/chunk-sk7h93je.js +0 -153
  299. package/dist/chunk-sm8g6fsm.js +0 -122
  300. package/dist/chunk-snrjy66h.js +0 -671
  301. package/dist/chunk-sq4a0yjh.js +0 -116
  302. package/dist/chunk-sr3t4thh.js +0 -895
  303. package/dist/chunk-srj6qnf6.js +0 -107
  304. package/dist/chunk-sz62n77p.js +0 -155
  305. package/dist/chunk-szj5wvdy.js +0 -28
  306. package/dist/chunk-t29a6zb5.js +0 -45
  307. package/dist/chunk-t2ecddwj.js +0 -731
  308. package/dist/chunk-t33hmmmm.js +0 -113
  309. package/dist/chunk-t4khqff1.js +0 -16
  310. package/dist/chunk-t9p85zff.js +0 -24
  311. package/dist/chunk-ta3jyvxs.js +0 -984
  312. package/dist/chunk-tkx5eec8.js +0 -54
  313. package/dist/chunk-v1kzp02e.js +0 -785
  314. package/dist/chunk-v4t6dyyh.js +0 -9076
  315. package/dist/chunk-v78fj8by.js +0 -145
  316. package/dist/chunk-v8kjswxt.js +0 -61
  317. package/dist/chunk-v9smspw2.js +0 -4301
  318. package/dist/chunk-vf612n57.js +0 -472
  319. package/dist/chunk-vkhrrvfq.js +0 -44
  320. package/dist/chunk-vt5wm07k.js +0 -74
  321. package/dist/chunk-vvvrv61g.js +0 -875
  322. package/dist/chunk-vyjeh50y.js +0 -2149
  323. package/dist/chunk-w0kxcv73.js +0 -97
  324. package/dist/chunk-w6m6trzq.js +0 -58
  325. package/dist/chunk-wa8yn2p0.js +0 -2007
  326. package/dist/chunk-wb18cecv.js +0 -995
  327. package/dist/chunk-wgk9sxk7.js +0 -329
  328. package/dist/chunk-wh0ev1bw.js +0 -111
  329. package/dist/chunk-wka1647p.js +0 -98
  330. package/dist/chunk-wnwfwyj4.js +0 -90
  331. package/dist/chunk-wpdchyy2.js +0 -97
  332. package/dist/chunk-x3g44n7k.js +0 -114
  333. package/dist/chunk-x47h283a.js +0 -56
  334. package/dist/chunk-x6r4v44b.js +0 -8
  335. package/dist/chunk-x7fdwq3d.js +0 -33
  336. package/dist/chunk-x8d2ehd7.js +0 -19
  337. package/dist/chunk-xbeg2hej.js +0 -257
  338. package/dist/chunk-xeb6075z.js +0 -3435
  339. package/dist/chunk-xhfmdq1y.js +0 -147
  340. package/dist/chunk-xhscn33a.js +0 -138
  341. package/dist/chunk-xv3era3s.js +0 -8
  342. package/dist/chunk-xz5gbhc3.js +0 -93
  343. package/dist/chunk-y1784krc.js +0 -19
  344. package/dist/chunk-y1vyezct.js +0 -123
  345. package/dist/chunk-y45ecntg.js +0 -942
  346. package/dist/chunk-y4ca9kqz.js +0 -3830
  347. package/dist/chunk-y9bhjjdz.js +0 -145
  348. package/dist/chunk-yb3bxv3w.js +0 -30
  349. package/dist/chunk-ye2q9gqj.js +0 -332
  350. package/dist/chunk-yfg3adfq.js +0 -88
  351. package/dist/chunk-yst0wmgw.js +0 -269
  352. package/dist/chunk-ywe9dbnz.js +0 -460
  353. package/dist/chunk-yyex5gsf.js +0 -269
  354. package/dist/chunk-yz2kzqk5.js +0 -439
  355. package/dist/chunk-z263ehpg.js +0 -131
  356. package/dist/chunk-z2dp53wn.js +0 -17
  357. package/dist/chunk-zaq348h2.js +0 -281
  358. package/dist/chunk-zr0qx9q0.js +0 -642
  359. package/dist/chunk-zxh62ved.js +0 -31
  360. package/dist/chunk-zy5vn8sd.js +0 -329
  361. package/dist/chunk-zzm33q8x.js +0 -8
  362. package/dist/cli.js +0 -91
@@ -1,2149 +0,0 @@
1
- // @bun
2
- import {
3
- __esm
4
- } from "./chunk-qp2qdcda.js";
5
-
6
- // node_modules/.bun/fflate@0.8.2/node_modules/fflate/esm/index.mjs
7
- import { createRequire } from "module";
8
- function StrmOpt(opts, cb) {
9
- if (typeof opts == "function")
10
- cb = opts, opts = {};
11
- this.ondata = cb;
12
- return opts;
13
- }
14
- function deflate(data, opts, cb) {
15
- if (!cb)
16
- cb = opts, opts = {};
17
- if (typeof cb != "function")
18
- err(7);
19
- return cbify(data, opts, [
20
- bDflt
21
- ], function(ev) {
22
- return pbf(deflateSync(ev.data[0], ev.data[1]));
23
- }, 0, cb);
24
- }
25
- function deflateSync(data, opts) {
26
- return dopt(data, opts || {}, 0, 0);
27
- }
28
- function inflate(data, opts, cb) {
29
- if (!cb)
30
- cb = opts, opts = {};
31
- if (typeof cb != "function")
32
- err(7);
33
- return cbify(data, opts, [
34
- bInflt
35
- ], function(ev) {
36
- return pbf(inflateSync(ev.data[0], gopt(ev.data[1])));
37
- }, 1, cb);
38
- }
39
- function inflateSync(data, opts) {
40
- return inflt(data, { i: 2 }, opts && opts.out, opts && opts.dictionary);
41
- }
42
- function gzip(data, opts, cb) {
43
- if (!cb)
44
- cb = opts, opts = {};
45
- if (typeof cb != "function")
46
- err(7);
47
- return cbify(data, opts, [
48
- bDflt,
49
- gze,
50
- function() {
51
- return [gzipSync];
52
- }
53
- ], function(ev) {
54
- return pbf(gzipSync(ev.data[0], ev.data[1]));
55
- }, 2, cb);
56
- }
57
- function gzipSync(data, opts) {
58
- if (!opts)
59
- opts = {};
60
- var c = crc(), l = data.length;
61
- c.p(data);
62
- var d = dopt(data, opts, gzhl(opts), 8), s = d.length;
63
- return gzh(d, opts), wbytes(d, s - 8, c.d()), wbytes(d, s - 4, l), d;
64
- }
65
- function gunzip(data, opts, cb) {
66
- if (!cb)
67
- cb = opts, opts = {};
68
- if (typeof cb != "function")
69
- err(7);
70
- return cbify(data, opts, [
71
- bInflt,
72
- guze,
73
- function() {
74
- return [gunzipSync];
75
- }
76
- ], function(ev) {
77
- return pbf(gunzipSync(ev.data[0], ev.data[1]));
78
- }, 3, cb);
79
- }
80
- function gunzipSync(data, opts) {
81
- var st = gzs(data);
82
- if (st + 8 > data.length)
83
- err(6, "invalid gzip data");
84
- return inflt(data.subarray(st, -8), { i: 2 }, opts && opts.out || new u8(gzl(data)), opts && opts.dictionary);
85
- }
86
- function zlib(data, opts, cb) {
87
- if (!cb)
88
- cb = opts, opts = {};
89
- if (typeof cb != "function")
90
- err(7);
91
- return cbify(data, opts, [
92
- bDflt,
93
- zle,
94
- function() {
95
- return [zlibSync];
96
- }
97
- ], function(ev) {
98
- return pbf(zlibSync(ev.data[0], ev.data[1]));
99
- }, 4, cb);
100
- }
101
- function zlibSync(data, opts) {
102
- if (!opts)
103
- opts = {};
104
- var a = adler();
105
- a.p(data);
106
- var d = dopt(data, opts, opts.dictionary ? 6 : 2, 4);
107
- return zlh(d, opts), wbytes(d, d.length - 4, a.d()), d;
108
- }
109
- function unzlib(data, opts, cb) {
110
- if (!cb)
111
- cb = opts, opts = {};
112
- if (typeof cb != "function")
113
- err(7);
114
- return cbify(data, opts, [
115
- bInflt,
116
- zule,
117
- function() {
118
- return [unzlibSync];
119
- }
120
- ], function(ev) {
121
- return pbf(unzlibSync(ev.data[0], gopt(ev.data[1])));
122
- }, 5, cb);
123
- }
124
- function unzlibSync(data, opts) {
125
- return inflt(data.subarray(zls(data, opts && opts.dictionary), -4), { i: 2 }, opts && opts.out, opts && opts.dictionary);
126
- }
127
- function decompress(data, opts, cb) {
128
- if (!cb)
129
- cb = opts, opts = {};
130
- if (typeof cb != "function")
131
- err(7);
132
- return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzip(data, opts, cb) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflate(data, opts, cb) : unzlib(data, opts, cb);
133
- }
134
- function decompressSync(data, opts) {
135
- return data[0] == 31 && data[1] == 139 && data[2] == 8 ? gunzipSync(data, opts) : (data[0] & 15) != 8 || data[0] >> 4 > 7 || (data[0] << 8 | data[1]) % 31 ? inflateSync(data, opts) : unzlibSync(data, opts);
136
- }
137
- function strToU8(str, latin1) {
138
- if (latin1) {
139
- var ar_1 = new u8(str.length);
140
- for (var i2 = 0;i2 < str.length; ++i2)
141
- ar_1[i2] = str.charCodeAt(i2);
142
- return ar_1;
143
- }
144
- if (te)
145
- return te.encode(str);
146
- var l = str.length;
147
- var ar = new u8(str.length + (str.length >> 1));
148
- var ai = 0;
149
- var w = function(v) {
150
- ar[ai++] = v;
151
- };
152
- for (var i2 = 0;i2 < l; ++i2) {
153
- if (ai + 5 > ar.length) {
154
- var n = new u8(ai + 8 + (l - i2 << 1));
155
- n.set(ar);
156
- ar = n;
157
- }
158
- var c = str.charCodeAt(i2);
159
- if (c < 128 || latin1)
160
- w(c);
161
- else if (c < 2048)
162
- w(192 | c >> 6), w(128 | c & 63);
163
- else if (c > 55295 && c < 57344)
164
- c = 65536 + (c & 1023 << 10) | str.charCodeAt(++i2) & 1023, w(240 | c >> 18), w(128 | c >> 12 & 63), w(128 | c >> 6 & 63), w(128 | c & 63);
165
- else
166
- w(224 | c >> 12), w(128 | c >> 6 & 63), w(128 | c & 63);
167
- }
168
- return slc(ar, 0, ai);
169
- }
170
- function strFromU8(dat, latin1) {
171
- if (latin1) {
172
- var r = "";
173
- for (var i2 = 0;i2 < dat.length; i2 += 16384)
174
- r += String.fromCharCode.apply(null, dat.subarray(i2, i2 + 16384));
175
- return r;
176
- } else if (td) {
177
- return td.decode(dat);
178
- } else {
179
- var _a2 = dutf8(dat), s = _a2.s, r = _a2.r;
180
- if (r.length)
181
- err(8);
182
- return s;
183
- }
184
- }
185
- function zip(data, opts, cb) {
186
- if (!cb)
187
- cb = opts, opts = {};
188
- if (typeof cb != "function")
189
- err(7);
190
- var r = {};
191
- fltn(data, "", r, opts);
192
- var k = Object.keys(r);
193
- var lft = k.length, o = 0, tot = 0;
194
- var slft = lft, files = new Array(lft);
195
- var term = [];
196
- var tAll = function() {
197
- for (var i3 = 0;i3 < term.length; ++i3)
198
- term[i3]();
199
- };
200
- var cbd = function(a, b) {
201
- mt(function() {
202
- cb(a, b);
203
- });
204
- };
205
- mt(function() {
206
- cbd = cb;
207
- });
208
- var cbf = function() {
209
- var out = new u8(tot + 22), oe = o, cdl = tot - o;
210
- tot = 0;
211
- for (var i3 = 0;i3 < slft; ++i3) {
212
- var f = files[i3];
213
- try {
214
- var l = f.c.length;
215
- wzh(out, tot, f, f.f, f.u, l);
216
- var badd = 30 + f.f.length + exfl(f.extra);
217
- var loc = tot + badd;
218
- out.set(f.c, loc);
219
- wzh(out, o, f, f.f, f.u, l, tot, f.m), o += 16 + badd + (f.m ? f.m.length : 0), tot = loc + l;
220
- } catch (e) {
221
- return cbd(e, null);
222
- }
223
- }
224
- wzf(out, o, files.length, cdl, oe);
225
- cbd(null, out);
226
- };
227
- if (!lft)
228
- cbf();
229
- var _loop_1 = function(i3) {
230
- var fn = k[i3];
231
- var _a2 = r[fn], file = _a2[0], p = _a2[1];
232
- var c = crc(), size = file.length;
233
- c.p(file);
234
- var f = strToU8(fn), s = f.length;
235
- var com = p.comment, m = com && strToU8(com), ms = m && m.length;
236
- var exl = exfl(p.extra);
237
- var compression = p.level == 0 ? 0 : 8;
238
- var cbl = function(e, d) {
239
- if (e) {
240
- tAll();
241
- cbd(e, null);
242
- } else {
243
- var l = d.length;
244
- files[i3] = mrg(p, {
245
- size,
246
- crc: c.d(),
247
- c: d,
248
- f,
249
- m,
250
- u: s != fn.length || m && com.length != ms,
251
- compression
252
- });
253
- o += 30 + s + exl + l;
254
- tot += 76 + 2 * (s + exl) + (ms || 0) + l;
255
- if (!--lft)
256
- cbf();
257
- }
258
- };
259
- if (s > 65535)
260
- cbl(err(11, 0, 1), null);
261
- if (!compression)
262
- cbl(null, file);
263
- else if (size < 160000) {
264
- try {
265
- cbl(null, deflateSync(file, p));
266
- } catch (e) {
267
- cbl(e, null);
268
- }
269
- } else
270
- term.push(deflate(file, p, cbl));
271
- };
272
- for (var i2 = 0;i2 < slft; ++i2) {
273
- _loop_1(i2);
274
- }
275
- return tAll;
276
- }
277
- function zipSync(data, opts) {
278
- if (!opts)
279
- opts = {};
280
- var r = {};
281
- var files = [];
282
- fltn(data, "", r, opts);
283
- var o = 0;
284
- var tot = 0;
285
- for (var fn in r) {
286
- var _a2 = r[fn], file = _a2[0], p = _a2[1];
287
- var compression = p.level == 0 ? 0 : 8;
288
- var f = strToU8(fn), s = f.length;
289
- var com = p.comment, m = com && strToU8(com), ms = m && m.length;
290
- var exl = exfl(p.extra);
291
- if (s > 65535)
292
- err(11);
293
- var d = compression ? deflateSync(file, p) : file, l = d.length;
294
- var c = crc();
295
- c.p(file);
296
- files.push(mrg(p, {
297
- size: file.length,
298
- crc: c.d(),
299
- c: d,
300
- f,
301
- m,
302
- u: s != fn.length || m && com.length != ms,
303
- o,
304
- compression
305
- }));
306
- o += 30 + s + exl + l;
307
- tot += 76 + 2 * (s + exl) + (ms || 0) + l;
308
- }
309
- var out = new u8(tot + 22), oe = o, cdl = tot - o;
310
- for (var i2 = 0;i2 < files.length; ++i2) {
311
- var f = files[i2];
312
- wzh(out, f.o, f, f.f, f.u, f.c.length);
313
- var badd = 30 + f.f.length + exfl(f.extra);
314
- out.set(f.c, f.o + badd);
315
- wzh(out, o, f, f.f, f.u, f.c.length, f.o, f.m), o += 16 + badd + (f.m ? f.m.length : 0);
316
- }
317
- wzf(out, o, files.length, cdl, oe);
318
- return out;
319
- }
320
- function unzip(data, opts, cb) {
321
- if (!cb)
322
- cb = opts, opts = {};
323
- if (typeof cb != "function")
324
- err(7);
325
- var term = [];
326
- var tAll = function() {
327
- for (var i3 = 0;i3 < term.length; ++i3)
328
- term[i3]();
329
- };
330
- var files = {};
331
- var cbd = function(a, b) {
332
- mt(function() {
333
- cb(a, b);
334
- });
335
- };
336
- mt(function() {
337
- cbd = cb;
338
- });
339
- var e = data.length - 22;
340
- for (;b4(data, e) != 101010256; --e) {
341
- if (!e || data.length - e > 65558) {
342
- cbd(err(13, 0, 1), null);
343
- return tAll;
344
- }
345
- }
346
- var lft = b2(data, e + 8);
347
- if (lft) {
348
- var c = lft;
349
- var o = b4(data, e + 16);
350
- var z = o == 4294967295 || c == 65535;
351
- if (z) {
352
- var ze = b4(data, e - 12);
353
- z = b4(data, ze) == 101075792;
354
- if (z) {
355
- c = lft = b4(data, ze + 32);
356
- o = b4(data, ze + 48);
357
- }
358
- }
359
- var fltr = opts && opts.filter;
360
- var _loop_3 = function(i3) {
361
- var _a2 = zh(data, o, z), c_1 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off);
362
- o = no;
363
- var cbl = function(e2, d) {
364
- if (e2) {
365
- tAll();
366
- cbd(e2, null);
367
- } else {
368
- if (d)
369
- files[fn] = d;
370
- if (!--lft)
371
- cbd(null, files);
372
- }
373
- };
374
- if (!fltr || fltr({
375
- name: fn,
376
- size: sc,
377
- originalSize: su,
378
- compression: c_1
379
- })) {
380
- if (!c_1)
381
- cbl(null, slc(data, b, b + sc));
382
- else if (c_1 == 8) {
383
- var infl = data.subarray(b, b + sc);
384
- if (su < 524288 || sc > 0.8 * su) {
385
- try {
386
- cbl(null, inflateSync(infl, { out: new u8(su) }));
387
- } catch (e2) {
388
- cbl(e2, null);
389
- }
390
- } else
391
- term.push(inflate(infl, { size: su }, cbl));
392
- } else
393
- cbl(err(14, "unknown compression type " + c_1, 1), null);
394
- } else
395
- cbl(null, null);
396
- };
397
- for (var i2 = 0;i2 < c; ++i2) {
398
- _loop_3(i2);
399
- }
400
- } else
401
- cbd(null, {});
402
- return tAll;
403
- }
404
- function unzipSync(data, opts) {
405
- var files = {};
406
- var e = data.length - 22;
407
- for (;b4(data, e) != 101010256; --e) {
408
- if (!e || data.length - e > 65558)
409
- err(13);
410
- }
411
- var c = b2(data, e + 8);
412
- if (!c)
413
- return {};
414
- var o = b4(data, e + 16);
415
- var z = o == 4294967295 || c == 65535;
416
- if (z) {
417
- var ze = b4(data, e - 12);
418
- z = b4(data, ze) == 101075792;
419
- if (z) {
420
- c = b4(data, ze + 32);
421
- o = b4(data, ze + 48);
422
- }
423
- }
424
- var fltr = opts && opts.filter;
425
- for (var i2 = 0;i2 < c; ++i2) {
426
- var _a2 = zh(data, o, z), c_2 = _a2[0], sc = _a2[1], su = _a2[2], fn = _a2[3], no = _a2[4], off = _a2[5], b = slzh(data, off);
427
- o = no;
428
- if (!fltr || fltr({
429
- name: fn,
430
- size: sc,
431
- originalSize: su,
432
- compression: c_2
433
- })) {
434
- if (!c_2)
435
- files[fn] = slc(data, b, b + sc);
436
- else if (c_2 == 8)
437
- files[fn] = inflateSync(data.subarray(b, b + sc), { out: new u8(su) });
438
- else
439
- err(14, "unknown compression type " + c_2);
440
- }
441
- }
442
- return files;
443
- }
444
- var require2, Worker, workerAdd = ";var __w=require('worker_threads');__w.parentPort.on('message',function(m){onmessage({data:m})}),postMessage=function(m,t){__w.parentPort.postMessage(m,t)},close=process.exit;self=global", wk, u8, u16, i32, fleb, fdeb, clim, freb = function(eb, start) {
445
- var b = new u16(31);
446
- for (var i = 0;i < 31; ++i) {
447
- b[i] = start += 1 << eb[i - 1];
448
- }
449
- var r = new i32(b[30]);
450
- for (var i = 1;i < 30; ++i) {
451
- for (var j = b[i];j < b[i + 1]; ++j) {
452
- r[j] = j - b[i] << 5 | i;
453
- }
454
- }
455
- return { b, r };
456
- }, _a, fl, revfl, _b, fd, revfd, rev, x, i, hMap = function(cd, mb, r) {
457
- var s = cd.length;
458
- var i2 = 0;
459
- var l = new u16(mb);
460
- for (;i2 < s; ++i2) {
461
- if (cd[i2])
462
- ++l[cd[i2] - 1];
463
- }
464
- var le = new u16(mb);
465
- for (i2 = 1;i2 < mb; ++i2) {
466
- le[i2] = le[i2 - 1] + l[i2 - 1] << 1;
467
- }
468
- var co;
469
- if (r) {
470
- co = new u16(1 << mb);
471
- var rvb = 15 - mb;
472
- for (i2 = 0;i2 < s; ++i2) {
473
- if (cd[i2]) {
474
- var sv = i2 << 4 | cd[i2];
475
- var r_1 = mb - cd[i2];
476
- var v = le[cd[i2] - 1]++ << r_1;
477
- for (var m = v | (1 << r_1) - 1;v <= m; ++v) {
478
- co[rev[v] >> rvb] = sv;
479
- }
480
- }
481
- }
482
- } else {
483
- co = new u16(s);
484
- for (i2 = 0;i2 < s; ++i2) {
485
- if (cd[i2]) {
486
- co[i2] = rev[le[cd[i2] - 1]++] >> 15 - cd[i2];
487
- }
488
- }
489
- }
490
- return co;
491
- }, flt, i, i, i, i, fdt, i, flm, flrm, fdm, fdrm, max = function(a) {
492
- var m = a[0];
493
- for (var i2 = 1;i2 < a.length; ++i2) {
494
- if (a[i2] > m)
495
- m = a[i2];
496
- }
497
- return m;
498
- }, bits = function(d, p, m) {
499
- var o = p / 8 | 0;
500
- return (d[o] | d[o + 1] << 8) >> (p & 7) & m;
501
- }, bits16 = function(d, p) {
502
- var o = p / 8 | 0;
503
- return (d[o] | d[o + 1] << 8 | d[o + 2] << 16) >> (p & 7);
504
- }, shft = function(p) {
505
- return (p + 7) / 8 | 0;
506
- }, slc = function(v, s, e) {
507
- if (s == null || s < 0)
508
- s = 0;
509
- if (e == null || e > v.length)
510
- e = v.length;
511
- return new u8(v.subarray(s, e));
512
- }, FlateErrorCode, ec, err = function(ind, msg, nt) {
513
- var e = new Error(msg || ec[ind]);
514
- e.code = ind;
515
- if (Error.captureStackTrace)
516
- Error.captureStackTrace(e, err);
517
- if (!nt)
518
- throw e;
519
- return e;
520
- }, inflt = function(dat, st, buf, dict) {
521
- var sl = dat.length, dl = dict ? dict.length : 0;
522
- if (!sl || st.f && !st.l)
523
- return buf || new u8(0);
524
- var noBuf = !buf;
525
- var resize = noBuf || st.i != 2;
526
- var noSt = st.i;
527
- if (noBuf)
528
- buf = new u8(sl * 3);
529
- var cbuf = function(l2) {
530
- var bl = buf.length;
531
- if (l2 > bl) {
532
- var nbuf = new u8(Math.max(bl * 2, l2));
533
- nbuf.set(buf);
534
- buf = nbuf;
535
- }
536
- };
537
- var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
538
- var tbts = sl * 8;
539
- do {
540
- if (!lm) {
541
- final = bits(dat, pos, 1);
542
- var type = bits(dat, pos + 1, 3);
543
- pos += 3;
544
- if (!type) {
545
- var s = shft(pos) + 4, l = dat[s - 4] | dat[s - 3] << 8, t = s + l;
546
- if (t > sl) {
547
- if (noSt)
548
- err(0);
549
- break;
550
- }
551
- if (resize)
552
- cbuf(bt + l);
553
- buf.set(dat.subarray(s, t), bt);
554
- st.b = bt += l, st.p = pos = t * 8, st.f = final;
555
- continue;
556
- } else if (type == 1)
557
- lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
558
- else if (type == 2) {
559
- var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
560
- var tl = hLit + bits(dat, pos + 5, 31) + 1;
561
- pos += 14;
562
- var ldt = new u8(tl);
563
- var clt = new u8(19);
564
- for (var i2 = 0;i2 < hcLen; ++i2) {
565
- clt[clim[i2]] = bits(dat, pos + i2 * 3, 7);
566
- }
567
- pos += hcLen * 3;
568
- var clb = max(clt), clbmsk = (1 << clb) - 1;
569
- var clm = hMap(clt, clb, 1);
570
- for (var i2 = 0;i2 < tl; ) {
571
- var r = clm[bits(dat, pos, clbmsk)];
572
- pos += r & 15;
573
- var s = r >> 4;
574
- if (s < 16) {
575
- ldt[i2++] = s;
576
- } else {
577
- var c = 0, n = 0;
578
- if (s == 16)
579
- n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i2 - 1];
580
- else if (s == 17)
581
- n = 3 + bits(dat, pos, 7), pos += 3;
582
- else if (s == 18)
583
- n = 11 + bits(dat, pos, 127), pos += 7;
584
- while (n--)
585
- ldt[i2++] = c;
586
- }
587
- }
588
- var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
589
- lbt = max(lt);
590
- dbt = max(dt);
591
- lm = hMap(lt, lbt, 1);
592
- dm = hMap(dt, dbt, 1);
593
- } else
594
- err(1);
595
- if (pos > tbts) {
596
- if (noSt)
597
- err(0);
598
- break;
599
- }
600
- }
601
- if (resize)
602
- cbuf(bt + 131072);
603
- var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
604
- var lpos = pos;
605
- for (;; lpos = pos) {
606
- var c = lm[bits16(dat, pos) & lms], sym = c >> 4;
607
- pos += c & 15;
608
- if (pos > tbts) {
609
- if (noSt)
610
- err(0);
611
- break;
612
- }
613
- if (!c)
614
- err(2);
615
- if (sym < 256)
616
- buf[bt++] = sym;
617
- else if (sym == 256) {
618
- lpos = pos, lm = null;
619
- break;
620
- } else {
621
- var add = sym - 254;
622
- if (sym > 264) {
623
- var i2 = sym - 257, b = fleb[i2];
624
- add = bits(dat, pos, (1 << b) - 1) + fl[i2];
625
- pos += b;
626
- }
627
- var d = dm[bits16(dat, pos) & dms], dsym = d >> 4;
628
- if (!d)
629
- err(3);
630
- pos += d & 15;
631
- var dt = fd[dsym];
632
- if (dsym > 3) {
633
- var b = fdeb[dsym];
634
- dt += bits16(dat, pos) & (1 << b) - 1, pos += b;
635
- }
636
- if (pos > tbts) {
637
- if (noSt)
638
- err(0);
639
- break;
640
- }
641
- if (resize)
642
- cbuf(bt + 131072);
643
- var end = bt + add;
644
- if (bt < dt) {
645
- var shift = dl - dt, dend = Math.min(dt, end);
646
- if (shift + bt < 0)
647
- err(3);
648
- for (;bt < dend; ++bt)
649
- buf[bt] = dict[shift + bt];
650
- }
651
- for (;bt < end; ++bt)
652
- buf[bt] = buf[bt - dt];
653
- }
654
- }
655
- st.l = lm, st.p = lpos, st.b = bt, st.f = final;
656
- if (lm)
657
- final = 1, st.m = lbt, st.d = dm, st.n = dbt;
658
- } while (!final);
659
- return bt != buf.length && noBuf ? slc(buf, 0, bt) : buf.subarray(0, bt);
660
- }, wbits = function(d, p, v) {
661
- v <<= p & 7;
662
- var o = p / 8 | 0;
663
- d[o] |= v;
664
- d[o + 1] |= v >> 8;
665
- }, wbits16 = function(d, p, v) {
666
- v <<= p & 7;
667
- var o = p / 8 | 0;
668
- d[o] |= v;
669
- d[o + 1] |= v >> 8;
670
- d[o + 2] |= v >> 16;
671
- }, hTree = function(d, mb) {
672
- var t = [];
673
- for (var i2 = 0;i2 < d.length; ++i2) {
674
- if (d[i2])
675
- t.push({ s: i2, f: d[i2] });
676
- }
677
- var s = t.length;
678
- var t2 = t.slice();
679
- if (!s)
680
- return { t: et, l: 0 };
681
- if (s == 1) {
682
- var v = new u8(t[0].s + 1);
683
- v[t[0].s] = 1;
684
- return { t: v, l: 1 };
685
- }
686
- t.sort(function(a, b) {
687
- return a.f - b.f;
688
- });
689
- t.push({ s: -1, f: 25001 });
690
- var l = t[0], r = t[1], i0 = 0, i1 = 1, i22 = 2;
691
- t[0] = { s: -1, f: l.f + r.f, l, r };
692
- while (i1 != s - 1) {
693
- l = t[t[i0].f < t[i22].f ? i0++ : i22++];
694
- r = t[i0 != i1 && t[i0].f < t[i22].f ? i0++ : i22++];
695
- t[i1++] = { s: -1, f: l.f + r.f, l, r };
696
- }
697
- var maxSym = t2[0].s;
698
- for (var i2 = 1;i2 < s; ++i2) {
699
- if (t2[i2].s > maxSym)
700
- maxSym = t2[i2].s;
701
- }
702
- var tr = new u16(maxSym + 1);
703
- var mbt = ln(t[i1 - 1], tr, 0);
704
- if (mbt > mb) {
705
- var i2 = 0, dt = 0;
706
- var lft = mbt - mb, cst = 1 << lft;
707
- t2.sort(function(a, b) {
708
- return tr[b.s] - tr[a.s] || a.f - b.f;
709
- });
710
- for (;i2 < s; ++i2) {
711
- var i2_1 = t2[i2].s;
712
- if (tr[i2_1] > mb) {
713
- dt += cst - (1 << mbt - tr[i2_1]);
714
- tr[i2_1] = mb;
715
- } else
716
- break;
717
- }
718
- dt >>= lft;
719
- while (dt > 0) {
720
- var i2_2 = t2[i2].s;
721
- if (tr[i2_2] < mb)
722
- dt -= 1 << mb - tr[i2_2]++ - 1;
723
- else
724
- ++i2;
725
- }
726
- for (;i2 >= 0 && dt; --i2) {
727
- var i2_3 = t2[i2].s;
728
- if (tr[i2_3] == mb) {
729
- --tr[i2_3];
730
- ++dt;
731
- }
732
- }
733
- mbt = mb;
734
- }
735
- return { t: new u8(tr), l: mbt };
736
- }, ln = function(n, l, d) {
737
- return n.s == -1 ? Math.max(ln(n.l, l, d + 1), ln(n.r, l, d + 1)) : l[n.s] = d;
738
- }, lc = function(c) {
739
- var s = c.length;
740
- while (s && !c[--s])
741
- ;
742
- var cl = new u16(++s);
743
- var cli = 0, cln = c[0], cls = 1;
744
- var w = function(v) {
745
- cl[cli++] = v;
746
- };
747
- for (var i2 = 1;i2 <= s; ++i2) {
748
- if (c[i2] == cln && i2 != s)
749
- ++cls;
750
- else {
751
- if (!cln && cls > 2) {
752
- for (;cls > 138; cls -= 138)
753
- w(32754);
754
- if (cls > 2) {
755
- w(cls > 10 ? cls - 11 << 5 | 28690 : cls - 3 << 5 | 12305);
756
- cls = 0;
757
- }
758
- } else if (cls > 3) {
759
- w(cln), --cls;
760
- for (;cls > 6; cls -= 6)
761
- w(8304);
762
- if (cls > 2)
763
- w(cls - 3 << 5 | 8208), cls = 0;
764
- }
765
- while (cls--)
766
- w(cln);
767
- cls = 1;
768
- cln = c[i2];
769
- }
770
- }
771
- return { c: cl.subarray(0, cli), n: s };
772
- }, clen = function(cf, cl) {
773
- var l = 0;
774
- for (var i2 = 0;i2 < cl.length; ++i2)
775
- l += cf[i2] * cl[i2];
776
- return l;
777
- }, wfblk = function(out, pos, dat) {
778
- var s = dat.length;
779
- var o = shft(pos + 2);
780
- out[o] = s & 255;
781
- out[o + 1] = s >> 8;
782
- out[o + 2] = out[o] ^ 255;
783
- out[o + 3] = out[o + 1] ^ 255;
784
- for (var i2 = 0;i2 < s; ++i2)
785
- out[o + i2 + 4] = dat[i2];
786
- return (o + 4 + s) * 8;
787
- }, wblk = function(dat, out, final, syms, lf, df, eb, li, bs, bl, p) {
788
- wbits(out, p++, final);
789
- ++lf[256];
790
- var _a2 = hTree(lf, 15), dlt = _a2.t, mlb = _a2.l;
791
- var _b2 = hTree(df, 15), ddt = _b2.t, mdb = _b2.l;
792
- var _c = lc(dlt), lclt = _c.c, nlc = _c.n;
793
- var _d = lc(ddt), lcdt = _d.c, ndc = _d.n;
794
- var lcfreq = new u16(19);
795
- for (var i2 = 0;i2 < lclt.length; ++i2)
796
- ++lcfreq[lclt[i2] & 31];
797
- for (var i2 = 0;i2 < lcdt.length; ++i2)
798
- ++lcfreq[lcdt[i2] & 31];
799
- var _e = hTree(lcfreq, 7), lct = _e.t, mlcb = _e.l;
800
- var nlcc = 19;
801
- for (;nlcc > 4 && !lct[clim[nlcc - 1]]; --nlcc)
802
- ;
803
- var flen = bl + 5 << 3;
804
- var ftlen = clen(lf, flt) + clen(df, fdt) + eb;
805
- var dtlen = clen(lf, dlt) + clen(df, ddt) + eb + 14 + 3 * nlcc + clen(lcfreq, lct) + 2 * lcfreq[16] + 3 * lcfreq[17] + 7 * lcfreq[18];
806
- if (bs >= 0 && flen <= ftlen && flen <= dtlen)
807
- return wfblk(out, p, dat.subarray(bs, bs + bl));
808
- var lm, ll, dm, dl;
809
- wbits(out, p, 1 + (dtlen < ftlen)), p += 2;
810
- if (dtlen < ftlen) {
811
- lm = hMap(dlt, mlb, 0), ll = dlt, dm = hMap(ddt, mdb, 0), dl = ddt;
812
- var llm = hMap(lct, mlcb, 0);
813
- wbits(out, p, nlc - 257);
814
- wbits(out, p + 5, ndc - 1);
815
- wbits(out, p + 10, nlcc - 4);
816
- p += 14;
817
- for (var i2 = 0;i2 < nlcc; ++i2)
818
- wbits(out, p + 3 * i2, lct[clim[i2]]);
819
- p += 3 * nlcc;
820
- var lcts = [lclt, lcdt];
821
- for (var it = 0;it < 2; ++it) {
822
- var clct = lcts[it];
823
- for (var i2 = 0;i2 < clct.length; ++i2) {
824
- var len = clct[i2] & 31;
825
- wbits(out, p, llm[len]), p += lct[len];
826
- if (len > 15)
827
- wbits(out, p, clct[i2] >> 5 & 127), p += clct[i2] >> 12;
828
- }
829
- }
830
- } else {
831
- lm = flm, ll = flt, dm = fdm, dl = fdt;
832
- }
833
- for (var i2 = 0;i2 < li; ++i2) {
834
- var sym = syms[i2];
835
- if (sym > 255) {
836
- var len = sym >> 18 & 31;
837
- wbits16(out, p, lm[len + 257]), p += ll[len + 257];
838
- if (len > 7)
839
- wbits(out, p, sym >> 23 & 31), p += fleb[len];
840
- var dst = sym & 31;
841
- wbits16(out, p, dm[dst]), p += dl[dst];
842
- if (dst > 3)
843
- wbits16(out, p, sym >> 5 & 8191), p += fdeb[dst];
844
- } else {
845
- wbits16(out, p, lm[sym]), p += ll[sym];
846
- }
847
- }
848
- wbits16(out, p, lm[256]);
849
- return p + ll[256];
850
- }, deo, et, dflt = function(dat, lvl, plvl, pre, post, st) {
851
- var s = st.z || dat.length;
852
- var o = new u8(pre + s + 5 * (1 + Math.ceil(s / 7000)) + post);
853
- var w = o.subarray(pre, o.length - post);
854
- var lst = st.l;
855
- var pos = (st.r || 0) & 7;
856
- if (lvl) {
857
- if (pos)
858
- w[0] = st.r >> 3;
859
- var opt = deo[lvl - 1];
860
- var n = opt >> 13, c = opt & 8191;
861
- var msk_1 = (1 << plvl) - 1;
862
- var prev = st.p || new u16(32768), head = st.h || new u16(msk_1 + 1);
863
- var bs1_1 = Math.ceil(plvl / 3), bs2_1 = 2 * bs1_1;
864
- var hsh = function(i3) {
865
- return (dat[i3] ^ dat[i3 + 1] << bs1_1 ^ dat[i3 + 2] << bs2_1) & msk_1;
866
- };
867
- var syms = new i32(25000);
868
- var lf = new u16(288), df = new u16(32);
869
- var lc_1 = 0, eb = 0, i2 = st.i || 0, li = 0, wi = st.w || 0, bs = 0;
870
- for (;i2 + 2 < s; ++i2) {
871
- var hv = hsh(i2);
872
- var imod = i2 & 32767, pimod = head[hv];
873
- prev[imod] = pimod;
874
- head[hv] = imod;
875
- if (wi <= i2) {
876
- var rem = s - i2;
877
- if ((lc_1 > 7000 || li > 24576) && (rem > 423 || !lst)) {
878
- pos = wblk(dat, w, 0, syms, lf, df, eb, li, bs, i2 - bs, pos);
879
- li = lc_1 = eb = 0, bs = i2;
880
- for (var j = 0;j < 286; ++j)
881
- lf[j] = 0;
882
- for (var j = 0;j < 30; ++j)
883
- df[j] = 0;
884
- }
885
- var l = 2, d = 0, ch_1 = c, dif = imod - pimod & 32767;
886
- if (rem > 2 && hv == hsh(i2 - dif)) {
887
- var maxn = Math.min(n, rem) - 1;
888
- var maxd = Math.min(32767, i2);
889
- var ml = Math.min(258, rem);
890
- while (dif <= maxd && --ch_1 && imod != pimod) {
891
- if (dat[i2 + l] == dat[i2 + l - dif]) {
892
- var nl = 0;
893
- for (;nl < ml && dat[i2 + nl] == dat[i2 + nl - dif]; ++nl)
894
- ;
895
- if (nl > l) {
896
- l = nl, d = dif;
897
- if (nl > maxn)
898
- break;
899
- var mmd = Math.min(dif, nl - 2);
900
- var md = 0;
901
- for (var j = 0;j < mmd; ++j) {
902
- var ti = i2 - dif + j & 32767;
903
- var pti = prev[ti];
904
- var cd = ti - pti & 32767;
905
- if (cd > md)
906
- md = cd, pimod = ti;
907
- }
908
- }
909
- }
910
- imod = pimod, pimod = prev[imod];
911
- dif += imod - pimod & 32767;
912
- }
913
- }
914
- if (d) {
915
- syms[li++] = 268435456 | revfl[l] << 18 | revfd[d];
916
- var lin = revfl[l] & 31, din = revfd[d] & 31;
917
- eb += fleb[lin] + fdeb[din];
918
- ++lf[257 + lin];
919
- ++df[din];
920
- wi = i2 + l;
921
- ++lc_1;
922
- } else {
923
- syms[li++] = dat[i2];
924
- ++lf[dat[i2]];
925
- }
926
- }
927
- }
928
- for (i2 = Math.max(i2, wi);i2 < s; ++i2) {
929
- syms[li++] = dat[i2];
930
- ++lf[dat[i2]];
931
- }
932
- pos = wblk(dat, w, lst, syms, lf, df, eb, li, bs, i2 - bs, pos);
933
- if (!lst) {
934
- st.r = pos & 7 | w[pos / 8 | 0] << 3;
935
- pos -= 7;
936
- st.h = head, st.p = prev, st.i = i2, st.w = wi;
937
- }
938
- } else {
939
- for (var i2 = st.w || 0;i2 < s + lst; i2 += 65535) {
940
- var e = i2 + 65535;
941
- if (e >= s) {
942
- w[pos / 8 | 0] = lst;
943
- e = s;
944
- }
945
- pos = wfblk(w, pos + 1, dat.subarray(i2, e));
946
- }
947
- st.i = s;
948
- }
949
- return slc(o, 0, pre + shft(pos) + post);
950
- }, crct, crc = function() {
951
- var c = -1;
952
- return {
953
- p: function(d) {
954
- var cr = c;
955
- for (var i2 = 0;i2 < d.length; ++i2)
956
- cr = crct[cr & 255 ^ d[i2]] ^ cr >>> 8;
957
- c = cr;
958
- },
959
- d: function() {
960
- return ~c;
961
- }
962
- };
963
- }, adler = function() {
964
- var a = 1, b = 0;
965
- return {
966
- p: function(d) {
967
- var n = a, m = b;
968
- var l = d.length | 0;
969
- for (var i2 = 0;i2 != l; ) {
970
- var e = Math.min(i2 + 2655, l);
971
- for (;i2 < e; ++i2)
972
- m += n += d[i2];
973
- n = (n & 65535) + 15 * (n >> 16), m = (m & 65535) + 15 * (m >> 16);
974
- }
975
- a = n, b = m;
976
- },
977
- d: function() {
978
- a %= 65521, b %= 65521;
979
- return (a & 255) << 24 | (a & 65280) << 8 | (b & 255) << 8 | b >> 8;
980
- }
981
- };
982
- }, dopt = function(dat, opt, pre, post, st) {
983
- if (!st) {
984
- st = { l: 1 };
985
- if (opt.dictionary) {
986
- var dict = opt.dictionary.subarray(-32768);
987
- var newDat = new u8(dict.length + dat.length);
988
- newDat.set(dict);
989
- newDat.set(dat, dict.length);
990
- dat = newDat;
991
- st.w = dict.length;
992
- }
993
- }
994
- return dflt(dat, opt.level == null ? 6 : opt.level, opt.mem == null ? st.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(dat.length))) * 1.5) : 20 : 12 + opt.mem, pre, post, st);
995
- }, mrg = function(a, b) {
996
- var o = {};
997
- for (var k in a)
998
- o[k] = a[k];
999
- for (var k in b)
1000
- o[k] = b[k];
1001
- return o;
1002
- }, wcln = function(fn, fnStr, td) {
1003
- var dt = fn();
1004
- var st = fn.toString();
1005
- var ks = st.slice(st.indexOf("[") + 1, st.lastIndexOf("]")).replace(/\s+/g, "").split(",");
1006
- for (var i2 = 0;i2 < dt.length; ++i2) {
1007
- var v = dt[i2], k = ks[i2];
1008
- if (typeof v == "function") {
1009
- fnStr += ";" + k + "=";
1010
- var st_1 = v.toString();
1011
- if (v.prototype) {
1012
- if (st_1.indexOf("[native code]") != -1) {
1013
- var spInd = st_1.indexOf(" ", 8) + 1;
1014
- fnStr += st_1.slice(spInd, st_1.indexOf("(", spInd));
1015
- } else {
1016
- fnStr += st_1;
1017
- for (var t in v.prototype)
1018
- fnStr += ";" + k + ".prototype." + t + "=" + v.prototype[t].toString();
1019
- }
1020
- } else
1021
- fnStr += st_1;
1022
- } else
1023
- td[k] = v;
1024
- }
1025
- return fnStr;
1026
- }, ch, cbfs = function(v) {
1027
- var tl = [];
1028
- for (var k in v) {
1029
- if (v[k].buffer) {
1030
- tl.push((v[k] = new v[k].constructor(v[k])).buffer);
1031
- }
1032
- }
1033
- return tl;
1034
- }, wrkr = function(fns, init, id, cb) {
1035
- if (!ch[id]) {
1036
- var fnStr = "", td_1 = {}, m = fns.length - 1;
1037
- for (var i2 = 0;i2 < m; ++i2)
1038
- fnStr = wcln(fns[i2], fnStr, td_1);
1039
- ch[id] = { c: wcln(fns[m], fnStr, td_1), e: td_1 };
1040
- }
1041
- var td = mrg({}, ch[id].e);
1042
- return wk(ch[id].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + init.toString() + "}", id, td, cbfs(td), cb);
1043
- }, bInflt = function() {
1044
- return [u8, u16, i32, fleb, fdeb, clim, fl, fd, flrm, fdrm, rev, ec, hMap, max, bits, bits16, shft, slc, err, inflt, inflateSync, pbf, gopt];
1045
- }, bDflt = function() {
1046
- return [u8, u16, i32, fleb, fdeb, clim, revfl, revfd, flm, flt, fdm, fdt, rev, deo, et, hMap, wbits, wbits16, hTree, ln, lc, clen, wfblk, wblk, shft, slc, dflt, dopt, deflateSync, pbf];
1047
- }, gze = function() {
1048
- return [gzh, gzhl, wbytes, crc, crct];
1049
- }, guze = function() {
1050
- return [gzs, gzl];
1051
- }, zle = function() {
1052
- return [zlh, wbytes, adler];
1053
- }, zule = function() {
1054
- return [zls];
1055
- }, pbf = function(msg) {
1056
- return postMessage(msg, [msg.buffer]);
1057
- }, gopt = function(o) {
1058
- return o && {
1059
- out: o.size && new u8(o.size),
1060
- dictionary: o.dictionary
1061
- };
1062
- }, cbify = function(dat, opts, fns, init, id, cb) {
1063
- var w = wrkr(fns, init, id, function(err2, dat2) {
1064
- w.terminate();
1065
- cb(err2, dat2);
1066
- });
1067
- w.postMessage([dat, opts], opts.consume ? [dat.buffer] : []);
1068
- return function() {
1069
- w.terminate();
1070
- };
1071
- }, astrm = function(strm) {
1072
- strm.ondata = function(dat, final) {
1073
- return postMessage([dat, final], [dat.buffer]);
1074
- };
1075
- return function(ev) {
1076
- if (ev.data.length) {
1077
- strm.push(ev.data[0], ev.data[1]);
1078
- postMessage([ev.data[0].length]);
1079
- } else
1080
- strm.flush();
1081
- };
1082
- }, astrmify = function(fns, strm, opts, init, id, flush, ext) {
1083
- var t;
1084
- var w = wrkr(fns, init, id, function(err2, dat) {
1085
- if (err2)
1086
- w.terminate(), strm.ondata.call(strm, err2);
1087
- else if (!Array.isArray(dat))
1088
- ext(dat);
1089
- else if (dat.length == 1) {
1090
- strm.queuedSize -= dat[0];
1091
- if (strm.ondrain)
1092
- strm.ondrain(dat[0]);
1093
- } else {
1094
- if (dat[1])
1095
- w.terminate();
1096
- strm.ondata.call(strm, err2, dat[0], dat[1]);
1097
- }
1098
- });
1099
- w.postMessage(opts);
1100
- strm.queuedSize = 0;
1101
- strm.push = function(d, f) {
1102
- if (!strm.ondata)
1103
- err(5);
1104
- if (t)
1105
- strm.ondata(err(4, 0, 1), null, !!f);
1106
- strm.queuedSize += d.length;
1107
- w.postMessage([d, t = f], [d.buffer]);
1108
- };
1109
- strm.terminate = function() {
1110
- w.terminate();
1111
- };
1112
- if (flush) {
1113
- strm.flush = function() {
1114
- w.postMessage([]);
1115
- };
1116
- }
1117
- }, b2 = function(d, b) {
1118
- return d[b] | d[b + 1] << 8;
1119
- }, b4 = function(d, b) {
1120
- return (d[b] | d[b + 1] << 8 | d[b + 2] << 16 | d[b + 3] << 24) >>> 0;
1121
- }, b8 = function(d, b) {
1122
- return b4(d, b) + b4(d, b + 4) * 4294967296;
1123
- }, wbytes = function(d, b, v) {
1124
- for (;v; ++b)
1125
- d[b] = v, v >>>= 8;
1126
- }, gzh = function(c, o) {
1127
- var fn = o.filename;
1128
- c[0] = 31, c[1] = 139, c[2] = 8, c[8] = o.level < 2 ? 4 : o.level == 9 ? 2 : 0, c[9] = 3;
1129
- if (o.mtime != 0)
1130
- wbytes(c, 4, Math.floor(new Date(o.mtime || Date.now()) / 1000));
1131
- if (fn) {
1132
- c[3] = 8;
1133
- for (var i2 = 0;i2 <= fn.length; ++i2)
1134
- c[i2 + 10] = fn.charCodeAt(i2);
1135
- }
1136
- }, gzs = function(d) {
1137
- if (d[0] != 31 || d[1] != 139 || d[2] != 8)
1138
- err(6, "invalid gzip data");
1139
- var flg = d[3];
1140
- var st = 10;
1141
- if (flg & 4)
1142
- st += (d[10] | d[11] << 8) + 2;
1143
- for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1);zs > 0; zs -= !d[st++])
1144
- ;
1145
- return st + (flg & 2);
1146
- }, gzl = function(d) {
1147
- var l = d.length;
1148
- return (d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16 | d[l - 1] << 24) >>> 0;
1149
- }, gzhl = function(o) {
1150
- return 10 + (o.filename ? o.filename.length + 1 : 0);
1151
- }, zlh = function(c, o) {
1152
- var lv = o.level, fl2 = lv == 0 ? 0 : lv < 6 ? 1 : lv == 9 ? 3 : 2;
1153
- c[0] = 120, c[1] = fl2 << 6 | (o.dictionary && 32);
1154
- c[1] |= 31 - (c[0] << 8 | c[1]) % 31;
1155
- if (o.dictionary) {
1156
- var h = adler();
1157
- h.p(o.dictionary);
1158
- wbytes(c, 2, h.d());
1159
- }
1160
- }, zls = function(d, dict) {
1161
- if ((d[0] & 15) != 8 || d[0] >> 4 > 7 || (d[0] << 8 | d[1]) % 31)
1162
- err(6, "invalid zlib data");
1163
- if ((d[1] >> 5 & 1) == +!dict)
1164
- err(6, "invalid zlib data: " + (d[1] & 32 ? "need" : "unexpected") + " dictionary");
1165
- return (d[1] >> 3 & 4) + 2;
1166
- }, Deflate, AsyncDeflate, Inflate, AsyncInflate, Gzip, AsyncGzip, Gunzip, AsyncGunzip, Zlib, AsyncZlib, Unzlib, AsyncUnzlib, Decompress, AsyncDecompress, fltn = function(d, p, t, o) {
1167
- for (var k in d) {
1168
- var val = d[k], n = p + k, op = o;
1169
- if (Array.isArray(val))
1170
- op = mrg(o, val[1]), val = val[0];
1171
- if (val instanceof u8)
1172
- t[n] = [val, op];
1173
- else {
1174
- t[n += "/"] = [new u8(0), op];
1175
- fltn(val, n, t, o);
1176
- }
1177
- }
1178
- }, te, td, tds = 0, dutf8 = function(d) {
1179
- for (var r = "", i2 = 0;; ) {
1180
- var c = d[i2++];
1181
- var eb = (c > 127) + (c > 223) + (c > 239);
1182
- if (i2 + eb > d.length)
1183
- return { s: r, r: slc(d, i2 - 1) };
1184
- if (!eb)
1185
- r += String.fromCharCode(c);
1186
- else if (eb == 3) {
1187
- c = ((c & 15) << 18 | (d[i2++] & 63) << 12 | (d[i2++] & 63) << 6 | d[i2++] & 63) - 65536, r += String.fromCharCode(55296 | c >> 10, 56320 | c & 1023);
1188
- } else if (eb & 1)
1189
- r += String.fromCharCode((c & 31) << 6 | d[i2++] & 63);
1190
- else
1191
- r += String.fromCharCode((c & 15) << 12 | (d[i2++] & 63) << 6 | d[i2++] & 63);
1192
- }
1193
- }, DecodeUTF8, EncodeUTF8, dbf = function(l) {
1194
- return l == 1 ? 3 : l < 6 ? 2 : l == 9 ? 1 : 0;
1195
- }, slzh = function(d, b) {
1196
- return b + 30 + b2(d, b + 26) + b2(d, b + 28);
1197
- }, zh = function(d, b, z) {
1198
- var fnl = b2(d, b + 28), fn = strFromU8(d.subarray(b + 46, b + 46 + fnl), !(b2(d, b + 8) & 2048)), es = b + 46 + fnl, bs = b4(d, b + 20);
1199
- var _a2 = z && bs == 4294967295 ? z64e(d, es) : [bs, b4(d, b + 24), b4(d, b + 42)], sc = _a2[0], su = _a2[1], off = _a2[2];
1200
- return [b2(d, b + 10), sc, su, fn, es + b2(d, b + 30) + b2(d, b + 32), off];
1201
- }, z64e = function(d, b) {
1202
- for (;b2(d, b) != 1; b += 4 + b2(d, b + 2))
1203
- ;
1204
- return [b8(d, b + 12), b8(d, b + 4), b8(d, b + 20)];
1205
- }, exfl = function(ex) {
1206
- var le = 0;
1207
- if (ex) {
1208
- for (var k in ex) {
1209
- var l = ex[k].length;
1210
- if (l > 65535)
1211
- err(9);
1212
- le += l + 4;
1213
- }
1214
- }
1215
- return le;
1216
- }, wzh = function(d, b, f, fn, u, c, ce, co) {
1217
- var fl2 = fn.length, ex = f.extra, col = co && co.length;
1218
- var exl = exfl(ex);
1219
- wbytes(d, b, ce != null ? 33639248 : 67324752), b += 4;
1220
- if (ce != null)
1221
- d[b++] = 20, d[b++] = f.os;
1222
- d[b] = 20, b += 2;
1223
- d[b++] = f.flag << 1 | (c < 0 && 8), d[b++] = u && 8;
1224
- d[b++] = f.compression & 255, d[b++] = f.compression >> 8;
1225
- var dt = new Date(f.mtime == null ? Date.now() : f.mtime), y = dt.getFullYear() - 1980;
1226
- if (y < 0 || y > 119)
1227
- err(10);
1228
- wbytes(d, b, y << 25 | dt.getMonth() + 1 << 21 | dt.getDate() << 16 | dt.getHours() << 11 | dt.getMinutes() << 5 | dt.getSeconds() >> 1), b += 4;
1229
- if (c != -1) {
1230
- wbytes(d, b, f.crc);
1231
- wbytes(d, b + 4, c < 0 ? -c - 2 : c);
1232
- wbytes(d, b + 8, f.size);
1233
- }
1234
- wbytes(d, b + 12, fl2);
1235
- wbytes(d, b + 14, exl), b += 16;
1236
- if (ce != null) {
1237
- wbytes(d, b, col);
1238
- wbytes(d, b + 6, f.attrs);
1239
- wbytes(d, b + 10, ce), b += 14;
1240
- }
1241
- d.set(fn, b);
1242
- b += fl2;
1243
- if (exl) {
1244
- for (var k in ex) {
1245
- var exf = ex[k], l = exf.length;
1246
- wbytes(d, b, +k);
1247
- wbytes(d, b + 2, l);
1248
- d.set(exf, b + 4), b += 4 + l;
1249
- }
1250
- }
1251
- if (col)
1252
- d.set(co, b), b += col;
1253
- return b;
1254
- }, wzf = function(o, b, c, d, e) {
1255
- wbytes(o, b, 101010256);
1256
- wbytes(o, b + 8, c);
1257
- wbytes(o, b + 10, c);
1258
- wbytes(o, b + 12, d);
1259
- wbytes(o, b + 16, e);
1260
- }, ZipPassThrough, ZipDeflate, AsyncZipDeflate, Zip, UnzipPassThrough, UnzipInflate, AsyncUnzipInflate, Unzip, mt;
1261
- var init_esm = __esm(() => {
1262
- require2 = createRequire("/");
1263
- try {
1264
- Worker = require2("worker_threads").Worker;
1265
- } catch (e) {}
1266
- wk = Worker ? function(c, _, msg, transfer, cb) {
1267
- var done = false;
1268
- var w = new Worker(c + workerAdd, { eval: true }).on("error", function(e) {
1269
- return cb(e, null);
1270
- }).on("message", function(m) {
1271
- return cb(null, m);
1272
- }).on("exit", function(c2) {
1273
- if (c2 && !done)
1274
- cb(new Error("exited with code " + c2), null);
1275
- });
1276
- w.postMessage(msg, transfer);
1277
- w.terminate = function() {
1278
- done = true;
1279
- return Worker.prototype.terminate.call(w);
1280
- };
1281
- return w;
1282
- } : function(_, __, ___, ____, cb) {
1283
- setImmediate(function() {
1284
- return cb(new Error("async operations unsupported - update to Node 12+ (or Node 10-11 with the --experimental-worker CLI flag)"), null);
1285
- });
1286
- var NOP = function() {};
1287
- return {
1288
- terminate: NOP,
1289
- postMessage: NOP
1290
- };
1291
- };
1292
- u8 = Uint8Array;
1293
- u16 = Uint16Array;
1294
- i32 = Int32Array;
1295
- fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0]);
1296
- fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0]);
1297
- clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
1298
- _a = freb(fleb, 2);
1299
- fl = _a.b;
1300
- revfl = _a.r;
1301
- fl[28] = 258, revfl[258] = 28;
1302
- _b = freb(fdeb, 0);
1303
- fd = _b.b;
1304
- revfd = _b.r;
1305
- rev = new u16(32768);
1306
- for (i = 0;i < 32768; ++i) {
1307
- x = (i & 43690) >> 1 | (i & 21845) << 1;
1308
- x = (x & 52428) >> 2 | (x & 13107) << 2;
1309
- x = (x & 61680) >> 4 | (x & 3855) << 4;
1310
- rev[i] = ((x & 65280) >> 8 | (x & 255) << 8) >> 1;
1311
- }
1312
- flt = new u8(288);
1313
- for (i = 0;i < 144; ++i)
1314
- flt[i] = 8;
1315
- for (i = 144;i < 256; ++i)
1316
- flt[i] = 9;
1317
- for (i = 256;i < 280; ++i)
1318
- flt[i] = 7;
1319
- for (i = 280;i < 288; ++i)
1320
- flt[i] = 8;
1321
- fdt = new u8(32);
1322
- for (i = 0;i < 32; ++i)
1323
- fdt[i] = 5;
1324
- flm = /* @__PURE__ */ hMap(flt, 9, 0);
1325
- flrm = /* @__PURE__ */ hMap(flt, 9, 1);
1326
- fdm = /* @__PURE__ */ hMap(fdt, 5, 0);
1327
- fdrm = /* @__PURE__ */ hMap(fdt, 5, 1);
1328
- FlateErrorCode = {
1329
- UnexpectedEOF: 0,
1330
- InvalidBlockType: 1,
1331
- InvalidLengthLiteral: 2,
1332
- InvalidDistance: 3,
1333
- StreamFinished: 4,
1334
- NoStreamHandler: 5,
1335
- InvalidHeader: 6,
1336
- NoCallback: 7,
1337
- InvalidUTF8: 8,
1338
- ExtraFieldTooLong: 9,
1339
- InvalidDate: 10,
1340
- FilenameTooLong: 11,
1341
- StreamFinishing: 12,
1342
- InvalidZipData: 13,
1343
- UnknownCompressionMethod: 14
1344
- };
1345
- ec = [
1346
- "unexpected EOF",
1347
- "invalid block type",
1348
- "invalid length/literal",
1349
- "invalid distance",
1350
- "stream finished",
1351
- "no stream handler",
1352
- ,
1353
- "no callback",
1354
- "invalid UTF-8 data",
1355
- "extra field too long",
1356
- "date not in range 1980-2099",
1357
- "filename too long",
1358
- "stream finishing",
1359
- "invalid zip data"
1360
- ];
1361
- deo = /* @__PURE__ */ new i32([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]);
1362
- et = /* @__PURE__ */ new u8(0);
1363
- crct = /* @__PURE__ */ function() {
1364
- var t = new Int32Array(256);
1365
- for (var i2 = 0;i2 < 256; ++i2) {
1366
- var c = i2, k = 9;
1367
- while (--k)
1368
- c = (c & 1 && -306674912) ^ c >>> 1;
1369
- t[i2] = c;
1370
- }
1371
- return t;
1372
- }();
1373
- ch = [];
1374
- Deflate = /* @__PURE__ */ function() {
1375
- function Deflate2(opts, cb) {
1376
- if (typeof opts == "function")
1377
- cb = opts, opts = {};
1378
- this.ondata = cb;
1379
- this.o = opts || {};
1380
- this.s = { l: 0, i: 32768, w: 32768, z: 32768 };
1381
- this.b = new u8(98304);
1382
- if (this.o.dictionary) {
1383
- var dict = this.o.dictionary.subarray(-32768);
1384
- this.b.set(dict, 32768 - dict.length);
1385
- this.s.i = 32768 - dict.length;
1386
- }
1387
- }
1388
- Deflate2.prototype.p = function(c, f) {
1389
- this.ondata(dopt(c, this.o, 0, 0, this.s), f);
1390
- };
1391
- Deflate2.prototype.push = function(chunk, final) {
1392
- if (!this.ondata)
1393
- err(5);
1394
- if (this.s.l)
1395
- err(4);
1396
- var endLen = chunk.length + this.s.z;
1397
- if (endLen > this.b.length) {
1398
- if (endLen > 2 * this.b.length - 32768) {
1399
- var newBuf = new u8(endLen & -32768);
1400
- newBuf.set(this.b.subarray(0, this.s.z));
1401
- this.b = newBuf;
1402
- }
1403
- var split = this.b.length - this.s.z;
1404
- this.b.set(chunk.subarray(0, split), this.s.z);
1405
- this.s.z = this.b.length;
1406
- this.p(this.b, false);
1407
- this.b.set(this.b.subarray(-32768));
1408
- this.b.set(chunk.subarray(split), 32768);
1409
- this.s.z = chunk.length - split + 32768;
1410
- this.s.i = 32766, this.s.w = 32768;
1411
- } else {
1412
- this.b.set(chunk, this.s.z);
1413
- this.s.z += chunk.length;
1414
- }
1415
- this.s.l = final & 1;
1416
- if (this.s.z > this.s.w + 8191 || final) {
1417
- this.p(this.b, final || false);
1418
- this.s.w = this.s.i, this.s.i -= 2;
1419
- }
1420
- };
1421
- Deflate2.prototype.flush = function() {
1422
- if (!this.ondata)
1423
- err(5);
1424
- if (this.s.l)
1425
- err(4);
1426
- this.p(this.b, false);
1427
- this.s.w = this.s.i, this.s.i -= 2;
1428
- };
1429
- return Deflate2;
1430
- }();
1431
- AsyncDeflate = /* @__PURE__ */ function() {
1432
- function AsyncDeflate2(opts, cb) {
1433
- astrmify([
1434
- bDflt,
1435
- function() {
1436
- return [astrm, Deflate];
1437
- }
1438
- ], this, StrmOpt.call(this, opts, cb), function(ev) {
1439
- var strm = new Deflate(ev.data);
1440
- onmessage = astrm(strm);
1441
- }, 6, 1);
1442
- }
1443
- return AsyncDeflate2;
1444
- }();
1445
- Inflate = /* @__PURE__ */ function() {
1446
- function Inflate2(opts, cb) {
1447
- if (typeof opts == "function")
1448
- cb = opts, opts = {};
1449
- this.ondata = cb;
1450
- var dict = opts && opts.dictionary && opts.dictionary.subarray(-32768);
1451
- this.s = { i: 0, b: dict ? dict.length : 0 };
1452
- this.o = new u8(32768);
1453
- this.p = new u8(0);
1454
- if (dict)
1455
- this.o.set(dict);
1456
- }
1457
- Inflate2.prototype.e = function(c) {
1458
- if (!this.ondata)
1459
- err(5);
1460
- if (this.d)
1461
- err(4);
1462
- if (!this.p.length)
1463
- this.p = c;
1464
- else if (c.length) {
1465
- var n = new u8(this.p.length + c.length);
1466
- n.set(this.p), n.set(c, this.p.length), this.p = n;
1467
- }
1468
- };
1469
- Inflate2.prototype.c = function(final) {
1470
- this.s.i = +(this.d = final || false);
1471
- var bts = this.s.b;
1472
- var dt = inflt(this.p, this.s, this.o);
1473
- this.ondata(slc(dt, bts, this.s.b), this.d);
1474
- this.o = slc(dt, this.s.b - 32768), this.s.b = this.o.length;
1475
- this.p = slc(this.p, this.s.p / 8 | 0), this.s.p &= 7;
1476
- };
1477
- Inflate2.prototype.push = function(chunk, final) {
1478
- this.e(chunk), this.c(final);
1479
- };
1480
- return Inflate2;
1481
- }();
1482
- AsyncInflate = /* @__PURE__ */ function() {
1483
- function AsyncInflate2(opts, cb) {
1484
- astrmify([
1485
- bInflt,
1486
- function() {
1487
- return [astrm, Inflate];
1488
- }
1489
- ], this, StrmOpt.call(this, opts, cb), function(ev) {
1490
- var strm = new Inflate(ev.data);
1491
- onmessage = astrm(strm);
1492
- }, 7, 0);
1493
- }
1494
- return AsyncInflate2;
1495
- }();
1496
- Gzip = /* @__PURE__ */ function() {
1497
- function Gzip2(opts, cb) {
1498
- this.c = crc();
1499
- this.l = 0;
1500
- this.v = 1;
1501
- Deflate.call(this, opts, cb);
1502
- }
1503
- Gzip2.prototype.push = function(chunk, final) {
1504
- this.c.p(chunk);
1505
- this.l += chunk.length;
1506
- Deflate.prototype.push.call(this, chunk, final);
1507
- };
1508
- Gzip2.prototype.p = function(c, f) {
1509
- var raw = dopt(c, this.o, this.v && gzhl(this.o), f && 8, this.s);
1510
- if (this.v)
1511
- gzh(raw, this.o), this.v = 0;
1512
- if (f)
1513
- wbytes(raw, raw.length - 8, this.c.d()), wbytes(raw, raw.length - 4, this.l);
1514
- this.ondata(raw, f);
1515
- };
1516
- Gzip2.prototype.flush = function() {
1517
- Deflate.prototype.flush.call(this);
1518
- };
1519
- return Gzip2;
1520
- }();
1521
- AsyncGzip = /* @__PURE__ */ function() {
1522
- function AsyncGzip2(opts, cb) {
1523
- astrmify([
1524
- bDflt,
1525
- gze,
1526
- function() {
1527
- return [astrm, Deflate, Gzip];
1528
- }
1529
- ], this, StrmOpt.call(this, opts, cb), function(ev) {
1530
- var strm = new Gzip(ev.data);
1531
- onmessage = astrm(strm);
1532
- }, 8, 1);
1533
- }
1534
- return AsyncGzip2;
1535
- }();
1536
- Gunzip = /* @__PURE__ */ function() {
1537
- function Gunzip2(opts, cb) {
1538
- this.v = 1;
1539
- this.r = 0;
1540
- Inflate.call(this, opts, cb);
1541
- }
1542
- Gunzip2.prototype.push = function(chunk, final) {
1543
- Inflate.prototype.e.call(this, chunk);
1544
- this.r += chunk.length;
1545
- if (this.v) {
1546
- var p = this.p.subarray(this.v - 1);
1547
- var s = p.length > 3 ? gzs(p) : 4;
1548
- if (s > p.length) {
1549
- if (!final)
1550
- return;
1551
- } else if (this.v > 1 && this.onmember) {
1552
- this.onmember(this.r - p.length);
1553
- }
1554
- this.p = p.subarray(s), this.v = 0;
1555
- }
1556
- Inflate.prototype.c.call(this, final);
1557
- if (this.s.f && !this.s.l && !final) {
1558
- this.v = shft(this.s.p) + 9;
1559
- this.s = { i: 0 };
1560
- this.o = new u8(0);
1561
- this.push(new u8(0), final);
1562
- }
1563
- };
1564
- return Gunzip2;
1565
- }();
1566
- AsyncGunzip = /* @__PURE__ */ function() {
1567
- function AsyncGunzip2(opts, cb) {
1568
- var _this = this;
1569
- astrmify([
1570
- bInflt,
1571
- guze,
1572
- function() {
1573
- return [astrm, Inflate, Gunzip];
1574
- }
1575
- ], this, StrmOpt.call(this, opts, cb), function(ev) {
1576
- var strm = new Gunzip(ev.data);
1577
- strm.onmember = function(offset) {
1578
- return postMessage(offset);
1579
- };
1580
- onmessage = astrm(strm);
1581
- }, 9, 0, function(offset) {
1582
- return _this.onmember && _this.onmember(offset);
1583
- });
1584
- }
1585
- return AsyncGunzip2;
1586
- }();
1587
- Zlib = /* @__PURE__ */ function() {
1588
- function Zlib2(opts, cb) {
1589
- this.c = adler();
1590
- this.v = 1;
1591
- Deflate.call(this, opts, cb);
1592
- }
1593
- Zlib2.prototype.push = function(chunk, final) {
1594
- this.c.p(chunk);
1595
- Deflate.prototype.push.call(this, chunk, final);
1596
- };
1597
- Zlib2.prototype.p = function(c, f) {
1598
- var raw = dopt(c, this.o, this.v && (this.o.dictionary ? 6 : 2), f && 4, this.s);
1599
- if (this.v)
1600
- zlh(raw, this.o), this.v = 0;
1601
- if (f)
1602
- wbytes(raw, raw.length - 4, this.c.d());
1603
- this.ondata(raw, f);
1604
- };
1605
- Zlib2.prototype.flush = function() {
1606
- Deflate.prototype.flush.call(this);
1607
- };
1608
- return Zlib2;
1609
- }();
1610
- AsyncZlib = /* @__PURE__ */ function() {
1611
- function AsyncZlib2(opts, cb) {
1612
- astrmify([
1613
- bDflt,
1614
- zle,
1615
- function() {
1616
- return [astrm, Deflate, Zlib];
1617
- }
1618
- ], this, StrmOpt.call(this, opts, cb), function(ev) {
1619
- var strm = new Zlib(ev.data);
1620
- onmessage = astrm(strm);
1621
- }, 10, 1);
1622
- }
1623
- return AsyncZlib2;
1624
- }();
1625
- Unzlib = /* @__PURE__ */ function() {
1626
- function Unzlib2(opts, cb) {
1627
- Inflate.call(this, opts, cb);
1628
- this.v = opts && opts.dictionary ? 2 : 1;
1629
- }
1630
- Unzlib2.prototype.push = function(chunk, final) {
1631
- Inflate.prototype.e.call(this, chunk);
1632
- if (this.v) {
1633
- if (this.p.length < 6 && !final)
1634
- return;
1635
- this.p = this.p.subarray(zls(this.p, this.v - 1)), this.v = 0;
1636
- }
1637
- if (final) {
1638
- if (this.p.length < 4)
1639
- err(6, "invalid zlib data");
1640
- this.p = this.p.subarray(0, -4);
1641
- }
1642
- Inflate.prototype.c.call(this, final);
1643
- };
1644
- return Unzlib2;
1645
- }();
1646
- AsyncUnzlib = /* @__PURE__ */ function() {
1647
- function AsyncUnzlib2(opts, cb) {
1648
- astrmify([
1649
- bInflt,
1650
- zule,
1651
- function() {
1652
- return [astrm, Inflate, Unzlib];
1653
- }
1654
- ], this, StrmOpt.call(this, opts, cb), function(ev) {
1655
- var strm = new Unzlib(ev.data);
1656
- onmessage = astrm(strm);
1657
- }, 11, 0);
1658
- }
1659
- return AsyncUnzlib2;
1660
- }();
1661
- Decompress = /* @__PURE__ */ function() {
1662
- function Decompress2(opts, cb) {
1663
- this.o = StrmOpt.call(this, opts, cb) || {};
1664
- this.G = Gunzip;
1665
- this.I = Inflate;
1666
- this.Z = Unzlib;
1667
- }
1668
- Decompress2.prototype.i = function() {
1669
- var _this = this;
1670
- this.s.ondata = function(dat, final) {
1671
- _this.ondata(dat, final);
1672
- };
1673
- };
1674
- Decompress2.prototype.push = function(chunk, final) {
1675
- if (!this.ondata)
1676
- err(5);
1677
- if (!this.s) {
1678
- if (this.p && this.p.length) {
1679
- var n = new u8(this.p.length + chunk.length);
1680
- n.set(this.p), n.set(chunk, this.p.length);
1681
- } else
1682
- this.p = chunk;
1683
- if (this.p.length > 2) {
1684
- this.s = this.p[0] == 31 && this.p[1] == 139 && this.p[2] == 8 ? new this.G(this.o) : (this.p[0] & 15) != 8 || this.p[0] >> 4 > 7 || (this.p[0] << 8 | this.p[1]) % 31 ? new this.I(this.o) : new this.Z(this.o);
1685
- this.i();
1686
- this.s.push(this.p, final);
1687
- this.p = null;
1688
- }
1689
- } else
1690
- this.s.push(chunk, final);
1691
- };
1692
- return Decompress2;
1693
- }();
1694
- AsyncDecompress = /* @__PURE__ */ function() {
1695
- function AsyncDecompress2(opts, cb) {
1696
- Decompress.call(this, opts, cb);
1697
- this.queuedSize = 0;
1698
- this.G = AsyncGunzip;
1699
- this.I = AsyncInflate;
1700
- this.Z = AsyncUnzlib;
1701
- }
1702
- AsyncDecompress2.prototype.i = function() {
1703
- var _this = this;
1704
- this.s.ondata = function(err2, dat, final) {
1705
- _this.ondata(err2, dat, final);
1706
- };
1707
- this.s.ondrain = function(size) {
1708
- _this.queuedSize -= size;
1709
- if (_this.ondrain)
1710
- _this.ondrain(size);
1711
- };
1712
- };
1713
- AsyncDecompress2.prototype.push = function(chunk, final) {
1714
- this.queuedSize += chunk.length;
1715
- Decompress.prototype.push.call(this, chunk, final);
1716
- };
1717
- return AsyncDecompress2;
1718
- }();
1719
- te = typeof TextEncoder != "undefined" && /* @__PURE__ */ new TextEncoder;
1720
- td = typeof TextDecoder != "undefined" && /* @__PURE__ */ new TextDecoder;
1721
- try {
1722
- td.decode(et, { stream: true });
1723
- tds = 1;
1724
- } catch (e) {}
1725
- DecodeUTF8 = /* @__PURE__ */ function() {
1726
- function DecodeUTF82(cb) {
1727
- this.ondata = cb;
1728
- if (tds)
1729
- this.t = new TextDecoder;
1730
- else
1731
- this.p = et;
1732
- }
1733
- DecodeUTF82.prototype.push = function(chunk, final) {
1734
- if (!this.ondata)
1735
- err(5);
1736
- final = !!final;
1737
- if (this.t) {
1738
- this.ondata(this.t.decode(chunk, { stream: true }), final);
1739
- if (final) {
1740
- if (this.t.decode().length)
1741
- err(8);
1742
- this.t = null;
1743
- }
1744
- return;
1745
- }
1746
- if (!this.p)
1747
- err(4);
1748
- var dat = new u8(this.p.length + chunk.length);
1749
- dat.set(this.p);
1750
- dat.set(chunk, this.p.length);
1751
- var _a2 = dutf8(dat), s = _a2.s, r = _a2.r;
1752
- if (final) {
1753
- if (r.length)
1754
- err(8);
1755
- this.p = null;
1756
- } else
1757
- this.p = r;
1758
- this.ondata(s, final);
1759
- };
1760
- return DecodeUTF82;
1761
- }();
1762
- EncodeUTF8 = /* @__PURE__ */ function() {
1763
- function EncodeUTF82(cb) {
1764
- this.ondata = cb;
1765
- }
1766
- EncodeUTF82.prototype.push = function(chunk, final) {
1767
- if (!this.ondata)
1768
- err(5);
1769
- if (this.d)
1770
- err(4);
1771
- this.ondata(strToU8(chunk), this.d = final || false);
1772
- };
1773
- return EncodeUTF82;
1774
- }();
1775
- ZipPassThrough = /* @__PURE__ */ function() {
1776
- function ZipPassThrough2(filename) {
1777
- this.filename = filename;
1778
- this.c = crc();
1779
- this.size = 0;
1780
- this.compression = 0;
1781
- }
1782
- ZipPassThrough2.prototype.process = function(chunk, final) {
1783
- this.ondata(null, chunk, final);
1784
- };
1785
- ZipPassThrough2.prototype.push = function(chunk, final) {
1786
- if (!this.ondata)
1787
- err(5);
1788
- this.c.p(chunk);
1789
- this.size += chunk.length;
1790
- if (final)
1791
- this.crc = this.c.d();
1792
- this.process(chunk, final || false);
1793
- };
1794
- return ZipPassThrough2;
1795
- }();
1796
- ZipDeflate = /* @__PURE__ */ function() {
1797
- function ZipDeflate2(filename, opts) {
1798
- var _this = this;
1799
- if (!opts)
1800
- opts = {};
1801
- ZipPassThrough.call(this, filename);
1802
- this.d = new Deflate(opts, function(dat, final) {
1803
- _this.ondata(null, dat, final);
1804
- });
1805
- this.compression = 8;
1806
- this.flag = dbf(opts.level);
1807
- }
1808
- ZipDeflate2.prototype.process = function(chunk, final) {
1809
- try {
1810
- this.d.push(chunk, final);
1811
- } catch (e) {
1812
- this.ondata(e, null, final);
1813
- }
1814
- };
1815
- ZipDeflate2.prototype.push = function(chunk, final) {
1816
- ZipPassThrough.prototype.push.call(this, chunk, final);
1817
- };
1818
- return ZipDeflate2;
1819
- }();
1820
- AsyncZipDeflate = /* @__PURE__ */ function() {
1821
- function AsyncZipDeflate2(filename, opts) {
1822
- var _this = this;
1823
- if (!opts)
1824
- opts = {};
1825
- ZipPassThrough.call(this, filename);
1826
- this.d = new AsyncDeflate(opts, function(err2, dat, final) {
1827
- _this.ondata(err2, dat, final);
1828
- });
1829
- this.compression = 8;
1830
- this.flag = dbf(opts.level);
1831
- this.terminate = this.d.terminate;
1832
- }
1833
- AsyncZipDeflate2.prototype.process = function(chunk, final) {
1834
- this.d.push(chunk, final);
1835
- };
1836
- AsyncZipDeflate2.prototype.push = function(chunk, final) {
1837
- ZipPassThrough.prototype.push.call(this, chunk, final);
1838
- };
1839
- return AsyncZipDeflate2;
1840
- }();
1841
- Zip = /* @__PURE__ */ function() {
1842
- function Zip2(cb) {
1843
- this.ondata = cb;
1844
- this.u = [];
1845
- this.d = 1;
1846
- }
1847
- Zip2.prototype.add = function(file) {
1848
- var _this = this;
1849
- if (!this.ondata)
1850
- err(5);
1851
- if (this.d & 2)
1852
- this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, false);
1853
- else {
1854
- var f = strToU8(file.filename), fl_1 = f.length;
1855
- var com = file.comment, o = com && strToU8(com);
1856
- var u = fl_1 != file.filename.length || o && com.length != o.length;
1857
- var hl_1 = fl_1 + exfl(file.extra) + 30;
1858
- if (fl_1 > 65535)
1859
- this.ondata(err(11, 0, 1), null, false);
1860
- var header = new u8(hl_1);
1861
- wzh(header, 0, file, f, u, -1);
1862
- var chks_1 = [header];
1863
- var pAll_1 = function() {
1864
- for (var _i = 0, chks_2 = chks_1;_i < chks_2.length; _i++) {
1865
- var chk = chks_2[_i];
1866
- _this.ondata(null, chk, false);
1867
- }
1868
- chks_1 = [];
1869
- };
1870
- var tr_1 = this.d;
1871
- this.d = 0;
1872
- var ind_1 = this.u.length;
1873
- var uf_1 = mrg(file, {
1874
- f,
1875
- u,
1876
- o,
1877
- t: function() {
1878
- if (file.terminate)
1879
- file.terminate();
1880
- },
1881
- r: function() {
1882
- pAll_1();
1883
- if (tr_1) {
1884
- var nxt = _this.u[ind_1 + 1];
1885
- if (nxt)
1886
- nxt.r();
1887
- else
1888
- _this.d = 1;
1889
- }
1890
- tr_1 = 1;
1891
- }
1892
- });
1893
- var cl_1 = 0;
1894
- file.ondata = function(err2, dat, final) {
1895
- if (err2) {
1896
- _this.ondata(err2, dat, final);
1897
- _this.terminate();
1898
- } else {
1899
- cl_1 += dat.length;
1900
- chks_1.push(dat);
1901
- if (final) {
1902
- var dd = new u8(16);
1903
- wbytes(dd, 0, 134695760);
1904
- wbytes(dd, 4, file.crc);
1905
- wbytes(dd, 8, cl_1);
1906
- wbytes(dd, 12, file.size);
1907
- chks_1.push(dd);
1908
- uf_1.c = cl_1, uf_1.b = hl_1 + cl_1 + 16, uf_1.crc = file.crc, uf_1.size = file.size;
1909
- if (tr_1)
1910
- uf_1.r();
1911
- tr_1 = 1;
1912
- } else if (tr_1)
1913
- pAll_1();
1914
- }
1915
- };
1916
- this.u.push(uf_1);
1917
- }
1918
- };
1919
- Zip2.prototype.end = function() {
1920
- var _this = this;
1921
- if (this.d & 2) {
1922
- this.ondata(err(4 + (this.d & 1) * 8, 0, 1), null, true);
1923
- return;
1924
- }
1925
- if (this.d)
1926
- this.e();
1927
- else
1928
- this.u.push({
1929
- r: function() {
1930
- if (!(_this.d & 1))
1931
- return;
1932
- _this.u.splice(-1, 1);
1933
- _this.e();
1934
- },
1935
- t: function() {}
1936
- });
1937
- this.d = 3;
1938
- };
1939
- Zip2.prototype.e = function() {
1940
- var bt = 0, l = 0, tl = 0;
1941
- for (var _i = 0, _a2 = this.u;_i < _a2.length; _i++) {
1942
- var f = _a2[_i];
1943
- tl += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0);
1944
- }
1945
- var out = new u8(tl + 22);
1946
- for (var _b2 = 0, _c = this.u;_b2 < _c.length; _b2++) {
1947
- var f = _c[_b2];
1948
- wzh(out, bt, f, f.f, f.u, -f.c - 2, l, f.o);
1949
- bt += 46 + f.f.length + exfl(f.extra) + (f.o ? f.o.length : 0), l += f.b;
1950
- }
1951
- wzf(out, bt, this.u.length, tl, l);
1952
- this.ondata(null, out, true);
1953
- this.d = 2;
1954
- };
1955
- Zip2.prototype.terminate = function() {
1956
- for (var _i = 0, _a2 = this.u;_i < _a2.length; _i++) {
1957
- var f = _a2[_i];
1958
- f.t();
1959
- }
1960
- this.d = 2;
1961
- };
1962
- return Zip2;
1963
- }();
1964
- UnzipPassThrough = /* @__PURE__ */ function() {
1965
- function UnzipPassThrough2() {}
1966
- UnzipPassThrough2.prototype.push = function(data, final) {
1967
- this.ondata(null, data, final);
1968
- };
1969
- UnzipPassThrough2.compression = 0;
1970
- return UnzipPassThrough2;
1971
- }();
1972
- UnzipInflate = /* @__PURE__ */ function() {
1973
- function UnzipInflate2() {
1974
- var _this = this;
1975
- this.i = new Inflate(function(dat, final) {
1976
- _this.ondata(null, dat, final);
1977
- });
1978
- }
1979
- UnzipInflate2.prototype.push = function(data, final) {
1980
- try {
1981
- this.i.push(data, final);
1982
- } catch (e) {
1983
- this.ondata(e, null, final);
1984
- }
1985
- };
1986
- UnzipInflate2.compression = 8;
1987
- return UnzipInflate2;
1988
- }();
1989
- AsyncUnzipInflate = /* @__PURE__ */ function() {
1990
- function AsyncUnzipInflate2(_, sz) {
1991
- var _this = this;
1992
- if (sz < 320000) {
1993
- this.i = new Inflate(function(dat, final) {
1994
- _this.ondata(null, dat, final);
1995
- });
1996
- } else {
1997
- this.i = new AsyncInflate(function(err2, dat, final) {
1998
- _this.ondata(err2, dat, final);
1999
- });
2000
- this.terminate = this.i.terminate;
2001
- }
2002
- }
2003
- AsyncUnzipInflate2.prototype.push = function(data, final) {
2004
- if (this.i.terminate)
2005
- data = slc(data, 0);
2006
- this.i.push(data, final);
2007
- };
2008
- AsyncUnzipInflate2.compression = 8;
2009
- return AsyncUnzipInflate2;
2010
- }();
2011
- Unzip = /* @__PURE__ */ function() {
2012
- function Unzip2(cb) {
2013
- this.onfile = cb;
2014
- this.k = [];
2015
- this.o = {
2016
- 0: UnzipPassThrough
2017
- };
2018
- this.p = et;
2019
- }
2020
- Unzip2.prototype.push = function(chunk, final) {
2021
- var _this = this;
2022
- if (!this.onfile)
2023
- err(5);
2024
- if (!this.p)
2025
- err(4);
2026
- if (this.c > 0) {
2027
- var len = Math.min(this.c, chunk.length);
2028
- var toAdd = chunk.subarray(0, len);
2029
- this.c -= len;
2030
- if (this.d)
2031
- this.d.push(toAdd, !this.c);
2032
- else
2033
- this.k[0].push(toAdd);
2034
- chunk = chunk.subarray(len);
2035
- if (chunk.length)
2036
- return this.push(chunk, final);
2037
- } else {
2038
- var f = 0, i2 = 0, is = undefined, buf = undefined;
2039
- if (!this.p.length)
2040
- buf = chunk;
2041
- else if (!chunk.length)
2042
- buf = this.p;
2043
- else {
2044
- buf = new u8(this.p.length + chunk.length);
2045
- buf.set(this.p), buf.set(chunk, this.p.length);
2046
- }
2047
- var l = buf.length, oc = this.c, add = oc && this.d;
2048
- var _loop_2 = function() {
2049
- var _a2;
2050
- var sig = b4(buf, i2);
2051
- if (sig == 67324752) {
2052
- f = 1, is = i2;
2053
- this_1.d = null;
2054
- this_1.c = 0;
2055
- var bf = b2(buf, i2 + 6), cmp_1 = b2(buf, i2 + 8), u = bf & 2048, dd = bf & 8, fnl = b2(buf, i2 + 26), es = b2(buf, i2 + 28);
2056
- if (l > i2 + 30 + fnl + es) {
2057
- var chks_3 = [];
2058
- this_1.k.unshift(chks_3);
2059
- f = 2;
2060
- var sc_1 = b4(buf, i2 + 18), su_1 = b4(buf, i2 + 22);
2061
- var fn_1 = strFromU8(buf.subarray(i2 + 30, i2 += 30 + fnl), !u);
2062
- if (sc_1 == 4294967295) {
2063
- _a2 = dd ? [-2] : z64e(buf, i2), sc_1 = _a2[0], su_1 = _a2[1];
2064
- } else if (dd)
2065
- sc_1 = -1;
2066
- i2 += es;
2067
- this_1.c = sc_1;
2068
- var d_1;
2069
- var file_1 = {
2070
- name: fn_1,
2071
- compression: cmp_1,
2072
- start: function() {
2073
- if (!file_1.ondata)
2074
- err(5);
2075
- if (!sc_1)
2076
- file_1.ondata(null, et, true);
2077
- else {
2078
- var ctr = _this.o[cmp_1];
2079
- if (!ctr)
2080
- file_1.ondata(err(14, "unknown compression type " + cmp_1, 1), null, false);
2081
- d_1 = sc_1 < 0 ? new ctr(fn_1) : new ctr(fn_1, sc_1, su_1);
2082
- d_1.ondata = function(err2, dat3, final2) {
2083
- file_1.ondata(err2, dat3, final2);
2084
- };
2085
- for (var _i = 0, chks_4 = chks_3;_i < chks_4.length; _i++) {
2086
- var dat2 = chks_4[_i];
2087
- d_1.push(dat2, false);
2088
- }
2089
- if (_this.k[0] == chks_3 && _this.c)
2090
- _this.d = d_1;
2091
- else
2092
- d_1.push(et, true);
2093
- }
2094
- },
2095
- terminate: function() {
2096
- if (d_1 && d_1.terminate)
2097
- d_1.terminate();
2098
- }
2099
- };
2100
- if (sc_1 >= 0)
2101
- file_1.size = sc_1, file_1.originalSize = su_1;
2102
- this_1.onfile(file_1);
2103
- }
2104
- return "break";
2105
- } else if (oc) {
2106
- if (sig == 134695760) {
2107
- is = i2 += 12 + (oc == -2 && 8), f = 3, this_1.c = 0;
2108
- return "break";
2109
- } else if (sig == 33639248) {
2110
- is = i2 -= 4, f = 3, this_1.c = 0;
2111
- return "break";
2112
- }
2113
- }
2114
- };
2115
- var this_1 = this;
2116
- for (;i2 < l - 4; ++i2) {
2117
- var state_1 = _loop_2();
2118
- if (state_1 === "break")
2119
- break;
2120
- }
2121
- this.p = et;
2122
- if (oc < 0) {
2123
- var dat = f ? buf.subarray(0, is - 12 - (oc == -2 && 8) - (b4(buf, is - 16) == 134695760 && 4)) : buf.subarray(0, i2);
2124
- if (add)
2125
- add.push(dat, !!f);
2126
- else
2127
- this.k[+(f == 2)].push(dat);
2128
- }
2129
- if (f & 2)
2130
- return this.push(buf.subarray(i2), final);
2131
- this.p = buf.subarray(i2);
2132
- }
2133
- if (final) {
2134
- if (this.c)
2135
- err(13);
2136
- this.p = null;
2137
- }
2138
- };
2139
- Unzip2.prototype.register = function(decoder) {
2140
- this.o[decoder.compression] = decoder;
2141
- };
2142
- return Unzip2;
2143
- }();
2144
- mt = typeof queueMicrotask == "function" ? queueMicrotask : typeof setTimeout == "function" ? setTimeout : function(fn) {
2145
- fn();
2146
- };
2147
- });
2148
-
2149
- export { FlateErrorCode, Deflate, AsyncDeflate, deflate, deflateSync, Inflate, AsyncInflate, inflate, inflateSync, Gzip, AsyncGzip, gzip, gzipSync, Gunzip, AsyncGunzip, gunzip, gunzipSync, Zlib, AsyncZlib, zlib, zlibSync, Unzlib, AsyncUnzlib, unzlib, unzlibSync, Decompress, AsyncDecompress, decompress, decompressSync, DecodeUTF8, EncodeUTF8, strToU8, strFromU8, ZipPassThrough, ZipDeflate, AsyncZipDeflate, Zip, zip, zipSync, UnzipPassThrough, UnzipInflate, AsyncUnzipInflate, Unzip, unzip, unzipSync, init_esm };