solve-engine 2.14.0 → 2.15.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 (203) hide show
  1. package/dist/{BytecodeBuilder-BGq9ZiO3.d.cts → BytecodeBuilder-CRYfrFfq.d.cts} +2 -1
  2. package/dist/{BytecodeBuilder-BGq9ZiO3.d.ts → BytecodeBuilder-CRYfrFfq.d.ts} +2 -1
  3. package/dist/{EngineError-Ce1lPkjZ.d.cts → EngineError-Cv5q4Rbv.d.cts} +3 -1
  4. package/dist/{EngineError-Ce1lPkjZ.d.ts → EngineError-Cv5q4Rbv.d.ts} +3 -1
  5. package/dist/{Lexer-B4C1qHXu.d.cts → Lexer-CCHFDcgP.d.cts} +1 -1
  6. package/dist/{Lexer-DKMlj7Sy.d.ts → Lexer-CqagTewQ.d.ts} +1 -1
  7. package/dist/{PackageCompatibility-BG0iur4I.d.cts → PackageCompatibility-C2IQZ_w3.d.cts} +1 -1
  8. package/dist/{PackageCompatibility-BlIcQg5v.d.ts → PackageCompatibility-Cl7GF_Iu.d.ts} +1 -1
  9. package/dist/{PackageRegistry-BJ0QQd3k.d.ts → PackageRegistry-CK_JoX50.d.ts} +14 -7
  10. package/dist/{PackageRegistry-DeGDZkNt.d.cts → PackageRegistry-CZO1IbS-.d.cts} +14 -7
  11. package/dist/{Parselet-Blq8B0Gj.d.ts → Parselet-CK0bNO1l.d.ts} +2 -2
  12. package/dist/{Parselet-BSndkWEY.d.cts → Parselet-DOGmj6N6.d.cts} +2 -2
  13. package/dist/{ScopeManager-D8nLv--u.d.cts → ScopeManager-BtqiTVjG.d.cts} +3 -3
  14. package/dist/{ScopeManager-CF3cZUqW.d.ts → ScopeManager-C6c1WmJD.d.ts} +3 -3
  15. package/dist/{TokenNormalizer-DnlL7_8c.d.cts → TokenNormalizer-BfTHg1qt.d.cts} +35 -0
  16. package/dist/{TokenNormalizer-DCWdZjGz.d.ts → TokenNormalizer-d7F1KQFs.d.ts} +35 -0
  17. package/dist/{VMCheckpoints-Dy39SVHa.d.cts → VMCheckpoints-BFDlaGse.d.cts} +2 -2
  18. package/dist/{VMCheckpoints-BsR5_auF.d.ts → VMCheckpoints-DJdvpliw.d.ts} +2 -2
  19. package/dist/{WorkerError-B4p6PNfx.d.cts → WorkerError-FH7KXX4_.d.cts} +1 -1
  20. package/dist/{WorkerError-Dhj9BQ_A.d.ts → WorkerError-J3v3ix_z.d.ts} +1 -1
  21. package/dist/{chunk-75XDS65A.cjs → chunk-2XZCLDHJ.cjs} +2 -2
  22. package/dist/chunk-2XZCLDHJ.cjs.map +1 -0
  23. package/dist/{chunk-BW6FR7DA.js → chunk-3PDDKWTJ.js} +3 -3
  24. package/dist/{chunk-BW6FR7DA.js.map → chunk-3PDDKWTJ.js.map} +1 -1
  25. package/dist/{chunk-3MBENI4Q.cjs → chunk-3Y56PSQD.cjs} +3 -3
  26. package/dist/{chunk-3MBENI4Q.cjs.map → chunk-3Y56PSQD.cjs.map} +1 -1
  27. package/dist/{chunk-YOHM2WQT.js → chunk-4IIFFJTJ.js} +4 -4
  28. package/dist/chunk-4IIFFJTJ.js.map +1 -0
  29. package/dist/chunk-5SDSIRPL.js +2 -0
  30. package/dist/chunk-5SDSIRPL.js.map +1 -0
  31. package/dist/{chunk-PNDQRCRQ.cjs → chunk-6U66HQKQ.cjs} +2 -2
  32. package/dist/chunk-6U66HQKQ.cjs.map +1 -0
  33. package/dist/{chunk-VBSMA7WJ.cjs → chunk-ABVDKMNF.cjs} +2 -2
  34. package/dist/chunk-ABVDKMNF.cjs.map +1 -0
  35. package/dist/chunk-AYTEPHRO.js +3 -0
  36. package/dist/chunk-AYTEPHRO.js.map +1 -0
  37. package/dist/chunk-C5MP74ER.js +2 -0
  38. package/dist/chunk-C5MP74ER.js.map +1 -0
  39. package/dist/{chunk-JQBG3LX4.js → chunk-CUDPOWXA.js} +2 -2
  40. package/dist/{chunk-JQBG3LX4.js.map → chunk-CUDPOWXA.js.map} +1 -1
  41. package/dist/{chunk-LUMVKVFQ.cjs → chunk-EEUA3OJ6.cjs} +2 -2
  42. package/dist/{chunk-LUMVKVFQ.cjs.map → chunk-EEUA3OJ6.cjs.map} +1 -1
  43. package/dist/chunk-EEVUKZ5B.cjs +2 -0
  44. package/dist/{chunk-EURCQMZK.cjs.map → chunk-EEVUKZ5B.cjs.map} +1 -1
  45. package/dist/{chunk-3HYO3QYW.cjs → chunk-EXCFCHAT.cjs} +2 -2
  46. package/dist/{chunk-3HYO3QYW.cjs.map → chunk-EXCFCHAT.cjs.map} +1 -1
  47. package/dist/chunk-FAGFPVYK.cjs +2 -0
  48. package/dist/chunk-FAGFPVYK.cjs.map +1 -0
  49. package/dist/chunk-FPGYRFJY.cjs +5 -0
  50. package/dist/chunk-FPGYRFJY.cjs.map +1 -0
  51. package/dist/chunk-FVQWN5HZ.cjs +2 -0
  52. package/dist/chunk-FVQWN5HZ.cjs.map +1 -0
  53. package/dist/{chunk-4BZIYU7S.cjs → chunk-GWCBPITD.cjs} +3 -3
  54. package/dist/{chunk-4BZIYU7S.cjs.map → chunk-GWCBPITD.cjs.map} +1 -1
  55. package/dist/{chunk-YAYBVVG2.js → chunk-GWJJRH32.js} +3 -3
  56. package/dist/{chunk-YAYBVVG2.js.map → chunk-GWJJRH32.js.map} +1 -1
  57. package/dist/chunk-HDGARCI2.cjs +2 -0
  58. package/dist/chunk-HDGARCI2.cjs.map +1 -0
  59. package/dist/{chunk-MVP2YD4X.cjs → chunk-HG4NPDN5.cjs} +2 -2
  60. package/dist/{chunk-MVP2YD4X.cjs.map → chunk-HG4NPDN5.cjs.map} +1 -1
  61. package/dist/{chunk-FNNIAJNY.cjs → chunk-IMXSVHQK.cjs} +2 -2
  62. package/dist/{chunk-FNNIAJNY.cjs.map → chunk-IMXSVHQK.cjs.map} +1 -1
  63. package/dist/{chunk-LH7URJZT.js → chunk-IPOU3JTA.js} +3 -3
  64. package/dist/{chunk-LH7URJZT.js.map → chunk-IPOU3JTA.js.map} +1 -1
  65. package/dist/{chunk-WTEXBPBR.js → chunk-JOIQFDZQ.js} +2 -2
  66. package/dist/chunk-JOIQFDZQ.js.map +1 -0
  67. package/dist/{chunk-KHCNMNZZ.js → chunk-JP4JMQOG.js} +2 -2
  68. package/dist/{chunk-KHCNMNZZ.js.map → chunk-JP4JMQOG.js.map} +1 -1
  69. package/dist/chunk-KKMLFYVW.cjs +3 -0
  70. package/dist/chunk-KKMLFYVW.cjs.map +1 -0
  71. package/dist/{chunk-62LMTO4F.js → chunk-LHLW7JLS.js} +2 -2
  72. package/dist/{chunk-62LMTO4F.js.map → chunk-LHLW7JLS.js.map} +1 -1
  73. package/dist/{chunk-SOMGSIO4.cjs → chunk-NAZ6PGLS.cjs} +2 -2
  74. package/dist/chunk-NAZ6PGLS.cjs.map +1 -0
  75. package/dist/{chunk-A33K7NY4.js → chunk-O3ALJLYC.js} +2 -2
  76. package/dist/chunk-O3ALJLYC.js.map +1 -0
  77. package/dist/chunk-P4ETODMP.js +2 -0
  78. package/dist/chunk-P4ETODMP.js.map +1 -0
  79. package/dist/{chunk-P6WPEUAJ.cjs → chunk-PREIL3IB.cjs} +2 -2
  80. package/dist/{chunk-P6WPEUAJ.cjs.map → chunk-PREIL3IB.cjs.map} +1 -1
  81. package/dist/chunk-Q3PSTNSY.js +2 -0
  82. package/dist/chunk-Q3PSTNSY.js.map +1 -0
  83. package/dist/{chunk-NQSWT3UO.js → chunk-Q7HPPLMG.js} +2 -2
  84. package/dist/{chunk-NQSWT3UO.js.map → chunk-Q7HPPLMG.js.map} +1 -1
  85. package/dist/chunk-RC4M6HBX.cjs +2 -0
  86. package/dist/chunk-RC4M6HBX.cjs.map +1 -0
  87. package/dist/{chunk-MSYX32PF.cjs → chunk-S3DFU33X.cjs} +2 -2
  88. package/dist/{chunk-MSYX32PF.cjs.map → chunk-S3DFU33X.cjs.map} +1 -1
  89. package/dist/chunk-TVE2DNPU.js +2 -0
  90. package/dist/chunk-TVE2DNPU.js.map +1 -0
  91. package/dist/{chunk-YNMMRH44.js → chunk-TZYMXNIB.js} +2 -2
  92. package/dist/chunk-TZYMXNIB.js.map +1 -0
  93. package/dist/{chunk-6TPXH6Y5.cjs → chunk-UUAFDZK6.cjs} +3 -3
  94. package/dist/{chunk-6TPXH6Y5.cjs.map → chunk-UUAFDZK6.cjs.map} +1 -1
  95. package/dist/{chunk-QYO7IEPR.js → chunk-UZSPBFZN.js} +2 -2
  96. package/dist/{chunk-QYO7IEPR.js.map → chunk-UZSPBFZN.js.map} +1 -1
  97. package/dist/chunk-VJP4GGCW.cjs +2 -0
  98. package/dist/chunk-VJP4GGCW.cjs.map +1 -0
  99. package/dist/chunk-W5ELYJ4Z.cjs +2 -0
  100. package/dist/chunk-W5ELYJ4Z.cjs.map +1 -0
  101. package/dist/{chunk-YTCTUBR2.js → chunk-WOIJPV7Z.js} +2 -2
  102. package/dist/{chunk-YTCTUBR2.js.map → chunk-WOIJPV7Z.js.map} +1 -1
  103. package/dist/{chunk-MVZUTETT.js → chunk-XK23K3EJ.js} +2 -2
  104. package/dist/{chunk-MVZUTETT.js.map → chunk-XK23K3EJ.js.map} +1 -1
  105. package/dist/{chunk-MPB7KUN5.js → chunk-YAZ4DUJJ.js} +2 -2
  106. package/dist/chunk-YAZ4DUJJ.js.map +1 -0
  107. package/dist/chunk-YFX53MZF.js +2 -0
  108. package/dist/chunk-YFX53MZF.js.map +1 -0
  109. package/dist/constants.cjs +1 -1
  110. package/dist/constants.js +1 -1
  111. package/dist/engine.cjs +1 -1
  112. package/dist/engine.d.cts +10 -10
  113. package/dist/engine.d.ts +10 -10
  114. package/dist/engine.js +1 -1
  115. package/dist/errors.cjs +1 -1
  116. package/dist/errors.d.cts +3 -3
  117. package/dist/errors.d.ts +3 -3
  118. package/dist/errors.js +1 -1
  119. package/dist/format.cjs +1 -1
  120. package/dist/format.js +1 -1
  121. package/dist/index.cjs +1 -1
  122. package/dist/index.d.cts +10 -10
  123. package/dist/index.d.ts +10 -10
  124. package/dist/index.js +1 -1
  125. package/dist/language.d.cts +9 -9
  126. package/dist/language.d.ts +9 -9
  127. package/dist/lexer.cjs +1 -1
  128. package/dist/lexer.d.cts +2 -2
  129. package/dist/lexer.d.ts +2 -2
  130. package/dist/lexer.js +1 -1
  131. package/dist/normalizer.cjs +1 -1
  132. package/dist/normalizer.d.cts +2 -2
  133. package/dist/normalizer.d.ts +2 -2
  134. package/dist/normalizer.js +1 -1
  135. package/dist/packages.cjs +1 -1
  136. package/dist/packages.d.cts +8 -8
  137. package/dist/packages.d.ts +8 -8
  138. package/dist/packages.js +1 -1
  139. package/dist/parser.cjs +1 -1
  140. package/dist/parser.d.cts +3 -3
  141. package/dist/parser.d.ts +3 -3
  142. package/dist/parser.js +1 -1
  143. package/dist/{pipeline-BM8xc0CZ.d.cts → pipeline-B4wf3M1h.d.cts} +5 -24
  144. package/dist/{pipeline-J2ehIm7t.d.ts → pipeline-QIT4iD8f.d.ts} +5 -24
  145. package/dist/resolvers.d.cts +1 -1
  146. package/dist/resolvers.d.ts +1 -1
  147. package/dist/testing.cjs +2 -2
  148. package/dist/testing.d.cts +9 -9
  149. package/dist/testing.d.ts +9 -9
  150. package/dist/testing.js +1 -1
  151. package/dist/uom.cjs +1 -1
  152. package/dist/uom.d.cts +1 -1
  153. package/dist/uom.d.ts +1 -1
  154. package/dist/uom.js +1 -1
  155. package/dist/vm.cjs +1 -1
  156. package/dist/vm.d.cts +8 -7
  157. package/dist/vm.d.ts +8 -7
  158. package/dist/vm.js +1 -1
  159. package/dist/worker.cjs +2 -2
  160. package/dist/worker.d.cts +9 -9
  161. package/dist/worker.d.ts +9 -9
  162. package/dist/worker.js +1 -1
  163. package/package.json +1 -1
  164. package/dist/chunk-2VK3NH5S.cjs +0 -3
  165. package/dist/chunk-2VK3NH5S.cjs.map +0 -1
  166. package/dist/chunk-3GAWAMT4.js +0 -2
  167. package/dist/chunk-3GAWAMT4.js.map +0 -1
  168. package/dist/chunk-4FCHZYAH.js +0 -3
  169. package/dist/chunk-4FCHZYAH.js.map +0 -1
  170. package/dist/chunk-4QVBSG6B.cjs +0 -2
  171. package/dist/chunk-4QVBSG6B.cjs.map +0 -1
  172. package/dist/chunk-556Q7VZC.cjs +0 -2
  173. package/dist/chunk-556Q7VZC.cjs.map +0 -1
  174. package/dist/chunk-75XDS65A.cjs.map +0 -1
  175. package/dist/chunk-A33K7NY4.js.map +0 -1
  176. package/dist/chunk-C65UDMWH.cjs +0 -2
  177. package/dist/chunk-C65UDMWH.cjs.map +0 -1
  178. package/dist/chunk-EURCQMZK.cjs +0 -2
  179. package/dist/chunk-FUDVKPB7.cjs +0 -2
  180. package/dist/chunk-FUDVKPB7.cjs.map +0 -1
  181. package/dist/chunk-GMSBBLUQ.js +0 -2
  182. package/dist/chunk-GMSBBLUQ.js.map +0 -1
  183. package/dist/chunk-JEFMG6CV.js +0 -2
  184. package/dist/chunk-JEFMG6CV.js.map +0 -1
  185. package/dist/chunk-K4MME6ZT.js +0 -2
  186. package/dist/chunk-K4MME6ZT.js.map +0 -1
  187. package/dist/chunk-MPB7KUN5.js.map +0 -1
  188. package/dist/chunk-PL7AH5EU.cjs +0 -5
  189. package/dist/chunk-PL7AH5EU.cjs.map +0 -1
  190. package/dist/chunk-PNDQRCRQ.cjs.map +0 -1
  191. package/dist/chunk-SNVPM27Q.cjs +0 -2
  192. package/dist/chunk-SNVPM27Q.cjs.map +0 -1
  193. package/dist/chunk-SOMGSIO4.cjs.map +0 -1
  194. package/dist/chunk-T3FBAFRR.js +0 -2
  195. package/dist/chunk-T3FBAFRR.js.map +0 -1
  196. package/dist/chunk-VBSMA7WJ.cjs.map +0 -1
  197. package/dist/chunk-WTEXBPBR.js.map +0 -1
  198. package/dist/chunk-WYIOXAFW.cjs +0 -2
  199. package/dist/chunk-WYIOXAFW.cjs.map +0 -1
  200. package/dist/chunk-YNMMRH44.js.map +0 -1
  201. package/dist/chunk-YOHM2WQT.js.map +0 -1
  202. package/dist/chunk-YVKHEAFT.js +0 -2
  203. package/dist/chunk-YVKHEAFT.js.map +0 -1
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';require('./chunk-3MBENI4Q.cjs'),require('./chunk-EFJCC6FJ.cjs');var chunkPL7AH5EU_cjs=require('./chunk-PL7AH5EU.cjs');require('./chunk-FNNIAJNY.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-LNZNJSRW.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-556Q7VZC.cjs'),require('./chunk-MVP2YD4X.cjs'),require('./chunk-6TPXH6Y5.cjs'),require('./chunk-R2SZFJTT.cjs');var chunk2VK3NH5S_cjs=require('./chunk-2VK3NH5S.cjs');require('./chunk-FUDVKPB7.cjs'),require('./chunk-WYIOXAFW.cjs');var chunk4QVBSG6B_cjs=require('./chunk-4QVBSG6B.cjs');require('./chunk-C65UDMWH.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-EURCQMZK.cjs'),require('./chunk-4BZIYU7S.cjs'),require('./chunk-VBSMA7WJ.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-75XDS65A.cjs');var chunkPNDQRCRQ_cjs=require('./chunk-PNDQRCRQ.cjs');require('./chunk-BKSKZA4W.cjs');var chunkLUMVKVFQ_cjs=require('./chunk-LUMVKVFQ.cjs');require('./chunk-3HYO3QYW.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-SNVPM27Q.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-MSYX32PF.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs');var chunkSOMGSIO4_cjs=require('./chunk-SOMGSIO4.cjs');var r={DEFINE_FUNCTION_INVALID_NAME:"DEFINE_FUNCTION_INVALID_NAME",DEFINE_FUNCTION_INVALID_SPEC:"DEFINE_FUNCTION_INVALID_SPEC",DEFINE_FUNCTION_ARITY_MISMATCH:"DEFINE_FUNCTION_ARITY_MISMATCH",DEFINE_FUNCTION_ARGUMENT_TYPE:"DEFINE_FUNCTION_ARGUMENT_TYPE",DEFINE_FUNCTION_RETURN_TYPE:"DEFINE_FUNCTION_RETURN_TYPE"},b=/^[a-z_][a-z0-9_]*$/i,y=new Set(["number","string","boolean"]);function u(e){return e===1?"1 argument":`${e} arguments`}function f(e){switch(e.type){case 0:case 1:return "a number";case 3:return "a string";case 10:return "a boolean";case 2:return "a big integer";case 5:return "a percentage";case 6:return "a value with a unit";case 4:return "a date";case 7:return "a matrix";case 8:return "a range";case 9:return "a symbolic expression";default:return "an unsupported value"}}function A(e,n,t){switch(n.type){case "number":if(e.type===0||e.type===1)return e.toNumber();break;case "string":if(e.type===3)return e.value;break;case "boolean":if(e.type===10)return e.value;break}throw chunkSOMGSIO4_cjs.c.execution({code:r.DEFINE_FUNCTION_ARGUMENT_TYPE,message:`${t}() expects "${n.name}" to be a ${n.type}, but was given ${f(e)}`,expected:`a ${n.type}`,found:f(e),context:{functionName:t,argName:n.name,expectedType:n.type}})}function S(e,n,t){switch(n){case "number":if(typeof e=="number")return chunkPNDQRCRQ_cjs.n(e);break;case "string":if(typeof e=="string")return chunkPNDQRCRQ_cjs.t(e);break;case "boolean":if(typeof e=="boolean")return chunkPNDQRCRQ_cjs.L(e);break}throw chunkSOMGSIO4_cjs.c.internal({code:r.DEFINE_FUNCTION_RETURN_TYPE,message:`${t}() is declared to return a ${n}, but its implementation returned ${typeof e}`,expected:`a ${n}`,found:typeof e,context:{functionName:t,expectedType:n}})}var p=class{constructor(n){this.fnName=n;this.category="Function";}parse(n,t,i){n.consume("LPAREN");let a=0;if(n.peek()?.type!=="RPAREN")for(n.parseExpression(chunk4QVBSG6B_cjs.a.Lowest,i),a++;n.match("COMMA");)n.parseExpression(chunk4QVBSG6B_cjs.a.Lowest,i),a++;n.consume("RPAREN"),i.emitPluginCall(this.fnName,a);}};function P(e){let n=e.args.length;return t=>{if(t.length!==n)throw chunkSOMGSIO4_cjs.c.execution({code:r.DEFINE_FUNCTION_ARITY_MISMATCH,message:`${e.name}() takes ${u(n)}, but was given ${t.length===0?"none":u(t.length)}`,expected:u(n),found:t.length===0?"none":u(t.length),context:{functionName:e.name,expected:n,actual:t.length}});let i=new Array(n);for(let s=0;s<n;s++)i[s]=A(t[s],e.args[s],e.name);let a=e.call(...i);return S(a,e.returns,e.name)}}function V(e){if(typeof e?.name!="string"||!b.test(e.name))throw chunkSOMGSIO4_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_NAME,message:`defineFunction: name must be a single identifier, got ${JSON.stringify(e?.name)}`,suggestion:'e.g. "vat" or "net_price"',context:{name:e?.name}});if(!Array.isArray(e.args))throw chunkSOMGSIO4_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" args must be an array`,context:{name:e.name}});for(let n of e.args){if(typeof n?.name!="string"||n.name.length===0)throw chunkSOMGSIO4_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has an argument with no name`,context:{name:e.name}});if(!y.has(n.type))throw chunkSOMGSIO4_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" argument "${n.name}" has unsupported type ${JSON.stringify(n.type)}`,suggestion:"supported argument types are number, string, boolean",context:{name:e.name,argName:n.name,type:n.type}})}if(!y.has(e.returns))throw chunkSOMGSIO4_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has unsupported return type ${JSON.stringify(e.returns)}`,suggestion:"supported return types are number, string, boolean",context:{name:e.name,returns:e.returns}});if(typeof e.call!="function")throw chunkSOMGSIO4_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" is missing a call implementation`,context:{name:e.name}})}function O(e){V(e);let n=e.name,t=`DEFINE_FN_${n.toUpperCase()}`;return {name:`solve-fn-${n}`,lexerVocabulary:{keywords:{[n.toLowerCase()]:t}},prefixParselets:{[t]:new p(n)},pluginFunctions:{[n]:P(e)}}}function h(e={}){let{extraPackages:n=[],...t}=e;return new chunkPL7AH5EU_cjs.n({...t,packages:n.length>0?[...chunk2VK3NH5S_cjs.y,...n]:chunk2VK3NH5S_cjs.y})}Object.defineProperty(exports,"ExpressionEngine",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.n}});Object.defineProperty(exports,"SNAPSHOT_FORMAT",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.d}});Object.defineProperty(exports,"SNAPSHOT_VERSION",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.e}});Object.defineProperty(exports,"SnapshotErrorCodes",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.f}});Object.defineProperty(exports,"assertEngineVersionCompatible",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.c}});Object.defineProperty(exports,"checkEngineVersionCompatibility",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.b}});Object.defineProperty(exports,"checkPackageCompatibility",{enumerable:true,get:function(){return chunkPL7AH5EU_cjs.a}});Object.defineProperty(exports,"ENGINE_VERSION",{enumerable:true,get:function(){return chunkLUMVKVFQ_cjs.a}});exports.DefineFunctionErrorCodes=r;exports.createEngine=h;exports.defineFunction=O;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';require('./chunk-3Y56PSQD.cjs'),require('./chunk-EFJCC6FJ.cjs');var chunkFPGYRFJY_cjs=require('./chunk-FPGYRFJY.cjs');require('./chunk-IMXSVHQK.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-LNZNJSRW.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-VJP4GGCW.cjs'),require('./chunk-HG4NPDN5.cjs'),require('./chunk-UUAFDZK6.cjs'),require('./chunk-R2SZFJTT.cjs');var chunkKKMLFYVW_cjs=require('./chunk-KKMLFYVW.cjs');require('./chunk-W5ELYJ4Z.cjs'),require('./chunk-HDGARCI2.cjs');var chunkFVQWN5HZ_cjs=require('./chunk-FVQWN5HZ.cjs');require('./chunk-RC4M6HBX.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-EEVUKZ5B.cjs'),require('./chunk-GWCBPITD.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-2XZCLDHJ.cjs');var chunk6U66HQKQ_cjs=require('./chunk-6U66HQKQ.cjs');require('./chunk-BKSKZA4W.cjs');var chunkEEUA3OJ6_cjs=require('./chunk-EEUA3OJ6.cjs');require('./chunk-EXCFCHAT.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-FAGFPVYK.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs');var chunkNAZ6PGLS_cjs=require('./chunk-NAZ6PGLS.cjs');var r={DEFINE_FUNCTION_INVALID_NAME:"DEFINE_FUNCTION_INVALID_NAME",DEFINE_FUNCTION_INVALID_SPEC:"DEFINE_FUNCTION_INVALID_SPEC",DEFINE_FUNCTION_ARITY_MISMATCH:"DEFINE_FUNCTION_ARITY_MISMATCH",DEFINE_FUNCTION_ARGUMENT_TYPE:"DEFINE_FUNCTION_ARGUMENT_TYPE",DEFINE_FUNCTION_RETURN_TYPE:"DEFINE_FUNCTION_RETURN_TYPE"},b=/^[a-z_][a-z0-9_]*$/i,y=new Set(["number","string","boolean"]);function u(e){return e===1?"1 argument":`${e} arguments`}function f(e){switch(e.type){case 0:case 1:return "a number";case 3:return "a string";case 10:return "a boolean";case 2:return "a big integer";case 5:return "a percentage";case 6:return "a value with a unit";case 4:return "a date";case 7:return "a matrix";case 8:return "a range";case 9:return "a symbolic expression";default:return "an unsupported value"}}function A(e,n,t){switch(n.type){case "number":if(e.type===0||e.type===1)return e.toNumber();break;case "string":if(e.type===3)return e.value;break;case "boolean":if(e.type===10)return e.value;break}throw chunkNAZ6PGLS_cjs.c.execution({code:r.DEFINE_FUNCTION_ARGUMENT_TYPE,message:`${t}() expects "${n.name}" to be a ${n.type}, but was given ${f(e)}`,expected:`a ${n.type}`,found:f(e),context:{functionName:t,argName:n.name,expectedType:n.type}})}function S(e,n,t){switch(n){case "number":if(typeof e=="number")return chunk6U66HQKQ_cjs.n(e);break;case "string":if(typeof e=="string")return chunk6U66HQKQ_cjs.t(e);break;case "boolean":if(typeof e=="boolean")return chunk6U66HQKQ_cjs.L(e);break}throw chunkNAZ6PGLS_cjs.c.internal({code:r.DEFINE_FUNCTION_RETURN_TYPE,message:`${t}() is declared to return a ${n}, but its implementation returned ${typeof e}`,expected:`a ${n}`,found:typeof e,context:{functionName:t,expectedType:n}})}var p=class{constructor(n){this.fnName=n;this.category="Function";}parse(n,t,i){n.consume("LPAREN");let a=0;if(n.peek()?.type!=="RPAREN")for(n.parseExpression(chunkFVQWN5HZ_cjs.a.Lowest,i),a++;n.match("COMMA");)n.parseExpression(chunkFVQWN5HZ_cjs.a.Lowest,i),a++;n.consume("RPAREN"),i.emitPluginCall(this.fnName,a);}};function P(e){let n=e.args.length;return t=>{if(t.length!==n)throw chunkNAZ6PGLS_cjs.c.execution({code:r.DEFINE_FUNCTION_ARITY_MISMATCH,message:`${e.name}() takes ${u(n)}, but was given ${t.length===0?"none":u(t.length)}`,expected:u(n),found:t.length===0?"none":u(t.length),context:{functionName:e.name,expected:n,actual:t.length}});let i=new Array(n);for(let s=0;s<n;s++)i[s]=A(t[s],e.args[s],e.name);let a=e.call(...i);return S(a,e.returns,e.name)}}function V(e){if(typeof e?.name!="string"||!b.test(e.name))throw chunkNAZ6PGLS_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_NAME,message:`defineFunction: name must be a single identifier, got ${JSON.stringify(e?.name)}`,suggestion:'e.g. "vat" or "net_price"',context:{name:e?.name}});if(!Array.isArray(e.args))throw chunkNAZ6PGLS_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" args must be an array`,context:{name:e.name}});for(let n of e.args){if(typeof n?.name!="string"||n.name.length===0)throw chunkNAZ6PGLS_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has an argument with no name`,context:{name:e.name}});if(!y.has(n.type))throw chunkNAZ6PGLS_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" argument "${n.name}" has unsupported type ${JSON.stringify(n.type)}`,suggestion:"supported argument types are number, string, boolean",context:{name:e.name,argName:n.name,type:n.type}})}if(!y.has(e.returns))throw chunkNAZ6PGLS_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has unsupported return type ${JSON.stringify(e.returns)}`,suggestion:"supported return types are number, string, boolean",context:{name:e.name,returns:e.returns}});if(typeof e.call!="function")throw chunkNAZ6PGLS_cjs.c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" is missing a call implementation`,context:{name:e.name}})}function O(e){V(e);let n=e.name,t=`DEFINE_FN_${n.toUpperCase()}`;return {name:`solve-fn-${n}`,lexerVocabulary:{keywords:{[n.toLowerCase()]:t}},prefixParselets:{[t]:new p(n)},pluginFunctions:{[n]:P(e)}}}function h(e={}){let{extraPackages:n=[],...t}=e;return new chunkFPGYRFJY_cjs.n({...t,packages:n.length>0?[...chunkKKMLFYVW_cjs.y,...n]:chunkKKMLFYVW_cjs.y})}Object.defineProperty(exports,"ExpressionEngine",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.n}});Object.defineProperty(exports,"SNAPSHOT_FORMAT",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.d}});Object.defineProperty(exports,"SNAPSHOT_VERSION",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.e}});Object.defineProperty(exports,"SnapshotErrorCodes",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.f}});Object.defineProperty(exports,"assertEngineVersionCompatible",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.c}});Object.defineProperty(exports,"checkEngineVersionCompatibility",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.b}});Object.defineProperty(exports,"checkPackageCompatibility",{enumerable:true,get:function(){return chunkFPGYRFJY_cjs.a}});Object.defineProperty(exports,"ENGINE_VERSION",{enumerable:true,get:function(){return chunkEEUA3OJ6_cjs.a}});exports.DefineFunctionErrorCodes=r;exports.createEngine=h;exports.defineFunction=O;//# sourceMappingURL=index.cjs.map
2
2
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -1,19 +1,19 @@
1
- import { I as IEnginePackage, a as EngineOptions, E as ExpressionEngine } from './PackageRegistry-DeGDZkNt.cjs';
2
- export { b as EngineRestoreOptions, c as EngineSnapshot, d as Explanation, e as ExplanationStep, S as SNAPSHOT_FORMAT, f as SNAPSHOT_VERSION, g as SerializedAnonymousBody, h as SerializedBytecode, i as SerializedDecimal, j as SerializedLineCacheEntry, k as SerializedNumber, l as SerializedRational, m as SerializedUserFunction, n as SerializedValue, o as SnapshotErrorCodes } from './PackageRegistry-DeGDZkNt.cjs';
3
- export { a as CompatibilityConflict, b as CompatibilityConflictKind, C as CompatibilityReport, c as CompatibilitySeverity, d as checkPackageCompatibility } from './PackageCompatibility-BG0iur4I.cjs';
1
+ import { I as IEnginePackage, a as EngineOptions, E as ExpressionEngine } from './PackageRegistry-CZO1IbS-.cjs';
2
+ export { b as EngineRestoreOptions, c as EngineSnapshot, d as Explanation, e as ExplanationStep, S as SNAPSHOT_FORMAT, f as SNAPSHOT_VERSION, g as SerializedAnonymousBody, h as SerializedBytecode, i as SerializedDecimal, j as SerializedLineCacheEntry, k as SerializedNumber, l as SerializedRational, m as SerializedUserFunction, n as SerializedValue, o as SnapshotErrorCodes } from './PackageRegistry-CZO1IbS-.cjs';
3
+ export { a as CompatibilityConflict, b as CompatibilityConflictKind, C as CompatibilityReport, c as CompatibilitySeverity, d as checkPackageCompatibility } from './PackageCompatibility-C2IQZ_w3.cjs';
4
4
  export { E as EngineConfigOverride } from './Configuration-BGQn-cJ8.cjs';
