sema-code-ui 0.0.0-stage → 2.1.4
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.
- package/README.md +28 -2
- package/bin/sema-ui.js +2 -0
- package/dist/cli.js +4639 -0
- package/dist/public/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/public/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/public/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/public/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/public/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/public/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/public/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/public/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/public/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/public/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/public/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/public/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/public/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/public/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/public/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/public/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/public/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/public/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/public/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/public/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/public/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/public/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/public/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/public/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/public/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/public/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/public/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/public/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/public/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/public/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/public/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/public/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/public/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/public/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/public/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
- package/dist/public/assets/abnfDiagram-VCTEODGH-jerp7nR7.js +1 -0
- package/dist/public/assets/arc-BKtVw-5X.js +1 -0
- package/dist/public/assets/architectureDiagram-5GKGNRK7-CAQBfzNp.js +36 -0
- package/dist/public/assets/blockDiagram-I7D4REHJ-eT3AUuZb.js +129 -0
- package/dist/public/assets/c4Diagram-7LVT6UL2-DAAd027j.js +38 -0
- package/dist/public/assets/channel-COTmjPbb.js +1 -0
- package/dist/public/assets/chunk-2Q5K7J3B-D-9Y1d0N.js +1 -0
- package/dist/public/assets/chunk-5VM5RSS4-DwGFL19Q.js +15 -0
- package/dist/public/assets/chunk-F27PBJKO-BQ3tTrPF.js +1 -0
- package/dist/public/assets/chunk-IMKFNOWR-C1YkYZnB.js +231 -0
- package/dist/public/assets/chunk-JWPE2WC7-ddWKnZRa.js +1 -0
- package/dist/public/assets/chunk-POPQ4Y6H-fBnUAxGB.js +1 -0
- package/dist/public/assets/chunk-SVP7TREG-CMXiwsDR.js +88 -0
- package/dist/public/assets/chunk-TICWLB2K-DST453KD.js +206 -0
- package/dist/public/assets/chunk-XXDRQBXY-D5kNIT5P.js +1 -0
- package/dist/public/assets/classDiagram-ZZMXUADV-Lr4CIilS.js +1 -0
- package/dist/public/assets/classDiagram-v2-VYDZK3BY-Lr4CIilS.js +1 -0
- package/dist/public/assets/cose-bilkent-JH36ORCC-sc1yF5Gf.js +1 -0
- package/dist/public/assets/cynefin-OW5HDTMX-Dwe5aQpb.js +178 -0
- package/dist/public/assets/cynefinDiagram-5FMLGOSQ-W_SW62Ko.js +62 -0
- package/dist/public/assets/cytoscape.esm-Bch-eiPH.js +331 -0
- package/dist/public/assets/dagre-GXQ25YYZ-D99NrftV.js +4 -0
- package/dist/public/assets/defaultLocale-DX6XiGOO.js +1 -0
- package/dist/public/assets/diagram-S7CK7UJ4-DL3IhTh8.js +30 -0
- package/dist/public/assets/diagram-UQ7AKVKN-DSL_Joxa.js +41 -0
- package/dist/public/assets/diagram-VSXAHHWV-ge66Mn5n.js +3 -0
- package/dist/public/assets/diagram-VX7I27RA-BGeISp3y.js +24 -0
- package/dist/public/assets/diagram-Z3DM3KII-ClJeMRbb.js +24 -0
- package/dist/public/assets/docx-preview-BcbGRtLc.js +27 -0
- package/dist/public/assets/ebnfDiagram-PWID7BFC-Cn4t65pg.js +1 -0
- package/dist/public/assets/erDiagram-RLTQ6QDP-B1CfcDsm.js +99 -0
- package/dist/public/assets/exceljs.min-GkdcPpXr.js +57 -0
- package/dist/public/assets/flowDiagram-HODETNUW-BKAsEEya.js +168 -0
- package/dist/public/assets/ganttDiagram-EL5Y4UJY-wj_xV86l.js +292 -0
- package/dist/public/assets/gitGraphDiagram-WWUBYQGX-DcWUGLDO.js +106 -0
- package/dist/public/assets/index-2mLslaAC.js +931 -0
- package/dist/public/assets/index-BANUd07X.css +32 -0
- package/dist/public/assets/index-BP9qYm1I.js +1 -0
- package/dist/public/assets/index-B_RX2-hb.js +1 -0
- package/dist/public/assets/index-BeSy_WW1.js +198 -0
- package/dist/public/assets/index-C1rb1p6e.js +74 -0
- package/dist/public/assets/infoDiagram-27XIBGKW-DIKucIos.js +2 -0
- package/dist/public/assets/init-Gi6I4Gst.js +1 -0
- package/dist/public/assets/ishikawaDiagram-5VMMS53U-Bz_J0vOe.js +70 -0
- package/dist/public/assets/journeyDiagram-3NMN7TZE-CLkeMlCH.js +139 -0
- package/dist/public/assets/jstat-so0kbz-l.js +1 -0
- package/dist/public/assets/jszip.min-Cbc05ZIR.js +12 -0
- package/dist/public/assets/kanban-definition-UXKFOSKX-CwzN7MzX.js +89 -0
- package/dist/public/assets/layout-BcaUROCV.js +1 -0
- package/dist/public/assets/linear-Gq1n-w3C.js +1 -0
- package/dist/public/assets/mermaid.core-COBFmWjx.js +312 -0
- package/dist/public/assets/mindmap-definition-YA3MSWOX-DqRme-JA.js +96 -0
- package/dist/public/assets/ordinal-Cboi1Yqb.js +1 -0
- package/dist/public/assets/pdf-B5ZmZFk6.js +57 -0
- package/dist/public/assets/pdf.worker.min-BmVo14Nb.mjs +28 -0
- package/dist/public/assets/pdf.worker.min-LAOCk-LR.js +1 -0
- package/dist/public/assets/pegDiagram-XKGWAZYB-DaxTeHLN.js +1 -0
- package/dist/public/assets/pieDiagram-E7YTZNPT-D11GqVqw.js +39 -0
- package/dist/public/assets/pptx-preview.es-CaqkDSuh.js +28 -0
- package/dist/public/assets/quadrantDiagram-AXDQQJYC-fFb8l4El.js +7 -0
- package/dist/public/assets/railroadDiagram-O6MQD6OU-CIa-0P69.js +1 -0
- package/dist/public/assets/requirementDiagram-BXWQKSXE-BKzH5D9W.js +84 -0
- package/dist/public/assets/sankeyDiagram-P5KCCOFB-CtqHjl2H.js +40 -0
- package/dist/public/assets/sequenceDiagram-WJ2MYXX4-BpX3U60k.js +162 -0
- package/dist/public/assets/sizeCapture-INFHLROL-DsR9QL71.js +1 -0
- package/dist/public/assets/stateDiagram-D77RDMKH-0454rKey.js +1 -0
- package/dist/public/assets/stateDiagram-v2-MP3YSRHH-CYc0JDHV.js +1 -0
- package/dist/public/assets/swimlanes-42K2YHIH-BNRZBx_P.js +1 -0
- package/dist/public/assets/swimlanesDiagram-VR7AAH4N-DMo6Bf1N.js +8 -0
- package/dist/public/assets/timeline-definition-24CTP7MA-BNDN48o2.js +120 -0
- package/dist/public/assets/vennDiagram-4TSXK5OY-C2f8zI0e.js +34 -0
- package/dist/public/assets/wardleyDiagram-VM6X3IG4-CmfNgA4_.js +78 -0
- package/dist/public/assets/xychartDiagram-S5SC5T6Z-B2xKzCa7.js +7 -0
- package/dist/public/icon.svg +8 -0
- package/dist/public/index.html +14 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Add-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Add-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/B5pc-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/B5pc-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/CNS-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/CNS-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/CNS1-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/CNS1-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/CNS2-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/CNS2-V.bcmap +3 -0
- package/dist/public/pdfjs-6.3.289/cmaps/ETHK-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/ETHK-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/ETen-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/ETen-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/ETenms-B5-H.bcmap +3 -0
- package/dist/public/pdfjs-6.3.289/cmaps/ETenms-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Ext-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Ext-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GB-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GB-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GB-H.bcmap +4 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GB-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBK-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBK-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBK2K-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBK2K-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBT-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBT-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBT-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBT-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKdla-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKdla-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKm314-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKm314-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKm471-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKm471-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKscs-B5-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/HKscs-B5-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Hankaku.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Hiragana.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSC-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSC-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSC-Johab-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSC-Johab-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Katakana.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/LICENSE +36 -0
- package/dist/public/pdfjs-6.3.289/cmaps/NWP-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/NWP-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/RKSJ-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/RKSJ-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/Roman.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/V.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/cmaps/WP-Symbol.bcmap +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitDingbats.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixed.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerif.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/FoxitSymbol.pfb +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/LICENSE_FOXIT +27 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/LICENSE_LIBERATION +363 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/public/pdfjs-6.3.289/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/public/pdfjs-6.3.289/wasm/LICENSE_JBIG2 +196 -0
- package/dist/public/pdfjs-6.3.289/wasm/LICENSE_OPENJPEG +39 -0
- package/dist/public/pdfjs-6.3.289/wasm/LICENSE_PDFJS_JBIG2 +13 -0
- package/dist/public/pdfjs-6.3.289/wasm/LICENSE_PDFJS_OPENJPEG +22 -0
- package/dist/public/pdfjs-6.3.289/wasm/LICENSE_PDFJS_QCMS +19 -0
- package/dist/public/pdfjs-6.3.289/wasm/LICENSE_QCMS +21 -0
- package/dist/public/pdfjs-6.3.289/wasm/jbig2.wasm +0 -0
- package/dist/public/pdfjs-6.3.289/wasm/jbig2_nowasm_fallback.js +15 -0
- package/dist/public/pdfjs-6.3.289/wasm/openjpeg.wasm +0 -0
- package/dist/public/pdfjs-6.3.289/wasm/openjpeg_nowasm_fallback.js +17 -0
- package/dist/public/pdfjs-6.3.289/wasm/qcms_bg.wasm +0 -0
- package/dist/public/pdfjs-6.3.289/wasm/quickjs-eval.js +16 -0
- package/dist/public/pdfjs-6.3.289/wasm/quickjs-eval.wasm +0 -0
- package/dist/public/viz-runtime.js +2 -0
- package/dist/resources/README.md +89 -0
- package/dist/resources/chrome/.mcp.json +9 -0
- package/dist/resources/chrome/skills/chrome-use/SKILL.md +78 -0
- package/dist/resources/mcp/fetch.json +14 -0
- package/dist/resources/mcp/playwright.json +14 -0
- package/dist/resources/skills/android-native-dev.json +13 -0
- package/dist/resources/skills/archify.json +13 -0
- package/dist/resources/skills/avoid-ai-writing.json +13 -0
- package/dist/resources/skills/brainstorming.json +13 -0
- package/dist/resources/skills/budget-variance-analysis.json +13 -0
- package/dist/resources/skills/code-review.json +13 -0
- package/dist/resources/skills/contract-review.json +13 -0
- package/dist/resources/skills/decision-memo.json +13 -0
- package/dist/resources/skills/deck-from-doc.json +13 -0
- package/dist/resources/skills/documentation-and-adrs.json +13 -0
- package/dist/resources/skills/flutter-dev.json +13 -0
- package/dist/resources/skills/frontend-dev.json +13 -0
- package/dist/resources/skills/ios-application-dev.json +13 -0
- package/dist/resources/skills/landing-page-generator.json +13 -0
- package/dist/resources/skills/minimax-docx.json +14 -0
- package/dist/resources/skills/minimax-pdf.json +14 -0
- package/dist/resources/skills/minimax-xlsx.json +14 -0
- package/dist/resources/skills/pptx-generator.json +14 -0
- package/dist/resources/skills/react-native-dev.json +13 -0
- package/dist/resources/skills/remotion-best-practices.json +12 -0
- package/dist/resources/skills/shader-dev.json +13 -0
- package/dist/resources/skills/systematic-debugging.json +13 -0
- package/dist/resources/skills/visualize/SKILL.md +413 -0
- package/dist/resources/skills/visualize/card.json +7 -0
- package/dist/resources/skills/visualize/scripts/check.mjs +539 -0
- package/dist/resources/skills/visualize/scripts/path.mjs +24 -0
- package/dist/resources/skills/wiki-page-writer.json +13 -0
- package/dist/resources/skills/writing-plans.json +13 -0
- package/dist/worker-entry.js +326 -0
- package/package.json +49 -4
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import{a as to,g as eo}from"./index-2mLslaAC.js";import{a as no,r as ei}from"./jstat-so0kbz-l.js";function ro(t,n){for(var e=0;e<n.length;e++){const r=n[e];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const E=Object.getOwnPropertyDescriptor(r,i);E&&Object.defineProperty(t,i,E.get?E:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var an,rr;function Ke(){if(rr)return an;rr=1;class t{constructor(e,r){if(e==null&&r==null)this._data=[],this._refs=[];else{if(e.length!==r.length)throw Error("Collection: data length should match references length.");this._data=e,this._refs=r}}get data(){return this._data}get refs(){return this._refs}get length(){return this._data.length}add(e,r){this._data.push(e),this._refs.push(r)}}return an=t,an}var sn,ir;function At(){if(ir)return sn;ir=1;const t=Rt(),n=Ke(),e={NUMBER:0,ARRAY:1,BOOLEAN:2,STRING:3,RANGE_REF:4,CELL_REF:5,COLLECTIONS:6,NUMBER_NO_BOOLEAN:10},r=[1,1,2,6,24,120,720,5040,40320,362880,3628800,39916800,479001600,6227020800,87178291200,1307674368e3,20922789888e3,355687428096e3,6402373705728e3,121645100408832e3,243290200817664e4,5109094217170944e4,11240007277776077e5,2585201673888498e7,6204484017332394e8,15511210043330986e9,40329146112660565e10,10888869450418352e12,30488834461171387e13,8841761993739702e15,26525285981219107e16,8222838654177922e18,2631308369336935e20,8683317618811886e21,29523279903960416e22,10333147966386145e24,37199332678990125e25,13763753091226346e27,5230226174666011e29,20397882081197444e30,8159152832478977e32,3345252661316381e34,140500611775288e37,6041526306337383e37,2658271574788449e39,11962222086548019e40,5502622159812089e42,25862324151116818e43,12413915592536073e45,6082818640342675e47,30414093201713376e48,15511187532873822e50,8065817517094388e52,42748832840600255e53,2308436973392414e56,12696403353658276e57,7109985878048635e59,40526919504877214e60,23505613312828785e62,13868311854568984e64,832098711274139e67,5075802138772248e68,3146997326038794e70,198260831540444e73,12688693218588417e73,8247650592082472e75,5443449390774431e77,3647111091818868e79,24800355424368305e80,1711224524281413e83,11978571669969892e84,8504785885678623e86,61234458376886085e87,44701154615126844e89,3307885441519386e92,248091408113954e95,18854947016660504e95,14518309202828587e97,11324281178206297e99,8946182130782976e101,7156945704626381e103,5797126020747368e105,4753643337012842e107,3945523969720659e109,3314240134565353e111,281710411438055e114,24227095383672734e114,2107757298379528e117,18548264225739844e118,1650795516090846e121,14857159644817615e122,1352001527678403e125,12438414054641308e126,11567725070816416e128,1087366156656743e131,1032997848823906e133,9916779348709496e134,9619275968248212e136,9426890448883248e138,9332621544394415e140,9332621544394415e142],i={};Object.keys(e).forEach(h=>{i[e[h]]=h});class E{constructor(){this.Types=e,this.type2Number={number:e.NUMBER,boolean:e.BOOLEAN,string:e.STRING,object:-1}}checkFunctionResult(d){if(typeof d==="number"){if(isNaN(d))return t.VALUE;if(!isFinite(d))return t.NUM}return d??t.NULL}flattenDeep(d){return d.reduce((s,f)=>Array.isArray(f)?s.concat(this.flattenDeep(f)):s.concat(f),[])}acceptNumber(d,s=!0,f=!0){if(d instanceof t)return d;let N;if(typeof d=="number")N=d;else if(typeof d=="boolean")if(f)N=Number(d);else throw t.VALUE;else if(typeof d=="string"){if(d.length===0||(N=Number(d),N!==N))throw t.VALUE}else if(Array.isArray(d))if(s)N=this.acceptNumber(d[0][0]);else if(d[0].length===1)N=this.acceptNumber(d[0][0]);else throw t.VALUE;else throw Error("Unknown type in FormulaHelpers.acceptNumber");return N}flattenParams(d,s,f,N,c=null,l=1){if(d.length<l)throw t.ARG_MISSING([s]);c==null&&(c=s===e.NUMBER?0:s==null?null:""),d.forEach(p=>{const{isCellRef:R,isRangeRef:T,isArray:O}=p,m=p.value instanceof n,M=!R&&!T&&!O&&!m,I={isLiteral:M,isCellRef:R,isRangeRef:T,isArray:O,isUnion:m};if(M)p.omitted?p=c:p=this.accept(p,s,c),N(p,I);else if(R)N(p.value,I);else if(m){if(!f)throw t.VALUE;p=p.value.data,p=this.flattenDeep(p),p.forEach(w=>{N(w,I)})}else(T||O)&&(p=this.flattenDeep(p.value),p.forEach(w=>{N(w,I)}))})}accept(d,s=null,f,N=!0,c=!1){if(Array.isArray(s)&&(s=s[0]),d==null&&f===void 0)throw t.ARG_MISSING([s]);if(d==null)return f;if(typeof d!="object"||Array.isArray(d))return d;const l=d.isArray;if(d.value!=null&&(d=d.value),s==null)return d;if(d instanceof t)throw d;if(s===e.ARRAY){if(Array.isArray(d))return N?this.flattenDeep(d):d;if(d instanceof n)throw t.VALUE;if(c)return N?[d]:[[d]];throw t.VALUE}else if(s===e.COLLECTIONS)return d;l&&(d=d[0][0]);const p=this.type(d);if(s===e.STRING)p===e.BOOLEAN?d=d?"TRUE":"FALSE":d=`${d}`;else if(s===e.BOOLEAN){if(p===e.STRING)throw t.VALUE;p===e.NUMBER&&(d=!!d)}else if(s===e.NUMBER)d=this.acceptNumber(d,!1);else if(s===e.NUMBER_NO_BOOLEAN)d=this.acceptNumber(d,!1,!1);else throw t.VALUE;return d}type(d){let s=this.type2Number[typeof d];return s===-1&&(Array.isArray(d)?s=e.ARRAY:d.ref?d.ref.from?s=e.RANGE_REF:s=e.CELL_REF:d instanceof n&&(s=e.COLLECTIONS)),s}isRangeRef(d){return d.ref&&d.ref.from}isCellRef(d){return d.ref&&!d.ref.from}retrieveRanges(d,s,f){return f=u.extend(s,f),s=this.retrieveArg(d,s),s=o.accept(s,e.ARRAY,void 0,!1,!0),f!==s?(f=this.retrieveArg(d,f),f=o.accept(f,e.ARRAY,void 0,!1,!0)):f=s,[s,f]}retrieveArg(d,s){if(s===null)return{value:0,isArray:!1,omitted:!0};const f=d.utils.extractRefValue(s);return{value:f.val,isArray:f.isArray,ref:s.ref}}}const o=new E,A={isWildCard:h=>typeof h=="string"?/[*?]/.test(h):!1,toRegex:(h,d)=>RegExp(h.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/([^~]??)[?]/g,"$1.").replace(/([^~]??)[*]/g,"$1.*").replace(/~([?*])/g,"$1"),d)},a={parse:h=>{const d=typeof h;if(d==="string"){const s=h.toUpperCase();if(s==="TRUE"||s==="FALSE")return{op:"=",value:s==="TRUE"};const f=h.match(/(<>|>=|<=|>|<|=)(.*)/);if(f){let N=f[1],c;if(isNaN(f[2])){const l=f[2].toUpperCase();if(l==="TRUE"||l==="FALSE")c=l==="TRUE";else if(/#NULL!|#DIV\/0!|#VALUE!|#NAME\?|#NUM!|#N\/A|#REF!/.test(f[2]))c=new t(f[2]);else if(c=f[2],A.isWildCard(c))return{op:"wc",value:A.toRegex(c),match:N==="="}}else c=Number(f[2]);return{op:N,value:c}}else return A.isWildCard(h)?{op:"wc",value:A.toRegex(h),match:!0}:{op:"=",value:h}}else{if(d==="boolean"||d==="number"||Array.isArray(h)||h instanceof t)return{op:"=",value:h};throw Error(`Criteria.parse: type ${typeof h} not support`)}}},u={columnNumberToName:h=>{let d=h,s="",f=0;for(;d>0;)f=(d-1)%26,s=String.fromCharCode(65+f)+s,d=Math.floor((d-f)/26);return s},columnNameToNumber:h=>{h=h.toUpperCase();const d=h.length;let s=0;for(let f=0;f<d;f++){const N=h.charCodeAt(f);isNaN(N)||(s+=(N-64)*26**(d-f-1))}return s},extend:(h,d)=>{if(d==null)return h;let s,f;if(o.isCellRef(h))s=0,f=0;else if(o.isRangeRef(h))s=h.ref.to.row-h.ref.from.row,f=h.ref.to.col-h.ref.from.col;else throw Error("Address.extend should not reach here.");return o.isCellRef(d)?(s>0||f>0)&&(d={ref:{from:{col:d.ref.col,row:d.ref.row},to:{row:d.ref.row+s,col:d.ref.col+f}}}):(d.ref.to.row=d.ref.from.row+s,d.ref.to.col=d.ref.from.col+f),d}};return sn={FormulaHelpers:o,Types:e,ReversedTypes:i,Factorials:r,WildCard:A,Criteria:a,Address:u},sn}var cn,or;function Rt(){if(or)return cn;or=1;class t extends Error{constructor(e,r,i){if(super(r),r==null&&i==null&&t.errorMap.has(e))return t.errorMap.get(e);r==null&&i==null?(this._error=e,t.errorMap.set(e,this)):this._error=e,this.details=i}get error(){return this._error}get name(){return this._error}equals(e){return e instanceof t&&e._error===this._error}toString(){return this._error}}return t.errorMap=new Map,t.DIV0=new t("#DIV/0!"),t.NA=new t("#N/A"),t.NAME=new t("#NAME?"),t.NULL=new t("#NULL!"),t.NUM=new t("#NUM!"),t.REF=new t("#REF!"),t.VALUE=new t("#VALUE!"),t.NOT_IMPLEMENTED=n=>new t("#NAME?",`Function ${n} is not implemented.`),t.TOO_MANY_ARGS=n=>new t("#N/A",`Function ${n} has too many arguments.`),t.ARG_MISSING=n=>{const{Types:e}=At();return new t("#N/A",`Argument type ${n.map(r=>e[r]).join(", ")} is missing.`)},t.ERROR=(n,e)=>new t("#ERROR!",n,e),cn=t,cn}var un,ar;function ni(){if(ar)return un;ar=1;class t{}t.version="0.10.3";function n(S){let y="",g=S.length-1;for(;g>=0;)y+=S.charAt(g--);return y}function e(S,y){let g="";for(;g.length<y;)g+=S;return g}function r(S,y){let g=""+S;return g.length>=y?g:e("0",y-g.length)+g}function i(S,y){let g=""+S;return g.length>=y?g:e(" ",y-g.length)+g}function E(S,y){let g=""+S;return g.length>=y?g:g+e(" ",y-g.length)}function o(S,y){let g=""+Math.round(S);return g.length>=y?g:e("0",y-g.length)+g}function A(S,y){let g=""+S;return g.length>=y?g:e("0",y-g.length)+g}const a=Math.pow(2,32);function u(S,y){if(S>a||S<-a)return o(S,y);const g=Math.round(S);return A(g,y)}function h(S,y){return y=y||0,S.length>=7+y&&(S.charCodeAt(y)|32)===103&&(S.charCodeAt(y+1)|32)===101&&(S.charCodeAt(y+2)|32)===110&&(S.charCodeAt(y+3)|32)===101&&(S.charCodeAt(y+4)|32)===114&&(S.charCodeAt(y+5)|32)===97&&(S.charCodeAt(y+6)|32)===108}const d=[["Sun","Sunday"],["Mon","Monday"],["Tue","Tuesday"],["Wed","Wednesday"],["Thu","Thursday"],["Fri","Friday"],["Sat","Saturday"]],s=[["J","Jan","January"],["F","Feb","February"],["M","Mar","March"],["A","Apr","April"],["M","May","May"],["J","Jun","June"],["J","Jul","July"],["A","Aug","August"],["S","Sep","September"],["O","Oct","October"],["N","Nov","November"],["D","Dec","December"]];function f(S){S[0]="General",S[1]="0",S[2]="0.00",S[3]="#,##0",S[4]="#,##0.00",S[9]="0%",S[10]="0.00%",S[11]="0.00E+00",S[12]="# ?/?",S[13]="# ??/??",S[14]="m/d/yy",S[15]="d-mmm-yy",S[16]="d-mmm",S[17]="mmm-yy",S[18]="h:mm AM/PM",S[19]="h:mm:ss AM/PM",S[20]="h:mm",S[21]="h:mm:ss",S[22]="m/d/yy h:mm",S[37]="#,##0 ;(#,##0)",S[38]="#,##0 ;[Red](#,##0)",S[39]="#,##0.00;(#,##0.00)",S[40]="#,##0.00;[Red](#,##0.00)",S[45]="mm:ss",S[46]="[h]:mm:ss",S[47]="mmss.0",S[48]="##0.0E+0",S[49]="@",S[56]='"上午/下午 "hh"時"mm"分"ss"秒 "',S[65535]="General"}const N={};f(N);function c(S,y,g){const _=S<0?-1:1;let v=S*_,B=0,C=1,F=0,q=1,V=0,X=0,j=Math.floor(v);for(;V<y&&(j=Math.floor(v),F=j*C+B,X=j*V+q,!(v-j<5e-8));)v=1/(v-j),B=C,C=F,q=V,V=X;if(X>y&&(V>y?(X=q,F=B):(X=V,F=C)),!g)return[0,_*F,X];const at=Math.floor(_*F/X);return[at,_*F-at*X,X]}function l(S,y,g){if(S>2958465||S<0)return null;let _=S|0,v=Math.floor(86400*(S-_)),B=0,C=[];const F={D:_,T:v,u:86400*(S-_)-v,y:0,m:0,d:0,H:0,M:0,S:0,q:0};if(Math.abs(F.u)<1e-6&&(F.u=0),y&&y.date1904&&(_+=1462),F.u>.9999&&(F.u=0,++v===86400&&(F.T=v=0,++_,++F.D)),_===60)C=g?[1317,10,29]:[1900,2,29],B=3;else if(_===0)C=g?[1317,8,29]:[1900,1,0],B=6;else{_>60&&--_;const q=new Date(1900,0,1);q.setDate(q.getDate()+_-1),C=[q.getFullYear(),q.getMonth()+1,q.getDate()],B=q.getDay(),_<60&&(B=(B+6)%7),g&&(B=w())}return F.y=C[0],F.m=C[1],F.d=C[2],F.S=v%60,v=Math.floor(v/60),F.M=v%60,v=Math.floor(v/60),F.H=v,F.q=B,F}t.parse_date_code=l;const p=new Date(1899,11,31,0,0,0),R=p.getTime(),T=new Date(1900,2,1,0,0,0);function O(S,y){let g=S.getTime();return y?g-=1461*24*60*60*1e3:S>=T&&(g+=1440*60*1e3),(g-(R+(S.getTimezoneOffset()-p.getTimezoneOffset())*6e4))/(1440*60*1e3)}function m(S){return S.toString(10)}t._general_int=m;const M=(function(){const y=/\.(\d*[1-9])0+$/,g=/\.0*$/,_=/\.(\d*[1-9])0+/,v=/\.0*[Ee]/,B=/(E[+-])(\d)$/;function C(X){const j=X<0?12:11;let at=V(X.toFixed(12));return at.length<=j||(at=X.toPrecision(10),at.length<=j)?at:X.toExponential(5)}function F(X){let j=X.toFixed(11).replace(y,".$1");return j.length>(X<0?12:11)&&(j=X.toPrecision(6)),j}function q(X){for(let j=0;j!==X.length;++j)if((X.charCodeAt(j)|32)===101)return X.replace(_,".$1").replace(v,"E").replace("e","E").replace(B,"$10$2");return X}function V(X){return X.indexOf(".")>-1?X.replace(g,"").replace(y,".$1"):X}return function(j){let at=Math.floor(Math.log(Math.abs(j))*Math.LOG10E),st;return at>=-4&&at<=-1?st=j.toPrecision(10+at):Math.abs(at)<=9?st=C(j):at===10?st=j.toFixed(10).substr(0,12):st=F(j),V(q(st))}})();t._general_num=M;function I(S,y){switch(typeof S){case"string":return S;case"boolean":return S?"TRUE":"FALSE";case"number":return(S|0)===S?m(S):M(S);case"undefined":return"";case"object":if(S==null)return"";if(S instanceof Date)return Qt(14,O(S,y&&y.date1904),y)}throw new Error("unsupported value in General format: "+S)}t._general=I;function w(){return 0}function D(S,y,g,_){let v="",B=0,C=0,F=g.y,q,V=0;switch(S){case 98:F=g.y+543;case 121:switch(y.length){case 1:case 2:q=F%100,V=2;break;default:q=F%1e4,V=4;break}break;case 109:switch(y.length){case 1:case 2:q=g.m,V=y.length;break;case 3:return s[g.m-1][1];case 5:return s[g.m-1][0];default:return s[g.m-1][2]}break;case 100:switch(y.length){case 1:case 2:q=g.d,V=y.length;break;case 3:return d[g.q][0];default:return d[g.q][1]}break;case 104:switch(y.length){case 1:case 2:q=1+(g.H+11)%12,V=y.length;break;default:throw"bad hour format: "+y}break;case 72:switch(y.length){case 1:case 2:q=g.H,V=y.length;break;default:throw"bad hour format: "+y}break;case 77:switch(y.length){case 1:case 2:q=g.M,V=y.length;break;default:throw"bad minute format: "+y}break;case 115:if(y!=="s"&&y!=="ss"&&y!==".0"&&y!==".00"&&y!==".000")throw"bad second format: "+y;return g.u===0&&(y==="s"||y==="ss")?r(g.S,y.length):(_>=2?C=_===3?1e3:100:C=_===1?10:1,B=Math.round(C*(g.S+g.u)),B>=60*C&&(B=0),y==="s"?B===0?"0":""+B/C:(v=r(B,2+_),y==="ss"?v.substr(0,2):"."+v.substr(2,y.length-1)));case 90:switch(y){case"[h]":case"[hh]":q=g.D*24+g.H;break;case"[m]":case"[mm]":q=(g.D*24+g.H)*60+g.M;break;case"[s]":case"[ss]":q=((g.D*24+g.H)*60+g.M)*60+Math.round(g.S+g.u);break;default:throw"bad abstime format: "+y}V=y.length===3?1:2;break;case 101:q=F,V=1}return V>0?r(q,V):""}function G(S){if(S.length<=3)return S;let g=S.length%3,_=S.substr(0,g);for(;g!==S.length;g+=3)_+=(_.length>0?",":"")+S.substr(g,3);return _}const H=(function(){const y=/%/g;function g(x,U,L){const P=U.replace(y,""),k=U.length-P.length;return H(x,P,L*Math.pow(10,2*k))+e("%",k)}function _(x,U,L){let P=U.length-1;for(;U.charCodeAt(P-1)===44;)--P;return H(x,U.substr(0,P),L/Math.pow(10,3*(U.length-P)))}function v(x,U){let L,P=x.indexOf("E")-x.indexOf(".")-1;if(x.match(/^#+0.0E\+0$/)){if(U===0)return"0.0E+0";if(U<0)return"-"+v(x,-U);let k=x.indexOf(".");k===-1&&(k=x.indexOf("E"));let K=Math.floor(Math.log(U)*Math.LOG10E)%k;if(K<0&&(K+=k),L=(U/Math.pow(10,K)).toPrecision(P+1+(k+K)%k),L.indexOf("e")===-1){const nt=Math.floor(Math.log(U)*Math.LOG10E);for(L.indexOf(".")===-1?L=L.charAt(0)+"."+L.substr(1)+"E+"+(nt-L.length+K):L+="E+"+(nt-K);L.substr(0,2)==="0.";)L=L.charAt(0)+L.substr(2,k)+"."+L.substr(2+k),L=L.replace(/^0+([1-9])/,"$1").replace(/^0+\./,"0.");L=L.replace(/\+-/,"-")}L=L.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(nt,ft,pt,tt){return ft+pt+tt.substr(0,(k+K)%k)+"."+tt.substr(K)+"E"})}else L=U.toExponential(P);return x.match(/E\+00$/)&&L.match(/e[+-]\d$/)&&(L=L.substr(0,L.length-1)+"0"+L.charAt(L.length-1)),x.match(/E\-/)&&L.match(/e\+/)&&(L=L.replace(/e\+/,"e")),L.replace("e","E")}const B=/# (\?+)( ?)\/( ?)(\d+)/;function C(x,U,L){const P=parseInt(x[4],10),k=Math.round(U*P),K=Math.floor(k/P);let nt=k-K*P,ft=P;return L+(K===0?"":""+K)+" "+(nt===0?e(" ",x[1].length+1+x[4].length):i(nt,x[1].length)+x[2]+"/"+x[3]+r(ft,x[4].length))}function F(x,U,L){return L+(U===0?"":""+U)+e(" ",x[1].length+2+x[4].length)}const q=/^#*0*\.([0#]+)/,V=/\).*[0#]/,X=/\(###\) ###\\?-####/;function j(x){let U="",L;for(let P=0;P!==x.length;++P)switch(L=x.charCodeAt(P)){case 35:break;case 63:U+=" ";break;case 48:U+="0";break;default:U+=String.fromCharCode(L)}return U}function at(x,U){const L=Math.pow(10,U);return""+Math.round(x*L)/L}function st(x,U){return U<(""+Math.round((x-Math.floor(x))*Math.pow(10,U))).length?0:Math.round((x-Math.floor(x))*Math.pow(10,U))}function ie(x,U){return U<(""+Math.round((x-Math.floor(x))*Math.pow(10,U))).length?1:0}function ue(x){return x<2147483647&&x>-2147483648?""+(x>=0?x|0:x-1|0):""+Math.floor(x)}function ct(x,U,L){if(x.charCodeAt(0)===40&&!U.match(V)){const et=U.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return L>=0?ct("n",et,L):"("+ct("n",et,-L)+")"}if(U.charCodeAt(U.length-1)===44)return _(x,U,L);if(U.indexOf("%")!==-1)return g(x,U,L);if(U.indexOf("E")!==-1)return v(U,L);if(U.charCodeAt(0)===36)return"$"+ct(x,U.substr(U.charAt(1)==" "?2:1),L);let P,k,K,nt,ft=Math.abs(L),pt=L<0?"-":"";if(U.match(/^00+$/))return pt+u(ft,U.length);if(U.match(/^[#?]+$/))return P=u(L,0),P==="0"&&(P=""),P.length>U.length?P:j(U.substr(0,U.length-P.length))+P;if(k=U.match(B))return C(k,ft,pt);if(U.match(/^#+0+$/))return pt+u(ft,U.length-U.indexOf("0"));if(k=U.match(q))return P=at(L,k[1].length).replace(/^([^\.]+)$/,"$1."+j(k[1])).replace(/\.$/,"."+j(k[1])).replace(/\.(\d*)$/,function(et,Zt){return"."+Zt+e("0",j(k[1]).length-Zt.length)}),U.indexOf("0.")!==-1?P:P.replace(/^0\./,".");if(U=U.replace(/^#+([0.])/,"$1"),k=U.match(/^(0*)\.(#*)$/))return pt+at(ft,k[2].length).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,k[1].length?"0.":".");if(k=U.match(/^#{1,3},##0(\.?)$/))return pt+G(u(ft,0));if(k=U.match(/^#,##0\.([#0]*0)$/))return L<0?"-"+ct(x,U,-L):G(""+(Math.floor(L)+ie(L,k[1].length)))+"."+r(st(L,k[1].length),k[1].length);if(k=U.match(/^#,#*,#0/))return ct(x,U.replace(/^#,#*,/,""),L);if(k=U.match(/^([0#]+)(\\?-([0#]+))+$/))return P=n(ct(x,U.replace(/[\\-]/g,""),L)),K=0,n(n(U.replace(/\\/g,"")).replace(/[0#]/g,function(et){return K<P.length?P.charAt(K++):et==="0"?"0":""}));if(U.match(X))return P=ct(x,"##########",L),"("+P.substr(0,3)+") "+P.substr(3,3)+"-"+P.substr(6);let tt="";if(k=U.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return K=Math.min(k[4].length,7),nt=c(ft,Math.pow(10,K)-1,!1),P=""+pt,tt=H("n",k[1],nt[1]),tt.charAt(tt.length-1)===" "&&(tt=tt.substr(0,tt.length-1)+"0"),P+=tt+k[2]+"/"+k[3],tt=E(nt[2],K),tt.length<k[4].length&&(tt=j(k[4].substr(k[4].length-tt.length))+tt),P+=tt,P;if(k=U.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return K=Math.min(Math.max(k[1].length,k[4].length),7),nt=c(ft,Math.pow(10,K)-1,!0),pt+(nt[0]||(nt[1]?"":"0"))+" "+(nt[1]?i(nt[1],K)+k[2]+"/"+k[3]+E(nt[2],K):e(" ",2*K+1+k[2].length+k[3].length));if(k=U.match(/^[#0?]+$/))return P=u(L,0),U.length<=P.length?P:j(U.substr(0,U.length-P.length))+P;if(k=U.match(/^([#0?]+)\.([#0]+)$/)){P=""+L.toFixed(Math.min(k[2].length,10)).replace(/([^0])0+$/,"$1"),K=P.indexOf(".");const et=U.indexOf(".")-K,Zt=U.length-P.length-et;return j(U.substr(0,et)+P+U.substr(U.length-Zt))}if(k=U.match(/^00,000\.([#0]*0)$/))return K=st(L,k[1].length),L<0?"-"+ct(x,U,-L):G(ue(L)).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(et){return"00,"+(et.length<3?r(0,3-et.length):"")+et})+"."+r(K,k[1].length);switch(U){case"###,##0.00":return ct(x,"#,##0.00",L);case"###,###":case"##,###":case"#,###":const et=G(u(ft,0));return et!=="0"?pt+et:"";case"###,###.00":return ct(x,"###,##0.00",L).replace(/^0\./,".");case"#,###.00":return ct(x,"#,##0.00",L).replace(/^0\./,".")}throw new Error("unsupported format |"+U+"|")}function Q(x,U,L){let P=U.length-1;for(;U.charCodeAt(P-1)===44;)--P;return H(x,U.substr(0,P),L/Math.pow(10,3*(U.length-P)))}function ut(x,U,L){const P=U.replace(y,""),k=U.length-P.length;return H(x,P,L*Math.pow(10,2*k))+e("%",k)}function vt(x,U){let L,P=x.indexOf("E")-x.indexOf(".")-1;if(x.match(/^#+0.0E\+0$/)){if(U===0)return"0.0E+0";if(U<0)return"-"+vt(x,-U);let k=x.indexOf(".");k===-1&&(k=x.indexOf("E"));let K=Math.floor(Math.log(U)*Math.LOG10E)%k;if(K<0&&(K+=k),L=(U/Math.pow(10,K)).toPrecision(P+1+(k+K)%k),!L.match(/[Ee]/)){const nt=Math.floor(Math.log(U)*Math.LOG10E);L.indexOf(".")===-1?L=L.charAt(0)+"."+L.substr(1)+"E+"+(nt-L.length+K):L+="E+"+(nt-K),L=L.replace(/\+-/,"-")}L=L.replace(/^([+-]?)(\d*)\.(\d*)[Ee]/,function(nt,ft,pt,tt){return ft+pt+tt.substr(0,(k+K)%k)+"."+tt.substr(K)+"E"})}else L=U.toExponential(P);return x.match(/E\+00$/)&&L.match(/e[+-]\d$/)&&(L=L.substr(0,L.length-1)+"0"+L.charAt(L.length-1)),x.match(/E\-/)&&L.match(/e\+/)&&(L=L.replace(/e\+/,"e")),L.replace("e","E")}function J(x,U,L){if(x.charCodeAt(0)===40&&!U.match(V)){const et=U.replace(/\( */,"").replace(/ \)/,"").replace(/\)/,"");return L>=0?J("n",et,L):"("+J("n",et,-L)+")"}if(U.charCodeAt(U.length-1)===44)return Q(x,U,L);if(U.indexOf("%")!==-1)return ut(x,U,L);if(U.indexOf("E")!==-1)return vt(U,L);if(U.charCodeAt(0)===36)return"$"+J(x,U.substr(U.charAt(1)==" "?2:1),L);let P,k,K,nt,ft=Math.abs(L),pt=L<0?"-":"";if(U.match(/^00+$/))return pt+r(ft,U.length);if(U.match(/^[#?]+$/))return P=""+L,L===0&&(P=""),P.length>U.length?P:j(U.substr(0,U.length-P.length))+P;if(k=U.match(B))return F(k,ft,pt);if(U.match(/^#+0+$/))return pt+r(ft,U.length-U.indexOf("0"));if(k=U.match(q))return P=(""+L).replace(/^([^\.]+)$/,"$1."+j(k[1])).replace(/\.$/,"."+j(k[1])),P=P.replace(/\.(\d*)$/,function(et,Zt){return"."+Zt+e("0",j(k[1]).length-Zt.length)}),U.indexOf("0.")!==-1?P:P.replace(/^0\./,".");if(U=U.replace(/^#+([0.])/,"$1"),k=U.match(/^(0*)\.(#*)$/))return pt+(""+ft).replace(/\.(\d*[1-9])0*$/,".$1").replace(/^(-?\d*)$/,"$1.").replace(/^0\./,k[1].length?"0.":".");if(k=U.match(/^#{1,3},##0(\.?)$/))return pt+G(""+ft);if(k=U.match(/^#,##0\.([#0]*0)$/))return L<0?"-"+J(x,U,-L):G(""+L)+"."+e("0",k[1].length);if(k=U.match(/^#,#*,#0/))return J(x,U.replace(/^#,#*,/,""),L);if(k=U.match(/^([0#]+)(\\?-([0#]+))+$/))return P=n(J(x,U.replace(/[\\-]/g,""),L)),K=0,n(n(U.replace(/\\/g,"")).replace(/[0#]/g,function(et){return K<P.length?P.charAt(K++):et==="0"?"0":""}));if(U.match(X))return P=J(x,"##########",L),"("+P.substr(0,3)+") "+P.substr(3,3)+"-"+P.substr(6);let tt="";if(k=U.match(/^([#0?]+)( ?)\/( ?)([#0?]+)/))return K=Math.min(k[4].length,7),nt=c(ft,Math.pow(10,K)-1,!1),P=""+pt,tt=H("n",k[1],nt[1]),tt.charAt(tt.length-1)==" "&&(tt=tt.substr(0,tt.length-1)+"0"),P+=tt+k[2]+"/"+k[3],tt=E(nt[2],K),tt.length<k[4].length&&(tt=j(k[4].substr(k[4].length-tt.length))+tt),P+=tt,P;if(k=U.match(/^# ([#0?]+)( ?)\/( ?)([#0?]+)/))return K=Math.min(Math.max(k[1].length,k[4].length),7),nt=c(ft,Math.pow(10,K)-1,!0),pt+(nt[0]||(nt[1]?"":"0"))+" "+(nt[1]?i(nt[1],K)+k[2]+"/"+k[3]+E(nt[2],K):e(" ",2*K+1+k[2].length+k[3].length));if(k=U.match(/^[#0?]+$/))return P=""+L,U.length<=P.length?P:j(U.substr(0,U.length-P.length))+P;if(k=U.match(/^([#0]+)\.([#0]+)$/)){P=""+L.toFixed(Math.min(k[2].length,10)).replace(/([^0])0+$/,"$1"),K=P.indexOf(".");let et=U.indexOf(".")-K,Zt=U.length-P.length-et;return j(U.substr(0,et)+P+U.substr(U.length-Zt))}if(k=U.match(/^00,000\.([#0]*0)$/))return L<0?"-"+J(x,U,-L):G(""+L).replace(/^\d,\d{3}$/,"0$&").replace(/^\d*$/,function(et){return"00,"+(et.length<3?r(0,3-et.length):"")+et})+"."+r(0,k[1].length);switch(U){case"###,###":case"##,###":case"#,###":const et=G(""+ft);return et!=="0"?pt+et:"";default:if(U.match(/\.[0#?]*$/))return J(x,U.slice(0,U.lastIndexOf(".")),L)+j(U.slice(U.lastIndexOf(".")))}throw new Error("unsupported format |"+U+"|")}return function(U,L,P){return(P|0)===P?J(U,L,P):ct(U,L,P)}})();function b(S){const y=[];let g=!1,_=0;for(let v=0;v<S.length;++v)switch(S.charCodeAt(v)){case 34:g=!g;break;case 95:case 42:case 92:++v;break;case 59:y[y.length]=S.substr(_,v-_),_=v+1}if(y[y.length]=S.substr(_),g===!0)throw new Error("Format |"+S+"| unterminated string ");return y}t._split=b;const z=/\[[HhMmSs]*\]/;function Z(S){let y=0,g="",_="";for(;y<S.length;)switch(g=S.charAt(y)){case"G":h(S,y)&&(y+=6),y++;break;case'"':for(;S.charCodeAt(++y)!==34&&y<S.length;)++y;++y;break;case"\\":y+=2;break;case"_":y+=2;break;case"@":++y;break;case"B":case"b":if(S.charAt(y+1)==="1"||S.charAt(y+1)==="2")return!0;case"M":case"D":case"Y":case"H":case"S":case"E":case"m":case"d":case"y":case"h":case"s":case"e":case"g":return!0;case"A":case"a":if(S.substr(y,3).toUpperCase()==="A/P"||S.substr(y,5).toUpperCase()==="AM/PM")return!0;++y;break;case"[":for(_=g;S.charAt(y++)!=="]"&&y<S.length;)_+=S.charAt(y);if(_.match(z))return!0;break;case".":case"0":case"#":for(;y<S.length&&("0#?.,E+-%".indexOf(g=S.charAt(++y))>-1||g=="\\"&&S.charAt(y+1)=="-"&&"0#".indexOf(S.charAt(y+2))>-1););break;case"?":for(;S.charAt(++y)===g;);break;case"*":++y,(S.charAt(y)===" "||S.charAt(y)==="*")&&++y;break;case"(":case")":++y;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(;y<S.length&&"0123456789".indexOf(S.charAt(++y))>-1;);break;case" ":++y;break;default:++y;break}return!1}t.is_date=Z;function rt(S,y,g,_){let v=[],B="",C=0,F="",q="t",V,X,j,at="H";for(;C<S.length;)switch(F=S.charAt(C)){case"G":if(!h(S,C))throw new Error("unrecognized character "+F+" in "+S);v[v.length]={t:"G",v:"General"},C+=7;break;case'"':for(B="";(j=S.charCodeAt(++C))!==34&&C<S.length;)B+=String.fromCharCode(j);v[v.length]={t:"t",v:B},++C;break;case"\\":const U=S.charAt(++C),L=U==="("||U===")"?U:"t";v[v.length]={t:L,v:U},++C;break;case"_":v[v.length]={t:"t",v:" "},C+=2;break;case"@":v[v.length]={t:"T",v:y},++C;break;case"B":case"b":if(S.charAt(C+1)==="1"||S.charAt(C+1)==="2"){if(V==null&&(V=l(y,g,S.charAt(C+1)==="2"),V==null))return"";v[v.length]={t:"X",v:S.substr(C,2)},q=F,C+=2;break}case"M":case"D":case"Y":case"H":case"S":case"E":F=F.toLowerCase();case"m":case"d":case"y":case"h":case"s":case"e":case"g":if(y<0||V==null&&(V=l(y,g),V==null))return"";for(B=F;++C<S.length&&S.charAt(C).toLowerCase()===F;)B+=F;F==="m"&&q.toLowerCase()==="h"&&(F="M"),F==="h"&&(F=at),v[v.length]={t:F,v:B},q=F;break;case"A":case"a":const P={t:F,v:F};if(V==null&&(V=l(y,g)),S.substr(C,3).toUpperCase()==="A/P"?(V!=null&&(P.v=V.H>=12?"P":"A"),P.t="T",at="h",C+=3):S.substr(C,5).toUpperCase()==="AM/PM"?(V!=null&&(P.v=V.H>=12?"PM":"AM"),P.t="T",C+=5,at="h"):(P.t="t",++C),V==null&&P.t==="T")return"";v[v.length]=P,q=F;break;case"[":for(B=F;S.charAt(C++)!=="]"&&C<S.length;)B+=S.charAt(C);if(B.slice(-1)!=="]")throw'unterminated "[" block: |'+B+"|";if(B.match(z)){if(V==null&&(V=l(y,g),V==null))return"";v[v.length]={t:"Z",v:B.toLowerCase()},q=B.charAt(1)}else B.indexOf("$")>-1&&(B=(B.match(/\$([^-\[\]]*)/)||[])[1]||"$",Z(S)||(v[v.length]={t:"t",v:B}));break;case".":if(V!=null){for(B=F;++C<S.length&&(F=S.charAt(C))==="0";)B+=F;v[v.length]={t:"s",v:B};break}case"0":case"#":for(B=F;++C<S.length&&"0#?.,E+-%".indexOf(F=S.charAt(C))>-1||F=="\\"&&S.charAt(C+1)=="-"&&C<S.length-2&&"0#".indexOf(S.charAt(C+2))>-1;)B+=F;v[v.length]={t:"n",v:B};break;case"?":for(B=F;S.charAt(++C)===F;)B+=F;v[v.length]={t:F,v:B},q=F;break;case"*":++C,(S.charAt(C)===" "||S.charAt(C)==="*")&&++C;break;case"(":case")":v[v.length]={t:_===1||typeof y=="number"&&y<0?"t":F,v:F},++C;break;case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":for(B=F;C<S.length&&"0123456789".indexOf(S.charAt(++C))>-1;)B+=S.charAt(C);v[v.length]={t:"D",v:B};break;case" ":v[v.length]={t:F,v:F},++C;break;default:if(",$-+/():!^&'~{}<>=€acfijklopqrtuvwxzP".indexOf(F)===-1)throw new Error("unrecognized character "+F+" in "+S);v[v.length]={t:"t",v:F},++C;break}let st=0,ie=0,ue;for(C=v.length-1,q="t";C>=0;--C)switch(v[C].t){case"h":case"H":v[C].t=at,q="h",st<1&&(st=1);break;case"s":(ue=v[C].v.match(/\.0+$/))&&(ie=Math.max(ie,ue[0].length-1)),st<3&&(st=3);case"d":case"y":case"M":case"e":q=v[C].t;break;case"m":q==="s"&&(v[C].t="M",st<2&&(st=2));break;case"X":break;case"Z":st<1&&v[C].v.match(/[Hh]/)&&(st=1),st<2&&v[C].v.match(/[Mm]/)&&(st=2),st<3&&v[C].v.match(/[Ss]/)&&(st=3)}switch(st){case 0:break;case 1:V.u>=.5&&(V.u=0,++V.S),V.S>=60&&(V.S=0,++V.M),V.M>=60&&(V.M=0,++V.H);break;case 2:V.u>=.5&&(V.u=0,++V.S),V.S>=60&&(V.S=0,++V.M);break}let ct="",Q;for(C=0;C<v.length;++C)switch(v[C].t){case"t":case"T":case" ":case"D":break;case"X":v[C].v="",v[C].t=";";break;case"d":case"m":case"y":case"h":case"H":case"M":case"s":case"e":case"b":case"Z":v[C].v=D(v[C].t.charCodeAt(0),v[C].v,V,ie),v[C].t="t";break;case"n":case"(":case"?":for(Q=C+1;v[Q]!=null&&((F=v[Q].t)==="?"||F==="D"||(F===" "||F==="t")&&v[Q+1]!=null&&(v[Q+1].t==="?"||v[Q+1].t==="t"&&v[Q+1].v==="/")||v[C].t==="("&&(F===" "||F==="n"||F===")")||F==="t"&&(v[Q].v==="/"||v[Q].v===" "&&v[Q+1]!=null&&v[Q+1].t==="?"));)v[C].v+=v[Q].v,v[Q]={v:"",t:";"},++Q;ct+=v[C].v,C=Q-1;break;case"G":v[C].t="t",v[C].v=I(y,g);break}let ut="",vt,J;if(ct.length>0){ct.charCodeAt(0)===40?(vt=y<0&&ct.charCodeAt(0)===45?-y:y,J=H("(",ct,vt)):(vt=y<0&&_>1?-y:y,J=H("n",ct,vt),vt<0&&v[0]&&v[0].t==="t"&&(J=J.substr(1),v[0].v="-"+v[0].v)),Q=J.length-1;let U=v.length;for(C=0;C<v.length;++C)if(v[C]!=null&&v[C].t!=="t"&&v[C].v.indexOf(".")>-1){U=C;break}let L=v.length;if(U===v.length&&J.indexOf("E")===-1){for(C=v.length-1;C>=0;--C)v[C]==null||"n?(".indexOf(v[C].t)===-1||(Q>=v[C].v.length-1?(Q-=v[C].v.length,v[C].v=J.substr(Q+1,v[C].v.length)):Q<0?v[C].v="":(v[C].v=J.substr(0,Q+1),Q=-1),v[C].t="t",L=C);Q>=0&&L<v.length&&(v[L].v=J.substr(0,Q+1)+v[L].v)}else if(U!==v.length&&J.indexOf("E")===-1){for(Q=J.indexOf(".")-1,C=U;C>=0;--C)if(!(v[C]==null||"n?(".indexOf(v[C].t)===-1)){for(X=v[C].v.indexOf(".")>-1&&C===U?v[C].v.indexOf(".")-1:v[C].v.length-1,ut=v[C].v.substr(X+1);X>=0;--X)Q>=0&&(v[C].v.charAt(X)==="0"||v[C].v.charAt(X)==="#")&&(ut=J.charAt(Q--)+ut);v[C].v=ut,v[C].t="t",L=C}for(Q>=0&&L<v.length&&(v[L].v=J.substr(0,Q+1)+v[L].v),Q=J.indexOf(".")+1,C=U;C<v.length;++C)if(!(v[C]==null||"n?(".indexOf(v[C].t)===-1&&C!==U)){for(X=v[C].v.indexOf(".")>-1&&C===U?v[C].v.indexOf(".")+1:0,ut=v[C].v.substr(0,X);X<v[C].v.length;++X)Q<J.length&&(ut+=J.charAt(Q++));v[C].v=ut,v[C].t="t",L=C}}}for(C=0;C<v.length;++C)v[C]!=null&&"n(?".indexOf(v[C].t)>-1&&(vt=_>1&&y<0&&C>0&&v[C-1].v==="-"?-y:y,v[C].v=H(v[C].t,v[C].v,vt),v[C].t="t");let x="";for(C=0;C!==v.length;++C)v[C]!=null&&(x+=v[C].v);return x}t._eval=rt;const Ut=/\[[=<>]/,wt=/\[([=<>]*)(-?\d+\.?\d*)\]/;function zt(S,y){if(y==null)return!1;const g=parseFloat(y[2]);switch(y[1]){case"=":if(S===g)return!0;break;case">":if(S>g)return!0;break;case"<":if(S<g)return!0;break;case"<>":if(S!==g)return!0;break;case">=":if(S>=g)return!0;break;case"<=":if(S<=g)return!0;break}return!1}function Dt(S,y){let g=b(S),_=g.length,v=g[_-1].indexOf("@");if(_<4&&v>-1&&--_,g.length>4)throw new Error("cannot find right format for |"+g.join("|")+"|");if(typeof y!="number")return[4,g.length===4||v>-1?g[g.length-1]:"@"];switch(g.length){case 1:g=v>-1?["General","General","General",g[0]]:[g[0],g[0],g[0],"@"];break;case 2:g=v>-1?[g[0],g[0],g[0],g[1]]:[g[0],g[1],g[0],"@"];break;case 3:g=v>-1?[g[0],g[1],g[0],g[2]]:[g[0],g[1],g[2],"@"];break}const B=y>0?g[0]:y<0?g[1]:g[2];if(g[0].indexOf("[")===-1&&g[1].indexOf("[")===-1)return[_,B];if(g[0].match(Ut)!=null||g[1].match(Ut)!=null){const C=g[0].match(wt),F=g[1].match(wt);return zt(y,C)?[_,g[0]]:zt(y,F)?[_,g[1]]:[_,g[C!=null&&F!=null?2:1]]}return[_,B]}function Qt(S,y,g){g==null&&(g={});let _="";switch(typeof S){case"string":S==="m/d/yy"&&g.dateNF?_=g.dateNF:_=S;break;case"number":S===14&&g.dateNF?_=g.dateNF:_=(g.table!=null?g.table:N)[S];break}if(h(_,0))return I(y,g);y instanceof Date&&(y=O(y,g.date1904));const v=Dt(_,y);if(h(v[1]))return I(y,g);if(y===!0)y="TRUE";else if(y===!1)y="FALSE";else if(y===""||y==null)return"";return rt(v[1],y,g,v[0])}function re(S,y){if(typeof y!="number"){y=+y||-1;for(let g=0;g<392;++g){if(N[g]===void 0){y<0&&(y=g);continue}if(N[g]===S){y=g;break}}y<0&&(y=391)}return N[y]=S,y}return t.load=re,t._table=N,t.get_table=function(){return N},t.load_table=function(y){for(let g=0;g!==392;++g)y[g]!==void 0&&re(y[g],g)},t.init_table=f,t.format=Qt,un=t,un}var ln={exports:{}},sr;function io(){return sr||(sr=1,(function(t){const n="ศูนย์บาทถ้วน",e=["","หนึ่ง","สอง","สาม","สี่","ห้า","หก","เจ็ด","แปด","เก้า"],r=["","สิบ","ร้อย","พัน","หมื่น","แสน","ล้าน"];function i(a){let u="";const h=a.length,d=7;if(h>d){const s=h-d+1,f=a.slice(0,s),N=a.slice(s);return i(f)+"ล้าน"+i(N)}else for(let s=0;s<h;s++){const f=a[s];f>0&&(u+=e[f]+r[h-s-1])}return u}function E(a){let u=a;u=u.replace("หนึ่งสิบ","สิบ"),u=u.replace("สองสิบ","ยี่สิบ");const h=5;return u.length>h&&u.length-u.lastIndexOf("หนึ่ง")===h&&(u=u.substr(0,u.length-h)+"เอ็ด"),u}function o(a,u){let h="";return a===""&&u===""?h=n:a!==""&&u===""?h=a+"บาทถ้วน":a===""&&u!==""?h=u+"สตางค์":h=a+"บาท"+u+"สตางค์",h}function A(a){let u=n;if(isNaN(a)||a>=Number.MAX_SAFE_INTEGER)return u;const h=Math.floor(a).toString(),d=Math.round(a%1*100).toString(),s=Array.from(h).map(Number),f=Array.from(d).map(Number);let N=i(s),c=i(f);return N=E(N),c=E(c),u=o(N,c),u}t.exports!=null&&(t.exports=A)})(ln)),ln.exports}var fn,cr;function ri(){if(cr)return fn;cr=1;const t=Rt(),{FormulaHelpers:n,Types:e,WildCard:r}=At(),i=n,E=ni(),o=io(),A={latin:{halfRE:/[!-~]/g,fullRE:/[!-~]/g,delta:65248},hangul1:{halfRE:/[ᄀ-ᄒ]/g,fullRE:/[ᆨ-ᇂ]/g,delta:-60921},hangul2:{halfRE:/[ᅡ-ᅵ]/g,fullRE:/[ᅡ-ᅵ]/g,delta:-61025},kana:{delta:0,half:"。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゙゚",full:"。「」、・ヲァィゥェォャュョッーアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン゛゜"},extras:{delta:0,half:"¢£¬¯¦¥₩ |←↑→↓■°",full:"¢£¬ ̄¦¥₩ │←↑→↓■○"}},a=c=>l=>c.delta?String.fromCharCode(l.charCodeAt(0)+c.delta):[...c.full][[...c.half].indexOf(l)],u=c=>l=>c.delta?String.fromCharCode(l.charCodeAt(0)-c.delta):[...c.half][[...c.full].indexOf(l)],h=(c,l)=>c[l+"RE"]||new RegExp("["+c[l]+"]","g"),d=Object.keys(A).map(c=>A[c]),s=c=>d.reduce((l,p)=>l.replace(h(p,"half"),a(p)),c),f=c=>d.reduce((l,p)=>l.replace(h(p,"full"),u(p)),c),N={ASC:c=>(c=i.accept(c,e.STRING),f(c)),BAHTTEXT:c=>{c=i.accept(c,e.NUMBER);try{return o(c)}catch(l){throw Error(`Error in https://github.com/jojoee/bahttext
|
|
2
|
+
${l.toString()}`)}},CHAR:c=>{if(c=i.accept(c,e.NUMBER),c>255||c<1)throw t.VALUE;return String.fromCharCode(c)},CLEAN:c=>(c=i.accept(c,e.STRING),c.replace(/[\x00-\x1F]/g,"")),CODE:c=>{if(c=i.accept(c,e.STRING),c.length===0)throw t.VALUE;return c.charCodeAt(0)},CONCAT:(...c)=>{let l="";return i.flattenParams(c,e.STRING,!1,p=>{p=i.accept(p,e.STRING),l+=p}),l},CONCATENATE:(...c)=>{let l="";if(c.length===0)throw Error("CONCATENATE need at least one argument.");return c.forEach(p=>{p=i.accept(p,e.STRING),l+=p}),l},DBCS:c=>(c=i.accept(c,e.STRING),s(c)),DOLLAR:(c,l)=>{c=i.accept(c,e.NUMBER),l=i.accept(l,e.NUMBER,2);const p=Array(l).fill("0").join("");return E.format(`$#,##0.${p}_);($#,##0.${p})`,c).trim()},EXACT:(c,l)=>(c=i.accept(c,[e.STRING]),l=i.accept(l,[e.STRING]),c===l),FIND:(c,l,p)=>{if(c=i.accept(c,e.STRING),l=i.accept(l,e.STRING),p=i.accept(p,e.NUMBER,1),p<1||p>l.length)throw t.VALUE;const R=l.indexOf(c,p-1);if(R===-1)throw t.VALUE;return R+1},FINDB:(...c)=>N.FIND(...c),FIXED:(c,l,p)=>{c=i.accept(c,e.NUMBER),l=i.accept(l,e.NUMBER,2),p=i.accept(p,e.BOOLEAN,!1);const R=Array(l).fill("0").join(""),T=p?"":"#,";return E.format(`${T}##0.${R}_);(${T}##0.${R})`,c).trim()},LEFT:(c,l)=>{if(c=i.accept(c,e.STRING),l=i.accept(l,e.NUMBER,1),l<0)throw t.VALUE;return l>c.length?c:c.slice(0,l)},LEFTB:(...c)=>N.LEFT(...c),LEN:c=>(c=i.accept(c,e.STRING),c.length),LENB:(...c)=>N.LEN(...c),LOWER:c=>(c=i.accept(c,e.STRING),c.toLowerCase()),MID:(c,l,p)=>{if(c=i.accept(c,e.STRING),l=i.accept(l,e.NUMBER),p=i.accept(p,e.NUMBER),l>c.length)return"";if(l<1||p<1)throw t.VALUE;return c.slice(l-1,l+p-1)},MIDB:(...c)=>N.MID(...c),NUMBERVALUE:(c,l,p)=>{if(c=i.accept(c,e.STRING),l=i.accept(l,e.STRING,"."),p=i.accept(p,e.STRING,","),c.length===0)return 0;if(l.length===0||p.length===0||(l=l[0],p=p[0],l===p||c.indexOf(l)<c.lastIndexOf(p)))throw t.VALUE;const R=c.replace(p,"").replace(l,".").replace(/[^\-0-9.%()]/g,"").match(/([(-]*)([0-9]*[.]*[0-9]+)([)]?)([%]*)/);if(!R)throw t.VALUE;const T=R[1].length,O=R[3].length,m=R[4].length;let M=Number(R[2]);if(T>1||T&&!O||!T&&O||isNaN(M))throw t.VALUE;return M=M/100**m,T?-M:M},PHONETIC:()=>{},PROPER:c=>(c=i.accept(c,[e.STRING]),c=c.toLowerCase(),c=c.charAt(0).toUpperCase()+c.slice(1),c.replace(/(?:[^a-zA-Z])([a-zA-Z])/g,l=>l.toUpperCase())),REPLACE:(c,l,p,R)=>{c=i.accept(c,[e.STRING]),l=i.accept(l,[e.NUMBER]),p=i.accept(p,[e.NUMBER]),R=i.accept(R,[e.STRING]);let T=c.split("");return T.splice(l-1,p,R),T.join("")},REPLACEB:(...c)=>N.REPLACE(...c),REPT:(c,l)=>{c=i.accept(c,e.STRING),l=i.accept(l,e.NUMBER);let p="";for(let R=0;R<l;R++)p+=c;return p},RIGHT:(c,l)=>{if(c=i.accept(c,e.STRING),l=i.accept(l,e.NUMBER,1),l<0)throw t.VALUE;const p=c.length;return l>p?c:c.slice(p-l)},RIGHTB:(...c)=>N.RIGHT(...c),SEARCH:(c,l,p)=>{if(c=i.accept(c,e.STRING),l=i.accept(l,e.STRING),p=i.accept(p,e.NUMBER,1),p<1||p>l.length)throw t.VALUE;let R=r.isWildCard(c)?r.toRegex(c,"i"):c;const T=l.slice(p-1).search(R);if(T===-1)throw t.VALUE;return T+p},SEARCHB:(...c)=>N.SEARCH(...c),SUBSTITUTE:(...c)=>{},T:c=>(c=i.accept(c),typeof c=="string"?c:""),TEXT:(c,l)=>{c=i.accept(c,e.NUMBER),l=i.accept(l,e.STRING);try{return E.format(l,c)}catch(p){throw console.error(p),t.VALUE}},TEXTJOIN:(...c)=>{},TRIM:c=>(c=i.accept(c,[e.STRING]),c.replace(/^\s+|\s+$/g,"")),UNICHAR:c=>{if(c=i.accept(c,[e.NUMBER]),c<=0)throw t.VALUE;return String.fromCharCode(c)},UNICODE:c=>N.CODE(c)};return fn=N,fn}var hn,ur;function qe(){if(ur)return hn;ur=1;const t=Rt(),{FormulaHelpers:n}=At(),e={unaryOp:(o,A,a)=>{let u=1;if(o.forEach(h=>{if(h!=="+")if(h==="-")u=-u;else throw new Error(`Unrecognized prefix: ${h}`)}),A==null&&(A=0),u===1)return A;try{A=n.acceptNumber(A,a)}catch(h){if(h instanceof t)Array.isArray(A)&&(A=A[0][0]);else throw h}return typeof A=="number"&&isNaN(A)?t.VALUE:-A}},r={percentOp:(o,A,a)=>{try{o=n.acceptNumber(o,a)}catch(u){if(u instanceof t)return u;throw u}if(A==="%")return o/100;throw new Error(`Unrecognized postfix: ${A}`)}},i={boolean:3,string:2,number:1};return hn={Prefix:e,Postfix:r,Infix:{compareOp:(o,A,a,u,h)=>{o==null&&(o=0),a==null&&(a=0),u&&(o=o[0][0]),h&&(a=a[0][0]);const d=typeof o,s=typeof a;if(d===s)switch(A){case"=":return o===a;case">":return o>a;case"<":return o<a;case"<>":return o!==a;case"<=":return o<=a;case">=":return o>=a}else switch(A){case"=":return!1;case">":return i[d]>i[s];case"<":return i[d]<i[s];case"<>":return!0;case"<=":return i[d]<=i[s];case">=":return i[d]>=i[s]}throw Error("Infix.compareOp: Should not reach here.")},concatOp:(o,A,a,u,h)=>{o==null&&(o=""),a==null&&(a=""),u&&(o=o[0][0]),h&&(a=a[0][0]);const d=typeof o,s=typeof a;return d==="boolean"&&(o=o?"TRUE":"FALSE"),s==="boolean"&&(a=a?"TRUE":"FALSE"),""+o+a},mathOp:(o,A,a,u,h)=>{o==null&&(o=0),a==null&&(a=0);try{o=n.acceptNumber(o,u),a=n.acceptNumber(a,h)}catch(d){if(d instanceof t)return d;throw d}switch(A){case"+":return o+a;case"-":return o-a;case"*":return o*a;case"/":return a===0?t.DIV0:o/a;case"^":return o**a}throw Error("Infix.mathOp: Should not reach here.")}},Operators:{compareOp:["<",">","=","<>","<=",">="],concatOp:["&"],mathOp:["+","-","*","/","^"]}},hn}var pn,lr;function ii(){if(lr)return pn;lr=1;const t=Rt(),{FormulaHelpers:n,Types:e,Factorials:r,Criteria:i}=At(),{Infix:E}=qe(),o=n,A=[],a=[];function u(s){return s<=100?r[s]:A[s]>0?A[s]:A[s]=u(s-1)*s}function h(s){return s===1||s===0?1:s===2?2:a[s]>0?a[s]:a[s]=h(s-2)*s}const d={ABS:s=>(s=o.accept(s,e.NUMBER),Math.abs(s)),AGGREGATE:(s,f,N,...c)=>{},ARABIC:s=>{if(s=o.accept(s,e.STRING).toUpperCase(),!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(s))throw new t("#VALUE!","Invalid roman numeral in ARABIC evaluation.");let f=0;return s.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,function(N){f+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[N]}),f},BASE:(s,f,N)=>{if(s=o.accept(s,e.NUMBER),s<0||s>=2**53||(f=o.accept(f,e.NUMBER),f<2||f>36)||(N=o.accept(N,e.NUMBER,0),N<0))throw t.NUM;const c=s.toString(f).toUpperCase();return new Array(Math.max(N+1-c.length,0)).join("0")+c},CEILING:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),f===0)return 0;if(s/f%1===0)return s;const N=Math.abs(f),c=Math.floor(Math.abs(s)/N);return s<0?f<0?-N*(c+1):-N*c:(c+1)*N},"CEILING.MATH":(s,f,N)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER,s>0?1:-1),N=o.accept(N,e.NUMBER,0),s>=0)return d.CEILING(s,f);const c=N?f:0;return d.CEILING(s,f)-c},"CEILING.PRECISE":(s,f)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER,1),d.CEILING(s,Math.abs(f))),COMBIN:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),s<0||f<0||s<f)throw t.NUM;const N=d.FACT(s),c=d.FACT(f);return N/c/d.FACT(s-f)},COMBINA:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),(s===0||s===1)&&f===0)return 1;if(s<0||f<0)throw t.NUM;return d.COMBIN(s+f-1,s-1)},DECIMAL:(s,f)=>{if(s=o.accept(s,e.STRING),f=o.accept(f,e.NUMBER),f=Math.trunc(f),f<2||f>36)throw t.NUM;const N=parseInt(s,f);if(isNaN(N))throw t.NUM;return N},DEGREES:s=>(s=o.accept(s,e.NUMBER),s*(180/Math.PI)),EVEN:s=>d.CEILING(s,-2),EXP:s=>(s=o.accept(s,e.NUMBER),Math.exp(s)),FACT:s=>{if(s=o.accept(s,e.NUMBER),s=Math.trunc(s),s>170||s<0)throw t.NUM;return s<=100?r[s]:u(s)},FACTDOUBLE:s=>{if(s=o.accept(s,e.NUMBER),s=Math.trunc(s),s<-1)throw t.NUM;return s===-1?1:h(s)},FLOOR:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),f===0)return 0;if(s>0&&f<0)throw t.NUM;if(s/f%1===0)return s;const N=Math.abs(f),c=Math.floor(Math.abs(s)/N);return s<0?f<0?-N*c:-N*(c+1):c*N},"FLOOR.MATH":(s,f,N)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER,s>0?1:-1),N=o.accept(N,e.NUMBER,0),N===0||s>=0?d.FLOOR(s,Math.abs(f)):d.FLOOR(s,f)+f),"FLOOR.PRECISE":(s,f)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER,1),d.FLOOR(s,Math.abs(f))),GCD:(...s)=>{const f=[];o.flattenParams(s,null,!1,R=>{if(R=typeof R=="boolean"?NaN:Number(R),isNaN(R))throw t.VALUE;if(R<0||R>9007199254740990)throw t.NUM;f.push(Math.trunc(R))},0);let N,c,l=s.length,p=Math.abs(f[0]);for(N=1;N<l;N++){for(c=Math.abs(f[N]);p&&c;)p>c?p%=c:c%=p;p+=c}return p},INT:s=>(s=o.accept(s,e.NUMBER),Math.floor(s)),"ISO.CEILING":(...s)=>d["CEILING.PRECISE"](...s),LCM:(...s)=>{const f=[];o.flattenParams(s,null,!1,l=>{if(l=typeof l=="boolean"?NaN:Number(l),isNaN(l))throw t.VALUE;if(l<0||l>9007199254740990)throw t.NUM;f.push(Math.trunc(l))},1);let N=f.length,c=Math.abs(f[0]);for(let l=1;l<N;l++){let p=Math.abs(f[l]),R=c;for(;c&&p;)c>p?c%=p:p%=c;c=Math.abs(R*f[l])/(c+p)}return c},LN:s=>(s=o.accept(s,e.NUMBER),Math.log(s)),LOG:(s,f)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER,10),Math.log(s)/Math.log(f)),LOG10:s=>(s=o.accept(s,e.NUMBER),Math.log10(s)),MDETERM:s=>{if(s=o.accept(s,e.ARRAY,void 0,!1,!0),s[0].length!==s.length)throw t.VALUE;const f=s.length,N=s[0].length;let c=0,l,p;if(f===1)return s[0][0];if(f===2)return s[0][0]*s[1][1]-s[0][1]*s[1][0];for(let R=0;R<N;R++){l=s[0][R],p=s[0][R];for(let T=1;T<f;T++)p*=s[T][((R+T)%N+N)%N],l*=s[T][((R-T)%N+N)%N];c+=p-l}return c},MINVERSE:s=>{},MMULT:(s,f)=>{s=o.accept(s,e.ARRAY,void 0,!1,!0),f=o.accept(f,e.ARRAY,void 0,!1,!0);const N=s.length,c=s[0].length,l=f.length,p=f[0].length,R=new Array(N);if(c!==l)throw t.VALUE;for(let T=0;T<N;T++){R[T]=new Array(p);for(let O=0;O<p;O++){R[T][O]=0;for(let m=0;m<c;m++){const M=s[T][m],I=f[m][O];if(typeof M!="number"||typeof I!="number")throw t.VALUE;R[T][O]+=s[T][m]*f[m][O]}}}return R},MOD:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),f===0)throw t.DIV0;return s-f*d.INT(s/f)},MROUND:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),f===0)return 0;if(s>0&&f<0||s<0&&f>0)throw t.NUM;return s/f%1===0?s:Math.round(s/f)*f},MULTINOMIAL:(...s)=>{let f=0,N=1;return o.flattenParams(s,e.NUMBER,!1,c=>{if(c<0)throw t.NUM;f+=c,N*=u(c)}),u(f)/N},MUNIT:s=>{s=o.accept(s,e.NUMBER);const f=[];for(let N=0;N<s;N++){const c=[];for(let l=0;l<s;l++)N===l?c.push(1):c.push(0);f.push(c)}return f},ODD:s=>{if(s=o.accept(s,e.NUMBER),s===0)return 1;let f=Math.ceil(Math.abs(s));return f=f&1?f:f+1,s>0?f:-f},PI:()=>Math.PI,POWER:(s,f)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),s**f),PRODUCT:(...s)=>{let f=1;return o.flattenParams(s,null,!0,(N,c)=>{const l=Number(N);c.isLiteral&&!isNaN(l)?f*=l:typeof N=="number"&&(f*=N)},1),f},QUOTIENT:(s,f)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),Math.trunc(s/f)),RADIANS:s=>(s=o.accept(s,e.NUMBER),s/180*Math.PI),RAND:()=>Math.random(),RANDBETWEEN:(s,f)=>(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),Math.floor(Math.random()*(f-s+1)+s)),ROMAN:(s,f)=>{if(s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER,0),f!==0)throw Error("ROMAN: only allows form=0 (classic form).");const N=String(s).split(""),c=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];let l="",p=3;for(;p--;)l=(c[+N.pop()+p*10]||"")+l;return new Array(+N.join("")+1).join("M")+l},ROUND:(s,f)=>{s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER);const N=Math.pow(10,Math.abs(f)),c=s>0?1:-1;return f>0?c*Math.round(Math.abs(s)*N)/N:f===0?c*Math.round(Math.abs(s)):c*Math.round(Math.abs(s)/N)*N},ROUNDDOWN:(s,f)=>{s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER);const N=Math.pow(10,Math.abs(f)),c=s>0?1:-1;if(f>0){const l=1/N*.5;return c*Math.round((Math.abs(s)-l)*N)/N}else{if(f===0)return c*Math.round(Math.abs(s)-.5);{const l=N*.5;return c*Math.round((Math.abs(s)-l)/N)*N}}},ROUNDUP:(s,f)=>{s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER);const N=Math.pow(10,Math.abs(f)),c=s>0?1:-1;if(f>0){const l=1/N*.5;return c*Math.round((Math.abs(s)+l)*N)/N}else{if(f===0)return c*Math.round(Math.abs(s)+.5);{const l=N*.5;return c*Math.round((Math.abs(s)+l)/N)*N}}},SERIESSUM:(s,f,N,c)=>{s=o.accept(s,e.NUMBER),f=o.accept(f,e.NUMBER),N=o.accept(N,e.NUMBER);let l=0,p;return o.flattenParams([c],e.NUMBER,!1,R=>{if(typeof R!="number")throw t.VALUE;l===0?p=R*Math.pow(s,f):p+=R*Math.pow(s,f+l*N),l++}),p},SIGN:s=>(s=o.accept(s,e.NUMBER),s>0?1:s===0?0:-1),SQRT:s=>{if(s=o.accept(s,e.NUMBER),s<0)throw t.NUM;return Math.sqrt(s)},SQRTPI:s=>{if(s=o.accept(s,e.NUMBER),s<0)throw t.NUM;return Math.sqrt(s*Math.PI)},SUBTOTAL:()=>{},SUM:(...s)=>{let f=0;return o.flattenParams(s,e.NUMBER,!0,(N,c)=>{(c.isLiteral||typeof N=="number")&&(f+=N)}),f},SUMIF:(s,f,N,c)=>{const l=o.retrieveRanges(s,f,c);f=l[0],c=l[1],N=o.retrieveArg(s,N);const p=N.isArray;N=i.parse(o.accept(N));let R=0;return f.forEach((T,O)=>{T.forEach((m,M)=>{const I=c[O][M];typeof I=="number"&&(N.op==="wc"?N.match===N.value.test(m)&&(R+=I):E.compareOp(m,N.op,N.value,Array.isArray(m),p)&&(R+=I))})}),R},SUMIFS:()=>{},SUMPRODUCT:(s,...f)=>{s=o.accept(s,e.ARRAY,void 0,!1,!0),f.forEach(c=>{if(c=o.accept(c,e.ARRAY,void 0,!1,!0),s[0].length!==c[0].length||s.length!==c.length)throw t.VALUE;for(let l=0;l<s.length;l++)for(let p=0;p<s[0].length;p++)typeof s[l][p]!="number"&&(s[l][p]=0),typeof c[l][p]!="number"&&(c[l][p]=0),s[l][p]*=c[l][p]});let N=0;return s.forEach(c=>{c.forEach(l=>{N+=l})}),N},SUMSQ:(...s)=>{let f=0;return o.flattenParams(s,e.NUMBER,!0,(N,c)=>{(c.isLiteral||typeof N=="number")&&(f+=N**2)}),f},SUMX2MY2:(s,f)=>{const N=[],c=[];let l=0;if(o.flattenParams([s],null,!1,(p,R)=>{N.push(p)}),o.flattenParams([f],null,!1,(p,R)=>{c.push(p)}),N.length!==c.length)throw t.NA;for(let p=0;p<N.length;p++)typeof N[p]=="number"&&typeof c[p]=="number"&&(l+=N[p]**2-c[p]**2);return l},SUMX2PY2:(s,f)=>{const N=[],c=[];let l=0;if(o.flattenParams([s],null,!1,(p,R)=>{N.push(p)}),o.flattenParams([f],null,!1,(p,R)=>{c.push(p)}),N.length!==c.length)throw t.NA;for(let p=0;p<N.length;p++)typeof N[p]=="number"&&typeof c[p]=="number"&&(l+=N[p]**2+c[p]**2);return l},SUMXMY2:(s,f)=>{const N=[],c=[];let l=0;if(o.flattenParams([s],null,!1,(p,R)=>{N.push(p)}),o.flattenParams([f],null,!1,(p,R)=>{c.push(p)}),N.length!==c.length)throw t.NA;for(let p=0;p<N.length;p++)typeof N[p]=="number"&&typeof c[p]=="number"&&(l+=(N[p]-c[p])**2);return l},TRUNC:s=>(s=o.accept(s,e.NUMBER),Math.trunc(s))};return pn=d,pn}var En,fr;function oo(){if(fr)return En;fr=1;const t=Rt(),{FormulaHelpers:n,Types:e}=At(),r=n,i=2**27-1;return En={ACOS:o=>{if(o=r.accept(o,e.NUMBER),o>1||o<-1)throw t.NUM;return Math.acos(o)},ACOSH:o=>{if(o=r.accept(o,e.NUMBER),o<1)throw t.NUM;return Math.acosh(o)},ACOT:o=>(o=r.accept(o,e.NUMBER),Math.PI/2-Math.atan(o)),ACOTH:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)<=1)throw t.NUM;return Math.atanh(1/o)},ASIN:o=>{if(o=r.accept(o,e.NUMBER),o>1||o<-1)throw t.NUM;return Math.asin(o)},ASINH:o=>(o=r.accept(o,e.NUMBER),Math.asinh(o)),ATAN:o=>(o=r.accept(o,e.NUMBER),Math.atan(o)),ATAN2:(o,A)=>{if(o=r.accept(o,e.NUMBER),A=r.accept(A,e.NUMBER),A===0&&o===0)throw t.DIV0;return Math.atan2(A,o)},ATANH:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>1)throw t.NUM;return Math.atanh(o)},COS:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>i)throw t.NUM;return Math.cos(o)},COSH:o=>(o=r.accept(o,e.NUMBER),Math.cosh(o)),COT:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>i)throw t.NUM;if(o===0)throw t.DIV0;return 1/Math.tan(o)},COTH:o=>{if(o=r.accept(o,e.NUMBER),o===0)throw t.DIV0;return 1/Math.tanh(o)},CSC:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>i)throw t.NUM;return 1/Math.sin(o)},CSCH:o=>{if(o=r.accept(o,e.NUMBER),o===0)throw t.DIV0;return 1/Math.sinh(o)},SEC:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>i)throw t.NUM;return 1/Math.cos(o)},SECH:o=>(o=r.accept(o,e.NUMBER),1/Math.cosh(o)),SIN:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>i)throw t.NUM;return Math.sin(o)},SINH:o=>(o=r.accept(o,e.NUMBER),Math.sinh(o)),TAN:o=>{if(o=r.accept(o,e.NUMBER),Math.abs(o)>i)throw t.NUM;return Math.tan(o)},TANH:o=>(o=r.accept(o,e.NUMBER),Math.tanh(o))},En}var dn,hr;function ao(){if(hr)return dn;hr=1;const t=Rt(),{FormulaHelpers:n,Types:e}=At(),r=n;function i(o){let A=0,a=0;return r.flattenParams(o,null,!0,u=>{const h=typeof u;h==="string"?u==="TRUE"?u=!0:u==="FALSE"&&(u=!1):h==="number"&&(u=!!u),typeof u=="boolean"&&(u===!0?A++:a++)}),[A,a]}return dn={AND:(...o)=>{const[A,a]=i(o);return A===0&&a===0?t.VALUE:A>0&&a===0},FALSE:()=>!1,IF:(o,A,a,u)=>(A=r.accept(A,e.BOOLEAN),a=r.accept(a),u=r.accept(u,null,!1),A?a:u),IFERROR:(o,A)=>o.value instanceof t?r.accept(A):r.accept(o),IFNA:function(o,A){if(arguments.length>2)throw t.TOO_MANY_ARGS("IFNA");return t.NA.equals(o.value)?r.accept(A):r.accept(o)},IFS:(...o)=>{if(o.length%2!==0)return new t("#N/A","IFS expects all arguments after position 0 to be in pairs.");for(let A=0;A<o.length/2;A++){const a=r.accept(o[A*2],e.BOOLEAN),u=r.accept(o[A*2+1]);if(a)return u}return t.NA},NOT:o=>(o=r.accept(o,e.BOOLEAN),!o),OR:(...o)=>{const[A,a]=i(o);return A===0&&a===0?t.VALUE:A>0},SWITCH:(...o)=>{},TRUE:()=>!0,XOR:(...o)=>{const[A,a]=i(o);return A===0&&a===0?t.VALUE:A%2===1}},dn}var Rn,pr;function so(){if(pr)return Rn;pr=1;const t=Rt(),n=ri(),{FormulaHelpers:e,Types:r}=At(),i=e,E=no(),o=ei(),A=536870911,a=-536870912,u=511,h=-512,d=/^\s?[+-]?\s?[0-9]+[.]?[0-9]*([eE][+\-][0-9]+)?\s?$/,s=/^\s?([+-]?\s?([0-9]+[.]?[0-9]*([eE][+\-][0-9]+)?)?)\s?[ij]\s?$/,f=/^\s?([+-]?\s?[0-9]+[.]?[0-9]*([eE][+\-][0-9]+)?)\s?([+-]?\s?([0-9]+[.]?[0-9]*([eE][+\-][0-9]+)?)?)\s?[ij]\s?$/;function N(l){l=i.accept(l);let p=0,R=0,T="i";if(typeof l=="number")return{real:l,im:R,unit:T};if(typeof l=="boolean")throw t.VALUE;let O=l.match(d);if(O)return p=Number(O[0]),{real:p,im:R,unit:T};if(O=l.match(s),O)return R=Number(/^\s?[+-]?\s?$/.test(O[1])?O[1]+"1":O[1]),T=O[0].slice(-1),{real:p,im:R,unit:T};if(O=l.match(f),O)return p=Number(O[1]),R=Number(/^\s?[+-]?\s?$/.test(O[3])?O[3]+"1":O[3]),T=O[0].slice(-1),{real:p,im:R,unit:T};throw t.NUM}const c={BESSELI:(l,p)=>{if(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN),p=Math.trunc(p),p<0)throw t.NUM;return E.besseli(l,p)},BESSELJ:(l,p)=>{if(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN),p=Math.trunc(p),p<0)throw t.NUM;return E.besselj(l,p)},BESSELK:(l,p)=>{if(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN),p=Math.trunc(p),p<0)throw t.NUM;return E.besselk(l,p)},BESSELY:(l,p)=>{if(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN),p=Math.trunc(p),p<0)throw t.NUM;return E.bessely(l,p)},BIN2DEC:l=>{l=i.accept(l,r.NUMBER_NO_BOOLEAN);let p=l.toString();if(p.length>10)throw t.NUM;return p.length===10&&p.substring(0,1)==="1"?parseInt(p.substring(1),2)+h:parseInt(p,2)},BIN2HEX:(l,p)=>{l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN,null);const R=l.toString();if(R.length>10)throw t.NUM;if(R.length===10&&R.substring(0,1)==="1")return(parseInt(R.substring(1),2)+0xfffffffe00).toString(16).toUpperCase();const T=parseInt(l,2).toString(16);if(p==null)return T.toUpperCase();if(p<0)throw t.NUM;if(p=Math.trunc(p),p>=T.length)return(n.REPT("0",p-T.length)+T).toUpperCase();throw t.NUM},BIN2OCT:(l,p)=>{l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER,null);let R=l.toString();if(R.length>10)throw t.NUM;if(R.length===10&&R.substr(0,1)==="1")return(parseInt(R.substr(1),2)+1073741312).toString(8);let T=parseInt(l,2).toString(8);if(p==null)return T.toUpperCase();if(p<0)throw t.NUM;if(p=Math.trunc(p),p>=T.length)return n.REPT("0",p-T.length)+T;throw t.NUM},BITAND:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER),l<0||p<0||Math.floor(l)!==l||Math.floor(p)!==p||l>0xffffffffffff||p>0xffffffffffff)throw t.NUM;return l&p},BITLSHIFT:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER),p=Math.trunc(p),Math.abs(p)>53||l<0||Math.floor(l)!==l||l>0xffffffffffff)throw t.NUM;const R=p>=0?l*2**p:Math.trunc(l/2**-p);if(R>0xffffffffffff)throw t.NUM;return R},BITOR:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER),l<0||p<0||Math.floor(l)!==l||Math.floor(p)!==p||l>0xffffffffffff||p>0xffffffffffff)throw t.NUM;return l|p},BITRSHIFT:(l,p)=>(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER),c.BITLSHIFT(l,-p)),BITXOR:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER),l<0||l>0xffffffffffff||Math.floor(l)!==l||p<0||p>0xffffffffffff||Math.floor(p)!==p)throw t.NUM;return l^p},COMPLEX:(l,p,R)=>{if(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN),R=i.accept(R,r.STRING,"i"),R!=="i"&&R!=="j")throw t.VALUE;if(l===0&&p===0)return 0;if(l===0)return p===1?R:p===-1?"-"+R:p.toString()+R;if(p===0)return l.toString();{let T=p>0?"+":"";return p===1?l.toString()+T+R:p===-1?l.toString()+T+"-"+R:l.toString()+T+p.toString()+R}},DEC2BIN:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER,null),l<h||l>u)throw t.NUM;if(l<0)return"1"+n.REPT("0",9-(512+l).toString(2).length)+(512+l).toString(2);let R=parseInt(l,10).toString(2);if(p==null)return R;if(p=Math.trunc(p),p<=0||p<R.length)throw t.NUM;return n.REPT("0",p-R.length)+R},DEC2HEX:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER,null),l<-549755813888||l>549755813888)throw t.NUM;if(l<0)return(1099511627776+l).toString(16).toUpperCase();let R=parseInt(l,10).toString(16);if(p==null)return R.toUpperCase();if(p=Math.trunc(p),p<=0||p<R.length)throw t.NUM;return n.REPT("0",p-R.length)+R.toUpperCase()},DEC2OCT:(l,p)=>{if(l=i.accept(l,r.NUMBER),p=i.accept(p,r.NUMBER,null),l<-536870912||l>536870912)throw t.NUM;if(l<0)return(l+1073741824).toString(8);let R=parseInt(l,10).toString(8);if(p==null)return R.toUpperCase();if(p=Math.trunc(p),p<=0||p<R.length)throw t.NUM;return n.REPT("0",p-R.length)+R},DELTA:(l,p)=>(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN,0),l===p?1:0),ERF:(l,p)=>(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN,0),o.erf(l)),ERFC:l=>(l=i.accept(l,r.NUMBER_NO_BOOLEAN),o.erfc(l)),GESTEP:(l,p)=>(l=i.accept(l,r.NUMBER_NO_BOOLEAN),p=i.accept(p,r.NUMBER_NO_BOOLEAN,0),l>=p?1:0),HEX2BIN:(l,p)=>{if(l=i.accept(l,r.STRING),p=i.accept(p,r.NUMBER,null),l.length>10||!/^[0-9a-fA-F]*$/.test(l))throw t.NUM;let R=l.length===10&&l.substr(0,1).toLowerCase()==="f",T=R?parseInt(l,16)-1099511627776:parseInt(l,16);if(T<h||T>u)throw t.NUM;if(R)return"1"+n.REPT("0",9-(T+512).toString(2).length)+(T+512).toString(2);let O=T.toString(2);if(p==null)return O;if(p=Math.trunc(p),p<=0||p<O.length)throw t.NUM;return n.REPT("0",p-O.length)+O},HEX2DEC:l=>{if(l=i.accept(l,r.STRING),l.length>10||!/^[0-9a-fA-F]*$/.test(l))throw t.NUM;let p=parseInt(l,16);return p>=549755813888?p-1099511627776:p},HEX2OCT:(l,p)=>{if(l=i.accept(l,r.STRING),l.length>10||!/^[0-9a-fA-F]*$/.test(l))throw t.NUM;let R=c.HEX2DEC(l);if(R>A||R<a)throw t.NUM;return c.DEC2OCT(R,p)},IMABS:l=>{const{real:p,im:R}=N(l);return Math.sqrt(Math.pow(p,2)+Math.pow(R,2))},IMAGINARY:l=>N(l).im,IMARGUMENT:l=>{const{real:p,im:R}=N(l);if(p===0&&R===0)throw t.DIV0;return p===0&&R>0?Math.PI/2:p===0&&R<0?-Math.PI/2:p<0&&R===0?Math.PI:p>0&&R===0?0:p>0?Math.atan(R/p):p<0&&R>0?Math.atan(R/p)+Math.PI:Math.atan(R/p)-Math.PI},IMCONJUGATE:l=>{const{real:p,im:R,unit:T}=N(l);return R!==0?c.COMPLEX(p,-R,T):""+p},IMCOS:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.cos(p)*(Math.exp(R)+Math.exp(-R))/2,m=-Math.sin(p)*(Math.exp(R)-Math.exp(-R))/2;return c.COMPLEX(O,m,T)},IMCOSH:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.cos(R)*(Math.exp(p)+Math.exp(-p))/2,m=-Math.sin(R)*(Math.exp(p)-Math.exp(-p))/2;return c.COMPLEX(O,-m,T)},IMCOT:l=>{l=i.accept(l);let p=c.IMCOS(l),R=c.IMSIN(l);return c.IMDIV(p,R)},IMCSC:l=>(l=i.accept(l),c.IMDIV("1",c.IMSIN(l))),IMCSCH:l=>(l=i.accept(l),c.IMDIV("1",c.IMSINH(l))),IMDIV:(l,p)=>{const R=N(l),T=R.real,O=R.im,m=R.unit,M=N(p),I=M.real,w=M.im,D=M.unit;if(I===0&&w===0||m!==D)throw t.NUM;let G=m,H=Math.pow(I,2)+Math.pow(w,2);return c.COMPLEX((T*I+O*w)/H,(O*I-T*w)/H,G)},IMEXP:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.exp(p);return c.COMPLEX(O*Math.cos(R),O*Math.sin(R),T)},IMLN:l=>{const{real:p,im:R,unit:T}=N(l);return c.COMPLEX(Math.log(Math.sqrt(Math.pow(p,2)+Math.pow(R,2))),Math.atan(R/p),T)},IMLOG10:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.log(Math.sqrt(Math.pow(p,2)+Math.pow(R,2)))/Math.log(10),m=Math.atan(R/p)/Math.log(10);return c.COMPLEX(O,m,T)},IMLOG2:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.log(Math.sqrt(Math.pow(p,2)+Math.pow(R,2)))/Math.log(2),m=Math.atan(R/p)/Math.log(2);return c.COMPLEX(O,m,T)},IMPOWER:(l,p)=>{let{unit:R}=N(l);p=i.accept(p,r.NUMBER_NO_BOOLEAN);let T=Math.pow(c.IMABS(l),p),O=c.IMARGUMENT(l),m=T*Math.cos(p*O),M=T*Math.sin(p*O);return c.COMPLEX(m,M,R)},IMPRODUCT:(...l)=>{let p,R=0;return i.flattenParams(l,null,!1,T=>{if(R===0)p=i.accept(T),N(p);else{const O=N(p),m=O.real,M=O.im,I=O.unit,w=N(T),D=w.real,G=w.im,H=w.unit;if(I!==H)throw t.VALUE;p=c.COMPLEX(m*D-M*G,m*G+M*D)}R++},1),p},IMREAL:l=>N(l).real,IMSEC:l=>c.IMDIV("1",c.IMCOS(l)),IMSECH:l=>c.IMDIV("1",c.IMCOSH(l)),IMSIN:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.sin(p)*(Math.exp(R)+Math.exp(-R))/2,m=Math.cos(p)*(Math.exp(R)-Math.exp(-R))/2;return c.COMPLEX(O,m,T)},IMSINH:l=>{const{real:p,im:R,unit:T}=N(l);let O=Math.cos(R)*(Math.exp(p)-Math.exp(-p))/2,m=Math.sin(R)*(Math.exp(p)+Math.exp(-p))/2;return c.COMPLEX(O,m,T)},IMSQRT:l=>{const{unit:p}=N(l);let R=Math.sqrt(c.IMABS(l)),T=c.IMARGUMENT(l);return c.COMPLEX(R*Math.cos(T/2),R*Math.sin(T/2),p)},IMSUB:(l,p)=>{const R=N(l),T=R.real,O=R.im,m=R.unit,M=N(p),I=M.real,w=M.im,D=M.unit;if(m!==D)throw t.VALUE;return c.COMPLEX(T-I,O-w,m)},IMSUM:(...l)=>{let p=0,R=0,T;return i.flattenParams(l,null,!1,O=>{const{real:m,im:M,unit:I}=N(O);if(T||(T=I),T!==I)throw t.VALUE;p+=m,R+=M}),c.COMPLEX(p,R,T)},IMTAN:l=>{const{unit:p}=N(l);return c.IMDIV(c.IMSIN(l),c.IMCOS(l),p)},OCT2BIN:(l,p)=>{if(l=i.accept(l,r.STRING),p=i.accept(p,r.NUMBER,null),l.length>10||p>10||p!==null&&p<0)throw t.NUM;p=Math.trunc(p);let R=l.length===10&&l.substring(0,1)==="7",T=c.OCT2DEC(l);if(T<h||T>u)return t.NUM;if(R)return"1"+n.REPT("0",9-(512+T).toString(2).length)+(512+T).toString(2);let O=T.toString(2);if(p===0)return O;if(p<O.length)throw t.NUM;return n.REPT("0",p-O.length)+O},OCT2DEC:l=>{if(l=i.accept(l,r.STRING),l.length>10)throw t.NUM;for(const R of l)if(R<"0"||R>"7")throw t.NUM;let p=parseInt(l,8);return p>=536870912?p-1073741824:p},OCT2HEX:(l,p)=>{if(l=i.accept(l,r.STRING),p=i.accept(p,r.NUMBER_NO_BOOLEAN,null),l.length>10)throw t.NUM;for(const O of l)if(O<"0"||O>"7")throw t.NUM;if(p=Math.trunc(p),p<0||p>10)throw t.NUM;let R=c.OCT2DEC(l),T=c.DEC2HEX(R);if(p===0)return T;if(p<T.length)throw t.NUM;return n.REPT("0",p-T.length)+T}};return Rn=c,Rn}var Nn,Er;function co(){if(Er)return Nn;Er=1;const t=Rt(),{FormulaHelpers:n,Types:e,WildCard:r,Address:i}=At(),E=Ke(),o=n;return Nn={ADDRESS:(a,u,h,d,s)=>{if(a=o.accept(a,e.NUMBER),u=o.accept(u,e.NUMBER),h=o.accept(h,e.NUMBER,1),d=o.accept(d,e.BOOLEAN,!0),s=o.accept(s,e.STRING,""),a<1||u<1||h<1||h>4)throw t.VALUE;let f="";return s.length>0&&(/[^A-Za-z_.\d\u007F-\uFFFF]/.test(s)?f+=`'${s}'!`:f+=s+"!"),d?(f+=h===1||h===3?"$":"",f+=i.columnNumberToName(u),f+=h===1||h===2?"$":"",f+=a):(f+="R",f+=h===4||h===3?`[${a}]`:a,f+="C",f+=h===4||h===2?`[${u}]`:u),f},AREAS:a=>(a=o.accept(a),a instanceof E?a.length:1),CHOOSE:(a,...u)=>{},COLUMN:(a,u)=>{if(u==null){if(a.position.col!=null)return a.position.col;throw Error("FormulaParser.parse is called without position parameter.")}else{if(typeof u!="object"||Array.isArray(u))throw t.VALUE;if(o.isCellRef(u))return u.ref.col;if(o.isRangeRef(u))return u.ref.from.col;throw Error("ReferenceFunctions.COLUMN should not reach here.")}},COLUMNS:(a,u)=>{if(u==null)throw Error("COLUMNS requires one argument");if(typeof u!="object"||Array.isArray(u))throw t.VALUE;if(o.isCellRef(u))return 1;if(o.isRangeRef(u))return Math.abs(u.ref.from.col-u.ref.to.col)+1;throw Error("ReferenceFunctions.COLUMNS should not reach here.")},HLOOKUP:(a,u,h,d)=>{a=o.accept(a);try{u=o.accept(u,e.ARRAY,void 0,!1)}catch(f){throw f instanceof t?t.NA:f}if(h=o.accept(h,e.NUMBER),d=o.accept(d,e.BOOLEAN,!0),h<1)throw t.VALUE;if(u[h-1]===void 0)throw t.REF;const s=typeof a;if(d){let f=s===typeof u[0][0]?u[0][0]:null;for(let N=1;N<u[0].length;N++){const c=u[0][N];if(typeof c===s){if(f>a&&c>a)throw t.NA;if(c===a)return u[h-1][N];if(f!=null&&c>a&&f<=a)return u[h-1][N-1];f=c}}if(f==null)throw t.NA;return f}else{let f=-1;if(r.isWildCard(a)?f=u[0].findIndex(N=>r.toRegex(a,"i").test(N)):f=u[0].findIndex(N=>N===a),f===-1)throw t.NA;return u[h-1][f]}},INDEX:(a,u,h,d,s)=>{h=a.utils.extractRefValue(h),h={value:h.val,isArray:h.isArray},h=o.accept(h,e.NUMBER),h=Math.trunc(h),d==null?d=1:(d=a.utils.extractRefValue(d),d={value:d.val,isArray:d.isArray},d=o.accept(d,e.NUMBER,1),d=Math.trunc(d)),s==null?s=1:(s=a.utils.extractRefValue(s),s={value:s.val,isArray:s.isArray},s=o.accept(s,e.NUMBER,1),s=Math.trunc(s));let f=u;if(u instanceof E)f=u.refs[s-1];else if(s>1)throw t.REF;if(h===0&&d===0)return f;if(h===0){if(o.isRangeRef(f)){if(f.ref.to.col-f.ref.from.col<d-1)throw t.REF;return f.ref.from.col+=d-1,f.ref.to.col=f.ref.from.col,f}else if(Array.isArray(f)){const N=[];return f.forEach(c=>N.push([c[d-1]])),N}}if(d===0){if(o.isRangeRef(f)){if(f.ref.to.row-f.ref.from.row<h-1)throw t.REF;return f.ref.from.row+=h-1,f.ref.to.row=f.ref.from.row,f}else if(Array.isArray(f))return f[d-1]}if(h!==0&&d!==0){if(o.isRangeRef(f)){if(f=f.ref,f.to.row-f.from.row<h-1||f.to.col-f.from.col<d-1)throw t.REF;return{ref:{row:f.from.row+h-1,col:f.from.col+d-1}}}else if(o.isCellRef(f)){if(f=f.ref,h>1||d>1)throw t.REF;return{ref:{row:f.row+h-1,col:f.col+d-1}}}else if(Array.isArray(f)){if(f.length<h||f[0].length<d)throw t.REF;return f[h-1][d-1]}}},MATCH:()=>{},ROW:(a,u)=>{if(u==null){if(a.position.row!=null)return a.position.row;throw Error("FormulaParser.parse is called without position parameter.")}else{if(typeof u!="object"||Array.isArray(u))throw t.VALUE;if(o.isCellRef(u))return u.ref.row;if(o.isRangeRef(u))return u.ref.from.row;throw Error("ReferenceFunctions.ROW should not reach here.")}},ROWS:(a,u)=>{if(u==null)throw Error("ROWS requires one argument");if(typeof u!="object"||Array.isArray(u))throw t.VALUE;if(o.isCellRef(u))return 1;if(o.isRangeRef(u))return Math.abs(u.ref.from.row-u.ref.to.row)+1;throw Error("ReferenceFunctions.ROWS should not reach here.")},TRANSPOSE:a=>{a=o.accept(a,e.ARRAY,void 0,!1);const u=[];for(let h=0;h<a[0].length;h++){u[h]=[];for(let d=0;d<a.length;d++)u[h][d]=a[d][h]}return u},VLOOKUP:(a,u,h,d)=>{a=o.accept(a);try{u=o.accept(u,e.ARRAY,void 0,!1)}catch(f){throw f instanceof t?t.NA:f}if(h=o.accept(h,e.NUMBER),d=o.accept(d,e.BOOLEAN,!0),h<1)throw t.VALUE;if(u[0][h-1]===void 0)throw t.REF;const s=typeof a;if(d){let f=s===typeof u[0][0]?u[0][0]:null;for(let N=1;N<u.length;N++){const c=u[N],l=u[N][0];if(typeof l===s){if(f>a&&l>a)throw t.NA;if(l===a)return c[h-1];if(f!=null&&l>a&&f<=a)return u[N-1][h-1];f=l}}if(f==null)throw t.NA;return f}else{let f=-1;if(r.isWildCard(a)?f=u.findIndex(N=>r.toRegex(a,"i").test(N[0])):f=u.findIndex(N=>N[0]===a),f===-1)throw t.NA;return u[f][h-1]}}},Nn}var gn,dr;function uo(){if(dr)return gn;dr=1;const t=Rt(),{FormulaHelpers:n,Types:e}=At(),r=n,i={"#NULL!":1,"#DIV/0!":2,"#VALUE!":3,"#REF!":4,"#NAME?":5,"#NUM!":6,"#N/A":7};return gn={CELL:(o,A)=>{},"ERROR.TYPE":o=>{if(o=r.accept(o),o instanceof t)return i[o.toString()];throw t.NA},INFO:()=>{},ISBLANK:o=>o.ref?o.value==null||o.value==="":!1,ISERR:o=>(o=r.accept(o),o instanceof t&&o.toString()!=="#N/A"),ISERROR:o=>(o=r.accept(o),o instanceof t),ISEVEN:o=>(o=r.accept(o,e.NUMBER),o=Math.trunc(o),o%2===0),ISLOGICAL:o=>(o=r.accept(o),typeof o=="boolean"),ISNA:o=>(o=r.accept(o),o instanceof t&&o.toString()==="#N/A"),ISNONTEXT:o=>(o=r.accept(o),typeof o!="string"),ISNUMBER:o=>(o=r.accept(o),typeof o=="number"),ISREF:o=>!o.ref||r.isCellRef(o)&&(o.ref.row>1048576||o.ref.col>16384)||r.isRangeRef(o)&&(o.ref.from.row>1048576||o.ref.from.col>16384||o.ref.to.row>1048576||o.ref.to.col>16384)?!1:(o=r.accept(o),!(o instanceof t&&o.toString()==="#REF!")),ISTEXT:o=>(o=r.accept(o),typeof o=="string"),N:o=>{o=r.accept(o);const A=typeof o;if(A==="number")return o;if(A==="boolean")return Number(o);if(o instanceof t)throw o;return 0},NA:()=>{throw t.NA},TYPE:o=>{if(o.ref){if(r.isRangeRef(o))return 16;if(r.isCellRef(o)&&(o=r.accept(o),typeof o=="string"&&o.length===0))return 1}o=r.accept(o);const A=typeof o;if(A==="number")return 1;if(A==="string")return 2;if(A==="boolean")return 4;if(o instanceof t)return 16;if(Array.isArray(o))return 64}},gn}var An,Rr;function lo(){if(Rr)return An;Rr=1;const t=Rt(),{FormulaHelpers:n,Types:e}=At(),r=n,i=ei(),E=ii(),o=2.5066282746310002,A={"BETA.DIST":(a,u,h,d,s,f)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),s=r.accept(s,e.NUMBER,0),f=r.accept(f,e.NUMBER,1),u<=0||h<=0||a<s||a>f||s===f)throw t.NUM;return a=(a-s)/(f-s),d?i.beta.cdf(a,u,h):i.beta.pdf(a,u,h)/(f-s)},"BETA.INV":(a,u,h,d,s)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.NUMBER,0),s=r.accept(s,e.NUMBER,1),u<=0||h<=0||a<=0||a>1)throw t.NUM;return i.beta.inv(a,u,h)*(s-d)+d},"BINOM.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),u<0||h<0||h>1||a<0||a>u)throw t.NUM;return d?i.binomial.cdf(a,u,h):i.binomial.pdf(a,u,h)},"BINOM.DIST.RANGE":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.NUMBER,h),a<0||u<0||u>1||h<0||h>a||d<h||d>a)throw t.NUM;let s=0;for(let f=h;f<=d;f++)s+=E.COMBIN(a,f)*Math.pow(u,f)*Math.pow(1-u,a-f);return s},"BINOM.INV":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<0||u<0||u>1||h<0||h>1)throw t.NUM;let d=0;for(;d<=a;){if(i.binomial.cdf(d,a,u)>=h)return d;d++}},"CHISQ.DIST":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),u=Math.trunc(u),a<0||u<1||u>10**10)throw t.NUM;return h?i.chisquare.cdf(a,u):i.chisquare.pdf(a,u)},"CHISQ.DIST.RT":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),u=Math.trunc(u),a<0||u<1||u>10**10)throw t.NUM;return 1-i.chisquare.cdf(a,u)},"CHISQ.INV":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),u=Math.trunc(u),a<0||a>1||u<1||u>10**10)throw t.NUM;return i.chisquare.inv(a,u)},"CHISQ.INV.RT":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),u=Math.trunc(u),a<0||a>1||u<1||u>10**10)throw t.NUM;return i.chisquare.inv(1-a,u)},"CHISQ.TEST":(a,u)=>{const h=r.accept(a,e.ARRAY,void 0,!1,!1),d=r.accept(u,e.ARRAY,void 0,!1,!1);if(h.length!==d.length||h[0].length!==d[0].length||h.length===1&&h[0].length===1)throw t.NA;const s=h.length,f=h[0].length;let N=(s-1)*(f-1);s===1?N=f-1:N=s-1;let c=0;for(let O=0;O<s;O++)for(let m=0;m<f;m++)if(!(typeof h[O][m]!="number"||typeof d[O][m]!="number")){if(d[O][m]===0)throw t.DIV0;c+=Math.pow(h[O][m]-d[O][m],2)/d[O][m]}let l=Math.exp(-.5*c);N%2===1&&(l=l*Math.sqrt(2*c/Math.PI));let p=N;for(;p>=2;)l=l*c/p,p=p-2;let R=l,T=N;for(;R>1e-15*l;)T=T+2,R=R*c/T,l=l+R;return 1-l},"CONFIDENCE.NORM":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),h=Math.trunc(h),a<=0||a>=1||u<=0||h<1)throw t.NUM;return i.normalci(1,a,u,h)[1]-1},"CONFIDENCE.T":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),h=Math.trunc(h),a<=0||a>=1||u<=0||h<1)throw t.NUM;if(h===1)throw t.DIV0;return i.tci(1,a,u,h)[1]-1},CORREL:(a,u)=>{if(a=r.accept(a,e.ARRAY,void 0,!0,!0),u=r.accept(u,e.ARRAY,void 0,!0,!0),a.length!==u.length)throw t.NA;const h=[],d=[];for(let s=0;s<a.length;s++)typeof a[s]!="number"||typeof u[s]!="number"||(h.push(a[s]),d.push(u[s]));if(h.length<=1)throw t.DIV0;return i.corrcoeff(h,d)},"COVARIANCE.P":(a,u)=>{if(a=r.accept(a,e.ARRAY,void 0,!0,!0),u=r.accept(u,e.ARRAY,void 0,!0,!0),a.length!==u.length)throw t.NA;const h=[],d=[];for(let c=0;c<a.length;c++)typeof a[c]!="number"||typeof u[c]!="number"||(h.push(a[c]),d.push(u[c]));const s=i.mean(h),f=i.mean(d);let N=0;for(let c=0;c<h.length;c++)N+=(h[c]-s)*(d[c]-f);return N/h.length},"COVARIANCE.S":(a,u)=>{if(a=r.accept(a,e.ARRAY,void 0,!0,!0),u=r.accept(u,e.ARRAY,void 0,!0,!0),a.length!==u.length)throw t.NA;const h=[],d=[];for(let s=0;s<a.length;s++)typeof a[s]!="number"||typeof u[s]!="number"||(h.push(a[s]),d.push(u[s]));if(h.length<=1)throw t.DIV0;return i.covariance(h,d)},DEVSQ:(...a)=>{let u=0,h=[];r.flattenParams(a,e.NUMBER,!0,(s,f)=>{typeof s=="number"&&(u+=s,h.push(s))});const d=u/h.length;u=0;for(let s=0;s<h.length;s++)u+=(h[s]-d)**2;return u},"EXPON.DIST":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.BOOLEAN),a<0||u<=0)throw t.NUM;return h?i.exponential.cdf(a,u):i.exponential.pdf(a,u)},"F.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),a<0||u<1||h<1)throw t.NUM;return u=Math.trunc(u),h=Math.trunc(h),d?i.centralF.cdf(a,u,h):i.centralF.pdf(a,u,h)},"F.DIST.RT":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<0||u<1||h<1)throw t.NUM;return u=Math.trunc(u),h=Math.trunc(h),1-i.centralF.cdf(a,u,h)},"F.INV":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<0||a>1||u<1||h<1)throw t.NUM;return u=Math.trunc(u),h=Math.trunc(h),i.centralF.inv(a,u,h)},"F.INV.RT":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<0||a>1||u<1||u>=Math.pow(10,10)||h<1||h>=Math.pow(10,10))throw t.NUM;return u=Math.trunc(u),h=Math.trunc(h),i.centralF.inv(1-a,u,h)},"F.TEST":(a,u)=>{a=r.accept(a,e.ARRAY,void 0,!0,!0),u=r.accept(u,e.ARRAY,void 0,!0,!0);const h=[],d=[];let s=0,f=0;for(let l=0;l<Math.max(a.length,u.length);l++)typeof a[l]=="number"&&(h.push(a[l]),s+=a[l]),typeof u[l]=="number"&&(d.push(u[l]),f+=u[l]);if(h.length<=1||d.length<=1)throw t.DIV0;s/=h.length,f/=d.length;let N=0,c=0;for(let l=0;l<h.length;l++)N+=(s-h[l])**2;N/=h.length-1;for(let l=0;l<d.length;l++)c+=(f-d[l])**2;return c/=d.length-1,i.centralF.cdf(N/c,h.length-1,d.length-1)*2},FISHER:a=>{if(a=r.accept(a,e.NUMBER),a<=-1||a>=1)throw t.NUM;return Math.log((1+a)/(1-a))/2},FISHERINV:a=>{a=r.accept(a,e.NUMBER);let u=Math.exp(2*a);return(u-1)/(u+1)},FORECAST:(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.ARRAY,void 0,!0,!0),h=r.accept(h,e.ARRAY,void 0,!0,!0),h.length!==u.length)throw t.NA;const d=[],s=[];let f=!0;for(let O=0;O<u.length;O++)typeof u[O]!="number"||typeof h[O]!="number"||(d.push(u[O]),s.push(h[O]),h[O]!==h[0]&&(f=!1));if(f)throw t.DIV0;const N=i.mean(d),c=i.mean(s);let l=0,p=0;for(let O=0;O<d.length;O++)l+=(s[O]-c)*(d[O]-N),p+=(s[O]-c)**2;const R=l/p;return N-R*c+R*a},"FORECAST.ETS":()=>{},"FORECAST.ETS.CONFINT":()=>{},"FORECAST.ETS.SEASONALITY":()=>{},"FORECAST.ETS.STAT":()=>{},"FORECAST.LINEAR":(...a)=>A.FORECAST(...a),FREQUENCY:(a,u)=>{a=r.accept(a,e.ARRAY,void 0,!0,!0),u=r.accept(u,e.ARRAY,void 0,!0,!0);const h=[];for(let s=0;s<u.length;s++)typeof u[s]=="number"&&h.push(u[s]);h.sort(),h.push(1/0);const d=[];for(let s=0;s<h.length;s++){d[s]=[],d[s][0]=0;for(let f=0;f<a.length;f++){if(typeof a[f]!="number")continue;a[f]<=h[s]&&(d[s][0]++,a[f]=null)}}return d},GAMMA:a=>{if(a=r.accept(a,e.NUMBER),a===0||a<0&&a===Math.trunc(a))throw t.NUM;return i.gammafn(a)},"GAMMA.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),a<0||u<=0||h<=0)throw t.NUM;return d?i.gamma.cdf(a,u,h,!0):i.gamma.pdf(a,u,h,!1)},"GAMMA.INV":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<0||a>1||u<=0||h<=0)throw t.NUM;return i.gamma.inv(a,u,h)},GAMMALN:a=>{if(a=r.accept(a,e.NUMBER),a<=0)throw t.NUM;return i.gammaln(a)},"GAMMALN.PRECISE":a=>{if(a=r.accept(a,e.NUMBER),a<=0)throw t.NUM;return i.gammaln(a)},GAUSS:a=>(a=r.accept(a,e.NUMBER),i.normal.cdf(a,0,1)-.5),GEOMEAN:(...a)=>{const u=[];return r.flattenParams(a,e.NUMBER,!0,(h,d)=>{typeof h=="number"&&u.push(h)}),i.geomean(u)},GROWTH:(a,u,h,d)=>{a=r.accept(a,e.ARRAY,void 0,!0,!0);for(let m=0;m<a.length;m++)if(typeof a[m]!="number")throw t.VALUE;u=r.accept(u,e.ARRAY,null,!0,!0);const s=u==null;if(u==null){u=[];for(let m=1;m<=a.length;m++)u.push(m)}else{if(u.length!==a.length)throw t.REF;for(let m=0;m<u.length;m++)if(typeof u[m]!="number")throw t.VALUE}if(h=r.accept(h,e.ARRAY,null,!1,!0),h==null&&s){h=[];for(let m=1;m<=a.length;m++)h.push(m);h=[h]}else h==null&&(h=Array.isArray(u[0])?u:[u]);d=r.accept(d,e.BOOLEAN,!0);const f=a.length;let N=0,c=0,l=0,p=0;for(let m=0;m<f;m++){const M=u[m],I=Math.log(a[m]);N+=M,c+=I,l+=M*I,p+=M*M}N/=f,c/=f,l/=f,p/=f;let R,T;d?(R=(l-N*c)/(p-N*N),T=c-R*N):(R=l/p,T=0);const O=[];for(let m=0;m<h.length;m++){O[m]=[];for(let M=0;M<h[0].length;M++){if(typeof h[m][M]!="number")throw t.VALUE;O[m][M]=Math.exp(T+R*h[m][M])}}return O},HARMEAN:(...a)=>{let u=0,h=0;return r.flattenParams(a,e.NUMBER,!0,(d,s)=>{typeof d=="number"&&(h+=1/d,u++)}),u/h},"HYPGEOM.DIST":(a,u,h,d,s)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.NUMBER),s=r.accept(s,e.BOOLEAN),a=Math.trunc(a),u=Math.trunc(u),h=Math.trunc(h),d=Math.trunc(d),d<=0||a<0||u<=0||h<=0||u>d||h>d||u<a||h<a||a<u-d+h)throw t.NUM;function f(c,l,p,R){return E.COMBIN(p,c)*E.COMBIN(R-p,l-c)/E.COMBIN(R,l)}function N(c,l,p,R){let T=0;for(let O=0;O<=c;O++)T+=f(O,l,p,R);return T}return s?N(a,u,h,d):f(a,u,h,d)},INTERCEPT:(a,u)=>{if(a=r.accept(a,e.ARRAY,void 0,!0,!0),u=r.accept(u,e.ARRAY,void 0,!0,!0),u.length!==a.length)throw t.NA;const h=[],d=[];for(let p=0;p<a.length;p++)typeof a[p]!="number"||typeof u[p]!="number"||(h.push(a[p]),d.push(u[p]));if(h.length<=1)throw t.DIV0;const s=i.mean(h),f=i.mean(d);let N=0,c=0;for(let p=0;p<h.length;p++)N+=(d[p]-f)*(h[p]-s),c+=(d[p]-f)**2;const l=N/c;return s-l*f},KURT:(...a)=>{let u=0,h=[];r.flattenParams(a,e.NUMBER,!0,(f,N)=>{typeof f=="number"&&(u+=f,h.push(f))});const d=h.length;u/=d;let s=0;for(let f=0;f<d;f++)s+=Math.pow(h[f]-u,4);return s=s/Math.pow(i.stdev(h,!0),4),d*(d+1)/((d-1)*(d-2)*(d-3))*s-3*(d-1)*(d-1)/((d-2)*(d-3))},LINEST:()=>{},LOGEST:()=>{},"LOGNORM.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),a<=0||h<=0)throw t.NUM;return d?i.lognormal.cdf(a,u,h):i.lognormal.pdf(a,u,h)},"LOGNORM.INV":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<=0||a>=1||h<=0)throw t.NUM;return i.lognormal.inv(a,u,h)},"MODE.MULT":()=>{},"MODE.SNGL":()=>{},"NEGBINOM.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),a=Math.trunc(a),u=Math.trunc(u),h<0||h>1||a<0||u<1)throw t.NUM;return d?i.negbin.cdf(a,u,h):i.negbin.pdf(a,u,h)},"NORM.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),h<=0)throw t.NUM;return d?i.normal.cdf(a,u,h):i.normal.pdf(a,u,h)},"NORM.INV":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),a<=0||a>=1||h<=0)throw t.NUM;return i.normal.inv(a,u,h)},"NORM.S.DIST":(a,u)=>(a=r.accept(a,e.NUMBER),u=r.accept(u,e.BOOLEAN),u?i.normal.cdf(a,0,1):i.normal.pdf(a,0,1)),"NORM.S.INV":a=>{if(a=r.accept(a,e.NUMBER),a<=0||a>=1)throw t.NUM;return i.normal.inv(a,0,1)},PEARSON:()=>{},"PERCENTILE.EXC":()=>{},"PERCENTILE.INC":()=>{},"PERCENTRANK.EXC":()=>{},"PERCENTRANK.INC":()=>{},PERMUTATIONA:()=>{},PHI:a=>(a=r.accept(a,e.NUMBER),Math.exp(-.5*a*a)/o),"POISSON.DIST":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.BOOLEAN),a<0||u<0)throw t.NUM;return a=Math.trunc(a),h?i.poisson.cdf(a,u):i.poisson.pdf(a,u)},PROB:()=>{},"QUARTILE.EXC":()=>{},"QUARTILE.INC":()=>{},"RANK.AVG":()=>{},"RANK.EQ":()=>{},RSQ:()=>{},SKEW:()=>{},"SKEW.P":()=>{},SLOPE:()=>{},STANDARDIZE:(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),h<=0)throw t.NUM;return(a-u)/h},"STDEV.P":()=>{},"STDEV.S":()=>{},STDEVA:()=>{},STDEVPA:()=>{},STEYX:()=>{},"T.DIST":(a,u,h)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.BOOLEAN),u<1)throw t.NUM;return h?i.studentt.cdf(a,u):i.studentt.pdf(a,u)},"T.DIST.2T":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),u<1||a<0)throw t.NUM;return(1-i.studentt.cdf(a,u))*2},"T.DIST.RT":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),u<1)throw t.NUM;return 1-i.studentt.cdf(a,u)},"T.INV":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),a<=0||a>1||u<1)throw t.NUM;return u=u%1===0?u:Math.trunc(u),i.studentt.inv(a,u)},"T.INV.2T":(a,u)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),a<=0||a>1||u<1)throw t.NUM;return u=u%1===0?u:Math.trunc(u),Math.abs(i.studentt.inv(a/2,u))},"T.TEST":()=>{},TREND:()=>{},TRIMMEAN:()=>{},"VAR.P":()=>{},"VAR.S":()=>{},VARA:()=>{},VARPA:()=>{},"WEIBULL.DIST":(a,u,h,d)=>{if(a=r.accept(a,e.NUMBER),u=r.accept(u,e.NUMBER),h=r.accept(h,e.NUMBER),d=r.accept(d,e.BOOLEAN),a<0||u<=0||h<=0)throw t.NUM;return d?1-Math.exp(-Math.pow(a/h,u)):Math.pow(a,u-1)*Math.exp(-Math.pow(a/h,u))*u/Math.pow(h,u)},"Z.TEST":()=>{}};return An={DistributionFunctions:A},An}var Mn,Nr;function fo(){if(Nr)return Mn;Nr=1;const t=Rt(),{FormulaHelpers:n,Types:e,Criteria:r,Address:i}=At(),{Infix:E}=qe(),o=n,{DistributionFunctions:A}=lo();return Mn=Object.assign({AVEDEV:(...u)=>{let h=0;const d=[];o.flattenParams(u,e.NUMBER,!0,(f,N)=>{typeof f=="number"&&(h+=f,d.push(f))});const s=h/d.length;h=0;for(let f=0;f<d.length;f++)h+=Math.abs(d[f]-s);return h/d.length},AVERAGE:(...u)=>{let h=0,d=0;return o.flattenParams(u,e.NUMBER,!0,(s,f)=>{typeof s=="number"&&(h+=s,d++)}),h/d},AVERAGEA:(...u)=>{let h=0,d=0;return o.flattenParams(u,e.NUMBER,!0,(s,f)=>{const N=typeof s;N==="number"?(h+=s,d++):N==="string"&&d++}),h/d},AVERAGEIF:(u,h,d,s)=>{const f=o.retrieveRanges(u,h,s);h=f[0],s=f[1],d=o.retrieveArg(u,d);const N=d.isArray;d=r.parse(o.accept(d));let c=0,l=0;if(h.forEach((p,R)=>{p.forEach((T,O)=>{const m=s[R][O];typeof m=="number"&&(d.op==="wc"?d.match===d.value.test(T)&&(c+=m,l++):E.compareOp(T,d.op,d.value,Array.isArray(T),N)&&(c+=m,l++))})}),l===0)throw t.DIV0;return c/l},AVERAGEIFS:()=>{},COUNT:(...u)=>{let h=0;return o.flattenParams(u,null,!0,(d,s)=>{(s.isLiteral&&!isNaN(d)||typeof d=="number")&&h++}),h},COUNTIF:(u,h)=>{u=o.accept(u,e.ARRAY,void 0,!1,!0);const d=h.isArray;h=o.accept(h);let s=0;return h=r.parse(h),u.forEach(f=>{f.forEach(N=>{h.op==="wc"?h.match===h.value.test(N)&&s++:E.compareOp(N,h.op,h.value,Array.isArray(N),d)&&s++})}),s},LARGE:()=>{},MAX:()=>{},MAXA:()=>{},MAXIFS:()=>{},MEDIAN:()=>{},MIN:()=>{},MINA:()=>{},MINIFS:()=>{},PERMUT:()=>{},PERMUTATIONA:()=>{},SMALL:()=>{}},A),Mn}var Tn,gr;function ho(){if(gr)return Tn;gr=1;const t=Rt(),{FormulaHelpers:n,Types:e}=At(),r=n,i=1e3*60*60*24,E=new Date(Date.UTC(1900,0,1)),o=[void 0,0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,1,2,3,4,5,6,0],A=[void 0,[1,2,3,4,5,6,7],[7,1,2,3,4,5,6],[6,0,1,2,3,4,5],void 0,void 0,void 0,void 0,void 0,void 0,void 0,[7,1,2,3,4,5,6],[6,7,1,2,3,4,5],[5,6,7,1,2,3,4],[4,5,6,7,1,2,3],[3,4,5,6,7,1,2],[2,3,4,5,6,7,1],[1,2,3,4,5,6,7]],a=[void 0,[6,0],[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],void 0,void 0,void 0,[0],[1],[2],[3],[4],[5],[6]],u=/^\s*(\d\d?)\s*(:\s*\d\d?)?\s*(:\s*\d\d?)?\s*(pm|am)?\s*$/i,h=/^\s*((\d\d?)\s*([-\/])\s*(\d\d?))([\d:.apm\s]*)$/i,d=/^\s*((\d\d?)\s*([-/])\s*(jan\w*|feb\w*|mar\w*|apr\w*|may\w*|jun\w*|jul\w*|aug\w*|sep\w*|oct\w*|nov\w*|dec\w*))([\d:.apm\s]*)$/i,s=/^\s*((jan\w*|feb\w*|mar\w*|apr\w*|may\w*|jun\w*|jul\w*|aug\w*|sep\w*|oct\w*|nov\w*|dec\w*)\s*([-/])\s*(\d\d?))([\d:.apm\s]*)$/i;function f(M){const I=M.match(h),w=M.match(d),D=M.match(s);return I?M=I[1]+I[3]+new Date().getFullYear()+I[5]:w?M=w[1]+w[3]+new Date().getFullYear()+w[5]:D&&(M=D[1]+D[3]+new Date().getFullYear()+D[5]),new Date(Date.parse(`${M} UTC`))}function N(M){const I=M.match(u);if(!I)return;const w=I[2]?I[2]:":00",D=I[3]?I[3]:":00",G=I[4]?" "+I[4]:"",H=new Date(Date.parse(`1/1/1900 ${I[1]+w+D+G} UTC`));let b=new Date;return b=new Date(Date.UTC(b.getFullYear(),b.getMonth(),b.getDate(),b.getHours(),b.getMinutes(),b.getSeconds(),b.getMilliseconds())),new Date(Date.UTC(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),H.getUTCHours(),H.getUTCMinutes(),H.getUTCSeconds(),H.getUTCMilliseconds()))}function c(M){const I=M>-22038912e5?2:1;return Math.floor((M-E)/864e5)+I}function l(M){if(M<0)throw t.VALUE;return M<=60?new Date(E.getTime()+(M-1)*864e5):new Date(E.getTime()+(M-2)*864e5)}function p(M){if(M instanceof Date)return{date:M};M=r.accept(M);let I=!0,w;return isNaN(M)?(w=N(M),w?I=!1:w=f(M)):(M=Number(M),w=l(M)),{date:w,isDateGiven:I}}function R(M){return p(M).date}function T(M,I){return M.getUTCFullYear()===I.getUTCFullYear()&&M.getUTCMonth()===I.getUTCMonth()&&M.getUTCDate()===I.getUTCDate()}function O(M){return M===1900?!0:new Date(M,1,29).getMonth()===1}const m={DATE:(M,I,w)=>{if(M=r.accept(M,e.NUMBER),I=r.accept(I,e.NUMBER),w=r.accept(w,e.NUMBER),M<0||M>=1e4)throw t.NUM;return M<1900&&(M+=1900),c(Date.UTC(M,I-1,w))},DATEDIF:(M,I,w)=>{if(M=R(M),I=R(I),w=r.accept(w,e.STRING).toLowerCase(),M>I)throw t.NUM;const D=I.getUTCFullYear()-M.getUTCFullYear(),G=I.getUTCMonth()-M.getUTCMonth(),H=I.getUTCDate()-M.getUTCDate();let b;switch(w){case"y":return b=G<0||G===0&&H<0?-1:0,b+D;case"m":return b=H<0?-1:0,D*12+G+b;case"d":return Math.floor(I-M)/i;case"md":return M.setUTCFullYear(I.getUTCFullYear()),H<0?M.setUTCMonth(I.getUTCMonth()-1):M.setUTCMonth(I.getUTCMonth()),Math.floor(I-M)/i;case"ym":return b=H<0?-1:0,(b+D*12+G)%12;case"yd":return G<0||G===0&&H<0?M.setUTCFullYear(I.getUTCFullYear()-1):M.setUTCFullYear(I.getUTCFullYear()),Math.floor(I-M)/i}},DATEVALUE:M=>{M=r.accept(M,e.STRING);const{date:I,isDateGiven:w}=p(M);if(!w)return 0;const D=c(I);if(D<0||D>2958465)throw t.VALUE;return D},DAY:M=>R(M).getUTCDate(),DAYS:(M,I)=>{M=R(M),I=R(I);let w=0;return I<-22038912e5&&-22038912e5<M&&(w=1),Math.floor(M-I)/i+w},DAYS360:(M,I,w)=>{M=R(M),I=R(I),w=r.accept(w,e.BOOLEAN,!1),M.getUTCDate()===31&&M.setUTCDate(30),!w&&M.getUTCDate()<30&&I.getUTCDate()>30?I.setUTCMonth(I.getUTCMonth()+1,1):I.getUTCDate()===31&&I.setUTCDate(30);const D=I.getUTCFullYear()-M.getUTCFullYear(),G=I.getUTCMonth()-M.getUTCMonth(),H=I.getUTCDate()-M.getUTCDate();return G*30+H+D*12*30},EDATE:(M,I)=>(M=R(M),I=r.accept(I,e.NUMBER),M.setUTCMonth(M.getUTCMonth()+I),c(M)),EOMONTH:(M,I)=>(M=R(M),I=r.accept(I,e.NUMBER),M.setUTCMonth(M.getUTCMonth()+I+1,0),c(M)),HOUR:M=>R(M).getUTCHours(),ISOWEEKNUM:M=>{const I=R(M),w=new Date(Date.UTC(I.getFullYear(),I.getMonth(),I.getDate())),D=w.getUTCDay();w.setUTCDate(w.getUTCDate()+4-D);const G=new Date(Date.UTC(w.getUTCFullYear(),0,1));return Math.ceil(((w-G)/864e5+1)/7)},MINUTE:M=>R(M).getUTCMinutes(),MONTH:M=>R(M).getUTCMonth()+1,NETWORKDAYS:(M,I,w)=>{M=R(M),I=R(I);let D=1;if(M>I){D=-1;const b=M;M=I,I=b}const G=[];w!=null&&r.flattenParams([w],e.NUMBER,!1,b=>{G.push(R(b))});let H=0;for(;M<=I;){if(M.getUTCDay()!==0&&M.getUTCDay()!==6){let b=!1;for(let z=0;z<G.length;z++)if(T(M,G[z])){b=!0;break}b||H++}M.setUTCDate(M.getUTCDate()+1)}return D*H},"NETWORKDAYS.INTL":(M,I,w,D)=>{M=R(M),I=R(I);let G=1;if(M>I){G=-1;const z=M;M=I,I=z}if(w=r.accept(w,null,1),w==="1111111")return 0;if(typeof w=="string"&&Number(w).toString()!==w){if(w.length!==7)throw t.VALUE;w=w.charAt(6)+w.slice(0,6);const z=[];for(let Z=0;Z<w.length;Z++)w.charAt(Z)==="1"&&z.push(Z);w=z}else{if(typeof w!="number")throw t.VALUE;w=a[w]}const H=[];D!=null&&r.flattenParams([D],e.NUMBER,!1,z=>{H.push(R(z))});let b=0;for(;M<=I;){let z=!1;for(let Z=0;Z<w.length;Z++)if(w[Z]===M.getUTCDay()){z=!0;break}if(!z){let Z=!1;for(let rt=0;rt<H.length;rt++)if(T(M,H[rt])){Z=!0;break}Z||b++}M.setUTCDate(M.getUTCDate()+1)}return G*b},NOW:()=>{const M=new Date;return c(Date.UTC(M.getFullYear(),M.getMonth(),M.getDate(),M.getHours(),M.getMinutes(),M.getSeconds(),M.getMilliseconds()))+(3600*M.getHours()+60*M.getMinutes()+M.getSeconds())/86400},SECOND:M=>R(M).getUTCSeconds(),TIME:(M,I,w)=>{if(M=r.accept(M,e.NUMBER),I=r.accept(I,e.NUMBER),w=r.accept(w,e.NUMBER),M<0||M>32767||I<0||I>32767||w<0||w>32767)throw t.NUM;return(3600*M+60*I+w)/86400},TIMEVALUE:M=>(M=R(M),(3600*M.getUTCHours()+60*M.getUTCMinutes()+M.getUTCSeconds())/86400),TODAY:()=>{const M=new Date;return c(Date.UTC(M.getFullYear(),M.getMonth(),M.getDate()))},WEEKDAY:(M,I)=>{const w=R(M);I=r.accept(I,e.NUMBER,1);const D=w.getUTCDay(),G=A[I];if(!G)throw t.NUM;return G[D]},WEEKNUM:(M,I)=>{const w=R(M);if(I=r.accept(I,e.NUMBER,1),I===21)return m.ISOWEEKNUM(M);const D=o[I],G=new Date(Date.UTC(w.getUTCFullYear(),0,1)),H=G.getUTCDay()<D?1:0;return Math.ceil(((w-G)/864e5+1)/7)+H},WORKDAY:(M,I,w)=>m["WORKDAY.INTL"](M,I,1,w),"WORKDAY.INTL":(M,I,w,D)=>{if(M=R(M),I=r.accept(I,e.NUMBER),w=r.accept(w,null,1),w==="1111111")throw t.VALUE;if(typeof w=="string"&&Number(w).toString()!==w){if(w.length!==7)throw t.VALUE;w=w.charAt(6)+w.slice(0,6);const b=[];for(let z=0;z<w.length;z++)w.charAt(z)==="1"&&b.push(z);w=b}else{if(typeof w!="number")throw t.VALUE;if(w=a[w],w==null)throw t.NUM}const G=[];D!=null&&r.flattenParams([D],e.NUMBER,!1,b=>{G.push(R(b))}),M.setUTCDate(M.getUTCDate()+1);let H=0;for(;H<I;){let b=!1;for(let z=0;z<w.length;z++)if(w[z]===M.getUTCDay()){b=!0;break}if(!b){let z=!1;for(let Z=0;Z<G.length;Z++)if(T(M,G[Z])){z=!0;break}z||H++}M.setUTCDate(M.getUTCDate()+1)}return c(M)-1},YEAR:M=>R(M).getUTCFullYear(),YEARFRAC:(M,I,w)=>{if(M=R(M),I=R(I),M>I){const rt=M;M=I,I=rt}if(w=r.accept(w,e.NUMBER,0),w=Math.trunc(w),w<0||w>4)throw t.VALUE;let D=M.getUTCDate();const G=M.getUTCMonth()+1,H=M.getUTCFullYear();let b=I.getUTCDate();const z=I.getUTCMonth()+1,Z=I.getUTCFullYear();switch(w){case 0:return D===31&&b===31?(D=30,b=30):D===31?D=30:D===30&&b===31&&(b=30),Math.abs(b+z*30+Z*360-(D+G*30+H*360))/360;case 1:if(Z-H<2){const rt=O(H)&&H!==1900?366:365;return m.DAYS(I,M)/rt}else{const rt=Z-H+1,wt=(new Date(Z+1,0,1)-new Date(H,0,1))/1e3/60/60/24/rt;return m.DAYS(I,M)/wt}case 2:return Math.abs(m.DAYS(I,M)/360);case 3:return Math.abs(m.DAYS(I,M)/365);case 4:return Math.abs(b+z*30+Z*360-(D+G*30+H*360))/360}}};return Tn=m,Tn}var vn,Ar;function po(){if(Ar)return vn;Ar=1;const t=Rt(),{FormulaHelpers:n,Types:e}=At(),r=n;return vn={ENCODEURL:E=>encodeURIComponent(r.accept(E,e.STRING)),FILTERXML:()=>{},WEBSERVICE:(E,o)=>{throw t.ERROR("WEBSERVICE is not supported in sync mode.")}},vn}var kn="7.1.2";function ot(t){return t&&t.length===0}function Vt(t){return t==null?[]:Object.keys(t)}function mt(t){for(var n=[],e=Object.keys(t),r=0;r<e.length;r++)n.push(t[e[r]]);return n}function Eo(t,n){for(var e=[],r=Vt(t),i=0;i<r.length;i++){var E=r[i];e.push(n.call(null,t[E],E))}return e}function W(t,n){for(var e=[],r=0;r<t.length;r++)e.push(n.call(null,t[r],r));return e}function _t(t){for(var n=[],e=0;e<t.length;e++){var r=t[e];Array.isArray(r)?n=n.concat(_t(r)):n.push(r)}return n}function Ht(t){return ot(t)?void 0:t[0]}function oi(t){var n=t&&t.length;return n?t[n-1]:void 0}function $(t,n){if(Array.isArray(t))for(var e=0;e<t.length;e++)n.call(null,t[e],e);else if($n(t))for(var r=Vt(t),e=0;e<r.length;e++){var i=r[e],E=t[i];n.call(null,E,i)}else throw Error("non exhaustive match")}function qt(t){return typeof t=="string"}function Jt(t){return t===void 0}function se(t){return t instanceof Function}function Mt(t,n){return n===void 0&&(n=1),t.slice(n,t.length)}function ve(t,n){return n===void 0&&(n=1),t.slice(0,t.length-n)}function Wt(t,n){var e=[];if(Array.isArray(t))for(var r=0;r<t.length;r++){var i=t[r];n.call(null,i)&&e.push(i)}return e}function Re(t,n){return Wt(t,function(e){return!n(e)})}function bt(t,n){for(var e=Object.keys(t),r={},i=0;i<e.length;i++){var E=e[i],o=t[E];n(o)&&(r[E]=o)}return r}function Y(t,n){return $n(t)?t.hasOwnProperty(n):!1}function dt(t,n){return de(t,function(e){return e===n})!==void 0}function Lt(t){for(var n=[],e=0;e<t.length;e++)n.push(t[e]);return n}function Ie(t){var n={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}function de(t,n){for(var e=0;e<t.length;e++){var r=t[e];if(n.call(null,r))return r}}function Ro(t,n){for(var e=[],r=0;r<t.length;r++){var i=t[r];n.call(null,i)&&e.push(i)}return e}function Tt(t,n,e){for(var r=Array.isArray(t),i=r?t:mt(t),E=r?[]:Vt(t),o=e,A=0;A<i.length;A++)o=n.call(null,o,i[A],r?A:E[A]);return o}function ye(t){return Re(t,function(n){return n==null})}function bn(t,n){n===void 0&&(n=function(r){return r});var e=[];return Tt(t,function(r,i){var E=n(i);return dt(e,E)?r:(e.push(E),r.concat(i))},[])}function Kt(t){return Array.isArray(t)}function te(t){return t instanceof RegExp}function $n(t){return t instanceof Object}function Ft(t,n){for(var e=0;e<t.length;e++)if(!n(t[e],e))return!1;return!0}function Xe(t,n){return Re(t,function(e){return dt(n,e)})}function ai(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return!0;return!1}function No(t,n){for(var e=0;e<t.length;e++)if(t[e]===n)return e;return-1}function $t(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var r=0;r<n.length;r++)for(var i=n[r],E=Vt(i),o=0;o<E.length;o++){var A=E[o];t[A]=i[A]}return t}function go(t){for(var n=[],e=1;e<arguments.length;e++)n[e-1]=arguments[e];for(var r=0;r<n.length;r++)for(var i=n[r],E=Vt(i),o=0;o<E.length;o++){var A=E[o];Y(t,A)||(t[A]=i[A])}return t}function Yn(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return go.apply(null,[{}].concat(t))}function Ao(t,n){var e={};return $(t,function(r){var i=n(r),E=e[i];E?E.push(r):e[i]=[r]}),e}function Mr(t,n){for(var e=Ie(t),r=Vt(n),i=0;i<r.length;i++){var E=r[i],o=n[E];e[E]=o}return e}function Nt(){}function Tr(t){return t}function Mo(t){for(var n=[],e=0;e<t.length;e++){var r=t[e];n.push(r!==void 0?r:void 0)}return n}function Fn(t){console&&console.error&&console.error("Error: "+t)}function si(t){console&&console.warn&&console.warn("Warning: "+t)}function vr(){return typeof Map=="function"}function To(t,n){n.forEach(function(e){var r=e.prototype;Object.getOwnPropertyNames(r).forEach(function(i){if(i!=="constructor"){var E=Object.getOwnPropertyDescriptor(r,i);E&&(E.get||E.set)?Object.defineProperty(t.prototype,i,E):t.prototype[i]=e.prototype[i]}})})}function ci(t){function n(){}n.prototype=t;var e=new n;function r(){return typeof e.bar}return r(),r(),t}function De(t){return t[t.length-1]}function ui(t){var n=new Date().getTime(),e=t(),r=new Date().getTime(),i=r-n;return{time:i,value:e}}var Pe={exports:{}},vo=Pe.exports,Or;function Oo(){return Or||(Or=1,(function(t){(function(n,e){t.exports?t.exports=e():n.regexpToAst=e()})(typeof self<"u"?self:vo,function(){function n(){}n.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},n.prototype.restoreState=function(c){this.idx=c.idx,this.input=c.input,this.groupIdx=c.groupIdx},n.prototype.pattern=function(c){this.idx=0,this.input=c,this.groupIdx=0,this.consumeChar("/");var l=this.disjunction();this.consumeChar("/");for(var p={type:"Flags",loc:{begin:this.idx,end:c.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":A(p,"global");break;case"i":A(p,"ignoreCase");break;case"m":A(p,"multiLine");break;case"u":A(p,"unicode");break;case"y":A(p,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:p,value:l,loc:this.loc(0)}},n.prototype.disjunction=function(){var c=[],l=this.idx;for(c.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),c.push(this.alternative());return{type:"Disjunction",value:c,loc:this.loc(l)}},n.prototype.alternative=function(){for(var c=[],l=this.idx;this.isTerm();)c.push(this.term());return{type:"Alternative",value:c,loc:this.loc(l)}},n.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},n.prototype.assertion=function(){var c=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(c)};case"$":return{type:"EndAnchor",loc:this.loc(c)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(c)};case"B":return{type:"NonWordBoundary",loc:this.loc(c)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");var l;switch(this.popChar()){case"=":l="Lookahead";break;case"!":l="NegativeLookahead";break}a(l);var p=this.disjunction();return this.consumeChar(")"),{type:l,value:p,loc:this.loc(c)}}u()},n.prototype.quantifier=function(c){var l,p=this.idx;switch(this.popChar()){case"*":l={atLeast:0,atMost:1/0};break;case"+":l={atLeast:1,atMost:1/0};break;case"?":l={atLeast:0,atMost:1};break;case"{":var R=this.integerIncludingZero();switch(this.popChar()){case"}":l={atLeast:R,atMost:R};break;case",":var T;this.isDigit()?(T=this.integerIncludingZero(),l={atLeast:R,atMost:T}):l={atLeast:R,atMost:1/0},this.consumeChar("}");break}if(c===!0&&l===void 0)return;a(l);break}if(!(c===!0&&l===void 0))return a(l),this.peekChar(0)==="?"?(this.consumeChar("?"),l.greedy=!1):l.greedy=!0,l.type="Quantifier",l.loc=this.loc(p),l},n.prototype.atom=function(){var c,l=this.idx;switch(this.peekChar()){case".":c=this.dotAll();break;case"\\":c=this.atomEscape();break;case"[":c=this.characterClass();break;case"(":c=this.group();break}return c===void 0&&this.isPatternCharacter()&&(c=this.patternCharacter()),a(c),c.loc=this.loc(l),this.isQuantifier()&&(c.quantifier=this.quantifier()),c},n.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[E(`
|
|
3
|
+
`),E("\r"),E("\u2028"),E("\u2029")]}},n.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()}},n.prototype.decimalEscapeAtom=function(){var c=this.positiveInteger();return{type:"GroupBackReference",value:c}},n.prototype.characterClassEscape=function(){var c,l=!1;switch(this.popChar()){case"d":c=d;break;case"D":c=d,l=!0;break;case"s":c=f;break;case"S":c=f,l=!0;break;case"w":c=s;break;case"W":c=s,l=!0;break}return a(c),{type:"Set",value:c,complement:l}},n.prototype.controlEscapeAtom=function(){var c;switch(this.popChar()){case"f":c=E("\f");break;case"n":c=E(`
|
|
4
|
+
`);break;case"r":c=E("\r");break;case"t":c=E(" ");break;case"v":c=E("\v");break}return a(c),{type:"Character",value:c}},n.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var c=this.popChar();if(/[a-zA-Z]/.test(c)===!1)throw Error("Invalid ");var l=c.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:l}},n.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:E("\0")}},n.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},n.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},n.prototype.identityEscapeAtom=function(){var c=this.popChar();return{type:"Character",value:E(c)}},n.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case`
|
|
5
|
+
`:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var c=this.popChar();return{type:"Character",value:E(c)}}},n.prototype.characterClass=function(){var c=[],l=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),l=!0);this.isClassAtom();){var p=this.classAtom(),R=p.type==="Character";if(R&&this.isRangeDash()){this.consumeChar("-");var T=this.classAtom(),O=T.type==="Character";if(O){if(T.value<p.value)throw Error("Range out of order in character class");c.push({from:p.value,to:T.value})}else o(p.value,c),c.push(E("-")),o(T.value,c)}else o(p.value,c)}return this.consumeChar("]"),{type:"Set",complement:l,value:c}},n.prototype.classAtom=function(){switch(this.peekChar()){case"]":case`
|
|
6
|
+
`:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},n.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:E("\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()}},n.prototype.group=function(){var c=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),c=!1;break;default:this.groupIdx++;break}var l=this.disjunction();this.consumeChar(")");var p={type:"Group",capturing:c,value:l};return c&&(p.idx=this.groupIdx),p},n.prototype.positiveInteger=function(){var c=this.popChar();if(i.test(c)===!1)throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)c+=this.popChar();return parseInt(c,10)},n.prototype.integerIncludingZero=function(){var c=this.popChar();if(r.test(c)===!1)throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)c+=this.popChar();return parseInt(c,10)},n.prototype.patternCharacter=function(){var c=this.popChar();switch(c){case`
|
|
7
|
+
`: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:E(c)}}},n.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},n.prototype.isRangeDash=function(){return this.peekChar()==="-"&&this.isClassAtom(1)},n.prototype.isDigit=function(){return r.test(this.peekChar(0))},n.prototype.isClassAtom=function(c){switch(c===void 0&&(c=0),this.peekChar(c)){case"]":case`
|
|
8
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},n.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},n.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},n.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}},n.prototype.isQuantifier=function(){var c=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(c)}},n.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
|
|
9
|
+
`:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},n.prototype.parseHexDigits=function(c){for(var l="",p=0;p<c;p++){var R=this.popChar();if(e.test(R)===!1)throw Error("Expecting a HexDecimal digits");l+=R}var T=parseInt(l,16);return{type:"Character",value:T}},n.prototype.peekChar=function(c){return c===void 0&&(c=0),this.input[this.idx+c]},n.prototype.popChar=function(){var c=this.peekChar(0);return this.consumeChar(),c},n.prototype.consumeChar=function(c){if(c!==void 0&&this.input[this.idx]!==c)throw Error("Expected: '"+c+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++},n.prototype.loc=function(c){return{begin:c,end:this.idx}};var e=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function E(c){return c.charCodeAt(0)}function o(c,l){c.length!==void 0?c.forEach(function(p){l.push(p)}):l.push(c)}function A(c,l){if(c[l]===!0)throw"duplicate flag "+l;c[l]=!0}function a(c){if(c===void 0)throw Error("Internal Error - Should never get here!")}function u(){throw Error("Internal Error - Should never get here!")}var h,d=[];for(h=E("0");h<=E("9");h++)d.push(h);var s=[E("_")].concat(d);for(h=E("a");h<=E("z");h++)s.push(h);for(h=E("A");h<=E("Z");h++)s.push(h);var f=[E(" "),E("\f"),E(`
|
|
10
|
+
`),E("\r"),E(" "),E("\v"),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E(" "),E("\u2028"),E("\u2029"),E(" "),E(" "),E(" "),E("\uFEFF")];function N(){}return N.prototype.visitChildren=function(c){for(var l in c){var p=c[l];c.hasOwnProperty(l)&&(p.type!==void 0?this.visit(p):Array.isArray(p)&&p.forEach(function(R){this.visit(R)},this))}},N.prototype.visit=function(c){switch(c.type){case"Pattern":this.visitPattern(c);break;case"Flags":this.visitFlags(c);break;case"Disjunction":this.visitDisjunction(c);break;case"Alternative":this.visitAlternative(c);break;case"StartAnchor":this.visitStartAnchor(c);break;case"EndAnchor":this.visitEndAnchor(c);break;case"WordBoundary":this.visitWordBoundary(c);break;case"NonWordBoundary":this.visitNonWordBoundary(c);break;case"Lookahead":this.visitLookahead(c);break;case"NegativeLookahead":this.visitNegativeLookahead(c);break;case"Character":this.visitCharacter(c);break;case"Set":this.visitSet(c);break;case"Group":this.visitGroup(c);break;case"GroupBackReference":this.visitGroupBackReference(c);break;case"Quantifier":this.visitQuantifier(c);break}this.visitChildren(c)},N.prototype.visitPattern=function(c){},N.prototype.visitFlags=function(c){},N.prototype.visitDisjunction=function(c){},N.prototype.visitAlternative=function(c){},N.prototype.visitStartAnchor=function(c){},N.prototype.visitEndAnchor=function(c){},N.prototype.visitWordBoundary=function(c){},N.prototype.visitNonWordBoundary=function(c){},N.prototype.visitLookahead=function(c){},N.prototype.visitNegativeLookahead=function(c){},N.prototype.visitCharacter=function(c){},N.prototype.visitSet=function(c){},N.prototype.visitGroup=function(c){},N.prototype.visitGroupBackReference=function(c){},N.prototype.visitQuantifier=function(c){},{RegExpParser:n,BaseRegExpVisitor:N,VERSION:"0.5.0"}})})(Pe)),Pe.exports}var Ce=Oo(),ke={},Io=new Ce.RegExpParser;function je(t){var n=t.toString();if(ke.hasOwnProperty(n))return ke[n];var e=Io.pattern(n);return ke[n]=e,e}function yo(){ke={}}var Co=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),li="Complement Sets are not supported for first char optimization",Ge=`Unable to use "first char" lexer optimizations:
|
|
11
|
+
`;function So(t,n){n===void 0&&(n=!1);try{var e=je(t),r=xn(e.value,{},e.flags.ignoreCase);return r}catch(E){if(E.message===li)n&&si(""+Ge+(" Unable to optimize: < "+t.toString()+` >
|
|
12
|
+
`)+` Complement Sets cannot be automatically optimized.
|
|
13
|
+
This will disable the lexer's first char optimizations.
|
|
14
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{var i="";n&&(i=`
|
|
15
|
+
This will disable the lexer's first char optimizations.
|
|
16
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Fn(Ge+`
|
|
17
|
+
`+(" Failed parsing: < "+t.toString()+` >
|
|
18
|
+
`)+(" Using the regexp-to-ast library version: "+Ce.VERSION+`
|
|
19
|
+
`)+" Please open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]}function xn(t,n,e){switch(t.type){case"Disjunction":for(var r=0;r<t.value.length;r++)xn(t.value[r],n,e);break;case"Alternative":for(var i=t.value,r=0;r<i.length;r++){var E=i[r];switch(E.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var o=E;switch(o.type){case"Character":Le(o.value,n,e);break;case"Set":if(o.complement===!0)throw Error(li);$(o.value,function(u){if(typeof u=="number")Le(u,n,e);else{var h=u;if(e===!0)for(var d=h.from;d<=h.to;d++)Le(d,n,e);else{for(var d=h.from;d<=h.to&&d<Ae;d++)Le(d,n,e);if(h.to>=Ae)for(var s=h.from>=Ae?h.from:Ae,f=h.to,N=oe(s),c=oe(f),l=N;l<=c;l++)n[l]=l}}});break;case"Group":xn(o.value,n,e);break;default:throw Error("Non Exhaustive Match")}var A=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&Bn(o)===!1||o.type!=="Group"&&A===!1)break}break;default:throw Error("non exhaustive match!")}return mt(n)}function Le(t,n,e){var r=oe(t);n[r]=r,e===!0&&Uo(t,n)}function Uo(t,n){var e=String.fromCharCode(t),r=e.toUpperCase();if(r!==e){var i=oe(r.charCodeAt(0));n[i]=i}else{var E=e.toLowerCase();if(E!==e){var i=oe(E.charCodeAt(0));n[i]=i}}}function Ir(t,n){return de(t.value,function(e){if(typeof e=="number")return dt(n,e);var r=e;return de(n,function(i){return r.from<=i&&i<=r.to})!==void 0})}function Bn(t){return t.quantifier&&t.quantifier.atLeast===0?!0:t.value?Kt(t.value)?Ft(t.value,Bn):Bn(t.value):!1}var mo=(function(t){Co(n,t);function n(e){var r=t.call(this)||this;return r.targetCharCodes=e,r.found=!1,r}return n.prototype.visitChildren=function(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}t.prototype.visitChildren.call(this,e)}},n.prototype.visitCharacter=function(e){dt(this.targetCharCodes,e.value)&&(this.found=!0)},n.prototype.visitSet=function(e){e.complement?Ir(e,this.targetCharCodes)===void 0&&(this.found=!0):Ir(e,this.targetCharCodes)!==void 0&&(this.found=!0)},n})(Ce.BaseRegExpVisitor);function Kn(t,n){if(n instanceof RegExp){var e=je(n),r=new mo(t);return r.visit(e),r.found}else return de(n,function(i){return dt(t,i.charCodeAt(0))})!==void 0}var fi=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),Xt="PATTERN",le="defaultMode",we="modes",hi=typeof new RegExp("(?:)").sticky=="boolean";function Lo(t,n){n=Yn(n,{useSticky:hi,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
|
|
20
|
+
`],tracer:function(R,T){return T()}});var e=n.tracer;e("initCharCodeToOptimizedIndexMap",function(){Jo()});var r;e("Reject Lexer.NA",function(){r=Re(t,function(R){return R[Xt]===Gt.NA})});var i=!1,E;e("Transform Patterns",function(){i=!1,E=W(r,function(R){var T=R[Xt];if(te(T)){var O=T.source;return O.length===1&&O!=="^"&&O!=="$"&&O!=="."&&!T.ignoreCase?O:O.length===2&&O[0]==="\\"&&!dt(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],O[1])?O[1]:n.useSticky?Cr(T):yr(T)}else{if(se(T))return i=!0,{exec:T};if(Y(T,"exec"))return i=!0,T;if(typeof T=="string"){if(T.length===1)return T;var m=T.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),M=new RegExp(m);return n.useSticky?Cr(M):yr(M)}else throw Error("non exhaustive match")}})});var o,A,a,u,h;e("misc mapping",function(){o=W(r,function(R){return R.tokenTypeIdx}),A=W(r,function(R){var T=R.GROUP;if(T!==Gt.SKIPPED){if(qt(T))return T;if(Jt(T))return!1;throw Error("non exhaustive match")}}),a=W(r,function(R){var T=R.LONGER_ALT;if(T){var O=No(r,T);return O}}),u=W(r,function(R){return R.PUSH_MODE}),h=W(r,function(R){return Y(R,"POP_MODE")})});var d;e("Line Terminator Handling",function(){var R=di(n.lineTerminatorCharacters);d=W(r,function(T){return!1}),n.positionTracking!=="onlyOffset"&&(d=W(r,function(T){if(Y(T,"LINE_BREAKS"))return T.LINE_BREAKS;if(Ei(T,R)===!1)return Kn(R,T.PATTERN)}))});var s,f,N,c;e("Misc Mapping #2",function(){s=W(r,pi),f=W(E,zo),N=Tt(r,function(R,T){var O=T.GROUP;return qt(O)&&O!==Gt.SKIPPED&&(R[O]=[]),R},{}),c=W(E,function(R,T){return{pattern:E[T],longerAlt:a[T],canLineTerminator:d[T],isCustom:s[T],short:f[T],group:A[T],push:u[T],pop:h[T],tokenTypeIdx:o[T],tokenType:r[T]}})});var l=!0,p=[];return n.safeMode||e("First Char Optimization",function(){p=Tt(r,function(R,T,O){if(typeof T.PATTERN=="string"){var m=T.PATTERN.charCodeAt(0),M=oe(m);On(R,M,c[O])}else if(Kt(T.START_CHARS_HINT)){var I;$(T.START_CHARS_HINT,function(D){var G=typeof D=="string"?D.charCodeAt(0):D,H=oe(G);I!==H&&(I=H,On(R,H,c[O]))})}else if(te(T.PATTERN))if(T.PATTERN.unicode)l=!1,n.ensureOptimizations&&Fn(""+Ge+(" Unable to analyze < "+T.PATTERN.toString()+` > pattern.
|
|
21
|
+
`)+` The regexp unicode flag is not currently supported by the regexp-to-ast library.
|
|
22
|
+
This will disable the lexer's first char optimizations.
|
|
23
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{var w=So(T.PATTERN,n.ensureOptimizations);ot(w)&&(l=!1),$(w,function(D){On(R,D,c[O])})}else n.ensureOptimizations&&Fn(""+Ge+(" TokenType: <"+T.name+`> is using a custom token pattern without providing <start_chars_hint> parameter.
|
|
24
|
+
`)+` This will disable the lexer's first char optimizations.
|
|
25
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),l=!1;return R},[])}),e("ArrayPacking",function(){p=Mo(p)}),{emptyGroups:N,patternIdxToConfig:c,charCodeToPatternIdxToConfig:p,hasCustom:i,canBeOptimized:l}}function wo(t,n){var e=[],r=Po(t);e=e.concat(r.errors);var i=ko(r.valid),E=i.valid;return e=e.concat(i.errors),e=e.concat(_o(E)),e=e.concat(Wo(E)),e=e.concat(bo(E,n)),e=e.concat($o(E)),e}function _o(t){var n=[],e=Wt(t,function(r){return te(r[Xt])});return n=n.concat(xo(e)),n=n.concat(Go(e)),n=n.concat(Vo(e)),n=n.concat(Ho(e)),n=n.concat(Bo(e)),n}function Po(t){var n=Wt(t,function(i){return!Y(i,Xt)}),e=W(n,function(i){return{message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:ht.MISSING_PATTERN,tokenTypes:[i]}}),r=Xe(t,n);return{errors:e,valid:r}}function ko(t){var n=Wt(t,function(i){var E=i[Xt];return!te(E)&&!se(E)&&!Y(E,"exec")&&!qt(E)}),e=W(n,function(i){return{message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:ht.INVALID_PATTERN,tokenTypes:[i]}}),r=Xe(t,n);return{errors:e,valid:r}}var Fo=/[^\\][\$]/;function xo(t){var n=(function(i){fi(E,i);function E(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return E.prototype.visitEndAnchor=function(o){this.found=!0},E})(Ce.BaseRegExpVisitor),e=Wt(t,function(i){var E=i[Xt];try{var o=je(E),A=new n;return A.visit(o),A.found}catch{return Fo.test(E.source)}}),r=W(e,function(i){return{message:`Unexpected RegExp Anchor Error:
|
|
26
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
27
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ht.EOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Bo(t){var n=Wt(t,function(r){var i=r[Xt];return i.test("")}),e=W(n,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:ht.EMPTY_MATCH_PATTERN,tokenTypes:[r]}});return e}var Do=/[^\\[][\^]|^\^/;function Go(t){var n=(function(i){fi(E,i);function E(){var o=i!==null&&i.apply(this,arguments)||this;return o.found=!1,o}return E.prototype.visitStartAnchor=function(o){this.found=!0},E})(Ce.BaseRegExpVisitor),e=Wt(t,function(i){var E=i[Xt];try{var o=je(E),A=new n;return A.visit(o),A.found}catch{return Do.test(E.source)}}),r=W(e,function(i){return{message:`Unexpected RegExp Anchor Error:
|
|
28
|
+
Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
29
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:ht.SOI_ANCHOR_FOUND,tokenTypes:[i]}});return r}function Vo(t){var n=Wt(t,function(r){var i=r[Xt];return i instanceof RegExp&&(i.multiline||i.global)}),e=W(n,function(r){return{message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:ht.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}});return e}function Ho(t){var n=[],e=W(t,function(E){return Tt(t,function(o,A){return E.PATTERN.source===A.PATTERN.source&&!dt(n,A)&&A.PATTERN!==Gt.NA&&(n.push(A),o.push(A)),o},[])});e=ye(e);var r=Wt(e,function(E){return E.length>1}),i=W(r,function(E){var o=W(E,function(a){return a.name}),A=Ht(E).PATTERN;return{message:"The same RegExp pattern ->"+A+"<-"+("has been used in all of the following Token Types: "+o.join(", ")+" <-"),type:ht.DUPLICATE_PATTERNS_FOUND,tokenTypes:E}});return i}function Wo(t){var n=Wt(t,function(r){if(!Y(r,"GROUP"))return!1;var i=r.GROUP;return i!==Gt.SKIPPED&&i!==Gt.NA&&!qt(i)}),e=W(n,function(r){return{message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:ht.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}});return e}function bo(t,n){var e=Wt(t,function(i){return i.PUSH_MODE!==void 0&&!dt(n,i.PUSH_MODE)}),r=W(e,function(i){var E="Token Type: ->"+i.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+i.PUSH_MODE+"<-which does not exist";return{message:E,type:ht.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}});return r}function $o(t){var n=[],e=Tt(t,function(r,i,E){var o=i.PATTERN;return o===Gt.NA||(qt(o)?r.push({str:o,idx:E,tokenType:i}):te(o)&&Ko(o)&&r.push({str:o.source,idx:E,tokenType:i})),r},[]);return $(t,function(r,i){$(e,function(E){var o=E.str,A=E.idx,a=E.tokenType;if(i<A&&Yo(o,r.PATTERN)){var u="Token: ->"+a.name+`<- can never be matched.
|
|
30
|
+
`+("Because it appears AFTER the Token Type ->"+r.name+"<-")+`in the lexer's definition.
|
|
31
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;n.push({message:u,type:ht.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),n}function Yo(t,n){if(te(n)){var e=n.exec(t);return e!==null&&e.index===0}else{if(se(n))return n(t,0,[],{});if(Y(n,"exec"))return n.exec(t,0,[],{});if(typeof n=="string")return n===t;throw Error("non exhaustive match")}}function Ko(t){var n=[".","\\","[","]","|","^","$","(",")","?","*","+","{"];return de(n,function(e){return t.source.indexOf(e)!==-1})===void 0}function yr(t){var n=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",n)}function Cr(t){var n=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,n)}function qo(t,n,e){var r=[];return Y(t,le)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+le+`> property in its definition
|
|
32
|
+
`,type:ht.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Y(t,we)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+we+`> property in its definition
|
|
33
|
+
`,type:ht.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Y(t,we)&&Y(t,le)&&!Y(t.modes,t.defaultMode)&&r.push({message:"A MultiMode Lexer cannot be initialized with a "+le+": <"+t.defaultMode+`>which does not exist
|
|
34
|
+
`,type:ht.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Y(t,we)&&$(t.modes,function(i,E){$(i,function(o,A){Jt(o)&&r.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:"+("<"+E+"> at index: <"+A+`>
|
|
35
|
+
`),type:ht.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),r}function Xo(t,n,e){var r=[],i=!1,E=ye(_t(Eo(t.modes,function(a){return a}))),o=Re(E,function(a){return a[Xt]===Gt.NA}),A=di(e);return n&&$(o,function(a){var u=Ei(a,A);if(u!==!1){var h=Zo(a,u),d={message:h,type:u.issue,tokenType:a};r.push(d)}else Y(a,"LINE_BREAKS")?a.LINE_BREAKS===!0&&(i=!0):Kn(A,a.PATTERN)&&(i=!0)}),n&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
36
|
+
This Lexer has been defined to track line and column information,
|
|
37
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
38
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
39
|
+
for details.`,type:ht.NO_LINE_BREAKS_FLAGS}),r}function jo(t){var n={},e=Vt(t);return $(e,function(r){var i=t[r];if(Kt(i))n[r]=[];else throw Error("non exhaustive match")}),n}function pi(t){var n=t.PATTERN;if(te(n))return!1;if(se(n))return!0;if(Y(n,"exec"))return!0;if(qt(n))return!1;throw Error("non exhaustive match")}function zo(t){return qt(t)&&t.length===1?t.charCodeAt(0):!1}var Qo={test:function(t){for(var n=t.length,e=this.lastIndex;e<n;e++){var r=t.charCodeAt(e);if(r===10)return this.lastIndex=e+1,!0;if(r===13)return t.charCodeAt(e+1)===10?this.lastIndex=e+2:this.lastIndex=e+1,!0}return!1},lastIndex:0};function Ei(t,n){if(Y(t,"LINE_BREAKS"))return!1;if(te(t.PATTERN)){try{Kn(n,t.PATTERN)}catch(e){return{issue:ht.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}else{if(qt(t.PATTERN))return!1;if(pi(t))return{issue:ht.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function Zo(t,n){if(n.issue===ht.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
|
|
40
|
+
`+(" The problem is in the <"+t.name+`> Token Type
|
|
41
|
+
`)+(" Root cause: "+n.errMsg+`.
|
|
42
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(n.issue===ht.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
|
|
43
|
+
`+(" The problem is in the <"+t.name+`> Token Type
|
|
44
|
+
`)+" For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function di(t){var n=W(t,function(e){return qt(e)&&e.length>0?e.charCodeAt(0):e});return n}function On(t,n,e){t[n]===void 0?t[n]=[e]:t[n].push(e)}var Ae=256;function oe(t){return t<Ae?t:Fe[t]}var Fe=[];function Jo(){if(ot(Fe)){Fe=new Array(65536);for(var t=0;t<65536;t++)Fe[t]=t>255?255+~~(t/255):t}}function ze(t,n){var e=t.tokenTypeIdx;return e===n.tokenTypeIdx?!0:n.isParent===!0&&n.categoryMatchesMap[e]===!0}function Ve(t,n){return t.tokenTypeIdx===n.tokenTypeIdx}var Sr=1,Ri={};function Se(t){var n=ta(t);ea(n),ra(n),na(n),$(n,function(e){e.isParent=e.categoryMatches.length>0})}function ta(t){for(var n=Lt(t),e=t,r=!0;r;){e=ye(_t(W(e,function(E){return E.CATEGORIES})));var i=Xe(e,n);n=n.concat(i),ot(i)?r=!1:e=i}return n}function ea(t){$(t,function(n){gi(n)||(Ri[Sr]=n,n.tokenTypeIdx=Sr++),Ur(n)&&!Kt(n.CATEGORIES)&&(n.CATEGORIES=[n.CATEGORIES]),Ur(n)||(n.CATEGORIES=[]),ia(n)||(n.categoryMatches=[]),oa(n)||(n.categoryMatchesMap={})})}function na(t){$(t,function(n){n.categoryMatches=[],$(n.categoryMatchesMap,function(e,r){n.categoryMatches.push(Ri[r].tokenTypeIdx)})})}function ra(t){$(t,function(n){Ni([],n)})}function Ni(t,n){$(t,function(e){n.categoryMatchesMap[e.tokenTypeIdx]=!0}),$(n.CATEGORIES,function(e){var r=t.concat(n);dt(r,e)||Ni(r,e)})}function gi(t){return Y(t,"tokenTypeIdx")}function Ur(t){return Y(t,"CATEGORIES")}function ia(t){return Y(t,"categoryMatches")}function oa(t){return Y(t,"categoryMatchesMap")}function aa(t){return Y(t,"tokenTypeIdx")}var Ai={buildUnableToPopLexerModeMessage:function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,n,e,r,i){return"unexpected character: ->"+t.charAt(n)+"<- at offset: "+n+","+(" skipped "+e+" characters.")}},ht;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"})(ht||(ht={}));var Me={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
45
|
+
`,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:Ai,traceInitPerf:!1,skipValidations:!1};Object.freeze(Me);var Gt=(function(){function t(n,e){var r=this;if(e===void 0&&(e=Me),this.lexerDefinition=n,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 e=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
46
|
+
a boolean 2nd argument is no longer supported`);this.config=Mr(Me,e);var i=this.config.traceInitPerf;i===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof i=="number"&&(this.traceInitMaxIdent=i,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var E,o=!0;r.TRACE_INIT("Lexer Config handling",function(){if(r.config.lineTerminatorsPattern===Me.lineTerminatorsPattern)r.config.lineTerminatorsPattern=Qo;else if(r.config.lineTerminatorCharacters===Me.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
47
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(e.safeMode&&e.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');r.trackStartLines=/full|onlyStart/i.test(r.config.positionTracking),r.trackEndLines=/full/i.test(r.config.positionTracking),Kt(n)?(E={modes:{}},E.modes[le]=Lt(n),E[le]=le):(o=!1,E=Ie(n))}),r.config.skipValidations===!1&&(r.TRACE_INIT("performRuntimeChecks",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(qo(E,r.trackStartLines,r.config.lineTerminatorCharacters))}),r.TRACE_INIT("performWarningRuntimeChecks",function(){r.lexerDefinitionWarning=r.lexerDefinitionWarning.concat(Xo(E,r.trackStartLines,r.config.lineTerminatorCharacters))})),E.modes=E.modes?E.modes:{},$(E.modes,function(h,d){E.modes[d]=Re(h,function(s){return Jt(s)})});var A=Vt(E.modes);if($(E.modes,function(h,d){r.TRACE_INIT("Mode: <"+d+"> processing",function(){if(r.modes.push(d),r.config.skipValidations===!1&&r.TRACE_INIT("validatePatterns",function(){r.lexerDefinitionErrors=r.lexerDefinitionErrors.concat(wo(h,A))}),ot(r.lexerDefinitionErrors)){Se(h);var s;r.TRACE_INIT("analyzeTokenTypes",function(){s=Lo(h,{lineTerminatorCharacters:r.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:r.TRACE_INIT.bind(r)})}),r.patternIdxToConfig[d]=s.patternIdxToConfig,r.charCodeToPatternIdxToConfig[d]=s.charCodeToPatternIdxToConfig,r.emptyGroups=Mr(r.emptyGroups,s.emptyGroups),r.hasCustom=s.hasCustom||r.hasCustom,r.canModeBeOptimized[d]=s.canBeOptimized}})}),r.defaultMode=E.defaultMode,!ot(r.lexerDefinitionErrors)&&!r.config.deferDefinitionErrorsHandling){var a=W(r.lexerDefinitionErrors,function(h){return h.message}),u=a.join(`-----------------------
|
|
48
|
+
`);throw new Error(`Errors detected in definition of Lexer:
|
|
49
|
+
`+u)}$(r.lexerDefinitionWarning,function(h){si(h.message)}),r.TRACE_INIT("Choosing sub-methods implementations",function(){if(hi?(r.chopInput=Tr,r.match=r.matchWithTest):(r.updateLastIndex=Nt,r.match=r.matchWithExec),o&&(r.handleModes=Nt),r.trackStartLines===!1&&(r.computeNewColumn=Tr),r.trackEndLines===!1&&(r.updateTokenEndLineColumnLocation=Nt),/full/i.test(r.config.positionTracking))r.createTokenInstance=r.createFullToken;else if(/onlyStart/i.test(r.config.positionTracking))r.createTokenInstance=r.createStartOnlyToken;else if(/onlyOffset/i.test(r.config.positionTracking))r.createTokenInstance=r.createOffsetOnlyToken;else throw Error('Invalid <positionTracking> config option: "'+r.config.positionTracking+'"');r.hasCustom?(r.addToken=r.addTokenUsingPush,r.handlePayload=r.handlePayloadWithCustom):(r.addToken=r.addTokenUsingMemberAccess,r.handlePayload=r.handlePayloadNoCustom)}),r.TRACE_INIT("Failed Optimization Warnings",function(){var h=Tt(r.canModeBeOptimized,function(d,s,f){return s===!1&&d.push(f),d},[]);if(e.ensureOptimizations&&!ot(h))throw Error("Lexer Modes: < "+h.join(", ")+` > cannot be optimized.
|
|
50
|
+
Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
|
|
51
|
+
Or inspect the console log for details on how to resolve these issues.`)}),r.TRACE_INIT("clearRegExpParserCache",function(){yo()}),r.TRACE_INIT("toFastProperties",function(){ci(r)})})}return t.prototype.tokenize=function(n,e){if(e===void 0&&(e=this.defaultMode),!ot(this.lexerDefinitionErrors)){var r=W(this.lexerDefinitionErrors,function(o){return o.message}),i=r.join(`-----------------------
|
|
52
|
+
`);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
53
|
+
`+i)}var E=this.tokenizeInternal(n,e);return E},t.prototype.tokenizeInternal=function(n,e){var r=this,i,E,o,A,a,u,h,d,s,f,N,c,l,p,R=n,T=R.length,O=0,m=0,M=this.hasCustom?0:Math.floor(n.length/10),I=new Array(M),w=[],D=this.trackStartLines?1:void 0,G=this.trackStartLines?1:void 0,H=jo(this.emptyGroups),b=this.trackStartLines,z=this.config.lineTerminatorsPattern,Z=0,rt=[],Ut=[],wt=[],zt=[];Object.freeze(zt);var Dt=void 0;function Qt(){return rt}function re(ut){var vt=oe(ut),J=Ut[vt];return J===void 0?zt:J}var S=function(ut){if(wt.length===1&&ut.tokenType.PUSH_MODE===void 0){var vt=r.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ut);w.push({offset:ut.startOffset,line:ut.startLine!==void 0?ut.startLine:void 0,column:ut.startColumn!==void 0?ut.startColumn:void 0,length:ut.image.length,message:vt})}else{wt.pop();var J=oi(wt);rt=r.patternIdxToConfig[J],Ut=r.charCodeToPatternIdxToConfig[J],Z=rt.length;var x=r.canModeBeOptimized[J]&&r.config.safeMode===!1;Ut&&x?Dt=re:Dt=Qt}};function y(ut){wt.push(ut),Ut=this.charCodeToPatternIdxToConfig[ut],rt=this.patternIdxToConfig[ut],Z=rt.length,Z=rt.length;var vt=this.canModeBeOptimized[ut]&&this.config.safeMode===!1;Ut&&vt?Dt=re:Dt=Qt}y.call(this,e);for(var g;O<T;){a=null;var _=R.charCodeAt(O),v=Dt(_),B=v.length;for(i=0;i<B;i++){g=v[i];var C=g.pattern;u=null;var F=g.short;if(F!==!1?_===F&&(a=C):g.isCustom===!0?(p=C.exec(R,O,I,H),p!==null?(a=p[0],p.payload!==void 0&&(u=p.payload)):a=null):(this.updateLastIndex(C,O),a=this.match(C,n,O)),a!==null){if(A=g.longerAlt,A!==void 0){var q=rt[A],V=q.pattern;h=null,q.isCustom===!0?(p=V.exec(R,O,I,H),p!==null?(o=p[0],p.payload!==void 0&&(h=p.payload)):o=null):(this.updateLastIndex(V,O),o=this.match(V,n,O)),o&&o.length>a.length&&(a=o,u=h,g=q)}break}}if(a!==null){if(d=a.length,s=g.group,s!==void 0&&(f=g.tokenTypeIdx,N=this.createTokenInstance(a,O,f,g.tokenType,D,G,d),this.handlePayload(N,u),s===!1?m=this.addToken(I,m,N):H[s].push(N)),n=this.chopInput(n,d),O=O+d,G=this.computeNewColumn(G,d),b===!0&&g.canLineTerminator===!0){var X=0,j=void 0,at=void 0;z.lastIndex=0;do j=z.test(a),j===!0&&(at=z.lastIndex-1,X++);while(j===!0);X!==0&&(D=D+X,G=d-at,this.updateTokenEndLineColumnLocation(N,s,at,X,D,G,d))}this.handleModes(g,S,y,N)}else{for(var st=O,ie=D,ue=G,ct=!1;!ct&&O<T;)for(R.charCodeAt(O),n=this.chopInput(n,1),O++,E=0;E<Z;E++){var Q=rt[E],C=Q.pattern,F=Q.short;if(F!==!1?R.charCodeAt(O)===F&&(ct=!0):Q.isCustom===!0?ct=C.exec(R,O,I,H)!==null:(this.updateLastIndex(C,O),ct=C.exec(n)!==null),ct===!0)break}c=O-st,l=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(R,st,c,ie,ue),w.push({offset:st,line:ie,column:ue,length:c,message:l})}}return this.hasCustom||(I.length=m),{tokens:I,groups:H,errors:w}},t.prototype.handleModes=function(n,e,r,i){if(n.pop===!0){var E=n.push;e(i),E!==void 0&&r.call(this,E)}else n.push!==void 0&&r.call(this,n.push)},t.prototype.chopInput=function(n,e){return n.substring(e)},t.prototype.updateLastIndex=function(n,e){n.lastIndex=e},t.prototype.updateTokenEndLineColumnLocation=function(n,e,r,i,E,o,A){var a,u;e!==void 0&&(a=r===A-1,u=a?-1:0,i===1&&a===!0||(n.endLine=E+u,n.endColumn=o-1+-u))},t.prototype.computeNewColumn=function(n,e){return n+e},t.prototype.createTokenInstance=function(){return null},t.prototype.createOffsetOnlyToken=function(n,e,r,i){return{image:n,startOffset:e,tokenTypeIdx:r,tokenType:i}},t.prototype.createStartOnlyToken=function(n,e,r,i,E,o){return{image:n,startOffset:e,startLine:E,startColumn:o,tokenTypeIdx:r,tokenType:i}},t.prototype.createFullToken=function(n,e,r,i,E,o,A){return{image:n,startOffset:e,endOffset:e+A-1,startLine:E,endLine:E,startColumn:o,endColumn:o+A-1,tokenTypeIdx:r,tokenType:i}},t.prototype.addToken=function(n,e,r){return 666},t.prototype.addTokenUsingPush=function(n,e,r){return n.push(r),e},t.prototype.addTokenUsingMemberAccess=function(n,e,r){return n[e]=r,e++,e},t.prototype.handlePayload=function(n,e){},t.prototype.handlePayloadNoCustom=function(n,e){},t.prototype.handlePayloadWithCustom=function(n,e){e!==null&&(n.payload=e)},t.prototype.match=function(n,e,r){return null},t.prototype.matchWithTest=function(n,e,r){var i=n.test(e);return i===!0?e.substring(r,n.lastIndex):null},t.prototype.matchWithExec=function(n,e){var r=n.exec(e);return r!==null?r[0]:r},t.prototype.TRACE_INIT=function(n,e){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--> <"+n+">");var i=ui(e),E=i.time,o=i.value,A=E>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&A(r+"<-- <"+n+"> time: "+E+"ms"),this.traceInitIndent--,o}else return e()},t.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.",t.NA=/NOT_APPLICABLE/,t})();function fe(t){return Mi(t)?t.LABEL:t.name}function sa(t){return t.name}function Mi(t){return qt(t.LABEL)&&t.LABEL!==""}var ca="parent",mr="categories",Lr="label",wr="group",_r="push_mode",Pr="pop_mode",kr="longer_alt",Fr="line_breaks",xr="start_chars_hint";function qn(t){return ua(t)}function ua(t){var n=t.pattern,e={};if(e.name=t.name,Jt(n)||(e.PATTERN=n),Y(t,ca))throw`The parent property is no longer supported.
|
|
54
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Y(t,mr)&&(e.CATEGORIES=t[mr]),Se([e]),Y(t,Lr)&&(e.LABEL=t[Lr]),Y(t,wr)&&(e.GROUP=t[wr]),Y(t,Pr)&&(e.POP_MODE=t[Pr]),Y(t,_r)&&(e.PUSH_MODE=t[_r]),Y(t,kr)&&(e.LONGER_ALT=t[kr]),Y(t,Fr)&&(e.LINE_BREAKS=t[Fr]),Y(t,xr)&&(e.START_CHARS_HINT=t[xr]),e}var ae=qn({name:"EOF",pattern:Gt.NA});Se([ae]);function Qe(t,n,e,r,i,E,o,A){return{image:n,startOffset:e,endOffset:r,startLine:i,endLine:E,startColumn:o,endColumn:A,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function la(t,n){return ze(t,n)}var ne=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),jt=(function(){function t(n){this._definition=n}return Object.defineProperty(t.prototype,"definition",{get:function(){return this._definition},set:function(n){this._definition=n},enumerable:!1,configurable:!0}),t.prototype.accept=function(n){n.visit(this),$(this.definition,function(e){e.accept(n)})},t})(),Ct=(function(t){ne(n,t);function n(e){var r=t.call(this,[])||this;return r.idx=1,$t(r,bt(e,function(i){return i!==void 0})),r}return Object.defineProperty(n.prototype,"definition",{get:function(){return this.referencedRule!==void 0?this.referencedRule.definition:[]},set:function(e){},enumerable:!1,configurable:!0}),n.prototype.accept=function(e){e.visit(this)},n})(jt),he=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.orgText="",$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),It=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.ignoreAmbiguities=!1,$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),Ot=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.idx=1,$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),xt=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.idx=1,$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),Bt=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.idx=1,$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),Et=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.idx=1,$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),Pt=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.idx=1,$t(r,bt(e,function(i){return i!==void 0})),r}return n})(jt),kt=(function(t){ne(n,t);function n(e){var r=t.call(this,e.definition)||this;return r.idx=1,r.ignoreAmbiguities=!1,r.hasPredicates=!1,$t(r,bt(e,function(i){return i!==void 0})),r}return Object.defineProperty(n.prototype,"definition",{get:function(){return this._definition},set:function(e){this._definition=e},enumerable:!1,configurable:!0}),n})(jt),lt=(function(){function t(n){this.idx=1,$t(this,bt(n,function(e){return e!==void 0}))}return t.prototype.accept=function(n){n.visit(this)},t})();function Ti(t){return W(t,Te)}function Te(t){function n(i){return W(i,Te)}if(t instanceof Ct)return{type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(t instanceof It)return{type:"Alternative",definition:n(t.definition)};if(t instanceof Ot)return{type:"Option",idx:t.idx,definition:n(t.definition)};if(t instanceof xt)return{type:"RepetitionMandatory",idx:t.idx,definition:n(t.definition)};if(t instanceof Bt)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:Te(new lt({terminalType:t.separator})),definition:n(t.definition)};if(t instanceof Pt)return{type:"RepetitionWithSeparator",idx:t.idx,separator:Te(new lt({terminalType:t.separator})),definition:n(t.definition)};if(t instanceof Et)return{type:"Repetition",idx:t.idx,definition:n(t.definition)};if(t instanceof kt)return{type:"Alternation",idx:t.idx,definition:n(t.definition)};if(t instanceof lt){var e={type:"Terminal",name:t.terminalType.name,label:fe(t.terminalType),idx:t.idx},r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(e.pattern=te(r)?r.source:r),e}else{if(t instanceof he)return{type:"Rule",name:t.name,orgText:t.orgText,definition:n(t.definition)};throw Error("non exhaustive match")}}var Ze=(function(){function t(){}return t.prototype.walk=function(n,e){var r=this;e===void 0&&(e=[]),$(n.definition,function(i,E){var o=Mt(n.definition,E+1);if(i instanceof Ct)r.walkProdRef(i,o,e);else if(i instanceof lt)r.walkTerminal(i,o,e);else if(i instanceof It)r.walkFlat(i,o,e);else if(i instanceof Ot)r.walkOption(i,o,e);else if(i instanceof xt)r.walkAtLeastOne(i,o,e);else if(i instanceof Bt)r.walkAtLeastOneSep(i,o,e);else if(i instanceof Pt)r.walkManySep(i,o,e);else if(i instanceof Et)r.walkMany(i,o,e);else if(i instanceof kt)r.walkOr(i,o,e);else throw Error("non exhaustive match")})},t.prototype.walkTerminal=function(n,e,r){},t.prototype.walkProdRef=function(n,e,r){},t.prototype.walkFlat=function(n,e,r){var i=e.concat(r);this.walk(n,i)},t.prototype.walkOption=function(n,e,r){var i=e.concat(r);this.walk(n,i)},t.prototype.walkAtLeastOne=function(n,e,r){var i=[new Ot({definition:n.definition})].concat(e,r);this.walk(n,i)},t.prototype.walkAtLeastOneSep=function(n,e,r){var i=Br(n,e,r);this.walk(n,i)},t.prototype.walkMany=function(n,e,r){var i=[new Ot({definition:n.definition})].concat(e,r);this.walk(n,i)},t.prototype.walkManySep=function(n,e,r){var i=Br(n,e,r);this.walk(n,i)},t.prototype.walkOr=function(n,e,r){var i=this,E=e.concat(r);$(n.definition,function(o){var A=new It({definition:[o]});i.walk(A,E)})},t})();function Br(t,n,e){var r=[new Ot({definition:[new lt({terminalType:t.separator})].concat(t.definition)})],i=r.concat(n,e);return i}var pe=(function(){function t(){}return t.prototype.visit=function(n){var e=n;switch(e.constructor){case Ct:return this.visitNonTerminal(e);case It:return this.visitAlternative(e);case Ot:return this.visitOption(e);case xt:return this.visitRepetitionMandatory(e);case Bt:return this.visitRepetitionMandatoryWithSeparator(e);case Pt:return this.visitRepetitionWithSeparator(e);case Et:return this.visitRepetition(e);case kt:return this.visitAlternation(e);case lt:return this.visitTerminal(e);case he:return this.visitRule(e);default:throw Error("non exhaustive match")}},t.prototype.visitNonTerminal=function(n){},t.prototype.visitAlternative=function(n){},t.prototype.visitOption=function(n){},t.prototype.visitRepetition=function(n){},t.prototype.visitRepetitionMandatory=function(n){},t.prototype.visitRepetitionMandatoryWithSeparator=function(n){},t.prototype.visitRepetitionWithSeparator=function(n){},t.prototype.visitAlternation=function(n){},t.prototype.visitTerminal=function(n){},t.prototype.visitRule=function(n){},t})(),fa=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})();function ha(t){return t instanceof It||t instanceof Ot||t instanceof Et||t instanceof xt||t instanceof Bt||t instanceof Pt||t instanceof lt||t instanceof he}function He(t,n){n===void 0&&(n=[]);var e=t instanceof Ot||t instanceof Et||t instanceof Pt;return e?!0:t instanceof kt?ai(t.definition,function(r){return He(r,n)}):t instanceof Ct&&dt(n,t)?!1:t instanceof jt?(t instanceof Ct&&n.push(t),Ft(t.definition,function(r){return He(r,n)})):!1}function pa(t){return t instanceof kt}function Yt(t){if(t instanceof Ct)return"SUBRULE";if(t instanceof Ot)return"OPTION";if(t instanceof kt)return"OR";if(t instanceof xt)return"AT_LEAST_ONE";if(t instanceof Bt)return"AT_LEAST_ONE_SEP";if(t instanceof Pt)return"MANY_SEP";if(t instanceof Et)return"MANY";if(t instanceof lt)return"CONSUME";throw Error("non exhaustive match")}var vi=(function(t){fa(n,t);function n(){var e=t!==null&&t.apply(this,arguments)||this;return e.separator="-",e.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},e}return n.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},n.prototype.visitTerminal=function(e){var r=e.terminalType.name+this.separator+"Terminal";Y(this.dslMethods,r)||(this.dslMethods[r]=[]),this.dslMethods[r].push(e)},n.prototype.visitNonTerminal=function(e){var r=e.nonTerminalName+this.separator+"Terminal";Y(this.dslMethods,r)||(this.dslMethods[r]=[]),this.dslMethods[r].push(e)},n.prototype.visitOption=function(e){this.dslMethods.option.push(e)},n.prototype.visitRepetitionWithSeparator=function(e){this.dslMethods.repetitionWithSeparator.push(e)},n.prototype.visitRepetitionMandatory=function(e){this.dslMethods.repetitionMandatory.push(e)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)},n.prototype.visitRepetition=function(e){this.dslMethods.repetition.push(e)},n.prototype.visitAlternation=function(e){this.dslMethods.alternation.push(e)},n})(pe),_e=new vi;function Ea(t){_e.reset(),t.accept(_e);var n=_e.dslMethods;return _e.reset(),n}function Ue(t){if(t instanceof Ct)return Ue(t.referencedRule);if(t instanceof lt)return Na(t);if(ha(t))return da(t);if(pa(t))return Ra(t);throw Error("non exhaustive match")}function da(t){for(var n=[],e=t.definition,r=0,i=e.length>r,E,o=!0;i&&o;)E=e[r],o=He(E),n=n.concat(Ue(E)),r=r+1,i=e.length>r;return bn(n)}function Ra(t){var n=W(t.definition,function(e){return Ue(e)});return bn(_t(n))}function Na(t){return[t.terminalType]}var Oi="_~IN~_",ga=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),Aa=(function(t){ga(n,t);function n(e){var r=t.call(this)||this;return r.topProd=e,r.follows={},r}return n.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},n.prototype.walkTerminal=function(e,r,i){},n.prototype.walkProdRef=function(e,r,i){var E=Ta(e.referencedRule,e.idx)+this.topProd.name,o=r.concat(i),A=new It({definition:o}),a=Ue(A);this.follows[E]=a},n})(Ze);function Ma(t){var n={};return $(t,function(e){var r=new Aa(e).startWalking();$t(n,r)}),n}function Ta(t,n){return t.name+n+Oi}var Xn={buildMismatchTokenMessage:function(t){var n=t.expected,e=t.actual;t.previous,t.ruleName;var r=Mi(n),i=r?"--> "+fe(n)+" <--":"token of type --> "+n.name+" <--",E="Expecting "+i+" but found --> '"+e.image+"' <--";return E},buildNotAllInputParsedMessage:function(t){var n=t.firstRedundant;return t.ruleName,"Redundant input, expecting EOF but found: "+n.image},buildNoViableAltMessage:function(t){var n=t.expectedPathsPerAlt,e=t.actual;t.previous;var r=t.customUserDescription;t.ruleName;var i="Expecting: ",E=Ht(e).image,o=`
|
|
55
|
+
but found: '`+E+"'";if(r)return i+r+o;var A=Tt(n,function(d,s){return d.concat(s)},[]),a=W(A,function(d){return"["+W(d,function(s){return fe(s)}).join(", ")+"]"}),u=W(a,function(d,s){return" "+(s+1)+". "+d}),h=`one of these possible Token sequences:
|
|
56
|
+
`+u.join(`
|
|
57
|
+
`);return i+h+o},buildEarlyExitMessage:function(t){var n=t.expectedIterationPaths,e=t.actual,r=t.customUserDescription;t.ruleName;var i="Expecting: ",E=Ht(e).image,o=`
|
|
58
|
+
but found: '`+E+"'";if(r)return i+r+o;var A=W(n,function(u){return"["+W(u,function(h){return fe(h)}).join(",")+"]"}),a=`expecting at least one iteration which starts with one of these possible Token sequences::
|
|
59
|
+
`+("<"+A.join(" ,")+">");return i+a+o}};Object.freeze(Xn);var Ii={buildRuleNotFoundError:function(t,n){var e="Invalid grammar, reference to a rule which is not defined: ->"+n.nonTerminalName+`<-
|
|
60
|
+
inside top level rule: ->`+t.name+"<-";return e}},Je={buildDuplicateFoundError:function(t,n){function e(h){return h instanceof lt?h.terminalType.name:h instanceof Ct?h.nonTerminalName:""}var r=t.name,i=Ht(n),E=i.idx,o=Yt(i),A=e(i),a=E>0,u="->"+o+(a?E:"")+"<- "+(A?"with argument: ->"+A+"<-":"")+`
|
|
61
|
+
appears more than once (`+n.length+" times) in the top level rule: ->"+r+`<-.
|
|
62
|
+
For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
|
|
63
|
+
`;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
|
|
64
|
+
`),u},buildNamespaceConflictError:function(t){var n=`Namespace conflict found in grammar.
|
|
65
|
+
`+("The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+t.name+`>.
|
|
66
|
+
`)+`To resolve this make sure each Terminal and Non-Terminal names are unique
|
|
67
|
+
This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
|
|
68
|
+
and Non-Terminal names start with a lower case letter.`;return n},buildAlternationPrefixAmbiguityError:function(t){var n=W(t.prefixPath,function(i){return fe(i)}).join(", "),e=t.alternation.idx===0?"":t.alternation.idx,r="Ambiguous alternatives: <"+t.ambiguityIndices.join(" ,")+`> due to common lookahead prefix
|
|
69
|
+
`+("in <OR"+e+"> inside <"+t.topLevelRule.name+`> Rule,
|
|
70
|
+
`)+("<"+n+`> may appears as a prefix path in all these alternatives.
|
|
71
|
+
`)+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
|
|
72
|
+
For Further details.`;return r},buildAlternationAmbiguityError:function(t){var n=W(t.prefixPath,function(i){return fe(i)}).join(", "),e=t.alternation.idx===0?"":t.alternation.idx,r="Ambiguous Alternatives Detected: <"+t.ambiguityIndices.join(" ,")+"> in <OR"+e+">"+(" inside <"+t.topLevelRule.name+`> Rule,
|
|
73
|
+
`)+("<"+n+`> may appears as a prefix path in all these alternatives.
|
|
74
|
+
`);return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
75
|
+
For Further details.`,r},buildEmptyRepetitionError:function(t){var n=Yt(t.repetition);t.repetition.idx!==0&&(n+=t.repetition.idx);var e="The repetition <"+n+"> within Rule <"+t.topLevelRule.name+`> can never consume any tokens.
|
|
76
|
+
This could lead to an infinite loop.`;return e},buildTokenNameError:function(t){return"deprecated"},buildEmptyAlternationError:function(t){var n="Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+">"+(" in <OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`> Rule.
|
|
77
|
+
`)+"Only the last alternative may be an empty alternative.";return n},buildTooManyAlternativesError:function(t){var n=`An Alternation cannot have more than 256 alternatives:
|
|
78
|
+
`+("<OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+`> Rule.
|
|
79
|
+
has `+(t.alternation.definition.length+1)+" alternatives.");return n},buildLeftRecursionError:function(t){var n=t.topLevelRule.name,e=W(t.leftRecursionPath,function(E){return E.name}),r=n+" --> "+e.concat([n]).join(" --> "),i=`Left Recursion found in grammar.
|
|
80
|
+
`+("rule: <"+n+`> can be invoked from itself (directly or indirectly)
|
|
81
|
+
`)+(`without consuming any Tokens. The grammar path that causes this is:
|
|
82
|
+
`+r+`
|
|
83
|
+
`)+` To fix this refactor your grammar to remove the left recursion.
|
|
84
|
+
see: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring.`;return i},buildInvalidRuleNameError:function(t){return"deprecated"},buildDuplicateRuleNameError:function(t){var n;t.topLevelRule instanceof he?n=t.topLevelRule.name:n=t.topLevelRule;var e="Duplicate definition, rule: ->"+n+"<- is already defined in the grammar: ->"+t.grammarName+"<-";return e}},va=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})();function Oa(t,n){var e=new Ia(t,n);return e.resolveRefs(),e.errors}var Ia=(function(t){va(n,t);function n(e,r){var i=t.call(this)||this;return i.nameToTopRule=e,i.errMsgProvider=r,i.errors=[],i}return n.prototype.resolveRefs=function(){var e=this;$(mt(this.nameToTopRule),function(r){e.currTopLevel=r,r.accept(e)})},n.prototype.visitNonTerminal=function(e){var r=this.nameToTopRule[e.nonTerminalName];if(r)e.referencedRule=r;else{var i=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:i,type:St.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}},n})(pe),Ee=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),ya=(function(t){Ee(n,t);function n(e,r){var i=t.call(this)||this;return i.topProd=e,i.path=r,i.possibleTokTypes=[],i.nextProductionName="",i.nextProductionOccurrence=0,i.found=!1,i.isAtEndOfPath=!1,i}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=Lt(this.path.ruleStack).reverse(),this.occurrenceStack=Lt(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},n.prototype.walk=function(e,r){r===void 0&&(r=[]),this.found||t.prototype.walk.call(this,e,r)},n.prototype.walkProdRef=function(e,r,i){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){var E=r.concat(i);this.updateExpectedNext(),this.walk(e.referencedRule,E)}},n.prototype.updateExpectedNext=function(){ot(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},n})(Ze),Ca=(function(t){Ee(n,t);function n(e,r){var i=t.call(this,e,r)||this;return i.path=r,i.nextTerminalName="",i.nextTerminalOccurrence=0,i.nextTerminalName=i.path.lastTok.name,i.nextTerminalOccurrence=i.path.lastTokOccurrence,i}return n.prototype.walkTerminal=function(e,r,i){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){var E=r.concat(i),o=new It({definition:E});this.possibleTokTypes=Ue(o),this.found=!0}},n})(ya),tn=(function(t){Ee(n,t);function n(e,r){var i=t.call(this)||this;return i.topRule=e,i.occurrence=r,i.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},i}return n.prototype.startWalking=function(){return this.walk(this.topRule),this.result},n})(Ze),Sa=(function(t){Ee(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.walkMany=function(e,r,i){if(e.idx===this.occurrence){var E=Ht(r.concat(i));this.result.isEndOfRule=E===void 0,E instanceof lt&&(this.result.token=E.terminalType,this.result.occurrence=E.idx)}else t.prototype.walkMany.call(this,e,r,i)},n})(tn),Dr=(function(t){Ee(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.walkManySep=function(e,r,i){if(e.idx===this.occurrence){var E=Ht(r.concat(i));this.result.isEndOfRule=E===void 0,E instanceof lt&&(this.result.token=E.terminalType,this.result.occurrence=E.idx)}else t.prototype.walkManySep.call(this,e,r,i)},n})(tn),Ua=(function(t){Ee(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.walkAtLeastOne=function(e,r,i){if(e.idx===this.occurrence){var E=Ht(r.concat(i));this.result.isEndOfRule=E===void 0,E instanceof lt&&(this.result.token=E.terminalType,this.result.occurrence=E.idx)}else t.prototype.walkAtLeastOne.call(this,e,r,i)},n})(tn),Gr=(function(t){Ee(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.walkAtLeastOneSep=function(e,r,i){if(e.idx===this.occurrence){var E=Ht(r.concat(i));this.result.isEndOfRule=E===void 0,E instanceof lt&&(this.result.token=E.terminalType,this.result.occurrence=E.idx)}else t.prototype.walkAtLeastOneSep.call(this,e,r,i)},n})(tn);function Dn(t,n,e){e===void 0&&(e=[]),e=Lt(e);var r=[],i=0;function E(u){return u.concat(Mt(t,i+1))}function o(u){var h=Dn(E(u),n,e);return r.concat(h)}for(;e.length<n&&i<t.length;){var A=t[i];if(A instanceof It)return o(A.definition);if(A instanceof Ct)return o(A.definition);if(A instanceof Ot)r=o(A.definition);else if(A instanceof xt){var a=A.definition.concat([new Et({definition:A.definition})]);return o(a)}else if(A instanceof Bt){var a=[new It({definition:A.definition}),new Et({definition:[new lt({terminalType:A.separator})].concat(A.definition)})];return o(a)}else if(A instanceof Pt){var a=A.definition.concat([new Et({definition:[new lt({terminalType:A.separator})].concat(A.definition)})]);r=o(a)}else if(A instanceof Et){var a=A.definition.concat([new Et({definition:A.definition})]);r=o(a)}else{if(A instanceof kt)return $(A.definition,function(u){ot(u.definition)===!1&&(r=o(u.definition))}),r;if(A instanceof lt)e.push(A.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:e,suffixDef:Mt(t,i)}),r}function yi(t,n,e,r){var i="EXIT_NONE_TERMINAL",E=[i],o="EXIT_ALTERNATIVE",A=!1,a=n.length,u=a-r-1,h=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!ot(d);){var s=d.pop();if(s===o){A&&oi(d).idx<=u&&d.pop();continue}var f=s.def,N=s.idx,c=s.ruleStack,l=s.occurrenceStack;if(!ot(f)){var p=f[0];if(p===i){var R={idx:N,def:Mt(f),ruleStack:ve(c),occurrenceStack:ve(l)};d.push(R)}else if(p instanceof lt)if(N<a-1){var T=N+1,O=n[T];if(e(O,p.terminalType)){var R={idx:T,def:Mt(f),ruleStack:c,occurrenceStack:l};d.push(R)}}else if(N===a-1)h.push({nextTokenType:p.terminalType,nextTokenOccurrence:p.idx,ruleStack:c,occurrenceStack:l}),A=!0;else throw Error("non exhaustive match");else if(p instanceof Ct){var m=Lt(c);m.push(p.nonTerminalName);var M=Lt(l);M.push(p.idx);var R={idx:N,def:p.definition.concat(E,Mt(f)),ruleStack:m,occurrenceStack:M};d.push(R)}else if(p instanceof Ot){var I={idx:N,def:Mt(f),ruleStack:c,occurrenceStack:l};d.push(I),d.push(o);var w={idx:N,def:p.definition.concat(Mt(f)),ruleStack:c,occurrenceStack:l};d.push(w)}else if(p instanceof xt){var D=new Et({definition:p.definition,idx:p.idx}),G=p.definition.concat([D],Mt(f)),R={idx:N,def:G,ruleStack:c,occurrenceStack:l};d.push(R)}else if(p instanceof Bt){var H=new lt({terminalType:p.separator}),D=new Et({definition:[H].concat(p.definition),idx:p.idx}),G=p.definition.concat([D],Mt(f)),R={idx:N,def:G,ruleStack:c,occurrenceStack:l};d.push(R)}else if(p instanceof Pt){var I={idx:N,def:Mt(f),ruleStack:c,occurrenceStack:l};d.push(I),d.push(o);var H=new lt({terminalType:p.separator}),b=new Et({definition:[H].concat(p.definition),idx:p.idx}),G=p.definition.concat([b],Mt(f)),w={idx:N,def:G,ruleStack:c,occurrenceStack:l};d.push(w)}else if(p instanceof Et){var I={idx:N,def:Mt(f),ruleStack:c,occurrenceStack:l};d.push(I),d.push(o);var b=new Et({definition:p.definition,idx:p.idx}),G=p.definition.concat([b],Mt(f)),w={idx:N,def:G,ruleStack:c,occurrenceStack:l};d.push(w)}else if(p instanceof kt)for(var z=p.definition.length-1;z>=0;z--){var Z=p.definition[z],rt={idx:N,def:Z.definition.concat(Mt(f)),ruleStack:c,occurrenceStack:l};d.push(rt),d.push(o)}else if(p instanceof It)d.push({idx:N,def:p.definition.concat(Mt(f)),ruleStack:c,occurrenceStack:l});else if(p instanceof he)d.push(ma(p,N,c,l));else throw Error("non exhaustive match")}}return h}function ma(t,n,e,r){var i=Lt(e);i.push(t.name);var E=Lt(r);return E.push(1),{idx:n,def:t.definition,ruleStack:i,occurrenceStack:E}}var Ci=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),it;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(it||(it={}));function La(t){if(t instanceof Ot)return it.OPTION;if(t instanceof Et)return it.REPETITION;if(t instanceof xt)return it.REPETITION_MANDATORY;if(t instanceof Bt)return it.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Pt)return it.REPETITION_WITH_SEPARATOR;if(t instanceof kt)return it.ALTERNATION;throw Error("non exhaustive match")}function wa(t,n,e,r,i,E){var o=jn(t,n,e),A=mi(o)?Ve:ze;return E(o,r,A,i)}function _a(t,n,e,r,i,E){var o=zn(t,n,i,e),A=mi(o)?Ve:ze;return E(o[0],A,r)}function Pa(t,n,e,r){var i=t.length,E=Ft(t,function(a){return Ft(a,function(u){return u.length===1})});if(n)return function(a){for(var u=W(a,function(T){return T.GATE}),h=0;h<i;h++){var d=t[h],s=d.length,f=u[h];if(!(f!==void 0&&f.call(this)===!1))t:for(var N=0;N<s;N++){for(var c=d[N],l=c.length,p=0;p<l;p++){var R=this.LA(p+1);if(e(R,c[p])===!1)continue t}return h}}};if(E&&!r){var o=W(t,function(a){return _t(a)}),A=Tt(o,function(a,u,h){return $(u,function(d){Y(a,d.tokenTypeIdx)||(a[d.tokenTypeIdx]=h),$(d.categoryMatches,function(s){Y(a,s)||(a[s]=h)})}),a},[]);return function(){var a=this.LA(1);return A[a.tokenTypeIdx]}}else return function(){for(var a=0;a<i;a++){var u=t[a],h=u.length;t:for(var d=0;d<h;d++){for(var s=u[d],f=s.length,N=0;N<f;N++){var c=this.LA(N+1);if(e(c,s[N])===!1)continue t}return a}}}}function ka(t,n,e){var r=Ft(t,function(u){return u.length===1}),i=t.length;if(r&&!e){var E=_t(t);if(E.length===1&&ot(E[0].categoryMatches)){var o=E[0],A=o.tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===A}}else{var a=Tt(E,function(u,h,d){return u[h.tokenTypeIdx]=!0,$(h.categoryMatches,function(s){u[s]=!0}),u},[]);return function(){var u=this.LA(1);return a[u.tokenTypeIdx]===!0}}}else return function(){t:for(var u=0;u<i;u++){for(var h=t[u],d=h.length,s=0;s<d;s++){var f=this.LA(s+1);if(n(f,h[s])===!1)continue t}return!0}return!1}}var Fa=(function(t){Ci(n,t);function n(e,r,i){var E=t.call(this)||this;return E.topProd=e,E.targetOccurrence=r,E.targetProdType=i,E}return n.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},n.prototype.checkIsTarget=function(e,r,i,E){return e.idx===this.targetOccurrence&&this.targetProdType===r?(this.restDef=i.concat(E),!0):!1},n.prototype.walkOption=function(e,r,i){this.checkIsTarget(e,it.OPTION,r,i)||t.prototype.walkOption.call(this,e,r,i)},n.prototype.walkAtLeastOne=function(e,r,i){this.checkIsTarget(e,it.REPETITION_MANDATORY,r,i)||t.prototype.walkOption.call(this,e,r,i)},n.prototype.walkAtLeastOneSep=function(e,r,i){this.checkIsTarget(e,it.REPETITION_MANDATORY_WITH_SEPARATOR,r,i)||t.prototype.walkOption.call(this,e,r,i)},n.prototype.walkMany=function(e,r,i){this.checkIsTarget(e,it.REPETITION,r,i)||t.prototype.walkOption.call(this,e,r,i)},n.prototype.walkManySep=function(e,r,i){this.checkIsTarget(e,it.REPETITION_WITH_SEPARATOR,r,i)||t.prototype.walkOption.call(this,e,r,i)},n})(Ze),Si=(function(t){Ci(n,t);function n(e,r,i){var E=t.call(this)||this;return E.targetOccurrence=e,E.targetProdType=r,E.targetRef=i,E.result=[],E}return n.prototype.checkIsTarget=function(e,r){e.idx===this.targetOccurrence&&this.targetProdType===r&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)},n.prototype.visitOption=function(e){this.checkIsTarget(e,it.OPTION)},n.prototype.visitRepetition=function(e){this.checkIsTarget(e,it.REPETITION)},n.prototype.visitRepetitionMandatory=function(e){this.checkIsTarget(e,it.REPETITION_MANDATORY)},n.prototype.visitRepetitionMandatoryWithSeparator=function(e){this.checkIsTarget(e,it.REPETITION_MANDATORY_WITH_SEPARATOR)},n.prototype.visitRepetitionWithSeparator=function(e){this.checkIsTarget(e,it.REPETITION_WITH_SEPARATOR)},n.prototype.visitAlternation=function(e){this.checkIsTarget(e,it.ALTERNATION)},n})(pe);function Vr(t){for(var n=new Array(t),e=0;e<t;e++)n[e]=[];return n}function In(t){for(var n=[""],e=0;e<t.length;e++){for(var r=t[e],i=[],E=0;E<n.length;E++){var o=n[E];i.push(o+"_"+r.tokenTypeIdx);for(var A=0;A<r.categoryMatches.length;A++){var a="_"+r.categoryMatches[A];i.push(o+a)}}n=i}return n}function xa(t,n,e){for(var r=0;r<t.length;r++)if(r!==e)for(var i=t[r],E=0;E<n.length;E++){var o=n[E];if(i[o]===!0)return!1}return!0}function Ui(t,n){for(var e=W(t,function(h){return Dn([h],1)}),r=Vr(e.length),i=W(e,function(h){var d={};return $(h,function(s){var f=In(s.partialPath);$(f,function(N){d[N]=!0})}),d}),E=e,o=1;o<=n;o++){var A=E;E=Vr(A.length);for(var a=function(h){for(var d=A[h],s=0;s<d.length;s++){var f=d[s].partialPath,N=d[s].suffixDef,c=In(f),l=xa(i,c,h);if(l||ot(N)||f.length===n){var p=r[h];if(Gn(p,f)===!1){p.push(f);for(var R=0;R<c.length;R++){var T=c[R];i[h][T]=!0}}}else{var O=Dn(N,o+1,f);E[h]=E[h].concat(O),$(O,function(m){var M=In(m.partialPath);$(M,function(I){i[h][I]=!0})})}}},u=0;u<A.length;u++)a(u)}return r}function jn(t,n,e,r){var i=new Si(t,it.ALTERNATION,r);return n.accept(i),Ui(i.result,e)}function zn(t,n,e,r){var i=new Si(t,e);n.accept(i);var E=i.result,o=new Fa(n,t,e),A=o.startWalking(),a=new It({definition:E}),u=new It({definition:A});return Ui([a,u],r)}function Gn(t,n){t:for(var e=0;e<t.length;e++){var r=t[e];if(r.length===n.length){for(var i=0;i<r.length;i++){var E=n[i],o=r[i],A=E===o||o.categoryMatchesMap[E.tokenTypeIdx]!==void 0;if(A===!1)continue t}return!0}}return!1}function Ba(t,n){return t.length<n.length&&Ft(t,function(e,r){var i=n[r];return e===i||i.categoryMatchesMap[e.tokenTypeIdx]})}function mi(t){return Ft(t,function(n){return Ft(n,function(e){return Ft(e,function(r){return ot(r.categoryMatches)})})})}var Qn=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})();function Da(t,n,e,r,i){var E=W(t,function(f){return Ga(f,r)}),o=W(t,function(f){return wi(f,f,r)}),A=[],a=[],u=[];Ft(o,ot)&&(A=W(t,function(f){return $a(f,r)}),a=W(t,function(f){return Ya(f,n,r)}),u=Xa(t,n,r));var h=Qa(t,e,r),d=W(t,function(f){return qa(f,r)}),s=W(t,function(f){return Wa(f,t,i,r)});return _t(E.concat(u,o,A,a,h,d,s))}function Ga(t,n){var e=new Ha;t.accept(e);var r=e.allProductions,i=Ao(r,Va),E=bt(i,function(A){return A.length>1}),o=W(mt(E),function(A){var a=Ht(A),u=n.buildDuplicateFoundError(t,A),h=Yt(a),d={message:u,type:St.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:h,occurrence:a.idx},s=Li(a);return s&&(d.parameter=s),d});return o}function Va(t){return Yt(t)+"_#_"+t.idx+"_#_"+Li(t)}function Li(t){return t instanceof lt?t.terminalType.name:t instanceof Ct?t.nonTerminalName:""}var Ha=(function(t){Qn(n,t);function n(){var e=t!==null&&t.apply(this,arguments)||this;return e.allProductions=[],e}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})(pe);function Wa(t,n,e,r){var i=[],E=Tt(n,function(A,a){return a.name===t.name?A+1:A},0);if(E>1){var o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:e});i.push({message:o,type:St.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function ba(t,n,e){var r=[],i;return dt(n,t)||(i="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+e+"<-as it is not defined in any of the super grammars ",r.push({message:i,type:St.INVALID_RULE_OVERRIDE,ruleName:t})),r}function wi(t,n,e,r){r===void 0&&(r=[]);var i=[],E=xe(n.definition);if(ot(E))return[];var o=t.name,A=dt(E,t);A&&i.push({message:e.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:St.LEFT_RECURSION,ruleName:o});var a=Xe(E,r.concat([t])),u=W(a,function(h){var d=Lt(r);return d.push(h),wi(t,h,e,d)});return i.concat(_t(u))}function xe(t){var n=[];if(ot(t))return n;var e=Ht(t);if(e instanceof Ct)n.push(e.referencedRule);else if(e instanceof It||e instanceof Ot||e instanceof xt||e instanceof Bt||e instanceof Pt||e instanceof Et)n=n.concat(xe(e.definition));else if(e instanceof kt)n=_t(W(e.definition,function(o){return xe(o.definition)}));else if(!(e instanceof lt))throw Error("non exhaustive match");var r=He(e),i=t.length>1;if(r&&i){var E=Mt(t);return n.concat(xe(E))}else return n}var Zn=(function(t){Qn(n,t);function n(){var e=t!==null&&t.apply(this,arguments)||this;return e.alternations=[],e}return n.prototype.visitAlternation=function(e){this.alternations.push(e)},n})(pe);function $a(t,n){var e=new Zn;t.accept(e);var r=e.alternations,i=Tt(r,function(E,o){var A=ve(o.definition),a=W(A,function(u,h){var d=yi([u],[],null,1);return ot(d)?{message:n.buildEmptyAlternationError({topLevelRule:t,alternation:o,emptyChoiceIdx:h}),type:St.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:o.idx,alternative:h+1}:null});return E.concat(ye(a))},[]);return i}function Ya(t,n,e){var r=new Zn;t.accept(r);var i=r.alternations;i=Re(i,function(o){return o.ignoreAmbiguities===!0});var E=Tt(i,function(o,A){var a=A.idx,u=A.maxLookahead||n,h=jn(a,t,u,A),d=ja(h,A,t,e),s=za(h,A,t,e);return o.concat(d,s)},[]);return E}var Ka=(function(t){Qn(n,t);function n(){var e=t!==null&&t.apply(this,arguments)||this;return e.allProductions=[],e}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})(pe);function qa(t,n){var e=new Zn;t.accept(e);var r=e.alternations,i=Tt(r,function(E,o){return o.definition.length>255&&E.push({message:n.buildTooManyAlternativesError({topLevelRule:t,alternation:o}),type:St.TOO_MANY_ALTS,ruleName:t.name,occurrence:o.idx}),E},[]);return i}function Xa(t,n,e){var r=[];return $(t,function(i){var E=new Ka;i.accept(E);var o=E.allProductions;$(o,function(A){var a=La(A),u=A.maxLookahead||n,h=A.idx,d=zn(h,i,a,u),s=d[0];if(ot(_t(s))){var f=e.buildEmptyRepetitionError({topLevelRule:i,repetition:A});r.push({message:f,type:St.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function ja(t,n,e,r){var i=[],E=Tt(t,function(A,a,u){return n.definition[u].ignoreAmbiguities===!0||$(a,function(h){var d=[u];$(t,function(s,f){u!==f&&Gn(s,h)&&n.definition[f].ignoreAmbiguities!==!0&&d.push(f)}),d.length>1&&!Gn(i,h)&&(i.push(h),A.push({alts:d,path:h}))}),A},[]),o=W(E,function(A){var a=W(A.alts,function(h){return h+1}),u=r.buildAlternationAmbiguityError({topLevelRule:e,alternation:n,ambiguityIndices:a,prefixPath:A.path});return{message:u,type:St.AMBIGUOUS_ALTS,ruleName:e.name,occurrence:n.idx,alternatives:[A.alts]}});return o}function za(t,n,e,r){var i=[],E=Tt(t,function(o,A,a){var u=W(A,function(h){return{idx:a,path:h}});return o.concat(u)},[]);return $(E,function(o){var A=n.definition[o.idx];if(A.ignoreAmbiguities!==!0){var a=o.idx,u=o.path,h=Ro(E,function(s){return n.definition[s.idx].ignoreAmbiguities!==!0&&s.idx<a&&Ba(s.path,u)}),d=W(h,function(s){var f=[s.idx+1,a+1],N=n.idx===0?"":n.idx,c=r.buildAlternationPrefixAmbiguityError({topLevelRule:e,alternation:n,ambiguityIndices:f,prefixPath:s.path});return{message:c,type:St.AMBIGUOUS_PREFIX_ALTS,ruleName:e.name,occurrence:N,alternatives:f}});i=i.concat(d)}}),i}function Qa(t,n,e){var r=[],i=W(n,function(E){return E.name});return $(t,function(E){var o=E.name;if(dt(i,o)){var A=e.buildNamespaceConflictError(E);r.push({message:A,type:St.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function _i(t){t=Yn(t,{errMsgProvider:Ii});var n={};return $(t.rules,function(e){n[e.name]=e}),Oa(n,t.errMsgProvider)}function Pi(t){return t=Yn(t,{errMsgProvider:Je}),Da(t.rules,t.maxLookahead,t.tokenTypes,t.errMsgProvider,t.grammarName)}function Za(t){$(t.rules,function(n){var e=new vi;n.accept(e),$(e.dslMethods,function(r){$(r,function(i,E){i.idx=E+1})})})}var me=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),ki="MismatchedTokenException",Fi="NoViableAltException",xi="EarlyExitException",Bi="NotAllInputParsedException",Di=[ki,Fi,xi,Bi];Object.freeze(Di);function Oe(t){return dt(Di,t.name)}var en=(function(t){me(n,t);function n(e,r){var i=this.constructor,E=t.call(this,e)||this;return E.token=r,E.resyncedTokens=[],Object.setPrototypeOf(E,i.prototype),Error.captureStackTrace&&Error.captureStackTrace(E,E.constructor),E}return n})(Error),Jn=(function(t){me(n,t);function n(e,r,i){var E=t.call(this,e,r)||this;return E.previousToken=i,E.name=ki,E}return n})(en),Gi=(function(t){me(n,t);function n(e,r,i){var E=t.call(this,e,r)||this;return E.previousToken=i,E.name=Fi,E}return n})(en),Vi=(function(t){me(n,t);function n(e,r){var i=t.call(this,e,r)||this;return i.name=Bi,i}return n})(en),Hi=(function(t){me(n,t);function n(e,r,i){var E=t.call(this,e,r)||this;return E.previousToken=i,E.name=xi,E}return n})(en),yn={},Wi="InRuleRecoveryException";function bi(t){this.name=Wi,this.message=t}bi.prototype=Error.prototype;var Ja=(function(){function t(){}return t.prototype.initRecoverable=function(n){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=Y(n,"recoveryEnabled")?n.recoveryEnabled:ee.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=ts)},t.prototype.getTokenToInsert=function(n){var e=Qe(n,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e},t.prototype.canTokenTypeBeInsertedInRecovery=function(n){return!0},t.prototype.tryInRepetitionRecovery=function(n,e,r,i){for(var E=this,o=this.findReSyncTokenType(),A=this.exportLexerState(),a=[],u=!1,h=this.LA(1),d=this.LA(1),s=function(){var f=E.LA(0),N=E.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:h,previous:f,ruleName:E.getCurrRuleFullName()}),c=new Jn(N,h,E.LA(0));c.resyncedTokens=ve(a),E.SAVE_ERROR(c)};!u;)if(this.tokenMatcher(d,i)){s();return}else if(r.call(this)){s(),n.apply(this,e);return}else this.tokenMatcher(d,o)?u=!0:(d=this.SKIP_TOKEN(),this.addToResyncTokens(d,a));this.importLexerState(A)},t.prototype.shouldInRepetitionRecoveryBeTried=function(n,e,r){return!(r===!1||n===void 0||e===void 0||this.tokenMatcher(this.LA(1),n)||this.isBackTracking()||this.canPerformInRuleRecovery(n,this.getFollowsForInRuleRecovery(n,e)))},t.prototype.getFollowsForInRuleRecovery=function(n,e){var r=this.getCurrentGrammarPath(n,e),i=this.getNextPossibleTokenTypes(r);return i},t.prototype.tryInRuleRecovery=function(n,e){if(this.canRecoverWithSingleTokenInsertion(n,e)){var r=this.getTokenToInsert(n);return r}if(this.canRecoverWithSingleTokenDeletion(n)){var i=this.SKIP_TOKEN();return this.consumeToken(),i}throw new bi("sad sad panda")},t.prototype.canPerformInRuleRecovery=function(n,e){return this.canRecoverWithSingleTokenInsertion(n,e)||this.canRecoverWithSingleTokenDeletion(n)},t.prototype.canRecoverWithSingleTokenInsertion=function(n,e){var r=this;if(!this.canTokenTypeBeInsertedInRecovery(n)||ot(e))return!1;var i=this.LA(1),E=de(e,function(o){return r.tokenMatcher(i,o)})!==void 0;return E},t.prototype.canRecoverWithSingleTokenDeletion=function(n){var e=this.tokenMatcher(this.LA(2),n);return e},t.prototype.isInCurrentRuleReSyncSet=function(n){var e=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(e);return dt(r,n)},t.prototype.findReSyncTokenType=function(){for(var n=this.flattenFollowSet(),e=this.LA(1),r=2;;){var i=e.tokenType;if(dt(n,i))return i;e=this.LA(r),r++}},t.prototype.getCurrFollowKey=function(){if(this.RULE_STACK.length===1)return yn;var n=this.getLastExplicitRuleShortName(),e=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(n),idxInCallingRule:e,inRule:this.shortRuleNameToFullName(r)}},t.prototype.buildFullFollowKeyStack=function(){var n=this,e=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return W(e,function(i,E){return E===0?yn:{ruleName:n.shortRuleNameToFullName(i),idxInCallingRule:r[E],inRule:n.shortRuleNameToFullName(e[E-1])}})},t.prototype.flattenFollowSet=function(){var n=this,e=W(this.buildFullFollowKeyStack(),function(r){return n.getFollowSetFromFollowKey(r)});return _t(e)},t.prototype.getFollowSetFromFollowKey=function(n){if(n===yn)return[ae];var e=n.ruleName+n.idxInCallingRule+Oi+n.inRule;return this.resyncFollows[e]},t.prototype.addToResyncTokens=function(n,e){return this.tokenMatcher(n,ae)||e.push(n),e},t.prototype.reSyncTo=function(n){for(var e=[],r=this.LA(1);this.tokenMatcher(r,n)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,e);return ve(e)},t.prototype.attemptInRepetitionRecovery=function(n,e,r,i,E,o,A){},t.prototype.getCurrentGrammarPath=function(n,e){var r=this.getHumanReadableRuleStack(),i=Lt(this.RULE_OCCURRENCE_STACK),E={ruleStack:r,occurrenceStack:i,lastTok:n,lastTokOccurrence:e};return E},t.prototype.getHumanReadableRuleStack=function(){var n=this;return W(this.RULE_STACK,function(e){return n.shortRuleNameToFullName(e)})},t})();function ts(t,n,e,r,i,E,o){var A=this.getKeyForAutomaticLookahead(r,i),a=this.firstAfterRepMap[A];if(a===void 0){var u=this.getCurrRuleFullName(),h=this.getGAstProductions()[u],d=new E(h,i);a=d.startWalking(),this.firstAfterRepMap[A]=a}var s=a.token,f=a.occurrence,N=a.isEndOfRule;this.RULE_STACK.length===1&&N&&s===void 0&&(s=ae,f=1),this.shouldInRepetitionRecoveryBeTried(s,f,o)&&this.tryInRepetitionRecovery(t,n,e,s)}var es=4,ce=8,$i=1<<ce,Yi=2<<ce,Vn=3<<ce,Hn=4<<ce,Wn=5<<ce,Be=6<<ce;function Cn(t,n,e){return e|n|t}var ns=(function(){function t(){}return t.prototype.initLooksAhead=function(n){this.dynamicTokensEnabled=Y(n,"dynamicTokensEnabled")?n.dynamicTokensEnabled:ee.dynamicTokensEnabled,this.maxLookahead=Y(n,"maxLookahead")?n.maxLookahead:ee.maxLookahead,this.lookAheadFuncsCache=vr()?new Map:[],vr()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},t.prototype.preComputeLookaheadFunctions=function(n){var e=this;$(n,function(r){e.TRACE_INIT(r.name+" Rule Lookahead",function(){var i=Ea(r),E=i.alternation,o=i.repetition,A=i.option,a=i.repetitionMandatory,u=i.repetitionMandatoryWithSeparator,h=i.repetitionWithSeparator;$(E,function(d){var s=d.idx===0?"":d.idx;e.TRACE_INIT(""+Yt(d)+s,function(){var f=wa(d.idx,r,d.maxLookahead||e.maxLookahead,d.hasPredicates,e.dynamicTokensEnabled,e.lookAheadBuilderForAlternatives),N=Cn(e.fullRuleNameToShort[r.name],$i,d.idx);e.setLaFuncCache(N,f)})}),$(o,function(d){e.computeLookaheadFunc(r,d.idx,Vn,it.REPETITION,d.maxLookahead,Yt(d))}),$(A,function(d){e.computeLookaheadFunc(r,d.idx,Yi,it.OPTION,d.maxLookahead,Yt(d))}),$(a,function(d){e.computeLookaheadFunc(r,d.idx,Hn,it.REPETITION_MANDATORY,d.maxLookahead,Yt(d))}),$(u,function(d){e.computeLookaheadFunc(r,d.idx,Be,it.REPETITION_MANDATORY_WITH_SEPARATOR,d.maxLookahead,Yt(d))}),$(h,function(d){e.computeLookaheadFunc(r,d.idx,Wn,it.REPETITION_WITH_SEPARATOR,d.maxLookahead,Yt(d))})})})},t.prototype.computeLookaheadFunc=function(n,e,r,i,E,o){var A=this;this.TRACE_INIT(""+o+(e===0?"":e),function(){var a=_a(e,n,E||A.maxLookahead,A.dynamicTokensEnabled,i,A.lookAheadBuilderForOptional),u=Cn(A.fullRuleNameToShort[n.name],r,e);A.setLaFuncCache(u,a)})},t.prototype.lookAheadBuilderForOptional=function(n,e,r){return ka(n,e,r)},t.prototype.lookAheadBuilderForAlternatives=function(n,e,r,i){return Pa(n,e,r,i)},t.prototype.getKeyForAutomaticLookahead=function(n,e){var r=this.getLastExplicitRuleShortName();return Cn(r,n,e)},t.prototype.getLaFuncFromCache=function(n){},t.prototype.getLaFuncFromMap=function(n){return this.lookAheadFuncsCache.get(n)},t.prototype.getLaFuncFromObj=function(n){return this.lookAheadFuncsCache[n]},t.prototype.setLaFuncCache=function(n,e){},t.prototype.setLaFuncCacheUsingMap=function(n,e){this.lookAheadFuncsCache.set(n,e)},t.prototype.setLaFuncUsingObj=function(n,e){this.lookAheadFuncsCache[n]=e},t})();function Hr(t,n){isNaN(t.startOffset)===!0?(t.startOffset=n.startOffset,t.endOffset=n.endOffset):t.endOffset<n.endOffset&&(t.endOffset=n.endOffset)}function Wr(t,n){isNaN(t.startOffset)===!0?(t.startOffset=n.startOffset,t.startColumn=n.startColumn,t.startLine=n.startLine,t.endOffset=n.endOffset,t.endColumn=n.endColumn,t.endLine=n.endLine):t.endOffset<n.endOffset&&(t.endOffset=n.endOffset,t.endColumn=n.endColumn,t.endLine=n.endLine)}function rs(t,n,e){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}function is(t,n,e){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function os(t){return nn(t.constructor)}var br="name";function nn(t){var n=t.name;return n||"anonymous"}function Ki(t,n){var e=Object.getOwnPropertyDescriptor(t,br);return Jt(e)||e.configurable?(Object.defineProperty(t,br,{enumerable:!1,configurable:!0,writable:!1,value:n}),!0):!1}function as(t,n){for(var e=Vt(t),r=e.length,i=0;i<r;i++)for(var E=e[i],o=t[E],A=o.length,a=0;a<A;a++){var u=o[a];u.tokenTypeIdx===void 0&&this[u.name](u.children,n)}}function ss(t,n){var e=function(){};Ki(e,t+"BaseSemantics");var r={visit:function(i,E){if(Kt(i)&&(i=i[0]),!Jt(i))return this[i.name](i.children,E)},validateVisitor:function(){var i=us(this,n);if(!ot(i)){var E=W(i,function(o){return o.msg});throw Error("Errors Detected in CST Visitor <"+nn(this.constructor)+`>:
|
|
85
|
+
`+(""+E.join(`
|
|
86
|
+
|
|
87
|
+
`).replace(/\n/g,`
|
|
88
|
+
`)))}}};return e.prototype=r,e.prototype.constructor=e,e._RULE_NAMES=n,e}function cs(t,n,e){var r=function(){};Ki(r,t+"BaseSemanticsWithDefaults");var i=Object.create(e.prototype);return $(n,function(E){i[E]=as}),r.prototype=i,r.prototype.constructor=r,r}var We;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(We||(We={}));function us(t,n){var e=ls(t,n),r=hs(t,n);return e.concat(r)}function ls(t,n){var e=W(n,function(r){if(!se(t[r]))return{msg:"Missing visitor method: <"+r+"> on "+nn(t.constructor)+" CST Visitor.",type:We.MISSING_METHOD,methodName:r}});return ye(e)}var fs=["constructor","visit","validateVisitor"];function hs(t,n){var e=[];for(var r in t)se(t[r])&&!dt(fs,r)&&!dt(n,r)&&e.push({msg:"Redundant visitor method: <"+r+"> on "+nn(t.constructor)+` CST Visitor
|
|
89
|
+
There is no Grammar Rule corresponding to this method's name.
|
|
90
|
+
`,type:We.REDUNDANT_METHOD,methodName:r});return e}var ps=(function(){function t(){}return t.prototype.initTreeBuilder=function(n){if(this.CST_STACK=[],this.outputCst=n.outputCst,this.nodeLocationTracking=Y(n,"nodeLocationTracking")?n.nodeLocationTracking:ee.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Nt,this.cstFinallyStateUpdate=Nt,this.cstPostTerminal=Nt,this.cstPostNonTerminal=Nt,this.cstPostRule=Nt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Wr,this.setNodeLocationFromNode=Wr,this.cstPostRule=Nt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Nt,this.setNodeLocationFromNode=Nt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Hr,this.setNodeLocationFromNode=Hr,this.cstPostRule=Nt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Nt,this.setNodeLocationFromNode=Nt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Nt,this.setNodeLocationFromNode=Nt,this.cstPostRule=Nt,this.setInitialNodeLocation=Nt;else throw Error('Invalid <nodeLocationTracking> config option: "'+n.nodeLocationTracking+'"')},t.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(n){n.location={startOffset:NaN,endOffset:NaN}},t.prototype.setInitialNodeLocationOnlyOffsetRegular=function(n){n.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},t.prototype.setInitialNodeLocationFullRecovery=function(n){n.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.setInitialNodeLocationFullRegular=function(n){var e=this.LA(1);n.location={startOffset:e.startOffset,startLine:e.startLine,startColumn:e.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.cstInvocationStateUpdate=function(n,e){var r={name:n,children:{}};this.setInitialNodeLocation(r),this.CST_STACK.push(r)},t.prototype.cstFinallyStateUpdate=function(){this.CST_STACK.pop()},t.prototype.cstPostRuleFull=function(n){var e=this.LA(0),r=n.location;r.startOffset<=e.startOffset?(r.endOffset=e.endOffset,r.endLine=e.endLine,r.endColumn=e.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)},t.prototype.cstPostRuleOnlyOffset=function(n){var e=this.LA(0),r=n.location;r.startOffset<=e.startOffset?r.endOffset=e.endOffset:r.startOffset=NaN},t.prototype.cstPostTerminal=function(n,e){var r=this.CST_STACK[this.CST_STACK.length-1];rs(r,e,n),this.setNodeLocationFromToken(r.location,e)},t.prototype.cstPostNonTerminal=function(n,e){var r=this.CST_STACK[this.CST_STACK.length-1];is(r,e,n),this.setNodeLocationFromNode(r.location,n.location)},t.prototype.getBaseCstVisitorConstructor=function(){if(Jt(this.baseCstVisitorConstructor)){var n=ss(this.className,Vt(this.gastProductionsCache));return this.baseCstVisitorConstructor=n,n}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(Jt(this.baseCstVisitorWithDefaultsConstructor)){var n=cs(this.className,Vt(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=n,n}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.getLastExplicitRuleShortName=function(){var n=this.RULE_STACK;return n[n.length-1]},t.prototype.getPreviousExplicitRuleShortName=function(){var n=this.RULE_STACK;return n[n.length-2]},t.prototype.getLastExplicitRuleOccurrenceIndex=function(){var n=this.RULE_OCCURRENCE_STACK;return n[n.length-1]},t})(),Es=(function(){function t(){}return t.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(t.prototype,"input",{get:function(){return this.tokVector},set:function(n){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=n,this.tokVectorLength=n.length},enumerable:!1,configurable:!0}),t.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):$e},t.prototype.LA=function(n){var e=this.currIdx+n;return e<0||this.tokVectorLength<=e?$e:this.tokVector[e]},t.prototype.consumeToken=function(){this.currIdx++},t.prototype.exportLexerState=function(){return this.currIdx},t.prototype.importLexerState=function(n){this.currIdx=n},t.prototype.resetLexerState=function(){this.currIdx=-1},t.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},t.prototype.getLexerPosition=function(){return this.exportLexerState()},t})(),ds=(function(){function t(){}return t.prototype.ACTION=function(n){return n.call(this)},t.prototype.consume=function(n,e,r){return this.consumeInternal(e,n,r)},t.prototype.subrule=function(n,e,r){return this.subruleInternal(e,n,r)},t.prototype.option=function(n,e){return this.optionInternal(e,n)},t.prototype.or=function(n,e){return this.orInternal(e,n)},t.prototype.many=function(n,e){return this.manyInternal(n,e)},t.prototype.atLeastOne=function(n,e){return this.atLeastOneInternal(n,e)},t.prototype.CONSUME=function(n,e){return this.consumeInternal(n,0,e)},t.prototype.CONSUME1=function(n,e){return this.consumeInternal(n,1,e)},t.prototype.CONSUME2=function(n,e){return this.consumeInternal(n,2,e)},t.prototype.CONSUME3=function(n,e){return this.consumeInternal(n,3,e)},t.prototype.CONSUME4=function(n,e){return this.consumeInternal(n,4,e)},t.prototype.CONSUME5=function(n,e){return this.consumeInternal(n,5,e)},t.prototype.CONSUME6=function(n,e){return this.consumeInternal(n,6,e)},t.prototype.CONSUME7=function(n,e){return this.consumeInternal(n,7,e)},t.prototype.CONSUME8=function(n,e){return this.consumeInternal(n,8,e)},t.prototype.CONSUME9=function(n,e){return this.consumeInternal(n,9,e)},t.prototype.SUBRULE=function(n,e){return this.subruleInternal(n,0,e)},t.prototype.SUBRULE1=function(n,e){return this.subruleInternal(n,1,e)},t.prototype.SUBRULE2=function(n,e){return this.subruleInternal(n,2,e)},t.prototype.SUBRULE3=function(n,e){return this.subruleInternal(n,3,e)},t.prototype.SUBRULE4=function(n,e){return this.subruleInternal(n,4,e)},t.prototype.SUBRULE5=function(n,e){return this.subruleInternal(n,5,e)},t.prototype.SUBRULE6=function(n,e){return this.subruleInternal(n,6,e)},t.prototype.SUBRULE7=function(n,e){return this.subruleInternal(n,7,e)},t.prototype.SUBRULE8=function(n,e){return this.subruleInternal(n,8,e)},t.prototype.SUBRULE9=function(n,e){return this.subruleInternal(n,9,e)},t.prototype.OPTION=function(n){return this.optionInternal(n,0)},t.prototype.OPTION1=function(n){return this.optionInternal(n,1)},t.prototype.OPTION2=function(n){return this.optionInternal(n,2)},t.prototype.OPTION3=function(n){return this.optionInternal(n,3)},t.prototype.OPTION4=function(n){return this.optionInternal(n,4)},t.prototype.OPTION5=function(n){return this.optionInternal(n,5)},t.prototype.OPTION6=function(n){return this.optionInternal(n,6)},t.prototype.OPTION7=function(n){return this.optionInternal(n,7)},t.prototype.OPTION8=function(n){return this.optionInternal(n,8)},t.prototype.OPTION9=function(n){return this.optionInternal(n,9)},t.prototype.OR=function(n){return this.orInternal(n,0)},t.prototype.OR1=function(n){return this.orInternal(n,1)},t.prototype.OR2=function(n){return this.orInternal(n,2)},t.prototype.OR3=function(n){return this.orInternal(n,3)},t.prototype.OR4=function(n){return this.orInternal(n,4)},t.prototype.OR5=function(n){return this.orInternal(n,5)},t.prototype.OR6=function(n){return this.orInternal(n,6)},t.prototype.OR7=function(n){return this.orInternal(n,7)},t.prototype.OR8=function(n){return this.orInternal(n,8)},t.prototype.OR9=function(n){return this.orInternal(n,9)},t.prototype.MANY=function(n){this.manyInternal(0,n)},t.prototype.MANY1=function(n){this.manyInternal(1,n)},t.prototype.MANY2=function(n){this.manyInternal(2,n)},t.prototype.MANY3=function(n){this.manyInternal(3,n)},t.prototype.MANY4=function(n){this.manyInternal(4,n)},t.prototype.MANY5=function(n){this.manyInternal(5,n)},t.prototype.MANY6=function(n){this.manyInternal(6,n)},t.prototype.MANY7=function(n){this.manyInternal(7,n)},t.prototype.MANY8=function(n){this.manyInternal(8,n)},t.prototype.MANY9=function(n){this.manyInternal(9,n)},t.prototype.MANY_SEP=function(n){this.manySepFirstInternal(0,n)},t.prototype.MANY_SEP1=function(n){this.manySepFirstInternal(1,n)},t.prototype.MANY_SEP2=function(n){this.manySepFirstInternal(2,n)},t.prototype.MANY_SEP3=function(n){this.manySepFirstInternal(3,n)},t.prototype.MANY_SEP4=function(n){this.manySepFirstInternal(4,n)},t.prototype.MANY_SEP5=function(n){this.manySepFirstInternal(5,n)},t.prototype.MANY_SEP6=function(n){this.manySepFirstInternal(6,n)},t.prototype.MANY_SEP7=function(n){this.manySepFirstInternal(7,n)},t.prototype.MANY_SEP8=function(n){this.manySepFirstInternal(8,n)},t.prototype.MANY_SEP9=function(n){this.manySepFirstInternal(9,n)},t.prototype.AT_LEAST_ONE=function(n){this.atLeastOneInternal(0,n)},t.prototype.AT_LEAST_ONE1=function(n){return this.atLeastOneInternal(1,n)},t.prototype.AT_LEAST_ONE2=function(n){this.atLeastOneInternal(2,n)},t.prototype.AT_LEAST_ONE3=function(n){this.atLeastOneInternal(3,n)},t.prototype.AT_LEAST_ONE4=function(n){this.atLeastOneInternal(4,n)},t.prototype.AT_LEAST_ONE5=function(n){this.atLeastOneInternal(5,n)},t.prototype.AT_LEAST_ONE6=function(n){this.atLeastOneInternal(6,n)},t.prototype.AT_LEAST_ONE7=function(n){this.atLeastOneInternal(7,n)},t.prototype.AT_LEAST_ONE8=function(n){this.atLeastOneInternal(8,n)},t.prototype.AT_LEAST_ONE9=function(n){this.atLeastOneInternal(9,n)},t.prototype.AT_LEAST_ONE_SEP=function(n){this.atLeastOneSepFirstInternal(0,n)},t.prototype.AT_LEAST_ONE_SEP1=function(n){this.atLeastOneSepFirstInternal(1,n)},t.prototype.AT_LEAST_ONE_SEP2=function(n){this.atLeastOneSepFirstInternal(2,n)},t.prototype.AT_LEAST_ONE_SEP3=function(n){this.atLeastOneSepFirstInternal(3,n)},t.prototype.AT_LEAST_ONE_SEP4=function(n){this.atLeastOneSepFirstInternal(4,n)},t.prototype.AT_LEAST_ONE_SEP5=function(n){this.atLeastOneSepFirstInternal(5,n)},t.prototype.AT_LEAST_ONE_SEP6=function(n){this.atLeastOneSepFirstInternal(6,n)},t.prototype.AT_LEAST_ONE_SEP7=function(n){this.atLeastOneSepFirstInternal(7,n)},t.prototype.AT_LEAST_ONE_SEP8=function(n){this.atLeastOneSepFirstInternal(8,n)},t.prototype.AT_LEAST_ONE_SEP9=function(n){this.atLeastOneSepFirstInternal(9,n)},t.prototype.RULE=function(n,e,r){if(r===void 0&&(r=Ye),dt(this.definedRulesNames,n)){var i=Je.buildDuplicateRuleNameError({topLevelRule:n,grammarName:this.className}),E={message:i,type:St.DUPLICATE_RULE_NAME,ruleName:n};this.definitionErrors.push(E)}this.definedRulesNames.push(n);var o=this.defineRule(n,e,r);return this[n]=o,o},t.prototype.OVERRIDE_RULE=function(n,e,r){r===void 0&&(r=Ye);var i=[];i=i.concat(ba(n,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,i);var E=this.defineRule(n,e,r);return this[n]=E,E},t.prototype.BACKTRACK=function(n,e){return function(){this.isBackTrackingStack.push(1);var r=this.saveRecogState();try{return n.apply(this,e),!0}catch(i){if(Oe(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return Ti(mt(this.gastProductionsCache))},t})(),Rs=(function(){function t(){}return t.prototype.initRecognizerEngine=function(n,e){if(this.className=os(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Ve,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},Y(e,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
91
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
92
|
+
For Further details.`);if(Kt(n)){if(ot(n))throw Error(`A Token Vocabulary cannot be empty.
|
|
93
|
+
Note that the first argument for the parser constructor
|
|
94
|
+
is no longer a Token vector (since v4.0).`);if(typeof n[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
95
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
96
|
+
For Further details.`)}if(Kt(n))this.tokensMap=Tt(n,function(o,A){return o[A.name]=A,o},{});else if(Y(n,"modes")&&Ft(_t(mt(n.modes)),aa)){var r=_t(mt(n.modes)),i=bn(r);this.tokensMap=Tt(i,function(o,A){return o[A.name]=A,o},{})}else if($n(n))this.tokensMap=Ie(n);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=ae;var E=Ft(mt(n),function(o){return ot(o.categoryMatches)});this.tokenMatcher=E?Ve:ze,Se(mt(this.tokensMap))},t.prototype.defineRule=function(n,e,r){if(this.selfAnalysisDone)throw Error("Grammar rule <"+n+`> may not be defined after the 'performSelfAnalysis' method has been called'
|
|
97
|
+
Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);var i=Y(r,"resyncEnabled")?r.resyncEnabled:Ye.resyncEnabled,E=Y(r,"recoveryValueFunc")?r.recoveryValueFunc:Ye.recoveryValueFunc,o=this.ruleShortNameIdx<<es+ce;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=n,this.fullRuleNameToShort[n]=o;function A(h){try{if(this.outputCst===!0){e.apply(this,h);var d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}else return e.apply(this,h)}catch(s){return this.invokeRuleCatch(s,i,E)}finally{this.ruleFinallyStateUpdate()}}var a;a=function(h,d){return h===void 0&&(h=0),this.ruleInvocationStateUpdate(o,n,h),A.call(this,d)};var u="ruleName";return a[u]=n,a.originalGrammarAction=e,a},t.prototype.invokeRuleCatch=function(n,e,r){var i=this.RULE_STACK.length===1,E=e&&!this.isBackTracking()&&this.recoveryEnabled;if(Oe(n)){var o=n;if(E){var A=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(A))if(o.resyncedTokens=this.reSyncTo(A),this.outputCst){var a=this.CST_STACK[this.CST_STACK.length-1];return a.recoveredNode=!0,a}else return r();else{if(this.outputCst){var a=this.CST_STACK[this.CST_STACK.length-1];a.recoveredNode=!0,o.partialCstResult=a}throw o}}else{if(i)return this.moveToTerminatedState(),r();throw o}}else throw n},t.prototype.optionInternal=function(n,e){var r=this.getKeyForAutomaticLookahead(Yi,e);return this.optionInternalLogic(n,e,r)},t.prototype.optionInternalLogic=function(n,e,r){var i=this,E=this.getLaFuncFromCache(r),o,A;if(n.DEF!==void 0){if(o=n.DEF,A=n.GATE,A!==void 0){var a=E;E=function(){return A.call(i)&&a.call(i)}}}else o=n;if(E.call(this)===!0)return o.call(this)},t.prototype.atLeastOneInternal=function(n,e){var r=this.getKeyForAutomaticLookahead(Hn,n);return this.atLeastOneInternalLogic(n,e,r)},t.prototype.atLeastOneInternalLogic=function(n,e,r){var i=this,E=this.getLaFuncFromCache(r),o,A;if(e.DEF!==void 0){if(o=e.DEF,A=e.GATE,A!==void 0){var a=E;E=function(){return A.call(i)&&a.call(i)}}}else o=e;if(E.call(this)===!0)for(var u=this.doSingleRepetition(o);E.call(this)===!0&&u===!0;)u=this.doSingleRepetition(o);else throw this.raiseEarlyExitException(n,it.REPETITION_MANDATORY,e.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[n,e],E,Hn,n,Ua)},t.prototype.atLeastOneSepFirstInternal=function(n,e){var r=this.getKeyForAutomaticLookahead(Be,n);this.atLeastOneSepFirstInternalLogic(n,e,r)},t.prototype.atLeastOneSepFirstInternalLogic=function(n,e,r){var i=this,E=e.DEF,o=e.SEP,A=this.getLaFuncFromCache(r);if(A.call(this)===!0){E.call(this);for(var a=function(){return i.tokenMatcher(i.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),E.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[n,o,a,E,Gr],a,Be,n,Gr)}else throw this.raiseEarlyExitException(n,it.REPETITION_MANDATORY_WITH_SEPARATOR,e.ERR_MSG)},t.prototype.manyInternal=function(n,e){var r=this.getKeyForAutomaticLookahead(Vn,n);return this.manyInternalLogic(n,e,r)},t.prototype.manyInternalLogic=function(n,e,r){var i=this,E=this.getLaFuncFromCache(r),o,A;if(e.DEF!==void 0){if(o=e.DEF,A=e.GATE,A!==void 0){var a=E;E=function(){return A.call(i)&&a.call(i)}}}else o=e;for(var u=!0;E.call(this)===!0&&u===!0;)u=this.doSingleRepetition(o);this.attemptInRepetitionRecovery(this.manyInternal,[n,e],E,Vn,n,Sa,u)},t.prototype.manySepFirstInternal=function(n,e){var r=this.getKeyForAutomaticLookahead(Wn,n);this.manySepFirstInternalLogic(n,e,r)},t.prototype.manySepFirstInternalLogic=function(n,e,r){var i=this,E=e.DEF,o=e.SEP,A=this.getLaFuncFromCache(r);if(A.call(this)===!0){E.call(this);for(var a=function(){return i.tokenMatcher(i.LA(1),o)};this.tokenMatcher(this.LA(1),o)===!0;)this.CONSUME(o),E.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[n,o,a,E,Dr],a,Wn,n,Dr)}},t.prototype.repetitionSepSecondInternal=function(n,e,r,i,E){for(;r();)this.CONSUME(e),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[n,e,r,i,E],r,Be,n,E)},t.prototype.doSingleRepetition=function(n){var e=this.getLexerPosition();n.call(this);var r=this.getLexerPosition();return r>e},t.prototype.orInternal=function(n,e){var r=this.getKeyForAutomaticLookahead($i,e),i=Kt(n)?n:n.DEF,E=this.getLaFuncFromCache(r),o=E.call(this,i);if(o!==void 0){var A=i[o];return A.ALT.call(this)}this.raiseNoAltException(e,n.ERR_MSG)},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){var n=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:n,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new Vi(e,n))}},t.prototype.subruleInternal=function(n,e,r){var i;try{var E=r!==void 0?r.ARGS:void 0;return i=n.call(this,e,E),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:n.ruleName),i}catch(o){this.subruleInternalError(o,r,n.ruleName)}},t.prototype.subruleInternalError=function(n,e,r){throw Oe(n)&&n.partialCstResult!==void 0&&(this.cstPostNonTerminal(n.partialCstResult,e!==void 0&&e.LABEL!==void 0?e.LABEL:r),delete n.partialCstResult),n},t.prototype.consumeInternal=function(n,e,r){var i;try{var E=this.LA(1);this.tokenMatcher(E,n)===!0?(this.consumeToken(),i=E):this.consumeInternalError(n,E,r)}catch(o){i=this.consumeInternalRecovery(n,e,o)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:n.name,i),i},t.prototype.consumeInternalError=function(n,e,r){var i,E=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:n,actual:e,previous:E,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new Jn(i,e,E))},t.prototype.consumeInternalRecovery=function(n,e,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){var i=this.getFollowsForInRuleRecovery(n,e);try{return this.tryInRuleRecovery(n,i)}catch(E){throw E.name===Wi?r:E}}else throw r},t.prototype.saveRecogState=function(){var n=this.errors,e=Lt(this.RULE_STACK);return{errors:n,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK}},t.prototype.reloadRecogState=function(n){this.errors=n.errors,this.importLexerState(n.lexerState),this.RULE_STACK=n.RULE_STACK},t.prototype.ruleInvocationStateUpdate=function(n,e,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(n),this.cstInvocationStateUpdate(e,n)},t.prototype.isBackTracking=function(){return this.isBackTrackingStack.length!==0},t.prototype.getCurrRuleFullName=function(){var n=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[n]},t.prototype.shortRuleNameToFullName=function(n){return this.shortRuleNameToFull[n]},t.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),ae)},t.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},t})(),Ns=(function(){function t(){}return t.prototype.initErrorHandler=function(n){this._errors=[],this.errorMessageProvider=Y(n,"errorMessageProvider")?n.errorMessageProvider:ee.errorMessageProvider},t.prototype.SAVE_ERROR=function(n){if(Oe(n))return n.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:Lt(this.RULE_OCCURRENCE_STACK)},this._errors.push(n),n;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(t.prototype,"errors",{get:function(){return Lt(this._errors)},set:function(n){this._errors=n},enumerable:!1,configurable:!0}),t.prototype.raiseEarlyExitException=function(n,e,r){for(var i=this.getCurrRuleFullName(),E=this.getGAstProductions()[i],o=zn(n,E,e,this.maxLookahead),A=o[0],a=[],u=1;u<=this.maxLookahead;u++)a.push(this.LA(u));var h=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:A,actual:a,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new Hi(h,this.LA(1),this.LA(0)))},t.prototype.raiseNoAltException=function(n,e){for(var r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],E=jn(n,i,this.maxLookahead),o=[],A=1;A<=this.maxLookahead;A++)o.push(this.LA(A));var a=this.LA(0),u=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:E,actual:o,previous:a,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new Gi(u,this.LA(1),a))},t})(),gs=(function(){function t(){}return t.prototype.initContentAssist=function(){},t.prototype.computeContentAssist=function(n,e){var r=this.gastProductionsCache[n];if(Jt(r))throw Error("Rule ->"+n+"<- does not exist in this grammar.");return yi([r],e,this.tokenMatcher,this.maxLookahead)},t.prototype.getNextPossibleTokenTypes=function(n){var e=Ht(n.ruleStack),r=this.getGAstProductions(),i=r[e],E=new Ca(i,n).startWalking();return E},t})(),rn={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(rn);var $r=!0,Yr=Math.pow(2,ce)-1,qi=qn({name:"RECORDING_PHASE_TOKEN",pattern:Gt.NA});Se([qi]);var Xi=Qe(qi,`This IToken indicates the Parser is in Recording Phase
|
|
98
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(Xi);var As={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
99
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}},Ms=(function(){function t(){}return t.prototype.initGastRecorder=function(n){this.recordingProdStack=[],this.RECORDING_PHASE=!1},t.prototype.enableRecording=function(){var n=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var e=function(i){var E=i>0?i:"";n["CONSUME"+E]=function(o,A){return this.consumeInternalRecord(o,i,A)},n["SUBRULE"+E]=function(o,A){return this.subruleInternalRecord(o,i,A)},n["OPTION"+E]=function(o){return this.optionInternalRecord(o,i)},n["OR"+E]=function(o){return this.orInternalRecord(o,i)},n["MANY"+E]=function(o){this.manyInternalRecord(i,o)},n["MANY_SEP"+E]=function(o){this.manySepFirstInternalRecord(i,o)},n["AT_LEAST_ONE"+E]=function(o){this.atLeastOneInternalRecord(i,o)},n["AT_LEAST_ONE_SEP"+E]=function(o){this.atLeastOneSepFirstInternalRecord(i,o)}},r=0;r<10;r++)e(r);n.consume=function(i,E,o){return this.consumeInternalRecord(E,i,o)},n.subrule=function(i,E,o){return this.subruleInternalRecord(E,i,o)},n.option=function(i,E){return this.optionInternalRecord(E,i)},n.or=function(i,E){return this.orInternalRecord(E,i)},n.many=function(i,E){this.manyInternalRecord(i,E)},n.atLeastOne=function(i,E){this.atLeastOneInternalRecord(i,E)},n.ACTION=n.ACTION_RECORD,n.BACKTRACK=n.BACKTRACK_RECORD,n.LA=n.LA_RECORD})},t.prototype.disableRecording=function(){var n=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var e=0;e<10;e++){var r=e>0?e:"";delete n["CONSUME"+r],delete n["SUBRULE"+r],delete n["OPTION"+r],delete n["OR"+r],delete n["MANY"+r],delete n["MANY_SEP"+r],delete n["AT_LEAST_ONE"+r],delete n["AT_LEAST_ONE_SEP"+r]}delete n.consume,delete n.subrule,delete n.option,delete n.or,delete n.many,delete n.atLeastOne,delete n.ACTION,delete n.BACKTRACK,delete n.LA})},t.prototype.ACTION_RECORD=function(n){},t.prototype.BACKTRACK_RECORD=function(n,e){return function(){return!0}},t.prototype.LA_RECORD=function(n){return $e},t.prototype.topLevelRuleRecord=function(n,e){try{var r=new he({definition:[],name:n});return r.name=n,this.recordingProdStack.push(r),e.call(this),this.recordingProdStack.pop(),r}catch(i){if(i.KNOWN_RECORDER_ERROR!==!0)try{i.message=i.message+`
|
|
100
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
101
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw i}throw i}},t.prototype.optionInternalRecord=function(n,e){return Ne.call(this,Ot,n,e)},t.prototype.atLeastOneInternalRecord=function(n,e){Ne.call(this,xt,e,n)},t.prototype.atLeastOneSepFirstInternalRecord=function(n,e){Ne.call(this,Bt,e,n,$r)},t.prototype.manyInternalRecord=function(n,e){Ne.call(this,Et,e,n)},t.prototype.manySepFirstInternalRecord=function(n,e){Ne.call(this,Pt,e,n,$r)},t.prototype.orInternalRecord=function(n,e){return Ts.call(this,n,e)},t.prototype.subruleInternalRecord=function(n,e,r){if(be(e),!n||Y(n,"ruleName")===!1){var i=new Error("<SUBRULE"+Kr(e)+"> argument is invalid"+(" expecting a Parser method reference but got: <"+JSON.stringify(n)+">")+(`
|
|
102
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var E=De(this.recordingProdStack),o=n.ruleName,A=new Ct({idx:e,nonTerminalName:o,referencedRule:void 0});return E.definition.push(A),this.outputCst?As:rn},t.prototype.consumeInternalRecord=function(n,e,r){if(be(e),!gi(n)){var i=new Error("<CONSUME"+Kr(e)+"> argument is invalid"+(" expecting a TokenType reference but got: <"+JSON.stringify(n)+">")+(`
|
|
103
|
+
inside top level rule: <`+this.recordingProdStack[0].name+">"));throw i.KNOWN_RECORDER_ERROR=!0,i}var E=De(this.recordingProdStack),o=new lt({idx:e,terminalType:n});return E.definition.push(o),Xi},t})();function Ne(t,n,e,r){r===void 0&&(r=!1),be(e);var i=De(this.recordingProdStack),E=se(n)?n:n.DEF,o=new t({definition:[],idx:e});return r&&(o.separator=n.SEP),Y(n,"MAX_LOOKAHEAD")&&(o.maxLookahead=n.MAX_LOOKAHEAD),this.recordingProdStack.push(o),E.call(this),i.definition.push(o),this.recordingProdStack.pop(),rn}function Ts(t,n){var e=this;be(n);var r=De(this.recordingProdStack),i=Kt(t)===!1,E=i===!1?t:t.DEF,o=new kt({definition:[],idx:n,ignoreAmbiguities:i&&t.IGNORE_AMBIGUITIES===!0});Y(t,"MAX_LOOKAHEAD")&&(o.maxLookahead=t.MAX_LOOKAHEAD);var A=ai(E,function(a){return se(a.GATE)});return o.hasPredicates=A,r.definition.push(o),$(E,function(a){var u=new It({definition:[]});o.definition.push(u),Y(a,"IGNORE_AMBIGUITIES")?u.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:Y(a,"GATE")&&(u.ignoreAmbiguities=!0),e.recordingProdStack.push(u),a.ALT.call(e),e.recordingProdStack.pop()}),rn}function Kr(t){return t===0?"":""+t}function be(t){if(t<0||t>Yr){var n=new Error("Invalid DSL Method idx value: <"+t+`>
|
|
104
|
+
`+("Idx value must be a none negative value smaller than "+(Yr+1)));throw n.KNOWN_RECORDER_ERROR=!0,n}}var vs=(function(){function t(){}return t.prototype.initPerformanceTracer=function(n){if(Y(n,"traceInitPerf")){var e=n.traceInitPerf,r=typeof e=="number";this.traceInitMaxIdent=r?e:1/0,this.traceInitPerf=r?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=ee.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(n,e){if(this.traceInitPerf===!0){this.traceInitIndent++;var r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(r+"--> <"+n+">");var i=ui(e),E=i.time,o=i.value,A=E>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&A(r+"<-- <"+n+"> time: "+E+"ms"),this.traceInitIndent--,o}else return e()},t})(),ji=(function(){var t=function(n,e){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var E in i)Object.prototype.hasOwnProperty.call(i,E)&&(r[E]=i[E])},t(n,e)};return function(n,e){t(n,e);function r(){this.constructor=n}n.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}})(),$e=Qe(ae,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze($e);var ee=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Xn,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Ye=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),St;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS"})(St||(St={}));function Os(t){return t===void 0&&(t=void 0),function(){return t}}var tr=(function(){function t(n,e){this.definitionErrors=[],this.selfAnalysisDone=!1;var r=this;if(r.initErrorHandler(e),r.initLexerAdapter(),r.initLooksAhead(e),r.initRecognizerEngine(n,e),r.initRecoverable(e),r.initTreeBuilder(e),r.initContentAssist(),r.initGastRecorder(e),r.initPerformanceTracer(e),Y(e,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
105
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
106
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
107
|
+
For further details.`);this.skipValidations=Y(e,"skipValidations")?e.skipValidations:ee.skipValidations}return t.performSelfAnalysis=function(n){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")},t.prototype.performSelfAnalysis=function(){var n=this;this.TRACE_INIT("performSelfAnalysis",function(){var e;n.selfAnalysisDone=!0;var r=n.className;n.TRACE_INIT("toFastProps",function(){ci(n)}),n.TRACE_INIT("Grammar Recording",function(){try{n.enableRecording(),$(n.definedRulesNames,function(E){var o=n[E],A=o.originalGrammarAction,a=void 0;n.TRACE_INIT(E+" Rule",function(){a=n.topLevelRuleRecord(E,A)}),n.gastProductionsCache[E]=a})}finally{n.disableRecording()}});var i=[];if(n.TRACE_INIT("Grammar Resolving",function(){i=_i({rules:mt(n.gastProductionsCache)}),n.definitionErrors.push.apply(n.definitionErrors,i)}),n.TRACE_INIT("Grammar Validations",function(){if(ot(i)&&n.skipValidations===!1){var E=Pi({rules:mt(n.gastProductionsCache),maxLookahead:n.maxLookahead,tokenTypes:mt(n.tokensMap),errMsgProvider:Je,grammarName:r});n.definitionErrors.push.apply(n.definitionErrors,E)}}),ot(n.definitionErrors)&&(n.recoveryEnabled&&n.TRACE_INIT("computeAllProdsFollows",function(){var E=Ma(mt(n.gastProductionsCache));n.resyncFollows=E}),n.TRACE_INIT("ComputeLookaheadFunctions",function(){n.preComputeLookaheadFunctions(mt(n.gastProductionsCache))})),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!ot(n.definitionErrors))throw e=W(n.definitionErrors,function(E){return E.message}),new Error(`Parser Definition Errors detected:
|
|
108
|
+
`+e.join(`
|
|
109
|
+
-------------------------------
|
|
110
|
+
`))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t})();To(tr,[Ja,ns,ps,Es,Rs,ds,Ns,gs,Ms,vs]);var Is=(function(t){ji(n,t);function n(e,r){r===void 0&&(r=ee);var i=this,E=Ie(r);return E.outputCst=!0,i=t.call(this,e,E)||this,i}return n})(tr),ys=(function(t){ji(n,t);function n(e,r){r===void 0&&(r=ee);var i=this,E=Ie(r);return E.outputCst=!1,i=t.call(this,e,E)||this,i}return n})(tr);function Cs(t,n){var e=n===void 0?{}:n,r=e.resourceBase,i=r===void 0?"https://unpkg.com/chevrotain@"+kn+"/diagrams/":r,E=e.css,o=E===void 0?"https://unpkg.com/chevrotain@"+kn+"/diagrams/diagrams.css":E,A=`
|
|
111
|
+
<!-- This is a generated file -->
|
|
112
|
+
<!DOCTYPE html>
|
|
113
|
+
<meta charset="utf-8">
|
|
114
|
+
<style>
|
|
115
|
+
body {
|
|
116
|
+
background-color: hsl(30, 20%, 95%)
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
119
|
+
|
|
120
|
+
`,a=`
|
|
121
|
+
<link rel='stylesheet' href='`+o+`'>
|
|
122
|
+
`,u=`
|
|
123
|
+
<script src='`+i+`vendor/railroad-diagrams.js'><\/script>
|
|
124
|
+
<script src='`+i+`src/diagrams_builder.js'><\/script>
|
|
125
|
+
<script src='`+i+`src/diagrams_behavior.js'><\/script>
|
|
126
|
+
<script src='`+i+`src/main.js'><\/script>
|
|
127
|
+
`,h=`
|
|
128
|
+
<div id="diagrams" align="center"></div>
|
|
129
|
+
`,d=`
|
|
130
|
+
<script>
|
|
131
|
+
window.serializedGrammar = `+JSON.stringify(t,null," ")+`;
|
|
132
|
+
<\/script>
|
|
133
|
+
`,s=`
|
|
134
|
+
<script>
|
|
135
|
+
var diagramsDiv = document.getElementById("diagrams");
|
|
136
|
+
main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);
|
|
137
|
+
<\/script>
|
|
138
|
+
`;return A+a+u+h+d+s}var gt=`
|
|
139
|
+
`;function Ss(t){return`
|
|
140
|
+
(function (root, factory) {
|
|
141
|
+
if (typeof define === 'function' && define.amd) {
|
|
142
|
+
// AMD. Register as an anonymous module.
|
|
143
|
+
define(['chevrotain'], factory);
|
|
144
|
+
} else if (typeof module === 'object' && module.exports) {
|
|
145
|
+
// Node. Does not work with strict CommonJS, but
|
|
146
|
+
// only CommonJS-like environments that support module.exports,
|
|
147
|
+
// like Node.
|
|
148
|
+
module.exports = factory(require('chevrotain'));
|
|
149
|
+
} else {
|
|
150
|
+
// Browser globals (root is window)
|
|
151
|
+
root.returnExports = factory(root.b);
|
|
152
|
+
}
|
|
153
|
+
}(typeof self !== 'undefined' ? self : this, function (chevrotain) {
|
|
154
|
+
|
|
155
|
+
`+zi(t)+`
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
`+t.name+": "+t.name+`
|
|
159
|
+
}
|
|
160
|
+
}));
|
|
161
|
+
`}function Us(t){return`
|
|
162
|
+
`+zi(t)+`
|
|
163
|
+
return new `+t.name+`(tokenVocabulary, config)
|
|
164
|
+
`}function zi(t){var n=`
|
|
165
|
+
function `+t.name+`(tokenVocabulary, config) {
|
|
166
|
+
// invoke super constructor
|
|
167
|
+
// No support for embedded actions currently, so we can 'hardcode'
|
|
168
|
+
// The use of CstParser.
|
|
169
|
+
chevrotain.CstParser.call(this, tokenVocabulary, config)
|
|
170
|
+
|
|
171
|
+
const $ = this
|
|
172
|
+
|
|
173
|
+
`+ms(t.rules)+`
|
|
174
|
+
|
|
175
|
+
// very important to call this after all the rules have been defined.
|
|
176
|
+
// otherwise the parser may not work correctly as it will lack information
|
|
177
|
+
// derived during the self analysis phase.
|
|
178
|
+
this.performSelfAnalysis(this)
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// inheritance as implemented in javascript in the previous decade... :(
|
|
182
|
+
`+t.name+`.prototype = Object.create(chevrotain.CstParser.prototype)
|
|
183
|
+
`+t.name+".prototype.constructor = "+t.name+`
|
|
184
|
+
`;return n}function ms(t){var n=W(t,function(e){return Ls(e,1)});return n.join(`
|
|
185
|
+
`)}function Ls(t,n){var e=yt(n,'$.RULE("'+t.name+'", function() {')+gt;return e+=on(t.definition,n+1),e+=yt(n+1,"})")+gt,e}function ws(t,n){var e=t.terminalType.name;return yt(n,"$.CONSUME"+t.idx+"(this.tokensMap."+e+")"+gt)}function _s(t,n){return yt(n,"$.SUBRULE"+t.idx+"($."+t.nonTerminalName+")"+gt)}function Ps(t,n){var e=yt(n,"$.OR"+t.idx+"([")+gt,r=W(t.definition,function(i){return ks(i,n+1)});return e+=r.join(","+gt),e+=gt+yt(n,"])"+gt),e}function ks(t,n){var e=yt(n,"{")+gt;return e+=yt(n+1,"ALT: function() {")+gt,e+=on(t.definition,n+1),e+=yt(n+1,"}")+gt,e+=yt(n,"}"),e}function Fs(t,n){if(t instanceof Ct)return _s(t,n);if(t instanceof Ot)return ge("OPTION",t,n);if(t instanceof xt)return ge("AT_LEAST_ONE",t,n);if(t instanceof Bt)return ge("AT_LEAST_ONE_SEP",t,n);if(t instanceof Pt)return ge("MANY_SEP",t,n);if(t instanceof Et)return ge("MANY",t,n);if(t instanceof kt)return Ps(t,n);if(t instanceof lt)return ws(t,n);if(t instanceof It)return on(t.definition,n);throw Error("non exhaustive match")}function ge(t,n,e){var r=yt(e,"$."+(t+n.idx)+"(");return n.separator?(r+="{"+gt,r+=yt(e+1,"SEP: this.tokensMap."+n.separator.name)+","+gt,r+="DEF: "+qr(n.definition,e+2)+gt,r+=yt(e,"}")+gt):r+=qr(n.definition,e+1),r+=yt(e,")")+gt,r}function qr(t,n){var e="function() {"+gt;return e+=on(t,n),e+=yt(n,"}")+gt,e}function on(t,n){var e="";return $(t,function(r){e+=Fs(r,n+1)}),e}function yt(t,n){var e=Array(t*4+1).join(" ");return e+n}function xs(t){var n=Us({name:t.name,rules:t.rules}),e=new Function("tokenVocabulary","config","chevrotain",n);return function(r){return e(t.tokenVocabulary,r,require("../api"))}}function Bs(t){return Ss({name:t.name,rules:t.rules})}function Ds(){console.warn(`The clearCache function was 'soft' removed from the Chevrotain API.
|
|
186
|
+
It performs no action other than printing this message.
|
|
187
|
+
Please avoid using it as it will be completely removed in the future`)}var Gs=(function(){function t(){throw new Error(`The Parser class has been deprecated, use CstParser or EmbeddedActionsParser instead.
|
|
188
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_7-0-0`)}return t})();const Vs=Object.freeze(Object.defineProperty({__proto__:null,Alternation:kt,Alternative:It,CstParser:Is,EMPTY_ALT:Os,EOF:ae,EarlyExitException:Hi,EmbeddedActionsParser:ys,GAstVisitor:pe,Lexer:Gt,get LexerDefinitionErrorType(){return ht},MismatchedTokenException:Jn,NoViableAltException:Gi,NonTerminal:Ct,NotAllInputParsedException:Vi,Option:Ot,Parser:Gs,get ParserDefinitionErrorType(){return St},Repetition:Et,RepetitionMandatory:xt,RepetitionMandatoryWithSeparator:Bt,RepetitionWithSeparator:Pt,Rule:he,Terminal:lt,VERSION:kn,assignOccurrenceIndices:Za,clearCache:Ds,createSyntaxDiagramsCode:Cs,createToken:qn,createTokenInstance:Qe,defaultGrammarResolverErrorProvider:Ii,defaultGrammarValidatorErrorProvider:Je,defaultLexerErrorProvider:Ai,defaultParserErrorProvider:Xn,generateParserFactory:xs,generateParserModule:Bs,isRecognitionException:Oe,resolveGrammar:_i,serializeGrammar:Ti,serializeProduction:Te,tokenLabel:fe,tokenMatcher:la,tokenName:sa,validateGrammar:Pi},Symbol.toStringTag,{value:"Module"})),er=to(Vs);var Sn,Xr;function nr(){if(Xr)return Sn;Xr=1;const{createToken:t,Lexer:n}=er,e=Rt(),r={},i=t({name:"WhiteSpace",pattern:/\s+/,group:n.SKIPPED}),E=t({name:"String",pattern:/"(""|[^"])*"/}),o=t({name:"SingleQuotedString",pattern:/'(''|[^'])*'/}),A=t({name:"SheetQuoted",pattern:/'((?![\\\/\[\]*?:]).)+?'!/}),a=t({name:"Function",pattern:/[A-Za-z_]+[A-Za-z_0-9.]*\(/}),u=t({name:"FormulaErrorT",pattern:/#NULL!|#DIV\/0!|#VALUE!|#NAME\?|#NUM!|#N\/A/}),h=t({name:"RefError",pattern:/#REF!/}),d=t({name:"Name",pattern:/[a-zA-Z_][a-zA-Z0-9_.?]*/}),s=t({name:"Sheet",pattern:/[A-Za-z_.\d\u007F-\uFFFF]+!/}),f=t({name:"Cell",pattern:/[$]?[A-Za-z]{1,3}[$]?[1-9][0-9]*/,longer_alt:d}),N=t({name:"Number",pattern:/[0-9]+[.]?[0-9]*([eE][+\-][0-9]+)?/}),c=t({name:"Boolean",pattern:/TRUE|FALSE/i}),l=t({name:"Column",pattern:/[$]?[A-Za-z]{1,3}/,longer_alt:d}),p=t({name:"At",pattern:/@/}),R=t({name:"Comma",pattern:/,/}),T=t({name:"Colon",pattern:/:/}),O=t({name:"Semicolon",pattern:/;/}),m=t({name:"OpenParen",pattern:/\(/}),M=t({name:"CloseParen",pattern:/\)/}),I=t({name:"OpenSquareParen",pattern:/\[/}),w=t({name:"CloseSquareParen",pattern:/]/});t({name:"exclamationMark",pattern:/!/});const D=t({name:"OpenCurlyParen",pattern:/{/}),G=t({name:"CloseCurlyParen",pattern:/}/}),H=t({name:"QuoteS",pattern:/'/}),b=t({name:"MulOp",pattern:/\*/}),z=t({name:"PlusOp",pattern:/\+/}),Z=t({name:"DivOp",pattern:/\//}),rt=t({name:"MinOp",pattern:/-/}),Ut=t({name:"ConcatOp",pattern:/&/}),wt=t({name:"ExOp",pattern:/\^/}),zt=t({name:"PercentOp",pattern:/%/}),Dt=t({name:"GtOp",pattern:/>/}),Qt=t({name:"EqOp",pattern:/=/}),re=t({name:"LtOp",pattern:/</}),S=t({name:"NeqOp",pattern:/<>/}),y=t({name:"GteOp",pattern:/>=/}),g=t({name:"LteOp",pattern:/<=/}),_=[i,E,A,o,a,u,h,s,f,c,l,d,N,p,R,T,O,m,M,I,w,D,G,H,b,z,Z,rt,Ut,wt,b,zt,S,y,g,Dt,Qt,re],v=new n(_,{ensureOptimizations:!0});return _.forEach(B=>{r[B.name]=B}),Sn={tokenVocabulary:r,lex:function(B){const C=v.tokenize(B);if(C.errors.length>0){const F=C.errors[0],q=F.line,V=F.column;let X=`
|
|
189
|
+
`+B.split(`
|
|
190
|
+
`)[q-1]+`
|
|
191
|
+
`;throw X+=Array(V-1).fill(" ").join("")+`^
|
|
192
|
+
`,F.message=X+`Error at position ${q}:${V}
|
|
193
|
+
`+F.message,F.errorLocation={line:q,column:V},e.ERROR(F.message,F)}return C}},Sn}var Un,jr;function Qi(){if(jr)return Un;jr=1;const t=nr(),{EmbeddedActionsParser:n}=er,e=t.tokenVocabulary,{String:r,SheetQuoted:i,ExcelRefFunction:E,ExcelConditionalRefFunction:o,Function:A,FormulaErrorT:a,RefError:u,Cell:h,Sheet:d,Name:s,Number:f,Boolean:N,Column:c,Comma:l,Colon:p,Semicolon:R,OpenParen:T,CloseParen:O,OpenCurlyParen:m,CloseCurlyParen:M,MulOp:I,PlusOp:w,DivOp:D,MinOp:G,ConcatOp:H,ExOp:b,PercentOp:z,NeqOp:Z,GteOp:rt,LteOp:Ut,GtOp:wt,EqOp:zt,LtOp:Dt}=t.tokenVocabulary;class Qt extends n{constructor(S,y){super(e,{outputCst:!1,maxLookahead:1,skipValidations:!0}),this.utils=y,this.binaryOperatorsPrecedence=[["^"],["*","/"],["+","-"],["&"],["<",">","=","<>","<=",">="]];const g=this;g.RULE("formulaWithBinaryOp",()=>{const _=[],v=[g.SUBRULE(g.formulaWithPercentOp)];return g.MANY(()=>{_.push(g.OR(g.c1||(g.c1=[{ALT:()=>g.CONSUME(wt).image},{ALT:()=>g.CONSUME(zt).image},{ALT:()=>g.CONSUME(Dt).image},{ALT:()=>g.CONSUME(Z).image},{ALT:()=>g.CONSUME(rt).image},{ALT:()=>g.CONSUME(Ut).image},{ALT:()=>g.CONSUME(H).image},{ALT:()=>g.CONSUME(w).image},{ALT:()=>g.CONSUME(G).image},{ALT:()=>g.CONSUME(I).image},{ALT:()=>g.CONSUME(D).image},{ALT:()=>g.CONSUME(b).image}]))),v.push(g.SUBRULE2(g.formulaWithPercentOp))}),g.ACTION(()=>{for(const B of this.binaryOperatorsPrecedence)for(let C=0,F=_.length;C<F;C++){const q=_[C];B.includes(q)&&(_.splice(C,1),v.splice(C,2,this.utils.applyInfix(v[C],q,v[C+1])),C--,F--)}}),v[0]}),g.RULE("plusMinusOp",()=>g.OR([{ALT:()=>g.CONSUME(w).image},{ALT:()=>g.CONSUME(G).image}])),g.RULE("formulaWithPercentOp",()=>{let _=g.SUBRULE(g.formulaWithUnaryOp);return g.OPTION(()=>{const v=g.CONSUME(z).image;_=g.ACTION(()=>this.utils.applyPostfix(_,v))}),_}),g.RULE("formulaWithUnaryOp",()=>{const _=[];g.MANY(()=>{const B=g.OR([{ALT:()=>g.CONSUME(w).image},{ALT:()=>g.CONSUME(G).image}]);_.push(B)});const v=g.SUBRULE(g.formulaWithIntersect);return _.length>0?g.ACTION(()=>this.utils.applyPrefix(_,v)):v}),g.RULE("formulaWithIntersect",()=>{let _=g.SUBRULE(g.formulaWithRange);const v=[_];return g.MANY({GATE:()=>{const B=g.LA(0);return g.LA(1).startOffset>B.endOffset+1},DEF:()=>{v.push(g.SUBRULE3(g.formulaWithRange))}}),v.length>1?g.ACTION(()=>g.ACTION(()=>this.utils.applyIntersect(v))):_}),g.RULE("formulaWithRange",()=>{const _=g.SUBRULE(g.formula),v=[_];return g.MANY(()=>{g.CONSUME(p),v.push(g.SUBRULE2(g.formula))}),v.length>1?g.ACTION(()=>g.ACTION(()=>this.utils.applyRange(v))):_}),g.RULE("formula",()=>g.OR9([{ALT:()=>g.SUBRULE(g.referenceWithoutInfix)},{ALT:()=>g.SUBRULE(g.paren)},{ALT:()=>g.SUBRULE(g.constant)},{ALT:()=>g.SUBRULE(g.functionCall)},{ALT:()=>g.SUBRULE(g.constantArray)}])),g.RULE("paren",()=>{g.CONSUME(T);let _;const v=[];return v.push(g.SUBRULE(g.formulaWithBinaryOp)),g.MANY(()=>{g.CONSUME(l),v.push(g.SUBRULE2(g.formulaWithBinaryOp))}),v.length>1?_=g.ACTION(()=>this.utils.applyUnion(v)):_=v[0],g.CONSUME(O),_}),g.RULE("constantArray",()=>{const _=[[]];let v=0;return g.CONSUME(m),_[v].push(g.SUBRULE(g.constantForArray)),g.MANY(()=>{const B=g.OR([{ALT:()=>g.CONSUME(l).image},{ALT:()=>g.CONSUME(R).image}]),C=g.SUBRULE2(g.constantForArray);B===","||(v++,_[v]=[]),_[v].push(C)}),g.CONSUME(M),g.ACTION(()=>this.utils.toArray(_))}),g.RULE("constantForArray",()=>g.OR([{ALT:()=>{const _=g.OPTION(()=>g.SUBRULE(g.plusMinusOp)),v=g.CONSUME(f).image,B=g.ACTION(()=>this.utils.toNumber(v));return _?g.ACTION(()=>this.utils.applyPrefix([_],B)):B}},{ALT:()=>{const _=g.CONSUME(r).image;return g.ACTION(()=>this.utils.toString(_))}},{ALT:()=>{const _=g.CONSUME(N).image;return g.ACTION(()=>this.utils.toBoolean(_))}},{ALT:()=>{const _=g.CONSUME(a).image;return g.ACTION(()=>this.utils.toError(_))}},{ALT:()=>{const _=g.CONSUME(u).image;return g.ACTION(()=>this.utils.toError(_))}}])),g.RULE("constant",()=>g.OR([{ALT:()=>{const _=g.CONSUME(f).image;return g.ACTION(()=>this.utils.toNumber(_))}},{ALT:()=>{const _=g.CONSUME(r).image;return g.ACTION(()=>this.utils.toString(_))}},{ALT:()=>{const _=g.CONSUME(N).image;return g.ACTION(()=>this.utils.toBoolean(_))}},{ALT:()=>{const _=g.CONSUME(a).image;return g.ACTION(()=>this.utils.toError(_))}}])),g.RULE("functionCall",()=>{const _=g.CONSUME(A).image.slice(0,-1),v=g.SUBRULE(g.arguments);return g.CONSUME(O),g.ACTION(()=>S.callFunction(_,v))}),g.RULE("arguments",()=>{g.MANY2(()=>{g.CONSUME2(l)});const _=[];return g.OPTION(()=>{_.push(g.SUBRULE(g.formulaWithBinaryOp)),g.MANY(()=>{g.CONSUME1(l),_.push(null),g.OPTION3(()=>{_.pop(),_.push(g.SUBRULE2(g.formulaWithBinaryOp))})})}),_}),g.RULE("referenceWithoutInfix",()=>g.OR([{ALT:()=>g.SUBRULE(g.referenceItem)},{ALT:()=>{const _=g.SUBRULE(g.prefixName),v=g.SUBRULE2(g.formulaWithRange);return g.ACTION(()=>{if(this.utils.isFormulaError(v))return v;v.ref.sheet=_}),v}}])),g.RULE("referenceItem",()=>g.OR([{ALT:()=>{const _=g.CONSUME(h).image;return g.ACTION(()=>this.utils.parseCellAddress(_))}},{ALT:()=>{const _=g.CONSUME(s).image;return g.ACTION(()=>S.getVariable(_))}},{ALT:()=>{const _=g.CONSUME(c).image;return g.ACTION(()=>this.utils.parseCol(_))}},{ALT:()=>{const _=g.CONSUME(u).image;return g.ACTION(()=>this.utils.toError(_))}}])),g.RULE("prefixName",()=>g.OR([{ALT:()=>g.CONSUME(d).image.slice(0,-1)},{ALT:()=>g.CONSUME(i).image.slice(1,-2).replace(/''/g,"'")}])),this.performSelfAnalysis()}}return Un={Parser:Qt},Un}var mn,zr;function Zi(){if(zr)return mn;zr=1;const t=Rt(),{Address:n}=At(),{Prefix:e,Postfix:r,Infix:i,Operators:E}=qe(),o=Ke(),A=1048576,a=16384,{NotAllInputParsedException:u}=er;class h{constructor(s){this.context=s}columnNameToNumber(s){return n.columnNameToNumber(s)}parseCellAddress(s){const f=s.match(/([$]?)([A-Za-z]{1,3})([$]?)([1-9][0-9]*)/);return{ref:{address:f[0],col:this.columnNameToNumber(f[2]),row:+f[4]}}}parseRow(s){const f=+s;if(!Number.isInteger(f))throw Error("Row number must be integer.");return{ref:{col:void 0,row:+s}}}parseCol(s){return{ref:{col:this.columnNameToNumber(s),row:void 0}}}parseColRange(s,f){return s=this.columnNameToNumber(s),f=this.columnNameToNumber(f),{ref:{from:{col:Math.min(s,f),row:null},to:{col:Math.max(s,f),row:null}}}}parseRowRange(s,f){return{ref:{from:{col:null,row:Math.min(s,f)},to:{col:null,row:Math.max(s,f)}}}}_applyPrefix(s,f,N){return this.isFormulaError(f)?f:e.unaryOp(s,f,N)}async applyPrefixAsync(s,f){const{val:N,isArray:c}=this.extractRefValue(await f);return this._applyPrefix(s,N,c)}applyPrefix(s,f){if(this.context.async)return this.applyPrefixAsync(s,f);{const{val:N,isArray:c}=this.extractRefValue(f);return this._applyPrefix(s,N,c)}}_applyPostfix(s,f,N){return this.isFormulaError(s)?s:r.percentOp(s,N,f)}async applyPostfixAsync(s,f){const{val:N,isArray:c}=this.extractRefValue(await s);return this._applyPostfix(N,c,f)}applyPostfix(s,f){if(this.context.async)return this.applyPostfixAsync(s,f);{const{val:N,isArray:c}=this.extractRefValue(s);return this._applyPostfix(N,c,f)}}_applyInfix(s,f,N){const c=s.val,l=s.isArray,p=N.val,R=N.isArray;if(this.isFormulaError(c))return c;if(this.isFormulaError(p))return p;if(E.compareOp.includes(f))return i.compareOp(c,f,p,l,R);if(E.concatOp.includes(f))return i.concatOp(c,f,p,l,R);if(E.mathOp.includes(f))return i.mathOp(c,f,p,l,R);throw new Error(`Unrecognized infix: ${f}`)}async applyInfixAsync(s,f,N){const c=this.extractRefValue(await s),l=this.extractRefValue(await N);return this._applyInfix(c,f,l)}applyInfix(s,f,N){if(this.context.async)return this.applyInfixAsync(s,f,N);{const c=this.extractRefValue(s),l=this.extractRefValue(N);return this._applyInfix(c,f,l)}}applyIntersect(s){if(this.isFormulaError(s[0]))return s[0];if(!s[0].ref)throw Error(`Expecting a reference, but got ${s[0]}.`);let f,N,c,l,p,R;const T=s.shift().ref;if(p=T.sheet,T.from)f=Math.max(T.from.row,T.to.row),c=Math.min(T.from.row,T.to.row),N=Math.max(T.from.col,T.to.col),l=Math.min(T.from.col,T.to.col);else{if(T.row===void 0||T.col===void 0)throw Error("Cannot intersect the whole row or column.");f=c=T.row,N=l=T.col}let O;return s.forEach(m=>{if(this.isFormulaError(m))return m;if(m=m.ref,!m)throw Error(`Expecting a reference, but got ${m}.`);if(m.from){const M=Math.max(m.from.row,m.to.row),I=Math.min(m.from.row,m.to.row),w=Math.max(m.from.col,m.to.col),D=Math.min(m.from.col,m.to.col);(I>f||M<c||D>N||w<l||p!==m.sheet)&&(O=t.NULL),f=Math.min(f,M),c=Math.max(c,I),N=Math.min(N,w),l=Math.max(l,D)}else{if(m.row===void 0||m.col===void 0)throw Error("Cannot intersect the whole row or column.");(m.row>f||m.row<c||m.col>N||m.col<l||p!==m.sheet)&&(O=t.NULL),f=c=m.row,N=l=m.col}}),O||(f===c&&N===l?R={ref:{sheet:p,row:f,col:N}}:R={ref:{sheet:p,from:{row:c,col:l},to:{row:f,col:N}}},R.ref.sheet||delete R.ref.sheet,R)}applyUnion(s){const f=new o;for(let N=0;N<s.length;N++){if(this.isFormulaError(s[N]))return s[N];f.add(this.extractRefValue(s[N]).val,s[N])}return f}applyRange(s){let f,N=-1,c=-1,l=A+1,p=a+1;return s.forEach(R=>{if(this.isFormulaError(R))return R;typeof R=="number"&&(R=this.parseRow(R)),R=R.ref,R.row===void 0&&(l=1,N=A),R.col===void 0&&(p=1,c=a),R.row>N&&(N=R.row),R.row<l&&(l=R.row),R.col>c&&(c=R.col),R.col<p&&(p=R.col)}),N===l&&c===p?f={ref:{row:N,col:c}}:f={ref:{from:{row:l,col:p},to:{row:N,col:c}}},f}extractRefValue(s){let f=s,N=!1;return Array.isArray(f)&&(N=!0),s.ref?{val:this.context.retrieveRef(s),isArray:N}:{val:f,isArray:N}}toArray(s){return s}toNumber(s){return Number(s)}toString(s){return s.substring(1,s.length-1).replace(/""/g,'"')}toBoolean(s){return s==="TRUE"}toError(s){return new t(s.toUpperCase())}isFormulaError(s){return s instanceof t}static formatChevrotainError(s,f){let N,c,l="";return s instanceof u?(N=s.token.startLine,c=s.token.startColumn):(N=s.previousToken.startLine,c=s.previousToken.startColumn+1),l+=`
|
|
194
|
+
`+f.split(`
|
|
195
|
+
`)[N-1]+`
|
|
196
|
+
`,l+=Array(c-1).fill(" ").join("")+`^
|
|
197
|
+
`,l+=`Error at position ${N}:${c}
|
|
198
|
+
`+s.message,s.errorLocation={line:N,column:c},t.ERROR(l,s)}}return mn=h,mn}var Ln,Qr;function Hs(){if(Qr)return Ln;Qr=1;const t=ri(),n=ii(),e=oo(),r=ao(),i=so(),E=co(),o=uo(),A=fo(),a=ho(),u=po(),h=Rt(),{FormulaHelpers:d}=At(),{Parser:s,allTokens:f}=Qi(),N=nr(),c=Zi();class l{constructor(R,T=!1){this.logs=[],this.isTest=T,this.utils=new c(this),R=Object.assign({functions:{},functionsNeedContext:{},onVariable:()=>null,onCell:()=>0,onRange:()=>[[0]]},R),this.onVariable=R.onVariable,this.functions=Object.assign({},a,A,o,E,i,r,t,n,e,u,R.functions,R.functionsNeedContext),this.onRange=R.onRange,this.onCell=R.onCell,this.funsNullAs0=Object.keys(n).concat(Object.keys(e)).concat(Object.keys(r)).concat(Object.keys(i)).concat(Object.keys(E)).concat(Object.keys(A)).concat(Object.keys(a)),this.funsNeedContextAndNoDataRetrieve=["ROW","ROWS","COLUMN","COLUMNS","SUMIF","INDEX","AVERAGEIF","IF"],this.funsNeedContext=[...Object.keys(R.functionsNeedContext),...this.funsNeedContextAndNoDataRetrieve,"INDEX","OFFSET","INDIRECT","IF","CHOOSE","WEBSERVICE"],this.funsPreserveRef=Object.keys(o),this.parser=new s(this,this.utils)}static get allTokens(){return f}getCell(R){return R.sheet==null&&(R.sheet=this.position?this.position.sheet:void 0),this.onCell(R)}getRange(R){return R.sheet==null&&(R.sheet=this.position?this.position.sheet:void 0),this.onRange(R)}getVariable(R){const T={ref:this.onVariable(R,this.position.sheet,this.position)};return T.ref==null?h.NAME:T}retrieveRef(R){return d.isRangeRef(R)?this.getRange(R.ref):d.isCellRef(R)?this.getCell(R.ref):R}_callFunction(R,T){R.indexOf("_xlfn.")===0&&(R=R.slice(6)),R=R.toUpperCase();const O=this.funsNullAs0.includes(R)?0:"";if(this.funsNeedContextAndNoDataRetrieve.includes(R)||(T=T.map(m=>{if(m===null)return{value:O,isArray:!1,omitted:!0};const M=this.utils.extractRefValue(m);return this.funsPreserveRef.includes(R)?{value:M.val,isArray:M.isArray,ref:m.ref}:{value:M.val,isArray:M.isArray,isRangeRef:!!d.isRangeRef(m),isCellRef:!!d.isCellRef(m)}})),this.functions[R]){let m;try{!this.funsNeedContextAndNoDataRetrieve.includes(R)&&!this.funsNeedContext.includes(R)?m=this.functions[R](...T):m=this.functions[R](this,...T)}catch(M){if(M instanceof h)return M;throw M}if(m===void 0){if(this.isTest)return this.logs.includes(R)||this.logs.push(R),{value:0,ref:{}};throw h.NOT_IMPLEMENTED(R)}return m}else{if(this.isTest)return this.logs.includes(R)||this.logs.push(R),{value:0,ref:{}};throw h.NOT_IMPLEMENTED(R)}}async callFunctionAsync(R,T){const O=[];for(const M of T)O.push(await M);const m=await this._callFunction(R,O);return d.checkFunctionResult(m)}callFunction(R,T){if(this.async)return this.callFunctionAsync(R,T);{const O=this._callFunction(R,T);return d.checkFunctionResult(O)}}supportedFunctions(){const R=[];return Object.keys(this.functions).forEach(O=>{try{if(this.functions[O](0,0,0,0,0,0,0,0,0,0,0)===void 0)return;R.push(O)}catch(m){m instanceof Error&&R.push(O)}}),R.sort()}checkFormulaResult(R,T=!1){const O=typeof R;if(O==="number"){if(isNaN(R))return h.VALUE;if(!isFinite(R))return h.NUM;R+=0}else if(O==="object"){if(R instanceof h)return R;if(T){if(R.ref&&(R=this.retrieveRef(R)),typeof R=="object"&&!Array.isArray(R)&&R!=null)return h.VALUE}else if(R.ref&&R.ref.row&&!R.ref.from)R=this.retrieveRef(R);else if(R.ref&&R.ref.from&&R.ref.from.col===R.ref.to.col)R=this.retrieveRef({ref:{row:R.ref.from.row,col:R.ref.from.col}});else if(Array.isArray(R))R=R[0][0];else return h.VALUE}return R}parse(R,T,O=!1){if(R.length===0)throw Error("Input must not be empty.");this.position=T,this.async=!1;const m=N.lex(R);this.parser.input=m.tokens;let M;try{if(M=this.parser.formulaWithBinaryOp(),M=this.checkFormulaResult(M,O),M instanceof h)return M}catch(I){throw h.ERROR(I.message,I)}if(this.parser.errors.length>0){const I=this.parser.errors[0];throw c.formatChevrotainError(I,R)}return M}async parseAsync(R,T,O=!1){if(R.length===0)throw Error("Input must not be empty.");this.position=T,this.async=!0;const m=N.lex(R);this.parser.input=m.tokens;let M;try{if(M=await this.parser.formulaWithBinaryOp(),M=this.checkFormulaResult(M,O),M instanceof h)return M}catch(I){throw h.ERROR(I.message,I)}if(this.parser.errors.length>0){const I=this.parser.errors[0];throw c.formatChevrotainError(I,R)}return M}}return Ln={FormulaParser:l,FormulaHelpers:d},Ln}var wn,Zr;function Ws(){if(Zr)return wn;Zr=1;const t=Rt(),{FormulaHelpers:n,Types:e,Address:r}=At(),{Prefix:i,Postfix:E,Infix:o,Operators:A}=qe(),a=Ke(),u=1048576,h=16384;class d{constructor(f){this.context=f}columnNameToNumber(f){return r.columnNameToNumber(f)}parseCellAddress(f){const N=f.match(/([$]?)([A-Za-z]{1,3})([$]?)([1-9][0-9]*)/);return{ref:{col:this.columnNameToNumber(N[2]),row:+N[4]}}}parseRow(f){const N=+f;if(!Number.isInteger(N))throw Error("Row number must be integer.");return{ref:{col:void 0,row:+f}}}parseCol(f){return{ref:{col:this.columnNameToNumber(f),row:void 0}}}applyPrefix(f,N){return this.extractRefValue(N),0}applyPostfix(f,N){return this.extractRefValue(f),0}applyInfix(f,N,c){return this.extractRefValue(f),this.extractRefValue(c),0}applyIntersect(f){if(this.isFormulaError(f[0]))return f[0];if(!f[0].ref)throw Error(`Expecting a reference, but got ${f[0]}.`);let N,c,l,p,R,T;const O=f.shift().ref;if(R=O.sheet,O.from)N=Math.max(O.from.row,O.to.row),l=Math.min(O.from.row,O.to.row),c=Math.max(O.from.col,O.to.col),p=Math.min(O.from.col,O.to.col);else{if(O.row===void 0||O.col===void 0)throw Error("Cannot intersect the whole row or column.");N=l=O.row,c=p=O.col}let m;return f.forEach(M=>{if(this.isFormulaError(M))return M;if(M=M.ref,!M)throw Error(`Expecting a reference, but got ${M}.`);if(M.from){const I=Math.max(M.from.row,M.to.row),w=Math.min(M.from.row,M.to.row),D=Math.max(M.from.col,M.to.col),G=Math.min(M.from.col,M.to.col);(w>N||I<l||G>c||D<p||R!==M.sheet)&&(m=t.NULL),N=Math.min(N,I),l=Math.max(l,w),c=Math.min(c,D),p=Math.max(p,G)}else{if(M.row===void 0||M.col===void 0)throw Error("Cannot intersect the whole row or column.");(M.row>N||M.row<l||M.col>c||M.col<p||R!==M.sheet)&&(m=t.NULL),N=l=M.row,c=p=M.col}}),m||(N===l&&c===p?T={ref:{sheet:R,row:N,col:c}}:T={ref:{sheet:R,from:{row:l,col:p},to:{row:N,col:c}}},T.ref.sheet||delete T.ref.sheet,T)}applyUnion(f){const N=new a;for(let c=0;c<f.length;c++){if(this.isFormulaError(f[c]))return f[c];N.add(this.extractRefValue(f[c]).val,f[c])}return N}applyRange(f){let N,c=-1,l=-1,p=u+1,R=h+1;return f.forEach(T=>{if(this.isFormulaError(T))return T;typeof T=="number"&&(T=this.parseRow(T)),T=T.ref,T.row===void 0&&(p=1,c=u),T.col===void 0&&(R=1,l=h),T.row>c&&(c=T.row),T.row<p&&(p=T.row),T.col>l&&(l=T.col),T.col<R&&(R=T.col)}),c===p&&l===R?N={ref:{row:c,col:l}}:N={ref:{from:{row:p,col:R},to:{row:c,col:l}}},N}extractRefValue(f){const N=Array.isArray(f);return f.ref?{val:this.context.retrieveRef(f),isArray:N}:{val:f,isArray:N}}toArray(f){return f}toNumber(f){return Number(f)}toString(f){return f.substring(1,f.length-1).replace(/""/g,'"')}toBoolean(f){return f==="TRUE"}toError(f){return new t(f.toUpperCase())}isFormulaError(f){return f instanceof t}}return wn=d,wn}var _n,Jr;function bs(){if(Jr)return _n;Jr=1;const t=Rt(),{FormulaHelpers:n}=At(),{Parser:e}=Qi(),r=nr(),i=Ws(),{formatChevrotainError:E}=Zi();class o{constructor(a){this.data=[],this.utils=new i(this),a=Object.assign({onVariable:()=>null},a),this.utils=new i(this),this.onVariable=a.onVariable,this.functions={},this.parser=new e(this,this.utils)}getCell(a){return a.row!=null&&(a.sheet==null&&(a.sheet=this.position?this.position.sheet:void 0),this.data.findIndex(h=>h.from&&h.from.row<=a.row&&h.to.row>=a.row&&h.from.col<=a.col&&h.to.col>=a.col||h.row===a.row&&h.col===a.col&&h.sheet===a.sheet)===-1&&this.data.push(a)),0}getRange(a){return a.from.row!=null&&(a.sheet==null&&(a.sheet=this.position?this.position.sheet:void 0),this.data.findIndex(h=>h.from&&h.from.row===a.from.row&&h.from.col===a.from.col&&h.to.row===a.to.row&&h.to.col===a.to.col)===-1&&this.data.push(a)),[[0]]}getVariable(a){const u={ref:this.onVariable(a,this.position.sheet)};return u.ref==null?t.NAME:(n.isCellRef(u)?this.getCell(u.ref):this.getRange(u.ref),0)}retrieveRef(a){return n.isRangeRef(a)?this.getRange(a.ref):n.isCellRef(a)?this.getCell(a.ref):a}callFunction(a,u){return u.forEach(h=>{h!=null&&this.retrieveRef(h)}),{value:0,ref:{}}}checkFormulaResult(a){this.retrieveRef(a)}parse(a,u,h=!1){if(a.length===0)throw Error("Input must not be empty.");this.data=[],this.position=u;const d=r.lex(a);this.parser.input=d.tokens;try{const s=this.parser.formulaWithBinaryOp();this.checkFormulaResult(s)}catch(s){if(!h)throw t.ERROR(s.message,s)}if(this.parser.errors.length>0&&!h){const s=this.parser.errors[0];throw E(s,a)}return this.data}}return _n={DepParser:o},_n}var Pn,ti;function $s(){if(ti)return Pn;ti=1;const{FormulaParser:t}=Hs(),{DepParser:n}=bs(),e=ni(),r=Rt();return Object.assign(t,{MAX_ROW:1048576,MAX_COLUMN:16384,SSF:e,DepParser:n,FormulaError:r,...At()}),Pn=t,Pn}var Ji=$s();const Ys=eo(Ji),Xs=ro({__proto__:null,default:Ys},[Ji]);export{Xs as i};
|