solve-engine 1.2.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (384) hide show
  1. package/README.md +12 -17
  2. package/dist/{BytecodeBuilder-Bp9xeTmX.d.cts → BytecodeBuilder-DGGeByAP.d.cts} +18 -0
  3. package/dist/{BytecodeBuilder-Bp9xeTmX.d.ts → BytecodeBuilder-DGGeByAP.d.ts} +18 -0
  4. package/dist/{Configuration-C9W8tJv_.d.cts → Configuration-B6W0-T67.d.cts} +17 -4
  5. package/dist/{Configuration-C9W8tJv_.d.ts → Configuration-B6W0-T67.d.ts} +17 -4
  6. package/dist/{EngineError-CNA_rHY-.d.cts → EngineError-Ce1lPkjZ.d.cts} +2 -0
  7. package/dist/{EngineError-CNA_rHY-.d.ts → EngineError-Ce1lPkjZ.d.ts} +2 -0
  8. package/dist/{PackageCompatibility-B6NX9IaN.d.cts → PackageCompatibility-Bn5jnBtA.d.cts} +2 -2
  9. package/dist/{PackageCompatibility-Ceg5XdAp.d.ts → PackageCompatibility-CIvq2MP5.d.ts} +2 -2
  10. package/dist/{PackageRegistry-DrCPQNyy.d.ts → PackageRegistry-DzeiWcv4.d.ts} +93 -172
  11. package/dist/{PackageRegistry-DnJYVw9G.d.cts → PackageRegistry-dpdurBVO.d.cts} +93 -172
  12. package/dist/{Parselet-Bhf7d0_W.d.ts → Parselet-B-zoPrTa.d.ts} +8 -5
  13. package/dist/{Parselet-Cv7S7KRt.d.cts → Parselet-C4Wu055_.d.cts} +8 -5
  14. package/dist/{ScopeManager-Bzq87GfA.d.ts → ScopeManager-C2LDOrDx.d.ts} +7 -16
  15. package/dist/{ScopeManager-DRDBVfan.d.cts → ScopeManager-D7uMXbhS.d.cts} +7 -16
  16. package/dist/{VMCheckpoints-C6c17Hbo.d.ts → VMCheckpoints-CGyFhivM.d.ts} +3 -3
  17. package/dist/{VMCheckpoints-dZxSMGHG.d.cts → VMCheckpoints-I9jg3jWR.d.cts} +3 -3
  18. package/dist/{Value-DZNQ_PU7.d.cts → Value-CCi_Eecs.d.cts} +40 -0
  19. package/dist/{Value-DZNQ_PU7.d.ts → Value-CCi_Eecs.d.ts} +40 -0
  20. package/dist/{WorkerError-Djd7GGGa.d.cts → WorkerError-B4p6PNfx.d.cts} +1 -1
  21. package/dist/{WorkerError-B7t7R2-m.d.ts → WorkerError-Dhj9BQ_A.d.ts} +1 -1
  22. package/dist/chunk-2JMFUQZH.js +2 -0
  23. package/dist/chunk-2JMFUQZH.js.map +1 -0
  24. package/dist/chunk-2RWAXT6O.js +0 -1
  25. package/dist/chunk-4BZIYU7S.cjs +3 -0
  26. package/dist/chunk-4BZIYU7S.cjs.map +1 -0
  27. package/dist/chunk-4J7XZSZJ.cjs +5 -0
  28. package/dist/chunk-4J7XZSZJ.cjs.map +1 -0
  29. package/dist/chunk-4QVBSG6B.cjs +2 -0
  30. package/dist/chunk-4QVBSG6B.cjs.map +1 -0
  31. package/dist/chunk-5IJD5L3O.cjs +2 -0
  32. package/dist/chunk-5IJD5L3O.cjs.map +1 -0
  33. package/dist/chunk-62LMTO4F.js +2 -0
  34. package/dist/chunk-62LMTO4F.js.map +1 -0
  35. package/dist/chunk-6CY44ZPG.js +2 -0
  36. package/dist/chunk-6CY44ZPG.js.map +1 -0
  37. package/dist/chunk-6G3PMEPA.js +2 -0
  38. package/dist/chunk-6G3PMEPA.js.map +1 -0
  39. package/dist/chunk-6INX773F.cjs +2 -0
  40. package/dist/chunk-6INX773F.cjs.map +1 -0
  41. package/dist/chunk-6KFVG6UY.cjs +2 -0
  42. package/dist/{chunk-YJHY7CMN.cjs.map → chunk-6KFVG6UY.cjs.map} +1 -1
  43. package/dist/chunk-76F3LCIL.js +4 -0
  44. package/dist/chunk-76F3LCIL.js.map +1 -0
  45. package/dist/chunk-7GK3XEZF.js +2 -0
  46. package/dist/chunk-7GK3XEZF.js.map +1 -0
  47. package/dist/chunk-APN442VD.cjs +2 -0
  48. package/dist/chunk-APN442VD.cjs.map +1 -0
  49. package/dist/chunk-AXMQG5TS.cjs +2 -0
  50. package/dist/chunk-AXMQG5TS.cjs.map +1 -0
  51. package/dist/chunk-CIQOK7Q4.cjs +2 -0
  52. package/dist/chunk-CIQOK7Q4.cjs.map +1 -0
  53. package/dist/chunk-E6Z4NQAS.js +2 -0
  54. package/dist/chunk-E6Z4NQAS.js.map +1 -0
  55. package/dist/chunk-EFJCC6FJ.cjs +2 -0
  56. package/dist/chunk-EFJCC6FJ.cjs.map +1 -0
  57. package/dist/chunk-ESUN2THE.cjs +2 -0
  58. package/dist/chunk-ESUN2THE.cjs.map +1 -0
  59. package/dist/chunk-EVAOPEO4.js +2 -0
  60. package/dist/chunk-EVAOPEO4.js.map +1 -0
  61. package/dist/chunk-EYRBENHC.js +3 -0
  62. package/dist/chunk-EYRBENHC.js.map +1 -0
  63. package/dist/chunk-FDE5HWDI.cjs +2 -0
  64. package/dist/chunk-FDE5HWDI.cjs.map +1 -0
  65. package/dist/chunk-FWW3M36J.cjs +2 -0
  66. package/dist/chunk-FWW3M36J.cjs.map +1 -0
  67. package/dist/chunk-GOIQYUWV.js +2 -0
  68. package/dist/chunk-GOIQYUWV.js.map +1 -0
  69. package/dist/chunk-HFKDWQUL.js +2 -0
  70. package/dist/chunk-HFKDWQUL.js.map +1 -0
  71. package/dist/chunk-HLBYHXQD.cjs +3 -0
  72. package/dist/chunk-HLBYHXQD.cjs.map +1 -0
  73. package/dist/chunk-IANAMBJQ.cjs +2 -0
  74. package/dist/chunk-IANAMBJQ.cjs.map +1 -0
  75. package/dist/chunk-IJMNVBIS.js +2 -0
  76. package/dist/chunk-IJMNVBIS.js.map +1 -0
  77. package/dist/chunk-J4LZD4ZY.js +3 -0
  78. package/dist/chunk-J4LZD4ZY.js.map +1 -0
  79. package/dist/chunk-JAK3RAFA.cjs +2 -0
  80. package/dist/chunk-JAK3RAFA.cjs.map +1 -0
  81. package/dist/chunk-JFAJN3C2.cjs +2 -0
  82. package/dist/chunk-JFAJN3C2.cjs.map +1 -0
  83. package/dist/chunk-JPFCXLJV.js +2 -0
  84. package/dist/chunk-JPFCXLJV.js.map +1 -0
  85. package/dist/chunk-JSPKKNPQ.js +3 -0
  86. package/dist/chunk-JSPKKNPQ.js.map +1 -0
  87. package/dist/chunk-L3FPQSGN.js +2 -0
  88. package/dist/chunk-L3FPQSGN.js.map +1 -0
  89. package/dist/chunk-LR4E4A4W.cjs +2 -0
  90. package/dist/chunk-LR4E4A4W.cjs.map +1 -0
  91. package/dist/chunk-MIQBJGGR.js +2 -0
  92. package/dist/chunk-MIQBJGGR.js.map +1 -0
  93. package/dist/chunk-MPB7KUN5.js +3 -0
  94. package/dist/chunk-MPB7KUN5.js.map +1 -0
  95. package/dist/chunk-MSYX32PF.cjs +2 -0
  96. package/dist/chunk-MSYX32PF.cjs.map +1 -0
  97. package/dist/chunk-MVZUTETT.js +2 -0
  98. package/dist/chunk-MVZUTETT.js.map +1 -0
  99. package/dist/chunk-N7N7MPMK.cjs +2 -0
  100. package/dist/chunk-N7N7MPMK.cjs.map +1 -0
  101. package/dist/chunk-NGBBNL4K.cjs +1 -3
  102. package/dist/chunk-P6WPEUAJ.cjs +2 -0
  103. package/dist/chunk-P6WPEUAJ.cjs.map +1 -0
  104. package/dist/chunk-PS272DZJ.cjs +2 -0
  105. package/dist/chunk-PS272DZJ.cjs.map +1 -0
  106. package/dist/chunk-QXQE7X4S.js +2 -0
  107. package/dist/chunk-QXQE7X4S.js.map +1 -0
  108. package/dist/chunk-R2ENWQ76.js +2 -0
  109. package/dist/chunk-R2ENWQ76.js.map +1 -0
  110. package/dist/chunk-R2SZFJTT.cjs +2 -0
  111. package/dist/chunk-R2SZFJTT.cjs.map +1 -0
  112. package/dist/chunk-RAF57WYO.js +2 -0
  113. package/dist/chunk-RAF57WYO.js.map +1 -0
  114. package/dist/chunk-RSF25YSJ.js +2 -0
  115. package/dist/chunk-RSF25YSJ.js.map +1 -0
  116. package/dist/chunk-SOMGSIO4.cjs +3 -0
  117. package/dist/chunk-SOMGSIO4.cjs.map +1 -0
  118. package/dist/chunk-SUXRZWH2.cjs +3 -0
  119. package/dist/chunk-SUXRZWH2.cjs.map +1 -0
  120. package/dist/chunk-SYYE3QAX.cjs +2 -0
  121. package/dist/chunk-SYYE3QAX.cjs.map +1 -0
  122. package/dist/chunk-SZGK6RIP.cjs +2 -0
  123. package/dist/chunk-SZGK6RIP.cjs.map +1 -0
  124. package/dist/chunk-TCZSPH4A.js +2 -0
  125. package/dist/chunk-TCZSPH4A.js.map +1 -0
  126. package/dist/chunk-TLG7VZRX.cjs +2 -0
  127. package/dist/chunk-TLG7VZRX.cjs.map +1 -0
  128. package/dist/chunk-TRBXW6HW.js +2 -0
  129. package/dist/{chunk-AQNHHJMJ.cjs.map → chunk-TRBXW6HW.js.map} +1 -1
  130. package/dist/chunk-TTFO4YDP.cjs +2 -0
  131. package/dist/chunk-TTFO4YDP.cjs.map +1 -0
  132. package/dist/chunk-TWC7K3ZX.js +2 -0
  133. package/dist/chunk-TWC7K3ZX.js.map +1 -0
  134. package/dist/chunk-UDQ57ZRX.cjs +2 -0
  135. package/dist/chunk-UDQ57ZRX.cjs.map +1 -0
  136. package/dist/chunk-UI6IFGBT.js +2 -0
  137. package/dist/chunk-UI6IFGBT.js.map +1 -0
  138. package/dist/chunk-UURM7P3P.cjs +4 -0
  139. package/dist/chunk-UURM7P3P.cjs.map +1 -0
  140. package/dist/chunk-W2JAR233.js +2 -0
  141. package/dist/chunk-W2JAR233.js.map +1 -0
  142. package/dist/chunk-WGZ3FNHI.js +2 -0
  143. package/dist/chunk-WGZ3FNHI.js.map +1 -0
  144. package/dist/chunk-WN5CMP4T.cjs +3 -0
  145. package/dist/chunk-WN5CMP4T.cjs.map +1 -0
  146. package/dist/chunk-XEIDV5JP.js +2 -0
  147. package/dist/chunk-XEIDV5JP.js.map +1 -0
  148. package/dist/chunk-XNIWQHXY.js +2 -0
  149. package/dist/chunk-XNIWQHXY.js.map +1 -0
  150. package/dist/chunk-XR7HEC7B.js +5 -0
  151. package/dist/chunk-XR7HEC7B.js.map +1 -0
  152. package/dist/chunk-Y7O4D3BJ.cjs +2 -0
  153. package/dist/chunk-Y7O4D3BJ.cjs.map +1 -0
  154. package/dist/chunk-YAYBVVG2.js +3 -0
  155. package/dist/chunk-YAYBVVG2.js.map +1 -0
  156. package/dist/chunk-YJ2OPULK.js +2 -0
  157. package/dist/chunk-YJ2OPULK.js.map +1 -0
  158. package/dist/chunk-YVKHEAFT.js +2 -0
  159. package/dist/chunk-YVKHEAFT.js.map +1 -0
  160. package/dist/chunk-ZCNBT44X.cjs +2 -0
  161. package/dist/chunk-ZCNBT44X.cjs.map +1 -0
  162. package/dist/chunk-ZLRJ7TDP.cjs +2 -0
  163. package/dist/chunk-ZLRJ7TDP.cjs.map +1 -0
  164. package/dist/constants.cjs +1 -21
  165. package/dist/constants.d.cts +1 -1
  166. package/dist/constants.d.ts +1 -1
  167. package/dist/constants.js +1 -4
  168. package/dist/engine.cjs +1 -94
  169. package/dist/engine.d.cts +10 -11
  170. package/dist/engine.d.ts +10 -11
  171. package/dist/engine.js +1 -37
  172. package/dist/errors.cjs +1 -105
  173. package/dist/errors.d.cts +3 -3
  174. package/dist/errors.d.ts +3 -3
  175. package/dist/errors.js +1 -4
  176. package/dist/format.cjs +1 -26
  177. package/dist/format.d.cts +2 -2
  178. package/dist/format.d.ts +2 -2
  179. package/dist/format.js +1 -9
  180. package/dist/index.cjs +1 -314
  181. package/dist/index.cjs.map +1 -1
  182. package/dist/index.d.cts +52 -20
  183. package/dist/index.d.ts +52 -20
  184. package/dist/index.js +1 -278
  185. package/dist/index.js.map +1 -1
  186. package/dist/language.cjs +1 -369
  187. package/dist/language.cjs.map +1 -1
  188. package/dist/language.d.cts +9 -10
  189. package/dist/language.d.ts +9 -10
  190. package/dist/language.js +1 -348
  191. package/dist/language.js.map +1 -1
  192. package/dist/lexer.cjs +1 -63
  193. package/dist/lexer.js +1 -10
  194. package/dist/normalizer.cjs +1 -39
  195. package/dist/normalizer.js +1 -10
  196. package/dist/packages.cjs +1 -132
  197. package/dist/packages.d.cts +8 -9
  198. package/dist/packages.d.ts +8 -9
  199. package/dist/packages.js +1 -23
  200. package/dist/parser.cjs +1 -54
  201. package/dist/parser.d.cts +8 -8
  202. package/dist/parser.d.ts +8 -8
  203. package/dist/parser.js +1 -9
  204. package/dist/{pipeline-D-PS9gVw.d.ts → pipeline-72QmQlGx.d.ts} +1 -1
  205. package/dist/{pipeline-DtSBJ8TS.d.cts → pipeline-DCQicwWX.d.cts} +1 -1
  206. package/dist/resolvers.cjs +1 -12
  207. package/dist/resolvers.d.cts +2 -2
  208. package/dist/resolvers.d.ts +2 -2
  209. package/dist/resolvers.js +1 -3
  210. package/dist/services.cjs +1 -20
  211. package/dist/services.js +1 -3
  212. package/dist/testing.cjs +3 -477
  213. package/dist/testing.cjs.map +1 -1
  214. package/dist/testing.d.cts +9 -10
  215. package/dist/testing.d.ts +9 -10
  216. package/dist/testing.js +3 -469
  217. package/dist/testing.js.map +1 -1
  218. package/dist/uom.cjs +1 -55
  219. package/dist/uom.d.cts +2 -2
  220. package/dist/uom.d.ts +2 -2
  221. package/dist/uom.js +1 -10
  222. package/dist/utilities.cjs +1 -36
  223. package/dist/utilities.js +1 -7
  224. package/dist/vm.cjs +1 -295
  225. package/dist/vm.cjs.map +1 -1
  226. package/dist/vm.d.cts +22 -10
  227. package/dist/vm.d.ts +22 -10
  228. package/dist/vm.js +1 -193
  229. package/dist/vm.js.map +1 -1
  230. package/dist/worker.cjs +2 -492
  231. package/dist/worker.cjs.map +1 -1
  232. package/dist/worker.d.cts +16 -17
  233. package/dist/worker.d.ts +16 -17
  234. package/dist/worker.js +2 -483
  235. package/dist/worker.js.map +1 -1
  236. package/package.json +1 -13
  237. package/dist/chunk-3BOK2LDK.js +0 -17
  238. package/dist/chunk-3BOK2LDK.js.map +0 -1
  239. package/dist/chunk-3VGDNEE3.js +0 -84
  240. package/dist/chunk-3VGDNEE3.js.map +0 -1
  241. package/dist/chunk-4K5W7EH2.cjs +0 -112
  242. package/dist/chunk-4K5W7EH2.cjs.map +0 -1
  243. package/dist/chunk-5EFKSKMA.js +0 -413
  244. package/dist/chunk-5EFKSKMA.js.map +0 -1
  245. package/dist/chunk-5HRB36DK.js +0 -405
  246. package/dist/chunk-5HRB36DK.js.map +0 -1
  247. package/dist/chunk-5ON7PUAZ.js +0 -12
  248. package/dist/chunk-5ON7PUAZ.js.map +0 -1
  249. package/dist/chunk-7AXJNQMF.cjs +0 -297
  250. package/dist/chunk-7AXJNQMF.cjs.map +0 -1
  251. package/dist/chunk-7JM3F4KL.js +0 -1795
  252. package/dist/chunk-7JM3F4KL.js.map +0 -1
  253. package/dist/chunk-7USV76HV.cjs +0 -341
  254. package/dist/chunk-7USV76HV.cjs.map +0 -1
  255. package/dist/chunk-A2DZ5BEJ.cjs +0 -1930
  256. package/dist/chunk-A2DZ5BEJ.cjs.map +0 -1
  257. package/dist/chunk-ADBA3XBE.cjs +0 -20
  258. package/dist/chunk-ADBA3XBE.cjs.map +0 -1
  259. package/dist/chunk-AKNGX4TZ.cjs +0 -236
  260. package/dist/chunk-AKNGX4TZ.cjs.map +0 -1
  261. package/dist/chunk-ALYRJ72W.cjs +0 -434
  262. package/dist/chunk-ALYRJ72W.cjs.map +0 -1
  263. package/dist/chunk-AMOJYLG2.cjs +0 -1692
  264. package/dist/chunk-AMOJYLG2.cjs.map +0 -1
  265. package/dist/chunk-AOH6UR2L.js +0 -825
  266. package/dist/chunk-AOH6UR2L.js.map +0 -1
  267. package/dist/chunk-AQNHHJMJ.cjs +0 -261
  268. package/dist/chunk-B7LXJ6LC.cjs +0 -36
  269. package/dist/chunk-B7LXJ6LC.cjs.map +0 -1
  270. package/dist/chunk-BESTLPRK.cjs +0 -6919
  271. package/dist/chunk-BESTLPRK.cjs.map +0 -1
  272. package/dist/chunk-BLI4NIQY.js +0 -98
  273. package/dist/chunk-BLI4NIQY.js.map +0 -1
  274. package/dist/chunk-BSPXMGIS.js +0 -455
  275. package/dist/chunk-BSPXMGIS.js.map +0 -1
  276. package/dist/chunk-C2OMO3WN.cjs +0 -2806
  277. package/dist/chunk-C2OMO3WN.cjs.map +0 -1
  278. package/dist/chunk-CSDQMDU2.js +0 -204
  279. package/dist/chunk-CSDQMDU2.js.map +0 -1
  280. package/dist/chunk-EJ3ILXX6.cjs +0 -223
  281. package/dist/chunk-EJ3ILXX6.cjs.map +0 -1
  282. package/dist/chunk-ENRIK36Q.cjs +0 -94
  283. package/dist/chunk-ENRIK36Q.cjs.map +0 -1
  284. package/dist/chunk-F4UB4XIL.js +0 -109
  285. package/dist/chunk-F4UB4XIL.js.map +0 -1
  286. package/dist/chunk-FD5ZZHEU.js +0 -92
  287. package/dist/chunk-FD5ZZHEU.js.map +0 -1
  288. package/dist/chunk-FE4RC37D.js +0 -2801
  289. package/dist/chunk-FE4RC37D.js.map +0 -1
  290. package/dist/chunk-FEAIOR7N.cjs +0 -91
  291. package/dist/chunk-FEAIOR7N.cjs.map +0 -1
  292. package/dist/chunk-FR7RNOPT.cjs +0 -3303
  293. package/dist/chunk-FR7RNOPT.cjs.map +0 -1
  294. package/dist/chunk-G2YPPLGX.cjs +0 -484
  295. package/dist/chunk-G2YPPLGX.cjs.map +0 -1
  296. package/dist/chunk-GCM5JHMX.js +0 -88
  297. package/dist/chunk-GCM5JHMX.js.map +0 -1
  298. package/dist/chunk-GDEU72RG.cjs +0 -829
  299. package/dist/chunk-GDEU72RG.cjs.map +0 -1
  300. package/dist/chunk-HKTQCQ4Z.cjs +0 -8383
  301. package/dist/chunk-HKTQCQ4Z.cjs.map +0 -1
  302. package/dist/chunk-HWHU642X.cjs +0 -316
  303. package/dist/chunk-HWHU642X.cjs.map +0 -1
  304. package/dist/chunk-ICEKS6YC.cjs +0 -507
  305. package/dist/chunk-ICEKS6YC.cjs.map +0 -1
  306. package/dist/chunk-IJGOFP2J.js +0 -6904
  307. package/dist/chunk-IJGOFP2J.js.map +0 -1
  308. package/dist/chunk-IQJGDZOP.js +0 -333
  309. package/dist/chunk-IQJGDZOP.js.map +0 -1
  310. package/dist/chunk-IT74O4BE.cjs +0 -456
  311. package/dist/chunk-IT74O4BE.cjs.map +0 -1
  312. package/dist/chunk-KXDQKVNX.cjs +0 -459
  313. package/dist/chunk-KXDQKVNX.cjs.map +0 -1
  314. package/dist/chunk-L2TE7PMO.cjs +0 -14
  315. package/dist/chunk-L2TE7PMO.cjs.map +0 -1
  316. package/dist/chunk-L5YHV6BQ.js +0 -499
  317. package/dist/chunk-L5YHV6BQ.js.map +0 -1
  318. package/dist/chunk-LO7HU5WB.cjs +0 -209
  319. package/dist/chunk-LO7HU5WB.cjs.map +0 -1
  320. package/dist/chunk-LSALB3IN.js +0 -292
  321. package/dist/chunk-LSALB3IN.js.map +0 -1
  322. package/dist/chunk-MI7OTUHL.cjs +0 -339
  323. package/dist/chunk-MI7OTUHL.cjs.map +0 -1
  324. package/dist/chunk-MIGXCBXT.cjs +0 -381
  325. package/dist/chunk-MIGXCBXT.cjs.map +0 -1
  326. package/dist/chunk-MVTOCRV2.js +0 -213
  327. package/dist/chunk-MVTOCRV2.js.map +0 -1
  328. package/dist/chunk-N7FNVFXW.cjs +0 -32
  329. package/dist/chunk-N7FNVFXW.cjs.map +0 -1
  330. package/dist/chunk-N7OA4WPJ.js +0 -362
  331. package/dist/chunk-N7OA4WPJ.js.map +0 -1
  332. package/dist/chunk-NAWZATKT.js +0 -478
  333. package/dist/chunk-NAWZATKT.js.map +0 -1
  334. package/dist/chunk-NLNDMWZC.js +0 -31
  335. package/dist/chunk-NLNDMWZC.js.map +0 -1
  336. package/dist/chunk-ORM7CHYZ.js +0 -1531
  337. package/dist/chunk-ORM7CHYZ.js.map +0 -1
  338. package/dist/chunk-OUHT5Z36.cjs +0 -393
  339. package/dist/chunk-OUHT5Z36.cjs.map +0 -1
  340. package/dist/chunk-PCZVMMWU.cjs +0 -74
  341. package/dist/chunk-PCZVMMWU.cjs.map +0 -1
  342. package/dist/chunk-RNKDIXDV.js +0 -336
  343. package/dist/chunk-RNKDIXDV.js.map +0 -1
  344. package/dist/chunk-SBUFNJVE.js +0 -258
  345. package/dist/chunk-SBUFNJVE.js.map +0 -1
  346. package/dist/chunk-TC6BTUSU.cjs +0 -1799
  347. package/dist/chunk-TC6BTUSU.cjs.map +0 -1
  348. package/dist/chunk-TPOK3UNI.js +0 -8355
  349. package/dist/chunk-TPOK3UNI.js.map +0 -1
  350. package/dist/chunk-UF6JG5SG.js +0 -312
  351. package/dist/chunk-UF6JG5SG.js.map +0 -1
  352. package/dist/chunk-UKQHXPGW.js +0 -30
  353. package/dist/chunk-UKQHXPGW.js.map +0 -1
  354. package/dist/chunk-V4XG5QF6.js +0 -1685
  355. package/dist/chunk-V4XG5QF6.js.map +0 -1
  356. package/dist/chunk-VEKIWQ3F.cjs +0 -39
  357. package/dist/chunk-VEKIWQ3F.cjs.map +0 -1
  358. package/dist/chunk-WMQRJTAO.js +0 -3266
  359. package/dist/chunk-WMQRJTAO.js.map +0 -1
  360. package/dist/chunk-X6K3HUOY.cjs +0 -86
  361. package/dist/chunk-X6K3HUOY.cjs.map +0 -1
  362. package/dist/chunk-XBTEO4OB.js +0 -391
  363. package/dist/chunk-XBTEO4OB.js.map +0 -1
  364. package/dist/chunk-XIYYHA65.cjs +0 -101
  365. package/dist/chunk-XIYYHA65.cjs.map +0 -1
  366. package/dist/chunk-YJHY7CMN.cjs +0 -1534
  367. package/dist/chunk-YLJ4XMA6.js +0 -33
  368. package/dist/chunk-YLJ4XMA6.js.map +0 -1
  369. package/dist/chunk-YNIWOYW6.js +0 -232
  370. package/dist/chunk-YNIWOYW6.js.map +0 -1
  371. package/dist/chunk-Z2XP767T.cjs +0 -35
  372. package/dist/chunk-Z2XP767T.cjs.map +0 -1
  373. package/dist/chunk-Z4X2RWOF.js +0 -37
  374. package/dist/chunk-Z4X2RWOF.js.map +0 -1
  375. package/dist/chunk-ZN6YYPIW.js +0 -67
  376. package/dist/chunk-ZN6YYPIW.js.map +0 -1
  377. package/dist/chunk-ZNFFTYWH.js +0 -1854
  378. package/dist/chunk-ZNFFTYWH.js.map +0 -1
  379. package/dist/variables.cjs +0 -17
  380. package/dist/variables.cjs.map +0 -1
  381. package/dist/variables.d.cts +0 -87
  382. package/dist/variables.d.ts +0 -87
  383. package/dist/variables.js +0 -4
  384. package/dist/variables.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ 'use strict';var E={NUMBER:"number",BIGINT:"number",FLOAT:"number",STRING:"string",PI:"keyword",E:"keyword",NOW:"keyword",TODAY:"keyword",TOMORROW:"keyword",YESTERDAY:"keyword",ROLL:"keyword",GLOBAL:"keyword",OF:"keyword",DURATION_DAY:"keyword",DURATION_WEEK:"keyword",DURATION_MONTH:"keyword",DURATION_YEAR:"keyword",DURATION_HOUR:"keyword",DURATION_MINUTE:"keyword",DURATION_SECOND:"keyword",NEXT:"keyword",LAST:"keyword",UNTIL:"keyword",SINCE:"keyword",BETWEEN:"keyword",SPLIT:"keyword",SPLIT_WAYS:"keyword",WAYS:"keyword",PEOPLE:"keyword",FROM:"keyword",BEST:"keyword",KEYWORD:"keyword",TRUE:"keyword",FALSE:"keyword",IF:"keyword",THEN:"keyword",ELSE:"keyword",AS:"keyword",CONVERTER_NAME:"keyword",ROUNDED:"keyword",TO_NEAREST:"keyword",DECIMAL_PLACES:"keyword",AVERAGE_OF:"keyword",MEDIAN_OF:"keyword",TOTAL_OF:"keyword",COUNT_OF:"keyword",LARGER_OF:"keyword",SMALLER_OF:"keyword",HALF_OF:"keyword",MIDPOINT_BETWEEN:"keyword",REMAINDER_OF:"keyword",NTH_ROOT:"keyword",LOG_PHRASE:"keyword",LOG_BASE:"keyword",GCD_OF:"keyword",LCM_OF:"keyword",SQUARE_ROOT_OF:"keyword",CUBE_ROOT_OF:"keyword",CLAMP:"keyword",MAP:"keyword",REDUCE:"keyword",SUM_FN:"keyword",PROD_FN:"keyword",EXPAND_FN:"keyword",FACTOR_FN:"keyword",SOLVE_FN:"keyword",DER_FN:"keyword",INTEGRAL_FN:"keyword",TAYLOR_FN:"keyword",JACOBIAN_FN:"keyword",IMAGINARY:"number",CONJ_FN:"keyword",RE_FN:"keyword",IM_FN:"keyword",CANCEL_FN:"keyword",APART_FN:"keyword",TIME_IN:"keyword",DATE_IN:"keyword",TIME_DIFFERENCE_BETWEEN:"keyword",CITY_NAME:"keyword",OVER:"keyword",AFTER:"keyword",PRESENT_VALUE_OF:"keyword",ANNUAL_RETURN_ON:"keyword",FOR_DURATION:"keyword",COMPOUNDING:"keyword",INVESTED:"keyword",RETURNED:"keyword",RATE_AT:"keyword",COMPOUND_INTEREST_ON:"keyword",INTEREST_ON:"keyword",DAILY_REPAYMENT_ON:"keyword",MONTHLY_REPAYMENT_ON:"keyword",ANNUAL_REPAYMENT_ON:"keyword",TOTAL_REPAYMENT_ON:"keyword",DAILY_LOAN_INTEREST_ON:"keyword",MONTHLY_LOAN_INTEREST_ON:"keyword",ANNUAL_LOAN_INTEREST_ON:"keyword",TOTAL_LOAN_INTEREST_ON:"keyword",TAX_ON:"keyword",TAX_OFF:"keyword",TAX_IN_PHRASE:"keyword",IS_TO:"keyword",IS:"keyword",PCT_ON:"operator",PCT_OFF:"operator",PCT_UP:"operator",PCT_DOWN:"operator",OF_WHAT:"keyword",OFF_WHAT:"keyword",ON_WHAT:"keyword",RANDOM_NUMBER:"keyword",WHAT_IS:"keyword",WHAT_WAS:"keyword",VALUE_OF:"keyword",WORTH_IN:"keyword",SAVINGS_HOW_LONG:"keyword",SAVINGS_HOW_MUCH:"keyword",IN_YEAR_DOLLARS:"keyword",INGREDIENT_NAME:"keyword",ASSUMING:"keyword",WORKDAYS_IN:"keyword",WEEKDAY_ON:"keyword",WEEKDAY_IN:"keyword",MONTH_ON:"keyword",MONTH_IN:"keyword",WEEK_ON:"keyword",DAYS_IN_PERIOD:"keyword",IN_TWO_UNITS:"unit",PER_UNIT:"unit",AT_RATE:"keyword",WEEK_IN:"keyword",BETWEEN_UNIT:"keyword",WORKDAYS_AFTER:"keyword",WORKDAYS_BEFORE:"keyword",WORKDAYS_BETWEEN:"keyword",IS_WEEKEND:"keyword",IS_WORKDAY:"keyword",CURRENT_TIMESTAMP:"keyword",TO_DATE:"keyword",TO_TIMESTAMP:"keyword",VIDEO_TIMECODE:"datetime",FRAME_COUNT:"datetime",AT:"keyword",PLUS:"operator",AND_CONJ:"operator",MINUS:"operator",STAR:"operator",SLASH:"operator",PLUS_MINUS:"operator",CARET:"operator",PERCENT:"operator",LSHIFT:"operator",RSHIFT:"operator",EQUALS:"operator",PLUS_EQUALS:"operator",MINUS_EQUALS:"operator",THEREFORE:"operator",INCREASE_BY:"operator",DECREASE_BY:"operator",OF_WHAT_IS:"keyword",ON_WHAT_IS:"keyword",OFF_WHAT_IS:"keyword",TIMES_BY:"operator",MULTIPLY_BY:"operator",DIVIDE_BY:"operator",MOD:"operator",INCREASE:"operator",DECREASE:"operator",UNICODE_MATH:"operator",QUESTION:"operator",BANG:"operator",NEQ:"comparison",IN:"comparison",GTE:"comparison",LTE:"comparison",EQUALITY:"comparison",LT:"comparison",GT:"comparison",LOGICAL_AND:"comparison",LOGICAL_OR:"comparison",OR:"comparison",URSHIFT:"bitwise",BIT_AND:"bitwise",BIT_OR:"bitwise",BIT_NOT:"bitwise",BIT_XOR:"bitwise",FUNC:"function",DOLLAR:"variable",COLON:"variable",IDENT:"variable",UNIT:"unit",CONVERT:"unit",TO:"unit",POUND:"unit",EURO:"unit",YEN:"unit",RUBLE:"unit",WON:"unit",CURRENCY_SYMBOL:"unit",PREV:"keyword",LINE_REF:"keyword",SUM_RANGE_CALL:"keyword",AVERAGE_RANGE_CALL:"keyword",TOTAL_ABOVE:"keyword",SUM_ABOVE:"keyword",AVERAGE_ABOVE:"keyword",GOAL_SEEK:"keyword",HEX_COLOUR:"colour",COLOUR_CALL:"function",DATETIME_LITERAL:"datetime",DURATION:"datetime",VEC2:"vector",VEC3:"vector",VEC4:"vector",LPAREN:"punctuation",RPAREN:"punctuation",LBRACKET:"punctuation",RBRACKET:"punctuation",LBRACE:"punctuation",RBRACE:"punctuation",DOT:"punctuation",COMMA:"punctuation",SEMICOLON:"punctuation",ERROR:"error"},N=new Set(["WS","NEWLINE","EOF","BACKTICK_OPEN","INLINE_SOLVE_START","COMMENT","TAG"]),r=new Map;function T(o,e){r.set(o,e);}function _(o){r.delete(o);}function O(o){return r.get(o)??E[o]}exports.a=N;exports.b=T;exports.c=_;exports.d=O;//# sourceMappingURL=chunk-Y7O4D3BJ.cjs.map