5
5
  export { ENGINE_VERSION } from './constants.cjs';
6
- import './Parselet-BSndkWEY.cjs';
7
- import './BytecodeBuilder-BGq9ZiO3.cjs';
6
+ import './Parselet-DOGmj6N6.cjs';
7
+ import './BytecodeBuilder-CRYfrFfq.cjs';
8
8
  import './Token-CbP_OutD.cjs';
9
- import './pipeline-BM8xc0CZ.cjs';
9
+ import './pipeline-B4wf3M1h.cjs';
10
10
  import './Value-DCTqTSeP.cjs';
11
- import './Lexer-B4C1qHXu.cjs';
11
+ import './Lexer-CCHFDcgP.cjs';
12
12
  import './resolvers.cjs';
13
13
  import '@tanstack/query-core';
14
- import './TokenNormalizer-DnlL7_8c.cjs';
15
- import './ScopeManager-D8nLv--u.cjs';
16
- import './EngineError-Ce1lPkjZ.cjs';
14
+ import './TokenNormalizer-BfTHg1qt.cjs';
15
+ import './ScopeManager-BtqiTVjG.cjs';
16
+ import './EngineError-Cv5q4Rbv.cjs';
17
17
 
18
18
  /**
19
19
  * A higher-level, declarative way to contribute a single `name(args)`
package/dist/index.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { I as IEnginePackage, a as EngineOptions, E as ExpressionEngine } from './PackageRegistry-BJ0QQd3k.js';
2
- export { b as EngineRestoreOptions, c as EngineSnapshot, d as Explanation, e as ExplanationStep, S as SNAPSHOT_FORMAT, f as SNAPSHOT_VERSION, g as SerializedAnonymousBody, h as SerializedBytecode, i as SerializedDecimal, j as SerializedLineCacheEntry, k as SerializedNumber, l as SerializedRational, m as SerializedUserFunction, n as SerializedValue, o as SnapshotErrorCodes } from './PackageRegistry-BJ0QQd3k.js';
3
- export { a as CompatibilityConflict, b as CompatibilityConflictKind, C as CompatibilityReport, c as CompatibilitySeverity, d as checkPackageCompatibility } from './PackageCompatibility-BlIcQg5v.js';
1
+ import { I as IEnginePackage, a as EngineOptions, E as ExpressionEngine } from './PackageRegistry-CK_JoX50.js';
2
+ export { b as EngineRestoreOptions, c as EngineSnapshot, d as Explanation, e as ExplanationStep, S as SNAPSHOT_FORMAT, f as SNAPSHOT_VERSION, g as SerializedAnonymousBody, h as SerializedBytecode, i as SerializedDecimal, j as SerializedLineCacheEntry, k as SerializedNumber, l as SerializedRational, m as SerializedUserFunction, n as SerializedValue, o as SnapshotErrorCodes } from './PackageRegistry-CK_JoX50.js';
3
+ export { a as CompatibilityConflict, b as CompatibilityConflictKind, C as CompatibilityReport, c as CompatibilitySeverity, d as checkPackageCompatibility } from './PackageCompatibility-Cl7GF_Iu.js';
4
4
  export { E as EngineConfigOverride } from './Configuration-BGQn-cJ8.js';
5
5
  export { ENGINE_VERSION } from './constants.js';
6
- import './Parselet-Blq8B0Gj.js';
7
- import './BytecodeBuilder-BGq9ZiO3.js';
6
+ import './Parselet-CK0bNO1l.js';
7
+ import './BytecodeBuilder-CRYfrFfq.js';
8
8
  import './Token-CbP_OutD.js';
9
- import './pipeline-J2ehIm7t.js';
9
+ import './pipeline-QIT4iD8f.js';
10
10
  import './Value-DCTqTSeP.js';
11
- import './Lexer-DKMlj7Sy.js';
11
+ import './Lexer-CqagTewQ.js';
12
12
  import './resolvers.js';
13
13
  import '@tanstack/query-core';
14
- import './TokenNormalizer-DCWdZjGz.js';
15
- import './ScopeManager-CF3cZUqW.js';
16
- import './EngineError-Ce1lPkjZ.js';
14
+ import './TokenNormalizer-d7F1KQFs.js';
15
+ import './ScopeManager-C6c1WmJD.js';
16
+ import './EngineError-Cv5q4Rbv.js';
17
17
 
18
18
  /**
19
19
  * A higher-level, declarative way to contribute a single `name(args)`
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- import'./chunk-BW6FR7DA.js';import'./chunk-RAF57WYO.js';import {n}from'./chunk-YOHM2WQT.js';export{n as ExpressionEngine,d as SNAPSHOT_FORMAT,e as SNAPSHOT_VERSION,f as SnapshotErrorCodes,c as assertEngineVersionCompatible,b as checkEngineVersionCompatibility,a as checkPackageCompatibility}from'./chunk-YOHM2WQT.js';import'./chunk-JQBG3LX4.js';import'./chunk-2RWAXT6O.js';import'./chunk-7E7NXKQ5.js';import'./chunk-MIQBJGGR.js';import'./chunk-K4MME6ZT.js';import'./chunk-KHCNMNZZ.js';import'./chunk-LH7URJZT.js';import'./chunk-XEIDV5JP.js';import {y as y$1}from'./chunk-4FCHZYAH.js';import'./chunk-JEFMG6CV.js';import'./chunk-T3FBAFRR.js';import {a}from'./chunk-YVKHEAFT.js';import'./chunk-3GAWAMT4.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-YTCTUBR2.js';import'./chunk-YAYBVVG2.js';import'./chunk-YNMMRH44.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-WTEXBPBR.js';import {L,t,n as n$1}from'./chunk-A33K7NY4.js';import'./chunk-DLAKPF5T.js';export{a as ENGINE_VERSION}from'./chunk-NQSWT3UO.js';import'./chunk-QYO7IEPR.js';import'./chunk-JPFCXLJV.js';import'./chunk-GMSBBLUQ.js';import'./chunk-IJMNVBIS.js';import'./chunk-62LMTO4F.js';import'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import {c}from'./chunk-MPB7KUN5.js';var r={DEFINE_FUNCTION_INVALID_NAME:"DEFINE_FUNCTION_INVALID_NAME",DEFINE_FUNCTION_INVALID_SPEC:"DEFINE_FUNCTION_INVALID_SPEC",DEFINE_FUNCTION_ARITY_MISMATCH:"DEFINE_FUNCTION_ARITY_MISMATCH",DEFINE_FUNCTION_ARGUMENT_TYPE:"DEFINE_FUNCTION_ARGUMENT_TYPE",DEFINE_FUNCTION_RETURN_TYPE:"DEFINE_FUNCTION_RETURN_TYPE"},b=/^[a-z_][a-z0-9_]*$/i,y=new Set(["number","string","boolean"]);function u(e){return e===1?"1 argument":`${e} arguments`}function f(e){switch(e.type){case 0:case 1:return "a number";case 3:return "a string";case 10:return "a boolean";case 2:return "a big integer";case 5:return "a percentage";case 6:return "a value with a unit";case 4:return "a date";case 7:return "a matrix";case 8:return "a range";case 9:return "a symbolic expression";default:return "an unsupported value"}}function A(e,n,t){switch(n.type){case "number":if(e.type===0||e.type===1)return e.toNumber();break;case "string":if(e.type===3)return e.value;break;case "boolean":if(e.type===10)return e.value;break}throw c.execution({code:r.DEFINE_FUNCTION_ARGUMENT_TYPE,message:`${t}() expects "${n.name}" to be a ${n.type}, but was given ${f(e)}`,expected:`a ${n.type}`,found:f(e),context:{functionName:t,argName:n.name,expectedType:n.type}})}function S(e,n,t$1){switch(n){case "number":if(typeof e=="number")return n$1(e);break;case "string":if(typeof e=="string")return t(e);break;case "boolean":if(typeof e=="boolean")return L(e);break}throw c.internal({code:r.DEFINE_FUNCTION_RETURN_TYPE,message:`${t$1}() is declared to return a ${n}, but its implementation returned ${typeof e}`,expected:`a ${n}`,found:typeof e,context:{functionName:t$1,expectedType:n}})}var p=class{constructor(n){this.fnName=n;this.category="Function";}parse(n,t,i){n.consume("LPAREN");let a$1=0;if(n.peek()?.type!=="RPAREN")for(n.parseExpression(a.Lowest,i),a$1++;n.match("COMMA");)n.parseExpression(a.Lowest,i),a$1++;n.consume("RPAREN"),i.emitPluginCall(this.fnName,a$1);}};function P(e){let n=e.args.length;return t=>{if(t.length!==n)throw c.execution({code:r.DEFINE_FUNCTION_ARITY_MISMATCH,message:`${e.name}() takes ${u(n)}, but was given ${t.length===0?"none":u(t.length)}`,expected:u(n),found:t.length===0?"none":u(t.length),context:{functionName:e.name,expected:n,actual:t.length}});let i=new Array(n);for(let s=0;s<n;s++)i[s]=A(t[s],e.args[s],e.name);let a=e.call(...i);return S(a,e.returns,e.name)}}function V(e){if(typeof e?.name!="string"||!b.test(e.name))throw c.config({code:r.DEFINE_FUNCTION_INVALID_NAME,message:`defineFunction: name must be a single identifier, got ${JSON.stringify(e?.name)}`,suggestion:'e.g. "vat" or "net_price"',context:{name:e?.name}});if(!Array.isArray(e.args))throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" args must be an array`,context:{name:e.name}});for(let n of e.args){if(typeof n?.name!="string"||n.name.length===0)throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has an argument with no name`,context:{name:e.name}});if(!y.has(n.type))throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" argument "${n.name}" has unsupported type ${JSON.stringify(n.type)}`,suggestion:"supported argument types are number, string, boolean",context:{name:e.name,argName:n.name,type:n.type}})}if(!y.has(e.returns))throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has unsupported return type ${JSON.stringify(e.returns)}`,suggestion:"supported return types are number, string, boolean",context:{name:e.name,returns:e.returns}});if(typeof e.call!="function")throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" is missing a call implementation`,context:{name:e.name}})}function O(e){V(e);let n=e.name,t=`DEFINE_FN_${n.toUpperCase()}`;return {name:`solve-fn-${n}`,lexerVocabulary:{keywords:{[n.toLowerCase()]:t}},prefixParselets:{[t]:new p(n)},pluginFunctions:{[n]:P(e)}}}function h(e={}){let{extraPackages:n$1=[],...t}=e;return new n({...t,packages:n$1.length>0?[...y$1,...n$1]:y$1})}export{r as DefineFunctionErrorCodes,h as createEngine,O as defineFunction};//# sourceMappingURL=index.js.map
1
+ import'./chunk-3PDDKWTJ.js';import'./chunk-RAF57WYO.js';import {n}from'./chunk-4IIFFJTJ.js';export{n as ExpressionEngine,d as SNAPSHOT_FORMAT,e as SNAPSHOT_VERSION,f as SnapshotErrorCodes,c as assertEngineVersionCompatible,b as checkEngineVersionCompatibility,a as checkPackageCompatibility}from'./chunk-4IIFFJTJ.js';import'./chunk-CUDPOWXA.js';import'./chunk-2RWAXT6O.js';import'./chunk-7E7NXKQ5.js';import'./chunk-MIQBJGGR.js';import'./chunk-P4ETODMP.js';import'./chunk-JP4JMQOG.js';import'./chunk-IPOU3JTA.js';import'./chunk-XEIDV5JP.js';import {y as y$1}from'./chunk-AYTEPHRO.js';import'./chunk-C5MP74ER.js';import'./chunk-5SDSIRPL.js';import {a}from'./chunk-Q3PSTNSY.js';import'./chunk-YFX53MZF.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-WOIJPV7Z.js';import'./chunk-GWJJRH32.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-JOIQFDZQ.js';import {L,t,n as n$1}from'./chunk-O3ALJLYC.js';import'./chunk-DLAKPF5T.js';export{a as ENGINE_VERSION}from'./chunk-Q7HPPLMG.js';import'./chunk-UZSPBFZN.js';import'./chunk-JPFCXLJV.js';import'./chunk-TVE2DNPU.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import {c}from'./chunk-YAZ4DUJJ.js';var r={DEFINE_FUNCTION_INVALID_NAME:"DEFINE_FUNCTION_INVALID_NAME",DEFINE_FUNCTION_INVALID_SPEC:"DEFINE_FUNCTION_INVALID_SPEC",DEFINE_FUNCTION_ARITY_MISMATCH:"DEFINE_FUNCTION_ARITY_MISMATCH",DEFINE_FUNCTION_ARGUMENT_TYPE:"DEFINE_FUNCTION_ARGUMENT_TYPE",DEFINE_FUNCTION_RETURN_TYPE:"DEFINE_FUNCTION_RETURN_TYPE"},b=/^[a-z_][a-z0-9_]*$/i,y=new Set(["number","string","boolean"]);function u(e){return e===1?"1 argument":`${e} arguments`}function f(e){switch(e.type){case 0:case 1:return "a number";case 3:return "a string";case 10:return "a boolean";case 2:return "a big integer";case 5:return "a percentage";case 6:return "a value with a unit";case 4:return "a date";case 7:return "a matrix";case 8:return "a range";case 9:return "a symbolic expression";default:return "an unsupported value"}}function A(e,n,t){switch(n.type){case "number":if(e.type===0||e.type===1)return e.toNumber();break;case "string":if(e.type===3)return e.value;break;case "boolean":if(e.type===10)return e.value;break}throw c.execution({code:r.DEFINE_FUNCTION_ARGUMENT_TYPE,message:`${t}() expects "${n.name}" to be a ${n.type}, but was given ${f(e)}`,expected:`a ${n.type}`,found:f(e),context:{functionName:t,argName:n.name,expectedType:n.type}})}function S(e,n,t$1){switch(n){case "number":if(typeof e=="number")return n$1(e);break;case "string":if(typeof e=="string")return t(e);break;case "boolean":if(typeof e=="boolean")return L(e);break}throw c.internal({code:r.DEFINE_FUNCTION_RETURN_TYPE,message:`${t$1}() is declared to return a ${n}, but its implementation returned ${typeof e}`,expected:`a ${n}`,found:typeof e,context:{functionName:t$1,expectedType:n}})}var p=class{constructor(n){this.fnName=n;this.category="Function";}parse(n,t,i){n.consume("LPAREN");let a$1=0;if(n.peek()?.type!=="RPAREN")for(n.parseExpression(a.Lowest,i),a$1++;n.match("COMMA");)n.parseExpression(a.Lowest,i),a$1++;n.consume("RPAREN"),i.emitPluginCall(this.fnName,a$1);}};function P(e){let n=e.args.length;return t=>{if(t.length!==n)throw c.execution({code:r.DEFINE_FUNCTION_ARITY_MISMATCH,message:`${e.name}() takes ${u(n)}, but was given ${t.length===0?"none":u(t.length)}`,expected:u(n),found:t.length===0?"none":u(t.length),context:{functionName:e.name,expected:n,actual:t.length}});let i=new Array(n);for(let s=0;s<n;s++)i[s]=A(t[s],e.args[s],e.name);let a=e.call(...i);return S(a,e.returns,e.name)}}function V(e){if(typeof e?.name!="string"||!b.test(e.name))throw c.config({code:r.DEFINE_FUNCTION_INVALID_NAME,message:`defineFunction: name must be a single identifier, got ${JSON.stringify(e?.name)}`,suggestion:'e.g. "vat" or "net_price"',context:{name:e?.name}});if(!Array.isArray(e.args))throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" args must be an array`,context:{name:e.name}});for(let n of e.args){if(typeof n?.name!="string"||n.name.length===0)throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has an argument with no name`,context:{name:e.name}});if(!y.has(n.type))throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" argument "${n.name}" has unsupported type ${JSON.stringify(n.type)}`,suggestion:"supported argument types are number, string, boolean",context:{name:e.name,argName:n.name,type:n.type}})}if(!y.has(e.returns))throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" has unsupported return type ${JSON.stringify(e.returns)}`,suggestion:"supported return types are number, string, boolean",context:{name:e.name,returns:e.returns}});if(typeof e.call!="function")throw c.config({code:r.DEFINE_FUNCTION_INVALID_SPEC,message:`defineFunction: "${e.name}" is missing a call implementation`,context:{name:e.name}})}function O(e){V(e);let n=e.name,t=`DEFINE_FN_${n.toUpperCase()}`;return {name:`solve-fn-${n}`,lexerVocabulary:{keywords:{[n.toLowerCase()]:t}},prefixParselets:{[t]:new p(n)},pluginFunctions:{[n]:P(e)}}}function h(e={}){let{extraPackages:n$1=[],...t}=e;return new n({...t,packages:n$1.length>0?[...y$1,...n$1]:y$1})}export{r as DefineFunctionErrorCodes,h as createEngine,O as defineFunction};//# sourceMappingURL=index.js.map
2
2
  //# sourceMappingURL=index.js.map
@@ -1,16 +1,16 @@
1
- import { C as CompletionItem } from './PackageRegistry-DeGDZkNt.cjs';
2
- export { L as LanguageService, p as LanguageServiceOptions, q as SemanticToken } from './PackageRegistry-DeGDZkNt.cjs';
3
- import { e as TokenCategory } from './Lexer-B4C1qHXu.cjs';
4
- import './Parselet-BSndkWEY.cjs';
5
- import './BytecodeBuilder-BGq9ZiO3.cjs';
1
+ import { C as CompletionItem } from './PackageRegistry-CZO1IbS-.cjs';
2
+ export { L as LanguageService, p as LanguageServiceOptions, q as SemanticToken } from './PackageRegistry-CZO1IbS-.cjs';
3
+ import { e as TokenCategory } from './Lexer-CCHFDcgP.cjs';
4
+ import './Parselet-DOGmj6N6.cjs';
5
+ import './BytecodeBuilder-CRYfrFfq.cjs';
6
6
  import './Token-CbP_OutD.cjs';
7
- import './pipeline-BM8xc0CZ.cjs';
7
+ import './pipeline-B4wf3M1h.cjs';
8
8
  import './Value-DCTqTSeP.cjs';
9
9
  import './resolvers.cjs';
10
10
  import '@tanstack/query-core';
11
- import './TokenNormalizer-DnlL7_8c.cjs';
12
- import './ScopeManager-D8nLv--u.cjs';
13
- import './EngineError-Ce1lPkjZ.cjs';
11
+ import './TokenNormalizer-BfTHg1qt.cjs';
12
+ import './ScopeManager-BtqiTVjG.cjs';
13
+ import './EngineError-Cv5q4Rbv.cjs';
14
14
  import './Configuration-BGQn-cJ8.cjs';
15
15
 
16
16
  /**
@@ -1,16 +1,16 @@
1
- import { C as CompletionItem } from './PackageRegistry-BJ0QQd3k.js';
2
- export { L as LanguageService, p as LanguageServiceOptions, q as SemanticToken } from './PackageRegistry-BJ0QQd3k.js';
3
- import { e as TokenCategory } from './Lexer-DKMlj7Sy.js';
4
- import './Parselet-Blq8B0Gj.js';
5
- import './BytecodeBuilder-BGq9ZiO3.js';
1
+ import { C as CompletionItem } from './PackageRegistry-CK_JoX50.js';
2
+ export { L as LanguageService, p as LanguageServiceOptions, q as SemanticToken } from './PackageRegistry-CK_JoX50.js';
3
+ import { e as TokenCategory } from './Lexer-CqagTewQ.js';
4
+ import './Parselet-CK0bNO1l.js';
5
+ import './BytecodeBuilder-CRYfrFfq.js';
6
6
  import './Token-CbP_OutD.js';
7
- import './pipeline-J2ehIm7t.js';
7
+ import './pipeline-QIT4iD8f.js';
8
8
  import './Value-DCTqTSeP.js';
9
9
  import './resolvers.js';
10
10
  import '@tanstack/query-core';
11
- import './TokenNormalizer-DCWdZjGz.js';
12
- import './ScopeManager-CF3cZUqW.js';
13
- import './EngineError-Ce1lPkjZ.js';
11
+ import './TokenNormalizer-d7F1KQFs.js';
12
+ import './ScopeManager-C6c1WmJD.js';
13
+ import './EngineError-Cv5q4Rbv.js';
14
14
  import './Configuration-BGQn-cJ8.js';
15
15
 
16
16
  /**
package/dist/lexer.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk3HYO3QYW_cjs=require('./chunk-3HYO3QYW.cjs');require('./chunk-Y7O4D3BJ.cjs');var chunkSNVPM27Q_cjs=require('./chunk-SNVPM27Q.cjs'),chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs');require('./chunk-MSYX32PF.cjs');var chunkWEAKI5V5_cjs=require('./chunk-WEAKI5V5.cjs');require('./chunk-6QRHN3I6.cjs'),require('./chunk-SOMGSIO4.cjs');Object.defineProperty(exports,"Lexer",{enumerable:true,get:function(){return chunk3HYO3QYW_cjs.b}});Object.defineProperty(exports,"LexerState",{enumerable:true,get:function(){return chunk3HYO3QYW_cjs.a}});Object.defineProperty(exports,"buildTokenLookup",{enumerable:true,get:function(){return chunk3HYO3QYW_cjs.d}});Object.defineProperty(exports,"sharedLexer",{enumerable:true,get:function(){return chunk3HYO3QYW_cjs.c}});Object.defineProperty(exports,"ExpressionLexer",{enumerable:true,get:function(){return chunkSNVPM27Q_cjs.b}});Object.defineProperty(exports,"LexerToken",{enumerable:true,get:function(){return chunkSNVPM27Q_cjs.a}});Object.defineProperty(exports,"TokenTypes",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.a}});Object.defineProperty(exports,"registerAllTokenTypes",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.e}});Object.defineProperty(exports,"registerTokenType",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.b}});Object.defineProperty(exports,"tokenTypeId",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.c}});Object.defineProperty(exports,"tokenTypeName",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.d}});Object.defineProperty(exports,"knownUnits",{enumerable:true,get:function(){return chunkWEAKI5V5_cjs.a}});//# sourceMappingURL=lexer.cjs.map
1
+ 'use strict';var chunkEXCFCHAT_cjs=require('./chunk-EXCFCHAT.cjs');require('./chunk-Y7O4D3BJ.cjs');var chunkFAGFPVYK_cjs=require('./chunk-FAGFPVYK.cjs'),chunk5IJD5L3O_cjs=require('./chunk-5IJD5L3O.cjs');require('./chunk-S3DFU33X.cjs');var chunkWEAKI5V5_cjs=require('./chunk-WEAKI5V5.cjs');require('./chunk-6QRHN3I6.cjs'),require('./chunk-NAZ6PGLS.cjs');Object.defineProperty(exports,"Lexer",{enumerable:true,get:function(){return chunkEXCFCHAT_cjs.b}});Object.defineProperty(exports,"LexerState",{enumerable:true,get:function(){return chunkEXCFCHAT_cjs.a}});Object.defineProperty(exports,"buildTokenLookup",{enumerable:true,get:function(){return chunkEXCFCHAT_cjs.d}});Object.defineProperty(exports,"sharedLexer",{enumerable:true,get:function(){return chunkEXCFCHAT_cjs.c}});Object.defineProperty(exports,"ExpressionLexer",{enumerable:true,get:function(){return chunkFAGFPVYK_cjs.b}});Object.defineProperty(exports,"LexerToken",{enumerable:true,get:function(){return chunkFAGFPVYK_cjs.a}});Object.defineProperty(exports,"TokenTypes",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.a}});Object.defineProperty(exports,"registerAllTokenTypes",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.e}});Object.defineProperty(exports,"registerTokenType",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.b}});Object.defineProperty(exports,"tokenTypeId",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.c}});Object.defineProperty(exports,"tokenTypeName",{enumerable:true,get:function(){return chunk5IJD5L3O_cjs.d}});Object.defineProperty(exports,"knownUnits",{enumerable:true,get:function(){return chunkWEAKI5V5_cjs.a}});//# sourceMappingURL=lexer.cjs.map
2
2
  //# sourceMappingURL=lexer.cjs.map
package/dist/lexer.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TokenLookup } from './Lexer-B4C1qHXu.cjs';
2
- export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-B4C1qHXu.cjs';
1
+ import { T as TokenLookup } from './Lexer-CCHFDcgP.cjs';
2
+ export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-CCHFDcgP.cjs';
3
3
  export { T as Token, a as TokenType, b as TokenTypes, r as registerAllTokenTypes, c as registerTokenType, t as tokenTypeId, d as tokenTypeName } from './Token-CbP_OutD.cjs';
4
4
 
5
5
  /**
package/dist/lexer.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { T as TokenLookup } from './Lexer-DKMlj7Sy.js';
2
- export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-DKMlj7Sy.js';
1
+ import { T as TokenLookup } from './Lexer-CqagTewQ.js';
2
+ export { E as ExpressionLexer, I as InlineSolveSpan, L as Lexer, a as LexerState, b as LexerToken, c as LexerVocabulary, d as LineClassification, M as MarkdownLineType, S as ScanLineResult, s as sharedLexer } from './Lexer-CqagTewQ.js';
3
3
  export { T as Token, a as TokenType, b as TokenTypes, r as registerAllTokenTypes, c as registerTokenType, t as tokenTypeId, d as tokenTypeName } from './Token-CbP_OutD.js';
4
4
 
5
5
  /**
package/dist/lexer.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as Lexer,a as LexerState,d as buildTokenLookup,c as sharedLexer}from'./chunk-QYO7IEPR.js';import'./chunk-JPFCXLJV.js';export{b as ExpressionLexer,a as LexerToken}from'./chunk-GMSBBLUQ.js';export{a as TokenTypes,e as registerAllTokenTypes,b as registerTokenType,c as tokenTypeId,d as tokenTypeName}from'./chunk-IJMNVBIS.js';import'./chunk-62LMTO4F.js';export{a as knownUnits}from'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import'./chunk-MPB7KUN5.js';//# sourceMappingURL=lexer.js.map
1
+ export{b as Lexer,a as LexerState,d as buildTokenLookup,c as sharedLexer}from'./chunk-UZSPBFZN.js';import'./chunk-JPFCXLJV.js';export{b as ExpressionLexer,a as LexerToken}from'./chunk-TVE2DNPU.js';export{a as TokenTypes,e as registerAllTokenTypes,b as registerTokenType,c as tokenTypeId,d as tokenTypeName}from'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';export{a as knownUnits}from'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import'./chunk-YAZ4DUJJ.js';//# sourceMappingURL=lexer.js.map
2
2
  //# sourceMappingURL=lexer.js.map
@@ -1,2 +1,2 @@
1
- 'use strict';require('./chunk-NGBBNL4K.cjs');var chunkC65UDMWH_cjs=require('./chunk-C65UDMWH.cjs');require('./chunk-SNVPM27Q.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-MSYX32PF.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs'),require('./chunk-SOMGSIO4.cjs');Object.defineProperty(exports,"BUILTIN_PHRASES",{enumerable:true,get:function(){return chunkC65UDMWH_cjs.g}});Object.defineProperty(exports,"PhraseTrie",{enumerable:true,get:function(){return chunkC65UDMWH_cjs.a}});Object.defineProperty(exports,"TokenNormalizer",{enumerable:true,get:function(){return chunkC65UDMWH_cjs.c}});Object.defineProperty(exports,"createBuiltinNormalizerRules",{enumerable:true,get:function(){return chunkC65UDMWH_cjs.f}});Object.defineProperty(exports,"createFusedToken",{enumerable:true,get:function(){return chunkC65UDMWH_cjs.b}});Object.defineProperty(exports,"implicitMultiplyRule",{enumerable:true,get:function(){return chunkC65UDMWH_cjs.d}});//# sourceMappingURL=normalizer.cjs.map
1
+ 'use strict';require('./chunk-NGBBNL4K.cjs');var chunkRC4M6HBX_cjs=require('./chunk-RC4M6HBX.cjs');require('./chunk-FAGFPVYK.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs'),require('./chunk-NAZ6PGLS.cjs');Object.defineProperty(exports,"BUILTIN_PHRASES",{enumerable:true,get:function(){return chunkRC4M6HBX_cjs.g}});Object.defineProperty(exports,"PhraseTrie",{enumerable:true,get:function(){return chunkRC4M6HBX_cjs.a}});Object.defineProperty(exports,"TokenNormalizer",{enumerable:true,get:function(){return chunkRC4M6HBX_cjs.c}});Object.defineProperty(exports,"createBuiltinNormalizerRules",{enumerable:true,get:function(){return chunkRC4M6HBX_cjs.f}});Object.defineProperty(exports,"createFusedToken",{enumerable:true,get:function(){return chunkRC4M6HBX_cjs.b}});Object.defineProperty(exports,"implicitMultiplyRule",{enumerable:true,get:function(){return chunkRC4M6HBX_cjs.d}});//# sourceMappingURL=normalizer.cjs.map
2
2
  //# sourceMappingURL=normalizer.cjs.map
@@ -1,5 +1,5 @@
1
- import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-DnlL7_8c.cjs';
2
- export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-DnlL7_8c.cjs';
1
+ import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-BfTHg1qt.cjs';
2
+ export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-BfTHg1qt.cjs';
3
3
  import { T as Token } from './Token-CbP_OutD.cjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-DCWdZjGz.js';
2
- export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-DCWdZjGz.js';
1
+ import { N as NormalizerMatch, a as NormalizerRule } from './TokenNormalizer-d7F1KQFs.js';
2
+ export { b as NormalizerOptions, T as TokenFusion, c as TokenNormalizer, d as createFusedToken } from './TokenNormalizer-d7F1KQFs.js';
3
3
  import { T as Token } from './Token-CbP_OutD.js';
4
4
 
5
5
  /**
@@ -1,2 +1,2 @@
1
- import'./chunk-2RWAXT6O.js';export{g as BUILTIN_PHRASES,a as PhraseTrie,c as TokenNormalizer,f as createBuiltinNormalizerRules,b as createFusedToken,d as implicitMultiplyRule}from'./chunk-3GAWAMT4.js';import'./chunk-GMSBBLUQ.js';import'./chunk-IJMNVBIS.js';import'./chunk-62LMTO4F.js';import'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import'./chunk-MPB7KUN5.js';//# sourceMappingURL=normalizer.js.map
1
+ import'./chunk-2RWAXT6O.js';export{g as BUILTIN_PHRASES,a as PhraseTrie,c as TokenNormalizer,f as createBuiltinNormalizerRules,b as createFusedToken,d as implicitMultiplyRule}from'./chunk-YFX53MZF.js';import'./chunk-TVE2DNPU.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import'./chunk-YAZ4DUJJ.js';//# sourceMappingURL=normalizer.js.map
2
2
  //# sourceMappingURL=normalizer.js.map
package/dist/packages.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunk2VK3NH5S_cjs=require('./chunk-2VK3NH5S.cjs');require('./chunk-FUDVKPB7.cjs');var chunkWYIOXAFW_cjs=require('./chunk-WYIOXAFW.cjs');require('./chunk-4QVBSG6B.cjs'),require('./chunk-C65UDMWH.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-EURCQMZK.cjs'),require('./chunk-4BZIYU7S.cjs'),require('./chunk-VBSMA7WJ.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-75XDS65A.cjs'),require('./chunk-PNDQRCRQ.cjs'),require('./chunk-BKSKZA4W.cjs'),require('./chunk-SNVPM27Q.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-MSYX32PF.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs'),require('./chunk-SOMGSIO4.cjs');Object.defineProperty(exports,"ARITHMETIC_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.a}});Object.defineProperty(exports,"BIGINT_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.n}});Object.defineProperty(exports,"BUILTIN_PACKAGES",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.y}});Object.defineProperty(exports,"CONDITIONALS_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.o}});Object.defineProperty(exports,"CONVERTERS_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.p}});Object.defineProperty(exports,"CURRENCY_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.j}});Object.defineProperty(exports,"DATETIME_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.d}});Object.defineProperty(exports,"DICE_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.f}});Object.defineProperty(exports,"FINANCE_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.r}});Object.defineProperty(exports,"FUNCTION_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.c}});Object.defineProperty(exports,"LINES_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.v}});Object.defineProperty(exports,"MAPREDUCE_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.m}});Object.defineProperty(exports,"MATHPHRASES_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.q}});Object.defineProperty(exports,"MATRIX_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.l}});Object.defineProperty(exports,"PERCENTAGE_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.b}});Object.defineProperty(exports,"TABLES_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.w}});Object.defineProperty(exports,"TAGS_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.x}});Object.defineProperty(exports,"TIME_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.e}});Object.defineProperty(exports,"UOM_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.h}});Object.defineProperty(exports,"VARIABLES_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.g}});Object.defineProperty(exports,"VECTOR_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.k}});Object.defineProperty(exports,"WEATHER_PACKAGE",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.s}});Object.defineProperty(exports,"createCurrencyPackage",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.i}});Object.defineProperty(exports,"createKnowledgePackage",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.u}});Object.defineProperty(exports,"createStocksPackage",{enumerable:true,get:function(){return chunk2VK3NH5S_cjs.t}});Object.defineProperty(exports,"SYMBOLIC_PACKAGE",{enumerable:true,get:function(){return chunkWYIOXAFW_cjs.a}});//# sourceMappingURL=packages.cjs.map
1
+ 'use strict';var chunkKKMLFYVW_cjs=require('./chunk-KKMLFYVW.cjs');require('./chunk-W5ELYJ4Z.cjs');var chunkHDGARCI2_cjs=require('./chunk-HDGARCI2.cjs');require('./chunk-FVQWN5HZ.cjs'),require('./chunk-RC4M6HBX.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-EEVUKZ5B.cjs'),require('./chunk-GWCBPITD.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-2XZCLDHJ.cjs'),require('./chunk-6U66HQKQ.cjs'),require('./chunk-BKSKZA4W.cjs'),require('./chunk-FAGFPVYK.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs'),require('./chunk-NAZ6PGLS.cjs');Object.defineProperty(exports,"ARITHMETIC_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.a}});Object.defineProperty(exports,"BIGINT_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.n}});Object.defineProperty(exports,"BUILTIN_PACKAGES",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.y}});Object.defineProperty(exports,"CONDITIONALS_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.o}});Object.defineProperty(exports,"CONVERTERS_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.p}});Object.defineProperty(exports,"CURRENCY_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.j}});Object.defineProperty(exports,"DATETIME_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.d}});Object.defineProperty(exports,"DICE_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.f}});Object.defineProperty(exports,"FINANCE_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.r}});Object.defineProperty(exports,"FUNCTION_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.c}});Object.defineProperty(exports,"LINES_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.v}});Object.defineProperty(exports,"MAPREDUCE_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.m}});Object.defineProperty(exports,"MATHPHRASES_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.q}});Object.defineProperty(exports,"MATRIX_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.l}});Object.defineProperty(exports,"PERCENTAGE_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.b}});Object.defineProperty(exports,"TABLES_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.w}});Object.defineProperty(exports,"TAGS_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.x}});Object.defineProperty(exports,"TIME_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.e}});Object.defineProperty(exports,"UOM_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.h}});Object.defineProperty(exports,"VARIABLES_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.g}});Object.defineProperty(exports,"VECTOR_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.k}});Object.defineProperty(exports,"WEATHER_PACKAGE",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.s}});Object.defineProperty(exports,"createCurrencyPackage",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.i}});Object.defineProperty(exports,"createKnowledgePackage",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.u}});Object.defineProperty(exports,"createStocksPackage",{enumerable:true,get:function(){return chunkKKMLFYVW_cjs.t}});Object.defineProperty(exports,"SYMBOLIC_PACKAGE",{enumerable:true,get:function(){return chunkHDGARCI2_cjs.a}});//# sourceMappingURL=packages.cjs.map
2
2
  //# sourceMappingURL=packages.cjs.map
@@ -1,15 +1,15 @@
1
- import { I as IEnginePackage } from './PackageRegistry-DeGDZkNt.cjs';
2
- import './Parselet-BSndkWEY.cjs';
3
- import './BytecodeBuilder-BGq9ZiO3.cjs';
1
+ import { I as IEnginePackage } from './PackageRegistry-CZO1IbS-.cjs';
2
+ import './Parselet-DOGmj6N6.cjs';
3
+ import './BytecodeBuilder-CRYfrFfq.cjs';
4
4
  import './Token-CbP_OutD.cjs';
5
- import './pipeline-BM8xc0CZ.cjs';
5
+ import './pipeline-B4wf3M1h.cjs';
6
6
  import './Value-DCTqTSeP.cjs';
7
- import './Lexer-B4C1qHXu.cjs';
7
+ import './Lexer-CCHFDcgP.cjs';
8
8
  import './resolvers.cjs';
9
9
  import '@tanstack/query-core';
10
- import './TokenNormalizer-DnlL7_8c.cjs';
11
- import './ScopeManager-D8nLv--u.cjs';
12
- import './EngineError-Ce1lPkjZ.cjs';
10
+ import './TokenNormalizer-BfTHg1qt.cjs';
11
+ import './ScopeManager-BtqiTVjG.cjs';
12
+ import './EngineError-Cv5q4Rbv.cjs';
13
13
  import './Configuration-BGQn-cJ8.cjs';
14
14
 
15
15
  /** Core arithmetic: numbers, `()` grouping, `pi`/`e` constants, `+ - * / % ^`, bitwise `<< >> & | ^`, and their `*_by` word forms. */
