@ax-llm/ax 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +547 -0
  3. package/build/module/docs/assets/icons.d.ts +1 -0
  4. package/build/module/docs/assets/icons.js +19 -0
  5. package/build/module/docs/assets/icons.js.map +1 -0
  6. package/build/module/docs/assets/main.d.ts +1 -0
  7. package/build/module/docs/assets/main.js +629 -0
  8. package/build/module/docs/assets/main.js.map +1 -0
  9. package/build/module/docs/assets/navigation.d.ts +1 -0
  10. package/build/module/docs/assets/navigation.js +3 -0
  11. package/build/module/docs/assets/navigation.js.map +1 -0
  12. package/build/module/docs/assets/search.d.ts +1 -0
  13. package/build/module/docs/assets/search.js +3 -0
  14. package/build/module/docs/assets/search.js.map +1 -0
  15. package/build/module/src/ai/anthropic/api.d.ts +24 -0
  16. package/build/module/src/ai/anthropic/api.js +188 -0
  17. package/build/module/src/ai/anthropic/api.js.map +1 -0
  18. package/build/module/src/ai/anthropic/index.d.ts +2 -0
  19. package/build/module/src/ai/anthropic/index.js +3 -0
  20. package/build/module/src/ai/anthropic/index.js.map +1 -0
  21. package/build/module/src/ai/anthropic/info.d.ts +2 -0
  22. package/build/module/src/ai/anthropic/info.js +34 -0
  23. package/build/module/src/ai/anthropic/info.js.map +1 -0
  24. package/build/module/src/ai/anthropic/types.d.ts +140 -0
  25. package/build/module/src/ai/anthropic/types.js +13 -0
  26. package/build/module/src/ai/anthropic/types.js.map +1 -0
  27. package/build/module/src/ai/azure-openai/api.d.ts +34 -0
  28. package/build/module/src/ai/azure-openai/api.js +42 -0
  29. package/build/module/src/ai/azure-openai/api.js.map +1 -0
  30. package/build/module/src/ai/azure-openai/index.d.ts +1 -0
  31. package/build/module/src/ai/azure-openai/index.js +2 -0
  32. package/build/module/src/ai/azure-openai/index.js.map +1 -0
  33. package/build/module/src/ai/balance.d.ts +26 -0
  34. package/build/module/src/ai/balance.js +87 -0
  35. package/build/module/src/ai/balance.js.map +1 -0
  36. package/build/module/src/ai/base.d.ts +56 -0
  37. package/build/module/src/ai/base.js +328 -0
  38. package/build/module/src/ai/base.js.map +1 -0
  39. package/build/module/src/ai/cohere/api.d.ts +35 -0
  40. package/build/module/src/ai/cohere/api.js +214 -0
  41. package/build/module/src/ai/cohere/api.js.map +1 -0
  42. package/build/module/src/ai/cohere/index.d.ts +2 -0
  43. package/build/module/src/ai/cohere/index.js +3 -0
  44. package/build/module/src/ai/cohere/index.js.map +1 -0
  45. package/build/module/src/ai/cohere/info.d.ts +2 -0
  46. package/build/module/src/ai/cohere/info.js +52 -0
  47. package/build/module/src/ai/cohere/info.js.map +1 -0
  48. package/build/module/src/ai/cohere/types.d.ts +85 -0
  49. package/build/module/src/ai/cohere/types.js +23 -0
  50. package/build/module/src/ai/cohere/types.js.map +1 -0
  51. package/build/module/src/ai/deepseek/api.d.ts +27 -0
  52. package/build/module/src/ai/deepseek/api.js +38 -0
  53. package/build/module/src/ai/deepseek/api.js.map +1 -0
  54. package/build/module/src/ai/deepseek/index.d.ts +2 -0
  55. package/build/module/src/ai/deepseek/index.js +3 -0
  56. package/build/module/src/ai/deepseek/index.js.map +1 -0
  57. package/build/module/src/ai/deepseek/info.d.ts +2 -0
  58. package/build/module/src/ai/deepseek/info.js +16 -0
  59. package/build/module/src/ai/deepseek/info.js.map +1 -0
  60. package/build/module/src/ai/deepseek/types.d.ts +8 -0
  61. package/build/module/src/ai/deepseek/types.js +10 -0
  62. package/build/module/src/ai/deepseek/types.js.map +1 -0
  63. package/build/module/src/ai/google-gemini/api.d.ts +34 -0
  64. package/build/module/src/ai/google-gemini/api.js +268 -0
  65. package/build/module/src/ai/google-gemini/api.js.map +1 -0
  66. package/build/module/src/ai/google-gemini/index.d.ts +2 -0
  67. package/build/module/src/ai/google-gemini/index.js +3 -0
  68. package/build/module/src/ai/google-gemini/index.js.map +1 -0
  69. package/build/module/src/ai/google-gemini/info.d.ts +6 -0
  70. package/build/module/src/ai/google-gemini/info.js +29 -0
  71. package/build/module/src/ai/google-gemini/info.js.map +1 -0
  72. package/build/module/src/ai/google-gemini/types.d.ts +151 -0
  73. package/build/module/src/ai/google-gemini/types.js +38 -0
  74. package/build/module/src/ai/google-gemini/types.js.map +1 -0
  75. package/build/module/src/ai/groq/api.d.ts +22 -0
  76. package/build/module/src/ai/groq/api.js +29 -0
  77. package/build/module/src/ai/groq/api.js.map +1 -0
  78. package/build/module/src/ai/groq/index.d.ts +1 -0
  79. package/build/module/src/ai/groq/index.js +2 -0
  80. package/build/module/src/ai/groq/index.js.map +1 -0
  81. package/build/module/src/ai/huggingface/api.d.ts +32 -0
  82. package/build/module/src/ai/huggingface/api.js +99 -0
  83. package/build/module/src/ai/huggingface/api.js.map +1 -0
  84. package/build/module/src/ai/huggingface/index.d.ts +2 -0
  85. package/build/module/src/ai/huggingface/index.js +3 -0
  86. package/build/module/src/ai/huggingface/index.js.map +1 -0
  87. package/build/module/src/ai/huggingface/info.d.ts +6 -0
  88. package/build/module/src/ai/huggingface/info.js +6 -0
  89. package/build/module/src/ai/huggingface/info.js.map +1 -0
  90. package/build/module/src/ai/huggingface/types.d.ts +42 -0
  91. package/build/module/src/ai/huggingface/types.js +9 -0
  92. package/build/module/src/ai/huggingface/types.js.map +1 -0
  93. package/build/module/src/ai/index.d.ts +28 -0
  94. package/build/module/src/ai/index.js +54 -0
  95. package/build/module/src/ai/index.js.map +1 -0
  96. package/build/module/src/ai/mistral/api.d.ts +27 -0
  97. package/build/module/src/ai/mistral/api.js +38 -0
  98. package/build/module/src/ai/mistral/api.js.map +1 -0
  99. package/build/module/src/ai/mistral/index.d.ts +2 -0
  100. package/build/module/src/ai/mistral/index.js +3 -0
  101. package/build/module/src/ai/mistral/index.js.map +1 -0
  102. package/build/module/src/ai/mistral/info.d.ts +2 -0
  103. package/build/module/src/ai/mistral/info.js +34 -0
  104. package/build/module/src/ai/mistral/info.js.map +1 -0
  105. package/build/module/src/ai/mistral/types.d.ts +18 -0
  106. package/build/module/src/ai/mistral/types.js +21 -0
  107. package/build/module/src/ai/mistral/types.js.map +1 -0
  108. package/build/module/src/ai/ollama/api.d.ts +24 -0
  109. package/build/module/src/ai/ollama/api.js +28 -0
  110. package/build/module/src/ai/ollama/api.js.map +1 -0
  111. package/build/module/src/ai/ollama/index.d.ts +1 -0
  112. package/build/module/src/ai/ollama/index.js +2 -0
  113. package/build/module/src/ai/ollama/index.js.map +1 -0
  114. package/build/module/src/ai/openai/api.d.ts +49 -0
  115. package/build/module/src/ai/openai/api.js +333 -0
  116. package/build/module/src/ai/openai/api.js.map +1 -0
  117. package/build/module/src/ai/openai/index.d.ts +2 -0
  118. package/build/module/src/ai/openai/index.js +3 -0
  119. package/build/module/src/ai/openai/index.js.map +1 -0
  120. package/build/module/src/ai/openai/info.d.ts +6 -0
  121. package/build/module/src/ai/openai/info.js +50 -0
  122. package/build/module/src/ai/openai/info.js.map +1 -0
  123. package/build/module/src/ai/openai/types.d.ts +192 -0
  124. package/build/module/src/ai/openai/types.js +35 -0
  125. package/build/module/src/ai/openai/types.js.map +1 -0
  126. package/build/module/src/ai/together/api.d.ts +22 -0
  127. package/build/module/src/ai/together/api.js +29 -0
  128. package/build/module/src/ai/together/api.js.map +1 -0
  129. package/build/module/src/ai/together/index.d.ts +1 -0
  130. package/build/module/src/ai/together/index.js +2 -0
  131. package/build/module/src/ai/together/index.js.map +1 -0
  132. package/build/module/src/ai/together/info.d.ts +2 -0
  133. package/build/module/src/ai/together/info.js +2 -0
  134. package/build/module/src/ai/together/info.js.map +1 -0
  135. package/build/module/src/ai/types.d.ts +70 -0
  136. package/build/module/src/ai/types.js +2 -0
  137. package/build/module/src/ai/types.js.map +1 -0
  138. package/build/module/src/ai/util.d.ts +13 -0
  139. package/build/module/src/ai/util.js +112 -0
  140. package/build/module/src/ai/util.js.map +1 -0
  141. package/build/module/src/db/base.d.ts +24 -0
  142. package/build/module/src/db/base.js +90 -0
  143. package/build/module/src/db/base.js.map +1 -0
  144. package/build/module/src/db/cloudflare.d.ts +20 -0
  145. package/build/module/src/db/cloudflare.js +98 -0
  146. package/build/module/src/db/cloudflare.js.map +1 -0
  147. package/build/module/src/db/index.d.ts +12 -0
  148. package/build/module/src/db/index.js +23 -0
  149. package/build/module/src/db/index.js.map +1 -0
  150. package/build/module/src/db/memory.d.ts +23 -0
  151. package/build/module/src/db/memory.js +125 -0
  152. package/build/module/src/db/memory.js.map +1 -0
  153. package/build/module/src/db/pinecone.d.ts +20 -0
  154. package/build/module/src/db/pinecone.js +71 -0
  155. package/build/module/src/db/pinecone.js.map +1 -0
  156. package/build/module/src/db/types.d.ts +35 -0
  157. package/build/module/src/db/types.js +3 -0
  158. package/build/module/src/db/types.js.map +1 -0
  159. package/build/module/src/db/weaviate.d.ts +20 -0
  160. package/build/module/src/db/weaviate.js +127 -0
  161. package/build/module/src/db/weaviate.js.map +1 -0
  162. package/build/module/src/docs/index.d.ts +4 -0
  163. package/build/module/src/docs/index.js +5 -0
  164. package/build/module/src/docs/index.js.map +1 -0
  165. package/build/module/src/docs/manager.d.ts +45 -0
  166. package/build/module/src/docs/manager.js +159 -0
  167. package/build/module/src/docs/manager.js.map +1 -0
  168. package/build/module/src/docs/reranker.d.ts +7 -0
  169. package/build/module/src/docs/reranker.js +26 -0
  170. package/build/module/src/docs/reranker.js.map +1 -0
  171. package/build/module/src/docs/rewriter.d.ts +4 -0
  172. package/build/module/src/docs/rewriter.js +9 -0
  173. package/build/module/src/docs/rewriter.js.map +1 -0
  174. package/build/module/src/docs/tika.d.ts +21 -0
  175. package/build/module/src/docs/tika.js +46 -0
  176. package/build/module/src/docs/tika.js.map +1 -0
  177. package/build/module/src/dsp/asserts.d.ts +32 -0
  178. package/build/module/src/dsp/asserts.js +88 -0
  179. package/build/module/src/dsp/asserts.js.map +1 -0
  180. package/build/module/src/dsp/eval.d.ts +62 -0
  181. package/build/module/src/dsp/eval.js +120 -0
  182. package/build/module/src/dsp/eval.js.map +1 -0
  183. package/build/module/src/dsp/evaluate.d.ts +12 -0
  184. package/build/module/src/dsp/evaluate.js +32 -0
  185. package/build/module/src/dsp/evaluate.js.map +1 -0
  186. package/build/module/src/dsp/extract.d.ts +25 -0
  187. package/build/module/src/dsp/extract.js +152 -0
  188. package/build/module/src/dsp/extract.js.map +1 -0
  189. package/build/module/src/dsp/generate.d.ts +52 -0
  190. package/build/module/src/dsp/generate.js +335 -0
  191. package/build/module/src/dsp/generate.js.map +1 -0
  192. package/build/module/src/dsp/generate.test.d.ts +1 -0
  193. package/build/module/src/dsp/generate.test.js +41 -0
  194. package/build/module/src/dsp/generate.test.js.map +1 -0
  195. package/build/module/src/dsp/index.d.ts +14 -0
  196. package/build/module/src/dsp/index.js +10 -0
  197. package/build/module/src/dsp/index.js.map +1 -0
  198. package/build/module/src/dsp/loader.d.ts +25 -0
  199. package/build/module/src/dsp/loader.js +87 -0
  200. package/build/module/src/dsp/loader.js.map +1 -0
  201. package/build/module/src/dsp/optimize.d.ts +29 -0
  202. package/build/module/src/dsp/optimize.js +100 -0
  203. package/build/module/src/dsp/optimize.js.map +1 -0
  204. package/build/module/src/dsp/parser.d.ts +86 -0
  205. package/build/module/src/dsp/parser.js +1437 -0
  206. package/build/module/src/dsp/parser.js.map +1 -0
  207. package/build/module/src/dsp/program.d.ts +64 -0
  208. package/build/module/src/dsp/program.js +129 -0
  209. package/build/module/src/dsp/program.js.map +1 -0
  210. package/build/module/src/dsp/prompt.d.ts +25 -0
  211. package/build/module/src/dsp/prompt.js +178 -0
  212. package/build/module/src/dsp/prompt.js.map +1 -0
  213. package/build/module/src/dsp/registry.d.ts +6 -0
  214. package/build/module/src/dsp/registry.js +15 -0
  215. package/build/module/src/dsp/registry.js.map +1 -0
  216. package/build/module/src/dsp/router.d.ts +24 -0
  217. package/build/module/src/dsp/router.js +72 -0
  218. package/build/module/src/dsp/router.js.map +1 -0
  219. package/build/module/src/dsp/sig.d.ts +37 -0
  220. package/build/module/src/dsp/sig.js +160 -0
  221. package/build/module/src/dsp/sig.js.map +1 -0
  222. package/build/module/src/dsp/sig.test.d.ts +1 -0
  223. package/build/module/src/dsp/sig.test.js +25 -0
  224. package/build/module/src/dsp/sig.test.js.map +1 -0
  225. package/build/module/src/dsp/stopwords.d.ts +1 -0
  226. package/build/module/src/dsp/stopwords.js +1163 -0
  227. package/build/module/src/dsp/stopwords.js.map +1 -0
  228. package/build/module/src/dsp/strutil.d.ts +9 -0
  229. package/build/module/src/dsp/strutil.js +52 -0
  230. package/build/module/src/dsp/strutil.js.map +1 -0
  231. package/build/module/src/dsp/util.d.ts +1 -0
  232. package/build/module/src/dsp/util.js +14 -0
  233. package/build/module/src/dsp/util.js.map +1 -0
  234. package/build/module/src/examples/agent.d.ts +1 -0
  235. package/build/module/src/examples/agent.js +24 -0
  236. package/build/module/src/examples/agent.js.map +1 -0
  237. package/build/module/src/examples/chain-of-thought.d.ts +1 -0
  238. package/build/module/src/examples/chain-of-thought.js +18 -0
  239. package/build/module/src/examples/chain-of-thought.js.map +1 -0
  240. package/build/module/src/examples/customer-support.d.ts +1 -0
  241. package/build/module/src/examples/customer-support.js +22 -0
  242. package/build/module/src/examples/customer-support.js.map +1 -0
  243. package/build/module/src/examples/fibonacci.d.ts +1 -0
  244. package/build/module/src/examples/fibonacci.js +9 -0
  245. package/build/module/src/examples/fibonacci.js.map +1 -0
  246. package/build/module/src/examples/food-search.d.ts +1 -0
  247. package/build/module/src/examples/food-search.js +137 -0
  248. package/build/module/src/examples/food-search.js.map +1 -0
  249. package/build/module/src/examples/marketing.d.ts +1 -0
  250. package/build/module/src/examples/marketing.js +26 -0
  251. package/build/module/src/examples/marketing.js.map +1 -0
  252. package/build/module/src/examples/meetings.d.ts +1 -0
  253. package/build/module/src/examples/meetings.js +149 -0
  254. package/build/module/src/examples/meetings.js.map +1 -0
  255. package/build/module/src/examples/qna-tune.d.ts +1 -0
  256. package/build/module/src/examples/qna-tune.js +29 -0
  257. package/build/module/src/examples/qna-tune.js.map +1 -0
  258. package/build/module/src/examples/qna-use-tuned.d.ts +1 -0
  259. package/build/module/src/examples/qna-use-tuned.js +25 -0
  260. package/build/module/src/examples/qna-use-tuned.js.map +1 -0
  261. package/build/module/src/examples/rag-docs.d.ts +1 -0
  262. package/build/module/src/examples/rag-docs.js +14 -0
  263. package/build/module/src/examples/rag-docs.js.map +1 -0
  264. package/build/module/src/examples/rag.d.ts +1 -0
  265. package/build/module/src/examples/rag.js +14 -0
  266. package/build/module/src/examples/rag.js.map +1 -0
  267. package/build/module/src/examples/react.d.ts +1 -0
  268. package/build/module/src/examples/react.js +36 -0
  269. package/build/module/src/examples/react.js.map +1 -0
  270. package/build/module/src/examples/routing.d.ts +1 -0
  271. package/build/module/src/examples/routing.js +48 -0
  272. package/build/module/src/examples/routing.js.map +1 -0
  273. package/build/module/src/examples/streaming1.d.ts +1 -0
  274. package/build/module/src/examples/streaming1.js +15 -0
  275. package/build/module/src/examples/streaming1.js.map +1 -0
  276. package/build/module/src/examples/streaming2.d.ts +1 -0
  277. package/build/module/src/examples/streaming2.js +24 -0
  278. package/build/module/src/examples/streaming2.js.map +1 -0
  279. package/build/module/src/examples/summarize.d.ts +1 -0
  280. package/build/module/src/examples/summarize.js +27 -0
  281. package/build/module/src/examples/summarize.js.map +1 -0
  282. package/build/module/src/examples/vectordb.d.ts +1 -0
  283. package/build/module/src/examples/vectordb.js +14 -0
  284. package/build/module/src/examples/vectordb.js.map +1 -0
  285. package/build/module/src/funcs/code.d.ts +10 -0
  286. package/build/module/src/funcs/code.js +63 -0
  287. package/build/module/src/funcs/code.js.map +1 -0
  288. package/build/module/src/funcs/embed.d.ts +8 -0
  289. package/build/module/src/funcs/embed.js +29 -0
  290. package/build/module/src/funcs/embed.js.map +1 -0
  291. package/build/module/src/funcs/index.d.ts +2 -0
  292. package/build/module/src/funcs/index.js +3 -0
  293. package/build/module/src/funcs/index.js.map +1 -0
  294. package/build/module/src/index.d.ts +9 -0
  295. package/build/module/src/index.js +15 -0
  296. package/build/module/src/index.js.map +1 -0
  297. package/build/module/src/prompts/agent.d.ts +24 -0
  298. package/build/module/src/prompts/agent.js +65 -0
  299. package/build/module/src/prompts/agent.js.map +1 -0
  300. package/build/module/src/prompts/cot.d.ts +9 -0
  301. package/build/module/src/prompts/cot.js +17 -0
  302. package/build/module/src/prompts/cot.js.map +1 -0
  303. package/build/module/src/prompts/index.d.ts +4 -0
  304. package/build/module/src/prompts/index.js +5 -0
  305. package/build/module/src/prompts/index.js.map +1 -0
  306. package/build/module/src/prompts/prompts.test.d.ts +1 -0
  307. package/build/module/src/prompts/prompts.test.js +48 -0
  308. package/build/module/src/prompts/prompts.test.js.map +1 -0
  309. package/build/module/src/prompts/rag.d.ts +23 -0
  310. package/build/module/src/prompts/rag.js +30 -0
  311. package/build/module/src/prompts/rag.js.map +1 -0
  312. package/build/module/src/prompts/react.d.ts +8 -0
  313. package/build/module/src/prompts/react.js +22 -0
  314. package/build/module/src/prompts/react.js.map +1 -0
  315. package/build/module/src/text/functions.d.ts +25 -0
  316. package/build/module/src/text/functions.js +55 -0
  317. package/build/module/src/text/functions.js.map +1 -0
  318. package/build/module/src/text/index.d.ts +3 -0
  319. package/build/module/src/text/index.js +4 -0
  320. package/build/module/src/text/index.js.map +1 -0
  321. package/build/module/src/text/jsonschema.d.ts +2 -0
  322. package/build/module/src/text/jsonschema.js +96 -0
  323. package/build/module/src/text/jsonschema.js.map +1 -0
  324. package/build/module/src/text/memory.d.ts +21 -0
  325. package/build/module/src/text/memory.js +73 -0
  326. package/build/module/src/text/memory.js.map +1 -0
  327. package/build/module/src/text/types.d.ts +57 -0
  328. package/build/module/src/text/types.js +2 -0
  329. package/build/module/src/text/types.js.map +1 -0
  330. package/build/module/src/trace/index.d.ts +171 -0
  331. package/build/module/src/trace/index.js +67 -0
  332. package/build/module/src/trace/index.js.map +1 -0
  333. package/build/module/src/types/index.d.ts +81 -0
  334. package/build/module/src/types/index.js +2 -0
  335. package/build/module/src/types/index.js.map +1 -0
  336. package/build/module/src/util/apicall.d.ts +21 -0
  337. package/build/module/src/util/apicall.js +137 -0
  338. package/build/module/src/util/apicall.js.map +1 -0
  339. package/build/module/src/util/log.d.ts +14 -0
  340. package/build/module/src/util/log.js +30 -0
  341. package/build/module/src/util/log.js.map +1 -0
  342. package/build/module/src/util/other.d.ts +1 -0
  343. package/build/module/src/util/other.js +4 -0
  344. package/build/module/src/util/other.js.map +1 -0
  345. package/build/module/src/util/stream.d.ts +10 -0
  346. package/build/module/src/util/stream.js +28 -0
  347. package/build/module/src/util/stream.js.map +1 -0
  348. package/build/module/src/util/transform.d.ts +8 -0
  349. package/build/module/src/util/transform.js +57 -0
  350. package/build/module/src/util/transform.js.map +1 -0
  351. package/package.json +111 -0
