gemi 0.116.0 → 0.117.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 (331) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/index.js +2 -2
  4. package/dist/app/index.js.map +1 -1
  5. package/dist/auth/AuthServiceProvider.d.ts.map +1 -1
  6. package/dist/auth/config.d.ts +27 -0
  7. package/dist/auth/config.d.ts.map +1 -1
  8. package/dist/auth/connections/ConnectionManager.d.ts +133 -0
  9. package/dist/auth/connections/ConnectionManager.d.ts.map +1 -0
  10. package/dist/auth/connections/ConnectionStore.d.ts +146 -0
  11. package/dist/auth/connections/ConnectionStore.d.ts.map +1 -0
  12. package/dist/auth/connections/ConnectionsController.d.ts +23 -0
  13. package/dist/auth/connections/ConnectionsController.d.ts.map +1 -0
  14. package/dist/auth/connections/OAuthConnectionProvider.d.ts +105 -0
  15. package/dist/auth/connections/OAuthConnectionProvider.d.ts.map +1 -0
  16. package/dist/auth/connections/errors.d.ts +32 -0
  17. package/dist/auth/connections/errors.d.ts.map +1 -0
  18. package/dist/auth/oauth/oauthState.d.ts +15 -2
  19. package/dist/auth/oauth/oauthState.d.ts.map +1 -1
  20. package/dist/auth/routes.d.ts +13 -0
  21. package/dist/auth/routes.d.ts.map +1 -1
  22. package/dist/bin/orm/emit.d.ts.map +1 -1
  23. package/dist/bin/orm-generator.js +51 -4
  24. package/dist/bin/orm-generator.js.map +4 -4
  25. package/dist/bun/plugin.js +2 -2
  26. package/dist/bun/plugin.js.map +1 -1
  27. package/dist/bun/preload.js +2 -2
  28. package/dist/bun/preload.js.map +1 -1
  29. package/dist/chunk-00n3gwr8.js +71 -0
  30. package/dist/chunk-00n3gwr8.js.map +13 -0
  31. package/dist/{chunk-t4yh4nf9.js → chunk-076jezzg.js} +3 -3
  32. package/dist/{chunk-t4yh4nf9.js.map → chunk-076jezzg.js.map} +1 -1
  33. package/dist/{chunk-qjhw8nje.js → chunk-077rea02.js} +1 -1
  34. package/dist/{chunk-6cx8ncd4.js → chunk-1ckha5dt.js} +3 -3
  35. package/dist/{chunk-6cx8ncd4.js.map → chunk-1ckha5dt.js.map} +1 -1
  36. package/dist/{chunk-mschc94q.js → chunk-1zzd39qg.js} +2 -2
  37. package/dist/{chunk-mschc94q.js.map → chunk-1zzd39qg.js.map} +1 -1
  38. package/dist/{chunk-5stgtwqw.js → chunk-2bja99cq.js} +2 -2
  39. package/dist/{chunk-5stgtwqw.js.map → chunk-2bja99cq.js.map} +1 -1
  40. package/dist/chunk-2czfefn2.js +10 -0
  41. package/dist/{chunk-yf1njzd5.js.map → chunk-2czfefn2.js.map} +5 -4
  42. package/dist/{chunk-aazmrxj9.js → chunk-37pk2cjg.js} +2 -2
  43. package/dist/{chunk-aazmrxj9.js.map → chunk-37pk2cjg.js.map} +1 -1
  44. package/dist/{chunk-qsrcdzan.js → chunk-3w4hk6q2.js} +3 -3
  45. package/dist/{chunk-qsrcdzan.js.map → chunk-3w4hk6q2.js.map} +1 -1
  46. package/dist/chunk-51w202vr.js +5 -0
  47. package/dist/{chunk-whtzggn6.js.map → chunk-51w202vr.js.map} +3 -4
  48. package/dist/{chunk-4088szy9.js → chunk-5m8vvtvn.js} +3 -3
  49. package/dist/{chunk-4088szy9.js.map → chunk-5m8vvtvn.js.map} +1 -1
  50. package/dist/{chunk-6d8rvr1v.js → chunk-5p4z1fgc.js} +2 -2
  51. package/dist/{chunk-6d8rvr1v.js.map → chunk-5p4z1fgc.js.map} +1 -1
  52. package/dist/{chunk-kejwjerj.js → chunk-5w6kyxsj.js} +2 -2
  53. package/dist/{chunk-kejwjerj.js.map → chunk-5w6kyxsj.js.map} +1 -1
  54. package/dist/{chunk-pyk3gzvc.js → chunk-62jw0vsf.js} +2 -2
  55. package/dist/{chunk-pyk3gzvc.js.map → chunk-62jw0vsf.js.map} +1 -1
  56. package/dist/chunk-63ewmmhc.js +5 -0
  57. package/dist/{chunk-1q9kd20m.js.map → chunk-63ewmmhc.js.map} +1 -1
  58. package/dist/{chunk-p1aqq0ga.js → chunk-6ggmk2eg.js} +3 -3
  59. package/dist/{chunk-p1aqq0ga.js.map → chunk-6ggmk2eg.js.map} +1 -1
  60. package/dist/{chunk-2tzm58j3.js → chunk-6y4nk9f1.js} +2 -2
  61. package/dist/{chunk-2tzm58j3.js.map → chunk-6y4nk9f1.js.map} +1 -1
  62. package/dist/{chunk-1hr4xht1.js → chunk-8gtc3s1y.js} +2 -2
  63. package/dist/{chunk-1hr4xht1.js.map → chunk-8gtc3s1y.js.map} +1 -1
  64. package/dist/{chunk-frerzsxq.js → chunk-a22h5cby.js} +2 -2
  65. package/dist/{chunk-frerzsxq.js.map → chunk-a22h5cby.js.map} +1 -1
  66. package/dist/{chunk-zyt2w03d.js → chunk-a32wfzdq.js} +2 -2
  67. package/dist/{chunk-zyt2w03d.js.map → chunk-a32wfzdq.js.map} +1 -1
  68. package/dist/{chunk-t04f3akb.js → chunk-a77586gv.js} +2 -2
  69. package/dist/{chunk-t04f3akb.js.map → chunk-a77586gv.js.map} +1 -1
  70. package/dist/chunk-a7r39713.js +5 -0
  71. package/dist/chunk-a7r39713.js.map +10 -0
  72. package/dist/{chunk-vxm6yevm.js → chunk-arwmvgrz.js} +2 -2
  73. package/dist/{chunk-vxm6yevm.js.map → chunk-arwmvgrz.js.map} +1 -1
  74. package/dist/{chunk-41da9628.js → chunk-bvqae0px.js} +1 -1
  75. package/dist/{chunk-d9mar37g.js → chunk-c2n6zdyd.js} +2 -2
  76. package/dist/{chunk-d9mar37g.js.map → chunk-c2n6zdyd.js.map} +1 -1
  77. package/dist/{chunk-56jky6vf.js → chunk-cytss9mb.js} +2 -2
  78. package/dist/{chunk-56jky6vf.js.map → chunk-cytss9mb.js.map} +1 -1
  79. package/dist/{chunk-vw8849ys.js → chunk-dcgvq79a.js} +2 -2
  80. package/dist/{chunk-m54s6jpr.js.map → chunk-dcgvq79a.js.map} +1 -1
  81. package/dist/{chunk-6chz1ktz.js → chunk-de4t48j9.js} +3 -3
  82. package/dist/{chunk-6chz1ktz.js.map → chunk-de4t48j9.js.map} +1 -1
  83. package/dist/{chunk-cbqazg9k.js → chunk-dz99g58c.js} +2 -2
  84. package/dist/{chunk-cbqazg9k.js.map → chunk-dz99g58c.js.map} +1 -1
  85. package/dist/{chunk-e573yxpq.js → chunk-e7ezmag9.js} +3 -3
  86. package/dist/{chunk-e573yxpq.js.map → chunk-e7ezmag9.js.map} +1 -1
  87. package/dist/{chunk-yer1r3t3.js → chunk-epvpmakp.js} +2 -2
  88. package/dist/{chunk-yer1r3t3.js.map → chunk-epvpmakp.js.map} +1 -1
  89. package/dist/{chunk-yhrye9cm.js → chunk-f8vcwzgd.js} +2 -2
  90. package/dist/{chunk-yhrye9cm.js.map → chunk-f8vcwzgd.js.map} +1 -1
  91. package/dist/chunk-fa37qzm3.js +5 -0
  92. package/dist/chunk-fa37qzm3.js.map +12 -0
  93. package/dist/{chunk-fxgxf16k.js → chunk-ffgmqwzy.js} +2 -2
  94. package/dist/{chunk-fxgxf16k.js.map → chunk-ffgmqwzy.js.map} +1 -1
  95. package/dist/{chunk-er3wf6ng.js → chunk-fk6nxhxn.js} +2 -2
  96. package/dist/{chunk-er3wf6ng.js.map → chunk-fk6nxhxn.js.map} +1 -1
  97. package/dist/{chunk-3hrj5rwm.js → chunk-fnwbbmnk.js} +2 -2
  98. package/dist/{chunk-3hrj5rwm.js.map → chunk-fnwbbmnk.js.map} +1 -1
  99. package/dist/chunk-g2wncay4.js +9 -0
  100. package/dist/{chunk-hytt9qyj.js.map → chunk-g2wncay4.js.map} +3 -4
  101. package/dist/{chunk-gts5p6mw.js → chunk-ge9xjwgq.js} +4 -4
  102. package/dist/{chunk-gts5p6mw.js.map → chunk-ge9xjwgq.js.map} +1 -1
  103. package/dist/{chunk-tw5kwbx4.js → chunk-gjy2qjcr.js} +2 -2
  104. package/dist/{chunk-tw5kwbx4.js.map → chunk-gjy2qjcr.js.map} +1 -1
  105. package/dist/{chunk-15c2vgaf.js → chunk-gn7kne7r.js} +2 -2
  106. package/dist/{chunk-15c2vgaf.js.map → chunk-gn7kne7r.js.map} +1 -1
  107. package/dist/{chunk-9n1hx3mq.js → chunk-hr61ekcr.js} +3 -3
  108. package/dist/{chunk-9n1hx3mq.js.map → chunk-hr61ekcr.js.map} +1 -1
  109. package/dist/{chunk-m54s6jpr.js → chunk-hvgmqt6z.js} +2 -2
  110. package/dist/{chunk-vw8849ys.js.map → chunk-hvgmqt6z.js.map} +1 -1
  111. package/dist/{chunk-aeh67ynz.js → chunk-hvpn18bb.js} +3 -3
  112. package/dist/{chunk-aeh67ynz.js.map → chunk-hvpn18bb.js.map} +1 -1
  113. package/dist/{chunk-jdhdrr2k.js → chunk-j1453bn1.js} +2 -2
  114. package/dist/{chunk-jdhdrr2k.js.map → chunk-j1453bn1.js.map} +1 -1
  115. package/dist/{chunk-tn2bryy2.js → chunk-jpetnpzn.js} +2 -2
  116. package/dist/{chunk-tn2bryy2.js.map → chunk-jpetnpzn.js.map} +1 -1
  117. package/dist/{chunk-v1tfdgy1.js → chunk-jqrs16g2.js} +3 -3
  118. package/dist/{chunk-v1tfdgy1.js.map → chunk-jqrs16g2.js.map} +1 -1
  119. package/dist/{chunk-4mfrgd5m.js → chunk-kk77x2v4.js} +2 -2
  120. package/dist/{chunk-4mfrgd5m.js.map → chunk-kk77x2v4.js.map} +1 -1
  121. package/dist/chunk-kpn7f58a.js +14 -0
  122. package/dist/{chunk-pn8v6fj2.js.map → chunk-kpn7f58a.js.map} +11 -6
  123. package/dist/chunk-mhteg4yz.js +57 -0
  124. package/dist/{chunk-ms9k0rx6.js.map → chunk-mhteg4yz.js.map} +15 -11
  125. package/dist/{chunk-n672d4g8.js → chunk-n9jyjp4a.js} +2 -2
  126. package/dist/{chunk-n672d4g8.js.map → chunk-n9jyjp4a.js.map} +1 -1
  127. package/dist/{chunk-vbdty91k.js → chunk-nb2gggba.js} +3 -3
  128. package/dist/{chunk-vbdty91k.js.map → chunk-nb2gggba.js.map} +1 -1
  129. package/dist/chunk-ntxsdchf.js +50 -0
  130. package/dist/chunk-ntxsdchf.js.map +10 -0
  131. package/dist/{chunk-2z1981d0.js → chunk-pepzecrm.js} +2 -2
  132. package/dist/{chunk-2z1981d0.js.map → chunk-pepzecrm.js.map} +1 -1
  133. package/dist/{chunk-785b41h1.js → chunk-pgy3mfxw.js} +3 -3
  134. package/dist/{chunk-785b41h1.js.map → chunk-pgy3mfxw.js.map} +1 -1
  135. package/dist/{chunk-98m15b9x.js → chunk-qhw0hej0.js} +2 -2
  136. package/dist/{chunk-98m15b9x.js.map → chunk-qhw0hej0.js.map} +1 -1
  137. package/dist/{chunk-303mprnv.js → chunk-r3v2cnrj.js} +2 -2
  138. package/dist/{chunk-303mprnv.js.map → chunk-r3v2cnrj.js.map} +1 -1
  139. package/dist/{chunk-ktr3k768.js → chunk-rhmpphhc.js} +3 -3
  140. package/dist/{chunk-ktr3k768.js.map → chunk-rhmpphhc.js.map} +1 -1
  141. package/dist/{chunk-fre6f4nk.js → chunk-s4f56035.js} +2 -2
  142. package/dist/{chunk-fre6f4nk.js.map → chunk-s4f56035.js.map} +1 -1
  143. package/dist/{chunk-sr942vb1.js → chunk-sj4f7x4p.js} +2 -2
  144. package/dist/{chunk-sr942vb1.js.map → chunk-sj4f7x4p.js.map} +1 -1
  145. package/dist/{chunk-wyw6p3fg.js → chunk-sksmnjkn.js} +3 -3
  146. package/dist/{chunk-wyw6p3fg.js.map → chunk-sksmnjkn.js.map} +1 -1
  147. package/dist/{chunk-kqxdsv22.js → chunk-stnd9qht.js} +2 -2
  148. package/dist/{chunk-kqxdsv22.js.map → chunk-stnd9qht.js.map} +1 -1
  149. package/dist/{chunk-1myhm0g3.js → chunk-t65074mw.js} +3 -3
  150. package/dist/{chunk-1myhm0g3.js.map → chunk-t65074mw.js.map} +1 -1
  151. package/dist/chunk-t87w4h84.js +24 -0
  152. package/dist/{chunk-79xg42e7.js.map → chunk-t87w4h84.js.map} +2 -2
  153. package/dist/{chunk-z10cas5r.js → chunk-thz75w6e.js} +2 -2
  154. package/dist/{chunk-z10cas5r.js.map → chunk-thz75w6e.js.map} +1 -1
  155. package/dist/{chunk-xt9tv99x.js → chunk-v8vnxkvp.js} +2 -2
  156. package/dist/{chunk-xt9tv99x.js.map → chunk-v8vnxkvp.js.map} +1 -1
  157. package/dist/{chunk-x7cpth2f.js → chunk-veq07rp8.js} +1 -1
  158. package/dist/{chunk-agyfv3f8.js → chunk-vj5necm0.js} +1 -1
  159. package/dist/{chunk-p91b8zcn.js → chunk-vtc23xpk.js} +2 -2
  160. package/dist/{chunk-p91b8zcn.js.map → chunk-vtc23xpk.js.map} +1 -1
  161. package/dist/{chunk-jmpw6bqz.js → chunk-w4e480he.js} +2 -2
  162. package/dist/{chunk-jmpw6bqz.js.map → chunk-w4e480he.js.map} +1 -1
  163. package/dist/{chunk-8rv62v14.js → chunk-wgb79ysr.js} +2 -2
  164. package/dist/{chunk-8rv62v14.js.map → chunk-wgb79ysr.js.map} +1 -1
  165. package/dist/{chunk-1vzks22y.js → chunk-wk1tp1f1.js} +2 -2
  166. package/dist/{chunk-1vzks22y.js.map → chunk-wk1tp1f1.js.map} +1 -1
  167. package/dist/{chunk-bra1a1fq.js → chunk-wwdbgshx.js} +2 -2
  168. package/dist/{chunk-bra1a1fq.js.map → chunk-wwdbgshx.js.map} +1 -1
  169. package/dist/{chunk-eqse2m6n.js → chunk-wzzrz612.js} +2 -2
  170. package/dist/{chunk-eqse2m6n.js.map → chunk-wzzrz612.js.map} +1 -1
  171. package/dist/{chunk-hdps9n52.js → chunk-x7qwx07b.js} +3 -3
  172. package/dist/{chunk-hdps9n52.js.map → chunk-x7qwx07b.js.map} +1 -1
  173. package/dist/chunk-x84as3vy.js +5 -0
  174. package/dist/chunk-x84as3vy.js.map +12 -0
  175. package/dist/chunk-y0en07zh.js +302 -0
  176. package/dist/chunk-y0en07zh.js.map +17 -0
  177. package/dist/{chunk-d2gfcf85.js → chunk-yfwrbfnw.js} +2 -2
  178. package/dist/{chunk-d2gfcf85.js.map → chunk-yfwrbfnw.js.map} +1 -1
  179. package/dist/{chunk-mazznq15.js → chunk-yhp6bvhj.js} +3 -3
  180. package/dist/{chunk-mazznq15.js.map → chunk-yhp6bvhj.js.map} +1 -1
  181. package/dist/{chunk-tzm3c7n6.js → chunk-yvtmygrk.js} +4 -4
  182. package/dist/{chunk-tzm3c7n6.js.map → chunk-yvtmygrk.js.map} +1 -1
  183. package/dist/{chunk-mqfzdfnz.js → chunk-zkjs3m5m.js} +2 -2
  184. package/dist/{chunk-mqfzdfnz.js.map → chunk-zkjs3m5m.js.map} +1 -1
  185. package/dist/chunk-zw6843j3.js +5 -0
  186. package/dist/chunk-zw6843j3.js.map +12 -0
  187. package/dist/client/Head.d.ts.map +1 -1
  188. package/dist/client/fonts.d.ts +69 -0
  189. package/dist/client/fonts.d.ts.map +1 -0
  190. package/dist/client/index.d.ts +1 -0
  191. package/dist/client/index.d.ts.map +1 -1
  192. package/dist/client/index.js +75 -1
  193. package/dist/client/index.js.map +1 -1
  194. package/dist/config/index.js +1 -1
  195. package/dist/console/builtins.d.ts +13 -0
  196. package/dist/console/builtins.d.ts.map +1 -0
  197. package/dist/console/run.js +13 -11
  198. package/dist/console/run.js.map +6 -5
  199. package/dist/console/runner.d.ts.map +1 -1
  200. package/dist/console/usage.d.ts +2 -0
  201. package/dist/console/usage.d.ts.map +1 -1
  202. package/dist/container/index.js +2 -2
  203. package/dist/container/index.js.map +1 -1
  204. package/dist/database/index.js +2 -2
  205. package/dist/database/index.js.map +1 -1
  206. package/dist/email/index.js +2 -2
  207. package/dist/email/index.js.map +1 -1
  208. package/dist/facades/Connections.d.ts +36 -0
  209. package/dist/facades/Connections.d.ts.map +1 -0
  210. package/dist/facades/Crypt.d.ts +26 -0
  211. package/dist/facades/Crypt.d.ts.map +1 -0
  212. package/dist/facades/Meta.d.ts +7 -1
  213. package/dist/facades/Meta.d.ts.map +1 -1
  214. package/dist/facades/Storage.d.ts +29 -0
  215. package/dist/facades/Storage.d.ts.map +1 -1
  216. package/dist/facades/index.d.ts +2 -0
  217. package/dist/facades/index.d.ts.map +1 -1
  218. package/dist/facades/index.js +2 -2
  219. package/dist/facades/index.js.map +1 -1
  220. package/dist/foundation/index.js +2 -2
  221. package/dist/foundation/index.js.map +1 -1
  222. package/dist/http/HttpRequest.d.ts +1 -0
  223. package/dist/http/HttpRequest.d.ts.map +1 -1
  224. package/dist/http/Metadata.d.ts +5 -0
  225. package/dist/http/Metadata.d.ts.map +1 -1
  226. package/dist/http/index.d.ts +3 -1
  227. package/dist/http/index.d.ts.map +1 -1
  228. package/dist/http/index.js +2 -2
  229. package/dist/http/index.js.map +1 -1
  230. package/dist/http/requestContext.d.ts +1 -0
  231. package/dist/http/requestContext.d.ts.map +1 -1
  232. package/dist/http/safeFetch/errors.d.ts +10 -0
  233. package/dist/http/safeFetch/errors.d.ts.map +1 -1
  234. package/dist/http/safeFetch/index.d.ts +1 -1
  235. package/dist/http/safeFetch/index.d.ts.map +1 -1
  236. package/dist/http/sitemap/Robots.d.ts +95 -0
  237. package/dist/http/sitemap/Robots.d.ts.map +1 -0
  238. package/dist/http/sitemap/Sitemap.d.ts +145 -0
  239. package/dist/http/sitemap/Sitemap.d.ts.map +1 -0
  240. package/dist/http/sitemap/fetchText.d.ts +16 -0
  241. package/dist/http/sitemap/fetchText.d.ts.map +1 -0
  242. package/dist/http/sitemap/index.d.ts +3 -0
  243. package/dist/http/sitemap/index.d.ts.map +1 -0
  244. package/dist/http/sitemap/xml.d.ts +21 -0
  245. package/dist/http/sitemap/xml.d.ts.map +1 -0
  246. package/dist/i18n/Translator.d.ts.map +1 -1
  247. package/dist/i18n/dictionaryRuntime.js +2 -2
  248. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  249. package/dist/i18n/index.d.ts +1 -1
  250. package/dist/i18n/index.d.ts.map +1 -1
  251. package/dist/i18n/index.js +2 -2
  252. package/dist/i18n/index.js.map +2 -2
  253. package/dist/i18n/resolveLocale.d.ts +18 -0
  254. package/dist/i18n/resolveLocale.d.ts.map +1 -1
  255. package/dist/kernel/index.js +3 -3
  256. package/dist/kernel/index.js.map +3 -3
  257. package/dist/kernel/providers.d.ts +2 -2
  258. package/dist/kernel/providers.d.ts.map +1 -1
  259. package/dist/orm/Model.d.ts.map +1 -1
  260. package/dist/orm/encryption-rotate.d.ts +44 -0
  261. package/dist/orm/encryption-rotate.d.ts.map +1 -0
  262. package/dist/orm/encryption.d.ts +54 -0
  263. package/dist/orm/encryption.d.ts.map +1 -0
  264. package/dist/orm/index.d.ts +2 -0
  265. package/dist/orm/index.d.ts.map +1 -1
  266. package/dist/orm/index.js +3 -3
  267. package/dist/orm/index.js.map +4 -4
  268. package/dist/orm/schema.d.ts +25 -1
  269. package/dist/orm/schema.d.ts.map +1 -1
  270. package/dist/server/index.js +2 -2
  271. package/dist/server/index.js.map +1 -1
  272. package/dist/services/encryption/Encrypter.d.ts +86 -0
  273. package/dist/services/encryption/Encrypter.d.ts.map +1 -0
  274. package/dist/services/encryption/EncryptionServiceProvider.d.ts +13 -0
  275. package/dist/services/encryption/EncryptionServiceProvider.d.ts.map +1 -0
  276. package/dist/services/encryption/config.d.ts +36 -0
  277. package/dist/services/encryption/config.d.ts.map +1 -0
  278. package/dist/services/file-storage/drivers/FileStorageDriver.d.ts +12 -1
  279. package/dist/services/file-storage/drivers/FileStorageDriver.d.ts.map +1 -1
  280. package/dist/services/file-storage/drivers/FileSystemDriver.d.ts +8 -1
  281. package/dist/services/file-storage/drivers/FileSystemDriver.d.ts.map +1 -1
  282. package/dist/services/file-storage/drivers/types.d.ts +17 -0
  283. package/dist/services/file-storage/drivers/types.d.ts.map +1 -1
  284. package/dist/services/file-storage/putFromUrl.d.ts +56 -0
  285. package/dist/services/file-storage/putFromUrl.d.ts.map +1 -0
  286. package/dist/services/file-storage/sniffContentType.d.ts +33 -0
  287. package/dist/services/file-storage/sniffContentType.d.ts.map +1 -0
  288. package/dist/services/index.d.ts +18 -4
  289. package/dist/services/index.d.ts.map +1 -1
  290. package/dist/services/index.js +10 -10
  291. package/dist/services/index.js.map +4 -3
  292. package/dist/services/queue/DatabaseQueueDriver.d.ts +96 -7
  293. package/dist/services/queue/DatabaseQueueDriver.d.ts.map +1 -1
  294. package/dist/services/queue/Job.d.ts +72 -0
  295. package/dist/services/queue/Job.d.ts.map +1 -1
  296. package/dist/services/queue/MemoryQueueDriver.d.ts +22 -2
  297. package/dist/services/queue/MemoryQueueDriver.d.ts.map +1 -1
  298. package/dist/services/queue/QueueDriver.d.ts +74 -1
  299. package/dist/services/queue/QueueDriver.d.ts.map +1 -1
  300. package/dist/services/queue/QueueManager.d.ts +47 -0
  301. package/dist/services/queue/QueueManager.d.ts.map +1 -1
  302. package/dist/services/queue/batch.d.ts +112 -0
  303. package/dist/services/queue/batch.d.ts.map +1 -0
  304. package/dist/services/queue/queueDriverContract.d.ts +5 -0
  305. package/dist/services/queue/queueDriverContract.d.ts.map +1 -1
  306. package/dist/services/queue/work.js +2 -2
  307. package/dist/services/queue/work.js.map +1 -1
  308. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  309. package/dist/stats/route-table.js +1 -1
  310. package/dist/support/index.js +2 -2
  311. package/dist/support/index.js.map +1 -1
  312. package/dist/vitest/index.js +2 -2
  313. package/dist/vitest/index.js.map +1 -1
  314. package/package.json +1 -1
  315. package/dist/chunk-1q9kd20m.js +0 -5
  316. package/dist/chunk-49nyyjfe.js +0 -5
  317. package/dist/chunk-49nyyjfe.js.map +0 -11
  318. package/dist/chunk-79xg42e7.js +0 -24
  319. package/dist/chunk-7vb4eey2.js +0 -217
  320. package/dist/chunk-7vb4eey2.js.map +0 -16
  321. package/dist/chunk-hytt9qyj.js +0 -54
  322. package/dist/chunk-jmg2zsaf.js +0 -5
  323. package/dist/chunk-jmg2zsaf.js.map +0 -12
  324. package/dist/chunk-ms9k0rx6.js +0 -46
  325. package/dist/chunk-pn8v6fj2.js +0 -14
  326. package/dist/chunk-whtzggn6.js +0 -5
  327. package/dist/chunk-yf1njzd5.js +0 -10
  328. /package/dist/{chunk-qjhw8nje.js.map → chunk-077rea02.js.map} +0 -0
  329. /package/dist/{chunk-41da9628.js.map → chunk-bvqae0px.js.map} +0 -0
  330. /package/dist/{chunk-x7cpth2f.js.map → chunk-veq07rp8.js.map} +0 -0
  331. /package/dist/{chunk-agyfv3f8.js.map → chunk-vj5necm0.js.map} +0 -0