@@ -1,15 +1,15 @@
1
- import { I as IEnginePackage } from './PackageRegistry-BJ0QQd3k.js';
2
- import './Parselet-Blq8B0Gj.js';
3
- import './BytecodeBuilder-BGq9ZiO3.js';
1
+ import { I as IEnginePackage } from './PackageRegistry-CK_JoX50.js';
2
+ import './Parselet-CK0bNO1l.js';
3
+ import './BytecodeBuilder-CRYfrFfq.js';
4
4
  import './Token-CbP_OutD.js';
5
- import './pipeline-J2ehIm7t.js';
5
+ import './pipeline-QIT4iD8f.js';
6
6
  import './Value-DCTqTSeP.js';
7
- import './Lexer-DKMlj7Sy.js';
7
+ import './Lexer-CqagTewQ.js';
8
8
  import './resolvers.js';
9
9
  import '@tanstack/query-core';
10
- import './TokenNormalizer-DCWdZjGz.js';
11
- import './ScopeManager-CF3cZUqW.js';
12
- import './EngineError-Ce1lPkjZ.js';
10
+ import './TokenNormalizer-d7F1KQFs.js';
11
+ import './ScopeManager-C6c1WmJD.js';
12
+ import './EngineError-Cv5q4Rbv.js';
13
13
  import './Configuration-BGQn-cJ8.js';
