file-viewer3 1.0.25 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (377) hide show
  1. package/README.en.md +7 -377
  2. package/README.md +8 -352
  3. package/dist/file-viewer3.css +1 -0
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.js +2 -0
  6. package/package.json +27 -129
  7. package/dist/_headers +0 -22
  8. package/dist/assets/3MFLoader--yjh7udp.js +0 -1
  9. package/dist/assets/AMFLoader-C0y7NIAO.js +0 -1
  10. package/dist/assets/ArchiveViewer-6AvBZVl3.js +0 -2
  11. package/dist/assets/ArchiveViewer-B2pHxHFv.css +0 -1
  12. package/dist/assets/AudioViewer-0CSMvCtp.css +0 -1
  13. package/dist/assets/AudioViewer-6a_DDcur.js +0 -1
  14. package/dist/assets/CadViewer-A9PKtCth.css +0 -1
  15. package/dist/assets/CadViewer-D94LUXKO.js +0 -110
  16. package/dist/assets/CodeViewer-BdZGsbFh.js +0 -2
  17. package/dist/assets/CodeViewer-CR2CsPRi.css +0 -1
  18. package/dist/assets/ColladaLoader-DTiuvWJL.js +0 -3
  19. package/dist/assets/DrawingViewer-BplS278E.js +0 -2
  20. package/dist/assets/DrawingViewer-DXiF5YWV.css +0 -1
  21. package/dist/assets/EdaViewer-BXH1Jmwr.js +0 -8
  22. package/dist/assets/EdaViewer-CKf1YQnh.css +0 -1
  23. package/dist/assets/EmailViewer-BsBKZ_A5.js +0 -4
  24. package/dist/assets/EmailViewer-BwvGE4ns.css +0 -1
  25. package/dist/assets/EpubViewer-Cci0l1Vm.css +0 -1
  26. package/dist/assets/EpubViewer-DlGzr8_x.js +0 -2
  27. package/dist/assets/FBXLoader-Bj34Z_uf.js +0 -1
  28. package/dist/assets/GLTFLoader-BNUIXeRP.js +0 -1
  29. package/dist/assets/ImageViewer-BKp7YpMs.css +0 -10
  30. package/dist/assets/ImageViewer-D1Yc0jYg.js +0 -1
  31. package/dist/assets/KMZLoader-DTmXWzX_.js +0 -1
  32. package/dist/assets/MarkdownViewer-CIljbLlu.css +0 -1
  33. package/dist/assets/MarkdownViewer-CRi0rhWw.js +0 -64
  34. package/dist/assets/ModelViewer-C4ir9AyI.css +0 -1
  35. package/dist/assets/ModelViewer-yxcVdLzz.js +0 -2
  36. package/dist/assets/OBJLoader-DW4Mv-mq.js +0 -5
  37. package/dist/assets/OfdViewer-DbkG1-Bp.js +0 -2
  38. package/dist/assets/OfdViewer-Ulv-WZWh.css +0 -1
  39. package/dist/assets/PCDLoader-CHA1g8rk.js +0 -3
  40. package/dist/assets/PLYLoader-DwTzA-Dg.js +0 -2
  41. package/dist/assets/PdfView-_Uu48dkU.js +0 -558
  42. package/dist/assets/PdfView-fKwbB_8j.css +0 -1
  43. package/dist/assets/PptxRender-BNoW_9_0.css +0 -1
  44. package/dist/assets/PptxRender-myCCfHiR.js +0 -32
  45. package/dist/assets/STLLoader-Bt7FMgMu.js +0 -1
  46. package/dist/assets/TDSLoader-D__OhSS9.js +0 -1
  47. package/dist/assets/TypstViewer-4dMAIp9x.js +0 -60
  48. package/dist/assets/TypstViewer-BgYR02wU.css +0 -1
  49. package/dist/assets/USDLoader-BovI5HgZ.js +0 -6
  50. package/dist/assets/UmdViewer-BfIWw5dV.js +0 -3
  51. package/dist/assets/UmdViewer-DpObj56a.css +0 -1
  52. package/dist/assets/VRMLLoader-_VxVXPvX.js +0 -140
  53. package/dist/assets/VTKLoader-BfnzBXsa.js +0 -3
  54. package/dist/assets/XYZLoader-DbQZs-aZ.js +0 -2
  55. package/dist/assets/XlsxTable-CKmWT6Iw.js +0 -5
  56. package/dist/assets/XlsxTable-Ccp_ksQc.css +0 -1
  57. package/dist/assets/__vite-browser-external-j1Zxnfxm.js +0 -1
  58. package/dist/assets/ar-SA-G6X2FPQ2-h0GtAVoD.js +0 -10
  59. package/dist/assets/arc-C_eH0vTw.js +0 -1
  60. package/dist/assets/architecture-7EHR7CIX-nPLvVkG5.js +0 -1
  61. package/dist/assets/architectureDiagram-3BPJPVTR-Cx8fJaC_.js +0 -36
  62. package/dist/assets/archive-D-0w4Z7t.js +0 -2
  63. package/dist/assets/audio-IkwcqgJA.js +0 -2
  64. package/dist/assets/az-AZ-76LH7QW2-D_aQ-6Zd.js +0 -1
  65. package/dist/assets/bash-LmRjUKlR.js +0 -1
  66. package/dist/assets/bg-BG-XCXSNQG7-H7Czia1L.js +0 -5
  67. package/dist/assets/blockDiagram-GPEHLZMM-v3Efy6dm.js +0 -132
  68. package/dist/assets/bn-BD-2XOGV67Q-f6ymEr9g.js +0 -5
  69. package/dist/assets/c4Diagram-AAUBKEIU-BdstYnMv.js +0 -10
  70. package/dist/assets/ca-ES-6MX7JW3Y-DTzyqWmS.js +0 -8
  71. package/dist/assets/cad-DFnQbJJO.js +0 -2
  72. package/dist/assets/cfb-Bv6fOQ4m.js +0 -11
  73. package/dist/assets/channel-C66J400U.js +0 -1
  74. package/dist/assets/chunk-2J33WTMH-BoyKZPbs.js +0 -1
  75. package/dist/assets/chunk-3OPIFGDE-a_QAVzsM.js +0 -62
  76. package/dist/assets/chunk-4BX2VUAB-DZj4_o2K.js +0 -1
  77. package/dist/assets/chunk-55IACEB6-C7hP08Mf.js +0 -1
  78. package/dist/assets/chunk-5ZQYHXKU-DBQ_7Zc2.js +0 -2
  79. package/dist/assets/chunk-6U3AYISY-C6-Mtja1.js +0 -12
  80. package/dist/assets/chunk-727SXJPM-BVNP_kQ-.js +0 -206
  81. package/dist/assets/chunk-AGHRB4JF-DrBKq3qz.js +0 -1
  82. package/dist/assets/chunk-AQP2D5EJ-0N6k4ROT.js +0 -231
  83. package/dist/assets/chunk-BSJP7CBP-b8olRIQO.js +0 -1
  84. package/dist/assets/chunk-CSCIHK7Q-B5j-yHKS.js +0 -124
  85. package/dist/assets/chunk-EIO257PC-C6qii-N9.js +0 -22
  86. package/dist/assets/chunk-FMBD7UC4-CBBZh2UU.js +0 -15
  87. package/dist/assets/chunk-K2UTITRG-Cx4xt2xV.js +0 -35
  88. package/dist/assets/chunk-KSCS5N6A-Dwg0HTxH.js +0 -10
  89. package/dist/assets/chunk-L5ZTLDWV-BPuCpePB.js +0 -1
  90. package/dist/assets/chunk-LZXEDZCA-CvLuVK3G.js +0 -2
  91. package/dist/assets/chunk-ND2GUHAM-CWJPhGEg.js +0 -1
  92. package/dist/assets/chunk-NNHCCRGN-DlpIbxXb.js +0 -159
  93. package/dist/assets/chunk-NZK2D7GU-DuaLWEa1.js +0 -1
  94. package/dist/assets/chunk-O5CBEL6O-dK2KeDfH.js +0 -70
  95. package/dist/assets/chunk-QZHKN3VN-4Bf82riF.js +0 -1
  96. package/dist/assets/chunk-SRAX5OIU-BhbLEiib.js +0 -1
  97. package/dist/assets/chunk-WU5MYG2G-DLkui5D2.js +0 -1
  98. package/dist/assets/chunk-XPW4576I-BvXQTKbm.js +0 -32
  99. package/dist/assets/chunk-Z3N5DIM6-D9TMVU7m.js +0 -1
  100. package/dist/assets/chunk-ZUYEQ4TG-BzFOpW--.js +0 -7
  101. package/dist/assets/classDiagram-4FO5ZUOK-DKj6zlra.js +0 -1
  102. package/dist/assets/classDiagram-v2-Q7XG4LA2-DKj6zlra.js +0 -1
  103. package/dist/assets/compare-BA1y8ff-.css +0 -1
  104. package/dist/assets/compare-QN3IusOj.js +0 -1
  105. package/dist/assets/compiler-qgJWLAtm.js +0 -1
  106. package/dist/assets/core-S5OLGxXP.js +0 -3
  107. package/dist/assets/cose-bilkent-S5V4N54A-CslZOqNN.js +0 -1
  108. package/dist/assets/cpp-V0F2hNk9.js +0 -1
  109. package/dist/assets/cs-CZ-2BRQDIVT-BRw0NNL_.js +0 -11
  110. package/dist/assets/csharp-GZmu99Fo.js +0 -1
  111. package/dist/assets/css-D5l_8KUR.js +0 -1
  112. package/dist/assets/cytoscape.esm-C8YCVR3_.js +0 -321
  113. package/dist/assets/da-DK-5WZEPLOC-q5u_UoZe.js +0 -5
  114. package/dist/assets/dagre-BM42HDAG-D6fpH9H3.js +0 -4
  115. package/dist/assets/dagre-Bx709z4p.js +0 -1
  116. package/dist/assets/de-DE-XR44H4JA-B79lsSt9.js +0 -8
  117. package/dist/assets/defaultLocale-C8Fc0cco.js +0 -1
  118. package/dist/assets/diagram-2AECGRRQ-DGviV3zF.js +0 -43
  119. package/dist/assets/diagram-5GNKFQAL-D8edmK5r.js +0 -10
  120. package/dist/assets/diagram-KO2AKTUF-DonC_-9l.js +0 -3
  121. package/dist/assets/diagram-LMA3HP47-T0-OD5uV.js +0 -24
  122. package/dist/assets/diagram-OG6HWLK6-BsRJiZE3.js +0 -24
  123. package/dist/assets/diff-CJb8JxGC.js +0 -1
  124. package/dist/assets/directory-open-01563666-D4xXyWb_.js +0 -1
  125. package/dist/assets/directory-open-4ed118d0-1i309Asm.js +0 -1
  126. package/dist/assets/dist-ND9DUPs_.js +0 -1
  127. package/dist/assets/dist-S-2Hyh3N.js +0 -1
  128. package/dist/assets/dist-jshluroQ.js +0 -27
  129. package/dist/assets/docx-preview-CAHEyNQy.js +0 -20
  130. package/dist/assets/drawing-B3sCN7BX.js +0 -2
  131. package/dist/assets/ebook-DDycOGR3.js +0 -2
  132. package/dist/assets/eda-JxVOVy9j.js +0 -2
  133. package/dist/assets/el-GR-BZB4AONW-DVV0CNhT.js +0 -10
  134. package/dist/assets/email-D9tCfCzQ.js +0 -2
  135. package/dist/assets/en-B4ZKOASM-CpbJugBW.js +0 -1
  136. package/dist/assets/erDiagram-TEJ5UH35-O-dDoXsU.js +0 -85
  137. package/dist/assets/es-ES-U4NZUMDT-DUvN9FXg.js +0 -9
  138. package/dist/assets/eu-ES-A7QVB2H4-DV6UAZB_.js +0 -11
  139. package/dist/assets/eventmodeling-FCH6USID-BONfeu8r.js +0 -1
  140. package/dist/assets/fa-IR-HGAKTJCU-0ql2xhuq.js +0 -8
  141. package/dist/assets/fflate.module-BIQmJeC9.js +0 -1
  142. package/dist/assets/fi-FI-Z5N7JZ37-CxtRUMtw.js +0 -6
  143. package/dist/assets/file-open-002ab408-BHUWm0Sh.js +0 -1
  144. package/dist/assets/file-open-7c801643-DZtJT5zp.js +0 -1
  145. package/dist/assets/file-save-3189631c-CO9S4HFW.js +0 -1
  146. package/dist/assets/file-save-745eba88-Bwdfz6OZ.js +0 -1
  147. package/dist/assets/flowDiagram-I6XJVG4X-DsWkZiFB.js +0 -162
  148. package/dist/assets/fr-FR-RHASNOE6-CLi1nCBA.js +0 -9
  149. package/dist/assets/ganttDiagram-6RSMTGT7-r5IfYmu1.js +0 -292
  150. package/dist/assets/gitGraph-WXDBUCRP-BPjRwtiT.js +0 -1
  151. package/dist/assets/gitGraphDiagram-PVQCEYII-DGYT-2sl.js +0 -106
  152. package/dist/assets/gl-ES-HMX3MZ6V-NMLOwshd.js +0 -10
  153. package/dist/assets/global-compiler-D1EEBbpA.js +0 -1
  154. package/dist/assets/global-renderer-AKzBLvRw.js +0 -1
  155. package/dist/assets/go-B-PCS5zA.js +0 -1
  156. package/dist/assets/graphlib-B8gBHxth.js +0 -1
  157. package/dist/assets/he-IL-6SHJWFNN-BWPkP_3r.js +0 -10
  158. package/dist/assets/hi-IN-IWLTKZ5I-KNyxys-k.js +0 -4
  159. package/dist/assets/hu-HU-A5ZG7DT2-BjcxkVW9.js +0 -7
  160. package/dist/assets/id-ID-SAP4L64H-B-oUkzcH.js +0 -10
  161. package/dist/assets/image-6zdrB4g6.js +0 -2
  162. package/dist/assets/image-GAAHSSAO-7tK5sChZ.js +0 -1
  163. package/dist/assets/image-blob-reduce.esm-NzmDxm1v.js +0 -2
  164. package/dist/assets/info-J43DQDTF-sQY7EXUc.js +0 -1
  165. package/dist/assets/infoDiagram-5YYISTIA-Dzg1KIdJ.js +0 -2
  166. package/dist/assets/ini-B1CroMsf.js +0 -1
  167. package/dist/assets/init-D6jRqBbL.js +0 -1
  168. package/dist/assets/ishikawaDiagram-YF4QCWOH-C4gAmRlT.js +0 -70
  169. package/dist/assets/it-IT-JPQ66NNP-Bwud0QsX.js +0 -11
  170. package/dist/assets/ja-JP-DBVTYXUO-DgNQ5bjg.js +0 -8
  171. package/dist/assets/java-ChVphriW.js +0 -1
  172. package/dist/assets/javascript-w9aIBC1S.js +0 -1
  173. package/dist/assets/journeyDiagram-JHISSGLW-ofw85AZe.js +0 -139
  174. package/dist/assets/json-DS4EA3dC.js +0 -1
  175. package/dist/assets/jszip.min-C7VJhIfM.js +0 -2
  176. package/dist/assets/kaa-6HZHGXH3-BMz8LTXv.js +0 -1
  177. package/dist/assets/kab-KAB-ZGHBKWFO-B9w0Zir8.js +0 -8
  178. package/dist/assets/kanban-definition-UN3LZRKU-CljG07f4.js +0 -89
  179. package/dist/assets/katex-Vhh-h91d.js +0 -257
  180. package/dist/assets/kk-KZ-P5N5QNE5-2tUcaoKh.js +0 -1
  181. package/dist/assets/km-KH-HSX4SM5Z-_kaSqGhJ.js +0 -11
  182. package/dist/assets/ko-KR-MTYHY66A-CIjaox2B.js +0 -9
  183. package/dist/assets/ku-TR-6OUDTVRD-CkLMAwgC.js +0 -9
  184. package/dist/assets/lib-CxFoY_GP.js +0 -6
  185. package/dist/assets/libarchive-DknIq1tb.js +0 -1
  186. package/dist/assets/libarchive-DxGirPmi.wasm +0 -0
  187. package/dist/assets/linear-DAeDjlp3.js +0 -1
  188. package/dist/assets/logo-DG62cSZK.png +0 -0
  189. package/dist/assets/lt-LT-XHIRWOB4-BsH7UAds.js +0 -3
  190. package/dist/assets/lv-LV-5QDEKY6T-DH8to9BS.js +0 -7
  191. package/dist/assets/main-B8S7RFzE.js +0 -4
  192. package/dist/assets/main-BZ1u3qpM.css +0 -1
  193. package/dist/assets/markdown-C8bVcNXx.js +0 -1
  194. package/dist/assets/md-OHaN-Ra2.js +0 -2
  195. package/dist/assets/mermaid-parser.core-DX-qibXo.js +0 -4
  196. package/dist/assets/mindmap-definition-RKZ34NQL-5NZ4x9hJ.js +0 -96
  197. package/dist/assets/model-B6Ua5SnP.js +0 -2
  198. package/dist/assets/mp4-Dho29Zd7.js +0 -1
  199. package/dist/assets/mr-IN-CRQNXWMA-BrKaFNSo.js +0 -13
  200. package/dist/assets/my-MM-5M5IBNSE-BZSEmctA.js +0 -1
  201. package/dist/assets/nb-NO-T6EIAALU-6a9gavJA.js +0 -10
  202. package/dist/assets/nestedRender-vUCW8qgY.js +0 -3
  203. package/dist/assets/nl-NL-IS3SIHDZ-uxPhLMYz.js +0 -8
  204. package/dist/assets/nn-NO-6E72VCQL-D4PNCwHO.js +0 -8
  205. package/dist/assets/oc-FR-POXYY2M6-C7kpaHdZ.js +0 -8
  206. package/dist/assets/ofd-CM51fmds.js +0 -2
  207. package/dist/assets/ofd-CsX4S_yH.js +0 -6
  208. package/dist/assets/ordinal-hYBb2elL.js +0 -1
  209. package/dist/assets/pa-IN-N4M65BXN-DudflUsb.js +0 -4
  210. package/dist/assets/package-BuR3Qm_h.css +0 -1
  211. package/dist/assets/package-DbhUOWuO.js +0 -296
  212. package/dist/assets/packet-YPE3B663-zJFiRlih.js +0 -1
  213. package/dist/assets/pdf-CZTifdsT.js +0 -2
  214. package/dist/assets/percentages-BXMCSKIN-DuKjcyNK.js +0 -1
  215. package/dist/assets/php-5k5YNuRS.js +0 -2
  216. package/dist/assets/pica-W1nY7k4k.js +0 -2
  217. package/dist/assets/pie-CZr-MxNa.js +0 -1
  218. package/dist/assets/pie-LRSECV5Y-ChrxPon2.js +0 -1
  219. package/dist/assets/pieDiagram-4H26LBE5-rqS9xOI6.js +0 -30
  220. package/dist/assets/pl-PL-T2D74RX3-BjwyDbo2.js +0 -9
  221. package/dist/assets/postal-mime-kkzCFkih.js +0 -29
  222. package/dist/assets/pptx-HCi3sDR0.js +0 -2
  223. package/dist/assets/printLayout-D2pf0W9y.js +0 -24
  224. package/dist/assets/prod-CAexHIHC.js +0 -149
  225. package/dist/assets/pt-BR-5N22H2LF-dhO4g53z.js +0 -9
  226. package/dist/assets/pt-PT-UZXXM6DQ-B0FVw5E6.js +0 -9
  227. package/dist/assets/python-DwhXSSGr.js +0 -1
  228. package/dist/assets/quadrantDiagram-W4KKPZXB-CvbA748i.js +0 -7
  229. package/dist/assets/radar-GUYGQ44K-Ch58tAlJ.js +0 -1
  230. package/dist/assets/reactivity.esm-bundler-Bfmlzvr-.js +0 -1
  231. package/dist/assets/renderer-69XMfifI.js +0 -1
  232. package/dist/assets/requirementDiagram-4Y6WPE33-Ek_Wtky1.js +0 -84
  233. package/dist/assets/ro-RO-JPDTUUEW-CRyQ9zJm.js +0 -11
  234. package/dist/assets/rough.esm-CIepY_sA.js +0 -1
  235. package/dist/assets/roundRect-D01gJrlt.js +0 -1
  236. package/dist/assets/ru-RU-B4JR7IUQ-Ccj6OqLf.js +0 -9
  237. package/dist/assets/runtime-core.esm-bundler-CR6OOEFf.js +0 -1
  238. package/dist/assets/rust-Dk33Kfe-.js +0 -1
  239. package/dist/assets/sankeyDiagram-5OEKKPKP-D3gZ6xE7.js +0 -40
  240. package/dist/assets/sequenceDiagram-3UESZ5HK-C5489xFA.js +0 -162
  241. package/dist/assets/si-LK-N5RQ5JYF-BwS2qaTv.js +0 -1
  242. package/dist/assets/sk-SK-C5VTKIMK-ly1tHoOw.js +0 -6
  243. package/dist/assets/sl-SI-NN7IZMDC-iZiOFm2y.js +0 -6
  244. package/dist/assets/sql-DWRKyvJ-.js +0 -1
  245. package/dist/assets/src-BrOGWJpF.js +0 -1
  246. package/dist/assets/src-D_n3k0l_.js +0 -5
  247. package/dist/assets/stateDiagram-AJRCARHV-1hoVbE34.js +0 -1
  248. package/dist/assets/stateDiagram-v2-BHNVJYJU-CZmypPHd.js +0 -1
  249. package/dist/assets/style-x1XGuNl0.css +0 -1
  250. package/dist/assets/subset-shared.chunk-CK2m59fy.js +0 -1
  251. package/dist/assets/subset-worker.chunk-B5G7hWyg.js +0 -1
  252. package/dist/assets/sv-SE-XGPEYMSR-BNpkY1PO.js +0 -10
  253. package/dist/assets/ta-IN-2NMHFXQM-DsldkrWk.js +0 -9
  254. package/dist/assets/text-CMp0EW11.js +0 -2
  255. package/dist/assets/th-TH-HPSO5L25-AVrKqKOh.js +0 -2
  256. package/dist/assets/three.module-BFsVh7r1.js +0 -4104
  257. package/dist/assets/time-B8nkukJS.js +0 -1
  258. package/dist/assets/timeline-definition-PNZ67QCA-CfMKM_FS.js +0 -120
  259. package/dist/assets/tr-TR-DEFEU3FU-DYarL0Oa.js +0 -7
  260. package/dist/assets/treeView-BLDUP644-CGGdcSoP.js +0 -1
  261. package/dist/assets/treemap-LRROVOQU-C3Zg5qig.js +0 -1
  262. package/dist/assets/typescript-BvteI6YB.js +0 -1
  263. package/dist/assets/typst-DOlgRigg.js +0 -2
  264. package/dist/assets/typst_ts_renderer_bg-DRRWm1TP.wasm +0 -0
  265. package/dist/assets/uk-UA-QMV73CPH-D36-a0jl.js +0 -6
  266. package/dist/assets/umd-r51rBtd2.js +0 -2
  267. package/dist/assets/vennDiagram-CIIHVFJN-GrdHiqIf.js +0 -34
  268. package/dist/assets/vi-VN-M7AON7JQ-zdUBY1Fz.js +0 -5
  269. package/dist/assets/wardley-L42UT6IY-ilBO1QYS.js +0 -1
  270. package/dist/assets/wardleyDiagram-YWT4CUSO-Cgr3uPws.js +0 -78
  271. package/dist/assets/wasm-C3ukMqzA.js +0 -1
  272. package/dist/assets/wasm-pack-shim-BShYmbRf.js +0 -1
  273. package/dist/assets/wasm-pack-shim-BnuNh1z7.js +0 -1
  274. package/dist/assets/word-DQCwLNG7.js +0 -150
  275. package/dist/assets/worker-bundle-Dx5mKZOL.js +0 -6
  276. package/dist/assets/worker-ref-BbTnHTC-.js +0 -1
  277. package/dist/assets/xlsx-B1qUDXfb.js +0 -2
  278. package/dist/assets/xlsx-ff7ER-JZ.png +0 -0
  279. package/dist/assets/xml-DasnpDVC.js +0 -1
  280. package/dist/assets/xychartDiagram-2RQKCTM6-BwoaSxOF.js +0 -7
  281. package/dist/assets/yaml-1XF8XcZB.js +0 -1
  282. package/dist/assets/zh-CN-LNUGB5OW-WQ7J6JkH.js +0 -10
  283. package/dist/assets/zh-HK-E62DVLB3-BoGXaBos.js +0 -1
  284. package/dist/assets/zh-TW-RAJ6MFWO-DZQOFop7.js +0 -9
  285. package/dist/compare.html +0 -21
  286. package/dist/example/README.md +0 -137
  287. package/dist/example/SOURCES.md +0 -49
  288. package/dist/example/app.log +0 -13
  289. package/dist/example/archive.tar.gz +0 -0
  290. package/dist/example/archive.zip +0 -0
  291. package/dist/example/audio.mp3 +0 -0
  292. package/dist/example/audio.ogg +0 -0
  293. package/dist/example/book.epub +0 -0
  294. package/dist/example/book.umd +0 -0
  295. package/dist/example/change.diff +0 -40
  296. package/dist/example/code.cjs +0 -38
  297. package/dist/example/code.css +0 -64
  298. package/dist/example/code.java +0 -55
  299. package/dist/example/code.js +0 -55
  300. package/dist/example/code.jsx +0 -43
  301. package/dist/example/code.mjs +0 -36
  302. package/dist/example/code.py +0 -56
  303. package/dist/example/code.ts +0 -78
  304. package/dist/example/code.tsx +0 -36
  305. package/dist/example/component.vue +0 -68
  306. package/dist/example/config.yaml +0 -48
  307. package/dist/example/config.yml +0 -25
  308. package/dist/example/data.json +0 -50
  309. package/dist/example/data.xml +0 -47
  310. package/dist/example/drawing.dxf +0 -22186
  311. package/dist/example/embedded.html +0 -316
  312. package/dist/example/excel.fods +0 -0
  313. package/dist/example/excel.numbers +0 -0
  314. package/dist/example/excel.ods +0 -0
  315. package/dist/example/excel.xls +0 -0
  316. package/dist/example/excel.xlsb +0 -0
  317. package/dist/example/excel.xlsm +0 -0
  318. package/dist/example/excel.xlsx +0 -0
  319. package/dist/example/flow.excalidraw +0 -1
  320. package/dist/example/index.php +0 -44
  321. package/dist/example/main.c +0 -39
  322. package/dist/example/main.cpp +0 -50
  323. package/dist/example/main.go +0 -55
  324. package/dist/example/main.h +0 -22
  325. package/dist/example/main.hpp +0 -28
  326. package/dist/example/main.rs +0 -36
  327. package/dist/example/markdown.md +0 -84
  328. package/dist/example/model.gltf +0 -66
  329. package/dist/example/model.obj +0 -10
  330. package/dist/example/model.ply +0 -18
  331. package/dist/example/model.step +0 -9
  332. package/dist/example/model.stl +0 -30
  333. package/dist/example/module.cc +0 -36
  334. package/dist/example/notes.markdown +0 -15
  335. package/dist/example/ofd.ofd +0 -0
  336. package/dist/example/page.htm +0 -29
  337. package/dist/example/page.html +0 -33
  338. package/dist/example/pdf.pdf +1 -9127
  339. package/dist/example/pic.bmp +0 -0
  340. package/dist/example/pic.gif +0 -0
  341. package/dist/example/pic.jpeg +0 -0
  342. package/dist/example/pic.jpg +0 -0
  343. package/dist/example/pic.png +0 -0
  344. package/dist/example/pic.tif +0 -0
  345. package/dist/example/pic.tiff +0 -0
  346. package/dist/example/pic.webp +0 -0
  347. package/dist/example/ppt.pptx +0 -0
  348. package/dist/example/process.drawio +0 -249
  349. package/dist/example/program.cs +0 -42
  350. package/dist/example/query.sql +0 -30
  351. package/dist/example/report.typ +0 -90
  352. package/dist/example/sample.dra +0 -0
  353. package/dist/example/sample.dwg +0 -0
  354. package/dist/example/sample.eml +0 -46
  355. package/dist/example/sample.msg +0 -0
  356. package/dist/example/sample.olb +0 -0
  357. package/dist/example/samples/apache/blocks_and_tables.dwf +0 -0
  358. package/dist/example/samples/autodesk/house.dwfx +0 -0
  359. package/dist/example/samples/autodesk/robot-arm.dwfx +0 -0
  360. package/dist/example/script.bash +0 -36
  361. package/dist/example/script.sh +0 -24
  362. package/dist/example/settings.ini +0 -23
  363. package/dist/example/table.csv +0 -4
  364. package/dist/example/template.dot +0 -0
  365. package/dist/example/test.doc +0 -0
  366. package/dist/example/text.txt +0 -3
  367. package/dist/example/vector.svg +0 -6
  368. package/dist/example/video.mp4 +0 -0
  369. package/dist/example/word.docx +0 -0
  370. package/dist/favicon.ico +0 -0
  371. package/dist/index.html +0 -302
  372. package/dist/vendor/libarchive/libarchive.wasm +0 -0
  373. package/dist/vendor/libarchive/worker-bundle.js +0 -6
  374. package/dist/wasm/cad/dwfv-render.wasm +0 -0
  375. package/dist/wasm/cad/dwg-worker.js +0 -24
  376. package/dist/wasm/cad/libredwg-web.js +0 -15
  377. package/dist/wasm/cad/libredwg-web.wasm +0 -0
