solve-engine 2.28.0 → 2.30.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 (152) hide show
  1. package/dist/{EngineError-CA2tiVaI.d.cts → EngineError-CqGtaT_v.d.cts} +4 -0
  2. package/dist/{EngineError-CA2tiVaI.d.ts → EngineError-CqGtaT_v.d.ts} +4 -0
  3. package/dist/{Lexer-B62Hn9I-.d.ts → Lexer-CqFjYoRA.d.ts} +1 -1
  4. package/dist/{Lexer-DOXatsjO.d.cts → Lexer-sCI05tqO.d.cts} +1 -1
  5. package/dist/{PackageCompatibility-DW18LqED.d.cts → PackageCompatibility-Bn-T_xKW.d.cts} +1 -1
  6. package/dist/{PackageCompatibility-DT1IPlQx.d.ts → PackageCompatibility-phvSFP4f.d.ts} +1 -1
  7. package/dist/{PackageRegistry-CevYUzRn.d.cts → PackageRegistry-B-C1duZw.d.cts} +3 -3
  8. package/dist/{PackageRegistry-Dl9kNP14.d.ts → PackageRegistry-C78jVkI9.d.ts} +3 -3
  9. package/dist/{VMBuiltins-AIivGl0a.d.cts → VMBuiltins-BkKzhj6C.d.cts} +1 -1
  10. package/dist/{VMBuiltins-CbuFfIgQ.d.ts → VMBuiltins-Du9y8sEo.d.ts} +1 -1
  11. package/dist/{VMCheckpoints-BVrJwfZY.d.cts → VMCheckpoints-WdUQrdc9.d.cts} +1 -1
  12. package/dist/{VMCheckpoints-DFCl63K5.d.ts → VMCheckpoints-gvy_yxYh.d.ts} +1 -1
  13. package/dist/{WorkerError-DDtwl4oH.d.cts → WorkerError-CRoM8Ju1.d.cts} +1 -1
  14. package/dist/{WorkerError-BuO9MrRr.d.ts → WorkerError-DTrl3Jag.d.ts} +1 -1
  15. package/dist/{chunk-IEBWLNI5.js → chunk-2PGGPFF3.js} +2 -2
  16. package/dist/{chunk-IEBWLNI5.js.map → chunk-2PGGPFF3.js.map} +1 -1
  17. package/dist/{chunk-I6WGOM3C.js → chunk-3ZGFAE3Q.js} +2 -2
  18. package/dist/{chunk-I6WGOM3C.js.map → chunk-3ZGFAE3Q.js.map} +1 -1
  19. package/dist/{chunk-UMW5PO42.cjs → chunk-4DR5RBHQ.cjs} +2 -2
  20. package/dist/{chunk-UMW5PO42.cjs.map → chunk-4DR5RBHQ.cjs.map} +1 -1
  21. package/dist/{chunk-WXOJ3DS3.cjs → chunk-5AKT36UK.cjs} +2 -2
  22. package/dist/{chunk-WXOJ3DS3.cjs.map → chunk-5AKT36UK.cjs.map} +1 -1
  23. package/dist/{chunk-MKBB7IVN.cjs → chunk-7DJYS5PO.cjs} +2 -2
  24. package/dist/{chunk-MKBB7IVN.cjs.map → chunk-7DJYS5PO.cjs.map} +1 -1
  25. package/dist/{chunk-KYE5BWPN.cjs → chunk-A755LVPT.cjs} +2 -2
  26. package/dist/{chunk-KYE5BWPN.cjs.map → chunk-A755LVPT.cjs.map} +1 -1
  27. package/dist/{chunk-5J2XDCSV.cjs → chunk-A764BY7L.cjs} +2 -2
  28. package/dist/{chunk-5J2XDCSV.cjs.map → chunk-A764BY7L.cjs.map} +1 -1
  29. package/dist/{chunk-TTHCH7V2.cjs → chunk-AGCNMEP2.cjs} +2 -2
  30. package/dist/{chunk-TTHCH7V2.cjs.map → chunk-AGCNMEP2.cjs.map} +1 -1
  31. package/dist/{chunk-MONPHAHO.js → chunk-B2NL65FI.js} +2 -2
  32. package/dist/{chunk-MONPHAHO.js.map → chunk-B2NL65FI.js.map} +1 -1
  33. package/dist/{chunk-RRJ77SF6.js → chunk-CB3EXUM2.js} +2 -2
  34. package/dist/{chunk-RRJ77SF6.js.map → chunk-CB3EXUM2.js.map} +1 -1
  35. package/dist/{chunk-OKSAUK5C.js → chunk-CDE2ZUGG.js} +2 -2
  36. package/dist/{chunk-OKSAUK5C.js.map → chunk-CDE2ZUGG.js.map} +1 -1
  37. package/dist/{chunk-POIHAKBX.js → chunk-CIC2YO2M.js} +2 -2
  38. package/dist/{chunk-POIHAKBX.js.map → chunk-CIC2YO2M.js.map} +1 -1
  39. package/dist/{chunk-YLTNXYA7.cjs → chunk-CM2WM5CM.cjs} +2 -2
  40. package/dist/{chunk-YLTNXYA7.cjs.map → chunk-CM2WM5CM.cjs.map} +1 -1
  41. package/dist/{chunk-2YNRIT2L.cjs → chunk-DUFEONVN.cjs} +3 -3
  42. package/dist/{chunk-2YNRIT2L.cjs.map → chunk-DUFEONVN.cjs.map} +1 -1
  43. package/dist/{chunk-JHHSQ2YR.js → chunk-FNSQ6O4Y.js} +3 -3
  44. package/dist/{chunk-JHHSQ2YR.js.map → chunk-FNSQ6O4Y.js.map} +1 -1
  45. package/dist/{chunk-7ASISMXA.js → chunk-FXB5GCBT.js} +2 -2
  46. package/dist/{chunk-7ASISMXA.js.map → chunk-FXB5GCBT.js.map} +1 -1
  47. package/dist/{chunk-2RLNVS6G.js → chunk-G3POUURF.js} +2 -2
  48. package/dist/{chunk-2RLNVS6G.js.map → chunk-G3POUURF.js.map} +1 -1
  49. package/dist/{chunk-2G3AW6OQ.cjs → chunk-GWV273KZ.cjs} +2 -2
  50. package/dist/{chunk-2G3AW6OQ.cjs.map → chunk-GWV273KZ.cjs.map} +1 -1
  51. package/dist/{chunk-N22D5ZD4.js → chunk-IQVSCL2R.js} +3 -3
  52. package/dist/{chunk-N22D5ZD4.js.map → chunk-IQVSCL2R.js.map} +1 -1
  53. package/dist/{chunk-6T5HPIZX.js → chunk-KH4QXKLT.js} +2 -2
  54. package/dist/{chunk-6T5HPIZX.js.map → chunk-KH4QXKLT.js.map} +1 -1
  55. package/dist/{chunk-OLATJABN.js → chunk-LP3JYC3A.js} +2 -2
  56. package/dist/{chunk-OLATJABN.js.map → chunk-LP3JYC3A.js.map} +1 -1
  57. package/dist/{chunk-FSNBYRNA.cjs → chunk-NNRTDLGC.cjs} +3 -3
  58. package/dist/{chunk-FSNBYRNA.cjs.map → chunk-NNRTDLGC.cjs.map} +1 -1
  59. package/dist/{chunk-APU5LON7.js → chunk-NOZKHMML.js} +3 -3
  60. package/dist/{chunk-APU5LON7.js.map → chunk-NOZKHMML.js.map} +1 -1
  61. package/dist/{chunk-A7RRWNLE.js → chunk-NQFCXLEF.js} +2 -2
  62. package/dist/{chunk-A7RRWNLE.js.map → chunk-NQFCXLEF.js.map} +1 -1
  63. package/dist/{chunk-O5ZLOZPH.cjs → chunk-OM7NOHJF.cjs} +2 -2
  64. package/dist/{chunk-O5ZLOZPH.cjs.map → chunk-OM7NOHJF.cjs.map} +1 -1
  65. package/dist/{chunk-QXGKONTZ.cjs → chunk-P43SV4NJ.cjs} +3 -3
  66. package/dist/{chunk-QXGKONTZ.cjs.map → chunk-P43SV4NJ.cjs.map} +1 -1
  67. package/dist/{chunk-IIBR4LVH.cjs → chunk-PNHTC3FM.cjs} +4 -4
  68. package/dist/{chunk-IIBR4LVH.cjs.map → chunk-PNHTC3FM.cjs.map} +1 -1
  69. package/dist/{chunk-DDVDRWCK.js → chunk-PTXUWGRR.js} +3 -3
  70. package/dist/{chunk-DDVDRWCK.js.map → chunk-PTXUWGRR.js.map} +1 -1
  71. package/dist/{chunk-GWEINEJG.cjs → chunk-Q7TBBV62.cjs} +2 -2
  72. package/dist/{chunk-GWEINEJG.cjs.map → chunk-Q7TBBV62.cjs.map} +1 -1
  73. package/dist/chunk-RAFOQ4T5.cjs +2 -0
  74. package/dist/{chunk-5NQE5JMU.cjs.map → chunk-RAFOQ4T5.cjs.map} +1 -1
  75. package/dist/{chunk-Z5DA5UXY.js → chunk-RELMEWY6.js} +2 -2
  76. package/dist/chunk-RELMEWY6.js.map +1 -0
  77. package/dist/{chunk-RVNW627Y.cjs → chunk-RHRAONDK.cjs} +2 -2
  78. package/dist/{chunk-RVNW627Y.cjs.map → chunk-RHRAONDK.cjs.map} +1 -1
  79. package/dist/{chunk-Z5VBXZ4A.js → chunk-SFM4XFGJ.js} +2 -2
  80. package/dist/{chunk-Z5VBXZ4A.js.map → chunk-SFM4XFGJ.js.map} +1 -1
  81. package/dist/{chunk-HTAT4MGN.cjs → chunk-SUAGBRQ7.cjs} +2 -2
  82. package/dist/chunk-SUAGBRQ7.cjs.map +1 -0
  83. package/dist/chunk-V7LXOTCU.js +3 -0
  84. package/dist/chunk-V7LXOTCU.js.map +1 -0
  85. package/dist/{chunk-7ZYYWSLT.js → chunk-VLX7ZVK4.js} +2 -2
  86. package/dist/{chunk-7ZYYWSLT.js.map → chunk-VLX7ZVK4.js.map} +1 -1
  87. package/dist/chunk-W7NN77PH.cjs +3 -0
  88. package/dist/chunk-W7NN77PH.cjs.map +1 -0
  89. package/dist/{chunk-W5BBKLNS.cjs → chunk-WQGHJAW2.cjs} +2 -2
  90. package/dist/{chunk-W5BBKLNS.cjs.map → chunk-WQGHJAW2.cjs.map} +1 -1
  91. package/dist/{chunk-U7CNADCJ.cjs → chunk-WU7SBKVU.cjs} +2 -2
  92. package/dist/{chunk-U7CNADCJ.cjs.map → chunk-WU7SBKVU.cjs.map} +1 -1
  93. package/dist/{chunk-LV7PJ2MU.js → chunk-X5K72MBV.js} +2 -2
  94. package/dist/{chunk-LV7PJ2MU.js.map → chunk-X5K72MBV.js.map} +1 -1
  95. package/dist/{chunk-IAL64FCP.js → chunk-YN5H54GM.js} +2 -2
  96. package/dist/{chunk-IAL64FCP.js.map → chunk-YN5H54GM.js.map} +1 -1
  97. package/dist/{chunk-UBKWHRFL.cjs → chunk-YWF6C2IO.cjs} +2 -2
  98. package/dist/{chunk-UBKWHRFL.cjs.map → chunk-YWF6C2IO.cjs.map} +1 -1
  99. package/dist/constants.cjs +1 -1
  100. package/dist/constants.js +1 -1
  101. package/dist/engine.cjs +1 -1
  102. package/dist/engine.d.cts +6 -6
  103. package/dist/engine.d.ts +6 -6
  104. package/dist/engine.js +1 -1
  105. package/dist/errors.cjs +1 -1
  106. package/dist/errors.d.cts +3 -3
  107. package/dist/errors.d.ts +3 -3
  108. package/dist/errors.js +1 -1
  109. package/dist/format.cjs +1 -1
  110. package/dist/format.js +1 -1
  111. package/dist/index.cjs +1 -1
  112. package/dist/index.d.cts +6 -6
  113. package/dist/index.d.ts +6 -6
  114. package/dist/index.js +1 -1
  115. package/dist/language.d.cts +5 -5
  116. package/dist/language.d.ts +5 -5
  117. package/dist/lexer.cjs +1 -1
  118. package/dist/lexer.d.cts +3 -3
  119. package/dist/lexer.d.ts +3 -3
  120. package/dist/lexer.js +1 -1
  121. package/dist/normalizer.cjs +1 -1
  122. package/dist/normalizer.js +1 -1
  123. package/dist/packages.cjs +1 -1
  124. package/dist/packages.d.cts +4 -4
  125. package/dist/packages.d.ts +4 -4
  126. package/dist/packages.js +1 -1
  127. package/dist/parser.cjs +1 -1
  128. package/dist/parser.js +1 -1
  129. package/dist/temporal.cjs +1 -1
  130. package/dist/temporal.js +1 -1
  131. package/dist/testing.cjs +2 -2
  132. package/dist/testing.d.cts +5 -5
  133. package/dist/testing.d.ts +5 -5
  134. package/dist/testing.js +1 -1
  135. package/dist/uom.cjs +1 -1
  136. package/dist/uom.js +1 -1
  137. package/dist/vm.cjs +1 -1
  138. package/dist/vm.d.cts +3 -3
  139. package/dist/vm.d.ts +3 -3
  140. package/dist/vm.js +1 -1
  141. package/dist/worker.cjs +2 -2
  142. package/dist/worker.d.cts +5 -5
  143. package/dist/worker.d.ts +5 -5
  144. package/dist/worker.js +1 -1
  145. package/package.json +1 -1
  146. package/dist/chunk-3LWK33TJ.js +0 -3
  147. package/dist/chunk-3LWK33TJ.js.map +0 -1
  148. package/dist/chunk-5NQE5JMU.cjs +0 -2
  149. package/dist/chunk-HTAT4MGN.cjs.map +0 -1
  150. package/dist/chunk-YIXCPLCN.cjs +0 -3
  151. package/dist/chunk-YIXCPLCN.cjs.map +0 -1
  152. package/dist/chunk-Z5DA5UXY.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import {e,c}from'./chunk-FAO6DQ74.js';import {a}from'./chunk-LHLW7JLS.js';import {a as a$1}from'./chunk-CHVGFTO3.js';import {c as c$1,b as b$1}from'./chunk-Z5DA5UXY.js';e();var x=c("BACKTICK_OPEN"),Q=c("BIGINT"),P=c("COMMENT"),A=c("CURRENCY_SYMBOL"),N=c("DOLLAR"),g=c("DOT"),v=c("EURO"),$=c("HEX_COLOUR"),b=c("IDENT"),j=c("INLINE_SOLVE_START"),q=c("LSHIFT"),U=c("MINUS"),_=c("NEQ"),I=c("NUMBER"),M=c("PLUS_MINUS"),B=c("POUND"),X=c("RSHIFT"),D=c("RUBLE"),H=c("SLASH"),Y=c("STAR"),J=c("STRING"),Z=c("TAG"),K=c("UNIT"),ee=c("URSHIFT"),F=c("WON"),G=c("YEN");function te(){let c=new Uint8Array(128);for(let t=48;t<=57;t++)c[t]=2;for(let t=65;t<=90;t++)c[t]=3;for(let t=97;t<=122;t++)c[t]=3;return c[95]=3,c[46]=4,c[32]=1,c[9]=1,c[10]=1,c[13]=1,c[33]=5,c[37]=5,c[38]=5,c[40]=5,c[41]=5,c[42]=5,c[43]=5,c[44]=5,c[45]=5,c[47]=5,c[58]=5,c[59]=5,c[60]=5,c[61]=5,c[62]=5,c[63]=5,c[91]=5,c[93]=5,c[94]=5,c[123]=5,c[124]=5,c[125]=5,c[126]=5,c[64]=5,c[34]=6,c[35]=7,c[36]=8,c[96]=11,c}function E(c){return c===133||c===160||c===5760||c>=8192&&c<=8202||c===8203||c===8232||c===8233||c===8239||c===8287||c===12288||c===65279}var l=class{constructor(t,i,e,s,n,r,o,h,a,u){this.type=t;this.typeId=i;this.value=e;this.text=s;this.offset=n;this.lineBreaks=r;this.line=o;this.col=h;this.sourceEnd=a;this.fault=u;}},W={61:{61:"EQUALITY",62:"THEREFORE"},33:{61:"NEQ"},62:{61:"GTE"},60:{61:"LTE"},38:{38:"LOGICAL_AND"},124:{124:"LOGICAL_OR"},43:{61:"PLUS_EQUALS"},45:{61:"MINUS_EQUALS"}},z={43:"PLUS",45:"MINUS",42:"STAR",47:"SLASH",94:"CARET",37:"PERCENT",40:"LPAREN",41:"RPAREN",91:"LBRACKET",93:"RBRACKET",123:"LBRACE",125:"RBRACE",44:"COMMA",58:"COLON",59:"SEMICOLON",61:"EQUALS",63:"QUESTION",33:"BANG",38:"BIT_AND",124:"BIT_OR",60:"LT",62:"GT",126:"BIT_NOT",64:"AT"},se=(()=>{let c=new Set;for(let i=48;i<=57;i++)c.add(i);let t=[43,45,42,47,94,37,40,41,91,93,123,125,61,60,62,33,38,124,126,59,63];for(let i of t)c.add(i);return c.add(36),c.add(163),c.add(8364),c.add(165),c.add(8381),c.add(8361),c.add(96),c.add(46),c.add(35),c})(),R=class R{constructor(t="en",i){this.input="";this.pos=0;this.len=0;this.line=1;this.lineStartPos=0;this.groupingStack=[];this.pluginKeywordOwners=new Map;this.pluginUnitOwners=new Map;this.pluginOperatorOwners=new Map;this.pluginOperators=new Map;this.pluginUnits=new Set;this.hasPluginOps=false;this._inlineSolveSpans=[];this.pluginRawLinePatterns=[];this.pendingRawLineToken=null;this.localeCode=t,this.locale=a(t),this.keywordMap=new Map;for(let[e,s]of Object.entries(this.locale.keywordMap))this.keywordMap.set(e.toLowerCase(),s);this.mergedKeywords=new Map(this.keywordMap),this.mergedUnits=a$1;}matchRawLine(t){for(let i of this.pluginRawLinePatterns){let e=i.pattern.exec(t);if(e&&typeof e[1]=="string"){let s=e[1].trim();if(s.length>0)return new l(i.tokenType,c(i.tokenType),s,s,0,0,this.line,1)}}return null}rebuildMergedUnits(){this.mergedUnits=this.pluginUnits.size===0?a$1:new Set([...a$1,...this.pluginUnits]);}registerVocabulary(t){if(t.keywords)for(let i of Object.keys(t.keywords)){let e=i.toLowerCase();if(this.keywordMap.has(e))throw c$1.config("PLUGIN_KEYWORD_COLLISION",`Plugin keyword "${i}" conflicts with built-in keyword (type: ${this.keywordMap.get(e)}). Built-in keywords cannot be overridden.`,{keyword:i,builtinType:this.keywordMap.get(e)})}if(t.operators){for(let i of Object.keys(t.operators))if(i.length===2){let e=i.charCodeAt(0),s=i.charCodeAt(1),n=W[e];if(n&&n[s]!==void 0)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in operator (type: ${n[s]}). Built-in operators cannot be overridden.`,{operator:i,builtinType:n[s]});if(e===60&&s===60)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in operator (type: LSHIFT). Built-in operators cannot be overridden.`,{operator:i,builtinType:"LSHIFT"});if(e===62&&s===62)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in operator (type: RSHIFT). Built-in operators cannot be overridden.`,{operator:i,builtinType:"RSHIFT"});if(e===47&&s===47)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in comment sequence. Comment sequences cannot be overridden.`,{operator:i,builtinType:"COMMENT"})}}if(t.units){for(let i of t.units)if(a$1.has(i))throw c$1.config("PLUGIN_UNIT_COLLISION",`Plugin unit "${i}" conflicts with a built-in unit. Built-in units cannot be overridden.`,{unit:i})}if(t.keywords)for(let[i,e]of Object.entries(t.keywords)){let s=i.toLowerCase();this.claim(this.pluginKeywordOwners,s,t,e),this.mergedKeywords.set(s,e);}if(t.operators){this.hasPluginOps=true;for(let[i,e]of Object.entries(t.operators))if(i.length===2){let s=i.charCodeAt(0),n=i.charCodeAt(1);this.claim(this.pluginOperatorOwners,s*65536+n,t,e);let r=this.pluginOperators.get(s);r||(r=new Map,this.pluginOperators.set(s,r)),r.set(n,e);}}if(t.units){for(let i of t.units){let e=this.pluginUnitOwners.get(i);e?e.push(t):this.pluginUnitOwners.set(i,[t]),this.pluginUnits.add(i);}this.rebuildMergedUnits();}t.rawLinePatterns&&this.pluginRawLinePatterns.push(...t.rawLinePatterns);}claim(t,i,e,s){let n=t.get(i);n?n.push({owner:e,tokenType:s}):t.set(i,[{owner:e,tokenType:s}]);}release(t,i,e){let s=t.get(i);if(!s)return;let n=s.filter(r=>r.owner!==e);if(n.length===0){t.delete(i);return}return t.set(i,n),n[n.length-1]}unregisterVocabulary(t){if(t.keywords)for(let i of Object.keys(t.keywords)){let e=i.toLowerCase(),s=this.release(this.pluginKeywordOwners,e,t);s?this.mergedKeywords.set(e,s.tokenType):this.mergedKeywords.delete(e);}if(t.operators){for(let i of Object.keys(t.operators))if(i.length===2){let e=i.charCodeAt(0),s=i.charCodeAt(1),n=this.release(this.pluginOperatorOwners,e*65536+s,t),r=this.pluginOperators.get(e);if(!r)continue;if(n){r.set(s,n.tokenType);continue}r.delete(s),r.size===0&&this.pluginOperators.delete(e);}this.hasPluginOps=this.pluginOperators.size>0;}if(t.units){for(let i of t.units){let e=this.pluginUnitOwners.get(i);if(!e)continue;let s=e.filter(n=>n!==t);if(s.length>0){this.pluginUnitOwners.set(i,s);continue}this.pluginUnitOwners.delete(i),this.pluginUnits.delete(i);}this.rebuildMergedUnits();}if(t.rawLinePatterns){let i=new Set(t.rawLinePatterns);this.pluginRawLinePatterns=this.pluginRawLinePatterns.filter(e=>!i.has(e));}}reset(t){this.input=t,this.pos=0,this.len=t.length,this.line=1,this.lineStartPos=0,this.pendingRawLineToken=this.pluginRawLinePatterns.length>0?this.matchRawLine(t):null;}scanDocument(t){this.input=t,this.pos=0,this.len=t.length,this.line=1,this.lineStartPos=0;let i=[],e=this.input,s=this.len;for(;this.pos<s;){let n=this.pos,r=this.pos;for(;r<s;){let C=e.charCodeAt(r);if(C===10||C===13)break;r++;}let o=this.line,h=this.classifyFromPositions(n,r),a=e.slice(n,r),u=[],f;if(!h.skip){let C=this.pluginRawLinePatterns.length>0?this.matchRawLine(a):null;if(C)u=[C];else {let w=this.len;this.len=r,h.contentOffset!==void 0&&(this.pos=h.contentOffset);try{this.tokenizeInto(u);}catch(S){if(!(S instanceof b$1))throw S;f=S,u=[],this._inlineSolveSpans=[],this.line=o;}finally{this.len=w;}}}let p=[];if(h.hasInlineSolve)if(!h.skip&&u.length>0){let C=this.findInlineSolves(a);p=this._inlineSolveSpans.map((w,S)=>({start:C[S]?.start??0,end:C[S]?.end??0,expression:C[S]?.expression??"",columnNumber:C[S]?.columnNumber??w.columnNumber,startTokenIndex:w.startTokenIndex,endTokenIndex:w.endTokenIndex}));}else p=this.findInlineSolves(a);let T={text:a,lineNumber:o,startOffset:n,endOffset:r,classification:h,tokens:u,inlineSolves:p};if(f&&(T.error=f),i.push(T),this.pos=r,this.pos<s){let C=e.charCodeAt(this.pos);C===13?(this.pos++,this.pos<s&&e.charCodeAt(this.pos)===10&&this.pos++):C===10&&this.pos++;}this.line++,this.lineStartPos=this.pos;}return i}tokenizeAll(){if(this.pendingRawLineToken)return this._inlineSolveSpans=[],[this.pendingRawLineToken];let t=[];return this.tokenizeInto(t),t}tokenizeInto(t){let i=this.len;if(i===0){this._inlineSolveSpans=[];return}let e=0,s=null,n=[];if(i===1){let o=this.input.charCodeAt(0);switch(R.CHAR_CLASS[o]??0){case 2:t.push(new l("NUMBER",I,this.input,this.input,0,0,1,1)),e++;break;case 4:t.push(new l("DOT",g,".",".",0,0,1,1)),e++;break;case 3:{let a=this.input,u=a.toLowerCase();if(this.mergedUnits.has(a))t.push(new l("UNIT",K,a,a,0,0,1,1));else {let f=this.mergedKeywords.get(u);f?t.push(new l(f,c(f),a,a,0,0,1,1)):t.push(new l("IDENT",b,a,a,0,0,1,1));}e++;break}case 5:{let a=z[o];a&&(t.push(new l(a,c(a),this.input,this.input,0,0,1,1)),e++);break}case 6:this.pos=0,t.push(this.tokenizeString()),e++;break;case 7:this.pos=0,t.push(this.tokenizeComment()),e++;break;case 8:t.push(new l("DOLLAR",N,"$","$",0,0,1,1)),e++;break;case 11:t.push(new l("BACKTICK_OPEN",x,"`","`",0,0,1,1)),e++;break;default:{E(o)||(o===215?(t.push(new l("STAR",Y,"\xD7","\xD7",0,0,1,1)),e++):o===247?(t.push(new l("SLASH",H,"\xF7","\xF7",0,0,1,1)),e++):o===177?(t.push(new l("PLUS_MINUS",M,"\xB1","\xB1",0,0,1,1)),e++):o===8800?(t.push(new l("NEQ",_,"\u2260","\u2260",0,0,1,1)),e++):o===163?(t.push(new l("POUND",B,"\xA3","\xA3",0,0,1,1)),e++):o===8364?(t.push(new l("EURO",v,"\u20AC","\u20AC",0,0,1,1)),e++):o===165?(t.push(new l("YEN",G,"\xA5","\xA5",0,0,1,1)),e++):o===8381?(t.push(new l("RUBLE",D,"\u20BD","\u20BD",0,0,1,1)),e++):o===8361?(t.push(new l("WON",F,"\u20A9","\u20A9",0,0,1,1)),e++):o===8377?(t.push(new l("CURRENCY_SYMBOL",A,"\u20B9","\u20B9",0,0,1,1)),e++):o===8378?(t.push(new l("CURRENCY_SYMBOL",A,"\u20BA","\u20BA",0,0,1,1)),e++):o===8372?(t.push(new l("CURRENCY_SYMBOL",A,"\u20B4","\u20B4",0,0,1,1)),e++):o===8362?(t.push(new l("CURRENCY_SYMBOL",A,"\u20AA","\u20AA",0,0,1,1)),e++):o===8363?(t.push(new l("CURRENCY_SYMBOL",A,"\u20AB","\u20AB",0,0,1,1)),e++):o===8358?(t.push(new l("CURRENCY_SYMBOL",A,"\u20A6","\u20A6",0,0,1,1)),e++):o===8369?(t.push(new l("CURRENCY_SYMBOL",A,"\u20B1","\u20B1",0,0,1,1)),e++):o===8722||o===8211?(t.push(new l("MINUS",U,this.input,this.input,0,0,1,1)),e++):o>=128&&(t.push(new l("IDENT",b,this.input,this.input,0,0,1,1)),e++));break}}this._inlineSolveSpans=n;return}let r=this.input;for(this.groupingStack.length=0;this.pos<i;){let o=r.charCodeAt(this.pos),h=R.CHAR_CLASS[o]??0;if(s&&o===92&&this.pos+1<i&&r.charCodeAt(this.pos+1)===96){this.pos+=2;continue}switch(h){case 1:this.pos++,o===10?(this.line++,this.lineStartPos=this.pos,this.groupingStack.length=0):o===13&&(this.line++,this.pos<i&&r.charCodeAt(this.pos)===10&&this.pos++,this.lineStartPos=this.pos,this.groupingStack.length=0);break;case 2:t.push(this.tokenizeNumber()),e++;break;case 3:{let a=this.tokenizeIdentifier();a.type==="INLINE_SOLVE_START"&&(s={startTokenIndex:e,startColumn:a.col}),t.push(a),e++;break}case 4:if(this.pos+1<i)if((R.CHAR_CLASS[r.charCodeAt(this.pos+1)]??0)===2)t.push(this.tokenizeNumber());else {let u=this.pos-this.lineStartPos+1;t.push(new l("DOT",g,".",".",this.pos,0,this.line,u)),this.pos++;}else {let a=this.pos-this.lineStartPos+1;t.push(new l("DOT",g,".",".",this.pos,0,this.line,a)),this.pos++;}e++;break;case 5:t.push(this.tokenizeOperator()),e++;break;case 6:t.push(this.tokenizeString()),e++;break;case 7:t.push(this.tokenizeComment()),e++;break;case 8:{let a=this.pos-this.lineStartPos+1;t.push(new l("DOLLAR",N,"$","$",this.pos,0,this.line,a)),this.pos++,e++;break}case 11:{let a=this.pos-this.lineStartPos+1;if(t.push(new l("BACKTICK_OPEN",x,"`","`",this.pos,0,this.line,a)),this.pos++,s){let u=s;n.push({start:0,end:0,expression:"",columnNumber:u.startColumn,startTokenIndex:u.startTokenIndex,endTokenIndex:e}),s=null;}e++;break}default:{let a=this.pos-this.lineStartPos+1;if(E(o))this.pos++,(o===8232||o===8233||o===133)&&(this.line++,this.lineStartPos=this.pos);else if(o===215)t.push(new l("STAR",Y,"\xD7","\xD7",this.pos,0,this.line,a)),this.pos++,e++;else if(o===247)t.push(new l("SLASH",H,"\xF7","\xF7",this.pos,0,this.line,a)),this.pos++,e++;else if(o===177)t.push(new l("PLUS_MINUS",M,"\xB1","\xB1",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8800)t.push(new l("NEQ",_,"\u2260","\u2260",this.pos,0,this.line,a)),this.pos++,e++;else if(o===163)t.push(new l("POUND",B,"\xA3","\xA3",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8364)t.push(new l("EURO",v,"\u20AC","\u20AC",this.pos,0,this.line,a)),this.pos++,e++;else if(o===165)t.push(new l("YEN",G,"\xA5","\xA5",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8381)t.push(new l("RUBLE",D,"\u20BD","\u20BD",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8361)t.push(new l("WON",F,"\u20A9","\u20A9",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8377)t.push(new l("CURRENCY_SYMBOL",A,"\u20B9","\u20B9",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8378)t.push(new l("CURRENCY_SYMBOL",A,"\u20BA","\u20BA",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8372)t.push(new l("CURRENCY_SYMBOL",A,"\u20B4","\u20B4",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8362)t.push(new l("CURRENCY_SYMBOL",A,"\u20AA","\u20AA",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8363)t.push(new l("CURRENCY_SYMBOL",A,"\u20AB","\u20AB",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8358)t.push(new l("CURRENCY_SYMBOL",A,"\u20A6","\u20A6",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8369)t.push(new l("CURRENCY_SYMBOL",A,"\u20B1","\u20B1",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8722||o===8211){let u=this.input[this.pos];t.push(new l("MINUS",U,u,u,this.pos,0,this.line,a)),this.pos++,e++;}else o>=128?(t.push(this.tokenizeIdentifier()),e++):this.pos++;break}}}this._inlineSolveSpans=n;}*[Symbol.iterator](){let t=[];this.tokenizeInto(t),yield*t;}tokenizeNumber(){let t=this.input,i=this.len,e=this.pos,s=e,n=e-this.lineStartPos+1,r;if(t.charCodeAt(e)===48&&e+1<i){let f=t.charCodeAt(e+1);if(f===120||f===88){for(e+=2;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102);)e++;let p=t.slice(s,e);return this.pos=e,new l("NUMBER",I,p,p,s,0,this.line,n)}if(f===98||f===66){for(e+=2;e<i&&(r=t.charCodeAt(e),r===48||r===49);)e++;let p=t.slice(s,e);return this.pos=e,new l("NUMBER",I,p,p,s,0,this.line,n)}if(f===111||f===79){for(e+=2;e<i&&(r=t.charCodeAt(e),r>=48&&r<=55);)e++;let p=t.slice(s,e);return this.pos=e,new l("NUMBER",I,p,p,s,0,this.line,n)}}let o=false;for(;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57);)o=true,e++;for(;o&&e<i&&(t.charCodeAt(e)===44||t.charCodeAt(e)===46)&&!(t.charCodeAt(e)===44&&this.groupingStack.length>0&&this.groupingStack[this.groupingStack.length-1]);){if(e+4<=i){let f=t.charCodeAt(e+1),p=t.charCodeAt(e+2),T=t.charCodeAt(e+3),C=e+4<i?t.charCodeAt(e+4):-1,w=!(C>=48&&C<=57);if(f>=48&&f<=57&&p>=48&&p<=57&&T>=48&&T<=57&&w){e+=4,o=true;continue}}break}let h=false;if(e<i&&t.charCodeAt(e)===46&&e+1<i){let f=t.charCodeAt(e+1);if(f>=48&&f<=57)for(h=true,e++;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57);)e++;}let a=false;if(e<i){let f=t.charCodeAt(e);if((f===101||f===69)&&e+1<i){let p=t.charCodeAt(e+1);if(p>=48&&p<=57||p===43||p===45)for(a=true,e++,(p===43||p===45)&&e++;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57);)e++;}}if(e<i&&t.charCodeAt(e)===110&&o&&!h&&!a){e++;let f=t.slice(s,e);return this.pos=e,new l("BIGINT",Q,f,f,s,0,this.line,n)}let u=t.slice(s,e);return this.pos=e,new l("NUMBER",I,u,u,s,0,this.line,n)}tokenizeIdentifier(){let t=this.input,i=this.len,e=this.pos,s=e,n=e-this.lineStartPos+1,r;for(;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95||r>=128&&!E(r));)e++;let o=t.slice(s,e),h=o.toLowerCase();if(h==="s"&&e<i&&t.charCodeAt(e)===96){e++,this.pos=e;let f=t.slice(s,e);return new l("INLINE_SOLVE_START",j,f,f,s,0,this.line,n)}if(this.mergedUnits.has(o)&&!this.isFollowedByLParen(e))return this.pos=e,new l("UNIT",K,o,o,s,0,this.line,n);let u=this.mergedKeywords.get(h);return u?(this.pos=e,new l(u,c(u),o,o,s,0,this.line,n)):(this.pos=e,new l("IDENT",b,o,o,s,0,this.line,n))}isFollowedByLParen(t){let i=this.len,e=t;for(;e<i;){let s=this.input.charCodeAt(e);if(s===40)return true;if(s!==32&&s!==9)break;e++;}return false}precededByCallTarget(t){let i=this.input,e=this.lineStartPos,s=t-1;for(;s>=e&&(i.charCodeAt(s)===32||i.charCodeAt(s)===9);)s--;if(s<e)return false;let n=i.charCodeAt(s),r=p=>p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p===95,o=p=>p>=65&&p<=90||p>=97&&p<=122||p===95;if(!r(n))return false;let h=s+1,a=false;for(;s>=e;){let p=i.charCodeAt(s);if(!r(p))break;o(p)&&(a=true),s--;}if(!a)return false;let u=i.slice(s+1,h).toLowerCase(),f=this.mergedKeywords.get(u);return f===void 0||f==="FUNC"}tokenizeOperator(){let t=this.input,i=this.pos,e=i-this.lineStartPos+1,s=t.charCodeAt(i),n=this.len;if(i+1<n){let h=t.charCodeAt(i+1),a=W[s];if(a){let u=a[h];if(u){let f=t.slice(i,i+2);return this.pos=i+2,new l(u,c(u),f,f,i,0,this.line,e)}}if(s===47&&h===47){let u=i+2;for(;u<n;){let p=t.charCodeAt(u);if(p===10||p===13)break;u++;}let f=t.slice(i,u);return this.pos=u,new l("COMMENT",P,f,f,i,0,this.line,e)}if(s===60&&h===60)return this.pos=i+2,new l("LSHIFT",q,"<<","<<",i,0,this.line,e);if(s===62&&h===62)return t.charCodeAt(i+2)===62?(this.pos=i+3,new l("URSHIFT",ee,">>>",">>>",i,0,this.line,e)):(this.pos=i+2,new l("RSHIFT",X,">>",">>",i,0,this.line,e));if(this.hasPluginOps){let u=this.pluginOperators.get(s);if(u){let f=u.get(h);if(f){let p=t.slice(i,i+2);return this.pos=i+2,new l(f,c(f),p,p,i,0,this.line,e)}}}}this.pos=i+1,s===91?this.groupingStack.push(true):s===40?this.groupingStack.push(this.precededByCallTarget(i)):(s===41||s===93)&&this.groupingStack.length>0&&this.groupingStack.pop();let r=z[s],o=t.charAt(i);return new l(r||"ERROR",c(r||"ERROR"),o,o,i,0,this.line,e)}tokenizeString(){let t=this.input,i=this.len,e=this.pos,s=e-this.lineStartPos+1,n=e+1,r=0;for(;n<i;){let o=t.charCodeAt(n);if(o===34){n++;let h=t.slice(e,n),a=t.slice(e+1,n-1);return this.pos=n,new l("STRING",J,a,h,e,r,this.line,s)}if(o===92&&n+1<i){n+=2;continue}o===10&&(this.line++,this.lineStartPos=n+1,r++),n++;}throw this.pos=n,c$1.parsing("UNTERMINATED_STRING",`Unterminated string literal: ${t.slice(e,n)}`,{literal:t.slice(e,n),offset:e})}static hasExpressionIndicators(t,i,e){let s=se;for(let n=i;n<e;n++){let r=t.charCodeAt(n);if(s.has(r)||r>=128&&(r===215||r===247||r===8800||r===163||r===8364||r===165||r===8381||r===8361))return true}return false}skipMarkerGap(t,i){let e=this.input,s=t;for(;s<i&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9);)s++;if(s+2<i&&e.charCodeAt(s)===91&&e.charCodeAt(s+2)===93){let n=s+3;for(;n<i&&(e.charCodeAt(n)===32||e.charCodeAt(n)===9);)n++;if(n>s+3)return n}return s}matchHexColourEnd(t,i){let e=this.input,s=t+1,n=0;for(;s<i;){let r=e.charCodeAt(s);if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))break;n++,s++;}if(n!==3&&n!==4&&n!==6&&n!==8)return -1;if(s<i){let r=e.charCodeAt(s);if(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95)return -1}return s}hasInlineSolveWithin(t,i){let e=this.input,s=i-1;for(let n=t;n<s;n++)if(e.charCodeAt(n)===115&&e.charCodeAt(n+1)===96)return true;return false}indexOfWithin(t,i,e){let s=this.input,n=e-t.length,r=t.charCodeAt(0);for(let o=i;o<=n;o++){if(s.charCodeAt(o)!==r)continue;let h=1;for(;h<t.length&&s.charCodeAt(o+h)===t.charCodeAt(h);)h++;if(h===t.length)return o}return -1}classifyFromPositions(t,i){let e=i;if(t>=e)return {type:"empty",skip:true,hasInlineSolve:false};let s=this.input,n=t;for(;n<e;){let h=s.charCodeAt(n);if(h!==32&&h!==9)break;n++;}if(n>=e)return {type:"empty",skip:true,hasInlineSolve:false};let r=s.charCodeAt(n),o;if(r===35){if(this.matchHexColourEnd(n,e)!==-1)return o===void 0&&(o=this.hasInlineSolveWithin(n,e)),{type:"expression",skip:false,hasInlineSolve:o};let h=1;for(;n+h<e&&s.charCodeAt(n+h)===35;)h++;return h<=6&&n+h<e&&s.charCodeAt(n+h)===32?{type:"heading",skip:true,hasInlineSolve:false}:{type:"heading",skip:true,hasInlineSolve:false}}if(r===62&&n+1<e&&s.charCodeAt(n+1)===32)return {type:"blockquote",skip:true,hasInlineSolve:false};if(r===96&&n+2<e&&s.charCodeAt(n+1)===96&&s.charCodeAt(n+2)===96)return {type:"code_fence",skip:true,hasInlineSolve:false};if(r===126&&n+2<e&&s.charCodeAt(n+1)===126&&s.charCodeAt(n+2)===126)return {type:"code_fence",skip:true,hasInlineSolve:false};if(r===36&&n+1<e&&s.charCodeAt(n+1)===36)return {type:"math_fence",skip:true,hasInlineSolve:false};if(r===45||r===42||r===95){let h=1;for(;n+h<e&&s.charCodeAt(n+h)===r;)h++;if(h>=3){let a=n+h;for(;a<e&&(s.charCodeAt(a)===32||s.charCodeAt(a)===9);)a++;if(a>=e)return {type:"hr",skip:true,hasInlineSolve:false}}}if((r===45||r===42||r===43)&&n+1<e&&s.charCodeAt(n+1)===32)return o===void 0&&(o=this.hasInlineSolveWithin(n,e)),{type:"list",skip:false,hasInlineSolve:o,contentOffset:this.skipMarkerGap(n+1,e)};if(r>=48&&r<=57){let h=n;for(;h<e&&s.charCodeAt(h)>=48&&s.charCodeAt(h)<=57;)h++;if(h<e&&s.charCodeAt(h)===46&&h+1<e&&s.charCodeAt(h+1)===32)return o===void 0&&(o=this.hasInlineSolveWithin(n,e)),{type:"list",skip:false,hasInlineSolve:o,contentOffset:this.skipMarkerGap(h+1,e)}}if(r===124){let h=n+1;for(;h<e;){let a=s.charCodeAt(h);if(a!==45&&a!==58&&a!==124&&a!==32&&a!==9&&a!==13)break;h++;}if(h>=e)return {type:"table_separator",skip:true,hasInlineSolve:false}}if(r===91&&n+1<e&&s.charCodeAt(n+1)===91){let h=this.indexOfWithin("]]",n+2,e);if(h!==-1){let a=h+2;for(;a<e&&(s.charCodeAt(a)===32||s.charCodeAt(a)===9);)a++;if(a>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(r===33&&n+2<e&&s.charCodeAt(n+1)===91&&s.charCodeAt(n+2)===91){let h=this.indexOfWithin("]]",n+3,e);if(h!==-1){let a=h+2;for(;a<e&&(s.charCodeAt(a)===32||s.charCodeAt(a)===9);)a++;if(a>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(r===47&&n+1<e&&s.charCodeAt(n+1)===47)return {type:"comment",skip:true,hasInlineSolve:false};if(r===62){let h=n+1;for(;h<e&&(s.charCodeAt(h)===32||s.charCodeAt(h)===9);)h++;if(h>=e)return {type:"blockquote",skip:true,hasInlineSolve:false}}if(r===45||r===42||r===43){let h=n+1;for(;h<e&&(s.charCodeAt(h)===32||s.charCodeAt(h)===9);)h++;if(h>=e)return {type:"list",skip:false,hasInlineSolve:false}}if(o===void 0&&(o=this.hasInlineSolveWithin(n,e)),!o){let h=true;for(let a=n;a<e;a++){let u=s.charCodeAt(a);if(u>=128||R.CHAR_CLASS[u]>1){h=false;break}}if(h)return {type:"empty",skip:true,hasInlineSolve:false}}return {type:"expression",skip:false,hasInlineSolve:o}}classifyLine(t){let i=this.input,e=this.len,s=this.pos;this.input=t,this.len=t.length,this.pos=0;let n=this.classifyFromPositions(0,t.length);return this.input=i,this.len=e,this.pos=s,n}getKeywords(){return Object.fromEntries(this.mergedKeywords)}findInlineSolves(t){let i=[],e=t.length,s=0;for(;s<e;){let n=t.indexOf("s`",s);if(n===-1)break;let r=n+2,o=r;for(;o<e;){let u=t.charCodeAt(o);if(u===92&&o+1<e){o+=2;continue}if(u===96)break;o++;}o>=e&&(o=e);let h=t.slice(r,o),a=o<e?o+1:o;i.push({start:n,end:a,expression:h,columnNumber:n+1}),s=a;}return i}tokenizeComment(){let t=this.input,i=this.len,e=this.pos,s=e-this.lineStartPos+1;if(t.charCodeAt(e)===35){let o=this.matchHexColourEnd(e,i);if(o!==-1){let p=t.slice(e,o);return this.pos=o,new l("HEX_COLOUR",$,p,p,e,0,this.line,s)}let h=t.charCodeAt(e+1),a=h>=65&&h<=90||h>=97&&h<=122,u=e>this.lineStartPos?t.charCodeAt(e-1):-1,f=u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||u===95;if(a&&!f){let p=e+2;for(;p<i;){let C=t.charCodeAt(p);if(!(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||C===95||C===45))break;p++;}let T=t.slice(e+1,p);return this.pos=p,new l("TAG",Z,T,T,e,0,this.line,s)}}let n=this.pos;for(n+1<i&&t.charCodeAt(n+1)===47?n+=2:n++;n<i;){let o=t.charCodeAt(n);if(o===10||o===13)break;n++;}let r=t.slice(e,n);return this.pos=n,new l("COMMENT",P,r,r,e,0,this.line,s)}};R.CHAR_CLASS=te();var V=R;var le={"to the power of":"CARET","power of":"CARET","increase by":"INCREASE_BY","decrease by":"DECREASE_BY","times by":"TIMES_BY","multiply by":"MULTIPLY_BY","divide by":"DIVIDE_BY","multiplied by":"MULTIPLY_BY","divided by":"DIVIDE_BY"};export{l as a,V as b,le as c};//# sourceMappingURL=chunk-OLATJABN.js.map
2
- //# sourceMappingURL=chunk-OLATJABN.js.map
1
+ import {e,c}from'./chunk-FAO6DQ74.js';import {a}from'./chunk-LHLW7JLS.js';import {a as a$1}from'./chunk-CHVGFTO3.js';import {c as c$1,b as b$1}from'./chunk-RELMEWY6.js';e();var x=c("BACKTICK_OPEN"),Q=c("BIGINT"),P=c("COMMENT"),A=c("CURRENCY_SYMBOL"),N=c("DOLLAR"),g=c("DOT"),v=c("EURO"),$=c("HEX_COLOUR"),b=c("IDENT"),j=c("INLINE_SOLVE_START"),q=c("LSHIFT"),U=c("MINUS"),_=c("NEQ"),I=c("NUMBER"),M=c("PLUS_MINUS"),B=c("POUND"),X=c("RSHIFT"),D=c("RUBLE"),H=c("SLASH"),Y=c("STAR"),J=c("STRING"),Z=c("TAG"),K=c("UNIT"),ee=c("URSHIFT"),F=c("WON"),G=c("YEN");function te(){let c=new Uint8Array(128);for(let t=48;t<=57;t++)c[t]=2;for(let t=65;t<=90;t++)c[t]=3;for(let t=97;t<=122;t++)c[t]=3;return c[95]=3,c[46]=4,c[32]=1,c[9]=1,c[10]=1,c[13]=1,c[33]=5,c[37]=5,c[38]=5,c[40]=5,c[41]=5,c[42]=5,c[43]=5,c[44]=5,c[45]=5,c[47]=5,c[58]=5,c[59]=5,c[60]=5,c[61]=5,c[62]=5,c[63]=5,c[91]=5,c[93]=5,c[94]=5,c[123]=5,c[124]=5,c[125]=5,c[126]=5,c[64]=5,c[34]=6,c[35]=7,c[36]=8,c[96]=11,c}function E(c){return c===133||c===160||c===5760||c>=8192&&c<=8202||c===8203||c===8232||c===8233||c===8239||c===8287||c===12288||c===65279}var l=class{constructor(t,i,e,s,n,r,o,h,a,u){this.type=t;this.typeId=i;this.value=e;this.text=s;this.offset=n;this.lineBreaks=r;this.line=o;this.col=h;this.sourceEnd=a;this.fault=u;}},W={61:{61:"EQUALITY",62:"THEREFORE"},33:{61:"NEQ"},62:{61:"GTE"},60:{61:"LTE"},38:{38:"LOGICAL_AND"},124:{124:"LOGICAL_OR"},43:{61:"PLUS_EQUALS"},45:{61:"MINUS_EQUALS"}},z={43:"PLUS",45:"MINUS",42:"STAR",47:"SLASH",94:"CARET",37:"PERCENT",40:"LPAREN",41:"RPAREN",91:"LBRACKET",93:"RBRACKET",123:"LBRACE",125:"RBRACE",44:"COMMA",58:"COLON",59:"SEMICOLON",61:"EQUALS",63:"QUESTION",33:"BANG",38:"BIT_AND",124:"BIT_OR",60:"LT",62:"GT",126:"BIT_NOT",64:"AT"},se=(()=>{let c=new Set;for(let i=48;i<=57;i++)c.add(i);let t=[43,45,42,47,94,37,40,41,91,93,123,125,61,60,62,33,38,124,126,59,63];for(let i of t)c.add(i);return c.add(36),c.add(163),c.add(8364),c.add(165),c.add(8381),c.add(8361),c.add(96),c.add(46),c.add(35),c})(),R=class R{constructor(t="en",i){this.input="";this.pos=0;this.len=0;this.line=1;this.lineStartPos=0;this.groupingStack=[];this.pluginKeywordOwners=new Map;this.pluginUnitOwners=new Map;this.pluginOperatorOwners=new Map;this.pluginOperators=new Map;this.pluginUnits=new Set;this.hasPluginOps=false;this._inlineSolveSpans=[];this.pluginRawLinePatterns=[];this.pendingRawLineToken=null;this.localeCode=t,this.locale=a(t),this.keywordMap=new Map;for(let[e,s]of Object.entries(this.locale.keywordMap))this.keywordMap.set(e.toLowerCase(),s);this.mergedKeywords=new Map(this.keywordMap),this.mergedUnits=a$1;}matchRawLine(t){for(let i of this.pluginRawLinePatterns){let e=i.pattern.exec(t);if(e&&typeof e[1]=="string"){let s=e[1].trim();if(s.length>0)return new l(i.tokenType,c(i.tokenType),s,s,0,0,this.line,1)}}return null}rebuildMergedUnits(){this.mergedUnits=this.pluginUnits.size===0?a$1:new Set([...a$1,...this.pluginUnits]);}registerVocabulary(t){if(t.keywords)for(let i of Object.keys(t.keywords)){let e=i.toLowerCase();if(this.keywordMap.has(e))throw c$1.config("PLUGIN_KEYWORD_COLLISION",`Plugin keyword "${i}" conflicts with built-in keyword (type: ${this.keywordMap.get(e)}). Built-in keywords cannot be overridden.`,{keyword:i,builtinType:this.keywordMap.get(e)})}if(t.operators){for(let i of Object.keys(t.operators))if(i.length===2){let e=i.charCodeAt(0),s=i.charCodeAt(1),n=W[e];if(n&&n[s]!==void 0)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in operator (type: ${n[s]}). Built-in operators cannot be overridden.`,{operator:i,builtinType:n[s]});if(e===60&&s===60)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in operator (type: LSHIFT). Built-in operators cannot be overridden.`,{operator:i,builtinType:"LSHIFT"});if(e===62&&s===62)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in operator (type: RSHIFT). Built-in operators cannot be overridden.`,{operator:i,builtinType:"RSHIFT"});if(e===47&&s===47)throw c$1.config("PLUGIN_OPERATOR_COLLISION",`Plugin operator "${i}" conflicts with built-in comment sequence. Comment sequences cannot be overridden.`,{operator:i,builtinType:"COMMENT"})}}if(t.units){for(let i of t.units)if(a$1.has(i))throw c$1.config("PLUGIN_UNIT_COLLISION",`Plugin unit "${i}" conflicts with a built-in unit. Built-in units cannot be overridden.`,{unit:i})}if(t.keywords)for(let[i,e]of Object.entries(t.keywords)){let s=i.toLowerCase();this.claim(this.pluginKeywordOwners,s,t,e),this.mergedKeywords.set(s,e);}if(t.operators){this.hasPluginOps=true;for(let[i,e]of Object.entries(t.operators))if(i.length===2){let s=i.charCodeAt(0),n=i.charCodeAt(1);this.claim(this.pluginOperatorOwners,s*65536+n,t,e);let r=this.pluginOperators.get(s);r||(r=new Map,this.pluginOperators.set(s,r)),r.set(n,e);}}if(t.units){for(let i of t.units){let e=this.pluginUnitOwners.get(i);e?e.push(t):this.pluginUnitOwners.set(i,[t]),this.pluginUnits.add(i);}this.rebuildMergedUnits();}t.rawLinePatterns&&this.pluginRawLinePatterns.push(...t.rawLinePatterns);}claim(t,i,e,s){let n=t.get(i);n?n.push({owner:e,tokenType:s}):t.set(i,[{owner:e,tokenType:s}]);}release(t,i,e){let s=t.get(i);if(!s)return;let n=s.filter(r=>r.owner!==e);if(n.length===0){t.delete(i);return}return t.set(i,n),n[n.length-1]}unregisterVocabulary(t){if(t.keywords)for(let i of Object.keys(t.keywords)){let e=i.toLowerCase(),s=this.release(this.pluginKeywordOwners,e,t);s?this.mergedKeywords.set(e,s.tokenType):this.mergedKeywords.delete(e);}if(t.operators){for(let i of Object.keys(t.operators))if(i.length===2){let e=i.charCodeAt(0),s=i.charCodeAt(1),n=this.release(this.pluginOperatorOwners,e*65536+s,t),r=this.pluginOperators.get(e);if(!r)continue;if(n){r.set(s,n.tokenType);continue}r.delete(s),r.size===0&&this.pluginOperators.delete(e);}this.hasPluginOps=this.pluginOperators.size>0;}if(t.units){for(let i of t.units){let e=this.pluginUnitOwners.get(i);if(!e)continue;let s=e.filter(n=>n!==t);if(s.length>0){this.pluginUnitOwners.set(i,s);continue}this.pluginUnitOwners.delete(i),this.pluginUnits.delete(i);}this.rebuildMergedUnits();}if(t.rawLinePatterns){let i=new Set(t.rawLinePatterns);this.pluginRawLinePatterns=this.pluginRawLinePatterns.filter(e=>!i.has(e));}}reset(t){this.input=t,this.pos=0,this.len=t.length,this.line=1,this.lineStartPos=0,this.pendingRawLineToken=this.pluginRawLinePatterns.length>0?this.matchRawLine(t):null;}scanDocument(t){this.input=t,this.pos=0,this.len=t.length,this.line=1,this.lineStartPos=0;let i=[],e=this.input,s=this.len;for(;this.pos<s;){let n=this.pos,r=this.pos;for(;r<s;){let C=e.charCodeAt(r);if(C===10||C===13)break;r++;}let o=this.line,h=this.classifyFromPositions(n,r),a=e.slice(n,r),u=[],f;if(!h.skip){let C=this.pluginRawLinePatterns.length>0?this.matchRawLine(a):null;if(C)u=[C];else {let w=this.len;this.len=r,h.contentOffset!==void 0&&(this.pos=h.contentOffset);try{this.tokenizeInto(u);}catch(S){if(!(S instanceof b$1))throw S;f=S,u=[],this._inlineSolveSpans=[],this.line=o;}finally{this.len=w;}}}let p=[];if(h.hasInlineSolve)if(!h.skip&&u.length>0){let C=this.findInlineSolves(a);p=this._inlineSolveSpans.map((w,S)=>({start:C[S]?.start??0,end:C[S]?.end??0,expression:C[S]?.expression??"",columnNumber:C[S]?.columnNumber??w.columnNumber,startTokenIndex:w.startTokenIndex,endTokenIndex:w.endTokenIndex}));}else p=this.findInlineSolves(a);let T={text:a,lineNumber:o,startOffset:n,endOffset:r,classification:h,tokens:u,inlineSolves:p};if(f&&(T.error=f),i.push(T),this.pos=r,this.pos<s){let C=e.charCodeAt(this.pos);C===13?(this.pos++,this.pos<s&&e.charCodeAt(this.pos)===10&&this.pos++):C===10&&this.pos++;}this.line++,this.lineStartPos=this.pos;}return i}tokenizeAll(){if(this.pendingRawLineToken)return this._inlineSolveSpans=[],[this.pendingRawLineToken];let t=[];return this.tokenizeInto(t),t}tokenizeInto(t){let i=this.len;if(i===0){this._inlineSolveSpans=[];return}let e=0,s=null,n=[];if(i===1){let o=this.input.charCodeAt(0);switch(R.CHAR_CLASS[o]??0){case 2:t.push(new l("NUMBER",I,this.input,this.input,0,0,1,1)),e++;break;case 4:t.push(new l("DOT",g,".",".",0,0,1,1)),e++;break;case 3:{let a=this.input,u=a.toLowerCase();if(this.mergedUnits.has(a))t.push(new l("UNIT",K,a,a,0,0,1,1));else {let f=this.mergedKeywords.get(u);f?t.push(new l(f,c(f),a,a,0,0,1,1)):t.push(new l("IDENT",b,a,a,0,0,1,1));}e++;break}case 5:{let a=z[o];a&&(t.push(new l(a,c(a),this.input,this.input,0,0,1,1)),e++);break}case 6:this.pos=0,t.push(this.tokenizeString()),e++;break;case 7:this.pos=0,t.push(this.tokenizeComment()),e++;break;case 8:t.push(new l("DOLLAR",N,"$","$",0,0,1,1)),e++;break;case 11:t.push(new l("BACKTICK_OPEN",x,"`","`",0,0,1,1)),e++;break;default:{E(o)||(o===215?(t.push(new l("STAR",Y,"\xD7","\xD7",0,0,1,1)),e++):o===247?(t.push(new l("SLASH",H,"\xF7","\xF7",0,0,1,1)),e++):o===177?(t.push(new l("PLUS_MINUS",M,"\xB1","\xB1",0,0,1,1)),e++):o===8800?(t.push(new l("NEQ",_,"\u2260","\u2260",0,0,1,1)),e++):o===163?(t.push(new l("POUND",B,"\xA3","\xA3",0,0,1,1)),e++):o===8364?(t.push(new l("EURO",v,"\u20AC","\u20AC",0,0,1,1)),e++):o===165?(t.push(new l("YEN",G,"\xA5","\xA5",0,0,1,1)),e++):o===8381?(t.push(new l("RUBLE",D,"\u20BD","\u20BD",0,0,1,1)),e++):o===8361?(t.push(new l("WON",F,"\u20A9","\u20A9",0,0,1,1)),e++):o===8377?(t.push(new l("CURRENCY_SYMBOL",A,"\u20B9","\u20B9",0,0,1,1)),e++):o===8378?(t.push(new l("CURRENCY_SYMBOL",A,"\u20BA","\u20BA",0,0,1,1)),e++):o===8372?(t.push(new l("CURRENCY_SYMBOL",A,"\u20B4","\u20B4",0,0,1,1)),e++):o===8362?(t.push(new l("CURRENCY_SYMBOL",A,"\u20AA","\u20AA",0,0,1,1)),e++):o===8363?(t.push(new l("CURRENCY_SYMBOL",A,"\u20AB","\u20AB",0,0,1,1)),e++):o===8358?(t.push(new l("CURRENCY_SYMBOL",A,"\u20A6","\u20A6",0,0,1,1)),e++):o===8369?(t.push(new l("CURRENCY_SYMBOL",A,"\u20B1","\u20B1",0,0,1,1)),e++):o===8722||o===8211?(t.push(new l("MINUS",U,this.input,this.input,0,0,1,1)),e++):o>=128&&(t.push(new l("IDENT",b,this.input,this.input,0,0,1,1)),e++));break}}this._inlineSolveSpans=n;return}let r=this.input;for(this.groupingStack.length=0;this.pos<i;){let o=r.charCodeAt(this.pos),h=R.CHAR_CLASS[o]??0;if(s&&o===92&&this.pos+1<i&&r.charCodeAt(this.pos+1)===96){this.pos+=2;continue}switch(h){case 1:this.pos++,o===10?(this.line++,this.lineStartPos=this.pos,this.groupingStack.length=0):o===13&&(this.line++,this.pos<i&&r.charCodeAt(this.pos)===10&&this.pos++,this.lineStartPos=this.pos,this.groupingStack.length=0);break;case 2:t.push(this.tokenizeNumber()),e++;break;case 3:{let a=this.tokenizeIdentifier();a.type==="INLINE_SOLVE_START"&&(s={startTokenIndex:e,startColumn:a.col}),t.push(a),e++;break}case 4:if(this.pos+1<i)if((R.CHAR_CLASS[r.charCodeAt(this.pos+1)]??0)===2)t.push(this.tokenizeNumber());else {let u=this.pos-this.lineStartPos+1;t.push(new l("DOT",g,".",".",this.pos,0,this.line,u)),this.pos++;}else {let a=this.pos-this.lineStartPos+1;t.push(new l("DOT",g,".",".",this.pos,0,this.line,a)),this.pos++;}e++;break;case 5:t.push(this.tokenizeOperator()),e++;break;case 6:t.push(this.tokenizeString()),e++;break;case 7:t.push(this.tokenizeComment()),e++;break;case 8:{let a=this.pos-this.lineStartPos+1;t.push(new l("DOLLAR",N,"$","$",this.pos,0,this.line,a)),this.pos++,e++;break}case 11:{let a=this.pos-this.lineStartPos+1;if(t.push(new l("BACKTICK_OPEN",x,"`","`",this.pos,0,this.line,a)),this.pos++,s){let u=s;n.push({start:0,end:0,expression:"",columnNumber:u.startColumn,startTokenIndex:u.startTokenIndex,endTokenIndex:e}),s=null;}e++;break}default:{let a=this.pos-this.lineStartPos+1;if(E(o))this.pos++,(o===8232||o===8233||o===133)&&(this.line++,this.lineStartPos=this.pos);else if(o===215)t.push(new l("STAR",Y,"\xD7","\xD7",this.pos,0,this.line,a)),this.pos++,e++;else if(o===247)t.push(new l("SLASH",H,"\xF7","\xF7",this.pos,0,this.line,a)),this.pos++,e++;else if(o===177)t.push(new l("PLUS_MINUS",M,"\xB1","\xB1",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8800)t.push(new l("NEQ",_,"\u2260","\u2260",this.pos,0,this.line,a)),this.pos++,e++;else if(o===163)t.push(new l("POUND",B,"\xA3","\xA3",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8364)t.push(new l("EURO",v,"\u20AC","\u20AC",this.pos,0,this.line,a)),this.pos++,e++;else if(o===165)t.push(new l("YEN",G,"\xA5","\xA5",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8381)t.push(new l("RUBLE",D,"\u20BD","\u20BD",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8361)t.push(new l("WON",F,"\u20A9","\u20A9",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8377)t.push(new l("CURRENCY_SYMBOL",A,"\u20B9","\u20B9",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8378)t.push(new l("CURRENCY_SYMBOL",A,"\u20BA","\u20BA",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8372)t.push(new l("CURRENCY_SYMBOL",A,"\u20B4","\u20B4",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8362)t.push(new l("CURRENCY_SYMBOL",A,"\u20AA","\u20AA",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8363)t.push(new l("CURRENCY_SYMBOL",A,"\u20AB","\u20AB",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8358)t.push(new l("CURRENCY_SYMBOL",A,"\u20A6","\u20A6",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8369)t.push(new l("CURRENCY_SYMBOL",A,"\u20B1","\u20B1",this.pos,0,this.line,a)),this.pos++,e++;else if(o===8722||o===8211){let u=this.input[this.pos];t.push(new l("MINUS",U,u,u,this.pos,0,this.line,a)),this.pos++,e++;}else o>=128?(t.push(this.tokenizeIdentifier()),e++):this.pos++;break}}}this._inlineSolveSpans=n;}*[Symbol.iterator](){let t=[];this.tokenizeInto(t),yield*t;}tokenizeNumber(){let t=this.input,i=this.len,e=this.pos,s=e,n=e-this.lineStartPos+1,r;if(t.charCodeAt(e)===48&&e+1<i){let f=t.charCodeAt(e+1);if(f===120||f===88){for(e+=2;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102);)e++;let p=t.slice(s,e);return this.pos=e,new l("NUMBER",I,p,p,s,0,this.line,n)}if(f===98||f===66){for(e+=2;e<i&&(r=t.charCodeAt(e),r===48||r===49);)e++;let p=t.slice(s,e);return this.pos=e,new l("NUMBER",I,p,p,s,0,this.line,n)}if(f===111||f===79){for(e+=2;e<i&&(r=t.charCodeAt(e),r>=48&&r<=55);)e++;let p=t.slice(s,e);return this.pos=e,new l("NUMBER",I,p,p,s,0,this.line,n)}}let o=false;for(;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57);)o=true,e++;for(;o&&e<i&&(t.charCodeAt(e)===44||t.charCodeAt(e)===46)&&!(t.charCodeAt(e)===44&&this.groupingStack.length>0&&this.groupingStack[this.groupingStack.length-1]);){if(e+4<=i){let f=t.charCodeAt(e+1),p=t.charCodeAt(e+2),T=t.charCodeAt(e+3),C=e+4<i?t.charCodeAt(e+4):-1,w=!(C>=48&&C<=57);if(f>=48&&f<=57&&p>=48&&p<=57&&T>=48&&T<=57&&w){e+=4,o=true;continue}}break}let h=false;if(e<i&&t.charCodeAt(e)===46&&e+1<i){let f=t.charCodeAt(e+1);if(f>=48&&f<=57)for(h=true,e++;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57);)e++;}let a=false;if(e<i){let f=t.charCodeAt(e);if((f===101||f===69)&&e+1<i){let p=t.charCodeAt(e+1);if(p>=48&&p<=57||p===43||p===45)for(a=true,e++,(p===43||p===45)&&e++;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57);)e++;}}if(e<i&&t.charCodeAt(e)===110&&o&&!h&&!a){e++;let f=t.slice(s,e);return this.pos=e,new l("BIGINT",Q,f,f,s,0,this.line,n)}let u=t.slice(s,e);return this.pos=e,new l("NUMBER",I,u,u,s,0,this.line,n)}tokenizeIdentifier(){let t=this.input,i=this.len,e=this.pos,s=e,n=e-this.lineStartPos+1,r;for(;e<i&&(r=t.charCodeAt(e),r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95||r>=128&&!E(r));)e++;let o=t.slice(s,e),h=o.toLowerCase();if(h==="s"&&e<i&&t.charCodeAt(e)===96){e++,this.pos=e;let f=t.slice(s,e);return new l("INLINE_SOLVE_START",j,f,f,s,0,this.line,n)}if(this.mergedUnits.has(o)&&!this.isFollowedByLParen(e))return this.pos=e,new l("UNIT",K,o,o,s,0,this.line,n);let u=this.mergedKeywords.get(h);return u?(this.pos=e,new l(u,c(u),o,o,s,0,this.line,n)):(this.pos=e,new l("IDENT",b,o,o,s,0,this.line,n))}isFollowedByLParen(t){let i=this.len,e=t;for(;e<i;){let s=this.input.charCodeAt(e);if(s===40)return true;if(s!==32&&s!==9)break;e++;}return false}precededByCallTarget(t){let i=this.input,e=this.lineStartPos,s=t-1;for(;s>=e&&(i.charCodeAt(s)===32||i.charCodeAt(s)===9);)s--;if(s<e)return false;let n=i.charCodeAt(s),r=p=>p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||p===95,o=p=>p>=65&&p<=90||p>=97&&p<=122||p===95;if(!r(n))return false;let h=s+1,a=false;for(;s>=e;){let p=i.charCodeAt(s);if(!r(p))break;o(p)&&(a=true),s--;}if(!a)return false;let u=i.slice(s+1,h).toLowerCase(),f=this.mergedKeywords.get(u);return f===void 0||f==="FUNC"}tokenizeOperator(){let t=this.input,i=this.pos,e=i-this.lineStartPos+1,s=t.charCodeAt(i),n=this.len;if(i+1<n){let h=t.charCodeAt(i+1),a=W[s];if(a){let u=a[h];if(u){let f=t.slice(i,i+2);return this.pos=i+2,new l(u,c(u),f,f,i,0,this.line,e)}}if(s===47&&h===47){let u=i+2;for(;u<n;){let p=t.charCodeAt(u);if(p===10||p===13)break;u++;}let f=t.slice(i,u);return this.pos=u,new l("COMMENT",P,f,f,i,0,this.line,e)}if(s===60&&h===60)return this.pos=i+2,new l("LSHIFT",q,"<<","<<",i,0,this.line,e);if(s===62&&h===62)return t.charCodeAt(i+2)===62?(this.pos=i+3,new l("URSHIFT",ee,">>>",">>>",i,0,this.line,e)):(this.pos=i+2,new l("RSHIFT",X,">>",">>",i,0,this.line,e));if(this.hasPluginOps){let u=this.pluginOperators.get(s);if(u){let f=u.get(h);if(f){let p=t.slice(i,i+2);return this.pos=i+2,new l(f,c(f),p,p,i,0,this.line,e)}}}}this.pos=i+1,s===91?this.groupingStack.push(true):s===40?this.groupingStack.push(this.precededByCallTarget(i)):(s===41||s===93)&&this.groupingStack.length>0&&this.groupingStack.pop();let r=z[s],o=t.charAt(i);return new l(r||"ERROR",c(r||"ERROR"),o,o,i,0,this.line,e)}tokenizeString(){let t=this.input,i=this.len,e=this.pos,s=e-this.lineStartPos+1,n=e+1,r=0;for(;n<i;){let o=t.charCodeAt(n);if(o===34){n++;let h=t.slice(e,n),a=t.slice(e+1,n-1);return this.pos=n,new l("STRING",J,a,h,e,r,this.line,s)}if(o===92&&n+1<i){n+=2;continue}o===10&&(this.line++,this.lineStartPos=n+1,r++),n++;}throw this.pos=n,c$1.parsing("UNTERMINATED_STRING",`Unterminated string literal: ${t.slice(e,n)}`,{literal:t.slice(e,n),offset:e})}static hasExpressionIndicators(t,i,e){let s=se;for(let n=i;n<e;n++){let r=t.charCodeAt(n);if(s.has(r)||r>=128&&(r===215||r===247||r===8800||r===163||r===8364||r===165||r===8381||r===8361))return true}return false}skipMarkerGap(t,i){let e=this.input,s=t;for(;s<i&&(e.charCodeAt(s)===32||e.charCodeAt(s)===9);)s++;if(s+2<i&&e.charCodeAt(s)===91&&e.charCodeAt(s+2)===93){let n=s+3;for(;n<i&&(e.charCodeAt(n)===32||e.charCodeAt(n)===9);)n++;if(n>s+3)return n}return s}matchHexColourEnd(t,i){let e=this.input,s=t+1,n=0;for(;s<i;){let r=e.charCodeAt(s);if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))break;n++,s++;}if(n!==3&&n!==4&&n!==6&&n!==8)return -1;if(s<i){let r=e.charCodeAt(s);if(r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122||r===95)return -1}return s}hasInlineSolveWithin(t,i){let e=this.input,s=i-1;for(let n=t;n<s;n++)if(e.charCodeAt(n)===115&&e.charCodeAt(n+1)===96)return true;return false}indexOfWithin(t,i,e){let s=this.input,n=e-t.length,r=t.charCodeAt(0);for(let o=i;o<=n;o++){if(s.charCodeAt(o)!==r)continue;let h=1;for(;h<t.length&&s.charCodeAt(o+h)===t.charCodeAt(h);)h++;if(h===t.length)return o}return -1}classifyFromPositions(t,i){let e=i;if(t>=e)return {type:"empty",skip:true,hasInlineSolve:false};let s=this.input,n=t;for(;n<e;){let h=s.charCodeAt(n);if(h!==32&&h!==9)break;n++;}if(n>=e)return {type:"empty",skip:true,hasInlineSolve:false};let r=s.charCodeAt(n),o;if(r===35){if(this.matchHexColourEnd(n,e)!==-1)return o===void 0&&(o=this.hasInlineSolveWithin(n,e)),{type:"expression",skip:false,hasInlineSolve:o};let h=1;for(;n+h<e&&s.charCodeAt(n+h)===35;)h++;return h<=6&&n+h<e&&s.charCodeAt(n+h)===32?{type:"heading",skip:true,hasInlineSolve:false}:{type:"heading",skip:true,hasInlineSolve:false}}if(r===62&&n+1<e&&s.charCodeAt(n+1)===32)return {type:"blockquote",skip:true,hasInlineSolve:false};if(r===96&&n+2<e&&s.charCodeAt(n+1)===96&&s.charCodeAt(n+2)===96)return {type:"code_fence",skip:true,hasInlineSolve:false};if(r===126&&n+2<e&&s.charCodeAt(n+1)===126&&s.charCodeAt(n+2)===126)return {type:"code_fence",skip:true,hasInlineSolve:false};if(r===36&&n+1<e&&s.charCodeAt(n+1)===36)return {type:"math_fence",skip:true,hasInlineSolve:false};if(r===45||r===42||r===95){let h=1;for(;n+h<e&&s.charCodeAt(n+h)===r;)h++;if(h>=3){let a=n+h;for(;a<e&&(s.charCodeAt(a)===32||s.charCodeAt(a)===9);)a++;if(a>=e)return {type:"hr",skip:true,hasInlineSolve:false}}}if((r===45||r===42||r===43)&&n+1<e&&s.charCodeAt(n+1)===32)return o===void 0&&(o=this.hasInlineSolveWithin(n,e)),{type:"list",skip:false,hasInlineSolve:o,contentOffset:this.skipMarkerGap(n+1,e)};if(r>=48&&r<=57){let h=n;for(;h<e&&s.charCodeAt(h)>=48&&s.charCodeAt(h)<=57;)h++;if(h<e&&s.charCodeAt(h)===46&&h+1<e&&s.charCodeAt(h+1)===32)return o===void 0&&(o=this.hasInlineSolveWithin(n,e)),{type:"list",skip:false,hasInlineSolve:o,contentOffset:this.skipMarkerGap(h+1,e)}}if(r===124){let h=n+1;for(;h<e;){let a=s.charCodeAt(h);if(a!==45&&a!==58&&a!==124&&a!==32&&a!==9&&a!==13)break;h++;}if(h>=e)return {type:"table_separator",skip:true,hasInlineSolve:false}}if(r===91&&n+1<e&&s.charCodeAt(n+1)===91){let h=this.indexOfWithin("]]",n+2,e);if(h!==-1){let a=h+2;for(;a<e&&(s.charCodeAt(a)===32||s.charCodeAt(a)===9);)a++;if(a>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(r===33&&n+2<e&&s.charCodeAt(n+1)===91&&s.charCodeAt(n+2)===91){let h=this.indexOfWithin("]]",n+3,e);if(h!==-1){let a=h+2;for(;a<e&&(s.charCodeAt(a)===32||s.charCodeAt(a)===9);)a++;if(a>=e)return {type:"wikilink",skip:true,hasInlineSolve:false}}}if(r===47&&n+1<e&&s.charCodeAt(n+1)===47)return {type:"comment",skip:true,hasInlineSolve:false};if(r===62){let h=n+1;for(;h<e&&(s.charCodeAt(h)===32||s.charCodeAt(h)===9);)h++;if(h>=e)return {type:"blockquote",skip:true,hasInlineSolve:false}}if(r===45||r===42||r===43){let h=n+1;for(;h<e&&(s.charCodeAt(h)===32||s.charCodeAt(h)===9);)h++;if(h>=e)return {type:"list",skip:false,hasInlineSolve:false}}if(o===void 0&&(o=this.hasInlineSolveWithin(n,e)),!o){let h=true;for(let a=n;a<e;a++){let u=s.charCodeAt(a);if(u>=128||R.CHAR_CLASS[u]>1){h=false;break}}if(h)return {type:"empty",skip:true,hasInlineSolve:false}}return {type:"expression",skip:false,hasInlineSolve:o}}classifyLine(t){let i=this.input,e=this.len,s=this.pos;this.input=t,this.len=t.length,this.pos=0;let n=this.classifyFromPositions(0,t.length);return this.input=i,this.len=e,this.pos=s,n}getKeywords(){return Object.fromEntries(this.mergedKeywords)}findInlineSolves(t){let i=[],e=t.length,s=0;for(;s<e;){let n=t.indexOf("s`",s);if(n===-1)break;let r=n+2,o=r;for(;o<e;){let u=t.charCodeAt(o);if(u===92&&o+1<e){o+=2;continue}if(u===96)break;o++;}o>=e&&(o=e);let h=t.slice(r,o),a=o<e?o+1:o;i.push({start:n,end:a,expression:h,columnNumber:n+1}),s=a;}return i}tokenizeComment(){let t=this.input,i=this.len,e=this.pos,s=e-this.lineStartPos+1;if(t.charCodeAt(e)===35){let o=this.matchHexColourEnd(e,i);if(o!==-1){let p=t.slice(e,o);return this.pos=o,new l("HEX_COLOUR",$,p,p,e,0,this.line,s)}let h=t.charCodeAt(e+1),a=h>=65&&h<=90||h>=97&&h<=122,u=e>this.lineStartPos?t.charCodeAt(e-1):-1,f=u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||u===95;if(a&&!f){let p=e+2;for(;p<i;){let C=t.charCodeAt(p);if(!(C>=48&&C<=57||C>=65&&C<=90||C>=97&&C<=122||C===95||C===45))break;p++;}let T=t.slice(e+1,p);return this.pos=p,new l("TAG",Z,T,T,e,0,this.line,s)}}let n=this.pos;for(n+1<i&&t.charCodeAt(n+1)===47?n+=2:n++;n<i;){let o=t.charCodeAt(n);if(o===10||o===13)break;n++;}let r=t.slice(e,n);return this.pos=n,new l("COMMENT",P,r,r,e,0,this.line,s)}};R.CHAR_CLASS=te();var V=R;var le={"to the power of":"CARET","power of":"CARET","increase by":"INCREASE_BY","decrease by":"DECREASE_BY","times by":"TIMES_BY","multiply by":"MULTIPLY_BY","divide by":"DIVIDE_BY","multiplied by":"MULTIPLY_BY","divided by":"DIVIDE_BY"};export{l as a,V as b,le as c};//# sourceMappingURL=chunk-LP3JYC3A.js.map
2
+ //# sourceMappingURL=chunk-LP3JYC3A.js.map