14
14
 
15
15
  /** Core arithmetic: numbers, `()` grouping, `pi`/`e` constants, `+ - * / % ^`, bitwise `<< >> & | ^`, and their `*_by` word forms. */
package/dist/packages.js CHANGED
@@ -1,2 +1,2 @@
1
- export{a as ARITHMETIC_PACKAGE,n as BIGINT_PACKAGE,y as BUILTIN_PACKAGES,o as CONDITIONALS_PACKAGE,p as CONVERTERS_PACKAGE,j as CURRENCY_PACKAGE,d as DATETIME_PACKAGE,f as DICE_PACKAGE,r as FINANCE_PACKAGE,c as FUNCTION_PACKAGE,v as LINES_PACKAGE,m as MAPREDUCE_PACKAGE,q as MATHPHRASES_PACKAGE,l as MATRIX_PACKAGE,b as PERCENTAGE_PACKAGE,w as TABLES_PACKAGE,x as TAGS_PACKAGE,e as TIME_PACKAGE,h as UOM_PACKAGE,g as VARIABLES_PACKAGE,k as VECTOR_PACKAGE,s as WEATHER_PACKAGE,i as createCurrencyPackage,u as createKnowledgePackage,t as createStocksPackage}from'./chunk-4FCHZYAH.js';import'./chunk-JEFMG6CV.js';export{a as SYMBOLIC_PACKAGE}from'./chunk-T3FBAFRR.js';import'./chunk-YVKHEAFT.js';import'./chunk-3GAWAMT4.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-YTCTUBR2.js';import'./chunk-YAYBVVG2.js';import'./chunk-YNMMRH44.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-WTEXBPBR.js';import'./chunk-A33K7NY4.js';import'./chunk-DLAKPF5T.js';import'./chunk-GMSBBLUQ.js';import'./chunk-IJMNVBIS.js';import'./chunk-62LMTO4F.js';import'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import'./chunk-MPB7KUN5.js';//# sourceMappingURL=packages.js.map
1
+ export{a as ARITHMETIC_PACKAGE,n as BIGINT_PACKAGE,y as BUILTIN_PACKAGES,o as CONDITIONALS_PACKAGE,p as CONVERTERS_PACKAGE,j as CURRENCY_PACKAGE,d as DATETIME_PACKAGE,f as DICE_PACKAGE,r as FINANCE_PACKAGE,c as FUNCTION_PACKAGE,v as LINES_PACKAGE,m as MAPREDUCE_PACKAGE,q as MATHPHRASES_PACKAGE,l as MATRIX_PACKAGE,b as PERCENTAGE_PACKAGE,w as TABLES_PACKAGE,x as TAGS_PACKAGE,e as TIME_PACKAGE,h as UOM_PACKAGE,g as VARIABLES_PACKAGE,k as VECTOR_PACKAGE,s as WEATHER_PACKAGE,i as createCurrencyPackage,u as createKnowledgePackage,t as createStocksPackage}from'./chunk-AYTEPHRO.js';import'./chunk-C5MP74ER.js';export{a as SYMBOLIC_PACKAGE}from'./chunk-5SDSIRPL.js';import'./chunk-Q3PSTNSY.js';import'./chunk-YFX53MZF.js';import'./chunk-76F3LCIL.js';import'./chunk-TCZSPH4A.js';import'./chunk-WOIJPV7Z.js';import'./chunk-GWJJRH32.js';import'./chunk-TZYMXNIB.js';import'./chunk-HFKDWQUL.js';import'./chunk-5TCSFTZD.js';import'./chunk-JOIQFDZQ.js';import'./chunk-O3ALJLYC.js';import'./chunk-DLAKPF5T.js';import'./chunk-TVE2DNPU.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-UWAXJX5G.js';import'./chunk-44EOEWGP.js';import'./chunk-YAZ4DUJJ.js';//# sourceMappingURL=packages.js.map
2
2
  //# sourceMappingURL=packages.js.map