@@ -0,0 +1,5 @@
1
+ // @bun
2
+ var _=/^[a-z]{2,3}(?:[-_][a-z0-9]{2,8})*$/i;function I(j){return _.test(j)}function U(j){return j.split(/[-_]/)[0].toLowerCase()}function H(j,B,N){let R=j?.split(";")[0].trim();if(!R||!I(R))return null;let W=R.replaceAll("_","-").toLowerCase(),J=B.find((X)=>X.toLowerCase()===W);if(J)return J;let K=U(R),S=B.filter((X)=>U(X)===K);if(S.length===0)return null;if(N&&S.includes(N))return N;return S[0]}var C=/^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/;function V(j){let B=[];for(let N of j.split(",")){let[R,...W]=N.split(";"),J=R.trim();if(!J||J!=="*"&&!I(J))continue;let K=1,S=!0;for(let X of W){let[z,O=""]=X.split("=");if(z.trim().toLowerCase()!=="q")continue;let Q=O.trim();if(!C.test(Q)){S=!1;break}K=Number(Q)}if(S)B.push({tag:J,q:K,index:B.length})}return B.sort((N,R)=>R.q-N.q||N.index-R.index)}function E(j,B){let N=j.replaceAll("_","-").toLowerCase(),R=B.replaceAll("_","-").toLowerCase();return R===N||R.startsWith(`${N}-`)}function M(j,B,N){if(!j||B.length===0)return null;let R=V(j),W=R.filter((S)=>S.q===0&&S.tag!=="*").map((S)=>S.tag),J=B.filter((S)=>!W.some((X)=>E(X,S)));if(J.length===0)return null;let K=!1;for(let{tag:S,q:X}of R){if(X===0)continue;if(S==="*"){K=!0;continue}let z=H(S,J,N);if(z)return z}if(!K)return null;return(N&&J.includes(N)?N:J[0])??null}var y="UTC";function G(j){if(typeof j!=="string"||j.length===0)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:j}),!0}catch{return!1}}var Y=new Map,F=500;function $(j,B){let N=Y.get(j);if(N===void 0){if(Y.size>=F)Y.delete(Y.keys().next().value);N=B(),Y.set(j,N)}return N}function P(j){return j instanceof Date?j:new Date(j)}function D(j){return j.dateStyle!==void 0||j.timeStyle!==void 0||j.weekday!==void 0||j.era!==void 0||j.year!==void 0||j.month!==void 0||j.day!==void 0||j.dayPeriod!==void 0||j.hour!==void 0||j.minute!==void 0||j.second!==void 0||j.fractionalSecondDigits!==void 0||j.timeZoneName!==void 0}function x(j){let{locale:B,timeZone:N}=j,R=(J={})=>{let K={...J,timeZone:J.timeZone??N};return $(`dt|${B}|${JSON.stringify(K)}`,()=>{return new Intl.DateTimeFormat(B,K)})},W=(J,K)=>{if(J&&D(J))return J;return{...K,...J}};return{locale:B,timeZone:N,date(J,K){return R(W(K,{dateStyle:"medium"})).format(P(J))},time(J,K){return R(W(K,{timeStyle:"short"})).format(P(J))},dateTime(J,K){return R(W(K,{dateStyle:"medium",timeStyle:"short"})).format(P(J))},number(J,K={}){return $(`n|${B}|${JSON.stringify(K)}`,()=>new Intl.NumberFormat(B,K)).format(J)},relative(J,K,S={}){return $(`r|${B}|${JSON.stringify(S)}`,()=>new Intl.RelativeTimeFormat(B,S)).format(J,K)},list(J,K={}){return $(`l|${B}|${JSON.stringify(K)}`,()=>new Intl.ListFormat(B,K)).format(J)},plural(J,K={}){return $(`p|${B}|${JSON.stringify(K)}`,()=>new Intl.PluralRules(B,K)).select(J)},dateTimeFormat:R}}class b{config;static token="translator";translations={};isEnabled=!1;constructor(j){this.config=j;if(!G(this.config.timeZone))throw Error(`translation.timeZone: "${String(this.config.timeZone)}" is not a time zone this runtime knows. Use an IANA name such as "UTC" or "Europe/Istanbul".`);let B={};for(let[N,R]of Object.entries(this.config.prefetch))for(let W of this.config.supportedLocales){if(!B[W])B[W]={};B[W][N]={};for(let J of R){B[W][N][J.name]={};for(let[K,S]of Object.entries(J.dictionary))this.isEnabled=!0,B[W][N][J.name][K]=S[W]}}this.translations=B}get isLocaleAware(){return this.isEnabled||this.config.supportedLocales.length>0}get supportedLocales(){return this.config.supportedLocales}get defaultLocale(){return this.config.defaultLocale}get components(){return this.config.components}get timeZone(){return this.config.timeZone}detectTimeZone(j){if(j){let B=this.config.detectTimeZone(j);if(G(B))return B}return this.config.timeZone}formatter(j,B){return x({locale:j||this.defaultLocale,timeZone:G(B)?B:this.timeZone})}onLocaleChange(j){return this.config.onLocaleChange(j)}detectLocale(j){let B=this.config.defaultLocale??this.config.supportedLocales[0]??"en-US",N=(K)=>H(K,this.config.supportedLocales,this.config.defaultLocale),R=N(this.config.detectLocale(j));if(R)return R;let W=N(j.cookies.get("i18n-locale"));if(W)return W;let J=M(j.headers.get("accept-language"),this.config.supportedLocales,this.config.defaultLocale);if(J)return J;return B}getPageTranslations(j,B){if(this.translations[j][B])return this.translations[j][B];return{}}}
3
+ export{H as xi,M as yi,y as zi,G as Ai,x as Bi,b as Ci};
4
+
5
+ //# debugId=A5B69EB2D1A7185764756E2164756E21
@@ -0,0 +1,12 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../i18n/resolveLocale.ts", "../i18n/formatter.ts", "../i18n/Translator.ts"],
4
+ "sourcesContent": [
5
+ "// A BCP 47-ish tag: a 2–3 letter language, then any number of subtags. Loose on\n// purpose — it only has to tell `en`, `de-AT` and `zh-Hant-TW` apart from path\n// segments like `blog` or `settings`.\nconst LOCALE_TAG = /^[a-z]{2,3}(?:[-_][a-z0-9]{2,8})*$/i;\n\nexport function looksLikeLocale(segment: string): boolean {\n return LOCALE_TAG.test(segment);\n}\n\nfunction languageOf(tag: string): string {\n return tag.split(/[-_]/)[0].toLowerCase();\n}\n\n/**\n * Maps a requested locale onto one the app supports, or `null` when none fits.\n *\n * An exact match wins, ignoring case (`en-us` → `en-US`). Otherwise the tag\n * falls back to a supported locale of the same language, so a short tag\n * resolves to its long form (`en` → `en-US`) and an unsupported region to a\n * supported one (`de-AT` → `de-DE`). When several share the language, the\n * default locale is preferred, then the first in `supportedLocales`.\n */\nexport function resolveLocale(\n requested: string | null | undefined,\n supportedLocales: string[],\n defaultLocale?: string,\n): string | null {\n // An `Accept-Language` entry may carry a weight: `de-AT;q=0.9`.\n const tag = requested?.split(\";\")[0].trim();\n if (!tag || !looksLikeLocale(tag)) {\n return null;\n }\n\n const normalized = tag.replaceAll(\"_\", \"-\").toLowerCase();\n const exact = supportedLocales.find((l) => l.toLowerCase() === normalized);\n if (exact) {\n return exact;\n }\n\n const language = languageOf(tag);\n const sameLanguage = supportedLocales.filter((l) => languageOf(l) === language);\n if (sameLanguage.length === 0) {\n return null;\n }\n if (defaultLocale && sameLanguage.includes(defaultLocale)) {\n return defaultLocale;\n }\n return sameLanguage[0];\n}\n\n// RFC 9110 §12.4.2: a weight is 0–1 with at most three decimals.\nconst Q_VALUE = /^(?:0(?:\\.\\d{0,3})?|1(?:\\.0{0,3})?)$/;\n\ntype LanguageRange = { tag: string; q: number };\n\n/**\n * Parses an `Accept-Language` header into its ranges, most preferred first:\n * by weight, then by position. An entry with a malformed weight or tag is\n * skipped; `q=0` entries are kept (they mark a language as unacceptable).\n */\nfunction parseAcceptLanguage(header: string): LanguageRange[] {\n const ranges: (LanguageRange & { index: number })[] = [];\n for (const entry of header.split(\",\")) {\n const [rawTag, ...params] = entry.split(\";\");\n const tag = rawTag.trim();\n if (!tag || (tag !== \"*\" && !looksLikeLocale(tag))) {\n continue;\n }\n let q = 1;\n let valid = true;\n for (const param of params) {\n const [name, value = \"\"] = param.split(\"=\");\n if (name.trim().toLowerCase() !== \"q\") {\n continue;\n }\n const weight = value.trim();\n if (!Q_VALUE.test(weight)) {\n valid = false;\n break;\n }\n q = Number(weight);\n }\n if (valid) {\n ranges.push({ tag, q, index: ranges.length });\n }\n }\n return ranges.sort((a, b) => b.q - a.q || a.index - b.index);\n}\n\n/** Does the language range `range` (`de`, `de-AT`) cover `locale`? (RFC 4647 basic filtering) */\nfunction rangeCovers(range: string, locale: string): boolean {\n const r = range.replaceAll(\"_\", \"-\").toLowerCase();\n const l = locale.replaceAll(\"_\", \"-\").toLowerCase();\n return l === r || l.startsWith(`${r}-`);\n}\n\n/**\n * Picks the best of `supportedLocales` for a whole `Accept-Language` header,\n * or `null` when none fits.\n *\n * Entries are tried by `q` weight, highest first (ties keep header order), and\n * each is matched with {@link resolveLocale}, so `de-AT` falls back to `de`.\n * An entry with `q=0` rules out every supported locale it covers (`de;q=0`\n * rules out `de` and `de-DE`). A `*` entry, when nothing more specific fits,\n * resolves to `defaultLocale` (or the first supported locale) unless that is\n * ruled out. Malformed entries are skipped.\n *\n * ```ts\n * negotiateLocale(\"de-AT,de;q=0.9,en;q=0.5\", [\"en\", \"de\"], \"en\"); // \"de\"\n * negotiateLocale(\"fr\", [\"en\", \"de\"], \"en\"); // null\n * negotiateLocale(\"fr,*;q=0.1\", [\"en\", \"de\"], \"en\"); // \"en\"\n * ```\n */\nexport function negotiateLocale(\n acceptLanguage: string | null | undefined,\n supportedLocales: string[],\n defaultLocale?: string,\n): string | null {\n if (!acceptLanguage || supportedLocales.length === 0) {\n return null;\n }\n\n const ranges = parseAcceptLanguage(acceptLanguage);\n const excluded = ranges.filter((r) => r.q === 0 && r.tag !== \"*\").map((r) => r.tag);\n const candidates = supportedLocales.filter(\n (locale) => !excluded.some((range) => rangeCovers(range, locale)),\n );\n if (candidates.length === 0) {\n return null;\n }\n\n let wildcard = false;\n for (const { tag, q } of ranges) {\n if (q === 0) {\n continue;\n }\n if (tag === \"*\") {\n wildcard = true;\n continue;\n }\n const locale = resolveLocale(tag, candidates, defaultLocale);\n if (locale) {\n return locale;\n }\n }\n\n if (!wildcard) {\n return null;\n }\n return (defaultLocale && candidates.includes(defaultLocale) ? defaultLocale : candidates[0]) ?? null;\n}\n",
6
+ "/**\n * Locale- and time-zone-aware formatting, shared by `useFormatter`, the\n * `format` property of a `useDictionary` result and `Lang.formatter()`.\n *\n * Dependency-free on purpose: components import it, so it must not pull in the\n * server facades.\n *\n * Why the time zone is pinned: a `Date` formatted with no `timeZone` uses the\n * runtime's zone, which is the server's during SSR and the viewer's in the\n * browser. The two disagree for anyone not sitting in the server's zone, so the\n * same instant can print a different hour, or a different day, on each side —\n * a hydration mismatch at best, a wrong date at worst. Every formatter here\n * carries one zone, resolved on the server and shipped with the page, so both\n * sides print the same text.\n */\n\nexport type DateInput = Date | number | string;\n\nexport interface FormatterInit {\n /** BCP 47 locale tag. */\n locale: string;\n /** IANA time zone, such as `UTC` or `Europe/Istanbul`. */\n timeZone: string;\n}\n\nexport interface Formatter {\n readonly locale: string;\n readonly timeZone: string;\n /** A date, `{ dateStyle: \"medium\" }` unless options are given. */\n date(value: DateInput, options?: Intl.DateTimeFormatOptions): string;\n /** A time of day, `{ timeStyle: \"short\" }` unless options are given. */\n time(value: DateInput, options?: Intl.DateTimeFormatOptions): string;\n /** Date and time, `{ dateStyle: \"medium\", timeStyle: \"short\" }` unless options are given. */\n dateTime(value: DateInput, options?: Intl.DateTimeFormatOptions): string;\n number(value: number | bigint, options?: Intl.NumberFormatOptions): string;\n relative(\n value: number,\n unit: Intl.RelativeTimeFormatUnit,\n options?: Intl.RelativeTimeFormatOptions,\n ): string;\n list(values: Iterable<string>, options?: Intl.ListFormatOptions): string;\n /** The CLDR plural category for `count`: `one`, `few`, `other`, … */\n plural(count: number, options?: Intl.PluralRulesOptions): Intl.LDMLPluralRule;\n /**\n * The cached `Intl.DateTimeFormat` behind `date`/`time`/`dateTime`, with the\n * formatter's zone applied. For `formatToParts` or `formatRange`.\n */\n dateTimeFormat(options?: Intl.DateTimeFormatOptions): Intl.DateTimeFormat;\n}\n\n/** The zone used when the app configures none. */\nexport const DEFAULT_TIME_ZONE = \"UTC\";\n\n/**\n * Whether `timeZone` is an IANA zone (or offset) this runtime's `Intl` accepts.\n * An unknown zone makes `Intl.DateTimeFormat` throw a `RangeError`, so a zone\n * that comes from a cookie or a user record is checked before it is trusted.\n */\nexport function isValidTimeZone(timeZone: unknown): timeZone is string {\n if (typeof timeZone !== \"string\" || timeZone.length === 0) {\n return false;\n }\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone });\n return true;\n } catch {\n return false;\n }\n}\n\n// Constructing an `Intl` formatter is the expensive part — it resolves locale\n// data — so each one is built once per (kind, locale, options). Options are\n// keyed by their JSON; callers pass small literal objects, and a key order\n// difference only costs a duplicate entry, never a wrong result.\nconst cache = new Map<string, unknown>();\nconst CACHE_LIMIT = 500;\n\nfunction cached<T>(key: string, create: () => T): T {\n let value = cache.get(key) as T | undefined;\n if (value === undefined) {\n if (cache.size >= CACHE_LIMIT) {\n // Insertion order: drop the oldest. Unbounded user-driven option objects\n // (a currency per row) must not grow a long-lived server process forever.\n cache.delete(cache.keys().next().value!);\n }\n value = create();\n cache.set(key, value);\n }\n return value;\n}\n\nfunction toDate(value: DateInput): Date {\n return value instanceof Date ? value : new Date(value);\n}\n\nfunction hasDateTimeFields(options: Intl.DateTimeFormatOptions): boolean {\n return (\n options.dateStyle !== undefined ||\n options.timeStyle !== undefined ||\n options.weekday !== undefined ||\n options.era !== undefined ||\n options.year !== undefined ||\n options.month !== undefined ||\n options.day !== undefined ||\n options.dayPeriod !== undefined ||\n options.hour !== undefined ||\n options.minute !== undefined ||\n options.second !== undefined ||\n options.fractionalSecondDigits !== undefined ||\n options.timeZoneName !== undefined\n );\n}\n\nexport function createFormatter(init: FormatterInit): Formatter {\n const { locale, timeZone } = init;\n\n const dateTimeFormat = (options: Intl.DateTimeFormatOptions = {}) => {\n // `??`, not a spread: `{ timeZone: undefined }` would otherwise drop the\n // pinned zone and fall back to the runtime's, which is the bug this exists\n // to prevent.\n const resolved = { ...options, timeZone: options.timeZone ?? timeZone };\n return cached(`dt|${locale}|${JSON.stringify(resolved)}`, () => {\n return new Intl.DateTimeFormat(locale, resolved);\n });\n };\n\n const withDefaults = (\n options: Intl.DateTimeFormatOptions | undefined,\n defaults: Intl.DateTimeFormatOptions,\n ) => {\n if (options && hasDateTimeFields(options)) {\n return options;\n }\n // Options that only tweak (a `timeZone`, `hour12`) still get the default\n // fields; otherwise `{ timeZone }` alone would print a bare numeric date.\n return { ...defaults, ...options };\n };\n\n return {\n locale,\n timeZone,\n date(value, options) {\n return dateTimeFormat(withDefaults(options, { dateStyle: \"medium\" })).format(\n toDate(value),\n );\n },\n time(value, options) {\n return dateTimeFormat(withDefaults(options, { timeStyle: \"short\" })).format(\n toDate(value),\n );\n },\n dateTime(value, options) {\n return dateTimeFormat(\n withDefaults(options, { dateStyle: \"medium\", timeStyle: \"short\" }),\n ).format(toDate(value));\n },\n number(value, options = {}) {\n return cached(\n `n|${locale}|${JSON.stringify(options)}`,\n () => new Intl.NumberFormat(locale, options),\n ).format(value);\n },\n relative(value, unit, options = {}) {\n return cached(\n `r|${locale}|${JSON.stringify(options)}`,\n () => new Intl.RelativeTimeFormat(locale, options),\n ).format(value, unit);\n },\n list(values, options = {}) {\n return cached(\n `l|${locale}|${JSON.stringify(options)}`,\n () => new Intl.ListFormat(locale, options),\n ).format(values);\n },\n plural(count, options = {}) {\n return cached(\n `p|${locale}|${JSON.stringify(options)}`,\n () => new Intl.PluralRules(locale, options),\n ).select(count);\n },\n dateTimeFormat,\n };\n}\n",
7
+ "import type { HttpRequest } from \"../http/HttpRequest\";\nimport type { Dictionary } from \"./Dictionary\";\nimport type { TranslationConfig } from \"./config\";\nimport { negotiateLocale, resolveLocale } from \"./resolveLocale\";\nimport {\n createFormatter,\n isValidTimeZone,\n type Formatter,\n} from \"./formatter\";\n\nexport class Translator {\n static token = \"translator\";\n\n translations = {};\n isEnabled = false;\n\n constructor(public config: Required<TranslationConfig>) {\n // Fail at boot rather than on the first page that prints a date: `Intl`\n // throws a `RangeError` for a zone it does not know.\n if (!isValidTimeZone(this.config.timeZone)) {\n throw new Error(\n `translation.timeZone: \"${String(this.config.timeZone)}\" is not a time zone this runtime knows. Use an IANA name such as \"UTC\" or \"Europe/Istanbul\".`,\n );\n }\n\n const translations = {};\n\n for (const [route, dicArray] of Object.entries(this.config.prefetch)) {\n for (const locale of this.config.supportedLocales) {\n if (!translations[locale]) {\n translations[locale] = {};\n }\n translations[locale][route] = {};\n for (const dic of dicArray) {\n translations[locale][route][dic.name] = {};\n for (const [key, value] of Object.entries(dic.dictionary)) {\n this.isEnabled = true;\n translations[locale][route][dic.name][key] = value[locale];\n }\n }\n }\n }\n this.translations = translations;\n }\n\n /**\n * Whether the app does locale-aware routing and rendering at all.\n *\n * `isEnabled` only means the legacy `prefetch` config has dictionaries to\n * serve. An app on `defineDictionary` has an empty `prefetch` and declares\n * its locales through `supportedLocales` alone, so gating on `isEnabled`\n * leaves it without locale detection or a locale URL prefix. Both the render\n * path and the redirect read this, because when they disagreed a migrated app\n * rendered a non-default locale at `/` with no redirect and no `Vary` — one\n * cache fill away from serving that document to everyone.\n */\n get isLocaleAware(): boolean {\n return this.isEnabled || this.config.supportedLocales.length > 0;\n }\n\n get supportedLocales(): string[] {\n return this.config.supportedLocales;\n }\n\n get defaultLocale(): string {\n return this.config.defaultLocale;\n }\n\n get components(): Record<string, Dictionary<any>> {\n return this.config.components;\n }\n\n /** The configured zone; `UTC` unless `translation.timeZone` says otherwise. */\n get timeZone(): string {\n return this.config.timeZone;\n }\n\n /**\n * The zone dates are formatted in for this request: `detectTimeZone`'s\n * answer when it gives a zone `Intl` knows, the configured zone otherwise.\n * A bad value from a cookie must not take the page down, so it is ignored\n * rather than thrown.\n */\n detectTimeZone(req: HttpRequest<any, any> | null | undefined): string {\n if (req) {\n const detected = this.config.detectTimeZone(req);\n if (isValidTimeZone(detected)) {\n return detected;\n }\n }\n return this.config.timeZone;\n }\n\n /**\n * A formatter for `locale` (the default locale when omitted) in `timeZone`\n * (the configured zone when omitted). For server code outside a request —\n * jobs, emails. Inside a request, `Lang.formatter()` picks up the request's\n * locale and zone.\n */\n formatter(locale?: string, timeZone?: string): Formatter {\n return createFormatter({\n locale: locale || this.defaultLocale,\n timeZone: isValidTimeZone(timeZone) ? timeZone : this.timeZone,\n });\n }\n\n onLocaleChange(locale: string): Promise<void> | void {\n return this.config.onLocaleChange(locale);\n }\n\n detectLocale(req: HttpRequest<any, any>) {\n const fallbackLocale =\n this.config.defaultLocale ?? this.config.supportedLocales[0] ?? \"en-US\";\n const resolve = (tag: string | null | undefined) =>\n resolveLocale(tag, this.config.supportedLocales, this.config.defaultLocale);\n\n const detectedLocale = resolve(this.config.detectLocale(req));\n if (detectedLocale) {\n return detectedLocale;\n }\n\n const previousLocale = resolve(req.cookies.get(\"i18n-locale\"));\n if (previousLocale) {\n return previousLocale;\n }\n\n // The best entry by `q` weight the app can serve, even by language alone\n // (`de-AT` → `de-DE`), wins.\n const acceptedLocale = negotiateLocale(\n req.headers.get(\"accept-language\"),\n this.config.supportedLocales,\n this.config.defaultLocale,\n );\n if (acceptedLocale) {\n return acceptedLocale;\n }\n\n return fallbackLocale;\n }\n\n getPageTranslations(locale: string, scope: string) {\n if (this.translations[locale][scope]) {\n return this.translations[locale][scope];\n }\n return {};\n }\n}\n"
8
+ ],
9
+ "mappings": ";AAGA,IAAM,EAAa,sCAEZ,SAAS,CAAe,CAAC,EAA0B,CACxD,OAAO,EAAW,KAAK,CAAO,EAGhC,SAAS,CAAU,CAAC,EAAqB,CACvC,OAAO,EAAI,MAAM,MAAM,EAAE,GAAG,YAAY,EAYnC,SAAS,CAAa,CAC3B,EACA,EACA,EACe,CAEf,IAAM,EAAM,GAAW,MAAM,GAAG,EAAE,GAAG,KAAK,EAC1C,GAAI,CAAC,GAAO,CAAC,EAAgB,CAAG,EAC9B,OAAO,KAGT,IAAM,EAAa,EAAI,WAAW,IAAK,GAAG,EAAE,YAAY,EAClD,EAAQ,EAAiB,KAAK,CAAC,IAAM,EAAE,YAAY,IAAM,CAAU,EACzE,GAAI,EACF,OAAO,EAGT,IAAM,EAAW,EAAW,CAAG,EACzB,EAAe,EAAiB,OAAO,CAAC,IAAM,EAAW,CAAC,IAAM,CAAQ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,SAAS,CAAC,EAAiB,EAA8B,CACvD,OAAO,EAAgB,CACrB,OAAQ,GAAU,KAAK,cACvB,SAAU,EAAgB,CAAQ,EAAI,EAAW,KAAK,QACxD,CAAC,EAGH,cAAc,CAAC,EAAsC,CACnD,OAAO,KAAK,OAAO,eAAe,CAAM,EAG1C,YAAY,CAAC,EAA4B,CACvC,IAAM,EACJ,KAAK,OAAO,eAAiB,KAAK,OAAO,iBAAiB,IAAM,QAC5D,EAAU,CAAC,IACf,EAAc,EAAK,KAAK,OAAO,iBAAkB,KAAK,OAAO,aAAa,EAEtE,EAAiB,EAAQ,KAAK,OAAO,aAAa,CAAG,CAAC,EAC5D,GAAI,EACF,OAAO,EAGT,IAAM,EAAiB,EAAQ,EAAI,QAAQ,IAAI,aAAa,CAAC,EAC7D,GAAI,EACF,OAAO,EAKT,IAAM,EAAiB,EACrB,EAAI,QAAQ,IAAI,iBAAiB,EACjC,KAAK,OAAO,iBACZ,KAAK,OAAO,aACd,EACA,GAAI,EACF,OAAO,EAGT,OAAO,EAGT,mBAAmB,CAAC,EAAgB,EAAe,CACjD,GAAI,KAAK,aAAa,GAAQ,GAC5B,OAAO,KAAK,aAAa,GAAQ,GAEnC,MAAO,CAAC,EAEZ",
10
+ "debugId": "A5B69EB2D1A7185764756E2164756E21",
11
+ "names": []
12
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Head.d.ts","sourceRoot":"","sources":["../../client/Head.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAwBnD,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,QA4C3D;AAmED,eAAO,MAAM,IAAI,GAAI,wBAGlB;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,4CAsC5C,CAAC"}
1
+ {"version":3,"file":"Head.d.ts","sourceRoot":"","sources":["../../client/Head.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAc,MAAM,OAAO,CAAC;AAmCnD,wBAAgB,UAAU,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,QAoD3D;AAmED,eAAO,MAAM,IAAI,GAAI,wBAGlB;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,4CA6D5C,CAAC"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * `Meta.fonts`: the `@font-face` rules and font preloads of one response.
3
+ * Pure, so the server (validation) and `<Head />` (rendering) share it.
4
+ */
5
+ /** A font file format, as `@font-face`'s `format()` names it. */
6
+ export type FontFormat = "woff2" | "woff" | "truetype" | "opentype" | "collection" | "embedded-opentype" | "svg";
7
+ /** One file of a font; list the preferred format first. */
8
+ export type FontSource = {
9
+ url: string;
10
+ /** Inferred from the url's extension when left out. */
11
+ format?: FontFormat;
12
+ };
13
+ /** One `@font-face`, see `Meta.fonts`. */
14
+ export type MetaFont = {
15
+ /** The `font-family` name that CSS refers to, e.g. `"Acme Sans"`. */
16
+ family: string;
17
+ /** A url, or several files with the preferred one first. */
18
+ src: string | FontSource[];
19
+ /** `font-weight`: `400`, `"bold"`, or a range for a variable font, `"100 900"`. */
20
+ weight?: string | number;
21
+ /** `font-style`: `"normal"`, `"italic"`, `"oblique 10deg"`. */
22
+ style?: string;
23
+ /** `font-stretch`: `"condensed"`, `"75% 125%"`. */
24
+ stretch?: string;
25
+ /** `font-display`. Defaults to `"swap"`. */
26
+ display?: "auto" | "block" | "swap" | "fallback" | "optional";
27
+ /** `unicode-range`, e.g. `"U+0000-00FF, U+0131"`. */
28
+ unicodeRange?: string;
29
+ /**
30
+ * Preload the first file with `<link rel="preload" as="font" crossorigin>`.
31
+ * Only for fonts the page renders above the fold: a preloaded font that is
32
+ * never used is a wasted download (and a console warning).
33
+ */
34
+ preload?: boolean;
35
+ };
36
+ /** A font after `normalizeFonts`: validated, with every source's format resolved. */
37
+ export type NormalizedFont = {
38
+ family: string;
39
+ src: {
40
+ url: string;
41
+ format: FontFormat | null;
42
+ }[];
43
+ weight: string | null;
44
+ style: string | null;
45
+ stretch: string | null;
46
+ display: NonNullable<MetaFont["display"]>;
47
+ unicodeRange: string | null;
48
+ preload: boolean;
49
+ };
50
+ export type FontPreload = {
51
+ href: string;
52
+ type: string | null;
53
+ };
54
+ /** The format a url's extension implies (`.woff2` → `"woff2"`), ignoring query and hash. */
55
+ export declare function fontFormatOf(url: string): FontFormat | null;
56
+ /** Validates what a handler passed; throws a `TypeError` naming the bad value. */
57
+ export declare function normalizeFonts(fonts: MetaFont[]): NormalizedFont[];
58
+ /**
59
+ * A CSS string literal holding `value`. Quotes, backslashes, control
60
+ * characters and `<` (so `</style>` can't close the element) are escaped.
61
+ */
62
+ export declare function cssString(value: string): string;
63
+ /** One `@font-face` rule. */
64
+ export declare function fontFaceRule(font: NormalizedFont): string;
65
+ /** The `@font-face` rules for `fonts`, an identical font declared twice once. */
66
+ export declare function fontFaceRules(fonts: NormalizedFont[] | null | undefined): string[];
67
+ /** The first file of every font marked `preload`, each url once. */
68
+ export declare function fontPreloads(fonts: NormalizedFont[] | null | undefined): FontPreload[];
69
+ //# sourceMappingURL=fonts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fonts.d.ts","sourceRoot":"","sources":["../../client/fonts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,iEAAiE;AACjE,MAAM,MAAM,UAAU,GAClB,OAAO,GACP,MAAM,GACN,UAAU,GACV,UAAU,GACV,YAAY,GACZ,mBAAmB,GACnB,KAAK,CAAC;AAEV,2DAA2D;AAC3D,MAAM,MAAM,UAAU,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC;AAEF,0CAA0C;AAC1C,MAAM,MAAM,Q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E,GAAG,cAAc,EAAE,CAsClE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAM/C;AAED,6BAA6B;AAC7B,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAczD;AAED,iFAAiF;AACjF,wBAAgB,aAAa,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,EAAE,CAElF;AAED,oEAAoE;AACpE,wBAAgB,YAAY,CAAC,KAAK,EAAE,cAAc,EAAE,GAAG,IAAI,GAAG,SAAS,GAAG,WAAW,EAAE,CAYtF"}
@@ -42,6 +42,7 @@ export type { CreateI18nDictionary } from "./I18nContext";
42
42
  export { Image } from "./Image";
43
43
  export { Head } from "./Head";
44
44
  export { textDirection, type HtmlAttributes, type RootLayoutProps, } from "./htmlAttributes";
45
+ export type { MetaFont, FontSource, FontFormat } from "./fonts";
45
46
  export { useForgotPassword } from "./auth/useForgotPassword";
46
47
  export { useSignIn } from "./auth/useSignIn";
47
48
  export { useSignUp } from "./auth/useSignUp";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":";AAMA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,YAAY,EACV,YAAY,EACZ,WAAW,EACX,gBAAgB,GACjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO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AM,kBAAkB,CAAC;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
@@ -1644,6 +1644,51 @@ function resolveHtmlAttributes(set, locale) {
1644
1644
  };
1645
1645
  }
1646
1646
  //#endregion
1647
+ //#region client/fonts.ts
1648
+ var MIME_BY_FORMAT = {
1649
+ woff2: "font/woff2",
1650
+ woff: "font/woff",
1651
+ truetype: "font/ttf",
1652
+ opentype: "font/otf",
1653
+ collection: "font/collection"
1654
+ };
1655
+ /**
1656
+ * A CSS string literal holding `value`. Quotes, backslashes, control
1657
+ * characters and `<` (so `</style>` can't close the element) are escaped.
1658
+ */
1659
+ function cssString(value) {
1660
+ return `"${value.replace(/[\\"<>\u0000-\u001f\u007f]/g, (char) => char === "\\" || char === "\"" ? `\\${char}` : `\\${char.charCodeAt(0).toString(16)} `)}"`;
1661
+ }
1662
+ /** One `@font-face` rule. */
1663
+ function fontFaceRule(font) {
1664
+ const src = font.src.map(({ url, format }) => `url(${cssString(url)})${format ? ` format(${cssString(format)})` : ""}`).join(", ");
1665
+ return `@font-face { ${[
1666
+ `font-family: ${cssString(font.family)}`,
1667
+ `src: ${src}`,
1668
+ font.weight && `font-weight: ${font.weight}`,
1669
+ font.style && `font-style: ${font.style}`,
1670
+ font.stretch && `font-stretch: ${font.stretch}`,
1671
+ `font-display: ${font.display}`,
1672
+ font.unicodeRange && `unicode-range: ${font.unicodeRange}`
1673
+ ].filter(Boolean).join("; ")}; }`;
1674
+ }
1675
+ /** The `@font-face` rules for `fonts`, an identical font declared twice once. */
1676
+ function fontFaceRules(fonts) {
1677
+ return [...new Set((fonts ?? []).map(fontFaceRule))];
1678
+ }
1679
+ /** The first file of every font marked `preload`, each url once. */
1680
+ function fontPreloads(fonts) {
1681
+ const preloads = /* @__PURE__ */ new Map();
1682
+ for (const font of fonts ?? []) {
1683
+ const first = font.preload ? font.src[0] : void 0;
1684
+ if (first && !preloads.has(first.url)) preloads.set(first.url, {
1685
+ href: first.url,
1686
+ type: (first.format && MIME_BY_FORMAT[first.format]) ?? null
1687
+ });
1688
+ }
1689
+ return [...preloads.values()];
1690
+ }
1691
+ //#endregion
1647
1692
  //#region client/Head.tsx
1648
1693
  /** Marks the `<link>`s rendered from metadata, so a navigation can replace them. */
1649
1694
  var GEMI_META_ATTRIBUTE = "data-gemi-meta";
@@ -1660,11 +1705,19 @@ function metaLinks(canonical, alternates) {
1660
1705
  });