2
+ //# sourceMappingURL=chunk-Y7O4D3BJ.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/language/TokenCategoryMap.ts"],"names":["TOKEN_CATEGORY_MAP","UNCATEGORIZED_TOKEN_TYPES","pluginCategories","registerTokenCategory","tokenType","category","unregisterTokenCategory","getTokenCategory"],"mappings":"aAiBA,IAAMA,CAAAA,CAAoD,CAEzD,MAAA,CAAQ,QAAA,CACR,MAAA,CAAQ,QAAA,CACR,KAAA,CAAO,QAAA,CACP,MAAA,CAAQ,QAAA,CAGR,EAAA,CAAI,SAAA,CACJ,CAAA,CAAG,SAAA,CACH,GAAA,CAAK,SAAA,CACL,KAAA,CAAO,SAAA,CACP,QAAA,CAAU,SAAA,CACV,SAAA,CAAW,SAAA,CACX,IAAA,CAAM,SAAA,CACN,MAAA,CAAQ,SAAA,CACR,EAAA,CAAI,SAAA,CACJ,YAAA,CAAc,SAAA,CACd,aAAA,CAAe,SAAA,CACf,cAAA,CAAgB,SAAA,CAChB,aAAA,CAAe,SAAA,CACf,aAAA,CAAe,SAAA,CACf,eAAA,CAAiB,SAAA,CACjB,eAAA,CAAiB,SAAA,CACjB,IAAA,CAAM,SAAA,CACN,IAAA,CAAM,SAAA,CACN,KAAA,CAAO,SAAA,CACP,KAAA,CAAO,SAAA,CACP,OAAA,CAAS,SAAA,CAGT,KAAA,CAAO,SAAA,CACP,UAAA,CAAY,SAAA,CACZ,IAAA,CAAM,SAAA,CACN,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AwBF,CAAAA,CAAyB,CAChEF,CAAAA,CAAiB,MAAA,CAAOE,CAAS,EAClC,CAWO,SAASG,CAAAA,CAAiBH,CAAAA,CAA8C,CAC9E,OAAOF,CAAAA,CAAiB,GAAA,CAAIE,CAAS,CAAA,EAAKJ,CAAAA,CAAmBI,CAAS,CACvE","file":"chunk-Y7O4D3BJ.cjs","sourcesContent":["import type { TokenCategory } from \"@solve-js/language/TokenCategory\";\n\n/**\n * Static, built-in token-type → semantic-category table.\n *\n * Covers the full `TokenTypes` surface (see Token.ts) so nothing recognized\n * by the lexer's grammar goes uncategorized by omission. Structural/internal\n * token types (WS, NEWLINE, EOF, BACKTICK_OPEN, INLINE_SOLVE_START, COMMENT)\n * are intentionally absent, they're either filtered out before reaching\n * this lookup (see Lexer.getHighlightTokens) or simply have nothing\n * meaningful to highlight. COMMENT specifically: it reaches\n * Lexer.getHighlightTokens() (unlike WS/NEWLINE, filtered earlier), so a\n * future \"give comments their own color\" pass would add a real category\n * here. This is a rendering-scope decision, not a correctness\n * requirement, since COMMENT tokens are already filtered out of the\n * parser's input regardless of how they're highlighted.\n */\nconst TOKEN_CATEGORY_MAP: Record<string, TokenCategory> = {\n\t// Literals\n\tNUMBER: \"number\",\n\tBIGINT: \"number\",\n\tFLOAT: \"number\",\n\tSTRING: \"string\",\n\n\t// Keywords (constants, date words, dice, misc grammar keywords)\n\tPI: \"keyword\",\n\tE: \"keyword\",\n\tNOW: \"keyword\",\n\tTODAY: \"keyword\",\n\tTOMORROW: \"keyword\",\n\tYESTERDAY: \"keyword\",\n\tROLL: \"keyword\",\n\tGLOBAL: \"keyword\",\n\tOF: \"keyword\",\n\tDURATION_DAY: \"keyword\",\n\tDURATION_WEEK: \"keyword\",\n\tDURATION_MONTH: \"keyword\",\n\tDURATION_YEAR: \"keyword\",\n\tDURATION_HOUR: \"keyword\",\n\tDURATION_MINUTE: \"keyword\",\n\tDURATION_SECOND: \"keyword\",\n\tNEXT: \"keyword\",\n\tLAST: \"keyword\",\n\tUNTIL: \"keyword\",\n\tSINCE: \"keyword\",\n\tBETWEEN: \"keyword\",\n\t// Bill split (finance): the split verb, its two spellings, and the trailing\n\t// words the normalizer retypes only inside the full split shape.\n\tSPLIT: \"keyword\",\n\tSPLIT_WAYS: \"keyword\",\n\tWAYS: \"keyword\",\n\tPEOPLE: \"keyword\",\n\tFROM: \"keyword\",\n\tBEST: \"keyword\",\n\tKEYWORD: \"keyword\",\n\tTRUE: \"keyword\",\n\tFALSE: \"keyword\",\n\tIF: \"keyword\",\n\tTHEN: \"keyword\",\n\tELSE: \"keyword\",\n\tAS: \"keyword\",\n\tCONVERTER_NAME: \"keyword\",\n\tROUNDED: \"keyword\",\n\tTO_NEAREST: \"keyword\",\n\tDECIMAL_PLACES: \"keyword\",\n\tAVERAGE_OF: \"keyword\",\n\tMEDIAN_OF: \"keyword\",\n\tTOTAL_OF: \"keyword\",\n\tCOUNT_OF: \"keyword\",\n\tLARGER_OF: \"keyword\",\n\tSMALLER_OF: \"keyword\",\n\tHALF_OF: \"keyword\",\n\tMIDPOINT_BETWEEN: \"keyword\",\n\tREMAINDER_OF: \"keyword\",\n\tNTH_ROOT: \"keyword\",\n\tLOG_PHRASE: \"keyword\",\n\tLOG_BASE: \"keyword\",\n\tGCD_OF: \"keyword\",\n\tLCM_OF: \"keyword\",\n\tSQUARE_ROOT_OF: \"keyword\",\n\tCUBE_ROOT_OF: \"keyword\",\n\tCLAMP: \"keyword\",\n\tMAP: \"keyword\",\n\tREDUCE: \"keyword\",\n\tSUM_FN: \"keyword\",\n\tPROD_FN: \"keyword\",\n\t// Symbolic algebra verbs (packages/symbolic/). Declared here alongside\n\t// map/reduce rather than only on the package descriptor, so highlighting is\n\t// correct without depending on registration order.\n\tEXPAND_FN: \"keyword\",\n\tFACTOR_FN: \"keyword\",\n\tSOLVE_FN: \"keyword\",\n\tDER_FN: \"keyword\",\n\tINTEGRAL_FN: \"keyword\",\n\tTAYLOR_FN: \"keyword\",\n\tJACOBIAN_FN: \"keyword\",\n\tIMAGINARY: \"number\",\n\tCONJ_FN: \"keyword\",\n\tRE_FN: \"keyword\",\n\tIM_FN: \"keyword\",\n\tCANCEL_FN: \"keyword\",\n\tAPART_FN: \"keyword\",\n\tTIME_IN: \"keyword\",\n\tDATE_IN: \"keyword\",\n\tTIME_DIFFERENCE_BETWEEN: \"keyword\",\n\tCITY_NAME: \"keyword\",\n\tOVER: \"keyword\",\n\t// The investment grammar's connectives (packages/finance/).\n\tAFTER: \"keyword\",\n\tPRESENT_VALUE_OF: \"keyword\",\n\tANNUAL_RETURN_ON: \"keyword\",\n\tFOR_DURATION: \"keyword\",\n\tCOMPOUNDING: \"keyword\",\n\tINVESTED: \"keyword\",\n\tRETURNED: \"keyword\",\n\tRATE_AT: \"keyword\",\n\tCOMPOUND_INTEREST_ON: \"keyword\",\n\tINTEREST_ON: \"keyword\",\n\tDAILY_REPAYMENT_ON: \"keyword\",\n\tMONTHLY_REPAYMENT_ON: \"keyword\",\n\tANNUAL_REPAYMENT_ON: \"keyword\",\n\tTOTAL_REPAYMENT_ON: \"keyword\",\n\tDAILY_LOAN_INTEREST_ON: \"keyword\",\n\tMONTHLY_LOAN_INTEREST_ON: \"keyword\",\n\tANNUAL_LOAN_INTEREST_ON: \"keyword\",\n\tTOTAL_LOAN_INTEREST_ON: \"keyword\",\n\tTAX_ON: \"keyword\",\n\tTAX_OFF: \"keyword\",\n\tTAX_IN_PHRASE: \"keyword\",\n\tIS_TO: \"keyword\",\n\tIS: \"keyword\",\n\tPCT_ON: \"operator\",\n\tPCT_OFF: \"operator\",\n\tPCT_UP: \"operator\",\n\tPCT_DOWN: \"operator\",\n\tOF_WHAT: \"keyword\",\n\tOFF_WHAT: \"keyword\",\n\tON_WHAT: \"keyword\",\n\tRANDOM_NUMBER: \"keyword\",\n\tWHAT_IS: \"keyword\",\n\tWHAT_WAS: \"keyword\",\n\tVALUE_OF: \"keyword\",\n\tWORTH_IN: \"keyword\",\n\tSAVINGS_HOW_LONG: \"keyword\",\n\tSAVINGS_HOW_MUCH: \"keyword\",\n\tIN_YEAR_DOLLARS: \"keyword\",\n\tINGREDIENT_NAME: \"keyword\",\n\tASSUMING: \"keyword\",\n\t// Datetime, workdays/weekdays/timestamps (packages/datetime/); Time\n\t// video timecode (packages/time/). See Token.ts's TokenTypes doc\n\t// comments for why each is a fused phrase/sequence token rather than a\n\t// bare keyword.\n\tWORKDAYS_IN: \"keyword\",\n\tWEEKDAY_ON: \"keyword\",\n\tWEEKDAY_IN: \"keyword\",\n\tMONTH_ON: \"keyword\",\n\tMONTH_IN: \"keyword\",\n\tWEEK_ON: \"keyword\",\n\tDAYS_IN_PERIOD: \"keyword\",\n\tIN_TWO_UNITS: \"unit\",\n\tPER_UNIT: \"unit\",\n\tAT_RATE: \"keyword\",\n\tWEEK_IN: \"keyword\",\n\tBETWEEN_UNIT: \"keyword\",\n\tWORKDAYS_AFTER: \"keyword\",\n\tWORKDAYS_BEFORE: \"keyword\",\n\tWORKDAYS_BETWEEN: \"keyword\",\n\tIS_WEEKEND: \"keyword\",\n\tIS_WORKDAY: \"keyword\",\n\tCURRENT_TIMESTAMP: \"keyword\",\n\tTO_DATE: \"keyword\",\n\tTO_TIMESTAMP: \"keyword\",\n\tVIDEO_TIMECODE: \"datetime\",\n\tFRAME_COUNT: \"datetime\",\n\tAT: \"keyword\",\n\n\t// Arithmetic / assignment-style operators\n\tPLUS: \"operator\",\n\t// The word \"and\". An operator rather than a keyword: it adds, and syntax\n\t// highlighting that painted it as a keyword would make \"5 and 3\" look\n\t// structurally different from \"5 + 3\" when the two mean the same thing.\n\tAND_CONJ: \"operator\",\n\tMINUS: \"operator\",\n\tSTAR: \"operator\",\n\tSLASH: \"operator\",\n\t// `±` / `+/-`, the uncertainty operator (packages/uncertainty/). A core\n\t// lexer token, so its category lives in the built-in map alongside the other\n\t// operators rather than being registered by the package.\n\tPLUS_MINUS: \"operator\",\n\tCARET: \"operator\",\n\tPERCENT: \"operator\",\n\tLSHIFT: \"operator\",\n\tRSHIFT: \"operator\",\n\tEQUALS: \"operator\",\n\tPLUS_EQUALS: \"operator\",\n\tMINUS_EQUALS: \"operator\",\n\tTHEREFORE: \"operator\",\n\tINCREASE_BY: \"operator\",\n\tDECREASE_BY: \"operator\",\n\tOF_WHAT_IS: \"keyword\",\n\tON_WHAT_IS: \"keyword\",\n\tOFF_WHAT_IS: \"keyword\",\n\tTIMES_BY: \"operator\",\n\tMULTIPLY_BY: \"operator\",\n\tDIVIDE_BY: \"operator\",\n\tMOD: \"operator\",\n\tINCREASE: \"operator\",\n\tDECREASE: \"operator\",\n\tUNICODE_MATH: \"operator\",\n\tQUESTION: \"operator\",\n\tBANG: \"operator\",\n\n\t// Comparison operators\n\tNEQ: \"comparison\",\n\tIN: \"comparison\",\n\tGTE: \"comparison\",\n\tLTE: \"comparison\",\n\tEQUALITY: \"comparison\",\n\tLT: \"comparison\",\n\tGT: \"comparison\",\n\tLOGICAL_AND: \"comparison\",\n\tLOGICAL_OR: \"comparison\",\n\tOR: \"comparison\",\n\n\t// Bitwise operators\n\tURSHIFT: \"bitwise\",\n\tBIT_AND: \"bitwise\",\n\tBIT_OR: \"bitwise\",\n\tBIT_NOT: \"bitwise\",\n\tBIT_XOR: \"bitwise\",\n\n\t// Functions\n\tFUNC: \"function\",\n\n\t// Variable references/definitions, DOLLAR/COLON are the sigils, IDENT is\n\t// a bare identifier reference. All three are recognized-by-the-grammar\n\t// variable syntax at LEX time, independent of whether the variable turns\n\t// out to be defined at eval time (that's a separate, later concern).\n\tDOLLAR: \"variable\",\n\tCOLON: \"variable\",\n\tIDENT: \"variable\",\n\n\t// Units / conversions / currency symbols\n\tUNIT: \"unit\",\n\tCONVERT: \"unit\",\n\tTO: \"unit\",\n\tPOUND: \"unit\",\n\tEURO: \"unit\",\n\tYEN: \"unit\",\n\tRUBLE: \"unit\",\n\tWON: \"unit\",\n\tCURRENCY_SYMBOL: \"unit\",\n\n\t// Cross-line data access (packages/lines/)\n\tPREV: \"keyword\",\n\tLINE_REF: \"keyword\",\n\tSUM_RANGE_CALL: \"keyword\",\n\tAVERAGE_RANGE_CALL: \"keyword\",\n\tTOTAL_ABOVE: \"keyword\",\n\tSUM_ABOVE: \"keyword\",\n\tAVERAGE_ABOVE: \"keyword\",\n\n\t// Goal seek (packages/goalseek/)\n\tGOAL_SEEK: \"keyword\",\n\n\t// Colour (packages/colour/). HEX_COLOUR gets its own \"colour\" category so a\n\t// host can render an inline swatch on the literal; the call token highlights\n\t// like any function.\n\tHEX_COLOUR: \"colour\",\n\tCOLOUR_CALL: \"function\",\n\n\t// Datetime literals/durations\n\tDATETIME_LITERAL: \"datetime\",\n\tDURATION: \"datetime\",\n\n\t// Vectors\n\tVEC2: \"vector\",\n\tVEC3: \"vector\",\n\tVEC4: \"vector\",\n\n\t// Punctuation, grouping/separators, deliberately neutral/muted rather\n\t// than left uncategorized: they're still recognized grammar, just not\n\t// semantically interesting enough to earn a \"loud\" color.\n\tLPAREN: \"punctuation\",\n\tRPAREN: \"punctuation\",\n\tLBRACKET: \"punctuation\",\n\tRBRACKET: \"punctuation\",\n\tLBRACE: \"punctuation\",\n\tRBRACE: \"punctuation\",\n\tDOT: \"punctuation\",\n\tCOMMA: \"punctuation\",\n\tSEMICOLON: \"punctuation\",\n\n\t// Errors\n\tERROR: \"error\",\n};\n\n/**\n * Token types intentionally left uncategorized, either purely structural\n * (never meant to be visibly styled) or already filtered out upstream\n * before reaching a category lookup. Used only by the completeness test to\n * distinguish \"deliberately unstyled\" from \"forgotten.\"\n */\nexport const UNCATEGORIZED_TOKEN_TYPES: ReadonlySet<string> = new Set([\n\t\"WS\",\n\t\"NEWLINE\",\n\t\"EOF\",\n\t\"BACKTICK_OPEN\",\n\t\"INLINE_SOLVE_START\",\n\t\"COMMENT\",\n\t// A mid-line `#tag` reaches the highlight stream like COMMENT but has no\n\t// evaluation role of its own (it is stripped or folded into an aggregate),\n\t// so it is deliberately unstyled rather than categorised.\n\t\"TAG\",\n]);\n\n/**\n * Runtime registry for package-contributed categories (e.g. a plugin's\n * custom token types). Overrides/extends the static table above, never\n * replaces it, so a package can't accidentally break core highlighting.\n * Register/unregister symmetry mirrors this codebase's other pluggable\n * registries (e.g. sharedOpRegistry). See ExpressionEngine.registerPackage\n * / unregisterPackage, which call these on behalf of IEnginePackage.tokenCategories.\n */\nconst pluginCategories = new Map<string, TokenCategory>();\n\n/**\n * Map a token type to a highlighting category.\n *\n * @param tokenType - Token type a package registered.\n * @param category - Category deciding how an editor colours it.\n */\nexport function registerTokenCategory(tokenType: string, category: TokenCategory): void {\n\tpluginCategories.set(tokenType, category);\n}\n\n/**\n * Remove a token type's highlighting category.\n *\n * @param tokenType - Token type to forget. Unknown types are ignored.\n */\nexport function unregisterTokenCategory(tokenType: string): void {\n\tpluginCategories.delete(tokenType);\n}\n\n/**\n * Resolve a token type to its semantic category, checking plugin-contributed\n * categories first (so a plugin could theoretically re-categorize a builtin\n * token type, though in practice plugins only ever add categories for their\n * own new types).\n *\n * @returns The category, or `undefined` if the token type has no category\n * the signal to a UI adapter that this token should render unstyled.\n */\nexport function getTokenCategory(tokenType: string): TokenCategory | undefined {\n\treturn pluginCategories.get(tokenType) ?? TOKEN_CATEGORY_MAP[tokenType];\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import {a}from'./chunk-HFKDWQUL.js';import {c}from'./chunk-MPB7KUN5.js';var T=new Set(["AED","AFN","ALL","AMD","ANG","AOA","ARS","AUD","AWG","AZN","BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB","BOV","BRL","BSD","BTN","BWP","BYN","BZD","CAD","CDF","CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP","ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP","GMD","GNF","GTQ","GYD","HKD","HNL","HTG","HUF","IDR","ILS","INR","IQD","IRR","ISK","JMD","JOD","JPY","KES","KGS","KHR","KMF","KPW","KRW","KWD","KYD","KZT","LAK","LBP","LKR","LRD","LSL","LYD","MAD","MDL","MGA","MKD","MMK","MNT","MOP","MRU","MUR","MVR","MWK","MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR","NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG","QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG","SEK","SGD","SHP","SLE","SOS","SRD","SSP","STN","SVC","SYP","SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD","TZS","UAH","UGX","USD","USN","UYI","UYU","UYW","UZS","VED","VES","VND","VUV","WST","XAF","XCD","XCG","XOF","XPF","YER","ZAR","ZMW","ZWG"]);function N(O){return T.has(O.toUpperCase())}var d={API_ERROR:"CURRENCY_API_ERROR",UNKNOWN_CODE:"UNKNOWN_CURRENCY_CODE",CRYPTO_API_ERROR:"CRYPTO_PRICE_API_ERROR"},o=class o{constructor(){this.baseTables=new Map;}isCryptoCode(t){return t.toUpperCase()in o.CRYPTO_IDS}async getRate(t,e,r){let n=t.toUpperCase(),s=e.toUpperCase();if(this.isCryptoCode(n)||this.isCryptoCode(s))return this.getCryptoRate(n,s,r);let{signal:C,cleanup:l}=a(r,o.FETCH_TIMEOUT_MS,"Currency API fetch");try{let a=await fetch(`https://api.frankfurter.dev/v2/rates?base=${n}`,{signal:C});if(!a.ok)throw c.external(d.API_ERROR,`Currency API returned ${a.status}`,{status:a.status});let i=await a.json(),c$1=Array.isArray(i)?Object.fromEntries(i.filter(R=>{if(typeof R!="object"||R===null)return !1;let u=R;return typeof u.quote=="string"&&typeof u.rate=="number"}).map(R=>[R.quote.toUpperCase(),R.rate])):i.rates??{};if(c$1[s]===void 0)throw c.validation(d.UNKNOWN_CODE,`Unknown currency: ${s}`,{code:s});return this.baseTables.set(n,{fetchedAt:Date.now(),rates:{...c$1,[n]:1}}),c$1[s]}finally{l();}}async getCryptoRate(t,e,r){let{signal:n,cleanup:s}=a(r,o.FETCH_TIMEOUT_MS,"Crypto price API fetch");try{let C=this.isCryptoCode(t),l=this.isCryptoCode(e),a;if(C&&l){let i=o.CRYPTO_IDS[t],c$1=o.CRYPTO_IDS[e],R=await this.fetchCoinGeckoPrices([i,c$1],"usd",n),u=R[i]?.usd,P=R[c$1]?.usd;if(typeof u!="number")throw c.validation(d.UNKNOWN_CODE,`Unknown currency: ${t}`,{code:t});if(typeof P!="number")throw c.validation(d.UNKNOWN_CODE,`Unknown currency: ${e}`,{code:e});a=u/P;}else if(C){let i=o.CRYPTO_IDS[t],c$1=e.toLowerCase(),u=(await this.fetchCoinGeckoPrices([i],c$1,n))[i]?.[c$1];if(typeof u!="number")throw c.validation(d.UNKNOWN_CODE,`Unknown currency: ${e}`,{code:e});a=u;}else {let i=o.CRYPTO_IDS[e],c$1=t.toLowerCase(),u=(await this.fetchCoinGeckoPrices([i],c$1,n))[i]?.[c$1];if(typeof u!="number")throw c.validation(d.UNKNOWN_CODE,`Unknown currency: ${t}`,{code:t});a=1/u;}return this.baseTables.set(t,{fetchedAt:Date.now(),rates:{[t]:1,[e]:a}}),a}finally{s();}}async fetchCoinGeckoPrices(t,e,r){let n=`https://api.coingecko.com/api/v3/simple/price?ids=${t.join(",")}&vs_currencies=${e}`,s=await fetch(n,{signal:r});if(!s.ok)throw c.external(d.CRYPTO_API_ERROR,`Crypto price API returned ${s.status}`,{status:s.status});return s.json()}primeRates(t,e){let r=t.toUpperCase();this.baseTables.set(r,{fetchedAt:Date.now(),rates:{...e,[r]:1}});}clearRates(){this.baseTables.clear();}getRateSync(t,e){let r=t.toUpperCase(),n=e.toUpperCase();if(r===n)return 1;let s=Date.now();for(let C of this.baseTables.values()){if(s-C.fetchedAt>o.RATE_FRESHNESS_MS)continue;let l=C.rates[r],a=C.rates[n];if(l&&a)return a/l}return null}async convert(t,e,r){let n=await this.getRate(e,r);return t*n}getAllRates(){let t=Date.now(),e={},r=false;for(let[n,s]of this.baseTables)if(!(t-s.fetchedAt>o.RATE_FRESHNESS_MS))for(let[C,l]of Object.entries(s.rates))e[`${n}:${C}`]=l,r=true;return r?e:null}hasRates(){return this.getAllRates()!==null}convertSync(t,e,r){let n=this.getRateSync(e,r);return n===null?null:t*n}isCurrency(t){return N(t)||this.isCryptoCode(t)}};o.RATE_FRESHNESS_MS=900*1e3,o.CRYPTO_IDS={BTC:"bitcoin",ETH:"ethereum",SOL:"solana",XRP:"ripple",ADA:"cardano",DOGE:"dogecoin",DOT:"polkadot"},o.FETCH_TIMEOUT_MS=1e4;var f=o,b=new f,h=b;
2
+ export{f as a,b,h as c};//# sourceMappingURL=chunk-YAYBVVG2.js.map
3
+ //# sourceMappingURL=chunk-YAYBVVG2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/uom/Iso4217.ts","../src/uom/CurrencyExchange.ts"],"names":["ISO_4217_CODES","isIso4217","code","CurrencyErrorCodes","_CurrencyExchangeService","from","to","signal","fromUpper","toUpper","fetchSignal","cleanup","createTimeoutSignal","response","ErrorFactory","data","rates","entry","candidate","fromIsCrypto","toIsCrypto","rate","fromId","toId","fromUsd","toUsd","vs","value","priceOfToInFrom","ids","vsCurrency","url","base","baseUpper","now","table","fromRate","toRate","snapshot","any","CurrencyExchangeService","currencyExchangeService","sharedCurrencyExchange"],"mappings":"wEAyBO,IAAMA,CAAAA,CAAsC,IAAI,GAAA,CAAI,CAC1D,KAAA,CAAO,MAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,MAAO,KAAA,CAC/D,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,MAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAC/D,KAAA,CAAO,KAAA,CAAO,MAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CACnC,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,MAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAAO,KAAA,CAC/D,MAAO,KAAA,CA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SaE,CAAAA,CAiBa,iBAAA,CAAoB,GAAA,CAAU,GAAA,CAjB3CA,EA4Ba,UAAA,CAAqC,CAC3D,GAAA,CAAK,SAAA,CAAW,GAAA,CAAK,UAAA,CAAY,IAAK,QAAA,CAAU,GAAA,CAAK,QAAA,CACrD,GAAA,CAAK,SAAA,CAAW,IAAA,CAAM,WAAY,GAAA,CAAK,UACzC,CAAA,CA/BWA,CAAAA,CAkDa,gBAAA,CAAmB,GAAA,CAlDtC,IAAMoC,CAAAA,CAANpC,CAAAA,CAsTMqC,CAAAA,CAA0B,IAAID,CAAAA,CAI9BE,CAAAA,CAAyBD","file":"chunk-YAYBVVG2.js","sourcesContent":["/**\n * Every active ISO 4217 currency code.\n *\n * This exists because `CurrencyExchange.isCurrency()` used to hold a\n * hand-written list of forty-six codes, and a code missing from it did not\n * error: `$100 in UAH` returned the original hundred dollars, unconverted, as\n * though the rate were 1. A wrong answer, not a missing feature.\n *\n * The list is the ISO 4217 active set, so \"is this a currency\" is answered by\n * the standard rather than by whichever codes happened to get added. Whether a\n * *rate* is available for one is a separate question, answered at resolution\n * time by whatever the exchange provider supports; conflating the two is what\n * produced the silent failure.\n *\n * Deliberately excluded:\n * - The historical/withdrawn codes (DEM, FRF, and the rest). They are not\n * active, no provider quotes them, and recognising them would only move the\n * failure later.\n * - The X-series non-currencies: XAU/XAG/XPT/XPD (metals), XDR (IMF special\n * drawing rights), XTS (reserved for testing) and XXX (explicitly \"no\n * currency\"). XXX in particular must never resolve.\n *\n * Cryptocurrencies are not here either. They are not ISO 4217 and are tracked\n * separately in `CurrencyExchangeService.CRYPTO_IDS`.\n */\nexport const ISO_4217_CODES: ReadonlySet<string> = new Set([\n\t\"AED\", \"AFN\", \"ALL\", \"AMD\", \"ANG\", \"AOA\", \"ARS\", \"AUD\", \"AWG\", \"AZN\",\n\t\"BAM\", \"BBD\", \"BDT\", \"BGN\", \"BHD\", \"BIF\", \"BMD\", \"BND\", \"BOB\", \"BOV\",\n\t\"BRL\", \"BSD\", \"BTN\", \"BWP\", \"BYN\", \"BZD\",\n\t\"CAD\", \"CDF\", \"CHE\", \"CHF\", \"CHW\", \"CLF\", \"CLP\", \"CNY\", \"COP\", \"COU\",\n\t\"CRC\", \"CUP\", \"CVE\", \"CZK\",\n\t\"DJF\", \"DKK\", \"DOP\", \"DZD\",\n\t\"EGP\", \"ERN\", \"ETB\", \"EUR\",\n\t\"FJD\", \"FKP\",\n\t\"GBP\", \"GEL\", \"GHS\", \"GIP\", \"GMD\", \"GNF\", \"GTQ\", \"GYD\",\n\t\"HKD\", \"HNL\", \"HTG\", \"HUF\",\n\t\"IDR\", \"ILS\", \"INR\", \"IQD\", \"IRR\", \"ISK\",\n\t\"JMD\", \"JOD\", \"JPY\",\n\t\"KES\", \"KGS\", \"KHR\", \"KMF\", \"KPW\", \"KRW\", \"KWD\", \"KYD\", \"KZT\",\n\t\"LAK\", \"LBP\", \"LKR\", \"LRD\", \"LSL\", \"LYD\",\n\t\"MAD\", \"MDL\", \"MGA\", \"MKD\", \"MMK\", \"MNT\", \"MOP\", \"MRU\", \"MUR\", \"MVR\",\n\t\"MWK\", \"MXN\", \"MXV\", \"MYR\", \"MZN\",\n\t\"NAD\", \"NGN\", \"NIO\", \"NOK\", \"NPR\", \"NZD\",\n\t\"OMR\",\n\t\"PAB\", \"PEN\", \"PGK\", \"PHP\", \"PKR\", \"PLN\", \"PYG\",\n\t\"QAR\",\n\t\"RON\", \"RSD\", \"RUB\", \"RWF\",\n\t\"SAR\", \"SBD\", \"SCR\", \"SDG\", \"SEK\", \"SGD\", \"SHP\", \"SLE\", \"SOS\", \"SRD\",\n\t\"SSP\", \"STN\", \"SVC\", \"SYP\", \"SZL\",\n\t\"THB\", \"TJS\", \"TMT\", \"TND\", \"TOP\", \"TRY\", \"TTD\", \"TWD\", \"TZS\",\n\t\"UAH\", \"UGX\", \"USD\", \"USN\", \"UYI\", \"UYU\", \"UYW\", \"UZS\",\n\t\"VED\", \"VES\", \"VND\", \"VUV\",\n\t\"WST\",\n\t\"XAF\", \"XCD\", \"XCG\", \"XOF\", \"XPF\",\n\t\"YER\",\n\t\"ZAR\", \"ZMW\", \"ZWG\",\n]);\n\n/**\n * Whether `code` is an active ISO 4217 currency code.\n *\n * @param code - A three-letter code, in any case.\n */\nexport function isIso4217(code: string): boolean {\n\treturn ISO_4217_CODES.has(code.toUpperCase());\n}\n","/**\n * Production-grade currency exchange service with scalable architecture\n * Integrates with DataQueryService for worker-based execution\n */\n\nimport { isIso4217 } from \"@solve-js/uom/Iso4217\";\nimport { createTimeoutSignal } from \"@solve-js/utilities/TimeoutSignal\";\nimport { ErrorFactory } from \"@solve-js/errors/UnifiedErrorFramework\";\n\n/**\n * Error codes for this service. Co-located rather than unioned into\n * `errors/ErrorCode.ts`'s core catalog (that catalog is scoped to the\n * parser/VM/engine/errors/config/lexer layers, not yet the ~17 domain\n * packages. See that file's module doc for the intended per-package\n * pattern this follows).\n */\nexport const CurrencyErrorCodes = {\n /** Frankfurter's rates endpoint returned a non-OK HTTP status. */\n API_ERROR: \"CURRENCY_API_ERROR\",\n /** A requested currency/crypto code isn't in the fetched rate table, an unrecognized code, not an API failure. */\n UNKNOWN_CODE: \"UNKNOWN_CURRENCY_CODE\",\n /** CoinGecko's simple-price endpoint returned a non-OK HTTP status. */\n CRYPTO_API_ERROR: \"CRYPTO_PRICE_API_ERROR\",\n} as const;\n\n// ============================================================================\n// CURRENCY EXCHANGE SERVICE\n// ============================================================================\n\n/**\n * Caches exchange rates fetched from an external source.\n *\n * Rates are global market data rather than per-engine configuration, which is\n * why one instance is shared. Two engines with private copies would fetch the\n * same endpoint twice and could disagree about one pair at one moment. See\n * `engine/EngineContext.ts`.\n */\nexport class CurrencyExchangeService {\n /**\n * Live rate tables cached from successful getRate() fetches, keyed by\n * uppercase base currency. Each table holds every rate the API returned\n * for that base (plus the base itself at 1), so any pair whose two codes\n * appear in one fresh table can be served synchronously, including\n * cross pairs via triangulation (EUR→GBP through a USD-base table).\n * Stale tables are ignored, not evicted; the next successful fetch for\n * the same base overwrites them.\n */\n private baseTables: Map<string, { fetchedAt: number; rates: Record<string, number> }> = new Map();\n\n /**\n * How long a fetched rate may be served synchronously by getRateSync().\n * Beyond this window callers fall through to the async path (expression\n * shows Pending until the fetch lands).\n */\n private static readonly RATE_FRESHNESS_MS = 15 * 60 * 1000;\n\n /**\n * Ticker → CoinGecko coin id, for the cryptocurrencies `isCurrency()`\n * recognizes. Frankfurter (the fiat rate source below) is ECB reference\n * rates only and has no concept of BTC/ETH/etc, routing a crypto code\n * through it as `base=BTC` fails outright, which is why crypto pairs\n * previously never resolved (see CurrencyAsyncResolver/VM.ts's ADD\n * handling for the two bugs that let that failure pass silently instead\n * of surfacing as a real fetch).\n */\n private static readonly CRYPTO_IDS: Record<string, string> = {\n BTC: \"bitcoin\", ETH: \"ethereum\", SOL: \"solana\", XRP: \"ripple\",\n ADA: \"cardano\", DOGE: \"dogecoin\", DOT: \"polkadot\",\n };\n\n private isCryptoCode(code: string): boolean {\n return code.toUpperCase() in CurrencyExchangeService.CRYPTO_IDS;\n }\n\n constructor() {}\n\n // ------------------------------------------------------------------------\n // RATE FETCHING\n // ------------------------------------------------------------------------\n\n /**\n * Timeout (ms) for currency exchange rate fetches.\n *\n * If the frankfurter API doesn't respond within this window, the fetch\n * is aborted, preventing indefinite \"Pending\" states in the playground\n * and Obsidian plugin when the exchange rate API is unreachable.\n */\n private static readonly FETCH_TIMEOUT_MS = 10_000;\n\n /**\n * Fetch the live exchange rate for converting 1 unit of `from` into `to`.\n *\n * Routes cryptocurrency codes (see {@link CRYPTO_IDS}) to CoinGecko and\n * everything else to Frankfurter (ECB reference rates, fiat-only). On\n * success, caches the whole returned rate table for `from` so subsequent\n * lookups, including cross-pairs via triangulation, can be served\n * synchronously by {@link getRateSync} within the freshness window.\n *\n * @throws If the currency code is unrecognized or the fetch fails/times out.\n */\n async getRate(from: string, to: string, signal?: AbortSignal): Promise<number> {\n const fromUpper = from.toUpperCase();\n const toUpper = to.toUpperCase();\n\n if (this.isCryptoCode(fromUpper) || this.isCryptoCode(toUpper)) {\n return this.getCryptoRate(fromUpper, toUpper, signal);\n }\n\n // Combine the caller's optional abort signal with a hard timeout so a\n // hanging currency API never blocks re-evaluation indefinitely.\n const { signal: fetchSignal, cleanup } = createTimeoutSignal(\n signal,\n CurrencyExchangeService.FETCH_TIMEOUT_MS,\n \"Currency API fetch\",\n );\n\n try {\n const response = await fetch(`https://api.frankfurter.dev/v2/rates?base=${fromUpper}`, { signal: fetchSignal });\n if (!response.ok) throw ErrorFactory.external(CurrencyErrorCodes.API_ERROR, `Currency API returned ${response.status}`, { status: response.status });\n const data = await response.json();\n // The v2 endpoint returns a flat array of { date, base, quote, rate }\n // entries (one per target currency) rather than the classic v1 shape\n // { base, date, rates: { CODE: rate } }. Reading data.rates against\n // the real response is always undefined, so every conversion used to\n // throw \"Unknown currency\" no matter which currencies were requested.\n // Accept both shapes so a future API revision back to the object form\n // doesn't silently break this again.\n const rates: Record<string, number> = Array.isArray(data)\n ? Object.fromEntries(\n data\n .filter((entry: unknown): entry is { quote: string; rate: number } => {\n if (typeof entry !== \"object\" || entry === null) return false;\n const candidate = entry as { quote?: unknown; rate?: unknown };\n return typeof candidate.quote === \"string\" && typeof candidate.rate === \"number\";\n })\n .map((entry: { quote: string; rate: number }) => [entry.quote.toUpperCase(), entry.rate])\n )\n : (data.rates ?? {});\n if (rates[toUpper] === undefined) throw ErrorFactory.validation(CurrencyErrorCodes.UNKNOWN_CODE, `Unknown currency: ${toUpper}`, { code: toUpper });\n\n // The API returns ALL rates for the base currency, cache the whole\n // table so subsequent conversions (including cross pairs via\n // triangulation) resolve synchronously within the freshness window\n // instead of going Pending again.\n this.baseTables.set(fromUpper, {\n fetchedAt: Date.now(),\n rates: { ...rates, [fromUpper]: 1 },\n });\n\n return rates[toUpper];\n } finally {\n cleanup();\n }\n }\n\n /**\n * Crypto rate fetch, routed through CoinGecko's no-auth simple-price\n * endpoint instead of Frankfurter (fiat-only, has no BTC/ETH concept).\n * Handles all three combinations, crypto→crypto, crypto→fiat\n * fiat→crypto, via prices denominated in USD (or the target fiat\n * directly, which CoinGecko's `vs_currencies` also accepts), then\n * caches the result as a same-shaped base table so getRateSync /\n * convertSync keep working unchanged for crypto pairs too.\n */\n private async getCryptoRate(fromUpper: string, toUpper: string, signal?: AbortSignal): Promise<number> {\n const { signal: fetchSignal, cleanup } = createTimeoutSignal(\n signal,\n CurrencyExchangeService.FETCH_TIMEOUT_MS,\n \"Crypto price API fetch\",\n );\n\n try {\n const fromIsCrypto = this.isCryptoCode(fromUpper);\n const toIsCrypto = this.isCryptoCode(toUpper);\n let rate: number;\n\n if (fromIsCrypto && toIsCrypto) {\n const fromId = CurrencyExchangeService.CRYPTO_IDS[fromUpper];\n const toId = CurrencyExchangeService.CRYPTO_IDS[toUpper];\n const data = await this.fetchCoinGeckoPrices([fromId, toId], \"usd\", fetchSignal);\n const fromUsd = data[fromId]?.usd;\n const toUsd = data[toId]?.usd;\n if (typeof fromUsd !== \"number\") throw ErrorFactory.validation(CurrencyErrorCodes.UNKNOWN_CODE, `Unknown currency: ${fromUpper}`, { code: fromUpper });\n if (typeof toUsd !== \"number\") throw ErrorFactory.validation(CurrencyErrorCodes.UNKNOWN_CODE, `Unknown currency: ${toUpper}`, { code: toUpper });\n rate = fromUsd / toUsd;\n } else if (fromIsCrypto) {\n const fromId = CurrencyExchangeService.CRYPTO_IDS[fromUpper];\n const vs = toUpper.toLowerCase();\n const data = await this.fetchCoinGeckoPrices([fromId], vs, fetchSignal);\n const value = data[fromId]?.[vs];\n if (typeof value !== \"number\") throw ErrorFactory.validation(CurrencyErrorCodes.UNKNOWN_CODE, `Unknown currency: ${toUpper}`, { code: toUpper });\n rate = value;\n } else {\n const toId = CurrencyExchangeService.CRYPTO_IDS[toUpper];\n const vs = fromUpper.toLowerCase();\n const data = await this.fetchCoinGeckoPrices([toId], vs, fetchSignal);\n const priceOfToInFrom = data[toId]?.[vs];\n if (typeof priceOfToInFrom !== \"number\") throw ErrorFactory.validation(CurrencyErrorCodes.UNKNOWN_CODE, `Unknown currency: ${fromUpper}`, { code: fromUpper });\n rate = 1 / priceOfToInFrom;\n }\n\n // Cache as a single-pair base table, same shape Frankfurter fetches\n // produce, so getRateSync/convertSync's triangulation logic doesn't\n // need to know or care which source a rate came from.\n this.baseTables.set(fromUpper, {\n fetchedAt: Date.now(),\n rates: { [fromUpper]: 1, [toUpper]: rate },\n });\n\n return rate;\n } finally {\n cleanup();\n }\n }\n\n private async fetchCoinGeckoPrices(ids: string[], vsCurrency: string, signal: AbortSignal): Promise<Record<string, Record<string, number>>> {\n const url = `https://api.coingecko.com/api/v3/simple/price?ids=${ids.join(\",\")}&vs_currencies=${vsCurrency}`;\n const response = await fetch(url, { signal });\n if (!response.ok) throw ErrorFactory.external(CurrencyErrorCodes.CRYPTO_API_ERROR, `Crypto price API returned ${response.status}`, { status: response.status });\n return response.json();\n }\n\n /**\n * Seed a base rate table without a network fetch.\n *\n * Intended for tests and for future user-provided offline rates\n * production live data always comes from {@link getRate}. Seeded rates\n * obey the same freshness window as fetched ones.\n *\n * @param base - Base currency code (e.g. \"USD\").\n * @param rates - Map of currency code → rate relative to the base.\n */\n primeRates(base: string, rates: Record<string, number>): void {\n const baseUpper = base.toUpperCase();\n this.baseTables.set(baseUpper, {\n fetchedAt: Date.now(),\n rates: { ...rates, [baseUpper]: 1 },\n });\n }\n\n /**\n * Drop every cached/primed rate table.\n *\n * Mainly for test isolation: {@link sharedCurrencyExchange} is a\n * module-level singleton, so a rate primed or fetched by one test can\n * silently leak into a later test in the same file. Also usable in\n * production if a caller ever wants to force a full re-fetch.\n */\n clearRates(): void {\n this.baseTables.clear();\n }\n\n /**\n * Synchronous rate lookup: `1` for same-currency pairs, a cached LIVE\n * rate if one was fetched within {@link RATE_FRESHNESS_MS}, otherwise\n * `null`, callers fall through to the async fetch path and the\n * expression shows Pending until real data arrives.\n *\n * There is deliberately no hardcoded fallback table: a stale made-up\n * rate presented as a real conversion is worse than a Pending state.\n */\n getRateSync(from: string, to: string): number | null {\n const fromUpper = from.toUpperCase();\n const toUpper = to.toUpperCase();\n if (fromUpper === toUpper) {\n return 1;\n }\n const now = Date.now();\n for (const table of this.baseTables.values()) {\n if (now - table.fetchedAt > CurrencyExchangeService.RATE_FRESHNESS_MS) continue;\n const fromRate = table.rates[fromUpper];\n const toRate = table.rates[toUpper];\n if (fromRate && toRate) {\n return toRate / fromRate;\n }\n }\n return null;\n }\n\n /** Convert `value` from `from` to `to` using a freshly-fetched live rate (see {@link getRate}). */\n async convert(value: number, from: string, to: string): Promise<number> {\n const rate = await this.getRate(from, to);\n return value * rate;\n }\n\n /**\n * Get all currently cached fresh rates, keyed \"FROM:TO\".\n * @returns Snapshot of fresh live rates, or null when none are cached.\n */\n getAllRates(): Record<string, number> | null {\n const now = Date.now();\n const snapshot: Record<string, number> = {};\n let any = false;\n for (const [base, table] of this.baseTables) {\n if (now - table.fetchedAt > CurrencyExchangeService.RATE_FRESHNESS_MS) continue;\n for (const [code, rate] of Object.entries(table.rates)) {\n snapshot[`${base}:${code}`] = rate;\n any = true;\n }\n }\n return any ? snapshot : null;\n }\n\n /**\n * Check whether any fresh live rates are currently cached.\n */\n hasRates(): boolean {\n return this.getAllRates() !== null;\n }\n\n /**\n * Synchronous conversion using cached rates only\n * Returns null if rate not in cache\n */\n convertSync(value: number, from: string, to: string): number | null {\n const rate = this.getRateSync(from, to);\n if (rate === null) return null;\n return value * rate;\n }\n\n // ------------------------------------------------------------------------\n // CURRENCY VALIDATION\n // ------------------------------------------------------------------------\n\n /**\n * Check whether `code` is a recognized currency code: any active ISO 4217\n * code, or one of the cryptocurrencies in {@link CRYPTO_IDS}.\n *\n * This used to be a hand-written list of forty-six codes, which meant\n * `$100 in UAH` returned an unconverted hundred dollars rather than saying\n * it could not convert. Answering from the standard rather than from\n * whichever codes happened to get added is what stops that class of bug.\n *\n * Recognising a code is not the same as having a rate for it. That is\n * answered later, by the exchange provider; conflating the two is what\n * produced the silent failure.\n */\n isCurrency(code: string): boolean {\n return isIso4217(code) || this.isCryptoCode(code);\n }\n}\n\n// ============================================================================\n// SINGLETON INSTANCE\n// ============================================================================\n\n/** The shared rate cache. See {@link CurrencyExchangeService} for why it is shared. */\nexport const currencyExchangeService = new CurrencyExchangeService();\n\n// Export for backward compatibility\n/** Alias for {@link currencyExchangeService}, kept for older imports. */\nexport const sharedCurrencyExchange = currencyExchangeService;\n\n// Default export\nexport default currencyExchangeService;\n"]}
@@ -0,0 +1,2 @@
1
+ import {c as c$2}from'./chunk-TWC7K3ZX.js';import {y,C,a as a$1,G,J,e as e$2,h as h$1,t as t$1,p,k as k$1,m,n as n$1,g as g$1,q as q$3,f as f$2,u as u$1,o as o$1,s as s$1,j as j$2,r as r$2,l,b as b$2,c as c$6}from'./chunk-W2JAR233.js';import {c as c$5}from'./chunk-YAYBVVG2.js';import {b}from'./chunk-E6Z4NQAS.js';import {ea,T,U,X,S,Y,q as q$1,aa,ma,j as j$1,$,_,ia,ra,ua}from'./chunk-RSF25YSJ.js';import {n,g,j,a,N,c as c$3,O as O$1,e,C as C$1,F,K,x,y as y$1,w,u,t,v,r as r$1,L,G as G$1,k,I,f as f$1,P,J as J$1,s,q as q$2,p as p$1,o,d,A,b as b$1,B}from'./chunk-EVAOPEO4.js';import {c as c$4,e as e$1,i,h,f,a as a$2}from'./chunk-WGZ3FNHI.js';import {a as a$3}from'./chunk-2JMFUQZH.js';import {c as c$1,r,d as d$1}from'./chunk-MPB7KUN5.js';var At=class{constructor(){this.consumers=new Map;this.dependencies=new Map;this.writes=new Map;this.lineReads=new Map;this.dataSourceDependencies=new Map;this.dataSourceConsumers=new Map;}registerLine(a,o,u){let m=this.lineReads.get(a);if(m)for(let h of m){let b=this.consumers.get(h);b&&b.delete(a);}this.lineReads.set(a,new Set(o));for(let h of o)this.consumers.has(h)||this.consumers.set(h,new Set),this.consumers.get(h).add(a);if(u.length>0){this.dependencies.set(a,new Set(o)),this.writes.set(a,new Set(u));for(let h of u){let b=this.consumers.get(h);b&&b.delete(a);}}}registerLineDataSourceDependency(a,o,u){let m=JSON.stringify(u),h=`${o}:${m}`;this.dataSourceDependencies.has(a)||this.dataSourceDependencies.set(a,new Set),this.dataSourceDependencies.get(a).add(h),this.dataSourceConsumers.has(h)||this.dataSourceConsumers.set(h,new Set),this.dataSourceConsumers.get(h).add(a);}getAffectedLines(a){let o=new Set,u=[a];for(;u.length>0;){let m=u.pop(),h=this.consumers.get(m);if(h)for(let b of h){if(o.has(b))continue;o.add(b);let d=this.writes.get(b);if(d)for(let y of d)u.push(y);}}return o}getAffectedLinesInOrder(a){let o=this.getAffectedLines(a);if(o.size===0)return [];let u=new Map,m=new Map;for(let y of o)u.has(y)||u.set(y,0),m.has(y)||m.set(y,[]);let h=new Map;for(let y of o){let x=this.writes.get(y);if(x)for(let S of x)h.set(S,y);}for(let y of o){let x=this.lineReads.get(y);if(x)for(let S of x){let A=h.get(S);A!==void 0&&A!==y&&(m.get(A).push(y),u.set(y,(u.get(y)??0)+1));}}let b=[];for(let[y,x]of u)x===0&&b.push(y);if(b.length===0&&o.size>0){let y=Array.from(o).sort((x,S)=>x-S);b.push(y[0]);}let d=[];for(;b.length>0;){let y=b.shift();d.push(y);for(let x of m.get(y)??[]){let S=(u.get(x)??1)-1;u.set(x,S),S===0&&b.push(x);}}if(d.length<o.size){let y=new Set(d),x=Array.from(o).filter(S=>!y.has(S)).sort((S,A)=>S-A);d.push(...x);}return d}getAffectedLinesByDataSource(a,o){let u=JSON.stringify(o),m=`${a}:${u}`;return this.dataSourceConsumers.get(m)??new Set}removeLine(a){let o=this.lineReads.get(a);if(o){for(let m of o){let h=this.consumers.get(m);h&&h.delete(a);}this.lineReads.delete(a);}this.dependencies.delete(a),this.writes.delete(a);let u=this.dataSourceDependencies.get(a);if(u){for(let m of u)this.dataSourceConsumers.get(m)?.delete(a);this.dataSourceDependencies.delete(a);}}getConsumers(a){return this.consumers.get(a)??new Set}getDependencies(a){return this.dependencies.get(a)??new Set}getWrites(a){return this.writes.get(a)??new Set}getSnapshot(){let a={};for(let[b,d]of this.consumers)a[b]=Array.from(d);let o={};for(let[b,d]of this.writes)o[b]=Array.from(d);let u={};for(let[b,d]of this.lineReads)u[b]=Array.from(d);let m={};for(let[b,d]of this.dataSourceDependencies)m[b]=Array.from(d);let h={};for(let[b,d]of this.dataSourceConsumers)h[b]=Array.from(d);return {consumers:a,writes:o,reads:u,dataSourceDeps:m,dataSourceConsumers:h}}clear(){this.consumers.clear(),this.dependencies.clear(),this.writes.clear(),this.lineReads.clear(),this.dataSourceDependencies.clear(),this.dataSourceConsumers.clear();}};var Ct=class{constructor(){this.definitions=new Map;}write(a,o,u){this.definitions.has(a)||this.definitions.set(a,[]);let m=this.definitions.get(a);m.push({line:o,expr:u}),m.sort((h,b)=>h.line-b.line);}read(a,o){let u=this.definitions.get(a);if(u){for(let m=u.length-1;m>=0;m--)if(u[m].line<=o)return u[m].expr.lastResult}}invalidateDownstream(a,o){let u=this.definitions.get(a);if(!u)return;let m=u.findIndex(h=>h.line===o);m!==-1&&u.splice(m+1);}clear(){this.definitions.clear();}};function zt(r){let a=new Date(r).getDay();return a===0||a===6}function Ut(r,a){return zt(r)?false:a?!a(r):true}function wt(r){let a=new Date(r);return new Date(a.getFullYear(),a.getMonth(),a.getDate()).getTime()}function vt(r,a,o,u){let m=Math.trunc(Math.abs(a)),h=a>=0?1:-1,b=new Date(r),d=0;for(;m>0;){if(b.setDate(b.getDate()+h),d++,d>u)return null;Ut(b.getTime(),o)&&m--;}return b.getTime()}function Ot(r,a,o,u){let m=wt(Math.min(r,a)),h=wt(Math.max(r,a)),b=Math.round((h-m)/864e5);if(b>u)return null;let d=0,y=new Date(m);for(let x=0;x<=b;x++)Ut(y.getTime(),o)&&d++,y.setDate(y.getDate()+1);return d}var Qt={0:{name:"sqrt",min:1,max:1},1:{name:"abs",min:1,max:1},2:{name:"sin",min:1,max:1},3:{name:"cos",min:1,max:1},4:{name:"tan",min:1,max:1},5:{name:"log",min:1,max:1},6:{name:"ceil",min:1,max:1},7:{name:"floor",min:1,max:1},8:{name:"round",min:1,max:2},9:{name:"min",min:1,max:1/0},10:{name:"max",min:1,max:1/0},11:{name:"asin",min:1,max:1},12:{name:"acos",min:1,max:1},13:{name:"atan",min:1,max:1},14:{name:"atan2",min:2,max:2},15:{name:"sinh",min:1,max:1},16:{name:"cosh",min:1,max:1},17:{name:"tanh",min:1,max:1},18:{name:"asinh",min:1,max:1},19:{name:"acosh",min:1,max:1},20:{name:"atanh",min:1,max:1},21:{name:"cbrt",min:1,max:1},22:{name:"clz32",min:1,max:1},23:{name:"expm1",min:1,max:1},24:{name:"exp",min:1,max:1},25:{name:"fround",min:1,max:1},26:{name:"hypot",min:1,max:1/0},27:{name:"imul",min:2,max:2},28:{name:"log10",min:1,max:1},29:{name:"log1p",min:1,max:1},30:{name:"log2",min:1,max:1},31:{name:"pow",min:2,max:2},32:{name:"random",min:0,max:0},33:{name:"sign",min:1,max:1},34:{name:"trunc",min:1,max:1},35:{name:"degtorad",min:1,max:1},36:{name:"radtodeg",min:1,max:1},37:{name:"roll",min:2,max:2},38:{name:"gcd",min:2,max:2},39:{name:"lcm",min:2,max:2},40:{name:"permutation",min:2,max:2},41:{name:"combination",min:2,max:2},42:{name:"average",min:0,max:1/0},43:{name:"median",min:0,max:1/0},44:{name:"total",min:0,max:1/0},45:{name:"count",min:0,max:1/0},46:{name:"proportion",min:3,max:3},47:{name:"clamp",min:3,max:3},48:{name:"hex",min:1,max:1},49:{name:"bin",min:1,max:1},50:{name:"int",min:1,max:1},51:{name:"compoundInterest",min:3,max:3},52:{name:"interestEarned",min:3,max:3},53:{name:"compoundInterestRate",min:3,max:3},54:{name:"compoundInterestYears",min:3,max:3},55:{name:"loanRepayment",min:4,max:4},56:{name:"loanInterest",min:4,max:4},57:{name:"monthlyPayment",min:3,max:3},58:{name:"taxAdd",min:2,max:2},59:{name:"taxRemove",min:2,max:2},60:{name:"inflationAdjust",min:3,max:3},61:{name:"root",min:2,max:2},62:{name:"fact",min:1,max:1},63:{name:"transpose",min:1,max:1},64:{name:"det",min:1,max:1},65:{name:"inv",min:1,max:1},66:{name:"dot",min:2,max:2},67:{name:"expand",min:1,max:1},68:{name:"factor",min:1,max:1},69:{name:"solve",min:3,max:3},70:{name:"der",min:2,max:3},71:{name:"integral",min:2,max:2},72:{name:"taylor",min:4,max:4},73:{name:"jacobian",min:1,max:1/0},74:{name:"imaginary",min:1,max:1},75:{name:"conj",min:1,max:1},76:{name:"re",min:1,max:1},77:{name:"im",min:1,max:1},78:{name:"cancel",min:1,max:1},79:{name:"apart",min:1,max:1},80:{name:"compoundInterestEvery",min:4,max:4},81:{name:"compoundInterestEarnedEvery",min:4,max:4},82:{name:"presentValue",min:3,max:3},83:{name:"roi",min:2,max:2},84:{name:"annualisedReturn",min:3,max:3},85:{name:"taxIn",min:2,max:2},86:{name:"taxOn",min:2,max:2},87:{name:"sind",min:1,max:1},88:{name:"cosd",min:1,max:1},89:{name:"tand",min:1,max:1},90:{name:"asind",min:1,max:1},91:{name:"acosd",min:1,max:1},92:{name:"atand",min:1,max:1},93:{name:"daysCount",min:1,max:1},94:{name:"asTwoUnits",min:3,max:3},95:{name:"makeRate",min:2,max:2},96:{name:"atRate",min:2,max:2},97:{name:"roundToPlaces",min:2,max:2},98:{name:"splitEach",min:2,max:2},99:{name:"savingsGoalPayment",min:3,max:3},100:{name:"savingsGoalPeriods",min:5,max:5}};function ke(r){return r===1?"1 argument":`${r} arguments`}function Jt(r){return r.max===1/0?`at least ${ke(r.min)}`:r.min===r.max?ke(r.min):`${r.min} to ${ke(r.max)}`}function Rt(r,a){let o=Qt[r];if(o!==void 0&&!(a>=o.min&&a<=o.max))return c$1.execution("BUILTIN_ARITY_MISMATCH",`${o.name}() takes ${Jt(o)}, but was given ${a===0?"none":ke(a)}`,{functionName:o.name,expectedMin:o.min,expectedMax:o.max,actual:a})}function Hn(r,a=200,o=5e4,u=50,m=1e5,h=2e6,b=1e4,d=100,y$1=-100,x=y,S){let A=[],M=new Map,L=0,j,$,n$1=[],Q=new Map,W=new Map,K=new Map;return {push(f){A.length<a&&A.push(f);},getMaxStackDepth(){return a},getMaxCollectionSize(){return m},getMaxAllocatedElements(){return h},getMaxFunctionCalls(){return b},getMaxDateOffsetYears(){return d},getMinDateOffsetYears(){return y$1},isHoliday(f){return S?S(f):false},pop(){return A.length===0?n(0):A.pop()},popNumber(){return c(A).toNumber()},popString(){return q(c(A),"VM.popString()")},peek(){return A[A.length-1]},getStack(){return A},registry:r,getVar(f){if(n$1.length>0){let e=n$1[n$1.length-1].get(f);if(e!==void 0)return e}return M.get(f)},setVar(f,e){M.set(f,e);},deleteVar(f){M.delete(f);},pushCallFrame(f){if(n$1.length>=u)throw c$1.execution("FUNCTION_RECURSION_LIMIT_EXCEEDED",`Function call nesting exceeded maximum depth of ${u} (possible infinite recursion, e.g. f(x) = f(x))`,{maxFunctionRecursionDepth:u});n$1.push(f);},popCallFrame(){n$1.pop();},getCallFrame(){return n$1.length>0?n$1[n$1.length-1]:void 0},defineUserFunction(f,e,t){Q.set(f,{name:f,params:e,program:t});},getUserFunction(f){return Q.get(f)},hasUserFunction(f){return Q.has(f)},getVariableEntries(){return Array.from(M.entries())},getUserFunctionDefs(){return Array.from(Q.values())},defineEquation(f,e,t){W.set(f,{variable:f,factorNames:e,rhsProgram:t});},getEquation(f){return W.get(f)},hasEquation(f){return W.has(f)},defineScalarEquation(f,e,t){K.set(f,{variable:f,lhsProgram:e,rhsProgram:t});},getScalarEquation(f){return K.get(f)},hasScalarEquation(f){return K.has(f)},reset(){A.length=0,M.clear(),n$1.length=0,Q.clear(),W.clear(),K.clear(),L=0,$&&($(),$=void 0),j=void 0;},get activeSignal(){return j},set activeSignal(f){j=f;},get abortCurrent(){return $},set abortCurrent(f){$=f;},context:x,getMaxInstructions(){return o},getInstructionCount(){return L},incrementInstructions(f){if(L+=f,L>o)throw c$1.execution("INSTRUCTION_LIMIT_EXCEEDED",`Execution exceeded maximum of ${o} instructions`)}}}function Zt(r,a){return r.rows===1&&r.cols===1?a.data.length:a.rows===1&&a.cols===1?r.data.length:r.cols!==a.rows?0:r.rows*a.cols}function en(r,a){return !Number.isInteger(a)||a<0?0:r.rows*r.cols*(1+(a<2?1:2*Math.floor(Math.log2(a))))}function c(r){if(r.length===0)throw c$1.internal({code:"STACK_UNDERFLOW",message:"Stack underflow: an opcode expected a value on the stack but it was empty",expected:"at least one value on the VM stack",found:"an empty stack",suggestion:"this indicates corrupted bytecode or a bug in a package's parselet (mismatched push/pop counts), not a user-input error"});return r.pop()}var Ht="bytecode is caller input on this entry point: rebuild the program with the engine's compiler, or fix the hand-assembled stream";function tn(r){return typeof r=="number"?b(r):r}function se(r,a,o,u,m,h={}){let b=tn(a);return c$1.validation({code:r,message:`Malformed bytecode: ${b} ${o}`,expected:u,found:m,suggestion:Ht,context:typeof a=="number"?{opcode:a,opcodeName:b,...h}:{site:b,...h}})}function O(r,a,o,u){if(a>=r.length)throw se("MALFORMED_BYTECODE_TRUNCATED",o,`is missing its ${u}: the program ends mid-instruction`,`an operand byte at offset ${a}`,`a program only ${r.length} byte(s) long`,{offset:a,length:r.length,role:u});return r[a]}function qe(r,a,o,u,m,h){let b=O(r,a,o,u);if(b>=m)throw se("MALFORMED_BYTECODE_CONSTANT_INDEX",o,`reads ${h} entry ${b}, which does not exist`,`an index below ${m}`,`${b}`,{index:b,poolSize:m,pool:h});return b}function z(r,a,o,u,m){return Qe(o,O(r,a,u,m),u)}function Qe(r,a,o){let u=r[a];if(typeof u!="string")throw se("MALFORMED_BYTECODE_CONSTANT_INDEX",o,`reads string-pool entry ${a}, which is ${a>=r.length?"past the end of the pool":"not a string"}`,`an index below ${r.length}, holding a string`,a>=r.length?`${a}`:typeof u,{index:a,poolSize:r.length,pool:"string-pool"});return u}function q(r,a,o){if(typeof r.value!="string")throw se("MALFORMED_BYTECODE_OPERAND_TYPE",a,`expected a ${o??"string"} on the stack`,o?`a string value holding the ${o}`:"a string value",`a ${g[r.type]??"unknown"} value`,o?{role:o,valueType:r.type}:{valueType:r.type});return r.value}function Vt(r,a,o){if(r!==0&&r!==1&&r!==2)throw se("MALFORMED_BYTECODE_BODY_KIND",o,`has body kind ${r}, which is not one this VM knows`,"0 (inline body), 1 (builtin function) or 2 (user-defined function)",`${r}`,{kind:r,ref:a})}function nn(r,a){try{return BigInt(r)}catch{throw se("MALFORMED_BYTECODE_BIGINT_LITERAL",a,`cannot read "${r}" as a whole number`,"a string holding an integer, with no decimal point or separators",`"${r}"`,{literal:r})}}function an(r){if(r===null||typeof r!="object")return `expected a bytecode program, got ${r===null?"null":typeof r}`;let a=r;return typeof a.opcodes?.length!="number"?"the program has no `opcodes` array":typeof a.numbers?.length!="number"?"the program has no `numbers` pool":typeof a.strings?.length!="number"?"the program has no `strings` pool":null}function Bt(r,a,o,u,m,h,b,d){let y=new Map;for(let S=0;S<r.length;S++)y.set(r[S],o[S]);u.pushCallFrame(y);let x;try{x=Je(a,u,m,h,b,d);}finally{u.popCallFrame();}if(x.type==="pending")throw c$1.execution("MAP_REDUCE_ASYNC_UNSUPPORTED","map/reduce transform bodies calling an async operation (weather, stocks, currency, ...) aren't supported");if(x.type==="error")throw x.error;return x.value}function rn(r,a,o,u,m,h,b){let d=new Map(o.getCallFrame());d.set(r,I(q$1(r))),o.pushCallFrame(d);let y;try{y=Je(a,o,u,m,h,b);}finally{o.popCallFrame();}if(y.type==="pending")throw c$1.execution("SYMBOLIC_ASYNC_UNSUPPORTED","an algebra verb's expression cannot call an async operation (weather, stocks, currency, ...)");if(y.type==="error")throw y.error;return y.value}function Ft(r,a){if(r.type!==6||a.type!==6)return null;let o=r.unit,u=a.unit;if(o===void 0||u===void 0)return null;let m=o.indexOf("/"),h=u.indexOf("/");if(m<0||h<0||o.slice(0,m)!==u.slice(0,h))return null;let b=a$3[o.slice(m+1).toLowerCase()],d=a$3[u.slice(h+1).toLowerCase()];return b===void 0||d===void 0||b[0]!==d[0]?null:r.toNumber()*(d[1]/b[1])}function Lt(r,a){if(r.type!==6||a.type!==6)return null;let o=r.unit,u$1=a.unit;if(o===void 0||u$1===void 0||o.includes("/")||u$1.includes("/"))return null;let m=ua[o.toUpperCase()]!==void 0,h=ua[u$1.toUpperCase()]!==void 0;return m===h?null:u(r.toNumber()*a.toNumber(),m?o:u$1)}function $t(r,a,o){if(r.type===5)return a.type===6&&a.unit!==void 0?c$6(a,a.unit,r.toNumber(),o):a.type!==5&&a.type!==0?null:L(r.toNumber()+o*a.toNumber());if(a.type!==5)return null;let u=1+o*a.toNumber();if(r.type===0){let m=r.toNumber()*u;return r.uncertainty!==void 0?q$2(m,Math.abs(r.uncertainty*u)):n(m)}return r.type===6&&r.unit!==void 0?c$6(r,r.unit,a.toNumber(),o):null}function on(r,a){let o=r.type===5?r:a.type===5?a:null;if(o===null)return null;let u=o===r?a:r;if(u.type!==0||u.uncertainty===void 0)return null;let m=o.toNumber();return q$2(u.toNumber()*m,Math.abs(u.uncertainty*m))}function sn(r,a){let o=r.type===6?r:a,u=r.type===6?a:r;return o.type!==6||o.unit===void 0||!c$5.isCurrency(o.unit)||u.type!==0&&u.type!==5||u.rational!==void 0?null:b$2(o,u.toNumber(),o.unit)}function un(r,a){if(a.type===5&&r.type===0&&r.uncertainty!==void 0){let o=a.toNumber();return o===0?null:q$2(r.toNumber()/o,Math.abs(r.uncertainty/o))}if(r.type===5&&a.type===0&&a.uncertainty!==void 0){let o=a.toNumber();return o===0?null:q$2(r.toNumber()/o,Math.abs(r.toNumber()*a.uncertainty/(o*o)))}return null}function ln(r){if(r.type===6){let a=r.unit;if(a&&c$4(a)==="time")try{return e$1(r.toNumber(),a,"ms")}catch{}return 0}return r.toNumber()}var Pt=260;function qt(r,a,o){let u=Math.trunc(Math.abs(a)),h=(a>=0?1:-1)>0?o.getMaxDateOffsetYears():-o.getMinDateOffsetYears(),b=Math.floor(h*Pt);if(u>b)throw c$1.execution("DATE_OFFSET_LIMIT_EXCEEDED",`A date offset of ${u.toLocaleString("en-US")} workdays is about ${Math.round(u/Pt).toLocaleString("en-US")} years, past the limit of ${h} years for a workday offset`,{requestedWorkdays:u,limitYears:h,limitWorkdays:b});let d=b*7+7,y=vt(r,a,x=>o.isHoliday(x),d);if(y===null)throw c$1.execution("DATE_OFFSET_LIMIT_EXCEEDED",`A working-day offset of ${u.toLocaleString("en-US")} could not be reached within the ${h}-year limit; the configured holiday calendar leaves too few working days`,{requestedWorkdays:u,limitYears:h,maxCalendarSteps:d});return y}var Yt=864e5,cn={month:1,months:1,mo:1,year:12,years:12,yr:12,y:12,a:12,decade:120,decades:120,dec:120,century:1200,centuries:1200,millennium:12e3,millennia:12e3};function mn(r,a){return new Date(r,a+1,0).getDate()}function jt(r,a){let o=Math.trunc(a),u=new Date(r);u.setDate(u.getDate()+o);let m=u.getTime();return Number.isNaN(m)?r+a*Yt:m+(a-o)*Yt}function pn(r,a){let o=Math.trunc(a),u=new Date(r),m=u.getDate();u.setDate(1),u.setMonth(u.getMonth()+o),u.setDate(Math.min(m,mn(u.getFullYear(),u.getMonth())));let h=u.getTime(),b=e$1(1,"month","ms");return Number.isNaN(h)?r+a*b:h+(a-o)*b}function he(r,a,o,u){if(a.type===6&&a.unit!==void 0){let m=a.unit,h=o*a.toNumber();if(a$2(m))return qt(r,h,u);let b=cn[m];if(b!==void 0)return pn(r,h*b);if(c$4(m)==="time"){let d=0;try{d=e$1(1,m,"day");}catch{}if(Number.isInteger(d)&&d>=1)return jt(r,h*d)}}return r+o*ln(a)}function Xt(r,a,o){let u$1=B(r.unit);if(a.type===6&&A(a.unit)){let m=B(a.unit);return m!==u$1?N("TIMECODE_FPS_MISMATCH",`Cannot combine timecodes at different frame rates (${u$1} fps vs ${m} fps)`):o===1?u(r.toNumber()+a.toNumber(),r.unit):u(r.toNumber()-a.toNumber(),"frames")}if(a.type===6&&a.unit==="frames")return u(r.toNumber()+o*a.toNumber(),r.unit);if(a.type===6&&a.unit&&c$4(a.unit)==="time"){let m=e$1(a.toNumber(),a.unit,"s");return u(r.toNumber()+o*m*u$1,r.unit)}return u(r.toNumber()+o*a.toNumber(),r.unit)}function ge(r){return r.type===10?r.value:r.toNumber()!==0}function Gt(r,a){let o=l(r,a);return N("INCOMPATIBLE_UNITS",o??`Cannot convert ${r} to ${a}: they do not measure the same thing`)}var Se=65536;function fn(r,a){if(!Number.isInteger(a)||a<0)return null;if(a===0)return 1;let o=Math.abs(r.toNumber());return o<=1?1:(o<=2?1:Math.log2(o))*a}function dn(r,a){let o=1n,u=r,m=a;for(;m>0n;)m%2n===1n&&(o*=u),m/=2n,m>0n&&(u*=u);return o}var je=Se;function Wt(r){let a=r<0n?-r:r;if(a===0n)return 0;let o=Number(a);return Number.isFinite(o)?Math.floor(Math.log2(o))+1:a.toString(16).length*4}function Kt(r,a,o){let u=n$1(r),m=n$1(a);if(u===0n)return s(0n);let h=o*Number(m);if(h<=0||Wt(u)+h<=je)return s(o===1?u<<m:u>>m);throw c$1.execution("BIGINT_SHIFT_LIMIT_EXCEEDED",`Shifting by ${m} would build an exact integer of about ${(Wt(u)+h).toLocaleString("en-US")} bits, past the limit of ${je.toLocaleString("en-US")} bits`,{shift:String(m),limitBits:je})}function ze(r,a){let{numerator:o,denominator:u$1}=y$1(r.unit),m=c$4(u$1),h=c$4(a.unit);if(!m||m!==h)return N("RATE_MUL_MEASURE_MISMATCH",`Cannot multiply a "${u$1}"-denominated rate by "${a.unit}" \u2014 different measures`);let b=e$1(a.toNumber(),a.unit,u$1),d=r.toNumber()*b;return o?u(d,o):n(d)}function bn(r){if(Number.isNaN(r))return "NaN";if(!isFinite(r))return r>0?"Infinity":"-Infinity";let a=r<0,o=Math.abs(r),u=Math.floor(o),m=o-u;if(m<1e-9)return `${a?"-":""}${u}`;let h=0,b=1,d=1,y=0,x=m,S=1e6;for(let M=0;M<30;M++){let L=Math.floor(x+1e-9),j=L*b+h,$=L*y+d;if($>S||(h=b,b=j,d=y,y=$,Math.abs(m-b/y)<1e-9))break;let n=x-L;if(n<1e-9)break;x=1/n;}let A=u*y+b;return `${a?"-":""}${A}/${y}`}function hn(r){return r.d===1n?String(r.n):`${r.n}/${r.d}`}function gn(r){let a=r.toNumber(),o=r.type===5?1+a:a;return `${Math.round(o*1e6)/1e6}x`}function yn(r){if(!Number.isFinite(r))return String(r);if(r===0)return "0e+0";let[a,o]=r.toExponential().split("e");return `${a.includes(".")?a.replace(/0+$/,"").replace(/\.$/,""):a}e${o}`}function Je(r$3,a$2,o$2,u$2,m$1,h$2){let b$2=an(r$3);if(b$2)return {type:"error",error:c$1.validation({code:"MALFORMED_BYTECODE_PROGRAM",message:`Malformed bytecode: ${b$2}`,expected:"a BytecodeProgram with opcodes, numbers and strings",found:b$2,suggestion:Ht})};let{opcodes:d$2,numbers:y,strings:x$1,userFunctionBodies:S$1,anonymousBodies:A$1}=r$3,M=0,L$1=0,j$3=a$2.getMaxInstructions(),$$1=a$2.getMaxStackDepth(),n$2=a$2.getStack(),Q=o$2?.hasCollectors??false,W=j();if(d$2.length===0)return {type:"value",value:n(0)};a(a$2);try{for(;M<d$2.length;){if(++L$1>j$3)throw c$1.execution("INSTRUCTION_LIMIT_EXCEEDED",`Execution exceeded maximum of ${j$3} instructions`);if(n$2.length>$$1)throw c$1.execution("STACK_LIMIT_EXCEEDED",`Execution exceeded maximum stack depth of ${$$1}`);let f$3=d$2[M++];if(Q){let e=n$2.map(t=>({type:t.type,value:t.value,unit:t.unit}));o$2.fireVmStep({type:c$2.VmStep,elapsedNs:0,expression:u$2??"",opcode:f$3,opcodeName:b(f$3),ip:M-1,stackDepth:n$2.length,instructionNumber:L$1,stack:e});}switch(f$3){case 0:break;case 1:{let e=c(n$2);return {type:"value",value:W?k(e):e}}case 3:{let e=c(n$2);n$2.push(e),n$2.push(e);break}case 2:{let e=c(n$2),t=c(n$2);n$2.push(e),n$2.push(t);break}case 10:n$2.push(n(y[qe(d$2,M++,f$3,"constant-pool index",y.length,"number-pool")]));break;case 11:n$2.push(s(nn(z(d$2,M++,x$1,f$3,"constant-pool index"),f$3)));break;case 16:{let e=ia(z(d$2,M++,x$1,f$3,"constant-pool index"));n$2.push(o(ra(e),e));break}case 12:n$2.push(r$1(y[qe(d$2,M++,f$3,"constant-pool index",y.length,"number-pool")]));break;case 13:n$2.push(t(z(d$2,M++,x$1,f$3,"constant-pool index")));break;case 14:n$2.push(J$1(O(d$2,M++,f$3,"boolean operand")===1));break;case 20:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.uncertainty!==void 0||e.uncertainty!==void 0){let p=s$1(t,e,"add");if(p){n$2.push(p);break}}if(t.rational!==void 0||e.rational!==void 0){let p=r$2(t,e,"add");if(p){n$2.push(p);break}}let i=$t(t,e,1),l=i===null?Ft(t,e):null;i!==null?n$2.push(i):l!==null?n$2.push(u(l+e.toNumber(),e.unit)):t.type===0&&e.type===0?n$2.push(n(t.value+e.value)):t.type===10&&e.type===10?n$2.push(J$1(t.value&&e.value)):t.type===4?e.type===4?n$2.push(N("INVALID_DATETIME_OP","Cannot add two datetimes together")):n$2.push(K(he(t.toNumber(),e,1,a$2))):t.type===6&&A(t.unit)?n$2.push(Xt(t,e,1)):e.type===4?n$2.push(K(he(e.toNumber(),t,1,a$2))):n$2.push(u$1(t,e,(p,g)=>p+g,(p,g)=>p+g,"add"));break}case 21:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.uncertainty!==void 0||e.uncertainty!==void 0){let p=s$1(t,e,"sub");if(p){n$2.push(p);break}}if(t.rational!==void 0||e.rational!==void 0){let p=r$2(t,e,"sub");if(p){n$2.push(p);break}}let i=$t(t,e,-1),l=i===null?Ft(t,e):null;i!==null?n$2.push(i):l!==null?n$2.push(u(l-e.toNumber(),e.unit)):t.type===0&&e.type===0?n$2.push(n(t.value-e.value)):t.type===4?e.type===4?n$2.push(u(t.toNumber()-e.toNumber(),"ms")):n$2.push(K(he(t.toNumber(),e,-1,a$2))):t.type===6&&A(t.unit)?n$2.push(Xt(t,e,-1)):e.type===4?n$2.push(N("INVALID_DATETIME_OP","Cannot subtract a datetime from a value that is not a datetime")):n$2.push(u$1(t,e,(p,g)=>p-g,(p,g)=>p-g,"sub"));break}case 22:{let e=c(n$2),t=c(n$2),s=on(t,e);if(s){n$2.push(s);break}if(t.uncertainty!==void 0||e.uncertainty!==void 0){let l=s$1(t,e,"mul");if(l){n$2.push(l);break}}if(t.rational!==void 0||e.rational!==void 0){let l=r$2(t,e,"mul");if(l){n$2.push(l);break}}let i=sn(t,e);if(i){n$2.push(i);break}t.type===0&&e.type===0?n$2.push(n(t.value*e.value)):t.type===7&&e.type===7?(d(Zt(t.value,e.value),"matrix cells"),n$2.push(_(t.value,e.value))):t.type===6&&x(t.unit)&&e.type===6&&e.unit?n$2.push(ze(t,e)):e.type===6&&x(e.unit)&&t.type===6&&t.unit?n$2.push(ze(e,t)):Lt(t,e)!==null?n$2.push(Lt(t,e)):n$2.push(u$1(t,e,(l,p)=>l*p,(l,p)=>l*p,"mul"));break}case 23:{let e=c(n$2),t=c(n$2),s=un(t,e);if(s){n$2.push(s);break}if(t.uncertainty!==void 0||e.uncertainty!==void 0){let i=s$1(t,e,"div");if(i){n$2.push(i);break}}if(t.type===6&&e.type===6){let{lv:i,rv:l,sameMeasure:p}=j$2(t,e);p?n$2.push(n(i/l)):c$5.isCurrency(t.unit)&&c$5.isCurrency(e.unit)?n$2.push(N("INCOMPATIBLE_UNITS",`Cannot combine incompatible units: ${t.unit} and ${e.unit}`)):n$2.push(w(i/l,t.unit,e.unit));}else {let i=r$2(t,e,"div");if(i){n$2.push(i);break}n$2.push(u$1(t,e,(l,p)=>l/p,(l,p)=>{if(p===0n)throw o$1();return l/p},"div"));}break}case 24:{let e=c(n$2),t=c(n$2);n$2.push(u$1(t,e,(s,i)=>s%i,(s,i)=>{if(i===0n)throw o$1();return s%i}));break}case 25:{let e=c(n$2),t=c(n$2);if(t.type===13){n$2.push(t);break}if(e.type===13){n$2.push(e);break}if(t.type===12){n$2.push(t);break}if(e.type===12){n$2.push(e);break}if(t.type===0&&e.type===0){n$2.push(n(q$3(t.value,e.value)));break}if(t.type===7||e.type===7){if(t.type!==7||e.type!==0){n$2.push(N("MATRIX_POWER_UNSUPPORTED",`^: a matrix may only be the base, raised to a whole number (as in "[1,2;3,4]^2"); "${g[t.type]} ^ ${g[e.type]}" has no matrix reading.`));break}d(en(t.value,e.value),"matrix cells"),n$2.push($(t.value,e.value));break}if(t.type===9||e.type===9){n$2.push(f$2(t,e));break}if(t.type===2||e.type===2){let s$1=fn(t,e.toNumber());if(s$1!==null){if(s$1>Se)throw c$1.execution("BIGINT_POW_LIMIT_EXCEEDED",`That power would build an exact integer of about ${Math.round(s$1).toLocaleString("en-US")} bits, past the limit of ${Se.toLocaleString("en-US")} bits`,{limitBits:Se});n$2.push(s(dn(n$1(t),n$1(e))));break}}n$2.push(n(q$3(t.toNumber(),e.toNumber())));break}case 26:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}e.type===2?n$2.push(s(-e.value)):e.type===6&&e.exact!==void 0?n$2.push(v(-e.toNumber(),e.unit,ma(e.exact))):e.type===6?n$2.push(u(-e.toNumber(),e.unit)):e.type===5?n$2.push(L(-e.toNumber())):e.type===9?n$2.push(g$1(e)):e.type===0&&e.rational!==void 0?n$2.push(p$1(-e.toNumber(),j$1(e.rational))):e.type===0&&e.exact!==void 0?n$2.push(o(-e.toNumber(),ma(e.exact))):n$2.push(n(-e.toNumber()));break}case 27:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}e.type===6&&e.exact!==void 0?n$2.push(v(e.toNumber(),e.unit,e.exact)):e.type===6?n$2.push(u(e.toNumber(),e.unit)):e.type===5?n$2.push(L(e.toNumber())):e.type===0&&e.rational!==void 0?n$2.push(p$1(e.toNumber(),e.rational)):e.type===0&&e.exact!==void 0?n$2.push(o(e.toNumber(),e.exact)):n$2.push(n(e.toNumber()));break}case 28:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}n$2.push(q$2(t.toNumber(),Math.abs(e.toNumber())));break}case 30:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}t.type===2||e.type===2?n$2.push(Kt(t,e,1)):n$2.push(n(t.toNumber()<<e.toNumber()));break}case 31:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}t.type===2||e.type===2?n$2.push(Kt(t,e,-1)):n$2.push(n(t.toNumber()>>e.toNumber()));break}case 32:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}n$2.push(n(t.toNumber()>>>e.toNumber()));break}case 33:{let e=c(n$2),t=c(n$2),s$1=O$1(t,e);if(s$1){n$2.push(s$1);break}t.type===2||e.type===2?n$2.push(s(n$1(t)&n$1(e))):n$2.push(n(t.toNumber()&e.toNumber()));break}case 34:{let e=c(n$2),t=c(n$2),s$1=O$1(t,e);if(s$1){n$2.push(s$1);break}t.type===2||e.type===2?n$2.push(s(n$1(t)|n$1(e))):n$2.push(n(t.toNumber()|e.toNumber()));break}case 35:{let e=c(n$2),t=c(n$2),s$1=O$1(t,e);if(s$1){n$2.push(s$1);break}t.type===2||e.type===2?n$2.push(s(n$1(t)^n$1(e))):n$2.push(n(t.toNumber()^e.toNumber()));break}case 36:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}e.type===2?n$2.push(s(~e.value)):n$2.push(n(~e.toNumber()));break}case 40:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.rational!==void 0||e.rational!==void 0){let i=t$1(t,e);if(i!==null){n$2.push(J$1(i===0));break}}if(t.type===0&&e.type===0)n$2.push(J$1(t.value===e.value));else if(t.type===2||e.type===2){let i=p(t,e);n$2.push(J$1(i===null?t.toNumber()===e.toNumber():i===0));}else if(t.type===3&&e.type===3)n$2.push(J$1(t.value===e.value));else if(t.type===6&&e.type===6){let{equal:i,sameMeasure:l}=k$1(t,e);n$2.push(J$1(l&&i));}else if(t.type===7&&e.type===7)n$2.push(aa(t.value,e.value,(i,l)=>i===l));else if(t.type===14||e.type===14)if(t.type===14&&e.type===14){let i=t.value,l=e.value;n$2.push(J$1(i.r===l.r&&i.g===l.g&&i.b===l.b&&i.a===l.a));}else n$2.push(J$1(!1));else n$2.push(J$1(t.toNumber()===e.toNumber()));break}case 41:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.rational!==void 0||e.rational!==void 0){let i=t$1(t,e);if(i!==null){n$2.push(J$1(i!==0));break}}if(t.type===0&&e.type===0)n$2.push(J$1(t.value!==e.value));else if(t.type===2||e.type===2){let i=p(t,e);n$2.push(J$1(i===null?t.toNumber()!==e.toNumber():i!==0));}else if(t.type===3&&e.type===3)n$2.push(J$1(t.value!==e.value));else if(t.type===6&&e.type===6){let{equal:i,sameMeasure:l}=k$1(t,e);n$2.push(J$1(!l||!i));}else if(t.type===7&&e.type===7)n$2.push(aa(t.value,e.value,(i,l)=>i!==l));else if(t.type===14||e.type===14)if(t.type===14&&e.type===14){let i=t.value,l=e.value;n$2.push(J$1(!(i.r===l.r&&i.g===l.g&&i.b===l.b&&i.a===l.a)));}else n$2.push(J$1(!0));else n$2.push(J$1(t.toNumber()!==e.toNumber()));break}case 42:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.rational!==void 0||e.rational!==void 0){let i=t$1(t,e);if(i!==null){n$2.push(J$1(i<0));break}}if(t.type===0&&e.type===0)n$2.push(J$1(t.value<e.value));else if(t.type===2||e.type===2){let i=p(t,e);n$2.push(J$1(i===null?t.toNumber()<e.toNumber():i<0));}else if(t.type===6&&e.type===6){let{lv:i,rv:l,equal:p,sameMeasure:g}=k$1(t,e);n$2.push(g?J$1(!p&&i<l):m(t,e));}else t.type===7&&e.type===7?n$2.push(aa(t.value,e.value,(i,l)=>i<l)):n$2.push(J$1(t.toNumber()<e.toNumber()));break}case 43:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.rational!==void 0||e.rational!==void 0){let i=t$1(t,e);if(i!==null){n$2.push(J$1(i<=0));break}}if(t.type===0&&e.type===0)n$2.push(J$1(t.value<=e.value));else if(t.type===2||e.type===2){let i=p(t,e);n$2.push(J$1(i===null?t.toNumber()<=e.toNumber():i<=0));}else if(t.type===6&&e.type===6){let{lv:i,rv:l,equal:p,sameMeasure:g}=k$1(t,e);n$2.push(g?J$1(p||i<=l):m(t,e));}else t.type===7&&e.type===7?n$2.push(aa(t.value,e.value,(i,l)=>i<=l)):n$2.push(J$1(t.toNumber()<=e.toNumber()));break}case 44:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.rational!==void 0||e.rational!==void 0){let i=t$1(t,e);if(i!==null){n$2.push(J$1(i>0));break}}if(t.type===0&&e.type===0)n$2.push(J$1(t.value>e.value));else if(t.type===2||e.type===2){let i=p(t,e);n$2.push(J$1(i===null?t.toNumber()>e.toNumber():i>0));}else if(t.type===6&&e.type===6){let{lv:i,rv:l,equal:p,sameMeasure:g}=k$1(t,e);n$2.push(g?J$1(!p&&i>l):m(t,e));}else t.type===7&&e.type===7?n$2.push(aa(t.value,e.value,(i,l)=>i>l)):n$2.push(J$1(t.toNumber()>e.toNumber()));break}case 45:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.rational!==void 0||e.rational!==void 0){let i=t$1(t,e);if(i!==null){n$2.push(J$1(i>=0));break}}if(t.type===0&&e.type===0)n$2.push(J$1(t.value>=e.value));else if(t.type===2||e.type===2){let i=p(t,e);n$2.push(J$1(i===null?t.toNumber()>=e.toNumber():i>=0));}else if(t.type===6&&e.type===6){let{lv:i,rv:l,equal:p,sameMeasure:g}=k$1(t,e);n$2.push(g?J$1(p||i>=l):m(t,e));}else t.type===7&&e.type===7?n$2.push(aa(t.value,e.value,(i,l)=>i>=l)):n$2.push(J$1(t.toNumber()>=e.toNumber()));break}case 130:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}n$2.push(J$1(ge(t)&&ge(e)));break}case 131:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}n$2.push(J$1(ge(t)||ge(e)));break}case 132:{let e=c(n$2),t=c(n$2),s=c(n$2),i=O$1(s);if(i){n$2.push(i);break}n$2.push(ge(s)?t:e);break}case 50:{let e=O(d$2,M++,f$3,"plugin-function index"),t=O(d$2,M++,f$3,"argument count"),s=[];for(let p=0;p<t;p++)s.push(c(n$2));s.reverse();let i=a$2.context.pluginFunctions[e],l=P(s);if(l)n$2.push(l);else if(!i)n$2.push(n(0));else {let p=i(s,m$1);if(p instanceof Promise){let g=`plugin:${e}:${s.map(V=>String(V.value??"")).join("|")}`,D=a$2.activeSignal,U=a$2.context.pluginFunctionOwners[e]??"";return {type:"pending",queryKey:g,resolver:p,packageId:U,signal:D}}n$2.push(p);}break}case 51:{let e=O(d$2,M++,f$3,"builtin-function index"),t=O(d$2,M++,f$3,"argument count"),s=Rt(e,t);if(s)throw s;let i=[],l=!1;for(let D=0;D<t;D++){let U=c(n$2);U.type===9&&(l=!0),i.push(U);}let p=P(i);if(p){n$2.push(p);break}let g=C[e];if(g){let D=i.reverse(),U=l&&!e$2.has(e);n$2.push(U?h$1(e,D):g(D));}break}case 150:{let e=O(d$2,M++,f$3,"function-body index"),t=S$1?.[e];if(!t)throw c$1.internal("INTERNAL_MISSING_FUNCTION_BODY",`Internal error: DEFINE_USER_FUNCTION referenced missing body index ${e}`,{bodyIdx:e});a$2.defineUserFunction(t.name,t.params,t.program);break}case 151:{let e=z(d$2,M++,x$1,f$3,"function-name index"),t=O(d$2,M++,f$3,"argument count"),s=[];for(let g=0;g<t;g++)s.push(c(n$2));s.reverse();let i=a$2.getUserFunction(e);if(!i)throw c$1.execution("UNDEFINED_FUNCTION",`Undefined function: ${e}`,{name:e});if(t!==i.params.length)throw c$1.execution("FUNCTION_ARITY_MISMATCH",`${e} expects ${i.params.length} argument(s) but got ${t}`,{name:e,expected:i.params.length,actual:t});let l=new Map;for(let g=0;g<i.params.length;g++)l.set(i.params[g],s[g]);f$1(),a$2.pushCallFrame(l);let p;try{p=Je(i.program,a$2,o$2,u$2,m$1);}finally{a$2.popCallFrame();}if(p.type==="pending")throw c$1.execution("USER_FUNCTION_ASYNC_UNSUPPORTED",`${e}: user-defined functions with async bodies (weather, stocks, currency, ...) aren't supported`,{name:e});if(p.type==="error")throw p.error;n$2.push(p.value);break}case 60:{let e=z(d$2,M++,x$1,f$3,"variable-name index"),t=a$2.getVar(e);if(t!==void 0)n$2.push(t);else if(h$2)n$2.push(I(q$1(e)));else throw c$1.execution("UNDEFINED_VARIABLE",`Undefined variable: ${e}`,{varName:e});break}case 61:{let e=c(n$2),t=z(d$2,M++,x$1,f$3,"variable-name index");a$2.setVar(t,W?k(e):e),n$2.push(e);break}case 62:{let e=z(d$2,M++,x$1,f$3,"variable-name index"),t=J.get(e);if(t===void 0)throw c$1.internal({code:"GLOBAL_VARIABLE_NOT_RESOLVED",message:`Global variable "${e}" was read before it resolved`,expected:`global variable "${e}" to already be resolved (async preflight should guarantee this)`,found:"no value in the global variable store",context:{varName:e}});n$2.push(t);break}case 63:{let e=c(n$2),t=z(d$2,M++,x$1,f$3,"variable-name index");J.set(t,W?k(e):e),n$2.push(e);break}case 70:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}n$2.push(n(e.toNumber()));break}case 71:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}if(e.type===14){let s=e.value;n$2.push(G$1({r:s.r,g:s.g,b:s.b,a:s.a,format:"hex"}));break}n$2.push(r$1(e.type===2?e.value:e.toNumber()));break}case 74:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}n$2.push(L(e.toNumber()));break}case 140:{let e=c(n$2),t$1=O$1(e);if(t$1){n$2.push(t$1);break}n$2.push(t(e.rational!==void 0?hn(e.rational):bn(e.toNumber())));break}case 141:{let e=c(n$2),t$1=O$1(e);if(t$1){n$2.push(t$1);break}n$2.push(t(gn(e)));break}case 142:{let e=c(n$2),t$1=O$1(e);if(t$1){n$2.push(t$1);break}n$2.push(t(yn(e.toNumber())));break}case 143:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}n$2.push(r$1(e.type===2?e.value:e.toNumber(),"bin"));break}case 144:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}n$2.push(r$1(e.type===2?e.value:e.toNumber(),"oct"));break}case 145:{let e=q(c(n$2),f$3,"converter name").toLowerCase(),t=c(n$2),s=O$1(t);if(s){n$2.push(s);break}let i=G.get(e);i?n$2.push(i(t)):n$2.push(N("UNKNOWN_AS_CONVERTER",`Unknown converter "as ${e}"`));break}case 80:{let e=q(c(n$2),f$3,"unit name"),t=c(n$2),s=O$1(t);if(s){n$2.push(s);break}let i=a$1(t,e);i?n$2.push(v(t.toNumber(),e,i)):n$2.push(u(t.toNumber(),e));break}case 81:{let e=q(c(n$2),f$3,"target unit name"),t=q(c(n$2),f$3,"source unit name"),s=c(n$2),i$1=O$1(s);if(i$1){n$2.push(i$1);break}let l=s.toNumber(),p=c$4(t),g=c$5.isCurrency(t)&&c$5.isCurrency(e);if(p&&c$4(e)===p)n$2.push(u(e$1(l,t,e),e));else if(g){let D=c$5.convertSync(l,t,e);D!==null?n$2.push(u(D,e)):n$2.push(N("CURRENCY_RATE_UNAVAILABLE",`No exchange rate available for ${t} to ${e}`));}else {let D=i(l,t,e);D!==null?n$2.push(u(D,e)):n$2.push(Gt(t,e));}break}case 85:{let e=q(c(n$2),f$3,"unit name"),t$1=f(e);n$2.push(t(t$1.length>0?t$1.join(", "):`No known units for "${e}"`));break}case 83:{let e=q(c(n$2),f$3,"unit name"),t=c(n$2),s=O$1(t);if(s){n$2.push(s);break}let{value:i,unit:l}=h(t.toNumber(),e);n$2.push(u(i,l));break}case 84:{let e=q(c(n$2),f$3,"target unit name"),t=c(n$2),s=O$1(t);if(s){n$2.push(s);break}if(t.type===6){let i$1=t.unit,l=t.toNumber(),p=c$4(i$1),g=c$5.isCurrency(i$1)&&c$5.isCurrency(e);if(p&&c$4(e)===p)n$2.push(u(e$1(l,i$1,e),e));else if(g){let D=c$5.convertSync(l,i$1,e);D!==null?n$2.push(u(D,e)):n$2.push(N("CURRENCY_RATE_UNAVAILABLE",`No exchange rate available for ${i$1} to ${e}`));}else {let D=i(l,i$1,e);D!==null?n$2.push(u(D,e)):n$2.push(Gt(i$1,e));}}else n$2.push(u(t.toNumber(),e));break}case 82:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}n$2.push(n(e.toNumber()));break}case 110:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(e.type!==6||!e.unit){n$2.push(N("RATE_MISSING_DENOMINATOR_UNIT",'Cannot build a rate: the right-hand side of "/" has no unit'));break}let i=t.type===6?t.unit??"":"";n$2.push(w(t.toNumber()/e.toNumber(),i,e.unit));break}case 111:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.type!==6||!x(t.unit)){n$2.push(N("RATE_MUL_LEFT_NOT_A_RATE",'Left-hand side of a rate multiplication must be a rate (e.g. "$50/week")'));break}if(e.type!==6||!e.unit){n$2.push(N("RATE_MUL_RIGHT_MISSING_UNIT","Right-hand side of a rate multiplication must have a unit matching the rate's denominator"));break}n$2.push(ze(t,e));break}case 112:{let e=q(c(n$2),f$3,"denominator unit name"),t=c(n$2),s=O$1(t);if(s){n$2.push(s);break}if(t.type!==6||!x(t.unit)){n$2.push(N("RATE_CONVERT_NOT_A_RATE","Cannot convert a non-rate value's denominator"));break}let{numerator:i,denominator:l}=y$1(t.unit),p=c$4(l),g=c$4(e);if(!p||p!==g){n$2.push(N("RATE_CONVERT_MEASURE_MISMATCH",`Cannot convert a "${l}"-denominated rate to "${e}" \u2014 different measures`));break}let D=e$1(1,e,l);n$2.push(w(t.toNumber()*D,i,e));break}case 120:{let e=c(n$2),t=O$1(e);if(t){n$2.push(t);break}let s=e.toNumber(),i=new Date,l=new Date(i.getFullYear(),i.getMonth(),i.getDate(),0,0,0,0);l.setMinutes(s),n$2.push(K(l.getTime()));break}case 90:n$2.push(K(Date.now()));break;case 95:n$2.push(K(y[qe(d$2,M++,f$3,"constant-pool index",y.length,"number-pool")]));break;case 91:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}n$2.push(K(he(t.toNumber(),e,1,a$2)));break}case 92:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}n$2.push(K(he(t.toNumber(),e,-1,a$2)));break}case 96:{let e=O(d$2,M++,f$3,"workday offset direction")===1?-1:1,t=c(n$2),s=c(n$2),i=O$1(s,t);if(i){n$2.push(i);break}if(t.type!==4){n$2.push(N(r.WORKDAY_OFFSET_EXPECTED_DATE,`"working days after/before/from" expects a date to count from, got ${g[t.type]??"an unsupported value"}`));break}n$2.push(K(qt(t.toNumber(),e*s.toNumber(),a$2)));break}case 97:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.type!==4||e.type!==4){n$2.push(N(r.WORKDAYS_BETWEEN_EXPECTED_DATES,`"working days between" expects two dates, got ${g[t.type]??"an unsupported value"} and ${g[e.type]??"an unsupported value"}`));break}let i=Math.ceil((a$2.getMaxDateOffsetYears()-a$2.getMinDateOffsetYears())*366),l=Ot(t.toNumber(),e.toNumber(),p=>a$2.isHoliday(p),i);if(l===null){n$2.push(N(r.WORKDAYS_BETWEEN_RANGE_TOO_LARGE,`The two dates are more than ${a$2.getMaxDateOffsetYears()-a$2.getMinDateOffsetYears()} years apart, past the working-day count's limit`));break}n$2.push(n(l));break}case 93:case 94:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}let i=e.toNumber(),l=t.toNumber(),p=new Date(l).getDay(),g=f$3===93?(i-p+7)%7:(p-i+7)%7;g===0&&(g=7),n$2.push(K(jt(l,f$3===93?g:-g)));break}case 152:{let e$1=O(d$2,M++,f$3,"row count"),t=O(d$2,M++,f$3,"column count"),s=e$1*t,i=e(s,"matrix cells"),l=null;for(let p=s-1;p>=0;p--){let g=c(n$2);l===null&&(l=O$1(g)),i[p]=g.type===10||g.type===9?g.value:g.toNumber();}if(l){n$2.push(l);break}n$2.push(C$1(e$1,t,Y(e$1,t,i)));break}case 153:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.type!==7){n$2.push(N("MATRIX_INDEX_NOT_A_MATRIX",'Cannot index a non-matrix value with "[...]".'));break}let i=t.value,l=Math.trunc(e.toNumber());if(l<0||l>=i.data.length){n$2.push(N("MATRIX_INDEX_OUT_OF_BOUNDS",`Index ${l} is out of bounds for a ${i.rows}x${i.cols} matrix (valid range: 0-${i.data.length-1}).`));break}let p=S(i,l);n$2.push(X(p));break}case 154:{let e=c(n$2),t=c(n$2),s=c(n$2),i=O$1(s,t,e);if(i){n$2.push(i);break}if(s.type!==7){n$2.push(N("MATRIX_INDEX_NOT_A_MATRIX",'Cannot index a non-matrix value with "[...]".'));break}let l=s.value,p=Math.trunc(t.toNumber()),g=Math.trunc(e.toNumber());if(!U(l,p,g)){n$2.push(N("MATRIX_INDEX_OUT_OF_BOUNDS",`[${p}, ${g}] is out of bounds for a ${l.rows}x${l.cols} matrix.`));break}let D=T(l,p,g);n$2.push(X(D));break}case 156:{let e=c(n$2),t=c(n$2),s=O$1(t,e);if(s){n$2.push(s);break}if(t.type!==0||e.type!==0){n$2.push(N("INVALID_RANGE_BOUND",`A range's bounds must be plain numbers (e.g. "0:3").`));break}let i=t.value,l=e.value;if(!Number.isInteger(i)||!Number.isInteger(l)){n$2.push(N("NON_INTEGER_RANGE_BOUND",`A range's bounds must be whole numbers, got "${i}:${l}".`));break}if(i>l){n$2.push(N("DESCENDING_RANGE",`A range's min (${i}) cannot be greater than its max (${l}) \u2014 did you mean "${l}:${i}"?`));break}n$2.push(F(i,l));break}case 155:{let e$1=c(n$2),t=c(n$2),s=c(n$2),i=O$1(s,t,e$1);if(i){n$2.push(i);break}if(s.type!==7){n$2.push(N("MATRIX_INDEX_NOT_A_MATRIX",'Cannot slice a non-matrix value with "[...]".'));break}if(t.type!==8||e$1.type!==8){n$2.push(N("INVALID_MATRIX_SLICE_BOUND",'Matrix slicing needs range bounds (e.g. "a[0:1, 1:2]").'));break}let l=s.value,p=t.value,g=e$1.value;if(p.min<0||p.max>=l.rows||g.min<0||g.max>=l.cols){n$2.push(N("MATRIX_INDEX_OUT_OF_BOUNDS",`Slice [${p.min}:${p.max}, ${g.min}:${g.max}] is out of bounds for a ${l.rows}x${l.cols} matrix.`));break}let D=p.max-p.min+1,U=g.max-g.min+1,V=e(D*U,"matrix cells");for(let B=0;B<D;B++)for(let C=0;C<U;C++)V[B+C*D]=T(l,p.min+B,g.min+C);n$2.push(C$1(D,U,V));break}case 157:{let e$1=O(d$2,M++,f$3,"body kind"),t=O(d$2,M++,f$3,"body reference"),s=O(d$2,M++,f$3,"collection count");Vt(e$1,t,f$3);let i=new Array(s);for(let T=s-1;T>=0;T--)i[T]=c(n$2);let l=[],p;if(e$1===0){let T=A$1?.[t];if(!T)throw c$1.internal("INTERNAL_MISSING_ANONYMOUS_BODY",`Internal error: MAP_INVOKE referenced missing anonymous body index ${t}`,{ref:t});l=T.params,p=T.program;}else if(e$1===2){let T=Qe(x$1,t,f$3),v=a$2.getUserFunction(T);if(!v){n$2.push(N("UNDEFINED_FUNCTION",`map: undefined function "${T}"`));break}if(v.params.length!==s){n$2.push(N("FUNCTION_ARITY_MISMATCH",`map: "${T}" expects ${v.params.length} argument(s) but ${s} collection(s) were given`));break}l=v.params,p=v.program;}let g=-1,D=new Array(s),U;for(let T=0;T<s;T++){let v=ea(i[T],a$2.getMaxCollectionSize());if(!Array.isArray(v)){U=v;break}if(c$3(v.length,"collection elements"),g===-1)g=v.length;else if(v.length!==g){U=N("MAP_COLLECTION_LENGTH_MISMATCH",`map: all collections must have the same length (got ${g} and ${v.length}).`);break}D[T]=v;}if(U){n$2.push(U);break}let V=e(g,"matrix cells"),B;for(let T=0;T<g;T++){let v=new Array(s);for(let ye=0;ye<s;ye++)v[ye]=D[ye][T];let ae=e$1===1?C[t]?.(v)??N("UNKNOWN_BUILTIN_FUNCTION",`map: unknown builtin function index ${t}`):Bt(l,p,v,a$2,o$2,u$2,m$1,!!h$2),Ze=O$1(ae);if(Ze){B=Ze;break}V[T]=ae.type===10||ae.type===9?ae.value:ae.toNumber();}if(B){n$2.push(B);break}let C$2=i[0],R=C$2?.type===7?C$2.value:void 0;R&&R.rows*R.cols===g?n$2.push(C$1(R.rows,R.cols,V)):n$2.push(C$1(1,g,V));break}case 158:{let e=O(d$2,M++,f$3,"body kind"),t=O(d$2,M++,f$3,"body reference"),s=O(d$2,M++,f$3,"initial-value flag");Vt(e,t,f$3);let i=s?c(n$2):void 0,l=c(n$2),p=[],g;if(e===0){let C=A$1?.[t];if(!C)throw c$1.internal("INTERNAL_MISSING_ANONYMOUS_BODY",`Internal error: REDUCE_INVOKE referenced missing anonymous body index ${t}`,{ref:t});p=C.params,g=C.program;}else if(e===2){let C=Qe(x$1,t,f$3),R=a$2.getUserFunction(C);if(!R){n$2.push(N("UNDEFINED_FUNCTION",`reduce: undefined function "${C}"`));break}if(R.params.length!==2){n$2.push(N("FUNCTION_ARITY_MISMATCH",`reduce: "${C}" must take exactly 2 arguments (accumulator, element), got ${R.params.length}`));break}p=R.params,g=R.program;}let D=ea(l,a$2.getMaxCollectionSize());if(!Array.isArray(D)){n$2.push(D);break}c$3(D.length,"collection elements");let U,V;if(i!==void 0){let C=O$1(i);if(C){n$2.push(C);break}U=i,V=0;}else {if(D.length===0){n$2.push(N("REDUCE_EMPTY_COLLECTION","reduce: cannot reduce an empty collection without an initial value."));break}U=D[0],V=1;}let B;for(let C$1=V;C$1<D.length;C$1++){let R=[U,D[C$1]],T=e===1?C[t]?.(R)??N("UNKNOWN_BUILTIN_FUNCTION",`reduce: unknown builtin function index ${t}`):Bt(p,g,R,a$2,o$2,u$2,m$1,!!h$2),v=O$1(T);if(v){B=v;break}U=T;}if(B){n$2.push(B);break}n$2.push(U);break}case 159:{let e=O(d$2,M++,f$3,"body reference"),t=A$1?.[e];if(!t)throw c$1.internal("INTERNAL_MISSING_ANONYMOUS_BODY",`Internal error: BIND_UNKNOWN referenced missing anonymous body index ${e}`,{ref:e});n$2.push(rn(t.params[0],t.program,a$2,o$2,u$2,m$1,!!h$2));break}}}let K$1=c(n$2);return {type:"value",value:W?k(K$1):K$1}}catch(K){return {type:"error",error:d$1(K)}}finally{b$1();}}export{At as a,Ct as b,Hn as c,Je as d};//# sourceMappingURL=chunk-YJ2OPULK.js.map
2
+ //# sourceMappingURL=chunk-YJ2OPULK.js.map