package/dist/parser.cjs CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkFNNIAJNY_cjs=require('./chunk-FNNIAJNY.cjs');require('./chunk-MVP2YD4X.cjs');var chunk4QVBSG6B_cjs=require('./chunk-4QVBSG6B.cjs'),chunkVBSMA7WJ_cjs=require('./chunk-VBSMA7WJ.cjs');require('./chunk-5IJD5L3O.cjs'),require('./chunk-MSYX32PF.cjs'),require('./chunk-SOMGSIO4.cjs');Object.defineProperty(exports,"ParseletRegistry",{enumerable:true,get:function(){return chunkFNNIAJNY_cjs.b}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return chunkFNNIAJNY_cjs.a}});Object.defineProperty(exports,"PrecedenceParser",{enumerable:true,get:function(){return chunkFNNIAJNY_cjs.a}});Object.defineProperty(exports,"sharedParseletRegistry",{enumerable:true,get:function(){return chunkFNNIAJNY_cjs.c}});Object.defineProperty(exports,"BindingPower",{enumerable:true,get:function(){return chunk4QVBSG6B_cjs.a}});Object.defineProperty(exports,"BytecodeBuilder",{enumerable:true,get:function(){return chunk4QVBSG6B_cjs.d}});Object.defineProperty(exports,"buildBindingPowerTable",{enumerable:true,get:function(){return chunk4QVBSG6B_cjs.b}});Object.defineProperty(exports,"invalidateBindingPowerTable",{enumerable:true,get:function(){return chunk4QVBSG6B_cjs.c}});Object.defineProperty(exports,"OpCode",{enumerable:true,get:function(){return chunkVBSMA7WJ_cjs.a}});Object.defineProperty(exports,"getOpCodeName",{enumerable:true,get:function(){return chunkVBSMA7WJ_cjs.b}});//# sourceMappingURL=parser.cjs.map
1
+ 'use strict';var chunkIMXSVHQK_cjs=require('./chunk-IMXSVHQK.cjs');require('./chunk-HG4NPDN5.cjs');var chunkFVQWN5HZ_cjs=require('./chunk-FVQWN5HZ.cjs'),chunkABVDKMNF_cjs=require('./chunk-ABVDKMNF.cjs');require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-NAZ6PGLS.cjs');Object.defineProperty(exports,"ParseletRegistry",{enumerable:true,get:function(){return chunkIMXSVHQK_cjs.b}});Object.defineProperty(exports,"Parser",{enumerable:true,get:function(){return chunkIMXSVHQK_cjs.a}});Object.defineProperty(exports,"PrecedenceParser",{enumerable:true,get:function(){return chunkIMXSVHQK_cjs.a}});Object.defineProperty(exports,"sharedParseletRegistry",{enumerable:true,get:function(){return chunkIMXSVHQK_cjs.c}});Object.defineProperty(exports,"BindingPower",{enumerable:true,get:function(){return chunkFVQWN5HZ_cjs.a}});Object.defineProperty(exports,"BytecodeBuilder",{enumerable:true,get:function(){return chunkFVQWN5HZ_cjs.d}});Object.defineProperty(exports,"buildBindingPowerTable",{enumerable:true,get:function(){return chunkFVQWN5HZ_cjs.b}});Object.defineProperty(exports,"invalidateBindingPowerTable",{enumerable:true,get:function(){return chunkFVQWN5HZ_cjs.c}});Object.defineProperty(exports,"OpCode",{enumerable:true,get:function(){return chunkABVDKMNF_cjs.a}});Object.defineProperty(exports,"getOpCodeName",{enumerable:true,get:function(){return chunkABVDKMNF_cjs.b}});//# sourceMappingURL=parser.cjs.map
2
2
  //# sourceMappingURL=parser.cjs.map