@@ -0,0 +1,1437 @@
1
+ /* eslint-disable */
2
+ const peggyParser = // Generated by Peggy 3.0.2.
3
+
4
+ //
5
+ // https://peggyjs.org/
6
+ // @ts-ignore
7
+ (function () {
8
+ // @ts-ignore
9
+ "use strict";
10
+ // @ts-ignore
11
+ function peg$subclass(child, parent) {
12
+ // @ts-ignore
13
+ function C() { this.constructor = child; }
14
+ // @ts-ignore
15
+ C.prototype = parent.prototype;
16
+ // @ts-ignore
17
+ child.prototype = new C();
18
+ }
19
+ // @ts-ignore
20
+ function peg$SyntaxError(message, expected, found, location) {
21
+ // @ts-ignore
22
+ var self = Error.call(this, message);
23
+ // istanbul ignore next Check is a necessary evil to support older environments
24
+ // @ts-ignore
25
+ if (Object.setPrototypeOf) {
26
+ // @ts-ignore
27
+ Object.setPrototypeOf(self, peg$SyntaxError.prototype);
28
+ }
29
+ // @ts-ignore
30
+ self.expected = expected;
31
+ // @ts-ignore
32
+ self.found = found;
33
+ // @ts-ignore
34
+ self.location = location;
35
+ // @ts-ignore
36
+ self.name = "SyntaxError";
37
+ // @ts-ignore
38
+ return self;
39
+ }
40
+ // @ts-ignore
41
+ peg$subclass(peg$SyntaxError, Error);
42
+ // @ts-ignore
43
+ function peg$padEnd(str, targetLength, padString) {
44
+ // @ts-ignore
45
+ padString = padString || " ";
46
+ // @ts-ignore
47
+ if (str.length > targetLength) {
48
+ return str;
49
+ }
50
+ // @ts-ignore
51
+ targetLength -= str.length;
52
+ // @ts-ignore
53
+ padString += padString.repeat(targetLength);
54
+ // @ts-ignore
55
+ return str + padString.slice(0, targetLength);
56
+ }
57
+ // @ts-ignore
58
+ peg$SyntaxError.prototype.format = function (sources) {
59
+ // @ts-ignore
60
+ var str = "Error: " + this.message;
61
+ // @ts-ignore
62
+ if (this.location) {
63
+ // @ts-ignore
64
+ var src = null;
65
+ // @ts-ignore
66
+ var k;
67
+ // @ts-ignore
68
+ for (k = 0; k < sources.length; k++) {
69
+ // @ts-ignore
70
+ if (sources[k].source === this.location.source) {
71
+ // @ts-ignore
72
+ src = sources[k].text.split(/\r\n|\n|\r/g);
73
+ // @ts-ignore
74
+ break;
75
+ }
76
+ }
77
+ // @ts-ignore
78
+ var s = this.location.start;
79
+ // @ts-ignore
80
+ var offset_s = (this.location.source && (typeof this.location.source.offset === "function"))
81
+ // @ts-ignore
82
+ ? this.location.source.offset(s)
83
+ // @ts-ignore
84
+ : s;
85
+ // @ts-ignore
86
+ var loc = this.location.source + ":" + offset_s.line + ":" + offset_s.column;
87
+ // @ts-ignore
88
+ if (src) {
89
+ // @ts-ignore
90
+ var e = this.location.end;
91
+ // @ts-ignore
92
+ var filler = peg$padEnd("", offset_s.line.toString().length, ' ');
93
+ // @ts-ignore
94
+ var line = src[s.line - 1];
95
+ // @ts-ignore
96
+ var last = s.line === e.line ? e.column : line.length + 1;
97
+ // @ts-ignore
98
+ var hatLen = (last - s.column) || 1;
99
+ // @ts-ignore
100
+ str += "\n --> " + loc + "\n"
101
+ // @ts-ignore
102
+ + filler + " |\n"
103
+ // @ts-ignore
104
+ + offset_s.line + " | " + line + "\n"
105
+ // @ts-ignore
106
+ + filler + " | " + peg$padEnd("", s.column - 1, ' ')
107
+ // @ts-ignore
108
+ + peg$padEnd("", hatLen, "^");
109
+ // @ts-ignore
110
+ }
111
+ else {
112
+ // @ts-ignore
113
+ str += "\n at " + loc;
114
+ }
115
+ }
116
+ // @ts-ignore
117
+ return str;
118
+ };
119
+ // @ts-ignore
120
+ peg$SyntaxError.buildMessage = function (expected, found) {
121
+ // @ts-ignore
122
+ var DESCRIBE_EXPECTATION_FNS = {
123
+ // @ts-ignore
124
+ literal: function (expectation) {
125
+ // @ts-ignore
126
+ return "\"" + literalEscape(expectation.text) + "\"";
127
+ },
128
+ // @ts-ignore
129
+ class: function (expectation) {
130
+ // @ts-ignore
131
+ var escapedParts = expectation.parts.map(function (part) {
132
+ // @ts-ignore
133
+ return Array.isArray(part)
134
+ // @ts-ignore
135
+ ? classEscape(part[0]) + "-" + classEscape(part[1])
136
+ // @ts-ignore
137
+ : classEscape(part);
138
+ });
139
+ // @ts-ignore
140
+ return "[" + (expectation.inverted ? "^" : "") + escapedParts.join("") + "]";
141
+ },
142
+ // @ts-ignore
143
+ any: function () {
144
+ // @ts-ignore
145
+ return "any character";
146
+ },
147
+ // @ts-ignore
148
+ end: function () {
149
+ // @ts-ignore
150
+ return "end of input";
151
+ },
152
+ // @ts-ignore
153
+ other: function (expectation) {
154
+ // @ts-ignore
155
+ return expectation.description;
156
+ }
157
+ };
158
+ // @ts-ignore
159
+ function hex(ch) {
160
+ // @ts-ignore
161
+ return ch.charCodeAt(0).toString(16).toUpperCase();
162
+ }
163
+ // @ts-ignore
164
+ function literalEscape(s) {
165
+ // @ts-ignore
166
+ return s
167
+ // @ts-ignore
168
+ .replace(/\\/g, "\\\\")
169
+ // @ts-ignore
170
+ .replace(/"/g, "\\\"")
171
+ // @ts-ignore
172
+ .replace(/\0/g, "\\0")
173
+ // @ts-ignore
174
+ .replace(/\t/g, "\\t")
175
+ // @ts-ignore
176
+ .replace(/\n/g, "\\n")
177
+ // @ts-ignore
178
+ .replace(/\r/g, "\\r")
179
+ // @ts-ignore
180
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
181
+ // @ts-ignore
182
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
183
+ }
184
+ // @ts-ignore
185
+ function classEscape(s) {
186
+ // @ts-ignore
187
+ return s
188
+ // @ts-ignore
189
+ .replace(/\\/g, "\\\\")
190
+ // @ts-ignore
191
+ .replace(/\]/g, "\\]")
192
+ // @ts-ignore
193
+ .replace(/\^/g, "\\^")
194
+ // @ts-ignore
195
+ .replace(/-/g, "\\-")
196
+ // @ts-ignore
197
+ .replace(/\0/g, "\\0")
198
+ // @ts-ignore
199
+ .replace(/\t/g, "\\t")
200
+ // @ts-ignore
201
+ .replace(/\n/g, "\\n")
202
+ // @ts-ignore
203
+ .replace(/\r/g, "\\r")
204
+ // @ts-ignore
205
+ .replace(/[\x00-\x0F]/g, function (ch) { return "\\x0" + hex(ch); })
206
+ // @ts-ignore
207
+ .replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) { return "\\x" + hex(ch); });
208
+ }
209
+ // @ts-ignore
210
+ function describeExpectation(expectation) {
211
+ // @ts-ignore
212
+ return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
213
+ }
214
+ // @ts-ignore
215
+ function describeExpected(expected) {
216
+ // @ts-ignore
217
+ var descriptions = expected.map(describeExpectation);
218
+ // @ts-ignore
219
+ var i, j;
220
+ // @ts-ignore
221
+ descriptions.sort();
222
+ // @ts-ignore
223
+ if (descriptions.length > 0) {
224
+ // @ts-ignore
225
+ for (i = 1, j = 1; i < descriptions.length; i++) {
226
+ // @ts-ignore
227
+ if (descriptions[i - 1] !== descriptions[i]) {
228
+ // @ts-ignore
229
+ descriptions[j] = descriptions[i];
230
+ // @ts-ignore
231
+ j++;
232
+ }
233
+ }
234
+ // @ts-ignore
235
+ descriptions.length = j;
236
+ }
237
+ // @ts-ignore
238
+ switch (descriptions.length) {
239
+ // @ts-ignore
240
+ case 1:
241
+ // @ts-ignore
242
+ return descriptions[0];
243
+ // @ts-ignore
244
+ case 2:
245
+ // @ts-ignore
246
+ return descriptions[0] + " or " + descriptions[1];
247
+ // @ts-ignore
248
+ default:
249
+ // @ts-ignore
250
+ return descriptions.slice(0, -1).join(", ")
251
+ // @ts-ignore
252
+ + ", or "
253
+ // @ts-ignore
254
+ + descriptions[descriptions.length - 1];
255
+ }
256
+ }
257
+ // @ts-ignore
258
+ function describeFound(found) {
259
+ // @ts-ignore
260
+ return found ? "\"" + literalEscape(found) + "\"" : "end of input";
261
+ }
262
+ // @ts-ignore
263
+ return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
264
+ };
265
+ // @ts-ignore
266
+ function peg$parse(input, options) {
267
+ // @ts-ignore
268
+ options = options !== undefined ? options : {};
269
+ // @ts-ignore
270
+ var peg$FAILED = {};
271
+ // @ts-ignore
272
+ var peg$source = options.grammarSource;
273
+ // @ts-ignore
274
+ var peg$startRuleFunctions = { ParsedSignature: peg$parseParsedSignature };
275
+ // @ts-ignore
276
+ var peg$startRuleFunction = peg$parseParsedSignature;
277
+ // @ts-ignore
278
+ var peg$c0 = "->";
279
+ var peg$c1 = ",";
280
+ var peg$c2 = "?";
281
+ var peg$c3 = ":";
282
+ var peg$c4 = "[]";
283
+ var peg$c5 = "'";
284
+ var peg$c6 = "\"";
285
+ var peg$r0 = /^[a-zA-Z_0-9]/;
286
+ var peg$r1 = /^[^']/;
287
+ var peg$r2 = /^[^"]/;
288
+ var peg$r3 = /^[ \t\r\n]/;
289
+ var peg$e0 = peg$literalExpectation("->", false);
290
+ var peg$e1 = peg$literalExpectation(",", false);
291
+ var peg$e2 = peg$literalExpectation("?", false);
292
+ var peg$e3 = peg$literalExpectation(":", false);
293
+ var peg$e4 = peg$classExpectation([["a", "z"], ["A", "Z"], "_", ["0", "9"]], false, false);
294
+ var peg$e5 = peg$literalExpectation("[]", false);
295
+ var peg$e6 = peg$literalExpectation("'", false);
296
+ var peg$e7 = peg$classExpectation(["'"], true, false);
297
+ var peg$e8 = peg$literalExpectation("\"", false);
298
+ var peg$e9 = peg$classExpectation(["\""], true, false);
299
+ var peg$e10 = peg$classExpectation([" ", "\t", "\r", "\n"], false, false);
300
+ // @ts-ignore
301
+ var peg$f0 = function (optionalDesc, inputs, outputs) {
302
+ // @ts-ignore
303
+ return {
304
+ // @ts-ignore
305
+ desc: optionalDesc ? optionalDesc.join("").trim() : undefined,
306
+ // @ts-ignore
307
+ inputs,
308
+ // @ts-ignore
309
+ outputs
310
+ };
311
+ }; // @ts-ignore
312
+ var peg$f1 = function (name, isOptional, optionalType, optionalDesc) {
313
+ // @ts-ignore
314
+ return {
315
+ // @ts-ignore
316
+ name,
317
+ // @ts-ignore
318
+ desc: optionalDesc ? optionalDesc.join("").trim() : undefined,
319
+ // @ts-ignore
320
+ type: optionalType ? optionalType.at(-1) : undefined,
321
+ // @ts-ignore
322
+ isOptional: isOptional ? true : undefined
323
+ };
324
+ }; // @ts-ignore
325
+ var peg$f2 = function (chars, isArray) {
326
+ // @ts-ignore
327
+ return { name: chars.join(""), isArray: isArray ? true : false };
328
+ }; // @ts-ignore
329
+ var peg$f3 = function (chars) {
330
+ // @ts-ignore
331
+ return chars.join("");
332
+ }; // @ts-ignore
333
+ var peg$f4 = function (content) {
334
+ return content.join("");
335
+ }; // @ts-ignore
336
+ var peg$f5 = function (content) {
337
+ return content.join("");
338
+ }; // @ts-ignore
339
+ var peg$f6 = function () {
340
+ // @ts-ignore
341
+ return "";
342
+ }; // @ts-ignore
343
+ var peg$f7 = function () {
344
+ // @ts-ignore
345
+ return "";
346
+ };
347
+ // @ts-ignore
348
+ var peg$currPos = 0;
349
+ // @ts-ignore
350
+ var peg$savedPos = 0;
351
+ // @ts-ignore
352
+ var peg$posDetailsCache = [{ line: 1, column: 1 }];
353
+ // @ts-ignore
354
+ var peg$maxFailPos = 0;
355
+ // @ts-ignore
356
+ var peg$maxFailExpected = [];
357
+ // @ts-ignore
358
+ var peg$silentFails = 0;
359
+ // @ts-ignore
360
+ var peg$resultsCache = {};
361
+ // @ts-ignore
362
+ var peg$result;
363
+ // @ts-ignore
364
+ if ("startRule" in options) {
365
+ // @ts-ignore
366
+ if (!(options.startRule in peg$startRuleFunctions)) {
367
+ // @ts-ignore
368
+ throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
369
+ }
370
+ // @ts-ignore
371
+ peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
372
+ }
373
+ // @ts-ignore
374
+ function text() {
375
+ // @ts-ignore
376
+ return input.substring(peg$savedPos, peg$currPos);
377
+ }
378
+ // @ts-ignore
379
+ function offset() {
380
+ // @ts-ignore
381
+ return peg$savedPos;
382
+ }
383
+ // @ts-ignore
384
+ function range() {
385
+ // @ts-ignore
386
+ return {
387
+ // @ts-ignore
388
+ source: peg$source,
389
+ // @ts-ignore
390
+ start: peg$savedPos,
391
+ // @ts-ignore
392
+ end: peg$currPos
393
+ };
394
+ }
395
+ // @ts-ignore
396
+ function location() {
397
+ // @ts-ignore
398
+ return peg$computeLocation(peg$savedPos, peg$currPos);
399
+ }
400
+ // @ts-ignore
401
+ function expected(description, location) {
402
+ // @ts-ignore
403
+ location = location !== undefined
404
+ // @ts-ignore
405
+ ? location
406
+ // @ts-ignore
407
+ : peg$computeLocation(peg$savedPos, peg$currPos);
408
+ // @ts-ignore
409
+ throw peg$buildStructuredError(
410
+ // @ts-ignore
411
+ [peg$otherExpectation(description)],
412
+ // @ts-ignore
413
+ input.substring(peg$savedPos, peg$currPos),
414
+ // @ts-ignore
415
+ location);
416
+ }
417
+ // @ts-ignore
418
+ function error(message, location) {
419
+ // @ts-ignore
420
+ location = location !== undefined
421
+ // @ts-ignore
422
+ ? location
423
+ // @ts-ignore
424
+ : peg$computeLocation(peg$savedPos, peg$currPos);
425
+ // @ts-ignore
426
+ throw peg$buildSimpleError(message, location);
427
+ }
428
+ // @ts-ignore
429
+ function peg$literalExpectation(text, ignoreCase) {
430
+ // @ts-ignore
431
+ return { type: "literal", text: text, ignoreCase: ignoreCase };
432
+ }
433
+ // @ts-ignore
434
+ function peg$classExpectation(parts, inverted, ignoreCase) {
435
+ // @ts-ignore
436
+ return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
437
+ }
438
+ // @ts-ignore
439
+ function peg$anyExpectation() {
440
+ // @ts-ignore
441
+ return { type: "any" };
442
+ }
443
+ // @ts-ignore
444
+ function peg$endExpectation() {
445
+ // @ts-ignore
446
+ return { type: "end" };
447
+ }
448
+ // @ts-ignore
449
+ function peg$otherExpectation(description) {
450
+ // @ts-ignore
451
+ return { type: "other", description: description };
452
+ }
453
+ // @ts-ignore
454
+ function peg$computePosDetails(pos) {
455
+ // @ts-ignore
456
+ var details = peg$posDetailsCache[pos];
457
+ // @ts-ignore
458
+ var p;
459
+ // @ts-ignore
460
+ if (details) {
461
+ // @ts-ignore
462
+ return details;
463
+ // @ts-ignore
464
+ }
465
+ else {
466
+ // @ts-ignore
467
+ p = pos - 1;
468
+ // @ts-ignore
469
+ while (!peg$posDetailsCache[p]) {
470
+ // @ts-ignore
471
+ p--;
472
+ }
473
+ // @ts-ignore
474
+ details = peg$posDetailsCache[p];
475
+ // @ts-ignore
476
+ details = {
477
+ // @ts-ignore
478
+ line: details.line,
479
+ // @ts-ignore
480
+ column: details.column
481
+ };
482
+ // @ts-ignore
483
+ while (p < pos) {
484
+ // @ts-ignore
485
+ if (input.charCodeAt(p) === 10) {
486
+ // @ts-ignore
487
+ details.line++;
488
+ // @ts-ignore
489
+ details.column = 1;
490
+ // @ts-ignore
491
+ }
492
+ else {
493
+ // @ts-ignore
494
+ details.column++;
495
+ }
496
+ // @ts-ignore
497
+ p++;
498
+ }
499
+ // @ts-ignore
500
+ peg$posDetailsCache[pos] = details;
501
+ // @ts-ignore
502
+ return details;
503
+ }
504
+ }
505
+ // @ts-ignore
506
+ function peg$computeLocation(startPos, endPos, offset) {
507
+ // @ts-ignore
508
+ var startPosDetails = peg$computePosDetails(startPos);
509
+ // @ts-ignore
510
+ var endPosDetails = peg$computePosDetails(endPos);
511
+ // @ts-ignore
512
+ var res = {
513
+ // @ts-ignore
514
+ source: peg$source,
515
+ // @ts-ignore
516
+ start: {
517
+ // @ts-ignore
518
+ offset: startPos,
519
+ // @ts-ignore
520
+ line: startPosDetails.line,
521
+ // @ts-ignore
522
+ column: startPosDetails.column
523
+ },
524
+ // @ts-ignore
525
+ end: {
526
+ // @ts-ignore
527
+ offset: endPos,
528
+ // @ts-ignore
529
+ line: endPosDetails.line,
530
+ // @ts-ignore
531
+ column: endPosDetails.column
532
+ }
533
+ };
534
+ // @ts-ignore
535
+ if (offset && peg$source && (typeof peg$source.offset === "function")) {
536
+ // @ts-ignore
537
+ res.start = peg$source.offset(res.start);
538
+ // @ts-ignore
539
+ res.end = peg$source.offset(res.end);
540
+ }
541
+ // @ts-ignore
542
+ return res;
543
+ }
544
+ // @ts-ignore
545
+ function peg$fail(expected) {
546
+ // @ts-ignore
547
+ if (peg$currPos < peg$maxFailPos) {
548
+ return;
549
+ }
550
+ // @ts-ignore
551
+ if (peg$currPos > peg$maxFailPos) {
552
+ // @ts-ignore
553
+ peg$maxFailPos = peg$currPos;
554
+ // @ts-ignore
555
+ peg$maxFailExpected = [];
556
+ }
557
+ // @ts-ignore
558
+ peg$maxFailExpected.push(expected);
559
+ }
560
+ // @ts-ignore
561
+ function peg$buildSimpleError(message, location) {
562
+ // @ts-ignore
563
+ return new peg$SyntaxError(message, null, null, location);
564
+ }
565
+ // @ts-ignore
566
+ function peg$buildStructuredError(expected, found, location) {
567
+ // @ts-ignore
568
+ return new peg$SyntaxError(
569
+ // @ts-ignore
570
+ peg$SyntaxError.buildMessage(expected, found),
571
+ // @ts-ignore
572
+ expected,
573
+ // @ts-ignore
574
+ found,
575
+ // @ts-ignore
576
+ location);
577
+ }
578
+ // @ts-ignore
579
+ function peg$parseParsedSignature() {
580
+ // @ts-ignore
581
+ var s0, s1, s2, s3, s4, s5, s6, s7;
582
+ // @ts-ignore
583
+ var key = peg$currPos * 8 + 0;
584
+ // @ts-ignore
585
+ var cached = peg$resultsCache[key];
586
+ // @ts-ignore
587
+ if (cached) {
588
+ // @ts-ignore
589
+ peg$currPos = cached.nextPos;
590
+ // @ts-ignore
591
+ return cached.result;
592
+ }
593
+ // @ts-ignore
594
+ s0 = peg$currPos;
595
+ // @ts-ignore
596
+ s1 = peg$currPos;
597
+ // @ts-ignore
598
+ s2 = peg$parse_();
599
+ // @ts-ignore
600
+ s3 = peg$parseParsedString();
601
+ // @ts-ignore
602
+ if (s3 !== peg$FAILED) {
603
+ // @ts-ignore
604
+ s4 = peg$parse_();
605
+ // @ts-ignore
606
+ s2 = [s2, s3, s4];
607
+ // @ts-ignore
608
+ s1 = s2;
609
+ // @ts-ignore
610
+ }
611
+ else {
612
+ // @ts-ignore
613
+ peg$currPos = s1;
614
+ // @ts-ignore
615
+ s1 = peg$FAILED;
616
+ }
617
+ // @ts-ignore
618
+ if (s1 === peg$FAILED) {
619
+ // @ts-ignore
620
+ s1 = null;
621
+ }
622
+ // @ts-ignore
623
+ s2 = peg$parseParsedFieldList();
624
+ // @ts-ignore
625
+ s3 = peg$parse__();
626
+ // @ts-ignore
627
+ if (s3 !== peg$FAILED) {
628
+ // @ts-ignore
629
+ if (input.substr(peg$currPos, 2) === peg$c0) {
630
+ // @ts-ignore
631
+ s4 = peg$c0;
632
+ // @ts-ignore
633
+ peg$currPos += 2;
634
+ // @ts-ignore
635
+ }
636
+ else {
637
+ // @ts-ignore
638
+ s4 = peg$FAILED;
639
+ // @ts-ignore
640
+ if (peg$silentFails === 0) {
641
+ peg$fail(peg$e0);
642
+ }
643
+ }
644
+ // @ts-ignore
645
+ if (s4 !== peg$FAILED) {
646
+ // @ts-ignore
647
+ s5 = peg$parse__();
648
+ // @ts-ignore
649
+ if (s5 !== peg$FAILED) {
650
+ // @ts-ignore
651
+ s6 = peg$parseParsedFieldList();
652
+ // @ts-ignore
653
+ s7 = peg$parse_();
654
+ // @ts-ignore
655
+ peg$savedPos = s0;
656
+ // @ts-ignore
657
+ s0 = peg$f0(s1, s2, s6);
658
+ // @ts-ignore
659
+ }
660
+ else {
661
+ // @ts-ignore
662
+ peg$currPos = s0;
663
+ // @ts-ignore
664
+ s0 = peg$FAILED;
665
+ }
666
+ // @ts-ignore
667
+ }
668
+ else {
669
+ // @ts-ignore
670
+ peg$currPos = s0;
671
+ // @ts-ignore
672
+ s0 = peg$FAILED;
673
+ }
674
+ // @ts-ignore
675
+ }
676
+ else {
677
+ // @ts-ignore
678
+ peg$currPos = s0;
679
+ // @ts-ignore
680
+ s0 = peg$FAILED;
681
+ }
682
+ // @ts-ignore
683
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
684
+ // @ts-ignore
685
+ return s0;
686
+ }
687
+ // @ts-ignore
688
+ function peg$parseParsedFieldList() {
689
+ // @ts-ignore
690
+ var s0, s1, s2, s3, s4, s5;
691
+ // @ts-ignore
692
+ var key = peg$currPos * 8 + 1;
693
+ // @ts-ignore
694
+ var cached = peg$resultsCache[key];
695
+ // @ts-ignore
696
+ if (cached) {
697
+ // @ts-ignore
698
+ peg$currPos = cached.nextPos;
699
+ // @ts-ignore
700
+ return cached.result;
701
+ }
702
+ // @ts-ignore
703
+ s0 = [];
704
+ // @ts-ignore
705
+ s1 = peg$parseParsedField();
706
+ // @ts-ignore
707
+ while (s1 !== peg$FAILED) {
708
+ // @ts-ignore
709
+ s0.push(s1);
710
+ // @ts-ignore
711
+ s1 = peg$currPos;
712
+ // @ts-ignore
713
+ s2 = peg$currPos;
714
+ // @ts-ignore
715
+ s3 = peg$parse_();
716
+ // @ts-ignore
717
+ if (input.charCodeAt(peg$currPos) === 44) {
718
+ // @ts-ignore
719
+ s4 = peg$c1;
720
+ // @ts-ignore
721
+ peg$currPos++;
722
+ // @ts-ignore
723
+ }
724
+ else {
725
+ // @ts-ignore
726
+ s4 = peg$FAILED;
727
+ // @ts-ignore
728
+ if (peg$silentFails === 0) {
729
+ peg$fail(peg$e1);
730
+ }
731
+ }
732
+ // @ts-ignore
733
+ if (s4 !== peg$FAILED) {
734
+ // @ts-ignore
735
+ s5 = peg$parse_();
736
+ // @ts-ignore
737
+ s3 = [s3, s4, s5];
738
+ // @ts-ignore
739
+ s2 = s3;
740
+ // @ts-ignore
741
+ }
742
+ else {
743
+ // @ts-ignore
744
+ peg$currPos = s2;
745
+ // @ts-ignore
746
+ s2 = peg$FAILED;
747
+ }
748
+ // @ts-ignore
749
+ if (s2 !== peg$FAILED) {
750
+ // @ts-ignore
751
+ s2 = peg$parseParsedField();
752
+ // @ts-ignore
753
+ s1 = s2;
754
+ // @ts-ignore
755
+ }
756
+ else {
757
+ // @ts-ignore
758
+ s1 = s2;
759
+ }
760
+ }
761
+ // @ts-ignore
762
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
763
+ // @ts-ignore
764
+ return s0;
765
+ }
766
+ // @ts-ignore
767
+ function peg$parseParsedField() {
768
+ // @ts-ignore
769
+ var s0, s1, s2, s3, s4, s5, s6, s7, s8;
770
+ // @ts-ignore
771
+ var key = peg$currPos * 8 + 2;
772
+ // @ts-ignore
773
+ var cached = peg$resultsCache[key];
774
+ // @ts-ignore
775
+ if (cached) {
776
+ // @ts-ignore
777
+ peg$currPos = cached.nextPos;
778
+ // @ts-ignore
779
+ return cached.result;
780
+ }
781
+ // @ts-ignore
782
+ s0 = peg$currPos;
783
+ // @ts-ignore
784
+ s1 = peg$parse_();
785
+ // @ts-ignore
786
+ s2 = peg$parseParsedIdentifier();
787
+ // @ts-ignore
788
+ if (input.charCodeAt(peg$currPos) === 63) {
789
+ // @ts-ignore
790
+ s3 = peg$c2;
791
+ // @ts-ignore
792
+ peg$currPos++;
793
+ // @ts-ignore
794
+ }
795
+ else {
796
+ // @ts-ignore
797
+ s3 = peg$FAILED;
798
+ // @ts-ignore
799
+ if (peg$silentFails === 0) {
800
+ peg$fail(peg$e2);
801
+ }
802
+ }
803
+ // @ts-ignore
804
+ if (s3 === peg$FAILED) {
805
+ // @ts-ignore
806
+ s3 = null;
807
+ }
808
+ // @ts-ignore
809
+ s4 = peg$currPos;
810
+ // @ts-ignore
811
+ s5 = peg$parse_();
812
+ // @ts-ignore
813
+ if (input.charCodeAt(peg$currPos) === 58) {
814
+ // @ts-ignore
815
+ s6 = peg$c3;
816
+ // @ts-ignore
817
+ peg$currPos++;
818
+ // @ts-ignore
819
+ }
820
+ else {
821
+ // @ts-ignore
822
+ s6 = peg$FAILED;
823
+ // @ts-ignore
824
+ if (peg$silentFails === 0) {
825
+ peg$fail(peg$e3);
826
+ }
827
+ }
828
+ // @ts-ignore
829
+ if (s6 !== peg$FAILED) {
830
+ // @ts-ignore
831
+ s7 = peg$parse_();
832
+ // @ts-ignore
833
+ s8 = peg$parseParsedType();
834
+ // @ts-ignore
835
+ s5 = [s5, s6, s7, s8];
836
+ // @ts-ignore
837
+ s4 = s5;
838
+ // @ts-ignore
839
+ }
840
+ else {
841
+ // @ts-ignore
842
+ peg$currPos = s4;
843
+ // @ts-ignore
844
+ s4 = peg$FAILED;
845
+ }
846
+ // @ts-ignore
847
+ if (s4 === peg$FAILED) {
848
+ // @ts-ignore
849
+ s4 = null;
850
+ }
851
+ // @ts-ignore
852
+ s5 = peg$currPos;
853
+ // @ts-ignore
854
+ s6 = peg$parse_();
855
+ // @ts-ignore
856
+ s7 = peg$parseParsedString();
857
+ // @ts-ignore
858
+ if (s7 !== peg$FAILED) {
859
+ // @ts-ignore
860
+ s6 = [s6, s7];
861
+ // @ts-ignore
862
+ s5 = s6;
863
+ // @ts-ignore
864
+ }
865
+ else {
866
+ // @ts-ignore
867
+ peg$currPos = s5;
868
+ // @ts-ignore
869
+ s5 = peg$FAILED;
870
+ }
871
+ // @ts-ignore
872
+ if (s5 === peg$FAILED) {
873
+ // @ts-ignore
874
+ s5 = null;
875
+ }
876
+ // @ts-ignore
877
+ peg$savedPos = s0;
878
+ // @ts-ignore
879
+ s0 = peg$f1(s2, s3, s4, s5);
880
+ // @ts-ignore
881
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
882
+ // @ts-ignore
883
+ return s0;
884
+ }
885
+ // @ts-ignore
886
+ function peg$parseParsedType() {
887
+ // @ts-ignore
888
+ var s0, s1, s2;
889
+ // @ts-ignore
890
+ var key = peg$currPos * 8 + 3;
891
+ // @ts-ignore
892
+ var cached = peg$resultsCache[key];
893
+ // @ts-ignore
894
+ if (cached) {
895
+ // @ts-ignore
896
+ peg$currPos = cached.nextPos;
897
+ // @ts-ignore
898
+ return cached.result;
899
+ }
900
+ // @ts-ignore
901
+ s0 = peg$currPos;
902
+ // @ts-ignore
903
+ s1 = [];
904
+ // @ts-ignore
905
+ if (peg$r0.test(input.charAt(peg$currPos))) {
906
+ // @ts-ignore
907
+ s2 = input.charAt(peg$currPos);
908
+ // @ts-ignore
909
+ peg$currPos++;
910
+ // @ts-ignore
911
+ }
912
+ else {
913
+ // @ts-ignore
914
+ s2 = peg$FAILED;
915
+ // @ts-ignore
916
+ if (peg$silentFails === 0) {
917
+ peg$fail(peg$e4);
918
+ }
919
+ }
920
+ // @ts-ignore
921
+ while (s2 !== peg$FAILED) {
922
+ // @ts-ignore
923
+ s1.push(s2);
924
+ // @ts-ignore
925
+ if (peg$r0.test(input.charAt(peg$currPos))) {
926
+ // @ts-ignore
927
+ s2 = input.charAt(peg$currPos);
928
+ // @ts-ignore
929
+ peg$currPos++;
930
+ // @ts-ignore
931
+ }
932
+ else {
933
+ // @ts-ignore
934
+ s2 = peg$FAILED;
935
+ // @ts-ignore
936
+ if (peg$silentFails === 0) {
937
+ peg$fail(peg$e4);
938
+ }
939
+ }
940
+ }
941
+ // @ts-ignore
942
+ if (input.substr(peg$currPos, 2) === peg$c4) {
943
+ // @ts-ignore
944
+ s2 = peg$c4;
945
+ // @ts-ignore
946
+ peg$currPos += 2;
947
+ // @ts-ignore
948
+ }
949
+ else {
950
+ // @ts-ignore
951
+ s2 = peg$FAILED;
952
+ // @ts-ignore
953
+ if (peg$silentFails === 0) {
954
+ peg$fail(peg$e5);
955
+ }
956
+ }
957
+ // @ts-ignore
958
+ if (s2 === peg$FAILED) {
959
+ // @ts-ignore
960
+ s2 = null;
961
+ }
962
+ // @ts-ignore
963
+ peg$savedPos = s0;
964
+ // @ts-ignore
965
+ s0 = peg$f2(s1, s2);
966
+ // @ts-ignore
967
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
968
+ // @ts-ignore
969
+ return s0;
970
+ }
971
+ // @ts-ignore
972
+ function peg$parseParsedIdentifier() {
973
+ // @ts-ignore
974
+ var s0, s1, s2;
975
+ // @ts-ignore
976
+ var key = peg$currPos * 8 + 4;
977
+ // @ts-ignore
978
+ var cached = peg$resultsCache[key];
979
+ // @ts-ignore
980
+ if (cached) {
981
+ // @ts-ignore
982
+ peg$currPos = cached.nextPos;
983
+ // @ts-ignore
984
+ return cached.result;
985
+ }
986
+ // @ts-ignore
987
+ s0 = peg$currPos;
988
+ // @ts-ignore
989
+ s1 = [];
990
+ // @ts-ignore
991
+ if (peg$r0.test(input.charAt(peg$currPos))) {
992
+ // @ts-ignore
993
+ s2 = input.charAt(peg$currPos);
994
+ // @ts-ignore
995
+ peg$currPos++;
996
+ // @ts-ignore
997
+ }
998
+ else {
999
+ // @ts-ignore
1000
+ s2 = peg$FAILED;
1001
+ // @ts-ignore
1002
+ if (peg$silentFails === 0) {
1003
+ peg$fail(peg$e4);
1004
+ }
1005
+ }
1006
+ // @ts-ignore
1007
+ while (s2 !== peg$FAILED) {
1008
+ // @ts-ignore
1009
+ s1.push(s2);
1010
+ // @ts-ignore
1011
+ if (peg$r0.test(input.charAt(peg$currPos))) {
1012
+ // @ts-ignore
1013
+ s2 = input.charAt(peg$currPos);
1014
+ // @ts-ignore
1015
+ peg$currPos++;
1016
+ // @ts-ignore
1017
+ }
1018
+ else {
1019
+ // @ts-ignore
1020
+ s2 = peg$FAILED;
1021
+ // @ts-ignore
1022
+ if (peg$silentFails === 0) {
1023
+ peg$fail(peg$e4);
1024
+ }
1025
+ }
1026
+ }
1027
+ // @ts-ignore
1028
+ peg$savedPos = s0;
1029
+ // @ts-ignore
1030
+ s1 = peg$f3(s1);
1031
+ // @ts-ignore
1032
+ s0 = s1;
1033
+ // @ts-ignore
1034
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
1035
+ // @ts-ignore
1036
+ return s0;
1037
+ }
1038
+ // @ts-ignore
1039
+ function peg$parseParsedString() {
1040
+ // @ts-ignore
1041
+ var s0, s1, s2, s3;
1042
+ // @ts-ignore
1043
+ var key = peg$currPos * 8 + 5;
1044
+ // @ts-ignore
1045
+ var cached = peg$resultsCache[key];
1046
+ // @ts-ignore
1047
+ if (cached) {
1048
+ // @ts-ignore
1049
+ peg$currPos = cached.nextPos;
1050
+ // @ts-ignore
1051
+ return cached.result;
1052
+ }
1053
+ // @ts-ignore
1054
+ s0 = peg$currPos;
1055
+ // @ts-ignore
1056
+ if (input.charCodeAt(peg$currPos) === 39) {
1057
+ // @ts-ignore
1058
+ s1 = peg$c5;
1059
+ // @ts-ignore
1060
+ peg$currPos++;
1061
+ // @ts-ignore
1062
+ }
1063
+ else {
1064
+ // @ts-ignore
1065
+ s1 = peg$FAILED;
1066
+ // @ts-ignore
1067
+ if (peg$silentFails === 0) {
1068
+ peg$fail(peg$e6);
1069
+ }
1070
+ }
1071
+ // @ts-ignore
1072
+ if (s1 !== peg$FAILED) {
1073
+ // @ts-ignore
1074
+ s2 = [];
1075
+ // @ts-ignore
1076
+ if (peg$r1.test(input.charAt(peg$currPos))) {
1077
+ // @ts-ignore
1078
+ s3 = input.charAt(peg$currPos);
1079
+ // @ts-ignore
1080
+ peg$currPos++;
1081
+ // @ts-ignore
1082
+ }
1083
+ else {
1084
+ // @ts-ignore
1085
+ s3 = peg$FAILED;
1086
+ // @ts-ignore
1087
+ if (peg$silentFails === 0) {
1088
+ peg$fail(peg$e7);
1089
+ }
1090
+ }
1091
+ // @ts-ignore
1092
+ while (s3 !== peg$FAILED) {
1093
+ // @ts-ignore
1094
+ s2.push(s3);
1095
+ // @ts-ignore
1096
+ if (peg$r1.test(input.charAt(peg$currPos))) {
1097
+ // @ts-ignore
1098
+ s3 = input.charAt(peg$currPos);
1099
+ // @ts-ignore
1100
+ peg$currPos++;
1101
+ // @ts-ignore
1102
+ }
1103
+ else {
1104
+ // @ts-ignore
1105
+ s3 = peg$FAILED;
1106
+ // @ts-ignore
1107
+ if (peg$silentFails === 0) {
1108
+ peg$fail(peg$e7);
1109
+ }
1110
+ }
1111
+ }
1112
+ // @ts-ignore
1113
+ if (input.charCodeAt(peg$currPos) === 39) {
1114
+ // @ts-ignore
1115
+ s3 = peg$c5;
1116
+ // @ts-ignore
1117
+ peg$currPos++;
1118
+ // @ts-ignore
1119
+ }
1120
+ else {
1121
+ // @ts-ignore
1122
+ s3 = peg$FAILED;
1123
+ // @ts-ignore
1124
+ if (peg$silentFails === 0) {
1125
+ peg$fail(peg$e6);
1126
+ }
1127
+ }
1128
+ // @ts-ignore
1129
+ if (s3 !== peg$FAILED) {
1130
+ // @ts-ignore
1131
+ peg$savedPos = s0;
1132
+ // @ts-ignore
1133
+ s0 = peg$f4(s2);
1134
+ // @ts-ignore
1135
+ }
1136
+ else {
1137
+ // @ts-ignore
1138
+ peg$currPos = s0;
1139
+ // @ts-ignore
1140
+ s0 = peg$FAILED;
1141
+ }
1142
+ // @ts-ignore
1143
+ }
1144
+ else {
1145
+ // @ts-ignore
1146
+ peg$currPos = s0;
1147
+ // @ts-ignore
1148
+ s0 = peg$FAILED;
1149
+ }
1150
+ // @ts-ignore
1151
+ if (s0 === peg$FAILED) {
1152
+ // @ts-ignore
1153
+ s0 = peg$currPos;
1154
+ // @ts-ignore
1155
+ if (input.charCodeAt(peg$currPos) === 34) {
1156
+ // @ts-ignore
1157
+ s1 = peg$c6;
1158
+ // @ts-ignore
1159
+ peg$currPos++;
1160
+ // @ts-ignore
1161
+ }
1162
+ else {
1163
+ // @ts-ignore
1164
+ s1 = peg$FAILED;
1165
+ // @ts-ignore
1166
+ if (peg$silentFails === 0) {
1167
+ peg$fail(peg$e8);
1168
+ }
1169
+ }
1170
+ // @ts-ignore
1171
+ if (s1 !== peg$FAILED) {
1172
+ // @ts-ignore
1173
+ s2 = [];
1174
+ // @ts-ignore
1175
+ if (peg$r2.test(input.charAt(peg$currPos))) {
1176
+ // @ts-ignore
1177
+ s3 = input.charAt(peg$currPos);
1178
+ // @ts-ignore
1179
+ peg$currPos++;
1180
+ // @ts-ignore
1181
+ }
1182
+ else {
1183
+ // @ts-ignore
1184
+ s3 = peg$FAILED;
1185
+ // @ts-ignore
1186
+ if (peg$silentFails === 0) {
1187
+ peg$fail(peg$e9);
1188
+ }
1189
+ }
1190
+ // @ts-ignore
1191
+ while (s3 !== peg$FAILED) {
1192
+ // @ts-ignore
1193
+ s2.push(s3);
1194
+ // @ts-ignore
1195
+ if (peg$r2.test(input.charAt(peg$currPos))) {
1196
+ // @ts-ignore
1197
+ s3 = input.charAt(peg$currPos);
1198
+ // @ts-ignore
1199
+ peg$currPos++;
1200
+ // @ts-ignore
1201
+ }
1202
+ else {
1203
+ // @ts-ignore
1204
+ s3 = peg$FAILED;
1205
+ // @ts-ignore
1206
+ if (peg$silentFails === 0) {
1207
+ peg$fail(peg$e9);
1208
+ }
1209
+ }
1210
+ }
1211
+ // @ts-ignore
1212
+ if (input.charCodeAt(peg$currPos) === 34) {
1213
+ // @ts-ignore
1214
+ s3 = peg$c6;
1215
+ // @ts-ignore
1216
+ peg$currPos++;
1217
+ // @ts-ignore
1218
+ }
1219
+ else {
1220
+ // @ts-ignore
1221
+ s3 = peg$FAILED;
1222
+ // @ts-ignore
1223
+ if (peg$silentFails === 0) {
1224
+ peg$fail(peg$e8);
1225
+ }
1226
+ }
1227
+ // @ts-ignore
1228
+ if (s3 !== peg$FAILED) {
1229
+ // @ts-ignore
1230
+ peg$savedPos = s0;
1231
+ // @ts-ignore
1232
+ s0 = peg$f5(s2);
1233
+ // @ts-ignore
1234
+ }
1235
+ else {
1236
+ // @ts-ignore
1237
+ peg$currPos = s0;
1238
+ // @ts-ignore
1239
+ s0 = peg$FAILED;
1240
+ }
1241
+ // @ts-ignore
1242
+ }
1243
+ else {
1244
+ // @ts-ignore
1245
+ peg$currPos = s0;
1246
+ // @ts-ignore
1247
+ s0 = peg$FAILED;
1248
+ }
1249
+ }
1250
+ // @ts-ignore
1251
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
1252
+ // @ts-ignore
1253
+ return s0;
1254
+ }
1255
+ // @ts-ignore
1256
+ function peg$parse_() {
1257
+ // @ts-ignore
1258
+ var s0, s1, s2;
1259
+ // @ts-ignore
1260
+ var key = peg$currPos * 8 + 6;
1261
+ // @ts-ignore
1262
+ var cached = peg$resultsCache[key];
1263
+ // @ts-ignore
1264
+ if (cached) {
1265
+ // @ts-ignore
1266
+ peg$currPos = cached.nextPos;
1267
+ // @ts-ignore
1268
+ return cached.result;
1269
+ }
1270
+ // @ts-ignore
1271
+ s0 = peg$currPos;
1272
+ // @ts-ignore
1273
+ s1 = [];
1274
+ // @ts-ignore
1275
+ if (peg$r3.test(input.charAt(peg$currPos))) {
1276
+ // @ts-ignore
1277
+ s2 = input.charAt(peg$currPos);
1278
+ // @ts-ignore
1279
+ peg$currPos++;
1280
+ // @ts-ignore
1281
+ }
1282
+ else {
1283
+ // @ts-ignore
1284
+ s2 = peg$FAILED;
1285
+ // @ts-ignore
1286
+ if (peg$silentFails === 0) {
1287
+ peg$fail(peg$e10);
1288
+ }
1289
+ }
1290
+ // @ts-ignore
1291
+ while (s2 !== peg$FAILED) {
1292
+ // @ts-ignore
1293
+ s1.push(s2);
1294
+ // @ts-ignore
1295
+ if (peg$r3.test(input.charAt(peg$currPos))) {
1296
+ // @ts-ignore
1297
+ s2 = input.charAt(peg$currPos);
1298
+ // @ts-ignore
1299
+ peg$currPos++;
1300
+ // @ts-ignore
1301
+ }
1302
+ else {
1303
+ // @ts-ignore
1304
+ s2 = peg$FAILED;
1305
+ // @ts-ignore
1306
+ if (peg$silentFails === 0) {
1307
+ peg$fail(peg$e10);
1308
+ }
1309
+ }
1310
+ }
1311
+ // @ts-ignore
1312
+ peg$savedPos = s0;
1313
+ // @ts-ignore
1314
+ s1 = peg$f6();
1315
+ // @ts-ignore
1316
+ s0 = s1;
1317
+ // @ts-ignore
1318
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
1319
+ // @ts-ignore
1320
+ return s0;
1321
+ }
1322
+ // @ts-ignore
1323
+ function peg$parse__() {
1324
+ // @ts-ignore
1325
+ var s0, s1, s2;
1326
+ // @ts-ignore
1327
+ var key = peg$currPos * 8 + 7;
1328
+ // @ts-ignore
1329
+ var cached = peg$resultsCache[key];
1330
+ // @ts-ignore
1331
+ if (cached) {
1332
+ // @ts-ignore
1333
+ peg$currPos = cached.nextPos;
1334
+ // @ts-ignore
1335
+ return cached.result;
1336
+ }
1337
+ // @ts-ignore
1338
+ s0 = peg$currPos;
1339
+ // @ts-ignore
1340
+ s1 = [];
1341
+ // @ts-ignore
1342
+ if (peg$r3.test(input.charAt(peg$currPos))) {
1343
+ // @ts-ignore
1344
+ s2 = input.charAt(peg$currPos);
1345
+ // @ts-ignore
1346
+ peg$currPos++;
1347
+ // @ts-ignore
1348
+ }
1349
+ else {
1350
+ // @ts-ignore
1351
+ s2 = peg$FAILED;
1352
+ // @ts-ignore
1353
+ if (peg$silentFails === 0) {
1354
+ peg$fail(peg$e10);
1355
+ }
1356
+ }
1357
+ // @ts-ignore
1358
+ if (s2 !== peg$FAILED) {
1359
+ // @ts-ignore
1360
+ while (s2 !== peg$FAILED) {
1361
+ // @ts-ignore
1362
+ s1.push(s2);
1363
+ // @ts-ignore
1364
+ if (peg$r3.test(input.charAt(peg$currPos))) {
1365
+ // @ts-ignore
1366
+ s2 = input.charAt(peg$currPos);
1367
+ // @ts-ignore
1368
+ peg$currPos++;
1369
+ // @ts-ignore
1370
+ }
1371
+ else {
1372
+ // @ts-ignore
1373
+ s2 = peg$FAILED;
1374
+ // @ts-ignore
1375
+ if (peg$silentFails === 0) {
1376
+ peg$fail(peg$e10);
1377
+ }
1378
+ }
1379
+ }
1380
+ // @ts-ignore
1381
+ }
1382
+ else {
1383
+ // @ts-ignore
1384
+ s1 = peg$FAILED;
1385
+ }
1386
+ // @ts-ignore
1387
+ if (s1 !== peg$FAILED) {
1388
+ // @ts-ignore
1389
+ peg$savedPos = s0;
1390
+ // @ts-ignore
1391
+ s1 = peg$f7();
1392
+ }
1393
+ // @ts-ignore
1394
+ s0 = s1;
1395
+ // @ts-ignore
1396
+ peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };
1397
+ // @ts-ignore
1398
+ return s0;
1399
+ }
1400
+ // @ts-ignore
1401
+ peg$result = peg$startRuleFunction();
1402
+ // @ts-ignore
1403
+ if (peg$result !== peg$FAILED && peg$currPos === input.length) {
1404
+ // @ts-ignore
1405
+ return peg$result;
1406
+ // @ts-ignore
1407
+ }
1408
+ else {
1409
+ // @ts-ignore
1410
+ if (peg$result !== peg$FAILED && peg$currPos < input.length) {
1411
+ // @ts-ignore
1412
+ peg$fail(peg$endExpectation());
1413
+ }
1414
+ // @ts-ignore
1415
+ throw peg$buildStructuredError(
1416
+ // @ts-ignore
1417
+ peg$maxFailExpected,
1418
+ // @ts-ignore
1419
+ peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
1420
+ // @ts-ignore
1421
+ peg$maxFailPos < input.length
1422
+ // @ts-ignore
1423
+ ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
1424
+ // @ts-ignore
1425
+ : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
1426
+ }
1427
+ }
1428
+ // @ts-ignore
1429
+ return {
1430
+ SyntaxError: peg$SyntaxError,
1431
+ parse: peg$parse
1432
+ };
1433
+ })();
1434
+ peggyParser.SyntaxError.prototype.name = "PeggySyntaxError";
1435
+ export const parse = peggyParser.parse;
1436
+ export const PeggySyntaxError = peggyParser.SyntaxError;
1437
+ //# sourceMappingURL=parser.js.map