jialing-code 1.1.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 (460) hide show
  1. package/README.md +97 -0
  2. package/dist/chunk-065m026w.js +97 -0
  3. package/dist/chunk-06saje2v.js +39 -0
  4. package/dist/chunk-0731m51q.js +8 -0
  5. package/dist/chunk-0975ccyw.js +265 -0
  6. package/dist/chunk-09n3fjx5.js +67 -0
  7. package/dist/chunk-0bdjdzew.js +41 -0
  8. package/dist/chunk-0ce6kd7y.js +212 -0
  9. package/dist/chunk-0e1xsncc.js +969 -0
  10. package/dist/chunk-0m2861gw.js +154 -0
  11. package/dist/chunk-0paqc2yw.js +15 -0
  12. package/dist/chunk-0rg6yrhy.js +99 -0
  13. package/dist/chunk-0sakxrcf.js +643 -0
  14. package/dist/chunk-0v9hwxvz.js +105 -0
  15. package/dist/chunk-0vkfrmqm.js +690 -0
  16. package/dist/chunk-0vvfnhhv.js +248 -0
  17. package/dist/chunk-0w4rsycj.js +145 -0
  18. package/dist/chunk-0x9b2nmd.js +63 -0
  19. package/dist/chunk-0xjaqda8.js +1124 -0
  20. package/dist/chunk-1141xmr4.js +8 -0
  21. package/dist/chunk-13d1842d.js +154 -0
  22. package/dist/chunk-1921a6yb.js +32 -0
  23. package/dist/chunk-1ad8mk9g.js +527 -0
  24. package/dist/chunk-1ax41pws.js +28 -0
  25. package/dist/chunk-1c8z1b5v.js +16 -0
  26. package/dist/chunk-1cbn5kxf.js +7 -0
  27. package/dist/chunk-1eapde8a.js +726 -0
  28. package/dist/chunk-1h2famwb.js +49 -0
  29. package/dist/chunk-1jggnf7z.js +85 -0
  30. package/dist/chunk-1k92pn9c.js +32 -0
  31. package/dist/chunk-1qakq4sn.js +802 -0
  32. package/dist/chunk-1rvz0433.js +722 -0
  33. package/dist/chunk-1xkekb9y.js +19 -0
  34. package/dist/chunk-238g70xa.js +36 -0
  35. package/dist/chunk-24ge0eqa.js +106 -0
  36. package/dist/chunk-278vghwm.js +5395 -0
  37. package/dist/chunk-27xc1csx.js +104 -0
  38. package/dist/chunk-2a42s11t.js +412 -0
  39. package/dist/chunk-2aa02aw6.js +438 -0
  40. package/dist/chunk-2eykm0j0.js +20 -0
  41. package/dist/chunk-2gzv8nrw.js +205 -0
  42. package/dist/chunk-2k995y2x.js +880 -0
  43. package/dist/chunk-2nayx6q1.js +63 -0
  44. package/dist/chunk-2sd2w2h4.js +44 -0
  45. package/dist/chunk-2tw2ve8h.js +145 -0
  46. package/dist/chunk-30rst83v.js +168 -0
  47. package/dist/chunk-3aavh06g.js +1581 -0
  48. package/dist/chunk-3b0yvt2h.js +469 -0
  49. package/dist/chunk-3be7ka25.js +56 -0
  50. package/dist/chunk-3c25bcsw.js +17 -0
  51. package/dist/chunk-3dyxka97.js +584 -0
  52. package/dist/chunk-3f7rypmf.js +16544 -0
  53. package/dist/chunk-3fsd7f51.js +93 -0
  54. package/dist/chunk-3gqdqmzb.js +75 -0
  55. package/dist/chunk-3h8a89gy.js +46 -0
  56. package/dist/chunk-3m84sret.js +71 -0
  57. package/dist/chunk-3nb7j3js.js +96 -0
  58. package/dist/chunk-3p08nvn2.js +98 -0
  59. package/dist/chunk-3r09htpc.js +318 -0
  60. package/dist/chunk-3r24h7t6.js +113 -0
  61. package/dist/chunk-3rkfxjtq.js +80 -0
  62. package/dist/chunk-3tmk7dc2.js +604 -0
  63. package/dist/chunk-3w6s9m5w.js +16 -0
  64. package/dist/chunk-43qjymy5.js +92 -0
  65. package/dist/chunk-44fpr6jq.js +434 -0
  66. package/dist/chunk-45kxdsp8.js +444 -0
  67. package/dist/chunk-495d85x1.js +8066 -0
  68. package/dist/chunk-4ba796se.js +1095 -0
  69. package/dist/chunk-4g3v8y12.js +23 -0
  70. package/dist/chunk-4h53xj8n.js +3445 -0
  71. package/dist/chunk-4jm600zv.js +13 -0
  72. package/dist/chunk-4jy9dtwk.js +116 -0
  73. package/dist/chunk-4p60dd45.js +55 -0
  74. package/dist/chunk-4z0jsrqg.js +81 -0
  75. package/dist/chunk-4zfkzkt6.js +37 -0
  76. package/dist/chunk-55wgxwa9.js +13877 -0
  77. package/dist/chunk-5dbk24zg.js +890 -0
  78. package/dist/chunk-5hzvp4va.js +115 -0
  79. package/dist/chunk-5kbt1mbt.js +500 -0
  80. package/dist/chunk-5pen7vr8.js +176 -0
  81. package/dist/chunk-5r280eng.js +198 -0
  82. package/dist/chunk-5srym52s.js +88 -0
  83. package/dist/chunk-600kg7k6.js +41 -0
  84. package/dist/chunk-616w0qj3.js +160 -0
  85. package/dist/chunk-62jw1t8c.js +94 -0
  86. package/dist/chunk-62xmt9mk.js +372 -0
  87. package/dist/chunk-64bvg7c3.js +229 -0
  88. package/dist/chunk-65yhe4s0.js +281 -0
  89. package/dist/chunk-6aewh27m.js +102 -0
  90. package/dist/chunk-6bd8brc4.js +48 -0
  91. package/dist/chunk-6dj5t602.js +341 -0
  92. package/dist/chunk-6exxdk1p.js +6956 -0
  93. package/dist/chunk-6f5j8fs0.js +752 -0
  94. package/dist/chunk-6g62sjpf.js +328 -0
  95. package/dist/chunk-6gecq2ta.js +1493 -0
  96. package/dist/chunk-6gr3c3w9.js +378 -0
  97. package/dist/chunk-6kpbgc5w.js +23 -0
  98. package/dist/chunk-6kseqw79.js +154 -0
  99. package/dist/chunk-6mxm1qd0.js +40764 -0
  100. package/dist/chunk-6n2qgm9v.js +8 -0
  101. package/dist/chunk-6tq2v3rk.js +186 -0
  102. package/dist/chunk-6wsdhj3v.js +93 -0
  103. package/dist/chunk-6zw9fhgb.js +4389 -0
  104. package/dist/chunk-71grc1mw.js +111 -0
  105. package/dist/chunk-73rpbt04.js +1947 -0
  106. package/dist/chunk-748feghg.js +604 -0
  107. package/dist/chunk-75e8gtg9.js +84 -0
  108. package/dist/chunk-75th4717.js +780 -0
  109. package/dist/chunk-760252na.js +101 -0
  110. package/dist/chunk-7739pg2c.js +4261 -0
  111. package/dist/chunk-778fnx46.js +472 -0
  112. package/dist/chunk-77g09znh.js +391 -0
  113. package/dist/chunk-7aw745vx.js +40175 -0
  114. package/dist/chunk-7m2nd8da.js +110 -0
  115. package/dist/chunk-7n35vjtw.js +444 -0
  116. package/dist/chunk-7n5ss4sh.js +144 -0
  117. package/dist/chunk-7rjnxcfe.js +107 -0
  118. package/dist/chunk-7sb5axvf.js +122 -0
  119. package/dist/chunk-7wm5s02e.js +216 -0
  120. package/dist/chunk-7ymfj7m3.js +151 -0
  121. package/dist/chunk-7z8j9qfn.js +121 -0
  122. package/dist/chunk-7zsapntc.js +216 -0
  123. package/dist/chunk-805fhkfh.js +908 -0
  124. package/dist/chunk-80k1nj24.js +253 -0
  125. package/dist/chunk-83hfzbx3.js +10 -0
  126. package/dist/chunk-85cypsdd.js +92 -0
  127. package/dist/chunk-8760caxf.js +2644 -0
  128. package/dist/chunk-88f6egg6.js +387 -0
  129. package/dist/chunk-88r7kwgj.js +22 -0
  130. package/dist/chunk-89e1v45e.js +463 -0
  131. package/dist/chunk-8bedvdm1.js +32 -0
  132. package/dist/chunk-8c4x4vdz.js +177 -0
  133. package/dist/chunk-8hq5kk3y.js +44 -0
  134. package/dist/chunk-8ngxagxq.js +18 -0
  135. package/dist/chunk-8tnsngw2.js +31 -0
  136. package/dist/chunk-8wjnca8h.js +307 -0
  137. package/dist/chunk-8y12jxg8.js +10 -0
  138. package/dist/chunk-8ymf4e6z.js +48 -0
  139. package/dist/chunk-90wp6wez.js +10510 -0
  140. package/dist/chunk-92bp5bnf.js +650 -0
  141. package/dist/chunk-92q8sx5z.js +90 -0
  142. package/dist/chunk-958rtmtx.js +10476 -0
  143. package/dist/chunk-9e2kqv5g.js +125 -0
  144. package/dist/chunk-9f4f1hy5.js +281 -0
  145. package/dist/chunk-9gbamk79.js +93 -0
  146. package/dist/chunk-9k5s3ryh.js +167 -0
  147. package/dist/chunk-9xzfqm15.js +97 -0
  148. package/dist/chunk-9zgdvbm6.js +110 -0
  149. package/dist/chunk-a0p3q8jw.js +24 -0
  150. package/dist/chunk-a22sayzp.js +220 -0
  151. package/dist/chunk-a8ejc632.js +3094 -0
  152. package/dist/chunk-a8gj9d9z.js +120 -0
  153. package/dist/chunk-a9vdeb6y.js +258 -0
  154. package/dist/chunk-a9yev47v.js +674 -0
  155. package/dist/chunk-a9zh40sj.js +48 -0
  156. package/dist/chunk-ack5mfba.js +105 -0
  157. package/dist/chunk-ae76ded0.js +30 -0
  158. package/dist/chunk-akjw4dh6.js +538 -0
  159. package/dist/chunk-asc6wz4q.js +1188 -0
  160. package/dist/chunk-atqejh3p.js +273 -0
  161. package/dist/chunk-atv2e6b7.js +61 -0
  162. package/dist/chunk-axvvkwz8.js +1551 -0
  163. package/dist/chunk-azgz7kj9.js +38 -0
  164. package/dist/chunk-b3zave8q.js +275 -0
  165. package/dist/chunk-b4wg70y1.js +54 -0
  166. package/dist/chunk-b8b13qn2.js +100 -0
  167. package/dist/chunk-bg3mt9bm.js +28 -0
  168. package/dist/chunk-bh4jvcjn.js +91 -0
  169. package/dist/chunk-bhdt6k7w.js +15 -0
  170. package/dist/chunk-bm1qb16p.js +17 -0
  171. package/dist/chunk-bpvsd1j1.js +266 -0
  172. package/dist/chunk-bqfnp99q.js +477 -0
  173. package/dist/chunk-bsbmmfyt.js +17 -0
  174. package/dist/chunk-bsbt34jm.js +42 -0
  175. package/dist/chunk-c78akdhr.js +458 -0
  176. package/dist/chunk-cdz5yb0r.js +57 -0
  177. package/dist/chunk-cfv996bs.js +22 -0
  178. package/dist/chunk-cgfdkzhb.js +12 -0
  179. package/dist/chunk-ckh4r5er.js +257 -0
  180. package/dist/chunk-cmgjnvn9.js +89 -0
  181. package/dist/chunk-cpjgvay8.js +687 -0
  182. package/dist/chunk-crfryjx9.js +276 -0
  183. package/dist/chunk-ctw5jwcd.js +213 -0
  184. package/dist/chunk-cvy3vntc.js +65 -0
  185. package/dist/chunk-cwbzz504.js +94 -0
  186. package/dist/chunk-cy2hswr1.js +15 -0
  187. package/dist/chunk-cyejkay3.js +222 -0
  188. package/dist/chunk-d18z9pna.js +106 -0
  189. package/dist/chunk-d5cq0n0v.js +162 -0
  190. package/dist/chunk-db45aryp.js +50 -0
  191. package/dist/chunk-de8nqh0z.js +790 -0
  192. package/dist/chunk-dfw6h350.js +2336 -0
  193. package/dist/chunk-dgqrcy74.js +48 -0
  194. package/dist/chunk-dn75ptgd.js +184 -0
  195. package/dist/chunk-dnh7jtpb.js +37 -0
  196. package/dist/chunk-dpshyv9m.js +90 -0
  197. package/dist/chunk-dt8cdvnm.js +642 -0
  198. package/dist/chunk-dtxby6fr.js +306 -0
  199. package/dist/chunk-dv1wfr85.js +6373 -0
  200. package/dist/chunk-dw363edx.js +1154 -0
  201. package/dist/chunk-dwrdacck.js +62 -0
  202. package/dist/chunk-dxnnv5e3.js +276 -0
  203. package/dist/chunk-e3g8q4cn.js +1646 -0
  204. package/dist/chunk-e3m9k9s2.js +542 -0
  205. package/dist/chunk-e4q49asn.js +155 -0
  206. package/dist/chunk-e5pntxye.js +37 -0
  207. package/dist/chunk-e7393td6.js +42 -0
  208. package/dist/chunk-ead42yrh.js +87 -0
  209. package/dist/chunk-eb90vwvr.js +152 -0
  210. package/dist/chunk-ecvwk9hg.js +250 -0
  211. package/dist/chunk-edjd6aay.js +173 -0
  212. package/dist/chunk-eg0h8mtm.js +130 -0
  213. package/dist/chunk-ehtwnxpg.js +1591 -0
  214. package/dist/chunk-ek686gx1.js +94 -0
  215. package/dist/chunk-eqp1rfft.js +17 -0
  216. package/dist/chunk-evhwt0ar.js +1015 -0
  217. package/dist/chunk-ewadzrm8.js +103 -0
  218. package/dist/chunk-ewsgsw9h.js +172291 -0
  219. package/dist/chunk-f0pa0r7e.js +3198 -0
  220. package/dist/chunk-f2mhrmww.js +62 -0
  221. package/dist/chunk-f39zxvwn.js +401 -0
  222. package/dist/chunk-f46z54tq.js +374 -0
  223. package/dist/chunk-f5ma3nh5.js +3436 -0
  224. package/dist/chunk-f60q23az.js +3038 -0
  225. package/dist/chunk-f6v2nz57.js +107 -0
  226. package/dist/chunk-f6yjan38.js +38 -0
  227. package/dist/chunk-fbv4apne.js +51 -0
  228. package/dist/chunk-fem4s778.js +70 -0
  229. package/dist/chunk-fezm1kn8.js +376 -0
  230. package/dist/chunk-fm1n3ysp.js +6108 -0
  231. package/dist/chunk-frg83bfw.js +225 -0
  232. package/dist/chunk-fscm8db0.js +692 -0
  233. package/dist/chunk-fyc5fepv.js +10 -0
  234. package/dist/chunk-g0j0t6qk.js +26 -0
  235. package/dist/chunk-g0nc1ftf.js +849 -0
  236. package/dist/chunk-g338npwr.js +1061 -0
  237. package/dist/chunk-g3t0act8.js +8 -0
  238. package/dist/chunk-g75w4hw3.js +26 -0
  239. package/dist/chunk-g8vp82en.js +1866 -0
  240. package/dist/chunk-gax0fcbx.js +182 -0
  241. package/dist/chunk-gsz4dh3y.js +606 -0
  242. package/dist/chunk-gtfffm7h.js +440 -0
  243. package/dist/chunk-gver9zb9.js +420 -0
  244. package/dist/chunk-gyj242zr.js +20 -0
  245. package/dist/chunk-h0qngp9w.js +157 -0
  246. package/dist/chunk-h14kemnk.js +123 -0
  247. package/dist/chunk-h8wj1a74.js +8960 -0
  248. package/dist/chunk-h9mcb2eg.js +87 -0
  249. package/dist/chunk-h9nh2980.js +91 -0
  250. package/dist/chunk-hakdhagh.js +16606 -0
  251. package/dist/chunk-hbc6ymdv.js +55 -0
  252. package/dist/chunk-hh7cmy4k.js +20 -0
  253. package/dist/chunk-hjhc4cpt.js +69 -0
  254. package/dist/chunk-hjwez8qc.js +5018 -0
  255. package/dist/chunk-hk9xz7gk.js +118 -0
  256. package/dist/chunk-hqmz36b3.js +552 -0
  257. package/dist/chunk-hrzerbfw.js +1299 -0
  258. package/dist/chunk-hs8ph4p8.js +8 -0
  259. package/dist/chunk-ht1xwrnd.js +716 -0
  260. package/dist/chunk-hvmfg2dc.js +338 -0
  261. package/dist/chunk-hx2tr4ep.js +7189 -0
  262. package/dist/chunk-hzhe8ygc.js +547 -0
  263. package/dist/chunk-j2k4p94p.js +55 -0
  264. package/dist/chunk-j3a4p81y.js +184 -0
  265. package/dist/chunk-j49g6g3s.js +57 -0
  266. package/dist/chunk-j5d5hp9h.js +71 -0
  267. package/dist/chunk-j64ga6ta.js +8035 -0
  268. package/dist/chunk-j7tyxan1.js +116 -0
  269. package/dist/chunk-j8v4774z.js +424 -0
  270. package/dist/chunk-jafes477.js +29 -0
  271. package/dist/chunk-jd32zbps.js +15 -0
  272. package/dist/chunk-jdgeec04.js +4249 -0
  273. package/dist/chunk-jftd4jq5.js +4521 -0
  274. package/dist/chunk-jkxqhv6y.js +812 -0
  275. package/dist/chunk-jmfr6h0n.js +120 -0
  276. package/dist/chunk-jn4aabmx.js +40 -0
  277. package/dist/chunk-jnhkref0.js +30 -0
  278. package/dist/chunk-jsbpm1gz.js +27 -0
  279. package/dist/chunk-jtcyjc3k.js +5802 -0
  280. package/dist/chunk-jx817w05.js +11 -0
  281. package/dist/chunk-jzmz18nn.js +65 -0
  282. package/dist/chunk-k0p9w03v.js +4957 -0
  283. package/dist/chunk-k3dcdnck.js +89 -0
  284. package/dist/chunk-k3wadzcd.js +88 -0
  285. package/dist/chunk-kaeshsk1.js +713 -0
  286. package/dist/chunk-kbkey9ed.js +522 -0
  287. package/dist/chunk-kcwfhqbb.js +196 -0
  288. package/dist/chunk-key6jr7p.js +224 -0
  289. package/dist/chunk-knay8cy9.js +173 -0
  290. package/dist/chunk-kr3rg2y1.js +95 -0
  291. package/dist/chunk-kwekc97v.js +18 -0
  292. package/dist/chunk-m06q12hg.js +61 -0
  293. package/dist/chunk-m2mcpbhk.js +43 -0
  294. package/dist/chunk-m8v220gz.js +71 -0
  295. package/dist/chunk-mgpqy78h.js +208 -0
  296. package/dist/chunk-mkejwh4t.js +16 -0
  297. package/dist/chunk-mptyw5n1.js +107 -0
  298. package/dist/chunk-mqajm0dp.js +66 -0
  299. package/dist/chunk-mrksbgxj.js +490 -0
  300. package/dist/chunk-msjfc5ba.js +246 -0
  301. package/dist/chunk-mt25echc.js +6157 -0
  302. package/dist/chunk-mt3jfnr8.js +277 -0
  303. package/dist/chunk-mtn242d4.js +9300 -0
  304. package/dist/chunk-mzfkvave.js +169 -0
  305. package/dist/chunk-n0qaeaa5.js +256 -0
  306. package/dist/chunk-n1erf6kh.js +22820 -0
  307. package/dist/chunk-n2avk1r2.js +61 -0
  308. package/dist/chunk-n6atnpcq.js +765 -0
  309. package/dist/chunk-n7ttdtk0.js +641 -0
  310. package/dist/chunk-ncnfzby5.js +822 -0
  311. package/dist/chunk-ncnr1jtf.js +2058 -0
  312. package/dist/chunk-nerv0jvx.js +74 -0
  313. package/dist/chunk-ngd2abep.js +90 -0
  314. package/dist/chunk-nka1g8f4.js +773 -0
  315. package/dist/chunk-nnaxkc2z.js +128 -0
  316. package/dist/chunk-npyrtj8j.js +691 -0
  317. package/dist/chunk-nq0fxyxh.js +752 -0
  318. package/dist/chunk-nrmffak7.js +114 -0
  319. package/dist/chunk-nsz546wq.js +1170 -0
  320. package/dist/chunk-nt837qt9.js +21 -0
  321. package/dist/chunk-nv64x1z5.js +86 -0
  322. package/dist/chunk-nxsh6de2.js +1711 -0
  323. package/dist/chunk-nz4getcr.js +40 -0
  324. package/dist/chunk-p1f607pa.js +83 -0
  325. package/dist/chunk-p2816w9z.js +1486 -0
  326. package/dist/chunk-p2d5nh3g.js +342 -0
  327. package/dist/chunk-p4r5y02t.js +90 -0
  328. package/dist/chunk-p7g7pf3f.js +336 -0
  329. package/dist/chunk-pb4ad8r2.js +110 -0
  330. package/dist/chunk-pbrhz0zr.js +716 -0
  331. package/dist/chunk-ps49ymvj.js +43 -0
  332. package/dist/chunk-pwnt3veb.js +103 -0
  333. package/dist/chunk-pwwa7s62.js +11 -0
  334. package/dist/chunk-px3w0kde.js +299 -0
  335. package/dist/chunk-pzn777jb.js +756 -0
  336. package/dist/chunk-q25bjaev.js +15 -0
  337. package/dist/chunk-q5by3da6.js +8 -0
  338. package/dist/chunk-q6av622g.js +38 -0
  339. package/dist/chunk-q6xkvtf2.js +1318 -0
  340. package/dist/chunk-q81jx1tq.js +476 -0
  341. package/dist/chunk-qehb6fk5.js +339 -0
  342. package/dist/chunk-qj1avx1q.js +87 -0
  343. package/dist/chunk-qn2dxr66.js +105 -0
  344. package/dist/chunk-qnfx3qtx.js +617 -0
  345. package/dist/chunk-qp18kd4h.js +48 -0
  346. package/dist/chunk-qp2qdcda.js +100 -0
  347. package/dist/chunk-qpjy9tcf.js +133 -0
  348. package/dist/chunk-qqfa0dqg.js +2343 -0
  349. package/dist/chunk-qwh3htcz.js +202 -0
  350. package/dist/chunk-qz2x630m.js +49145 -0
  351. package/dist/chunk-r3vakcs1.js +496 -0
  352. package/dist/chunk-r66hz8j6.js +34 -0
  353. package/dist/chunk-r6b58y3x.js +17 -0
  354. package/dist/chunk-rekp48rk.js +62 -0
  355. package/dist/chunk-rn0v1hk8.js +34 -0
  356. package/dist/chunk-rs1xrs6m.js +534 -0
  357. package/dist/chunk-rs45skes.js +123 -0
  358. package/dist/chunk-rzszqp82.js +524 -0
  359. package/dist/chunk-s274nv8k.js +8 -0
  360. package/dist/chunk-s3pzvdss.js +50 -0
  361. package/dist/chunk-s9mesaw0.js +26840 -0
  362. package/dist/chunk-sd36yzx8.js +954 -0
  363. package/dist/chunk-sdj9b9wh.js +782 -0
  364. package/dist/chunk-sdw2q69p.js +227 -0
  365. package/dist/chunk-sfgp9cc0.js +130 -0
  366. package/dist/chunk-spqaamnc.js +63 -0
  367. package/dist/chunk-spzrs4df.js +73 -0
  368. package/dist/chunk-sxkr7k43.js +55 -0
  369. package/dist/chunk-szj5wvdy.js +28 -0
  370. package/dist/chunk-t0rgmccj.js +39 -0
  371. package/dist/chunk-t1nnzjgg.js +17 -0
  372. package/dist/chunk-t94fcnt8.js +566 -0
  373. package/dist/chunk-tjaqa99q.js +125 -0
  374. package/dist/chunk-tjq2evtw.js +328 -0
  375. package/dist/chunk-ts2p6bv1.js +224 -0
  376. package/dist/chunk-ttk5dzz8.js +25 -0
  377. package/dist/chunk-tw0q7ynt.js +59 -0
  378. package/dist/chunk-v02jkvgy.js +131 -0
  379. package/dist/chunk-v084bqt3.js +1529 -0
  380. package/dist/chunk-v0amythm.js +164 -0
  381. package/dist/chunk-v1kzp02e.js +785 -0
  382. package/dist/chunk-v1mgv1et.js +15 -0
  383. package/dist/chunk-v399mzxk.js +58 -0
  384. package/dist/chunk-v3gm2day.js +8 -0
  385. package/dist/chunk-v43hrrxp.js +71 -0
  386. package/dist/chunk-v6aqb2aj.js +102 -0
  387. package/dist/chunk-v78fj8by.js +145 -0
  388. package/dist/chunk-v7qmhjdn.js +1921 -0
  389. package/dist/chunk-v9smspw2.js +4301 -0
  390. package/dist/chunk-vdw93s4h.js +2431 -0
  391. package/dist/chunk-vest0y6x.js +3830 -0
  392. package/dist/chunk-vf5sd1nq.js +12 -0
  393. package/dist/chunk-vratq94g.js +349 -0
  394. package/dist/chunk-vrz7t3m3.js +20 -0
  395. package/dist/chunk-vtb185z9.js +70 -0
  396. package/dist/chunk-vx01rvg8.js +654 -0
  397. package/dist/chunk-vyc0rjyx.js +31 -0
  398. package/dist/chunk-vyjeh50y.js +2149 -0
  399. package/dist/chunk-vzpffsza.js +269 -0
  400. package/dist/chunk-w2ef3kxk.js +3353 -0
  401. package/dist/chunk-w2z5pqd3.js +336 -0
  402. package/dist/chunk-w3whm4mn.js +432 -0
  403. package/dist/chunk-w7wgpqcp.js +157 -0
  404. package/dist/chunk-waa00cvb.js +301 -0
  405. package/dist/chunk-wb0qm4es.js +155 -0
  406. package/dist/chunk-wbkahkdc.js +27 -0
  407. package/dist/chunk-wfz0qffj.js +3939 -0
  408. package/dist/chunk-wn0cx0pt.js +283 -0
  409. package/dist/chunk-wv6gzt9c.js +726 -0
  410. package/dist/chunk-wx42ycm4.js +998 -0
  411. package/dist/chunk-wxkpgy05.js +268 -0
  412. package/dist/chunk-wzpdet3m.js +843 -0
  413. package/dist/chunk-x0mwzt38.js +714 -0
  414. package/dist/chunk-x592wbfh.js +244 -0
  415. package/dist/chunk-x5pqsp9r.js +100 -0
  416. package/dist/chunk-x679thag.js +825 -0
  417. package/dist/chunk-x8b7vft8.js +132 -0
  418. package/dist/chunk-x8cftch7.js +119 -0
  419. package/dist/chunk-x9q7r885.js +348 -0
  420. package/dist/chunk-xawkt0vb.js +1585 -0
  421. package/dist/chunk-xdw5dv00.js +8 -0
  422. package/dist/chunk-xe9cc860.js +287 -0
  423. package/dist/chunk-xjr9c3vt.js +101 -0
  424. package/dist/chunk-xk7zaqta.js +21933 -0
  425. package/dist/chunk-xktbmawc.js +678 -0
  426. package/dist/chunk-xn6yw46v.js +140 -0
  427. package/dist/chunk-xsq9ae7x.js +90 -0
  428. package/dist/chunk-xszk7n10.js +14358 -0
  429. package/dist/chunk-xt8a5r1t.js +84 -0
  430. package/dist/chunk-xydyndkv.js +195 -0
  431. package/dist/chunk-xzt10yc5.js +60 -0
  432. package/dist/chunk-y04y95dr.js +91 -0
  433. package/dist/chunk-y1784krc.js +19 -0
  434. package/dist/chunk-y1x32h3x.js +128 -0
  435. package/dist/chunk-y3s7aww5.js +99 -0
  436. package/dist/chunk-y47cg3kz.js +42 -0
  437. package/dist/chunk-y7kzvepn.js +469 -0
  438. package/dist/chunk-y89kbsyc.js +287 -0
  439. package/dist/chunk-yd87p1c3.js +159 -0
  440. package/dist/chunk-yf3yw8fw.js +105 -0
  441. package/dist/chunk-ygbf0ezx.js +1391 -0
  442. package/dist/chunk-yjbxnshv.js +208 -0
  443. package/dist/chunk-ynednmqd.js +192 -0
  444. package/dist/chunk-yvhez44y.js +259 -0
  445. package/dist/chunk-ywxd4qw4.js +22 -0
  446. package/dist/chunk-yzrmgpy4.js +117 -0
  447. package/dist/chunk-z0b2vb24.js +862 -0
  448. package/dist/chunk-z1zj044v.js +655 -0
  449. package/dist/chunk-z2dp53wn.js +17 -0
  450. package/dist/chunk-z3w0xasa.js +165 -0
  451. package/dist/chunk-z7ycmrb3.js +644 -0
  452. package/dist/chunk-zh11tdkb.js +347 -0
  453. package/dist/chunk-zk2wsm7d.js +15 -0
  454. package/dist/chunk-zqfqcf22.js +229 -0
  455. package/dist/chunk-zqk2j8px.js +699 -0
  456. package/dist/chunk-zqvsc10j.js +2833 -0
  457. package/dist/chunk-zsfxha74.js +17655 -0
  458. package/dist/chunk-zvc4snyb.js +117 -0
  459. package/dist/cli.js +194 -0
  460. package/package.json +173 -0
