@cimplify/sdk 0.108.0 → 0.110.2

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 (608) hide show
  1. package/LICENSE +21 -0
  2. package/dist/advanced.d.mts +4 -3
  3. package/dist/advanced.d.ts +4 -3
  4. package/dist/advanced.js +24 -24
  5. package/dist/advanced.mjs +5 -5
  6. package/dist/animation-4EXBXRVX.js +27 -0
  7. package/dist/animation-6DICNWUP.mjs +6 -0
  8. package/dist/audio-DhvyjqdA.d.mts +249 -0
  9. package/dist/audio-m0w8cnxq.d.ts +249 -0
  10. package/dist/avatars.d.mts +110 -0
  11. package/dist/avatars.d.ts +110 -0
  12. package/dist/avatars.js +82 -0
  13. package/dist/avatars.mjs +5 -0
  14. package/dist/backend-gUCzs5Kg.d.mts +3866 -0
  15. package/dist/backend-gUCzs5Kg.d.ts +3866 -0
  16. package/dist/{catalogue-B4eLL8Mi.d.ts → catalogue-CPTMyBUz.d.mts} +109 -221
  17. package/dist/catalogue-DzrTXP3v.d.mts +541 -0
  18. package/dist/catalogue-DzrTXP3v.d.ts +541 -0
  19. package/dist/{catalogue-OT89_Ifs.d.mts → catalogue-OTuS5zp-.d.ts} +109 -221
  20. package/dist/chunk-22BD3RHN.mjs +1809 -0
  21. package/dist/chunk-25T4JHEA.mjs +21 -0
  22. package/dist/chunk-2AQ237Y4.js +508 -0
  23. package/dist/chunk-2IC4H6OV.mjs +48 -0
  24. package/dist/chunk-2LHLG4OB.mjs +71 -0
  25. package/dist/chunk-2O2CG465.js +1709 -0
  26. package/dist/chunk-2Q4DTHXK.js +316 -0
  27. package/dist/chunk-2QTQ6BUH.mjs +46 -0
  28. package/dist/chunk-2UN4SFLR.mjs +100 -0
  29. package/dist/chunk-2V75I7K3.js +454 -0
  30. package/dist/chunk-2V7IL4HC.js +10 -0
  31. package/dist/chunk-34XBXUMW.js +296 -0
  32. package/dist/chunk-3C4C654I.js +71 -0
  33. package/dist/chunk-3DAD2LDF.mjs +72 -0
  34. package/dist/chunk-3GXH2NFD.mjs +4 -0
  35. package/dist/chunk-3O47ZFW3.js +961 -0
  36. package/dist/chunk-3OY3VYNF.mjs +11 -0
  37. package/dist/chunk-3S6WPBZL.js +2936 -0
  38. package/dist/chunk-3TUOUP5T.js +399 -0
  39. package/dist/chunk-3VEH23I5.mjs +1380 -0
  40. package/dist/chunk-3ZYSAW2T.mjs +263 -0
  41. package/dist/chunk-4ANVF274.js +103 -0
  42. package/dist/chunk-4C7I3ELN.js +388 -0
  43. package/dist/chunk-4DYKAYFO.mjs +8 -0
  44. package/dist/chunk-4ZDR72SG.js +329 -0
  45. package/dist/chunk-52YS45RR.js +1066 -0
  46. package/dist/chunk-5325XSCH.js +107 -0
  47. package/dist/chunk-5AD5X6AV.js +13 -0
  48. package/dist/chunk-5BYDGGWO.mjs +197 -0
  49. package/dist/chunk-5C3C7VDM.mjs +55 -0
  50. package/dist/chunk-5HFMY3D7.js +660 -0
  51. package/dist/chunk-5LH2QN3T.js +1862 -0
  52. package/dist/chunk-5PJEXSOW.js +44 -0
  53. package/dist/chunk-5SXDH3Y7.js +90 -0
  54. package/dist/chunk-5YFBGGCK.mjs +502 -0
  55. package/dist/chunk-5YWN6H5Q.mjs +133 -0
  56. package/dist/chunk-66QP3SMN.js +402 -0
  57. package/dist/chunk-6DAEZKIG.mjs +385 -0
  58. package/dist/chunk-6DATW7TB.mjs +420 -0
  59. package/dist/{chunk-JRGK3NXR.mjs → chunk-6ETDAU62.mjs} +72 -212
  60. package/dist/chunk-6H254EVP.mjs +178 -0
  61. package/dist/chunk-6PFNJPBJ.mjs +820 -0
  62. package/dist/chunk-6PJWXIFX.mjs +357 -0
  63. package/dist/chunk-6SWKWCMS.js +80 -0
  64. package/dist/chunk-6VVXXX7S.js +808 -0
  65. package/dist/chunk-6WUBSMTX.js +1403 -0
  66. package/dist/chunk-73SGZLAQ.mjs +35 -0
  67. package/dist/chunk-76L2V6KD.mjs +4 -0
  68. package/dist/chunk-7AAIAVAA.js +1531 -0
  69. package/dist/chunk-7ARSJPV3.mjs +93 -0
  70. package/dist/chunk-7BHW5GTC.mjs +1234 -0
  71. package/dist/chunk-7DQSDKDU.js +6 -0
  72. package/dist/chunk-7IQQQENP.mjs +401 -0
  73. package/dist/chunk-7KFTYENS.js +11357 -0
  74. package/dist/chunk-7SM6XSPZ.js +3171 -0
  75. package/dist/chunk-7SXOHAIR.mjs +28 -0
  76. package/dist/chunk-A2MAX6S4.js +90 -0
  77. package/dist/chunk-A33OORT7.mjs +1530 -0
  78. package/dist/{chunk-U6ACF76H.mjs → chunk-A36JRXXH.mjs} +1075 -1845
  79. package/dist/chunk-A7BU3BK4.js +52 -0
  80. package/dist/chunk-A7MQSN2V.mjs +77 -0
  81. package/dist/chunk-A7V4L2IT.mjs +416 -0
  82. package/dist/chunk-AABEK6XU.js +226 -0
  83. package/dist/chunk-AGV33FWC.mjs +5005 -0
  84. package/dist/chunk-AHNR3BXI.js +108 -0
  85. package/dist/chunk-AQ5RLBU2.mjs +286 -0
  86. package/dist/chunk-AQOE6WCG.js +1270 -0
  87. package/dist/chunk-ATAWRACV.mjs +62 -0
  88. package/dist/chunk-ATCURNUV.js +14 -0
  89. package/dist/chunk-AWPV33OO.js +6 -0
  90. package/dist/chunk-AYJPHKYV.js +337 -0
  91. package/dist/chunk-AZ5BGWHB.js +162 -0
  92. package/dist/chunk-AZAXD44P.js +1373 -0
  93. package/dist/chunk-BBGKQIJJ.mjs +406 -0
  94. package/dist/chunk-BP4JLSUA.js +1453 -0
  95. package/dist/{chunk-SUCE7FWA.mjs → chunk-BTUSVHIE.mjs} +539 -978
  96. package/dist/chunk-BU6OK542.mjs +818 -0
  97. package/dist/chunk-CVSRWM6W.js +418 -0
  98. package/dist/chunk-CYBMFMJD.mjs +247 -0
  99. package/dist/chunk-DDJLDOUX.mjs +217 -0
  100. package/dist/{chunk-V32BCG7M.js → chunk-DFZWHNRG.js} +75 -215
  101. package/dist/chunk-DJ2C7AVG.js +644 -0
  102. package/dist/chunk-DS2VU4WW.mjs +102 -0
  103. package/dist/chunk-DSAG7T5P.js +7290 -0
  104. package/dist/chunk-E2QPPH7I.js +327 -0
  105. package/dist/chunk-E65WCTIG.mjs +1187 -0
  106. package/dist/{chunk-33VCYWVL.mjs → chunk-E6QQKDNE.mjs} +30 -42
  107. package/dist/chunk-ECDK6QBF.mjs +981 -0
  108. package/dist/chunk-EIB4OWVQ.mjs +620 -0
  109. package/dist/chunk-EQUZYCGO.js +250 -0
  110. package/dist/chunk-F3UJ6ZRM.mjs +313 -0
  111. package/dist/chunk-F63N2ZTQ.js +7023 -0
  112. package/dist/chunk-F6XRYEM3.mjs +26 -0
  113. package/dist/chunk-FE6VCE4K.js +5030 -0
  114. package/dist/chunk-FLWD6GRR.js +1372 -0
  115. package/dist/chunk-FQBFWJBS.mjs +110 -0
  116. package/dist/chunk-FXVJ2HFU.js +26 -0
  117. package/dist/chunk-FZMQMQBW.js +312 -0
  118. package/dist/chunk-G3EEC44R.js +53 -0
  119. package/dist/{chunk-KG3WT4PR.mjs → chunk-GCKWKLZF.mjs} +73 -104
  120. package/dist/chunk-GCX7TY4D.mjs +6826 -0
  121. package/dist/chunk-GDB6TCSD.js +450 -0
  122. package/dist/chunk-GDCV4IWO.mjs +21 -0
  123. package/dist/chunk-GDZT5LZ5.js +170 -0
  124. package/dist/chunk-GHPUYD4I.mjs +213 -0
  125. package/dist/chunk-GHS6MIL6.mjs +1432 -0
  126. package/dist/chunk-GPS2THCL.mjs +11 -0
  127. package/dist/{chunk-EV2EVOYS.js → chunk-GTJWQAGU.js} +31 -42
  128. package/dist/chunk-GVTI6UJQ.mjs +130 -0
  129. package/dist/chunk-GXKI64OT.mjs +1138 -0
  130. package/dist/chunk-GYDYF2WX.js +275 -0
  131. package/dist/chunk-GYLP6UG4.mjs +705 -0
  132. package/dist/chunk-H3OQKK6X.js +1158 -0
  133. package/dist/chunk-H5DFSCJ6.js +40 -0
  134. package/dist/chunk-HAGEIC2L.mjs +186 -0
  135. package/dist/chunk-HAJ4JRFO.js +293 -0
  136. package/dist/chunk-HDR72GB6.js +188 -0
  137. package/dist/chunk-HF5HPS4T.mjs +40 -0
  138. package/dist/chunk-HK6LOFDS.js +218 -0
  139. package/dist/chunk-HMWYTXCY.mjs +143 -0
  140. package/dist/chunk-HPCSRCMA.js +89 -0
  141. package/dist/chunk-HSEO6TPU.js +247 -0
  142. package/dist/chunk-I5FOHCLH.js +132 -0
  143. package/dist/chunk-IDLW4NWA.mjs +85 -0
  144. package/dist/chunk-IIDZ5WUX.js +61 -0
  145. package/dist/chunk-IR74FJHU.js +2332 -0
  146. package/dist/chunk-IRVFYAKP.mjs +100 -0
  147. package/dist/{chunk-XBL3TMPC.mjs → chunk-IZDWAL53.mjs} +1795 -3287
  148. package/dist/chunk-J2KZXIU3.js +51 -0
  149. package/dist/chunk-J2U6PJSO.js +91 -0
  150. package/dist/chunk-J5AJNY2N.js +283 -0
  151. package/dist/chunk-J6KQZ4FO.mjs +821 -0
  152. package/dist/{chunk-OWW5GUSB.js → chunk-JGBCIKJV.js} +7 -6
  153. package/dist/chunk-JKGTBMU7.mjs +25 -0
  154. package/dist/chunk-JR3TNEQC.js +422 -0
  155. package/dist/chunk-JURRXY2J.mjs +29 -0
  156. package/dist/chunk-K3HW5I2A.mjs +317 -0
  157. package/dist/chunk-K46SMZ66.mjs +103 -0
  158. package/dist/chunk-K4UDGE3Z.mjs +6 -0
  159. package/dist/chunk-KDQOR4QQ.mjs +350 -0
  160. package/dist/chunk-KDTVOLHI.mjs +288 -0
  161. package/dist/chunk-KGHJH5KJ.mjs +35 -0
  162. package/dist/chunk-KIZOA5LX.mjs +140 -0
  163. package/dist/chunk-KK6HYVBI.mjs +242 -0
  164. package/dist/chunk-KMKWGXMK.js +856 -0
  165. package/dist/chunk-KPA6K5IB.js +80 -0
  166. package/dist/chunk-KU7O4IXU.mjs +260 -0
  167. package/dist/chunk-KVFNRJOR.mjs +11142 -0
  168. package/dist/chunk-KZJRSXHK.js +2432 -0
  169. package/dist/chunk-LHWPRUJL.js +79 -0
  170. package/dist/chunk-LIV3KXJG.mjs +369 -0
  171. package/dist/chunk-LKV4LACG.js +21 -0
  172. package/dist/chunk-LUY45X3U.mjs +263 -0
  173. package/dist/chunk-LYEZZEEF.mjs +17 -0
  174. package/dist/chunk-M5EXQZYY.mjs +1519 -0
  175. package/dist/chunk-ME6HGG4I.mjs +1338 -0
  176. package/dist/chunk-MEXP6DA6.js +31 -0
  177. package/dist/chunk-MG52AW3H.js +902 -0
  178. package/dist/chunk-MIPO6F72.js +334 -0
  179. package/dist/{chunk-5QW7CQBA.js → chunk-MKIJQL5Q.js} +211 -321
  180. package/dist/chunk-MN3YETVN.mjs +17 -0
  181. package/dist/chunk-MOBSBXVE.mjs +2391 -0
  182. package/dist/chunk-MOMOZEUM.mjs +88 -0
  183. package/dist/chunk-MRFUNRAP.js +62 -0
  184. package/dist/chunk-MTIHEW2M.js +433 -0
  185. package/dist/chunk-N4RGGDEL.mjs +73 -0
  186. package/dist/chunk-NH654HAT.js +10 -0
  187. package/dist/chunk-NHJUGZUR.mjs +253 -0
  188. package/dist/chunk-NMQT4HG3.mjs +757 -0
  189. package/dist/chunk-NPSYB6DC.mjs +906 -0
  190. package/dist/chunk-NW2GPMSO.js +857 -0
  191. package/dist/chunk-NXKQOQ6L.js +76 -0
  192. package/dist/chunk-NXLAZIJZ.js +309 -0
  193. package/dist/chunk-NYWNA5CF.js +148 -0
  194. package/dist/chunk-NZTKLY2W.js +1442 -0
  195. package/dist/chunk-O2ICABUD.js +36 -0
  196. package/dist/chunk-OIVVQQ22.js +862 -0
  197. package/dist/chunk-OKC2B4O3.mjs +312 -0
  198. package/dist/chunk-OLWFPDBK.js +2220 -0
  199. package/dist/chunk-OMTVH334.js +3779 -0
  200. package/dist/chunk-OQRVEM56.mjs +362 -0
  201. package/dist/chunk-OXMIBOD4.js +337 -0
  202. package/dist/chunk-PBL6YL5L.mjs +288 -0
  203. package/dist/chunk-PDOELNNQ.js +97 -0
  204. package/dist/chunk-PDQJY2GZ.js +136 -0
  205. package/dist/chunk-PKOZXD2Q.js +1274 -0
  206. package/dist/chunk-PPF2BYFL.mjs +2191 -0
  207. package/dist/chunk-PQTQKNKD.js +539 -0
  208. package/dist/chunk-PRSR4FAV.mjs +81 -0
  209. package/dist/chunk-PTRNO5UD.js +95 -0
  210. package/dist/chunk-Q2Y3VMKH.js +2000 -0
  211. package/dist/chunk-QCZOE65N.js +96 -0
  212. package/dist/chunk-QDYFLATW.mjs +52 -0
  213. package/dist/chunk-QQABGCMM.js +22 -0
  214. package/dist/chunk-QS6TRHMR.js +345 -0
  215. package/dist/chunk-R56P64LB.mjs +208 -0
  216. package/dist/chunk-RCQ2MPBV.js +428 -0
  217. package/dist/chunk-RFVRPYR2.mjs +856 -0
  218. package/dist/chunk-RKBLPGPV.js +11521 -0
  219. package/dist/chunk-RM2V4IND.mjs +327 -0
  220. package/dist/chunk-RQXN5A34.mjs +613 -0
  221. package/dist/chunk-RUVGVNOF.mjs +2687 -0
  222. package/dist/chunk-SAFJIGYB.mjs +165 -0
  223. package/dist/chunk-SKQFLBDD.js +263 -0
  224. package/dist/chunk-SMK6JU2F.mjs +2092 -0
  225. package/dist/{chunk-UVRPC2P7.js → chunk-SNNEOS5Z.js} +1984 -3476
  226. package/dist/chunk-SPCRQ6NO.mjs +1246 -0
  227. package/dist/chunk-SWX4SALA.mjs +19 -0
  228. package/dist/{chunk-JVODCGFP.mjs → chunk-SYEO2WV4.mjs} +128 -238
  229. package/dist/chunk-T2QQMX2N.js +10 -0
  230. package/dist/chunk-T3AFF3L7.mjs +57 -0
  231. package/dist/chunk-T6Z2EXYL.js +712 -0
  232. package/dist/chunk-T7LOXGYX.js +118 -0
  233. package/dist/chunk-TJCAE7RC.mjs +1315 -0
  234. package/dist/chunk-TJI3K6RP.js +137 -0
  235. package/dist/chunk-TL2SVO4P.mjs +55 -0
  236. package/dist/chunk-TM63CYGN.mjs +399 -0
  237. package/dist/chunk-TU5RYTYU.mjs +13 -0
  238. package/dist/chunk-TVJZ4GPS.js +1553 -0
  239. package/dist/chunk-TWM6DLYF.js +371 -0
  240. package/dist/chunk-U63OC4TQ.js +30 -0
  241. package/dist/{chunk-L5GKVQVJ.js → chunk-U6BVSJZ6.js} +25 -57
  242. package/dist/chunk-U6UVWEAK.mjs +792 -0
  243. package/dist/chunk-UCEPNO6N.mjs +11048 -0
  244. package/dist/{chunk-ANT574FD.js → chunk-UCR5HRYM.js} +74 -105
  245. package/dist/chunk-UG5BTOTF.mjs +334 -0
  246. package/dist/chunk-UGH37BQW.mjs +157 -0
  247. package/dist/chunk-V7ZRH3PY.mjs +271 -0
  248. package/dist/chunk-VBGHBL3E.mjs +1394 -0
  249. package/dist/chunk-VRBDAS5I.js +920 -0
  250. package/dist/chunk-VVE3Y76O.js +230 -0
  251. package/dist/chunk-W65JIRI4.mjs +1182 -0
  252. package/dist/chunk-WHYKAT7G.js +62 -0
  253. package/dist/{chunk-YOIVZ6OA.mjs → chunk-WIZRUIZB.mjs} +25 -57
  254. package/dist/chunk-WKWTDZS7.js +385 -0
  255. package/dist/chunk-WLMINRC4.mjs +78 -0
  256. package/dist/chunk-WOF3AD3J.js +22 -0
  257. package/dist/chunk-WWKMOA76.js +1262 -0
  258. package/dist/chunk-X5A5FOWW.js +615 -0
  259. package/dist/chunk-X6CN6KQF.mjs +192 -0
  260. package/dist/chunk-XD2PMH46.mjs +517 -0
  261. package/dist/chunk-XJA2NGTI.mjs +88 -0
  262. package/dist/chunk-XJIHN3BY.mjs +8 -0
  263. package/dist/chunk-XK6UDWJS.js +203 -0
  264. package/dist/chunk-XPG3N5CF.mjs +415 -0
  265. package/dist/chunk-XVZ2NKSU.mjs +74 -0
  266. package/dist/chunk-XYP45OLE.js +117 -0
  267. package/dist/chunk-XZSDGZX6.mjs +301 -0
  268. package/dist/chunk-Y2EMGN4T.mjs +120 -0
  269. package/dist/chunk-Y3XWP5XW.mjs +298 -0
  270. package/dist/chunk-Y4K22JL6.js +228 -0
  271. package/dist/chunk-Y65LXQGA.mjs +3164 -0
  272. package/dist/chunk-Y66WVMO5.mjs +87 -0
  273. package/dist/chunk-Y7JWLB25.mjs +7280 -0
  274. package/dist/chunk-YCDXAJKU.js +175 -0
  275. package/dist/chunk-YRDQCCIS.js +152 -0
  276. package/dist/chunk-YV52DGSA.js +111 -0
  277. package/dist/chunk-YXGZQPUD.js +94 -0
  278. package/dist/chunk-Z3A3AFVU.mjs +102 -0
  279. package/dist/chunk-ZCY6YKKP.mjs +475 -0
  280. package/dist/chunk-ZEQHXVU5.js +215 -0
  281. package/dist/chunk-ZF7JCXCI.js +284 -0
  282. package/dist/chunk-ZJBRUH6V.js +29 -0
  283. package/dist/chunk-ZMIL4ZOA.js +365 -0
  284. package/dist/chunk-ZR5ULMN2.mjs +337 -0
  285. package/dist/chunk-ZXREOYOW.js +87 -0
  286. package/dist/{client-BSP9U1O1.d.mts → client-CX_WR0-J.d.mts} +2 -2
  287. package/dist/client-Dytx_ZTC.d.ts +230 -0
  288. package/dist/{client-B878xeAP.d.ts → client-dqOhP9Nc.d.ts} +2 -2
  289. package/dist/client-hTKbCuhG.d.mts +230 -0
  290. package/dist/clock-B-UAjkKa.d.mts +5 -0
  291. package/dist/clock-B-UAjkKa.d.ts +5 -0
  292. package/dist/config-BlXQluJR.d.mts +36 -0
  293. package/dist/config-BlXQluJR.d.ts +36 -0
  294. package/dist/courier-Cnn-edJ4.d.ts +95 -0
  295. package/dist/courier-FmGfkvIN.d.mts +95 -0
  296. package/dist/crowd-DdHFbqKK.d.ts +186 -0
  297. package/dist/crowd-hOVSAmA3.d.mts +186 -0
  298. package/dist/danfo-BEBapFlX.d.mts +146 -0
  299. package/dist/danfo-UQ_PTIIx.d.ts +146 -0
  300. package/dist/{elements-Bty6Qs_N.d.mts → elements-DdsRig-2.d.mts} +1548 -257
  301. package/dist/{elements-Bty6Qs_N.d.ts → elements-DdsRig-2.d.ts} +1548 -257
  302. package/dist/engines/godot.d.mts +56 -0
  303. package/dist/engines/godot.d.ts +56 -0
  304. package/dist/engines/godot.js +28 -0
  305. package/dist/engines/godot.mjs +3 -0
  306. package/dist/engines/wasm.d.mts +11 -0
  307. package/dist/engines/wasm.d.ts +11 -0
  308. package/dist/engines/wasm.js +178 -0
  309. package/dist/engines/wasm.mjs +176 -0
  310. package/dist/fallback-CrG_lTFk.d.mts +270 -0
  311. package/dist/fallback-CrG_lTFk.d.ts +270 -0
  312. package/dist/fallback-KDB4Y2CE.mjs +6 -0
  313. package/dist/fallback-Y26TQENE.js +19 -0
  314. package/dist/features-CZB4rmcD.d.mts +118 -0
  315. package/dist/features-CZB4rmcD.d.ts +118 -0
  316. package/dist/fit-BWiE7rgA.d.mts +44 -0
  317. package/dist/fit-DK0oT7zO.d.ts +44 -0
  318. package/dist/five-a-side-Bv1AOUy3.d.mts +115 -0
  319. package/dist/five-a-side-EC51SJY1.d.ts +115 -0
  320. package/dist/fluid-ARr0qUIL.d.ts +939 -0
  321. package/dist/fluid-DLlEj2cs.d.mts +939 -0
  322. package/dist/game/conformance.d.mts +84 -0
  323. package/dist/game/conformance.d.ts +84 -0
  324. package/dist/game/conformance.js +1025 -0
  325. package/dist/game/conformance.mjs +994 -0
  326. package/dist/game/heap.d.mts +40 -0
  327. package/dist/game/heap.d.ts +40 -0
  328. package/dist/game/heap.js +48 -0
  329. package/dist/game/heap.mjs +7 -0
  330. package/dist/game/kit/canvas.d.mts +240 -0
  331. package/dist/game/kit/canvas.d.ts +240 -0
  332. package/dist/game/kit/canvas.js +3566 -0
  333. package/dist/game/kit/canvas.mjs +1039 -0
  334. package/dist/game/kit/courier.d.mts +17 -0
  335. package/dist/game/kit/courier.d.ts +17 -0
  336. package/dist/game/kit/courier.js +66 -0
  337. package/dist/game/kit/courier.mjs +49 -0
  338. package/dist/game/kit/danfo.d.mts +11 -0
  339. package/dist/game/kit/danfo.d.ts +11 -0
  340. package/dist/game/kit/danfo.js +109 -0
  341. package/dist/game/kit/danfo.mjs +44 -0
  342. package/dist/game/kit/engine.d.mts +29 -0
  343. package/dist/game/kit/engine.d.ts +29 -0
  344. package/dist/game/kit/engine.js +183 -0
  345. package/dist/game/kit/engine.mjs +30 -0
  346. package/dist/game/kit/five-a-side.d.mts +11 -0
  347. package/dist/game/kit/five-a-side.d.ts +11 -0
  348. package/dist/game/kit/five-a-side.js +86 -0
  349. package/dist/game/kit/five-a-side.mjs +41 -0
  350. package/dist/game/kit/frontier.d.mts +344 -0
  351. package/dist/game/kit/frontier.d.ts +344 -0
  352. package/dist/game/kit/frontier.js +435 -0
  353. package/dist/game/kit/frontier.mjs +14 -0
  354. package/dist/game/kit/genesis.d.mts +752 -0
  355. package/dist/game/kit/genesis.d.ts +752 -0
  356. package/dist/game/kit/genesis.js +380 -0
  357. package/dist/game/kit/genesis.mjs +15 -0
  358. package/dist/game/kit/ludo.d.mts +15 -0
  359. package/dist/game/kit/ludo.d.ts +15 -0
  360. package/dist/game/kit/ludo.js +87 -0
  361. package/dist/game/kit/ludo.mjs +42 -0
  362. package/dist/game/kit/runner.d.mts +12 -0
  363. package/dist/game/kit/runner.d.ts +12 -0
  364. package/dist/game/kit/runner.js +83 -0
  365. package/dist/game/kit/runner.mjs +46 -0
  366. package/dist/game/kit/shootout.d.mts +13 -0
  367. package/dist/game/kit/shootout.d.ts +13 -0
  368. package/dist/game/kit/shootout.js +122 -0
  369. package/dist/game/kit/shootout.mjs +57 -0
  370. package/dist/game/kit/slots.d.mts +392 -0
  371. package/dist/game/kit/slots.d.ts +392 -0
  372. package/dist/game/kit/slots.js +215 -0
  373. package/dist/game/kit/slots.mjs +6 -0
  374. package/dist/game/kit/tycoon.d.mts +16 -0
  375. package/dist/game/kit/tycoon.d.ts +16 -0
  376. package/dist/game/kit/tycoon.js +145 -0
  377. package/dist/game/kit/tycoon.mjs +44 -0
  378. package/dist/game/kit/word.d.mts +11 -0
  379. package/dist/game/kit/word.d.ts +11 -0
  380. package/dist/game/kit/word.js +78 -0
  381. package/dist/game/kit/word.mjs +41 -0
  382. package/dist/game/kit/worlds.d.mts +18 -0
  383. package/dist/game/kit/worlds.d.ts +18 -0
  384. package/dist/game/kit/worlds.js +74 -0
  385. package/dist/game/kit/worlds.mjs +49 -0
  386. package/dist/game/kit.d.mts +53 -0
  387. package/dist/game/kit.d.ts +53 -0
  388. package/dist/game/kit.js +2610 -0
  389. package/dist/game/kit.mjs +101 -0
  390. package/dist/game/prepared.d.mts +14 -0
  391. package/dist/game/prepared.d.ts +14 -0
  392. package/dist/game/prepared.js +81 -0
  393. package/dist/game/prepared.mjs +32 -0
  394. package/dist/game-Bx8onkhX.d.mts +1451 -0
  395. package/dist/game-fgQy2YIm.d.ts +1451 -0
  396. package/dist/game-theme-CBTw1b_d.d.mts +35 -0
  397. package/dist/game-theme-Dg-ict5A.d.ts +35 -0
  398. package/dist/game.d.mts +3546 -0
  399. package/dist/game.d.ts +3546 -0
  400. package/dist/game.js +4455 -0
  401. package/dist/game.mjs +50 -0
  402. package/dist/graphics-C6YjWYvP.d.ts +5 -0
  403. package/dist/graphics-Dk2yQnYN.d.mts +5 -0
  404. package/dist/guest-DrsA00XD.d.mts +732 -0
  405. package/dist/guest-wIdfoT05.d.ts +732 -0
  406. package/dist/hit-stop-BKkVwTq7.d.mts +43 -0
  407. package/dist/hit-stop-D-8pPYnM.d.ts +43 -0
  408. package/dist/hot-Crn9XpHJ.d.ts +29 -0
  409. package/dist/hot-DH3nOhQD.d.mts +29 -0
  410. package/dist/{index-CQStGb3B.d.mts → index-6gkHMGAq.d.mts} +2 -2
  411. package/dist/index-B8ybCKJI.d.ts +41 -0
  412. package/dist/{index-DJwXmoaP.d.ts → index-B98Xac8e.d.ts} +2 -2
  413. package/dist/{index-B7oA_1XI.d.ts → index-B_ByTtIT.d.ts} +2 -2
  414. package/dist/index-DHjNHb1c.d.mts +41 -0
  415. package/dist/{index-DhUSTAhT.d.mts → index-DbAN_VQE.d.mts} +2 -2
  416. package/dist/index.d.mts +134 -24
  417. package/dist/index.d.ts +134 -24
  418. package/dist/index.js +407 -248
  419. package/dist/index.mjs +184 -58
  420. package/dist/interactives-authoring.d.mts +231 -0
  421. package/dist/interactives-authoring.d.ts +231 -0
  422. package/dist/interactives-authoring.js +1743 -0
  423. package/dist/interactives-authoring.mjs +1704 -0
  424. package/dist/interactives-canvas.global.js +148 -0
  425. package/dist/interactives-guest.d.mts +20 -0
  426. package/dist/interactives-guest.d.ts +20 -0
  427. package/dist/interactives-guest.js +63 -0
  428. package/dist/interactives-guest.json +1 -0
  429. package/dist/interactives-guest.mjs +61 -0
  430. package/dist/interactives-jsc.global.js +9357 -0
  431. package/dist/interactives-meters.d.mts +93 -0
  432. package/dist/interactives-meters.d.ts +93 -0
  433. package/dist/interactives-meters.js +252 -0
  434. package/dist/interactives-meters.mjs +68 -0
  435. package/dist/interactives-production.d.mts +430 -0
  436. package/dist/interactives-production.d.ts +430 -0
  437. package/dist/interactives-production.js +1231 -0
  438. package/dist/interactives-production.mjs +1170 -0
  439. package/dist/interactives-record.d.mts +112 -0
  440. package/dist/interactives-record.d.ts +112 -0
  441. package/dist/interactives-record.js +302 -0
  442. package/dist/interactives-record.mjs +295 -0
  443. package/dist/interactives-runtime.d.mts +61 -0
  444. package/dist/interactives-runtime.d.ts +61 -0
  445. package/dist/interactives-runtime.js +442 -0
  446. package/dist/interactives-runtime.mjs +25 -0
  447. package/dist/interactives-studio-kernel.global.js +1 -0
  448. package/dist/interactives-studio.d.mts +806 -0
  449. package/dist/interactives-studio.d.ts +806 -0
  450. package/dist/interactives-studio.js +5741 -0
  451. package/dist/interactives-studio.mjs +5651 -0
  452. package/dist/interactives-tick.d.mts +90 -0
  453. package/dist/interactives-tick.d.ts +90 -0
  454. package/dist/interactives-tick.js +203 -0
  455. package/dist/interactives-tick.mjs +6 -0
  456. package/dist/interactives-web.d.mts +762 -0
  457. package/dist/interactives-web.d.ts +762 -0
  458. package/dist/interactives-web.js +5000 -0
  459. package/dist/interactives-web.mjs +4628 -0
  460. package/dist/interactives.d.mts +2430 -0
  461. package/dist/interactives.d.ts +2430 -0
  462. package/dist/interactives.js +5723 -0
  463. package/dist/interactives.mjs +4333 -0
  464. package/dist/juice-CoHxlpKA.d.ts +42 -0
  465. package/dist/juice-DQztFS43.d.mts +42 -0
  466. package/dist/launch-T2f4_Di4.d.mts +151 -0
  467. package/dist/launch-d6oreMzR.d.ts +151 -0
  468. package/dist/library-DXYaMFhi.d.mts +69 -0
  469. package/dist/library-DXYaMFhi.d.ts +69 -0
  470. package/dist/link-BUTqGmyi.d.mts +38 -0
  471. package/dist/link-BUTqGmyi.d.ts +38 -0
  472. package/dist/lint.js +104 -204
  473. package/dist/lint.mjs +103 -203
  474. package/dist/local-D8_I6UeL.d.mts +6967 -0
  475. package/dist/local-VZkqsCzR.d.ts +6967 -0
  476. package/dist/lockstep-BLf6dglI.d.mts +321 -0
  477. package/dist/lockstep-D50Ia0JW.d.ts +321 -0
  478. package/dist/ludo-B8ClkDqr.d.ts +205 -0
  479. package/dist/ludo-BOuohQ-M.d.mts +205 -0
  480. package/dist/mock/cli.mjs +200 -56
  481. package/dist/mock/library.js +200 -56
  482. package/dist/mock/library.mjs +200 -56
  483. package/dist/mock/msw.js +200 -56
  484. package/dist/mock/msw.mjs +200 -56
  485. package/dist/native-BodxSh03.d.mts +16 -0
  486. package/dist/native-DUHMT8gA.d.ts +16 -0
  487. package/dist/network-ZXLD7l1b.d.mts +19 -0
  488. package/dist/network-ZXLD7l1b.d.ts +19 -0
  489. package/dist/online-XeymeM9s.d.ts +381 -0
  490. package/dist/online-d7W_Al9a.d.mts +381 -0
  491. package/dist/params-DxFb5G_U.d.mts +155 -0
  492. package/dist/params-DxFb5G_U.d.ts +155 -0
  493. package/dist/play-BRRlfLhX.d.ts +940 -0
  494. package/dist/play-ClrMd_e8.d.mts +940 -0
  495. package/dist/policy-CCw8tXLm.d.mts +3078 -0
  496. package/dist/policy-CMqOSQIu.d.ts +3078 -0
  497. package/dist/ports-B_0v_P3A.d.mts +13 -0
  498. package/dist/ports-CGU_3e_0.d.ts +13 -0
  499. package/dist/prefetch-BHnicOQj.d.ts +117 -0
  500. package/dist/prefetch-CBXgYacv.d.mts +117 -0
  501. package/dist/{price-CSztR02F.d.mts → price-BOzexBww.d.mts} +1 -1
  502. package/dist/{price-C_vasx9A.d.ts → price-C1h9sPxE.d.ts} +1 -1
  503. package/dist/protocol-C8qbpUbT.d.mts +242 -0
  504. package/dist/protocol-C8qbpUbT.d.ts +242 -0
  505. package/dist/rapier-AZHT4YI7.js +7886 -0
  506. package/dist/rapier-ODEPCQA6.mjs +7792 -0
  507. package/dist/react.d.mts +157 -15
  508. package/dist/react.d.ts +157 -15
  509. package/dist/react.js +5564 -5904
  510. package/dist/react.mjs +5451 -5808
  511. package/dist/runner-CQcLL7By.d.ts +189 -0
  512. package/dist/runner-D46Yj-wE.d.mts +189 -0
  513. package/dist/runtime-BRWfkf_q.d.mts +51 -0
  514. package/dist/runtime-DyuBMkKM.d.ts +51 -0
  515. package/dist/scheduling-D2ajXpMC.d.ts +224 -0
  516. package/dist/scheduling-DSRbbaZb.d.mts +224 -0
  517. package/dist/schema-BrWxzKp6.d.mts +63 -0
  518. package/dist/schema-BrWxzKp6.d.ts +63 -0
  519. package/dist/server/evict.js +34 -37
  520. package/dist/server/evict.mjs +34 -37
  521. package/dist/server/tanstack.d.mts +49 -3
  522. package/dist/server/tanstack.d.ts +49 -3
  523. package/dist/server/tanstack.js +169 -117
  524. package/dist/server/tanstack.mjs +166 -118
  525. package/dist/{server-Dckg4Vdr.d.ts → server-D29IIuDV.d.ts} +136 -130
  526. package/dist/{server-B6dW7-Lj.d.mts → server-DQMWPnc8.d.mts} +136 -130
  527. package/dist/server.d.mts +45 -5
  528. package/dist/server.d.ts +45 -5
  529. package/dist/server.js +171 -227
  530. package/dist/server.mjs +165 -225
  531. package/dist/session-grant-CJ27DwrT.d.mts +19 -0
  532. package/dist/session-grant-CJ27DwrT.d.ts +19 -0
  533. package/dist/shootout-BJZeX6FG.d.ts +140 -0
  534. package/dist/shootout-tcZd1Rxt.d.mts +140 -0
  535. package/dist/state-replica-stMtdkVD.d.mts +42 -0
  536. package/dist/state-replica-stMtdkVD.d.ts +42 -0
  537. package/dist/studio-CowqWqez.d.mts +14 -0
  538. package/dist/studio-CowqWqez.d.ts +14 -0
  539. package/dist/styles.css +1 -1
  540. package/dist/template-AhCdB1kW.d.mts +190 -0
  541. package/dist/template-BkEGVTQj.d.ts +190 -0
  542. package/dist/terrain-BMxEc6Oc.d.ts +429 -0
  543. package/dist/terrain-C-XC1Oui.d.mts +429 -0
  544. package/dist/testing/msw.d.mts +28 -4
  545. package/dist/testing/msw.d.ts +28 -4
  546. package/dist/testing/msw.js +15 -21
  547. package/dist/testing/msw.mjs +15 -21
  548. package/dist/testing/suite.d.mts +6 -5
  549. package/dist/testing/suite.d.ts +6 -5
  550. package/dist/testing/suite.js +89 -124
  551. package/dist/testing/suite.mjs +81 -116
  552. package/dist/testing.d.mts +27 -1227
  553. package/dist/testing.d.ts +27 -1227
  554. package/dist/testing.js +127 -131
  555. package/dist/testing.mjs +19 -23
  556. package/dist/tick-transport-C8QEh8Uw.d.mts +50 -0
  557. package/dist/tick-transport-UjHY3xK1.d.ts +50 -0
  558. package/dist/timeline-protocol-hp6e8zFB.d.mts +47 -0
  559. package/dist/timeline-protocol-hp6e8zFB.d.ts +47 -0
  560. package/dist/tokens-DhanQRQS.d.mts +21 -0
  561. package/dist/tokens-K8yxwd6G.d.ts +21 -0
  562. package/dist/tree-C-Io2Hbx.d.mts +35 -0
  563. package/dist/tree-CP_qSW4H.d.ts +35 -0
  564. package/dist/tycoon-B5KHk2Xx.d.mts +255 -0
  565. package/dist/tycoon-hmHo-3HX.d.ts +255 -0
  566. package/dist/types-BQkxPwZP.d.mts +219 -0
  567. package/dist/types-D_f6UUxM.d.ts +219 -0
  568. package/dist/ui-DwHicuFv.d.mts +563 -0
  569. package/dist/ui-hi7S2YcH.d.ts +563 -0
  570. package/dist/{sign-in-DQlIdqsi.d.mts → url-52ndUruG.d.mts} +15 -1
  571. package/dist/{sign-in-DQlIdqsi.d.ts → url-52ndUruG.d.ts} +15 -1
  572. package/dist/utils.d.mts +3 -3
  573. package/dist/utils.d.ts +3 -3
  574. package/dist/utils.js +37 -37
  575. package/dist/utils.mjs +4 -4
  576. package/dist/vars-Dc_PrhBK.d.mts +511 -0
  577. package/dist/vars-Dc_PrhBK.d.ts +511 -0
  578. package/dist/vm-IUARFFAI.mjs +63 -0
  579. package/dist/vm-N7L6MGGH.js +65 -0
  580. package/dist/weave-delivery-CW-Kstut.d.mts +360 -0
  581. package/dist/weave-delivery-CW-Kstut.d.ts +360 -0
  582. package/dist/web-Dss74a7v.d.ts +883 -0
  583. package/dist/web-f9ZQPoyw.d.mts +883 -0
  584. package/dist/web-transport-C7MkBL0a.d.ts +19 -0
  585. package/dist/web-transport-aYEqXMd9.d.mts +19 -0
  586. package/dist/weight-CPGjsgjV.d.ts +92 -0
  587. package/dist/weight-tF1ODR1p.d.mts +92 -0
  588. package/dist/word-BcX9Jcmv.d.mts +70 -0
  589. package/dist/word-C7sVPLHm.d.ts +70 -0
  590. package/dist/world-PvILHDR1.d.ts +2285 -0
  591. package/dist/world-qekkXjJv.d.mts +2285 -0
  592. package/dist/worlds-Br2Pb0Cs.d.ts +109 -0
  593. package/dist/worlds-D5ydYr7d.d.mts +109 -0
  594. package/engines/c/cimplify.h +108 -0
  595. package/engines/c/cimplify.lib.js +11 -0
  596. package/engines/godot/addons/cimplify/cimplify.gd +97 -0
  597. package/engines/rust/interactives-ctx/Cargo.toml +9 -0
  598. package/engines/rust/interactives-ctx/src/lib.rs +189 -0
  599. package/package.json +189 -3
  600. package/vendor/rapier3d-compat/LICENSE +201 -0
  601. package/vendor/rapier3d-compat/PATCHES.md +61 -0
  602. package/dist/chunk-2P4KXFB6.js +0 -274
  603. package/dist/chunk-3G6RQLXK.mjs +0 -21
  604. package/dist/chunk-3V4DVXV3.mjs +0 -254
  605. package/dist/chunk-EDK3LNM6.js +0 -2436
  606. package/dist/chunk-F7J3HK27.js +0 -4549
  607. package/dist/chunk-U4MW6PYU.mjs +0 -23
  608. package/dist/chunk-XREIZ56K.js +0 -26