package/dist/parser.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-BSndkWEY.cjs';
2
- export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-BGq9ZiO3.cjs';
1
+ export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-DOGmj6N6.cjs';
2
+ export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-CRYfrFfq.cjs';
3
3
  import './Token-CbP_OutD.cjs';
4
- import './pipeline-BM8xc0CZ.cjs';
4
+ import './pipeline-B4wf3M1h.cjs';
5
5
  import './Value-DCTqTSeP.cjs';
6
6
 
7
7
  /**
package/dist/parser.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-Blq8B0Gj.js';
2
- export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-BGq9ZiO3.js';
1
+ export { I as InfixParselet, P as ParseletRegistry, a as Parser, a as PrecedenceParser, b as PrefixParselet, s as sharedParseletRegistry } from './Parselet-CK0bNO1l.js';
2
+ export { B as BytecodeBuilder, a as BytecodeProgram, O as OpCode, g as getOpCodeName } from './BytecodeBuilder-CRYfrFfq.js';
3
3
  import './Token-CbP_OutD.js';
4
- import './pipeline-J2ehIm7t.js';
4
+ import './pipeline-QIT4iD8f.js';
5
5
  import './Value-DCTqTSeP.js';
6
6
 
7
7
  /**
package/dist/parser.js CHANGED
@@ -1,2 +1,2 @@
1
- export{b as ParseletRegistry,a as Parser,a as PrecedenceParser,c as sharedParseletRegistry}from'./chunk-JQBG3LX4.js';import'./chunk-KHCNMNZZ.js';export{a as BindingPower,d as BytecodeBuilder,b as buildBindingPowerTable,c as invalidateBindingPowerTable}from'./chunk-YVKHEAFT.js';export{a as OpCode,b as getOpCodeName}from'./chunk-YNMMRH44.js';import'./chunk-IJMNVBIS.js';import'./chunk-62LMTO4F.js';import'./chunk-MPB7KUN5.js';//# sourceMappingURL=parser.js.map
1
+ export{b as ParseletRegistry,a as Parser,a as PrecedenceParser,c as sharedParseletRegistry}from'./chunk-CUDPOWXA.js';import'./chunk-JP4JMQOG.js';export{a as BindingPower,d as BytecodeBuilder,b as buildBindingPowerTable,c as invalidateBindingPowerTable}from'./chunk-Q3PSTNSY.js';export{a as OpCode,b as getOpCodeName}from'./chunk-TZYMXNIB.js';import'./chunk-IJMNVBIS.js';import'./chunk-LHLW7JLS.js';import'./chunk-YAZ4DUJJ.js';//# sourceMappingURL=parser.js.map
2
2
  //# sourceMappingURL=parser.js.map
@@ -115,27 +115,6 @@ interface CategorizedParselet {
115
115
  readonly bindingPower?: number;
116
116
  readonly tokenOffset: number;
117
117
  }
118
- /** Structured diagnostic report */
119
- interface DiagnosticReport {
120
- readonly events: readonly DiagnosticEvent[];
121
- readonly parselets: readonly CategorizedParselet[];
122
- readonly summary: {
123
- readonly totalTokens: number;
124
- readonly totalParselets: number;
125
- readonly totalOpcodes: number;
126
- readonly cacheHit: boolean;
127
- readonly elapsedNs: number;
128
- readonly parseCategories: ReadonlyMap<string, number>;
129
- };
130
- readonly metadata: {
131
- readonly expression: string;
132
- readonly inputType: string;
133
- readonly timestamp: number;
134
- readonly vmTraceEnabled: boolean;
135
- };
136
- /** Serialize to a JSON-safe plain object */
137
- toJSON(): DiagnosticReportJSON;
138
- }
139
118
  /** JSON-serializable representation of a DiagnosticReport */