1661
1706
  return links;
1662
1707
  }
1708
+ /** Marks the `<style>`s holding `Meta.fonts`' `@font-face` rules. */
1709
+ var GEMI_FONTS_ATTRIBUTE = "data-gemi-fonts";
1710
+ /**
1711
+ * The `@font-face` rules already in the document. A navigation adds the new
1712
+ * page's and removes none: a skipped layout's fonts are still in use, and an
1713
+ * unused `@font-face` costs nothing (it is only fetched when text uses it).
1714
+ */
1715
+ var appliedFontRules = /* @__PURE__ */ new Set();
1663
1716
  /** Whether a navigation has set `<html>` attributes from metadata. */
1664
1717
  var htmlAttributesApplied = false;
1665
1718
  function updateMeta(meta, locale) {
1666
1719
  if (!meta) return;
1667
- const { title, description, htmlAttributes, canonical, alternates } = meta;
1720
+ const { title, description, htmlAttributes, canonical, alternates, fonts } = meta;
1668
1721
  if (htmlAttributes || htmlAttributesApplied) {
1669
1722
  htmlAttributesApplied = true;
1670
1723
  for (const [name, value] of Object.entries(resolveHtmlAttributes(htmlAttributes, locale))) if (typeof value === "string") document.documentElement.setAttribute(name, value);
@@ -1678,6 +1731,14 @@ function updateMeta(meta, locale) {
1678
1731
  element.setAttribute(GEMI_META_ATTRIBUTE, "");
1679
1732
  document.head.appendChild(element);
1680
1733
  }
1734
+ const newFontRules = fontFaceRules(fonts).filter((rule) => !appliedFontRules.has(rule));
1735
+ if (newFontRules.length > 0) {
1736
+ const style = document.createElement("style");
1737
+ style.setAttribute(GEMI_FONTS_ATTRIBUTE, "");
1738
+ style.textContent = newFontRules.join("\n");
1739
+ document.head.appendChild(style);
1740
+ for (const rule of newFontRules) appliedFontRules.add(rule);
1741
+ }
1681
1742
  if (title) document.title = title;
1682
1743
  if (description) {
1683
1744
  const desc = document.querySelector("meta[name='description']");
@@ -1749,6 +1810,8 @@ var OpenGraph = (props) => {
1749
1810
  var Head = ({ children = null, charSet = "utf-8" }) => {
1750
1811
  const { meta } = useContext(ServerDataContext);
1751
1812
  if (meta?.htmlAttributes) htmlAttributesApplied = true;
1813
+ const fontRules = fontFaceRules(meta?.fonts);
1814
+ if (typeof window !== "undefined") for (const rule of fontRules) appliedFontRules.add(rule);
1752
1815
  return /* @__PURE__ */ jsxs("head", { children: [
1753
1816
  /* @__PURE__ */ jsx("meta", { charSet }),
1754
1817
  /* @__PURE__ */ jsx("meta", {
@@ -1771,6 +1834,17 @@ var Head = ({ children = null, charSet = "utf-8" }) => {
1771
1834
  hrefLang: link.hrefLang,
1772
1835
  [GEMI_META_ATTRIBUTE]: ""
1773
1836
  }, `${link.rel}:${link.hrefLang ?? ""}:${link.href}`)),
1837
+ fontPreloads(meta?.fonts).map((preload) => /* @__PURE__ */ jsx("link", {
1838
+ rel: "preload",
1839
+ as: "font",
1840
+ href: preload.href,
1841
+ type: preload.type ?? void 0,
1842
+ crossOrigin: ""
1843
+ }, `preload:${preload.href}`)),
1844
+ fontRules.length > 0 && /* @__PURE__ */ jsx("style", {
1845
+ [GEMI_FONTS_ATTRIBUTE]: "",
1846
+ dangerouslySetInnerHTML: { __html: fontRules.join("\n") }
1847
+ }),
1774
1848
  children
1775
1849
  ] });
1776
1850
  };