@@ -0,0 +1,2220 @@
1
+ 'use strict';
2
+
3
+ var chunk5SXDH3Y7_js = require('./chunk-5SXDH3Y7.js');
4
+ var chunkVRBDAS5I_js = require('./chunk-VRBDAS5I.js');
5
+ var chunkZJBRUH6V_js = require('./chunk-ZJBRUH6V.js');
6
+ var chunkT6Z2EXYL_js = require('./chunk-T6Z2EXYL.js');
7
+ var chunkPDOELNNQ_js = require('./chunk-PDOELNNQ.js');
8
+
9
+ // src/interactives/game-ui/styling/keys.ts
10
+ var ValueType = {
11
+ length: 0,
12
+ float: 1,
13
+ int: 2,
14
+ color: 3,
15
+ enumeration: 4,
16
+ bool: 5,
17
+ edges: 6,
18
+ pair: 7,
19
+ colors: 8,
20
+ quad: 9,
21
+ shadow: 10,
22
+ gradient: 11
23
+ }, GRADIENT_STOPS = 4, SHADOW_WORDS = 5, GRADIENT_WORDS = 1 + (4) * 2 + 4, GRADIENT_FIRST_FLOAT = 1 + (4), VALUE_WORDS = [1, 1, 1, 1, 1, 1, 4, 2, 4, 4, (5), GRADIENT_WORDS];
24
+ function isFloatWord(type, word) {
25
+ switch (type) {
26
+ case ValueType.length:
27
+ case ValueType.float:
28
+ case ValueType.edges:
29
+ case ValueType.pair:
30
+ case ValueType.quad:
31
+ return true;
32
+ case ValueType.shadow:
33
+ return word > 0;
34
+ case ValueType.gradient:
35
+ return word >= GRADIENT_FIRST_FLOAT;
36
+ default:
37
+ return false;
38
+ }
39
+ }
40
+ function isColorWord(type, word) {
41
+ return type === ValueType.color || type === ValueType.colors ? true : type === ValueType.shadow ? word === 0 : type === ValueType.gradient ? word > 0 && word < GRADIENT_FIRST_FLOAT : false;
42
+ }
43
+ var Tier = { shorthandOfShorthands: 1e3, shorthandOfLonghands: 2e3, plain: 3e3, longhand: 4e3 }, DISPLAY = { flex: 0, none: 1 }, POSITION = { relative: 0, absolute: 1 }, POINTER = { auto: 0, none: 1 }, T = ValueType, S1 = Tier.shorthandOfShorthands, S2 = Tier.shorthandOfLonghands, P = Tier.plain, L = Tier.longhand, SPECS = [
44
+ { name: "width", type: T.length, tier: P },
45
+ { name: "height", type: T.length, tier: P },
46
+ { name: "minWidth", type: T.length, tier: P },
47
+ { name: "minHeight", type: T.length, tier: P },
48
+ { name: "maxWidth", type: T.length, tier: P },
49
+ { name: "maxHeight", type: T.length, tier: P },
50
+ { name: "basis", type: T.length, tier: P },
51
+ { name: "inset", type: T.length, tier: S1 },
52
+ { name: "insetInline", type: T.length, tier: S2 },
53
+ { name: "insetBlock", type: T.length, tier: S2 },
54
+ { name: "top", type: T.length, tier: L },
55
+ { name: "right", type: T.length, tier: L },
56
+ { name: "bottom", type: T.length, tier: L },
57
+ { name: "left", type: T.length, tier: L },
58
+ { name: "padding", type: T.edges, tier: S1 },
59
+ { name: "paddingInline", type: T.float, tier: S2 },
60
+ { name: "paddingBlock", type: T.float, tier: S2 },
61
+ { name: "paddingTop", type: T.float, tier: L },
62
+ { name: "paddingRight", type: T.float, tier: L },
63
+ { name: "paddingBottom", type: T.float, tier: L },
64
+ { name: "paddingLeft", type: T.float, tier: L },
65
+ { name: "margin", type: T.edges, tier: S1 },
66
+ { name: "marginInline", type: T.float, tier: S2 },
67
+ { name: "marginBlock", type: T.float, tier: S2 },
68
+ { name: "marginTop", type: T.float, tier: L },
69
+ { name: "marginRight", type: T.float, tier: L },
70
+ { name: "marginBottom", type: T.float, tier: L },
71
+ { name: "marginLeft", type: T.float, tier: L },
72
+ { name: "borderWidth", type: T.edges, tier: S1 },
73
+ { name: "borderInlineWidth", type: T.float, tier: S2 },
74
+ { name: "borderBlockWidth", type: T.float, tier: S2 },
75
+ { name: "borderTopWidth", type: T.float, tier: L },
76
+ { name: "borderRightWidth", type: T.float, tier: L },
77
+ { name: "borderBottomWidth", type: T.float, tier: L },
78
+ { name: "borderLeftWidth", type: T.float, tier: L },
79
+ { name: "gap", type: T.pair, tier: S2 },
80
+ { name: "columnGap", type: T.float, tier: L },
81
+ { name: "rowGap", type: T.float, tier: L },
82
+ { name: "grow", type: T.float, tier: P },
83
+ { name: "shrink", type: T.float, tier: P },
84
+ { name: "aspect", type: T.float, tier: P },
85
+ { name: "direction", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.DIRECTION },
86
+ { name: "justify", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.JUSTIFY },
87
+ { name: "alignItems", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.ALIGN },
88
+ { name: "alignSelf", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.ALIGN },
89
+ { name: "alignContent", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.ALIGN },
90
+ { name: "position", type: T.enumeration, tier: P, table: POSITION },
91
+ { name: "wrap", type: T.bool, tier: P },
92
+ { name: "display", type: T.enumeration, tier: P, table: DISPLAY },
93
+ { name: "fill", type: T.color, tier: P },
94
+ { name: "borderColor", type: T.colors, tier: S1 },
95
+ { name: "borderInlineColor", type: T.color, tier: S2 },
96
+ { name: "borderBlockColor", type: T.color, tier: S2 },
97
+ { name: "borderTopColor", type: T.color, tier: L },
98
+ { name: "borderRightColor", type: T.color, tier: L },
99
+ { name: "borderBottomColor", type: T.color, tier: L },
100
+ { name: "borderLeftColor", type: T.color, tier: L },
101
+ { name: "radius", type: T.edges, tier: S2 },
102
+ { name: "radiusTopLeft", type: T.float, tier: L },
103
+ { name: "radiusTopRight", type: T.float, tier: L },
104
+ { name: "radiusBottomRight", type: T.float, tier: L },
105
+ { name: "radiusBottomLeft", type: T.float, tier: L },
106
+ { name: "opacity", type: T.float, tier: P },
107
+ { name: "translate", type: T.pair, tier: S2 },
108
+ { name: "translateX", type: T.float, tier: L },
109
+ { name: "translateY", type: T.float, tier: L },
110
+ { name: "scale", type: T.pair, tier: S2 },
111
+ { name: "scaleX", type: T.float, tier: L },
112
+ { name: "scaleY", type: T.float, tier: L },
113
+ { name: "rotate", type: T.float, tier: P },
114
+ { name: "origin", type: T.pair, tier: P },
115
+ { name: "zIndex", type: T.int, tier: P },
116
+ { name: "hidden", type: T.bool, tier: P },
117
+ { name: "clip", type: T.bool, tier: P },
118
+ { name: "pointerEvents", type: T.enumeration, tier: P, table: POINTER },
119
+ { name: "layer", type: T.bool, tier: P },
120
+ { name: "shadow", type: T.shadow, tier: P },
121
+ { name: "gradient", type: T.gradient, tier: P },
122
+ { name: "fontFamily", type: T.int, tier: P },
123
+ { name: "fontWeight", type: T.int, tier: P },
124
+ { name: "fontSize", type: T.float, tier: P },
125
+ { name: "lineHeight", type: T.float, tier: P },
126
+ { name: "letterSpacing", type: T.float, tier: P },
127
+ { name: "textAlign", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.TEXT_ALIGN },
128
+ { name: "textColor", type: T.color, tier: P },
129
+ { name: "textWrap", type: T.bool, tier: P },
130
+ { name: "verticalAlign", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.VERTICAL },
131
+ { name: "placeholderColor", type: T.color, tier: P },
132
+ { name: "tint", type: T.color, tier: P },
133
+ { name: "uv", type: T.quad, tier: P },
134
+ { name: "nineSlice", type: T.edges, tier: P },
135
+ { name: "nineSliceUv", type: T.edges, tier: P },
136
+ { name: "shape", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.SHAPE },
137
+ { name: "stroke", type: T.color, tier: P },
138
+ { name: "strokeWidth", type: T.float, tier: P },
139
+ { name: "scrollAxes", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.AXES },
140
+ { name: "textWrapStyle", type: T.enumeration, tier: P, table: chunkVRBDAS5I_js.TEXT_WRAP_STYLE }
141
+ ], KEY_COUNT = SPECS.length, KEY_NAMES = SPECS.map((s) => s.name), KEY_TYPES = Uint8Array.from(SPECS, (s) => s.type), KEY_TIERS = Uint16Array.from(SPECS, (s) => s.tier), KEY_TABLES = SPECS.map((s) => s.table ?? null), ALIASES = {
142
+ borderRadius: "radius",
143
+ borderTopLeftRadius: "radiusTopLeft",
144
+ borderTopRightRadius: "radiusTopRight",
145
+ borderBottomRightRadius: "radiusBottomRight",
146
+ borderBottomLeftRadius: "radiusBottomLeft",
147
+ paddingHorizontal: "paddingInline",
148
+ paddingVertical: "paddingBlock",
149
+ marginHorizontal: "marginInline",
150
+ marginVertical: "marginBlock",
151
+ flexGrow: "grow",
152
+ flexShrink: "shrink",
153
+ flexBasis: "basis",
154
+ flexDirection: "direction",
155
+ justifyContent: "justify",
156
+ backgroundColor: "fill",
157
+ color: "textColor",
158
+ aspectRatio: "aspect"
159
+ }, KEY_IDS = /* @__PURE__ */ new Map();
160
+ SPECS.forEach((s, i) => KEY_IDS.set(s.name, i));
161
+ for (let [alias, target] of Object.entries(ALIASES)) KEY_IDS.set(alias, KEY_IDS.get(target));
162
+ function keyId(name) {
163
+ return KEY_IDS.get(name) ?? -1;
164
+ }
165
+ var STYLE_PROPERTY_NAMES = [...KEY_IDS.keys()], Condition = {
166
+ pressed: 1,
167
+ focus: 2,
168
+ disabled: 4,
169
+ landscape: 8,
170
+ portrait: 16,
171
+ safe: 32,
172
+ sm: 64,
173
+ lg: 128
174
+ }, STATE_CONDITIONS = Condition.pressed | Condition.focus | Condition.disabled, CONTEXT_CONDITIONS = Condition.landscape | Condition.portrait | Condition.safe | Condition.sm | Condition.lg, CONDITION_KEYS = {
175
+ ":pressed": Condition.pressed,
176
+ ":active": Condition.pressed,
177
+ ":focus": Condition.focus,
178
+ ":disabled": Condition.disabled,
179
+ "@landscape": Condition.landscape,
180
+ "@portrait": Condition.portrait,
181
+ "@safe": Condition.safe,
182
+ "@sm": Condition.sm,
183
+ "@lg": Condition.lg
184
+ }, PSEUDO_ACTIVE = 170, PSEUDO_FOCUS = 150, PSEUDO_DISABLED = 92, AT_MEDIA = 200, CONDITION_BITS = 8, CONDITION_PRIORITY = [(170), (150), (92), (200), (200), (200), (200), (200)];
185
+ function conditionPriority(mask) {
186
+ let total = 0;
187
+ for (let bit = 0; bit < (8); bit++) mask & 1 << bit && (total += CONDITION_PRIORITY[bit]);
188
+ return total;
189
+ }
190
+ var WireEmit = { length: 0, float: 1, word: 2, floats: 3, words: 4, shadow: 5, gradient: 6, flag: 7 }, BLACK = 0, WHITE = 4294967295, PLACEHOLDER = 4294967168, DEFAULT_WEIGHT = 400, DEFAULT_FONT = 16, CENTER = 0.5;
191
+ function length(prop, chain) {
192
+ return { prop, emit: WireEmit.length, components: [chain], defaults: [0, chunkVRBDAS5I_js.UiUnit.auto] };
193
+ }
194
+ function single(prop, emit, key, fallback) {
195
+ return { prop, emit, components: [[[key, 0]]], defaults: [fallback] };
196
+ }
197
+ function sides(prop, all, inline, block, top, right, bottom, left) {
198
+ return {
199
+ prop,
200
+ emit: WireEmit.floats,
201
+ components: [
202
+ [[all, 0], [block, 0], [top, 0]],
203
+ [[all, 1], [inline, 0], [right, 0]],
204
+ [[all, 2], [block, 0], [bottom, 0]],
205
+ [[all, 3], [inline, 0], [left, 0]]
206
+ ],
207
+ defaults: [0, 0, 0, 0]
208
+ };
209
+ }
210
+ function pair(prop, all, first, second, fallback) {
211
+ return {
212
+ prop,
213
+ emit: WireEmit.floats,
214
+ components: [first === null ? [[all, 0]] : [[all, 0], [first, 0]], second === null ? [[all, 1]] : [[all, 1], [second, 0]]],
215
+ defaults: [fallback, fallback]
216
+ };
217
+ }
218
+ function whole(prop, emit, key, defaults2) {
219
+ return { prop, emit, components: defaults2.map((_, i) => [[key, i]]), defaults: defaults2 };
220
+ }
221
+ var WIRE_SPECS = [
222
+ length(chunkVRBDAS5I_js.UiProp.width, [["width", 0]]),
223
+ length(chunkVRBDAS5I_js.UiProp.height, [["height", 0]]),
224
+ length(chunkVRBDAS5I_js.UiProp.min_width, [["minWidth", 0]]),
225
+ length(chunkVRBDAS5I_js.UiProp.min_height, [["minHeight", 0]]),
226
+ length(chunkVRBDAS5I_js.UiProp.max_width, [["maxWidth", 0]]),
227
+ length(chunkVRBDAS5I_js.UiProp.max_height, [["maxHeight", 0]]),
228
+ length(chunkVRBDAS5I_js.UiProp.basis, [["basis", 0]]),
229
+ length(chunkVRBDAS5I_js.UiProp.inset_top, [["inset", 0], ["insetBlock", 0], ["top", 0]]),
230
+ length(chunkVRBDAS5I_js.UiProp.inset_right, [["inset", 0], ["insetInline", 0], ["right", 0]]),
231
+ length(chunkVRBDAS5I_js.UiProp.inset_bottom, [["inset", 0], ["insetBlock", 0], ["bottom", 0]]),
232
+ length(chunkVRBDAS5I_js.UiProp.inset_left, [["inset", 0], ["insetInline", 0], ["left", 0]]),
233
+ sides(chunkVRBDAS5I_js.UiProp.padding, "padding", "paddingInline", "paddingBlock", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft"),
234
+ sides(chunkVRBDAS5I_js.UiProp.margin, "margin", "marginInline", "marginBlock", "marginTop", "marginRight", "marginBottom", "marginLeft"),
235
+ sides(chunkVRBDAS5I_js.UiProp.border_width, "borderWidth", "borderInlineWidth", "borderBlockWidth", "borderTopWidth", "borderRightWidth", "borderBottomWidth", "borderLeftWidth"),
236
+ pair(chunkVRBDAS5I_js.UiProp.gap, "gap", "columnGap", "rowGap", 0),
237
+ single(chunkVRBDAS5I_js.UiProp.grow, WireEmit.float, "grow", 0),
238
+ single(chunkVRBDAS5I_js.UiProp.shrink, WireEmit.float, "shrink", 1),
239
+ single(chunkVRBDAS5I_js.UiProp.aspect, WireEmit.float, "aspect", 0),
240
+ single(chunkVRBDAS5I_js.UiProp.direction, WireEmit.word, "direction", chunkVRBDAS5I_js.DIRECTION.column),
241
+ single(chunkVRBDAS5I_js.UiProp.justify, WireEmit.word, "justify", chunkVRBDAS5I_js.JUSTIFY.start),
242
+ single(chunkVRBDAS5I_js.UiProp.align_items, WireEmit.word, "alignItems", chunkVRBDAS5I_js.ALIGN.stretch),
243
+ single(chunkVRBDAS5I_js.UiProp.align_self, WireEmit.word, "alignSelf", chunkVRBDAS5I_js.ALIGN.auto),
244
+ single(chunkVRBDAS5I_js.UiProp.align_content, WireEmit.word, "alignContent", chunkVRBDAS5I_js.ALIGN.stretch),
245
+ single(chunkVRBDAS5I_js.UiProp.position, WireEmit.word, "position", POSITION.relative),
246
+ single(chunkVRBDAS5I_js.UiProp.wrap, WireEmit.word, "wrap", 0),
247
+ single(chunkVRBDAS5I_js.UiProp.display_none, WireEmit.word, "display", DISPLAY.flex),
248
+ single(chunkVRBDAS5I_js.UiProp.fill, WireEmit.word, "fill", (0)),
249
+ {
250
+ prop: chunkVRBDAS5I_js.UiProp.border_color,
251
+ emit: WireEmit.words,
252
+ components: [
253
+ [["borderColor", 0], ["borderBlockColor", 0], ["borderTopColor", 0]],
254
+ [["borderColor", 1], ["borderInlineColor", 0], ["borderRightColor", 0]],
255
+ [["borderColor", 2], ["borderBlockColor", 0], ["borderBottomColor", 0]],
256
+ [["borderColor", 3], ["borderInlineColor", 0], ["borderLeftColor", 0]]
257
+ ],
258
+ defaults: [(0), (0), (0), (0)]
259
+ },
260
+ {
261
+ prop: chunkVRBDAS5I_js.UiProp.radii,
262
+ emit: WireEmit.floats,
263
+ components: [
264
+ [["radius", 0], ["radiusTopLeft", 0]],
265
+ [["radius", 1], ["radiusTopRight", 0]],
266
+ [["radius", 2], ["radiusBottomRight", 0]],
267
+ [["radius", 3], ["radiusBottomLeft", 0]]
268
+ ],
269
+ defaults: [0, 0, 0, 0]
270
+ },
271
+ single(chunkVRBDAS5I_js.UiProp.opacity, WireEmit.float, "opacity", 1),
272
+ pair(chunkVRBDAS5I_js.UiProp.translate, "translate", "translateX", "translateY", 0),
273
+ pair(chunkVRBDAS5I_js.UiProp.scale, "scale", "scaleX", "scaleY", 1),
274
+ single(chunkVRBDAS5I_js.UiProp.rotate, WireEmit.float, "rotate", 0),
275
+ pair(chunkVRBDAS5I_js.UiProp.origin, "origin", null, null, (0.5)),
276
+ single(chunkVRBDAS5I_js.UiProp.z_index, WireEmit.word, "zIndex", 0),
277
+ single(chunkVRBDAS5I_js.UiProp.hidden, WireEmit.word, "hidden", 0),
278
+ single(chunkVRBDAS5I_js.UiProp.clip, WireEmit.word, "clip", 0),
279
+ single(chunkVRBDAS5I_js.UiProp.pointer_events_none, WireEmit.word, "pointerEvents", POINTER.auto),
280
+ single(chunkVRBDAS5I_js.UiProp.flags, WireEmit.flag, "layer", 0),
281
+ whole(chunkVRBDAS5I_js.UiProp.shadow, WireEmit.shadow, "shadow", [0, 0, 0, 0, 0]),
282
+ whole(chunkVRBDAS5I_js.UiProp.gradient, WireEmit.gradient, "gradient", new Array(GRADIENT_WORDS).fill(0)),
283
+ single(chunkVRBDAS5I_js.UiProp.font_family, WireEmit.word, "fontFamily", 0),
284
+ single(chunkVRBDAS5I_js.UiProp.font_weight, WireEmit.word, "fontWeight", (400)),
285
+ single(chunkVRBDAS5I_js.UiProp.font_size, WireEmit.float, "fontSize", (16)),
286
+ single(chunkVRBDAS5I_js.UiProp.line_height, WireEmit.float, "lineHeight", 0),
287
+ single(chunkVRBDAS5I_js.UiProp.letter_spacing, WireEmit.float, "letterSpacing", 0),
288
+ single(chunkVRBDAS5I_js.UiProp.text_align, WireEmit.word, "textAlign", chunkVRBDAS5I_js.TEXT_ALIGN.start),
289
+ single(chunkVRBDAS5I_js.UiProp.text_color, WireEmit.word, "textColor", (4294967295)),
290
+ single(chunkVRBDAS5I_js.UiProp.text_wrap, WireEmit.word, "textWrap", 0),
291
+ single(chunkVRBDAS5I_js.UiProp.vertical_align, WireEmit.word, "verticalAlign", chunkVRBDAS5I_js.VERTICAL.top),
292
+ single(chunkVRBDAS5I_js.UiProp.placeholder_color, WireEmit.word, "placeholderColor", (4294967168)),
293
+ single(chunkVRBDAS5I_js.UiProp.image_tint, WireEmit.word, "tint", (4294967295)),
294
+ whole(chunkVRBDAS5I_js.UiProp.image_uv, WireEmit.floats, "uv", [0, 0, 1, 1]),
295
+ whole(chunkVRBDAS5I_js.UiProp.nine_slice, WireEmit.floats, "nineSlice", [0, 0, 0, 0]),
296
+ whole(chunkVRBDAS5I_js.UiProp.nine_slice_uv, WireEmit.floats, "nineSliceUv", [0, 0, 0, 0]),
297
+ single(chunkVRBDAS5I_js.UiProp.shape_kind, WireEmit.word, "shape", chunkVRBDAS5I_js.SHAPE.rect),
298
+ single(chunkVRBDAS5I_js.UiProp.stroke_color, WireEmit.word, "stroke", (0)),
299
+ single(chunkVRBDAS5I_js.UiProp.stroke_width, WireEmit.float, "strokeWidth", 0),
300
+ single(chunkVRBDAS5I_js.UiProp.scroll_axes, WireEmit.word, "scrollAxes", chunkVRBDAS5I_js.AXES.none),
301
+ single(chunkVRBDAS5I_js.UiProp.text_wrap_style, WireEmit.word, "textWrapStyle", chunkVRBDAS5I_js.TEXT_WRAP_STYLE.greedy)
302
+ ], WIRE_COUNT = WIRE_SPECS.length, WIRE_PROPS = Uint8Array.from(WIRE_SPECS, (w) => w.prop), WIRE_EMITS = Uint8Array.from(WIRE_SPECS, (w) => w.emit), WIRE_COMPONENT_START = new Uint16Array(WIRE_COUNT), WIRE_COMPONENT_COUNT = new Uint8Array(WIRE_COUNT), WIRE_DEFAULT_UNIT = new Uint8Array(WIRE_COUNT), components = [], defaults = [], chainStart = [], chainCount = [], chainKeys = [], chainWords = [], keyWires = Array.from({ length: KEY_COUNT }, () => []);
303
+ WIRE_SPECS.forEach((wire, w) => {
304
+ WIRE_COMPONENT_START[w] = components.length, WIRE_COMPONENT_COUNT[w] = wire.components.length, WIRE_DEFAULT_UNIT[w] = wire.emit === WireEmit.length ? wire.defaults[1] : 0, wire.components.forEach((chain, c) => {
305
+ components.push(components.length), defaults.push(wire.defaults[c]), chainStart.push(chainKeys.length), chainCount.push(chain.length);
306
+ for (let [name, word] of chain) {
307
+ let id = keyId(name);
308
+ if (id < 0) throw new Error(`wire chain names unknown key ${name}`);
309
+ chainKeys.push(id), chainWords.push(word), keyWires[id].indexOf(w) < 0 && keyWires[id].push(w);
310
+ }
311
+ });
312
+ });
313
+ var descendants = Array.from({ length: KEY_COUNT }, () => /* @__PURE__ */ new Set());
314
+ for (let wire of WIRE_SPECS)
315
+ for (let chain of wire.components)
316
+ for (let i = 0; i < chain.length; i++)
317
+ for (let j = i + 1; j < chain.length; j++) descendants[keyId(chain[i][0])].add(keyId(chain[j][0]));
318
+ var KEY_DESCENDANTS = descendants.map((set) => [...set].sort((a, b) => a - b)), COMPONENT_DEFAULTS = Float64Array.from(defaults), COMPONENT_CHAIN_START = Uint16Array.from(chainStart), COMPONENT_CHAIN_COUNT = Uint8Array.from(chainCount), CHAIN_KEYS = Uint8Array.from(chainKeys), CHAIN_WORDS = Uint8Array.from(chainWords), KEY_WIRES = keyWires.map((list) => Uint8Array.from(list)), MAX_COMPONENTS = GRADIENT_WORDS;
319
+
320
+ // src/interactives/game-ui/styling/compile.ts
321
+ var STYLE_BLOCK_MAGIC = 827937875, STYLE_BLOCK_VERSION = 1, STYLE_BLOCK_HEADER_WORDS = 2, VariantKind = { literal: 0, null: 1, referenced: 2 }, SLOT_REFERENCE = 2147483648, BYTE = 255, COUNT_SHIFT = 8, PAYLOAD_SHIFT = 8, KIND_SHIFT = 16, UNIT_SHIFT = 20, NIBBLE = 15, VERSION_SHIFT = 16, COUNT_MASK = 65535, PERCENT = "%", AUTO = "auto", DEFAULT = "default", UiStyleCompileError = class extends chunkVRBDAS5I_js.UiStyleError {
322
+ constructor(message, kind, subject, suggestion) {
323
+ super(message);
324
+ this.kind = kind;
325
+ this.subject = subject;
326
+ this.suggestion = suggestion;
327
+ this.name = "UiStyleCompileError";
328
+ }
329
+ };
330
+ function propertyError(name) {
331
+ let hit = chunkZJBRUH6V_js.suggest(name, STYLE_PROPERTY_NAMES);
332
+ return new UiStyleCompileError(`unknown style property "${name}"${hit === null ? "" : `; did you mean "${hit}"?`}`, "property", name, hit);
333
+ }
334
+ function valueError(key, detail) {
335
+ return new UiStyleCompileError(`${key}: ${detail}`, "value", key, null);
336
+ }
337
+ var f32 = new Float32Array(1), u32 = new Uint32Array(f32.buffer);
338
+ function floatBits(value) {
339
+ return f32[0] = value, u32[0];
340
+ }
341
+ function bitsFloat(word) {
342
+ return u32[0] = word, f32[0];
343
+ }
344
+ function isReference(value) {
345
+ return value instanceof chunk5SXDH3Y7_js.UiVar || value instanceof chunk5SXDH3Y7_js.UiSlot;
346
+ }
347
+ function referenceWord(value) {
348
+ return value instanceof chunk5SXDH3Y7_js.UiSlot ? ((2147483648) | value.index) >>> 0 : value.id;
349
+ }
350
+ function isPlainObject(value) {
351
+ if (typeof value != "object" || value === null || Array.isArray(value) || isReference(value)) return false;
352
+ let proto = Object.getPrototypeOf(value);
353
+ return proto === Object.prototype || proto === null;
354
+ }
355
+ function isConditional(value) {
356
+ if (!isPlainObject(value)) return false;
357
+ for (let key of Object.keys(value)) if (key === DEFAULT || key.startsWith(":") || key.startsWith("@")) return true;
358
+ return false;
359
+ }
360
+ function flatten(key, value, mask, out) {
361
+ if (!isConditional(value)) {
362
+ out.delete(mask), out.set(mask, value);
363
+ return;
364
+ }
365
+ for (let [name, nested] of Object.entries(value)) {
366
+ if (name === DEFAULT) {
367
+ flatten(key, nested, mask, out);
368
+ continue;
369
+ }
370
+ let bit = CONDITION_KEYS[name];
371
+ if (bit === void 0) {
372
+ let hit = chunkZJBRUH6V_js.suggest(name, Object.keys(CONDITION_KEYS));
373
+ throw new UiStyleCompileError(`${key}: unknown condition "${name}"${hit === null ? "" : `; did you mean "${hit}"?`}`, "condition", name, hit);
374
+ }
375
+ flatten(key, nested, mask | bit, out);
376
+ }
377
+ }
378
+ var Encoder = class {
379
+ constructor(key) {
380
+ this.key = key;
381
+ this.words = [];
382
+ this.refs = 0;
383
+ this.unit = 0;
384
+ }
385
+ reference(value) {
386
+ this.refs |= 1 << this.words.length, this.words.push(referenceWord(value));
387
+ }
388
+ float(value) {
389
+ if (isReference(value)) return this.reference(value);
390
+ if (typeof value != "number" || !Number.isFinite(value)) throw valueError(this.key, `${String(value)} must be a finite number`);
391
+ this.words.push(floatBits(value));
392
+ }
393
+ color(value) {
394
+ if (isReference(value)) return this.reference(value);
395
+ if (typeof value != "number" && typeof value != "string") throw valueError(this.key, `${String(value)} must be a colour`);
396
+ try {
397
+ this.words.push(chunkVRBDAS5I_js.parseColor(value));
398
+ } catch (error) {
399
+ throw valueError(this.key, error.message);
400
+ }
401
+ }
402
+ length(value) {
403
+ if (isReference(value))
404
+ return this.unit = value instanceof chunk5SXDH3Y7_js.UiSlot && value.percent ? chunkVRBDAS5I_js.UiUnit.percent : chunkVRBDAS5I_js.UiUnit.points, this.reference(value);
405
+ if (typeof value == "number" && Number.isFinite(value)) {
406
+ this.unit = chunkVRBDAS5I_js.UiUnit.points, this.words.push(floatBits(value));
407
+ return;
408
+ }
409
+ if (value === AUTO) {
410
+ this.unit = chunkVRBDAS5I_js.UiUnit.auto, this.words.push(0);
411
+ return;
412
+ }
413
+ if (typeof value == "string" && value.endsWith(PERCENT)) {
414
+ let amount = Number(value.slice(0, -PERCENT.length));
415
+ if (Number.isFinite(amount)) {
416
+ this.unit = chunkVRBDAS5I_js.UiUnit.percent, this.words.push(floatBits(amount));
417
+ return;
418
+ }
419
+ }
420
+ throw valueError(this.key, `length ${String(value)} must be a number, a percentage or auto`);
421
+ }
422
+ enumeration(value, table) {
423
+ if (isReference(value)) return this.reference(value);
424
+ let code = typeof value == "string" ? table[value] : void 0;
425
+ if (code === void 0) throw valueError(this.key, `${String(value)} is not one of ${Object.keys(table).join(", ")}${chunkZJBRUH6V_js.didYouMean(String(value), Object.keys(table))}`);
426
+ this.words.push(code);
427
+ }
428
+ bool(value) {
429
+ if (isReference(value)) return this.reference(value);
430
+ if (typeof value != "boolean") throw valueError(this.key, `${String(value)} must be true or false`);
431
+ this.words.push(value ? 1 : 0);
432
+ }
433
+ int(value) {
434
+ if (isReference(value)) return this.reference(value);
435
+ if (typeof value != "number" || !Number.isInteger(value)) throw valueError(this.key, `${String(value)} must be an integer`);
436
+ this.words.push((value | 0) >>> 0);
437
+ }
438
+ repeat(value, count, write, what) {
439
+ if (Array.isArray(value)) {
440
+ if (value.length !== count) throw valueError(this.key, `${what} takes one value or ${count} values`);
441
+ for (let item of value) write(item);
442
+ return;
443
+ }
444
+ for (let i = 0; i < count; i++) write(value);
445
+ }
446
+ shadow(value) {
447
+ if (!isPlainObject(value)) throw valueError(this.key, "a shadow is { color, x, y, blur, spread }");
448
+ let known = ["color", "x", "y", "blur", "spread"];
449
+ for (let name of Object.keys(value)) if (known.indexOf(name) < 0) throw valueError(this.key, `shadow has no ${name}${chunkZJBRUH6V_js.didYouMean(name, known)}`);
450
+ this.color(value.color), this.float(value.x ?? 0), this.float(value.y ?? 0), this.float(value.blur ?? 0), this.float(value.spread ?? 0);
451
+ }
452
+ gradient(value) {
453
+ if (!isPlainObject(value)) throw valueError(this.key, "a gradient is { kind, stops, from, to }");
454
+ let known = ["kind", "stops", "from", "to"];
455
+ for (let name of Object.keys(value)) if (known.indexOf(name) < 0) throw valueError(this.key, `gradient has no ${name}${chunkZJBRUH6V_js.didYouMean(name, known)}`);
456
+ let stops = value.stops;
457
+ if (!Array.isArray(stops) || stops.length === 0 || stops.length > (4)) throw valueError(this.key, `a gradient needs between 1 and ${(4)} stops`);
458
+ this.enumeration(value.kind ?? "linear", chunkVRBDAS5I_js.GRADIENT_KIND);
459
+ let pick = (i) => {
460
+ let stop = stops[Math.min(i, stops.length - 1)];
461
+ if (!Array.isArray(stop) || stop.length !== 2) throw valueError(this.key, "each gradient stop is [colour, offset]");
462
+ return stop;
463
+ };
464
+ for (let i = 0; i < (4); i++) this.color(pick(i)[0]);
465
+ for (let i = 0; i < (4); i++) this.float(pick(i)[1]);
466
+ let from = value.from ?? [0, 0], to = value.to ?? [0, 1];
467
+ if (!Array.isArray(from) || from.length !== 2 || !Array.isArray(to) || to.length !== 2) throw valueError(this.key, "gradient from and to are [x, y] points");
468
+ this.float(from[0]), this.float(from[1]), this.float(to[0]), this.float(to[1]);
469
+ }
470
+ };
471
+ function encodeLeaf(key, type, table, value) {
472
+ let e = new Encoder(key), whole2 = isReference(value);
473
+ if (whole2 && (type === ValueType.shadow || type === ValueType.gradient)) throw valueError(key, "a variable can fill a colour or a number inside a shadow or gradient, not the whole value");
474
+ switch (type) {
475
+ case ValueType.length:
476
+ e.length(value);
477
+ break;
478
+ case ValueType.float:
479
+ e.float(value);
480
+ break;
481
+ case ValueType.int:
482
+ e.int(value);
483
+ break;
484
+ case ValueType.color:
485
+ e.color(value);
486
+ break;
487
+ case ValueType.enumeration:
488
+ e.enumeration(value, table);
489
+ break;
490
+ case ValueType.bool:
491
+ e.bool(value);
492
+ break;
493
+ case ValueType.edges:
494
+ e.repeat(value, 4, (v) => e.float(v), "an edge value");
495
+ break;
496
+ case ValueType.pair:
497
+ e.repeat(value, 2, (v) => e.float(v), "a pair");
498
+ break;
499
+ case ValueType.colors:
500
+ e.repeat(value, 4, (v) => e.color(v), "a border colour");
501
+ break;
502
+ case ValueType.quad:
503
+ if (!Array.isArray(value) && !whole2) throw valueError(key, "takes four numbers");
504
+ e.repeat(value, 4, (v) => e.float(v), "a quad");
505
+ break;
506
+ case ValueType.shadow:
507
+ e.shadow(value);
508
+ break;
509
+ case ValueType.gradient:
510
+ e.gradient(value);
511
+ break;
512
+ }
513
+ if (e.words.length !== VALUE_WORDS[type]) throw valueError(key, "encoded to the wrong width");
514
+ return e;
515
+ }
516
+ function compileStyle(definition) {
517
+ if (!isPlainObject(definition)) throw new UiStyleCompileError("a style is an object of style properties", "value", "style", null);
518
+ let byKey = /* @__PURE__ */ new Map();
519
+ for (let [name, value] of Object.entries(definition)) {
520
+ if (value === void 0) continue;
521
+ let id = keyId(name);
522
+ if (id < 0) throw propertyError(name);
523
+ let variants = /* @__PURE__ */ new Map();
524
+ flatten(name, value, 0, variants), byKey.delete(id), byKey.set(id, variants);
525
+ for (let child of KEY_DESCENDANTS[id])
526
+ byKey.delete(child), byKey.set(child, /* @__PURE__ */ new Map([[0, null]]));
527
+ }
528
+ let ids = [...byKey.keys()].sort((a, b) => a - b), out = [(827937875), ids.length | (1) << (16)];
529
+ for (let id of ids) {
530
+ let variants = byKey.get(id), masks = [...variants.keys()].sort((a, b) => a - b);
531
+ out.push(id | masks.length << (8));
532
+ let type = KEY_TYPES[id];
533
+ for (let mask of masks) {
534
+ let leaf = variants.get(mask);
535
+ if (leaf === null) {
536
+ out.push(mask | VariantKind.null << (16));
537
+ continue;
538
+ }
539
+ let encoded = encodeLeaf(KEY_NAMES[id], type, KEY_TABLES[id], leaf), kind = encoded.refs === 0 ? VariantKind.literal : VariantKind.referenced;
540
+ out.push((mask | encoded.words.length << (8) | kind << (16) | encoded.unit << (20)) >>> 0), kind === VariantKind.referenced && out.push(encoded.refs);
541
+ for (let word of encoded.words) out.push(word >>> 0);
542
+ }
543
+ }
544
+ return Uint32Array.from(out);
545
+ }
546
+ function readBlock(words) {
547
+ if (words.length < (2) || words[0] >>> 0 !== (827937875)) throw new chunkVRBDAS5I_js.UiStyleError("compiled style data is not a style block");
548
+ let version = words[1] >>> (16);
549
+ if (version !== (1)) throw new chunkVRBDAS5I_js.UiStyleError(`compiled style block version ${version} is not supported; rebuild with this SDK`);
550
+ let keys = words[1] & (65535), out = [], at = (2);
551
+ for (let k = 0; k < keys; k++) {
552
+ let head = words[at++], key = head & (255), count = head >>> (8) & (255);
553
+ for (let v = 0; v < count; v++) {
554
+ let word = words[at++], kind = word >>> (16) & (15), size2 = word >>> (8) & (255), refs = kind === VariantKind.referenced ? words[at++] : 0, payload = [];
555
+ for (let i = 0; i < size2; i++) payload.push(words[at++] >>> 0);
556
+ out.push({ key, mask: word & (255), kind, unit: word >>> (20) & (15), refs, payload });
557
+ }
558
+ }
559
+ if (at !== words.length) throw new chunkVRBDAS5I_js.UiStyleError("compiled style block has trailing words");
560
+ return out;
561
+ }
562
+ function payloadNumber(type, word, bits) {
563
+ return isFloatWord(type, word) ? bitsFloat(bits) : type === ValueType.int ? bits | 0 : bits >>> 0;
564
+ }
565
+
566
+ // src/interactives/game-ui/styling/tailwind.ts
567
+ var SPACING_UNIT = 4, SPACING_STEPS = ["0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "5", "6", "7", "8", "9", "10", "11", "12", "14", "16", "20", "24", "28", "32", "36", "40", "44", "48", "52", "56", "60", "64", "72", "80", "96"], SPACING = new Set(SPACING_STEPS), FRACTIONS = ["1/2", "1/3", "2/3", "1/4", "2/4", "3/4", "1/5", "2/5", "3/5", "4/5", "1/6", "5/6"], PERCENT2 = 100, FULL = "100%", AUTO2 = "auto", PX = "px", RADIUS = { none: 0, sm: 2, "": 4, md: 6, lg: 8, xl: 12, "2xl": 16, "3xl": 24, full: 9999 }, BORDER_WIDTHS = { "": 1, 0: 0, 2: 2, 4: 4, 8: 8 }, OPACITY_STEP = 5, Z = ["0", "10", "20", "30", "40", "50", "auto"], SCALES = ["0", "50", "75", "90", "95", "100", "105", "110", "125", "150"], ROTATIONS = ["0", "1", "2", "3", "6", "12", "45", "90", "180"], DEGREES = Math.PI / 180, FONT_SIZES = { xs: 12, sm: 14, base: 16, lg: 18, xl: 20, "2xl": 24, "3xl": 30, "4xl": 36, "5xl": 48, "6xl": 60, "7xl": 72 }, FONT_WEIGHTS = { thin: 100, extralight: 200, light: 300, normal: 400, medium: 500, semibold: 600, bold: 700, extrabold: 800, black: 900 }, LEADING = { none: 1, tight: 1.25, snug: 1.375, normal: 1.5, relaxed: 1.625, loose: 2 }, SHADOW_INK = "#0000001a", SHADOWS = {
568
+ sm: { color: "#0000000d", x: 0, y: 1, blur: 2, spread: 0 },
569
+ "": { color: SHADOW_INK, x: 0, y: 1, blur: 3, spread: 0 },
570
+ md: { color: SHADOW_INK, x: 0, y: 4, blur: 6, spread: -1 },
571
+ lg: { color: SHADOW_INK, x: 0, y: 10, blur: 15, spread: -3 },
572
+ xl: { color: SHADOW_INK, x: 0, y: 20, blur: 25, spread: -5 },
573
+ "2xl": { color: "#00000040", x: 0, y: 25, blur: 50, spread: -12 },
574
+ none: null
575
+ }, ORIGINS = {
576
+ center: [0.5, 0.5],
577
+ top: [0.5, 0],
578
+ "top-right": [1, 0],
579
+ right: [1, 0.5],
580
+ "bottom-right": [1, 1],
581
+ bottom: [0.5, 1],
582
+ "bottom-left": [0, 1],
583
+ left: [0, 0.5],
584
+ "top-left": [0, 0]
585
+ }, GRADIENT_DIRECTIONS = {
586
+ t: [0.5, 1, 0.5, 0],
587
+ tr: [0, 1, 1, 0],
588
+ r: [0, 0.5, 1, 0.5],
589
+ br: [0, 0, 1, 1],
590
+ b: [0.5, 0, 0.5, 1],
591
+ bl: [1, 0, 0, 1],
592
+ l: [1, 0.5, 0, 0.5],
593
+ tl: [1, 1, 0, 0]
594
+ }, RADIAL_GEOMETRY = [0.5, 0.5, 0.5, 0], VIA_OFFSET = 0.5, LITERAL_COLOURS = { white: "#ffffffff", black: "#000000ff", transparent: "#00000000" }, TRANSPARENT = LITERAL_COLOURS.transparent, VARIANTS = {
595
+ pressed: Condition.pressed,
596
+ active: Condition.pressed,
597
+ focus: Condition.focus,
598
+ disabled: Condition.disabled,
599
+ landscape: Condition.landscape,
600
+ portrait: Condition.portrait,
601
+ safe: Condition.safe,
602
+ sm: Condition.sm,
603
+ lg: Condition.lg
604
+ }, CONDITION_NAMES = [":pressed", ":focus", ":disabled", "@landscape", "@portrait", "@safe", "@sm", "@lg"];
605
+ function kebab(name) {
606
+ return name.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`);
607
+ }
608
+ var TOKEN_COLOURS = /* @__PURE__ */ new Map();
609
+ for (let [name, variable] of Object.entries(chunk5SXDH3Y7_js.tokens)) TOKEN_COLOURS.set(kebab(name), variable);
610
+ var COLOUR_NAMES = [...TOKEN_COLOURS.keys(), ...Object.keys(LITERAL_COLOURS)];
611
+ function arbitrary(token) {
612
+ return token.length > 2 && token.startsWith("[") && token.endsWith("]") ? token.slice(1, -1) : null;
613
+ }
614
+ function arbitraryNumber(token) {
615
+ let raw = arbitrary(token);
616
+ if (raw === null) return null;
617
+ let body = raw.endsWith(PX) ? raw.slice(0, -PX.length) : raw, value = Number(body);
618
+ return body.length > 0 && Number.isFinite(value) ? value : null;
619
+ }
620
+ function spacing(token) {
621
+ return token === PX ? 1 : SPACING.has(token) ? Number(token) * (4) : arbitraryNumber(token);
622
+ }
623
+ function size(token) {
624
+ if (token === "full") return FULL;
625
+ if (token === AUTO2) return AUTO2;
626
+ let slash = token.indexOf("/");
627
+ if (slash > 0 && FRACTIONS.indexOf(token) >= 0) return `${Number(token.slice(0, slash)) / Number(token.slice(slash + 1)) * (100)}%`;
628
+ let raw = arbitrary(token);
629
+ return raw !== null && raw.endsWith("%") && Number.isFinite(Number(raw.slice(0, -1))) ? raw : spacing(token);
630
+ }
631
+ function colour(token) {
632
+ let variable = TOKEN_COLOURS.get(token);
633
+ if (variable !== void 0) return variable;
634
+ let literal = LITERAL_COLOURS[token];
635
+ if (literal !== void 0) return literal;
636
+ let raw = arbitrary(token);
637
+ return raw !== null && raw.startsWith("#") ? raw : null;
638
+ }
639
+ function percentScale(token) {
640
+ return SCALES.indexOf(token) >= 0 ? Number(token) / (100) : arbitraryNumber(token);
641
+ }
642
+ var sign = (negative, value) => negative ? -value : value, spacingValues = () => [PX, ...SPACING_STEPS], sizeValues = () => [...spacingValues(), ...FRACTIONS, "full", AUTO2];
643
+ function keyword(prefix, apply) {
644
+ return {
645
+ prefix,
646
+ values: () => [""],
647
+ apply: (token, context) => token !== "" ? false : (apply(context), true)
648
+ };
649
+ }
650
+ function choice(prefix, table, apply) {
651
+ return {
652
+ prefix,
653
+ values: () => Object.keys(table),
654
+ apply: (token, context) => Object.prototype.hasOwnProperty.call(table, token) ? (apply(table[token], context), true) : false
655
+ };
656
+ }
657
+ function spaced(prefix, props3, negative) {
658
+ return {
659
+ prefix,
660
+ negative,
661
+ values: spacingValues,
662
+ apply: (token, context, minus) => {
663
+ let value = spacing(token);
664
+ if (value === null) return false;
665
+ for (let prop of props3) context.set(prop, sign(minus, value));
666
+ return true;
667
+ }
668
+ };
669
+ }
670
+ function sized(prefix, props3, negative) {
671
+ return {
672
+ prefix,
673
+ negative,
674
+ values: sizeValues,
675
+ apply: (token, context, minus) => {
676
+ let value = size(token);
677
+ if (value === null || minus && value === AUTO2) return false;
678
+ let signed = typeof value == "number" ? sign(minus, value) : minus ? `-${value}` : value;
679
+ for (let prop of props3) context.set(prop, signed);
680
+ return true;
681
+ }
682
+ };
683
+ }
684
+ function coloured(prefix, props3) {
685
+ return {
686
+ prefix,
687
+ values: () => COLOUR_NAMES,
688
+ apply: (token, context) => {
689
+ let value = colour(token);
690
+ if (value === null) return false;
691
+ for (let prop of props3) context.set(prop, value);
692
+ return true;
693
+ }
694
+ };
695
+ }
696
+ function widths(prefix, prop) {
697
+ return {
698
+ prefix,
699
+ values: () => Object.keys(BORDER_WIDTHS),
700
+ apply: (token, context) => {
701
+ let value = Object.prototype.hasOwnProperty.call(BORDER_WIDTHS, token) ? BORDER_WIDTHS[token] : arbitraryNumber(token);
702
+ return value === null ? false : (context.set(prop, value), true);
703
+ }
704
+ };
705
+ }
706
+ function radius(prefix, props3) {
707
+ return {
708
+ prefix,
709
+ values: () => Object.keys(RADIUS),
710
+ apply: (token, context) => {
711
+ let value = Object.prototype.hasOwnProperty.call(RADIUS, token) ? RADIUS[token] : arbitraryNumber(token);
712
+ if (value === null) return false;
713
+ for (let prop of props3) context.set(prop, value);
714
+ return true;
715
+ }
716
+ };
717
+ }
718
+ function scaled(prefix, props3) {
719
+ return {
720
+ prefix,
721
+ values: () => SCALES,
722
+ apply: (token, context) => {
723
+ let value = percentScale(token);
724
+ if (value === null) return false;
725
+ for (let prop of props3) context.set(prop, value);
726
+ return true;
727
+ }
728
+ };
729
+ }
730
+ var FAMILIES = [
731
+ keyword("flex", (c) => c.set("display", "flex")),
732
+ keyword("hidden", (c) => c.set("display", "none")),
733
+ keyword("invisible", (c) => c.set("hidden", true)),
734
+ keyword("visible", (c) => c.set("hidden", false)),
735
+ choice("flex", { row: "row", col: "column", "row-reverse": "row-reverse", "col-reverse": "column-reverse" }, (v, c) => c.set("direction", v)),
736
+ choice("flex", { wrap: true, nowrap: false }, (v, c) => c.set("wrap", v)),
737
+ choice("flex", { 1: [1, 1, "0%"], auto: [1, 1, AUTO2], initial: [0, 1, AUTO2], none: [0, 0, AUTO2] }, (v, c) => {
738
+ c.set("grow", v[0]), c.set("shrink", v[1]), c.set("basis", v[2]);
739
+ }),
740
+ keyword("grow", (c) => c.set("grow", 1)),
741
+ choice("grow", { 0: 0 }, (v, c) => c.set("grow", v)),
742
+ keyword("shrink", (c) => c.set("shrink", 1)),
743
+ choice("shrink", { 0: 0 }, (v, c) => c.set("shrink", v)),
744
+ sized("basis", ["basis"], false),
745
+ choice("justify", { start: "start", end: "end", center: "center", between: "space-between", around: "space-around", evenly: "space-evenly" }, (v, c) => c.set("justify", v)),
746
+ choice("items", { start: "start", end: "end", center: "center", stretch: "stretch" }, (v, c) => c.set("alignItems", v)),
747
+ choice("self", { auto: "auto", start: "start", end: "end", center: "center", stretch: "stretch" }, (v, c) => c.set("alignSelf", v)),
748
+ choice("content", { start: "start", end: "end", center: "center", stretch: "stretch" }, (v, c) => c.set("alignContent", v)),
749
+ keyword("absolute", (c) => c.set("position", "absolute")),
750
+ keyword("relative", (c) => c.set("position", "relative")),
751
+ choice("overflow", { hidden: true, visible: false, clip: true }, (v, c) => c.set("clip", v)),
752
+ choice("overflow", { scroll: "both", auto: "both" }, (v, c) => c.set("scrollAxes", v)),
753
+ choice("overflow-x", { scroll: "x", auto: "x" }, (v, c) => c.set("scrollAxes", v)),
754
+ choice("overflow-y", { scroll: "y", auto: "y" }, (v, c) => c.set("scrollAxes", v)),
755
+ choice("pointer-events", { none: "none", auto: "auto" }, (v, c) => c.set("pointerEvents", v)),
756
+ {
757
+ prefix: "aspect",
758
+ values: () => ["square", "video"],
759
+ apply: (token, c) => {
760
+ let value = token === "square" ? 1 : token === "video" ? 1.7777777777777777 : arbitraryNumber(token);
761
+ return value === null ? false : (c.set("aspect", value), true);
762
+ }
763
+ },
764
+ {
765
+ prefix: "z",
766
+ negative: true,
767
+ values: () => Z,
768
+ apply: (token, c, minus) => {
769
+ let value = token === AUTO2 ? 0 : Z.indexOf(token) >= 0 ? Number(token) : arbitraryNumber(token);
770
+ return value === null || !Number.isInteger(value) ? false : (c.set("zIndex", sign(minus, value)), true);
771
+ }
772
+ },
773
+ {
774
+ prefix: "opacity",
775
+ values: () => Array.from({ length: (100) / (5) + 1 }, (_, i) => String(i * (5))),
776
+ apply: (token, c) => {
777
+ let step2 = Number(token), value = token.length > 0 && Number.isInteger(step2) && step2 >= 0 && step2 <= (100) && step2 % (5) === 0 ? step2 / (100) : arbitraryNumber(token);
778
+ return value === null ? false : (c.set("opacity", value), true);
779
+ }
780
+ },
781
+ spaced("p", ["padding"], false),
782
+ spaced("px", ["paddingInline"], false),
783
+ spaced("py", ["paddingBlock"], false),
784
+ spaced("pt", ["paddingTop"], false),
785
+ spaced("pr", ["paddingRight"], false),
786
+ spaced("pb", ["paddingBottom"], false),
787
+ spaced("pl", ["paddingLeft"], false),
788
+ spaced("m", ["margin"], true),
789
+ spaced("mx", ["marginInline"], true),
790
+ spaced("my", ["marginBlock"], true),
791
+ spaced("mt", ["marginTop"], true),
792
+ spaced("mr", ["marginRight"], true),
793
+ spaced("mb", ["marginBottom"], true),
794
+ spaced("ml", ["marginLeft"], true),
795
+ spaced("gap", ["gap"], false),
796
+ spaced("gap-x", ["columnGap"], false),
797
+ spaced("gap-y", ["rowGap"], false),
798
+ sized("w", ["width"], false),
799
+ sized("h", ["height"], false),
800
+ sized("min-w", ["minWidth"], false),
801
+ sized("min-h", ["minHeight"], false),
802
+ sized("max-w", ["maxWidth"], false),
803
+ sized("max-h", ["maxHeight"], false),
804
+ sized("size", ["width", "height"], false),
805
+ sized("inset", ["inset"], true),
806
+ sized("inset-x", ["insetInline"], true),
807
+ sized("inset-y", ["insetBlock"], true),
808
+ sized("top", ["top"], true),
809
+ sized("right", ["right"], true),
810
+ sized("bottom", ["bottom"], true),
811
+ sized("left", ["left"], true),
812
+ radius("rounded", ["radius"]),
813
+ radius("rounded-t", ["radiusTopLeft", "radiusTopRight"]),
814
+ radius("rounded-r", ["radiusTopRight", "radiusBottomRight"]),
815
+ radius("rounded-b", ["radiusBottomRight", "radiusBottomLeft"]),
816
+ radius("rounded-l", ["radiusTopLeft", "radiusBottomLeft"]),
817
+ radius("rounded-tl", ["radiusTopLeft"]),
818
+ radius("rounded-tr", ["radiusTopRight"]),
819
+ radius("rounded-br", ["radiusBottomRight"]),
820
+ radius("rounded-bl", ["radiusBottomLeft"]),
821
+ widths("border", "borderWidth"),
822
+ widths("border-x", "borderInlineWidth"),
823
+ widths("border-y", "borderBlockWidth"),
824
+ widths("border-t", "borderTopWidth"),
825
+ widths("border-r", "borderRightWidth"),
826
+ widths("border-b", "borderBottomWidth"),
827
+ widths("border-l", "borderLeftWidth"),
828
+ coloured("border", ["borderColor"]),
829
+ coloured("border-x", ["borderInlineColor"]),
830
+ coloured("border-y", ["borderBlockColor"]),
831
+ coloured("border-t", ["borderTopColor"]),
832
+ coloured("border-r", ["borderRightColor"]),
833
+ coloured("border-b", ["borderBottomColor"]),
834
+ coloured("border-l", ["borderLeftColor"]),
835
+ coloured("bg", ["fill"]),
836
+ coloured("fill", ["fill"]),
837
+ coloured("tint", ["tint"]),
838
+ coloured("stroke", ["stroke"]),
839
+ choice("stroke", { 0: 0, 1: 1, 2: 2 }, (v, c) => c.set("strokeWidth", v)),
840
+ coloured("placeholder", ["placeholderColor"]),
841
+ coloured("text", ["textColor"]),
842
+ choice("text", FONT_SIZES, (v, c) => c.set("fontSize", v)),
843
+ {
844
+ prefix: "text",
845
+ values: () => [],
846
+ apply: (token, c) => {
847
+ let value = arbitraryNumber(token);
848
+ return value === null ? false : (c.set("fontSize", value), true);
849
+ }
850
+ },
851
+ choice("text", { left: "left", center: "center", right: "right", start: "start", end: "end" }, (v, c) => c.set("textAlign", v)),
852
+ choice("text", { wrap: true, nowrap: false }, (v, c) => c.set("textWrap", v)),
853
+ choice("text", { balance: "balance", pretty: "pretty" }, (v, c) => {
854
+ c.set("textWrap", true), c.set("textWrapStyle", v);
855
+ }),
856
+ choice("font", FONT_WEIGHTS, (v, c) => c.set("fontWeight", v)),
857
+ {
858
+ prefix: "leading",
859
+ values: () => Object.keys(LEADING),
860
+ apply: (token, c) => {
861
+ let value = Object.prototype.hasOwnProperty.call(LEADING, token) ? LEADING[token] : arbitraryNumber(token);
862
+ return value === null ? false : (c.set("lineHeight", value), true);
863
+ }
864
+ },
865
+ {
866
+ prefix: "tracking",
867
+ negative: true,
868
+ values: () => [],
869
+ apply: (token, c, minus) => {
870
+ let value = arbitraryNumber(token);
871
+ return value === null ? false : (c.set("letterSpacing", sign(minus, value)), true);
872
+ }
873
+ },
874
+ choice("align", { top: "top", middle: "center", bottom: "bottom" }, (v, c) => c.set("verticalAlign", v)),
875
+ scaled("scale", ["scale"]),
876
+ scaled("scale-x", ["scaleX"]),
877
+ scaled("scale-y", ["scaleY"]),
878
+ {
879
+ prefix: "rotate",
880
+ negative: true,
881
+ values: () => ROTATIONS,
882
+ apply: (token, c, minus) => {
883
+ let degrees = ROTATIONS.indexOf(token) >= 0 ? Number(token) : arbitraryNumber(token);
884
+ return degrees === null ? false : (c.set("rotate", sign(minus, degrees) * DEGREES), true);
885
+ }
886
+ },
887
+ spaced("translate-x", ["translateX"], true),
888
+ spaced("translate-y", ["translateY"], true),
889
+ choice("origin", ORIGINS, (v, c) => c.set("origin", v)),
890
+ choice("shadow", SHADOWS, (v, c) => c.set("shadow", v)),
891
+ choice("bg-gradient-to", GRADIENT_DIRECTIONS, (v, c) => {
892
+ c.gradient.kind = "linear", c.gradient.geometry = v;
893
+ }),
894
+ choice("bg-linear-to", GRADIENT_DIRECTIONS, (v, c) => {
895
+ c.gradient.kind = "linear", c.gradient.geometry = v;
896
+ }),
897
+ keyword("bg-radial", (c) => {
898
+ c.gradient.kind = "radial", c.gradient.geometry = RADIAL_GEOMETRY;
899
+ }),
900
+ {
901
+ prefix: "from",
902
+ values: () => COLOUR_NAMES,
903
+ apply: (token, c) => {
904
+ let value = colour(token);
905
+ return value === null ? false : (c.gradient.from = value, true);
906
+ }
907
+ },
908
+ {
909
+ prefix: "via",
910
+ values: () => COLOUR_NAMES,
911
+ apply: (token, c) => {
912
+ let value = colour(token);
913
+ return value === null ? false : (c.gradient.via = value, true);
914
+ }
915
+ },
916
+ {
917
+ prefix: "to",
918
+ values: () => COLOUR_NAMES,
919
+ apply: (token, c) => {
920
+ let value = colour(token);
921
+ return value === null ? false : (c.gradient.to = value, true);
922
+ }
923
+ }
924
+ ], ORDERED = [...FAMILIES].sort((a, b) => b.prefix.length - a.prefix.length), vocabulary = null;
925
+ function tailwindVocabulary() {
926
+ if (vocabulary !== null) return vocabulary;
927
+ let out = /* @__PURE__ */ new Set();
928
+ for (let family of FAMILIES)
929
+ for (let value of family.values()) {
930
+ let name = value === "" ? family.prefix : `${family.prefix}-${value}`;
931
+ out.add(name), family.negative === true && value !== "" && value !== "0" && value !== AUTO2 && out.add(`-${name}`);
932
+ }
933
+ for (let variant of Object.keys(VARIANTS)) out.add(`${variant}:`);
934
+ return vocabulary = [...out], vocabulary;
935
+ }
936
+ function splitVariants(name) {
937
+ let parts = [], depth = 0, start = 0;
938
+ for (let i = 0; i < name.length; i++) {
939
+ let c = name[i];
940
+ c === "[" ? depth++ : c === "]" ? depth-- : c === ":" && depth === 0 && (parts.push(name.slice(start, i)), start = i + 1);
941
+ }
942
+ return parts.push(name.slice(start)), parts;
943
+ }
944
+ function applyUtility(body, context) {
945
+ let negative = body.startsWith("-"), bare = negative ? body.slice(1) : body;
946
+ for (let family of ORDERED) {
947
+ if (negative && family.negative !== true) continue;
948
+ let token = null;
949
+ if (bare === family.prefix ? token = "" : bare.startsWith(`${family.prefix}-`) && (token = bare.slice(family.prefix.length + 1)), token !== null && family.apply(token, context, negative))
950
+ return true;
951
+ }
952
+ return false;
953
+ }
954
+ function insert(target, bits, value) {
955
+ if (bits.length === 0) {
956
+ target.default = value;
957
+ return;
958
+ }
959
+ let name = CONDITION_NAMES[bits[0]], nested = target[name] ?? {};
960
+ target[name] = nested, insert(nested, bits.slice(1), value);
961
+ }
962
+ function maskBits(mask) {
963
+ let bits = [];
964
+ for (let bit = 0; bit < CONDITION_NAMES.length; bit++) mask & 1 << bit && bits.push(bit);
965
+ return bits;
966
+ }
967
+ function gradientValue(parts) {
968
+ let geometry = parts.geometry ?? GRADIENT_DIRECTIONS.b, from = parts.from ?? TRANSPARENT, to = parts.to ?? TRANSPARENT, stops = parts.via === void 0 ? [[from, 0], [to, 1]] : [[from, 0], [parts.via, (0.5)], [to, 1]];
969
+ return { kind: parts.kind ?? "linear", stops, from: [geometry[0], geometry[1]], to: [geometry[2], geometry[3]] };
970
+ }
971
+ function tailwindStyle(classes) {
972
+ let values = /* @__PURE__ */ new Map(), gradients = /* @__PURE__ */ new Map(), set = (mask) => (prop, value) => {
973
+ let byMask = values.get(prop);
974
+ byMask === void 0 && (byMask = /* @__PURE__ */ new Map(), values.set(prop, byMask)), byMask.delete(mask), byMask.set(mask, value);
975
+ };
976
+ for (let name of classes.split(/\s+/)) {
977
+ if (name.length === 0) continue;
978
+ let parts = splitVariants(name), body = parts[parts.length - 1], mask = 0;
979
+ for (let i = 0; i < parts.length - 1; i++) {
980
+ let bit = VARIANTS[parts[i]];
981
+ if (bit === void 0) {
982
+ let hit = chunkZJBRUH6V_js.suggest(parts[i], Object.keys(VARIANTS));
983
+ throw new UiStyleCompileError(`unknown variant "${parts[i]}:" in "${name}"${hit === null ? "" : `; did you mean "${hit}:"?`}`, "class", name, hit === null ? null : `${hit}:${body}`);
984
+ }
985
+ mask |= bit;
986
+ }
987
+ if (body.length === 0) throw new UiStyleCompileError(`class "${name}" has no utility after its variants`, "class", name, null);
988
+ let gradient = gradients.get(mask);
989
+ if (gradient === void 0 && (gradient = {}, gradients.set(mask, gradient)), !applyUtility(body, { set: set(mask), gradient })) {
990
+ let hit = chunkZJBRUH6V_js.suggest(body, tailwindVocabulary()), prefix = parts.slice(0, -1).map((p) => `${p}:`).join("");
991
+ throw new UiStyleCompileError(`unknown class "${name}"${hit === null ? "" : `; did you mean "${prefix}${hit}"?`}`, "class", name, hit === null ? null : `${prefix}${hit}`);
992
+ }
993
+ }
994
+ for (let [mask, parts] of gradients)
995
+ parts.kind === void 0 && parts.from === void 0 && parts.via === void 0 && parts.to === void 0 || set(mask)("gradient", gradientValue(parts));
996
+ let style = {}, ordered = [...values].sort((a, b) => KEY_TIERS[keyId(a[0])] - KEY_TIERS[keyId(b[0])]);
997
+ for (let [prop, byMask] of ordered) {
998
+ if (byMask.size === 1 && byMask.has(0)) {
999
+ style[prop] = byMask.get(0);
1000
+ continue;
1001
+ }
1002
+ let nested = {};
1003
+ for (let mask of [...byMask.keys()].sort((a, b) => a - b)) insert(nested, maskBits(mask), byMask.get(mask));
1004
+ style[prop] = nested;
1005
+ }
1006
+ return style;
1007
+ }
1008
+ function compileClasses(classes) {
1009
+ return compileStyle(tailwindStyle(classes));
1010
+ }
1011
+
1012
+ // src/interactives/game-ui/styling/runtime.ts
1013
+ var NO_VARIANT = -1, REF_VAR = 1, REF_SLOT = 2, SLOT_INDEX = 65535, PERCENT3 = "%", SLOT_FLOAT = 0, SLOT_INT = 1, SLOT_WORD = 2, slotFloats = new Float32Array(1), slotWords = new Uint32Array(slotFloats.buffer), AUTO3 = "auto", CompiledStyle = class {
1014
+ constructor(words) {
1015
+ this.first = new Int16Array(KEY_COUNT).fill((-1));
1016
+ this.count = new Uint8Array(KEY_COUNT);
1017
+ this.variantKey = new Uint8Array(0);
1018
+ this.mask = new Uint8Array(0);
1019
+ this.priority = new Uint16Array(0);
1020
+ this.empty = new Uint8Array(0);
1021
+ this.unit = new Uint8Array(0);
1022
+ this.start = new Uint16Array(0);
1023
+ this.values = new Float64Array(0);
1024
+ this.refKind = new Uint8Array(0);
1025
+ this.refId = new Int32Array(0);
1026
+ this.stateMask = 0;
1027
+ this.contextMask = 0;
1028
+ this.usesVars = false;
1029
+ this.slots = 0;
1030
+ this.version = 0;
1031
+ this.slotPos = new Int32Array(0);
1032
+ this.slotFloat = new Uint8Array(0);
1033
+ this.slotRefPos = new Int32Array(0);
1034
+ this.slotRefSlot = new Int32Array(0);
1035
+ this.slotRefMode = new Uint8Array(0);
1036
+ this.load(words);
1037
+ }
1038
+ slotBits(slot) {
1039
+ let value = this.values[this.slotPos[slot]];
1040
+ return this.slotFloat[slot] === 1 ? floatBits(value) : value >>> 0;
1041
+ }
1042
+ load(words) {
1043
+ let variants = readBlock(words), n = variants.length, total = 0;
1044
+ for (let v of variants) total += v.payload.length;
1045
+ this.first.fill((-1)), this.count.fill(0), this.variantKey = new Uint8Array(n), this.mask = new Uint8Array(n), this.priority = new Uint16Array(n), this.empty = new Uint8Array(n), this.unit = new Uint8Array(n), this.start = new Uint16Array(n), this.values = new Float64Array(total), this.refKind = new Uint8Array(total), this.refId = new Int32Array(total), this.stateMask = 0, this.contextMask = 0, this.usesVars = false, this.slots = 0;
1046
+ let at = 0;
1047
+ variants.forEach((v, i) => {
1048
+ this.first[v.key] === (-1) && (this.first[v.key] = i), this.count[v.key]++, this.variantKey[i] = v.key, this.mask[i] = v.mask, this.priority[i] = KEY_TIERS[v.key] + conditionPriority(v.mask), this.empty[i] = v.kind === VariantKind.null ? 1 : 0, this.unit[i] = v.unit, this.start[i] = at, this.stateMask |= v.mask & STATE_CONDITIONS, this.contextMask |= v.mask & CONTEXT_CONDITIONS;
1049
+ let type = KEY_TYPES[v.key];
1050
+ v.payload.forEach((bits, word) => {
1051
+ let pos = at + word;
1052
+ if (v.refs & 1 << word) {
1053
+ bits & (2147483648) ? (this.refKind[pos] = (2), this.refId[pos] = bits & (65535), this.slots = Math.max(this.slots, (bits & (65535)) + 1)) : (this.refKind[pos] = (1), this.refId[pos] = bits, this.usesVars = true);
1054
+ return;
1055
+ }
1056
+ this.values[pos] = payloadNumber(type, word, bits);
1057
+ }), at += v.payload.length;
1058
+ }), this.slotPos = new Int32Array(this.slots).fill(-1), this.slotFloat = new Uint8Array(this.slots);
1059
+ for (let v = 0; v < n; v++) {
1060
+ let begin = this.start[v], end = v + 1 < n ? this.start[v + 1] : total;
1061
+ for (let pos = begin; pos < end; pos++) {
1062
+ if (this.refKind[pos] !== (2) || this.slotPos[this.refId[pos]] >= 0) continue;
1063
+ let type = KEY_TYPES[this.variantKey[v]];
1064
+ this.slotPos[this.refId[pos]] = pos, this.slotFloat[this.refId[pos]] = isFloatWord(type, pos - begin) ? 1 : 0;
1065
+ }
1066
+ }
1067
+ let refPos = [], refSlot = [], refMode = [];
1068
+ for (let v = 0; v < n; v++) {
1069
+ let begin = this.start[v], end = v + 1 < n ? this.start[v + 1] : total, type = KEY_TYPES[this.variantKey[v]];
1070
+ for (let pos = begin; pos < end; pos++) {
1071
+ if (this.refKind[pos] !== (2)) continue;
1072
+ let word = pos - begin;
1073
+ refPos.push(pos), refSlot.push(this.refId[pos]), refMode.push(isColorWord(type, word) ? (2) : isFloatWord(type, word) ? (0) : type === ValueType.int ? (1) : (2));
1074
+ }
1075
+ }
1076
+ this.slotRefPos = Int32Array.from(refPos), this.slotRefSlot = Int32Array.from(refSlot), this.slotRefMode = Uint8Array.from(refMode), this.version++;
1077
+ }
1078
+ keySignature() {
1079
+ let out = "";
1080
+ for (let k = 0; k < KEY_COUNT; k++) this.first[k] !== (-1) && (out += `${k},`);
1081
+ return out;
1082
+ }
1083
+ setSlotsFrom(source, offset = 0) {
1084
+ let positions = this.slotRefPos, slots = this.slotRefSlot, modes = this.slotRefMode, values = this.values;
1085
+ for (let i = 0; i < positions.length; i++) {
1086
+ let mode = modes[i], value = source[offset + slots[i]];
1087
+ values[positions[i]] = mode === (0) ? value : mode === (1) ? value | 0 : value >>> 0;
1088
+ }
1089
+ return this;
1090
+ }
1091
+ slotBitsTo(slot, out, at) {
1092
+ let value = this.values[this.slotPos[slot]];
1093
+ this.slotFloat[slot] === 1 ? (slotFloats[0] = value, out[at] = slotWords[0]) : out[at] = value >>> 0;
1094
+ }
1095
+ setSlot(slot, raw) {
1096
+ let total = this.values.length;
1097
+ for (let v = 0; v < this.variantKey.length; v++) {
1098
+ let begin = this.start[v], end = v + 1 < this.variantKey.length ? this.start[v + 1] : total;
1099
+ for (let pos = begin; pos < end; pos++) {
1100
+ if (this.refKind[pos] !== (2) || this.refId[pos] !== slot) continue;
1101
+ let key = this.variantKey[v];
1102
+ convert(key, pos - begin, raw), this.values[pos] = converted[0], KEY_TYPES[key] === ValueType.length && typeof raw == "string" && this.unit[v] !== convertedUnit && (this.unit[v] = convertedUnit, this.version++);
1103
+ }
1104
+ }
1105
+ }
1106
+ }, converted = new Float64Array(1), convertedUnit = chunkVRBDAS5I_js.UiUnit.points;
1107
+ function convert(key, word, raw) {
1108
+ let type = KEY_TYPES[key];
1109
+ if (convertedUnit = chunkVRBDAS5I_js.UiUnit.points, isColorWord(type, word)) {
1110
+ converted[0] = typeof raw == "number" ? raw >>> 0 : chunkVRBDAS5I_js.parseColor(raw);
1111
+ return;
1112
+ }
1113
+ if (typeof raw == "number") {
1114
+ converted[0] = isFloatWord(type, word) ? raw : type === ValueType.int ? raw | 0 : raw >>> 0;
1115
+ return;
1116
+ }
1117
+ if (typeof raw == "boolean") {
1118
+ converted[0] = raw ? 1 : 0;
1119
+ return;
1120
+ }
1121
+ if (type === ValueType.enumeration) {
1122
+ let code = KEY_TABLES[key][raw];
1123
+ if (code === void 0) throw new chunkVRBDAS5I_js.UiStyleError(`style variable value ${raw} is not valid here`);
1124
+ converted[0] = code;
1125
+ return;
1126
+ }
1127
+ if (type === ValueType.length && raw === AUTO3) {
1128
+ convertedUnit = chunkVRBDAS5I_js.UiUnit.auto, converted[0] = 0;
1129
+ return;
1130
+ }
1131
+ type === ValueType.length && raw.endsWith(PERCENT3) && (convertedUnit = chunkVRBDAS5I_js.UiUnit.percent);
1132
+ let value = Number.parseFloat(raw);
1133
+ converted[0] = isFloatWord(type, word) ? value : type === ValueType.int ? value | 0 : value >>> 0;
1134
+ }
1135
+ var UiProps = class _UiProps {
1136
+ constructor(parts) {
1137
+ this.owner = new Array(KEY_COUNT).fill(null);
1138
+ this.wireSet = new Uint8Array(WIRE_COUNT);
1139
+ this.encoded = null;
1140
+ this.encodedVersion = -1;
1141
+ let themes = [];
1142
+ for (let part of parts) {
1143
+ if (part instanceof chunk5SXDH3Y7_js.UiTheme) {
1144
+ themes.push(part);
1145
+ continue;
1146
+ }
1147
+ if (part instanceof _UiProps) {
1148
+ part.theme !== null && themes.push(part.theme);
1149
+ for (let k = 0; k < KEY_COUNT; k++) part.owner[k] !== null && (this.owner[k] = part.owner[k]);
1150
+ continue;
1151
+ }
1152
+ for (let k = 0; k < KEY_COUNT; k++) part.first[k] !== (-1) && (this.owner[k] = part);
1153
+ }
1154
+ let wires = /* @__PURE__ */ new Set(), state = 0, context = 0, vars = false;
1155
+ for (let k = 0; k < KEY_COUNT; k++) {
1156
+ let style = this.owner[k];
1157
+ if (style === null) continue;
1158
+ for (let w of KEY_WIRES[k]) wires.add(w);
1159
+ let first = style.first[k];
1160
+ for (let v = first; v < first + style.count[k]; v++)
1161
+ state |= style.mask[v] & STATE_CONDITIONS, context |= style.mask[v] & CONTEXT_CONDITIONS;
1162
+ vars || (vars = style.usesVars);
1163
+ }
1164
+ this.wires = Uint8Array.from([...wires].sort((a, b) => a - b));
1165
+ for (let w of this.wires) this.wireSet[w] = 1;
1166
+ let distinct = [];
1167
+ for (let k = 0; k < KEY_COUNT; k++) {
1168
+ let style = this.owner[k];
1169
+ style !== null && distinct.indexOf(style) < 0 && distinct.push(style);
1170
+ }
1171
+ this.styles = distinct, this.dynamics = distinct.filter((style) => style.slots > 0), this.slotOffsets = new Int32Array(this.dynamics.length);
1172
+ let slots = 0;
1173
+ this.dynamics.forEach((style, i) => {
1174
+ this.slotOffsets[i] = slots, slots += style.slots;
1175
+ }), this.slotCount = slots, this.stateMask = state, this.contextMask = context, this.usesVars = vars, this.theme = themes.length === 0 ? null : themes.length === 1 ? themes[0] : chunk5SXDH3Y7_js.mergeThemes(themes);
1176
+ }
1177
+ version() {
1178
+ let total = 0;
1179
+ for (let i = 0; i < this.styles.length; i++) total += this.styles[i].version;
1180
+ return total;
1181
+ }
1182
+ slotOffset(style) {
1183
+ for (let i = 0; i < this.dynamics.length; i++) if (this.dynamics[i] === style) return this.slotOffsets[i];
1184
+ return 0;
1185
+ }
1186
+ }, classCache = /* @__PURE__ */ new Map(), objectCache = /* @__PURE__ */ new WeakMap();
1187
+ function isWords(value) {
1188
+ return value instanceof Uint32Array || Array.isArray(value) && typeof value[0] == "number";
1189
+ }
1190
+ function styleOf(arg) {
1191
+ if (arg instanceof CompiledStyle || arg instanceof UiProps || arg instanceof chunk5SXDH3Y7_js.UiTheme) return arg;
1192
+ if (typeof arg == "string") {
1193
+ let style2 = classCache.get(arg);
1194
+ return style2 === void 0 && (style2 = new CompiledStyle(compileClasses(arg)), classCache.set(arg, style2)), style2;
1195
+ }
1196
+ let style = objectCache.get(arg);
1197
+ return style === void 0 && (style = new CompiledStyle(isWords(arg) ? arg : compileStyle(arg)), objectCache.set(arg, style)), style;
1198
+ }
1199
+ var PropsNode = class {
1200
+ constructor() {
1201
+ this.next = null;
1202
+ this.result = null;
1203
+ }
1204
+ }, root = new PropsNode(), EMPTY_PROPS = new UiProps([]);
1205
+ root.result = EMPTY_PROPS;
1206
+ function isList(arg) {
1207
+ return Array.isArray(arg) && !isWords(arg);
1208
+ }
1209
+ function step(node, arg) {
1210
+ if (arg === false || arg === null || arg === void 0) return node;
1211
+ if (isList(arg)) {
1212
+ let at = node;
1213
+ for (let i = 0; i < arg.length; i++) at = step(at, arg[i]);
1214
+ return at;
1215
+ }
1216
+ let key = typeof arg == "string" || arg instanceof CompiledStyle || arg instanceof UiProps || arg instanceof chunk5SXDH3Y7_js.UiTheme ? arg : styleOf(arg), next = node.next;
1217
+ next === null && (next = /* @__PURE__ */ new Map(), node.next = next);
1218
+ let child = next.get(key);
1219
+ return child === void 0 && (child = new PropsNode(), next.set(key, child)), child;
1220
+ }
1221
+ function collect(arg, out) {
1222
+ if (!(arg === false || arg === null || arg === void 0)) {
1223
+ if (isList(arg)) {
1224
+ for (let item of arg) collect(item, out);
1225
+ return;
1226
+ }
1227
+ out.push(styleOf(arg));
1228
+ }
1229
+ }
1230
+ function props(a, b, c, d, e, f2, g, h) {
1231
+ let node = step(root, a);
1232
+ if (node = step(node, b), node = step(node, c), node = step(node, d), node = step(node, e), node = step(node, f2), node = step(node, g), node = step(node, h), node.result !== null) return node.result;
1233
+ let parts = [];
1234
+ return collect([a, b, c, d, e, f2, g, h], parts), node.result = parts.length === 1 && parts[0] instanceof UiProps ? parts[0] : new UiProps(parts), node.result;
1235
+ }
1236
+ function contextual(name, error) {
1237
+ throw error instanceof UiStyleCompileError ? new UiStyleCompileError(`styles.${name}: ${error.message}`, error.kind, error.subject, error.suggestion) : error;
1238
+ }
1239
+ function compiledDynamic(entry) {
1240
+ let style = new CompiledStyle(entry[0]), fns = entry[1];
1241
+ return (a, b, c, d) => {
1242
+ for (let i = 0; i < fns.length; i++) style.setSlot(i, fns[i](a, b, c, d));
1243
+ return style;
1244
+ };
1245
+ }
1246
+ function fallbackDynamic(name, fn) {
1247
+ let style = null, signature = "";
1248
+ return (a, b, c, d) => {
1249
+ let words;
1250
+ try {
1251
+ words = compileStyle(fn(a, b, c, d));
1252
+ } catch (error) {
1253
+ contextual(name, error);
1254
+ }
1255
+ if (style === null)
1256
+ return style = new CompiledStyle(words), signature = style.keySignature(), style;
1257
+ if (style.load(words), style.keySignature() !== signature) throw new chunkVRBDAS5I_js.UiStyleError(`styles.${name}: a dynamic style must return the same properties on every call`);
1258
+ return style;
1259
+ };
1260
+ }
1261
+ function styles(definition, compiled) {
1262
+ let out = {}, names = /* @__PURE__ */ new Set([...Object.keys(definition), ...Object.keys(compiled ?? {})]);
1263
+ for (let name of names) {
1264
+ let entry = compiled?.[name], value = definition[name];
1265
+ if (entry !== void 0 && !isWords(entry) && typeof entry[1] == "function") {
1266
+ let style = new CompiledStyle(entry[0]);
1267
+ out[name] = entry[1](style, new Float64Array(Math.max(1, style.slots)));
1268
+ continue;
1269
+ }
1270
+ if (entry !== void 0 && !isWords(entry)) {
1271
+ out[name] = compiledDynamic(entry);
1272
+ continue;
1273
+ }
1274
+ if (entry !== void 0) {
1275
+ out[name] = new CompiledStyle(entry);
1276
+ continue;
1277
+ }
1278
+ if (typeof value == "function") {
1279
+ out[name] = fallbackDynamic(name, value);
1280
+ continue;
1281
+ }
1282
+ try {
1283
+ out[name] = new CompiledStyle(compileStyle(value));
1284
+ } catch (error) {
1285
+ contextual(name, error);
1286
+ }
1287
+ }
1288
+ return out;
1289
+ }
1290
+ var TokenKind = { color: 1, float: 2 };
1291
+ var varKinds = /* @__PURE__ */ new Map(), collectedIds = [], collectedKinds = [], encodingProps = null, literalVars = false, insets = null;
1292
+ function tokenKind(type, word) {
1293
+ return isColorWord(type, word) ? TokenKind.color : type !== ValueType.length && isFloatWord(type, word) ? TokenKind.float : 0;
1294
+ }
1295
+ function claimToken(id, kind) {
1296
+ if (kind === 0) return false;
1297
+ let known = varKinds.get(id);
1298
+ if (known === void 0) varKinds.set(id, kind);
1299
+ else if (known !== kind) return false;
1300
+ return collectedIds.indexOf(id) < 0 && (collectedIds.push(id), collectedKinds.push(kind)), true;
1301
+ }
1302
+ function tokenBits(kind, raw) {
1303
+ return kind === TokenKind.color ? typeof raw == "number" ? raw >>> 0 : chunkVRBDAS5I_js.parseColor(raw) : floatBits(typeof raw == "number" ? raw : Number.parseFloat(raw));
1304
+ }
1305
+ var component = new Float64Array(MAX_COMPONENTS), floats2 = new Float64Array(2), floats4 = new Float64Array(4), words1 = new Float64Array(1), words4 = new Float64Array(4), NO_WORDS = new Float64Array(0), lengthUnit = 0, keepRefs = false, componentRefs = 0, componentSafe = 0;
1306
+ var SHADOW_FLOATS = 4, GRADIENT_HEAD = 5;
1307
+ function read(style, variant, word, target, slot) {
1308
+ let pos = style.start[variant] + word;
1309
+ lengthUnit = style.unit[variant];
1310
+ let kind = style.refKind[pos];
1311
+ if (kind === (2) && keepRefs && encodingProps !== null) {
1312
+ component[slot] = ((2147483648) | encodingProps.slotOffset(style) + style.refId[pos]) >>> 0, componentRefs |= 1 << slot;
1313
+ return;
1314
+ }
1315
+ if (kind !== (1)) {
1316
+ component[slot] = style.values[pos];
1317
+ return;
1318
+ }
1319
+ let id = style.refId[pos];
1320
+ if (keepRefs) {
1321
+ if (target.scopedVar(id) === void 0 && claimToken(id, tokenKind(KEY_TYPES[style.variantKey[variant]], word))) {
1322
+ component[slot] = id, componentRefs |= 1 << slot;
1323
+ return;
1324
+ }
1325
+ literalVars = true;
1326
+ }
1327
+ let raw = target.resolveVar(id) ?? chunk5SXDH3Y7_js.varDefault(id);
1328
+ if (raw === void 0) throw new chunkVRBDAS5I_js.UiStyleError(`style variable ${id} has no value; define it with defineVars`);
1329
+ convert(style.variantKey[variant], word, raw), component[slot] = converted[0], lengthUnit = convertedUnit;
1330
+ }
1331
+ function safeEdge(prop, component2) {
1332
+ return prop === chunkVRBDAS5I_js.UiProp.padding || prop === chunkVRBDAS5I_js.UiProp.margin ? component2 : prop >= chunkVRBDAS5I_js.UiProp.inset_top && prop <= chunkVRBDAS5I_js.UiProp.inset_left ? prop - chunkVRBDAS5I_js.UiProp.inset_top : -1;
1333
+ }
1334
+ function resolveWire(owner, wire, active, target) {
1335
+ let first = WIRE_COMPONENT_START[wire], count = WIRE_COMPONENT_COUNT[wire], any = false;
1336
+ componentRefs = 0, componentSafe = 0, lengthUnit = WIRE_DEFAULT_UNIT[wire];
1337
+ let unit = lengthUnit;
1338
+ for (let c = 0; c < count; c++) {
1339
+ let index = first + c, chainStart2 = COMPONENT_CHAIN_START[index], chainEnd = chainStart2 + COMPONENT_CHAIN_COUNT[index], best = -1, bestStyle = null, bestVariant = (-1), bestWord = 0;
1340
+ for (let link = chainStart2; link < chainEnd; link++) {
1341
+ let key = CHAIN_KEYS[link], style = owner[key];
1342
+ if (style === null) continue;
1343
+ let begin = style.first[key], end = begin + style.count[key];
1344
+ for (let v = begin; v < end; v++)
1345
+ style.empty[v] === 1 || (style.mask[v] & ~active) !== 0 || style.priority[v] >= best && (best = style.priority[v], bestStyle = style, bestVariant = v, bestWord = CHAIN_WORDS[link]);
1346
+ }
1347
+ if (bestStyle === null) {
1348
+ component[c] = COMPONENT_DEFAULTS[index];
1349
+ continue;
1350
+ }
1351
+ if (any = true, read(bestStyle, bestVariant, bestWord, target, c), (bestStyle.mask[bestVariant] & Condition.safe) !== 0) {
1352
+ let edge = safeEdge(WIRE_PROPS[wire], c);
1353
+ edge >= 0 && (WIRE_EMITS[wire] !== WireEmit.length || lengthUnit === chunkVRBDAS5I_js.UiUnit.points) && (keepRefs ? componentSafe |= 1 << c : insets !== null);
1354
+ }
1355
+ unit = lengthUnit;
1356
+ }
1357
+ return lengthUnit = unit, any;
1358
+ }
1359
+ function fillFrom(values, offset, count) {
1360
+ for (let i = 0; i < count; i++) values[i] = component[offset + i];
1361
+ return values;
1362
+ }
1363
+ function resetWire(target, wire) {
1364
+ let kind = WIRE_EMITS[wire];
1365
+ if (kind === WireEmit.flag) return;
1366
+ resolveWire(EMPTY_PROPS.owner, wire, 0, target);
1367
+ let prop = WIRE_PROPS[wire], { writer, id } = target;
1368
+ switch (target.cache.forget(prop), kind) {
1369
+ case WireEmit.length:
1370
+ writer.propFloatAt(id, prop, component, 0, lengthUnit);
1371
+ return;
1372
+ case WireEmit.float:
1373
+ writer.propFloatAt(id, prop, component, 0);
1374
+ return;
1375
+ case WireEmit.word:
1376
+ writer.propWordAt(id, prop, component, 0);
1377
+ return;
1378
+ case WireEmit.floats: {
1379
+ let n = WIRE_COMPONENT_COUNT[wire];
1380
+ writer.propFloats(id, prop, fillFrom(n === 2 ? floats2 : floats4, 0, n));
1381
+ return;
1382
+ }
1383
+ case WireEmit.words:
1384
+ writer.propWords(id, prop, fillFrom(words4, 0, 4));
1385
+ return;
1386
+ case WireEmit.shadow:
1387
+ words1[0] = component[0], writer.propMixed(id, prop, words1, fillFrom(floats4, 1, (4)));
1388
+ return;
1389
+ case WireEmit.gradient:
1390
+ writer.propWords(id, prop, NO_WORDS);
1391
+ return;
1392
+ }
1393
+ }
1394
+ var STYLE_RECORD_REFERENCED = 1 << 24, STYLE_RECORD_SAFE_EDGES = 1 << 25, RECORD_UNIT_SHIFT = 8, RECORD_WORDS_SHIFT = 16, MAX_STYLE_VARIANTS = 64, DETACHED = {
1395
+ writer: null,
1396
+ cache: null,
1397
+ id: 0,
1398
+ resolveVar: () => {
1399
+ },
1400
+ scopedVar: () => {
1401
+ },
1402
+ setLayer: () => {
1403
+ }
1404
+ };
1405
+ function wireClosure(owner, wire) {
1406
+ let closure = [0], first = WIRE_COMPONENT_START[wire];
1407
+ for (let index = first; index < first + WIRE_COMPONENT_COUNT[wire]; index++) {
1408
+ let chainStart2 = COMPONENT_CHAIN_START[index];
1409
+ for (let link = chainStart2; link < chainStart2 + COMPONENT_CHAIN_COUNT[index]; link++) {
1410
+ let key = CHAIN_KEYS[link], style = owner[key];
1411
+ if (style !== null)
1412
+ for (let v = style.first[key]; v < style.first[key] + style.count[key]; v++) {
1413
+ let mask = style.mask[v];
1414
+ if (style.empty[v] === 1 || mask === 0 || closure.indexOf(mask) >= 0) continue;
1415
+ let known = closure.length;
1416
+ for (let i = 0; i < known; i++) closure.indexOf(closure[i] | mask) < 0 && closure.push(closure[i] | mask);
1417
+ if (closure.length > (64)) throw new chunkVRBDAS5I_js.UiStyleError(`a style property combines more than ${(64)} condition sets; split it across elements`);
1418
+ }
1419
+ }
1420
+ }
1421
+ return closure;
1422
+ }
1423
+ function isFloatComponent(emit, index) {
1424
+ return emit === WireEmit.length || emit === WireEmit.float || emit === WireEmit.floats ? true : emit === WireEmit.shadow ? index > 0 : emit === WireEmit.gradient ? index >= (5) : false;
1425
+ }
1426
+ function encodeEntry(out, wire) {
1427
+ let emit = WIRE_EMITS[wire], count = WIRE_COMPONENT_COUNT[wire], referenced = componentRefs !== 0, safe = componentSafe !== 0, unit = emit === WireEmit.length ? lengthUnit : 0;
1428
+ out.push((WIRE_PROPS[wire] | unit << (8) | count << (16) | (referenced ? STYLE_RECORD_REFERENCED : 0) | (safe ? STYLE_RECORD_SAFE_EDGES : 0)) >>> 0), referenced && out.push(componentRefs >>> 0), safe && out.push(componentSafe >>> 0);
1429
+ for (let i = 0; i < count; i++) {
1430
+ let value = component[i];
1431
+ out.push((componentRefs & 1 << i) !== 0 ? value >>> 0 : isFloatComponent(emit, i) ? floatBits(value) : value >>> 0);
1432
+ }
1433
+ }
1434
+ function encode(props3, target) {
1435
+ let records = [], wires = new Uint8Array(WIRE_COUNT);
1436
+ keepRefs = true, encodingProps = props3, literalVars = false, collectedIds.length = 0, collectedKinds.length = 0;
1437
+ try {
1438
+ let list = Array.from(props3.wires).filter((wire) => WIRE_EMITS[wire] !== WireEmit.flag), closures = list.map((wire) => wireClosure(props3.owner, wire)), masks = [...new Set(closures.flat())].sort((a, b) => conditionPriority(a) - conditionPriority(b) || a - b);
1439
+ for (let union of masks) {
1440
+ let words = [];
1441
+ for (let i = 0; i < list.length; i++) {
1442
+ let wire = list[i];
1443
+ closures[i].indexOf(union) < 0 || !resolveWire(props3.owner, wire, union, target) || (encodeEntry(words, wire), wires[wire] = 1);
1444
+ }
1445
+ union !== 0 && words.length === 0 || records.push({ mask: union, words: Uint32Array.from(words) });
1446
+ }
1447
+ return { records, wires, tokenIds: Uint32Array.from(collectedIds), tokenKinds: Uint8Array.from(collectedKinds), literal: literalVars };
1448
+ } finally {
1449
+ keepRefs = false, encodingProps = null, componentRefs = 0, componentSafe = 0;
1450
+ }
1451
+ }
1452
+ function encodeStyleRecords(props3) {
1453
+ return [...engineRecords(props3, DETACHED, false).records];
1454
+ }
1455
+ function engineRecords(props3, target, scoped) {
1456
+ let version = props3.version(), cached = props3.encoded;
1457
+ return (cached === null || props3.encodedVersion !== version) && (cached = encode(props3, DETACHED), props3.encoded = cached, props3.encodedVersion = version), scoped || cached.literal ? encode(props3, target) : cached;
1458
+ }
1459
+
1460
+ // src/interactives/game-ui/styling/index.ts
1461
+ function styles2(definition, compiled) {
1462
+ return styles(definition, compiled);
1463
+ }
1464
+ var props2 = props;
1465
+
1466
+ // src/interactives/game-ui/measure.ts
1467
+ var MEASURE_CAPACITY = 2048, DEFAULT_FONT_SIZE = 16, WRAP_SLACK = 0.01, MEMO_LIMIT = 16384, f = Math.fround, TextMeasurer = class {
1468
+ constructor() {
1469
+ this.layout = new chunkT6Z2EXYL_js.TextLayout((2048));
1470
+ this.style = chunkT6Z2EXYL_js.defaultLayoutStyle();
1471
+ this.result = { lines: 0, rows: 0, width: 0, height: 0 };
1472
+ this.memo = /* @__PURE__ */ new Map();
1473
+ this.hits = 0;
1474
+ this.misses = 0;
1475
+ this.dictionaries = null;
1476
+ }
1477
+ measure(table, text, style, width, out) {
1478
+ let size2 = style.fontSize ?? (16), lineHeight = style.lineHeight ?? 0, letterSpacing = style.letterSpacing ?? 0, wrap = style.textWrapStyle ?? "greedy", limit = width > 0 && Number.isFinite(width) ? width : Number.POSITIVE_INFINITY, dictionaries = chunkT6Z2EXYL_js.breakDictionaries();
1479
+ dictionaries !== this.dictionaries && (this.dictionaries = dictionaries, this.memo.clear());
1480
+ let known = this.memo.get(text);
1481
+ if (known !== void 0 && known.table === table && known.size === size2 && known.lineHeight === lineHeight && known.letterSpacing === letterSpacing && known.wrap === wrap && known.limit === limit)
1482
+ return this.hits++, out.lines = known.lines, out.width = known.width, out.height = known.height, out;
1483
+ this.misses++;
1484
+ let shaped = f(Math.max(size2, 11920929e-14)), s = this.style;
1485
+ s.size = shaped, s.lineHeight = f(lineHeight), s.letterSpacing = f(f(letterSpacing) / shaped), s.maxWidth = Number.isFinite(limit) ? f(f(limit) + f((0.01))) : 0, s.wrap = wrap;
1486
+ let result = this.layout.measure(table, text, s, this.result);
1487
+ return out.lines = result.lines, out.width = result.width, out.height = result.height, known !== void 0 ? (known.table = table, known.size = size2, known.lineHeight = lineHeight, known.letterSpacing = letterSpacing, known.wrap = wrap, known.limit = limit, known.lines = result.lines, known.width = result.width, known.height = result.height) : (this.memo.size >= (16384) && this.memo.clear(), this.memo.set(text, { table, size: size2, lineHeight, letterSpacing, wrap, limit, lines: result.lines, width: result.width, height: result.height })), out;
1488
+ }
1489
+ clear() {
1490
+ this.memo.clear();
1491
+ }
1492
+ };
1493
+
1494
+ // src/interactives/game-ui/ui.ts
1495
+ var MIN_POLYGON_POINTS = 3, POLYGON_WORDS = 2, EXCLUSION_RECORDS = Array.from({ length: chunkVRBDAS5I_js.UI_MAX_EXCLUSIONS }, () => ({
1496
+ shape: 0,
1497
+ sibling: 0,
1498
+ margin: 0,
1499
+ x: 0,
1500
+ y: 0,
1501
+ width: 0,
1502
+ height: 0,
1503
+ points: null
1504
+ })), BREAKPOINT_SM = 640, BREAKPOINT_LG = 1024, LEGACY_KEYS = /* @__PURE__ */ new Set([
1505
+ "width",
1506
+ "height",
1507
+ "minWidth",
1508
+ "minHeight",
1509
+ "maxWidth",
1510
+ "maxHeight",
1511
+ "basis",
1512
+ "top",
1513
+ "right",
1514
+ "bottom",
1515
+ "left",
1516
+ "padding",
1517
+ "margin",
1518
+ "borderWidth",
1519
+ "gap",
1520
+ "grow",
1521
+ "shrink",
1522
+ "aspect",
1523
+ "direction",
1524
+ "justify",
1525
+ "alignItems",
1526
+ "alignSelf",
1527
+ "alignContent",
1528
+ "position",
1529
+ "wrap",
1530
+ "display",
1531
+ "fill",
1532
+ "borderColor",
1533
+ "radius",
1534
+ "opacity",
1535
+ "translate",
1536
+ "scale",
1537
+ "rotate",
1538
+ "origin",
1539
+ "zIndex",
1540
+ "hidden",
1541
+ "clip",
1542
+ "pointerEvents",
1543
+ "layer",
1544
+ "shadow",
1545
+ "gradient",
1546
+ "fontFamily",
1547
+ "fontWeight",
1548
+ "fontSize",
1549
+ "lineHeight",
1550
+ "letterSpacing",
1551
+ "textAlign",
1552
+ "textColor",
1553
+ "textWrap",
1554
+ "verticalAlign",
1555
+ "placeholderColor",
1556
+ "tint",
1557
+ "uv",
1558
+ "nineSlice",
1559
+ "nineSliceUv",
1560
+ "shape",
1561
+ "stroke",
1562
+ "strokeWidth",
1563
+ "scrollAxes",
1564
+ "textWrapStyle"
1565
+ ]);
1566
+ function conditional(value) {
1567
+ if (typeof value != "object" || value === null || Array.isArray(value)) return false;
1568
+ for (let key in value) if (key === "default" || key.startsWith(":") || key.startsWith("@")) return true;
1569
+ return false;
1570
+ }
1571
+ function isLegacyStyle(style) {
1572
+ if (typeof style != "object" || style === null || Array.isArray(style) || ArrayBuffer.isView(style) || style instanceof CompiledStyle || style instanceof UiProps || style instanceof chunk5SXDH3Y7_js.UiTheme) return false;
1573
+ for (let key in style) {
1574
+ if (!LEGACY_KEYS.has(key)) return false;
1575
+ let value = style[key];
1576
+ if (value instanceof chunk5SXDH3Y7_js.UiVar || conditional(value)) return false;
1577
+ }
1578
+ return true;
1579
+ }
1580
+ function holds(encoded, mask) {
1581
+ let records = encoded.records;
1582
+ for (let i = 0; i < records.length; i++) if (records[i].mask === mask) return true;
1583
+ return false;
1584
+ }
1585
+ var GameUiError = class extends Error {
1586
+ constructor(message) {
1587
+ super(message), this.name = "GameUiError";
1588
+ }
1589
+ }, DEFAULT_MAX_NODES = 4096, DEFAULT_MAX_SLOTS = 4096, NO_SLOTS = -1, EMPTY_RECORD = new Uint32Array(0), SLOT_SCRATCH = new Uint32Array(1), ROOT_THEME = {}, DEFAULT_WEIGHT2 = 400, PIVOT_BOTTOM_CENTER = [0.5, 1], ZERO_PAIR = [0, 0], DEFAULT_MIN_SCALE = 0.25, DEFAULT_MAX_SCALE = 2, DEFAULT_OCCLUDED_OPACITY = 0.35, NO_SEPARATOR = 0, COMMA = 44, EVENT_FLAGS = {
1590
+ press: chunkVRBDAS5I_js.UiFlag.press,
1591
+ release: chunkVRBDAS5I_js.UiFlag.press,
1592
+ tap: chunkVRBDAS5I_js.UiFlag.tap,
1593
+ long_press: chunkVRBDAS5I_js.UiFlag.long_press,
1594
+ drag_start: chunkVRBDAS5I_js.UiFlag.drag,
1595
+ drag_move: chunkVRBDAS5I_js.UiFlag.drag,
1596
+ drag_end: chunkVRBDAS5I_js.UiFlag.drag,
1597
+ scroll: 0,
1598
+ focus: 0,
1599
+ action: chunkVRBDAS5I_js.UiFlag.tap,
1600
+ passthrough: 0,
1601
+ change: 0,
1602
+ blur: 0,
1603
+ vector: 0
1604
+ }, VECTOR_TRUE = 1, VECTOR_FALSE = 0, vectorNameEncoder = new TextEncoder(), vectorNames = /* @__PURE__ */ new Map();
1605
+ function vectorName(name) {
1606
+ let bytes = vectorNames.get(name);
1607
+ return bytes === void 0 && (bytes = vectorNameEncoder.encode(name), vectorNames.set(name, bytes)), bytes;
1608
+ }
1609
+ var decoder = new TextDecoder(), EVENT_NAMES = (() => {
1610
+ let names = [];
1611
+ for (let [name, code] of Object.entries(chunkVRBDAS5I_js.UiEventKind)) names[code] = name;
1612
+ return names;
1613
+ })(), UiElement = class {
1614
+ constructor(ui, id, kind) {
1615
+ this.ui = ui;
1616
+ this.id = id;
1617
+ this.kind = kind;
1618
+ this.cache = new chunkVRBDAS5I_js.StyleCache();
1619
+ this.flags = 0;
1620
+ this.listeners = null;
1621
+ this.alive = true;
1622
+ this.edited = "";
1623
+ this.parentElement = null;
1624
+ this.kids = [];
1625
+ this.current = null;
1626
+ this.sent = null;
1627
+ this.sentVersion = -1;
1628
+ this.forced = false;
1629
+ this.focusable = false;
1630
+ this.slotBase = (-1);
1631
+ this.slotSize = 0;
1632
+ this.slotFresh = false;
1633
+ this.slotBits = null;
1634
+ this.stateBits = 0;
1635
+ this.scope = null;
1636
+ }
1637
+ get writer() {
1638
+ return this.ui.writer;
1639
+ }
1640
+ get props() {
1641
+ return this.current;
1642
+ }
1643
+ get state() {
1644
+ return this.stateBits;
1645
+ }
1646
+ resolveVar(id) {
1647
+ let cursor = this;
1648
+ for (; cursor !== null; ) {
1649
+ let scope = cursor.scope;
1650
+ if (scope !== null) {
1651
+ let value = scope.values.get(id);
1652
+ if (value !== void 0) return value;
1653
+ }
1654
+ cursor = cursor.parentElement;
1655
+ }
1656
+ let root2 = this.ui.rootTheme;
1657
+ if (root2 !== null) {
1658
+ let value = root2.values.get(id);
1659
+ if (value !== void 0) return value;
1660
+ }
1661
+ return chunk5SXDH3Y7_js.varDefault(id);
1662
+ }
1663
+ scopedVar(id) {
1664
+ let cursor = this;
1665
+ for (; cursor !== null; ) {
1666
+ let scope = cursor.scope;
1667
+ if (scope !== null) {
1668
+ let value = scope.values.get(id);
1669
+ if (value !== void 0) return value;
1670
+ }
1671
+ cursor = cursor.parentElement;
1672
+ }
1673
+ }
1674
+ scoped() {
1675
+ let cursor = this;
1676
+ for (; cursor !== null; ) {
1677
+ if (cursor.scope !== null) return true;
1678
+ cursor = cursor.parentElement;
1679
+ }
1680
+ return false;
1681
+ }
1682
+ get perElement() {
1683
+ return this.sent !== null && (this.sent.literal || this.sent !== this.current?.encoded);
1684
+ }
1685
+ setLayer(on) {
1686
+ this.setFlag(chunkVRBDAS5I_js.UiFlag.layer, on);
1687
+ }
1688
+ applyProps(next) {
1689
+ let previous = this.scope, old = this.current;
1690
+ if (this.current = next, this.scope = next.theme, (next.stateMask & Condition.pressed) !== 0 && this.setFlag(chunkVRBDAS5I_js.UiFlag.press, true), (next.stateMask & Condition.focus) !== 0 && !this.focusable && (this.focusable = true, this.ui.writer.propWord(this.id, chunkVRBDAS5I_js.UiProp.focusable, 1)), this.send(old, next), previous !== this.scope) for (let i = 0; i < this.kids.length; i++) this.kids[i].restyleVars();
1691
+ }
1692
+ send(old, next) {
1693
+ let version = next.version();
1694
+ if (next !== old || this.sent === null || this.forced || version !== this.sentVersion) {
1695
+ let encoded = engineRecords(next, this, this.scoped());
1696
+ next.slotCount > this.slotSize && this.allocateSlots(next.slotCount), this.ui.ensureTokens(encoded.tokenIds, encoded.tokenKinds);
1697
+ let writer = this.ui.writer, previous = this.sent;
1698
+ if (previous !== null && previous !== encoded) {
1699
+ let records2 = previous.records;
1700
+ for (let i = 0; i < records2.length; i++) {
1701
+ let mask = records2[i].mask;
1702
+ mask !== 0 && !holds(encoded, mask) && writer.style(this.id, mask, EMPTY_RECORD);
1703
+ }
1704
+ }
1705
+ let records = encoded.records, base = this.slotBase < 0 ? 0 : this.slotBase;
1706
+ for (let i = 0; i < records.length; i++) writer.style(this.id, records[i].mask, records[i].words, base);
1707
+ if (previous !== null && previous !== encoded) {
1708
+ let before = previous.wires, after = encoded.wires;
1709
+ for (let wire = 0; wire < before.length; wire++) before[wire] === 1 && after[wire] === 0 && resetWire(this, wire);
1710
+ }
1711
+ this.sent = encoded, this.sentVersion = version, this.forced = false;
1712
+ }
1713
+ this.writeSlots(next);
1714
+ }
1715
+ allocateSlots(count) {
1716
+ this.slotBase !== (-1) && this.ui.freeSlots(this.slotBase, this.slotSize), this.slotBase = this.ui.allocateSlots(count), this.slotSize = count, this.slotBits = new Uint32Array(count), this.slotFresh = true;
1717
+ }
1718
+ writeSlots(props3) {
1719
+ let bits = this.slotBits;
1720
+ if (bits === null || props3.slotCount === 0) return;
1721
+ let dynamics = props3.dynamics;
1722
+ for (let d = 0; d < dynamics.length; d++) {
1723
+ let style = dynamics[d], offset = props3.slotOffsets[d];
1724
+ for (let s = 0; s < style.slots; s++) {
1725
+ style.slotBitsTo(s, SLOT_SCRATCH, 0);
1726
+ let local = offset + s;
1727
+ !this.slotFresh && bits[local] === SLOT_SCRATCH[0] || (bits[local] = SLOT_SCRATCH[0], this.ui.writer.slotAt(this.slotBase + local, SLOT_SCRATCH, 0));
1728
+ }
1729
+ }
1730
+ this.slotFresh = false;
1731
+ }
1732
+ active() {
1733
+ let bits = 0, cursor = this;
1734
+ for (; cursor !== null; )
1735
+ bits |= cursor.stateBits, cursor = cursor.parentElement;
1736
+ return (bits & Condition.disabled) !== 0 && (bits &= ~(Condition.pressed | Condition.focus)), bits | this.ui.context;
1737
+ }
1738
+ restyle() {
1739
+ this.current === null || !this.alive || (this.forced = true, this.send(this.current, this.current), this.ui.touched());
1740
+ }
1741
+ restyleVars() {
1742
+ this.current !== null && this.current.usesVars && this.restyle();
1743
+ for (let i = 0; i < this.kids.length; i++) this.kids[i].restyleVars();
1744
+ }
1745
+ setState(state, on) {
1746
+ let bit = Condition[state], next = on ? this.stateBits | bit : this.stateBits & ~bit;
1747
+ return next === this.stateBits ? this : (this.stateBits = next, state === "disabled" && this.alive && (this.ui.writer.propWord(this.id, chunkVRBDAS5I_js.UiProp.disabled, on ? 1 : 0), this.ui.touched()), this);
1748
+ }
1749
+ get parent() {
1750
+ return this.parentElement;
1751
+ }
1752
+ get children() {
1753
+ return this.kids;
1754
+ }
1755
+ contains(element) {
1756
+ let cursor = element.parentElement;
1757
+ for (; cursor !== null; ) {
1758
+ if (cursor === this) return true;
1759
+ cursor = cursor.parentElement;
1760
+ }
1761
+ return false;
1762
+ }
1763
+ detach() {
1764
+ let parent = this.parentElement;
1765
+ if (parent === null) return;
1766
+ let at = parent.kids.indexOf(this);
1767
+ at >= 0 && parent.kids.splice(at, 1), this.parentElement = null;
1768
+ }
1769
+ adopt(child, before) {
1770
+ if (child === this || child.contains(this))
1771
+ throw new GameUiError(`inserting ui element ${child.id} would create a cycle`);
1772
+ child.parentElement !== null && child.detach();
1773
+ let at = before === null ? -1 : this.kids.indexOf(before);
1774
+ at < 0 ? this.kids.push(child) : this.kids.splice(at, 0, child), child.parentElement = this;
1775
+ }
1776
+ get destroyed() {
1777
+ return !this.alive;
1778
+ }
1779
+ style(style) {
1780
+ return this.ui.check(this), isLegacyStyle(style) ? (style.layer !== void 0 && this.setFlag(chunkVRBDAS5I_js.UiFlag.layer, style.layer), chunkVRBDAS5I_js.writeStyle(this.ui.writer, this.cache, this.id, style)) : this.applyProps(style instanceof UiProps ? style : props2(style)), this.ui.touched(), this;
1781
+ }
1782
+ append(child) {
1783
+ return this.ui.check(this), this.ui.check(child), this.adopt(child, null), this.ui.writer.insert(child.id, this.id, 4294967295), this.ui.touched(), this;
1784
+ }
1785
+ insertBefore(child, before) {
1786
+ if (this.ui.check(this), this.ui.check(child), before.parentElement !== this) throw new GameUiError(`ui element ${before.id} is not a child of ${this.id}`);
1787
+ return this.adopt(child, before), this.ui.writer.insert(child.id, this.id, before.id), this.ui.touched(), this;
1788
+ }
1789
+ remove() {
1790
+ return this.ui.check(this), this.detach(), this.ui.writer.remove(this.id), this.ui.touched(), this;
1791
+ }
1792
+ destroy() {
1793
+ this.alive && (this.ui.release(this), this.alive = false);
1794
+ }
1795
+ get value() {
1796
+ return this.edited;
1797
+ }
1798
+ accept(value) {
1799
+ this.edited = value;
1800
+ }
1801
+ text(value) {
1802
+ return this.ui.check(this), this.kind === "input" && (this.edited = value), this.ui.writer.text(this.id, value), this.ui.touched(), this;
1803
+ }
1804
+ textPrefix(value, length2) {
1805
+ return this.ui.check(this), this.ui.writer.textPrefix(this.id, value, length2), this.ui.touched(), this;
1806
+ }
1807
+ textRef(id) {
1808
+ return this.ui.check(this), this.ui.writer.textRef(this.id, id), this.ui.touched(), this;
1809
+ }
1810
+ number(value, options = {}) {
1811
+ this.ui.check(this);
1812
+ let separator = options.separator === void 0 ? (44) : options.separator.length === 0 ? (0) : options.separator.charCodeAt(0);
1813
+ return this.ui.writer.number(this.id, value, chunkVRBDAS5I_js.UiNumberFormat[options.format ?? "integer"], options.decimals ?? 0, separator), this.ui.touched(), this;
1814
+ }
1815
+ placeholder(value) {
1816
+ return this.ui.check(this), this.ui.writer.placeholder(this.id, value), this.ui.touched(), this;
1817
+ }
1818
+ image(asset, width, height) {
1819
+ return this.ui.check(this), this.ui.writer.image(this.id, asset, width, height), this.ui.touched(), this;
1820
+ }
1821
+ path(points) {
1822
+ return this.ui.check(this), this.ui.writer.path(this.id, points), this.ui.touched(), this;
1823
+ }
1824
+ vector(asset, artboard = 0) {
1825
+ return this.requireVector(), this.ui.writer.vector(this.id, asset, artboard), this.ui.touched(), this;
1826
+ }
1827
+ play(kind, index) {
1828
+ return this.requireVector(), this.ui.writer.vectorPlay(this.id, kind, index), this.ui.touched(), this;
1829
+ }
1830
+ seek(kind, index, seconds) {
1831
+ return this.requireVector(), this.ui.writer.vectorSeek(this.id, kind, index, seconds), this.ui.touched(), this;
1832
+ }
1833
+ setInput(input, value) {
1834
+ this.requireVector();
1835
+ let numeric = typeof value == "boolean" ? value ? (1) : (0) : value;
1836
+ return typeof input == "number" ? this.ui.writer.vectorInput(this.id, input, numeric) : this.ui.writer.vectorInputName(this.id, vectorName(input), numeric), this.ui.touched(), this;
1837
+ }
1838
+ setData(path, value) {
1839
+ return this.requireVector(), typeof value == "boolean" ? this.ui.writer.vectorData(this.id, chunkVRBDAS5I_js.UiVectorData.bool, vectorName(path), value ? (1) : (0), 0) : this.ui.writer.vectorData(this.id, chunkVRBDAS5I_js.UiVectorData.number, vectorName(path), value, 0), this.ui.touched(), this;
1840
+ }
1841
+ setDataColor(path, argb) {
1842
+ return this.requireVector(), this.ui.writer.vectorData(this.id, chunkVRBDAS5I_js.UiVectorData.color, vectorName(path), 0, argb >>> 0), this.ui.touched(), this;
1843
+ }
1844
+ fireData(path) {
1845
+ return this.requireVector(), this.ui.writer.vectorData(this.id, chunkVRBDAS5I_js.UiVectorData.fire, vectorName(path), 0, 0), this.ui.touched(), this;
1846
+ }
1847
+ detachVector() {
1848
+ return this.requireVector(), this.ui.writer.vectorDetach(this.id), this.ui.touched(), this;
1849
+ }
1850
+ requireVector() {
1851
+ if (this.ui.check(this), this.kind !== "vector") throw new GameUiError(`ui ${this.kind} ${this.id} is not a vector element; create it with ui.vector`);
1852
+ }
1853
+ flowAround(exclusions) {
1854
+ if (this.ui.check(this), this.kind === "image" || this.kind === "shape") throw new GameUiError(`ui ${this.kind} ${this.id} cannot flow around shapes; use text, input, box or scroll`);
1855
+ let count = exclusions === null ? 0 : exclusions.length;
1856
+ if (count > chunkVRBDAS5I_js.UI_MAX_EXCLUSIONS) throw new GameUiError(`ui element ${this.id} flows around at most ${chunkVRBDAS5I_js.UI_MAX_EXCLUSIONS} shapes`);
1857
+ for (let i = 0; i < count; i++) this.exclusionRecord(exclusions[i], EXCLUSION_RECORDS[i]);
1858
+ this.ui.writer.exclusions(this.id, EXCLUSION_RECORDS, count);
1859
+ for (let i = 0; i < count; i++) EXCLUSION_RECORDS[i].points = null;
1860
+ return this.ui.touched(), this;
1861
+ }
1862
+ exclusionRecord(exclusion, out) {
1863
+ if (out.margin = exclusion.margin ?? 0, out.sibling = 4294967295, out.x = 0, out.y = 0, out.width = 0, out.height = 0, out.points = null, "rect" in exclusion)
1864
+ out.shape = chunkVRBDAS5I_js.UiExclusionShape.rect, out.x = exclusion.rect[0], out.y = exclusion.rect[1], out.width = exclusion.rect[2], out.height = exclusion.rect[3];
1865
+ else if ("circle" in exclusion) {
1866
+ let [cx, cy, r] = exclusion.circle;
1867
+ out.shape = chunkVRBDAS5I_js.UiExclusionShape.ellipse, out.x = cx - r, out.y = cy - r, out.width = r * 2, out.height = r * 2;
1868
+ } else if ("polygon" in exclusion) {
1869
+ if (exclusion.polygon.length < (3) * (2)) throw new GameUiError("an exclusion polygon needs at least three points");
1870
+ out.shape = chunkVRBDAS5I_js.UiExclusionShape.polygon, out.points = exclusion.polygon, exclusion.element !== void 0 && (out.sibling = this.exclusionTarget(exclusion.element));
1871
+ } else
1872
+ out.shape = exclusion.shape === "circle" ? chunkVRBDAS5I_js.UiExclusionShape.ellipse : chunkVRBDAS5I_js.UiExclusionShape.rect, out.sibling = this.exclusionTarget(exclusion.element);
1873
+ }
1874
+ exclusionTarget(element) {
1875
+ if (this.ui.check(element), element === this) throw new GameUiError(`ui element ${this.id} cannot flow around itself`);
1876
+ return element.id;
1877
+ }
1878
+ transition(props3, options) {
1879
+ this.ui.check(this);
1880
+ let mask = 0;
1881
+ for (let prop of props3) mask |= chunkVRBDAS5I_js.UiTransition[prop];
1882
+ let easing = options.spring !== void 0 ? "spring" : options.bezier !== void 0 ? "bezier" : options.easing ?? "ease", params = options.spring !== void 0 ? [options.spring.damping, options.spring.cycles, 0, 0] : options.bezier ?? null;
1883
+ return this.ui.writer.transition(this.id, mask, options.duration, chunkVRBDAS5I_js.UiEasing[easing], params), this.ui.touched(), this;
1884
+ }
1885
+ accessibility(options) {
1886
+ this.ui.check(this);
1887
+ let writer = this.ui.writer;
1888
+ options.role !== void 0 && writer.propWord(this.id, chunkVRBDAS5I_js.UiProp.role, chunkVRBDAS5I_js.UiRole[options.role]), options.label !== void 0 && writer.label(this.id, options.label), options.value !== void 0 && writer.value(this.id, options.value);
1889
+ let traits = (options.selected ? chunkVRBDAS5I_js.UiTrait.selected : 0) | (options.disabled ? chunkVRBDAS5I_js.UiTrait.disabled : 0) | (options.hidden ? chunkVRBDAS5I_js.UiTrait.hidden : 0) | (options.live ? chunkVRBDAS5I_js.UiTrait.live : 0) | (options.modal ? chunkVRBDAS5I_js.UiTrait.modal : 0);
1890
+ if (writer.propWord(this.id, chunkVRBDAS5I_js.UiProp.traits, traits), this.setState("disabled", options.disabled === true), options.actions !== void 0) {
1891
+ let actions = 0;
1892
+ for (let action of options.actions) actions |= chunkVRBDAS5I_js.UiAction[action];
1893
+ writer.propWord(this.id, chunkVRBDAS5I_js.UiProp.actions, actions);
1894
+ }
1895
+ return this.ui.touched(), this;
1896
+ }
1897
+ scrollTo(x, y) {
1898
+ return this.ui.check(this), this.ui.writer.scrollTo(this.id, x, y), this.ui.touched(), this;
1899
+ }
1900
+ focus() {
1901
+ return this.ui.check(this), this.ui.writer.focus(this.id), this.ui.touched(), this;
1902
+ }
1903
+ blur() {
1904
+ return this.ui.check(this), this.ui.writer.blur(this.id), this.ui.touched(), this;
1905
+ }
1906
+ on(event, listener) {
1907
+ this.ui.check(this), this.listeners === null && (this.listeners = /* @__PURE__ */ new Map());
1908
+ let list = this.listeners.get(event);
1909
+ return list === void 0 && (list = [], this.listeners.set(event, list)), list.push(listener), this.setFlag(EVENT_FLAGS[event], true), () => {
1910
+ let at = list.indexOf(listener);
1911
+ at >= 0 && list.splice(at, 1);
1912
+ };
1913
+ }
1914
+ emit(name, event) {
1915
+ name === "press" ? this.setState("pressed", true) : name === "release" ? this.setState("pressed", false) : name === "focus" ? this.setState("focus", true) : name === "blur" && this.setState("focus", false);
1916
+ let list = this.listeners?.get(name);
1917
+ if (list === void 0 || list.length === 0) return false;
1918
+ for (let i = 0; i < list.length; i++) list[i](event, this);
1919
+ return true;
1920
+ }
1921
+ setFlag(flag, on) {
1922
+ if (flag === 0) return;
1923
+ let next = on ? this.flags | flag : this.flags & ~flag;
1924
+ next !== this.flags && (this.flags = next, this.ui.writer.propWord(this.id, chunkVRBDAS5I_js.UiProp.flags, next), this.ui.touched());
1925
+ }
1926
+ dispose() {
1927
+ this.alive = false, this.listeners = null, this.current = null, this.sent = null, this.scope = null, this.slotBase !== (-1) && this.ui.freeSlots(this.slotBase, this.slotSize), this.slotBase = (-1), this.slotSize = 0, this.slotBits = null;
1928
+ }
1929
+ }, GameUi = class {
1930
+ constructor(sink, options = {}) {
1931
+ this.sink = sink;
1932
+ this.elements = [];
1933
+ this.free = [];
1934
+ this.next = 0;
1935
+ this.strings = /* @__PURE__ */ new Map();
1936
+ this.families = /* @__PURE__ */ new Map();
1937
+ this.fontFamilies = [];
1938
+ this.fontWeights = [];
1939
+ this.fontIds = [];
1940
+ this.measurer = new TextMeasurer();
1941
+ this.passthrough = [];
1942
+ this.event = { kind: 0, phase: 0, pointer: 0, node: 0, x: 0, y: 0, dx: 0, dy: 0, value: 0, time_ms: 0 };
1943
+ this.scheduled = false;
1944
+ this.contextBits = Condition.portrait | Condition.safe;
1945
+ this.themeRoot = null;
1946
+ this.tokenIds = [];
1947
+ this.tokenKinds = [];
1948
+ this.tokenSent = /* @__PURE__ */ new Set();
1949
+ this.themeBits = /* @__PURE__ */ new WeakMap();
1950
+ this.slotTop = 0;
1951
+ this.freeSlotBlocks = /* @__PURE__ */ new Map();
1952
+ this.flushTask = () => {
1953
+ this.flush();
1954
+ };
1955
+ this.maxNodes = options.max_nodes ?? (4096), this.maxSlots = options.max_slots ?? (4096), this.autoFlush = options.auto_flush ?? true, this.writer = new chunkVRBDAS5I_js.PatchWriter(options.capacity, options.reserve ?? 0), options.dictionaries === true && this.textDictionaries(true);
1956
+ }
1957
+ get context() {
1958
+ return this.contextBits;
1959
+ }
1960
+ get rootTheme() {
1961
+ return this.themeRoot;
1962
+ }
1963
+ styles(definition, compiled) {
1964
+ return styles2(definition, compiled);
1965
+ }
1966
+ props(a, b, c, d, e, f2, g, h) {
1967
+ return props2(a, b, c, d, e, f2, g, h);
1968
+ }
1969
+ environment(environment) {
1970
+ let width = environment.width;
1971
+ this.contextBits = (width > environment.height ? Condition.landscape : Condition.portrait) | Condition.safe | (width >= (640) ? Condition.sm : 0) | (width >= (1024) ? Condition.lg : 0);
1972
+ }
1973
+ tokenValue(theme, id, kind) {
1974
+ let key = theme ?? ROOT_THEME, caches = this.themeBits.get(key);
1975
+ caches === void 0 && (caches = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()], this.themeBits.set(key, caches));
1976
+ let cache = caches[kind], bits = cache.get(id);
1977
+ if (bits === void 0) {
1978
+ let raw = theme?.values.get(id) ?? chunk5SXDH3Y7_js.varDefault(id);
1979
+ if (raw === void 0) throw new GameUiError(`style variable ${id} has no value; define it with defineVars`);
1980
+ bits = tokenBits(kind, raw), cache.set(id, bits);
1981
+ }
1982
+ return bits;
1983
+ }
1984
+ ensureTokens(ids, kinds) {
1985
+ let missing = 0;
1986
+ for (let i = 0; i < ids.length; i++) this.tokenSent.has(ids[i]) || missing++;
1987
+ if (missing !== 0) {
1988
+ this.writer.tokens(false, missing);
1989
+ for (let i = 0; i < ids.length; i++) {
1990
+ let id = ids[i];
1991
+ this.tokenSent.has(id) || (this.tokenSent.add(id), this.tokenIds.push(id), this.tokenKinds.push(kinds[i]), this.writer.pair(id, this.tokenValue(this.themeRoot, id, kinds[i])));
1992
+ }
1993
+ }
1994
+ }
1995
+ theme(theme) {
1996
+ if (theme === this.themeRoot) return;
1997
+ this.themeRoot = theme;
1998
+ let count = this.tokenIds.length;
1999
+ if (count > 0) {
2000
+ this.writer.tokens(true, count);
2001
+ for (let i = 0; i < count; i++) this.writer.pair(this.tokenIds[i], this.tokenValue(theme, this.tokenIds[i], this.tokenKinds[i]));
2002
+ }
2003
+ for (let i = 0; i < this.elements.length; i++) {
2004
+ let element = this.elements[i];
2005
+ element !== void 0 && element.perElement && element.restyle();
2006
+ }
2007
+ this.touched();
2008
+ }
2009
+ allocateSlots(count) {
2010
+ let free = this.freeSlotBlocks.get(count);
2011
+ if (free !== void 0 && free.length > 0) return free.pop();
2012
+ let base = this.slotTop;
2013
+ if (base + count > this.maxSlots) throw new GameUiError(`a game ui holds at most ${this.maxSlots} dynamic style slots`);
2014
+ return this.slotTop = base + count, base;
2015
+ }
2016
+ freeSlots(base, count) {
2017
+ let free = this.freeSlotBlocks.get(count);
2018
+ free === void 0 && (free = [], this.freeSlotBlocks.set(count, free)), free.push(base);
2019
+ }
2020
+ textDictionaries(on) {
2021
+ this.writer.textOptions(on ? chunkVRBDAS5I_js.UiTextOption.dictionaries : 0), this.touched();
2022
+ }
2023
+ check(element) {
2024
+ if (element.ui !== this) throw new GameUiError("this element belongs to another game ui");
2025
+ if (element.destroyed) throw new GameUiError(`ui element ${element.id} was destroyed`);
2026
+ }
2027
+ touched() {
2028
+ !this.autoFlush || this.scheduled || (this.scheduled = true, queueMicrotask(this.flushTask));
2029
+ }
2030
+ allocate(kind) {
2031
+ let id = this.free.length > 0 ? this.free.pop() : this.next++;
2032
+ if (id >= this.maxNodes) throw new GameUiError(`a game ui holds at most ${this.maxNodes} nodes`);
2033
+ let element = new UiElement(this, id, kind);
2034
+ return this.elements[id] = element, this.writer.create(id, chunkVRBDAS5I_js.UiKind[kind]), this.touched(), element;
2035
+ }
2036
+ release(element) {
2037
+ this.check(element), this.writer.destroy(element.id), this.touched(), this.forget(element);
2038
+ }
2039
+ forget(element) {
2040
+ element.detach();
2041
+ let kids = element.children.slice();
2042
+ for (let i = 0; i < kids.length; i++) this.forget(kids[i]);
2043
+ this.elements[element.id] = void 0, this.free.push(element.id), element.dispose();
2044
+ }
2045
+ element(id) {
2046
+ return this.elements[id];
2047
+ }
2048
+ box(style) {
2049
+ let element = this.allocate("box");
2050
+ return style !== void 0 && element.style(style), element;
2051
+ }
2052
+ text(content, style, options) {
2053
+ let element = this.allocate("text");
2054
+ return style !== void 0 && element.style(style), content.length > 0 && element.text(content), options?.flowAround !== void 0 && element.flowAround(options.flowAround), element;
2055
+ }
2056
+ fontFor(family, weight = (400)) {
2057
+ let id = typeof family == "number" ? family : this.family(family), best = id, distance = Number.POSITIVE_INFINITY;
2058
+ for (let i = 0; i < this.fontFamilies.length; i++) {
2059
+ if (this.fontFamilies[i] !== id) continue;
2060
+ let gap = Math.abs(this.fontWeights[i] - weight);
2061
+ gap < distance && (distance = gap, best = this.fontIds[i]);
2062
+ }
2063
+ return best;
2064
+ }
2065
+ measureText(text, style = {}, width = 0, out) {
2066
+ let font = this.fontFor(style.fontFamily ?? 0, style.fontWeight ?? (400)), table = chunkPDOELNNQ_js.fontTable(font);
2067
+ if (table === void 0)
2068
+ throw new GameUiError(`measureText needs the table of render font ${font}; load it with graphics.loadFont before measuring`);
2069
+ return this.measurer.measure(table, text, style, width, out ?? { lines: 0, width: 0, height: 0 });
2070
+ }
2071
+ get measureStats() {
2072
+ return { hits: this.measurer.hits, misses: this.measurer.misses };
2073
+ }
2074
+ image(asset, natural, style) {
2075
+ let element = this.allocate("image");
2076
+ return element.image(asset, natural[0], natural[1]), style !== void 0 && element.style(style), element;
2077
+ }
2078
+ loadVector(asset, bytes) {
2079
+ this.writer.vectorLoad(asset, bytes), this.touched();
2080
+ }
2081
+ unloadVector(asset) {
2082
+ this.writer.vectorUnload(asset), this.touched();
2083
+ }
2084
+ vector(asset, artboard = 0, style) {
2085
+ let element = this.allocate("vector");
2086
+ return element.vector(asset, artboard), style !== void 0 && element.style(style), element;
2087
+ }
2088
+ shape(style, path) {
2089
+ let element = this.allocate("shape");
2090
+ return style !== void 0 && element.style(style), path !== void 0 && element.path(path), element;
2091
+ }
2092
+ scroll(style) {
2093
+ let element = this.allocate("scroll");
2094
+ return style !== void 0 && element.style(style), element;
2095
+ }
2096
+ input(placeholder, style) {
2097
+ let element = this.allocate("input");
2098
+ return style !== void 0 && element.style(style), placeholder.length > 0 && element.placeholder(placeholder), element;
2099
+ }
2100
+ root(element, options = {}) {
2101
+ this.check(element);
2102
+ let offset = options.offset ?? ZERO_PAIR;
2103
+ return this.writer.root(element.id, chunkVRBDAS5I_js.UiAnchor[options.anchor ?? "top_left"], options.safe_area ?? true, offset[0], offset[1], options.z ?? 0), this.touched(), element;
2104
+ }
2105
+ worldRoot(element, anchor) {
2106
+ return this.check(element), this.writer.worldRoot(element.id, {
2107
+ position: anchor.position,
2108
+ pivot: anchor.pivot ?? PIVOT_BOTTOM_CENTER,
2109
+ offset: anchor.offset ?? ZERO_PAIR,
2110
+ reference_distance: anchor.reference_distance ?? 0,
2111
+ min_scale: anchor.min_scale ?? (0.25),
2112
+ max_scale: anchor.max_scale ?? (2),
2113
+ hide_when_occluded: anchor.hide_when_occluded ?? false,
2114
+ occluded_opacity: anchor.occluded_opacity ?? (0.35),
2115
+ z: anchor.z ?? 0
2116
+ }), this.touched(), element;
2117
+ }
2118
+ unroot(element) {
2119
+ this.check(element), this.writer.unroot(element.id), this.touched();
2120
+ }
2121
+ move(element, x, y, z) {
2122
+ this.check(element), this.writer.anchor(element.id, x, y, z), this.touched();
2123
+ }
2124
+ moveFrom(element, values, offset) {
2125
+ this.check(element), this.writer.anchorFrom(element.id, values, offset), this.touched();
2126
+ }
2127
+ occlude(element, occluded) {
2128
+ this.check(element), this.writer.occluded(element.id, occluded), this.touched();
2129
+ }
2130
+ intern(text) {
2131
+ let known = this.strings.get(text);
2132
+ if (known !== void 0) return known;
2133
+ let id = this.strings.size;
2134
+ return this.strings.set(text, id), this.writer.string(id, text), this.touched(), id;
2135
+ }
2136
+ family(name) {
2137
+ let known = this.families.get(name);
2138
+ if (known !== void 0) return known;
2139
+ let id = this.families.size;
2140
+ return this.families.set(name, id), id;
2141
+ }
2142
+ registerFont(family, font, weight = (400)) {
2143
+ let id = this.family(family), at = -1;
2144
+ for (let i = 0; i < this.fontFamilies.length; i++) this.fontFamilies[i] === id && this.fontWeights[i] === weight && (at = i);
2145
+ return at < 0 ? (this.fontFamilies.push(id), this.fontWeights.push(weight), this.fontIds.push(font)) : this.fontIds[at] = font, this.writer.font(id, weight, font), this.touched(), id;
2146
+ }
2147
+ onPassthrough(listener) {
2148
+ return this.passthrough.push(listener), () => {
2149
+ let at = this.passthrough.indexOf(listener);
2150
+ at >= 0 && this.passthrough.splice(at, 1);
2151
+ };
2152
+ }
2153
+ flush() {
2154
+ if (this.scheduled = false, this.writer.empty) return 0;
2155
+ let length2 = this.writer.finish();
2156
+ return this.sink.submit(this.writer.bytes, length2), this.writer.reset(), length2;
2157
+ }
2158
+ dispatch(bytes, offset = 0) {
2159
+ let view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength), handled = 0, stride = 32;
2160
+ for (let at = offset; at + 32 <= bytes.byteLength; at += stride) {
2161
+ chunkVRBDAS5I_js.readEvent(view, at, this.event), stride = chunkVRBDAS5I_js.eventStride(this.event.kind, view, at), this.event.text = void 0;
2162
+ let name = EVENT_NAMES[this.event.kind];
2163
+ if (name == null) continue;
2164
+ if (name === "change") {
2165
+ let start = at + 32, end = Math.min(start + this.event.value, bytes.byteLength), text = decoder.decode(bytes.subarray(start, end));
2166
+ this.event.text = text;
2167
+ let target = this.elements[this.event.node];
2168
+ if (target === void 0) continue;
2169
+ target.accept(text), target.emit(name, this.event) && handled++;
2170
+ continue;
2171
+ }
2172
+ if (name === "passthrough") {
2173
+ for (let i = 0; i < this.passthrough.length; i++) this.passthrough[i](this.event);
2174
+ handled++;
2175
+ continue;
2176
+ }
2177
+ let element = this.elements[this.event.node];
2178
+ element !== void 0 && element.emit(name, this.event) && handled++;
2179
+ }
2180
+ return handled;
2181
+ }
2182
+ };
2183
+ function collectingSink() {
2184
+ let buffers = [];
2185
+ return {
2186
+ buffers,
2187
+ submit(bytes, length2) {
2188
+ buffers.push(bytes.slice(0, length2));
2189
+ }
2190
+ };
2191
+ }
2192
+
2193
+ exports.BREAKPOINT_LG = (1024);
2194
+ exports.BREAKPOINT_SM = (640);
2195
+ exports.CompiledStyle = CompiledStyle;
2196
+ exports.Condition = Condition;
2197
+ exports.GameUi = GameUi;
2198
+ exports.GameUiError = GameUiError;
2199
+ exports.KEY_NAMES = KEY_NAMES;
2200
+ exports.SLOT_REFERENCE = (2147483648);
2201
+ exports.STYLE_BLOCK_MAGIC = (827937875);
2202
+ exports.STYLE_BLOCK_VERSION = (1);
2203
+ exports.STYLE_PROPERTY_NAMES = STYLE_PROPERTY_NAMES;
2204
+ exports.STYLE_RECORD_REFERENCED = STYLE_RECORD_REFERENCED;
2205
+ exports.STYLE_RECORD_SAFE_EDGES = STYLE_RECORD_SAFE_EDGES;
2206
+ exports.TextMeasurer = TextMeasurer;
2207
+ exports.UiElement = UiElement;
2208
+ exports.UiProps = UiProps;
2209
+ exports.UiStyleCompileError = UiStyleCompileError;
2210
+ exports.VariantKind = VariantKind;
2211
+ exports.collectingSink = collectingSink;
2212
+ exports.compileClasses = compileClasses;
2213
+ exports.compileStyle = compileStyle;
2214
+ exports.conditionPriority = conditionPriority;
2215
+ exports.encodeStyleRecords = encodeStyleRecords;
2216
+ exports.props = props2;
2217
+ exports.readBlock = readBlock;
2218
+ exports.styles = styles2;
2219
+ exports.tailwindStyle = tailwindStyle;
2220
+ exports.tailwindVocabulary = tailwindVocabulary;