140
119
  interface DiagnosticReportJSON {
141
120
  readonly events: readonly DiagnosticEvent[];
@@ -155,8 +134,8 @@ interface DiagnosticReportJSON {
155
134
  readonly vmTraceEnabled: boolean;
156
135
  };
157
136
  }
158
- /** JSON-serializable representation of a DiagnosticReport */
159
- interface DiagnosticReportJSON {
137
+ /** Structured diagnostic report */
138
+ interface DiagnosticReport {
160
139
  readonly events: readonly DiagnosticEvent[];
161
140
  readonly parselets: readonly CategorizedParselet[];
162
141
  readonly summary: {
@@ -165,7 +144,7 @@ interface DiagnosticReportJSON {
165
144
  readonly totalOpcodes: number;
166
145
  readonly cacheHit: boolean;
167
146
  readonly elapsedNs: number;
168
- readonly parseCategories: Record<string, number>;
147
+ readonly parseCategories: ReadonlyMap<string, number>;
169
148
  };
170
149
  readonly metadata: {
171
150
  readonly expression: string;
@@ -173,6 +152,8 @@ interface DiagnosticReportJSON {
173
152
  readonly timestamp: number;
174
153
  readonly vmTraceEnabled: boolean;
175
154
  };
155
+ /** Serialize to a JSON-safe plain object */
156
+ toJSON(): DiagnosticReportJSON;
176
157
  }
177
158
 
178
159
  /**
@@ -115,27 +115,6 @@ interface CategorizedParselet {
115
115
  readonly bindingPower?: number;
116
116
  readonly tokenOffset: number;
117
117
  }
118
- /** Structured diagnostic report */
119
- interface DiagnosticReport {
120
- readonly events: readonly DiagnosticEvent[];
121
- readonly parselets: readonly CategorizedParselet[];
122
- readonly summary: {
123
- readonly totalTokens: number;
124
- readonly totalParselets: number;
125
- readonly totalOpcodes: number;
126
- readonly cacheHit: boolean;
127
- readonly elapsedNs: number;
128
- readonly parseCategories: ReadonlyMap<string, number>;
129
- };
130
- readonly metadata: {
131
- readonly expression: string;
132
- readonly inputType: string;
133
- readonly timestamp: number;
134
- readonly vmTraceEnabled: boolean;
135
- };
136
- /** Serialize to a JSON-safe plain object */
137
- toJSON(): DiagnosticReportJSON;
138
- }
139
118
  /** JSON-serializable representation of a DiagnosticReport */
140
119
  interface DiagnosticReportJSON {
141
120
  readonly events: readonly DiagnosticEvent[];
@@ -155,8 +134,8 @@ interface DiagnosticReportJSON {
155
134
  readonly vmTraceEnabled: boolean;
156
135
  };
157
136
  }
158
- /** JSON-serializable representation of a DiagnosticReport */
159
- interface DiagnosticReportJSON {
137
+ /** Structured diagnostic report */
138
+ interface DiagnosticReport {
160
139
  readonly events: readonly DiagnosticEvent[];
161
140
  readonly parselets: readonly CategorizedParselet[];
162
141
  readonly summary: {
@@ -165,7 +144,7 @@ interface DiagnosticReportJSON {
165
144
  readonly totalOpcodes: number;
166
145
  readonly cacheHit: boolean;
167
146
  readonly elapsedNs: number;
168
- readonly parseCategories: Record<string, number>;
147
+ readonly parseCategories: ReadonlyMap<string, number>;
169
148
  };
170
149
  readonly metadata: {
171
150
  readonly expression: string;
@@ -173,6 +152,8 @@ interface DiagnosticReportJSON {
173
152
  readonly timestamp: number;
174
153
  readonly vmTraceEnabled: boolean;
175
154
  };
155
+ /** Serialize to a JSON-safe plain object */
156
+ toJSON(): DiagnosticReportJSON;
176
157
  }
177
158
 
178
159
  /**
@@ -1,6 +1,6 @@
1
1
  import { QueryClient } from '@tanstack/query-core';
2
2
  import { T as Token } from './Token-CbP_OutD.cjs';
3
- import { a as BytecodeProgram } from './BytecodeBuilder-BGq9ZiO3.cjs';
3
+ import { a as BytecodeProgram } from './BytecodeBuilder-CRYfrFfq.cjs';
4
4
  import { V as Value } from './Value-DCTqTSeP.cjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { QueryClient } from '@tanstack/query-core';
2
2
  import { T as Token } from './Token-CbP_OutD.js';
3
- import { a as BytecodeProgram } from './BytecodeBuilder-BGq9ZiO3.js';
3
+ import { a as BytecodeProgram } from './BytecodeBuilder-CRYfrFfq.js';
4
4
  import { V as Value } from './Value-DCTqTSeP.js';
5
5
 
6
6
  /**
package/dist/testing.cjs CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';var chunkPL7AH5EU_cjs=require('./chunk-PL7AH5EU.cjs');require('./chunk-FNNIAJNY.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-LNZNJSRW.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-556Q7VZC.cjs'),require('./chunk-MVP2YD4X.cjs'),require('./chunk-6TPXH6Y5.cjs'),require('./chunk-R2SZFJTT.cjs');var chunk2VK3NH5S_cjs=require('./chunk-2VK3NH5S.cjs');require('./chunk-FUDVKPB7.cjs'),require('./chunk-WYIOXAFW.cjs'),require('./chunk-4QVBSG6B.cjs'),require('./chunk-C65UDMWH.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-EURCQMZK.cjs'),require('./chunk-4BZIYU7S.cjs'),require('./chunk-VBSMA7WJ.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-75XDS65A.cjs');var chunkPNDQRCRQ_cjs=require('./chunk-PNDQRCRQ.cjs');require('./chunk-BKSKZA4W.cjs');var chunkLUMVKVFQ_cjs=require('./chunk-LUMVKVFQ.cjs');require('./chunk-3HYO3QYW.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-SNVPM27Q.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-MSYX32PF.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs');var chunkSOMGSIO4_cjs=require('./chunk-SOMGSIO4.cjs');var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new chunkPL7AH5EU_cjs.n({locale:e,packages:r?chunk2VK3NH5S_cjs.y:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof chunkSOMGSIO4_cjs.b)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new chunkPNDQRCRQ_cjs.m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=chunkPL7AH5EU_cjs.a(this.pkg,t),s=$.indexOf(e),a=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a.length>0){let u=a.map(g=>`[${g.severity}] ${g.detail}`).join(`
1
+ 'use strict';var chunkFPGYRFJY_cjs=require('./chunk-FPGYRFJY.cjs');require('./chunk-IMXSVHQK.cjs'),require('./chunk-NGBBNL4K.cjs'),require('./chunk-LNZNJSRW.cjs'),require('./chunk-TTFO4YDP.cjs'),require('./chunk-VJP4GGCW.cjs'),require('./chunk-HG4NPDN5.cjs'),require('./chunk-UUAFDZK6.cjs'),require('./chunk-R2SZFJTT.cjs');var chunkKKMLFYVW_cjs=require('./chunk-KKMLFYVW.cjs');require('./chunk-W5ELYJ4Z.cjs'),require('./chunk-HDGARCI2.cjs'),require('./chunk-FVQWN5HZ.cjs'),require('./chunk-RC4M6HBX.cjs'),require('./chunk-UURM7P3P.cjs'),require('./chunk-ZLRJ7TDP.cjs'),require('./chunk-EEVUKZ5B.cjs'),require('./chunk-GWCBPITD.cjs'),require('./chunk-ABVDKMNF.cjs'),require('./chunk-TLG7VZRX.cjs'),require('./chunk-5TVI2UPZ.cjs'),require('./chunk-2XZCLDHJ.cjs');var chunk6U66HQKQ_cjs=require('./chunk-6U66HQKQ.cjs');require('./chunk-BKSKZA4W.cjs');var chunkEEUA3OJ6_cjs=require('./chunk-EEUA3OJ6.cjs');require('./chunk-EXCFCHAT.cjs'),require('./chunk-Y7O4D3BJ.cjs'),require('./chunk-FAGFPVYK.cjs'),require('./chunk-5IJD5L3O.cjs'),require('./chunk-S3DFU33X.cjs'),require('./chunk-WEAKI5V5.cjs'),require('./chunk-6QRHN3I6.cjs');var chunkNAZ6PGLS_cjs=require('./chunk-NAZ6PGLS.cjs');var i=class o extends Error{constructor(t){super(t.message),this.name="ExpectationError",this.code=t.code,this.expected=t.expected,this.actual=t.actual,Object.setPrototypeOf(this,o.prototype);}};function V(o=[],t={}){let{locale:e="en",includeBuiltins:r=true}=t,s=new chunkFPGYRFJY_cjs.n({locale:e,packages:r?chunkKKMLFYVW_cjs.y:[]});for(let a of o)s.registerPackage(a);return s}function v(o,t){try{let e=o.evaluateExpression(t);return e.isError()?{status:"error",code:e.errorCode??"",message:e.errorMessage??"",source:e}:e.isPending()?{status:"pending",value:e}:{status:"value",value:e}}catch(e){if(e instanceof chunkNAZ6PGLS_cjs.b)return {status:"error",code:e.code,message:e.message,source:e};let r=e instanceof Error?e.message:String(e);return {status:"error",code:"UNKNOWN_ERROR",message:r,source:new chunk6U66HQKQ_cjs.m(13,"UNKNOWN_ERROR",r)}}}function x(o,t){if(Object.is(o,t))return true;if(!Number.isFinite(o)||!Number.isFinite(t))return false;let e=1e-9*Math.max(1,Math.abs(o),Math.abs(t));return Math.abs(o-t)<=e}function l(o){return o.type===3?JSON.stringify(o.value):o.type===6&&typeof o.unit=="string"?`${String(o.value)} ${o.unit}`:String(o.value)}function n(o){switch(o.status){case "value":return l(o.value);case "pending":return "a pending async value";case "error":return `an error (${o.code}: ${o.message})`}}var d=class{constructor(t,e){this.expression=t;this.outcome=e;}get value(){if(this.outcome.status==="error")throw new i({code:"EXPECTED_VALUE",message:`Expected "${this.expression}" to evaluate, but it failed with ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this.outcome.value}toEvaluate(){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EVALUATE",message:`Expected "${this.expression}" to evaluate to a value, but got ${n(this.outcome)}.`,expected:"a resolved value",actual:n(this.outcome)});return this}toEqual(t,e){if(this.outcome.status!=="value")throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but got ${n(this.outcome)}.`,expected:c(t,e),actual:n(this.outcome)});let r=this.outcome.value,s;if(typeof t=="number"?s=x(r.toNumber(),t):typeof t=="boolean"?s=r.type===10&&r.value===t:s=C(r)===t,!s)throw new i({code:"EXPECTED_EQUAL",message:`Expected "${this.expression}" to equal ${c(t,e)}, but it was ${l(r)}.`,expected:c(t,e),actual:l(r)});if(e!==void 0&&r.unit!==e)throw new i({code:"EXPECTED_UNIT",message:`Expected "${this.expression}" to carry the unit "${e}", but it was ${r.unit===void 0?"unitless":`"${r.unit}"`}.`,expected:`unit "${e}"`,actual:r.unit===void 0?"no unit":`unit "${r.unit}"`});return this}toBeError(){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_ERROR",message:`Expected "${this.expression}" to fail, but it produced ${n(this.outcome)}.`,expected:"an error",actual:n(this.outcome)});return this}toFailWith(t){if(this.outcome.status!=="error")throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it produced ${n(this.outcome)}.`,expected:`error code "${t}"`,actual:n(this.outcome)});if(this.outcome.code!==t)throw new i({code:"EXPECTED_FAIL_WITH",message:`Expected "${this.expression}" to fail with "${t}", but it failed with "${this.outcome.code}" (${this.outcome.message}).`,expected:`error code "${t}"`,actual:`error code "${this.outcome.code}"`});return this}toBePending(){if(this.outcome.status!=="pending")throw new i({code:"EXPECTED_PENDING",message:`Expected "${this.expression}" to be pending, but got ${n(this.outcome)}.`,expected:"a pending async value",actual:n(this.outcome)});return this}};function c(o,t){let e=typeof o=="string"?JSON.stringify(o):String(o);return t===void 0?e:`${e} ${t}`}function C(o){return String(o.value)}function D(o,t){return new d(t,v(o,t))}var O=["a","an","and","or","but","if","then","the","this","that","these","those","in","on","at","to","of","for","from","with","by","as","per","into","over","is","are","was","were","be","been","being","do","does","did","have","has","had","will","would","can","could","should","may","might","must","price","cost","value","total","sum","count","rate","amount","number","time","date","day","week","month","year","hour","minute","second","add","buy","sell","hold","make","take","give","get","set","run","up","down","out","off","all","some","any","no","not","more","less","one","two","three","first","last","next","each","every","here","there"],$=["error","warning","info"];function k(o){let t=[],e=o.lexerVocabulary;if(e?.keywords)for(let[r,s]of Object.entries(e.keywords))t.push({word:r,via:"keyword",tokenType:s});if(e?.units)for(let r of e.units)t.push({word:r,via:"unit"});if(e?.operators)for(let[r,s]of Object.entries(e.operators))t.push({word:r,via:"operator",tokenType:s});if(o.phrases)for(let[r,s]of Object.entries(o.phrases))r.includes(" ")||t.push({word:r,via:"phrase",tokenType:s});return t}var p=class{constructor(t){this.pkg=t;}notToShadow(t=O){let e=new Set(t.map(s=>s.toLowerCase())),r=k(this.pkg).filter(s=>e.has(s.word.toLowerCase()));if(r.length>0){let s=r.map(a=>`"${a.word}" (${a.via})`).join(", ");throw new i({code:"PACKAGE_SHADOWS_PROSE",message:`Package "${this.pkg.name}" claims prose word(s) as syntax: ${s}. A word that is also ordinary English turns prose into arithmetic; prefer a multi-word phrase or a form that requires a parenthesis.`,expected:"no prose words claimed as syntax",actual:s})}return r}notToCollideWith(t,e="error"){let r=chunkFPGYRFJY_cjs.a(this.pkg,t),s=$.indexOf(e),a=r.conflicts.filter(u=>$.indexOf(u.severity)<=s);if(a.length>0){let u=a.map(g=>`[${g.severity}] ${g.detail}`).join(`
2
2
  `);throw new i({code:"PACKAGE_VOCABULARY_COLLISION",message:`Package "${this.pkg.name}" collides with another package:
3
- ${u}`,expected:`no conflicts at or above "${e}" severity`,actual:`${a.length} conflict(s)`})}return r}toDeclareCompatibleEngineVersion(t=chunkLUMVKVFQ_cjs.a){let e=chunkPL7AH5EU_cjs.b(this.pkg,t);if(!e.compatible){let r=e.reason==="invalid-range"?`its range "${e.declaredRange}" is not valid semver`:`its range "${e.declaredRange}" is not satisfied by engine version "${e.engineVersion}"`;throw new i({code:"PACKAGE_ENGINE_VERSION_INCOMPATIBLE",message:`Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${r}.`,expected:`an engineVersion satisfied by "${t}"`,actual:`"${e.declaredRange}"`})}return this}};function L(o){return new p(o)}exports.COMMON_PROSE_WORDS=O;exports.ExpectationError=i;exports.ExpressionAssertion=d;exports.PackageAssertion=p;exports.createTestEngine=V;exports.expectExpression=D;exports.expectPackage=L;//# sourceMappingURL=testing.cjs.map
3
+ ${u}`,expected:`no conflicts at or above "${e}" severity`,actual:`${a.length} conflict(s)`})}return r}toDeclareCompatibleEngineVersion(t=chunkEEUA3OJ6_cjs.a){let e=chunkFPGYRFJY_cjs.b(this.pkg,t);if(!e.compatible){let r=e.reason==="invalid-range"?`its range "${e.declaredRange}" is not valid semver`:`its range "${e.declaredRange}" is not satisfied by engine version "${e.engineVersion}"`;throw new i({code:"PACKAGE_ENGINE_VERSION_INCOMPATIBLE",message:`Package "${this.pkg.name}" declares an engineVersion that will be rejected at registration: ${r}.`,expected:`an engineVersion satisfied by "${t}"`,actual:`"${e.declaredRange}"`})}return this}};function L(o){return new p(o)}exports.COMMON_PROSE_WORDS=O;exports.ExpectationError=i;exports.ExpressionAssertion=d;exports.PackageAssertion=p;exports.createTestEngine=V;exports.expectExpression=D;exports.expectPackage=L;//# sourceMappingURL=testing.cjs.map
4
4
  //# sourceMappingURL=testing.cjs.map