@@ -1,140 +0,0 @@
1
- import{At as e,Bt as t,C as n,Ct as r,E as i,Et as a,Ft as o,K as s,Tt as c,V as l,Z as u,_t as d,c as f,dt as p,et as m,f as h,ft as g,gt as _,h as v,l as y,m as b,p as x,pt as S,q as C,rt as w,tt as T,u as E,v as D,w as O,wt as k,y as A,yt as j,z as M,zt as N}from"./three.module-BFsVh7r1.js";var P=(e,t)=>()=>(t||(t={exports:{}},e(t.exports,t)),t.exports),F=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION=void 0,e.VERSION=`9.0.1`}),I=P((e,t)=>{var n=e&&e.__spreadArray||function(e,t){for(var n=0,r=t.length,i=e.length;n<r;n++,i++)e[i]=t[n];return e};Object.defineProperty(e,"__esModule",{value:!0}),e.toFastProperties=e.timer=e.peek=e.isES2015MapSupported=e.PRINT_WARNING=e.PRINT_ERROR=e.packArray=e.IDENTITY=e.NOOP=e.merge=e.groupBy=e.defaults=e.assignNoOverwrite=e.assign=e.zipObject=e.sortBy=e.indexOf=e.some=e.difference=e.every=e.isObject=e.isRegExp=e.isArray=e.partial=e.uniq=e.compact=e.reduce=e.findAll=e.find=e.cloneObj=e.cloneArr=e.contains=e.has=e.pick=e.reject=e.filter=e.dropRight=e.drop=e.isFunction=e.isUndefined=e.isString=e.forEach=e.last=e.first=e.flatten=e.map=e.mapValues=e.values=e.keys=e.isEmpty=void 0;function r(e){return e&&e.length===0}e.isEmpty=r;function i(e){return e==null?[]:Object.keys(e)}e.keys=i;function a(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++)t.push(e[n[r]]);return t}e.values=a;function o(e,t){for(var n=[],r=i(e),a=0;a<r.length;a++){var o=r[a];n.push(t.call(null,e[o],o))}return n}e.mapValues=o;function s(e,t){for(var n=[],r=0;r<e.length;r++)n.push(t.call(null,e[r],r));return n}e.map=s;function c(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];Array.isArray(r)?t=t.concat(c(r)):t.push(r)}return t}e.flatten=c;function l(e){return r(e)?void 0:e[0]}e.first=l;function u(e){var t=e&&e.length;return t?e[t-1]:void 0}e.last=u;function d(e,t){if(Array.isArray(e))for(var n=0;n<e.length;n++)t.call(null,e[n],n);else if(M(e))for(var r=i(e),n=0;n<r.length;n++){var a=r[n],o=e[a];t.call(null,o,a)}else throw Error(`non exhaustive match`)}e.forEach=d;function f(e){return typeof e==`string`}e.isString=f;function p(e){return e===void 0}e.isUndefined=p;function m(e){return e instanceof Function}e.isFunction=m;function h(e,t){return t===void 0&&(t=1),e.slice(t,e.length)}e.drop=h;function g(e,t){return t===void 0&&(t=1),e.slice(0,e.length-t)}e.dropRight=g;function _(e,t){var n=[];if(Array.isArray(e))for(var r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}e.filter=_;function v(e,t){return _(e,function(e){return!t(e)})}e.reject=v;function y(e,t){for(var n=Object.keys(e),r={},i=0;i<n.length;i++){var a=n[i],o=e[a];t(o)&&(r[a]=o)}return r}e.pick=y;function b(e,t){return M(e)?e.hasOwnProperty(t):!1}e.has=b;function x(e,t){return w(e,function(e){return e===t})!==void 0}e.contains=x;function S(e){for(var t=[],n=0;n<e.length;n++)t.push(e[n]);return t}e.cloneArr=S;function C(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}e.cloneObj=C;function w(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(t.call(null,r))return r}}e.find=w;function T(e,t){for(var n=[],r=0;r<e.length;r++){var i=e[r];t.call(null,i)&&n.push(i)}return n}e.findAll=T;function E(e,t,n){for(var r=Array.isArray(e),o=r?e:a(e),s=r?[]:i(e),c=n,l=0;l<o.length;l++)c=t.call(null,c,o[l],r?l:s[l]);return c}e.reduce=E;function D(e){return v(e,function(e){return e==null})}e.compact=D;function O(e,t){t===void 0&&(t=function(e){return e});var n=[];return E(e,function(e,r){var i=t(r);return x(n,i)?e:(n.push(i),e.concat(r))},[])}e.uniq=O;function k(e){var t=[...arguments].slice(1),n=[null].concat(t);return Function.bind.apply(e,n)}e.partial=k;function A(e){return Array.isArray(e)}e.isArray=A;function j(e){return e instanceof RegExp}e.isRegExp=j;function M(e){return e instanceof Object}e.isObject=M;function N(e,t){for(var n=0;n<e.length;n++)if(!t(e[n],n))return!1;return!0}e.every=N;function P(e,t){return v(e,function(e){return x(t,e)})}e.difference=P;function F(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1}e.some=F;function I(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1}e.indexOf=I;function ee(e,t){var n=S(e);return n.sort(function(e,n){return t(e)-t(n)}),n}e.sortBy=ee;function te(e,t){if(e.length!==t.length)throw Error(`can't zipObject with different number of keys and values!`);for(var n={},r=0;r<e.length;r++)n[e[r]]=t[r];return n}e.zipObject=te;function ne(e){for(var t=[...arguments].slice(1),n=0;n<t.length;n++)for(var r=t[n],a=i(r),o=0;o<a.length;o++){var s=a[o];e[s]=r[s]}return e}e.assign=ne;function L(e){for(var t=[...arguments].slice(1),n=0;n<t.length;n++)for(var r=t[n],a=i(r),o=0;o<a.length;o++){var s=a[o];b(e,s)||(e[s]=r[s])}return e}e.assignNoOverwrite=L;function R(){var e=[...arguments];return L.apply(void 0,n([{}],e))}e.defaults=R;function z(e,t){var n={};return d(e,function(e){var r=t(e),i=n[r];i?i.push(e):n[r]=[e]}),n}e.groupBy=z;function re(e,t){for(var n=C(e),r=i(t),a=0;a<r.length;a++){var o=r[a];n[o]=t[o]}return n}e.merge=re;function B(){}e.NOOP=B;function V(e){return e}e.IDENTITY=V;function H(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r===void 0?void 0:r)}return t}e.packArray=H;function U(e){console&&console.error&&console.error(`Error: `+e)}e.PRINT_ERROR=U;function W(e){console&&console.warn&&console.warn(`Warning: `+e)}e.PRINT_WARNING=W;function G(){return typeof Map==`function`}e.isES2015MapSupported=G;function ie(e){return e[e.length-1]}e.peek=ie;function ae(e){var t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}e.timer=ae;function K(e){function t(){}t.prototype=e;var n=new t;function r(){return typeof n.bar}return r(),r(),e}e.toFastProperties=K}),ee=P((e,t)=>{(function(e,n){typeof define==`function`&&define.amd?define([],n):typeof t==`object`&&t.exports?t.exports=n():e.regexpToAst=n()})(typeof self<`u`?self:e,function(){function e(){}e.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},e.prototype.restoreState=function(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx},e.prototype.pattern=function(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);var t=this.disjunction();this.consumeChar(`/`);for(var n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case`g`:o(n,`global`);break;case`i`:o(n,`ignoreCase`);break;case`m`:o(n,`multiLine`);break;case`u`:o(n,`unicode`);break;case`y`:o(n,`sticky`);break}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}},e.prototype.disjunction=function(){var e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}},e.prototype.alternative=function(){for(var e=[],t=this.idx;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}},e.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},e.prototype.assertion=function(){var e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:this.consumeChar(`?`);var t;switch(this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break}s(t);var n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}c()},e.prototype.quantifier=function(e){var t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:var r=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:r,atMost:r};break;case`,`:var i;this.isDigit()?(i=this.integerIncludingZero(),t={atLeast:r,atMost:i}):t={atLeast:r,atMost:1/0},this.consumeChar(`}`);break}if(e===!0&&t===void 0)return;s(t);break}if(!(e===!0&&t===void 0))return s(t),this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t},e.prototype.atom=function(){var e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group();break}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),s(e),e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e},e.prototype.dotAll=function(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[i(`
2
- `),i(`\r`),i(`\u2028`),i(`\u2029`)]}},e.prototype.atomEscape=function(){switch(this.consumeChar(`\\`),this.peekChar()){case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:return this.decimalEscapeAtom();case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.decimalEscapeAtom=function(){return{type:`GroupBackReference`,value:this.positiveInteger()}},e.prototype.characterClassEscape=function(){var e,t=!1;switch(this.popChar()){case`d`:e=u;break;case`D`:e=u,t=!0;break;case`s`:e=f;break;case`S`:e=f,t=!0;break;case`w`:e=d;break;case`W`:e=d,t=!0;break}return s(e),{type:`Set`,value:e,complement:t}},e.prototype.controlEscapeAtom=function(){var e;switch(this.popChar()){case`f`:e=i(`\f`);break;case`n`:e=i(`
3
- `);break;case`r`:e=i(`\r`);break;case`t`:e=i(` `);break;case`v`:e=i(`\v`);break}return s(e),{type:`Character`,value:e}},e.prototype.controlLetterEscapeAtom=function(){this.consumeChar(`c`);var e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}},e.prototype.nulCharacterAtom=function(){return this.consumeChar(`0`),{type:`Character`,value:i(`\0`)}},e.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar(`x`),this.parseHexDigits(2)},e.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar(`u`),this.parseHexDigits(4)},e.prototype.identityEscapeAtom=function(){return{type:`Character`,value:i(this.popChar())}},e.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
4
- `:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:i(this.popChar())}}},e.prototype.characterClass=function(){var e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){var n=this.classAtom();if(n.type===`Character`&&this.isRangeDash()){this.consumeChar(`-`);var r=this.classAtom();if(r.type===`Character`){if(r.value<n.value)throw Error(`Range out of order in character class`);e.push({from:n.value,to:r.value})}else a(n.value,e),e.push(i(`-`)),a(r.value,e)}else a(n.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}},e.prototype.classAtom=function(){switch(this.peekChar()){case`]`:case`
5
- `:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}},e.prototype.classEscape=function(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:i(`\b`)};case`d`:case`D`:case`s`:case`S`:case`w`:case`W`:return this.characterClassEscape();case`f`:case`n`:case`r`:case`t`:case`v`:return this.controlEscapeAtom();case`c`:return this.controlLetterEscapeAtom();case`0`:return this.nulCharacterAtom();case`x`:return this.hexEscapeSequenceAtom();case`u`:return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},e.prototype.group=function(){var e=!0;switch(this.consumeChar(`(`),this.peekChar(0)){case`?`:this.consumeChar(`?`),this.consumeChar(`:`),e=!1;break;default:this.groupIdx++;break}var t=this.disjunction();this.consumeChar(`)`);var n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n},e.prototype.positiveInteger=function(){var e=this.popChar();if(r.test(e)===!1)throw Error(`Expecting a positive integer`);for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.integerIncludingZero=function(){var e=this.popChar();if(n.test(e)===!1)throw Error(`Expecting an integer`);for(;n.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)},e.prototype.patternCharacter=function(){var e=this.popChar();switch(e){case`
6
- `:case`\r`:case`\u2028`:case`\u2029`:case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:throw Error(`TBD`);default:return{type:`Character`,value:i(e)}}},e.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}},e.prototype.isRangeDash=function(){return this.peekChar()===`-`&&this.isClassAtom(1)},e.prototype.isDigit=function(){return n.test(this.peekChar(0))},e.prototype.isClassAtom=function(e){switch(e===void 0&&(e=0),this.peekChar(e)){case`]`:case`
7
- `:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}},e.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},e.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}},e.prototype.isAssertion=function(){switch(this.peekChar(0)){case`^`:case`$`:return!0;case`\\`:switch(this.peekChar(1)){case`b`:case`B`:return!0;default:return!1}case`(`:return this.peekChar(1)===`?`&&(this.peekChar(2)===`=`||this.peekChar(2)===`!`);default:return!1}},e.prototype.isQuantifier=function(){var e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}},e.prototype.isPatternCharacter=function(){switch(this.peekChar()){case`^`:case`$`:case`\\`:case`.`:case`*`:case`+`:case`?`:case`(`:case`)`:case`[`:case`|`:case`/`:case`
8
- `:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}},e.prototype.parseHexDigits=function(e){for(var n=``,r=0;r<e;r++){var i=this.popChar();if(t.test(i)===!1)throw Error(`Expecting a HexDecimal digits`);n+=i}return{type:`Character`,value:parseInt(n,16)}},e.prototype.peekChar=function(e){return e===void 0&&(e=0),this.input[this.idx+e]},e.prototype.popChar=function(){var e=this.peekChar(0);return this.consumeChar(),e},e.prototype.consumeChar=function(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++},e.prototype.loc=function(e){return{begin:e,end:this.idx}};var t=/[0-9a-fA-F]/,n=/[0-9]/,r=/[1-9]/;function i(e){return e.charCodeAt(0)}function a(e,t){e.length===void 0?t.push(e):e.forEach(function(e){t.push(e)})}function o(e,t){if(e[t]===!0)throw`duplicate flag `+t;e[t]=!0}function s(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`)}function c(){throw Error(`Internal Error - Should never get here!`)}var l,u=[];for(l=i(`0`);l<=i(`9`);l++)u.push(l);var d=[i(`_`)].concat(u);for(l=i(`a`);l<=i(`z`);l++)d.push(l);for(l=i(`A`);l<=i(`Z`);l++)d.push(l);var f=[i(` `),i(`\f`),i(`
9
- `),i(`\r`),i(` `),i(`\v`),i(` `),i(`\xA0`),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(` `),i(`\u2028`),i(`\u2029`),i(` `),i(` `),i(` `),i(``)];function p(){}return p.prototype.visitChildren=function(e){for(var t in e){var n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(function(e){this.visit(e)},this):this.visit(n))}},p.prototype.visit=function(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e);break}this.visitChildren(e)},p.prototype.visitPattern=function(e){},p.prototype.visitFlags=function(e){},p.prototype.visitDisjunction=function(e){},p.prototype.visitAlternative=function(e){},p.prototype.visitStartAnchor=function(e){},p.prototype.visitEndAnchor=function(e){},p.prototype.visitWordBoundary=function(e){},p.prototype.visitNonWordBoundary=function(e){},p.prototype.visitLookahead=function(e){},p.prototype.visitNegativeLookahead=function(e){},p.prototype.visitCharacter=function(e){},p.prototype.visitSet=function(e){},p.prototype.visitGroup=function(e){},p.prototype.visitGroupBackReference=function(e){},p.prototype.visitQuantifier=function(e){},{RegExpParser:e,BaseRegExpVisitor:p,VERSION:`0.5.0`}})}),te=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.clearRegExpParserCache=e.getRegExpAst=void 0;var t=ee(),n={},r=new t.RegExpParser;function i(e){var t=e.toString();if(n.hasOwnProperty(t))return n[t];var i=r.pattern(t);return n[t]=i,i}e.getRegExpAst=i;function a(){n={}}e.clearRegExpParserCache=a}),ne=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.canMatchCharCode=e.firstCharOptimizedIndices=e.getOptimizedStartCodesIndices=e.failedOptimizationPrefixMsg=void 0;var n=ee(),r=I(),i=te(),a=L(),o=`Complement Sets are not supported for first char optimization`;e.failedOptimizationPrefixMsg=`Unable to use "first char" lexer optimizations:
10
- `;function s(t,a){a===void 0&&(a=!1);try{var s=i.getRegExpAst(t);return c(s.value,{},s.flags.ignoreCase)}catch(i){if(i.message===o)a&&r.PRINT_WARNING(``+e.failedOptimizationPrefixMsg+(` Unable to optimize: < `+t.toString()+` >
11
- `)+` Complement Sets cannot be automatically optimized.
12
- This will disable the lexer's first char optimizations.
13
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var l=``;a&&(l=`
14
- This will disable the lexer's first char optimizations.
15
- See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),r.PRINT_ERROR(e.failedOptimizationPrefixMsg+`
16
- `+(` Failed parsing: < `+t.toString()+` >
17
- `)+(` Using the regexp-to-ast library version: `+n.VERSION+`
18
- `)+` Please open an issue at: https://github.com/bd82/regexp-to-ast/issues`+l)}}return[]}e.getOptimizedStartCodesIndices=s;function c(e,t,n){switch(e.type){case`Disjunction`:for(var i=0;i<e.value.length;i++)c(e.value[i],t,n);break;case`Alternative`:for(var s=e.value,i=0;i<s.length;i++){var u=s[i];switch(u.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}var d=u;switch(d.type){case`Character`:l(d.value,t,n);break;case`Set`:if(d.complement===!0)throw Error(o);r.forEach(d.value,function(e){if(typeof e==`number`)l(e,t,n);else{var r=e;if(n===!0)for(var i=r.from;i<=r.to;i++)l(i,t,n);else{for(var i=r.from;i<=r.to&&i<a.minOptimizationVal;i++)l(i,t,n);if(r.to>=a.minOptimizationVal)for(var o=r.from>=a.minOptimizationVal?r.from:a.minOptimizationVal,s=r.to,c=a.charCodeToOptimizedIndex(o),u=a.charCodeToOptimizedIndex(s),d=c;d<=u;d++)t[d]=d}}});break;case`Group`:c(d.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}var p=d.quantifier!==void 0&&d.quantifier.atLeast===0;if(d.type===`Group`&&f(d)===!1||d.type!==`Group`&&p===!1)break}break;default:throw Error(`non exhaustive match!`)}return r.values(t)}e.firstCharOptimizedIndices=c;function l(e,t,n){var r=a.charCodeToOptimizedIndex(e);t[r]=r,n===!0&&u(e,t)}function u(e,t){var n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){var i=a.charCodeToOptimizedIndex(r.charCodeAt(0));t[i]=i}else{var o=n.toLowerCase();if(o!==n){var i=a.charCodeToOptimizedIndex(o.charCodeAt(0));t[i]=i}}}function d(e,t){return r.find(e.value,function(e){if(typeof e==`number`)return r.contains(t,e);var n=e;return r.find(t,function(e){return n.from<=e&&e<=n.to})!==void 0})}function f(e){return e.quantifier&&e.quantifier.atLeast===0?!0:e.value?r.isArray(e.value)?r.every(e.value,f):f(e.value):!1}var p=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.targetCharCodes=t,n.found=!1,n}return n.prototype.visitChildren=function(t){if(this.found!==!0){switch(t.type){case`Lookahead`:this.visitLookahead(t);return;case`NegativeLookahead`:this.visitNegativeLookahead(t);return}e.prototype.visitChildren.call(this,t)}},n.prototype.visitCharacter=function(e){r.contains(this.targetCharCodes,e.value)&&(this.found=!0)},n.prototype.visitSet=function(e){e.complement?d(e,this.targetCharCodes)===void 0&&(this.found=!0):d(e,this.targetCharCodes)!==void 0&&(this.found=!0)},n}(n.BaseRegExpVisitor);function m(e,t){if(t instanceof RegExp){var n=i.getRegExpAst(t),a=new p(e);return a.visit(n),a.found}else return r.find(t,function(t){return r.contains(e,t.charCodeAt(0))})!==void 0}e.canMatchCharCode=m}),L=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.charCodeToOptimizedIndex=e.minOptimizationVal=e.buildLineBreakIssueMessage=e.LineTerminatorOptimizedTester=e.isShortPattern=e.isCustomPattern=e.cloneEmptyGroups=e.performWarningRuntimeChecks=e.performRuntimeChecks=e.addStickyFlag=e.addStartOfInput=e.findUnreachablePatterns=e.findModesThatDoNotExist=e.findInvalidGroupType=e.findDuplicatePatterns=e.findUnsupportedFlags=e.findStartOfInputAnchor=e.findEmptyMatchRegExps=e.findEndOfInputAnchor=e.findInvalidPatterns=e.findMissingPatterns=e.validatePatterns=e.analyzeTokenTypes=e.enableSticky=e.disableSticky=e.SUPPORT_STICKY=e.MODES=e.DEFAULT_MODE=void 0;var n=ee(),r=re(),i=I(),a=ne(),o=te(),s=`PATTERN`;e.DEFAULT_MODE=`defaultMode`,e.MODES=`modes`,e.SUPPORT_STICKY=typeof RegExp(`(?:)`).sticky==`boolean`;function c(){e.SUPPORT_STICKY=!1}e.disableSticky=c;function l(){e.SUPPORT_STICKY=!0}e.enableSticky=l;function u(t,n){n=i.defaults(n,{useSticky:e.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`
19
- `],tracer:function(e,t){return t()}});var o=n.tracer;o(`initCharCodeToOptimizedIndexMap`,function(){V()});var c;o(`Reject Lexer.NA`,function(){c=i.reject(t,function(e){return e[s]===r.Lexer.NA})});var l=!1,u;o(`Transform Patterns`,function(){l=!1,u=i.map(c,function(e){var t=e[s];if(i.isRegExp(t)){var r=t.source;return r.length===1&&r!==`^`&&r!==`$`&&r!==`.`&&!t.ignoreCase?r:r.length===2&&r[0]===`\\`&&!i.contains([`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`],r[1])?r[1]:n.useSticky?O(t):D(t)}else{if(i.isFunction(t))return l=!0,{exec:t};if(i.has(t,`exec`))return l=!0,t;if(typeof t==`string`){if(t.length===1)return t;var a=t.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`),o=new RegExp(a);return n.useSticky?O(o):D(o)}else throw Error(`non exhaustive match`)}})});var d,f,p,m,h;o(`misc mapping`,function(){d=i.map(c,function(e){return e.tokenTypeIdx}),f=i.map(c,function(e){var t=e.GROUP;if(t!==r.Lexer.SKIPPED){if(i.isString(t))return t;if(i.isUndefined(t))return!1;throw Error(`non exhaustive match`)}}),p=i.map(c,function(e){var t=e.LONGER_ALT;if(t)return i.indexOf(c,t)}),m=i.map(c,function(e){return e.PUSH_MODE}),h=i.map(c,function(e){return i.has(e,`POP_MODE`)})});var g;o(`Line Terminator Handling`,function(){var e=L(n.lineTerminatorCharacters);g=i.map(c,function(e){return!1}),n.positionTracking!==`onlyOffset`&&(g=i.map(c,function(t){if(i.has(t,`LINE_BREAKS`))return t.LINE_BREAKS;if(P(t,e)===!1)return a.canMatchCharCode(e,t.PATTERN)}))});var _,v,y,b;o(`Misc Mapping #2`,function(){_=i.map(c,M),v=i.map(u,N),y=i.reduce(c,function(e,t){var n=t.GROUP;return i.isString(n)&&n!==r.Lexer.SKIPPED&&(e[n]=[]),e},{}),b=i.map(u,function(e,t){return{pattern:u[t],longerAlt:p[t],canLineTerminator:g[t],isCustom:_[t],short:v[t],group:f[t],push:m[t],pop:h[t],tokenTypeIdx:d[t],tokenType:c[t]}})});var x=!0,S=[];return n.safeMode||o(`First Char Optimization`,function(){S=i.reduce(c,function(e,t,r){if(typeof t.PATTERN==`string`)R(e,B(t.PATTERN.charCodeAt(0)),b[r]);else if(i.isArray(t.START_CHARS_HINT)){var o;i.forEach(t.START_CHARS_HINT,function(t){var n=B(typeof t==`string`?t.charCodeAt(0):t);o!==n&&(o=n,R(e,n,b[r]))})}else if(i.isRegExp(t.PATTERN))if(t.PATTERN.unicode)x=!1,n.ensureOptimizations&&i.PRINT_ERROR(``+a.failedOptimizationPrefixMsg+(` Unable to analyze < `+t.PATTERN.toString()+` > pattern.
20
- `)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
21
- This will disable the lexer's first char optimizations.
22
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var s=a.getOptimizedStartCodesIndices(t.PATTERN,n.ensureOptimizations);i.isEmpty(s)&&(x=!1),i.forEach(s,function(t){R(e,t,b[r])})}else n.ensureOptimizations&&i.PRINT_ERROR(``+a.failedOptimizationPrefixMsg+(` TokenType: <`+t.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
23
- `)+` This will disable the lexer's first char optimizations.
24
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),x=!1;return e},[])}),o(`ArrayPacking`,function(){S=i.packArray(S)}),{emptyGroups:y,patternIdxToConfig:b,charCodeToPatternIdxToConfig:S,hasCustom:l,canBeOptimized:x}}e.analyzeTokenTypes=u;function d(e,t){var n=[],r=p(e);n=n.concat(r.errors);var i=m(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(f(a)),n=n.concat(S(a)),n=n.concat(C(a,t)),n=n.concat(w(a)),n}e.validatePatterns=d;function f(e){var t=[],n=i.filter(e,function(e){return i.isRegExp(e[s])});return t=t.concat(g(n)),t=t.concat(y(n)),t=t.concat(b(n)),t=t.concat(x(n)),t=t.concat(_(n)),t}function p(e){var t=i.filter(e,function(e){return!i.has(e,s)});return{errors:i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:r.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[e]}}),valid:i.difference(e,t)}}e.findMissingPatterns=p;function m(e){var t=i.filter(e,function(e){var t=e[s];return!i.isRegExp(t)&&!i.isFunction(t)&&!i.has(t,`exec`)&&!i.isString(t)});return{errors:i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:r.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[e]}}),valid:i.difference(e,t)}}e.findInvalidPatterns=m;var h=/[^\\][\$]/;function g(e){var a=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.found=!1,t}return n.prototype.visitEndAnchor=function(e){this.found=!0},n}(n.BaseRegExpVisitor),c=i.filter(e,function(e){var t=e[s];try{var n=o.getRegExpAst(t),r=new a;return r.visit(n),r.found}catch{return h.test(t.source)}});return i.map(c,function(e){return{message:`Unexpected RegExp Anchor Error:
25
- Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
26
- See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:r.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[e]}})}e.findEndOfInputAnchor=g;function _(e){var t=i.filter(e,function(e){return e[s].test(``)});return i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:r.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[e]}})}e.findEmptyMatchRegExps=_;var v=/[^\\[][\^]|^\^/;function y(e){var a=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.found=!1,t}return n.prototype.visitStartAnchor=function(e){this.found=!0},n}(n.BaseRegExpVisitor),c=i.filter(e,function(e){var t=e[s];try{var n=o.getRegExpAst(t),r=new a;return r.visit(n),r.found}catch{return v.test(t.source)}});return i.map(c,function(e){return{message:`Unexpected RegExp Anchor Error:
27
- Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
28
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:r.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[e]}})}e.findStartOfInputAnchor=y;function b(e){var t=i.filter(e,function(e){var t=e[s];return t instanceof RegExp&&(t.multiline||t.global)});return i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:r.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}})}e.findUnsupportedFlags=b;function x(e){var t=[],n=i.map(e,function(n){return i.reduce(e,function(e,a){return n.PATTERN.source===a.PATTERN.source&&!i.contains(t,a)&&a.PATTERN!==r.Lexer.NA&&(t.push(a),e.push(a)),e},[])});n=i.compact(n);var a=i.filter(n,function(e){return e.length>1});return i.map(a,function(e){var t=i.map(e,function(e){return e.name});return{message:`The same RegExp pattern ->`+i.first(e).PATTERN+`<-`+(`has been used in all of the following Token Types: `+t.join(`, `)+` <-`),type:r.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}e.findDuplicatePatterns=x;function S(e){var t=i.filter(e,function(e){if(!i.has(e,`GROUP`))return!1;var t=e.GROUP;return t!==r.Lexer.SKIPPED&&t!==r.Lexer.NA&&!i.isString(t)});return i.map(t,function(e){return{message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:r.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}})}e.findInvalidGroupType=S;function C(e,t){var n=i.filter(e,function(e){return e.PUSH_MODE!==void 0&&!i.contains(t,e.PUSH_MODE)});return i.map(n,function(e){return{message:`Token Type: ->`+e.name+`<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->`+e.PUSH_MODE+`<-which does not exist`,type:r.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}})}e.findModesThatDoNotExist=C;function w(e){var t=[],n=i.reduce(e,function(e,t,n){var a=t.PATTERN;return a===r.Lexer.NA||(i.isString(a)?e.push({str:a,idx:n,tokenType:t}):i.isRegExp(a)&&E(a)&&e.push({str:a.source,idx:n,tokenType:t})),e},[]);return i.forEach(e,function(e,a){i.forEach(n,function(n){var i=n.str,o=n.idx,s=n.tokenType;if(a<o&&T(i,e.PATTERN)){var c=`Token: ->`+s.name+`<- can never be matched.
29
- `+(`Because it appears AFTER the Token Type ->`+e.name+`<-`)+`in the lexer's definition.
30
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:c,type:r.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[e,s]})}})}),t}e.findUnreachablePatterns=w;function T(e,t){if(i.isRegExp(t)){var n=t.exec(e);return n!==null&&n.index===0}else{if(i.isFunction(t))return t(e,0,[],{});if(i.has(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}}function E(e){return i.find([`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`],function(t){return e.source.indexOf(t)!==-1})===void 0}function D(e){var t=e.ignoreCase?`i`:``;return RegExp(`^(?:`+e.source+`)`,t)}e.addStartOfInput=D;function O(e){var t=e.ignoreCase?`iy`:`y`;return RegExp(``+e.source,t)}e.addStickyFlag=O;function k(t,n,a){var o=[];return i.has(t,e.DEFAULT_MODE)||o.push({message:`A MultiMode Lexer cannot be initialized without a <`+e.DEFAULT_MODE+`> property in its definition
31
- `,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),i.has(t,e.MODES)||o.push({message:`A MultiMode Lexer cannot be initialized without a <`+e.MODES+`> property in its definition
32
- `,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),i.has(t,e.MODES)&&i.has(t,e.DEFAULT_MODE)&&!i.has(t.modes,t.defaultMode)&&o.push({message:`A MultiMode Lexer cannot be initialized with a `+e.DEFAULT_MODE+`: <`+t.defaultMode+`>which does not exist
33
- `,type:r.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),i.has(t,e.MODES)&&i.forEach(t.modes,function(e,t){i.forEach(e,function(e,n){i.isUndefined(e)&&o.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:`+(`<`+t+`> at index: <`+n+`>
34
- `),type:r.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),o}e.performRuntimeChecks=k;function A(e,t,n){var o=[],c=!1,l=i.compact(i.flatten(i.mapValues(e.modes,function(e){return e}))),u=i.reject(l,function(e){return e[s]===r.Lexer.NA}),d=L(n);return t&&i.forEach(u,function(e){var t=P(e,d);if(t!==!1){var n={message:F(e,t),type:t.issue,tokenType:e};o.push(n)}else i.has(e,`LINE_BREAKS`)?e.LINE_BREAKS===!0&&(c=!0):a.canMatchCharCode(d,e.PATTERN)&&(c=!0)}),t&&!c&&o.push({message:`Warning: No LINE_BREAKS Found.
35
- This Lexer has been defined to track line and column information,
36
- But none of the Token Types can be identified as matching a line terminator.
37
- See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
38
- for details.`,type:r.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),o}e.performWarningRuntimeChecks=A;function j(e){var t={},n=i.keys(e);return i.forEach(n,function(n){var r=e[n];if(i.isArray(r))t[n]=[];else throw Error(`non exhaustive match`)}),t}e.cloneEmptyGroups=j;function M(e){var t=e.PATTERN;if(i.isRegExp(t))return!1;if(i.isFunction(t)||i.has(t,`exec`))return!0;if(i.isString(t))return!1;throw Error(`non exhaustive match`)}e.isCustomPattern=M;function N(e){return i.isString(e)&&e.length===1?e.charCodeAt(0):!1}e.isShortPattern=N,e.LineTerminatorOptimizedTester={test:function(e){for(var t=e.length,n=this.lastIndex;n<t;n++){var r=e.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return e.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function P(e,t){if(i.has(e,`LINE_BREAKS`))return!1;if(i.isRegExp(e.PATTERN)){try{a.canMatchCharCode(t,e.PATTERN)}catch(e){return{issue:r.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}else{if(i.isString(e.PATTERN))return!1;if(M(e))return{issue:r.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error(`non exhaustive match`)}}function F(e,t){if(t.issue===r.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
39
- `+(` The problem is in the <`+e.name+`> Token Type
40
- `)+(` Root cause: `+t.errMsg+`.
41
- `)+` For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===r.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
42
- `+(` The problem is in the <`+e.name+`> Token Type
43
- `)+` For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}e.buildLineBreakIssueMessage=F;function L(e){return i.map(e,function(e){return i.isString(e)&&e.length>0?e.charCodeAt(0):e})}function R(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}e.minOptimizationVal=256;var z=[];function B(t){return t<e.minOptimizationVal?t:z[t]}e.charCodeToOptimizedIndex=B;function V(){if(i.isEmpty(z)){z=Array(65536);for(var e=0;e<65536;e++)z[e]=e>255?255+~~(e/255):e}}}),R=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.isTokenType=e.hasExtendingTokensTypesMapProperty=e.hasExtendingTokensTypesProperty=e.hasCategoriesProperty=e.hasShortKeyProperty=e.singleAssignCategoriesToksMap=e.assignCategoriesMapProp=e.assignCategoriesTokensProp=e.assignTokenDefaultProps=e.expandCategories=e.augmentTokenTypes=e.tokenIdxToClass=e.tokenShortNameIdx=e.tokenStructuredMatcherNoCategories=e.tokenStructuredMatcher=void 0;var t=I();function n(e,t){var n=e.tokenTypeIdx;return n===t.tokenTypeIdx?!0:t.isParent===!0&&t.categoryMatchesMap[n]===!0}e.tokenStructuredMatcher=n;function r(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}e.tokenStructuredMatcherNoCategories=r,e.tokenShortNameIdx=1,e.tokenIdxToClass={};function i(e){var n=a(e);o(n),c(n),s(n),t.forEach(n,function(e){e.isParent=e.categoryMatches.length>0})}e.augmentTokenTypes=i;function a(e){for(var n=t.cloneArr(e),r=e,i=!0;i;){r=t.compact(t.flatten(t.map(r,function(e){return e.CATEGORIES})));var a=t.difference(r,n);n=n.concat(a),t.isEmpty(a)?i=!1:r=a}return n}e.expandCategories=a;function o(n){t.forEach(n,function(n){u(n)||(e.tokenIdxToClass[e.tokenShortNameIdx]=n,n.tokenTypeIdx=e.tokenShortNameIdx++),d(n)&&!t.isArray(n.CATEGORIES)&&(n.CATEGORIES=[n.CATEGORIES]),d(n)||(n.CATEGORIES=[]),f(n)||(n.categoryMatches=[]),p(n)||(n.categoryMatchesMap={})})}e.assignTokenDefaultProps=o;function s(n){t.forEach(n,function(n){n.categoryMatches=[],t.forEach(n.categoryMatchesMap,function(t,r){n.categoryMatches.push(e.tokenIdxToClass[r].tokenTypeIdx)})})}e.assignCategoriesTokensProp=s;function c(e){t.forEach(e,function(e){l([],e)})}e.assignCategoriesMapProp=c;function l(e,n){t.forEach(e,function(e){n.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.forEach(n.CATEGORIES,function(r){var i=e.concat(n);t.contains(i,r)||l(i,r)})}e.singleAssignCategoriesToksMap=l;function u(e){return t.has(e,`tokenTypeIdx`)}e.hasShortKeyProperty=u;function d(e){return t.has(e,`CATEGORIES`)}e.hasCategoriesProperty=d;function f(e){return t.has(e,`categoryMatches`)}e.hasExtendingTokensTypesProperty=f;function p(e){return t.has(e,`categoryMatchesMap`)}e.hasExtendingTokensTypesMapProperty=p;function m(e){return t.has(e,`tokenTypeIdx`)}e.isTokenType=m}),z=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultLexerErrorProvider=void 0,e.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(e){return`Unable to pop Lexer Mode after encountering Token ->`+e.image+`<- The Mode Stack is empty`},buildUnexpectedCharactersMessage:function(e,t,n,r,i){return`unexpected character: ->`+e.charAt(t)+`<- at offset: `+t+`,`+(` skipped `+n+` characters.`)}}}),re=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Lexer=e.LexerDefinitionErrorType=void 0;var t=L(),n=I(),r=R(),i=z(),a=te();(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`})(e.LexerDefinitionErrorType||={});var o={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
44
- `,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:i.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(o),e.Lexer=function(){function e(e,i){var s=this;if(i===void 0&&(i=o),this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},typeof i==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
45
- a boolean 2nd argument is no longer supported`);this.config=n.merge(o,i);var c=this.config.traceInitPerf;c===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof c==`number`&&(this.traceInitMaxIdent=c,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,function(){var c,l=!0;s.TRACE_INIT(`Lexer Config handling`,function(){if(s.config.lineTerminatorsPattern===o.lineTerminatorsPattern)s.config.lineTerminatorsPattern=t.LineTerminatorOptimizedTester;else if(s.config.lineTerminatorCharacters===o.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
46
- For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(i.safeMode&&i.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);s.trackStartLines=/full|onlyStart/i.test(s.config.positionTracking),s.trackEndLines=/full/i.test(s.config.positionTracking),n.isArray(e)?(c={modes:{}},c.modes[t.DEFAULT_MODE]=n.cloneArr(e),c[t.DEFAULT_MODE]=t.DEFAULT_MODE):(l=!1,c=n.cloneObj(e))}),s.config.skipValidations===!1&&(s.TRACE_INIT(`performRuntimeChecks`,function(){s.lexerDefinitionErrors=s.lexerDefinitionErrors.concat(t.performRuntimeChecks(c,s.trackStartLines,s.config.lineTerminatorCharacters))}),s.TRACE_INIT(`performWarningRuntimeChecks`,function(){s.lexerDefinitionWarning=s.lexerDefinitionWarning.concat(t.performWarningRuntimeChecks(c,s.trackStartLines,s.config.lineTerminatorCharacters))})),c.modes=c.modes?c.modes:{},n.forEach(c.modes,function(e,t){c.modes[t]=n.reject(e,function(e){return n.isUndefined(e)})});var u=n.keys(c.modes);if(n.forEach(c.modes,function(e,a){s.TRACE_INIT(`Mode: <`+a+`> processing`,function(){if(s.modes.push(a),s.config.skipValidations===!1&&s.TRACE_INIT(`validatePatterns`,function(){s.lexerDefinitionErrors=s.lexerDefinitionErrors.concat(t.validatePatterns(e,u))}),n.isEmpty(s.lexerDefinitionErrors)){r.augmentTokenTypes(e);var o;s.TRACE_INIT(`analyzeTokenTypes`,function(){o=t.analyzeTokenTypes(e,{lineTerminatorCharacters:s.config.lineTerminatorCharacters,positionTracking:i.positionTracking,ensureOptimizations:i.ensureOptimizations,safeMode:i.safeMode,tracer:s.TRACE_INIT.bind(s)})}),s.patternIdxToConfig[a]=o.patternIdxToConfig,s.charCodeToPatternIdxToConfig[a]=o.charCodeToPatternIdxToConfig,s.emptyGroups=n.merge(s.emptyGroups,o.emptyGroups),s.hasCustom=o.hasCustom||s.hasCustom,s.canModeBeOptimized[a]=o.canBeOptimized}})}),s.defaultMode=c.defaultMode,!n.isEmpty(s.lexerDefinitionErrors)&&!s.config.deferDefinitionErrorsHandling){var d=n.map(s.lexerDefinitionErrors,function(e){return e.message}).join(`-----------------------
47
- `);throw Error(`Errors detected in definition of Lexer:
48
- `+d)}n.forEach(s.lexerDefinitionWarning,function(e){n.PRINT_WARNING(e.message)}),s.TRACE_INIT(`Choosing sub-methods implementations`,function(){if(t.SUPPORT_STICKY?(s.chopInput=n.IDENTITY,s.match=s.matchWithTest):(s.updateLastIndex=n.NOOP,s.match=s.matchWithExec),l&&(s.handleModes=n.NOOP),s.trackStartLines===!1&&(s.computeNewColumn=n.IDENTITY),s.trackEndLines===!1&&(s.updateTokenEndLineColumnLocation=n.NOOP),/full/i.test(s.config.positionTracking))s.createTokenInstance=s.createFullToken;else if(/onlyStart/i.test(s.config.positionTracking))s.createTokenInstance=s.createStartOnlyToken;else if(/onlyOffset/i.test(s.config.positionTracking))s.createTokenInstance=s.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "`+s.config.positionTracking+`"`);s.hasCustom?(s.addToken=s.addTokenUsingPush,s.handlePayload=s.handlePayloadWithCustom):(s.addToken=s.addTokenUsingMemberAccess,s.handlePayload=s.handlePayloadNoCustom)}),s.TRACE_INIT(`Failed Optimization Warnings`,function(){var e=n.reduce(s.canModeBeOptimized,function(e,t,n){return t===!1&&e.push(n),e},[]);if(i.ensureOptimizations&&!n.isEmpty(e))throw Error(`Lexer Modes: < `+e.join(`, `)+` > cannot be optimized.
49
- Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
50
- Or inspect the console log for details on how to resolve these issues.`)}),s.TRACE_INIT(`clearRegExpParserCache`,function(){a.clearRegExpParserCache()}),s.TRACE_INIT(`toFastProperties`,function(){n.toFastProperties(s)})})}return e.prototype.tokenize=function(e,t){if(t===void 0&&(t=this.defaultMode),!n.isEmpty(this.lexerDefinitionErrors)){var r=n.map(this.lexerDefinitionErrors,function(e){return e.message}).join(`-----------------------
51
- `);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
52
- `+r)}return this.tokenizeInternal(e,t)},e.prototype.tokenizeInternal=function(e,r){var i=this,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y=e,b=y.length,x=0,S=0,C=this.hasCustom?0:Math.floor(e.length/10),w=Array(C),T=[],E=this.trackStartLines?1:void 0,D=this.trackStartLines?1:void 0,O=t.cloneEmptyGroups(this.emptyGroups),k=this.trackStartLines,A=this.config.lineTerminatorsPattern,j=0,M=[],N=[],P=[],F=[];Object.freeze(F);var I=void 0;function ee(){return M}function te(e){var n=t.charCodeToOptimizedIndex(e),r=N[n];return r===void 0?F:r}var ne=function(e){if(P.length===1&&e.tokenType.PUSH_MODE===void 0){var t=i.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);T.push({offset:e.startOffset,line:e.startLine===void 0?void 0:e.startLine,column:e.startColumn===void 0?void 0:e.startColumn,length:e.image.length,message:t})}else{P.pop();var r=n.last(P);M=i.patternIdxToConfig[r],N=i.charCodeToPatternIdxToConfig[r],j=M.length;var a=i.canModeBeOptimized[r]&&i.config.safeMode===!1;I=N&&a?te:ee}};function L(e){P.push(e),N=this.charCodeToPatternIdxToConfig[e],M=this.patternIdxToConfig[e],j=M.length,j=M.length;var t=this.canModeBeOptimized[e]&&this.config.safeMode===!1;I=N&&t?te:ee}L.call(this,r);for(var R;x<b;){l=null;var z=y.charCodeAt(x),re=I(z),B=re.length;for(a=0;a<B;a++){R=re[a];var V=R.pattern;u=null;var H=R.short;if(H===!1?R.isCustom===!0?(v=V.exec(y,x,w,O),v===null?l=null:(l=v[0],v.payload!==void 0&&(u=v.payload))):(this.updateLastIndex(V,x),l=this.match(V,e,x)):z===H&&(l=V),l!==null){if(c=R.longerAlt,c!==void 0){var U=M[c],W=U.pattern;d=null,U.isCustom===!0?(v=W.exec(y,x,w,O),v===null?s=null:(s=v[0],v.payload!==void 0&&(d=v.payload))):(this.updateLastIndex(W,x),s=this.match(W,e,x)),s&&s.length>l.length&&(l=s,u=d,R=U)}break}}if(l!==null){if(f=l.length,p=R.group,p!==void 0&&(m=R.tokenTypeIdx,h=this.createTokenInstance(l,x,m,R.tokenType,E,D,f),this.handlePayload(h,u),p===!1?S=this.addToken(w,S,h):O[p].push(h)),e=this.chopInput(e,f),x+=f,D=this.computeNewColumn(D,f),k===!0&&R.canLineTerminator===!0){var G=0,ie=void 0,ae=void 0;A.lastIndex=0;do ie=A.test(l),ie===!0&&(ae=A.lastIndex-1,G++);while(ie===!0);G!==0&&(E+=G,D=f-ae,this.updateTokenEndLineColumnLocation(h,p,ae,G,E,D,f))}this.handleModes(R,ne,L,h)}else{for(var K=x,oe=E,se=D,q=!1;!q&&x<b;)for(y.charCodeAt(x),e=this.chopInput(e,1),x++,o=0;o<j;o++){var ce=M[o],V=ce.pattern,H=ce.short;if(H===!1?ce.isCustom===!0?q=V.exec(y,x,w,O)!==null:(this.updateLastIndex(V,x),q=V.exec(e)!==null):y.charCodeAt(x)===H&&(q=!0),q===!0)break}g=x-K,_=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(y,K,g,oe,se),T.push({offset:K,line:oe,column:se,length:g,message:_})}}return this.hasCustom||(w.length=S),{tokens:w,groups:O,errors:T}},e.prototype.handleModes=function(e,t,n,r){if(e.pop===!0){var i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)},e.prototype.chopInput=function(e,t){return e.substring(t)},e.prototype.updateLastIndex=function(e,t){e.lastIndex=t},e.prototype.updateTokenEndLineColumnLocation=function(e,t,n,r,i,a,o){var s,c;t!==void 0&&(s=n===o-1,c=s?-1:0,r===1&&s===!0||(e.endLine=i+c,e.endColumn=a-1+-c))},e.prototype.computeNewColumn=function(e,t){return e+t},e.prototype.createTokenInstance=function(){return null},e.prototype.createOffsetOnlyToken=function(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}},e.prototype.createStartOnlyToken=function(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}},e.prototype.createFullToken=function(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}},e.prototype.addToken=function(e,t,n){return 666},e.prototype.addTokenUsingPush=function(e,t,n){return e.push(n),t},e.prototype.addTokenUsingMemberAccess=function(e,t,n){return e[t]=n,t++,t},e.prototype.handlePayload=function(e,t){},e.prototype.handlePayloadNoCustom=function(e,t){},e.prototype.handlePayloadWithCustom=function(e,t){t!==null&&(e.payload=t)},e.prototype.match=function(e,t,n){return null},e.prototype.matchWithTest=function(e,t,n){return e.test(t)===!0?t.substring(n,e.lastIndex):null},e.prototype.matchWithExec=function(e,t){var n=e.exec(t);return n===null?n:n[0]},e.prototype.TRACE_INIT=function(e,t){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+`--> <`+e+`>`);var i=n.timer(t),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+`<-- <`+e+`> time: `+a+`ms`),this.traceInitIndent--,o}else return t()},e.SKIPPED=`This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.`,e.NA=/NOT_APPLICABLE/,e}()}),B=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.tokenMatcher=e.createTokenInstance=e.EOF=e.createToken=e.hasTokenLabel=e.tokenName=e.tokenLabel=void 0;var t=I(),n=re(),r=R();function i(e){return o(e)?e.LABEL:e.name}e.tokenLabel=i;function a(e){return e.name}e.tokenName=a;function o(e){return t.isString(e.LABEL)&&e.LABEL!==``}e.hasTokenLabel=o;var s=`parent`,c=`categories`,l=`label`,u=`group`,d=`push_mode`,f=`pop_mode`,p=`longer_alt`,m=`line_breaks`,h=`start_chars_hint`;function g(e){return _(e)}e.createToken=g;function _(e){var n=e.pattern,i={};if(i.name=e.name,t.isUndefined(n)||(i.PATTERN=n),t.has(e,s))throw`The parent property is no longer supported.
53
- See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return t.has(e,c)&&(i.CATEGORIES=e[c]),r.augmentTokenTypes([i]),t.has(e,l)&&(i.LABEL=e[l]),t.has(e,u)&&(i.GROUP=e[u]),t.has(e,f)&&(i.POP_MODE=e[f]),t.has(e,d)&&(i.PUSH_MODE=e[d]),t.has(e,p)&&(i.LONGER_ALT=e[p]),t.has(e,m)&&(i.LINE_BREAKS=e[m]),t.has(e,h)&&(i.START_CHARS_HINT=e[h]),i}e.EOF=g({name:`EOF`,pattern:n.Lexer.NA}),r.augmentTokenTypes([e.EOF]);function v(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}e.createTokenInstance=v;function y(e,t){return r.tokenStructuredMatcher(e,t)}e.tokenMatcher=y}),V=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.serializeProduction=e.serializeGrammar=e.Terminal=e.Alternation=e.RepetitionWithSeparator=e.Repetition=e.RepetitionMandatoryWithSeparator=e.RepetitionMandatory=e.Option=e.Alternative=e.Rule=e.NonTerminal=e.AbstractProduction=void 0;var n=I(),r=B(),i=function(){function e(e){this._definition=e}return Object.defineProperty(e.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),e.prototype.accept=function(e){e.visit(this),n.forEach(this.definition,function(t){t.accept(e)})},e}();e.AbstractProduction=i;var a=function(e){t(r,e);function r(t){var r=e.call(this,[])||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return Object.defineProperty(r.prototype,"definition",{get:function(){return this.referencedRule===void 0?[]:this.referencedRule.definition},set:function(e){},enumerable:!1,configurable:!0}),r.prototype.accept=function(e){e.visit(this)},r}(i);e.NonTerminal=a;var o=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.orgText=``,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Rule=o;var s=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.ignoreAmbiguities=!1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Alternative=s;var c=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Option=c;var l=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.RepetitionMandatory=l;var u=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.RepetitionMandatoryWithSeparator=u;var d=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.Repetition=d;var f=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return r}(i);e.RepetitionWithSeparator=f;var p=function(e){t(r,e);function r(t){var r=e.call(this,t.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,n.assign(r,n.pick(t,function(e){return e!==void 0})),r}return Object.defineProperty(r.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),r}(i);e.Alternation=p;var m=function(){function e(e){this.idx=1,n.assign(this,n.pick(e,function(e){return e!==void 0}))}return e.prototype.accept=function(e){e.visit(this)},e}();e.Terminal=m;function h(e){return n.map(e,g)}e.serializeGrammar=h;function g(e){function t(e){return n.map(e,g)}if(e instanceof a)return{type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};if(e instanceof s)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof c)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof l)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof u)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:g(new m({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof f)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:g(new m({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof d)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof p)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof m){var i={type:`Terminal`,name:e.terminalType.name,label:r.tokenLabel(e.terminalType),idx:e.idx},h=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(i.pattern=n.isRegExp(h)?h.source:h),i}else{if(e instanceof o)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`)}}e.serializeProduction=g}),H=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RestWalker=void 0;var t=I(),n=V();e.RestWalker=function(){function e(){}return e.prototype.walk=function(e,r){var i=this;r===void 0&&(r=[]),t.forEach(e.definition,function(a,o){var s=t.drop(e.definition,o+1);if(a instanceof n.NonTerminal)i.walkProdRef(a,s,r);else if(a instanceof n.Terminal)i.walkTerminal(a,s,r);else if(a instanceof n.Alternative)i.walkFlat(a,s,r);else if(a instanceof n.Option)i.walkOption(a,s,r);else if(a instanceof n.RepetitionMandatory)i.walkAtLeastOne(a,s,r);else if(a instanceof n.RepetitionMandatoryWithSeparator)i.walkAtLeastOneSep(a,s,r);else if(a instanceof n.RepetitionWithSeparator)i.walkManySep(a,s,r);else if(a instanceof n.Repetition)i.walkMany(a,s,r);else if(a instanceof n.Alternation)i.walkOr(a,s,r);else throw Error(`non exhaustive match`)})},e.prototype.walkTerminal=function(e,t,n){},e.prototype.walkProdRef=function(e,t,n){},e.prototype.walkFlat=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkOption=function(e,t,n){var r=t.concat(n);this.walk(e,r)},e.prototype.walkAtLeastOne=function(e,t,r){var i=[new n.Option({definition:e.definition})].concat(t,r);this.walk(e,i)},e.prototype.walkAtLeastOneSep=function(e,t,n){var i=r(e,t,n);this.walk(e,i)},e.prototype.walkMany=function(e,t,r){var i=[new n.Option({definition:e.definition})].concat(t,r);this.walk(e,i)},e.prototype.walkManySep=function(e,t,n){var i=r(e,t,n);this.walk(e,i)},e.prototype.walkOr=function(e,r,i){var a=this,o=r.concat(i);t.forEach(e.definition,function(e){var t=new n.Alternative({definition:[e]});a.walk(t,o)})},e}();function r(e,t,r){return[new n.Option({definition:[new n.Terminal({terminalType:e.separator})].concat(e.definition)})].concat(t,r)}}),U=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GAstVisitor=void 0;var t=V();e.GAstVisitor=function(){function e(){}return e.prototype.visit=function(e){var n=e;switch(n.constructor){case t.NonTerminal:return this.visitNonTerminal(n);case t.Alternative:return this.visitAlternative(n);case t.Option:return this.visitOption(n);case t.RepetitionMandatory:return this.visitRepetitionMandatory(n);case t.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(n);case t.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(n);case t.Repetition:return this.visitRepetition(n);case t.Alternation:return this.visitAlternation(n);case t.Terminal:return this.visitTerminal(n);case t.Rule:return this.visitRule(n);default:throw Error(`non exhaustive match`)}},e.prototype.visitNonTerminal=function(e){},e.prototype.visitAlternative=function(e){},e.prototype.visitOption=function(e){},e.prototype.visitRepetition=function(e){},e.prototype.visitRepetitionMandatory=function(e){},e.prototype.visitRepetitionMandatoryWithSeparator=function(e){},e.prototype.visitRepetitionWithSeparator=function(e){},e.prototype.visitAlternation=function(e){},e.prototype.visitTerminal=function(e){},e.prototype.visitRule=function(e){},e}()}),W=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.collectMethods=e.DslMethodsCollectorVisitor=e.getProductionDslName=e.isBranchingProd=e.isOptionalProd=e.isSequenceProd=void 0;var n=I(),r=V(),i=U();function a(e){return e instanceof r.Alternative||e instanceof r.Option||e instanceof r.Repetition||e instanceof r.RepetitionMandatory||e instanceof r.RepetitionMandatoryWithSeparator||e instanceof r.RepetitionWithSeparator||e instanceof r.Terminal||e instanceof r.Rule}e.isSequenceProd=a;function o(e,t){return t===void 0&&(t=[]),e instanceof r.Option||e instanceof r.Repetition||e instanceof r.RepetitionWithSeparator?!0:e instanceof r.Alternation?n.some(e.definition,function(e){return o(e,t)}):e instanceof r.NonTerminal&&n.contains(t,e)?!1:e instanceof r.AbstractProduction?(e instanceof r.NonTerminal&&t.push(e),n.every(e.definition,function(e){return o(e,t)})):!1}e.isOptionalProd=o;function s(e){return e instanceof r.Alternation}e.isBranchingProd=s;function c(e){if(e instanceof r.NonTerminal)return`SUBRULE`;if(e instanceof r.Option)return`OPTION`;if(e instanceof r.Alternation)return`OR`;if(e instanceof r.RepetitionMandatory)return`AT_LEAST_ONE`;if(e instanceof r.RepetitionMandatoryWithSeparator)return`AT_LEAST_ONE_SEP`;if(e instanceof r.RepetitionWithSeparator)return`MANY_SEP`;if(e instanceof r.Repetition)return`MANY`;if(e instanceof r.Terminal)return`CONSUME`;throw Error(`non exhaustive match`)}e.getProductionDslName=c;var l=function(e){t(r,e);function r(){var t=e!==null&&e.apply(this,arguments)||this;return t.separator=`-`,t.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},t}return r.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},r.prototype.visitTerminal=function(e){var t=e.terminalType.name+this.separator+`Terminal`;n.has(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},r.prototype.visitNonTerminal=function(e){var t=e.nonTerminalName+this.separator+`Terminal`;n.has(this.dslMethods,t)||(this.dslMethods[t]=[]),this.dslMethods[t].push(e)},r.prototype.visitOption=function(e){this.dslMethods.option.push(e)},r.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},r.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},r.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},r.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},r.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},r}(i.GAstVisitor);e.DslMethodsCollectorVisitor=l;var u=new l;function d(e){u.reset(),e.accept(u);var t=u.dslMethods;return u.reset(),t}e.collectMethods=d}),G=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.firstForTerminal=e.firstForBranching=e.firstForSequence=e.first=void 0;var t=I(),n=V(),r=W();function i(e){if(e instanceof n.NonTerminal)return i(e.referencedRule);if(e instanceof n.Terminal)return s(e);if(r.isSequenceProd(e))return a(e);if(r.isBranchingProd(e))return o(e);throw Error(`non exhaustive match`)}e.first=i;function a(e){for(var n=[],a=e.definition,o=0,s=a.length>o,c,l=!0;s&&l;)c=a[o],l=r.isOptionalProd(c),n=n.concat(i(c)),o+=1,s=a.length>o;return t.uniq(n)}e.firstForSequence=a;function o(e){var n=t.map(e.definition,function(e){return i(e)});return t.uniq(t.flatten(n))}e.firstForBranching=o;function s(e){return[e.terminalType]}e.firstForTerminal=s}),ie=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.IN=void 0,e.IN=`_~IN~_`}),ae=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.buildInProdFollowPrefix=e.buildBetweenProdsFollowPrefix=e.computeAllProdsFollows=e.ResyncFollowsWalker=void 0;var n=H(),r=G(),i=I(),a=ie(),o=V(),s=function(e){t(n,e);function n(t){var n=e.call(this)||this;return n.topProd=t,n.follows={},n}return n.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},n.prototype.walkTerminal=function(e,t,n){},n.prototype.walkProdRef=function(e,t,n){var i=l(e.referencedRule,e.idx)+this.topProd.name,a=t.concat(n),s=new o.Alternative({definition:a}),c=r.first(s);this.follows[i]=c},n}(n.RestWalker);e.ResyncFollowsWalker=s;function c(e){var t={};return i.forEach(e,function(e){var n=new s(e).startWalking();i.assign(t,n)}),t}e.computeAllProdsFollows=c;function l(e,t){return e.name+t+a.IN}e.buildBetweenProdsFollowPrefix=l;function u(e){return e.terminalType.name+e.idx+a.IN}e.buildInProdFollowPrefix=u}),K=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defaultGrammarValidatorErrorProvider=e.defaultGrammarResolverErrorProvider=e.defaultParserErrorProvider=void 0;var t=B(),n=I(),r=I(),i=V(),a=W();e.defaultParserErrorProvider={buildMismatchTokenMessage:function(e){var n=e.expected,r=e.actual;return e.previous,e.ruleName,`Expecting `+(t.hasTokenLabel(n)?`--> `+t.tokenLabel(n)+` <--`:`token of type --> `+n.name+` <--`)+` but found --> '`+r.image+`' <--`},buildNotAllInputParsedMessage:function(e){var t=e.firstRedundant;return e.ruleName,`Redundant input, expecting EOF but found: `+t.image},buildNoViableAltMessage:function(e){var n=e.expectedPathsPerAlt,i=e.actual;e.previous;var a=e.customUserDescription;e.ruleName;var o=`Expecting: `,s=`
54
- but found: '`+r.first(i).image+`'`;if(a)return o+a+s;var c=r.reduce(n,function(e,t){return e.concat(t)},[]),l=r.map(c,function(e){return`[`+r.map(e,function(e){return t.tokenLabel(e)}).join(`, `)+`]`});return o+(`one of these possible Token sequences:
55
- `+r.map(l,function(e,t){return` `+(t+1)+`. `+e}).join(`
56
- `))+s},buildEarlyExitMessage:function(e){var n=e.expectedIterationPaths,i=e.actual,a=e.customUserDescription;e.ruleName;var o=`Expecting: `,s=`
57
- but found: '`+r.first(i).image+`'`;return a?o+a+s:o+(`expecting at least one iteration which starts with one of these possible Token sequences::
58
- `+(`<`+r.map(n,function(e){return`[`+r.map(e,function(e){return t.tokenLabel(e)}).join(`,`)+`]`}).join(` ,`)+`>`))+s}},Object.freeze(e.defaultParserErrorProvider),e.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(e,t){return`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-
59
- inside top level rule: ->`+e.name+`<-`}},e.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(e,t){function n(e){return e instanceof i.Terminal?e.terminalType.name:e instanceof i.NonTerminal?e.nonTerminalName:``}var o=e.name,s=r.first(t),c=s.idx,l=a.getProductionDslName(s),u=n(s),d=c>0,f=`->`+l+(d?c:``)+`<- `+(u?`with argument: ->`+u+`<-`:``)+`
60
- appears more than once (`+t.length+` times) in the top level rule: ->`+o+`<-.
61
- For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
62
- `;return f=f.replace(/[ \t]+/g,` `),f=f.replace(/\s\s+/g,`
63
- `),f},buildNamespaceConflictError:function(e){return`Namespace conflict found in grammar.
64
- `+(`The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <`+e.name+`>.
65
- `)+`To resolve this make sure each Terminal and Non-Terminal names are unique
66
- This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
67
- and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError:function(e){var n=r.map(e.prefixPath,function(e){return t.tokenLabel(e)}).join(`, `),i=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <`+e.ambiguityIndices.join(` ,`)+`> due to common lookahead prefix
68
- `+(`in <OR`+i+`> inside <`+e.topLevelRule.name+`> Rule,
69
- `)+(`<`+n+`> may appears as a prefix path in all these alternatives.
70
- `)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
71
- For Further details.`},buildAlternationAmbiguityError:function(e){var n=r.map(e.prefixPath,function(e){return t.tokenLabel(e)}).join(`, `),i=e.alternation.idx===0?``:e.alternation.idx,a=`Ambiguous Alternatives Detected: <`+e.ambiguityIndices.join(` ,`)+`> in <OR`+i+`>`+(` inside <`+e.topLevelRule.name+`> Rule,
72
- `)+(`<`+n+`> may appears as a prefix path in all these alternatives.
73
- `);return a+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
74
- For Further details.`,a},buildEmptyRepetitionError:function(e){var t=a.getProductionDslName(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <`+t+`> within Rule <`+e.topLevelRule.name+`> can never consume any tokens.
75
- This could lead to an infinite loop.`},buildTokenNameError:function(e){return`deprecated`},buildEmptyAlternationError:function(e){return`Ambiguous empty alternative: <`+(e.emptyChoiceIdx+1)+`>`+(` in <OR`+e.alternation.idx+`> inside <`+e.topLevelRule.name+`> Rule.
76
- `)+`Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError:function(e){return`An Alternation cannot have more than 256 alternatives:
77
- `+(`<OR`+e.alternation.idx+`> inside <`+e.topLevelRule.name+`> Rule.
78
- has `+(e.alternation.definition.length+1)+` alternatives.`)},buildLeftRecursionError:function(e){var t=e.topLevelRule.name,r=n.map(e.leftRecursionPath,function(e){return e.name}),i=t+` --> `+r.concat([t]).join(` --> `);return`Left Recursion found in grammar.
79
- `+(`rule: <`+t+`> can be invoked from itself (directly or indirectly)
80
- `)+(`without consuming any Tokens. The grammar path that causes this is:
81
- `+i+`
82
- `)+` To fix this refactor your grammar to remove the left recursion.
83
- see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`},buildInvalidRuleNameError:function(e){return`deprecated`},buildDuplicateRuleNameError:function(e){return`Duplicate definition, rule: ->`+(e.topLevelRule instanceof i.Rule?e.topLevelRule.name:e.topLevelRule)+`<- is already defined in the grammar: ->`+e.grammarName+`<-`}}}),oe=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.GastRefResolverVisitor=e.resolveGrammar=void 0;var n=Z(),r=I(),i=U();function a(e,t){var n=new o(e,t);return n.resolveRefs(),n.errors}e.resolveGrammar=a;var o=function(e){t(i,e);function i(t,n){var r=e.call(this)||this;return r.nameToTopRule=t,r.errMsgProvider=n,r.errors=[],r}return i.prototype.resolveRefs=function(){var e=this;r.forEach(r.values(this.nameToTopRule),function(t){e.currTopLevel=t,t.accept(e)})},i.prototype.visitNonTerminal=function(e){var t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{var r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:n.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},i}(i.GAstVisitor);e.GastRefResolverVisitor=o}),se=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.nextPossibleTokensAfter=e.possiblePathsFrom=e.NextTerminalAfterAtLeastOneSepWalker=e.NextTerminalAfterAtLeastOneWalker=e.NextTerminalAfterManySepWalker=e.NextTerminalAfterManyWalker=e.AbstractNextTerminalAfterProductionWalker=e.NextAfterTokenWalker=e.AbstractNextPossibleTokensWalker=void 0;var n=H(),r=I(),i=G(),a=V(),o=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.topProd=t,r.path=n,r.possibleTokTypes=[],r.nextProductionName=``,r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return n.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error(`The path does not start with the walker's top Rule!`);return this.ruleStack=r.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=r.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},n.prototype.walk=function(t,n){n===void 0&&(n=[]),this.found||e.prototype.walk.call(this,t,n)},n.prototype.walkProdRef=function(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}},n.prototype.updateExpectedNext=function(){r.isEmpty(this.ruleStack)?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},n}(n.RestWalker);e.AbstractNextPossibleTokensWalker=o,e.NextAfterTokenWalker=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.path=n,r.nextTerminalName=``,r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return n.prototype.walkTerminal=function(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var r=t.concat(n),o=new a.Alternative({definition:r});this.possibleTokTypes=i.first(o),this.found=!0}},n}(o);var s=function(e){t(n,e);function n(t,n){var r=e.call(this)||this;return r.topRule=t,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return n.prototype.startWalking=function(){return this.walk(this.topRule),this.result},n}(n.RestWalker);e.AbstractNextTerminalAfterProductionWalker=s,e.NextTerminalAfterManyWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkMany=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkMany.call(this,t,n,i)},n}(s),e.NextTerminalAfterManySepWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkManySep=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkManySep.call(this,t,n,i)},n}(s),e.NextTerminalAfterAtLeastOneWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkAtLeastOne=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOne.call(this,t,n,i)},n}(s),e.NextTerminalAfterAtLeastOneSepWalker=function(e){t(n,e);function n(){return e!==null&&e.apply(this,arguments)||this}return n.prototype.walkAtLeastOneSep=function(t,n,i){if(t.idx===this.occurrence){var o=r.first(n.concat(i));this.result.isEndOfRule=o===void 0,o instanceof a.Terminal&&(this.result.token=o.terminalType,this.result.occurrence=o.idx)}else e.prototype.walkAtLeastOneSep.call(this,t,n,i)},n}(s);function c(e,t,n){n===void 0&&(n=[]),n=r.cloneArr(n);var i=[],o=0;function s(t){return t.concat(r.drop(e,o+1))}function l(e){var r=c(s(e),t,n);return i.concat(r)}for(;n.length<t&&o<e.length;){var u=e[o];if(u instanceof a.Alternative||u instanceof a.NonTerminal)return l(u.definition);if(u instanceof a.Option)i=l(u.definition);else if(u instanceof a.RepetitionMandatory){var d=u.definition.concat([new a.Repetition({definition:u.definition})]);return l(d)}else if(u instanceof a.RepetitionMandatoryWithSeparator){var d=[new a.Alternative({definition:u.definition}),new a.Repetition({definition:[new a.Terminal({terminalType:u.separator})].concat(u.definition)})];return l(d)}else if(u instanceof a.RepetitionWithSeparator){var d=u.definition.concat([new a.Repetition({definition:[new a.Terminal({terminalType:u.separator})].concat(u.definition)})]);i=l(d)}else if(u instanceof a.Repetition){var d=u.definition.concat([new a.Repetition({definition:u.definition})]);i=l(d)}else{if(u instanceof a.Alternation)return r.forEach(u.definition,function(e){r.isEmpty(e.definition)===!1&&(i=l(e.definition))}),i;if(u instanceof a.Terminal)n.push(u.terminalType);else throw Error(`non exhaustive match`)}o++}return i.push({partialPath:n,suffixDef:r.drop(e,o)}),i}e.possiblePathsFrom=c;function l(e,t,n,i){var o=`EXIT_NONE_TERMINAL`,s=[o],c=`EXIT_ALTERNATIVE`,l=!1,d=t.length,f=d-i-1,p=[],m=[];for(m.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});!r.isEmpty(m);){var h=m.pop();if(h===c){l&&r.last(m).idx<=f&&m.pop();continue}var g=h.def,_=h.idx,v=h.ruleStack,y=h.occurrenceStack;if(!r.isEmpty(g)){var b=g[0];if(b===o){var x={idx:_,def:r.drop(g),ruleStack:r.dropRight(v),occurrenceStack:r.dropRight(y)};m.push(x)}else if(b instanceof a.Terminal)if(_<d-1){var S=_+1,C=t[S];if(n(C,b.terminalType)){var x={idx:S,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(x)}}else if(_===d-1)p.push({nextTokenType:b.terminalType,nextTokenOccurrence:b.idx,ruleStack:v,occurrenceStack:y}),l=!0;else throw Error(`non exhaustive match`);else if(b instanceof a.NonTerminal){var w=r.cloneArr(v);w.push(b.nonTerminalName);var T=r.cloneArr(y);T.push(b.idx);var x={idx:_,def:b.definition.concat(s,r.drop(g)),ruleStack:w,occurrenceStack:T};m.push(x)}else if(b instanceof a.Option){var E={idx:_,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(E),m.push(c);var D={idx:_,def:b.definition.concat(r.drop(g)),ruleStack:v,occurrenceStack:y};m.push(D)}else if(b instanceof a.RepetitionMandatory){var O=new a.Repetition({definition:b.definition,idx:b.idx}),k=b.definition.concat([O],r.drop(g)),x={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(x)}else if(b instanceof a.RepetitionMandatoryWithSeparator){var A=new a.Terminal({terminalType:b.separator}),O=new a.Repetition({definition:[A].concat(b.definition),idx:b.idx}),k=b.definition.concat([O],r.drop(g)),x={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(x)}else if(b instanceof a.RepetitionWithSeparator){var E={idx:_,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(E),m.push(c);var A=new a.Terminal({terminalType:b.separator}),j=new a.Repetition({definition:[A].concat(b.definition),idx:b.idx}),k=b.definition.concat([j],r.drop(g)),D={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(D)}else if(b instanceof a.Repetition){var E={idx:_,def:r.drop(g),ruleStack:v,occurrenceStack:y};m.push(E),m.push(c);var j=new a.Repetition({definition:b.definition,idx:b.idx}),k=b.definition.concat([j],r.drop(g)),D={idx:_,def:k,ruleStack:v,occurrenceStack:y};m.push(D)}else if(b instanceof a.Alternation)for(var M=b.definition.length-1;M>=0;M--){var N={idx:_,def:b.definition[M].definition.concat(r.drop(g)),ruleStack:v,occurrenceStack:y};m.push(N),m.push(c)}else if(b instanceof a.Alternative)m.push({idx:_,def:b.definition.concat(r.drop(g)),ruleStack:v,occurrenceStack:y});else if(b instanceof a.Rule)m.push(u(b,_,v,y));else throw Error(`non exhaustive match`)}}return p}e.nextPossibleTokensAfter=l;function u(e,t,n,i){var a=r.cloneArr(n);a.push(e.name);var o=r.cloneArr(i);return o.push(1),{idx:t,def:e.definition,ruleStack:a,occurrenceStack:o}}}),q=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.areTokenCategoriesNotUsed=e.isStrictPrefixOfPath=e.containsPath=e.getLookaheadPathsForOptionalProd=e.getLookaheadPathsForOr=e.lookAheadSequenceFromAlternatives=e.buildSingleAlternativeLookaheadFunction=e.buildAlternativesLookAheadFunc=e.buildLookaheadFuncForOptionalProd=e.buildLookaheadFuncForOr=e.getProdType=e.PROD_TYPE=void 0;var n=I(),r=se(),i=H(),a=R(),o=V(),s=U(),c;(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(c=e.PROD_TYPE||={});function l(e){if(e instanceof o.Option)return c.OPTION;if(e instanceof o.Repetition)return c.REPETITION;if(e instanceof o.RepetitionMandatory)return c.REPETITION_MANDATORY;if(e instanceof o.RepetitionMandatoryWithSeparator)return c.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof o.RepetitionWithSeparator)return c.REPETITION_WITH_SEPARATOR;if(e instanceof o.Alternation)return c.ALTERNATION;throw Error(`non exhaustive match`)}e.getProdType=l;function u(e,t,n,r,i,o){var s=b(e,t,n);return o(s,r,w(s)?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher,i)}e.buildLookaheadFuncForOr=u;function d(e,t,n,r,i,o){var s=x(e,t,i,n),c=w(s)?a.tokenStructuredMatcherNoCategories:a.tokenStructuredMatcher;return o(s[0],c,r)}e.buildLookaheadFuncForOptionalProd=d;function f(e,t,r,i){var a=e.length,o=n.every(e,function(e){return n.every(e,function(e){return e.length===1})});if(t)return function(t){for(var i=n.map(t,function(e){return e.GATE}),o=0;o<a;o++){var s=e[o],c=s.length,l=i[o];if(!(l!==void 0&&l.call(this)===!1))e:for(var u=0;u<c;u++){for(var d=s[u],f=d.length,p=0;p<f;p++)if(r(this.LA(p+1),d[p])===!1)continue e;return o}}};if(o&&!i){var s=n.map(e,function(e){return n.flatten(e)}),c=n.reduce(s,function(e,t,r){return n.forEach(t,function(t){n.has(e,t.tokenTypeIdx)||(e[t.tokenTypeIdx]=r),n.forEach(t.categoryMatches,function(t){n.has(e,t)||(e[t]=r)})}),e},[]);return function(){return c[this.LA(1).tokenTypeIdx]}}else return function(){for(var t=0;t<a;t++){var n=e[t],i=n.length;e:for(var o=0;o<i;o++){for(var s=n[o],c=s.length,l=0;l<c;l++)if(r(this.LA(l+1),s[l])===!1)continue e;return t}}}}e.buildAlternativesLookAheadFunc=f;function p(e,t,r){var i=n.every(e,function(e){return e.length===1}),a=e.length;if(i&&!r){var o=n.flatten(e);if(o.length===1&&n.isEmpty(o[0].categoryMatches)){var s=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}else{var c=n.reduce(o,function(e,t,r){return e[t.tokenTypeIdx]=!0,n.forEach(t.categoryMatches,function(t){e[t]=!0}),e},[]);return function(){return c[this.LA(1).tokenTypeIdx]===!0}}}else return function(){e:for(var n=0;n<a;n++){for(var r=e[n],i=r.length,o=0;o<i;o++)if(t(this.LA(o+1),r[o])===!1)continue e;return!0}return!1}}e.buildSingleAlternativeLookaheadFunction=p;var m=function(e){t(n,e);function n(t,n,r){var i=e.call(this)||this;return i.topProd=t,i.targetOccurrence=n,i.targetProdType=r,i}return n.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},n.prototype.checkIsTarget=function(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t?(this.restDef=n.concat(r),!0):!1},n.prototype.walkOption=function(t,n,r){this.checkIsTarget(t,c.OPTION,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkAtLeastOne=function(t,n,r){this.checkIsTarget(t,c.REPETITION_MANDATORY,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkAtLeastOneSep=function(t,n,r){this.checkIsTarget(t,c.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkMany=function(t,n,r){this.checkIsTarget(t,c.REPETITION,n,r)||e.prototype.walkOption.call(this,t,n,r)},n.prototype.walkManySep=function(t,n,r){this.checkIsTarget(t,c.REPETITION_WITH_SEPARATOR,n,r)||e.prototype.walkOption.call(this,t,n,r)},n}(i.RestWalker),h=function(e){t(n,e);function n(t,n,r){var i=e.call(this)||this;return i.targetOccurrence=t,i.targetProdType=n,i.targetRef=r,i.result=[],i}return n.prototype.checkIsTarget=function(e,t){e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)},n.prototype.visitOption=function(e){this.checkIsTarget(e,c.OPTION)},n.prototype.visitRepetition=function(e){this.checkIsTarget(e,c.REPETITION)},n.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,c.REPETITION_MANDATORY)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,c.REPETITION_MANDATORY_WITH_SEPARATOR)},n.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,c.REPETITION_WITH_SEPARATOR)},n.prototype.visitAlternation=function(e){this.checkIsTarget(e,c.ALTERNATION)},n}(s.GAstVisitor);function g(e){for(var t=Array(e),n=0;n<e;n++)t[n]=[];return t}function _(e){for(var t=[``],n=0;n<e.length;n++){for(var r=e[n],i=[],a=0;a<t.length;a++){var o=t[a];i.push(o+`_`+r.tokenTypeIdx);for(var s=0;s<r.categoryMatches.length;s++){var c=`_`+r.categoryMatches[s];i.push(o+c)}}t=i}return t}function v(e,t,n){for(var r=0;r<e.length;r++)if(r!==n){for(var i=e[r],a=0;a<t.length;a++)if(i[t[a]]===!0)return!1}return!0}function y(e,t){for(var i=n.map(e,function(e){return r.possiblePathsFrom([e],1)}),a=g(i.length),o=n.map(i,function(e){var t={};return n.forEach(e,function(e){var r=_(e.partialPath);n.forEach(r,function(e){t[e]=!0})}),t}),s=i,c=1;c<=t;c++){var l=s;s=g(l.length);for(var u=function(e){for(var i=l[e],u=0;u<i.length;u++){var d=i[u].partialPath,f=i[u].suffixDef,p=_(d);if(v(o,p,e)||n.isEmpty(f)||d.length===t){var m=a[e];if(S(m,d)===!1){m.push(d);for(var h=0;h<p.length;h++){var g=p[h];o[e][g]=!0}}}else{var y=r.possiblePathsFrom(f,c+1,d);s[e]=s[e].concat(y),n.forEach(y,function(t){var r=_(t.partialPath);n.forEach(r,function(t){o[e][t]=!0})})}}},d=0;d<l.length;d++)u(d)}return a}e.lookAheadSequenceFromAlternatives=y;function b(e,t,n,r){var i=new h(e,c.ALTERNATION,r);return t.accept(i),y(i.result,n)}e.getLookaheadPathsForOr=b;function x(e,t,n,r){var i=new h(e,n);t.accept(i);var a=i.result,s=new m(t,e,n).startWalking();return y([new o.Alternative({definition:a}),new o.Alternative({definition:s})],r)}e.getLookaheadPathsForOptionalProd=x;function S(e,t){e:for(var n=0;n<e.length;n++){var r=e[n];if(r.length===t.length){for(var i=0;i<r.length;i++){var a=t[i],o=r[i];if(!(a===o||o.categoryMatchesMap[a.tokenTypeIdx]!==void 0))continue e}return!0}}return!1}e.containsPath=S;function C(e,t){return e.length<t.length&&n.every(e,function(e,n){var r=t[n];return e===r||r.categoryMatchesMap[e.tokenTypeIdx]})}e.isStrictPrefixOfPath=C;function w(e){return n.every(e,function(e){return n.every(e,function(e){return n.every(e,function(e){return n.isEmpty(e.categoryMatches)})})})}e.areTokenCategoriesNotUsed=w}),ce=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.checkPrefixAlternativesAmbiguities=e.validateSomeNonEmptyLookaheadPath=e.validateTooManyAlts=e.RepetionCollector=e.validateAmbiguousAlternationAlternatives=e.validateEmptyOrAlternative=e.getFirstNoneTerminal=e.validateNoLeftRecursion=e.validateRuleIsOverridden=e.validateRuleDoesNotAlreadyExist=e.OccurrenceValidationCollector=e.identifyProductionForDuplicates=e.validateGrammar=void 0;var n=I(),r=I(),i=Z(),a=W(),o=q(),s=se(),c=V(),l=U();function u(e,t,i,a,o){var s=n.map(e,function(e){return d(e,a)}),c=n.map(e,function(e){return _(e,e,a)}),l=[],u=[],f=[];r.every(c,r.isEmpty)&&(l=r.map(e,function(e){return b(e,a)}),u=r.map(e,function(e){return x(e,t,a)}),f=w(e,t,a));var p=D(e,i,a),m=r.map(e,function(e){return C(e,a)}),g=r.map(e,function(t){return h(t,e,o,a)});return n.flatten(s.concat(f,c,l,u,p,m,g))}e.validateGrammar=u;function d(e,t){var r=new m;e.accept(r);var o=r.allProductions,s=n.groupBy(o,f),c=n.pick(s,function(e){return e.length>1});return n.map(n.values(c),function(r){var o=n.first(r),s=t.buildDuplicateFoundError(e,r),c=a.getProductionDslName(o),l={message:s,type:i.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:c,occurrence:o.idx},u=p(o);return u&&(l.parameter=u),l})}function f(e){return a.getProductionDslName(e)+`_#_`+e.idx+`_#_`+p(e)}e.identifyProductionForDuplicates=f;function p(e){return e instanceof c.Terminal?e.terminalType.name:e instanceof c.NonTerminal?e.nonTerminalName:``}var m=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.allProductions=[],t}return n.prototype.visitNonTerminal=function(e){this.allProductions.push(e)},n.prototype.visitOption=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetition=function(e){this.allProductions.push(e)},n.prototype.visitAlternation=function(e){this.allProductions.push(e)},n.prototype.visitTerminal=function(e){this.allProductions.push(e)},n}(l.GAstVisitor);e.OccurrenceValidationCollector=m;function h(e,t,n,a){var o=[];if(r.reduce(t,function(t,n){return n.name===e.name?t+1:t},0)>1){var s=a.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});o.push({message:s,type:i.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e.name})}return o}e.validateRuleDoesNotAlreadyExist=h;function g(e,t,r){var a=[],o;return n.contains(t,e)||(o=`Invalid rule override, rule: ->`+e+`<- cannot be overridden in the grammar: ->`+r+`<-as it is not defined in any of the super grammars `,a.push({message:o,type:i.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:e})),a}e.validateRuleIsOverridden=g;function _(e,t,r,a){a===void 0&&(a=[]);var o=[],s=v(t.definition);if(n.isEmpty(s))return[];var c=e.name;n.contains(s,e)&&o.push({message:r.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:a}),type:i.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:c});var l=n.difference(s,a.concat([e])),u=n.map(l,function(t){var i=n.cloneArr(a);return i.push(t),_(e,t,r,i)});return o.concat(n.flatten(u))}e.validateNoLeftRecursion=_;function v(e){var t=[];if(n.isEmpty(e))return t;var r=n.first(e);if(r instanceof c.NonTerminal)t.push(r.referencedRule);else if(r instanceof c.Alternative||r instanceof c.Option||r instanceof c.RepetitionMandatory||r instanceof c.RepetitionMandatoryWithSeparator||r instanceof c.RepetitionWithSeparator||r instanceof c.Repetition)t=t.concat(v(r.definition));else if(r instanceof c.Alternation)t=n.flatten(n.map(r.definition,function(e){return v(e.definition)}));else if(!(r instanceof c.Terminal))throw Error(`non exhaustive match`);var i=a.isOptionalProd(r),o=e.length>1;if(i&&o){var s=n.drop(e);return t.concat(v(s))}else return t}e.getFirstNoneTerminal=v;var y=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.alternations=[],t}return n.prototype.visitAlternation=function(e){this.alternations.push(e)},n}(l.GAstVisitor);function b(e,t){var r=new y;e.accept(r);var a=r.alternations;return n.reduce(a,function(r,a){var o=n.dropRight(a.definition),c=n.map(o,function(r,o){var c=s.nextPossibleTokensAfter([r],[],null,1);return n.isEmpty(c)?{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:a,emptyChoiceIdx:o}),type:i.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:a.idx,alternative:o+1}:null});return r.concat(n.compact(c))},[])}e.validateEmptyOrAlternative=b;function x(e,t,i){var a=new y;e.accept(a);var s=a.alternations;return s=r.reject(s,function(e){return e.ignoreAmbiguities===!0}),n.reduce(s,function(n,r){var a=r.idx,s=r.maxLookahead||t,c=o.getLookaheadPathsForOr(a,e,s,r),l=T(c,r,e,i),u=E(c,r,e,i);return n.concat(l,u)},[])}e.validateAmbiguousAlternationAlternatives=x;var S=function(e){t(n,e);function n(){var t=e!==null&&e.apply(this,arguments)||this;return t.allProductions=[],t}return n.prototype.visitRepetitionWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatory=function(e){this.allProductions.push(e)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.allProductions.push(e)},n.prototype.visitRepetition=function(e){this.allProductions.push(e)},n}(l.GAstVisitor);e.RepetionCollector=S;function C(e,t){var r=new y;e.accept(r);var a=r.alternations;return n.reduce(a,function(n,r){return r.definition.length>255&&n.push({message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:r}),type:i.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:e.name,occurrence:r.idx}),n},[])}e.validateTooManyAlts=C;function w(e,t,n){var a=[];return r.forEach(e,function(e){var s=new S;e.accept(s);var c=s.allProductions;r.forEach(c,function(s){var c=o.getProdType(s),l=s.maxLookahead||t,u=s.idx,d=o.getLookaheadPathsForOptionalProd(u,e,c,l)[0];if(r.isEmpty(r.flatten(d))){var f=n.buildEmptyRepetitionError({topLevelRule:e,repetition:s});a.push({message:f,type:i.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),a}e.validateSomeNonEmptyLookaheadPath=w;function T(e,t,a,s){var c=[],l=r.reduce(e,function(n,i,a){return t.definition[a].ignoreAmbiguities===!0||r.forEach(i,function(i){var s=[a];r.forEach(e,function(e,n){a!==n&&o.containsPath(e,i)&&t.definition[n].ignoreAmbiguities!==!0&&s.push(n)}),s.length>1&&!o.containsPath(c,i)&&(c.push(i),n.push({alts:s,path:i}))}),n},[]);return n.map(l,function(e){var n=r.map(e.alts,function(e){return e+1});return{message:s.buildAlternationAmbiguityError({topLevelRule:a,alternation:t,ambiguityIndices:n,prefixPath:e.path}),type:i.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:a.name,occurrence:t.idx,alternatives:[e.alts]}})}function E(e,t,n,a){var s=[],c=r.reduce(e,function(e,t,n){var i=r.map(t,function(e){return{idx:n,path:e}});return e.concat(i)},[]);return r.forEach(c,function(e){if(t.definition[e.idx].ignoreAmbiguities!==!0){var l=e.idx,u=e.path,d=r.findAll(c,function(e){return t.definition[e.idx].ignoreAmbiguities!==!0&&e.idx<l&&o.isStrictPrefixOfPath(e.path,u)}),f=r.map(d,function(e){var r=[e.idx+1,l+1],o=t.idx===0?``:t.idx;return{message:a.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:r,prefixPath:e.path}),type:i.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:r}});s=s.concat(f)}}),s}e.checkPrefixAlternativesAmbiguities=E;function D(e,t,n){var a=[],o=r.map(t,function(e){return e.name});return r.forEach(e,function(e){var t=e.name;if(r.contains(o,t)){var s=n.buildNamespaceConflictError(e);a.push({message:s,type:i.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),a}}),le=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateGrammar=e.resolveGrammar=void 0;var t=I(),n=oe(),r=ce(),i=K();function a(e){e=t.defaults(e,{errMsgProvider:i.defaultGrammarResolverErrorProvider});var r={};return t.forEach(e.rules,function(e){r[e.name]=e}),n.resolveGrammar(r,e.errMsgProvider)}e.resolveGrammar=a;function o(e){return e=t.defaults(e,{errMsgProvider:i.defaultGrammarValidatorErrorProvider}),r.validateGrammar(e.rules,e.maxLookahead,e.tokenTypes,e.errMsgProvider,e.grammarName)}e.validateGrammar=o}),ue=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.EarlyExitException=e.NotAllInputParsedException=e.NoViableAltException=e.MismatchedTokenException=e.isRecognitionException=void 0;var n=I(),r=`MismatchedTokenException`,i=`NoViableAltException`,a=`EarlyExitException`,o=`NotAllInputParsedException`,s=[r,i,a,o];Object.freeze(s);function c(e){return n.contains(s,e.name)}e.isRecognitionException=c;var l=function(e){t(n,e);function n(t,n){var r=this.constructor,i=e.call(this,t)||this;return i.token=n,i.resyncedTokens=[],Object.setPrototypeOf(i,r.prototype),Error.captureStackTrace&&Error.captureStackTrace(i,i.constructor),i}return n}(Error);e.MismatchedTokenException=function(e){t(n,e);function n(t,n,i){var a=e.call(this,t,n)||this;return a.previousToken=i,a.name=r,a}return n}(l),e.NoViableAltException=function(e){t(n,e);function n(t,n,r){var a=e.call(this,t,n)||this;return a.previousToken=r,a.name=i,a}return n}(l),e.NotAllInputParsedException=function(e){t(n,e);function n(t,n){var r=e.call(this,t,n)||this;return r.name=o,r}return n}(l),e.EarlyExitException=function(e){t(n,e);function n(t,n,r){var i=e.call(this,t,n)||this;return i.previousToken=r,i.name=a,i}return n}(l)}),de=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.attemptInRepetitionRecovery=e.Recoverable=e.InRuleRecoveryException=e.IN_RULE_RECOVERY_EXCEPTION=e.EOF_FOLLOW_KEY=void 0;var t=B(),n=I(),r=ue(),i=ie(),a=Z();e.EOF_FOLLOW_KEY={},e.IN_RULE_RECOVERY_EXCEPTION=`InRuleRecoveryException`;function o(t){this.name=e.IN_RULE_RECOVERY_EXCEPTION,this.message=t}e.InRuleRecoveryException=o,o.prototype=Error.prototype,e.Recoverable=function(){function c(){}return c.prototype.initRecoverable=function(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=n.has(e,`recoveryEnabled`)?e.recoveryEnabled:a.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=s)},c.prototype.getTokenToInsert=function(e){var n=t.createTokenInstance(e,``,NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n},c.prototype.canTokenTypeBeInsertedInRecovery=function(e){return!0},c.prototype.tryInRepetitionRecovery=function(e,t,i,a){for(var o=this,s=this.findReSyncTokenType(),c=this.exportLexerState(),l=[],u=!1,d=this.LA(1),f=this.LA(1),p=function(){var e=o.LA(0),t=o.errorMessageProvider.buildMismatchTokenMessage({expected:a,actual:d,previous:e,ruleName:o.getCurrRuleFullName()}),i=new r.MismatchedTokenException(t,d,o.LA(0));i.resyncedTokens=n.dropRight(l),o.SAVE_ERROR(i)};!u;)if(this.tokenMatcher(f,a)){p();return}else if(i.call(this)){p(),e.apply(this,t);return}else this.tokenMatcher(f,s)?u=!0:(f=this.SKIP_TOKEN(),this.addToResyncTokens(f,l));this.importLexerState(c)},c.prototype.shouldInRepetitionRecoveryBeTried=function(e,t,n){return!(n===!1||e===void 0||t===void 0||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t)))},c.prototype.getFollowsForInRuleRecovery=function(e,t){var n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)},c.prototype.tryInRuleRecovery=function(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new o(`sad sad panda`)},c.prototype.canPerformInRuleRecovery=function(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)},c.prototype.canRecoverWithSingleTokenInsertion=function(e,t){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(e)||n.isEmpty(t))return!1;var i=this.LA(1);return n.find(t,function(e){return r.tokenMatcher(i,e)})!==void 0},c.prototype.canRecoverWithSingleTokenDeletion=function(e){return this.tokenMatcher(this.LA(2),e)},c.prototype.isInCurrentRuleReSyncSet=function(e){var t=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(t);return n.contains(r,e)},c.prototype.findReSyncTokenType=function(){for(var e=this.flattenFollowSet(),t=this.LA(1),r=2;;){var i=t.tokenType;if(n.contains(e,i))return i;t=this.LA(r),r++}},c.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return e.EOF_FOLLOW_KEY;var t=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}},c.prototype.buildFullFollowKeyStack=function(){var t=this,r=this.RULE_STACK,i=this.RULE_OCCURRENCE_STACK;return n.map(r,function(n,a){return a===0?e.EOF_FOLLOW_KEY:{ruleName:t.shortRuleNameToFullName(n),idxInCallingRule:i[a],inRule:t.shortRuleNameToFullName(r[a-1])}})},c.prototype.flattenFollowSet=function(){var e=this,t=n.map(this.buildFullFollowKeyStack(),function(t){return e.getFollowSetFromFollowKey(t)});return n.flatten(t)},c.prototype.getFollowSetFromFollowKey=function(n){if(n===e.EOF_FOLLOW_KEY)return[t.EOF];var r=n.ruleName+n.idxInCallingRule+i.IN+n.inRule;return this.resyncFollows[r]},c.prototype.addToResyncTokens=function(e,n){return this.tokenMatcher(e,t.EOF)||n.push(e),n},c.prototype.reSyncTo=function(e){for(var t=[],r=this.LA(1);this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,t);return n.dropRight(t)},c.prototype.attemptInRepetitionRecovery=function(e,t,n,r,i,a,o){},c.prototype.getCurrentGrammarPath=function(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:n.cloneArr(this.RULE_OCCURRENCE_STACK),lastTok:e,lastTokOccurrence:t}},c.prototype.getHumanReadableRuleStack=function(){var e=this;return n.map(this.RULE_STACK,function(t){return e.shortRuleNameToFullName(t)})},c}();function s(e,n,r,i,a,o,s){var c=this.getKeyForAutomaticLookahead(i,a),l=this.firstAfterRepMap[c];if(l===void 0){var u=this.getCurrRuleFullName(),d=this.getGAstProductions()[u];l=new o(d,a).startWalking(),this.firstAfterRepMap[c]=l}var f=l.token,p=l.occurrence,m=l.isEndOfRule;this.RULE_STACK.length===1&&m&&f===void 0&&(f=t.EOF,p=1),this.shouldInRepetitionRecoveryBeTried(f,p,s)&&this.tryInRepetitionRecovery(e,n,r,f)}e.attemptInRepetitionRecovery=s}),fe=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getKeyForAutomaticLookahead=e.AT_LEAST_ONE_SEP_IDX=e.MANY_SEP_IDX=e.AT_LEAST_ONE_IDX=e.MANY_IDX=e.OPTION_IDX=e.OR_IDX=e.BITS_FOR_ALT_IDX=e.BITS_FOR_RULE_IDX=e.BITS_FOR_OCCURRENCE_IDX=e.BITS_FOR_METHOD_TYPE=void 0,e.BITS_FOR_METHOD_TYPE=4,e.BITS_FOR_OCCURRENCE_IDX=8,e.BITS_FOR_RULE_IDX=12,e.BITS_FOR_ALT_IDX=8,e.OR_IDX=1<<e.BITS_FOR_OCCURRENCE_IDX,e.OPTION_IDX=2<<e.BITS_FOR_OCCURRENCE_IDX,e.MANY_IDX=3<<e.BITS_FOR_OCCURRENCE_IDX,e.AT_LEAST_ONE_IDX=4<<e.BITS_FOR_OCCURRENCE_IDX,e.MANY_SEP_IDX=5<<e.BITS_FOR_OCCURRENCE_IDX,e.AT_LEAST_ONE_SEP_IDX=6<<e.BITS_FOR_OCCURRENCE_IDX;function t(e,t,n){return n|t|e}e.getKeyForAutomaticLookahead=t,32-e.BITS_FOR_ALT_IDX}),pe=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LooksAhead=void 0;var t=q(),n=I(),r=Z(),i=fe(),a=W();e.LooksAhead=function(){function e(){}return e.prototype.initLooksAhead=function(e){this.dynamicTokensEnabled=n.has(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:r.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=n.has(e,`maxLookahead`)?e.maxLookahead:r.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=n.isES2015MapSupported()?new Map:[],n.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},e.prototype.preComputeLookaheadFunctions=function(e){var r=this;n.forEach(e,function(e){r.TRACE_INIT(e.name+` Rule Lookahead`,function(){var o=a.collectMethods(e),s=o.alternation,c=o.repetition,l=o.option,u=o.repetitionMandatory,d=o.repetitionMandatoryWithSeparator,f=o.repetitionWithSeparator;n.forEach(s,function(n){var o=n.idx===0?``:n.idx;r.TRACE_INIT(``+a.getProductionDslName(n)+o,function(){var a=t.buildLookaheadFuncForOr(n.idx,e,n.maxLookahead||r.maxLookahead,n.hasPredicates,r.dynamicTokensEnabled,r.lookAheadBuilderForAlternatives),o=i.getKeyForAutomaticLookahead(r.fullRuleNameToShort[e.name],i.OR_IDX,n.idx);r.setLaFuncCache(o,a)})}),n.forEach(c,function(n){r.computeLookaheadFunc(e,n.idx,i.MANY_IDX,t.PROD_TYPE.REPETITION,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(l,function(n){r.computeLookaheadFunc(e,n.idx,i.OPTION_IDX,t.PROD_TYPE.OPTION,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(u,function(n){r.computeLookaheadFunc(e,n.idx,i.AT_LEAST_ONE_IDX,t.PROD_TYPE.REPETITION_MANDATORY,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(d,function(n){r.computeLookaheadFunc(e,n.idx,i.AT_LEAST_ONE_SEP_IDX,t.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,a.getProductionDslName(n))}),n.forEach(f,function(n){r.computeLookaheadFunc(e,n.idx,i.MANY_SEP_IDX,t.PROD_TYPE.REPETITION_WITH_SEPARATOR,n.maxLookahead,a.getProductionDslName(n))})})})},e.prototype.computeLookaheadFunc=function(e,n,r,a,o,s){var c=this;this.TRACE_INIT(``+s+(n===0?``:n),function(){var s=t.buildLookaheadFuncForOptionalProd(n,e,o||c.maxLookahead,c.dynamicTokensEnabled,a,c.lookAheadBuilderForOptional),l=i.getKeyForAutomaticLookahead(c.fullRuleNameToShort[e.name],r,n);c.setLaFuncCache(l,s)})},e.prototype.lookAheadBuilderForOptional=function(e,n,r){return t.buildSingleAlternativeLookaheadFunction(e,n,r)},e.prototype.lookAheadBuilderForAlternatives=function(e,n,r,i){return t.buildAlternativesLookAheadFunc(e,n,r,i)},e.prototype.getKeyForAutomaticLookahead=function(e,t){var n=this.getLastExplicitRuleShortName();return i.getKeyForAutomaticLookahead(n,e,t)},e.prototype.getLaFuncFromCache=function(e){},e.prototype.getLaFuncFromMap=function(e){return this.lookAheadFuncsCache.get(e)},e.prototype.getLaFuncFromObj=function(e){return this.lookAheadFuncsCache[e]},e.prototype.setLaFuncCache=function(e,t){},e.prototype.setLaFuncCacheUsingMap=function(e,t){this.lookAheadFuncsCache.set(e,t)},e.prototype.setLaFuncUsingObj=function(e,t){this.lookAheadFuncsCache[e]=t},e}()}),me=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.addNoneTerminalToCst=e.addTerminalToCst=e.setNodeLocationFull=e.setNodeLocationOnlyOffset=void 0;function t(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset)}e.setNodeLocationOnlyOffset=t;function n(e,t){isNaN(e.startOffset)===!0?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}e.setNodeLocationFull=n;function r(e,t,n){e.children[n]===void 0?e.children[n]=[t]:e.children[n].push(t)}e.addTerminalToCst=r;function i(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)}e.addNoneTerminalToCst=i}),he=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.defineNameProp=e.functionName=e.classNameFromInstance=void 0;var t=I();function n(e){return i(e.constructor)}e.classNameFromInstance=n;var r=`name`;function i(e){return e.name||`anonymous`}e.functionName=i;function a(e,n){var i=Object.getOwnPropertyDescriptor(e,r);return t.isUndefined(i)||i.configurable?(Object.defineProperty(e,r,{enumerable:!1,configurable:!0,writable:!1,value:n}),!0):!1}e.defineNameProp=a}),ge=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateRedundantMethods=e.validateMissingCstMethods=e.validateVisitor=e.CstVisitorDefinitionError=e.createBaseVisitorConstructorWithDefaults=e.createBaseSemanticVisitorConstructor=e.defaultVisit=void 0;var t=I(),n=he();function r(e,n){for(var r=t.keys(e),i=r.length,a=0;a<i;a++)for(var o=r[a],s=e[o],c=s.length,l=0;l<c;l++){var u=s[l];u.tokenTypeIdx===void 0&&this[u.name](u.children,n)}}e.defaultVisit=r;function i(e,r){var i=function(){};return n.defineNameProp(i,e+`BaseSemantics`),i.prototype={visit:function(e,n){if(t.isArray(e)&&(e=e[0]),!t.isUndefined(e))return this[e.name](e.children,n)},validateVisitor:function(){var e=s(this,r);if(!t.isEmpty(e)){var i=t.map(e,function(e){return e.msg});throw Error(`Errors Detected in CST Visitor <`+n.functionName(this.constructor)+`>:
84
- `+(``+i.join(`
85
-
86
- `).replace(/\n/g,`
87
- `)))}}},i.prototype.constructor=i,i._RULE_NAMES=r,i}e.createBaseSemanticVisitorConstructor=i;function a(e,i,a){var o=function(){};n.defineNameProp(o,e+`BaseSemanticsWithDefaults`);var s=Object.create(a.prototype);return t.forEach(i,function(e){s[e]=r}),o.prototype=s,o.prototype.constructor=o,o}e.createBaseVisitorConstructorWithDefaults=a;var o;(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(o=e.CstVisitorDefinitionError||={});function s(e,t){var n=c(e,t),r=u(e,t);return n.concat(r)}e.validateVisitor=s;function c(e,r){var i=t.map(r,function(r){if(!t.isFunction(e[r]))return{msg:`Missing visitor method: <`+r+`> on `+n.functionName(e.constructor)+` CST Visitor.`,type:o.MISSING_METHOD,methodName:r}});return t.compact(i)}e.validateMissingCstMethods=c;var l=[`constructor`,`visit`,`validateVisitor`];function u(e,r){var i=[];for(var a in e)t.isFunction(e[a])&&!t.contains(l,a)&&!t.contains(r,a)&&i.push({msg:`Redundant visitor method: <`+a+`> on `+n.functionName(e.constructor)+` CST Visitor
88
- There is no Grammar Rule corresponding to this method's name.
89
- `,type:o.REDUNDANT_METHOD,methodName:a});return i}e.validateRedundantMethods=u}),_e=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TreeBuilder=void 0;var t=me(),n=I(),r=ge(),i=Z();e.TreeBuilder=function(){function e(){}return e.prototype.initTreeBuilder=function(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=n.has(e,`nodeLocationTracking`)?e.nodeLocationTracking:i.DEFAULT_PARSER_CONFIG.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=n.NOOP,this.cstFinallyStateUpdate=n.NOOP,this.cstPostTerminal=n.NOOP,this.cstPostNonTerminal=n.NOOP,this.cstPostRule=n.NOOP;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=t.setNodeLocationFull,this.setNodeLocationFromNode=t.setNodeLocationFull,this.cstPostRule=n.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=n.NOOP,this.setNodeLocationFromNode=n.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=t.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=t.setNodeLocationOnlyOffset,this.cstPostRule=n.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=n.NOOP,this.setNodeLocationFromNode=n.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=n.NOOP,this.setNodeLocationFromNode=n.NOOP,this.cstPostRule=n.NOOP,this.setInitialNodeLocation=n.NOOP;else throw Error(`Invalid <nodeLocationTracking> config option: "`+e.nodeLocationTracking+`"`)},e.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(e){e.location={startOffset:NaN,endOffset:NaN}},e.prototype.setInitialNodeLocationOnlyOffsetRegular=function(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},e.prototype.setInitialNodeLocationFullRecovery=function(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.setInitialNodeLocationFullRegular=function(e){var t=this.LA(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},e.prototype.cstInvocationStateUpdate=function(e,t){var n={name:e,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},e.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},e.prototype.cstPostRuleFull=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},e.prototype.cstPostRuleOnlyOffset=function(e){var t=this.LA(0),n=e.location;n.startOffset<=t.startOffset?n.endOffset=t.endOffset:n.startOffset=NaN},e.prototype.cstPostTerminal=function(e,n){var r=this.CST_STACK[this.CST_STACK.length-1];t.addTerminalToCst(r,n,e),this.setNodeLocationFromToken(r.location,n)},e.prototype.cstPostNonTerminal=function(e,n){var r=this.CST_STACK[this.CST_STACK.length-1];t.addNoneTerminalToCst(r,n,e),this.setNodeLocationFromNode(r.location,e.location)},e.prototype.getBaseCstVisitorConstructor=function(){if(n.isUndefined(this.baseCstVisitorConstructor)){var e=r.createBaseSemanticVisitorConstructor(this.className,n.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor},e.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(n.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var e=r.createBaseVisitorConstructorWithDefaults(this.className,n.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor},e.prototype.getLastExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-1]},e.prototype.getPreviousExplicitRuleShortName=function(){var e=this.RULE_STACK;return e[e.length-2]},e.prototype.getLastExplicitRuleOccurrenceIndex=function(){var e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]},e}()}),ve=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LexerAdapter=void 0;var t=Z();e.LexerAdapter=function(){function e(){}return e.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(e.prototype,"input",{get:function(){return this.tokVector},set:function(e){if(this.selfAnalysisDone!==!0)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length},enumerable:!1,configurable:!0}),e.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):t.END_OF_FILE},e.prototype.LA=function(e){var n=this.currIdx+e;return n<0||this.tokVectorLength<=n?t.END_OF_FILE:this.tokVector[n]},e.prototype.consumeToken=function(){this.currIdx++},e.prototype.exportLexerState=function(){return this.currIdx},e.prototype.importLexerState=function(e){this.currIdx=e},e.prototype.resetLexerState=function(){this.currIdx=-1},e.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},e.prototype.getLexerPosition=function(){return this.exportLexerState()},e}()}),ye=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RecognizerApi=void 0;var t=I(),n=ue(),r=Z(),i=K(),a=ce(),o=V();e.RecognizerApi=function(){function e(){}return e.prototype.ACTION=function(e){return e.call(this)},e.prototype.consume=function(e,t,n){return this.consumeInternal(t,e,n)},e.prototype.subrule=function(e,t,n){return this.subruleInternal(t,e,n)},e.prototype.option=function(e,t){return this.optionInternal(t,e)},e.prototype.or=function(e,t){return this.orInternal(t,e)},e.prototype.many=function(e,t){return this.manyInternal(e,t)},e.prototype.atLeastOne=function(e,t){return this.atLeastOneInternal(e,t)},e.prototype.CONSUME=function(e,t){return this.consumeInternal(e,0,t)},e.prototype.CONSUME1=function(e,t){return this.consumeInternal(e,1,t)},e.prototype.CONSUME2=function(e,t){return this.consumeInternal(e,2,t)},e.prototype.CONSUME3=function(e,t){return this.consumeInternal(e,3,t)},e.prototype.CONSUME4=function(e,t){return this.consumeInternal(e,4,t)},e.prototype.CONSUME5=function(e,t){return this.consumeInternal(e,5,t)},e.prototype.CONSUME6=function(e,t){return this.consumeInternal(e,6,t)},e.prototype.CONSUME7=function(e,t){return this.consumeInternal(e,7,t)},e.prototype.CONSUME8=function(e,t){return this.consumeInternal(e,8,t)},e.prototype.CONSUME9=function(e,t){return this.consumeInternal(e,9,t)},e.prototype.SUBRULE=function(e,t){return this.subruleInternal(e,0,t)},e.prototype.SUBRULE1=function(e,t){return this.subruleInternal(e,1,t)},e.prototype.SUBRULE2=function(e,t){return this.subruleInternal(e,2,t)},e.prototype.SUBRULE3=function(e,t){return this.subruleInternal(e,3,t)},e.prototype.SUBRULE4=function(e,t){return this.subruleInternal(e,4,t)},e.prototype.SUBRULE5=function(e,t){return this.subruleInternal(e,5,t)},e.prototype.SUBRULE6=function(e,t){return this.subruleInternal(e,6,t)},e.prototype.SUBRULE7=function(e,t){return this.subruleInternal(e,7,t)},e.prototype.SUBRULE8=function(e,t){return this.subruleInternal(e,8,t)},e.prototype.SUBRULE9=function(e,t){return this.subruleInternal(e,9,t)},e.prototype.OPTION=function(e){return this.optionInternal(e,0)},e.prototype.OPTION1=function(e){return this.optionInternal(e,1)},e.prototype.OPTION2=function(e){return this.optionInternal(e,2)},e.prototype.OPTION3=function(e){return this.optionInternal(e,3)},e.prototype.OPTION4=function(e){return this.optionInternal(e,4)},e.prototype.OPTION5=function(e){return this.optionInternal(e,5)},e.prototype.OPTION6=function(e){return this.optionInternal(e,6)},e.prototype.OPTION7=function(e){return this.optionInternal(e,7)},e.prototype.OPTION8=function(e){return this.optionInternal(e,8)},e.prototype.OPTION9=function(e){return this.optionInternal(e,9)},e.prototype.OR=function(e){return this.orInternal(e,0)},e.prototype.OR1=function(e){return this.orInternal(e,1)},e.prototype.OR2=function(e){return this.orInternal(e,2)},e.prototype.OR3=function(e){return this.orInternal(e,3)},e.prototype.OR4=function(e){return this.orInternal(e,4)},e.prototype.OR5=function(e){return this.orInternal(e,5)},e.prototype.OR6=function(e){return this.orInternal(e,6)},e.prototype.OR7=function(e){return this.orInternal(e,7)},e.prototype.OR8=function(e){return this.orInternal(e,8)},e.prototype.OR9=function(e){return this.orInternal(e,9)},e.prototype.MANY=function(e){this.manyInternal(0,e)},e.prototype.MANY1=function(e){this.manyInternal(1,e)},e.prototype.MANY2=function(e){this.manyInternal(2,e)},e.prototype.MANY3=function(e){this.manyInternal(3,e)},e.prototype.MANY4=function(e){this.manyInternal(4,e)},e.prototype.MANY5=function(e){this.manyInternal(5,e)},e.prototype.MANY6=function(e){this.manyInternal(6,e)},e.prototype.MANY7=function(e){this.manyInternal(7,e)},e.prototype.MANY8=function(e){this.manyInternal(8,e)},e.prototype.MANY9=function(e){this.manyInternal(9,e)},e.prototype.MANY_SEP=function(e){this.manySepFirstInternal(0,e)},e.prototype.MANY_SEP1=function(e){this.manySepFirstInternal(1,e)},e.prototype.MANY_SEP2=function(e){this.manySepFirstInternal(2,e)},e.prototype.MANY_SEP3=function(e){this.manySepFirstInternal(3,e)},e.prototype.MANY_SEP4=function(e){this.manySepFirstInternal(4,e)},e.prototype.MANY_SEP5=function(e){this.manySepFirstInternal(5,e)},e.prototype.MANY_SEP6=function(e){this.manySepFirstInternal(6,e)},e.prototype.MANY_SEP7=function(e){this.manySepFirstInternal(7,e)},e.prototype.MANY_SEP8=function(e){this.manySepFirstInternal(8,e)},e.prototype.MANY_SEP9=function(e){this.manySepFirstInternal(9,e)},e.prototype.AT_LEAST_ONE=function(e){this.atLeastOneInternal(0,e)},e.prototype.AT_LEAST_ONE1=function(e){return this.atLeastOneInternal(1,e)},e.prototype.AT_LEAST_ONE2=function(e){this.atLeastOneInternal(2,e)},e.prototype.AT_LEAST_ONE3=function(e){this.atLeastOneInternal(3,e)},e.prototype.AT_LEAST_ONE4=function(e){this.atLeastOneInternal(4,e)},e.prototype.AT_LEAST_ONE5=function(e){this.atLeastOneInternal(5,e)},e.prototype.AT_LEAST_ONE6=function(e){this.atLeastOneInternal(6,e)},e.prototype.AT_LEAST_ONE7=function(e){this.atLeastOneInternal(7,e)},e.prototype.AT_LEAST_ONE8=function(e){this.atLeastOneInternal(8,e)},e.prototype.AT_LEAST_ONE9=function(e){this.atLeastOneInternal(9,e)},e.prototype.AT_LEAST_ONE_SEP=function(e){this.atLeastOneSepFirstInternal(0,e)},e.prototype.AT_LEAST_ONE_SEP1=function(e){this.atLeastOneSepFirstInternal(1,e)},e.prototype.AT_LEAST_ONE_SEP2=function(e){this.atLeastOneSepFirstInternal(2,e)},e.prototype.AT_LEAST_ONE_SEP3=function(e){this.atLeastOneSepFirstInternal(3,e)},e.prototype.AT_LEAST_ONE_SEP4=function(e){this.atLeastOneSepFirstInternal(4,e)},e.prototype.AT_LEAST_ONE_SEP5=function(e){this.atLeastOneSepFirstInternal(5,e)},e.prototype.AT_LEAST_ONE_SEP6=function(e){this.atLeastOneSepFirstInternal(6,e)},e.prototype.AT_LEAST_ONE_SEP7=function(e){this.atLeastOneSepFirstInternal(7,e)},e.prototype.AT_LEAST_ONE_SEP8=function(e){this.atLeastOneSepFirstInternal(8,e)},e.prototype.AT_LEAST_ONE_SEP9=function(e){this.atLeastOneSepFirstInternal(9,e)},e.prototype.RULE=function(e,n,a){if(a===void 0&&(a=r.DEFAULT_RULE_CONFIG),t.contains(this.definedRulesNames,e)){var o={message:i.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:r.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);var s=this.defineRule(e,n,a);return this[e]=s,s},e.prototype.OVERRIDE_RULE=function(e,t,n){n===void 0&&(n=r.DEFAULT_RULE_CONFIG);var i=[];i=i.concat(a.validateRuleIsOverridden(e,this.definedRulesNames,this.className)),this.definitionErrors=this.definitionErrors.concat(i);var o=this.defineRule(e,t,n);return this[e]=o,o},e.prototype.BACKTRACK=function(e,t){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return e.apply(this,t),!0}catch(e){if(n.isRecognitionException(e))return!1;throw e}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},e.prototype.getGAstProductions=function(){return this.gastProductionsCache},e.prototype.getSerializedGastProductions=function(){return o.serializeGrammar(t.values(this.gastProductionsCache))},e}()}),be=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.RecognizerEngine=void 0;var t=I(),n=fe(),r=ue(),i=q(),a=se(),o=Z(),s=de(),c=B(),l=R(),u=he();e.RecognizerEngine=function(){function e(){}return e.prototype.initRecognizerEngine=function(e,n){if(this.className=u.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=l.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},t.has(n,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
90
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
91
- For Further details.`);if(t.isArray(e)){if(t.isEmpty(e))throw Error(`A Token Vocabulary cannot be empty.
92
- Note that the first argument for the parser constructor
93
- is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
94
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
95
- For Further details.`)}if(t.isArray(e))this.tokensMap=t.reduce(e,function(e,t){return e[t.name]=t,e},{});else if(t.has(e,`modes`)&&t.every(t.flatten(t.values(e.modes)),l.isTokenType)){var r=t.flatten(t.values(e.modes)),i=t.uniq(r);this.tokensMap=t.reduce(i,function(e,t){return e[t.name]=t,e},{})}else if(t.isObject(e))this.tokensMap=t.cloneObj(e);else throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap.EOF=c.EOF;var a=t.every(t.values(e),function(e){return t.isEmpty(e.categoryMatches)});this.tokenMatcher=a?l.tokenStructuredMatcherNoCategories:l.tokenStructuredMatcher,l.augmentTokenTypes(t.values(this.tokensMap))},e.prototype.defineRule=function(e,r,i){if(this.selfAnalysisDone)throw Error(`Grammar rule <`+e+`> may not be defined after the 'performSelfAnalysis' method has been called'
96
- Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var a=t.has(i,`resyncEnabled`)?i.resyncEnabled:o.DEFAULT_RULE_CONFIG.resyncEnabled,s=t.has(i,`recoveryValueFunc`)?i.recoveryValueFunc:o.DEFAULT_RULE_CONFIG.recoveryValueFunc,c=this.ruleShortNameIdx<<n.BITS_FOR_METHOD_TYPE+n.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[c]=e,this.fullRuleNameToShort[e]=c;function l(e){try{if(this.outputCst===!0){r.apply(this,e);var t=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(t),t}else return r.apply(this,e)}catch(e){return this.invokeRuleCatch(e,a,s)}finally{this.ruleFinallyStateUpdate()}}var u=function(t,n){return t===void 0&&(t=0),this.ruleInvocationStateUpdate(c,e,t),l.call(this,n)},d=`ruleName`;return u[d]=e,u.originalGrammarAction=r,u},e.prototype.invokeRuleCatch=function(e,t,n){var i=this.RULE_STACK.length===1,a=t&&!this.isBackTracking()&&this.recoveryEnabled;if(r.isRecognitionException(e)){var o=e;if(a){var s=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(s))if(o.resyncedTokens=this.reSyncTo(s),this.outputCst){var c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return n();else{if(this.outputCst){var c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),n();throw o}}else throw e},e.prototype.optionInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.OPTION_IDX,t);return this.optionInternalLogic(e,t,r)},e.prototype.optionInternalLogic=function(e,t,n){var r=this,i=this.getLaFuncFromCache(n),a,o;if(e.DEF!==void 0){if(a=e.DEF,o=e.GATE,o!==void 0){var s=i;i=function(){return o.call(r)&&s.call(r)}}}else a=e;if(i.call(this)===!0)return a.call(this)},e.prototype.atLeastOneInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.AT_LEAST_ONE_IDX,e);return this.atLeastOneInternalLogic(e,t,r)},e.prototype.atLeastOneInternalLogic=function(e,t,r){var o=this,s=this.getLaFuncFromCache(r),c,l;if(t.DEF!==void 0){if(c=t.DEF,l=t.GATE,l!==void 0){var u=s;s=function(){return l.call(o)&&u.call(o)}}}else c=t;if(s.call(this)===!0)for(var d=this.doSingleRepetition(c);s.call(this)===!0&&d===!0;)d=this.doSingleRepetition(c);else throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY,t.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],s,n.AT_LEAST_ONE_IDX,e,a.NextTerminalAfterAtLeastOneWalker)},e.prototype.atLeastOneSepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.AT_LEAST_ONE_SEP_IDX,e);this.atLeastOneSepFirstInternalLogic(e,t,r)},e.prototype.atLeastOneSepFirstInternalLogic=function(e,t,r){var o=this,s=t.DEF,c=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){s.call(this);for(var l=function(){return o.tokenMatcher(o.LA(1),c)};this.tokenMatcher(this.LA(1),c)===!0;)this.CONSUME(c),s.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,c,l,s,a.NextTerminalAfterAtLeastOneSepWalker],l,n.AT_LEAST_ONE_SEP_IDX,e,a.NextTerminalAfterAtLeastOneSepWalker)}else throw this.raiseEarlyExitException(e,i.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG)},e.prototype.manyInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.MANY_IDX,e);return this.manyInternalLogic(e,t,r)},e.prototype.manyInternalLogic=function(e,t,r){var i=this,o=this.getLaFuncFromCache(r),s,c;if(t.DEF!==void 0){if(s=t.DEF,c=t.GATE,c!==void 0){var l=o;o=function(){return c.call(i)&&l.call(i)}}}else s=t;for(var u=!0;o.call(this)===!0&&u===!0;)u=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],o,n.MANY_IDX,e,a.NextTerminalAfterManyWalker,u)},e.prototype.manySepFirstInternal=function(e,t){var r=this.getKeyForAutomaticLookahead(n.MANY_SEP_IDX,e);this.manySepFirstInternalLogic(e,t,r)},e.prototype.manySepFirstInternalLogic=function(e,t,r){var i=this,o=t.DEF,s=t.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){o.call(this);for(var c=function(){return i.tokenMatcher(i.LA(1),s)};this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,c,o,a.NextTerminalAfterManySepWalker],c,n.MANY_SEP_IDX,e,a.NextTerminalAfterManySepWalker)}},e.prototype.repetitionSepSecondInternal=function(e,t,r,i,a){for(;r();)this.CONSUME(t),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,r,i,a],r,n.AT_LEAST_ONE_SEP_IDX,e,a)},e.prototype.doSingleRepetition=function(e){var t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t},e.prototype.orInternal=function(e,r){var i=this.getKeyForAutomaticLookahead(n.OR_IDX,r),a=t.isArray(e)?e:e.DEF,o=this.getLaFuncFromCache(i).call(this,a);if(o!==void 0)return a[o].ALT.call(this);this.raiseNoAltException(r,e.ERR_MSG)},e.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new r.NotAllInputParsedException(t,e))}},e.prototype.subruleInternal=function(e,t,n){var r;try{var i=n===void 0?void 0:n.ARGS;return r=e.call(this,t,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){this.subruleInternalError(t,n,e.ruleName)}},e.prototype.subruleInternalError=function(e,t,n){throw r.isRecognitionException(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e},e.prototype.consumeInternal=function(e,t,n){var r;try{var i=this.LA(1);this.tokenMatcher(i,e)===!0?(this.consumeToken(),r=i):this.consumeInternalError(e,i,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r},e.prototype.consumeInternalError=function(e,t,n){var i,a=this.LA(0);throw i=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:a,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new r.MismatchedTokenException(i,t,a))},e.prototype.consumeInternalRecovery=function(e,t,n){if(this.recoveryEnabled&&n.name===`MismatchedTokenException`&&!this.isBackTracking()){var r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===s.IN_RULE_RECOVERY_EXCEPTION?n:e}}else throw n},e.prototype.saveRecogState=function(){var e=this.errors,n=t.cloneArr(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}},e.prototype.reloadRecogState=function(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK},e.prototype.ruleInvocationStateUpdate=function(e,t,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(t,e)},e.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},e.prototype.getCurrRuleFullName=function(){var e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]},e.prototype.shortRuleNameToFullName=function(e){return this.shortRuleNameToFull[e]},e.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),c.EOF)},e.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},e}()}),xe=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorHandler=void 0;var t=ue(),n=I(),r=q(),i=Z();e.ErrorHandler=function(){function e(){}return e.prototype.initErrorHandler=function(e){this._errors=[],this.errorMessageProvider=n.has(e,`errorMessageProvider`)?e.errorMessageProvider:i.DEFAULT_PARSER_CONFIG.errorMessageProvider},e.prototype.SAVE_ERROR=function(e){if(t.isRecognitionException(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:n.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)},Object.defineProperty(e.prototype,"errors",{get:function(){return n.cloneArr(this._errors)},set:function(e){this._errors=e},enumerable:!1,configurable:!0}),e.prototype.raiseEarlyExitException=function(e,n,i){for(var a=this.getCurrRuleFullName(),o=this.getGAstProductions()[a],s=r.getLookaheadPathsForOptionalProd(e,o,n,this.maxLookahead)[0],c=[],l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));var u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:c,previous:this.LA(0),customUserDescription:i,ruleName:a});throw this.SAVE_ERROR(new t.EarlyExitException(u,this.LA(1),this.LA(0)))},e.prototype.raiseNoAltException=function(e,n){for(var i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],o=r.getLookaheadPathsForOr(e,a,this.maxLookahead),s=[],c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));var l=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:o,actual:s,previous:l,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new t.NoViableAltException(u,this.LA(1),l))},e}()}),Se=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ContentAssist=void 0;var t=se(),n=I();e.ContentAssist=function(){function e(){}return e.prototype.initContentAssist=function(){},e.prototype.computeContentAssist=function(e,r){var i=this.gastProductionsCache[e];if(n.isUndefined(i))throw Error(`Rule ->`+e+`<- does not exist in this grammar.`);return t.nextPossibleTokensAfter([i],r,this.tokenMatcher,this.maxLookahead)},e.prototype.getNextPossibleTokenTypes=function(e){var r=n.first(e.ruleStack),i=this.getGAstProductions()[r];return new t.NextAfterTokenWalker(i,e).startWalking()},e}()}),J=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.GastRecorder=void 0;var t=I(),n=V(),r=re(),i=R(),a=B(),o=Z(),s=fe(),c={description:`This Object indicates the Parser is during Recording Phase`};Object.freeze(c);var l=!0,u=2**s.BITS_FOR_OCCURRENCE_IDX-1,d=a.createToken({name:`RECORDING_PHASE_TOKEN`,pattern:r.Lexer.NA});i.augmentTokenTypes([d]);var f=a.createTokenInstance(d,`This IToken indicates the Parser is in Recording Phase
97
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(f);var p={name:`This CSTNode indicates the Parser is in Recording Phase
98
- See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};e.GastRecorder=function(){function e(){}return e.prototype.initGastRecorder=function(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1},e.prototype.enableRecording=function(){var e=this;this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,function(){for(var t=function(t){var n=t>0?t:``;e[`CONSUME`+n]=function(e,n){return this.consumeInternalRecord(e,t,n)},e[`SUBRULE`+n]=function(e,n){return this.subruleInternalRecord(e,t,n)},e[`OPTION`+n]=function(e){return this.optionInternalRecord(e,t)},e[`OR`+n]=function(e){return this.orInternalRecord(e,t)},e[`MANY`+n]=function(e){this.manyInternalRecord(t,e)},e[`MANY_SEP`+n]=function(e){this.manySepFirstInternalRecord(t,e)},e[`AT_LEAST_ONE`+n]=function(e){this.atLeastOneInternalRecord(t,e)},e[`AT_LEAST_ONE_SEP`+n]=function(e){this.atLeastOneSepFirstInternalRecord(t,e)}},n=0;n<10;n++)t(n);e.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},e.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},e.option=function(e,t){return this.optionInternalRecord(t,e)},e.or=function(e,t){return this.orInternalRecord(t,e)},e.many=function(e,t){this.manyInternalRecord(e,t)},e.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},e.ACTION=e.ACTION_RECORD,e.BACKTRACK=e.BACKTRACK_RECORD,e.LA=e.LA_RECORD})},e.prototype.disableRecording=function(){var e=this;this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,function(){for(var t=0;t<10;t++){var n=t>0?t:``;delete e[`CONSUME`+n],delete e[`SUBRULE`+n],delete e[`OPTION`+n],delete e[`OR`+n],delete e[`MANY`+n],delete e[`MANY_SEP`+n],delete e[`AT_LEAST_ONE`+n],delete e[`AT_LEAST_ONE_SEP`+n]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})},e.prototype.ACTION_RECORD=function(e){},e.prototype.BACKTRACK_RECORD=function(e,t){return function(){return!0}},e.prototype.LA_RECORD=function(e){return o.END_OF_FILE},e.prototype.topLevelRuleRecord=function(e,t){try{var r=new n.Rule({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),t.call(this),this.recordingProdStack.pop(),r}catch(e){if(e.KNOWN_RECORDER_ERROR!==!0)try{e.message+=`
99
- This error was thrown during the "grammar recording phase" For more info see:
100
- https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}},e.prototype.optionInternalRecord=function(e,t){return m.call(this,n.Option,e,t)},e.prototype.atLeastOneInternalRecord=function(e,t){m.call(this,n.RepetitionMandatory,t,e)},e.prototype.atLeastOneSepFirstInternalRecord=function(e,t){m.call(this,n.RepetitionMandatoryWithSeparator,t,e,l)},e.prototype.manyInternalRecord=function(e,t){m.call(this,n.Repetition,t,e)},e.prototype.manySepFirstInternalRecord=function(e,t){m.call(this,n.RepetitionWithSeparator,t,e,l)},e.prototype.orInternalRecord=function(e,t){return h.call(this,e,t)},e.prototype.subruleInternalRecord=function(e,r,i){if(_(r),!e||t.has(e,`ruleName`)===!1){var a=Error(`<SUBRULE`+g(r)+`> argument is invalid`+(` expecting a Parser method reference but got: <`+JSON.stringify(e)+`>`)+(`
101
- inside top level rule: <`+this.recordingProdStack[0].name+`>`));throw a.KNOWN_RECORDER_ERROR=!0,a}var o=t.peek(this.recordingProdStack),s=e.ruleName,l=new n.NonTerminal({idx:r,nonTerminalName:s,referencedRule:void 0});return o.definition.push(l),this.outputCst?p:c},e.prototype.consumeInternalRecord=function(e,r,a){if(_(r),!i.hasShortKeyProperty(e)){var o=Error(`<CONSUME`+g(r)+`> argument is invalid`+(` expecting a TokenType reference but got: <`+JSON.stringify(e)+`>`)+(`
102
- inside top level rule: <`+this.recordingProdStack[0].name+`>`));throw o.KNOWN_RECORDER_ERROR=!0,o}var s=t.peek(this.recordingProdStack),c=new n.Terminal({idx:r,terminalType:e});return s.definition.push(c),f},e}();function m(e,n,r,i){i===void 0&&(i=!1),_(r);var a=t.peek(this.recordingProdStack),o=t.isFunction(n)?n:n.DEF,s=new e({definition:[],idx:r});return i&&(s.separator=n.SEP),t.has(n,`MAX_LOOKAHEAD`)&&(s.maxLookahead=n.MAX_LOOKAHEAD),this.recordingProdStack.push(s),o.call(this),a.definition.push(s),this.recordingProdStack.pop(),c}function h(e,r){var i=this;_(r);var a=t.peek(this.recordingProdStack),o=t.isArray(e)===!1,s=o===!1?e:e.DEF,l=new n.Alternation({definition:[],idx:r,ignoreAmbiguities:o&&e.IGNORE_AMBIGUITIES===!0});return t.has(e,`MAX_LOOKAHEAD`)&&(l.maxLookahead=e.MAX_LOOKAHEAD),l.hasPredicates=t.some(s,function(e){return t.isFunction(e.GATE)}),a.definition.push(l),t.forEach(s,function(e){var r=new n.Alternative({definition:[]});l.definition.push(r),t.has(e,`IGNORE_AMBIGUITIES`)?r.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:t.has(e,`GATE`)&&(r.ignoreAmbiguities=!0),i.recordingProdStack.push(r),e.ALT.call(i),i.recordingProdStack.pop()}),c}function g(e){return e===0?``:``+e}function _(e){if(e<0||e>u){var t=Error(`Invalid DSL Method idx value: <`+e+`>
103
- `+(`Idx value must be a none negative value smaller than `+(u+1)));throw t.KNOWN_RECORDER_ERROR=!0,t}}}),Y=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PerformanceTracer=void 0;var t=I(),n=Z();e.PerformanceTracer=function(){function e(){}return e.prototype.initPerformanceTracer=function(e){if(t.has(e,`traceInitPerf`)){var r=e.traceInitPerf,i=typeof r==`number`;this.traceInitMaxIdent=i?r:1/0,this.traceInitPerf=i?r>0:r}else this.traceInitMaxIdent=0,this.traceInitPerf=n.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},e.prototype.TRACE_INIT=function(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+`--> <`+e+`>`);var i=t.timer(n),a=i.time,o=i.value,s=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(r+`<-- <`+e+`> time: `+a+`ms`),this.traceInitIndent--,o}else return n()},e}()}),X=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.applyMixins=void 0;function t(e,t){t.forEach(function(t){var n=t.prototype;Object.getOwnPropertyNames(n).forEach(function(r){if(r!==`constructor`){var i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(e.prototype,r,i):e.prototype[r]=t.prototype[r]}})})}e.applyMixins=t}),Z=P(e=>{var t=e&&e.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.EmbeddedActionsParser=e.CstParser=e.Parser=e.EMPTY_ALT=e.ParserDefinitionErrorType=e.DEFAULT_RULE_CONFIG=e.DEFAULT_PARSER_CONFIG=e.END_OF_FILE=void 0;var n=I(),r=ae(),i=B(),a=K(),o=le(),s=de(),c=pe(),l=_e(),u=ve(),d=ye(),f=be(),p=xe(),m=Se(),h=J(),g=Y(),_=X();e.END_OF_FILE=i.createTokenInstance(i.EOF,``,NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(e.END_OF_FILE),e.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:a.defaultParserErrorProvider,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),e.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`})(e.ParserDefinitionErrorType||={});function v(e){return e===void 0&&(e=void 0),function(){return e}}e.EMPTY_ALT=v;var y=function(){function t(t,r){this.definitionErrors=[],this.selfAnalysisDone=!1;var i=this;if(i.initErrorHandler(r),i.initLexerAdapter(),i.initLooksAhead(r),i.initRecognizerEngine(t,r),i.initRecoverable(r),i.initTreeBuilder(r),i.initContentAssist(),i.initGastRecorder(r),i.initPerformanceTracer(r),n.has(r,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
104
- Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
105
- See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
106
- For further details.`);this.skipValidations=n.has(r,`skipValidations`)?r.skipValidations:e.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT(`performSelfAnalysis`,function(){var i;e.selfAnalysisDone=!0;var s=e.className;e.TRACE_INIT(`toFastProps`,function(){n.toFastProperties(e)}),e.TRACE_INIT(`Grammar Recording`,function(){try{e.enableRecording(),n.forEach(e.definedRulesNames,function(t){var n=e[t].originalGrammarAction,r=void 0;e.TRACE_INIT(t+` Rule`,function(){r=e.topLevelRuleRecord(t,n)}),e.gastProductionsCache[t]=r})}finally{e.disableRecording()}});var c=[];if(e.TRACE_INIT(`Grammar Resolving`,function(){c=o.resolveGrammar({rules:n.values(e.gastProductionsCache)}),e.definitionErrors=e.definitionErrors.concat(c)}),e.TRACE_INIT(`Grammar Validations`,function(){if(n.isEmpty(c)&&e.skipValidations===!1){var t=o.validateGrammar({rules:n.values(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:n.values(e.tokensMap),errMsgProvider:a.defaultGrammarValidatorErrorProvider,grammarName:s});e.definitionErrors=e.definitionErrors.concat(t)}}),n.isEmpty(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT(`computeAllProdsFollows`,function(){e.resyncFollows=r.computeAllProdsFollows(n.values(e.gastProductionsCache))}),e.TRACE_INIT(`ComputeLookaheadFunctions`,function(){e.preComputeLookaheadFunctions(n.values(e.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!n.isEmpty(e.definitionErrors))throw i=n.map(e.definitionErrors,function(e){return e.message}),Error(`Parser Definition Errors detected:
107
- `+i.join(`
108
- -------------------------------
109
- `))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();e.Parser=y,_.applyMixins(y,[s.Recoverable,c.LooksAhead,l.TreeBuilder,u.LexerAdapter,f.RecognizerEngine,d.RecognizerApi,p.ErrorHandler,m.ContentAssist,h.GastRecorder,g.PerformanceTracer]),e.CstParser=function(r){t(i,r);function i(t,i){i===void 0&&(i=e.DEFAULT_PARSER_CONFIG);var a=this,o=n.cloneObj(i);return o.outputCst=!0,a=r.call(this,t,o)||this,a}return i}(y),e.EmbeddedActionsParser=function(r){t(i,r);function i(t,i){i===void 0&&(i=e.DEFAULT_PARSER_CONFIG);var a=this,o=n.cloneObj(i);return o.outputCst=!1,a=r.call(this,t,o)||this,a}return i}(y)}),Ce=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createSyntaxDiagramsCode=void 0;var t=F();function n(e,n){var r=n===void 0?{}:n,i=r.resourceBase,a=i===void 0?`https://unpkg.com/chevrotain@`+t.VERSION+`/diagrams/`:i,o=r.css,s=o===void 0?`https://unpkg.com/chevrotain@`+t.VERSION+`/diagrams/diagrams.css`:o,c=`
110
- <!-- This is a generated file -->
111
- <!DOCTYPE html>
112
- <meta charset="utf-8">
113
- <style>
114
- body {
115
- background-color: hsl(30, 20%, 95%)
116
- }
117
- </style>
118
-
119
- `,l=`
120
- <link rel='stylesheet' href='`+s+`'>
121
- `,u=`
122
- <script src='`+a+`vendor/railroad-diagrams.js'><\/script>
123
- <script src='`+a+`src/diagrams_builder.js'><\/script>
124
- <script src='`+a+`src/diagrams_behavior.js'><\/script>
125
- <script src='`+a+`src/main.js'><\/script>
126
- `,d=`
127
- <div id="diagrams" align="center"></div>
128
- `,f=`
129
- <script>
130
- window.serializedGrammar = `+JSON.stringify(e,null,` `)+`;
131
- <\/script>
132
- `;return c+l+u+d+f+`
133
- <script>
134
- var diagramsDiv = document.getElementById("diagrams");
135
- main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
136
- <\/script>
137
- `}e.createSyntaxDiagramsCode=n}),we=P(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Parser=e.createSyntaxDiagramsCode=e.clearCache=e.GAstVisitor=e.serializeProduction=e.serializeGrammar=e.Terminal=e.Rule=e.RepetitionWithSeparator=e.RepetitionMandatoryWithSeparator=e.RepetitionMandatory=e.Repetition=e.Option=e.NonTerminal=e.Alternative=e.Alternation=e.defaultLexerErrorProvider=e.NoViableAltException=e.NotAllInputParsedException=e.MismatchedTokenException=e.isRecognitionException=e.EarlyExitException=e.defaultParserErrorProvider=e.tokenName=e.tokenMatcher=e.tokenLabel=e.EOF=e.createTokenInstance=e.createToken=e.LexerDefinitionErrorType=e.Lexer=e.EMPTY_ALT=e.ParserDefinitionErrorType=e.EmbeddedActionsParser=e.CstParser=e.VERSION=void 0;var t=F();Object.defineProperty(e,"VERSION",{enumerable:!0,get:function(){return t.VERSION}});var n=Z();Object.defineProperty(e,"CstParser",{enumerable:!0,get:function(){return n.CstParser}}),Object.defineProperty(e,"EmbeddedActionsParser",{enumerable:!0,get:function(){return n.EmbeddedActionsParser}}),Object.defineProperty(e,"ParserDefinitionErrorType",{enumerable:!0,get:function(){return n.ParserDefinitionErrorType}}),Object.defineProperty(e,"EMPTY_ALT",{enumerable:!0,get:function(){return n.EMPTY_ALT}});var r=re();Object.defineProperty(e,"Lexer",{enumerable:!0,get:function(){return r.Lexer}}),Object.defineProperty(e,"LexerDefinitionErrorType",{enumerable:!0,get:function(){return r.LexerDefinitionErrorType}});var i=B();Object.defineProperty(e,"createToken",{enumerable:!0,get:function(){return i.createToken}}),Object.defineProperty(e,"createTokenInstance",{enumerable:!0,get:function(){return i.createTokenInstance}}),Object.defineProperty(e,"EOF",{enumerable:!0,get:function(){return i.EOF}}),Object.defineProperty(e,"tokenLabel",{enumerable:!0,get:function(){return i.tokenLabel}}),Object.defineProperty(e,"tokenMatcher",{enumerable:!0,get:function(){return i.tokenMatcher}}),Object.defineProperty(e,"tokenName",{enumerable:!0,get:function(){return i.tokenName}});var a=K();Object.defineProperty(e,"defaultParserErrorProvider",{enumerable:!0,get:function(){return a.defaultParserErrorProvider}});var o=ue();Object.defineProperty(e,"EarlyExitException",{enumerable:!0,get:function(){return o.EarlyExitException}}),Object.defineProperty(e,"isRecognitionException",{enumerable:!0,get:function(){return o.isRecognitionException}}),Object.defineProperty(e,"MismatchedTokenException",{enumerable:!0,get:function(){return o.MismatchedTokenException}}),Object.defineProperty(e,"NotAllInputParsedException",{enumerable:!0,get:function(){return o.NotAllInputParsedException}}),Object.defineProperty(e,"NoViableAltException",{enumerable:!0,get:function(){return o.NoViableAltException}});var s=z();Object.defineProperty(e,"defaultLexerErrorProvider",{enumerable:!0,get:function(){return s.defaultLexerErrorProvider}});var c=V();Object.defineProperty(e,"Alternation",{enumerable:!0,get:function(){return c.Alternation}}),Object.defineProperty(e,"Alternative",{enumerable:!0,get:function(){return c.Alternative}}),Object.defineProperty(e,"NonTerminal",{enumerable:!0,get:function(){return c.NonTerminal}}),Object.defineProperty(e,"Option",{enumerable:!0,get:function(){return c.Option}}),Object.defineProperty(e,"Repetition",{enumerable:!0,get:function(){return c.Repetition}}),Object.defineProperty(e,"RepetitionMandatory",{enumerable:!0,get:function(){return c.RepetitionMandatory}}),Object.defineProperty(e,"RepetitionMandatoryWithSeparator",{enumerable:!0,get:function(){return c.RepetitionMandatoryWithSeparator}}),Object.defineProperty(e,"RepetitionWithSeparator",{enumerable:!0,get:function(){return c.RepetitionWithSeparator}}),Object.defineProperty(e,"Rule",{enumerable:!0,get:function(){return c.Rule}}),Object.defineProperty(e,"Terminal",{enumerable:!0,get:function(){return c.Terminal}});var l=V();Object.defineProperty(e,"serializeGrammar",{enumerable:!0,get:function(){return l.serializeGrammar}}),Object.defineProperty(e,"serializeProduction",{enumerable:!0,get:function(){return l.serializeProduction}});var u=U();Object.defineProperty(e,"GAstVisitor",{enumerable:!0,get:function(){return u.GAstVisitor}});function d(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
138
- It performs no action other than printing this message.
139
- Please avoid using it as it will be completely removed in the future`)}e.clearCache=d;var f=Ce();Object.defineProperty(e,"createSyntaxDiagramsCode",{enumerable:!0,get:function(){return f.createSyntaxDiagramsCode}}),e.Parser=function(){function e(){throw Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
140
- See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return e}()})(),Te=class extends s{constructor(e){super(e)}load(e,t,r,i){let a=this,o=a.path===``?C.extractUrlBase(e):a.path,s=new n(a.manager);s.setPath(a.path),s.setRequestHeader(a.requestHeader),s.setWithCredentials(a.withCredentials),s.load(e,function(n){try{t(a.parse(n,o))}catch(t){i?i(t):console.error(t),a.manager.itemError(e)}},r,i)}parse(n,C){let P={};function F(e){let t=I(),n=new Ee(t.tokens),r=new Oe(t.tokenVocabulary),i=ee(r.getBaseCstVisitorConstructor());r.input=n.lex(e).tokens;let a=r.vrml();if(r.errors.length>0)throw console.error(r.errors),Error(`THREE.VRMLLoader: Parsing errors detected.`);return i.visit(a)}function I(){let e=we.createToken,t=e({name:`RouteIdentifier`,pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*[\.][^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d][^\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]*/}),n=e({name:`Identifier`,pattern:/[^\x30-\x39\0-\x20\x22\x27\x23\x2b\x2c\x2d\x2e\x5b\x5d\x5c\x7b\x7d]([^\0-\x20\x22\x27\x23\x2b\x2c\x2e\x5b\x5d\x5c\x7b\x7d])*/,longer_alt:t}),r=`Anchor.Billboard.Collision.Group.Transform.Inline.LOD.Switch.PerspectiveCamera.OrthographicCamera.AudioClip.DirectionalLight.PointLight.Script.Shape.Sound.SpotLight.WorldInfo.CylinderSensor.PlaneSensor.ProximitySensor.SphereSensor.TimeSensor.TouchSensor.VisibilitySensor.Box.Cone.Cylinder.ElevationGrid.Extrusion.IndexedFaceSet.IndexedLineSet.PointSet.Sphere.Color.Coordinate.Normal.TextureCoordinate.Appearance.FontStyle.ImageTexture.Material.MovieTexture.PixelTexture.TextureTransform.ColorInterpolator.CoordinateInterpolator.NormalInterpolator.OrientationInterpolator.PositionInterpolator.ScalarInterpolator.Background.Fog.NavigationInfo.Viewpoint.Text`.split(`.`),i=e({name:`Version`,pattern:/#VRML.*/,longer_alt:n}),a=e({name:`NodeName`,pattern:new RegExp(r.join(`|`)),longer_alt:n}),o=e({name:`DEF`,pattern:/DEF/,longer_alt:n}),s=e({name:`USE`,pattern:/USE/,longer_alt:n}),c=e({name:`ROUTE`,pattern:/ROUTE/,longer_alt:n}),l=e({name:`TO`,pattern:/TO/,longer_alt:n}),u=e({name:`StringLiteral`,pattern:/"(?:[^\\"\n\r]|\\[bfnrtv"\\/]|\\u[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F])*"/}),d=e({name:`HexLiteral`,pattern:/0[xX][0-9a-fA-F]+/}),f=e({name:`NumberLiteral`,pattern:/[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/}),p=e({name:`TrueLiteral`,pattern:/TRUE/}),m=e({name:`FalseLiteral`,pattern:/FALSE/}),h=e({name:`NullLiteral`,pattern:/NULL/}),g=e({name:`LSquare`,pattern:/\[/}),_=e({name:`RSquare`,pattern:/]/}),v=e({name:`LCurly`,pattern:/{/}),y=e({name:`RCurly`,pattern:/}/}),b=e({name:`Comment`,pattern:/#.*/,group:we.Lexer.SKIPPED}),x=[e({name:`WhiteSpace`,pattern:/[ ,\s]/,group:we.Lexer.SKIPPED}),a,o,s,c,l,p,m,h,i,n,t,u,d,f,g,_,v,y,b],S={};for(let e=0,t=x.length;e<t;e++){let t=x[e];S[t.name]=t}return{tokens:x,tokenVocabulary:S}}function ee(e){class t extends e{constructor(){super(),this.validateVisitor()}vrml(e){let t={version:this.visit(e.version),nodes:[],routes:[]};for(let n=0,r=e.node.length;n<r;n++){let r=e.node[n];t.nodes.push(this.visit(r))}if(e.route)for(let n=0,r=e.route.length;n<r;n++){let r=e.route[n];t.routes.push(this.visit(r))}return t}version(e){return e.Version[0].image}node(e){let t={name:e.NodeName[0].image,fields:[]};if(e.field)for(let n=0,r=e.field.length;n<r;n++){let r=e.field[n];t.fields.push(this.visit(r))}return e.def&&(t.DEF=this.visit(e.def[0])),t}field(e){let t={name:e.Identifier[0].image,type:null,values:null},n;return e.singleFieldValue&&(n=this.visit(e.singleFieldValue[0])),e.multiFieldValue&&(n=this.visit(e.multiFieldValue[0])),t.type=n.type,t.values=n.values,t}def(e){return(e.Identifier||e.NodeName)[0].image}use(e){return{USE:(e.Identifier||e.NodeName)[0].image}}singleFieldValue(e){return n(this,e)}multiFieldValue(e){return n(this,e)}route(e){return{FROM:e.RouteIdentifier[0].image,TO:e.RouteIdentifier[1].image}}}function n(e,t){let n={type:null,values:[]};if(t.node){n.type=`node`;for(let r=0,i=t.node.length;r<i;r++){let i=t.node[r];n.values.push(e.visit(i))}}if(t.use){n.type=`use`;for(let r=0,i=t.use.length;r<i;r++){let i=t.use[r];n.values.push(e.visit(i))}}if(t.StringLiteral){n.type=`string`;for(let e=0,r=t.StringLiteral.length;e<r;e++){let r=t.StringLiteral[e];n.values.push(r.image.replace(/'|"/g,``))}}if(t.NumberLiteral){n.type=`number`;for(let e=0,r=t.NumberLiteral.length;e<r;e++){let r=t.NumberLiteral[e];n.values.push(parseFloat(r.image))}}if(t.HexLiteral){n.type=`hex`;for(let e=0,r=t.HexLiteral.length;e<r;e++){let r=t.HexLiteral[e];n.values.push(r.image)}}if(t.TrueLiteral){n.type=`boolean`;for(let e=0,r=t.TrueLiteral.length;e<r;e++)t.TrueLiteral[e].image===`TRUE`&&n.values.push(!0)}if(t.FalseLiteral){n.type=`boolean`;for(let e=0,r=t.FalseLiteral.length;e<r;e++)t.FalseLiteral[e].image===`FALSE`&&n.values.push(!1)}return t.NullLiteral&&(n.type=`null`,t.NullLiteral.forEach(function(){n.values.push(null)})),n}return new t}function te(e){let t=e.nodes,n=new c;for(let e=0,n=t.length;e<n;e++){let n=t[e];ne(n)}for(let e=0,r=t.length;e<r;e++){let r=t[e],i=L(r);i instanceof p&&n.add(i),r.name===`WorldInfo`&&(n.userData.worldInfo=i)}return n}function ne(e){e.DEF&&(P[e.DEF]=e);let t=e.fields;for(let e=0,n=t.length;e<n;e++){let n=t[e];if(n.type===`node`){let e=n.values;for(let t=0,n=e.length;t<n;t++)ne(e[t])}}}function L(e){return e.USE?ge(e.USE):(e.build===void 0&&(e.build=R(e)),e.build)}function R(e){let t=e.name,n;switch(t){case`Anchor`:case`Group`:case`Transform`:case`Collision`:n=z(e);break;case`Background`:n=re(e);break;case`Shape`:n=B(e);break;case`Appearance`:n=V(e);break;case`Material`:n=H(e);break;case`ImageTexture`:n=ie(e);break;case`PixelTexture`:n=G(e);break;case`TextureTransform`:n=ae(e);break;case`IndexedFaceSet`:n=q(e);break;case`IndexedLineSet`:n=ce(e);break;case`PointSet`:n=le(e);break;case`Box`:n=ue(e);break;case`Cone`:n=de(e);break;case`Cylinder`:n=fe(e);break;case`Sphere`:n=pe(e);break;case`ElevationGrid`:n=me(e);break;case`Extrusion`:n=he(e);break;case`Color`:case`Coordinate`:case`Normal`:case`TextureCoordinate`:n=K(e);break;case`WorldInfo`:n=oe(e);break;case`OrthographicCamera`:case`PerspectiveCamera`:n=se(e,t);break;case`Billboard`:case`Inline`:case`LOD`:case`Switch`:case`AudioClip`:case`DirectionalLight`:case`PointLight`:case`Script`:case`Sound`:case`SpotLight`:case`CylinderSensor`:case`PlaneSensor`:case`ProximitySensor`:case`SphereSensor`:case`TimeSensor`:case`TouchSensor`:case`VisibilitySensor`:case`Text`:case`FontStyle`:case`MovieTexture`:case`ColorInterpolator`:case`CoordinateInterpolator`:case`NormalInterpolator`:case`OrientationInterpolator`:case`PositionInterpolator`:case`ScalarInterpolator`:case`Fog`:case`NavigationInfo`:case`Viewpoint`:break;default:console.warn(`THREE.VRMLLoader: Unknown node:`,t);break}return n!==void 0&&e.DEF!==void 0&&n.hasOwnProperty(`name`)===!0&&(n.name=e.DEF),n}function z(e){let n=new i,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`bboxCenter`:break;case`bboxSize`:break;case`center`:break;case`children`:_e(o,n);break;case`description`:break;case`collide`:break;case`parameter`:break;case`rotation`:let e=new t(o[0],o[1],o[2]).normalize(),r=o[3];n.quaternion.setFromAxisAngle(e,r);break;case`scale`:n.scale.set(o[0],o[1],o[2]);break;case`scaleOrientation`:break;case`translation`:n.position.set(o[0],o[1],o[2]);break;case`proxy`:break;case`url`:break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,a);break}}return n}function re(t){let n=new i,r,a,o,s,c=t.fields;for(let e=0,t=c.length;e<t;e++){let t=c[e],n=t.name,i=t.values;switch(n){case`groundAngle`:r=i;break;case`groundColor`:a=i;break;case`backUrl`:break;case`bottomUrl`:break;case`frontUrl`:break;case`leftUrl`:break;case`rightUrl`:break;case`topUrl`:break;case`skyAngle`:o=i;break;case`skyColor`:s=i;break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,n);break}}let l=1e4;if(s){let t=new e(l,32,16),r=new T({fog:!1,side:1,depthWrite:!1,depthTest:!1});s.length>3?(Re(t,l,o,Ie(s),!0),r.vertexColors=!0):r.color.setRGB(s[0],s[1],s[2],k);let i=new m(t,r);n.add(i)}if(a&&a.length>0){let t=new e(l,32,16,0,2*Math.PI,.5*Math.PI,1.5*Math.PI),i=new T({fog:!1,side:1,vertexColors:!0,depthWrite:!1,depthTest:!1});Re(t,l,r,Ie(a),!1);let o=new m(t,i);n.add(o)}return n.renderOrder=-1/0,n}function B(e){let t=e.fields,n=new T({name:s.DEFAULT_MATERIAL_NAME,color:0}),r;for(let e=0,i=t.length;e<i;e++){let i=t[e],a=i.name,o=i.values;switch(a){case`appearance`:o[0]!==null&&(n=L(o[0]));break;case`geometry`:o[0]!==null&&(r=L(o[0]));break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,a);break}}let i;if(r&&r.attributes.position){let e=r._type;if(e===`points`){let e=new d({name:s.DEFAULT_MATERIAL_NAME,color:16777215,opacity:n.opacity,transparent:n.transparent});r.attributes.color===void 0?n.isMeshPhongMaterial&&e.color.copy(n.emissive):e.vertexColors=!0,i=new _(r,e)}else if(e===`line`){let e=new M({name:s.DEFAULT_MATERIAL_NAME,color:16777215,opacity:n.opacity,transparent:n.transparent});r.attributes.color===void 0?n.isMeshPhongMaterial&&e.color.copy(n.emissive):e.vertexColors=!0,i=new l(r,e)}else r._solid!==void 0&&(n.side=r._solid?0:2),r.attributes.color!==void 0&&(n.vertexColors=!0),i=new m(r,n)}else i=new p,i.visible=!1;return i}function V(e){let t=new w,n,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`material`:if(o[0]!==null){let e=L(o[0]);e.diffuseColor&&t.color.copy(e.diffuseColor),e.emissiveColor&&t.emissive.copy(e.emissiveColor),e.shininess&&(t.shininess=e.shininess),e.specularColor&&t.specular.copy(e.specularColor),e.transparency&&(t.opacity=1-e.transparency),e.transparency>0&&(t.transparent=!0)}else t=new T({name:s.DEFAULT_MATERIAL_NAME,color:0});break;case`texture`:let e=o[0];e!==null&&(e.name===`ImageTexture`||e.name===`PixelTexture`)&&(t.map=L(e));break;case`textureTransform`:o[0]!==null&&(n=L(o[0]));break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,a);break}}if(t.map){if(t.map.__type){switch(t.map.__type){case Q.INTENSITY_ALPHA:t.opacity=1;break;case Q.RGB:t.color.set(16777215);break;case Q.RGBA:t.color.set(16777215),t.opacity=1;break;default:}delete t.map.__type}n&&(t.map.center.copy(n.center),t.map.rotation=n.rotation,t.map.repeat.copy(n.scale),t.map.offset.copy(n.translation))}return t}function H(e){let t={},n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`ambientIntensity`:break;case`diffuseColor`:t.diffuseColor=new x().setRGB(a[0],a[1],a[2],k);break;case`emissiveColor`:t.emissiveColor=new x().setRGB(a[0],a[1],a[2],k);break;case`shininess`:t.shininess=a[0];break;case`specularColor`:t.specularColor=new x().setRGB(a[0],a[1],a[2],k);break;case`transparency`:t.transparency=a[0];break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,i);break}}return t}function U(e,t,n){let r;switch(t){case Q.INTENSITY:r=parseInt(e),n.r=r,n.g=r,n.b=r,n.a=1;break;case Q.INTENSITY_ALPHA:r=parseInt(`0x`+e.substring(2,4)),n.r=r,n.g=r,n.b=r,n.a=parseInt(`0x`+e.substring(4,6));break;case Q.RGB:n.r=parseInt(`0x`+e.substring(2,4)),n.g=parseInt(`0x`+e.substring(4,6)),n.b=parseInt(`0x`+e.substring(6,8)),n.a=1;break;case Q.RGBA:n.r=parseInt(`0x`+e.substring(2,4)),n.g=parseInt(`0x`+e.substring(4,6)),n.b=parseInt(`0x`+e.substring(6,8)),n.a=parseInt(`0x`+e.substring(8,10));break;default:}}function W(e){let t;switch(e){case 1:t=Q.INTENSITY;break;case 2:t=Q.INTENSITY_ALPHA;break;case 3:t=Q.RGB;break;case 4:t=Q.RGBA;break;default:}return t}function G(e){let t,n=r,i=r,a=e.fields;for(let e=0,r=a.length;e<r;e++){let r=a[e],o=r.name,s=r.values;switch(o){case`image`:let e=s[0],r=s[1],a=s[2],c=W(a),l=new Uint8Array(4*e*r),u={r:0,g:0,b:0,a:0};for(let e=3,t=0,n=s.length;e<n;e++,t++){U(s[e],c,u);let n=t*4;l[n+0]=u.r,l[n+1]=u.g,l[n+2]=u.b,l[n+3]=u.a}t=new A(l,e,r),t.colorSpace=k,t.needsUpdate=!0,t.__type=c;break;case`repeatS`:s[0]===!1&&(n=h);break;case`repeatT`:s[0]===!1&&(i=h);break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,o);break}}return t&&(t.wrapS=n,t.wrapT=i),t}function ie(e){let t,n=r,i=r,a=e.fields;for(let e=0,r=a.length;e<r;e++){let r=a[e],o=r.name,s=r.values;switch(o){case`url`:let e=s[0];e&&(t=ze.load(e));break;case`repeatS`:s[0]===!1&&(n=h);break;case`repeatT`:s[0]===!1&&(i=h);break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,o);break}}return t&&(t.wrapS=n,t.wrapT=i,t.colorSpace=k),t}function ae(e){let t={center:new N,rotation:new N,scale:new N,translation:new N},n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`center`:t.center.set(a[0],a[1]);break;case`rotation`:t.rotation=a[0];break;case`scale`:t.scale.set(a[0],a[1]);break;case`translation`:t.translation.set(a[0],a[1]);break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,i);break}}return t}function K(e){return e.fields[0].values}function oe(e){let t={},n=e.fields;for(let e=0,r=n.length;e<r;e++){let r=n[e],i=r.name,a=r.values;switch(i){case`title`:t.title=a[0];break;case`info`:t.info=a;break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,i);break}}return t}function se(e,n){let r=n===`PerspectiveCamera`?new S:new g,i=(typeof window<`u`?window.innerWidth:1)/(typeof window<`u`?window.innerHeight:1),a=e.fields;for(let e=0,n=a.length;e<n;e++){let n=a[e],o=n.name,s=n.values;switch(o){case`position`:r.position.set(s[0],s[1],s[0]);break;case`orientation`:let e=new t(s[0],s[1],s[2]).normalize(),n=s[3];r.quaternion.setFromAxisAngle(e,n);break;case`focalDistance`:r.userData.focalDistance=s[0];break;case`heightAngle`:r.fov=u.radToDeg(s[0]),r.aspect=i,r.updateProjectionMatrix();break;case`height`:let a=s[0]/2,c=a*i;r.left=-c,r.right=c,r.top=a,r.bottom=-a,r.updateProjectionMatrix();break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,o);break}}return r}function q(e){let t,n,r,i,a=!0,o=!0,s=0,c,l,u,d,f=!0,p=!0,m=e.fields;for(let e=0,h=m.length;e<h;e++){let h=m[e],g=h.name,_=h.values;switch(g){case`color`:let e=_[0];e!==null&&(t=L(e));break;case`coord`:let m=_[0];m!==null&&(n=L(m));break;case`normal`:let h=_[0];h!==null&&(r=L(h));break;case`texCoord`:let v=_[0];v!==null&&(i=L(v));break;case`ccw`:a=_[0];break;case`colorIndex`:c=_;break;case`colorPerVertex`:f=_[0];break;case`convex`:break;case`coordIndex`:l=_;break;case`creaseAngle`:s=_[0];break;case`normalIndex`:u=_;break;case`normalPerVertex`:p=_[0];break;case`solid`:o=_[0];break;case`texCoordIndex`:d=_;break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,g);break}}if(l===void 0)return console.warn(`THREE.VRMLLoader: Missing coordIndex.`),new E;let h=ve(l,a),g,_,v;t&&(g=f===!0?c&&c.length>0?De(h,ve(c,a),t,3):$(h,new O(t,3)):c&&c.length>0?Ae(h,ye(be(t,c),l)):Ae(h,ye(t,l)),Le(g)),_=r?p===!0?u&&u.length>0?De(h,ve(u,a),r,3):$(h,new O(r,3)):u&&u.length>0?Ae(h,ye(be(r,u),l)):Ae(h,ye(r,l)):Pe(h,n,s),i&&(v=d&&d.length>0?De(h,ve(d,a),i,2):$(h,new O(i,2)));let y=new E,b=$(h,new O(n,3));return y.setAttribute(`position`,b),y.setAttribute(`normal`,_),g&&y.setAttribute(`color`,g),v&&y.setAttribute(`uv`,v),y._solid=o,y._type=`mesh`,y}function ce(e){let t,n,r,i,a=!0,o=e.fields;for(let e=0,s=o.length;e<s;e++){let s=o[e],c=s.name,l=s.values;switch(c){case`color`:let e=l[0];e!==null&&(t=L(e));break;case`coord`:let o=l[0];o!==null&&(n=L(o));break;case`colorIndex`:r=l;break;case`colorPerVertex`:a=l[0];break;case`coordIndex`:i=l;break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,c);break}}let s,c=xe(i);t&&(s=a===!0?r.length>0?De(c,xe(r),t,3):$(c,new O(t,3)):r.length>0?je(c,Se(be(t,r),i)):je(c,Se(t,i)),Le(s));let l=new E,u=$(c,new O(n,3));return l.setAttribute(`position`,u),s&&l.setAttribute(`color`,s),l._type=`line`,l}function le(e){let t,n,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`color`:let e=o[0];e!==null&&(t=L(e));break;case`coord`:let r=o[0];r!==null&&(n=L(r));break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,a);break}}let i=new E;if(i.setAttribute(`position`,new O(n,3)),t){let e=new O(t,3);Le(e),i.setAttribute(`color`,e)}return i._type=`points`,i}function ue(e){let n=new t(2,2,2),r=e.fields;for(let e=0,t=r.length;e<t;e++){let t=r[e],i=t.name,a=t.values;switch(i){case`size`:n.x=a[0],n.y=a[1],n.z=a[2];break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,i);break}}return new f(n.x,n.y,n.z)}function de(e){let t=1,n=2,r=!1,i=e.fields;for(let e=0,a=i.length;e<a;e++){let a=i[e],o=a.name,s=a.values;switch(o){case`bottom`:r=!s[0];break;case`bottomRadius`:t=s[0];break;case`height`:n=s[0];break;case`side`:break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,o);break}}return new v(t,n,16,1,r)}function fe(e){let t=1,n=2,r=e.fields;for(let e=0,i=r.length;e<i;e++){let i=r[e],a=i.name,o=i.values;switch(a){case`bottom`:break;case`radius`:t=o[0];break;case`height`:n=o[0];break;case`side`:break;case`top`:break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,a);break}}return new D(t,t,n,16,1)}function pe(t){let n=1,r=t.fields;for(let e=0,t=r.length;e<t;e++){let t=r[e],i=t.name,a=t.values;switch(i){case`radius`:n=a[0];break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,i);break}}return new e(n,16,16)}function me(e){let t,n,r,i,a=!0,o=!0,s=!0,c=!0,l=0,u=2,d=2,f=1,p=1,m=e.fields;for(let e=0,h=m.length;e<h;e++){let h=m[e],g=h.name,_=h.values;switch(g){case`color`:let e=_[0];e!==null&&(t=L(e));break;case`normal`:let m=_[0];m!==null&&(n=L(m));break;case`texCoord`:let h=_[0];h!==null&&(r=L(h));break;case`height`:i=_;break;case`ccw`:c=_[0];break;case`colorPerVertex`:a=_[0];break;case`creaseAngle`:l=_[0];break;case`normalPerVertex`:o=_[0];break;case`solid`:s=_[0];break;case`xDimension`:u=_[0];break;case`xSpacing`:f=_[0];break;case`zDimension`:d=_[0];break;case`zSpacing`:p=_[0];break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,g);break}}let h=[],g=[],_=[],v=[];for(let e=0;e<d;e++)for(let s=0;s<u;s++){let c=e*u+s,l=f*e,m=i[c],y=p*s;if(h.push(l,m,y),t&&a===!0){let e=t[c*3+0],n=t[c*3+1],r=t[c*3+2];_.push(e,n,r)}if(n&&o===!0){let e=n[c*3+0],t=n[c*3+1],r=n[c*3+2];g.push(e,t,r)}if(r){let e=r[c*2+0],t=r[c*2+1];v.push(e,t)}else v.push(e/(u-1),s/(d-1))}let y=[];for(let e=0;e<u-1;e++)for(let t=0;t<d-1;t++){let n=e+t*u,r=e+(t+1)*u,i=e+1+(t+1)*u,a=e+1+t*u;c===!0?(y.push(n,i,r),y.push(i,n,a)):(y.push(n,r,i),y.push(i,a,n))}let b=$(y,new O(h,3)),x=$(y,new O(v,2)),S,C;if(t){if(a===!1){for(let e=0;e<u-1;e++)for(let n=0;n<d-1;n++){let r=e+n*(u-1),i=t[r*3+0],a=t[r*3+1],o=t[r*3+2];_.push(i,a,o),_.push(i,a,o),_.push(i,a,o),_.push(i,a,o),_.push(i,a,o),_.push(i,a,o)}S=new O(_,3)}else S=$(y,new O(_,3));Le(S)}if(n)if(o===!1){for(let e=0;e<u-1;e++)for(let t=0;t<d-1;t++){let r=e+t*(u-1),i=n[r*3+0],a=n[r*3+1],o=n[r*3+2];g.push(i,a,o),g.push(i,a,o),g.push(i,a,o),g.push(i,a,o),g.push(i,a,o),g.push(i,a,o)}C=new O(g,3)}else C=$(y,new O(g,3));else C=Pe(y,h,l);let w=new E;return w.setAttribute(`position`,b),w.setAttribute(`normal`,C),w.setAttribute(`uv`,x),S&&w.setAttribute(`color`,S),w._solid=s,w._type=`mesh`,w}function he(e){let n=[1,1,1,-1,-1,-1,-1,1,1,1],r=[0,0,0,0,1,0],i,o,s=!0,c=!0,l=0,u=!0,d=!0,f=e.fields;for(let e=0,t=f.length;e<t;e++){let t=f[e],a=t.name,p=t.values;switch(a){case`beginCap`:s=p[0];break;case`ccw`:c=p[0];break;case`convex`:break;case`creaseAngle`:l=p[0];break;case`crossSection`:n=p;break;case`endCap`:u=p[0];break;case`orientation`:o=p;break;case`scale`:i=p;break;case`solid`:d=p[0];break;case`spine`:r=p;break;default:console.warn(`THREE.VRMLLoader: Unknown field:`,a);break}}let p=n[0]===n[n.length-2]&&n[1]===n[n.length-1],m=[],h=new t,g=new t,_=new t,v=new t,y=new j;for(let e=0,t=0,a=0,s=r.length;e<s;e+=3,t+=2,a+=4){h.fromArray(r,e),g.x=i?i[t+0]:1,g.y=1,g.z=i?i[t+1]:1,_.x=o?o[a+0]:0,_.y=o?o[a+1]:0,_.z=o?o[a+2]:1;let s=o?o[a+3]:0;for(let e=0,t=n.length;e<t;e+=2)v.x=n[e+0],v.y=0,v.z=n[e+1],v.multiply(g),y.setFromAxisAngle(_,s),v.applyQuaternion(y),v.add(h),m.push(v.x,v.y,v.z)}let b=[],x=r.length/3,S=n.length/2;for(let e=0;e<x-1;e++)for(let t=0;t<S-1;t++){let n=t+e*S,r=t+1+e*S,i=t+(e+1)*S,a=t+1+(e+1)*S;t===S-2&&p===!0&&(r=e*S,a=(e+1)*S),c===!0?(b.push(n,r,i),b.push(i,r,a)):(b.push(n,i,r),b.push(i,a,r))}if(s===!0||u===!0){let e=[];for(let t=0,r=n.length;t<r;t+=2)e.push(new N(n[t],n[t+1]));let t=a.triangulateShape(e,[]),r=[];for(let e=0,n=t.length;e<n;e++){let n=t[e];r.push(n[0],n[1],n[2])}if(s===!0)for(let e=0,t=r.length;e<t;e+=3)c===!0?b.push(r[e+0],r[e+1],r[e+2]):b.push(r[e+0],r[e+2],r[e+1]);if(u===!0){let e=S*(x-1);for(let t=0,n=r.length;t<n;t+=3)c===!0?b.push(e+r[t+0],e+r[t+2],e+r[t+1]):b.push(e+r[t+0],e+r[t+1],e+r[t+2])}}let C=$(b,new O(m,3)),w=Pe(b,m,l),T=new E;return T.setAttribute(`position`,C),T.setAttribute(`normal`,w),T._solid=d,T._type=`mesh`,T}function ge(e){let t=P[e],n=L(t);return n.isObject3D||n.isMaterial?n.clone():n}function _e(e,t){for(let n=0,r=e.length;n<r;n++){let r=L(e[n]);r instanceof p&&t.add(r)}}function ve(e,t){let n=[],r=0;for(let i=0,a=e.length;i<a;i++){let o=e[r],s=e[i+(t?1:2)],c=e[i+(t?2:1)];n.push(o,s,c),(e[i+3]===-1||i+3>=a)&&(i+=3,r=i+1)}return n}function ye(e,t){let n=[],r=0;for(let i=0,a=t.length;i<a;i++){let o=r*3,s=e[o],c=e[o+1],l=e[o+2];n.push(s,c,l),(t[i+3]===-1||i+3>=a)&&(i+=3,r++)}return n}function be(e,t){let n=[];for(let r=0,i=t.length;r<i;r++){let i=t[r]*3,a=e[i],o=e[i+1],s=e[i+2];n.push(a,o,s)}return n}function xe(e){let t=[];for(let n=0,r=e.length;n<r;n++){let i=e[n],a=e[n+1];t.push(i,a),(e[n+2]===-1||n+2>=r)&&(n+=2)}return t}function Se(e,t){let n=[],r=0;for(let i=0,a=t.length;i<a;i++){let o=r*3,s=e[o],c=e[o+1],l=e[o+2];n.push(s,c,l),(t[i+2]===-1||i+2>=a)&&(i+=2,r++)}return n}let J=new t,Y=new t,X=new t,Z=new N,Ce=new N,Te=new N;function De(e,t,n,r){let i=[];for(let a=0,o=e.length;a<o;a+=3){let e=t[a],o=t[a+1],s=t[a+2];r===2?(Z.fromArray(n,e*r),Ce.fromArray(n,o*r),Te.fromArray(n,s*r),i.push(Z.x,Z.y),i.push(Ce.x,Ce.y),i.push(Te.x,Te.y)):(J.fromArray(n,e*r),Y.fromArray(n,o*r),X.fromArray(n,s*r),i.push(J.x,J.y,J.z),i.push(Y.x,Y.y,Y.z),i.push(X.x,X.y,X.z))}return new O(i,r)}function Ae(e,t){let n=[];for(let r=0,i=0,a=e.length;r<a;r+=3,i++)J.fromArray(t,i*3),n.push(J.x,J.y,J.z),n.push(J.x,J.y,J.z),n.push(J.x,J.y,J.z);return new O(n,3)}function je(e,t){let n=[];for(let r=0,i=0,a=e.length;r<a;r+=2,i++)J.fromArray(t,i*3),n.push(J.x,J.y,J.z),n.push(J.x,J.y,J.z);return new O(n,3)}function $(e,t){let n=t.array,r=t.itemSize,i=new n.constructor(e.length*r),a=0,o=0;for(let t=0,s=e.length;t<s;t++){a=e[t]*r;for(let e=0;e<r;e++)i[o++]=n[a++]}return new O(i,r)}let Me=new t,Ne=new t;function Pe(e,t,n){let r=[],i={};for(let n=0,a=e.length;n<a;n+=3){let a=e[n],o=e[n+1],s=e[n+2],c=new ke(a,o,s);J.fromArray(t,a*3),Y.fromArray(t,o*3),X.fromArray(t,s*3),Ne.subVectors(X,Y),Me.subVectors(J,Y),Ne.cross(Me),Ne.normalize(),c.normal.copy(Ne),i[a]===void 0&&(i[a]=[]),i[o]===void 0&&(i[o]=[]),i[s]===void 0&&(i[s]=[]),i[a].push(c.normal),i[o].push(c.normal),i[s].push(c.normal),r.push(c)}let a=[];for(let e=0,o=r.length;e<o;e++){let o=r[e],s=Fe(i[o.a],o.normal,n),c=Fe(i[o.b],o.normal,n),l=Fe(i[o.c],o.normal,n);J.fromArray(t,o.a*3),Y.fromArray(t,o.b*3),X.fromArray(t,o.c*3),a.push(s.x,s.y,s.z),a.push(c.x,c.y,c.z),a.push(l.x,l.y,l.z)}return new O(a,3)}function Fe(e,n,r){let i=new t;if(r===0)i.copy(n);else for(let t=0,a=e.length;t<a;t++)e[t].angleTo(n)<r&&i.add(e[t]);return i.normalize()}function Ie(e){let t=[];for(let n=0,r=e.length;n<r;n+=3)t.push(new x(e[n],e[n+1],e[n+2]));return t}function Le(e){let t=new x;for(let n=0;n<e.count;n++)t.fromBufferAttribute(e,n),b.colorSpaceToWorking(t,k),e.setXYZ(n,t.r,t.g,t.b)}function Re(e,n,r,i,a){let o=[],s=a===!0?0:Math.PI;for(let e=0,c=i.length;e<c;e++){let i=e===0?0:r[e-1];i=a===!0?i:s-i;let c=new t;c.setFromSphericalCoords(n,i,0),o.push(c)}let c=e.index,l=e.attributes.position,u=new y(new Float32Array(e.attributes.position.count*3),3),d=new t,f=new x;for(let e=0;e<c.count;e++){let t=c.getX(e);d.fromBufferAttribute(l,t);let n,r,s=1;for(let e=1;e<o.length;e++){n=e-1,r=e;let t=o[n],i=o[r];if(a===!0){if(d.y<=t.y&&d.y>i.y){s=Math.abs(t.y-d.y)/Math.abs(t.y-i.y);break}}else if(d.y>=t.y&&d.y<i.y){s=Math.abs(t.y-d.y)/Math.abs(t.y-i.y);break}}let p=i[n],m=i[r];f.copy(p).lerp(m,s),b.colorSpaceToWorking(f,k),u.setXYZ(t,f.r,f.g,f.b)}e.setAttribute(`color`,u)}let ze=new o(this.manager);if(ze.setPath(this.resourcePath||C).setCrossOrigin(this.crossOrigin),n.indexOf(`#VRML V2.0`)===-1)throw Error(`THREE.VRMLLexer: Version of VRML asset not supported.`);return te(F(n))}},Ee=class{constructor(e){this.lexer=new we.Lexer(e)}lex(e){let t=this.lexer.tokenize(e);if(t.errors.length>0)throw console.error(t.errors),Error(`THREE.VRMLLexer: Lexing errors detected.`);return t}},De=we.CstParser,Oe=class extends De{constructor(e){super(e);let t=this,n=e.Version,r=e.LCurly,i=e.RCurly,a=e.LSquare,o=e.RSquare,s=e.Identifier,c=e.RouteIdentifier,l=e.StringLiteral,u=e.HexLiteral,d=e.NumberLiteral,f=e.TrueLiteral,p=e.FalseLiteral,m=e.NullLiteral,h=e.DEF,g=e.USE,_=e.ROUTE,v=e.TO,y=e.NodeName;t.RULE(`vrml`,function(){t.SUBRULE(t.version),t.AT_LEAST_ONE(function(){t.SUBRULE(t.node)}),t.MANY(function(){t.SUBRULE(t.route)})}),t.RULE(`version`,function(){t.CONSUME(n)}),t.RULE(`node`,function(){t.OPTION(function(){t.SUBRULE(t.def)}),t.CONSUME(y),t.CONSUME(r),t.MANY(function(){t.SUBRULE(t.field)}),t.CONSUME(i)}),t.RULE(`field`,function(){t.CONSUME(s),t.OR2([{ALT:function(){t.SUBRULE(t.singleFieldValue)}},{ALT:function(){t.SUBRULE(t.multiFieldValue)}}])}),t.RULE(`def`,function(){t.CONSUME(h),t.OR([{ALT:function(){t.CONSUME(s)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE(`use`,function(){t.CONSUME(g),t.OR([{ALT:function(){t.CONSUME(s)}},{ALT:function(){t.CONSUME(y)}}])}),t.RULE(`singleFieldValue`,function(){t.AT_LEAST_ONE(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(f)}},{ALT:function(){t.CONSUME(p)}},{ALT:function(){t.CONSUME(m)}}])})}),t.RULE(`multiFieldValue`,function(){t.CONSUME(a),t.MANY(function(){t.OR([{ALT:function(){t.SUBRULE(t.node)}},{ALT:function(){t.SUBRULE(t.use)}},{ALT:function(){t.CONSUME(l)}},{ALT:function(){t.CONSUME(u)}},{ALT:function(){t.CONSUME(d)}},{ALT:function(){t.CONSUME(m)}}])}),t.CONSUME(o)}),t.RULE(`route`,function(){t.CONSUME(_),t.CONSUME(c),t.CONSUME(v),t.CONSUME2(c)}),this.performSelfAnalysis()}},ke=class{constructor(e,n,r){this.a=e,this.b=n,this.c=r,this.normal=new t}},Q={INTENSITY:1,INTENSITY_ALPHA:2,RGB:3,RGBA:4};export{Te as VRMLLoader};
@@ -1,3 +0,0 @@
1
- import{C as e,K as t,l as n,p as r,u as i,w as a,wt as o}from"./three.module-BFsVh7r1.js";import{n as s}from"./fflate.module-BIQmJeC9.js";var c=class extends t{constructor(e){super(e),console.warn(`THREE.VTKLoader: The loader has been deprecated and will be removed with r194. Export your VTK files to glTF before using them on the web.`)}load(t,n,r,i){let a=this,o=new e(a.manager);o.setPath(a.path),o.setResponseType(`arraybuffer`),o.setRequestHeader(a.requestHeader),o.setWithCredentials(a.withCredentials),o.load(t,function(e){try{n(a.parse(e))}catch(e){i?i(e):console.error(e),a.manager.itemError(t)}},r,i)}parse(e){function t(e){let t=[],n=[],s=[],c=[],l,u=/^[^\d.\s-]+/;function d(e){let t=[],n=e.split(/\s+/);for(let e=0;e<n.length;e++)n[e]!==``&&t.push(parseFloat(n[e]));return t}let f=/^(\d+)\s+([\s\d]*)/,p=/^POINTS /,m=/^POLYGONS /,h=/^TRIANGLE_STRIPS /,g=/^POINT_DATA[ ]+(\d+)/,_=/^CELL_DATA[ ]+(\d+)/,v=/^COLOR_SCALARS[ ]+(\w+)[ ]+3/,y=/^NORMALS[ ]+(\w+)[ ]+(\w+)/,b=!1,x=!1,S=!1,C=!1,w=!1,T=!1,E=!1,D=new r,O=e.split(`
2
- `);for(let e in O){let r=O[e].trim();if(r.indexOf(`DATASET`)===0){let e=r.split(` `)[1];if(e!==`POLYDATA`)throw Error(`Unsupported DATASET type: `+e)}else if(b){if(u.exec(r)===null){let e=d(r);for(let t=0;t+2<e.length;t+=3)n.push(e[t],e[t+1],e[t+2])}}else if(x){if((l=f.exec(r))!==null){let e=parseInt(l[1]),n=l[2].split(/\s+/);if(e>=3){let r=parseInt(n[0]),i=1;for(let a=0;a<e-2;++a){let e=parseInt(n[i]),a=parseInt(n[i+1]);t.push(r,e,a),i++}}}}else if(S){if((l=f.exec(r))!==null){let e=parseInt(l[1]),n=l[2].split(/\s+/);if(e>=3)for(let r=0;r<e-2;r++)if(r%2==1){let e=parseInt(n[r]),i=parseInt(n[r+2]),a=parseInt(n[r+1]);t.push(e,i,a)}else{let e=parseInt(n[r]),i=parseInt(n[r+1]),a=parseInt(n[r+2]);t.push(e,i,a)}}}else if(C||w){if(T){if(u.exec(r)===null){let e=d(r);for(let t=0;t+2<e.length;t+=3)D.setRGB(e[t],e[t+1],e[t+2],o),s.push(D.r,D.g,D.b)}}else if(E&&u.exec(r)===null){let e=d(r);for(let t=0;t+2<e.length;t+=3)c.push(e[t],e[t+1],e[t+2])}}m.exec(r)===null?p.exec(r)===null?h.exec(r)===null?g.exec(r)===null?_.exec(r)===null?v.exec(r)===null?y.exec(r)!==null&&(E=!0,T=!1,b=!1,x=!1,S=!1):(T=!0,E=!1,b=!1,x=!1,S=!1):(w=!0,b=!1,x=!1,S=!1):(C=!0,b=!1,x=!1,S=!1):(x=!1,b=!1,S=!0):(x=!1,b=!0,S=!1):(x=!0,b=!1,S=!1)}let k=new i;if(k.setIndex(t),k.setAttribute(`position`,new a(n,3)),c.length===n.length&&k.setAttribute(`normal`,new a(c,3)),s.length!==t.length)s.length===n.length&&k.setAttribute(`color`,new a(s,3));else{k=k.toNonIndexed();let e=k.attributes.position.count/3;if(s.length===e*3){let t=[];for(let n=0;n<e;n++){let e=s[3*n+0],r=s[3*n+1],i=s[3*n+2];D.setRGB(e,r,i,o),t.push(D.r,D.g,D.b),t.push(D.r,D.g,D.b),t.push(D.r,D.g,D.b)}k.setAttribute(`color`,new a(t,3))}}return k}function c(e){let t=new Uint8Array(e),r=new DataView(e),a=[],o=[],s=[],c=0;function l(e,t){let n=t,r=e[n],i=[];for(;r!==10&&n<e.length;)i.push(String.fromCharCode(r)),n++,r=e[n];return{start:t,end:n,next:n+1,parsedString:i.join(``)}}let u,d;for(;;){if(u=l(t,c),d=u.parsedString,d.indexOf(`DATASET`)===0){let e=d.split(` `)[1];if(e!==`POLYDATA`)throw Error(`Unsupported DATASET type: `+e)}else if(d.indexOf(`POINTS`)===0){let e=parseInt(d.split(` `)[1],10),t=e*4*3;a=new Float32Array(e*3);let n=u.next;for(let t=0;t<e;t++)a[3*t]=r.getFloat32(n,!1),a[3*t+1]=r.getFloat32(n+4,!1),a[3*t+2]=r.getFloat32(n+8,!1),n+=12;u.next=u.next+t+1}else if(d.indexOf(`TRIANGLE_STRIPS`)===0){let e=parseInt(d.split(` `)[1],10),t=parseInt(d.split(` `)[2],10),n=t*4;s=new Uint32Array(3*t-9*e);let i=0,a=u.next;for(let t=0;t<e;t++){let e=r.getInt32(a,!1),t=[];a+=4;for(let n=0;n<e;n++)t.push(r.getInt32(a,!1)),a+=4;for(let n=0;n<e-2;n++)n%2?(s[i++]=t[n],s[i++]=t[n+2],s[i++]=t[n+1]):(s[i++]=t[n],s[i++]=t[n+1],s[i++]=t[n+2])}u.next=u.next+n+1}else if(d.indexOf(`POLYGONS`)===0){let e=parseInt(d.split(` `)[1],10),t=parseInt(d.split(` `)[2],10),n=t*4;s=new Uint32Array(3*t-9*e);let i=0,a=u.next;for(let t=0;t<e;t++){let e=r.getInt32(a,!1),t=[];a+=4;for(let n=0;n<e;n++)t.push(r.getInt32(a,!1)),a+=4;for(let n=1;n<e-1;n++)s[i++]=t[0],s[i++]=t[n],s[i++]=t[n+1]}u.next=u.next+n+1}else if(d.indexOf(`POINT_DATA`)===0){let e=parseInt(d.split(` `)[1],10);u=l(t,u.next);let n=e*4*3;o=new Float32Array(e*3);let i=u.next;for(let t=0;t<e;t++)o[3*t]=r.getFloat32(i,!1),o[3*t+1]=r.getFloat32(i+4,!1),o[3*t+2]=r.getFloat32(i+8,!1),i+=12;u.next+=n}if(c=u.next,c>=t.byteLength)break}let f=new i;return f.setIndex(new n(s,1)),f.setAttribute(`position`,new n(a,3)),o.length===a.length&&f.setAttribute(`normal`,new n(o,3)),f}function l(e,t){let n=e.length,r=new Float32Array(n+t.length);return r.set(e),r.set(t,n),r}function u(e,t){let n=e.length,r=new Int32Array(n+t.length);return r.set(e),r.set(t,n),r}function d(e){function t(e){let n={};if(e.nodeType===1){if(e.attributes&&e.attributes.length>0){n.attributes={};for(let t=0;t<e.attributes.length;t++){let r=e.attributes.item(t);n.attributes[r.nodeName]=r.nodeValue.trim()}}}else e.nodeType===3&&(n=e.nodeValue.trim());if(e.hasChildNodes())for(let r=0;r<e.childNodes.length;r++){let i=e.childNodes.item(r),a=i.nodeName;if(n[a]===void 0){let e=t(i);e!==``&&(Array.isArray(e[`#text`])&&(e[`#text`]=e[`#text`][0]),n[a]=e)}else{if(n[a].push===void 0){let e=n[a];n[a]=[e]}let e=t(i);e!==``&&(Array.isArray(e[`#text`])&&(e[`#text`]=e[`#text`][0]),n[a].push(e))}}return n}function r(e){let t=typeof Uint8Array<`u`?Uint8Array:Array,n=[];for(let e=0;e<64;++e)n[`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`.charCodeAt(e)]=e;n[45]=62,n[95]=63;let r=e.length;if(r%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);let i=e[r-2]===`=`?2:+(e[r-1]===`=`),a=new t(r*3/4-i),o=i>0?r-4:r,s=0,c,l;for(c=0,l=0;c<o;c+=4,l+=3){let t=n[e.charCodeAt(c)]<<18|n[e.charCodeAt(c+1)]<<12|n[e.charCodeAt(c+2)]<<6|n[e.charCodeAt(c+3)];a[s++]=(t&16711680)>>16,a[s++]=(t&65280)>>8,a[s++]=t&255}if(i===2){let t=n[e.charCodeAt(c)]<<2|n[e.charCodeAt(c+1)]>>4;a[s++]=t&255}else if(i===1){let t=n[e.charCodeAt(c)]<<10|n[e.charCodeAt(c+1)]<<4|n[e.charCodeAt(c+2)]>>2;a[s++]=t>>8&255,a[s++]=t&255}return a}function a(e,t){let n=0;c.attributes.header_type===`UInt64`?n=8:c.attributes.header_type===`UInt32`&&(n=4);let i,a;if(e.attributes.format===`binary`&&t){e.attributes.type===`Float32`?i=new Float32Array:(e.attributes.type===`Int32`||e.attributes.type===`Int64`)&&(i=new Int32Array);let t=e[`#text`],o=r(Array.isArray(t)?t[0]:t),c=o[0];for(let e=1;e<n-1;e++)c|=o[e]<<e*8;let d=(c+3)*n,f=d%3>0?3-d%3:0;d+=f;let p=[],m=d;p.push(m);let h=3*n;for(let e=0;e<c;e++){let t=o[e*n+h];for(let r=1;r<n-1;r++)t|=o[e*n+h+r]<<r*8;m+=t,p.push(m)}for(let t=0;t<p.length-1;t++)a=s(o.slice(p[t],p[t+1])).buffer,e.attributes.type===`Float32`?(a=new Float32Array(a),i=l(i,a)):(e.attributes.type===`Int32`||e.attributes.type===`Int64`)&&(a=new Int32Array(a),i=u(i,a));delete e[`#text`],e.attributes.type===`Int64`&&e.attributes.format===`binary`&&(i=i.filter(function(e,t){if(t%2!=1)return!0}))}else e.attributes.format===`binary`&&!t?(a=r(e[`#text`]),a=a.slice(n).buffer):a=e[`#text`]?e[`#text`].split(/\s+/).filter(function(e){if(e!==``)return e}):new Int32Array().buffer,delete e[`#text`],e.attributes.type===`Float32`?i=new Float32Array(a):e.attributes.type===`Int32`?i=new Int32Array(a):e.attributes.type===`Int64`&&(i=new Int32Array(a),e.attributes.format===`binary`&&(i=i.filter(function(e,t){if(t%2!=1)return!0})));return i}let o=new DOMParser().parseFromString(e,`application/xml`).documentElement,c=t(o),d=[],f=[],p=[];if(c.AppendedData){let e=c.AppendedData[`#text`].slice(1),t=c.PolyData.Piece,n=[`PointData`,`CellData`,`Points`,`Verts`,`Lines`,`Strips`,`Polys`],r=0,i=n.map(e=>{let n=t[e];return n&&n.DataArray?(Array.isArray(n.DataArray)?n.DataArray:[n.DataArray]).map(e=>e.attributes.offset):[]}).flat();for(let a of n){let n=t[a];if(n&&n.DataArray)if(Array.isArray(n.DataArray))for(let t of n.DataArray)t[`#text`]=e.slice(i[r],i[r+1]),t.attributes.format=`binary`,r++;else n.DataArray[`#text`]=e.slice(i[r],i[r+1]),n.DataArray.attributes.format=`binary`,r++}}if(c.PolyData){let e=c.PolyData.Piece,t=c.attributes.hasOwnProperty(`compressor`),r=[`PointData`,`Points`,`Strips`,`Polys`],o=0,s=r.length;for(;o<s;){let n=e[r[o]];if(n&&n.DataArray){let i;i=Array.isArray(n.DataArray)?n.DataArray:[n.DataArray];let s=0,c=i.length;for(;s<c;)`#text`in i[s]&&i[s][`#text`].length>0&&(i[s].text=a(i[s],t)),s++;switch(r[o]){case`PointData`:{let t=parseInt(e.attributes.NumberOfPoints),r=n.attributes.Normals;if(t>0){for(let e=0,n=i.length;e<n;e++)if(r===i[e].attributes.Name){let n=i[e].attributes.NumberOfComponents;f=new Float32Array(t*n),f.set(i[e].text,0)}}}break;case`Points`:{let t=parseInt(e.attributes.NumberOfPoints);if(t>0){let e=n.DataArray.attributes.NumberOfComponents;d=new Float32Array(t*e),d.set(n.DataArray.text,0)}}break;case`Strips`:{let t=parseInt(e.attributes.NumberOfStrips);if(t>0){let e=new Int32Array(n.DataArray[0].text.length),r=new Int32Array(n.DataArray[1].text.length);e.set(n.DataArray[0].text,0),r.set(n.DataArray[1].text,0);let i=t+e.length;p=new Uint32Array(3*i-9*t);let a=0;for(let n=0,i=t;n<i;n++){let t=[];for(let i=0,a=r[n],o=0;i<a-o;i++)t.push(e[i]),n>0&&(o=r[n-1]);for(let e=0,i=r[n],o=0;e<i-o-2;e++)e%2?(p[a++]=t[e],p[a++]=t[e+2],p[a++]=t[e+1]):(p[a++]=t[e],p[a++]=t[e+1],p[a++]=t[e+2]),n>0&&(o=r[n-1])}}}break;case`Polys`:{let t=parseInt(e.attributes.NumberOfPolys);if(t>0){let e=new Int32Array(n.DataArray[0].text.length),r=new Int32Array(n.DataArray[1].text.length);e.set(n.DataArray[0].text,0),r.set(n.DataArray[1].text,0);let i=t+e.length;p=new Uint32Array(3*i-9*t);let a=0,o=0,s=0,c=0,l=t;for(;s<l;){let t=[],n=0,i=r[s];for(;n<i-c;)t.push(e[o++]),n++;let l=1;for(;l<i-c-1;)p[a++]=t[0],p[a++]=t[l],p[a++]=t[l+1],l++;s++,c=r[s-1]}}}break;default:break}}o++}let l=new i;return l.setIndex(new n(p,1)),l.setAttribute(`position`,new n(d,3)),f.length===d.length&&l.setAttribute(`normal`,new n(f,3)),l}else throw Error(`Unsupported DATASET type`)}let f=new TextDecoder,p=f.decode(new Uint8Array(e,0,250)).split(`
3
- `);return p[0].indexOf(`xml`)===-1?p[2].includes(`ASCII`)?t(f.decode(e)):c(e):d(f.decode(e))}};export{c as VTKLoader};
@@ -1,2 +0,0 @@
1
- import{C as e,K as t,p as n,u as r,w as i,wt as a}from"./three.module-BFsVh7r1.js";var o=class extends t{load(t,n,r,i){let a=this,o=new e(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(t,function(e){try{n(a.parse(e))}catch(e){i?i(e):console.error(e),a.manager.itemError(t)}},r,i)}parse(e){let t=e.split(`
2
- `),o=[],s=[],c=new n;for(let e of t){if(e=e.trim(),e.charAt(0)===`#`)continue;let t=e.split(/\s+/);if(t.length===3&&(o.push(parseFloat(t[0])),o.push(parseFloat(t[1])),o.push(parseFloat(t[2]))),t.length===6){o.push(parseFloat(t[0])),o.push(parseFloat(t[1])),o.push(parseFloat(t[2]));let e=parseFloat(t[3])/255,n=parseFloat(t[4])/255,r=parseFloat(t[5])/255;c.setRGB(e,n,r,a),s.push(c.r,c.g,c.b)}}let l=new r;return l.setAttribute(`position`,new i(o,3)),s.length>0&&l.setAttribute(`color`,new i(s,3)),l}};export{o as XYZLoader};