@@ -0,0 +1,3830 @@
1
+ // @bun
2
+ import {
3
+ require_detect_libc
4
+ } from "./chunk-6dj5t602.js";
5
+ import {
6
+ require_color_convert,
7
+ require_color_name
8
+ } from "./chunk-sd36yzx8.js";
9
+ import {
10
+ require_coerce,
11
+ require_gte,
12
+ require_satisfies
13
+ } from "./chunk-0xjaqda8.js";
14
+ import {
15
+ __commonJS,
16
+ __esm,
17
+ __require,
18
+ __toESM
19
+ } from "./chunk-qp2qdcda.js";
20
+
21
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/is.js
22
+ var require_is = __commonJS((exports, module) => {
23
+ var defined = function(val) {
24
+ return typeof val !== "undefined" && val !== null;
25
+ };
26
+ var object = function(val) {
27
+ return typeof val === "object";
28
+ };
29
+ var plainObject = function(val) {
30
+ return Object.prototype.toString.call(val) === "[object Object]";
31
+ };
32
+ var fn = function(val) {
33
+ return typeof val === "function";
34
+ };
35
+ var bool = function(val) {
36
+ return typeof val === "boolean";
37
+ };
38
+ var buffer = function(val) {
39
+ return val instanceof Buffer;
40
+ };
41
+ var typedArray = function(val) {
42
+ if (defined(val)) {
43
+ switch (val.constructor) {
44
+ case Uint8Array:
45
+ case Uint8ClampedArray:
46
+ case Int8Array:
47
+ case Uint16Array:
48
+ case Int16Array:
49
+ case Uint32Array:
50
+ case Int32Array:
51
+ case Float32Array:
52
+ case Float64Array:
53
+ return true;
54
+ }
55
+ }
56
+ return false;
57
+ };
58
+ var arrayBuffer = function(val) {
59
+ return val instanceof ArrayBuffer;
60
+ };
61
+ var string = function(val) {
62
+ return typeof val === "string" && val.length > 0;
63
+ };
64
+ var number = function(val) {
65
+ return typeof val === "number" && !Number.isNaN(val);
66
+ };
67
+ var integer = function(val) {
68
+ return Number.isInteger(val);
69
+ };
70
+ var inRange = function(val, min, max) {
71
+ return val >= min && val <= max;
72
+ };
73
+ var inArray = function(val, list) {
74
+ return list.includes(val);
75
+ };
76
+ var invalidParameterError = function(name, expected, actual) {
77
+ return new Error(`Expected ${expected} for ${name} but received ${actual} of type ${typeof actual}`);
78
+ };
79
+ var nativeError = function(native, context) {
80
+ context.message = native.message;
81
+ return context;
82
+ };
83
+ module.exports = {
84
+ defined,
85
+ object,
86
+ plainObject,
87
+ fn,
88
+ bool,
89
+ buffer,
90
+ typedArray,
91
+ arrayBuffer,
92
+ string,
93
+ number,
94
+ integer,
95
+ inRange,
96
+ inArray,
97
+ invalidParameterError,
98
+ nativeError
99
+ };
100
+ });
101
+
102
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/package.json
103
+ var require_package = __commonJS((exports, module) => {
104
+ module.exports = {
105
+ name: "sharp",
106
+ description: "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
107
+ version: "0.33.5",
108
+ author: "Lovell Fuller <npm@lovell.info>",
109
+ homepage: "https://sharp.pixelplumbing.com",
110
+ contributors: [
111
+ "Pierre Inglebert <pierre.inglebert@gmail.com>",
112
+ "Jonathan Ong <jonathanrichardong@gmail.com>",
113
+ "Chanon Sajjamanochai <chanon.s@gmail.com>",
114
+ "Juliano Julio <julianojulio@gmail.com>",
115
+ "Daniel Gasienica <daniel@gasienica.ch>",
116
+ "Julian Walker <julian@fiftythree.com>",
117
+ "Amit Pitaru <pitaru.amit@gmail.com>",
118
+ "Brandon Aaron <hello.brandon@aaron.sh>",
119
+ "Andreas Lind <andreas@one.com>",
120
+ "Maurus Cuelenaere <mcuelenaere@gmail.com>",
121
+ "Linus Unneb\xE4ck <linus@folkdatorn.se>",
122
+ "Victor Mateevitsi <mvictoras@gmail.com>",
123
+ "Alaric Holloway <alaric.holloway@gmail.com>",
124
+ "Bernhard K. Weisshuhn <bkw@codingforce.com>",
125
+ "Chris Riley <criley@primedia.com>",
126
+ "David Carley <dacarley@gmail.com>",
127
+ "John Tobin <john@limelightmobileinc.com>",
128
+ "Kenton Gray <kentongray@gmail.com>",
129
+ "Felix B\xFCnemann <Felix.Buenemann@gmail.com>",
130
+ "Samy Al Zahrani <samyalzahrany@gmail.com>",
131
+ "Chintan Thakkar <lemnisk8@gmail.com>",
132
+ "F. Orlando Galashan <frulo@gmx.de>",
133
+ "Kleis Auke Wolthuizen <info@kleisauke.nl>",
134
+ "Matt Hirsch <mhirsch@media.mit.edu>",
135
+ "Matthias Thoemmes <thoemmes@gmail.com>",
136
+ "Patrick Paskaris <patrick@paskaris.gr>",
137
+ "J\xE9r\xE9my Lal <kapouer@melix.org>",
138
+ "Rahul Nanwani <r.nanwani@gmail.com>",
139
+ "Alice Monday <alice0meta@gmail.com>",
140
+ "Kristo Jorgenson <kristo.jorgenson@gmail.com>",
141
+ "YvesBos <yves_bos@outlook.com>",
142
+ "Guy Maliar <guy@tailorbrands.com>",
143
+ "Nicolas Coden <nicolas@ncoden.fr>",
144
+ "Matt Parrish <matt.r.parrish@gmail.com>",
145
+ "Marcel Bretschneider <marcel.bretschneider@gmail.com>",
146
+ "Matthew McEachen <matthew+github@mceachen.org>",
147
+ "Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>",
148
+ "Kenric D'Souza <kenric.dsouza@gmail.com>",
149
+ "Oleh Aleinyk <oleg.aleynik@gmail.com>",
150
+ "Marcel Bretschneider <marcel.bretschneider@gmail.com>",
151
+ "Andrea Bianco <andrea.bianco@unibas.ch>",
152
+ "Rik Heywood <rik@rik.org>",
153
+ "Thomas Parisot <hi@oncletom.io>",
154
+ "Nathan Graves <nathanrgraves+github@gmail.com>",
155
+ "Tom Lokhorst <tom@lokhorst.eu>",
156
+ "Espen Hovlandsdal <espen@hovlandsdal.com>",
157
+ "Sylvain Dumont <sylvain.dumont35@gmail.com>",
158
+ "Alun Davies <alun.owain.davies@googlemail.com>",
159
+ "Aidan Hoolachan <ajhoolachan21@gmail.com>",
160
+ "Axel Eirola <axel.eirola@iki.fi>",
161
+ "Freezy <freezy@xbmc.org>",
162
+ "Daiz <taneli.vatanen@gmail.com>",
163
+ "Julian Aubourg <j@ubourg.net>",
164
+ "Keith Belovay <keith@picthrive.com>",
165
+ "Michael B. Klein <mbklein@gmail.com>",
166
+ "Jordan Prudhomme <jordan@raboland.fr>",
167
+ "Ilya Ovdin <iovdin@gmail.com>",
168
+ "Andargor <andargor@yahoo.com>",
169
+ "Paul Neave <paul.neave@gmail.com>",
170
+ "Brendan Kennedy <brenwken@gmail.com>",
171
+ "Brychan Bennett-Odlum <git@brychan.io>",
172
+ "Edward Silverton <e.silverton@gmail.com>",
173
+ "Roman Malieiev <aromaleev@gmail.com>",
174
+ "Tomas Szabo <tomas.szabo@deftomat.com>",
175
+ "Robert O'Rourke <robert@o-rourke.org>",
176
+ "Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>",
177
+ "Christian Flintrup <chr@gigahost.dk>",
178
+ "Manan Jadhav <manan@motionden.com>",
179
+ "Leon Radley <leon@radley.se>",
180
+ "alza54 <alza54@thiocod.in>",
181
+ "Jacob Smith <jacob@frende.me>",
182
+ "Michael Nutt <michael@nutt.im>",
183
+ "Brad Parham <baparham@gmail.com>",
184
+ "Taneli Vatanen <taneli.vatanen@gmail.com>",
185
+ "Joris Dugu\xE9 <zaruike10@gmail.com>",
186
+ "Chris Banks <christopher.bradley.banks@gmail.com>",
187
+ "Ompal Singh <ompal.hitm09@gmail.com>",
188
+ "Brodan <christopher.hranj@gmail.com>",
189
+ "Ankur Parihar <ankur.github@gmail.com>",
190
+ "Brahim Ait elhaj <brahima@gmail.com>",
191
+ "Mart Jansink <m.jansink@gmail.com>",
192
+ "Lachlan Newman <lachnewman007@gmail.com>",
193
+ "Dennis Beatty <dennis@dcbeatty.com>",
194
+ "Ingvar Stepanyan <me@rreverser.com>",
195
+ "Don Denton <don@happycollision.com>"
196
+ ],
197
+ scripts: {
198
+ install: "node install/check",
199
+ clean: "rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",
200
+ test: "npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types",
201
+ "test-lint": "semistandard && cpplint",
202
+ "test-unit": "nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha",
203
+ "test-licensing": 'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',
204
+ "test-leak": "./test/leak/leak.sh",
205
+ "test-types": "tsd",
206
+ "package-from-local-build": "node npm/from-local-build",
207
+ "package-from-github-release": "node npm/from-github-release",
208
+ "docs-build": "node docs/build && node docs/search-index/build",
209
+ "docs-serve": "cd docs && npx serve",
210
+ "docs-publish": "cd docs && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"
211
+ },
212
+ type: "commonjs",
213
+ main: "lib/index.js",
214
+ types: "lib/index.d.ts",
215
+ files: [
216
+ "install",
217
+ "lib",
218
+ "src/*.{cc,h,gyp}"
219
+ ],
220
+ repository: {
221
+ type: "git",
222
+ url: "git://github.com/lovell/sharp.git"
223
+ },
224
+ keywords: [
225
+ "jpeg",
226
+ "png",
227
+ "webp",
228
+ "avif",
229
+ "tiff",
230
+ "gif",
231
+ "svg",
232
+ "jp2",
233
+ "dzi",
234
+ "image",
235
+ "resize",
236
+ "thumbnail",
237
+ "crop",
238
+ "embed",
239
+ "libvips",
240
+ "vips"
241
+ ],
242
+ dependencies: {
243
+ color: "^4.2.3",
244
+ "detect-libc": "^2.0.3",
245
+ semver: "^7.6.3"
246
+ },
247
+ optionalDependencies: {
248
+ "@img/sharp-darwin-arm64": "0.33.5",
249
+ "@img/sharp-darwin-x64": "0.33.5",
250
+ "@img/sharp-libvips-darwin-arm64": "1.0.4",
251
+ "@img/sharp-libvips-darwin-x64": "1.0.4",
252
+ "@img/sharp-libvips-linux-arm": "1.0.5",
253
+ "@img/sharp-libvips-linux-arm64": "1.0.4",
254
+ "@img/sharp-libvips-linux-s390x": "1.0.4",
255
+ "@img/sharp-libvips-linux-x64": "1.0.4",
256
+ "@img/sharp-libvips-linuxmusl-arm64": "1.0.4",
257
+ "@img/sharp-libvips-linuxmusl-x64": "1.0.4",
258
+ "@img/sharp-linux-arm": "0.33.5",
259
+ "@img/sharp-linux-arm64": "0.33.5",
260
+ "@img/sharp-linux-s390x": "0.33.5",
261
+ "@img/sharp-linux-x64": "0.33.5",
262
+ "@img/sharp-linuxmusl-arm64": "0.33.5",
263
+ "@img/sharp-linuxmusl-x64": "0.33.5",
264
+ "@img/sharp-wasm32": "0.33.5",
265
+ "@img/sharp-win32-ia32": "0.33.5",
266
+ "@img/sharp-win32-x64": "0.33.5"
267
+ },
268
+ devDependencies: {
269
+ "@emnapi/runtime": "^1.2.0",
270
+ "@img/sharp-libvips-dev": "1.0.4",
271
+ "@img/sharp-libvips-dev-wasm32": "1.0.5",
272
+ "@img/sharp-libvips-win32-ia32": "1.0.4",
273
+ "@img/sharp-libvips-win32-x64": "1.0.4",
274
+ "@types/node": "*",
275
+ async: "^3.2.5",
276
+ cc: "^3.0.1",
277
+ emnapi: "^1.2.0",
278
+ "exif-reader": "^2.0.1",
279
+ "extract-zip": "^2.0.1",
280
+ icc: "^3.0.0",
281
+ "jsdoc-to-markdown": "^8.0.3",
282
+ "license-checker": "^25.0.1",
283
+ mocha: "^10.7.3",
284
+ "node-addon-api": "^8.1.0",
285
+ nyc: "^17.0.0",
286
+ prebuild: "^13.0.1",
287
+ semistandard: "^17.0.0",
288
+ "tar-fs": "^3.0.6",
289
+ tsd: "^0.31.1"
290
+ },
291
+ license: "Apache-2.0",
292
+ engines: {
293
+ node: "^18.17.0 || ^20.3.0 || >=21.0.0"
294
+ },
295
+ config: {
296
+ libvips: ">=8.15.3"
297
+ },
298
+ funding: {
299
+ url: "https://opencollective.com/libvips"
300
+ },
301
+ binary: {
302
+ napi_versions: [
303
+ 9
304
+ ]
305
+ },
306
+ semistandard: {
307
+ env: [
308
+ "mocha"
309
+ ]
310
+ },
311
+ cc: {
312
+ linelength: "120",
313
+ filter: [
314
+ "build/include"
315
+ ]
316
+ },
317
+ nyc: {
318
+ include: [
319
+ "lib"
320
+ ]
321
+ },
322
+ tsd: {
323
+ directory: "test/types/"
324
+ }
325
+ };
326
+ });
327
+
328
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/libvips.js
329
+ var require_libvips = __commonJS((exports, module) => {
330
+ var { spawnSync } = __require("child_process");
331
+ var { createHash } = __require("crypto");
332
+ var semverCoerce = require_coerce();
333
+ var semverGreaterThanOrEqualTo = require_gte();
334
+ var semverSatisfies = require_satisfies();
335
+ var detectLibc = require_detect_libc();
336
+ var { config, engines, optionalDependencies } = require_package();
337
+ var minimumLibvipsVersionLabelled = process.env.npm_package_config_libvips || config.libvips;
338
+ var minimumLibvipsVersion = semverCoerce(minimumLibvipsVersionLabelled).version;
339
+ var prebuiltPlatforms = [
340
+ "darwin-arm64",
341
+ "darwin-x64",
342
+ "linux-arm",
343
+ "linux-arm64",
344
+ "linux-s390x",
345
+ "linux-x64",
346
+ "linuxmusl-arm64",
347
+ "linuxmusl-x64",
348
+ "win32-ia32",
349
+ "win32-x64"
350
+ ];
351
+ var spawnSyncOptions = {
352
+ encoding: "utf8",
353
+ shell: true
354
+ };
355
+ var log = (item) => {
356
+ if (item instanceof Error) {
357
+ console.error(`sharp: Installation error: ${item.message}`);
358
+ } else {
359
+ console.log(`sharp: ${item}`);
360
+ }
361
+ };
362
+ var runtimeLibc = () => detectLibc.isNonGlibcLinuxSync() ? detectLibc.familySync() : "";
363
+ var runtimePlatformArch = () => `${process.platform}${runtimeLibc()}-${process.arch}`;
364
+ var buildPlatformArch = () => {
365
+ if (isEmscripten()) {
366
+ return "wasm32";
367
+ }
368
+ const { npm_config_arch, npm_config_platform, npm_config_libc } = process.env;
369
+ const libc = typeof npm_config_libc === "string" ? npm_config_libc : runtimeLibc();
370
+ return `${npm_config_platform || process.platform}${libc}-${npm_config_arch || process.arch}`;
371
+ };
372
+ var buildSharpLibvipsIncludeDir = () => {
373
+ try {
374
+ return __require(`@img/sharp-libvips-dev-${buildPlatformArch()}/include`);
375
+ } catch {
376
+ try {
377
+ return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/include");})();
378
+ } catch {}
379
+ }
380
+ return "";
381
+ };
382
+ var buildSharpLibvipsCPlusPlusDir = () => {
383
+ try {
384
+ return (()=>{throw new Error("Cannot require module "+"@img/sharp-libvips-dev/cplusplus");})();
385
+ } catch {}
386
+ return "";
387
+ };
388
+ var buildSharpLibvipsLibDir = () => {
389
+ try {
390
+ return __require(`@img/sharp-libvips-dev-${buildPlatformArch()}/lib`);
391
+ } catch {
392
+ try {
393
+ return __require(`@img/sharp-libvips-${buildPlatformArch()}/lib`);
394
+ } catch {}
395
+ }
396
+ return "";
397
+ };
398
+ var isUnsupportedNodeRuntime = () => {
399
+ if (process.release?.name === "node" && process.versions) {
400
+ if (!semverSatisfies(process.versions.node, engines.node)) {
401
+ return { found: process.versions.node, expected: engines.node };
402
+ }
403
+ }
404
+ };
405
+ var isEmscripten = () => {
406
+ const { CC } = process.env;
407
+ return Boolean(CC && CC.endsWith("/emcc"));
408
+ };
409
+ var isRosetta = () => {
410
+ if (process.platform === "darwin" && process.arch === "x64") {
411
+ const translated = spawnSync("sysctl sysctl.proc_translated", spawnSyncOptions).stdout;
412
+ return (translated || "").trim() === "sysctl.proc_translated: 1";
413
+ }
414
+ return false;
415
+ };
416
+ var sha512 = (s) => createHash("sha512").update(s).digest("hex");
417
+ var yarnLocator = () => {
418
+ try {
419
+ const identHash = sha512(`imgsharp-libvips-${buildPlatformArch()}`);
420
+ const npmVersion = semverCoerce(optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`]).version;
421
+ return sha512(`${identHash}npm:${npmVersion}`).slice(0, 10);
422
+ } catch {}
423
+ return "";
424
+ };
425
+ var spawnRebuild = () => spawnSync(`node-gyp rebuild --directory=src ${isEmscripten() ? "--nodedir=emscripten" : ""}`, {
426
+ ...spawnSyncOptions,
427
+ stdio: "inherit"
428
+ }).status;
429
+ var globalLibvipsVersion = () => {
430
+ if (process.platform !== "win32") {
431
+ const globalLibvipsVersion2 = spawnSync("pkg-config --modversion vips-cpp", {
432
+ ...spawnSyncOptions,
433
+ env: {
434
+ ...process.env,
435
+ PKG_CONFIG_PATH: pkgConfigPath()
436
+ }
437
+ }).stdout;
438
+ return (globalLibvipsVersion2 || "").trim();
439
+ } else {
440
+ return "";
441
+ }
442
+ };
443
+ var pkgConfigPath = () => {
444
+ if (process.platform !== "win32") {
445
+ const brewPkgConfigPath = spawnSync('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2', spawnSyncOptions).stdout || "";
446
+ return [
447
+ brewPkgConfigPath.trim(),
448
+ process.env.PKG_CONFIG_PATH,
449
+ "/usr/local/lib/pkgconfig",
450
+ "/usr/lib/pkgconfig",
451
+ "/usr/local/libdata/pkgconfig",
452
+ "/usr/libdata/pkgconfig"
453
+ ].filter(Boolean).join(":");
454
+ } else {
455
+ return "";
456
+ }
457
+ };
458
+ var skipSearch = (status, reason, logger) => {
459
+ if (logger) {
460
+ logger(`Detected ${reason}, skipping search for globally-installed libvips`);
461
+ }
462
+ return status;
463
+ };
464
+ var useGlobalLibvips = (logger) => {
465
+ if (Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS) === true) {
466
+ return skipSearch(false, "SHARP_IGNORE_GLOBAL_LIBVIPS", logger);
467
+ }
468
+ if (Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS) === true) {
469
+ return skipSearch(true, "SHARP_FORCE_GLOBAL_LIBVIPS", logger);
470
+ }
471
+ if (isRosetta()) {
472
+ return skipSearch(false, "Rosetta", logger);
473
+ }
474
+ const globalVipsVersion = globalLibvipsVersion();
475
+ return !!globalVipsVersion && semverGreaterThanOrEqualTo(globalVipsVersion, minimumLibvipsVersion);
476
+ };
477
+ module.exports = {
478
+ minimumLibvipsVersion,
479
+ prebuiltPlatforms,
480
+ buildPlatformArch,
481
+ buildSharpLibvipsIncludeDir,
482
+ buildSharpLibvipsCPlusPlusDir,
483
+ buildSharpLibvipsLibDir,
484
+ isUnsupportedNodeRuntime,
485
+ runtimePlatformArch,
486
+ log,
487
+ yarnLocator,
488
+ spawnRebuild,
489
+ globalLibvipsVersion,
490
+ pkgConfigPath,
491
+ useGlobalLibvips
492
+ };
493
+ });
494
+
495
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/sharp.js
496
+ var require_sharp = __commonJS((exports, module) => {
497
+ var { familySync, versionSync } = require_detect_libc();
498
+ var { runtimePlatformArch, isUnsupportedNodeRuntime, prebuiltPlatforms, minimumLibvipsVersion } = require_libvips();
499
+ var runtimePlatform = runtimePlatformArch();
500
+ var paths = [
501
+ `../src/build/Release/sharp-${runtimePlatform}.node`,
502
+ "../src/build/Release/sharp-wasm32.node",
503
+ `@img/sharp-${runtimePlatform}/sharp.node`,
504
+ "@img/sharp-wasm32/sharp.node"
505
+ ];
506
+ var sharp;
507
+ var errors = [];
508
+ for (const path of paths) {
509
+ try {
510
+ sharp = __require(path);
511
+ break;
512
+ } catch (err) {
513
+ errors.push(err);
514
+ }
515
+ }
516
+ if (sharp) {
517
+ module.exports = sharp;
518
+ } else {
519
+ const [isLinux, isMacOs, isWindows] = ["linux", "darwin", "win32"].map((os) => runtimePlatform.startsWith(os));
520
+ const help = [`Could not load the "sharp" module using the ${runtimePlatform} runtime`];
521
+ errors.forEach((err) => {
522
+ if (err.code !== "MODULE_NOT_FOUND") {
523
+ help.push(`${err.code}: ${err.message}`);
524
+ }
525
+ });
526
+ const messages = errors.map((err) => err.message).join(" ");
527
+ help.push("Possible solutions:");
528
+ if (isUnsupportedNodeRuntime()) {
529
+ const { found, expected } = isUnsupportedNodeRuntime();
530
+ help.push("- Please upgrade Node.js:", ` Found ${found}`, ` Requires ${expected}`);
531
+ } else if (prebuiltPlatforms.includes(runtimePlatform)) {
532
+ const [os, cpu] = runtimePlatform.split("-");
533
+ const libc = os.endsWith("musl") ? " --libc=musl" : "";
534
+ help.push("- Ensure optional dependencies can be installed:", " npm install --include=optional sharp", "- Ensure your package manager supports multi-platform installation:", " See https://sharp.pixelplumbing.com/install#cross-platform", "- Add platform-specific dependencies:", ` npm install --os=${os.replace("musl", "")}${libc} --cpu=${cpu} sharp`);
535
+ } else {
536
+ help.push(`- Manually install libvips >= ${minimumLibvipsVersion}`, "- Add experimental WebAssembly-based dependencies:", " npm install --cpu=wasm32 sharp", " npm install @img/sharp-wasm32");
537
+ }
538
+ if (isLinux && /(symbol not found|CXXABI_)/i.test(messages)) {
539
+ try {
540
+ const { config } = __require(`@img/sharp-libvips-${runtimePlatform}/package`);
541
+ const libcFound = `${familySync()} ${versionSync()}`;
542
+ const libcRequires = `${config.musl ? "musl" : "glibc"} ${config.musl || config.glibc}`;
543
+ help.push("- Update your OS:", ` Found ${libcFound}`, ` Requires ${libcRequires}`);
544
+ } catch (errEngines) {}
545
+ }
546
+ if (isLinux && /\/snap\/core[0-9]{2}/.test(messages)) {
547
+ help.push("- Remove the Node.js Snap, which does not support native modules", " snap remove node");
548
+ }
549
+ if (isMacOs && /Incompatible library version/.test(messages)) {
550
+ help.push("- Update Homebrew:", " brew update && brew upgrade vips");
551
+ }
552
+ if (errors.some((err) => err.code === "ERR_DLOPEN_DISABLED")) {
553
+ help.push("- Run Node.js without using the --no-addons flag");
554
+ }
555
+ if (isWindows && /The specified procedure could not be found/.test(messages)) {
556
+ help.push("- Using the canvas package on Windows?", " See https://sharp.pixelplumbing.com/install#canvas-and-windows", "- Check for outdated versions of sharp in the dependency tree:", " npm ls sharp");
557
+ }
558
+ help.push("- Consult the installation documentation:", " See https://sharp.pixelplumbing.com/install");
559
+ throw new Error(help.join(`
560
+ `));
561
+ }
562
+ });
563
+
564
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/constructor.js
565
+ var require_constructor = __commonJS((exports, module) => {
566
+ var util = __require("util");
567
+ var stream = __require("stream");
568
+ var is = require_is();
569
+ require_sharp();
570
+ var debuglog = util.debuglog("sharp");
571
+ var Sharp = function(input, options) {
572
+ if (arguments.length === 1 && !is.defined(input)) {
573
+ throw new Error("Invalid input");
574
+ }
575
+ if (!(this instanceof Sharp)) {
576
+ return new Sharp(input, options);
577
+ }
578
+ stream.Duplex.call(this);
579
+ this.options = {
580
+ topOffsetPre: -1,
581
+ leftOffsetPre: -1,
582
+ widthPre: -1,
583
+ heightPre: -1,
584
+ topOffsetPost: -1,
585
+ leftOffsetPost: -1,
586
+ widthPost: -1,
587
+ heightPost: -1,
588
+ width: -1,
589
+ height: -1,
590
+ canvas: "crop",
591
+ position: 0,
592
+ resizeBackground: [0, 0, 0, 255],
593
+ useExifOrientation: false,
594
+ angle: 0,
595
+ rotationAngle: 0,
596
+ rotationBackground: [0, 0, 0, 255],
597
+ rotateBeforePreExtract: false,
598
+ flip: false,
599
+ flop: false,
600
+ extendTop: 0,
601
+ extendBottom: 0,
602
+ extendLeft: 0,
603
+ extendRight: 0,
604
+ extendBackground: [0, 0, 0, 255],
605
+ extendWith: "background",
606
+ withoutEnlargement: false,
607
+ withoutReduction: false,
608
+ affineMatrix: [],
609
+ affineBackground: [0, 0, 0, 255],
610
+ affineIdx: 0,
611
+ affineIdy: 0,
612
+ affineOdx: 0,
613
+ affineOdy: 0,
614
+ affineInterpolator: this.constructor.interpolators.bilinear,
615
+ kernel: "lanczos3",
616
+ fastShrinkOnLoad: true,
617
+ tint: [-1, 0, 0, 0],
618
+ flatten: false,
619
+ flattenBackground: [0, 0, 0],
620
+ unflatten: false,
621
+ negate: false,
622
+ negateAlpha: true,
623
+ medianSize: 0,
624
+ blurSigma: 0,
625
+ precision: "integer",
626
+ minAmpl: 0.2,
627
+ sharpenSigma: 0,
628
+ sharpenM1: 1,
629
+ sharpenM2: 2,
630
+ sharpenX1: 2,
631
+ sharpenY2: 10,
632
+ sharpenY3: 20,
633
+ threshold: 0,
634
+ thresholdGrayscale: true,
635
+ trimBackground: [],
636
+ trimThreshold: -1,
637
+ trimLineArt: false,
638
+ gamma: 0,
639
+ gammaOut: 0,
640
+ greyscale: false,
641
+ normalise: false,
642
+ normaliseLower: 1,
643
+ normaliseUpper: 99,
644
+ claheWidth: 0,
645
+ claheHeight: 0,
646
+ claheMaxSlope: 3,
647
+ brightness: 1,
648
+ saturation: 1,
649
+ hue: 0,
650
+ lightness: 0,
651
+ booleanBufferIn: null,
652
+ booleanFileIn: "",
653
+ joinChannelIn: [],
654
+ extractChannel: -1,
655
+ removeAlpha: false,
656
+ ensureAlpha: -1,
657
+ colourspace: "srgb",
658
+ colourspacePipeline: "last",
659
+ composite: [],
660
+ fileOut: "",
661
+ formatOut: "input",
662
+ streamOut: false,
663
+ keepMetadata: 0,
664
+ withMetadataOrientation: -1,
665
+ withMetadataDensity: 0,
666
+ withIccProfile: "",
667
+ withExif: {},
668
+ withExifMerge: true,
669
+ resolveWithObject: false,
670
+ jpegQuality: 80,
671
+ jpegProgressive: false,
672
+ jpegChromaSubsampling: "4:2:0",
673
+ jpegTrellisQuantisation: false,
674
+ jpegOvershootDeringing: false,
675
+ jpegOptimiseScans: false,
676
+ jpegOptimiseCoding: true,
677
+ jpegQuantisationTable: 0,
678
+ pngProgressive: false,
679
+ pngCompressionLevel: 6,
680
+ pngAdaptiveFiltering: false,
681
+ pngPalette: false,
682
+ pngQuality: 100,
683
+ pngEffort: 7,
684
+ pngBitdepth: 8,
685
+ pngDither: 1,
686
+ jp2Quality: 80,
687
+ jp2TileHeight: 512,
688
+ jp2TileWidth: 512,
689
+ jp2Lossless: false,
690
+ jp2ChromaSubsampling: "4:4:4",
691
+ webpQuality: 80,
692
+ webpAlphaQuality: 100,
693
+ webpLossless: false,
694
+ webpNearLossless: false,
695
+ webpSmartSubsample: false,
696
+ webpPreset: "default",
697
+ webpEffort: 4,
698
+ webpMinSize: false,
699
+ webpMixed: false,
700
+ gifBitdepth: 8,
701
+ gifEffort: 7,
702
+ gifDither: 1,
703
+ gifInterFrameMaxError: 0,
704
+ gifInterPaletteMaxError: 3,
705
+ gifReuse: true,
706
+ gifProgressive: false,
707
+ tiffQuality: 80,
708
+ tiffCompression: "jpeg",
709
+ tiffPredictor: "horizontal",
710
+ tiffPyramid: false,
711
+ tiffMiniswhite: false,
712
+ tiffBitdepth: 8,
713
+ tiffTile: false,
714
+ tiffTileHeight: 256,
715
+ tiffTileWidth: 256,
716
+ tiffXres: 1,
717
+ tiffYres: 1,
718
+ tiffResolutionUnit: "inch",
719
+ heifQuality: 50,
720
+ heifLossless: false,
721
+ heifCompression: "av1",
722
+ heifEffort: 4,
723
+ heifChromaSubsampling: "4:4:4",
724
+ heifBitdepth: 8,
725
+ jxlDistance: 1,
726
+ jxlDecodingTier: 0,
727
+ jxlEffort: 7,
728
+ jxlLossless: false,
729
+ rawDepth: "uchar",
730
+ tileSize: 256,
731
+ tileOverlap: 0,
732
+ tileContainer: "fs",
733
+ tileLayout: "dz",
734
+ tileFormat: "last",
735
+ tileDepth: "last",
736
+ tileAngle: 0,
737
+ tileSkipBlanks: -1,
738
+ tileBackground: [255, 255, 255, 255],
739
+ tileCentre: false,
740
+ tileId: "https://example.com/iiif",
741
+ tileBasename: "",
742
+ timeoutSeconds: 0,
743
+ linearA: [],
744
+ linearB: [],
745
+ debuglog: (warning) => {
746
+ this.emit("warning", warning);
747
+ debuglog(warning);
748
+ },
749
+ queueListener: function(queueLength) {
750
+ Sharp.queue.emit("change", queueLength);
751
+ }
752
+ };
753
+ this.options.input = this._createInputDescriptor(input, options, { allowStream: true });
754
+ return this;
755
+ };
756
+ Object.setPrototypeOf(Sharp.prototype, stream.Duplex.prototype);
757
+ Object.setPrototypeOf(Sharp, stream.Duplex);
758
+ function clone() {
759
+ const clone2 = this.constructor.call();
760
+ const { debuglog: debuglog2, queueListener, ...options } = this.options;
761
+ clone2.options = structuredClone(options);
762
+ clone2.options.debuglog = debuglog2;
763
+ clone2.options.queueListener = queueListener;
764
+ if (this._isStreamInput()) {
765
+ this.on("finish", () => {
766
+ this._flattenBufferIn();
767
+ clone2.options.input.buffer = this.options.input.buffer;
768
+ clone2.emit("finish");
769
+ });
770
+ }
771
+ return clone2;
772
+ }
773
+ Object.assign(Sharp.prototype, { clone });
774
+ module.exports = Sharp;
775
+ });
776
+
777
+ // node_modules/.bun/is-arrayish@0.3.4/node_modules/is-arrayish/index.js
778
+ var require_is_arrayish = __commonJS((exports, module) => {
779
+ module.exports = function isArrayish(obj) {
780
+ if (!obj || typeof obj === "string") {
781
+ return false;
782
+ }
783
+ return obj instanceof Array || Array.isArray(obj) || obj.length >= 0 && (obj.splice instanceof Function || Object.getOwnPropertyDescriptor(obj, obj.length - 1) && obj.constructor.name !== "String");
784
+ };
785
+ });
786
+
787
+ // node_modules/.bun/simple-swizzle@0.2.4/node_modules/simple-swizzle/index.js
788
+ var require_simple_swizzle = __commonJS((exports, module) => {
789
+ var isArrayish = require_is_arrayish();
790
+ var concat = Array.prototype.concat;
791
+ var slice = Array.prototype.slice;
792
+ var swizzle = module.exports = function swizzle2(args) {
793
+ var results = [];
794
+ for (var i = 0, len = args.length;i < len; i++) {
795
+ var arg = args[i];
796
+ if (isArrayish(arg)) {
797
+ results = concat.call(results, slice.call(arg));
798
+ } else {
799
+ results.push(arg);
800
+ }
801
+ }
802
+ return results;
803
+ };
804
+ swizzle.wrap = function(fn) {
805
+ return function() {
806
+ return fn(swizzle(arguments));
807
+ };
808
+ };
809
+ });
810
+
811
+ // node_modules/.bun/color-string@1.9.1/node_modules/color-string/index.js
812
+ var require_color_string = __commonJS((exports, module) => {
813
+ var colorNames = require_color_name();
814
+ var swizzle = require_simple_swizzle();
815
+ var hasOwnProperty = Object.hasOwnProperty;
816
+ var reverseNames = Object.create(null);
817
+ for (name in colorNames) {
818
+ if (hasOwnProperty.call(colorNames, name)) {
819
+ reverseNames[colorNames[name]] = name;
820
+ }
821
+ }
822
+ var name;
823
+ var cs = module.exports = {
824
+ to: {},
825
+ get: {}
826
+ };
827
+ cs.get = function(string) {
828
+ var prefix = string.substring(0, 3).toLowerCase();
829
+ var val;
830
+ var model;
831
+ switch (prefix) {
832
+ case "hsl":
833
+ val = cs.get.hsl(string);
834
+ model = "hsl";
835
+ break;
836
+ case "hwb":
837
+ val = cs.get.hwb(string);
838
+ model = "hwb";
839
+ break;
840
+ default:
841
+ val = cs.get.rgb(string);
842
+ model = "rgb";
843
+ break;
844
+ }
845
+ if (!val) {
846
+ return null;
847
+ }
848
+ return { model, value: val };
849
+ };
850
+ cs.get.rgb = function(string) {
851
+ if (!string) {
852
+ return null;
853
+ }
854
+ var abbr = /^#([a-f0-9]{3,4})$/i;
855
+ var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
856
+ var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
857
+ var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
858
+ var keyword = /^(\w+)$/;
859
+ var rgb = [0, 0, 0, 1];
860
+ var match;
861
+ var i;
862
+ var hexAlpha;
863
+ if (match = string.match(hex)) {
864
+ hexAlpha = match[2];
865
+ match = match[1];
866
+ for (i = 0;i < 3; i++) {
867
+ var i2 = i * 2;
868
+ rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
869
+ }
870
+ if (hexAlpha) {
871
+ rgb[3] = parseInt(hexAlpha, 16) / 255;
872
+ }
873
+ } else if (match = string.match(abbr)) {
874
+ match = match[1];
875
+ hexAlpha = match[3];
876
+ for (i = 0;i < 3; i++) {
877
+ rgb[i] = parseInt(match[i] + match[i], 16);
878
+ }
879
+ if (hexAlpha) {
880
+ rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
881
+ }
882
+ } else if (match = string.match(rgba)) {
883
+ for (i = 0;i < 3; i++) {
884
+ rgb[i] = parseInt(match[i + 1], 0);
885
+ }
886
+ if (match[4]) {
887
+ if (match[5]) {
888
+ rgb[3] = parseFloat(match[4]) * 0.01;
889
+ } else {
890
+ rgb[3] = parseFloat(match[4]);
891
+ }
892
+ }
893
+ } else if (match = string.match(per)) {
894
+ for (i = 0;i < 3; i++) {
895
+ rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
896
+ }
897
+ if (match[4]) {
898
+ if (match[5]) {
899
+ rgb[3] = parseFloat(match[4]) * 0.01;
900
+ } else {
901
+ rgb[3] = parseFloat(match[4]);
902
+ }
903
+ }
904
+ } else if (match = string.match(keyword)) {
905
+ if (match[1] === "transparent") {
906
+ return [0, 0, 0, 0];
907
+ }
908
+ if (!hasOwnProperty.call(colorNames, match[1])) {
909
+ return null;
910
+ }
911
+ rgb = colorNames[match[1]];
912
+ rgb[3] = 1;
913
+ return rgb;
914
+ } else {
915
+ return null;
916
+ }
917
+ for (i = 0;i < 3; i++) {
918
+ rgb[i] = clamp(rgb[i], 0, 255);
919
+ }
920
+ rgb[3] = clamp(rgb[3], 0, 1);
921
+ return rgb;
922
+ };
923
+ cs.get.hsl = function(string) {
924
+ if (!string) {
925
+ return null;
926
+ }
927
+ var hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
928
+ var match = string.match(hsl);
929
+ if (match) {
930
+ var alpha = parseFloat(match[4]);
931
+ var h = (parseFloat(match[1]) % 360 + 360) % 360;
932
+ var s = clamp(parseFloat(match[2]), 0, 100);
933
+ var l = clamp(parseFloat(match[3]), 0, 100);
934
+ var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
935
+ return [h, s, l, a];
936
+ }
937
+ return null;
938
+ };
939
+ cs.get.hwb = function(string) {
940
+ if (!string) {
941
+ return null;
942
+ }
943
+ var hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
944
+ var match = string.match(hwb);
945
+ if (match) {
946
+ var alpha = parseFloat(match[4]);
947
+ var h = (parseFloat(match[1]) % 360 + 360) % 360;
948
+ var w = clamp(parseFloat(match[2]), 0, 100);
949
+ var b = clamp(parseFloat(match[3]), 0, 100);
950
+ var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
951
+ return [h, w, b, a];
952
+ }
953
+ return null;
954
+ };
955
+ cs.to.hex = function() {
956
+ var rgba = swizzle(arguments);
957
+ return "#" + hexDouble(rgba[0]) + hexDouble(rgba[1]) + hexDouble(rgba[2]) + (rgba[3] < 1 ? hexDouble(Math.round(rgba[3] * 255)) : "");
958
+ };
959
+ cs.to.rgb = function() {
960
+ var rgba = swizzle(arguments);
961
+ return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ")" : "rgba(" + Math.round(rgba[0]) + ", " + Math.round(rgba[1]) + ", " + Math.round(rgba[2]) + ", " + rgba[3] + ")";
962
+ };
963
+ cs.to.rgb.percent = function() {
964
+ var rgba = swizzle(arguments);
965
+ var r = Math.round(rgba[0] / 255 * 100);
966
+ var g = Math.round(rgba[1] / 255 * 100);
967
+ var b = Math.round(rgba[2] / 255 * 100);
968
+ return rgba.length < 4 || rgba[3] === 1 ? "rgb(" + r + "%, " + g + "%, " + b + "%)" : "rgba(" + r + "%, " + g + "%, " + b + "%, " + rgba[3] + ")";
969
+ };
970
+ cs.to.hsl = function() {
971
+ var hsla = swizzle(arguments);
972
+ return hsla.length < 4 || hsla[3] === 1 ? "hsl(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%)" : "hsla(" + hsla[0] + ", " + hsla[1] + "%, " + hsla[2] + "%, " + hsla[3] + ")";
973
+ };
974
+ cs.to.hwb = function() {
975
+ var hwba = swizzle(arguments);
976
+ var a = "";
977
+ if (hwba.length >= 4 && hwba[3] !== 1) {
978
+ a = ", " + hwba[3];
979
+ }
980
+ return "hwb(" + hwba[0] + ", " + hwba[1] + "%, " + hwba[2] + "%" + a + ")";
981
+ };
982
+ cs.to.keyword = function(rgb) {
983
+ return reverseNames[rgb.slice(0, 3)];
984
+ };
985
+ function clamp(num, min, max) {
986
+ return Math.min(Math.max(min, num), max);
987
+ }
988
+ function hexDouble(num) {
989
+ var str = Math.round(num).toString(16).toUpperCase();
990
+ return str.length < 2 ? "0" + str : str;
991
+ }
992
+ });
993
+
994
+ // node_modules/.bun/color@4.2.3/node_modules/color/index.js
995
+ var require_color = __commonJS((exports, module) => {
996
+ var colorString = require_color_string();
997
+ var convert = require_color_convert();
998
+ var skippedModels = [
999
+ "keyword",
1000
+ "gray",
1001
+ "hex"
1002
+ ];
1003
+ var hashedModelKeys = {};
1004
+ for (const model of Object.keys(convert)) {
1005
+ hashedModelKeys[[...convert[model].labels].sort().join("")] = model;
1006
+ }
1007
+ var limiters = {};
1008
+ function Color(object, model) {
1009
+ if (!(this instanceof Color)) {
1010
+ return new Color(object, model);
1011
+ }
1012
+ if (model && model in skippedModels) {
1013
+ model = null;
1014
+ }
1015
+ if (model && !(model in convert)) {
1016
+ throw new Error("Unknown model: " + model);
1017
+ }
1018
+ let i;
1019
+ let channels;
1020
+ if (object == null) {
1021
+ this.model = "rgb";
1022
+ this.color = [0, 0, 0];
1023
+ this.valpha = 1;
1024
+ } else if (object instanceof Color) {
1025
+ this.model = object.model;
1026
+ this.color = [...object.color];
1027
+ this.valpha = object.valpha;
1028
+ } else if (typeof object === "string") {
1029
+ const result = colorString.get(object);
1030
+ if (result === null) {
1031
+ throw new Error("Unable to parse color from string: " + object);
1032
+ }
1033
+ this.model = result.model;
1034
+ channels = convert[this.model].channels;
1035
+ this.color = result.value.slice(0, channels);
1036
+ this.valpha = typeof result.value[channels] === "number" ? result.value[channels] : 1;
1037
+ } else if (object.length > 0) {
1038
+ this.model = model || "rgb";
1039
+ channels = convert[this.model].channels;
1040
+ const newArray = Array.prototype.slice.call(object, 0, channels);
1041
+ this.color = zeroArray(newArray, channels);
1042
+ this.valpha = typeof object[channels] === "number" ? object[channels] : 1;
1043
+ } else if (typeof object === "number") {
1044
+ this.model = "rgb";
1045
+ this.color = [
1046
+ object >> 16 & 255,
1047
+ object >> 8 & 255,
1048
+ object & 255
1049
+ ];
1050
+ this.valpha = 1;
1051
+ } else {
1052
+ this.valpha = 1;
1053
+ const keys = Object.keys(object);
1054
+ if ("alpha" in object) {
1055
+ keys.splice(keys.indexOf("alpha"), 1);
1056
+ this.valpha = typeof object.alpha === "number" ? object.alpha : 0;
1057
+ }
1058
+ const hashedKeys = keys.sort().join("");
1059
+ if (!(hashedKeys in hashedModelKeys)) {
1060
+ throw new Error("Unable to parse color from object: " + JSON.stringify(object));
1061
+ }
1062
+ this.model = hashedModelKeys[hashedKeys];
1063
+ const { labels } = convert[this.model];
1064
+ const color = [];
1065
+ for (i = 0;i < labels.length; i++) {
1066
+ color.push(object[labels[i]]);
1067
+ }
1068
+ this.color = zeroArray(color);
1069
+ }
1070
+ if (limiters[this.model]) {
1071
+ channels = convert[this.model].channels;
1072
+ for (i = 0;i < channels; i++) {
1073
+ const limit = limiters[this.model][i];
1074
+ if (limit) {
1075
+ this.color[i] = limit(this.color[i]);
1076
+ }
1077
+ }
1078
+ }
1079
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1080
+ if (Object.freeze) {
1081
+ Object.freeze(this);
1082
+ }
1083
+ }
1084
+ Color.prototype = {
1085
+ toString() {
1086
+ return this.string();
1087
+ },
1088
+ toJSON() {
1089
+ return this[this.model]();
1090
+ },
1091
+ string(places) {
1092
+ let self = this.model in colorString.to ? this : this.rgb();
1093
+ self = self.round(typeof places === "number" ? places : 1);
1094
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1095
+ return colorString.to[self.model](args);
1096
+ },
1097
+ percentString(places) {
1098
+ const self = this.rgb().round(typeof places === "number" ? places : 1);
1099
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1100
+ return colorString.to.rgb.percent(args);
1101
+ },
1102
+ array() {
1103
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1104
+ },
1105
+ object() {
1106
+ const result = {};
1107
+ const { channels } = convert[this.model];
1108
+ const { labels } = convert[this.model];
1109
+ for (let i = 0;i < channels; i++) {
1110
+ result[labels[i]] = this.color[i];
1111
+ }
1112
+ if (this.valpha !== 1) {
1113
+ result.alpha = this.valpha;
1114
+ }
1115
+ return result;
1116
+ },
1117
+ unitArray() {
1118
+ const rgb = this.rgb().color;
1119
+ rgb[0] /= 255;
1120
+ rgb[1] /= 255;
1121
+ rgb[2] /= 255;
1122
+ if (this.valpha !== 1) {
1123
+ rgb.push(this.valpha);
1124
+ }
1125
+ return rgb;
1126
+ },
1127
+ unitObject() {
1128
+ const rgb = this.rgb().object();
1129
+ rgb.r /= 255;
1130
+ rgb.g /= 255;
1131
+ rgb.b /= 255;
1132
+ if (this.valpha !== 1) {
1133
+ rgb.alpha = this.valpha;
1134
+ }
1135
+ return rgb;
1136
+ },
1137
+ round(places) {
1138
+ places = Math.max(places || 0, 0);
1139
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1140
+ },
1141
+ alpha(value) {
1142
+ if (value !== undefined) {
1143
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1144
+ }
1145
+ return this.valpha;
1146
+ },
1147
+ red: getset("rgb", 0, maxfn(255)),
1148
+ green: getset("rgb", 1, maxfn(255)),
1149
+ blue: getset("rgb", 2, maxfn(255)),
1150
+ hue: getset(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (value) => (value % 360 + 360) % 360),
1151
+ saturationl: getset("hsl", 1, maxfn(100)),
1152
+ lightness: getset("hsl", 2, maxfn(100)),
1153
+ saturationv: getset("hsv", 1, maxfn(100)),
1154
+ value: getset("hsv", 2, maxfn(100)),
1155
+ chroma: getset("hcg", 1, maxfn(100)),
1156
+ gray: getset("hcg", 2, maxfn(100)),
1157
+ white: getset("hwb", 1, maxfn(100)),
1158
+ wblack: getset("hwb", 2, maxfn(100)),
1159
+ cyan: getset("cmyk", 0, maxfn(100)),
1160
+ magenta: getset("cmyk", 1, maxfn(100)),
1161
+ yellow: getset("cmyk", 2, maxfn(100)),
1162
+ black: getset("cmyk", 3, maxfn(100)),
1163
+ x: getset("xyz", 0, maxfn(95.047)),
1164
+ y: getset("xyz", 1, maxfn(100)),
1165
+ z: getset("xyz", 2, maxfn(108.833)),
1166
+ l: getset("lab", 0, maxfn(100)),
1167
+ a: getset("lab", 1),
1168
+ b: getset("lab", 2),
1169
+ keyword(value) {
1170
+ if (value !== undefined) {
1171
+ return new Color(value);
1172
+ }
1173
+ return convert[this.model].keyword(this.color);
1174
+ },
1175
+ hex(value) {
1176
+ if (value !== undefined) {
1177
+ return new Color(value);
1178
+ }
1179
+ return colorString.to.hex(this.rgb().round().color);
1180
+ },
1181
+ hexa(value) {
1182
+ if (value !== undefined) {
1183
+ return new Color(value);
1184
+ }
1185
+ const rgbArray = this.rgb().round().color;
1186
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1187
+ if (alphaHex.length === 1) {
1188
+ alphaHex = "0" + alphaHex;
1189
+ }
1190
+ return colorString.to.hex(rgbArray) + alphaHex;
1191
+ },
1192
+ rgbNumber() {
1193
+ const rgb = this.rgb().color;
1194
+ return (rgb[0] & 255) << 16 | (rgb[1] & 255) << 8 | rgb[2] & 255;
1195
+ },
1196
+ luminosity() {
1197
+ const rgb = this.rgb().color;
1198
+ const lum = [];
1199
+ for (const [i, element] of rgb.entries()) {
1200
+ const chan = element / 255;
1201
+ lum[i] = chan <= 0.04045 ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1202
+ }
1203
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1204
+ },
1205
+ contrast(color2) {
1206
+ const lum1 = this.luminosity();
1207
+ const lum2 = color2.luminosity();
1208
+ if (lum1 > lum2) {
1209
+ return (lum1 + 0.05) / (lum2 + 0.05);
1210
+ }
1211
+ return (lum2 + 0.05) / (lum1 + 0.05);
1212
+ },
1213
+ level(color2) {
1214
+ const contrastRatio = this.contrast(color2);
1215
+ if (contrastRatio >= 7) {
1216
+ return "AAA";
1217
+ }
1218
+ return contrastRatio >= 4.5 ? "AA" : "";
1219
+ },
1220
+ isDark() {
1221
+ const rgb = this.rgb().color;
1222
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 1e4;
1223
+ return yiq < 128;
1224
+ },
1225
+ isLight() {
1226
+ return !this.isDark();
1227
+ },
1228
+ negate() {
1229
+ const rgb = this.rgb();
1230
+ for (let i = 0;i < 3; i++) {
1231
+ rgb.color[i] = 255 - rgb.color[i];
1232
+ }
1233
+ return rgb;
1234
+ },
1235
+ lighten(ratio) {
1236
+ const hsl = this.hsl();
1237
+ hsl.color[2] += hsl.color[2] * ratio;
1238
+ return hsl;
1239
+ },
1240
+ darken(ratio) {
1241
+ const hsl = this.hsl();
1242
+ hsl.color[2] -= hsl.color[2] * ratio;
1243
+ return hsl;
1244
+ },
1245
+ saturate(ratio) {
1246
+ const hsl = this.hsl();
1247
+ hsl.color[1] += hsl.color[1] * ratio;
1248
+ return hsl;
1249
+ },
1250
+ desaturate(ratio) {
1251
+ const hsl = this.hsl();
1252
+ hsl.color[1] -= hsl.color[1] * ratio;
1253
+ return hsl;
1254
+ },
1255
+ whiten(ratio) {
1256
+ const hwb = this.hwb();
1257
+ hwb.color[1] += hwb.color[1] * ratio;
1258
+ return hwb;
1259
+ },
1260
+ blacken(ratio) {
1261
+ const hwb = this.hwb();
1262
+ hwb.color[2] += hwb.color[2] * ratio;
1263
+ return hwb;
1264
+ },
1265
+ grayscale() {
1266
+ const rgb = this.rgb().color;
1267
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
1268
+ return Color.rgb(value, value, value);
1269
+ },
1270
+ fade(ratio) {
1271
+ return this.alpha(this.valpha - this.valpha * ratio);
1272
+ },
1273
+ opaquer(ratio) {
1274
+ return this.alpha(this.valpha + this.valpha * ratio);
1275
+ },
1276
+ rotate(degrees) {
1277
+ const hsl = this.hsl();
1278
+ let hue = hsl.color[0];
1279
+ hue = (hue + degrees) % 360;
1280
+ hue = hue < 0 ? 360 + hue : hue;
1281
+ hsl.color[0] = hue;
1282
+ return hsl;
1283
+ },
1284
+ mix(mixinColor, weight) {
1285
+ if (!mixinColor || !mixinColor.rgb) {
1286
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
1287
+ }
1288
+ const color1 = mixinColor.rgb();
1289
+ const color2 = this.rgb();
1290
+ const p = weight === undefined ? 0.5 : weight;
1291
+ const w = 2 * p - 1;
1292
+ const a = color1.alpha() - color2.alpha();
1293
+ const w1 = ((w * a === -1 ? w : (w + a) / (1 + w * a)) + 1) / 2;
1294
+ const w2 = 1 - w1;
1295
+ return Color.rgb(w1 * color1.red() + w2 * color2.red(), w1 * color1.green() + w2 * color2.green(), w1 * color1.blue() + w2 * color2.blue(), color1.alpha() * p + color2.alpha() * (1 - p));
1296
+ }
1297
+ };
1298
+ for (const model of Object.keys(convert)) {
1299
+ if (skippedModels.includes(model)) {
1300
+ continue;
1301
+ }
1302
+ const { channels } = convert[model];
1303
+ Color.prototype[model] = function(...args) {
1304
+ if (this.model === model) {
1305
+ return new Color(this);
1306
+ }
1307
+ if (args.length > 0) {
1308
+ return new Color(args, model);
1309
+ }
1310
+ return new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);
1311
+ };
1312
+ Color[model] = function(...args) {
1313
+ let color = args[0];
1314
+ if (typeof color === "number") {
1315
+ color = zeroArray(args, channels);
1316
+ }
1317
+ return new Color(color, model);
1318
+ };
1319
+ }
1320
+ function roundTo(number, places) {
1321
+ return Number(number.toFixed(places));
1322
+ }
1323
+ function roundToPlace(places) {
1324
+ return function(number) {
1325
+ return roundTo(number, places);
1326
+ };
1327
+ }
1328
+ function getset(model, channel, modifier) {
1329
+ model = Array.isArray(model) ? model : [model];
1330
+ for (const m of model) {
1331
+ (limiters[m] || (limiters[m] = []))[channel] = modifier;
1332
+ }
1333
+ model = model[0];
1334
+ return function(value) {
1335
+ let result;
1336
+ if (value !== undefined) {
1337
+ if (modifier) {
1338
+ value = modifier(value);
1339
+ }
1340
+ result = this[model]();
1341
+ result.color[channel] = value;
1342
+ return result;
1343
+ }
1344
+ result = this[model]().color[channel];
1345
+ if (modifier) {
1346
+ result = modifier(result);
1347
+ }
1348
+ return result;
1349
+ };
1350
+ }
1351
+ function maxfn(max) {
1352
+ return function(v) {
1353
+ return Math.max(0, Math.min(max, v));
1354
+ };
1355
+ }
1356
+ function assertArray(value) {
1357
+ return Array.isArray(value) ? value : [value];
1358
+ }
1359
+ function zeroArray(array, length) {
1360
+ for (let i = 0;i < length; i++) {
1361
+ if (typeof array[i] !== "number") {
1362
+ array[i] = 0;
1363
+ }
1364
+ }
1365
+ return array;
1366
+ }
1367
+ module.exports = Color;
1368
+ });
1369
+
1370
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/input.js
1371
+ var require_input = __commonJS((exports, module) => {
1372
+ var color = require_color();
1373
+ var is = require_is();
1374
+ var sharp = require_sharp();
1375
+ var align = {
1376
+ left: "low",
1377
+ center: "centre",
1378
+ centre: "centre",
1379
+ right: "high"
1380
+ };
1381
+ function _inputOptionsFromObject(obj) {
1382
+ const { raw, density, limitInputPixels, ignoreIcc, unlimited, sequentialRead, failOn, failOnError, animated, page, pages, subifd } = obj;
1383
+ return [raw, density, limitInputPixels, ignoreIcc, unlimited, sequentialRead, failOn, failOnError, animated, page, pages, subifd].some(is.defined) ? { raw, density, limitInputPixels, ignoreIcc, unlimited, sequentialRead, failOn, failOnError, animated, page, pages, subifd } : undefined;
1384
+ }
1385
+ function _createInputDescriptor(input, inputOptions, containerOptions) {
1386
+ const inputDescriptor = {
1387
+ failOn: "warning",
1388
+ limitInputPixels: Math.pow(16383, 2),
1389
+ ignoreIcc: false,
1390
+ unlimited: false,
1391
+ sequentialRead: true
1392
+ };
1393
+ if (is.string(input)) {
1394
+ inputDescriptor.file = input;
1395
+ } else if (is.buffer(input)) {
1396
+ if (input.length === 0) {
1397
+ throw Error("Input Buffer is empty");
1398
+ }
1399
+ inputDescriptor.buffer = input;
1400
+ } else if (is.arrayBuffer(input)) {
1401
+ if (input.byteLength === 0) {
1402
+ throw Error("Input bit Array is empty");
1403
+ }
1404
+ inputDescriptor.buffer = Buffer.from(input, 0, input.byteLength);
1405
+ } else if (is.typedArray(input)) {
1406
+ if (input.length === 0) {
1407
+ throw Error("Input Bit Array is empty");
1408
+ }
1409
+ inputDescriptor.buffer = Buffer.from(input.buffer, input.byteOffset, input.byteLength);
1410
+ } else if (is.plainObject(input) && !is.defined(inputOptions)) {
1411
+ inputOptions = input;
1412
+ if (_inputOptionsFromObject(inputOptions)) {
1413
+ inputDescriptor.buffer = [];
1414
+ }
1415
+ } else if (!is.defined(input) && !is.defined(inputOptions) && is.object(containerOptions) && containerOptions.allowStream) {
1416
+ inputDescriptor.buffer = [];
1417
+ } else {
1418
+ throw new Error(`Unsupported input '${input}' of type ${typeof input}${is.defined(inputOptions) ? ` when also providing options of type ${typeof inputOptions}` : ""}`);
1419
+ }
1420
+ if (is.object(inputOptions)) {
1421
+ if (is.defined(inputOptions.failOnError)) {
1422
+ if (is.bool(inputOptions.failOnError)) {
1423
+ inputDescriptor.failOn = inputOptions.failOnError ? "warning" : "none";
1424
+ } else {
1425
+ throw is.invalidParameterError("failOnError", "boolean", inputOptions.failOnError);
1426
+ }
1427
+ }
1428
+ if (is.defined(inputOptions.failOn)) {
1429
+ if (is.string(inputOptions.failOn) && is.inArray(inputOptions.failOn, ["none", "truncated", "error", "warning"])) {
1430
+ inputDescriptor.failOn = inputOptions.failOn;
1431
+ } else {
1432
+ throw is.invalidParameterError("failOn", "one of: none, truncated, error, warning", inputOptions.failOn);
1433
+ }
1434
+ }
1435
+ if (is.defined(inputOptions.density)) {
1436
+ if (is.inRange(inputOptions.density, 1, 1e5)) {
1437
+ inputDescriptor.density = inputOptions.density;
1438
+ } else {
1439
+ throw is.invalidParameterError("density", "number between 1 and 100000", inputOptions.density);
1440
+ }
1441
+ }
1442
+ if (is.defined(inputOptions.ignoreIcc)) {
1443
+ if (is.bool(inputOptions.ignoreIcc)) {
1444
+ inputDescriptor.ignoreIcc = inputOptions.ignoreIcc;
1445
+ } else {
1446
+ throw is.invalidParameterError("ignoreIcc", "boolean", inputOptions.ignoreIcc);
1447
+ }
1448
+ }
1449
+ if (is.defined(inputOptions.limitInputPixels)) {
1450
+ if (is.bool(inputOptions.limitInputPixels)) {
1451
+ inputDescriptor.limitInputPixels = inputOptions.limitInputPixels ? Math.pow(16383, 2) : 0;
1452
+ } else if (is.integer(inputOptions.limitInputPixels) && is.inRange(inputOptions.limitInputPixels, 0, Number.MAX_SAFE_INTEGER)) {
1453
+ inputDescriptor.limitInputPixels = inputOptions.limitInputPixels;
1454
+ } else {
1455
+ throw is.invalidParameterError("limitInputPixels", "positive integer", inputOptions.limitInputPixels);
1456
+ }
1457
+ }
1458
+ if (is.defined(inputOptions.unlimited)) {
1459
+ if (is.bool(inputOptions.unlimited)) {
1460
+ inputDescriptor.unlimited = inputOptions.unlimited;
1461
+ } else {
1462
+ throw is.invalidParameterError("unlimited", "boolean", inputOptions.unlimited);
1463
+ }
1464
+ }
1465
+ if (is.defined(inputOptions.sequentialRead)) {
1466
+ if (is.bool(inputOptions.sequentialRead)) {
1467
+ inputDescriptor.sequentialRead = inputOptions.sequentialRead;
1468
+ } else {
1469
+ throw is.invalidParameterError("sequentialRead", "boolean", inputOptions.sequentialRead);
1470
+ }
1471
+ }
1472
+ if (is.defined(inputOptions.raw)) {
1473
+ if (is.object(inputOptions.raw) && is.integer(inputOptions.raw.width) && inputOptions.raw.width > 0 && is.integer(inputOptions.raw.height) && inputOptions.raw.height > 0 && is.integer(inputOptions.raw.channels) && is.inRange(inputOptions.raw.channels, 1, 4)) {
1474
+ inputDescriptor.rawWidth = inputOptions.raw.width;
1475
+ inputDescriptor.rawHeight = inputOptions.raw.height;
1476
+ inputDescriptor.rawChannels = inputOptions.raw.channels;
1477
+ inputDescriptor.rawPremultiplied = !!inputOptions.raw.premultiplied;
1478
+ switch (input.constructor) {
1479
+ case Uint8Array:
1480
+ case Uint8ClampedArray:
1481
+ inputDescriptor.rawDepth = "uchar";
1482
+ break;
1483
+ case Int8Array:
1484
+ inputDescriptor.rawDepth = "char";
1485
+ break;
1486
+ case Uint16Array:
1487
+ inputDescriptor.rawDepth = "ushort";
1488
+ break;
1489
+ case Int16Array:
1490
+ inputDescriptor.rawDepth = "short";
1491
+ break;
1492
+ case Uint32Array:
1493
+ inputDescriptor.rawDepth = "uint";
1494
+ break;
1495
+ case Int32Array:
1496
+ inputDescriptor.rawDepth = "int";
1497
+ break;
1498
+ case Float32Array:
1499
+ inputDescriptor.rawDepth = "float";
1500
+ break;
1501
+ case Float64Array:
1502
+ inputDescriptor.rawDepth = "double";
1503
+ break;
1504
+ default:
1505
+ inputDescriptor.rawDepth = "uchar";
1506
+ break;
1507
+ }
1508
+ } else {
1509
+ throw new Error("Expected width, height and channels for raw pixel input");
1510
+ }
1511
+ }
1512
+ if (is.defined(inputOptions.animated)) {
1513
+ if (is.bool(inputOptions.animated)) {
1514
+ inputDescriptor.pages = inputOptions.animated ? -1 : 1;
1515
+ } else {
1516
+ throw is.invalidParameterError("animated", "boolean", inputOptions.animated);
1517
+ }
1518
+ }
1519
+ if (is.defined(inputOptions.pages)) {
1520
+ if (is.integer(inputOptions.pages) && is.inRange(inputOptions.pages, -1, 1e5)) {
1521
+ inputDescriptor.pages = inputOptions.pages;
1522
+ } else {
1523
+ throw is.invalidParameterError("pages", "integer between -1 and 100000", inputOptions.pages);
1524
+ }
1525
+ }
1526
+ if (is.defined(inputOptions.page)) {
1527
+ if (is.integer(inputOptions.page) && is.inRange(inputOptions.page, 0, 1e5)) {
1528
+ inputDescriptor.page = inputOptions.page;
1529
+ } else {
1530
+ throw is.invalidParameterError("page", "integer between 0 and 100000", inputOptions.page);
1531
+ }
1532
+ }
1533
+ if (is.defined(inputOptions.level)) {
1534
+ if (is.integer(inputOptions.level) && is.inRange(inputOptions.level, 0, 256)) {
1535
+ inputDescriptor.level = inputOptions.level;
1536
+ } else {
1537
+ throw is.invalidParameterError("level", "integer between 0 and 256", inputOptions.level);
1538
+ }
1539
+ }
1540
+ if (is.defined(inputOptions.subifd)) {
1541
+ if (is.integer(inputOptions.subifd) && is.inRange(inputOptions.subifd, -1, 1e5)) {
1542
+ inputDescriptor.subifd = inputOptions.subifd;
1543
+ } else {
1544
+ throw is.invalidParameterError("subifd", "integer between -1 and 100000", inputOptions.subifd);
1545
+ }
1546
+ }
1547
+ if (is.defined(inputOptions.create)) {
1548
+ if (is.object(inputOptions.create) && is.integer(inputOptions.create.width) && inputOptions.create.width > 0 && is.integer(inputOptions.create.height) && inputOptions.create.height > 0 && is.integer(inputOptions.create.channels)) {
1549
+ inputDescriptor.createWidth = inputOptions.create.width;
1550
+ inputDescriptor.createHeight = inputOptions.create.height;
1551
+ inputDescriptor.createChannels = inputOptions.create.channels;
1552
+ if (is.defined(inputOptions.create.noise)) {
1553
+ if (!is.object(inputOptions.create.noise)) {
1554
+ throw new Error("Expected noise to be an object");
1555
+ }
1556
+ if (!is.inArray(inputOptions.create.noise.type, ["gaussian"])) {
1557
+ throw new Error("Only gaussian noise is supported at the moment");
1558
+ }
1559
+ if (!is.inRange(inputOptions.create.channels, 1, 4)) {
1560
+ throw is.invalidParameterError("create.channels", "number between 1 and 4", inputOptions.create.channels);
1561
+ }
1562
+ inputDescriptor.createNoiseType = inputOptions.create.noise.type;
1563
+ if (is.number(inputOptions.create.noise.mean) && is.inRange(inputOptions.create.noise.mean, 0, 1e4)) {
1564
+ inputDescriptor.createNoiseMean = inputOptions.create.noise.mean;
1565
+ } else {
1566
+ throw is.invalidParameterError("create.noise.mean", "number between 0 and 10000", inputOptions.create.noise.mean);
1567
+ }
1568
+ if (is.number(inputOptions.create.noise.sigma) && is.inRange(inputOptions.create.noise.sigma, 0, 1e4)) {
1569
+ inputDescriptor.createNoiseSigma = inputOptions.create.noise.sigma;
1570
+ } else {
1571
+ throw is.invalidParameterError("create.noise.sigma", "number between 0 and 10000", inputOptions.create.noise.sigma);
1572
+ }
1573
+ } else if (is.defined(inputOptions.create.background)) {
1574
+ if (!is.inRange(inputOptions.create.channels, 3, 4)) {
1575
+ throw is.invalidParameterError("create.channels", "number between 3 and 4", inputOptions.create.channels);
1576
+ }
1577
+ const background = color(inputOptions.create.background);
1578
+ inputDescriptor.createBackground = [
1579
+ background.red(),
1580
+ background.green(),
1581
+ background.blue(),
1582
+ Math.round(background.alpha() * 255)
1583
+ ];
1584
+ } else {
1585
+ throw new Error("Expected valid noise or background to create a new input image");
1586
+ }
1587
+ delete inputDescriptor.buffer;
1588
+ } else {
1589
+ throw new Error("Expected valid width, height and channels to create a new input image");
1590
+ }
1591
+ }
1592
+ if (is.defined(inputOptions.text)) {
1593
+ if (is.object(inputOptions.text) && is.string(inputOptions.text.text)) {
1594
+ inputDescriptor.textValue = inputOptions.text.text;
1595
+ if (is.defined(inputOptions.text.height) && is.defined(inputOptions.text.dpi)) {
1596
+ throw new Error("Expected only one of dpi or height");
1597
+ }
1598
+ if (is.defined(inputOptions.text.font)) {
1599
+ if (is.string(inputOptions.text.font)) {
1600
+ inputDescriptor.textFont = inputOptions.text.font;
1601
+ } else {
1602
+ throw is.invalidParameterError("text.font", "string", inputOptions.text.font);
1603
+ }
1604
+ }
1605
+ if (is.defined(inputOptions.text.fontfile)) {
1606
+ if (is.string(inputOptions.text.fontfile)) {
1607
+ inputDescriptor.textFontfile = inputOptions.text.fontfile;
1608
+ } else {
1609
+ throw is.invalidParameterError("text.fontfile", "string", inputOptions.text.fontfile);
1610
+ }
1611
+ }
1612
+ if (is.defined(inputOptions.text.width)) {
1613
+ if (is.integer(inputOptions.text.width) && inputOptions.text.width > 0) {
1614
+ inputDescriptor.textWidth = inputOptions.text.width;
1615
+ } else {
1616
+ throw is.invalidParameterError("text.width", "positive integer", inputOptions.text.width);
1617
+ }
1618
+ }
1619
+ if (is.defined(inputOptions.text.height)) {
1620
+ if (is.integer(inputOptions.text.height) && inputOptions.text.height > 0) {
1621
+ inputDescriptor.textHeight = inputOptions.text.height;
1622
+ } else {
1623
+ throw is.invalidParameterError("text.height", "positive integer", inputOptions.text.height);
1624
+ }
1625
+ }
1626
+ if (is.defined(inputOptions.text.align)) {
1627
+ if (is.string(inputOptions.text.align) && is.string(this.constructor.align[inputOptions.text.align])) {
1628
+ inputDescriptor.textAlign = this.constructor.align[inputOptions.text.align];
1629
+ } else {
1630
+ throw is.invalidParameterError("text.align", "valid alignment", inputOptions.text.align);
1631
+ }
1632
+ }
1633
+ if (is.defined(inputOptions.text.justify)) {
1634
+ if (is.bool(inputOptions.text.justify)) {
1635
+ inputDescriptor.textJustify = inputOptions.text.justify;
1636
+ } else {
1637
+ throw is.invalidParameterError("text.justify", "boolean", inputOptions.text.justify);
1638
+ }
1639
+ }
1640
+ if (is.defined(inputOptions.text.dpi)) {
1641
+ if (is.integer(inputOptions.text.dpi) && is.inRange(inputOptions.text.dpi, 1, 1e6)) {
1642
+ inputDescriptor.textDpi = inputOptions.text.dpi;
1643
+ } else {
1644
+ throw is.invalidParameterError("text.dpi", "integer between 1 and 1000000", inputOptions.text.dpi);
1645
+ }
1646
+ }
1647
+ if (is.defined(inputOptions.text.rgba)) {
1648
+ if (is.bool(inputOptions.text.rgba)) {
1649
+ inputDescriptor.textRgba = inputOptions.text.rgba;
1650
+ } else {
1651
+ throw is.invalidParameterError("text.rgba", "bool", inputOptions.text.rgba);
1652
+ }
1653
+ }
1654
+ if (is.defined(inputOptions.text.spacing)) {
1655
+ if (is.integer(inputOptions.text.spacing) && is.inRange(inputOptions.text.spacing, -1e6, 1e6)) {
1656
+ inputDescriptor.textSpacing = inputOptions.text.spacing;
1657
+ } else {
1658
+ throw is.invalidParameterError("text.spacing", "integer between -1000000 and 1000000", inputOptions.text.spacing);
1659
+ }
1660
+ }
1661
+ if (is.defined(inputOptions.text.wrap)) {
1662
+ if (is.string(inputOptions.text.wrap) && is.inArray(inputOptions.text.wrap, ["word", "char", "word-char", "none"])) {
1663
+ inputDescriptor.textWrap = inputOptions.text.wrap;
1664
+ } else {
1665
+ throw is.invalidParameterError("text.wrap", "one of: word, char, word-char, none", inputOptions.text.wrap);
1666
+ }
1667
+ }
1668
+ delete inputDescriptor.buffer;
1669
+ } else {
1670
+ throw new Error("Expected a valid string to create an image with text.");
1671
+ }
1672
+ }
1673
+ } else if (is.defined(inputOptions)) {
1674
+ throw new Error("Invalid input options " + inputOptions);
1675
+ }
1676
+ return inputDescriptor;
1677
+ }
1678
+ function _write(chunk, encoding, callback) {
1679
+ if (Array.isArray(this.options.input.buffer)) {
1680
+ if (is.buffer(chunk)) {
1681
+ if (this.options.input.buffer.length === 0) {
1682
+ this.on("finish", () => {
1683
+ this.streamInFinished = true;
1684
+ });
1685
+ }
1686
+ this.options.input.buffer.push(chunk);
1687
+ callback();
1688
+ } else {
1689
+ callback(new Error("Non-Buffer data on Writable Stream"));
1690
+ }
1691
+ } else {
1692
+ callback(new Error("Unexpected data on Writable Stream"));
1693
+ }
1694
+ }
1695
+ function _flattenBufferIn() {
1696
+ if (this._isStreamInput()) {
1697
+ this.options.input.buffer = Buffer.concat(this.options.input.buffer);
1698
+ }
1699
+ }
1700
+ function _isStreamInput() {
1701
+ return Array.isArray(this.options.input.buffer);
1702
+ }
1703
+ function metadata(callback) {
1704
+ const stack = Error();
1705
+ if (is.fn(callback)) {
1706
+ if (this._isStreamInput()) {
1707
+ this.on("finish", () => {
1708
+ this._flattenBufferIn();
1709
+ sharp.metadata(this.options, (err, metadata2) => {
1710
+ if (err) {
1711
+ callback(is.nativeError(err, stack));
1712
+ } else {
1713
+ callback(null, metadata2);
1714
+ }
1715
+ });
1716
+ });
1717
+ } else {
1718
+ sharp.metadata(this.options, (err, metadata2) => {
1719
+ if (err) {
1720
+ callback(is.nativeError(err, stack));
1721
+ } else {
1722
+ callback(null, metadata2);
1723
+ }
1724
+ });
1725
+ }
1726
+ return this;
1727
+ } else {
1728
+ if (this._isStreamInput()) {
1729
+ return new Promise((resolve, reject) => {
1730
+ const finished = () => {
1731
+ this._flattenBufferIn();
1732
+ sharp.metadata(this.options, (err, metadata2) => {
1733
+ if (err) {
1734
+ reject(is.nativeError(err, stack));
1735
+ } else {
1736
+ resolve(metadata2);
1737
+ }
1738
+ });
1739
+ };
1740
+ if (this.writableFinished) {
1741
+ finished();
1742
+ } else {
1743
+ this.once("finish", finished);
1744
+ }
1745
+ });
1746
+ } else {
1747
+ return new Promise((resolve, reject) => {
1748
+ sharp.metadata(this.options, (err, metadata2) => {
1749
+ if (err) {
1750
+ reject(is.nativeError(err, stack));
1751
+ } else {
1752
+ resolve(metadata2);
1753
+ }
1754
+ });
1755
+ });
1756
+ }
1757
+ }
1758
+ }
1759
+ function stats(callback) {
1760
+ const stack = Error();
1761
+ if (is.fn(callback)) {
1762
+ if (this._isStreamInput()) {
1763
+ this.on("finish", () => {
1764
+ this._flattenBufferIn();
1765
+ sharp.stats(this.options, (err, stats2) => {
1766
+ if (err) {
1767
+ callback(is.nativeError(err, stack));
1768
+ } else {
1769
+ callback(null, stats2);
1770
+ }
1771
+ });
1772
+ });
1773
+ } else {
1774
+ sharp.stats(this.options, (err, stats2) => {
1775
+ if (err) {
1776
+ callback(is.nativeError(err, stack));
1777
+ } else {
1778
+ callback(null, stats2);
1779
+ }
1780
+ });
1781
+ }
1782
+ return this;
1783
+ } else {
1784
+ if (this._isStreamInput()) {
1785
+ return new Promise((resolve, reject) => {
1786
+ this.on("finish", function() {
1787
+ this._flattenBufferIn();
1788
+ sharp.stats(this.options, (err, stats2) => {
1789
+ if (err) {
1790
+ reject(is.nativeError(err, stack));
1791
+ } else {
1792
+ resolve(stats2);
1793
+ }
1794
+ });
1795
+ });
1796
+ });
1797
+ } else {
1798
+ return new Promise((resolve, reject) => {
1799
+ sharp.stats(this.options, (err, stats2) => {
1800
+ if (err) {
1801
+ reject(is.nativeError(err, stack));
1802
+ } else {
1803
+ resolve(stats2);
1804
+ }
1805
+ });
1806
+ });
1807
+ }
1808
+ }
1809
+ }
1810
+ module.exports = function(Sharp) {
1811
+ Object.assign(Sharp.prototype, {
1812
+ _inputOptionsFromObject,
1813
+ _createInputDescriptor,
1814
+ _write,
1815
+ _flattenBufferIn,
1816
+ _isStreamInput,
1817
+ metadata,
1818
+ stats
1819
+ });
1820
+ Sharp.align = align;
1821
+ };
1822
+ });
1823
+
1824
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/resize.js
1825
+ var require_resize = __commonJS((exports, module) => {
1826
+ var is = require_is();
1827
+ var gravity = {
1828
+ center: 0,
1829
+ centre: 0,
1830
+ north: 1,
1831
+ east: 2,
1832
+ south: 3,
1833
+ west: 4,
1834
+ northeast: 5,
1835
+ southeast: 6,
1836
+ southwest: 7,
1837
+ northwest: 8
1838
+ };
1839
+ var position = {
1840
+ top: 1,
1841
+ right: 2,
1842
+ bottom: 3,
1843
+ left: 4,
1844
+ "right top": 5,
1845
+ "right bottom": 6,
1846
+ "left bottom": 7,
1847
+ "left top": 8
1848
+ };
1849
+ var extendWith = {
1850
+ background: "background",
1851
+ copy: "copy",
1852
+ repeat: "repeat",
1853
+ mirror: "mirror"
1854
+ };
1855
+ var strategy = {
1856
+ entropy: 16,
1857
+ attention: 17
1858
+ };
1859
+ var kernel = {
1860
+ nearest: "nearest",
1861
+ linear: "linear",
1862
+ cubic: "cubic",
1863
+ mitchell: "mitchell",
1864
+ lanczos2: "lanczos2",
1865
+ lanczos3: "lanczos3"
1866
+ };
1867
+ var fit = {
1868
+ contain: "contain",
1869
+ cover: "cover",
1870
+ fill: "fill",
1871
+ inside: "inside",
1872
+ outside: "outside"
1873
+ };
1874
+ var mapFitToCanvas = {
1875
+ contain: "embed",
1876
+ cover: "crop",
1877
+ fill: "ignore_aspect",
1878
+ inside: "max",
1879
+ outside: "min"
1880
+ };
1881
+ function isRotationExpected(options) {
1882
+ return options.angle % 360 !== 0 || options.useExifOrientation === true || options.rotationAngle !== 0;
1883
+ }
1884
+ function isResizeExpected(options) {
1885
+ return options.width !== -1 || options.height !== -1;
1886
+ }
1887
+ function resize(widthOrOptions, height, options) {
1888
+ if (isResizeExpected(this.options)) {
1889
+ this.options.debuglog("ignoring previous resize options");
1890
+ }
1891
+ if (this.options.widthPost !== -1) {
1892
+ this.options.debuglog("operation order will be: extract, resize, extract");
1893
+ }
1894
+ if (is.defined(widthOrOptions)) {
1895
+ if (is.object(widthOrOptions) && !is.defined(options)) {
1896
+ options = widthOrOptions;
1897
+ } else if (is.integer(widthOrOptions) && widthOrOptions > 0) {
1898
+ this.options.width = widthOrOptions;
1899
+ } else {
1900
+ throw is.invalidParameterError("width", "positive integer", widthOrOptions);
1901
+ }
1902
+ } else {
1903
+ this.options.width = -1;
1904
+ }
1905
+ if (is.defined(height)) {
1906
+ if (is.integer(height) && height > 0) {
1907
+ this.options.height = height;
1908
+ } else {
1909
+ throw is.invalidParameterError("height", "positive integer", height);
1910
+ }
1911
+ } else {
1912
+ this.options.height = -1;
1913
+ }
1914
+ if (is.object(options)) {
1915
+ if (is.defined(options.width)) {
1916
+ if (is.integer(options.width) && options.width > 0) {
1917
+ this.options.width = options.width;
1918
+ } else {
1919
+ throw is.invalidParameterError("width", "positive integer", options.width);
1920
+ }
1921
+ }
1922
+ if (is.defined(options.height)) {
1923
+ if (is.integer(options.height) && options.height > 0) {
1924
+ this.options.height = options.height;
1925
+ } else {
1926
+ throw is.invalidParameterError("height", "positive integer", options.height);
1927
+ }
1928
+ }
1929
+ if (is.defined(options.fit)) {
1930
+ const canvas = mapFitToCanvas[options.fit];
1931
+ if (is.string(canvas)) {
1932
+ this.options.canvas = canvas;
1933
+ } else {
1934
+ throw is.invalidParameterError("fit", "valid fit", options.fit);
1935
+ }
1936
+ }
1937
+ if (is.defined(options.position)) {
1938
+ const pos = is.integer(options.position) ? options.position : strategy[options.position] || position[options.position] || gravity[options.position];
1939
+ if (is.integer(pos) && (is.inRange(pos, 0, 8) || is.inRange(pos, 16, 17))) {
1940
+ this.options.position = pos;
1941
+ } else {
1942
+ throw is.invalidParameterError("position", "valid position/gravity/strategy", options.position);
1943
+ }
1944
+ }
1945
+ this._setBackgroundColourOption("resizeBackground", options.background);
1946
+ if (is.defined(options.kernel)) {
1947
+ if (is.string(kernel[options.kernel])) {
1948
+ this.options.kernel = kernel[options.kernel];
1949
+ } else {
1950
+ throw is.invalidParameterError("kernel", "valid kernel name", options.kernel);
1951
+ }
1952
+ }
1953
+ if (is.defined(options.withoutEnlargement)) {
1954
+ this._setBooleanOption("withoutEnlargement", options.withoutEnlargement);
1955
+ }
1956
+ if (is.defined(options.withoutReduction)) {
1957
+ this._setBooleanOption("withoutReduction", options.withoutReduction);
1958
+ }
1959
+ if (is.defined(options.fastShrinkOnLoad)) {
1960
+ this._setBooleanOption("fastShrinkOnLoad", options.fastShrinkOnLoad);
1961
+ }
1962
+ }
1963
+ if (isRotationExpected(this.options) && isResizeExpected(this.options)) {
1964
+ this.options.rotateBeforePreExtract = true;
1965
+ }
1966
+ return this;
1967
+ }
1968
+ function extend(extend2) {
1969
+ if (is.integer(extend2) && extend2 > 0) {
1970
+ this.options.extendTop = extend2;
1971
+ this.options.extendBottom = extend2;
1972
+ this.options.extendLeft = extend2;
1973
+ this.options.extendRight = extend2;
1974
+ } else if (is.object(extend2)) {
1975
+ if (is.defined(extend2.top)) {
1976
+ if (is.integer(extend2.top) && extend2.top >= 0) {
1977
+ this.options.extendTop = extend2.top;
1978
+ } else {
1979
+ throw is.invalidParameterError("top", "positive integer", extend2.top);
1980
+ }
1981
+ }
1982
+ if (is.defined(extend2.bottom)) {
1983
+ if (is.integer(extend2.bottom) && extend2.bottom >= 0) {
1984
+ this.options.extendBottom = extend2.bottom;
1985
+ } else {
1986
+ throw is.invalidParameterError("bottom", "positive integer", extend2.bottom);
1987
+ }
1988
+ }
1989
+ if (is.defined(extend2.left)) {
1990
+ if (is.integer(extend2.left) && extend2.left >= 0) {
1991
+ this.options.extendLeft = extend2.left;
1992
+ } else {
1993
+ throw is.invalidParameterError("left", "positive integer", extend2.left);
1994
+ }
1995
+ }
1996
+ if (is.defined(extend2.right)) {
1997
+ if (is.integer(extend2.right) && extend2.right >= 0) {
1998
+ this.options.extendRight = extend2.right;
1999
+ } else {
2000
+ throw is.invalidParameterError("right", "positive integer", extend2.right);
2001
+ }
2002
+ }
2003
+ this._setBackgroundColourOption("extendBackground", extend2.background);
2004
+ if (is.defined(extend2.extendWith)) {
2005
+ if (is.string(extendWith[extend2.extendWith])) {
2006
+ this.options.extendWith = extendWith[extend2.extendWith];
2007
+ } else {
2008
+ throw is.invalidParameterError("extendWith", "one of: background, copy, repeat, mirror", extend2.extendWith);
2009
+ }
2010
+ }
2011
+ } else {
2012
+ throw is.invalidParameterError("extend", "integer or object", extend2);
2013
+ }
2014
+ return this;
2015
+ }
2016
+ function extract(options) {
2017
+ const suffix = isResizeExpected(this.options) || this.options.widthPre !== -1 ? "Post" : "Pre";
2018
+ if (this.options[`width${suffix}`] !== -1) {
2019
+ this.options.debuglog("ignoring previous extract options");
2020
+ }
2021
+ ["left", "top", "width", "height"].forEach(function(name) {
2022
+ const value = options[name];
2023
+ if (is.integer(value) && value >= 0) {
2024
+ this.options[name + (name === "left" || name === "top" ? "Offset" : "") + suffix] = value;
2025
+ } else {
2026
+ throw is.invalidParameterError(name, "integer", value);
2027
+ }
2028
+ }, this);
2029
+ if (isRotationExpected(this.options) && !isResizeExpected(this.options)) {
2030
+ if (this.options.widthPre === -1 || this.options.widthPost === -1) {
2031
+ this.options.rotateBeforePreExtract = true;
2032
+ }
2033
+ }
2034
+ return this;
2035
+ }
2036
+ function trim(options) {
2037
+ this.options.trimThreshold = 10;
2038
+ if (is.defined(options)) {
2039
+ if (is.object(options)) {
2040
+ if (is.defined(options.background)) {
2041
+ this._setBackgroundColourOption("trimBackground", options.background);
2042
+ }
2043
+ if (is.defined(options.threshold)) {
2044
+ if (is.number(options.threshold) && options.threshold >= 0) {
2045
+ this.options.trimThreshold = options.threshold;
2046
+ } else {
2047
+ throw is.invalidParameterError("threshold", "positive number", options.threshold);
2048
+ }
2049
+ }
2050
+ if (is.defined(options.lineArt)) {
2051
+ this._setBooleanOption("trimLineArt", options.lineArt);
2052
+ }
2053
+ } else {
2054
+ throw is.invalidParameterError("trim", "object", options);
2055
+ }
2056
+ }
2057
+ if (isRotationExpected(this.options)) {
2058
+ this.options.rotateBeforePreExtract = true;
2059
+ }
2060
+ return this;
2061
+ }
2062
+ module.exports = function(Sharp) {
2063
+ Object.assign(Sharp.prototype, {
2064
+ resize,
2065
+ extend,
2066
+ extract,
2067
+ trim
2068
+ });
2069
+ Sharp.gravity = gravity;
2070
+ Sharp.strategy = strategy;
2071
+ Sharp.kernel = kernel;
2072
+ Sharp.fit = fit;
2073
+ Sharp.position = position;
2074
+ };
2075
+ });
2076
+
2077
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/composite.js
2078
+ var require_composite = __commonJS((exports, module) => {
2079
+ var is = require_is();
2080
+ var blend = {
2081
+ clear: "clear",
2082
+ source: "source",
2083
+ over: "over",
2084
+ in: "in",
2085
+ out: "out",
2086
+ atop: "atop",
2087
+ dest: "dest",
2088
+ "dest-over": "dest-over",
2089
+ "dest-in": "dest-in",
2090
+ "dest-out": "dest-out",
2091
+ "dest-atop": "dest-atop",
2092
+ xor: "xor",
2093
+ add: "add",
2094
+ saturate: "saturate",
2095
+ multiply: "multiply",
2096
+ screen: "screen",
2097
+ overlay: "overlay",
2098
+ darken: "darken",
2099
+ lighten: "lighten",
2100
+ "colour-dodge": "colour-dodge",
2101
+ "color-dodge": "colour-dodge",
2102
+ "colour-burn": "colour-burn",
2103
+ "color-burn": "colour-burn",
2104
+ "hard-light": "hard-light",
2105
+ "soft-light": "soft-light",
2106
+ difference: "difference",
2107
+ exclusion: "exclusion"
2108
+ };
2109
+ function composite(images) {
2110
+ if (!Array.isArray(images)) {
2111
+ throw is.invalidParameterError("images to composite", "array", images);
2112
+ }
2113
+ this.options.composite = images.map((image) => {
2114
+ if (!is.object(image)) {
2115
+ throw is.invalidParameterError("image to composite", "object", image);
2116
+ }
2117
+ const inputOptions = this._inputOptionsFromObject(image);
2118
+ const composite2 = {
2119
+ input: this._createInputDescriptor(image.input, inputOptions, { allowStream: false }),
2120
+ blend: "over",
2121
+ tile: false,
2122
+ left: 0,
2123
+ top: 0,
2124
+ hasOffset: false,
2125
+ gravity: 0,
2126
+ premultiplied: false
2127
+ };
2128
+ if (is.defined(image.blend)) {
2129
+ if (is.string(blend[image.blend])) {
2130
+ composite2.blend = blend[image.blend];
2131
+ } else {
2132
+ throw is.invalidParameterError("blend", "valid blend name", image.blend);
2133
+ }
2134
+ }
2135
+ if (is.defined(image.tile)) {
2136
+ if (is.bool(image.tile)) {
2137
+ composite2.tile = image.tile;
2138
+ } else {
2139
+ throw is.invalidParameterError("tile", "boolean", image.tile);
2140
+ }
2141
+ }
2142
+ if (is.defined(image.left)) {
2143
+ if (is.integer(image.left)) {
2144
+ composite2.left = image.left;
2145
+ } else {
2146
+ throw is.invalidParameterError("left", "integer", image.left);
2147
+ }
2148
+ }
2149
+ if (is.defined(image.top)) {
2150
+ if (is.integer(image.top)) {
2151
+ composite2.top = image.top;
2152
+ } else {
2153
+ throw is.invalidParameterError("top", "integer", image.top);
2154
+ }
2155
+ }
2156
+ if (is.defined(image.top) !== is.defined(image.left)) {
2157
+ throw new Error("Expected both left and top to be set");
2158
+ } else {
2159
+ composite2.hasOffset = is.integer(image.top) && is.integer(image.left);
2160
+ }
2161
+ if (is.defined(image.gravity)) {
2162
+ if (is.integer(image.gravity) && is.inRange(image.gravity, 0, 8)) {
2163
+ composite2.gravity = image.gravity;
2164
+ } else if (is.string(image.gravity) && is.integer(this.constructor.gravity[image.gravity])) {
2165
+ composite2.gravity = this.constructor.gravity[image.gravity];
2166
+ } else {
2167
+ throw is.invalidParameterError("gravity", "valid gravity", image.gravity);
2168
+ }
2169
+ }
2170
+ if (is.defined(image.premultiplied)) {
2171
+ if (is.bool(image.premultiplied)) {
2172
+ composite2.premultiplied = image.premultiplied;
2173
+ } else {
2174
+ throw is.invalidParameterError("premultiplied", "boolean", image.premultiplied);
2175
+ }
2176
+ }
2177
+ return composite2;
2178
+ });
2179
+ return this;
2180
+ }
2181
+ module.exports = function(Sharp) {
2182
+ Sharp.prototype.composite = composite;
2183
+ Sharp.blend = blend;
2184
+ };
2185
+ });
2186
+
2187
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/operation.js
2188
+ var require_operation = __commonJS((exports, module) => {
2189
+ var color = require_color();
2190
+ var is = require_is();
2191
+ var vipsPrecision = {
2192
+ integer: "integer",
2193
+ float: "float",
2194
+ approximate: "approximate"
2195
+ };
2196
+ function rotate(angle, options) {
2197
+ if (this.options.useExifOrientation || this.options.angle || this.options.rotationAngle) {
2198
+ this.options.debuglog("ignoring previous rotate options");
2199
+ }
2200
+ if (!is.defined(angle)) {
2201
+ this.options.useExifOrientation = true;
2202
+ } else if (is.integer(angle) && !(angle % 90)) {
2203
+ this.options.angle = angle;
2204
+ } else if (is.number(angle)) {
2205
+ this.options.rotationAngle = angle;
2206
+ if (is.object(options) && options.background) {
2207
+ const backgroundColour = color(options.background);
2208
+ this.options.rotationBackground = [
2209
+ backgroundColour.red(),
2210
+ backgroundColour.green(),
2211
+ backgroundColour.blue(),
2212
+ Math.round(backgroundColour.alpha() * 255)
2213
+ ];
2214
+ }
2215
+ } else {
2216
+ throw is.invalidParameterError("angle", "numeric", angle);
2217
+ }
2218
+ return this;
2219
+ }
2220
+ function flip(flip2) {
2221
+ this.options.flip = is.bool(flip2) ? flip2 : true;
2222
+ return this;
2223
+ }
2224
+ function flop(flop2) {
2225
+ this.options.flop = is.bool(flop2) ? flop2 : true;
2226
+ return this;
2227
+ }
2228
+ function affine(matrix, options) {
2229
+ const flatMatrix = [].concat(...matrix);
2230
+ if (flatMatrix.length === 4 && flatMatrix.every(is.number)) {
2231
+ this.options.affineMatrix = flatMatrix;
2232
+ } else {
2233
+ throw is.invalidParameterError("matrix", "1x4 or 2x2 array", matrix);
2234
+ }
2235
+ if (is.defined(options)) {
2236
+ if (is.object(options)) {
2237
+ this._setBackgroundColourOption("affineBackground", options.background);
2238
+ if (is.defined(options.idx)) {
2239
+ if (is.number(options.idx)) {
2240
+ this.options.affineIdx = options.idx;
2241
+ } else {
2242
+ throw is.invalidParameterError("options.idx", "number", options.idx);
2243
+ }
2244
+ }
2245
+ if (is.defined(options.idy)) {
2246
+ if (is.number(options.idy)) {
2247
+ this.options.affineIdy = options.idy;
2248
+ } else {
2249
+ throw is.invalidParameterError("options.idy", "number", options.idy);
2250
+ }
2251
+ }
2252
+ if (is.defined(options.odx)) {
2253
+ if (is.number(options.odx)) {
2254
+ this.options.affineOdx = options.odx;
2255
+ } else {
2256
+ throw is.invalidParameterError("options.odx", "number", options.odx);
2257
+ }
2258
+ }
2259
+ if (is.defined(options.ody)) {
2260
+ if (is.number(options.ody)) {
2261
+ this.options.affineOdy = options.ody;
2262
+ } else {
2263
+ throw is.invalidParameterError("options.ody", "number", options.ody);
2264
+ }
2265
+ }
2266
+ if (is.defined(options.interpolator)) {
2267
+ if (is.inArray(options.interpolator, Object.values(this.constructor.interpolators))) {
2268
+ this.options.affineInterpolator = options.interpolator;
2269
+ } else {
2270
+ throw is.invalidParameterError("options.interpolator", "valid interpolator name", options.interpolator);
2271
+ }
2272
+ }
2273
+ } else {
2274
+ throw is.invalidParameterError("options", "object", options);
2275
+ }
2276
+ }
2277
+ return this;
2278
+ }
2279
+ function sharpen(options, flat, jagged) {
2280
+ if (!is.defined(options)) {
2281
+ this.options.sharpenSigma = -1;
2282
+ } else if (is.bool(options)) {
2283
+ this.options.sharpenSigma = options ? -1 : 0;
2284
+ } else if (is.number(options) && is.inRange(options, 0.01, 1e4)) {
2285
+ this.options.sharpenSigma = options;
2286
+ if (is.defined(flat)) {
2287
+ if (is.number(flat) && is.inRange(flat, 0, 1e4)) {
2288
+ this.options.sharpenM1 = flat;
2289
+ } else {
2290
+ throw is.invalidParameterError("flat", "number between 0 and 10000", flat);
2291
+ }
2292
+ }
2293
+ if (is.defined(jagged)) {
2294
+ if (is.number(jagged) && is.inRange(jagged, 0, 1e4)) {
2295
+ this.options.sharpenM2 = jagged;
2296
+ } else {
2297
+ throw is.invalidParameterError("jagged", "number between 0 and 10000", jagged);
2298
+ }
2299
+ }
2300
+ } else if (is.plainObject(options)) {
2301
+ if (is.number(options.sigma) && is.inRange(options.sigma, 0.000001, 10)) {
2302
+ this.options.sharpenSigma = options.sigma;
2303
+ } else {
2304
+ throw is.invalidParameterError("options.sigma", "number between 0.000001 and 10", options.sigma);
2305
+ }
2306
+ if (is.defined(options.m1)) {
2307
+ if (is.number(options.m1) && is.inRange(options.m1, 0, 1e6)) {
2308
+ this.options.sharpenM1 = options.m1;
2309
+ } else {
2310
+ throw is.invalidParameterError("options.m1", "number between 0 and 1000000", options.m1);
2311
+ }
2312
+ }
2313
+ if (is.defined(options.m2)) {
2314
+ if (is.number(options.m2) && is.inRange(options.m2, 0, 1e6)) {
2315
+ this.options.sharpenM2 = options.m2;
2316
+ } else {
2317
+ throw is.invalidParameterError("options.m2", "number between 0 and 1000000", options.m2);
2318
+ }
2319
+ }
2320
+ if (is.defined(options.x1)) {
2321
+ if (is.number(options.x1) && is.inRange(options.x1, 0, 1e6)) {
2322
+ this.options.sharpenX1 = options.x1;
2323
+ } else {
2324
+ throw is.invalidParameterError("options.x1", "number between 0 and 1000000", options.x1);
2325
+ }
2326
+ }
2327
+ if (is.defined(options.y2)) {
2328
+ if (is.number(options.y2) && is.inRange(options.y2, 0, 1e6)) {
2329
+ this.options.sharpenY2 = options.y2;
2330
+ } else {
2331
+ throw is.invalidParameterError("options.y2", "number between 0 and 1000000", options.y2);
2332
+ }
2333
+ }
2334
+ if (is.defined(options.y3)) {
2335
+ if (is.number(options.y3) && is.inRange(options.y3, 0, 1e6)) {
2336
+ this.options.sharpenY3 = options.y3;
2337
+ } else {
2338
+ throw is.invalidParameterError("options.y3", "number between 0 and 1000000", options.y3);
2339
+ }
2340
+ }
2341
+ } else {
2342
+ throw is.invalidParameterError("sigma", "number between 0.01 and 10000", options);
2343
+ }
2344
+ return this;
2345
+ }
2346
+ function median(size) {
2347
+ if (!is.defined(size)) {
2348
+ this.options.medianSize = 3;
2349
+ } else if (is.integer(size) && is.inRange(size, 1, 1000)) {
2350
+ this.options.medianSize = size;
2351
+ } else {
2352
+ throw is.invalidParameterError("size", "integer between 1 and 1000", size);
2353
+ }
2354
+ return this;
2355
+ }
2356
+ function blur(options) {
2357
+ let sigma;
2358
+ if (is.number(options)) {
2359
+ sigma = options;
2360
+ } else if (is.plainObject(options)) {
2361
+ if (!is.number(options.sigma)) {
2362
+ throw is.invalidParameterError("options.sigma", "number between 0.3 and 1000", sigma);
2363
+ }
2364
+ sigma = options.sigma;
2365
+ if ("precision" in options) {
2366
+ if (is.string(vipsPrecision[options.precision])) {
2367
+ this.options.precision = vipsPrecision[options.precision];
2368
+ } else {
2369
+ throw is.invalidParameterError("precision", "one of: integer, float, approximate", options.precision);
2370
+ }
2371
+ }
2372
+ if ("minAmplitude" in options) {
2373
+ if (is.number(options.minAmplitude) && is.inRange(options.minAmplitude, 0.001, 1)) {
2374
+ this.options.minAmpl = options.minAmplitude;
2375
+ } else {
2376
+ throw is.invalidParameterError("minAmplitude", "number between 0.001 and 1", options.minAmplitude);
2377
+ }
2378
+ }
2379
+ }
2380
+ if (!is.defined(options)) {
2381
+ this.options.blurSigma = -1;
2382
+ } else if (is.bool(options)) {
2383
+ this.options.blurSigma = options ? -1 : 0;
2384
+ } else if (is.number(sigma) && is.inRange(sigma, 0.3, 1000)) {
2385
+ this.options.blurSigma = sigma;
2386
+ } else {
2387
+ throw is.invalidParameterError("sigma", "number between 0.3 and 1000", sigma);
2388
+ }
2389
+ return this;
2390
+ }
2391
+ function flatten(options) {
2392
+ this.options.flatten = is.bool(options) ? options : true;
2393
+ if (is.object(options)) {
2394
+ this._setBackgroundColourOption("flattenBackground", options.background);
2395
+ }
2396
+ return this;
2397
+ }
2398
+ function unflatten() {
2399
+ this.options.unflatten = true;
2400
+ return this;
2401
+ }
2402
+ function gamma(gamma2, gammaOut) {
2403
+ if (!is.defined(gamma2)) {
2404
+ this.options.gamma = 2.2;
2405
+ } else if (is.number(gamma2) && is.inRange(gamma2, 1, 3)) {
2406
+ this.options.gamma = gamma2;
2407
+ } else {
2408
+ throw is.invalidParameterError("gamma", "number between 1.0 and 3.0", gamma2);
2409
+ }
2410
+ if (!is.defined(gammaOut)) {
2411
+ this.options.gammaOut = this.options.gamma;
2412
+ } else if (is.number(gammaOut) && is.inRange(gammaOut, 1, 3)) {
2413
+ this.options.gammaOut = gammaOut;
2414
+ } else {
2415
+ throw is.invalidParameterError("gammaOut", "number between 1.0 and 3.0", gammaOut);
2416
+ }
2417
+ return this;
2418
+ }
2419
+ function negate(options) {
2420
+ this.options.negate = is.bool(options) ? options : true;
2421
+ if (is.plainObject(options) && "alpha" in options) {
2422
+ if (!is.bool(options.alpha)) {
2423
+ throw is.invalidParameterError("alpha", "should be boolean value", options.alpha);
2424
+ } else {
2425
+ this.options.negateAlpha = options.alpha;
2426
+ }
2427
+ }
2428
+ return this;
2429
+ }
2430
+ function normalise(options) {
2431
+ if (is.plainObject(options)) {
2432
+ if (is.defined(options.lower)) {
2433
+ if (is.number(options.lower) && is.inRange(options.lower, 0, 99)) {
2434
+ this.options.normaliseLower = options.lower;
2435
+ } else {
2436
+ throw is.invalidParameterError("lower", "number between 0 and 99", options.lower);
2437
+ }
2438
+ }
2439
+ if (is.defined(options.upper)) {
2440
+ if (is.number(options.upper) && is.inRange(options.upper, 1, 100)) {
2441
+ this.options.normaliseUpper = options.upper;
2442
+ } else {
2443
+ throw is.invalidParameterError("upper", "number between 1 and 100", options.upper);
2444
+ }
2445
+ }
2446
+ }
2447
+ if (this.options.normaliseLower >= this.options.normaliseUpper) {
2448
+ throw is.invalidParameterError("range", "lower to be less than upper", `${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);
2449
+ }
2450
+ this.options.normalise = true;
2451
+ return this;
2452
+ }
2453
+ function normalize(options) {
2454
+ return this.normalise(options);
2455
+ }
2456
+ function clahe(options) {
2457
+ if (is.plainObject(options)) {
2458
+ if (is.integer(options.width) && options.width > 0) {
2459
+ this.options.claheWidth = options.width;
2460
+ } else {
2461
+ throw is.invalidParameterError("width", "integer greater than zero", options.width);
2462
+ }
2463
+ if (is.integer(options.height) && options.height > 0) {
2464
+ this.options.claheHeight = options.height;
2465
+ } else {
2466
+ throw is.invalidParameterError("height", "integer greater than zero", options.height);
2467
+ }
2468
+ if (is.defined(options.maxSlope)) {
2469
+ if (is.integer(options.maxSlope) && is.inRange(options.maxSlope, 0, 100)) {
2470
+ this.options.claheMaxSlope = options.maxSlope;
2471
+ } else {
2472
+ throw is.invalidParameterError("maxSlope", "integer between 0 and 100", options.maxSlope);
2473
+ }
2474
+ }
2475
+ } else {
2476
+ throw is.invalidParameterError("options", "plain object", options);
2477
+ }
2478
+ return this;
2479
+ }
2480
+ function convolve(kernel) {
2481
+ if (!is.object(kernel) || !Array.isArray(kernel.kernel) || !is.integer(kernel.width) || !is.integer(kernel.height) || !is.inRange(kernel.width, 3, 1001) || !is.inRange(kernel.height, 3, 1001) || kernel.height * kernel.width !== kernel.kernel.length) {
2482
+ throw new Error("Invalid convolution kernel");
2483
+ }
2484
+ if (!is.integer(kernel.scale)) {
2485
+ kernel.scale = kernel.kernel.reduce(function(a, b) {
2486
+ return a + b;
2487
+ }, 0);
2488
+ }
2489
+ if (kernel.scale < 1) {
2490
+ kernel.scale = 1;
2491
+ }
2492
+ if (!is.integer(kernel.offset)) {
2493
+ kernel.offset = 0;
2494
+ }
2495
+ this.options.convKernel = kernel;
2496
+ return this;
2497
+ }
2498
+ function threshold(threshold2, options) {
2499
+ if (!is.defined(threshold2)) {
2500
+ this.options.threshold = 128;
2501
+ } else if (is.bool(threshold2)) {
2502
+ this.options.threshold = threshold2 ? 128 : 0;
2503
+ } else if (is.integer(threshold2) && is.inRange(threshold2, 0, 255)) {
2504
+ this.options.threshold = threshold2;
2505
+ } else {
2506
+ throw is.invalidParameterError("threshold", "integer between 0 and 255", threshold2);
2507
+ }
2508
+ if (!is.object(options) || options.greyscale === true || options.grayscale === true) {
2509
+ this.options.thresholdGrayscale = true;
2510
+ } else {
2511
+ this.options.thresholdGrayscale = false;
2512
+ }
2513
+ return this;
2514
+ }
2515
+ function boolean(operand, operator, options) {
2516
+ this.options.boolean = this._createInputDescriptor(operand, options);
2517
+ if (is.string(operator) && is.inArray(operator, ["and", "or", "eor"])) {
2518
+ this.options.booleanOp = operator;
2519
+ } else {
2520
+ throw is.invalidParameterError("operator", "one of: and, or, eor", operator);
2521
+ }
2522
+ return this;
2523
+ }
2524
+ function linear(a, b) {
2525
+ if (!is.defined(a) && is.number(b)) {
2526
+ a = 1;
2527
+ } else if (is.number(a) && !is.defined(b)) {
2528
+ b = 0;
2529
+ }
2530
+ if (!is.defined(a)) {
2531
+ this.options.linearA = [];
2532
+ } else if (is.number(a)) {
2533
+ this.options.linearA = [a];
2534
+ } else if (Array.isArray(a) && a.length && a.every(is.number)) {
2535
+ this.options.linearA = a;
2536
+ } else {
2537
+ throw is.invalidParameterError("a", "number or array of numbers", a);
2538
+ }
2539
+ if (!is.defined(b)) {
2540
+ this.options.linearB = [];
2541
+ } else if (is.number(b)) {
2542
+ this.options.linearB = [b];
2543
+ } else if (Array.isArray(b) && b.length && b.every(is.number)) {
2544
+ this.options.linearB = b;
2545
+ } else {
2546
+ throw is.invalidParameterError("b", "number or array of numbers", b);
2547
+ }
2548
+ if (this.options.linearA.length !== this.options.linearB.length) {
2549
+ throw new Error("Expected a and b to be arrays of the same length");
2550
+ }
2551
+ return this;
2552
+ }
2553
+ function recomb(inputMatrix) {
2554
+ if (!Array.isArray(inputMatrix)) {
2555
+ throw is.invalidParameterError("inputMatrix", "array", inputMatrix);
2556
+ }
2557
+ if (inputMatrix.length !== 3 && inputMatrix.length !== 4) {
2558
+ throw is.invalidParameterError("inputMatrix", "3x3 or 4x4 array", inputMatrix.length);
2559
+ }
2560
+ const recombMatrix = inputMatrix.flat().map(Number);
2561
+ if (recombMatrix.length !== 9 && recombMatrix.length !== 16) {
2562
+ throw is.invalidParameterError("inputMatrix", "cardinality of 9 or 16", recombMatrix.length);
2563
+ }
2564
+ this.options.recombMatrix = recombMatrix;
2565
+ return this;
2566
+ }
2567
+ function modulate(options) {
2568
+ if (!is.plainObject(options)) {
2569
+ throw is.invalidParameterError("options", "plain object", options);
2570
+ }
2571
+ if ("brightness" in options) {
2572
+ if (is.number(options.brightness) && options.brightness >= 0) {
2573
+ this.options.brightness = options.brightness;
2574
+ } else {
2575
+ throw is.invalidParameterError("brightness", "number above zero", options.brightness);
2576
+ }
2577
+ }
2578
+ if ("saturation" in options) {
2579
+ if (is.number(options.saturation) && options.saturation >= 0) {
2580
+ this.options.saturation = options.saturation;
2581
+ } else {
2582
+ throw is.invalidParameterError("saturation", "number above zero", options.saturation);
2583
+ }
2584
+ }
2585
+ if ("hue" in options) {
2586
+ if (is.integer(options.hue)) {
2587
+ this.options.hue = options.hue % 360;
2588
+ } else {
2589
+ throw is.invalidParameterError("hue", "number", options.hue);
2590
+ }
2591
+ }
2592
+ if ("lightness" in options) {
2593
+ if (is.number(options.lightness)) {
2594
+ this.options.lightness = options.lightness;
2595
+ } else {
2596
+ throw is.invalidParameterError("lightness", "number", options.lightness);
2597
+ }
2598
+ }
2599
+ return this;
2600
+ }
2601
+ module.exports = function(Sharp) {
2602
+ Object.assign(Sharp.prototype, {
2603
+ rotate,
2604
+ flip,
2605
+ flop,
2606
+ affine,
2607
+ sharpen,
2608
+ median,
2609
+ blur,
2610
+ flatten,
2611
+ unflatten,
2612
+ gamma,
2613
+ negate,
2614
+ normalise,
2615
+ normalize,
2616
+ clahe,
2617
+ convolve,
2618
+ threshold,
2619
+ boolean,
2620
+ linear,
2621
+ recomb,
2622
+ modulate
2623
+ });
2624
+ };
2625
+ });
2626
+
2627
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/colour.js
2628
+ var require_colour = __commonJS((exports, module) => {
2629
+ var color = require_color();
2630
+ var is = require_is();
2631
+ var colourspace = {
2632
+ multiband: "multiband",
2633
+ "b-w": "b-w",
2634
+ bw: "b-w",
2635
+ cmyk: "cmyk",
2636
+ srgb: "srgb"
2637
+ };
2638
+ function tint(tint2) {
2639
+ this._setBackgroundColourOption("tint", tint2);
2640
+ return this;
2641
+ }
2642
+ function greyscale(greyscale2) {
2643
+ this.options.greyscale = is.bool(greyscale2) ? greyscale2 : true;
2644
+ return this;
2645
+ }
2646
+ function grayscale(grayscale2) {
2647
+ return this.greyscale(grayscale2);
2648
+ }
2649
+ function pipelineColourspace(colourspace2) {
2650
+ if (!is.string(colourspace2)) {
2651
+ throw is.invalidParameterError("colourspace", "string", colourspace2);
2652
+ }
2653
+ this.options.colourspacePipeline = colourspace2;
2654
+ return this;
2655
+ }
2656
+ function pipelineColorspace(colorspace) {
2657
+ return this.pipelineColourspace(colorspace);
2658
+ }
2659
+ function toColourspace(colourspace2) {
2660
+ if (!is.string(colourspace2)) {
2661
+ throw is.invalidParameterError("colourspace", "string", colourspace2);
2662
+ }
2663
+ this.options.colourspace = colourspace2;
2664
+ return this;
2665
+ }
2666
+ function toColorspace(colorspace) {
2667
+ return this.toColourspace(colorspace);
2668
+ }
2669
+ function _setBackgroundColourOption(key, value) {
2670
+ if (is.defined(value)) {
2671
+ if (is.object(value) || is.string(value)) {
2672
+ const colour = color(value);
2673
+ this.options[key] = [
2674
+ colour.red(),
2675
+ colour.green(),
2676
+ colour.blue(),
2677
+ Math.round(colour.alpha() * 255)
2678
+ ];
2679
+ } else {
2680
+ throw is.invalidParameterError("background", "object or string", value);
2681
+ }
2682
+ }
2683
+ }
2684
+ module.exports = function(Sharp) {
2685
+ Object.assign(Sharp.prototype, {
2686
+ tint,
2687
+ greyscale,
2688
+ grayscale,
2689
+ pipelineColourspace,
2690
+ pipelineColorspace,
2691
+ toColourspace,
2692
+ toColorspace,
2693
+ _setBackgroundColourOption
2694
+ });
2695
+ Sharp.colourspace = colourspace;
2696
+ Sharp.colorspace = colourspace;
2697
+ };
2698
+ });
2699
+
2700
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/channel.js
2701
+ var require_channel = __commonJS((exports, module) => {
2702
+ var is = require_is();
2703
+ var bool = {
2704
+ and: "and",
2705
+ or: "or",
2706
+ eor: "eor"
2707
+ };
2708
+ function removeAlpha() {
2709
+ this.options.removeAlpha = true;
2710
+ return this;
2711
+ }
2712
+ function ensureAlpha(alpha) {
2713
+ if (is.defined(alpha)) {
2714
+ if (is.number(alpha) && is.inRange(alpha, 0, 1)) {
2715
+ this.options.ensureAlpha = alpha;
2716
+ } else {
2717
+ throw is.invalidParameterError("alpha", "number between 0 and 1", alpha);
2718
+ }
2719
+ } else {
2720
+ this.options.ensureAlpha = 1;
2721
+ }
2722
+ return this;
2723
+ }
2724
+ function extractChannel(channel) {
2725
+ const channelMap = { red: 0, green: 1, blue: 2, alpha: 3 };
2726
+ if (Object.keys(channelMap).includes(channel)) {
2727
+ channel = channelMap[channel];
2728
+ }
2729
+ if (is.integer(channel) && is.inRange(channel, 0, 4)) {
2730
+ this.options.extractChannel = channel;
2731
+ } else {
2732
+ throw is.invalidParameterError("channel", "integer or one of: red, green, blue, alpha", channel);
2733
+ }
2734
+ return this;
2735
+ }
2736
+ function joinChannel(images, options) {
2737
+ if (Array.isArray(images)) {
2738
+ images.forEach(function(image) {
2739
+ this.options.joinChannelIn.push(this._createInputDescriptor(image, options));
2740
+ }, this);
2741
+ } else {
2742
+ this.options.joinChannelIn.push(this._createInputDescriptor(images, options));
2743
+ }
2744
+ return this;
2745
+ }
2746
+ function bandbool(boolOp) {
2747
+ if (is.string(boolOp) && is.inArray(boolOp, ["and", "or", "eor"])) {
2748
+ this.options.bandBoolOp = boolOp;
2749
+ } else {
2750
+ throw is.invalidParameterError("boolOp", "one of: and, or, eor", boolOp);
2751
+ }
2752
+ return this;
2753
+ }
2754
+ module.exports = function(Sharp) {
2755
+ Object.assign(Sharp.prototype, {
2756
+ removeAlpha,
2757
+ ensureAlpha,
2758
+ extractChannel,
2759
+ joinChannel,
2760
+ bandbool
2761
+ });
2762
+ Sharp.bool = bool;
2763
+ };
2764
+ });
2765
+
2766
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/output.js
2767
+ var require_output = __commonJS((exports, module) => {
2768
+ var path = __require("path");
2769
+ var is = require_is();
2770
+ var sharp = require_sharp();
2771
+ var formats = new Map([
2772
+ ["heic", "heif"],
2773
+ ["heif", "heif"],
2774
+ ["avif", "avif"],
2775
+ ["jpeg", "jpeg"],
2776
+ ["jpg", "jpeg"],
2777
+ ["jpe", "jpeg"],
2778
+ ["tile", "tile"],
2779
+ ["dz", "tile"],
2780
+ ["png", "png"],
2781
+ ["raw", "raw"],
2782
+ ["tiff", "tiff"],
2783
+ ["tif", "tiff"],
2784
+ ["webp", "webp"],
2785
+ ["gif", "gif"],
2786
+ ["jp2", "jp2"],
2787
+ ["jpx", "jp2"],
2788
+ ["j2k", "jp2"],
2789
+ ["j2c", "jp2"],
2790
+ ["jxl", "jxl"]
2791
+ ]);
2792
+ var jp2Regex = /\.(jp[2x]|j2[kc])$/i;
2793
+ var errJp2Save = () => new Error("JP2 output requires libvips with support for OpenJPEG");
2794
+ var bitdepthFromColourCount = (colours) => 1 << 31 - Math.clz32(Math.ceil(Math.log2(colours)));
2795
+ function toFile(fileOut, callback) {
2796
+ let err;
2797
+ if (!is.string(fileOut)) {
2798
+ err = new Error("Missing output file path");
2799
+ } else if (is.string(this.options.input.file) && path.resolve(this.options.input.file) === path.resolve(fileOut)) {
2800
+ err = new Error("Cannot use same file for input and output");
2801
+ } else if (jp2Regex.test(path.extname(fileOut)) && !this.constructor.format.jp2k.output.file) {
2802
+ err = errJp2Save();
2803
+ }
2804
+ if (err) {
2805
+ if (is.fn(callback)) {
2806
+ callback(err);
2807
+ } else {
2808
+ return Promise.reject(err);
2809
+ }
2810
+ } else {
2811
+ this.options.fileOut = fileOut;
2812
+ const stack = Error();
2813
+ return this._pipeline(callback, stack);
2814
+ }
2815
+ return this;
2816
+ }
2817
+ function toBuffer(options, callback) {
2818
+ if (is.object(options)) {
2819
+ this._setBooleanOption("resolveWithObject", options.resolveWithObject);
2820
+ } else if (this.options.resolveWithObject) {
2821
+ this.options.resolveWithObject = false;
2822
+ }
2823
+ this.options.fileOut = "";
2824
+ const stack = Error();
2825
+ return this._pipeline(is.fn(options) ? options : callback, stack);
2826
+ }
2827
+ function keepExif() {
2828
+ this.options.keepMetadata |= 1;
2829
+ return this;
2830
+ }
2831
+ function withExif(exif) {
2832
+ if (is.object(exif)) {
2833
+ for (const [ifd, entries] of Object.entries(exif)) {
2834
+ if (is.object(entries)) {
2835
+ for (const [k, v] of Object.entries(entries)) {
2836
+ if (is.string(v)) {
2837
+ this.options.withExif[`exif-${ifd.toLowerCase()}-${k}`] = v;
2838
+ } else {
2839
+ throw is.invalidParameterError(`${ifd}.${k}`, "string", v);
2840
+ }
2841
+ }
2842
+ } else {
2843
+ throw is.invalidParameterError(ifd, "object", entries);
2844
+ }
2845
+ }
2846
+ } else {
2847
+ throw is.invalidParameterError("exif", "object", exif);
2848
+ }
2849
+ this.options.withExifMerge = false;
2850
+ return this.keepExif();
2851
+ }
2852
+ function withExifMerge(exif) {
2853
+ this.withExif(exif);
2854
+ this.options.withExifMerge = true;
2855
+ return this;
2856
+ }
2857
+ function keepIccProfile() {
2858
+ this.options.keepMetadata |= 8;
2859
+ return this;
2860
+ }
2861
+ function withIccProfile(icc, options) {
2862
+ if (is.string(icc)) {
2863
+ this.options.withIccProfile = icc;
2864
+ } else {
2865
+ throw is.invalidParameterError("icc", "string", icc);
2866
+ }
2867
+ this.keepIccProfile();
2868
+ if (is.object(options)) {
2869
+ if (is.defined(options.attach)) {
2870
+ if (is.bool(options.attach)) {
2871
+ if (!options.attach) {
2872
+ this.options.keepMetadata &= ~8;
2873
+ }
2874
+ } else {
2875
+ throw is.invalidParameterError("attach", "boolean", options.attach);
2876
+ }
2877
+ }
2878
+ }
2879
+ return this;
2880
+ }
2881
+ function keepMetadata() {
2882
+ this.options.keepMetadata = 31;
2883
+ return this;
2884
+ }
2885
+ function withMetadata(options) {
2886
+ this.keepMetadata();
2887
+ this.withIccProfile("srgb");
2888
+ if (is.object(options)) {
2889
+ if (is.defined(options.orientation)) {
2890
+ if (is.integer(options.orientation) && is.inRange(options.orientation, 1, 8)) {
2891
+ this.options.withMetadataOrientation = options.orientation;
2892
+ } else {
2893
+ throw is.invalidParameterError("orientation", "integer between 1 and 8", options.orientation);
2894
+ }
2895
+ }
2896
+ if (is.defined(options.density)) {
2897
+ if (is.number(options.density) && options.density > 0) {
2898
+ this.options.withMetadataDensity = options.density;
2899
+ } else {
2900
+ throw is.invalidParameterError("density", "positive number", options.density);
2901
+ }
2902
+ }
2903
+ if (is.defined(options.icc)) {
2904
+ this.withIccProfile(options.icc);
2905
+ }
2906
+ if (is.defined(options.exif)) {
2907
+ this.withExifMerge(options.exif);
2908
+ }
2909
+ }
2910
+ return this;
2911
+ }
2912
+ function toFormat(format, options) {
2913
+ const actualFormat = formats.get((is.object(format) && is.string(format.id) ? format.id : format).toLowerCase());
2914
+ if (!actualFormat) {
2915
+ throw is.invalidParameterError("format", `one of: ${[...formats.keys()].join(", ")}`, format);
2916
+ }
2917
+ return this[actualFormat](options);
2918
+ }
2919
+ function jpeg(options) {
2920
+ if (is.object(options)) {
2921
+ if (is.defined(options.quality)) {
2922
+ if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
2923
+ this.options.jpegQuality = options.quality;
2924
+ } else {
2925
+ throw is.invalidParameterError("quality", "integer between 1 and 100", options.quality);
2926
+ }
2927
+ }
2928
+ if (is.defined(options.progressive)) {
2929
+ this._setBooleanOption("jpegProgressive", options.progressive);
2930
+ }
2931
+ if (is.defined(options.chromaSubsampling)) {
2932
+ if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ["4:2:0", "4:4:4"])) {
2933
+ this.options.jpegChromaSubsampling = options.chromaSubsampling;
2934
+ } else {
2935
+ throw is.invalidParameterError("chromaSubsampling", "one of: 4:2:0, 4:4:4", options.chromaSubsampling);
2936
+ }
2937
+ }
2938
+ const optimiseCoding = is.bool(options.optimizeCoding) ? options.optimizeCoding : options.optimiseCoding;
2939
+ if (is.defined(optimiseCoding)) {
2940
+ this._setBooleanOption("jpegOptimiseCoding", optimiseCoding);
2941
+ }
2942
+ if (is.defined(options.mozjpeg)) {
2943
+ if (is.bool(options.mozjpeg)) {
2944
+ if (options.mozjpeg) {
2945
+ this.options.jpegTrellisQuantisation = true;
2946
+ this.options.jpegOvershootDeringing = true;
2947
+ this.options.jpegOptimiseScans = true;
2948
+ this.options.jpegProgressive = true;
2949
+ this.options.jpegQuantisationTable = 3;
2950
+ }
2951
+ } else {
2952
+ throw is.invalidParameterError("mozjpeg", "boolean", options.mozjpeg);
2953
+ }
2954
+ }
2955
+ const trellisQuantisation = is.bool(options.trellisQuantization) ? options.trellisQuantization : options.trellisQuantisation;
2956
+ if (is.defined(trellisQuantisation)) {
2957
+ this._setBooleanOption("jpegTrellisQuantisation", trellisQuantisation);
2958
+ }
2959
+ if (is.defined(options.overshootDeringing)) {
2960
+ this._setBooleanOption("jpegOvershootDeringing", options.overshootDeringing);
2961
+ }
2962
+ const optimiseScans = is.bool(options.optimizeScans) ? options.optimizeScans : options.optimiseScans;
2963
+ if (is.defined(optimiseScans)) {
2964
+ this._setBooleanOption("jpegOptimiseScans", optimiseScans);
2965
+ if (optimiseScans) {
2966
+ this.options.jpegProgressive = true;
2967
+ }
2968
+ }
2969
+ const quantisationTable = is.number(options.quantizationTable) ? options.quantizationTable : options.quantisationTable;
2970
+ if (is.defined(quantisationTable)) {
2971
+ if (is.integer(quantisationTable) && is.inRange(quantisationTable, 0, 8)) {
2972
+ this.options.jpegQuantisationTable = quantisationTable;
2973
+ } else {
2974
+ throw is.invalidParameterError("quantisationTable", "integer between 0 and 8", quantisationTable);
2975
+ }
2976
+ }
2977
+ }
2978
+ return this._updateFormatOut("jpeg", options);
2979
+ }
2980
+ function png(options) {
2981
+ if (is.object(options)) {
2982
+ if (is.defined(options.progressive)) {
2983
+ this._setBooleanOption("pngProgressive", options.progressive);
2984
+ }
2985
+ if (is.defined(options.compressionLevel)) {
2986
+ if (is.integer(options.compressionLevel) && is.inRange(options.compressionLevel, 0, 9)) {
2987
+ this.options.pngCompressionLevel = options.compressionLevel;
2988
+ } else {
2989
+ throw is.invalidParameterError("compressionLevel", "integer between 0 and 9", options.compressionLevel);
2990
+ }
2991
+ }
2992
+ if (is.defined(options.adaptiveFiltering)) {
2993
+ this._setBooleanOption("pngAdaptiveFiltering", options.adaptiveFiltering);
2994
+ }
2995
+ const colours = options.colours || options.colors;
2996
+ if (is.defined(colours)) {
2997
+ if (is.integer(colours) && is.inRange(colours, 2, 256)) {
2998
+ this.options.pngBitdepth = bitdepthFromColourCount(colours);
2999
+ } else {
3000
+ throw is.invalidParameterError("colours", "integer between 2 and 256", colours);
3001
+ }
3002
+ }
3003
+ if (is.defined(options.palette)) {
3004
+ this._setBooleanOption("pngPalette", options.palette);
3005
+ } else if ([options.quality, options.effort, options.colours, options.colors, options.dither].some(is.defined)) {
3006
+ this._setBooleanOption("pngPalette", true);
3007
+ }
3008
+ if (this.options.pngPalette) {
3009
+ if (is.defined(options.quality)) {
3010
+ if (is.integer(options.quality) && is.inRange(options.quality, 0, 100)) {
3011
+ this.options.pngQuality = options.quality;
3012
+ } else {
3013
+ throw is.invalidParameterError("quality", "integer between 0 and 100", options.quality);
3014
+ }
3015
+ }
3016
+ if (is.defined(options.effort)) {
3017
+ if (is.integer(options.effort) && is.inRange(options.effort, 1, 10)) {
3018
+ this.options.pngEffort = options.effort;
3019
+ } else {
3020
+ throw is.invalidParameterError("effort", "integer between 1 and 10", options.effort);
3021
+ }
3022
+ }
3023
+ if (is.defined(options.dither)) {
3024
+ if (is.number(options.dither) && is.inRange(options.dither, 0, 1)) {
3025
+ this.options.pngDither = options.dither;
3026
+ } else {
3027
+ throw is.invalidParameterError("dither", "number between 0.0 and 1.0", options.dither);
3028
+ }
3029
+ }
3030
+ }
3031
+ }
3032
+ return this._updateFormatOut("png", options);
3033
+ }
3034
+ function webp(options) {
3035
+ if (is.object(options)) {
3036
+ if (is.defined(options.quality)) {
3037
+ if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
3038
+ this.options.webpQuality = options.quality;
3039
+ } else {
3040
+ throw is.invalidParameterError("quality", "integer between 1 and 100", options.quality);
3041
+ }
3042
+ }
3043
+ if (is.defined(options.alphaQuality)) {
3044
+ if (is.integer(options.alphaQuality) && is.inRange(options.alphaQuality, 0, 100)) {
3045
+ this.options.webpAlphaQuality = options.alphaQuality;
3046
+ } else {
3047
+ throw is.invalidParameterError("alphaQuality", "integer between 0 and 100", options.alphaQuality);
3048
+ }
3049
+ }
3050
+ if (is.defined(options.lossless)) {
3051
+ this._setBooleanOption("webpLossless", options.lossless);
3052
+ }
3053
+ if (is.defined(options.nearLossless)) {
3054
+ this._setBooleanOption("webpNearLossless", options.nearLossless);
3055
+ }
3056
+ if (is.defined(options.smartSubsample)) {
3057
+ this._setBooleanOption("webpSmartSubsample", options.smartSubsample);
3058
+ }
3059
+ if (is.defined(options.preset)) {
3060
+ if (is.string(options.preset) && is.inArray(options.preset, ["default", "photo", "picture", "drawing", "icon", "text"])) {
3061
+ this.options.webpPreset = options.preset;
3062
+ } else {
3063
+ throw is.invalidParameterError("preset", "one of: default, photo, picture, drawing, icon, text", options.preset);
3064
+ }
3065
+ }
3066
+ if (is.defined(options.effort)) {
3067
+ if (is.integer(options.effort) && is.inRange(options.effort, 0, 6)) {
3068
+ this.options.webpEffort = options.effort;
3069
+ } else {
3070
+ throw is.invalidParameterError("effort", "integer between 0 and 6", options.effort);
3071
+ }
3072
+ }
3073
+ if (is.defined(options.minSize)) {
3074
+ this._setBooleanOption("webpMinSize", options.minSize);
3075
+ }
3076
+ if (is.defined(options.mixed)) {
3077
+ this._setBooleanOption("webpMixed", options.mixed);
3078
+ }
3079
+ }
3080
+ trySetAnimationOptions(options, this.options);
3081
+ return this._updateFormatOut("webp", options);
3082
+ }
3083
+ function gif(options) {
3084
+ if (is.object(options)) {
3085
+ if (is.defined(options.reuse)) {
3086
+ this._setBooleanOption("gifReuse", options.reuse);
3087
+ }
3088
+ if (is.defined(options.progressive)) {
3089
+ this._setBooleanOption("gifProgressive", options.progressive);
3090
+ }
3091
+ const colours = options.colours || options.colors;
3092
+ if (is.defined(colours)) {
3093
+ if (is.integer(colours) && is.inRange(colours, 2, 256)) {
3094
+ this.options.gifBitdepth = bitdepthFromColourCount(colours);
3095
+ } else {
3096
+ throw is.invalidParameterError("colours", "integer between 2 and 256", colours);
3097
+ }
3098
+ }
3099
+ if (is.defined(options.effort)) {
3100
+ if (is.number(options.effort) && is.inRange(options.effort, 1, 10)) {
3101
+ this.options.gifEffort = options.effort;
3102
+ } else {
3103
+ throw is.invalidParameterError("effort", "integer between 1 and 10", options.effort);
3104
+ }
3105
+ }
3106
+ if (is.defined(options.dither)) {
3107
+ if (is.number(options.dither) && is.inRange(options.dither, 0, 1)) {
3108
+ this.options.gifDither = options.dither;
3109
+ } else {
3110
+ throw is.invalidParameterError("dither", "number between 0.0 and 1.0", options.dither);
3111
+ }
3112
+ }
3113
+ if (is.defined(options.interFrameMaxError)) {
3114
+ if (is.number(options.interFrameMaxError) && is.inRange(options.interFrameMaxError, 0, 32)) {
3115
+ this.options.gifInterFrameMaxError = options.interFrameMaxError;
3116
+ } else {
3117
+ throw is.invalidParameterError("interFrameMaxError", "number between 0.0 and 32.0", options.interFrameMaxError);
3118
+ }
3119
+ }
3120
+ if (is.defined(options.interPaletteMaxError)) {
3121
+ if (is.number(options.interPaletteMaxError) && is.inRange(options.interPaletteMaxError, 0, 256)) {
3122
+ this.options.gifInterPaletteMaxError = options.interPaletteMaxError;
3123
+ } else {
3124
+ throw is.invalidParameterError("interPaletteMaxError", "number between 0.0 and 256.0", options.interPaletteMaxError);
3125
+ }
3126
+ }
3127
+ }
3128
+ trySetAnimationOptions(options, this.options);
3129
+ return this._updateFormatOut("gif", options);
3130
+ }
3131
+ function jp2(options) {
3132
+ if (!this.constructor.format.jp2k.output.buffer) {
3133
+ throw errJp2Save();
3134
+ }
3135
+ if (is.object(options)) {
3136
+ if (is.defined(options.quality)) {
3137
+ if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
3138
+ this.options.jp2Quality = options.quality;
3139
+ } else {
3140
+ throw is.invalidParameterError("quality", "integer between 1 and 100", options.quality);
3141
+ }
3142
+ }
3143
+ if (is.defined(options.lossless)) {
3144
+ if (is.bool(options.lossless)) {
3145
+ this.options.jp2Lossless = options.lossless;
3146
+ } else {
3147
+ throw is.invalidParameterError("lossless", "boolean", options.lossless);
3148
+ }
3149
+ }
3150
+ if (is.defined(options.tileWidth)) {
3151
+ if (is.integer(options.tileWidth) && is.inRange(options.tileWidth, 1, 32768)) {
3152
+ this.options.jp2TileWidth = options.tileWidth;
3153
+ } else {
3154
+ throw is.invalidParameterError("tileWidth", "integer between 1 and 32768", options.tileWidth);
3155
+ }
3156
+ }
3157
+ if (is.defined(options.tileHeight)) {
3158
+ if (is.integer(options.tileHeight) && is.inRange(options.tileHeight, 1, 32768)) {
3159
+ this.options.jp2TileHeight = options.tileHeight;
3160
+ } else {
3161
+ throw is.invalidParameterError("tileHeight", "integer between 1 and 32768", options.tileHeight);
3162
+ }
3163
+ }
3164
+ if (is.defined(options.chromaSubsampling)) {
3165
+ if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ["4:2:0", "4:4:4"])) {
3166
+ this.options.jp2ChromaSubsampling = options.chromaSubsampling;
3167
+ } else {
3168
+ throw is.invalidParameterError("chromaSubsampling", "one of: 4:2:0, 4:4:4", options.chromaSubsampling);
3169
+ }
3170
+ }
3171
+ }
3172
+ return this._updateFormatOut("jp2", options);
3173
+ }
3174
+ function trySetAnimationOptions(source, target) {
3175
+ if (is.object(source) && is.defined(source.loop)) {
3176
+ if (is.integer(source.loop) && is.inRange(source.loop, 0, 65535)) {
3177
+ target.loop = source.loop;
3178
+ } else {
3179
+ throw is.invalidParameterError("loop", "integer between 0 and 65535", source.loop);
3180
+ }
3181
+ }
3182
+ if (is.object(source) && is.defined(source.delay)) {
3183
+ if (is.integer(source.delay) && is.inRange(source.delay, 0, 65535)) {
3184
+ target.delay = [source.delay];
3185
+ } else if (Array.isArray(source.delay) && source.delay.every(is.integer) && source.delay.every((v) => is.inRange(v, 0, 65535))) {
3186
+ target.delay = source.delay;
3187
+ } else {
3188
+ throw is.invalidParameterError("delay", "integer or an array of integers between 0 and 65535", source.delay);
3189
+ }
3190
+ }
3191
+ }
3192
+ function tiff(options) {
3193
+ if (is.object(options)) {
3194
+ if (is.defined(options.quality)) {
3195
+ if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
3196
+ this.options.tiffQuality = options.quality;
3197
+ } else {
3198
+ throw is.invalidParameterError("quality", "integer between 1 and 100", options.quality);
3199
+ }
3200
+ }
3201
+ if (is.defined(options.bitdepth)) {
3202
+ if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [1, 2, 4, 8])) {
3203
+ this.options.tiffBitdepth = options.bitdepth;
3204
+ } else {
3205
+ throw is.invalidParameterError("bitdepth", "1, 2, 4 or 8", options.bitdepth);
3206
+ }
3207
+ }
3208
+ if (is.defined(options.tile)) {
3209
+ this._setBooleanOption("tiffTile", options.tile);
3210
+ }
3211
+ if (is.defined(options.tileWidth)) {
3212
+ if (is.integer(options.tileWidth) && options.tileWidth > 0) {
3213
+ this.options.tiffTileWidth = options.tileWidth;
3214
+ } else {
3215
+ throw is.invalidParameterError("tileWidth", "integer greater than zero", options.tileWidth);
3216
+ }
3217
+ }
3218
+ if (is.defined(options.tileHeight)) {
3219
+ if (is.integer(options.tileHeight) && options.tileHeight > 0) {
3220
+ this.options.tiffTileHeight = options.tileHeight;
3221
+ } else {
3222
+ throw is.invalidParameterError("tileHeight", "integer greater than zero", options.tileHeight);
3223
+ }
3224
+ }
3225
+ if (is.defined(options.miniswhite)) {
3226
+ this._setBooleanOption("tiffMiniswhite", options.miniswhite);
3227
+ }
3228
+ if (is.defined(options.pyramid)) {
3229
+ this._setBooleanOption("tiffPyramid", options.pyramid);
3230
+ }
3231
+ if (is.defined(options.xres)) {
3232
+ if (is.number(options.xres) && options.xres > 0) {
3233
+ this.options.tiffXres = options.xres;
3234
+ } else {
3235
+ throw is.invalidParameterError("xres", "number greater than zero", options.xres);
3236
+ }
3237
+ }
3238
+ if (is.defined(options.yres)) {
3239
+ if (is.number(options.yres) && options.yres > 0) {
3240
+ this.options.tiffYres = options.yres;
3241
+ } else {
3242
+ throw is.invalidParameterError("yres", "number greater than zero", options.yres);
3243
+ }
3244
+ }
3245
+ if (is.defined(options.compression)) {
3246
+ if (is.string(options.compression) && is.inArray(options.compression, ["none", "jpeg", "deflate", "packbits", "ccittfax4", "lzw", "webp", "zstd", "jp2k"])) {
3247
+ this.options.tiffCompression = options.compression;
3248
+ } else {
3249
+ throw is.invalidParameterError("compression", "one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k", options.compression);
3250
+ }
3251
+ }
3252
+ if (is.defined(options.predictor)) {
3253
+ if (is.string(options.predictor) && is.inArray(options.predictor, ["none", "horizontal", "float"])) {
3254
+ this.options.tiffPredictor = options.predictor;
3255
+ } else {
3256
+ throw is.invalidParameterError("predictor", "one of: none, horizontal, float", options.predictor);
3257
+ }
3258
+ }
3259
+ if (is.defined(options.resolutionUnit)) {
3260
+ if (is.string(options.resolutionUnit) && is.inArray(options.resolutionUnit, ["inch", "cm"])) {
3261
+ this.options.tiffResolutionUnit = options.resolutionUnit;
3262
+ } else {
3263
+ throw is.invalidParameterError("resolutionUnit", "one of: inch, cm", options.resolutionUnit);
3264
+ }
3265
+ }
3266
+ }
3267
+ return this._updateFormatOut("tiff", options);
3268
+ }
3269
+ function avif(options) {
3270
+ return this.heif({ ...options, compression: "av1" });
3271
+ }
3272
+ function heif(options) {
3273
+ if (is.object(options)) {
3274
+ if (is.string(options.compression) && is.inArray(options.compression, ["av1", "hevc"])) {
3275
+ this.options.heifCompression = options.compression;
3276
+ } else {
3277
+ throw is.invalidParameterError("compression", "one of: av1, hevc", options.compression);
3278
+ }
3279
+ if (is.defined(options.quality)) {
3280
+ if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
3281
+ this.options.heifQuality = options.quality;
3282
+ } else {
3283
+ throw is.invalidParameterError("quality", "integer between 1 and 100", options.quality);
3284
+ }
3285
+ }
3286
+ if (is.defined(options.lossless)) {
3287
+ if (is.bool(options.lossless)) {
3288
+ this.options.heifLossless = options.lossless;
3289
+ } else {
3290
+ throw is.invalidParameterError("lossless", "boolean", options.lossless);
3291
+ }
3292
+ }
3293
+ if (is.defined(options.effort)) {
3294
+ if (is.integer(options.effort) && is.inRange(options.effort, 0, 9)) {
3295
+ this.options.heifEffort = options.effort;
3296
+ } else {
3297
+ throw is.invalidParameterError("effort", "integer between 0 and 9", options.effort);
3298
+ }
3299
+ }
3300
+ if (is.defined(options.chromaSubsampling)) {
3301
+ if (is.string(options.chromaSubsampling) && is.inArray(options.chromaSubsampling, ["4:2:0", "4:4:4"])) {
3302
+ this.options.heifChromaSubsampling = options.chromaSubsampling;
3303
+ } else {
3304
+ throw is.invalidParameterError("chromaSubsampling", "one of: 4:2:0, 4:4:4", options.chromaSubsampling);
3305
+ }
3306
+ }
3307
+ if (is.defined(options.bitdepth)) {
3308
+ if (is.integer(options.bitdepth) && is.inArray(options.bitdepth, [8, 10, 12])) {
3309
+ if (options.bitdepth !== 8 && this.constructor.versions.heif) {
3310
+ throw is.invalidParameterError("bitdepth when using prebuilt binaries", 8, options.bitdepth);
3311
+ }
3312
+ this.options.heifBitdepth = options.bitdepth;
3313
+ } else {
3314
+ throw is.invalidParameterError("bitdepth", "8, 10 or 12", options.bitdepth);
3315
+ }
3316
+ }
3317
+ } else {
3318
+ throw is.invalidParameterError("options", "Object", options);
3319
+ }
3320
+ return this._updateFormatOut("heif", options);
3321
+ }
3322
+ function jxl(options) {
3323
+ if (is.object(options)) {
3324
+ if (is.defined(options.quality)) {
3325
+ if (is.integer(options.quality) && is.inRange(options.quality, 1, 100)) {
3326
+ this.options.jxlDistance = options.quality >= 30 ? 0.1 + (100 - options.quality) * 0.09 : 53 / 3000 * options.quality * options.quality - 23 / 20 * options.quality + 25;
3327
+ } else {
3328
+ throw is.invalidParameterError("quality", "integer between 1 and 100", options.quality);
3329
+ }
3330
+ } else if (is.defined(options.distance)) {
3331
+ if (is.number(options.distance) && is.inRange(options.distance, 0, 15)) {
3332
+ this.options.jxlDistance = options.distance;
3333
+ } else {
3334
+ throw is.invalidParameterError("distance", "number between 0.0 and 15.0", options.distance);
3335
+ }
3336
+ }
3337
+ if (is.defined(options.decodingTier)) {
3338
+ if (is.integer(options.decodingTier) && is.inRange(options.decodingTier, 0, 4)) {
3339
+ this.options.jxlDecodingTier = options.decodingTier;
3340
+ } else {
3341
+ throw is.invalidParameterError("decodingTier", "integer between 0 and 4", options.decodingTier);
3342
+ }
3343
+ }
3344
+ if (is.defined(options.lossless)) {
3345
+ if (is.bool(options.lossless)) {
3346
+ this.options.jxlLossless = options.lossless;
3347
+ } else {
3348
+ throw is.invalidParameterError("lossless", "boolean", options.lossless);
3349
+ }
3350
+ }
3351
+ if (is.defined(options.effort)) {
3352
+ if (is.integer(options.effort) && is.inRange(options.effort, 3, 9)) {
3353
+ this.options.jxlEffort = options.effort;
3354
+ } else {
3355
+ throw is.invalidParameterError("effort", "integer between 3 and 9", options.effort);
3356
+ }
3357
+ }
3358
+ }
3359
+ return this._updateFormatOut("jxl", options);
3360
+ }
3361
+ function raw(options) {
3362
+ if (is.object(options)) {
3363
+ if (is.defined(options.depth)) {
3364
+ if (is.string(options.depth) && is.inArray(options.depth, ["char", "uchar", "short", "ushort", "int", "uint", "float", "complex", "double", "dpcomplex"])) {
3365
+ this.options.rawDepth = options.depth;
3366
+ } else {
3367
+ throw is.invalidParameterError("depth", "one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex", options.depth);
3368
+ }
3369
+ }
3370
+ }
3371
+ return this._updateFormatOut("raw");
3372
+ }
3373
+ function tile(options) {
3374
+ if (is.object(options)) {
3375
+ if (is.defined(options.size)) {
3376
+ if (is.integer(options.size) && is.inRange(options.size, 1, 8192)) {
3377
+ this.options.tileSize = options.size;
3378
+ } else {
3379
+ throw is.invalidParameterError("size", "integer between 1 and 8192", options.size);
3380
+ }
3381
+ }
3382
+ if (is.defined(options.overlap)) {
3383
+ if (is.integer(options.overlap) && is.inRange(options.overlap, 0, 8192)) {
3384
+ if (options.overlap > this.options.tileSize) {
3385
+ throw is.invalidParameterError("overlap", `<= size (${this.options.tileSize})`, options.overlap);
3386
+ }
3387
+ this.options.tileOverlap = options.overlap;
3388
+ } else {
3389
+ throw is.invalidParameterError("overlap", "integer between 0 and 8192", options.overlap);
3390
+ }
3391
+ }
3392
+ if (is.defined(options.container)) {
3393
+ if (is.string(options.container) && is.inArray(options.container, ["fs", "zip"])) {
3394
+ this.options.tileContainer = options.container;
3395
+ } else {
3396
+ throw is.invalidParameterError("container", "one of: fs, zip", options.container);
3397
+ }
3398
+ }
3399
+ if (is.defined(options.layout)) {
3400
+ if (is.string(options.layout) && is.inArray(options.layout, ["dz", "google", "iiif", "iiif3", "zoomify"])) {
3401
+ this.options.tileLayout = options.layout;
3402
+ } else {
3403
+ throw is.invalidParameterError("layout", "one of: dz, google, iiif, iiif3, zoomify", options.layout);
3404
+ }
3405
+ }
3406
+ if (is.defined(options.angle)) {
3407
+ if (is.integer(options.angle) && !(options.angle % 90)) {
3408
+ this.options.tileAngle = options.angle;
3409
+ } else {
3410
+ throw is.invalidParameterError("angle", "positive/negative multiple of 90", options.angle);
3411
+ }
3412
+ }
3413
+ this._setBackgroundColourOption("tileBackground", options.background);
3414
+ if (is.defined(options.depth)) {
3415
+ if (is.string(options.depth) && is.inArray(options.depth, ["onepixel", "onetile", "one"])) {
3416
+ this.options.tileDepth = options.depth;
3417
+ } else {
3418
+ throw is.invalidParameterError("depth", "one of: onepixel, onetile, one", options.depth);
3419
+ }
3420
+ }
3421
+ if (is.defined(options.skipBlanks)) {
3422
+ if (is.integer(options.skipBlanks) && is.inRange(options.skipBlanks, -1, 65535)) {
3423
+ this.options.tileSkipBlanks = options.skipBlanks;
3424
+ } else {
3425
+ throw is.invalidParameterError("skipBlanks", "integer between -1 and 255/65535", options.skipBlanks);
3426
+ }
3427
+ } else if (is.defined(options.layout) && options.layout === "google") {
3428
+ this.options.tileSkipBlanks = 5;
3429
+ }
3430
+ const centre = is.bool(options.center) ? options.center : options.centre;
3431
+ if (is.defined(centre)) {
3432
+ this._setBooleanOption("tileCentre", centre);
3433
+ }
3434
+ if (is.defined(options.id)) {
3435
+ if (is.string(options.id)) {
3436
+ this.options.tileId = options.id;
3437
+ } else {
3438
+ throw is.invalidParameterError("id", "string", options.id);
3439
+ }
3440
+ }
3441
+ if (is.defined(options.basename)) {
3442
+ if (is.string(options.basename)) {
3443
+ this.options.tileBasename = options.basename;
3444
+ } else {
3445
+ throw is.invalidParameterError("basename", "string", options.basename);
3446
+ }
3447
+ }
3448
+ }
3449
+ if (is.inArray(this.options.formatOut, ["jpeg", "png", "webp"])) {
3450
+ this.options.tileFormat = this.options.formatOut;
3451
+ } else if (this.options.formatOut !== "input") {
3452
+ throw is.invalidParameterError("format", "one of: jpeg, png, webp", this.options.formatOut);
3453
+ }
3454
+ return this._updateFormatOut("dz");
3455
+ }
3456
+ function timeout(options) {
3457
+ if (!is.plainObject(options)) {
3458
+ throw is.invalidParameterError("options", "object", options);
3459
+ }
3460
+ if (is.integer(options.seconds) && is.inRange(options.seconds, 0, 3600)) {
3461
+ this.options.timeoutSeconds = options.seconds;
3462
+ } else {
3463
+ throw is.invalidParameterError("seconds", "integer between 0 and 3600", options.seconds);
3464
+ }
3465
+ return this;
3466
+ }
3467
+ function _updateFormatOut(formatOut, options) {
3468
+ if (!(is.object(options) && options.force === false)) {
3469
+ this.options.formatOut = formatOut;
3470
+ }
3471
+ return this;
3472
+ }
3473
+ function _setBooleanOption(key, val) {
3474
+ if (is.bool(val)) {
3475
+ this.options[key] = val;
3476
+ } else {
3477
+ throw is.invalidParameterError(key, "boolean", val);
3478
+ }
3479
+ }
3480
+ function _read() {
3481
+ if (!this.options.streamOut) {
3482
+ this.options.streamOut = true;
3483
+ const stack = Error();
3484
+ this._pipeline(undefined, stack);
3485
+ }
3486
+ }
3487
+ function _pipeline(callback, stack) {
3488
+ if (typeof callback === "function") {
3489
+ if (this._isStreamInput()) {
3490
+ this.on("finish", () => {
3491
+ this._flattenBufferIn();
3492
+ sharp.pipeline(this.options, (err, data, info) => {
3493
+ if (err) {
3494
+ callback(is.nativeError(err, stack));
3495
+ } else {
3496
+ callback(null, data, info);
3497
+ }
3498
+ });
3499
+ });
3500
+ } else {
3501
+ sharp.pipeline(this.options, (err, data, info) => {
3502
+ if (err) {
3503
+ callback(is.nativeError(err, stack));
3504
+ } else {
3505
+ callback(null, data, info);
3506
+ }
3507
+ });
3508
+ }
3509
+ return this;
3510
+ } else if (this.options.streamOut) {
3511
+ if (this._isStreamInput()) {
3512
+ this.once("finish", () => {
3513
+ this._flattenBufferIn();
3514
+ sharp.pipeline(this.options, (err, data, info) => {
3515
+ if (err) {
3516
+ this.emit("error", is.nativeError(err, stack));
3517
+ } else {
3518
+ this.emit("info", info);
3519
+ this.push(data);
3520
+ }
3521
+ this.push(null);
3522
+ this.on("end", () => this.emit("close"));
3523
+ });
3524
+ });
3525
+ if (this.streamInFinished) {
3526
+ this.emit("finish");
3527
+ }
3528
+ } else {
3529
+ sharp.pipeline(this.options, (err, data, info) => {
3530
+ if (err) {
3531
+ this.emit("error", is.nativeError(err, stack));
3532
+ } else {
3533
+ this.emit("info", info);
3534
+ this.push(data);
3535
+ }
3536
+ this.push(null);
3537
+ this.on("end", () => this.emit("close"));
3538
+ });
3539
+ }
3540
+ return this;
3541
+ } else {
3542
+ if (this._isStreamInput()) {
3543
+ return new Promise((resolve, reject) => {
3544
+ this.once("finish", () => {
3545
+ this._flattenBufferIn();
3546
+ sharp.pipeline(this.options, (err, data, info) => {
3547
+ if (err) {
3548
+ reject(is.nativeError(err, stack));
3549
+ } else {
3550
+ if (this.options.resolveWithObject) {
3551
+ resolve({ data, info });
3552
+ } else {
3553
+ resolve(data);
3554
+ }
3555
+ }
3556
+ });
3557
+ });
3558
+ });
3559
+ } else {
3560
+ return new Promise((resolve, reject) => {
3561
+ sharp.pipeline(this.options, (err, data, info) => {
3562
+ if (err) {
3563
+ reject(is.nativeError(err, stack));
3564
+ } else {
3565
+ if (this.options.resolveWithObject) {
3566
+ resolve({ data, info });
3567
+ } else {
3568
+ resolve(data);
3569
+ }
3570
+ }
3571
+ });
3572
+ });
3573
+ }
3574
+ }
3575
+ }
3576
+ module.exports = function(Sharp) {
3577
+ Object.assign(Sharp.prototype, {
3578
+ toFile,
3579
+ toBuffer,
3580
+ keepExif,
3581
+ withExif,
3582
+ withExifMerge,
3583
+ keepIccProfile,
3584
+ withIccProfile,
3585
+ keepMetadata,
3586
+ withMetadata,
3587
+ toFormat,
3588
+ jpeg,
3589
+ jp2,
3590
+ png,
3591
+ webp,
3592
+ tiff,
3593
+ avif,
3594
+ heif,
3595
+ jxl,
3596
+ gif,
3597
+ raw,
3598
+ tile,
3599
+ timeout,
3600
+ _updateFormatOut,
3601
+ _setBooleanOption,
3602
+ _read,
3603
+ _pipeline
3604
+ });
3605
+ };
3606
+ });
3607
+
3608
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/utility.js
3609
+ var require_utility = __commonJS((exports, module) => {
3610
+ var events = __require("events");
3611
+ var detectLibc = require_detect_libc();
3612
+ var is = require_is();
3613
+ var { runtimePlatformArch } = require_libvips();
3614
+ var sharp = require_sharp();
3615
+ var runtimePlatform = runtimePlatformArch();
3616
+ var libvipsVersion = sharp.libvipsVersion();
3617
+ var format = sharp.format();
3618
+ format.heif.output.alias = ["avif", "heic"];
3619
+ format.jpeg.output.alias = ["jpe", "jpg"];
3620
+ format.tiff.output.alias = ["tif"];
3621
+ format.jp2k.output.alias = ["j2c", "j2k", "jp2", "jpx"];
3622
+ var interpolators = {
3623
+ nearest: "nearest",
3624
+ bilinear: "bilinear",
3625
+ bicubic: "bicubic",
3626
+ locallyBoundedBicubic: "lbb",
3627
+ nohalo: "nohalo",
3628
+ vertexSplitQuadraticBasisSpline: "vsqbs"
3629
+ };
3630
+ var versions = {
3631
+ vips: libvipsVersion.semver
3632
+ };
3633
+ if (!libvipsVersion.isGlobal) {
3634
+ if (!libvipsVersion.isWasm) {
3635
+ try {
3636
+ versions = __require(`@img/sharp-${runtimePlatform}/versions`);
3637
+ } catch (_) {
3638
+ try {
3639
+ versions = __require(`@img/sharp-libvips-${runtimePlatform}/versions`);
3640
+ } catch (_2) {}
3641
+ }
3642
+ } else {
3643
+ try {
3644
+ versions = (()=>{throw new Error("Cannot require module "+"@img/sharp-wasm32/versions");})();
3645
+ } catch (_) {}
3646
+ }
3647
+ }
3648
+ versions.sharp = require_package().version;
3649
+ if (versions.heif && format.heif) {
3650
+ format.heif.input.fileSuffix = [".avif"];
3651
+ format.heif.output.alias = ["avif"];
3652
+ }
3653
+ function cache(options) {
3654
+ if (is.bool(options)) {
3655
+ if (options) {
3656
+ return sharp.cache(50, 20, 100);
3657
+ } else {
3658
+ return sharp.cache(0, 0, 0);
3659
+ }
3660
+ } else if (is.object(options)) {
3661
+ return sharp.cache(options.memory, options.files, options.items);
3662
+ } else {
3663
+ return sharp.cache();
3664
+ }
3665
+ }
3666
+ cache(true);
3667
+ function concurrency(concurrency2) {
3668
+ return sharp.concurrency(is.integer(concurrency2) ? concurrency2 : null);
3669
+ }
3670
+ if (detectLibc.familySync() === detectLibc.GLIBC && !sharp._isUsingJemalloc()) {
3671
+ sharp.concurrency(1);
3672
+ } else if (detectLibc.familySync() === detectLibc.MUSL && sharp.concurrency() === 1024) {
3673
+ sharp.concurrency(__require("os").availableParallelism());
3674
+ }
3675
+ var queue = new events.EventEmitter;
3676
+ function counters() {
3677
+ return sharp.counters();
3678
+ }
3679
+ function simd(simd2) {
3680
+ return sharp.simd(is.bool(simd2) ? simd2 : null);
3681
+ }
3682
+ function block(options) {
3683
+ if (is.object(options)) {
3684
+ if (Array.isArray(options.operation) && options.operation.every(is.string)) {
3685
+ sharp.block(options.operation, true);
3686
+ } else {
3687
+ throw is.invalidParameterError("operation", "Array<string>", options.operation);
3688
+ }
3689
+ } else {
3690
+ throw is.invalidParameterError("options", "object", options);
3691
+ }
3692
+ }
3693
+ function unblock(options) {
3694
+ if (is.object(options)) {
3695
+ if (Array.isArray(options.operation) && options.operation.every(is.string)) {
3696
+ sharp.block(options.operation, false);
3697
+ } else {
3698
+ throw is.invalidParameterError("operation", "Array<string>", options.operation);
3699
+ }
3700
+ } else {
3701
+ throw is.invalidParameterError("options", "object", options);
3702
+ }
3703
+ }
3704
+ module.exports = function(Sharp) {
3705
+ Sharp.cache = cache;
3706
+ Sharp.concurrency = concurrency;
3707
+ Sharp.counters = counters;
3708
+ Sharp.simd = simd;
3709
+ Sharp.format = format;
3710
+ Sharp.interpolators = interpolators;
3711
+ Sharp.versions = versions;
3712
+ Sharp.queue = queue;
3713
+ Sharp.block = block;
3714
+ Sharp.unblock = unblock;
3715
+ };
3716
+ });
3717
+
3718
+ // node_modules/.bun/sharp@0.33.5/node_modules/sharp/lib/index.js
3719
+ var require_lib = __commonJS((exports, module) => {
3720
+ var Sharp = require_constructor();
3721
+ require_input()(Sharp);
3722
+ require_resize()(Sharp);
3723
+ require_composite()(Sharp);
3724
+ require_operation()(Sharp);
3725
+ require_colour()(Sharp);
3726
+ require_channel()(Sharp);
3727
+ require_output()(Sharp);
3728
+ require_utility()(Sharp);
3729
+ module.exports = Sharp;
3730
+ });
3731
+
3732
+ // packages/image-processor-napi/src/index.ts
3733
+ function createDarwinNativeModule() {
3734
+ return {
3735
+ hasClipboardImage() {
3736
+ try {
3737
+ const result = Bun.spawnSync({
3738
+ cmd: [
3739
+ "osascript",
3740
+ "-e",
3741
+ `try
3742
+ the clipboard as \xABclass PNGf\xBB
3743
+ return "yes"
3744
+ on error
3745
+ return "no"
3746
+ end try`
3747
+ ],
3748
+ stdout: "pipe",
3749
+ stderr: "pipe"
3750
+ });
3751
+ const output = result.stdout.toString().trim();
3752
+ return output === "yes";
3753
+ } catch {
3754
+ return false;
3755
+ }
3756
+ },
3757
+ readClipboardImage(maxWidth, maxHeight) {
3758
+ try {
3759
+ const tmpPath = `/tmp/claude_clipboard_native_${Date.now()}.png`;
3760
+ const script = `
3761
+ set png_data to (the clipboard as \xABclass PNGf\xBB)
3762
+ set fp to open for access POSIX file "${tmpPath}" with write permission
3763
+ write png_data to fp
3764
+ close access fp
3765
+ return "${tmpPath}"
3766
+ `;
3767
+ const result = Bun.spawnSync({
3768
+ cmd: ["osascript", "-e", script],
3769
+ stdout: "pipe",
3770
+ stderr: "pipe"
3771
+ });
3772
+ if (result.exitCode !== 0) {
3773
+ return null;
3774
+ }
3775
+ const file = Bun.file(tmpPath);
3776
+ const fs = __require("fs");
3777
+ const buffer = fs.readFileSync(tmpPath);
3778
+ try {
3779
+ fs.unlinkSync(tmpPath);
3780
+ } catch {}
3781
+ if (buffer.length === 0) {
3782
+ return null;
3783
+ }
3784
+ let width = 0;
3785
+ let height = 0;
3786
+ if (buffer.length > 24 && buffer[12] === 73 && buffer[13] === 72 && buffer[14] === 68 && buffer[15] === 82) {
3787
+ width = buffer.readUInt32BE(16);
3788
+ height = buffer.readUInt32BE(20);
3789
+ }
3790
+ const originalWidth = width;
3791
+ const originalHeight = height;
3792
+ if (maxWidth && maxHeight) {
3793
+ if (width > maxWidth || height > maxHeight) {
3794
+ const scale = Math.min(maxWidth / width, maxHeight / height);
3795
+ width = Math.round(width * scale);
3796
+ height = Math.round(height * scale);
3797
+ }
3798
+ }
3799
+ return {
3800
+ png: buffer,
3801
+ width,
3802
+ height,
3803
+ originalWidth,
3804
+ originalHeight
3805
+ };
3806
+ } catch {
3807
+ return null;
3808
+ }
3809
+ }
3810
+ };
3811
+ }
3812
+ function getNativeModule() {
3813
+ if (process.platform === "darwin") {
3814
+ return createDarwinNativeModule();
3815
+ }
3816
+ return null;
3817
+ }
3818
+ var import_sharp, sharp, src_default;
3819
+ var init_src = __esm(() => {
3820
+ import_sharp = __toESM(require_lib(), 1);
3821
+ sharp = import_sharp.default;
3822
+ src_default = sharp;
3823
+ });
3824
+ init_src();
3825
+
3826
+ export {
3827
+ sharp,
3828
+ getNativeModule,
3829
+ src_default as default
3830
+ };