@sheetxl/mcp 0.0.0-stage → 0.8.0-beta.14
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/LICENSE.md +11 -0
- package/README.md +72 -2
- package/agent/instructions.md +66 -0
- package/assets/2zIY9Xuml4y8NI05.js +596 -0
- package/assets/33QTHR3r6ZujxFx8.js +18 -0
- package/assets/8vRAQlvTcvMLeio0.js +1131 -0
- package/assets/9MRZ5Yc2RBgcqZSp.js +594 -0
- package/assets/9dbZwzIWefGss7is.js +52 -0
- package/assets/B-1_xSqUFCJ6jNjn.js +9109 -0
- package/assets/B-jE7tAMA559MtNt.js +37 -0
- package/assets/B5xHa5bjZu5ONrm5.js +638 -0
- package/assets/B66aeGYrHLbGpuN9.js +9137 -0
- package/assets/B6BP5l2qmeZhqVV7.js +7 -0
- package/assets/B6b9ytNrHR-ijcOa.js +30 -0
- package/assets/B9QlqO6n3MCBsvoj.js +504 -0
- package/assets/B9qiPx_BXxo1jgcx.js +2368 -0
- package/assets/B9w1dNK8pNq-Z1P3.js +142 -0
- package/assets/BDZ1FGc1zFqO1nK7.js +4036 -0
- package/assets/BFwNQZVRnbNt-gRJ.js +2260 -0
- package/assets/BMnNvUCJu35tT_aO.js +19 -0
- package/assets/BNfBq8Eic3Cl-f6A.js +184 -0
- package/assets/BOF64A2D2KKcv_fo.js +15 -0
- package/assets/BOcWUnxWSG1d5Ljc.js +447 -0
- package/assets/BW8XjynUqlfvuQUV.js +37 -0
- package/assets/BWsXOU_jh_cA8m8I.js +12 -0
- package/assets/BXC6616BWEWNZ2-D.js +63 -0
- package/assets/BYtBi8vLoB41QkV8.js +656 -0
- package/assets/B_-VPqfsse8AlCTm.js +81 -0
- package/assets/BiAEoWSl8c6jcUnS.js +28 -0
- package/assets/BkBCkgPNrFR5N9fo.js +19 -0
- package/assets/BmxgDCZk_aMDms4i.js +639 -0
- package/assets/BoTScfjgygCozDVi.js +23 -0
- package/assets/BwisWvPpXRhyIP4O.js +15 -0
- package/assets/ByziR0Anm39Bw0Bc.js +1556 -0
- package/assets/C-5LlJ5qhC7Ef0gV.js +12996 -0
- package/assets/C-CNmTrzNS-ZlQ8j.js +1760 -0
- package/assets/C1rIlmARlinuie5E.js +45 -0
- package/assets/C1w8NQeox7_92swz.js +35 -0
- package/assets/C2Rgsb69SnMOohGt.js +23 -0
- package/assets/C55MTJ_5qW94RElE.js +7514 -0
- package/assets/CBNNl8igIyeHY4St.js +780 -0
- package/assets/CDGeuGB9CBXeCIm6.js +12 -0
- package/assets/CH9M37mRwnS0t9wM.js +104 -0
- package/assets/CHHJZPAuM3OjbzF6.js +402 -0
- package/assets/CMTDUipnLiOj5pbe.js +610 -0
- package/assets/COFze3jkZDQRSij9.js +4437 -0
- package/assets/CPDkdp0yI4DwUHGZ.js +119 -0
- package/assets/CULV-2mwmqYYpAjM.js +119 -0
- package/assets/CVFTQ0OwsUt03r4o.js +146 -0
- package/assets/CXM1IYmE-TDInPwr.js +118 -0
- package/assets/CcLPa6zB5PH3OG2O.js +10289 -0
- package/assets/CdF5MxGnISAZ41oQ.js +359 -0
- package/assets/CeDqeFLuUfN8UIGx.js +17 -0
- package/assets/CfiVUfpeONJ3rf31.js +28 -0
- package/assets/Cfvhcua4c6onouhP.js +14 -0
- package/assets/CgjR_TiVOcuxg5tO.js +16 -0
- package/assets/CjwzOAnab_dpAqiG.js +144 -0
- package/assets/Cm3Q_-DDdnVHRBxr.js +351 -0
- package/assets/CpOhY88x6AgVxvTz.js +49 -0
- package/assets/CtpcYuBFU6fxsUhs.js +71 -0
- package/assets/CutEBbZl8oFbTlXZ.js +171 -0
- package/assets/CwJyw5Yxpj4PGh14.js +28 -0
- package/assets/CwdOInoJwCxXnhog.js +7 -0
- package/assets/D2_T0KSaye0ncjQa.js +6294 -0
- package/assets/D2w3KjYuONW1G1kX.js +86 -0
- package/assets/D3BAmD-1AfFtHdC6.js +242 -0
- package/assets/D81iH5MJJfq2t9FP.js +32 -0
- package/assets/D94hlZEaHtGHdN_K.js +202 -0
- package/assets/DBFXsbIHDxbMBrzV.js +319 -0
- package/assets/DCHsM8bfVisYJFTT.js +1783 -0
- package/assets/DIy1659Yv5-fD69E.js +123 -0
- package/assets/DK0VM9-qrEXBm8Ud.js +223 -0
- package/assets/DPazQ_nZv-sXUwO3.js +45 -0
- package/assets/DSSrCrejjpWoszj7.js +33 -0
- package/assets/DTlvhtB9hvPdbdxu.js +60493 -0
- package/assets/DUUt1z6Y_cpxEpYY.js +24 -0
- package/assets/DUYoUViqY5U6uQX3.js +18 -0
- package/assets/DUzaW_op2vBTwOOI.js +18 -0
- package/assets/DWTpPijG5yeNFR0W.js +14 -0
- package/assets/DZRp3_yqPS6Lshho.js +32 -0
- package/assets/DZZ5R3msiytVNCqK.js +199 -0
- package/assets/Df2IAW-O7Gwl7V1l.js +7 -0
- package/assets/Dfd7kvLIFNqu-m-r.js +51 -0
- package/assets/Dg7xy50qHwqkYd4g.js +1135 -0
- package/assets/DihigEGfNCLR8UPN.js +8 -0
- package/assets/DkFK1iu4vqjLZMja.js +3011 -0
- package/assets/DkPXpv81Y5teMd-R.js +20 -0
- package/assets/Dl87mJoXDkCkzBi7.js +3917 -0
- package/assets/DnmjS548g7nY6EUS.js +1860 -0
- package/assets/DoIU_ohoCBwTZV9G.js +310 -0
- package/assets/Doqy_uDSQTCv6a6X.js +35 -0
- package/assets/DpGuA6U12gwyGHEM.js +369 -0
- package/assets/DuZ6DXQGttY3Lrhd.js +5220 -0
- package/assets/Du_JrYiYGJo5_B9H.js +12 -0
- package/assets/DvD_K4M5HgJ4uJ8L.js +7 -0
- package/assets/EeSGsbh_r4N-qs4w.js +96 -0
- package/assets/GnXTzeDYWWeEf5yV.js +55 -0
- package/assets/HKLw8b2xTdu5c1w5.js +63 -0
- package/assets/KpCEdfpsHnfkyqjx.js +37 -0
- package/assets/OU7gC5JF-lyDOOid.js +27 -0
- package/assets/PRSerWiAGYu8MVnd.js +304 -0
- package/assets/PmooYGqWqoTxPExF.js +449 -0
- package/assets/QXKcNTuZqOauSidr.js +58 -0
- package/assets/ThqyayHHaBxzfaAt.js +255 -0
- package/assets/TzsPqmpG77I4ewVt.js +173 -0
- package/assets/UX2ywz3gr7q-MlHr.js +105 -0
- package/assets/W-MzzQHZuRxr8adc.js +2346 -0
- package/assets/ZBYHyJs7CQgnnHfR.js +362 -0
- package/assets/ZTEO4JX22YIOkrJg.js +8338 -0
- package/assets/a7BoASyT8yQZY9hJ.js +22 -0
- package/assets/aqguaobnu61szXWM.js +22 -0
- package/assets/cdIvC9t9tYtVn4nc.js +405 -0
- package/assets/cv7k-VAIJtYeL9k4.js +23 -0
- package/assets/ddJqSu7gXUkXjGxZ.js +13 -0
- package/assets/eHAVGCUcMAfNjEGt.js +7 -0
- package/assets/hRLLK6I6m0uGKWo8.js +32 -0
- package/assets/mcFLzsOH35mvmd3C.js +145 -0
- package/assets/st-UQngeBG4hwKoy.js +47 -0
- package/assets/w8YWSMNTTn45ImnB.js +857 -0
- package/assets/yNiBIhsMP9BCWd67.js +28 -0
- package/assets/zu-72oKE_gCkrozc.js +540 -0
- package/index.js +8070 -0
- package/lib.js +7 -0
- package/licenses/dependencies.txt +1552 -0
- package/package.json +44 -3
- package/resources/contents.json +333 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-italic.hinted.json +124 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-regular.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-display-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/aptos-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/aptos-regular.metrics.json +221 -0
- package/resources/fonts/@sheetxl/sdk/aptos-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold-italic.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-italic.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/arial-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/arial-regular.metrics.json +139 -0
- package/resources/fonts/@sheetxl/sdk/arial-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.hinted.json +122 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold.hinted.json +122 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-italic.hinted.json +121 -0
- package/resources/fonts/@sheetxl/sdk/calibri-italic.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/calibri-regular.hinted.json +121 -0
- package/resources/fonts/@sheetxl/sdk/calibri-regular.metrics.json +137 -0
- package/resources/fonts/@sheetxl/sdk/calibri-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.hinted.json +105 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold.hinted.json +108 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-italic.hinted.json +102 -0
- package/resources/fonts/@sheetxl/sdk/cambria-italic.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/cambria-regular.hinted.json +110 -0
- package/resources/fonts/@sheetxl/sdk/cambria-regular.metrics.json +66 -0
- package/resources/fonts/@sheetxl/sdk/cambria-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/contents.json +646 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-italic.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-italic.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-regular.hinted.json +11 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-regular.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/courier-new-regular.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.metrics.json +141 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.metrics.json +141 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-bold.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.metrics.json +143 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-italic.rows.json +8 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.hinted.json +125 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.metrics.json +141 -0
- package/resources/fonts/@sheetxl/sdk/times-new-roman-regular.rows.json +8 -0
- package/resources/locales/@sheetxl/formulas/contents.json +9 -0
- package/resources/locales/@sheetxl/formulas/de/functions.json +298 -0
- package/resources/locales/@sheetxl/formulas-extended/contents.json +9 -0
- package/resources/locales/@sheetxl/formulas-extended/de/functions.json +59 -0
- package/resources/locales/@sheetxl/sdk/contents.json +19 -0
- package/resources/locales/@sheetxl/sdk/de/grammar.json +16 -0
- package/resources/locales/@sheetxl/sdk/de/model.msg.json +710 -0
- package/resources/locales/@sheetxl/sdk/en/model.msg.json +732 -0
- package/screenshot-page/assets/-cpi3yOZYn6GsYN4.js +9 -0
- package/screenshot-page/assets/-i_fTASJeu9NdNH_.js +7 -0
- package/screenshot-page/assets/04d8koPx6lzeMYRQ.js +39 -0
- package/screenshot-page/assets/0MTaPYjKud2Q9QG9.js +1 -0
- package/screenshot-page/assets/21oAESJyBGXeHegm.js +2 -0
- package/screenshot-page/assets/3Ls_kOvlQseMV8Q0.js +1 -0
- package/screenshot-page/assets/4qZpl2QCzneWdmJO.js +1 -0
- package/screenshot-page/assets/6IEV7KeOEbBdrthj.js +1 -0
- package/screenshot-page/assets/8QrkTrKHDnMBb7q4.js +1 -0
- package/screenshot-page/assets/9w0ECZmzGUyk3F_O.js +1 -0
- package/screenshot-page/assets/AjS2PipZDIH3BXB2.js +1 -0
- package/screenshot-page/assets/B-KIwD5F_5S-NsPg.js +1 -0
- package/screenshot-page/assets/B-sAzW5ROrhvMGM4.js +1 -0
- package/screenshot-page/assets/B0FQypGas6gbGT_U.js +1 -0
- package/screenshot-page/assets/B2IQMVqTZT1rUnib.js +1 -0
- package/screenshot-page/assets/B2g3jiFIQ4Qjh5gG.js +1 -0
- package/screenshot-page/assets/B4PbXdzBe9BsoZ0e.js +2 -0
- package/screenshot-page/assets/B5GO9v4p9L70Xb9i.js +1 -0
- package/screenshot-page/assets/B8y_eLNCGnXLEIaE.js +1 -0
- package/screenshot-page/assets/BCl5buf87xUgIfEB.js +2 -0
- package/screenshot-page/assets/BEuMvXYIa9A1JacY.js +1 -0
- package/screenshot-page/assets/BEwl-ucV9Jfr0RoC.js +1 -0
- package/screenshot-page/assets/BFaiQZKle44Rhyou.js +1 -0
- package/screenshot-page/assets/BHqg55S-4_OoAu3P.js +2 -0
- package/screenshot-page/assets/BNgLvS2bLOYKRguv.js +1 -0
- package/screenshot-page/assets/BQAN82ftWBiLJT3r.js +1 -0
- package/screenshot-page/assets/BQfe-XTIOGeUnD9B.js +1 -0
- package/screenshot-page/assets/BQnELVV0uR4T4ItQ.js +1 -0
- package/screenshot-page/assets/BRVZJ0OGJg9XJro6.js +1 -0
- package/screenshot-page/assets/BRqSWCr2mTVNFquQ.js +1 -0
- package/screenshot-page/assets/BTOQaSn9DDyJPUlX.js +1 -0
- package/screenshot-page/assets/BUGXf2DEBog16Slb.js +2 -0
- package/screenshot-page/assets/BUjI304IvdJnFXH3.js +1 -0
- package/screenshot-page/assets/BYRwTzX1q407lHUS.js +2 -0
- package/screenshot-page/assets/Baz0SC2AgGyxMX72.js +1 -0
- package/screenshot-page/assets/BbP9KThfrodyosvn.js +1 -0
- package/screenshot-page/assets/BcOdl17EeFSxnAiq.js +1 -0
- package/screenshot-page/assets/BclKeOKIOBjijhsu.js +1 -0
- package/screenshot-page/assets/Bf7xq8PyF4ohjMzP.js +2 -0
- package/screenshot-page/assets/BimyzECCZl-NESff.js +1 -0
- package/screenshot-page/assets/BkLH7JH3A93TXFJi.js +1 -0
- package/screenshot-page/assets/BksaQEoZr5OWq-_d.js +3 -0
- package/screenshot-page/assets/Bor_tayB4yBfNOH5.js +2 -0
- package/screenshot-page/assets/BowRIybLgENunTOT.js +1 -0
- package/screenshot-page/assets/Bp7se0JaDGrzfSA_.js +1 -0
- package/screenshot-page/assets/Bwql3QifB2cv7Mqp.js +3 -0
- package/screenshot-page/assets/Bx61vmiWY0Xvx9qs.js +1 -0
- package/screenshot-page/assets/ByY3fmwyDPAyOLdo.js +1 -0
- package/screenshot-page/assets/Bz2U7weS0spa8Xbh.js +1 -0
- package/screenshot-page/assets/Bz5V1tmiy5gbT9ys.js +1 -0
- package/screenshot-page/assets/Bz9v1lgjvbu4QnOs.js +2 -0
- package/screenshot-page/assets/C1k_VrZqlpiUigCP.js +1 -0
- package/screenshot-page/assets/C2Wh2h27c7FUb8Yk.js +1 -0
- package/screenshot-page/assets/C6oLDVnuCS9LGkkH.js +1 -0
- package/screenshot-page/assets/C81mK8aZKZAAS-AB.js +1 -0
- package/screenshot-page/assets/C9SC-cEIt6gdhZRw.js +1 -0
- package/screenshot-page/assets/CE0MnsfMjqV2ICzk.js +57 -0
- package/screenshot-page/assets/CE8MCCIiwjOVwBBW.js +1 -0
- package/screenshot-page/assets/CFOaI8g7pJuPzsyk.js +1 -0
- package/screenshot-page/assets/CG3ynup87FmG-kkX.js +1 -0
- package/screenshot-page/assets/CHlWgOAlcRCjVuhg.js +1 -0
- package/screenshot-page/assets/CIged53b3hHKxa-o.js +1 -0
- package/screenshot-page/assets/CNQczIR5xcE5u5fT.js +1 -0
- package/screenshot-page/assets/CSUd8n1H0VBfREnk.js +2 -0
- package/screenshot-page/assets/CSlBTkRDITCC8JRB.js +1 -0
- package/screenshot-page/assets/CV2jr9hpQOG2OG0C.js +1 -0
- package/screenshot-page/assets/CXGgKVbVXjWzE0p6.js +1 -0
- package/screenshot-page/assets/CXKCmZ_TRyGaB9Ob.js +1 -0
- package/screenshot-page/assets/CXUO3vYip3JPSJ7A.js +1 -0
- package/screenshot-page/assets/CXwbGzavyvYgDbWU.js +1 -0
- package/screenshot-page/assets/CZf9s6otzzoaBlSs.js +1 -0
- package/screenshot-page/assets/CZvwQEeVhBilgKLG.js +1 -0
- package/screenshot-page/assets/Ca6nxdhEuLLty3d7.js +2 -0
- package/screenshot-page/assets/CbUDukmvDZmVfhJH.js +1 -0
- package/screenshot-page/assets/CbXtAM7H-Jg_J0dk.js +1 -0
- package/screenshot-page/assets/CctIRGMFmARVi2KT.js +1 -0
- package/screenshot-page/assets/Cenh1POxiGMxIQlv.js +1 -0
- package/screenshot-page/assets/ChSvXfVMLxZsP9zG.js +8 -0
- package/screenshot-page/assets/Ci5NtzhJLll1kxGf.js +10 -0
- package/screenshot-page/assets/CjngjJNheGaVRvZp.js +1 -0
- package/screenshot-page/assets/ClzdIJrFdInttVJA.js +1 -0
- package/screenshot-page/assets/CnPgk3HcIziOcskY.js +10 -0
- package/screenshot-page/assets/CnXLpFE_vFrJ5Jbf.js +1 -0
- package/screenshot-page/assets/CnZJ44ncMxZ4ivcB.js +586 -0
- package/screenshot-page/assets/CpbohdgEaEsVDi9J.js +1 -0
- package/screenshot-page/assets/CqR3hGrC956TkCMj.js +20 -0
- package/screenshot-page/assets/Cr1tQKUBVKOQl3QC.js +1 -0
- package/screenshot-page/assets/Cv8FG9PPBkkPw86e.js +1 -0
- package/screenshot-page/assets/CvL9XK3Ht1mP-rGz.js +4 -0
- package/screenshot-page/assets/CykecBozGGFl26KA.js +3940 -0
- package/screenshot-page/assets/CzTizxHhb-CI_ajE.js +1 -0
- package/screenshot-page/assets/CzzEl3lAkZopkwhC.js +1 -0
- package/screenshot-page/assets/D-LgRj0s-PAVqY-L.js +1 -0
- package/screenshot-page/assets/D-XR1MGhwn7Jqj60.js +1 -0
- package/screenshot-page/assets/D47ePD4x1lVazNdl.js +7 -0
- package/screenshot-page/assets/D6Jpaz2YkhOfzxDB.js +1 -0
- package/screenshot-page/assets/D9zCVZpnJBfNSNO2.js +1 -0
- package/screenshot-page/assets/DDQWM8rNYCYzKa9R.js +1 -0
- package/screenshot-page/assets/DDpAoGAPzo1c4vl5.js +27 -0
- package/screenshot-page/assets/DGXDfjkGZjMRAXPg.js +5 -0
- package/screenshot-page/assets/DHa5_U58lSwCnpmG.js +1 -0
- package/screenshot-page/assets/DKVB6ddRfDJatYid.js +1 -0
- package/screenshot-page/assets/DM9U7u7FQK0jcwh4.js +1 -0
- package/screenshot-page/assets/DNDaHmkQrQTaCHhV.js +1 -0
- package/screenshot-page/assets/DQ0kGd99-fXxuNYk.js +1 -0
- package/screenshot-page/assets/DQWHkaQeNXft9j8b.js +2 -0
- package/screenshot-page/assets/DRVfGdmVBvktrZ1t.js +1 -0
- package/screenshot-page/assets/DRrM-dY9nM7nDRpV.js +1 -0
- package/screenshot-page/assets/DT2x1gO3f2G5NfeB.js +1 -0
- package/screenshot-page/assets/DU3FmyUH0RjPIBd-.js +1 -0
- package/screenshot-page/assets/DUJzubL4qqOyizfu.js +1 -0
- package/screenshot-page/assets/DVueE--eOrZPrqrm.js +1 -0
- package/screenshot-page/assets/DWiI5I3RtoKvVT66.js +1 -0
- package/screenshot-page/assets/DYJSIlNxrNw8qk-w.js +1 -0
- package/screenshot-page/assets/DYRbCudWTaiE_Sjc.js +1 -0
- package/screenshot-page/assets/DZDRRw-62D6Zw7qs.js +1 -0
- package/screenshot-page/assets/D_H2dlsQ8PJ0r1WD.js +10 -0
- package/screenshot-page/assets/DaKZ4-Li_ULIIwnK.js +1 -0
- package/screenshot-page/assets/DadZXeaVK5UXSHIi.js +1 -0
- package/screenshot-page/assets/Db_VGqQo2G2JgXWW.js +1 -0
- package/screenshot-page/assets/DceNHPrRLok2At-X.js +1 -0
- package/screenshot-page/assets/DcrVJCyDwGKeil2U.js +1 -0
- package/screenshot-page/assets/DeAKjatTVaZ0u_FY.js +1 -0
- package/screenshot-page/assets/DmMZ4pd492HPw_3_.js +1 -0
- package/screenshot-page/assets/DmbuCapSSCYIa3yk.js +1 -0
- package/screenshot-page/assets/Dpepompn_NhpSncR.js +1 -0
- package/screenshot-page/assets/DqM1wwsmN1J4MXMm.js +1 -0
- package/screenshot-page/assets/DqYhS4mcQfOe96hU.js +1 -0
- package/screenshot-page/assets/DsL71n5SxCVjL6Ho.js +2 -0
- package/screenshot-page/assets/DyGpT6t96jrvgJes.js +1 -0
- package/screenshot-page/assets/DyLWQxXXTw5uwPVy.js +30 -0
- package/screenshot-page/assets/DyYVf8O1rhg3YmjW.js +1 -0
- package/screenshot-page/assets/DyxJBLjUkeDuu96F.js +1 -0
- package/screenshot-page/assets/DzZRUd0p22CBa27b.js +1 -0
- package/screenshot-page/assets/HclGiUj8dZXDFmoM.js +1 -0
- package/screenshot-page/assets/IRtoU5oVgBWu9rnK.js +2 -0
- package/screenshot-page/assets/IfF7Tv-nhz6Ikpn0.js +1 -0
- package/screenshot-page/assets/J73KTOmdZGNmnq-z.js +1 -0
- package/screenshot-page/assets/J_xJVgE7YlmeU-ZO.js +6 -0
- package/screenshot-page/assets/KoxRo2J_cwB_yOd5.js +2 -0
- package/screenshot-page/assets/LVtV_IPhPQroHRui.js +1 -0
- package/screenshot-page/assets/MNoPOsydrUv1UGU8.js +2 -0
- package/screenshot-page/assets/Miyn0clMq0rovRIo.js +1 -0
- package/screenshot-page/assets/Rm5Sf5E6t8bk_Y3r.js +1 -0
- package/screenshot-page/assets/b3AbgxQkoaCiBi15.js +1 -0
- package/screenshot-page/assets/fGlPAximvsxzPzGA.js +1 -0
- package/screenshot-page/assets/gG0AFZ45VxS_moMw.js +2 -0
- package/screenshot-page/assets/nHThFXCAZFOM_npq.js +1 -0
- package/screenshot-page/assets/pRykm05ElquZBk_a.js +1 -0
- package/screenshot-page/assets/qm3VY0bH7F7EgSdi.js +2 -0
- package/screenshot-page/assets/rPOkVKdPbFpTG6AY.js +1 -0
- package/screenshot-page/assets/w3bV7wggRayUYTd-.js +1 -0
- package/screenshot-page/assets/zFbb8ESzwR_bE7IQ.js +1 -0
- package/screenshot-page/assets/zHHZFbk5RXnrxbOc.js +42 -0
- package/screenshot-page/index.html +44 -0
- package/screenshot-page/resources/contents.json +333 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.hinted.json +124 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-display-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-narrow-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.metrics.json +221 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/aptos-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.metrics.json +139 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/arial-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.hinted.json +122 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.hinted.json +122 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.hinted.json +121 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.hinted.json +121 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.metrics.json +137 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/calibri-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.hinted.json +105 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.hinted.json +108 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.hinted.json +102 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.hinted.json +110 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.metrics.json +66 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/cambria-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/contents.json +646 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.hinted.json +11 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/courier-new-regular.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.metrics.json +141 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.metrics.json +141 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-bold.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.metrics.json +143 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-italic.rows.json +8 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.hinted.json +125 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.metrics.json +141 -0
- package/screenshot-page/resources/fonts/@sheetxl/sdk/times-new-roman-regular.rows.json +8 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas/contents.json +9 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas/de/functions.json +298 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas-extended/contents.json +9 -0
- package/screenshot-page/resources/locales/@sheetxl/formulas-extended/de/functions.json +59 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/contents.json +19 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/grammar.json +16 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/de/model.msg.json +710 -0
- package/screenshot-page/resources/locales/@sheetxl/sdk/en/model.msg.json +732 -0
- package/types/index.d.ts +1 -0
- package/types/lib.d.ts +2 -0
- package/types/scripting-api.json +10855 -0
- package/types/scripting-enums.json +1339 -0
- package/types/scripting.d.ts +49295 -0
- package/types/src/SessionRegistry.d.ts +630 -0
- package/types/src/index.d.ts +3 -0
- package/types/src/instances.d.ts +104 -0
- package/types/src/lib/Types.d.ts +17 -0
- package/types/src/lib/index.d.ts +2 -0
- package/types/src/lib/runReport.d.ts +158 -0
- package/types/src/lib.d.ts +2 -0
- package/types/src/prepareRun.d.ts +56 -0
- package/types/src/relay.d.ts +102 -0
- package/types/src/screenshot.d.ts +23 -0
- package/types/src/server.d.ts +37 -0
- package/types/src/taskStore.d.ts +28 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{i as e}from"./BcOdl17EeFSxnAiq.js";import{$r as t,Ai as n,Dt as r,En as i,Fi as a,Ir as o,It as s,Mr as c,P as l,Ti as u,Xt as d,Y as f,Zn as p,_i as m,a as h,cr as g,f as _,g as v,gt as y,hr as b,it as x,jt as S,m as C,mn as ee,nr as w,on as T,qn as te,qr as E,wt as ne,zi as D}from"./CnZJ44ncMxZ4ivcB.js";function O(e){console&&console.error&&console.error(`Error: ${e}`)}function k(e){console&&console.warn&&console.warn(`Warning: ${e}`)}function re(e){let t=new Date().getTime(),n=e();return{time:new Date().getTime()-t,value:n}}function ie(e){function t(){}t.prototype=e;let n=new t;function r(){return typeof n.bar}return r(),r(),e}var A=class{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),this.definition.forEach(t=>{t.accept(e)})}},j=class extends A{constructor(e){super([]),this.idx=1,Object.assign(this,V(e))}set definition(e){}get definition(){return this.referencedRule===void 0?[]:this.referencedRule.definition}accept(e){e.visit(this)}},M=class extends A{constructor(e){super(e.definition),this.orgText=``,Object.assign(this,V(e))}},N=class extends A{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,Object.assign(this,V(e))}},P=class extends A{constructor(e){super(e.definition),this.idx=1,Object.assign(this,V(e))}},F=class extends A{constructor(e){super(e.definition),this.idx=1,Object.assign(this,V(e))}},I=class extends A{constructor(e){super(e.definition),this.idx=1,Object.assign(this,V(e))}},L=class extends A{constructor(e){super(e.definition),this.idx=1,Object.assign(this,V(e))}},R=class extends A{constructor(e){super(e.definition),this.idx=1,Object.assign(this,V(e))}},z=class extends A{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,Object.assign(this,V(e))}},B=class{constructor(e){this.idx=1,Object.assign(this,V(e))}accept(e){e.visit(this)}};function ae(e){function t(e){return e.map(ae)}if(e instanceof j){let t={type:`NonTerminal`,name:e.nonTerminalName,idx:e.idx};return typeof e.label==`string`&&(t.label=e.label),t}if(e instanceof N)return{type:`Alternative`,definition:t(e.definition)};if(e instanceof P)return{type:`Option`,idx:e.idx,definition:t(e.definition)};if(e instanceof F)return{type:`RepetitionMandatory`,idx:e.idx,definition:t(e.definition)};if(e instanceof I)return{type:`RepetitionMandatoryWithSeparator`,idx:e.idx,separator:ae(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof R)return{type:`RepetitionWithSeparator`,idx:e.idx,separator:ae(new B({terminalType:e.separator})),definition:t(e.definition)};if(e instanceof L)return{type:`Repetition`,idx:e.idx,definition:t(e.definition)};if(e instanceof z)return{type:`Alternation`,idx:e.idx,definition:t(e.definition)};if(e instanceof B){let t={type:`Terminal`,name:e.terminalType.name,label:(n=e.terminalType,typeof(r=n).LABEL==`string`&&r.LABEL!==``?n.LABEL:n.name),idx:e.idx};typeof e.label==`string`&&(t.terminalLabel=e.label);let i=e.terminalType.PATTERN;return e.terminalType.PATTERN&&(t.pattern=i instanceof RegExp?i.source:i),t}if(e instanceof M)return{type:`Rule`,name:e.name,orgText:e.orgText,definition:t(e.definition)};throw Error(`non exhaustive match`);var n,r}function V(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}var oe=class{visit(e){let t=e;switch(t.constructor){case j:return this.visitNonTerminal(t);case N:return this.visitAlternative(t);case P:return this.visitOption(t);case F:return this.visitRepetitionMandatory(t);case I:return this.visitRepetitionMandatoryWithSeparator(t);case R:return this.visitRepetitionWithSeparator(t);case L:return this.visitRepetition(t);case z:return this.visitAlternation(t);case B:return this.visitTerminal(t);case M:return this.visitRule(t);default:throw Error(`non exhaustive match`)}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}};function se(e,t=[]){return e instanceof P||e instanceof L||e instanceof R||(e instanceof z?e.definition.some(e=>se(e,t)):!(e instanceof j&&t.includes(e))&&e instanceof A&&(e instanceof j&&t.push(e),e.definition.every(e=>se(e,t))))}function H(e){if(e instanceof j)return`SUBRULE`;if(e instanceof P)return`OPTION`;if(e instanceof z)return`OR`;if(e instanceof F)return`AT_LEAST_ONE`;if(e instanceof I)return`AT_LEAST_ONE_SEP`;if(e instanceof R)return`MANY_SEP`;if(e instanceof L)return`MANY`;if(e instanceof B)return`CONSUME`;throw Error(`non exhaustive match`)}var ce=class{walk(e,t=[]){e.definition.forEach((n,r)=>{let i=e.definition.slice(r+1);if(n instanceof j)this.walkProdRef(n,i,t);else if(n instanceof B)this.walkTerminal(n,i,t);else if(n instanceof N)this.walkFlat(n,i,t);else if(n instanceof P)this.walkOption(n,i,t);else if(n instanceof F)this.walkAtLeastOne(n,i,t);else if(n instanceof I)this.walkAtLeastOneSep(n,i,t);else if(n instanceof R)this.walkManySep(n,i,t);else if(n instanceof L)this.walkMany(n,i,t);else{if(!(n instanceof z))throw Error(`non exhaustive match`);this.walkOr(n,i,t)}})}walkTerminal(e,t,n){}walkProdRef(e,t,n){}walkFlat(e,t,n){let r=t.concat(n);this.walk(e,r)}walkOption(e,t,n){let r=t.concat(n);this.walk(e,r)}walkAtLeastOne(e,t,n){let r=[new P({definition:e.definition})].concat(t,n);this.walk(e,r)}walkAtLeastOneSep(e,t,n){let r=le(e,t,n);this.walk(e,r)}walkMany(e,t,n){let r=[new P({definition:e.definition})].concat(t,n);this.walk(e,r)}walkManySep(e,t,n){let r=le(e,t,n);this.walk(e,r)}walkOr(e,t,n){let r=t.concat(n);e.definition.forEach(e=>{let t=new N({definition:[e]});this.walk(t,r)})}};function le(e,t,n){return[new P({definition:[new B({terminalType:e.separator})].concat(e.definition)})].concat(t,n)}function ue(e){if(e instanceof j)return ue(e.referencedRule);if(e instanceof B)return[e.terminalType];if(function(e){return e instanceof N||e instanceof P||e instanceof L||e instanceof F||e instanceof I||e instanceof R||e instanceof B||e instanceof M}(e))return function(e){let t=[],n=e.definition,r,i=0,a=n.length>i,o=!0;for(;a&&o;)r=n[i],o=se(r),t=t.concat(ue(r)),i+=1,a=n.length>i;return[...new Set(t)]}(e);if(function(e){return e instanceof z}(e))return function(e){let t=e.definition.map(e=>ue(e));return[...new Set(t.flat())]}(e);throw Error(`non exhaustive match`)}var de=`_~IN~_`,fe=class extends ce{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,t,n){}walkProdRef(e,t,n){let r=(i=e.referencedRule,a=e.idx,i.name+a+de+this.topProd.name);var i,a;let o=ue(new N({definition:t.concat(n)}));this.follows[r]=o}};function U(e){return e.charCodeAt(0)}function pe(e,t){Array.isArray(e)?e.forEach(function(e){t.push(e)}):t.push(e)}function W(e,t){if(!0===e[t])throw`duplicate flag `+t;e[t],e[t]=!0}function G(e){if(e===void 0)throw Error(`Internal Error - Should never get here!`);return!0}function me(){throw Error(`Internal Error - Should never get here!`)}function he(e){return e.type===`Character`}var ge=[];for(let e=U(`0`);e<=U(`9`);e++)ge.push(e);var _e=[U(`_`)].concat(ge);for(let e=U(`a`);e<=U(`z`);e++)_e.push(e);for(let e=U(`A`);e<=U(`Z`);e++)_e.push(e);var ve=[U(` `),U(`\f`),U(`
|
|
2
|
+
`),U(`\r`),U(` `),U(`\v`),U(` `),U(`\xA0`),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(` `),U(`\u2028`),U(`\u2029`),U(` `),U(` `),U(` `),U(``)],ye=/[0-9a-fA-F]/,be=/[0-9]/,xe=/[1-9]/,Se=class{visitChildren(e){for(let t in e){let n=e[t];e.hasOwnProperty(t)&&(n.type===void 0?Array.isArray(n)&&n.forEach(e=>{this.visit(e)},this):this.visit(n))}}visit(e){switch(e.type){case`Pattern`:this.visitPattern(e);break;case`Flags`:this.visitFlags(e);break;case`Disjunction`:this.visitDisjunction(e);break;case`Alternative`:this.visitAlternative(e);break;case`StartAnchor`:this.visitStartAnchor(e);break;case`EndAnchor`:this.visitEndAnchor(e);break;case`WordBoundary`:this.visitWordBoundary(e);break;case`NonWordBoundary`:this.visitNonWordBoundary(e);break;case`Lookahead`:this.visitLookahead(e);break;case`NegativeLookahead`:this.visitNegativeLookahead(e);break;case`Lookbehind`:this.visitLookbehind(e);break;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);break;case`Character`:this.visitCharacter(e);break;case`Set`:this.visitSet(e);break;case`Group`:this.visitGroup(e);break;case`GroupBackReference`:this.visitGroupBackReference(e);break;case`Quantifier`:this.visitQuantifier(e)}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitLookbehind(e){}visitNegativeLookbehind(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}},Ce={},we=new class{constructor(){this.idx=0,this.input=``,this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar(`/`);let t=this.disjunction();this.consumeChar(`/`);let n={type:`Flags`,loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case`g`:W(n,`global`);break;case`i`:W(n,`ignoreCase`);break;case`m`:W(n,`multiLine`);break;case`u`:W(n,`unicode`);break;case`y`:W(n,`sticky`)}if(this.idx!==this.input.length)throw Error(`Redundant input: `+this.input.substring(this.idx));return{type:`Pattern`,flags:n,value:t,loc:this.loc(0)}}disjunction(){let e=[],t=this.idx;for(e.push(this.alternative());this.peekChar()===`|`;)this.consumeChar(`|`),e.push(this.alternative());return{type:`Disjunction`,value:e,loc:this.loc(t)}}alternative(){let e=[],t=this.idx;for(;this.isTerm();)e.push(this.term());return{type:`Alternative`,value:e,loc:this.loc(t)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){let e=this.idx;switch(this.popChar()){case`^`:return{type:`StartAnchor`,loc:this.loc(e)};case`$`:return{type:`EndAnchor`,loc:this.loc(e)};case`\\`:switch(this.popChar()){case`b`:return{type:`WordBoundary`,loc:this.loc(e)};case`B`:return{type:`NonWordBoundary`,loc:this.loc(e)}}throw Error(`Invalid Assertion Escape`);case`(`:let t;switch(this.consumeChar(`?`),this.popChar()){case`=`:t=`Lookahead`;break;case`!`:t=`NegativeLookahead`;break;case`<`:switch(this.popChar()){case`=`:t=`Lookbehind`;break;case`!`:t=`NegativeLookbehind`}}G(t);let n=this.disjunction();return this.consumeChar(`)`),{type:t,value:n,loc:this.loc(e)}}return me()}quantifier(e=!1){let t,n=this.idx;switch(this.popChar()){case`*`:t={atLeast:0,atMost:1/0};break;case`+`:t={atLeast:1,atMost:1/0};break;case`?`:t={atLeast:0,atMost:1};break;case`{`:let n=this.integerIncludingZero();switch(this.popChar()){case`}`:t={atLeast:n,atMost:n};break;case`,`:let e;this.isDigit()?(e=this.integerIncludingZero(),t={atLeast:n,atMost:e}):t={atLeast:n,atMost:1/0},this.consumeChar(`}`)}if(!0===e&&t===void 0)return;G(t)}if(!0!==e||t!==void 0)return G(t)?(this.peekChar(0)===`?`?(this.consumeChar(`?`),t.greedy=!1):t.greedy=!0,t.type=`Quantifier`,t.loc=this.loc(n),t):void 0}atom(){let e,t=this.idx;switch(this.peekChar()){case`.`:e=this.dotAll();break;case`\\`:e=this.atomEscape();break;case`[`:e=this.characterClass();break;case`(`:e=this.group()}return e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),G(e)?(e.loc=this.loc(t),this.isQuantifier()&&(e.quantifier=this.quantifier()),e):me()}dotAll(){return this.consumeChar(`.`),{type:`Set`,complement:!0,value:[U(`
|
|
3
|
+
`),U(`\r`),U(`\u2028`),U(`\u2029`)]}}atomEscape(){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()}}decimalEscapeAtom(){return{type:`GroupBackReference`,value:this.positiveInteger()}}characterClassEscape(){let e,t=!1;switch(this.popChar()){case`d`:e=ge;break;case`D`:e=ge,t=!0;break;case`s`:e=ve;break;case`S`:e=ve,t=!0;break;case`w`:e=_e;break;case`W`:e=_e,t=!0}return G(e)?{type:`Set`,value:e,complement:t}:me()}controlEscapeAtom(){let e;switch(this.popChar()){case`f`:e=U(`\f`);break;case`n`:e=U(`
|
|
4
|
+
`);break;case`r`:e=U(`\r`);break;case`t`:e=U(` `);break;case`v`:e=U(`\v`)}return G(e)?{type:`Character`,value:e}:me()}controlLetterEscapeAtom(){this.consumeChar(`c`);let e=this.popChar();if(!1===/[a-zA-Z]/.test(e))throw Error(`Invalid `);return{type:`Character`,value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar(`0`),{type:`Character`,value:U(`\0`)}}hexEscapeSequenceAtom(){return this.consumeChar(`x`),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar(`u`),this.parseHexDigits(4)}identityEscapeAtom(){return{type:`Character`,value:U(this.popChar())}}classPatternCharacterAtom(){switch(this.peekChar()){case`
|
|
5
|
+
`:case`\r`:case`\u2028`:case`\u2029`:case`\\`:case`]`:throw Error(`TBD`);default:return{type:`Character`,value:U(this.popChar())}}}characterClass(){let e=[],t=!1;for(this.consumeChar(`[`),this.peekChar(0)===`^`&&(this.consumeChar(`^`),t=!0);this.isClassAtom();){let t=this.classAtom();if(t.type,he(t)&&this.isRangeDash()){this.consumeChar(`-`);let n=this.classAtom();if(n.type,he(n)){if(n.value<t.value)throw Error(`Range out of order in character class`);e.push({from:t.value,to:n.value})}else pe(t.value,e),e.push(U(`-`)),pe(n.value,e)}else pe(t.value,e)}return this.consumeChar(`]`),{type:`Set`,complement:t,value:e}}classAtom(){switch(this.peekChar()){case`]`:case`
|
|
6
|
+
`:case`\r`:case`\u2028`:case`\u2029`:throw Error(`TBD`);case`\\`:return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar(`\\`),this.peekChar()){case`b`:return this.consumeChar(`b`),{type:`Character`,value:U(`\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()}}group(){let e=!0;this.consumeChar(`(`),this.peekChar(0)===`?`?(this.consumeChar(`?`),this.consumeChar(`:`),e=!1):this.groupIdx++;let t=this.disjunction();this.consumeChar(`)`);let n={type:`Group`,capturing:e,value:t};return e&&(n.idx=this.groupIdx),n}positiveInteger(){let e=this.popChar();if(!1===xe.test(e))throw Error(`Expecting a positive integer`);for(;be.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(!1===be.test(e))throw Error(`Expecting an integer`);for(;be.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){let e=this.popChar();switch(e){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:U(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case`g`:case`i`:case`m`:case`u`:case`y`:return!0;default:return!1}}isRangeDash(){return this.peekChar()===`-`&&this.isClassAtom(1)}isDigit(){return be.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case`]`:case`
|
|
8
|
+
`:case`\r`:case`\u2028`:case`\u2029`:return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case`.`:case`\\`:case`[`:case`(`:return!0;default:return!1}}isAssertion(){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)===`!`||this.peekChar(2)===`<`&&(this.peekChar(3)===`=`||this.peekChar(3)===`!`));default:return!1}}isQuantifier(){let e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){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}}parseHexDigits(e){let t=``;for(let n=0;n<e;n++){let e=this.popChar();if(!1===ye.test(e))throw Error(`Expecting a HexDecimal digits`);t+=e}return{type:`Character`,value:parseInt(t,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){let e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error(`Expected: '`+e+`' but found: '`+this.input[this.idx]+`' at offset: `+this.idx);if(this.idx>=this.input.length)throw Error(`Unexpected end of input`);this.idx++}loc(e){return{begin:e,end:this.idx}}};function Te(e){let t=e.toString();if(Ce.hasOwnProperty(t))return Ce[t];{let e=we.pattern(t);return Ce[t]=e,e}}var Ee=`Complement Sets are not supported for first char optimization`,De=`Unable to use "first char" lexer optimizations:
|
|
10
|
+
`;function Oe(e,t=!1){try{let t=Te(e);return ke(t.value,{},t.flags.ignoreCase)}catch(n){if(n.message===Ee)t&&k(`${De}\tUnable to optimize: < ${e.toString()} >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let n=``;t&&(n=`
|
|
11
|
+
This will disable the lexer's first char optimizations.
|
|
12
|
+
See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),O(`${De}\n\tFailed parsing: < ${e.toString()} >\n\tUsing the @chevrotain/regexp-to-ast library\n\tPlease open an issue at: https://github.com/chevrotain/chevrotain/issues`+n)}}return[]}function ke(e,t,n){switch(e.type){case`Disjunction`:for(let r=0;r<e.value.length;r++)ke(e.value[r],t,n);break;case`Alternative`:let r=e.value;for(let e=0;e<r.length;e++){let i=r[e];switch(i.type){case`EndAnchor`:case`GroupBackReference`:case`Lookahead`:case`NegativeLookahead`:case`Lookbehind`:case`NegativeLookbehind`:case`StartAnchor`:case`WordBoundary`:case`NonWordBoundary`:continue}let a=i;switch(a.type){case`Character`:Ae(a.value,t,n);break;case`Set`:if(!0===a.complement)throw Error(Ee);a.value.forEach(e=>{if(typeof e==`number`)Ae(e,t,n);else{let r=e;if(!0===n)for(let e=r.from;e<=r.to;e++)Ae(e,t,n);else{for(let e=r.from;e<=r.to&&e<256;e++)Ae(e,t,n);if(r.to>=256){let e=r.from>=256?r.from:256,n=r.to,i=K(e),a=K(n);for(let e=i;e<=a;e++)t[e]=e}}}});break;case`Group`:ke(a.value,t,n);break;default:throw Error(`Non Exhaustive Match`)}let o=a.quantifier!==void 0&&a.quantifier.atLeast===0;if(a.type===`Group`&&!1===Me(a)||a.type!==`Group`&&!1===o)break}break;default:throw Error(`non exhaustive match!`)}return Object.values(t)}function Ae(e,t,n){let r=K(e);t[r]=r,!0===n&&function(e,t){let n=String.fromCharCode(e),r=n.toUpperCase();if(r!==n){let e=K(r.charCodeAt(0));t[e]=e}else{let e=n.toLowerCase();if(e!==n){let n=K(e.charCodeAt(0));t[n]=n}}}(e,t)}function je(e,t){return e.value.find(e=>{if(typeof e==`number`)return t.includes(e);{let n=e;return t.find(e=>n.from<=e&&e<=n.to)!==void 0}})}function Me(e){let t=e.quantifier;return!(!t||t.atLeast!==0)||!!e.value&&(Array.isArray(e.value)?e.value.every(Me):Me(e.value))}var Ne=class extends Se{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(!0!==this.found){switch(e.type){case`Lookahead`:this.visitLookahead(e);return;case`NegativeLookahead`:this.visitNegativeLookahead(e);return;case`Lookbehind`:this.visitLookbehind(e);return;case`NegativeLookbehind`:this.visitNegativeLookbehind(e);return}super.visitChildren(e)}}visitCharacter(e){this.targetCharCodes.includes(e.value)&&(this.found=!0)}visitSet(e){e.complement?je(e,this.targetCharCodes)===void 0&&(this.found=!0):je(e,this.targetCharCodes)!==void 0&&(this.found=!0)}};function Pe(e,t){if(t instanceof RegExp){let n=Te(t),r=new Ne(e);return r.visit(n),r.found}for(let n of t){let t=n.charCodeAt(0);if(e.includes(t))return!0}return!1}var Fe=`PATTERN`,Ie=`defaultMode`;function Le(e,t){let n=(t=Object.assign({safeMode:!1,positionTracking:`full`,lineTerminatorCharacters:[`\r`,`
|
|
13
|
+
`],tracer:(e,t)=>t()},t)).tracer,r;n(`initCharCodeToOptimizedIndexMap`,()=>{(function(){if(Ye.length===0){Ye=Array(65536);for(let e=0;e<65536;e++)Ye[e]=e>255?255+~~(e/255):e}})()}),n(`Reject Lexer.NA`,()=>{r=e.filter(e=>e[Fe]!==J.NA)});let i,a,o,s,c,l,u,d,f,p,m,h=!1;n(`Transform Patterns`,()=>{h=!1,i=r.map(e=>{let t=e[Fe];if(t instanceof RegExp){let e=t.source;return e.length!==1||e===`^`||e===`$`||e===`.`||t.ignoreCase?e.length!==2||e[0]!==`\\`||[`d`,`D`,`s`,`S`,`t`,`r`,`n`,`t`,`0`,`c`,`b`,`B`,`f`,`v`,`w`,`W`].includes(e[1])?Ve(t):e[1]:e}if(typeof t==`function`)return h=!0,{exec:t};if(typeof t==`object`)return h=!0,t;if(typeof t==`string`){if(t.length===1)return t;{let e=t.replace(/[\\^$.*+?()[\]{}|]/g,`\\$&`);return Ve(new RegExp(e))}}throw Error(`non exhaustive match`)})}),n(`misc mapping`,()=>{a=r.map(e=>e.tokenTypeIdx),o=r.map(e=>{let t=e.GROUP;if(t!==J.SKIPPED){if(typeof t==`string`)return t;if(t===void 0)return!1;throw Error(`non exhaustive match`)}}),s=r.map(e=>{let t=e.LONGER_ALT;if(t)return Array.isArray(t)?t.map(e=>r.indexOf(e)):[r.indexOf(t)]}),c=r.map(e=>e.PUSH_MODE),l=r.map(e=>Object.hasOwn(e,`POP_MODE`))}),n(`Line Terminator Handling`,()=>{let e=qe(t.lineTerminatorCharacters);u=r.map(e=>!1),t.positionTracking!==`onlyOffset`&&(u=r.map(t=>Object.hasOwn(t,`LINE_BREAKS`)?!!t.LINE_BREAKS:!1===Ge(t,e)&&Pe(e,t.PATTERN)))}),n(`Misc Mapping #2`,()=>{d=r.map(He),f=i.map(Ue),p=r.reduce((e,t)=>{let n=t.GROUP;return typeof n==`string`&&n!==J.SKIPPED&&(e[n]=[]),e},{}),m=i.map((e,t)=>{let n=o[t]===void 0&&s[t]===void 0?function(e){if(!(e instanceof RegExp)||e.flags!==``)return;let t;try{t=Te(e)}catch{return}if(t.value.value.length!==1||t.value.value[0].value.length!==1)return;let n,r=t.value.value[0].value[0];for(;r.type===`Group`;){if(r.capturing||r.quantifier!==void 0&&n!==void 0||r.value.value.length!==1||r.value.value[0].value.length!==1)return;n=r.quantifier??n,r=r.value.value[0].value[0]}if(r.type!==`Set`||r.complement||r.quantifier!==void 0&&n!==void 0||(n=r.quantifier??n,n?.atLeast!==1||n.atMost!==1/0||!n.greedy))return;let i=new Uint8Array(128);for(let e of r.value){let t=typeof e==`number`?e:e.from,n=typeof e==`number`?e:e.to;if(t<0||n>=i.length)return;i.fill(1,t,n+1)}return i}(r[t].PATTERN):void 0;return{pattern:i[t],asciiClass:n,longerAlt:s[t],canLineTerminator:u[t],matchType:n===void 0?!1===f[t]?d[t]?1:2:0:3,short:f[t],group:o[t],push:c[t],pop:l[t],tokenTypeIdx:a[t],tokenType:r[t]}})});let g=!0,_=[];return t.safeMode||n(`First Char Optimization`,()=>{_=r.reduce((e,n,r)=>{if(typeof n.PATTERN==`string`)Je(e,K(n.PATTERN.charCodeAt(0)),m[r]);else if(Array.isArray(n.START_CHARS_HINT)){let t;n.START_CHARS_HINT.forEach(n=>{let i=K(typeof n==`string`?n.charCodeAt(0):n);t!==i&&(t=i,Je(e,i,m[r]))})}else if(n.PATTERN instanceof RegExp){if(n.PATTERN.unicode)g=!1,t.ensureOptimizations&&O(`${De}\tUnable to analyze < ${n.PATTERN.toString()} > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{let i=Oe(n.PATTERN,t.ensureOptimizations);i.length===0&&(g=!1),i.forEach(t=>{Je(e,t,m[r])})}}else t.ensureOptimizations&&O(`${De}\tTokenType: <${n.name}> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),g=!1;return e},[])}),{emptyGroups:p,patternIdxToConfig:m,charCodeToPatternIdxToConfig:_,hasCustom:h,canBeOptimized:g}}function Re(e,t){let n=[],r=function(e){let t=e.filter(e=>!Object.hasOwn(e,Fe));return{errors:t.map(e=>({message:`Token Type: ->`+e.name+`<- missing static 'PATTERN' property`,type:q.MISSING_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(e);n=n.concat(r.errors);let i=function(e){let t=e.filter(e=>{let t=e[Fe];return!(t instanceof RegExp||typeof t==`function`||Object.hasOwn(t,`exec`)||typeof t==`string`)});return{errors:t.map(e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.`,type:q.INVALID_PATTERN,tokenTypes:[e]})),valid:e.filter(e=>!t.includes(e))}}(r.valid),a=i.valid;return n=n.concat(i.errors),n=n.concat(function(e){let t=[],n=e.filter(e=>e[Fe]instanceof RegExp);return t=t.concat(function(e){class t extends Se{constructor(){super(...arguments),this.found=!1}visitEndAnchor(e){this.found=!0}}return e.filter(e=>{let n=e.PATTERN;try{let e=Te(n),r=new t;return r.visit(e),r.found}catch{return ze.test(n.source)}}).map(e=>({message:`Unexpected RegExp Anchor Error:
|
|
14
|
+
Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
|
|
15
|
+
See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.EOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){class t extends Se{constructor(){super(...arguments),this.found=!1}visitStartAnchor(e){this.found=!0}}return e.filter(e=>{let n=e.PATTERN;try{let e=Te(n),r=new t;return r.visit(e),r.found}catch{return Be.test(n.source)}}).map(e=>({message:`Unexpected RegExp Anchor Error:
|
|
16
|
+
Token Type: ->`+e.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
|
|
17
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:q.SOI_ANCHOR_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){return e.filter(e=>{let t=e[Fe];return t instanceof RegExp&&(t.multiline||t.global)}).map(e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' may NOT contain global('g') or multiline('m')`,type:q.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[e]}))}(n)),t=t.concat(function(e){let t=[],n=e.map(n=>e.reduce((e,r)=>(n.PATTERN.source!==r.PATTERN.source||t.includes(r)||r.PATTERN===J.NA||(t.push(r),e.push(r)),e),[]));return n=n.filter(Boolean),n.filter(e=>e.length>1).map(e=>{let t=e.map(e=>e.name);return{message:`The same RegExp pattern ->${e[0].PATTERN}<-has been used in all of the following Token Types: ${t.join(`, `)} <-`,type:q.DUPLICATE_PATTERNS_FOUND,tokenTypes:e}})}(n)),t=t.concat(function(e){return e.filter(e=>e.PATTERN.test(``)).map(e=>({message:`Token Type: ->`+e.name+`<- static 'PATTERN' must not match an empty string`,type:q.EMPTY_MATCH_PATTERN,tokenTypes:[e]}))}(n)),t}(a)),n=n.concat(function(e){return e.filter(e=>{if(!Object.hasOwn(e,`GROUP`))return!1;let t=e.GROUP;return t!==J.SKIPPED&&t!==J.NA&&typeof t!=`string`}).map(e=>({message:`Token Type: ->`+e.name+`<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String`,type:q.INVALID_GROUP_TYPE_FOUND,tokenTypes:[e]}))}(a)),n=n.concat(function(e,t){return e.filter(e=>e.PUSH_MODE!==void 0&&!t.includes(e.PUSH_MODE)).map(e=>({message:`Token Type: ->${e.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${e.PUSH_MODE}<-which does not exist`,type:q.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[e]}))}(a,t)),n=n.concat(function(e){let t=[],n=e.reduce((e,t,n)=>{let r=t.PATTERN;return r===J.NA||(typeof r==`string`?e.push({str:r,idx:n,tokenType:t}):r instanceof RegExp&&(i=r,[`.`,`\\`,`[`,`]`,`|`,`^`,`$`,`(`,`)`,`?`,`*`,`+`,`{`].find(e=>i.source.indexOf(e)!==-1)===void 0)&&e.push({str:r.source,idx:n,tokenType:t})),e;var i},[]);return e.forEach((e,r)=>{n.forEach(({str:n,idx:i,tokenType:a})=>{if(r<i&&function(e,t){if(t instanceof RegExp){if(/(\(\?=)|(\(\?!)|(\(\?<=)|(\(\?<!)/.test(t.source))return!1;let n=t.exec(e);return n!==null&&n.index===0}if(typeof t==`function`)return t(e,0,[],{});if(Object.hasOwn(t,`exec`))return t.exec(e,0,[],{});if(typeof t==`string`)return t===e;throw Error(`non exhaustive match`)}(n,e.PATTERN)){let n=`Token: ->${a.name}<- can never be matched.\nBecause it appears AFTER the Token Type ->${e.name}<-in the lexer's definition.\nSee https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;t.push({message:n,type:q.UNREACHABLE_PATTERN,tokenTypes:[e,a]})}})}),t}(a)),n}var ze=/[^\\][$]/,Be=/[^\\[][\^]|^\^/;function Ve(e){let t=e.ignoreCase?`iy`:`y`;return RegExp(`${e.source}`,t)}function He(e){let t=e.PATTERN;if(t instanceof RegExp)return!1;if(typeof t==`function`||Object.hasOwn(t,`exec`))return!0;if(typeof t==`string`)return!1;throw Error(`non exhaustive match`)}function Ue(e){return typeof e==`string`&&e.length===1&&e.charCodeAt(0)}var We={test:function(e){let t=e.length;for(let n=this.lastIndex;n<t;n++){let t=e.charCodeAt(n);if(t===10)return this.lastIndex=n+1,!0;if(t===13)return this.lastIndex=e.charCodeAt(n+1)===10?n+2:n+1,!0}return!1},lastIndex:0};function Ge(e,t){if(Object.hasOwn(e,`LINE_BREAKS`))return!1;if(e.PATTERN instanceof RegExp){try{Pe(t,e.PATTERN)}catch(e){return{issue:q.IDENTIFY_TERMINATOR,errMsg:e.message}}return!1}if(typeof e.PATTERN==`string`)return!1;if(He(e))return{issue:q.CUSTOM_LINE_BREAK};throw Error(`non exhaustive match`)}function Ke(e,t){if(t.issue===q.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <${e.name}> Token Type\n\t Root cause: ${t.errMsg}.\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(t.issue===q.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <${e.name}> Token Type\n\tFor details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error(`non exhaustive match`)}function qe(e){return e.map(e=>typeof e==`string`?e.charCodeAt(0):e)}function Je(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}var Ye=[];function K(e){return e<256?e:Ye[e]}function Xe(e,t){let n=e.tokenTypeIdx;return n===t.tokenTypeIdx||!0===t.isParent&&!0===t.categoryMatchesMap[n]}function Ze(e,t){return e.tokenTypeIdx===t.tokenTypeIdx}var Qe=1,$e={};function et(e){let t=function(e){let t=[...e],n=e,r=!0;for(;r;){n=n.map(e=>e.CATEGORIES).flat().filter(Boolean);let e=n.filter(e=>!t.includes(e));t=t.concat(e),e.length===0?r=!1:n=e}return t}(e);(function(e){e.forEach(e=>{var t;nt(e)||($e[Qe]=e,e.tokenTypeIdx=Qe++),rt(e)&&!Array.isArray(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),rt(e)||(e.CATEGORIES=[]),t=e,Object.hasOwn(t??{},`categoryMatches`)||(e.categoryMatches=[]),function(e){return Object.hasOwn(e??{},`categoryMatchesMap`)}(e)||(e.categoryMatchesMap={})})})(t),function(e){e.forEach(e=>{tt([],e)})}(t),function(e){e.forEach(e=>{e.categoryMatches=[],Object.keys(e.categoryMatchesMap).forEach(t=>{e.categoryMatches.push($e[t].tokenTypeIdx)})})}(t),t.forEach(e=>{e.isParent=e.categoryMatches.length>0})}function tt(e,t){e.forEach(e=>{t.categoryMatchesMap[e.tokenTypeIdx]=!0}),t.CATEGORIES.forEach(n=>{let r=e.concat(t);r.includes(n)||tt(r,n)})}function nt(e){return Object.hasOwn(e??{},`tokenTypeIdx`)}function rt(e){return Object.hasOwn(e??{},`CATEGORIES`)}function it(e){return Object.hasOwn(e??{},`tokenTypeIdx`)}var q,at={buildUnableToPopLexerModeMessage:e=>`Unable to pop Lexer Mode after encountering Token ->${e.image}<- The Mode Stack is empty`,buildUnexpectedCharactersMessage:(e,t,n,r,i,a)=>`unexpected character: ->${e.charAt(t)}<- at offset: ${t}, skipped ${n} characters.`};(function(e){e[e.MISSING_PATTERN=0]=`MISSING_PATTERN`,e[e.INVALID_PATTERN=1]=`INVALID_PATTERN`,e[e.EOI_ANCHOR_FOUND=2]=`EOI_ANCHOR_FOUND`,e[e.UNSUPPORTED_FLAGS_FOUND=3]=`UNSUPPORTED_FLAGS_FOUND`,e[e.DUPLICATE_PATTERNS_FOUND=4]=`DUPLICATE_PATTERNS_FOUND`,e[e.INVALID_GROUP_TYPE_FOUND=5]=`INVALID_GROUP_TYPE_FOUND`,e[e.PUSH_MODE_DOES_NOT_EXIST=6]=`PUSH_MODE_DOES_NOT_EXIST`,e[e.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]=`MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE`,e[e.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]=`MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY`,e[e.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]=`MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST`,e[e.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]=`LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED`,e[e.SOI_ANCHOR_FOUND=11]=`SOI_ANCHOR_FOUND`,e[e.EMPTY_MATCH_PATTERN=12]=`EMPTY_MATCH_PATTERN`,e[e.NO_LINE_BREAKS_FLAGS=13]=`NO_LINE_BREAKS_FLAGS`,e[e.UNREACHABLE_PATTERN=14]=`UNREACHABLE_PATTERN`,e[e.IDENTIFY_TERMINATOR=15]=`IDENTIFY_TERMINATOR`,e[e.CUSTOM_LINE_BREAK=16]=`CUSTOM_LINE_BREAK`,e[e.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]=`MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE`})(q||={});var ot={deferDefinitionErrorsHandling:!1,positionTracking:`full`,lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
|
|
18
|
+
`,`\r`],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:at,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(ot);var J=class{constructor(e,t=ot){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.cachedGroupKeys=[],this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(e,t)=>{if(!0===this.traceInitPerf){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);let{time:r,value:i}=re(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()},typeof t==`boolean`)throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
|
|
19
|
+
a boolean 2nd argument is no longer supported`);this.config=Object.assign({},ot,t);let n=this.config.traceInitPerf;!0===n?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof n==`number`&&(this.traceInitMaxIdent=n,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT(`Lexer Constructor`,()=>{let n,r=!0;this.TRACE_INIT(`Lexer Config handling`,()=>{if(this.config.lineTerminatorsPattern===ot.lineTerminatorsPattern)this.config.lineTerminatorsPattern=We;else if(this.config.lineTerminatorCharacters===ot.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
|
|
20
|
+
For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(t.safeMode&&t.ensureOptimizations)throw Error(`"safeMode" and "ensureOptimizations" flags are mutually exclusive.`);this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Array.isArray(e)?n={modes:{defaultMode:[...e]},defaultMode:Ie}:(r=!1,n=Object.assign({},e))}),!1===this.config.skipValidations&&(this.TRACE_INIT(`performRuntimeChecks`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(function(e){let t=[];return Object.hasOwn(e,`defaultMode`)||t.push({message:`A MultiMode Lexer cannot be initialized without a <defaultMode> property in its definition
|
|
21
|
+
`,type:q.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),Object.hasOwn(e,`modes`)||t.push({message:`A MultiMode Lexer cannot be initialized without a <modes> property in its definition
|
|
22
|
+
`,type:q.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),Object.hasOwn(e,`modes`)&&Object.hasOwn(e,`defaultMode`)&&!Object.hasOwn(e.modes,e.defaultMode)&&t.push({message:`A MultiMode Lexer cannot be initialized with a ${Ie}: <${e.defaultMode}>which does not exist\n`,type:q.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),Object.hasOwn(e,`modes`)&&Object.keys(e.modes).forEach(n=>{let r=e.modes[n];r.forEach((e,i)=>{e===void 0?t.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${n}> at index: <${i}>\n`,type:q.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED}):Object.hasOwn(e,`LONGER_ALT`)&&(Array.isArray(e.LONGER_ALT)?e.LONGER_ALT:[e.LONGER_ALT]).forEach(i=>{i===void 0||r.includes(i)||t.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${i.name}> on token <${e.name}> outside of mode <${n}>\n`,type:q.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})})}),t}(n,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT(`performWarningRuntimeChecks`,()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(function(e,t,n){let r=[],i=!1,a=Object.values(e.modes||{}).flat().filter(Boolean).filter(e=>e[Fe]!==J.NA),o=qe(n);return t&&a.forEach(e=>{let t=Ge(e,o);if(!1!==t){let n={message:Ke(e,t),type:t.issue,tokenType:e};r.push(n)}else Object.hasOwn(e,`LINE_BREAKS`)?!0===e.LINE_BREAKS&&(i=!0):Pe(o,e.PATTERN)&&(i=!0)}),t&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
|
|
23
|
+
This Lexer has been defined to track line and column information,
|
|
24
|
+
But none of the Token Types can be identified as matching a line terminator.
|
|
25
|
+
See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
|
|
26
|
+
for details.`,type:q.NO_LINE_BREAKS_FLAGS}),r}(n,this.trackStartLines,this.config.lineTerminatorCharacters))})),n.modes=n.modes?n.modes:{},Object.entries(n.modes).forEach(([e,t])=>{n.modes[e]=t.filter(e=>e!==void 0)});let i=Object.keys(n.modes);if(Object.entries(n.modes).forEach(([e,n])=>{this.TRACE_INIT(`Mode: <${e}> processing`,()=>{if(this.modes.push(e),!1===this.config.skipValidations&&this.TRACE_INIT(`validatePatterns`,()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(Re(n,i))}),this.lexerDefinitionErrors.length===0){let r;et(n),this.TRACE_INIT(`analyzeTokenTypes`,()=>{r=Le(n,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:t.positionTracking,ensureOptimizations:t.ensureOptimizations,safeMode:t.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[e]=r.patternIdxToConfig,this.charCodeToPatternIdxToConfig[e]=r.charCodeToPatternIdxToConfig,this.emptyGroups=Object.assign({},this.emptyGroups,r.emptyGroups),this.hasCustom=r.hasCustom||this.hasCustom,this.canModeBeOptimized[e]=r.canBeOptimized}})}),this.defaultMode=n.defaultMode,this.cachedGroupKeys=Object.keys(this.emptyGroups),this.lexerDefinitionErrors.length>0&&!this.config.deferDefinitionErrorsHandling){let e=this.lexerDefinitionErrors.map(e=>e.message).join(`-----------------------
|
|
27
|
+
`);throw Error(`Errors detected in definition of Lexer:
|
|
28
|
+
`+e)}this.lexerDefinitionWarning.forEach(e=>{k(e.message)}),this.TRACE_INIT(`Choosing sub-methods implementations`,()=>{if(r&&(this.handleModes=()=>{}),!1===this.trackStartLines&&(this.computeNewColumn=e=>e),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=()=>{}),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT(`Failed Optimization Warnings`,()=>{let e=Object.entries(this.canModeBeOptimized).reduce((e,[t,n])=>(!1===n&&e.push(t),e),[]);if(t.ensureOptimizations&&e.length>0)throw Error(`Lexer Modes: < ${e.join(`, `)} > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT(`clearRegExpParserCache`,()=>{Ce={}}),this.TRACE_INIT(`toFastProperties`,()=>{ie(this)})})}tokenize(e,t=this.defaultMode){if(this.lexerDefinitionErrors.length>0){let e=this.lexerDefinitionErrors.map(e=>e.message).join(`-----------------------
|
|
29
|
+
`);throw Error(`Unable to Tokenize because Errors detected in definition of Lexer:
|
|
30
|
+
`+e)}return this.tokenizeInternal(e,t)}tokenizeInternal(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=e,v=_.length,y=0,b=0,x=this.hasCustom?0:Math.floor(e.length/10),S=Array(x),C=[],ee=this.trackStartLines?1:void 0,w=this.trackStartLines?1:void 0,T={};for(let e=0;e<this.cachedGroupKeys.length;e++)T[this.cachedGroupKeys[e]]=[];let te=this.trackStartLines,E=this.config.lineTerminatorsPattern,ne=0,D=[],O=[],k=[],re=[];Object.freeze(re);let ie=!1,A=e=>{if(k.length===1&&e.tokenType.PUSH_MODE===void 0){let t=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(e);C.push({offset:e.startOffset,line:e.startLine,column:e.startColumn,length:e.image.length,message:t})}else{k.pop();let e=k.at(-1);D=this.patternIdxToConfig[e],O=this.charCodeToPatternIdxToConfig[e],ne=D.length;let t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;ie=!(!O||!t)}};function j(e){k.push(e),O=this.charCodeToPatternIdxToConfig[e],D=this.patternIdxToConfig[e],ne=D.length;let t=this.canModeBeOptimized[e]&&!1===this.config.safeMode;ie=!(!O||!t)}let M;j.call(this,t);let N=this.config.recoveryEnabled;for(;y<v;){s=null,u=-1;let t=_.charCodeAt(y),x;if(ie){let e=K(t),n=O[e];x=n===void 0?re:n}else x=D;let P=x.length;for(n=0;n<P;n++){M=x[n];let r=M.pattern;switch(c=null,M.matchType){case 0:t===M.short&&(u=1,s=r);break;case 1:g=r.exec(_,y,S,T),g===null?s=null:(s=g[0],u=s.length,g.payload!==void 0&&(c=g.payload));break;case 3:{let e=M.asciiClass;if(e[t]!==1){r.lastIndex=0;break}let n=y+1;for(;e[_.charCodeAt(n)]===1;)n++;u=n-y,r.lastIndex=n;break}case 2:r.lastIndex=y,u=this.matchLength(r,e,y)}if(u!==-1){if(o=M.longerAlt,o!==void 0){s=e.substring(y,y+u);let t=o.length;for(i=0;i<t;i++){let t=D[o[i]],n=t.pattern;if(l=null,t.matchType===1?(g=n.exec(_,y,S,T),g===null?a=null:(a=g[0],g.payload!==void 0&&(l=g.payload))):(n.lastIndex=y,a=this.match(n,e,y)),a&&a.length>s.length){s=a,u=a.length,c=l,M=t;break}}}break}}if(u!==-1){if(d=M.group,d!==void 0&&(s=s===null?e.substring(y,y+u):s,f=M.tokenTypeIdx,p=this.createTokenInstance(s,y,f,M.tokenType,ee,w,u),this.handlePayload(p,c),!1===d?b=this.addToken(S,b,p):T[d].push(p)),!0===te&&!0===M.canLineTerminator){let t,n,r=0;E.lastIndex=0;do s=s===null?e.substring(y,y+u):s,t=E.test(s),!0===t&&(n=E.lastIndex-1,r++);while(!0===t);r===0?w=this.computeNewColumn(w,u):(ee+=r,w=u-n,this.updateTokenEndLineColumnLocation(p,d,n,r,ee,w,u))}else w=this.computeNewColumn(w,u);y+=u,this.handleModes(M,A,j,p)}else{let t=y,n=ee,i=w,a=!1===N;for(;!1===a&&y<v;)for(y++,r=0;r<ne;r++){let t=D[r],n=t.pattern;switch(t.matchType){case 0:_.charCodeAt(y)===t.short&&(a=!0);break;case 1:a=n.exec(_,y,S,T)!==null;break;case 3:case 2:n.lastIndex=y,a=n.exec(e)!==null}if(!0===a)break}if(m=y-t,w=this.computeNewColumn(w,m),h=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(_,t,m,n,i,k.at(-1)),C.push({offset:t,line:n,column:i,length:m,message:h}),!1===N)break}}return this.hasCustom||(S.length=b),{tokens:S,groups:T,errors:C}}handleModes(e,t,n,r){if(!0===e.pop){let i=e.push;t(r),i!==void 0&&n.call(this,i)}else e.push!==void 0&&n.call(this,e.push)}updateTokenEndLineColumnLocation(e,t,n,r,i,a,o){let s,c;t!==void 0&&(s=n===o-1,c=s?-1:0,r===1&&!0===s||(e.endLine=i+c,e.endColumn=a-1-c))}computeNewColumn(e,t){return e+t}createOffsetOnlyToken(e,t,n,r){return{image:e,startOffset:t,tokenTypeIdx:n,tokenType:r}}createStartOnlyToken(e,t,n,r,i,a){return{image:e,startOffset:t,startLine:i,startColumn:a,tokenTypeIdx:n,tokenType:r}}createFullToken(e,t,n,r,i,a,o){return{image:e,startOffset:t,endOffset:t+o-1,startLine:i,endLine:i,startColumn:a,endColumn:a+o-1,tokenTypeIdx:n,tokenType:r}}addTokenUsingPush(e,t,n){return e.push(n),t}addTokenUsingMemberAccess(e,t,n){return e[t]=n,++t}handlePayloadNoCustom(e,t){}handlePayloadWithCustom(e,t){t!==null&&(e.payload=t)}match(e,t,n){return!0===e.test(t)?t.substring(n,e.lastIndex):null}matchLength(e,t,n){return!0===e.test(t)?e.lastIndex-n:-1}};function st(e){return ct(e)?e.LABEL:e.name}function ct(e){return typeof e.LABEL==`string`&&e.LABEL!==``}J.SKIPPED=`This marks a skipped Token pattern, this means each token identified by it will be consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.`,J.NA=/NOT_APPLICABLE/;var lt=`parent`,ut=`categories`,dt=`label`,ft=`group`,pt=`push_mode`,mt=`pop_mode`,ht=`longer_alt`,gt=`line_breaks`,_t=`start_chars_hint`;function Y(e){return function(e){let t=e.pattern,n={};if(n.name=e.name,t!==void 0&&(n.PATTERN=t),Object.hasOwn(e,lt))throw`The parent property is no longer supported.
|
|
31
|
+
See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return Object.hasOwn(e,ut)&&(n.CATEGORIES=e[ut]),et([n]),Object.hasOwn(e,dt)&&(n.LABEL=e[dt]),Object.hasOwn(e,ft)&&(n.GROUP=e[ft]),Object.hasOwn(e,mt)&&(n.POP_MODE=e[mt]),Object.hasOwn(e,pt)&&(n.PUSH_MODE=e[pt]),Object.hasOwn(e,ht)&&(n.LONGER_ALT=e[ht]),Object.hasOwn(e,gt)&&(n.LINE_BREAKS=e[gt]),Object.hasOwn(e,_t)&&(n.START_CHARS_HINT=e[_t]),n}(e)}var X=Y({name:`EOF`,pattern:J.NA});function vt(e,t,n,r,i,a,o,s){return{image:t,startOffset:n,endOffset:r,startLine:i,endLine:a,startColumn:o,endColumn:s,tokenTypeIdx:e.tokenTypeIdx,tokenType:e}}et([X]);var yt={buildMismatchTokenMessage:({expected:e,actual:t,previous:n,ruleName:r})=>`Expecting ${ct(e)?`--\x3e ${st(e)} <--`:`token of type --\x3e ${e.name} <--`} but found --\x3e '${t.image}' <--`,buildNotAllInputParsedMessage:({firstRedundant:e,ruleName:t})=>`Redundant input, expecting EOF but found: `+e.image,buildNoViableAltMessage({expectedPathsPerAlt:e,actual:t,previous:n,customUserDescription:r,ruleName:i}){let a=`
|
|
32
|
+
but found: '`+t[0].image+`'`;return r?`Expecting: `+r+a:`Expecting: one of these possible Token sequences:\n${e.reduce((e,t)=>e.concat(t),[]).map(e=>`[${e.map(e=>st(e)).join(`, `)}]`).map((e,t)=>` ${t+1}. ${e}`).join(`
|
|
33
|
+
`)}`+a},buildEarlyExitMessage({expectedIterationPaths:e,actual:t,customUserDescription:n,ruleName:r}){let i=`
|
|
34
|
+
but found: '`+t[0].image+`'`;return n?`Expecting: `+n+i:`Expecting: expecting at least one iteration which starts with one of these possible Token sequences::\n <${e.map(e=>`[${e.map(e=>st(e)).join(`,`)}]`).join(` ,`)}>`+i}};Object.freeze(yt);var bt={buildRuleNotFoundError:(e,t)=>`Invalid grammar, reference to a rule which is not defined: ->`+t.nonTerminalName+`<-
|
|
35
|
+
inside top level rule: ->`+e.name+`<-`},xt={buildDuplicateFoundError(e,t){let n=e.name,r=t[0],i=r.idx,a=H(r),o=(s=r)instanceof B?s.terminalType.name:s instanceof j?s.nonTerminalName:``;var s;let c=`->${a}${i>0?i:``}<- ${o?`with argument: ->${o}<-`:``}\n appears more than once (${t.length} times) in the top level rule: ->${n}<-. \n For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES \n `;return c=c.replace(/[ \t]+/g,` `),c=c.replace(/\s\s+/g,`
|
|
36
|
+
`),c},buildNamespaceConflictError:e=>`Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${e.name}>.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter.`,buildAlternationPrefixAmbiguityError(e){let t=e.prefixPath.map(e=>st(e)).join(`, `),n=e.alternation.idx===0?``:e.alternation.idx;return`Ambiguous alternatives: <${e.ambiguityIndices.join(` ,`)}> due to common lookahead prefix\nin <OR${n}> inside <${e.topLevelRule.name}> Rule,\n<${t}> may appears as a prefix path in all these alternatives.\nSee: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details.`},buildAlternationAmbiguityError(e){let t=e.alternation.idx===0?``:e.alternation.idx,n=e.prefixPath.length===0,r=`Ambiguous Alternatives Detected: <${e.ambiguityIndices.join(` ,`)}> in <OR${t}> inside <${e.topLevelRule.name}> Rule,\n`;return r+=n?`These alternatives are all empty (match no tokens), making them indistinguishable.
|
|
37
|
+
Only the last alternative may be empty.
|
|
38
|
+
`:`<${e.prefixPath.map(e=>st(e)).join(`, `)}> may appears as a prefix path in all these alternatives.\n`,r+=`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
|
|
39
|
+
For Further details.`,r},buildEmptyRepetitionError(e){let t=H(e.repetition);return e.repetition.idx!==0&&(t+=e.repetition.idx),`The repetition <${t}> within Rule <${e.topLevelRule.name}> can never consume any tokens.\nThis could lead to an infinite loop.`},buildTokenNameError:e=>`deprecated`,buildEmptyAlternationError:e=>`Ambiguous empty alternative: <${e.emptyChoiceIdx+1}> in <OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\nOnly the last alternative may be an empty alternative.`,buildTooManyAlternativesError:e=>`An Alternation cannot have more than 256 alternatives:\n<OR${e.alternation.idx}> inside <${e.topLevelRule.name}> Rule.\n has ${e.alternation.definition.length+1} alternatives.`,buildLeftRecursionError(e){let t=e.topLevelRule.name;return`Left Recursion found in grammar.\nrule: <${t}> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n ${t} --\x3e ${e.leftRecursionPath.map(e=>e.name).concat([t]).join(` --> `)}\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError:e=>`deprecated`,buildDuplicateRuleNameError(e){let t;return t=e.topLevelRule instanceof M?e.topLevelRule.name:e.topLevelRule,`Duplicate definition, rule: ->${t}<- is already defined in the grammar: ->${e.grammarName}<-`}},Z,St=class extends oe{constructor(e,t){super(),this.nameToTopRule=e,this.errMsgProvider=t,this.errors=[]}resolveRefs(){Object.values(this.nameToTopRule).forEach(e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){let t=this.nameToTopRule[e.nonTerminalName];if(t)e.referencedRule=t;else{let t=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:t,type:Q.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}},Ct=class extends ce{constructor(e,t){super(),this.topProd=e,this.path=t,this.possibleTokTypes=[],this.nextProductionName=``,this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){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=[...this.path.ruleStack].reverse(),this.occurrenceStack=[...this.path.occurrenceStack].reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,t=[]){this.found||super.walk(e,t)}walkProdRef(e,t,n){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){let r=t.concat(n);this.updateExpectedNext(),this.walk(e.referencedRule,r)}}updateExpectedNext(){this.ruleStack.length===0?(this.nextProductionName=``,this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}},wt=class extends Ct{constructor(e,t){super(e,t),this.path=t,this.nextTerminalName=``,this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,t,n){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){let e=new N({definition:t.concat(n)});this.possibleTokTypes=ue(e),this.found=!0}}},Tt=class extends ce{constructor(e,t){super(),this.topRule=e,this.occurrence=t,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}},Et=class extends Tt{walkMany(e,t,n){if(e.idx===this.occurrence){let e=t.concat(n)[0];this.result.isEndOfRule=e===void 0,e instanceof B&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkMany(e,t,n)}},Dt=class extends Tt{walkManySep(e,t,n){if(e.idx===this.occurrence){let e=t.concat(n)[0];this.result.isEndOfRule=e===void 0,e instanceof B&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkManySep(e,t,n)}},Ot=class extends Tt{walkAtLeastOne(e,t,n){if(e.idx===this.occurrence){let e=t.concat(n)[0];this.result.isEndOfRule=e===void 0,e instanceof B&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOne(e,t,n)}},kt=class extends Tt{walkAtLeastOneSep(e,t,n){if(e.idx===this.occurrence){let e=t.concat(n)[0];this.result.isEndOfRule=e===void 0,e instanceof B&&(this.result.token=e.terminalType,this.result.occurrence=e.idx)}else super.walkAtLeastOneSep(e,t,n)}};function At(e,t,n=[]){n=[...n];let r=[],i=0;function a(a){let o=At(a.concat(e.slice(i+1)),t,n);return r.concat(o)}for(;n.length<t&&i<e.length;){let t=e[i];if(t instanceof N||t instanceof j)return a(t.definition);if(t instanceof P)r=a(t.definition);else{if(t instanceof F)return a(t.definition.concat([new L({definition:t.definition})]));if(t instanceof I)return a([new N({definition:t.definition}),new L({definition:[new B({terminalType:t.separator})].concat(t.definition)})]);if(t instanceof R)r=a(t.definition.concat([new L({definition:[new B({terminalType:t.separator})].concat(t.definition)})]));else if(t instanceof L)r=a(t.definition.concat([new L({definition:t.definition})]));else{if(t instanceof z)return t.definition.forEach(e=>{e.definition.length!==0&&(r=a(e.definition))}),r;if(!(t instanceof B))throw Error(`non exhaustive match`);n.push(t.terminalType)}}i++}return r.push({partialPath:n,suffixDef:e.slice(i)}),r}function jt(e,t,n,r){let i=[...n];i.push(e.name);let a=[...r];return a.push(1),{idx:t,def:e.definition,ruleStack:i,occurrenceStack:a}}function Mt(e){if(e instanceof P||e===`Option`)return Z.OPTION;if(e instanceof L||e===`Repetition`)return Z.REPETITION;if(e instanceof F||e===`RepetitionMandatory`)return Z.REPETITION_MANDATORY;if(e instanceof I||e===`RepetitionMandatoryWithSeparator`)return Z.REPETITION_MANDATORY_WITH_SEPARATOR;if(e instanceof R||e===`RepetitionWithSeparator`)return Z.REPETITION_WITH_SEPARATOR;if(e instanceof z||e===`Alternation`)return Z.ALTERNATION;throw Error(`non exhaustive match`)}function Nt(e,t,n,r){let i=e.length,a=e.every(e=>e.every(e=>e.length===1));if(t)return function(t){let r=t.map(e=>e.GATE);for(let t=0;t<i;t++){let i=e[t],a=i.length,o=r[t];if(o===void 0||!1!==o.call(this))e:for(let e=0;e<a;e++){let r=i[e],a=r.length;for(let e=0;e<a;e++)if(!1===n(this.LA_FAST(e+1),r[e]))continue e;return t}}};if(a&&!r){let t=e.map(e=>e.flat()).reduce((e,t,n)=>(t.forEach(t=>{t.tokenTypeIdx in e||(e[t.tokenTypeIdx]=n),t.categoryMatches.forEach(t=>{Object.hasOwn(e,t)||(e[t]=n)})}),e),{});return function(){let e=this.LA_FAST(1);return t[e.tokenTypeIdx]}}return function(){for(let t=0;t<i;t++){let r=e[t],i=r.length;e:for(let e=0;e<i;e++){let i=r[e],a=i.length;for(let e=0;e<a;e++)if(!1===n(this.LA_FAST(e+1),i[e]))continue e;return t}}}}function Pt(e,t,n){let r=e.every(e=>e.length===1),i=e.length;if(r&&!n){let t=e.flat();if(t.length===1&&t[0].categoryMatches.length===0){let e=t[0].tokenTypeIdx;return function(){return this.LA_FAST(1).tokenTypeIdx===e}}{let e=t.reduce((e,t,n)=>(e[t.tokenTypeIdx]=!0,t.categoryMatches.forEach(t=>{e[t]=!0}),e),[]);return function(){let t=this.LA_FAST(1);return!0===e[t.tokenTypeIdx]}}}return function(){e:for(let n=0;n<i;n++){let r=e[n],i=r.length;for(let e=0;e<i;e++)if(!1===t(this.LA_FAST(e+1),r[e]))continue e;return!0}return!1}}(function(e){e[e.OPTION=0]=`OPTION`,e[e.REPETITION=1]=`REPETITION`,e[e.REPETITION_MANDATORY=2]=`REPETITION_MANDATORY`,e[e.REPETITION_MANDATORY_WITH_SEPARATOR=3]=`REPETITION_MANDATORY_WITH_SEPARATOR`,e[e.REPETITION_WITH_SEPARATOR=4]=`REPETITION_WITH_SEPARATOR`,e[e.ALTERNATION=5]=`ALTERNATION`})(Z||={});var Ft=class extends ce{constructor(e,t,n){super(),this.topProd=e,this.targetOccurrence=t,this.targetProdType=n}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,t,n,r){return e.idx===this.targetOccurrence&&this.targetProdType===t&&(this.restDef=n.concat(r),!0)}walkOption(e,t,n){this.checkIsTarget(e,Z.OPTION,t,n)||super.walkOption(e,t,n)}walkAtLeastOne(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY,t,n)||super.walkOption(e,t,n)}walkAtLeastOneSep(e,t,n){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}walkMany(e,t,n){this.checkIsTarget(e,Z.REPETITION,t,n)||super.walkOption(e,t,n)}walkManySep(e,t,n){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR,t,n)||super.walkOption(e,t,n)}},It=class extends oe{constructor(e,t,n){super(),this.targetOccurrence=e,this.targetProdType=t,this.targetRef=n,this.result=[]}checkIsTarget(e,t){e.idx!==this.targetOccurrence||this.targetProdType!==t||this.targetRef!==void 0&&e!==this.targetRef||(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,Z.OPTION)}visitRepetition(e){this.checkIsTarget(e,Z.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,Z.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,Z.ALTERNATION)}};function Lt(e){let t=Array(e);for(let n=0;n<e;n++)t[n]=[];return t}function Rt(e){let t=[``];for(let n=0;n<e.length;n++){let r=e[n],i=[];for(let e=0;e<t.length;e++){let n=t[e];i.push(n+`_`+r.tokenTypeIdx);for(let e=0;e<r.categoryMatches.length;e++){let t=`_`+r.categoryMatches[e];i.push(n+t)}}t=i}return t}function zt(e,t,n){for(let r=0;r<e.length;r++){if(r===n)continue;let i=e[r];for(let e=0;e<t.length;e++)if(!0===i[t[e]])return!1}return!0}function Bt(e,t){let n=e.map(e=>At([e],1)),r=Lt(n.length),i=n.map(e=>{let t={};return e.forEach(e=>{Rt(e.partialPath).forEach(e=>{t[e]=!0})}),t}),a=n;for(let e=1;e<=t;e++){let n=a;a=Lt(n.length);for(let o=0;o<n.length;o++){let s=n[o];for(let n=0;n<s.length;n++){let c=s[n].partialPath,l=s[n].suffixDef,u=Rt(c);if(zt(i,u,o)||l.length===0||c.length===t){let e=r[o];if(!1===Ut(e,c)){e.push(c);for(let e=0;e<u.length;e++){let t=u[e];i[o][t]=!0}}}else{let t=At(l,e+1,c);a[o]=a[o].concat(t),t.forEach(e=>{Rt(e.partialPath).forEach(e=>{i[o][e]=!0})})}}}}return r}function Vt(e,t,n,r){let i=new It(e,Z.ALTERNATION,r);return t.accept(i),Bt(i.result,n)}function Ht(e,t,n,r){let i=new It(e,n);t.accept(i);let a=i.result,o=new Ft(t,e,n).startWalking();return Bt([new N({definition:a}),new N({definition:o})],r)}function Ut(e,t){e:for(let n=0;n<e.length;n++){let r=e[n];if(r.length===t.length){for(let e=0;e<r.length;e++){let n=t[e],i=r[e];if((n===i||i.categoryMatchesMap[n.tokenTypeIdx]!==void 0)==0)continue e}return!0}}return!1}function Wt(e){return e.every(e=>e.every(e=>e.every(e=>e.categoryMatches.length===0)))}function Gt(e,t,n,r){let i=e.flatMap(e=>function(e,t){let n=new Jt;e.accept(n);let r=n.allProductions,i=Object.groupBy(r,Kt),a=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.length>1));return Object.values(a).map(n=>{let r=n[0],i=t.buildDuplicateFoundError(e,n),a=H(r),o={message:i,type:Q.DUPLICATE_PRODUCTIONS,ruleName:e.name,dslName:a,occurrence:r.idx},s=qt(r);return s&&(o.parameter=s),o})}(e,n)),a=function(e,t,n){let r=[],i=t.map(e=>e.name);return e.forEach(e=>{let t=e.name;if(i.includes(t)){let i=n.buildNamespaceConflictError(e);r.push({message:i,type:Q.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:t})}}),r}(e,t,n),o=e.flatMap(e=>function(e,t){let n=new Zt;return e.accept(n),n.alternations.flatMap(n=>n.definition.length>255?[{message:t.buildTooManyAlternativesError({topLevelRule:e,alternation:n}),type:Q.TOO_MANY_ALTS,ruleName:e.name,occurrence:n.idx}]:[])}(e,n)),s=e.flatMap(t=>function(e,t,n,r){let i=[];if(t.reduce((t,n)=>n.name===e.name?t+1:t,0)>1){let t=r.buildDuplicateRuleNameError({topLevelRule:e,grammarName:n});i.push({message:t,type:Q.DUPLICATE_RULE_NAME,ruleName:e.name})}return i}(t,e,r,n));return i.concat(a,o,s)}function Kt(e){return`${H(e)}_#_${e.idx}_#_${qt(e)}`}function qt(e){return e instanceof B?e.terminalType.name:e instanceof j?e.nonTerminalName:``}var Jt=class extends oe{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}};function Yt(e,t,n,r=[]){let i=[],a=Xt(t.definition);if(a.length===0)return[];{let t=e.name;a.includes(e)&&i.push({message:n.buildLeftRecursionError({topLevelRule:e,leftRecursionPath:r}),type:Q.LEFT_RECURSION,ruleName:t});let o=r.concat([e]),s=a.filter(e=>!o.includes(e)).flatMap(t=>{let i=[...r];return i.push(t),Yt(e,t,n,i)});return i.concat(s)}}function Xt(e){let t=[];if(e.length===0)return t;let n=e[0];if(n instanceof j)t.push(n.referencedRule);else if(n instanceof N||n instanceof P||n instanceof F||n instanceof I||n instanceof R||n instanceof L)t=t.concat(Xt(n.definition));else if(n instanceof z)t=n.definition.map(e=>Xt(e.definition)).flat();else if(!(n instanceof B))throw Error(`non exhaustive match`);let r=se(n),i=e.length>1;if(r&&i){let n=e.slice(1);return t.concat(Xt(n))}return t}var Zt=class extends oe{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}};function Qt(e,t){let n=new Zt;return e.accept(n),n.alternations.flatMap(n=>n.definition.slice(0,-1).flatMap((r,i)=>function(e,t,n,r){let i=`EXIT_NONE_TERMINAL`,a=[i],o=`EXIT_ALTERNATIVE`,s=!1,c=t.length,l=c-r-1,u=[],d=[];for(d.push({idx:-1,def:e,ruleStack:[],occurrenceStack:[]});d.length!==0;){let e=d.pop();if(e===o){s&&d.at(-1).idx<=l&&d.pop();continue}let r=e.def,f=e.idx,p=e.ruleStack,m=e.occurrenceStack;if(r.length===0)continue;let h=r[0];if(h===i){let e={idx:f,def:r.slice(1),ruleStack:p.slice(0,-1),occurrenceStack:m.slice(0,-1)};d.push(e)}else if(h instanceof B){if(f<c-1){let e=f+1;if(n(t[e],h.terminalType)){let t={idx:e,def:r.slice(1),ruleStack:p,occurrenceStack:m};d.push(t)}}else{if(f!==c-1)throw Error(`non exhaustive match`);u.push({nextTokenType:h.terminalType,nextTokenOccurrence:h.idx,ruleStack:p,occurrenceStack:m}),s=!0}}else if(h instanceof j){let e=[...p];e.push(h.nonTerminalName);let t=[...m];t.push(h.idx);let n={idx:f,def:h.definition.concat(a,r.slice(1)),ruleStack:e,occurrenceStack:t};d.push(n)}else if(h instanceof P){let e={idx:f,def:r.slice(1),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t={idx:f,def:h.definition.concat(r.slice(1)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof F){let e=new L({definition:h.definition,idx:h.idx}),t={idx:f,def:h.definition.concat([e],r.slice(1)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof I){let e=new L({definition:[new B({terminalType:h.separator})].concat(h.definition),idx:h.idx}),t={idx:f,def:h.definition.concat([e],r.slice(1)),ruleStack:p,occurrenceStack:m};d.push(t)}else if(h instanceof R){let e={idx:f,def:r.slice(1),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new L({definition:[new B({terminalType:h.separator})].concat(h.definition),idx:h.idx}),n={idx:f,def:h.definition.concat([t],r.slice(1)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof L){let e={idx:f,def:r.slice(1),ruleStack:p,occurrenceStack:m};d.push(e),d.push(o);let t=new L({definition:h.definition,idx:h.idx}),n={idx:f,def:h.definition.concat([t],r.slice(1)),ruleStack:p,occurrenceStack:m};d.push(n)}else if(h instanceof z)for(let e=h.definition.length-1;e>=0;e--){let t={idx:f,def:h.definition[e].definition.concat(r.slice(1)),ruleStack:p,occurrenceStack:m};d.push(t),d.push(o)}else if(h instanceof N)d.push({idx:f,def:h.definition.concat(r.slice(1)),ruleStack:p,occurrenceStack:m});else{if(!(h instanceof M))throw Error(`non exhaustive match`);d.push(jt(h,f,p,m))}}return u}([r],[],Xe,1).length===0?[{message:t.buildEmptyAlternationError({topLevelRule:e,alternation:n,emptyChoiceIdx:i}),type:Q.NONE_LAST_EMPTY_ALT,ruleName:e.name,occurrence:n.idx,alternative:i+1}]:[]))}function $t(e,t,n){let r=new Zt;e.accept(r);let i=r.alternations;return i=i.filter(e=>!0!==e.ignoreAmbiguities),i.flatMap(r=>{let i=r.idx,a=Vt(i,e,r.maxLookahead||t,r),o=function(e,t,n,r){let i=[];return e.reduce((n,r,a)=>(!0===t.definition[a].ignoreAmbiguities||r.forEach(r=>{let o=[a];e.forEach((e,n)=>{a!==n&&Ut(e,r)&&!0!==t.definition[n].ignoreAmbiguities&&o.push(n)}),o.length>1&&!Ut(i,r)&&(i.push(r),n.push({alts:o,path:r}))}),n),[]).map(e=>{let i=e.alts.map(e=>e+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Q.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:t.idx,alternatives:e.alts}})}(a,r,e,n),s=function(e,t,n,r){let i=e.reduce((e,t,n)=>{let r=t.map(e=>({idx:n,path:e}));return e.concat(r)},[]);return i.flatMap(e=>{if(!0===t.definition[e.idx].ignoreAmbiguities)return[];let a=e.idx,o=e.path;return i.filter(e=>{return!0!==t.definition[e.idx].ignoreAmbiguities&&e.idx<a&&(n=e.path,r=o,n.length<r.length&&n.every((e,t)=>{let n=r[t];return e===n||n.categoryMatchesMap[e.tokenTypeIdx]}));var n,r}).map(e=>{let i=[e.idx+1,a+1],o=t.idx===0?``:t.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:t,ambiguityIndices:i,prefixPath:e.path}),type:Q.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}})})}(a,r,e,n);return o.concat(s)})}var en=class extends oe{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}};function tn(e){let t=Object.assign({errMsgProvider:bt},e),n={};return e.rules.forEach(e=>{n[e.name]=e}),function(e,t){let n=new St(e,t);return n.resolveRefs(),n.errors}(n,t.errMsgProvider)}var nn=`MismatchedTokenException`,rn=`NoViableAltException`,an=`EarlyExitException`,on=`NotAllInputParsedException`,sn=[nn,rn,an,on];function cn(e){return sn.includes(e.name)}Object.freeze(sn);var ln=class extends Error{constructor(e,t){super(e),this.token=t,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},un=class extends ln{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=nn}},dn=class extends ln{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=rn}},fn=class extends ln{constructor(e,t){super(e,t),this.name=on}},pn=class extends ln{constructor(e,t,n){super(e,t),this.previousToken=n,this.name=an}},mn={},hn=class extends Error{constructor(e){super(e),this.name=`InRuleRecoveryException`}};function gn(e,t,n,r,i,a,o){var s,c;let l=r|i,u=(s=this.firstAfterRepMap)[c=this.currRuleShortName]??(s[c]=[]),d=u[l];if(d===void 0){let e=this.getCurrRuleFullName();d=new a(this.getGAstProductions()[e],i).startWalking(),u[l]=d}let f=d.token,p=d.occurrence,m=d.isEndOfRule;this.RULE_STACK_IDX===0&&m&&f===void 0&&(f=X,p=1),f!==void 0&&p!==void 0&&this.shouldInRepetitionRecoveryBeTried(f,p,o)&&this.tryInRepetitionRecovery(e,t,n,f)}var _n=1024,vn=1280,yn=1536,bn=class{constructor(e){this.maxLookahead=e?.maxLookahead??$.maxLookahead}validate(e){let t=this.validateNoLeftRecursion(e.rules);if(t.length===0){let n=this.validateEmptyOrAlternatives(e.rules),r=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),i=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...t,...n,...r,...i]}return t}validateNoLeftRecursion(e){return e.flatMap(e=>Yt(e,e,xt))}validateEmptyOrAlternatives(e){return e.flatMap(e=>Qt(e,xt))}validateAmbiguousAlternationAlternatives(e,t){return e.flatMap(e=>$t(e,t,xt))}validateSomeNonEmptyLookaheadPath(e,t){return function(e,t,n){let r=[];return e.forEach(e=>{let i=new en;e.accept(i),i.allProductions.forEach(i=>{let a=Mt(i),o=i.maxLookahead||t;if(Ht(i.idx,e,a,o)[0].flat().length===0){let t=n.buildEmptyRepetitionError({topLevelRule:e,repetition:i});r.push({message:t,type:Q.NO_NON_EMPTY_LOOKAHEAD,ruleName:e.name})}})}),r}(e,t,xt)}buildLookaheadForAlternation(e){return function(e,t,n,r,i,a){let o=Vt(e,t,n);return a(o,r,Wt(o)?Ze:Xe,i)}(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,Nt)}buildLookaheadForOptional(e){return function(e,t,n,r,i,a){let o=Ht(e,t,i,n),s=Wt(o)?Ze:Xe;return a(o[0],s,r)}(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,Mt(e.prodType),Pt)}},xn=new class extends oe{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}};function Sn(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.endOffset=t.endOffset):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset)}function Cn(e,t){e.startOffset===-1?(e.startOffset=t.startOffset,e.startColumn=t.startColumn,e.startLine=t.startLine,e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine):e.endOffset<t.endOffset==1&&(e.endOffset=t.endOffset,e.endColumn=t.endColumn,e.endLine=t.endLine)}var wn;function Tn(e,t){Object.defineProperty(e,"name",{enumerable:!1,configurable:!0,writable:!1,value:t})}function En(e,t){let n=Object.keys(e),r=n.length;for(let i=0;i<r;i++){let r=e[n[i]],a=r.length;for(let e=0;e<a;e++){let n=r[e];n.tokenTypeIdx===void 0&&this[n.name](n.children,t)}}}function Dn(e,t){let n=function(){};return Tn(n,e+`BaseSemantics`),n.prototype={visit:function(e,t){if(Array.isArray(e)&&(e=e[0]),e!==void 0)return this[e.name](e.children,t)},validateVisitor:function(){let e=function(e,t){return function(e,t){return t.filter(t=>typeof e[t]==`function`==0).map(t=>({msg:`Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,type:wn.MISSING_METHOD,methodName:t})).filter(Boolean)}(e,t)}(this,t);if(e.length!==0){let t=e.map(e=>e.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join(`
|
|
40
|
+
|
|
41
|
+
`).replace(/\n/g,`
|
|
42
|
+
`)}`)}}},n.prototype.constructor=n,n._RULE_NAMES=t,n}(function(e){e[e.REDUNDANT_METHOD=0]=`REDUNDANT_METHOD`,e[e.MISSING_METHOD=1]=`MISSING_METHOD`})(wn||={});var On={description:`This Object indicates the Parser is during Recording Phase`};Object.freeze(On);var kn=!0,An=Y({name:`RECORDING_PHASE_TOKEN`,pattern:J.NA});et([An]);var jn=vt(An,`This IToken indicates the Parser is in Recording Phase
|
|
43
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(jn);var Mn={name:`This CSTNode indicates the Parser is in Recording Phase
|
|
44
|
+
See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};function Nn(e,t,n,r=!1){In(n);let i=this.recordingProdStack.at(-1),a=typeof t==`function`?t:t.DEF,o=new e({definition:[],idx:n});return r&&(o.separator=t.SEP),Object.hasOwn(t,`MAX_LOOKAHEAD`)&&(o.maxLookahead=t.MAX_LOOKAHEAD),this.recordingProdStack.push(o),a.call(this),i.definition.push(o),this.recordingProdStack.pop(),On}function Pn(e,t){In(t);let n=this.recordingProdStack.at(-1),r=!1===Array.isArray(e),i=!1===r?e:e.DEF,a=new z({definition:[],idx:t,ignoreAmbiguities:r&&!0===e.IGNORE_AMBIGUITIES});return Object.hasOwn(e,`MAX_LOOKAHEAD`)&&(a.maxLookahead=e.MAX_LOOKAHEAD),a.hasPredicates=i.some(e=>typeof e.GATE==`function`),n.definition.push(a),i.forEach(e=>{let t=new N({definition:[]});a.definition.push(t),Object.hasOwn(e,`IGNORE_AMBIGUITIES`)?t.ignoreAmbiguities=e.IGNORE_AMBIGUITIES:Object.hasOwn(e,`GATE`)&&(t.ignoreAmbiguities=!0),this.recordingProdStack.push(t),e.ALT.call(this),this.recordingProdStack.pop()}),On}function Fn(e){return e===0?``:`${e}`}function In(e){if(e<0||e>255){let t=Error(`Invalid DSL Method idx value: <${e}>\n\tIdx value must be a none negative value smaller than 256`);throw t.KNOWN_RECORDER_ERROR=!0,t}}var Ln=vt(X,``,-1,-1,-1,-1,-1,-1);Object.freeze(Ln);var Q,$=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:yt,nodeLocationTracking:`none`,traceInitPerf:!1,skipValidations:!1}),Rn=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});(function(e){e[e.INVALID_RULE_NAME=0]=`INVALID_RULE_NAME`,e[e.DUPLICATE_RULE_NAME=1]=`DUPLICATE_RULE_NAME`,e[e.INVALID_RULE_OVERRIDE=2]=`INVALID_RULE_OVERRIDE`,e[e.DUPLICATE_PRODUCTIONS=3]=`DUPLICATE_PRODUCTIONS`,e[e.UNRESOLVED_SUBRULE_REF=4]=`UNRESOLVED_SUBRULE_REF`,e[e.LEFT_RECURSION=5]=`LEFT_RECURSION`,e[e.NONE_LAST_EMPTY_ALT=6]=`NONE_LAST_EMPTY_ALT`,e[e.AMBIGUOUS_ALTS=7]=`AMBIGUOUS_ALTS`,e[e.CONFLICT_TOKENS_RULES_NAMESPACE=8]=`CONFLICT_TOKENS_RULES_NAMESPACE`,e[e.INVALID_TOKEN_NAME=9]=`INVALID_TOKEN_NAME`,e[e.NO_NON_EMPTY_LOOKAHEAD=10]=`NO_NON_EMPTY_LOOKAHEAD`,e[e.AMBIGUOUS_PREFIX_ALTS=11]=`AMBIGUOUS_PREFIX_ALTS`,e[e.TOO_MANY_ALTS=12]=`TOO_MANY_ALTS`,e[e.CUSTOM_LOOKAHEAD_VALIDATION=13]=`CUSTOM_LOOKAHEAD_VALIDATION`})(Q||={});var zn,Bn=class e{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT(`performSelfAnalysis`,()=>{let t;this.selfAnalysisDone=!0;let n=this.className;this.TRACE_INIT(`toFastProps`,()=>{ie(this)}),this.TRACE_INIT(`Grammar Recording`,()=>{try{this.enableRecording(),this.definedRulesNames.forEach(e=>{let t=this[e].originalGrammarAction,n;this.TRACE_INIT(`${e} Rule`,()=>{n=this.topLevelRuleRecord(e,t)}),this.gastProductionsCache[e]=n})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT(`Grammar Resolving`,()=>{r=tn({rules:Object.values(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT(`Grammar Validations`,()=>{if(r.length===0&&!1===this.skipValidations){let t=function(e){let t=e.errMsgProvider??xt;return Gt(e.rules,e.tokenTypes,t,e.grammarName)}({rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),errMsgProvider:xt,grammarName:n}),r=(e={lookaheadStrategy:this.lookaheadStrategy,rules:Object.values(this.gastProductionsCache),tokenTypes:Object.values(this.tokensMap),grammarName:n}).lookaheadStrategy.validate({rules:e.rules,tokenTypes:e.tokenTypes,grammarName:e.grammarName}).map(e=>Object.assign({type:Q.CUSTOM_LOOKAHEAD_VALIDATION},e));this.definitionErrors=this.definitionErrors.concat(t,r)}var e}),this.definitionErrors.length===0&&(this.recoveryEnabled&&this.TRACE_INIT(`computeAllProdsFollows`,()=>{let e=function(e){let t={};return e.forEach(e=>{let n=new fe(e).startWalking();Object.assign(t,n)}),t}(Object.values(this.gastProductionsCache));this.resyncFollows=e}),this.TRACE_INIT(`ComputeLookaheadFunctions`,()=>{var e,t;(t=(e=this.lookaheadStrategy).initialize)==null||t.call(e,{rules:Object.values(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Object.values(this.gastProductionsCache))})),!e.DEFER_DEFINITION_ERRORS_HANDLING&&this.definitionErrors.length!==0)throw t=this.definitionErrors.map(e=>e.message),Error(`Parser Definition Errors detected:\n ${t.join(`
|
|
45
|
+
-------------------------------
|
|
46
|
+
`)}`)})}constructor(e,t){this.definitionErrors=[],this.selfAnalysisDone=!1;let n=this;if(n.initErrorHandler(t),n.initLexerAdapter(),n.initLooksAhead(t),n.initRecognizerEngine(e,t),n.initRecoverable(t),n.initTreeBuilder(t),n.initGastRecorder(t),n.initPerformanceTracer(t),Object.hasOwn(t,`ignoredIssues`))throw Error(`The <ignoredIssues> IParserConfig property has been deprecated.
|
|
47
|
+
Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
|
|
48
|
+
See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
|
|
49
|
+
For further details.`);this.skipValidations=Object.hasOwn(t,`skipValidations`)?t.skipValidations:$.skipValidations}};Bn.DEFER_DEFINITION_ERRORS_HANDLING=!1,zn=Bn,[class{initRecoverable(e){this.firstAfterRepMap=[],this.resyncFollows={},this.recoveryEnabled=Object.hasOwn(e,`recoveryEnabled`)?e.recoveryEnabled:$.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=gn)}getTokenToInsert(e){let t=vt(e,``,-1,-1,-1,-1,-1,-1);return t.isInsertedInRecovery=!0,t}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,t,n,r){let i=this.findReSyncTokenType(),a=this.exportLexerState(),o=[],s=!1,c=this.LA_FAST(1),l=this.LA_FAST(1),u=()=>{let e=this.LA(0),t=new un(this.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:c,previous:e,ruleName:this.getCurrRuleFullName()}),c,this.LA(0));t.resyncedTokens=o.slice(0,-1),this.SAVE_ERROR(t)};for(;!s;){if(this.tokenMatcher(l,r))return void u();if(n.call(this))return u(),void e.apply(this,t);this.tokenMatcher(l,i)?s=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,o))}this.importLexerState(a)}shouldInRepetitionRecoveryBeTried(e,t,n){return!1!==n&&!this.tokenMatcher(this.LA_FAST(1),e)&&!this.isBackTracking()&&!this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,t))}getNextPossibleTokenTypes(e){let t=e.ruleStack[0],n=this.getGAstProductions()[t];return new wt(n,e).startWalking()}getFollowsForInRuleRecovery(e,t){let n=this.getCurrentGrammarPath(e,t);return this.getNextPossibleTokenTypes(n)}tryInRuleRecovery(e,t){if(this.canRecoverWithSingleTokenInsertion(e,t))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){let e=this.SKIP_TOKEN();return this.consumeToken(),e}throw new hn(`sad sad panda`)}canPerformInRuleRecovery(e,t){return this.canRecoverWithSingleTokenInsertion(e,t)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,t){if(!this.canTokenTypeBeInsertedInRecovery(e)||t.length===0)return!1;let n=this.LA_FAST(1);return t.find(e=>this.tokenMatcher(n,e))!==void 0}canRecoverWithSingleTokenDeletion(e){return!!this.canTokenTypeBeDeletedInRecovery(e)&&this.tokenMatcher(this.LA(2),e)}isInCurrentRuleReSyncSet(e){let t=this.getCurrFollowKey();return this.getFollowSetFromFollowKey(t).includes(e)}findReSyncTokenType(){let e=this.flattenFollowSet(),t=this.LA_FAST(1),n=2;for(;;){let r=e.find(e=>Xe(t,e));if(r!==void 0)return r;t=this.LA(n),n++}}getCurrFollowKey(){if(this.RULE_STACK_IDX===0)return mn;let e=this.currRuleShortName,t=this.getLastExplicitRuleOccurrenceIndex(),n=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:t,inRule:this.shortRuleNameToFullName(n)}}buildFullFollowKeyStack(){let e=this.RULE_STACK,t=this.RULE_OCCURRENCE_STACK,n=this.RULE_STACK_IDX+1,r=Array(n);for(let i=0;i<n;i++)r[i]=i===0?mn:{ruleName:this.shortRuleNameToFullName(e[i]),idxInCallingRule:t[i],inRule:this.shortRuleNameToFullName(e[i-1])};return r}flattenFollowSet(){return this.buildFullFollowKeyStack().map(e=>this.getFollowSetFromFollowKey(e)).flat()}getFollowSetFromFollowKey(e){if(e===mn)return[X];let t=e.ruleName+e.idxInCallingRule+de+e.inRule;return this.resyncFollows[t]}addToResyncTokens(e,t){return this.tokenMatcher(e,X)||t.push(e),t}reSyncTo(e){let t=[],n=this.LA_FAST(1);for(;!1===this.tokenMatcher(n,e);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,t);return t.slice(0,-1)}attemptInRepetitionRecovery(e,t,n,r,i,a,o){}getCurrentGrammarPath(e,t){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1),lastTok:e,lastTokOccurrence:t}}getHumanReadableRuleStack(){let e=this.RULE_STACK_IDX+1,t=Array(e);for(let n=0;n<e;n++)t[n]=this.shortRuleNameToFullName(this.RULE_STACK[n]);return t}},class{initLooksAhead(e){this.dynamicTokensEnabled=Object.hasOwn(e,`dynamicTokensEnabled`)?e.dynamicTokensEnabled:$.dynamicTokensEnabled,this.maxLookahead=Object.hasOwn(e,`maxLookahead`)?e.maxLookahead:$.maxLookahead,this.lookaheadStrategy=Object.hasOwn(e,`lookaheadStrategy`)?e.lookaheadStrategy:new bn({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=[],this.currRuleLookaheadFuncs=[]}preComputeLookaheadFunctions(e){e.forEach(e=>{this.TRACE_INIT(`${e.name} Rule Lookahead`,()=>{let{alternation:t,repetition:n,option:r,repetitionMandatory:i,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:o}=function(e){xn.reset(),e.accept(xn);let t=xn.dslMethods;return xn.reset(),t}(e);t.forEach(t=>{let n=t.idx===0?``:t.idx;this.TRACE_INIT(`${H(t)}${n}`,()=>{let n=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:t.idx,rule:e,maxLookahead:t.maxLookahead||this.maxLookahead,hasPredicates:t.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled});this.setLaFuncCache(this.fullRuleNameToShort[e.name],256|t.idx,n)})}),n.forEach(t=>{this.computeLookaheadFunc(e,t.idx,768,`Repetition`,t.maxLookahead,H(t))}),r.forEach(t=>{this.computeLookaheadFunc(e,t.idx,512,`Option`,t.maxLookahead,H(t))}),i.forEach(t=>{this.computeLookaheadFunc(e,t.idx,_n,`RepetitionMandatory`,t.maxLookahead,H(t))}),a.forEach(t=>{this.computeLookaheadFunc(e,t.idx,yn,`RepetitionMandatoryWithSeparator`,t.maxLookahead,H(t))}),o.forEach(t=>{this.computeLookaheadFunc(e,t.idx,vn,`RepetitionWithSeparator`,t.maxLookahead,H(t))})})})}computeLookaheadFunc(e,t,n,r,i,a){this.TRACE_INIT(`${a}${t===0?``:t}`,()=>{let a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:t,rule:e,maxLookahead:i||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:r});this.setLaFuncCache(this.fullRuleNameToShort[e.name],n|t,a)})}setLaFuncCache(e,t,n){let r=this.lookAheadFuncsCache[e];r===void 0&&(r=[],this.lookAheadFuncsCache[e]=r),r[t]=n}},class{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=Object.hasOwn(e,`nodeLocationTracking`)?e.nodeLocationTracking:$.nodeLocationTracking,this.outputCst){if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Cn,this.setNodeLocationFromNode=Cn,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=Sn,this.setNodeLocationFromNode=Sn,this.cstPostRule=()=>{},this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`);this.setNodeLocationFromToken=()=>{},this.setNodeLocationFromNode=()=>{},this.cstPostRule=()=>{},this.setInitialNodeLocation=()=>{}}}else this.cstInvocationStateUpdate=()=>{},this.cstFinallyStateUpdate=()=>{},this.cstPostTerminal=()=>{},this.cstPostNonTerminal=()=>{},this.cstPostRule=()=>{}}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:-1,endOffset:-1}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA_FAST(1).startOffset,endOffset:-1}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:-1,startLine:-1,startColumn:-1,endOffset:-1,endLine:-1,endColumn:-1}}setInitialNodeLocationFullRegular(e){let t=this.LA_FAST(1);e.location={startOffset:t.startOffset,startLine:t.startLine,startColumn:t.startColumn,endOffset:-1,endLine:-1,endColumn:-1}}cstInvocationStateUpdate(e){let t={name:e,children:Object.create(null)};this.setInitialNodeLocation(t),this.CST_STACK.push(t)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){let t=this.LA(0),n=e.location;n.startOffset!==-1&&n.startOffset<=t.startOffset==1?(n.endOffset=t.endOffset,n.endLine=t.endLine,n.endColumn=t.endColumn):(n.startOffset=-1,n.startLine=-1,n.startColumn=-1)}cstPostRuleOnlyOffset(e){let t=this.LA(0),n=e.location;n.startOffset!==-1&&n.startOffset<=t.startOffset==1?n.endOffset=t.endOffset:n.startOffset=-1}cstPostTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];var r,i=t,a=e;(r=n).children[a]===void 0?r.children[a]=[i]:r.children[a].push(i),this.setNodeLocationFromToken(n.location,t)}cstPostNonTerminal(e,t){let n=this.CST_STACK[this.CST_STACK.length-1];(function(e,t,n){e.children[t]===void 0?e.children[t]=[n]:e.children[t].push(n)})(n,t,e),this.setNodeLocationFromNode(n.location,e.location)}get currCSTNode(){return this.CST_STACK[this.CST_STACK.length-1]}getBaseCstVisitorConstructor(){if(this.baseCstVisitorConstructor===void 0){let e=Dn(this.className,Object.keys(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(this.baseCstVisitorWithDefaultsConstructor===void 0){let e=function(e,t,n){let r=function(){};Tn(r,e+`BaseSemanticsWithDefaults`);let i=Object.create(n.prototype);return t.forEach(e=>{i[e]=En}),(r.prototype=i).constructor=r,r}(this.className,Object.keys(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getPreviousExplicitRuleShortName(){return this.RULE_STACK[this.RULE_STACK_IDX-1]}getLastExplicitRuleOccurrenceIndex(){return this.RULE_OCCURRENCE_STACK[this.RULE_OCCURRENCE_STACK_IDX]}},class{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(!0!==this.selfAnalysisDone)throw Error(`Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.`);this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVectorLength-2?(this.consumeToken(),this.LA_FAST(1)):Ln}LA_FAST(e){let t=this.currIdx+e;return this.tokVector[t]}LA(e){let t=this.currIdx+e;return t<0||this.tokVectorLength<=t?Ln:this.tokVector[t]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVectorLength-1}getLexerPosition(){return this.exportLexerState()}},class{initRecognizerEngine(e,t){if(this.className=this.constructor.name,this.shortRuleNameToFull=[],this.fullRuleNameToShort={},this.ruleShortNameIdx=0,this.tokenMatcher=Ze,this.subruleIdx=0,this.currRuleShortName=-1,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK=[],this.RULE_OCCURRENCE_STACK_IDX=-1,this.gastProductionsCache={},Object.hasOwn(t,`serializedGrammar`))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
|
|
50
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
|
|
51
|
+
For Further details.`);if(Array.isArray(e)){if(e.length===0)throw Error(`A Token Vocabulary cannot be empty.
|
|
52
|
+
Note that the first argument for the parser constructor
|
|
53
|
+
is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset==`number`)throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
|
|
54
|
+
See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
|
|
55
|
+
For Further details.`)}if(Array.isArray(e))this.tokensMap=e.reduce((e,t)=>(e[t.name]=t,e),{});else if(Object.hasOwn(e,`modes`)&&Object.values(e.modes).flat().every(it)){let t=Object.values(e.modes).flat(),n=[...new Set(t)];this.tokensMap=n.reduce((e,t)=>(e[t.name]=t,e),{})}else{if(typeof e!=`object`||!e)throw Error(`<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition`);this.tokensMap=Object.assign({},e)}this.tokensMap.EOF=X;let n=(Object.hasOwn(e,`modes`)?Object.values(e.modes).flat():Object.values(e)).every(e=>e.categoryMatches?.length==0);this.tokenMatcher=n?Ze:Xe,et(Object.values(this.tokensMap))}defineRule(e,t,n){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);let r=Object.hasOwn(n,`resyncEnabled`)?n.resyncEnabled:Rn.resyncEnabled,i=Object.hasOwn(n,`recoveryValueFunc`)?n.recoveryValueFunc:Rn.recoveryValueFunc,a=this.ruleShortNameIdx++,o;return this.shortRuleNameToFull[a]=e,this.fullRuleNameToShort[e]=a,o=!0===this.outputCst?function(...n){try{this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n);let r=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(r),r}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}}:function(...n){try{return this.ruleInvocationStateUpdate(a,e,this.subruleIdx),t.apply(this,n)}catch(e){return this.invokeRuleCatch(e,r,i)}finally{this.ruleFinallyStateUpdate()}},Object.assign(function(...t){this.onBeforeParse(e);try{return o.apply(this,t)}finally{this.onAfterParse(e)}},{ruleName:e,originalGrammarAction:t,coreRule:o})}invokeRuleCatch(e,t,n){let r=this.RULE_STACK_IDX===0,i=t&&!this.isBackTracking()&&this.recoveryEnabled;if(cn(e)){let t=e;if(i){let r=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(r)){if(t.resyncedTokens=this.reSyncTo(r),this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];return e.recoveredNode=!0,e}return n(e)}if(this.outputCst){let e=this.CST_STACK[this.CST_STACK.length-1];e.recoveredNode=!0,t.partialCstResult=e}throw t}if(r)return this.moveToTerminatedState(),n(e);throw t}throw e}optionInternal(e,t){let n=512|t;return this.optionInternalLogic(e,t,n)}optionInternalLogic(e,t,n){let r,i=this.currRuleLookaheadFuncs[n];if(typeof e!=`function`){r=e.DEF;let t=e.GATE;if(t!==void 0){let e=i;i=()=>t.call(this)&&e.call(this)}}else r=e;if(!0===i.call(this))return r.call(this)}atLeastOneInternal(e,t){let n=_n|e;return this.atLeastOneInternalLogic(e,t,n)}atLeastOneInternalLogic(e,t,n){let r,i=this.currRuleLookaheadFuncs[n];if(typeof t!=`function`){r=t.DEF;let e=t.GATE;if(e!==void 0){let t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;if(!0!==i.call(this))throw this.raiseEarlyExitException(e,Z.REPETITION_MANDATORY,t.ERR_MSG);{let e=this.doSingleRepetition(r);for(;!0===i.call(this)&&!0===e;)e=this.doSingleRepetition(r)}this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,t],i,_n,e,Ot)}atLeastOneSepFirstInternal(e,t){let n=yn|e;this.atLeastOneSepFirstInternalLogic(e,t,n)}atLeastOneSepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(!0!==this.currRuleLookaheadFuncs[n].call(this))throw this.raiseEarlyExitException(e,Z.REPETITION_MANDATORY_WITH_SEPARATOR,t.ERR_MSG);{r.call(this);let t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,kt],t,yn,e,kt)}}manyInternal(e,t){let n=768|e;return this.manyInternalLogic(e,t,n)}manyInternalLogic(e,t,n){let r,i=this.currRuleLookaheadFuncs[n];if(typeof t!=`function`){r=t.DEF;let e=t.GATE;if(e!==void 0){let t=i;i=()=>e.call(this)&&t.call(this)}}else r=t;let a=!0;for(;!0===i.call(this)&&!0===a;)a=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[e,t],i,768,e,Et,a)}manySepFirstInternal(e,t){let n=vn|e;this.manySepFirstInternalLogic(e,t,n)}manySepFirstInternalLogic(e,t,n){let r=t.DEF,i=t.SEP;if(!0===this.currRuleLookaheadFuncs[n].call(this)){r.call(this);let t=()=>this.tokenMatcher(this.LA_FAST(1),i);for(;!0===this.tokenMatcher(this.LA_FAST(1),i);)this.CONSUME(i),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,i,t,r,Dt],t,vn,e,Dt)}}repetitionSepSecondInternal(e,t,n,r,i){for(;n();)this.CONSUME(t),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,t,n,r,i],n,yn,e,i)}doSingleRepetition(e){let t=this.getLexerPosition();return e.call(this),this.getLexerPosition()>t}orInternal(e,t){let n=256|t,r=Array.isArray(e)?e:e.DEF,i=this.currRuleLookaheadFuncs[n].call(this,r);if(i!==void 0)return r[i].ALT.call(this);this.raiseNoAltException(t,e.ERR_MSG)}ruleFinallyStateUpdate(){this.RULE_STACK_IDX--,this.RULE_OCCURRENCE_STACK_IDX--,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName]),this.cstFinallyStateUpdate()}subruleInternal(e,t,n){let r;try{let i=n===void 0?void 0:n.ARGS;return this.subruleIdx=t,r=e.coreRule.apply(this,i),this.cstPostNonTerminal(r,n!==void 0&&n.LABEL!==void 0?n.LABEL:e.ruleName),r}catch(t){throw this.subruleInternalError(t,n,e.ruleName)}}subruleInternalError(e,t,n){throw cn(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,t!==void 0&&t.LABEL!==void 0?t.LABEL:n),delete e.partialCstResult),e}consumeInternal(e,t,n){let r;try{let t=this.LA_FAST(1);!0===this.tokenMatcher(t,e)?(this.consumeToken(),r=t):this.consumeInternalError(e,t,n)}catch(n){r=this.consumeInternalRecovery(e,t,n)}return this.cstPostTerminal(n!==void 0&&n.LABEL!==void 0?n.LABEL:e.name,r),r}consumeInternalError(e,t,n){let r,i=this.LA(0);throw r=n!==void 0&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:t,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new un(r,t,i))}consumeInternalRecovery(e,t,n){if(!this.recoveryEnabled||n.name!==`MismatchedTokenException`||this.isBackTracking())throw n;{let r=this.getFollowsForInRuleRecovery(e,t);try{return this.tryInRuleRecovery(e,r)}catch(e){throw e.name===`InRuleRecoveryException`?n:e}}}saveRecogState(){let e=this.errors,t=this.RULE_STACK.slice(0,this.RULE_STACK_IDX+1);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:t,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState);let t=e.RULE_STACK;for(let e=0;e<t.length;e++)this.RULE_STACK[e]=t[e];this.RULE_STACK_IDX=t.length-1,this.RULE_STACK_IDX>=0&&(this.currRuleShortName=this.RULE_STACK[this.RULE_STACK_IDX],this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[this.currRuleShortName])}ruleInvocationStateUpdate(e,t,n){this.RULE_OCCURRENCE_STACK[++this.RULE_OCCURRENCE_STACK_IDX]=n,this.RULE_STACK[++this.RULE_STACK_IDX]=e,this.currRuleShortName=e,this.currRuleLookaheadFuncs=this.lookAheadFuncsCache[e],this.cstInvocationStateUpdate(t)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){let e=this.currRuleShortName;return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),X)}reset(){this.resetLexerState(),this.subruleIdx=0,this.currRuleShortName=-1,this.currRuleLookaheadFuncs=[],this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK_IDX=-1,this.RULE_OCCURRENCE_STACK_IDX=-1,this.CST_STACK=[]}onBeforeParse(e){for(let e=0;e<this.maxLookahead+1;e++)this.tokVector.push(Ln)}onAfterParse(e){if(!1===this.isAtEndOfInput()){let e=this.LA(1),t=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new fn(t,e))}for(;this.tokVector.at(-1)===Ln;)this.tokVector.pop()}},class{ACTION(e){return e.call(this)}consume(e,t,n){return this.consumeInternal(t,e,n)}subrule(e,t,n){return this.subruleInternal(t,e,n)}option(e,t){return this.optionInternal(t,e)}or(e,t){return this.orInternal(t,e)}many(e,t){return this.manyInternal(e,t)}atLeastOne(e,t){return this.atLeastOneInternal(e,t)}CONSUME(e,t){return this.consumeInternal(e,0,t)}CONSUME1(e,t){return this.consumeInternal(e,1,t)}CONSUME2(e,t){return this.consumeInternal(e,2,t)}CONSUME3(e,t){return this.consumeInternal(e,3,t)}CONSUME4(e,t){return this.consumeInternal(e,4,t)}CONSUME5(e,t){return this.consumeInternal(e,5,t)}CONSUME6(e,t){return this.consumeInternal(e,6,t)}CONSUME7(e,t){return this.consumeInternal(e,7,t)}CONSUME8(e,t){return this.consumeInternal(e,8,t)}CONSUME9(e,t){return this.consumeInternal(e,9,t)}SUBRULE(e,t){return this.subruleInternal(e,0,t)}SUBRULE1(e,t){return this.subruleInternal(e,1,t)}SUBRULE2(e,t){return this.subruleInternal(e,2,t)}SUBRULE3(e,t){return this.subruleInternal(e,3,t)}SUBRULE4(e,t){return this.subruleInternal(e,4,t)}SUBRULE5(e,t){return this.subruleInternal(e,5,t)}SUBRULE6(e,t){return this.subruleInternal(e,6,t)}SUBRULE7(e,t){return this.subruleInternal(e,7,t)}SUBRULE8(e,t){return this.subruleInternal(e,8,t)}SUBRULE9(e,t){return this.subruleInternal(e,9,t)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,t,n=Rn){if(this.definedRulesNames.includes(e)){let t={message:xt.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:Q.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(t)}this.definedRulesNames.push(e);let r=this.defineRule(e,t,n);return this[e]=r,r}OVERRIDE_RULE(e,t,n=Rn){let r=function(e,t,n){let r=[],i;return t.includes(e)||(i=`Invalid rule override, rule: ->${e}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:Q.INVALID_RULE_OVERRIDE,ruleName:e})),r}(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(r);let i=this.defineRule(e,t,n);return this[e]=i,i}BACKTRACK(e,t){let n=e.coreRule??e;return function(){this.isBackTrackingStack.push(1);let e=this.saveRecogState();try{return n.apply(this,t),!0}catch(e){if(cn(e))return!1;throw e}finally{this.reloadRecogState(e),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return Object.values(this.gastProductionsCache).map(ae)}},class{initErrorHandler(e){this._errors=[],this.errorMessageProvider=Object.hasOwn(e,`errorMessageProvider`)?e.errorMessageProvider:$.errorMessageProvider}SAVE_ERROR(e){if(cn(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:this.RULE_OCCURRENCE_STACK.slice(0,this.RULE_OCCURRENCE_STACK_IDX+1)},this._errors.push(e),e;throw Error(`Trying to save an Error which is not a RecognitionException`)}get errors(){return[...this._errors]}set errors(e){this._errors=e}raiseEarlyExitException(e,t,n){let r=this.getCurrRuleFullName(),i=Ht(e,this.getGAstProductions()[r],t,this.maxLookahead)[0],a=[];for(let e=1;e<=this.maxLookahead;e++)a.push(this.LA(e));let o=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:i,actual:a,previous:this.LA(0),customUserDescription:n,ruleName:r});throw this.SAVE_ERROR(new pn(o,this.LA(1),this.LA(0)))}raiseNoAltException(e,t){let n=this.getCurrRuleFullName(),r=Vt(e,this.getGAstProductions()[n],this.maxLookahead),i=[];for(let e=1;e<=this.maxLookahead;e++)i.push(this.LA(e));let a=this.LA(0),o=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:r,actual:i,previous:a,customUserDescription:t,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new dn(o,this.LA(1),a))}},class{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT(`Enable Recording`,()=>{for(let e=0;e<10;e++){let t=e>0?e:``;this[`CONSUME${t}`]=function(t,n){return this.consumeInternalRecord(t,e,n)},this[`SUBRULE${t}`]=function(t,n){return this.subruleInternalRecord(t,e,n)},this[`OPTION${t}`]=function(t){return this.optionInternalRecord(t,e)},this[`OR${t}`]=function(t){return this.orInternalRecord(t,e)},this[`MANY${t}`]=function(t){this.manyInternalRecord(e,t)},this[`MANY_SEP${t}`]=function(t){this.manySepFirstInternalRecord(e,t)},this[`AT_LEAST_ONE${t}`]=function(t){this.atLeastOneInternalRecord(e,t)},this[`AT_LEAST_ONE_SEP${t}`]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}}this.consume=function(e,t,n){return this.consumeInternalRecord(t,e,n)},this.subrule=function(e,t,n){return this.subruleInternalRecord(t,e,n)},this.option=function(e,t){return this.optionInternalRecord(t,e)},this.or=function(e,t){return this.orInternalRecord(t,e)},this.many=function(e,t){this.manyInternalRecord(e,t)},this.atLeastOne=function(e,t){this.atLeastOneInternalRecord(e,t)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT(`Deleting Recording methods`,()=>{let e=this;for(let t=0;t<10;t++){let n=t>0?t:``;delete e[`CONSUME${n}`],delete e[`SUBRULE${n}`],delete e[`OPTION${n}`],delete e[`OR${n}`],delete e[`MANY${n}`],delete e[`MANY_SEP${n}`],delete e[`AT_LEAST_ONE${n}`],delete e[`AT_LEAST_ONE_SEP${n}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,t){return()=>!0}LA_RECORD(e){return Ln}topLevelRuleRecord(e,t){try{let n=new M({definition:[],name:e});return n.name=e,this.recordingProdStack.push(n),t.call(this),this.recordingProdStack.pop(),n}catch(e){if(!0!==e.KNOWN_RECORDER_ERROR)try{e.message+=`
|
|
56
|
+
This error was thrown during the "grammar recording phase" For more info see:
|
|
57
|
+
https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw e}throw e}}optionInternalRecord(e,t){return Nn.call(this,P,e,t)}atLeastOneInternalRecord(e,t){Nn.call(this,F,t,e)}atLeastOneSepFirstInternalRecord(e,t){Nn.call(this,I,t,e,kn)}manyInternalRecord(e,t){Nn.call(this,L,t,e)}manySepFirstInternalRecord(e,t){Nn.call(this,R,t,e,kn)}orInternalRecord(e,t){return Pn.call(this,e,t)}subruleInternalRecord(e,t,n){if(In(t),!e||!Object.hasOwn(e,`ruleName`)){let n=Error(`<SUBRULE${Fn(t)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=this.recordingProdStack.at(-1),i=e.ruleName,a=new j({idx:t,nonTerminalName:i,label:n?.LABEL,referencedRule:void 0});return r.definition.push(a),this.outputCst?Mn:On}consumeInternalRecord(e,t,n){if(In(t),!nt(e)){let n=Error(`<CONSUME${Fn(t)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>\n inside top level rule: <${this.recordingProdStack[0].name}>`);throw n.KNOWN_RECORDER_ERROR=!0,n}let r=this.recordingProdStack.at(-1),i=new B({idx:t,terminalType:e,label:n?.LABEL});return r.definition.push(i),jn}},class{initPerformanceTracer(e){if(Object.hasOwn(e,`traceInitPerf`)){let t=e.traceInitPerf,n=typeof t==`number`;this.traceInitMaxIdent=n?t:1/0,this.traceInitPerf=n?t>0:t}else this.traceInitMaxIdent=0,this.traceInitPerf=$.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,t){if(!0===this.traceInitPerf){this.traceInitIndent++;let n=Array(this.traceInitIndent+1).join(` `);this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${n}--\x3e <${e}>`);let{time:r,value:i}=re(t),a=r>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&a(`${n}<-- <${e}> time: ${r}ms`),this.traceInitIndent--,i}return t()}}].forEach(e=>{let t=e.prototype;Object.getOwnPropertyNames(t).forEach(n=>{if(n===`constructor`)return;let r=Object.getOwnPropertyDescriptor(t,n);r&&(r.get||r.set)?Object.defineProperty(zn.prototype,n,r):zn.prototype[n]=e.prototype[n]})});var Vn=class extends Bn{constructor(e,t=$){let n=Object.assign({},t);n.outputCst=!1,super(e,n)}},Hn=class t{static shared(e){let n=e?.locale??l,r=e?.maxColumn??Kn,i=e?.maxRow??qn,a=Gn.get(n);a||(a=new Map,Gn.set(n,a));let o=`${r}:${i}`,s=a.get(o);return s||(s=new t({locale:n,maxColumn:r,maxRow:i}),a.set(o,s)),s}constructor(e){let t=e?.maxColumn??Kn,n=e?.maxRow??qn,r=e?.locale??l;this._locale=r,this._maxColumn=t,this._maxRow=n;let{separatorFunction:i,separatorColumn:a,separatorRow:o,separatorDecimal:s}=r.separators;if(a===o)throw Error(`FormulaLexer: separatorColumn and separatorRow must differ (both '${a}')`);let c=Y({name:`WhiteSpace`,pattern:/[ \n\v\f\r\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,group:J.SKIPPED}),u=Y({name:`StringToken`,pattern:/"(""|[^"])*"/}),d=Y({name:`FunctionToken`,pattern:/[a-zA-Z_\u007F-\uFFFF]+[a-zA-Z0-9_.\u007F-\uFFFF]*(?=\()/}),f=Y({name:`TableReference`,pattern:{exec:m},line_breaks:!1,start_chars_hint:Wn}),p=Y({name:`BracketedString`,pattern:{exec:te},line_breaks:!1,start_chars_hint:[91],longer_alt:[f,u]}),h=e=>(e??[]).map(e=>e?.trim()).filter(Boolean).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).map(e=>e+`|`).join(``),g=e=>e.replace(/[A-Za-z]/g,e=>`[${e.toUpperCase()}${e.toLowerCase()}]`),_=Y({name:`LiteralError`,pattern:new RegExp(h(r.errorLiterals)+[`#PARSE!`,`#NULL!`,`#DIV\\/0!`,`#VALUE!`,`#NUM!`,`#FIELD!`,`#N\\/A`,`#GETTING_DATA`,`#SPILL!`,`#CONNECT!`,`#BLOCKED!`,`#UNKNOWN!`,`#CALC!`,`#BUSY!`,`#PYTHON!`,`#TIMEOUT!`].map(g).join(`|`))}),v=Y({name:`RefError`,pattern:new RegExp(h(r.errorRefs)+[`#REF!`,`#NAME\\?`].map(g).join(`|`))}),y=Y({name:`SingleQuotedString`,pattern:/'(''|[^'])*'/}),b=Y({name:`SheetQuoted`,pattern:/'(?:''|[^'])*?'!/}),x=Y({name:`Sheet`,pattern:/[A-Za-z_.\d\u007F-\uFFFF]*!/}),S=/[a-zA-Z_\\\u007F-\uFFFF][a-zA-Z0-9_.?\\\u007F-\uFFFF]*:?/y,C=Y({name:`NamedToken`,pattern:{exec:(e,t)=>{S.lastIndex=t;let n=S.exec(e);if(!n)return null;let r=n[0],i=r.indexOf(`.:`);return i===-1?r.endsWith(`:`)&&(r=r.slice(0,-1)):r=r.substring(0,i),[r]}},line_breaks:!1,start_chars_hint:Wn}),ee=Y({name:`Cell`,pattern:{exec:Xn(t,n)},line_breaks:!1,start_chars_hint:[36,...Un],longer_alt:C}),w=Y({name:`Column`,pattern:{exec:Yn(t)},line_breaks:!1,start_chars_hint:[36,...Un],longer_alt:C}),T=Y({name:`AbsRow`,pattern:/[$][0-9]+/}),E=s===`.`?`\\.`:s,ne=Y({name:`NumberToken`,pattern:RegExp(`[0-9]+${E}(?!:)[0-9]*([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|${E}[0-9]+([eE][+-]?[0-9]+|\\*\\*[+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+`)}),D=Y({name:`ScientificDigit`,pattern:/[0-9]+\*\*[+-]?[0-9]+/}),O=Y({name:`DigitToken`,pattern:/[0-9]+/}),k=[`TRUE`,`FALSE`];for(let e of[r.booleanTrue,r.booleanFalse]){let t=e?.trim();t&&!k.some(e=>e.toLowerCase()===t.toLowerCase())&&k.push(t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`))}let re=Y({name:`BooleanToken`,pattern:new RegExp(k.join(`|`),`i`)}),ie=Y({name:`ArgSeparator`,pattern:Zn(i)}),A=Y({name:`ColSeparator`,pattern:Zn(a)}),j=Y({name:`RowSeparator`,pattern:Zn(o)}),M=Y({name:`RangeOp`,pattern:/:/}),N=Y({name:`RangeTrimFullOp`,pattern:/\.:\./}),P=Y({name:`RangeTrimLeadingOp`,pattern:/\.:/}),F=Y({name:`RangeTrimTrailingOp`,pattern:/:\./}),I=Y({name:`OpenParen`,pattern:/\(/}),L=Y({name:`CloseParen`,pattern:/\)/}),R=Y({name:`OpenCurlyParen`,pattern:/{/}),z=Y({name:`CloseCurlyParen`,pattern:/}/}),B=Y({name:`QuoteS`,pattern:/'/}),ae=Y({name:`MulOp`,pattern:/\*(?!\*)/}),V=Y({name:`PlusOp`,pattern:/\+/}),oe=Y({name:`DivOp`,pattern:/\//}),se=Y({name:`MinOp`,pattern:/-/}),H=Y({name:`ImplicitIntersectOp`,pattern:/@/}),ce=Y({name:`ConcatOp`,pattern:/&/}),le=Y({name:`ExOp`,pattern:/\^/}),ue=Y({name:`PercentOp`,pattern:/%/}),de=Y({name:`ArrayAnchorOp`,pattern:/#/,longer_alt:[_,v]}),fe=Y({name:`GtOp`,pattern:/>/}),U=Y({name:`EqOp`,pattern:/=/}),pe=Y({name:`LtOp`,pattern:/</}),W=[c,u,b,y,x,d,f,p,_,v,ie,...a===i?[]:[A],j,N,P,F,M,ee,re,w,T,ne,D,O,de,H,C,I,L,R,z,B,ae,V,oe,se,ce,le,ue,Y({name:`NeqOp`,pattern:/<>/}),Y({name:`GteOp`,pattern:/>=/}),Y({name:`LteOp`,pattern:/<=/}),fe,U,pe];this._lexer=new J(W,{ensureOptimizations:!0});let G={};W.forEach(e=>{G[e.name]=e}),a===i&&(G.ColSeparator=ie),this._vocabulary=G}tokenize(t,n=!0){let r=this._lexer.tokenize(t);if(n&&r.errors.length>0){let n=r.errors[0],i=n.line,a=n.column,o=t.substr(n.offset,n.length||1),s=o?`Unexpected character '${o}'`:n.message;throw new e.Parse(s,{line:i,column:a,offset:n.offset,length:n.length})}return r}getVocabulary(){return this._vocabulary}getLocale(){return this._locale}getMaxColumn(){return this._maxColumn}getMaxRow(){return this._maxRow}getSeparators(){return this._locale.separators}},Un=(()=>{let e=[];for(let t=65;t<=90;t++)e.push(t);for(let t=97;t<=122;t++)e.push(t);for(let t=48;t<=57;t++)e.push(t);return e})().filter(e=>e<48||e>57),Wn=(()=>{let e=[...Un,95,92];for(let t=127;t<=65535;t++)e.push(t);return e})(),Gn=new WeakMap,Kn=16384,qn=1048576;function Jn(e,t,n){let r=0;for(let i=t;i<n;i++){let t=e.charCodeAt(i);r=26*r+(t>=97?t-96:t-64)}return r}function Yn(e){return(t,n)=>{let r=n;t.charCodeAt(r)===36&&r++;let i=r;for(;r<t.length&&r-i<3;){let e=t.charCodeAt(r);if(!(e>=65&&e<=90||e>=97&&e<=122))break;r++}if(r-i===0||Jn(t,i,r)>e)return null;if(r<t.length){let e=t.charCodeAt(r);if(e>=48&&e<=57)return null}return[t.substring(n,r)]}}function Xn(e,t){return(n,r)=>{let i=r;n.charCodeAt(i)===36&&i++;let a=i;for(;i<n.length&&i-a<3;){let e=n.charCodeAt(i);if(!(e>=65&&e<=90||e>=97&&e<=122))break;i++}if(i-a===0||Jn(n,a,i)>e)return null;i<n.length&&n.charCodeAt(i)===36&&i++;let o=i;for(;i<n.length;){let e=n.charCodeAt(i);if(!(e>=48&&e<=57))break;i++}if(i===o)return null;let s=parseInt(n.substring(o,i),10);return s<1||s>t?null:[n.substring(r,i)]}}function Zn(e){return new RegExp(e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`))}var Qn=class{constructor(e=l){let t=function(e){let t=[...g];if(e)for(let n of Object.values(e)){let e=n?.trim();e&&!t.some(t=>t.toLowerCase()===e.toLowerCase())&&t.push(e)}return t.sort((e,t)=>t.length-e.length),t.map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`)}(e.specifiers),n=Y({name:`WhiteSpace`,pattern:/\s+/,group:J.SKIPPED}),r=Y({name:`TableSpecifier`,pattern:RegExp(`\\[#(?:${t})\\]`,`i`)}),i=[n,r,Y({name:`BracketedColumn`,pattern:/\[(?:'['#[\]]|'(?!['#[\]])|[^'[\]])*\]/,longer_alt:[r]}),Y({name:`BareSpecifier`,pattern:RegExp(`#(?:${t})`,`i`)}),Y({name:`ColumnSep`,pattern:/:/}),Y({name:`ListSep`,pattern:new RegExp(e.separators.separatorFunction.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`))})];this._lexer=new J(i,{ensureOptimizations:!0});let a={};i.forEach(e=>{a[e.name]=e}),this._vocabulary=a}getVocabulary(){return this._vocabulary}tokenize(e){return this._lexer.tokenize(e)}},$n=class extends Vn{constructor(e=l){let n=new Qn(e),r=n.getVocabulary();super(r,{nodeLocationTracking:`none`,maxLookahead:2,skipValidations:!0,recoveryEnabled:!1}),this._lexer=n;let{TableSpecifier:i,BracketedColumn:a,BareSpecifier:o,ColumnSep:s,ListSep:u}=r,d=this;d.RULE(`ruleContent`,()=>{let e=[],t=d.SUBRULE(d.ruleItem);return d.ACTION(()=>{t&&e.push(t)}),d.MANY(()=>{d.CONSUME(u),d.OPTION(()=>{let t=d.SUBRULE2(d.ruleItem);d.ACTION(()=>{t&&e.push(t)})})}),e}),d.RULE(`ruleItem`,()=>d.OR([{ALT:()=>d.SUBRULE(d.ruleSpecifier)},{ALT:()=>d.SUBRULE(d.ruleColumnOrRange)}])),d.RULE(`ruleSpecifier`,()=>d.OR([{ALT:()=>{let n=d.CONSUME(i);return d.ACTION(()=>{let r=t(n.image,e);return r.image=n.image,r})}},{ALT:()=>{let n=d.CONSUME(o);return d.ACTION(()=>{let r=t(n.image,e);return r.image=n.image,r})}}])),d.RULE(`ruleColumnOrRange`,()=>{let e=d.CONSUME(a),t,n;return d.OPTION(()=>{t=d.CONSUME(s),n=d.CONSUME2(a)}),d.ACTION(()=>{let r=E(e.image);if(r.image=e.image,!n)return r;let i=E(n.image);i.image=n.image;let a=c(`:`,r,i,!0);return a.image=t?.image??`:`,a})}),d.performSelfAnalysis()}_parseInner(e){let t=this._lexer.tokenize(e);return t.errors.length>0||t.tokens.length===0?[]:(this.input=t.tokens,this.reset(),this.ruleContent()??[])}_parseContent(e){if(!e)return[];let t=e.trim();if(!t)return[];let n=t[0];if(n===`@`){let e=t.slice(1).trim();if(!e){let e=p(`@`,null,!0);return e.image=`@`,[e]}if(e.charAt(0)===`[`){let t=this._parseInner(e);if(t.length===1&&t[0].type===`infix`){let e=p(`@`,t[0],!0);return e.image=`@`,[e]}}let n=E(e);n.image=e;let r=p(`@`,n,!0);return r.image=`@`,[r]}if(n!==`[`&&n!==`#`){let t=E(e);return t.image=e,[t]}return this._parseInner(t)}parse(e,t,n){this.reset();let r=()=>({root:o(``,[]),errors:[]});if(!n)return r();let i=0;if(n.charAt(0)===`[`){let e=n.indexOf(`]`);e!==-1&&n.charAt(e+1)===`!`&&(i=e+2)}let a=n.indexOf(`[`,i);if(a===-1)return r();let s=n.slice(0,a),c=n.slice(a+1,-1),l=this._parseContent(c);return{root:o(s,l),errors:this.errors.length>0?[...this.errors]:[]}}},er=new Set([`:`,`.:.`,`.:`,`:.`]),tr=new Set([`.:.`,`.:`,`:.`]),nr=e=>{if(!e)return null;if(e.type===C.Cell){let t=e.value;return t.rowIndex===-(2**53-1)?`col`:t.colIndex===-(2**53-1)?`row`:null}return Number.isInteger(e.value)?`row`:null},rr=(e,t)=>{let n=parseInt(e.charCodeAt(0)===36?e.substring(1):e,10);return n>=1&&n<=t},ir=`A formula must not be empty`,ar=(e,t)=>`A formula must not be longer than ${t} characters (this one is ${e})`;function or(e,t){let n=e?.[0]?.image;if(!n){let e=t?.image;return e?`Expected a value after '${e}'`:`Expected a value`}return`Unexpected '${n}'`}var sr={...yt,buildNoViableAltMessage:e=>or(e.actual,e.previous),buildEarlyExitMessage:e=>or(e.actual,e.previous),buildNotAllInputParsedMessage:e=>{let t=e.firstRedundant?.image;return t?`Unexpected '${t}'`:yt.buildNotAllInputParsedMessage(e)},buildMismatchTokenMessage:e=>{let t=e.actual?.image;return e.expected===X&&t?`Unexpected '${t}'`:yt.buildMismatchTokenMessage(e)}},cr=class extends Vn{constructor(e){let t=e?.lexer??Hn.shared(e?.lexerOptions),o=t.getVocabulary();super(o,{skipValidations:!0,recoveryEnabled:!0,...e,nodeLocationTracking:`full`,errorMessageProvider:sr,maxLookahead:1}),this._ruleInfixOp=this.RULE(`ruleInfixOp`,()=>{let{PlusOp:e,MinOp:t,MulOp:n,DivOp:i,ExOp:a,ConcatOp:o,GtOp:s,EqOp:l,LtOp:u,NeqOp:d,GteOp:f,LteOp:p}=this._vocab,m=[];return m.push({node:this.SUBRULE(this._rulePostfixOp)}),this.MANY(()=>{let c=this.OR(this._c1||=[{ALT:()=>this.CONSUME(e).image},{ALT:()=>this.CONSUME(t).image},{ALT:()=>this.CONSUME(n).image},{ALT:()=>this.CONSUME(i).image},{ALT:()=>this.CONSUME(a).image},{ALT:()=>this.CONSUME(o).image},{ALT:()=>this.CONSUME(s).image},{ALT:()=>this.CONSUME(l).image},{ALT:()=>this.CONSUME(u).image},{ALT:()=>this.CONSUME(d).image},{ALT:()=>this.CONSUME(f).image},{ALT:()=>this.CONSUME(p).image}]),h={value:c,index:this.getLexerPosition(),isRange:r.includes(c)},g=this.SUBRULE2(this._rulePostfixOp);m.push({op:h,node:g})}),this.ACTION(()=>{let e=m.length-1,t=y.length;for(let n=0;e>0&&n<t;n++){let t=y[n],r=1;for(;r<m.length;){let n=m[r].op;if(t.includes(n.value)){let t=m[r-1].node,i=m[r].node,a=c(n.value,t,i,n.isRange);a=this._tag(a,n.index),m[r-1].node=a,m.splice(r,1),e--}else r++}}}),m[0].node}),this._rulePlusMinusOp=this.RULE(`rulePlusMinusOp`,()=>{let{PlusOp:e,MinOp:t}=this._vocab;return this.OR([{ALT:()=>this.CONSUME(e)},{ALT:()=>this.CONSUME(t)}])}),this._rulePostfixOp=this.RULE(`rulePostfixOp`,()=>{let{PercentOp:e}=this._vocab,t=this.SUBRULE(this._rulePrefixOp),n=[];return this.MANY(()=>{let t=this.CONSUME(e).image;this.ACTION(()=>{n.push([t,this.getLexerPosition()])})}),this.ACTION(()=>{let e=n.length;if(e!==0)for(let i=0;i<e;i++){let e=n[i],a=e[0],o=e[1],s=r.includes(a);t=w(a,t,s),t=this._tag(t,o)}}),t}),this._rulePrefixOp=this.RULE(`rulePrefixOp`,()=>{let{PlusOp:e,MinOp:t,ImplicitIntersectOp:n}=this._vocab,i=[];this.MANY(()=>{let r=this.OR([{ALT:()=>this.CONSUME(e).image},{ALT:()=>this.CONSUME(t).image},{ALT:()=>this.CONSUME(n).image}]);this.ACTION(()=>{i.push([r,this.getLexerPosition()])})});let a=this.SUBRULE(this._ruleRangeOp);return this.ACTION(()=>{let e=i.length;if(e!==0)for(let t=e-1;t>=0;t--){let e=i[t],n=e[0],o=e[1],s=r.includes(n);a=p(n,a,s),a=this._tag(a,o)}}),a}),this._ruleRangeOp=this.RULE(`ruleRangeOp`,()=>{let{RangeOp:e,RangeTrimFullOp:t,RangeTrimLeadingOp:n,RangeTrimTrailingOp:r,ArrayAnchorOp:i}=this._vocab,a=[];return a.push({node:this.SUBRULE(this._ruleCallOp)}),this.MANY2(()=>{this.CONSUME(i),a.push({anchor:this.getLexerPosition()})}),this.MANY(()=>{let o={value:this.OR(this._c2||=[{ALT:()=>this.CONSUME(e).image},{ALT:()=>this.CONSUME(t).image},{ALT:()=>this.CONSUME(n).image},{ALT:()=>this.CONSUME(r).image}]),index:this.getLexerPosition()},s=this.SUBRULE2(this._ruleCallOp);a.push({op:o,node:s}),this.MANY3(()=>{this.CONSUME2(i),a.push({anchor:this.getLexerPosition()})})}),this.ACTION(()=>{for(let e=1;e+1<a.length;e++){let t=a[e],n=a[e+1];if(t.op?.value!==`:`||n.op?.value!==`:`)continue;let r=nr(t.node);r&&nr(n.node)===r&&nr(a[e-1].node)!==r&&(t.node=this._tag(c(`:`,t.node,n.node,!0),n.op.index),a.splice(e+1,1))}for(let e=1;e<a.length;e++){let t=a[e];if(t.anchor!==void 0){a[0].node=this._tag(w(`#`,a[0].node,!0),t.anchor);continue}let n=t.op,r=c(n.value,a[0].node,t.node,!0);r=this._tag(r,n.index),a[0].node=r}}),a[0].node}),this._ruleCallOp=this.RULE(`ruleCallOp`,()=>{let{OpenParen:e,CloseParen:t}=this._vocab,n=this.SUBRULE(this._ruleFormula);return this.MANY({GATE:()=>{let t=this.LA(0),n=this.LA(1);return!(!t||!n||n.tokenType!==e)&&n.startOffset===t.endOffset+1},DEF:()=>{this.CONSUME(e);let r=this.getLexerPosition(),i=this.SUBRULE(this._ruleFunctionArguments),a=n,o=this.ACTION(()=>this._tag(h(a,i),r)),s=this.OPTION(()=>this.CONSUME(t));this.ACTION(()=>{s||this._reportError(o,`Missing closing parenthesis ')'`,r),this._tagClose(o,this.getLexerPosition()),n=o})}}),n}),this._ruleIntersectOp=this.RULE(`ruleIntersectOp`,()=>{let e=[this.SUBRULE(this._ruleInfixOp)];return this.MANY(()=>{this.OPTION({GATE:()=>{let e=this.LA(0);return this.LA(1).startOffset>e.endOffset+1},DEF:()=>{e.push(this.SUBRULE3(this._ruleInfixOp))}})}),this.ACTION(()=>{for(;e.length>1;){let t=e.length-1;for(let n=0;n<t;n++){let r=e[n],i=e[n+1],a=c(` `,r,i,!0),o=this._tokenMap.get(r);o&&delete o.tokenIndexClose;let s=this._tokenMap.get(i),l=s?.tokenIndex;if(l!==void 0){let e=this.input[l],t=this.input[l-1]?.endOffset??-1,n=this._inputText.slice(t+1,e.startOffset).slice(0,-1);n.length>0&&(a.wsBefore=n)}s&&delete s.tokenIndex,n+1<t&&s&&delete s.tokenIndexClose,e.splice(n,2,a),n--,t--}}}),e[0]}),this._ruleFormula=this.RULE(`ruleFormula`,()=>this.OR9([{ALT:()=>this.SUBRULE(this._ruleLiteral)},{ALT:()=>this.SUBRULE(this._ruleReference)},{ALT:()=>this.SUBRULE(this._ruleFunction)},{ALT:()=>this.SUBRULE(this._ruleParen)},{ALT:()=>this.SUBRULE(this._ruleTableReference)},{ALT:()=>this.SUBRULE(this._ruleBracketedString)},{ALT:()=>this.SUBRULE(this._ruleLiteralArray)}])),this._ruleGroup=this.RULE(`ruleGroup`,()=>{let{ArgSeparator:e}=this._vocab,t=[];return this.MANY(()=>{this.CONSUME(e);let n=this.SUBRULE2(this._ruleIntersectOp);this.ACTION(()=>{t.push(n)})}),t}),this._ruleParen=this.RULE(`ruleParen`,()=>{let{OpenParen:e,CloseParen:t}=this._vocab;return this._processParen(C.Paren,e,t)}),this._ruleLiteralArray=this.RULE(`ruleLiteralArray`,()=>{let{OpenCurlyParen:e,CloseCurlyParen:t,ColSeparator:n,RowSeparator:r}=this._vocab,i=S();this.CONSUME(e);let o=this.getLexerPosition(),s=this.ACTION(()=>this._tag(a(i),o)),c=this.SUBRULE(this._ruleLiteralForArray);this.ACTION(()=>{i.value.push(c)}),this.MANY(()=>{let e=!1;this.OR([{ALT:()=>{this.CONSUME(n),e=!0}},{ALT:()=>this.CONSUME(r)}]);let t=this.SUBRULE2(this._ruleLiteralForArray);this.ACTION(()=>{e||(i=S(),s.value.push(i)),i.value.push(t)})});let l=this.OPTION(()=>this.CONSUME(t));return s=this.ACTION(()=>(l||this._reportError(s,`Missing closing parenthesis '}'`,o),this._tagClose(s,this.getLexerPosition()))),s}),this._ruleLiteralForArray=this.RULE(`ruleLiteralForArray`,()=>{let{StringToken:e,BooleanToken:t,LiteralError:r,RefError:a}=this._vocab;return this.OR([{ALT:()=>{let e=this.OPTION(()=>this.SUBRULE(this._rulePlusMinusOp)),t=this.SUBRULE(this._ruleNumber),n=this.ACTION(()=>this._tag(D(t.image,this._locale),this.getLexerPosition()));return this.ACTION(()=>e?ee(e.image,n):n)}},{ALT:()=>{let t=this.CONSUME(e);return this.ACTION(()=>this._tag(i(t.image),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(t);return this.ACTION(()=>this._tag(v(e.image,this._locale),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(r);return this.ACTION(()=>this._tag(n(e.image,this._locale),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(a);return this.ACTION(()=>this._tag(s(e.image,this._locale),this.getLexerPosition()))}}])}),this._ruleLiteral=this.RULE(`ruleLiteral`,()=>{let{StringToken:e,BooleanToken:t,LiteralError:r,RefError:a}=this._vocab;return this.OR([{ALT:()=>{let e=this.SUBRULE(this._ruleNumber);return this.ACTION(()=>this._tag(D(e.image,this._locale),this.getLexerPosition()))}},{ALT:()=>{let t=this.CONSUME(e);return this.ACTION(()=>this._tag(i(t.image),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(t);return this.ACTION(()=>this._tag(v(e.image,this._locale),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(r);return this.ACTION(()=>this._tag(n(e.image,this._locale),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(a);return this.ACTION(()=>this._tag(s(e.image,this._locale),this.getLexerPosition()))}}])}),this._ruleFunction=this.RULE(`ruleFunction`,()=>{let{FunctionToken:e,OpenParen:t,CloseParen:n}=this._vocab,r=this.CONSUME(e).image,i=this.getLexerPosition();this.CONSUME(t);let a=this.SUBRULE(this._ruleFunctionArguments),o=this.ACTION(()=>this._tag(ne(r,a),i)),s=this.OPTION(()=>this.CONSUME(n));return o=this.ACTION(()=>(s||this._reportError(o,`Missing closing parenthesis ')'`,i),this._tagClose(o,this.getLexerPosition()))),o}),this._ruleFunctionArguments=this.RULE(`ruleFunctionArguments`,()=>{let{ArgSeparator:e,CloseParen:t}=this._vocab,n=[];return this.OPTION({GATE:()=>this.LA(1).tokenType!==t,DEF:()=>{let t;this.OPTION2(()=>{t=this.SUBRULE(this._ruleIntersectOp)}),t=this.ACTION(()=>t??this._tagClose(_(),this.getLexerPosition())),n.push(t),this.MANY(()=>{let t;this.CONSUME(e),this.OPTION3(()=>{t=this.SUBRULE2(this._ruleIntersectOp)}),t=this.ACTION(()=>t??this._tagClose(_(),this.getLexerPosition())),n.push(t)})}}),n}),this._ruleBracketedString=this.RULE(`ruleBracketedString`,()=>{let{BracketedString:e}=this._vocab,t=this.CONSUME(e),n=this.getLexerPosition();return this.ACTION(()=>{let e=this._srParser.parse(this.rowIndex,this.colIndex,t.image);for(let t of e.errors)this._astErrors.push(t);return this._tag(e.root,n)})}),this._ruleTableReference=this.RULE(`ruleTableReference`,()=>{let{TableReference:e}=this._vocab,t=this.CONSUME(e),n=this.getLexerPosition();return this.ACTION(()=>{let e=this._srParser.parse(this.rowIndex,this.colIndex,t.image);for(let t of e.errors)this._astErrors.push(t);return this._tag(e.root,n)})}),this._ruleReference=this.RULE(`ruleReference`,()=>{let{Sheet:e,SheetQuoted:t,DivOp:n,MulOp:r,PlusOp:i,MinOp:a,ArgSeparator:o,Cell:c,NamedToken:l,SingleQuotedString:p,Column:m,AbsRow:h,DigitToken:g,RefError:_}=this._vocab,v,y;this.OPTION2({GATE:()=>{for(let s=1;s<6;s++){let c=this.LA(s);if(c.tokenType===e||c.tokenType===t)return!0;if(c.image===``||c.image===`)`||c.tokenType===n||c.tokenType===r||c.tokenType===i||c.tokenType===a||c.tokenType===o)break}return!1},DEF:()=>{y=this.getLexerPosition()+1,v=this.SUBRULE(this._rulePrefixSheetName)}});let b=this.OR([{ALT:()=>{let e=this.CONSUME(c),t=this.getLexerPosition();return this.ACTION(()=>this._tag(f(e.image,this.rowIndex,this.colIndex),t))}},{ALT:()=>{let e=this.OR2([{ALT:()=>this.CONSUME(l)},{ALT:()=>this.CONSUME(p)}]);return this.ACTION(()=>this._tag(u(e.image),this.getLexerPosition()))}},{ALT:()=>this.SUBRULE(this._ruleBracketedString)},{ALT:()=>this.SUBRULE(this._ruleFunction)},{ALT:()=>{let e=this.CONSUME(m);return this.ACTION(()=>this._tag(d(e.image,this.colIndex),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(h);return this.ACTION(()=>this._tag(T(e.image,this.rowIndex),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(g);return this.ACTION(()=>this._tag(T(e.image,this.rowIndex),this.getLexerPosition()))}},{ALT:()=>{let e=this.CONSUME(_);return this.ACTION(()=>this._tag(s(e.image,this._locale),this.getLexerPosition()))}}]);return this.ACTION(()=>{if(v&&b){if(v.name===``)return void this._reportError(b,`'${v.image}' is not a valid sheet reference — a '!' needs a sheet name before it`);let e=b;if(b.type===C.Postfix&&b.inputs?.[0]&&(e=b.inputs[0]),e.type===C.Cell||e.type===C.Named||e.type===C.Row||e.type===C.TableColumn||e.type===C.Error){e.value.scope=v.name,e.value.scopeImage=v.image;let t=this._tokenMap.get(e);t&&y!==void 0&&(t.tokenIndex=y)}}}),b}),this._rulePrefixSheetName=this.RULE(`rulePrefixSheetName`,()=>{let{SheetQuoted:e,BracketedString:t,NamedToken:n,Column:r,RangeOp:i,Sheet:a}=this._vocab;return this.OR([{ALT:()=>{let t=this.CONSUME(e).image;return{name:t.slice(1,-2).replace(/''/g,`'`),image:t}}},{ALT:()=>{let e=``;this.OPTION(()=>{e+=this.CONSUME(t).image}),this.OPTION2({GATE:()=>this.LA(2).tokenType===i,DEF:()=>{e+=this.OR2([{ALT:()=>this.CONSUME(n).image},{GATE:()=>this.LA(1).image.charCodeAt(0)!==36,ALT:()=>this.CONSUME(r).image}]),this.CONSUME(i),e+=`:`}});let o=this.CONSUME(a).image;return{name:e+o.slice(0,-1),image:e+o}}}])}),this._ruleNumber=this.RULE(`ruleNumber`,()=>{let{NumberToken:e,ScientificDigit:t,DigitToken:n}=this._vocab;return this.OR([{ALT:()=>this.CONSUME(e)},{ALT:()=>this.CONSUME(t)},{ALT:()=>this.CONSUME(n)}])}),this._ruleRoot=this.RULE(`ruleRoot`,()=>{let{ArgSeparator:e}=this._vocab,t=this.SUBRULE(this._ruleIntersectOp),n=[];return this.MANY(()=>{this.CONSUME(e),n.push(this.SUBRULE2(this._ruleIntersectOp))}),this.ACTION(()=>n.length===0?t:{type:C.List,value:`,`,inputs:[t,...n],isReference:!0})}),this._lexer=t,this._locale=t.getLocale(),this._vocab=o,this._srParser=e?.srParser??new $n(this._locale),this.performSelfAnalysis()}getLexer(){return this._lexer}parse(t,n,r){let i=this._lexer.tokenize(r),a;if(!i)return{root:{type:C.Unparsed,value:r},errors:[]};let o=i.tokens;if(o.length===0)throw new e.Parse(ir);return this.input=o,this._inputText=r,this._inputTextLength=r.length,this.rowIndex=t,this.colIndex=n,this._astErrors=[],this._tokenMap=new Map,this.reset(),a=this._ruleRoot(),a&&this._bindAllWhitespace(a),a=b(a,(e,n)=>{let r=e.type,i=n?.isReference?n.value:void 0,a=typeof i==`string`&&er.has(i),o=typeof i==`string`&&tr.has(i),s=a?n.inputs:void 0,c=s?s[0]===e?s[1]:s[0]:void 0,l=this._lexer.getMaxRow();if(a&&r!==C.Cell&&Number.isInteger(e.value)){let n=T(e.image,t);return x(n,e),nr(c)===`row`?rr(e.image,l)||this._reportError(n,`'${e.image}' is not a valid row — rows run from 1 to ${l}`):this._reportError(n,`'${e.image}' is not a valid reference — a whole row can only pair with another row (as in ${e.image}:${e.image})`),n}if(o&&r===C.Named)return this._reportError(e,`'${e.image??e.value?.nameId}' is a name — '${i}' needs a cell or range on both sides`),e;if(r===C.Cell){let t=e.value,n=t.colIndex===-(2**53-1),r=t.rowIndex===-(2**53-1);if((n||r)&&nr(c)===(n?`row`:`col`))return n&&!rr(e.image,l)&&this._reportError(e,`'${e.image}' is not a valid row — rows run from 1 to ${l}`),e;if(n||r||t.colIndex>=16384){let a=u(e.image);x(a,e);let s=t.scope;return s&&(a.value.scope=s,a.value.scopeImage=t.scopeImage),n?this._reportError(a,`'${e.image}' is not a valid reference — a row needs a column (use ${e.image}:${e.image} for the whole row)`):r&&e.image.includes(`$`)?this._reportError(a,`'${e.image}' is not a valid reference — a whole column can only pair with another column (as in ${e.image}:${e.image})`):o&&this._reportError(a,`'${e.image}' is a name — '${i}' needs a cell or range on both sides`),a}}return e}),{root:a,errors:[...this.errors,...this._astErrors]}}_processParen(e,t,n){let r;this.CONSUME(t);let i=this.getLexerPosition();r=this.ACTION(()=>(r={type:e,value:null,inputs:null},this._tag(r,i)));let a=[],o=this.SUBRULE(this._ruleIntersectOp);o&&a.push(o);let s=this.SUBRULE(this._ruleGroup),c=this.OPTION(()=>this.CONSUME(n));return r=this.ACTION(()=>{if(s)for(let e=0;e<s.length;e++)a.push(s[e]);return r&&(c||this._reportError(r,`Missing closing parenthesis`,i),r.inputs=a),this._tagClose(r,this.getLexerPosition())}),r}_reportError(e,t,n=void 0,r=`SyntaxError`){n===void 0&&(n=this.getLexerPosition()),e.error=!0,this._astErrors.push({name:r,message:t,previousToken:this.input[n],ast:e})}_tag(e,t){return e?(e.image??=this.input[t].image,this._tokenMap.set(e,{tokenIndex:t,tokenIndexClose:t}),e):(console.warn(`node is null`),e)}_tagClose(e,t){let n=this._tokenMap.get(e);return n?n.tokenIndexClose=t:this._tokenMap.set(e,{tokenIndexClose:t}),e}_bindNodeWhitespace(e){let t=this._tokenMap.get(e);if(!t)return;let n=this.input,r=this._inputText,i=t.tokenIndex;if(i!==void 0){let t=n[i],a=n[i-1]?.endOffset??-1;a+1<t.startOffset&&(e.wsBefore=r.slice(a+1,t.startOffset))}let a=t.tokenIndexClose;if(a!==void 0){let t=n[a],i=n[a+1]?.startOffset??this._inputTextLength;t.endOffset+1<i&&(e.wsAfter=r.slice(t.endOffset+1,i))}}_bindAllWhitespace(e){if(e){if(this._bindNodeWhitespace(e),e.inputs)for(let t of e.inputs)t&&this._bindAllWhitespace(t);if(e.type===C.Array&&Array.isArray(e.value)){for(let t of e.value)if(t&&Array.isArray(t.value))for(let e of t.value)e&&this._bindAllWhitespace(e)}}}};export{ir as i,ar as n,cr as r,Hn as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={EFFECT:{s:`Returns the effective annual interest rate.`,p:{nominalRate:{d:`is the nominal interest rate.`},npery:{d:`is the number of compounding periods per year.`}}},NOMINAL:{s:`Returns the annual nominal interest rate.`,p:{effectiveRate:{d:`is the effective interest rate.`},npery:{d:`is the number of compounding periods per year.`}}},DOLLARDE:{s:`Converts a dollar price, expressed as a fraction, into a dollar price, expressed as a decimal number.`,p:{fractionalDollar:{d:`is a number expressed as a fraction.`},fraction:{d:`is the integer to use in the denominator of the fraction.`}}},DOLLARFR:{s:`Converts a dollar price, expressed as a decimal number, into a dollar price, expressed as a fraction.`,p:{decimalDollar:{d:`is a decimal number.`},fraction:{d:`is the integer to use in the denominator of the fraction.`}}}};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./ChSvXfVMLxZsP9zG.js";import{ct as t}from"./Ca6nxdhEuLLty3d7.js";import{i as n,n as r,r as i,s as a,t as o}from"./BcOdl17EeFSxnAiq.js";import{Bi as s,C as c,Ci as l,In as u,Kt as d,Ln as f,On as p,Pi as m,R as h,S as g,T as _,Ti as v,Vn as y,Vt as b,Zn as x,ar as S,b as C,br as w,c as T,di as E,g as D,hr as O,in as k,it as A,m as j,pt as ee,qt as M,v as te,vr as N,xn as ne,y as re}from"./CnZJ44ncMxZ4ivcB.js";var ie=(e,t)=>e+t,ae=(e,t)=>e-t,oe=(e,t)=>g(e+t,e),se=(e,t)=>g(e-t,e),ce=(e,t)=>c(e*t),le=(e,t)=>t===0?n.BuiltIn.Div0:c(e/t),ue=(e,t)=>{if(e===0){if(t<0)return n.BuiltIn.Div0;if(t===0)return NaN}if(e<0){if(Number.isInteger(t)&&Math.abs(t)<=4294967294)return c(e**t);let n=Number((1/t).toPrecision(15));return Number.isInteger(n)&&Math.abs(n%2)===1?c(-((-e)**t)):NaN}return c(e**t)},de=(e=``,t=``)=>{e===null&&(e=``),t===null&&(t=``);let n=typeof t;typeof e==`boolean`&&(e=k(e)),n===`boolean`&&(t=k(t));let r=``+e+t;return r.length>i.MAX_TEXT_LENGTH?r.slice(0,i.MAX_TEXT_LENGTH):r},fe=(e,t=null,n=null)=>e.compare(t,n)===0,pe=(e,t=null,n=null)=>e.compare(t,n)!==0,me=(e,t=null,n=null)=>e.compare(t,n)>0,he=(e,t=null,n=null)=>e.compare(t,n)>=0,ge=(e,t=null,n=null)=>e.compare(t,n)<0,_e=(e,t=null,n=null)=>e.compare(t,n)<=0,ve={type:o.Number,coerce:[o.Boolean,o.String],onError:`value`,misalignValue:n.BuiltIn.NA},ye={type:o.String,coerce:[o.Boolean,o.Number],onError:`value`,misalignValue:n.BuiltIn.NA},be={onError:`value`,misalignValue:n.BuiltIn.NA},P=e=>typeof e==`object`&&e&&!0===e.isIReferenceRange&&e.size===1?e.getValueAt(0,0)??null:e,F=(e,t,r,i)=>{if(t!==null&&t.colStart!==void 0&&(t=e.getValueAt(t.rowStart,t.colStart,t.scope))&&n.isError(t))return t;if(r!==null&&r.colStart!==void 0&&(r=e.getValueAt(r.rowStart,r.colStart,r.scope))&&n.isError(r))return r;if(t=P(t),r=P(r),typeof t==`number`&&typeof r==`number`)return i(t,r);let a,s;if(t?.isIRange?a=t:r?.isIRange&&(s=r),!a&&!s){let a=e.getRuntime();return t=l(a,t,S(t,!0),o.Number,!0),r=l(a,r,S(r,!0),o.Number,!0),t&&n.isError(t)?t:r&&n.isError(r)?r:i(t,r)}let c=!a,u=c?t:r;return(a??s).broadcast(u,(t,r)=>t&&n.isError(t)?t:r&&n.isError(r)?r:te(c?i(r,t):i(t,r),e),ve).fillEmpty(0)},I=(e,t,i,a)=>{if(u(t)||u(i)||r(t)||r(i))return n.BuiltIn.Value;if(t!==null&&t.colStart!==void 0&&(t=e.getValueAt(t.rowStart,t.colStart,t.scope))&&n.isError(t))return t;if(i!==null&&i.colStart!==void 0&&(i=e.getValueAt(i.rowStart,i.colStart,i.scope))&&n.isError(i))return i;let o,s;t=P(t),i=P(i);let c=!1;return t?.isIRange?(o=t,s=i):i?.isIRange&&(o=i,s=t,c=!0),o?o.broadcast(s,(t,r)=>t&&n.isError(t)?t:r&&n.isError(r)?r:(t=L(t),r=L(r),c?a(e,r,t):a(e,t,r)),be):n.isError(t)?t:n.isError(i)?i:a(e,L(t),L(i))},L=e=>!0===e?.isIRichData?e.toPrimitive?.()??e:e,xe=(e,t,r)=>{if(r??=0,r!==null&&r.colStart!==void 0&&(r=e.getValueAt(r.rowStart,r.colStart,r.scope))&&n.isError(r))return r;r=P(r);let i,a=1;if(t===`+`)return r;if(t!==`-`)throw new n.Value(`Unrecognized prefix: ${t}`);if(a=-a,r?.isIRange&&(i=r),!i){let t=e.getRuntime();return typeof(r=l(t,r,S(r,!0),o.Number,!0))==`number`?r*a:n.BuiltIn.Value}return i.broadcast(a,(e,t)=>e&&n.isError(e)?e:t&&n.isError(t)?t:ce(e,t),ve)},R=e=>e.getCode()<=n.Code.NA?e:n.BuiltIn.Value,z=(e,t,r,i,a)=>{if(n.isError(t))return R(t);if(r&&n.isError(r))return R(r);if(!t)return n.BuiltIn.Ref;if(t.isIReferenceRange&&r&&!r.isIReferenceRange?r=e.getReference(r):r&&r.isIReferenceRange&&t&&!t.isIReferenceRange&&(t=e.getReference(t)),t.isIReferenceRange&&(t=t.getCoords()),t.colStart===void 0||(r.isIReferenceRange&&(r=r.getCoords()),r.colStart===void 0))return n.BuiltIn.Value;let o=t.scope?a!==`either`||r.scope?null:t:r;if(o?.scope){let t=e.getReference(o);if(n.isError(t))return t;if(e.getSheetIndex()!==e.getSheetIndex(t))return n.BuiltIn.Value}let s=i(t,r);return n.isError(s)?s:s?e.getReference(s):n.BuiltIn.Null},Se={"+":(e,t,n)=>F(e,t,n,ie),"-":(e,t,n)=>F(e,t,n,ae),"*":(e,t,n)=>F(e,t,n,ce),"/":(e,t,n)=>F(e,t,n,le),"^":(e,t,n)=>F(e,t,n,ue)," ":(e,t,n,r)=>z(e,t,n,s,`either`),":":(e,t,n,r)=>z(e,t,n,p,`start`),".:.":(e,t,n,r)=>{let i=z(e,t,n,p,`start`);return e.getFunction(`TRIMRANGE`).execute(i,3,3)},".:":(e,t,n,r)=>{let i=z(e,t,n,p,`start`);return e.getFunction(`TRIMRANGE`).execute(i,1,1)},":.":(e,t,n,r)=>{let i=z(e,t,n,p,`start`);return e.getFunction(`TRIMRANGE`).execute(i,2,2)},"&":(e,t,r)=>((e,t,r,i)=>{if(t!==null&&t.colStart!==void 0&&(t=e.getValueAt(t.rowStart,t.colStart,t.scope))&&n.isError(t))return t;if(r!==null&&r.colStart!==void 0&&(r=e.getValueAt(r.rowStart,r.colStart,r.scope))&&n.isError(r))return r;if(t=P(t),r=P(r),typeof t==`string`&&typeof r==`string`)return i(t,r);let a,s;if(t?.isIRange?a=t:r?.isIRange&&(s=r),!a&&!s){let a=e.getRuntime();return t=l(a,t,S(t,!0),o.String,!1),r=l(a,r,S(r,!0),o.String,!1),n.isError(t)?t:n.isError(r)?r:i(t,r)}let c=!a,u=c?t:r;return(a??s).broadcast(u,(e,t)=>e&&n.isError(e)?e:t&&n.isError(t)?t:c?i(t,e):i(e,t),ye)})(e,t,r,de),"=":(e,t,n)=>I(e,t,n,fe),"<>":(e,t,n)=>I(e,t,n,pe),">":(e,t,n)=>I(e,t,n,me),"<":(e,t,n)=>I(e,t,n,ge),">=":(e,t,n)=>I(e,t,n,he),"<=":(e,t,n)=>I(e,t,n,_e)},Ce={"+":(e,t,n)=>F(e,t,n,oe),"-":(e,t,n)=>F(e,t,n,se)},we={"-":(e,t)=>xe(e,`-`,t),"+":(e,t)=>xe(e,`+`,t),"@":(e,t)=>{if(!t||!t.isIRange)return t;let r=t;if(!t.isIReferenceRange)return r.getValueAt(0,0);let i=t.getCoords(),a=r.getRowCount(),o=r.getColumnCount(),s=e.getRow()-i.rowStart,c=e.getColumn()-i.colStart,l=s>=0&&s<a,u=c>=0&&c<o;return l&&u?r.getValueAt(s,c):l&&o===1?r.getValueAt(s,0):u&&a===1?r.getValueAt(0,c):a===1&&o===1?r.getValueAt(0,0):n.BuiltIn.Value}},Te={"%":(e,t)=>F(e,t,100,le),"#":(e,t)=>n.isError(t)?R(t):t?(t.isIReferenceRange&&(t=t.getCoords()),t.colStart===void 0?n.BuiltIn.Value:t.rowStart!==t.rowEnd||t.colStart!==t.colEnd?n.BuiltIn.Ref:e.getSpillAt(t.rowStart,t.colStart,t.scope)||n.BuiltIn.Ref):n.BuiltIn.Ref};function B(e,t){for(let n=e.length-1;n>=0;n--)if(e[n].type===t)return e[n]}var Ee=class{constructor(){this.referenceIndices=[],this.rootReferences=new Set,this.cells=new Map,this.references=new Map,this.names=new Map}processNode(e,t){let n=e.type;if(e.isReference){let t={node:e,index:this.references.size,op:null,value:null,inputs:null};if(this.references.set(e,t),n===j.Cell){let n=e.value;n.$colIndex&&(t.hasHorizontalAbs=!0),n.$rowIndex&&(t.hasVerticalAbs=!0),t.value=this.cells.size,this.cells.set(e,this.cells.size),this.rootReferences.add(t),e.referenceIndex=this.referenceIndices.length,this.referenceIndices.push(t.index);return}if(n===j.Infix||n===j.Prefix||n===j.Postfix||n===j.List){let n=e.inputs||[],r=n.length,i=e.value;t.op=i;let a=N(r);t.inputs=a;for(let e=0;e<r;e++){let r=n[e],i=this.references.get(r);i?(i.hasHorizontalAbs&&(t.hasHorizontalAbs=!0),i.hasVerticalAbs&&(t.hasVerticalAbs=!0),a[e]=i.index):a[e]=-1,i&&this.rootReferences.delete(i)}if(this.rootReferences.add(t),rt.includes(i)){let r=n[0],i=!!r&&r.type===j.Cell,a=n[1],o=!!a&&a.type===j.Cell;i&&o&&a.referenceIndex!==void 0&&r.referenceIndex!==void 0&&(this.referenceIndices.splice(a.referenceIndex,1),a.referenceIndex=r.referenceIndex,e.referenceIndex=r.referenceIndex,this.referenceIndices[r.referenceIndex]=t.index)}else i===`#`&&n[0]&&(e.referenceIndex=n[0].referenceIndex);return}if(n===j.Error||n===j.Named){let r=n===j.Named?e.value.nameId:_(e.value),i=this.names.get(r);t.op=n,i===void 0&&(i=this.names.size,this.names.set(r,i)),t.value=i,this.rootReferences.add(t),e.referenceIndex=this.referenceIndices.length,this.referenceIndices.push(t.index);return}if(n===j.TableReference)return t.op=n,this.rootReferences.add(t),e.referenceIndex=this.referenceIndices.length,void this.referenceIndices.push(t.index)}else if(t&&t.isReference){let t={node:e,index:this.references.size,op:j.Function,value:e.value,inputs:null};this.references.set(e,t)}}};function V(e,t=!1,n=d){let r=[],i=new Set,a=(e,n,a)=>{let o={type:e.type,value:e.type===j.Error?C(e.value):e.value};e.image!==void 0&&(o.text=(e=>{let n=t?e.value?.scopeImage:void 0;return typeof n==`string`?n:``})(e)+e.image);let s=e.evalIndex??a;return s!==void 0&&(o.evalIndex=s),n&&(o.context=n),e.referenceIndex!==void 0&&(o.referenceIndex=e.referenceIndex),e.isReference&&i.add(o),r.push(o),o},o=(e,t,n,i,a)=>{if(t==null||r.length>1&&e===j.Whitespace&&r[r.length-1].type===j.Whitespace)return;let o={type:e,value:t,text:a??t};i!==void 0&&(o.evalIndex=i),n&&(o.context=n),r.push(o)};(function e(s,c,l){let u=s.evalIndex??l??0,d=s.type,f=(t,r,i)=>{if(!t)return;let a=t.length;for(let s=0;s<a;s++)e(t[s],r,i),s<a-1&&o(j.Separator,`,`,r,i,n.separatorFunction)};if(s.isLiteral){if(o(j.Whitespace,s.wsBefore,c,u),d===j.Array){o(j.Type,`{`,c,u);let t=s.value,r=t.length;for(let i=0;i<r;i++){let a=t[i],s=a.value,l=s.length;for(let t=0;t<l;t++){let r=s[t];o(j.Whitespace,r.wsBefore,c,u),e(r,c,u),o(j.Whitespace,r.wsAfter,c,u),t<l-1&&o(j.Separator,`,`,c,u,n.separatorColumn)}i<r-1&&(o(j.Whitespace,a.wsBefore,c,u),o(j.Separator,`;`,c,u,n.separatorRow),o(j.Whitespace,a.wsAfter,c,u))}s.error||o(j.Type,`}`,c,u)}else d===j.String&&(s={type:d,value:`"`+`${s.value}`.replace(/"/g,`""`)+`"`,image:s.image}),a(s,c,u);o(j.Whitespace,s.wsAfter,c,u)}else if(d===j.Infix)e(s.inputs[0],c,u),o(j.Whitespace,s.wsBefore,c,u),a(s,c,u),o(j.Whitespace,s.wsAfter,c,u),e(s.inputs[1],c,u);else if(d===j.Prefix)o(j.Whitespace,s.wsBefore,c,u),a(s,c,u),o(j.Whitespace,s.wsAfter,c,u),s.inputs&&e(s.inputs[0],c,u);else if(d===j.Postfix){s.inputs?.[0]&&e(s.inputs[0],c,u),o(j.Whitespace,s.wsBefore,c,u);let t=a(s,c,u),n=r[r.length-2];s.value===`#`&&t.text!==void 0&&!s.wsBefore&&i.has(n)&&(n.text=(n.text??``)+t.text,t.text=``),o(j.Whitespace,s.wsAfter,c,u)}else{o(j.Whitespace,s.wsBefore,c,u);let l=s.inputs;switch(d){case j.Function:{let t=String(s.value),i={type:j.Function,value:t,text:s.image??t,evalIndex:s.evalIndex};c&&(i.context=c),r.push(i);let a={name:t,argIndex:-1,type:s.binder?.kind??`function`};if(c?.bound&&(a.bound=c.bound),o(j.Paren,`(`,a,s.evalIndex),l){let t=l.length,r=s.binder?.kind,i=r===`lambda`?1:r===`let`?2:0,c=a.bound;for(let s=0;s<t;s++){let d=i&&s>=i?l[s-i]:void 0;if(d?.binding?.declaration){let e=d.value.nameId,t=r===`let`?St(l[s-1]):void 0;c=Z(c,t?{name:e,params:t}:{name:e})}let f={...a,argIndex:s};c&&(f.bound=c),e(l[s],f,u),s<t-1&&o(j.Separator,`,`,f,u,n.separatorFunction)}}s.error||o(j.Paren,`)`,a,s.evalIndex);break}case j.Call:{let t=y(s),i=r.length;if(t&&e(t,c,u),t?.type===j.Named)for(let e=i;e<r.length;e++){let t=r[e];t.type!==j.Whitespace&&(t.evalIndex=s.evalIndex,t.type===j.Named&&(t.type=j.Function,t.value=t.value.name))}let a={name:t?.type===j.Named?t.value.nameId:``,argIndex:-1,type:`function`};c?.bound&&(a.bound=c.bound),o(j.Paren,`(`,a,s.evalIndex);let l=E(s),d=l.length;for(let t=0;t<d;t++){let r={...a,argIndex:t};e(l[t],r,u),t<d-1&&o(j.Separator,`,`,r,u,n.separatorFunction)}s.error||o(j.Paren,`)`,a,s.evalIndex);break}case j.Cell:a(s,c,u);break;case j.Paren:o(d,`(`,c,u),f(l,c,u),s.error||o(d,`)`,c,u);break;case j.TableReference:{let n=s.value?.tableId??``,a={name:n,argIndex:-1,type:`table`},d=r.length,f=s.image,p,m=!1;if(n&&f){let e=0;if(f.charCodeAt(0)===91){let t=f.indexOf(`]`);t!==-1&&f.charCodeAt(t+1)===33&&(e=t+2)}let n=f.indexOf(`[`,e);if(m=n===0&&l!=null,n>0)p=f.slice(0,n);else if(!l){let e=f.lastIndexOf(`!`);p=t||e===-1?f:f.slice(e+1)}}if(!n||m&&t||o(j.TableReference,n,c,u,p),l&&o(j.Paren,`[`,a,u),l){let t=l.length;for(let n=0;n<t;n++){let r={...a,argIndex:n};e(l[n],r,u),n<t-1&&o(j.Separator,`,`,r,u)}}l&&!s.error&&o(j.Paren,`]`,a,u);let h=s.referenceIndex;for(let e=d;e<r.length;e++)h!==void 0&&(r[e].referenceIndex=h),i.add(r[e]);break}case j.TableSpecifier:case j.TableColumn:{let e=s.image,t=e!=null&&e.startsWith(`[`)&&e.endsWith(`]`);t&&o(j.Paren,`[`,c,u);let n={table:c?.type===`table`?c.name:``,name:s.value},i={type:d,value:n,text:t?e.slice(1,-1):e??n.name};u!==void 0&&(i.evalIndex=u),c&&(i.context=c),r.push(i),t&&o(j.Paren,`]`,c,u);break}case j.List:f(l,c,u);break;case j.Named:{let e=a(s,c,u),t=s.value;e.value=t.scope?{name:t.nameId,scope:t.scope}:{name:t.nameId},s.binding?.declaration&&s.binding.optional&&(e.value.optional=!0),s.binding&&(e.type=j.Parameter,s.binding.declaration&&(e.value.declaration=!0)),delete e.referenceIndex;break}default:s.value!==void 0&&a(s,c,u),l&&l.forEach(t=>e(t,c,u))}o(j.Whitespace,s.wsAfter,c,u)}})(e);let s=new Map;for(let e of r)if(e.type===j.Cell&&e.referenceIndex!==void 0){let t=s.get(e.referenceIndex);t?t.push(e):s.set(e.referenceIndex,[e])}for(let e of s.values())e.length===1?e[0].refSide=`self`:(e[0].refSide=`left`,e[e.length-1].refSide=`right`);let c=new Map;for(let e of r)if(e.referenceIndex!==void 0&&e.evalIndex!==void 0){let t=c.get(e.referenceIndex);(t===void 0||e.evalIndex<t)&&c.set(e.referenceIndex,e.evalIndex)}if(c.size>0){for(let e of r)if(e.referenceIndex!==void 0){let t=c.get(e.referenceIndex);t!==void 0&&(e.evalIndex=t)}}return r}function De(e,t){let n=``;for(let r=0;r<e.length;r++){let i=e[r],a=i.type;if(a===j.Cell||a===j.Named||a===j.Error){let e=a===j.Cell?i.value?.scope:(j.Named,i.value?.scope??void 0),r=a===j.Error?i.text!==void 0&&w(i.text):i.text?.includes(`!`)??!1;if(e&&i.text!==void 0&&!r){let r=t?.resolve(T.Sheet,e)?.toString()??e;n+=m(r)+`!`+i.text;continue}if(a===j.Named){n+=i.text??i.value?.name??``;continue}}if(a===j.Parameter){n+=i.text??i.value?.name??``;continue}let o=i.text??i.value;typeof o==`string`&&(n+=o)}return n}function Oe(e,t){let n;if(O(e,e=>{e.evalIndex===t&&(n=e)}),!n)return[];let r=V(n);return r.length>1&&r[0].type===j.Whitespace&&r.shift(),r.length>1&&r[r.length-1].type===j.Whitespace&&r.pop(),r}function ke(e){return O(e,e=>{if(e.type!==j.TableReference)return;let t=function(e){if(e.value!==null&&typeof e.value==`object`)return e.value;let t=e.value,n=e.inputs,r=!1,i=!1,a=!1,o=!1,s=null,c=null,l=!1,u=e=>{e?.type===j.TableColumn&&(s=e.value,c=e.value)};if(n)for(let e of n){let t=e.type;if(t===j.TableSpecifier){let t=e.value.toUpperCase().trim();t===`#ALL`?i=!0:t===`#HEADERS`?a=!0:t===`#TOTALS`?o=!0:t===`#DATA`?r=!0:t!==`@`&&t!==`#THIS ROW`||(l=!0)}else if(t===j.TableColumn)u(e);else if(t===j.Infix&&e.value===`:`){let t=e.inputs?.[0],n=e.inputs?.[1];t?.type===j.TableColumn&&(s=t.value),n?.type===j.TableColumn&&(c=n.value)}else if(t===j.Prefix&&e.value===`@`){l=!0;let t=e.inputs?.[0];t?.type===j.Infix&&t.value===`:`?(t.inputs?.[0]?.type===j.TableColumn&&(s=t.inputs[0].value),t.inputs?.[1]?.type===j.TableColumn&&(c=t.inputs[1].value)):u(t)}}return{tableId:t,spec:ne(i,a,r,o),columnFromId:s,columnToId:c,isThisRow:l}}(e);return{...e,value:t}})}function Ae(e){return O(e,e=>{if(e.type!==j.TableReference)return;let t=e.inputs;if(!t||t.findIndex(e=>e.type===j.TableSpecifier&&e.value.toUpperCase().trim()===`#THIS ROW`)===-1)return;let n=[],r;for(let e of t)(e.type!==j.TableSpecifier||e.value.toUpperCase().trim()!==`#THIS ROW`)&&(e.type!==j.TableColumn&&(e.type!==j.Infix||e.value!==`:`)||r?n.push(e):r=e);if(!r)return n.push({type:j.Prefix,value:`@`,inputs:null,isReference:!0}),{...e,inputs:n};let i=r.image??r.value,a=i.startsWith(`[`)&&i.endsWith(`]`)?{...r,image:i.slice(1,-1)}:r;return n.push(x(`@`,a,!0)),{...e,inputs:n}})}function je(e){return O(e,e=>{if(e.type!==j.TableReference||e.inputs?.length!==0||e.error)return;let t=e.value;return(typeof t==`string`?t:t?.tableId)?{...e,inputs:null}:void 0})}function Me(e){return O(e,e=>{if(e.type!==j.TableReference||!e.inputs)return;let t=e.value,n=typeof t==`string`?t:t?.tableId,r=e.image;if(!n||r?.charCodeAt(0)!==91)return;let i=r.indexOf(`]`);if(i!==-1&&r.charCodeAt(i+1)===33)return;let a={...e};return delete a.image,a})}var Ne=e=>{if(e?.type!==j.TableSpecifier)return 4;switch(e.value.toUpperCase().trim()){case`#ALL`:return 0;case`#HEADERS`:return 1;case`#DATA`:return 2;case`#TOTALS`:return 3;default:return 4}};function Pe(e){return O(e,e=>{if(e.type!==j.TableReference)return;let t=e.inputs;if(!t||t.length<2)return;let n=t.map((e,t)=>({input:e,index:t,rank:Ne(e)})).sort((e,t)=>e.rank-t.rank||e.index-t.index).map(e=>e.input);return n.every((e,n)=>e===t[n])?void 0:{...e,inputs:n}})}function Fe(t){if(!t)return e.EmptyArray;let n=e.EmptyArray;return O(t,t=>{if(t.type!==j.Named||t.binding)return;let r=t.value.nameId;r&&(n===e.EmptyArray&&(n=[]),n.includes(r)||n.push(r))}),n}function Ie(t,n){if(!t)return e.EmptyArray;let r=e.EmptyArray;return O(t,(t,i,a)=>{if(!t.isReference||i?.isReference)return;let o=t.type;if(o===j.Named||o===j.Error||o===j.TableReference||B(a,j.TableReference))return;let s=function(e){let t=e;for(;t;){if(t.referenceIndex!==void 0)return t.referenceIndex;if(!t.isReference)return;t=t.inputs?.[0]}}(t);s!==void 0&&function(e,t,n){let r=e;for(let e=t.length-1;e>=0;e--){let i=t[e];if(i.type===j.Paren||i.isReference){r=i;continue}if(i.type!==j.Function)return!0;let a=n?.(String(i.value));if(!a)return!0;let o=i.inputs?i.inputs.indexOf(r):-1;return(o>=0?H(a.getDeclaration().getParameters(),o):null)?.getRangeType()!==`p`}return!0}(t,a,n)&&(r===e.EmptyArray&&(r=[]),r.includes(s)||r.push(s))}),r.length>1&&r.sort((e,t)=>e-t),r}var Le=new Set([`SUBTOTAL`,`AGGREGATE`]);function Re(e,t){if(!e||!t)return!1;let n=!1;return O(e,e=>{if(n||e.type!==j.Function)return;let r=t(e.value)?.getName();r&&Le.has(r.toUpperCase())&&(n=!0)}),n}function ze(e,t){if(!e||!t)return!1;let n=!1;return O(e,e=>{n||e.type!==j.Function||t(e.value)?.getName().toUpperCase()===`TABLE`&&(n=!0)}),n}function Be(e,t){if(!e||!t)return!1;let n=!1;return O(e,e=>{n||e.type!==j.Function||!0===t(e.value)?.getDeclaration().getReturnType()?.isVolatile()&&(n=!0)}),n}var Ve=Object.freeze({value:!1,array:!1}),He=(e,t)=>{let n=function(e,t){if(!e||!t)return Ve;let n=!1,r=!1;return O(e,e=>{if(n)return;let i=e.type;if(i===j.Named)return void(e.binding===void 0&&(n=!0));if(i===j.Prefix)return void(e.value===`@`&&(n=!0));if(i===j.Call)return void(n=!0);if(i!==j.Function||e.binder!==void 0)return;let a=t(e.value);if(!a)return void(n=!0);if(r||!0!==e.implicitIntersect)return;let o=a.getDeclaration().getParameters(),s=e.inputs;if(s)for(let e=0;e<s.length;e++){let n=H(o,e);if(n!==null&&n.isValueOrRange()&&W(s[e],t))return void(r=!0)}}),{value:!n&&!r,array:!n}}(e,t);return{isBlankCacheable:n.value,isBlankCacheableArray:n.array}},Ue=(e,t)=>{let n=e.length;if(n===0)return null;if(t<n-1)return e[t];let r=e[n-1],i=r.getRepeatingTypes();return i&&i.length!==0?i[(t-(n-1))%i.length]:t<n?e[t]:r.isRest()?r:null};function We(t){if(!t)return e.EmptyArray;let n=e.EmptyArray,r=t=>{t&&(n===e.EmptyArray&&(n=[]),n.includes(t)||n.push(t))},i=e=>{typeof e==`string`&&r(M(e)?.bookId)};return O(t,e=>{if(e.type===j.Named){if(e.binding)return;let t=e.value;r(t.nameId),i(t.scope)}else if(e.type===j.TableReference){let t=e.value;r(typeof t==`string`?t:t?.tableId)}else if(e.type===j.Cell){let t=e.value?.scope;i(t),f(t)&&r(t)}else e.type===j.Error&&i(e.value?.scope)}),n}var Ge=(e,t)=>{if(!0===e.lazyArg)return!0;if(t?.binder?.kind!==`lambda`)return!1;let n=t.inputs;return n[n.length-1]===e},Ke=new Set([`IF`,`IFS`,`SWITCH`,`CHOOSE`,`IFERROR`,`IFNA`]),H=(e,t)=>{let n=e.length;if(n===0)return null;if(t<n)return e[t];let r=e[n-1];if(!r.isRest())return null;let i=r.getRepeatingTypes();return i&&i.length!==0?i[(t-(n-1))%i.length]:r},qe=e=>e.getScalarType()!==null&&e.getRangeType()===null&&e.getLambda()===null&&!e.isValueOrRange(),Je=(e,t,n)=>!(e.isRest()||!qe(e)||!W(t,n))&&!(e.isNoLift()&&U(t,n)),U=(e,t)=>{if(!e)return!1;let n=e.inputs;switch(e.type){case j.Cell:case j.Named:case j.TableReference:return!0;case j.Infix:case j.Prefix:case j.Postfix:return!0===e.isReference&&e.value!==`@`;case j.Paren:case j.List:return!!n&&n.length===1&&U(n[0],t);case j.Function:{if(e.binder!==void 0)return!1;let r=String(e.value).toUpperCase();if(Ke.has(r)){if(!n)return!1;for(let e=0;e<n.length;e++)if(U(n[e],t))return!0;return!1}let i=t?.(e.value);return!!i&&i.getDeclaration().getReturnType().getKind()===a.Reference}default:return!1}},Ye=(e,t)=>{if(!e)return!1;for(let n=0;n<e.length;n++)if(W(e[n],t))return!0;return!1};function W(e,t){if(!e)return!1;if(e.arrayValued!==void 0)return e.arrayValued;let n,r=e.type,i=e.inputs;switch(r){case j.Array:n=!0;break;case j.Cell:{let t=e.value;n=t.rowIndex===-(2**53-1)||t.colIndex===-(2**53-1);break}case j.Named:case j.Call:case j.TableReference:n=!0;break;case j.Infix:case j.Prefix:case j.Postfix:n=e.isReference?e.value!==`@`:Ye(i,t);break;case j.Paren:case j.List:n=!i||i.length!==1||W(i[0],t);break;case j.Function:{let r=e.binder;if(r!==void 0){n=r.kind===`lambda`||!!i&&W(i[i.length-1],t);break}let o=String(e.value).toUpperCase();if(Ke.has(o)){n=Ye(i,t);break}if(o===`INDEX`){if(n=!1,i)for(let e=1;e<i.length;e++){let r=i[e];if(!r||r.type===j.Empty||r.isLiteral&&r.value===0||W(r,t)){n=!0;break}}break}let s=t?.(e.value);if(!s){n=!0;break}let c=s.getDeclaration().getReturnType(),l=c.getKind();n=l===a.Array||l===a.Reference||l===null&&c.getRangeType()!==null;break}default:n=!1}return e.arrayValued=n,n}function Xe(e,t){if(e.firstCell!==void 0)return;let n=(e,r)=>{if(!e)return;e.firstCell=r;let i=e.inputs;if(!i)return;let a=e.type;if(a===j.Infix||a===j.Prefix||a===j.Postfix){let t=r&&!e.isReference;for(let e=0;e<i.length;e++)n(i[e],t)}else if(a===j.Paren||a===j.List){let e=r&&i.length===1;for(let t=0;t<i.length;t++)n(i[t],e)}else if(a===j.Function){let a=e.binder;if(a!==void 0){let e=i.length-1;for(let t=0;t<i.length;t++)n(i[t],r&&a.kind===`let`&&t===e);return}let o=r?t?.(e.value)?.getDeclaration().getParameters():null;for(let e=0;e<i.length;e++){let t=o?H(o,e):null;n(i[e],t!==null&&(qe(t)||et(t)))}}else for(let e=0;e<i.length;e++)n(i[e],!1)};n(e,!0)}var Ze=new Set([`=`,`<>`,`<`,`>`,`<=`,`>=`]),Qe=new Set([`ROW`,`COLUMN`]);function $e(e,t){if(!e||!t)return null;let n=e=>t(e.value)?.getName().toUpperCase()??null,r=!1;if(O(e,e=>{(e.hasLazyArgs||e.type===j.Call||e.binder!==void 0)&&(r=!0)}),r)return null;let i=e=>e.type===j.Number,a=e=>e.type===j.Number||e.type===j.String||e.type===j.Boolean,o=e=>{if(!e)return!1;let t=e.inputs;switch(e.type){case j.Paren:return t?.length===1&&o(t[0]);case j.Prefix:return(e.value===`-`||e.value===`+`)&&o(t?.[0]);case j.Infix:{if(e.value!==`+`&&e.value!==`-`&&e.value!==`*`)return!1;let[n,r]=t??[];return!(!n||!r)&&(o(n)&&(o(r)||i(r))||i(n)&&o(r))}case j.Function:{let r=n(e);if(r!==null&&Qe.has(r))return!t||t.length===0||t.length===1&&t[0]?.type===j.Cell;if(r===`MOD`&&t?.length===2){let e=t[1];return o(t[0])&&i(e)&&e.value!==0}return!1}}return!1},s=e=>{if(!e)return!1;let t=e.inputs;switch(e.type){case j.Paren:return t?.length===1&&s(t[0]);case j.Infix:{if(!Ze.has(e.value))return!1;let[n,r]=t??[];return!(!n||!r)&&(o(n)&&(o(r)||a(r))||a(n)&&o(r))}case j.Function:{let r=n(e);if(!t||t.length===0)return!1;if(r===`ISODD`||r===`ISEVEN`)return t.length===1&&o(t[0]);if(r===`NOT`)return t.length===1&&s(t[0]);if(r===`AND`||r===`OR`||r===`XOR`){let e=!1;for(let n=0;n<t.length;n++){let r=t[n];if(!r)return!1;if(r.type!==j.Boolean){if(!s(r))return!1;e=!0}}return e}return!1}}return!1},c=[],l=e=>{if(!e)return;if(s(e))return void c.push(e);let t=e.inputs;if(t)for(let e=0;e<t.length;e++)l(t[e])};l(e);let u=c.length;if(u===0||u>4)return null;let d=[];for(let t=0;t<1<<u;t++){let n=e=>{let r=c.indexOf(e);if(r!==-1)return D(t&1<<r?`TRUE`:`FALSE`);let i={...e};return delete i.evalIndex,delete i.firstCell,delete i.inLazy,delete i.lazyArg,delete i.hasLazyArgs,delete i.deferred,e.inputs&&(i.inputs=e.inputs.map(e=>e&&n(e))),i};d.push(n(e))}return d}var et=e=>e.getRangeType()===`*`&&e.getLambda()===null&&e.getArrayDepth()<=+!!e.isRest();function tt(e,n,r,i=!1,a=null,o=null){let s,c,l=r;l=ke(l),i||(l=Ae(l),l=Pe(l),l=je(l),l=Me(l)),[s,c]=function(e){let t=new Map,n=0,r=[e];for(;r.length>0;){let e=r.shift();if(t.set(e,{...e,evalIndex:n++}),e&&e.inputs)for(let t of e.inputs)r.push(t)}return t.forEach((e,n)=>{n&&n.inputs&&(e.inputs=n.inputs.map(e=>t.get(e)??e))}),[t.get(e),n]}(l);let u=N(c),f=[],p=[],m=new Ee,g,v=!1;(function(e,t){if(!e||!t)return;let n=e=>{if(!e)return;e.inLazy=!0,e.type===j.Named&&(e.deferredResolve=!0);let t=e.inputs;if(t)for(let e=0;e<t.length;e++)n(t[e])};O(e,e=>{if(e.type!==j.Function||e.binder!==void 0)return;let r=e.inputs;if(!r||r.length===0)return;let i=t(e.value)?.getDeclaration().getParameters();if(i)for(let t=0;t<r.length;t++){let a=r[t];a&&a.type!==j.Empty&&Ue(i,t)?.isLazy()&&(a.lazyArg=!0,e.hasLazyArgs=!0,n(a))}})})(s,o);let y=e=>{g===void 0&&(g=new Map);let t=g.get(e);return t===void 0&&g.set(e,t=[]),t},b=(e,t)=>{e===void 0?f.push(t):y(e).push(t)},x=e=>{e?.type!==j.Infix||e.value!==`+`&&e.value!==`-`||(e.snapsCancellation=!0)};s=O(s,(t,n,r)=>{let i=t.type,a=t.evalIndex;if(u[a]=null,i===j.TableColumn||i===j.TableSpecifier||t.isReference&&B(r,j.TableReference))return;if(v||=!q(t),t.binding?.declaration)return p[t.binding.slot]=-1,void(u[a]=void 0);let o=((e,t,n)=>{if(Ge(e,t))return e;for(let e=n.length-1;e>=0;e--)if(Ge(n[e],n[e-1]))return n[e]})(t,n,r);o===t&&y(t),o!==void 0&&i===j.Named&&(t.deferredResolve=!0);let s=t.binder;if(s&&s.kind===`let`){let e=t.inputs,n=e?.length??0,r=0;for(let t=0;t+1<n&&r<s.slots.length;t+=2)e[t]?.binding?.declaration&&(p[s.slots[r++]]=e[t+1]?.evalIndex??-1)}if((t.isReference||n&&n.isReference)&&(m.processNode(t,n),t.isReference)){if(i===j.Named)return void(o!==void 0&&b(o,t));if(i===j.Cell||i===j.TableReference||i===j.Error)return;if(i===j.Infix||i===j.Prefix||i===j.Postfix||i===j.List)return void b(o,t)}if(t.isLiteral){if(i!==j.Array)u[a]=t.value;else{let n=t.value,r=n.length,i=N(r);for(let e=0;e<r;e++){let t=n[e].value,r=t.length,a=N(r);for(let e=0;e<r;e++){let n=t[e],r=null;if(n&&(r=n.type===j.Error?_(n.value):n.value,n.type===j.Prefix)){let e=n.value;r=n.inputs[0].value,e===`-`&&(r=-r)}a[e]=r}i[e]=a}let o=ee(i);u[a]=new re(e,o.values,o.coords,void 0,o.isLiteral)}}else{if(i!==j.Empty)return t.binder?.kind===`lambda`&&x(t.inputs[t.inputs.length-1]),b(o,t),t;u[a]=void 0}}),x(s),g?.forEach((e,t)=>{t.deferred=e});let S=N(m.cells.size);m.cells.forEach((e,t)=>{let n=t.value,r=n.colIndex,i=n.rowIndex,a=n.$colIndex,o=n.$rowIndex,s={colStart:r,rowStart:i,colEnd:r,rowEnd:i,$colStart:a,$rowStart:o,$colEnd:a,$rowEnd:o};r===-(2**53-1)&&(s.colEnd=2**53-1),i===-(2**53-1)&&(s.rowEnd=2**53-1),n.scope&&(s.scope=n.scope),S[e]=s});let C=S.length,w=N(C);for(let e=0;e<C;e++)w[e]={colStart:0,rowStart:0,colEnd:0,rowEnd:0,scope:null};let T=N(m.references.size);m.references.forEach(e=>{T[e.index]=e});let E=[];m.rootReferences.forEach(e=>{E.push(e.index)}),function(e,t,n=!1){if(n){let t=e=>{if(!e)return;let n=e.type;n!==j.Function&&n!==j.Call||(e.implicitIntersect=!0);let r=e.inputs;if(r)for(let e=0;e<r.length;e++)t(r[e])};t(e);return}let r=e=>W(e,t),i=(e,n)=>{if(!e)return;let a=e.type;a!==j.Function&&a!==j.Call||(e.implicitIntersect=n);let o=e.inputs;if(o){if(a===j.Infix||a===j.Prefix||a===j.Postfix){let t=!e.isReference;for(let e=0;e<o.length;e++)i(o[e],(!t||!r(o[e]))&&n);return}if(a===j.Function){let r=e.binder;if(r!==void 0){let e=r.kind!==`lambda`&&n;for(let t=0;t<o.length;t++)i(o[t],e);return}let a=t?.(e.value)?.getDeclaration().getParameters(),s=!1;if(a)for(let e=0;e<o.length&&!s;e++){let n=o[e];if(!n)continue;let r=H(a,e);r&&Je(r,n,t)&&(s=!0)}s&&(e.implicitIntersect=!1);for(let e=0;e<o.length;e++)i(o[e],!s&&n);return}for(let e=0;e<o.length;e++)i(o[e],n)}};i(e,!r(e))}(s,o,!0===r.legacyIntersect);let D=e=>{let t=e.length;for(let n=0;n<t;n++){let t=e[n],r=t.type;if(r===j.Infix){if(!0===t.snapsCancellation){t.fn=Ce[t.value];continue}t.fn=Se[t.value]}else r===j.Prefix?t.fn=we[t.value]:r===j.Postfix&&(t.fn=Te[t.value])}},k;D(f),g?.forEach(D);let A=i?h(t(e.getLocale()).decimal):d,M={runtime:e,symbols:n,getFunction:o,ast:s,evaluations:u,executions:f,bindings:p,referencesAbsolute:w,referencesExecute:T,referencesRelative:S,referencesRoot:E,referenceIndices:m.referenceIndices,formatReferenceIndices:Ie(s,o),getTokens:()=>k??=V(s,i,A),namedIds:Fe(s),symbolIds:We(s),hasTotals:Re(s,o),hasDataTable:ze(s,o),hasVolatile:Be(s,o),...He(s,o),isReferenceOnly:!v,error:a,transform:t=>{let r=O(s,t);return r===s?M:tt(e,n,r,i,a,o)}};return M}function nt(e){let t=-1,r=-1;return Number.isSafeInteger(e.previousToken?.startLine)?(t=e.previousToken.startLine,r=e.previousToken.endColumn+1):Number.isSafeInteger(e.token?.startLine)&&(t=e.token.startLine,r=e.token.startColumn),t===-1?new n.Parse(e.message,{cause:e}):(e.errorLocation={line:t,column:r},new n.Parse(e.message,{line:t,column:r,cause:e}))}Object.freeze([[`:`,`.:.`,`.:`,`:.`],[`^`],[`*`,`/`],[`+`,`-`],[`&`],[`<`,`>`,`=`,`<>`,`<=`,`>=`]]);var rt=Object.freeze([`:`,`.:.`,`.:`,`:.`]),G=Object.freeze([`:`,` `,`.:.`,`.:`,`:.`]),it=Object.freeze([`@`]),K=Object.freeze([`#`]),at=Object.freeze(G.concat(K)),q=(Object.freeze(G.concat(it).concat(K)),e=>{if(!e)return!1;let t=e.type;if(t===j.Cell||t===j.TableReference)return!0;if(t===j.Infix){if(!G.includes(e.value))return!1;let t=e.inputs,n=t[0],r=t[1];return q(n)&&q(r)}return t===j.List&&(e.inputs?.every(q)??!1)}),ot=e=>!!e&&(!(e.type!==j.Infix||!at.includes(e.value))||!(e.type!==j.Postfix||!K.includes(e.value))||e.type===j.Array||e.type===j.TableReference),st=Object.freeze([`+`,`-`,`*`,`/`,`^`,`&`,`=`,`<>`,`>`,`<`,`>=`,`<=`]),ct=Object.freeze([`-`,`+`]),J=(e,t)=>{if(!e)return!1;let n=e.type;if(e.isLiteral)return n!==j.Error;if(n===j.Paren||n===j.List){let n=e.inputs;return!(!n||n.length===0)&&n.every(e=>J(e,t))}if(n===j.Infix)return st.includes(e.value);if(n===j.Prefix)return ct.includes(e.value);if(n===j.Postfix)return e.value===`%`;if(n===j.Function){if(!t)return!1;let n=t(e.value);if(!n)return!1;let r=n.getDeclaration().getReturnType(),i=r.getRangeType();return i!==`p`&&(i!==null||r.getLambda()===null&&r.getScalarType()!=null)}return!1},lt=(e,t)=>{if(!e)return null;let n=null,r=e=>{if(n||!e)return;if(e.type===j.Infix&&e.value===` `){let r=e.inputs,i=r?.[0],a=r?.[1];if(J(i,t))return void(n=i);if(J(a,t))return void(n=a)}let i=e.inputs;if(i)for(let e=0;e<i.length&&!n;e++)r(i[e])};return r(e),n},ut=(e,t)=>{if(!e)return null;let n=null,r=e=>{if(n||!e)return;if(e.type===j.Postfix&&e.value===`#`){let r=e.inputs?.[0];if(r&&J(r,t))return void(n=r)}let i=e.inputs;if(i)for(let e=0;e<i.length&&!n;e++)r(i[e])};return r(e),n},dt=e=>{for(let t=0;t<e.length;t++)if(e[t].getRepeatingTypes())return t;return-1},ft=(e,t,n)=>{let r=e[t].getRepeatingTypes(),i=r.length,a=t,o=e.length-t-1,s=o;for(;s>0&&e[t+s].isOptional();)s--;let c=+!e[t].isOptional(),l=r[i-1].isOptional();for(let e=s;e<=o;e++){let t=n-a-e;if(t>=0&&t%i===0&&t/i>=c)return{n:t/i,short:!1,variable:t,period:i,prefix:a,suffix:e};if(l&&t===i-1)return{n:1,short:!0,variable:t,period:i,prefix:a,suffix:e}}return null},pt=e=>{if(!e)return null;let t=null,n=e=>{if(t||!e)return;if(e.type===j.Array&&Array.isArray(e.value)){let n=e.value,r=n[0]?.value?.length??0;for(let e=1;e<n.length&&!t;e++){let i=n[e]?.value?.length??0;i!==r&&(t=`Array rows must all be the same length — row ${e+1} has ${i} value${i===1?``:`s`}, but row 1 has ${r}.`)}}let r=e.inputs;if(r)for(let e=0;e<r.length&&!t;e++)n(r[e])};return n(e),t},mt=(e,t)=>{if(!e||!t)return null;let n=null,r=e=>{if(n||!e)return;if(e.type===j.Function){let r=e.value,i=t(r);if(i){let t=i.getDeclaration(),a=t.getParameters(),o=e.inputs?.length??0,s=t.getMaxArguments();if(o>s)return void(n=`Too many arguments for ${r}. The most it accepts is ${s}, but got ${o}.`);let c=a.length>0?dt(a):-1,l=a.length>0&&a[a.length-1].isRest();if(c>=0){if(!ft(a,c,o)){let e=a[c].getRepeatingTypes().length,t=a.length-1;n=e===1?`Too few arguments for ${r}. Expected at least ${t+1}, but got ${o}.`:`Wrong number of arguments for ${r}. Expected ${t} plus a multiple of ${e}, but got ${o}.`}}else if(!l&&o>a.length)n=`Too many arguments for ${r}. Expected ${a.length}, but got ${o}.`;else for(let e=o;e<a.length&&!n;e++){let t=a[e];t.isOptional()||t.isRest()||(n=`Parameter ${t.getName()} is missing for ${r}.`)}}}let i=e.inputs;if(i)for(let e=0;e<i.length&&!n;e++)r(i[e])};return r(e),n},ht=(e,t)=>{if(!e||!t)return null;let n=null,r=e=>{if(n||!e)return;if(e.type===j.Function){let r=t(e.value);if(r){let i=r.getDeclaration().getParameters(),a=e.inputs;if(i.length>0&&a){let e=((e,t)=>{let n=Array(t),r=e.length,i=r>0?dt(e):-1;if(i<0){let i=r>0?e[r-1]:null,a=!!i&&i.isRest();for(let o=0;o<t;o++)n[o]=o<r?e[o]:a?i:null;return n}let a=e[i].getRepeatingTypes(),o=a.length,s=i,c=ft(e,i,t),l=c?c.suffix:r-i-1,u=Math.max(0,t-s-l);for(let c=0;c<t;c++)if(c<s)n[c]=e[c];else if(c<s+u)n[c]=a[(c-s)%o];else{let t=i+1+(c-s-u);n[c]=t<r?e[t]:null}return n})(i,a.length);for(let r=0;r<a.length&&!n;r++){let i=e[r];i&&i.getRangeType()===`p`&&J(a[r],t)&&(n=a[r])}}}}let i=e.inputs;if(i)for(let e=0;e<i.length&&!n;e++)r(i[e])};return r(e),n},gt=(e,t)=>{if(!e)return null;let n=null,r=e=>{if(n||!e)return;if(e.type===j.Call){let r=e.inputs?.[0];if(r&&J(r,t))return void(n=`This expression always produces a value, so it cannot be called as a function.`)}let i=e.inputs;if(i)for(let e=0;e<i.length&&!n;e++)r(i[e])};return r(e),n},Y=(e,t)=>{if(e.type!==j.Function)return;let n=e.value;if(typeof n!=`string`)return;let r=(t?.(n)?.getName()??n).toUpperCase();return r===`LET`?`let`:r===`LAMBDA`?`lambda`:void 0},X=e=>{if(e?.type!==j.Named)return;let t=e.value;return t?.nameId&&!t.scope&&!0!==t.optional?t.nameId:void 0},_t=/^[A-Za-z_\\][A-Za-z0-9_\\]*$/,vt=new Set([`TRUE`,`FALSE`]),yt=e=>{if(e?.type===j.Named){let t=e.value;return!0!==t?.optional||!t.nameId||t.scope?void 0:t.nameId}if(e?.type!==j.TableReference)return;let t=e.value,n;if(t===null||typeof t==`string`){if(t)return;let r=e.inputs;if(!r||r.length!==1||r[0]?.type!==j.TableColumn)return;let i=r[0].value;if(typeof i!=`string`)return;n=i}else{let e=t;if(!e||e.tableId!==``||e.spec!==0||!0===e.isThisRow||!e.columnFromId||e.columnFromId!==e.columnToId)return;n=e.columnFromId}return _t.test(n)&&!vt.has(n.toUpperCase())&&e.image===`[${n}]`?n:void 0},bt=e=>{let t=v(e.image??e.value);t.image=e.image??e.value,t.wsBefore=e.wsBefore;let n={type:j.Call,value:null,inputs:[t,...e.inputs??[]],wsAfter:e.wsAfter};return e.error&&(n.error=e.error),n};function xt(e,t){return e&&t?O(e,e=>{if(e.type===j.Function&&typeof e.value==`string`&&!t(e.value))return bt(e)}):e}function Z(e,t){let n=t.name.toUpperCase(),r=e?e.filter(e=>e.name.toUpperCase()!==n):[];return r.push(t),r}function St(e){if(e?.type!==j.Function||e.binder?.kind!==`lambda`)return;let t=e.inputs??[],n=[];for(let e=0;e<t.length-1;e++){let r=t[e];if(!r?.binding?.declaration)return;let i=r.value.nameId;n.push(r.binding.optional?{name:i,optional:!0}:{name:i})}return n}var Ct=new Set([`IF`,`IFERROR`,`IFNA`]);function Q(e,t){if(!e||e.type!==j.Function||typeof e.value!=`string`)return e;let n=(t?.(e.value)?.getName()??e.value).toUpperCase();if(!Ct.has(n))return e;let r=e.inputs,i;if(r)for(let e=0;e<r.length;e++){let n=Q(r[e],t);n!==r[e]&&((i??=[...r])[e]=n)}return{...e,inputs:i??r,passOmitted:!0}}function wt(e,t=null){if(!e)return e;let n=[],r=0,i=e=>{let t=e.inputs;if(!t)return e;let n;for(let e=0;e<t.length;e++){let r=t[e];if(!r)continue;let i=a(r);i!==r&&(n||=[...t],n[e]=i)}return n?{...e,inputs:n}:e},a=e=>{if(!e)return e;let o=Y(e,t);if(o)return((e,o)=>{let s=e.inputs,c=s?.length??0;if(!s||c<1)return i(e);let l=n.length,u=[],d=[...s],f=(e,t=!1)=>{let i=d[e],a=X(i),o=!1;if(a===void 0&&t){if(a=yt(i),a===void 0)return;o=!0}else if(a===void 0)return;let s=r++;n.push({key:a.toUpperCase(),slot:s,name:a}),u.push(s),d[e]=o?{...i,type:j.Named,value:{nameId:a,scope:null},inputs:null,binding:{slot:s,declaration:!0,optional:!0},isReference:!1}:{...i,binding:{slot:s,declaration:!0},isReference:!1}};if(o===`lambda`){for(let e=0;e<c-1;e++)f(e,!0);d[c-1]&&(d[c-1]=a(d[c-1]))}else{for(let e=0;e+1<c;e+=2)d[e+1]&&(d[e+1]=Q(a(d[e+1]),t)),f(e);c%2==1&&d[c-1]&&(d[c-1]=a(d[c-1]))}for(;n.length>l;)n.pop();return{...e,inputs:d,binder:{kind:o,slots:u}}})(e,o);if(e.type===j.Function&&typeof e.value==`string`){let r=e.value.toUpperCase();if(n.some(e=>e.key===r)&&!t?.(e.value))return i(bt(e))}if(n.length>0&&e.isReference&&e.value===`:`&&e.inputs?.length===2){let[t,r]=e.inputs;if(Tt(t)&&Tt(r)){let a=t.image.toUpperCase(),o=r.image.toUpperCase();if(n.some(e=>e.key===a||e.key===o))return i({...e,inputs:[Et(t),Et(r)]})}}if(e.type===j.Named){let t=X(e);if(t!==void 0){let r=t.toUpperCase();for(let i=n.length-1;i>=0;i--){if(n[i].key!==r)continue;let a={...e,binding:{slot:n[i].slot},isReference:!1};return t!==n[i].name&&(a.value={...e.value,nameId:n[i].name}),a}}return e}let s=i(e);if(s.type===j.Function&&typeof s.value==`string`&&(t?.(s.value)?.getName()??s.value).toUpperCase()===`ISOMITTED`){let e=s.inputs;if(e){let n;for(let r=0;r<e.length;r++){let i=e[r];if(i?.binding&&!i.binding.declaration&&!0!==i.rawFrameRead){(n??=[...e])[r]={...i,rawFrameRead:!0};continue}let a=Q(i,t);a!==i&&((n??=[...e])[r]=a)}if(n)return{...s,inputs:n}}}return s};return a(e)}var Tt=e=>{if(e?.type!==j.Cell||e.image===void 0)return!1;let t=e.value;return t.rowIndex===-(2**53-1)&&!0!==t.$colIndex&&!t.scope},Et=e=>{let t=v(e.image);return A(t,e),t},Dt=e=>e?.type===j.Cell,Ot=(e,t=null)=>{if(!e)return e;let n=!1,r=e=>{if(n||!e)return;let i=Y(e,t),a=e.inputs;if(i&&a){let e=i===`let`?2:1;for(let t=0;t<a.length-1;t+=e)if(Dt(a[t]))return void(n=!0)}if(a)for(let e=0;e<a.length&&!n;e++)r(a[e])};if(r(e),!n)return e;let i=null,a=O(e,e=>{if(e?.type!==j.Cell)return;let t=e.value,n=e.image;if(!0===t?.$colIndex||!0===t?.$rowIndex)return void(i??=`'${n??`a reference`}' cannot be absolute here. A LET/LAMBDA name that is a cell reference makes every reference in the formula a name, and a name cannot contain '$'.`);if(n===void 0)return;let r=v(n);A(r,e);let a=t?.scope;return a&&(r.value.scope=a,r.value.scopeImage=t.scopeImage),r});return i??a},kt=(e,t)=>{if(!e)return null;let n=null,r=e=>{if(n||!e)return;let i=Y(e,t);i&&((e,t)=>{let r=t===`let`?`LET`:`LAMBDA`,i=e.inputs,a=i?.length??0;if(!i||a<2)return;if(t===`let`&&a%2==0)return void(n=`Wrong number of arguments for LET. Expected name/value pairs followed by a calculation, but got ${a}.`);if(t===`lambda`&&i[a-1]?.type===j.Empty)return void(n=`LAMBDA has no calculation: the last argument is empty.`);let o=new Set,s=t===`let`?2:1,c=!1;for(let e=0;e<a-1;e+=s){let a=X(i[e]);if(a===void 0&&t===`lambda`)a=yt(i[e]),a!==void 0&&(c=!0);else if(a!==void 0&&c)return void(n=`Required name '${a}' cannot follow an optional name in ${r}.`);if(a===void 0)return void(n=`Expected a name in ${r} argument ${e+1}; a name cannot be the output of a formula.`);if(a.includes(`.`))return void(n=`Expected a name in ${r} argument ${e+1}; a name cannot contain '.'.`);let s=a.toUpperCase();if(o.has(s))return void(n=`Duplicate name '${a}' in ${r}.`);o.add(s)}})(e,i);let a=e.inputs;if(a)for(let e=0;e<a.length&&!n;e++)r(a[e])};return r(e),n};function At(e,t,n,r,i){let a=r,o,s=()=>(o===void 0&&(o=i&&n?t.bind(T.Table,``,{at:{scope:n,rowIndex:i.rowIndex,colIndex:i.colIndex}}):null),o);return O(e,(e,r,i=[])=>{let o,c=e.type;if(c===j.Cell){let n=e.value;if(n?.scope){let r=t.bind(T.Sheet,n.scope,a);r!==null&&(o||={...e},o.value={...n,scope:r})}}else if(c===j.Named){let r=e.value;if(r&&!e.binding){let i=function(e,t,n,r){if(t.scope){let e=n.bind(T.Sheet,t.scope,r);if(e===null||b(e))return}let i=n.bind(T.Table,t.nameId,{existing:!0});if(i===null)return;let a={type:j.TableReference,value:i,inputs:null,isReference:!0};A(a,e);let o=t.scopeImage;return typeof o==`string`&&e.image!==void 0&&(a.image=o+e.image),a}(e,r,t,a);if(i)return i;let s=r.scope?t.bind(T.Sheet,r.scope,a):null,c=(s===null?r.scope:b(s)?s:t.resolve(T.Sheet,s)?.toString()??r.scope)??n,l=t.bind(T.NamedFormula,r.nameId,c?{scope:c}:void 0);l===null&&s===null||(o||={...e},o.value={...r,nameId:l??r.nameId,...s===null?void 0:{scope:s}})}}else if(c===j.Error){let n=e.value;if(n?.scope){let r=t.bind(T.Sheet,n.scope,a);r!==null&&(o||={...e},o.value={...n,scope:r})}}else if(c===j.TableReference){let n=e.value;if(n){let r=t.bind(T.Table,n);o||={...e},r!==null&&(o.value=r)}else if(typeof n==`string`){let n=s();if(n!==null&&$(e,t))return{...e,value:n}}}else if(c===j.TableColumn){let n=e.value;if(n){let r=B(i,j.TableReference),a=r?.value||(r?s()??void 0:void 0),c=t.bind(T.TableColumn,n,a?{tableName:a}:void 0);o||={...e},c!==null&&(o.value=c)}}else if(c===j.Function){let n=e.value;if(n){let r=t.bind(T.Function,n);o||={...e},r!==null&&(o.value=r)}}return o})}function $(e,t){let n=!0,r=e.inputs;if(!r)return!0;for(let e=0;e<r.length&&n;e++)O(r[e],e=>{e.type===j.TableColumn&&t.resolve(T.TableColumn,e.value)===null&&(n=!1)});return n}function jt(e,t){let n=null;return O(e,e=>{if(n||e.type!==j.TableReference)return;if(e.value===``)return void(n=`A structured reference without a table name must be in a table that has its columns.`);let r=e.value;if(!t||typeof r!=`string`)return;let i=t.resolve(T.Table,r)?.toString()??r;t.bind(T.Table,i,{existing:!0})===null?n=`There is no table named '${i}'.`:$(e,t)||(n=`The table has no such column.`)}),n}export{wt as A,nt as C,tt as D,rt as E,ut as O,mt as S,pt as T,je as _,De as a,kt as b,Ot as c,Te as d,V as f,ht as g,gt as h,Ce as i,xt as j,we as k,Pe as l,Z as m,Ae as n,Me as o,Xe as p,At as r,Oe as s,$e as t,Se as u,jt as v,ot as w,lt as x,ke as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={"FORECAST.ETS":{s:`Returns the forecasted value for a specific future target date using exponential smoothing method.`,p:{targetDate:{d:`is the data point for which you want to predict a value. It should carry on the pattern of values in the timeline.`},values:{d:`is the array or range of numeric data you're predicting.`},timeline:{d:`is the independent array or range of numeric data. The dates in the timeline must have a consistent step between them and can't be zero.`},seasonality:{d:`[1] 0 = no seasonality; 1 = auto-detect; any integer > 1 = explicit seasonal period.`},dataCompletion:{d:`[1] 1 = interpolate missing values; 0 = fill with zeros.`},aggregation:{d:`[1] Aggregation method for duplicate timestamps: 1=Average, 2=Count, 3=CountA, 4=Max, 5=Median, 6=Min, 7=Sum.`}}},"FORECAST.ETS.CONFINT":{s:`Returns a confidence interval for the forecasted value at the specified target date.`,p:{targetDate:{d:`is the data point for which you want to predict a value. It should carry on the pattern of values in the timeline.`},values:{d:`is the array or range of numeric data you're predicting.`},timeline:{d:`is the independent array or range of numeric data. The dates in the timeline must have a consistent step between them and can't be zero.`},confidenceLevel:{d:`[0.95] Confidence probability, must be strictly between 0 and 1.`},seasonality:{d:`[1] 0 = no seasonality; 1 = auto-detect; any integer > 1 = explicit seasonal period.`},dataCompletion:{d:`[1] 1 = interpolate missing values; 0 = fill with zeros.`},aggregation:{d:`[1] Aggregation method for duplicate timestamps: 1=Average, 2=Count, 3=CountA, 4=Max, 5=Median, 6=Min, 7=Sum.`}}},"FORECAST.ETS.SEASONALITY":{s:`Returns the length of the repetitive pattern in the data for the specific time series.`,p:{values:{d:`is the array or range of numeric data you're predicting.`},timeline:{d:`is the independent array or range of numeric data. The dates in the timeline must have a consistent step between them and can't be zero.`},dataCompletion:{d:`[1] 1 = interpolate missing values; 0 = fill with zeros.`},aggregation:{d:`[1] Aggregation method for duplicate timestamps: 1=Average, 2=Count, 3=CountA, 4=Max, 5=Median, 6=Min, 7=Sum.`}}},"FORECAST.ETS.STAT":{s:`Returns a requested statistic for the ETS forecast model.`,p:{values:{d:`is the array or range of numeric data you're predicting.`},timeline:{d:`is the independent array or range of numeric data.`},statisticType:{d:`1=Alpha, 2=Beta (trend smoothing), 3=Gamma (seasonal smoothing), 4=MASE, 5=SMAPE, 6=MAE, 7=RMSE, 8=Step size.`},seasonality:{d:`[1] 0 = no seasonality; 1 = auto-detect; any integer > 1 = explicit seasonal period.`},dataCompletion:{d:`[1] 1 = interpolate missing values; 0 = fill with zeros.`},aggregation:{d:`[1] Aggregation method for duplicate timestamps: 1=Average, 2=Count, 3=CountA, 4=Max, 5=Median, 6=Min, 7=Sum.`}}}};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=class e{static{this.SIGNATURE=3759263696}static{this.ENDOFCHAIN=4294967294}static{this.FREESECT=4294967295}constructor(t){this.buf=t,this.dv=new DataView(t.buffer,t.byteOffset,t.byteLength);let n=this.dv;if(n.getUint32(0,!0)!==e.SIGNATURE)throw Error(`Not an OLE Compound File (bad signature).`);let r=n.getUint16(30,!0),i=n.getUint16(32,!0);this.sectorSize=1<<r,this.miniSectorSize=1<<i,this.miniStreamCutoff=n.getUint32(56,!0)||4096;let a=n.getUint32(48,!0),o=n.getUint32(60,!0),s=n.getUint32(64,!0),c=n.getUint32(68,!0),l=n.getUint32(72,!0),u=[];for(let t=0;t<109;t++){let r=n.getUint32(76+4*t,!0);if(r===e.FREESECT||r===e.ENDOFCHAIN)break;u.push(r)}let d=c,f=this.sectorSize/4,p=0;for(;d!==e.ENDOFCHAIN&&d!==e.FREESECT&&p++<l+1;){let t=this.sectorOffset(d);for(let r=0;r<f-1;r++){let i=n.getUint32(t+4*r,!0);i!==e.FREESECT&&i!==e.ENDOFCHAIN&&u.push(i)}d=n.getUint32(t+4*(f-1),!0)}let m=new Uint32Array(u.length*f),h=0;for(let e of u){let t=this.sectorOffset(e);for(let e=0;e<f;e++)m[h++]=n.getUint32(t+4*e,!0)}this.fat=m;let g=this.readChain(a),_=new DataView(g.buffer,g.byteOffset,g.byteLength),v=[],y=Math.floor(g.length/128);for(let e=0;e<y;e++){let t=128*e,n=g[t+66];if(n===0)continue;let r=_.getUint16(t+64,!0),i=``;for(let e=0;e<r/2-1&&e<31;e++)i+=String.fromCharCode(_.getUint16(t+2*e,!0));v.push({name:i,type:n,startSector:_.getUint32(t+116,!0),size:_.getUint32(t+120,!0)})}this.entries=v,this.byName=new Map(v.map(e=>[e.name,e]));let b=s?this.readChain(o):new Uint8Array,x=new DataView(b.buffer,b.byteOffset,b.byteLength);this.miniFat=new Uint32Array(Math.floor(b.length/4));for(let e=0;e<this.miniFat.length;e++)this.miniFat[e]=x.getUint32(4*e,!0);let S=v.find(e=>e.type===5);this.miniStream=S?this.readChainSized(S.startSector,S.size):new Uint8Array}static read(t){let n=t instanceof Uint8Array?t:new Uint8Array(t);return new e(n)}sectorOffset(e){return(e+1)*this.sectorSize}readChain(t){let n=[],r=t,i=0;for(;r!==e.ENDOFCHAIN&&r!==e.FREESECT&&i++<1e6;){let e=this.sectorOffset(r);n.push(this.buf.subarray(e,e+this.sectorSize)),r=this.fat[r]}return e.concat(n)}readChainSized(e,t){return this.readChain(e).subarray(0,t)}readMiniChain(t,n){let r=[],i=t,a=0;for(;i!==e.ENDOFCHAIN&&i!==e.FREESECT&&a++<1e6;){let e=i*this.miniSectorSize;r.push(this.miniStream.subarray(e,e+this.miniSectorSize)),i=this.miniFat[i]}return e.concat(r).subarray(0,n)}static concat(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}getStreamEntries(){return this.entries.filter(e=>e.type===2)}has(e){return this.byName.has(e)}readStream(e){let t=this.byName.get(e);return t&&t.type===2?this.readStreamEntry(t):null}readStreamEntry(e){return e.size<this.miniStreamCutoff?this.readMiniChain(e.startSector,e.size):this.readChainSized(e.startSector,e.size)}};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./-cpi3yOZYn6GsYN4.js";import{n as r}from"./CXGgKVbVXjWzE0p6.js";import{t as i}from"./BEwl-ucV9Jfr0RoC.js";import{$ as a,et as o,j as s,r as c}from"./DGXDfjkGZjMRAXPg.js";import{n as l}from"./J73KTOmdZGNmnq-z.js";import{X as u}from"./B4PbXdzBe9BsoZ0e.js";import{i as d,n as ee,r as te}from"./DmbuCapSSCYIa3yk.js";var f=e(t(),1),p=n(),m=e=>Math.round(1e3*e)/1e3,h=(e,t,n)=>{let r=m(50*(1-e.width/(n*t.width))),i=m(50*(1-e.height/(n*t.height)));return{left:r,right:r,top:i,bottom:i}},g=(e,t)=>h(e,t,Math.max(e.width/t.width,e.height/t.height)),_=(e,t)=>h(e,t,Math.min(e.width/t.width,e.height/t.height)),v=(e,t,n)=>{let r=Math.min(e.width,e.height*n),i=r/n,{left:a=0,top:o=0,right:s=0,bottom:c=0}=t,l=(e.width-r)/2/e.width*(100-a-s),u=(e.height-i)/2/e.height*(100-o-c);return{bounds:{x:e.x+(e.width-r)/2,y:e.y+(e.height-i)/2,width:r,height:i},crop:{left:m(a+l),right:m(s+l),top:m(o+u),bottom:m(c+u)}}},y=`data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=`,ne={left:`0%`,top:`0%`,width:`100%`,height:`100%`},b={position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,display:`block`,pointerEvents:`none`},re=(0,f.memo)((0,f.forwardRef)((e,t)=>{let{children:n,disabled:m,style:h,picture:g,movable:_,zoom:v=1,gesture:re,description:ie,tile:x,offsetX:S=0,offsetY:C=0,isDragging:w,onHide:ae,onShow:oe,onDragZone:se,adornmentHost:ce,flip:T,onKeyDownCapture:le,onFocus:ue,onBlur:de,loadingPanel:fe,...pe}=e,[E,D]=(0,f.useState)(!1),[O,me]=(0,f.useState)(null),[k,A]=(0,f.useState)(null),[j,M]=(0,f.useState)(null),[he,N]=(0,f.useReducer)(e=>e+1,0);r(g,{onAnyChange:N}),r(_??null,{onBoundsChange:N,onSelectionChange:N});let ge=i(),_e=s(),P=g.toJSON(),{width:F,height:I,rotation:L}=ee(_),R=F>0&&I>0,z=!!P.fill||!!P.stroke||P.geometry!==void 0&&P.geometry!==`rect`,ve=P.adjustments?JSON.stringify(P.adjustments):``,[B,V]=(0,f.useState)(null),[ye,H]=(0,f.useState)(!1);(0,f.useEffect)(()=>{if(!z||!R)return V(null),void H(!1);let e=!0;return g.getGeometry(F,I).then(t=>{e&&(V(t),H(!0))},()=>{e&&(V(null),H(!0))}),()=>{e=!1}},[g,z,R,P.geometry,ve]);let U=(0,f.useMemo)(()=>B&&R?B.getWidth()===F&&B.getHeight()===I?B:B.resize(F,I):null,[B,R,F,I]);a(!E&&(x?!k:!O)||z&&R&&!ye);let W=ge?.getStyles()??null,G=(0,f.useMemo)(()=>z?te({fill:P.fill,stroke:P.stroke,style:null},W):null,[z,P.fill,P.stroke,W]),K=`${(0,f.useId)().replace(/[^A-Za-z0-9_-]/g,``)}-clip`,q=(0,f.useMemo)(()=>{if(!U||P.geometry===void 0||P.geometry===`rect`)return null;let e=[];return U.forEachPath(t=>{t.layer===`fill`&&e.push(t.d)}),e.length>0?e.join(` `):null},[U,P.geometry]),J=T?.horizontal??!1,Y=T?.vertical??!1,X=(0,f.useMemo)(()=>L%360==0&&R?{dpr:o.getDevicePixelRatio(),zoom:v,width:F,height:I,flipH:J,flipV:Y}:null,[L,R,v,F,I,J,Y]),Z=g.getHyperlink?.()??null,Q=u(l,null),$=(0,f.useRef)(null);(0,f.useEffect)(()=>()=>{$.current?.(),Q(e=>e===g?null:e)},[g,Q]),(0,f.useEffect)(()=>{Z||Q(e=>e===g?null:e)},[!Z,g,Q]),(0,f.useEffect)(()=>{A(null),g.getDetails().then(e=>{D(!1),A(e.asUrl()),M(e.asSVGText?.()||null)}).catch(e=>{console.warn(e),D(!0),A(y),M(null)})},[g,he]);let be=c(t,()=>({isPictureEditor:()=>!0}),[]),xe=P.image?.sourceRect,Se=(0,f.useMemo)(()=>(e=>{let{left:t=0,top:n=0,right:r=0,bottom:i=0}=e??{},a=(100-t-r)/100,o=(100-n-i)/100;return{left:-t/a+`%`,top:-n/o+`%`,width:100/a+`%`,height:100/o+`%`}})(xe),[xe]),Ce=(0,f.useMemo)(()=>{if(k||j)return x?(0,p.jsx)(`div`,{style:{backgroundPosition:`${S}px ${C}px`,backgroundImage:`url(${k})`,backgroundRepeat:`repeat`,backgroundSize:`auto`,width:`100%`,height:`100%`,filter:`var(--sxl-image-filter)`}}):(0,p.jsx)(`img`,{style:{position:`absolute`,...E?ne:Se,border:E?`var(--sxl-color-neutral, grey) solid 1px`:void 0,backgroundColor:E?`var(--sxl-color-base-100, white)`:void 0,boxShadow:E?`0px 0px 3px var(--sxl-color-error, red)`:void 0,objectFit:E?`contain`:void 0,opacity:+!!O,filter:`var(--sxl-image-filter)`},draggable:!1,src:k??void 0,onLoad:()=>{me(!0)},onError:({currentTarget:e})=>{console.log(`error`),e.onerror=null,A(y),D(!0)},alt:ie??`${g.getType()}`})},[O,g,k,j,w,x,S,C,Se,E,ie]);if(g.isDeleted())return;let we=T&&(T.horizontal||T.vertical)?`scale(${T.horizontal?-1:1}, ${T.vertical?-1:1})`:void 0,Te=h?.pointerEvents===`none`?`none`:`visiblePainted`,{left:Ee=0,top:De=0,right:Oe=0,bottom:ke=0}=P.image?.stretch??{};return(0,p.jsxs)(`div`,{className:`picture-editor`,style:{position:`relative`,display:`flex`,flex:`1 1 100%`,filter:w?`drop-shadow(1px 1px 1.5px var(--sxl-color-shadow, rgba(0, 0, 0, .25)))`:void 0,transform:we,transformOrigin:`center`,...h,pointerEvents:`none`,width:`100%`,height:`100%`},tabIndex:0,...pe,onPointerDownCapture:Z?e=>{if(e.button!==0||e.ctrlKey||e.metaKey||e.shiftKey||!_||_.isSelected())return;$.current?.();let t=e.currentTarget.ownerDocument,{pointerId:n,clientX:r,clientY:i,timeStamp:a}=e.nativeEvent,o=e=>{if(e.pointerId!==n||($.current?.(),!(Math.abs(e.clientX-r)<=4&&Math.abs(e.clientY-i)<=4&&e.timeStamp-a<=500)))return;let t=g.getHyperlink();t&&(_.unselect(),t.open().catch(e=>{_e.showError?.(e instanceof Error?e:String(e))}))},s=e=>{e.pointerId===n&&$.current?.()};t.addEventListener(`pointerup`,o),t.addEventListener(`pointercancel`,s),$.current=()=>{$.current=null,t.removeEventListener(`pointerup`,o),t.removeEventListener(`pointercancel`,s)}}:void 0,onPointerEnter:Z?()=>{Q(g)}:void 0,onPointerLeave:Z?()=>{Q(e=>e===g?null:e)}:void 0,onKeyDownCapture:e=>{le?.(e)},ref:be,children:[U&&G?(0,p.jsx)(`svg`,{className:`picture-fill`,viewBox:`0 0 ${F} ${I}`,preserveAspectRatio:`none`,overflow:`visible`,style:b,children:(0,p.jsx)(d,{geometry:U,style:{...G,stroke:null,strokeGradient:void 0,strokeWidth:0},zoom:v,grid:X,hit:Te})}):null,q?(0,p.jsx)(`svg`,{width:0,height:0,style:{position:`absolute`},"aria-hidden":!0,children:(0,p.jsx)(`defs`,{children:(0,p.jsx)(`clipPath`,{id:K,clipPathUnits:`objectBoundingBox`,children:(0,p.jsx)(`path`,{d:q,transform:`scale(${1/F} ${1/I})`})})})}):null,(0,p.jsx)(`div`,{className:`picture-clip`,style:{position:`absolute`,...ne,clipPath:q?`url(#${K})`:void 0,pointerEvents:h?.pointerEvents??`auto`,cursor:Z&&!_?.isSelected()?`pointer`:void 0},children:(0,p.jsxs)(`div`,{className:`picture-image`,style:{position:`absolute`,left:`${Ee}%`,top:`${De}%`,right:`${Oe}%`,bottom:`${ke}%`,overflow:`hidden`},children:[O||E?void 0:fe,Ce]})}),U&&G&&G.strokeWidth>0?(0,p.jsx)(`svg`,{className:`picture-border`,viewBox:`0 0 ${F} ${I}`,preserveAspectRatio:`none`,overflow:`visible`,style:b,children:(0,p.jsx)(d,{geometry:U,style:{...G,fill:null,gradient:void 0,image:void 0},zoom:v,grid:X,hit:Te})}):null]})}));re.displayName=`PictureEditor`;export{g as i,re as n,_ as r,v as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={COMPLEX:{s:`Converts real and imaginary coefficients into a complex number.`,p:{realNum:{d:`is the real coefficient of the complex number.`},iNum:{d:`is the imaginary coefficient of the complex number.`},suffix:{d:`is the suffix for the imaginary component of the complex number.`}}},IMABS:{s:`Returns the absolute value (modulus) of a complex number`,p:{inumber:{d:`is a complex number for which you want the absolute value`}}},IMAGINARY:{s:`Returns the imaginary coefficient of a complex number`,p:{inumber:{d:`is a complex number for which you want the imaginary coefficient`}}},IMARGUMENT:{s:`Returns the argument q, an angle expressed in radians`,p:{inumber:{d:`is a complex number for which you want the argument`}}},IMCONJUGATE:{s:`Returns the complex conjugate of a complex number`,p:{inumber:{d:`is a complex number for which you want the conjugate`}}},IMCOS:{s:`Returns the cosine of a complex number`,p:{inumber:{d:`is a complex number for which you want the cosine`}}},IMCOSH:{s:`Returns the hyperbolic cosine of a complex number`,p:{inumber:{d:`is a complex number for which you want the hyperbolic cosine`}}},IMCOT:{s:`Returns the cotangent of a complex number`,p:{inumber:{d:`is a complex number for which you want the cotangent`}}},IMCOTH:{s:`Returns the hyperbolic cotangent of a complex number.`,c:`Sheets`,p:{inumber:{d:`is a complex number for which you want the hyperbolic cotangent.`}}},IMCSC:{s:`Returns the cosecant of a complex number`,p:{inumber:{d:`is a complex number for which you want the cosecant`}}},IMCSCH:{s:`Returns the hyperbolic cosecant of a complex number`,p:{inumber:{d:`is a complex number for which you want the hyperbolic cosecant`}}},IMDIV:{s:`Returns the quotient of two complex numbers`,p:{inumber1:{d:`is the complex numerator or dividend`},inumber2:{d:`is the complex denominator or divisor`}}},IMEXP:{s:`Returns the exponential of a complex number`,p:{inumber:{d:`is a complex number for which you want the exponential`}}},IMLN:{s:`Returns the exponential of a complex number`,p:{inumber:{d:`is a complex number for which you want the exponential`}}},IMLOG:{s:`Returns the logarithm of a complex number to a specified base.`,c:`Sheets`,p:{inumber:{d:`is a complex number for which you want the logarithm.`},base:{d:`is the base of the logarithm. Default is 10.`}}},IMLOG10:{s:`Returns the base-10 logarithm of a complex number`,p:{inumber:{d:`is a complex number for which you want the common logarithm`}}},IMLOG2:{s:`Returns the base-2 logarithm of a complex number`,p:{inumber:{d:`is a complex number for which you want the base-2 logarithm`}}},IMPOWER:{s:`Returns the base-2 logarithm of a complex number`,p:{inumber:{d:`is a complex number for which you want the base-2 logarithm`},number:{}}},IMPRODUCT:{s:`Returns the product of 1 to 255 complex numbers`,p:{inumber:{d:`are from 1 to 255 complex numbers to multiply.`}}},IMREAL:{s:`Returns the real coefficient of a complex number`,p:{inumber:{d:`is a complex number for which you want the real coefficient`}}},IMSEC:{s:`Returns the secant of a complex number`,p:{inumber:{d:`is a complex number for which you want the secant`}}},IMSECH:{s:`Returns the hyperbolic secant of a complex number`,p:{inumber:{d:`is a complex number for which you want the hyperbolic secant`}}},IMSIN:{s:`Returns the sine of a complex number`,p:{inumber:{d:`is a complex number for which you want the sine`}}},IMSINH:{s:`Returns the hyperbolic sine of a complex number`,p:{inumber:{d:`is a complex number for which you want the hyperbolic sine`}}},IMSQRT:{s:`Returns the square root of a complex number`,p:{inumber:{d:`is a complex number for which you want the square root`}}},IMSUB:{s:`Returns the difference of two complex numbers`,p:{inumber1:{d:`is the complex number from which to subtract inumber2`},inumber2:{d:`is the complex number to subtract from inumber1`}}},IMSUM:{s:`Returns the sum of complex numbers`,p:{inumber:{d:`are from 1 to 255 complex numbers to add`}}},IMTAN:{s:`Returns the tangent of a complex number`,p:{inumber:{d:`is a complex number for which you want the tangent`}}},IMTANH:{s:`Returns the hyperbolic tangent of a complex number.`,c:`Sheets`,p:{inumber:{d:`is a complex number for which you want the hyperbolic tangent.`}}}};export{e as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./-cpi3yOZYn6GsYN4.js";import{n as r}from"./CXGgKVbVXjWzE0p6.js";import{t as i}from"./CXUO3vYip3JPSJ7A.js";import{r as a}from"./DGXDfjkGZjMRAXPg.js";import{n as o}from"./zFbb8ESzwR_bE7IQ.js";import{D as s,Lt as c,U as l,Y as u,m as d}from"./Ca6nxdhEuLLty3d7.js";var f=e(t(),1),p=n(),m=`data-run`,h=e=>typeof e==`string`?e?[{text:e}]:[]:e.runs??[],g=e=>{if(e.nodeType===3)return e.nodeValue??``;if(e.nodeType!==1)return``;if(e.localName===`br`)return`
|
|
2
|
+
`;let t=``,n=e.childNodes;for(let e=0;e<n.length;e++)t+=g(n[e]);return t},_=(0,f.memo)((0,f.forwardRef)((e,t)=>{let{value:n,onChange:r,onDone:a,readOnly:o=!1,runStyle:s,style:c,onKeyDown:l,onBlur:u,...d}=e,_=(0,f.useRef)(null),v=(0,f.useMemo)(()=>h(n),[n]),y=(0,f.useMemo)(()=>JSON.stringify(n),[n]),b=()=>{let e=_.current;if(!e||o)return;let t=((e,t)=>{let n=[],r=e.childNodes;for(let e=0;e<r.length;e++){let i=r[e],a=g(i);if(!a)continue;let o=i.nodeType===1?i.getAttribute(m):null;if(o!==null){let e=t[parseInt(o,10)]?.font;n.push(e?{text:a,font:e}:{text:a});continue}let s=n[n.length-1];s?s.text+=a:n.push({text:a})}return n.every(e=>!e.font)?n.map(e=>e.text).join(``):{runs:n}})(e,v);JSON.stringify(h(t))!==JSON.stringify(v)&&r?.(t)},x=e=>{e.stopPropagation()},S=i([_,t]);return(0,p.jsx)(`div`,{ref:S,contentEditable:!o&&`plaintext-only`,suppressContentEditableWarning:!0,spellCheck:!1,...d,style:{width:`100%`,minHeight:`100%`,boxSizing:`border-box`,outline:`none`,whiteSpace:`pre-wrap`,overflowWrap:`break-word`,userSelect:`text`,cursor:o?void 0:`text`,...c},onKeyDown:e=>{l?.(e),o||(e.stopPropagation(),e.key===`Escape`&&(e.preventDefault(),e.currentTarget.blur(),a?.()))},onKeyUp:o?void 0:x,onCopy:o?void 0:x,onCut:o?void 0:x,onPaste:o?void 0:x,onBlur:e=>{b(),u?.(e)},children:v.map((e,t)=>(0,p.jsx)(`span`,{[m]:t,style:e.font?s?.(e.font):void 0,children:e.text},t))},y)}));_.displayName=`RichTextEditor`;var v=new c(d.Named.InfoBk).toCSS(`adaptive`),y=new c(d.Named.InfoText).toCSS(`adaptive`),b=(e,t)=>{if(t)try{return e.getWorksheet().getStyles().parseColor(t)?.toCSS(`adaptive`)}catch{return}},x=(e,t)=>{let n=t.family;if(n===l.ThemeFamily.Heading||n===l.ThemeFamily.Body){let t=e.getWorksheet().getStyles().getTheme().getFontScheme();n=(n===l.ThemeFamily.Heading?t.getMajorFont():t.getMinorFont())??void 0}if(n)return s.toCSSFontFamily(n,t.fallbacks)},S=e=>{let t=[],n=e.underline;if(n&&n!==s.UnderlineStyle.None&&t.push(`underline`),e.strike&&e.strike!==s.StrikeStyle.None&&t.push(`line-through`),t.length===0)return;let r=n===s.UnderlineStyle.Double||n===s.UnderlineStyle.DoubleAccounting;return t.join(` `)+(r?` double`:``)},C=e=>{let t={borderWidth:`1px`,borderStyle:`solid`,borderColor:`var(--sxl-note-border-color, ${y})`,backgroundColor:`var(--sxl-note-background-color, ${v})`},n=e.getStyle(),r=n?.toJSON();if(!n||!r)return t;try{if(r.fill&&(delete t.backgroundColor,Object.assign(t,n.getFill().toCSS(`adaptive`))),r.stroke){let e=n.getStroke();if(e.isVisible()){let{borderWidth:n,borderStyle:r,borderColor:i}=e.toCSS(`adaptive`);Object.assign(t,{borderWidth:n,borderStyle:r,borderColor:i}),e.getCompound()!==u.Compound.Single&&(t.borderStyle=`double`)}else t.borderStyle=`none`}}catch{}return t},w=(0,f.memo)((0,f.forwardRef)((e,t)=>{let{children:n,disabled:i,style:s,note:c,movable:l,zoom:u=1,isDragging:d,onHide:m,onShow:h,onDragZone:g,adornmentHost:v,flip:w,gesture:T,...E}=e,[,D]=(0,f.useReducer)(e=>e+1,0);r(c,{onContentChange:()=>{D()},onAnyChange:()=>{D()}});let O=a(t,()=>({isNoteEditor:()=>!0}),[]);if(!c.isDeleted()&&c.isNote())return(0,p.jsx)(o,{className:`note-editor`,...E,ref:O,movable:l,onContextMenu:e=>{e.stopPropagation()},onDragZone:g,disabled:i,style:{...C(c),color:`var(--sxl-note-color, ${y})`,fontFamily:`Tahoma, sans-serif`,fontSize:`9pt`,zoom:u,boxShadow:d?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,...s},contentStyle:{padding:`0px 1px`},children:(0,p.jsx)(_,{value:c.getRichContent()??c.getContent(),readOnly:i,runStyle:e=>((e,t)=>{if(!t)return;let n=!!t.baseline,r=t.size===void 0?void 0:`${t.size}pt`;return n&&(r=t.size===void 0?`smaller`:.66*t.size+`pt`),{fontFamily:x(e,t),fontSize:r,fontWeight:t.weight,fontStyle:t.style,textDecoration:S(t),verticalAlign:n?t.baseline>0?`super`:`sub`:void 0,letterSpacing:t.letterSpacing===void 0?void 0:`${t.letterSpacing}px`,color:b(e,t.color)}})(c,e),onChange:e=>{c.setContent(e)},onDone:()=>{l?.unselect()}})})}));w.displayName=`NoteEditor`;export{w as NoteEditor};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={AND:{s:`Checks whether all arguments are TRUE, and returns TRUE if all arguments are TRUE.`,p:{logical:{d:`are 1 to 255 conditions you want to test that can be either TRUE or FALSE and can be logical values, arrays, or references.`}}},BYCOL:{s:`Applies a LAMBDA function to each column and returns an array of the results.`,p:{array:{d:`is an array to be separated by column.`},fn:{d:`is a LAMBDA that takes a column as its single parameter and returns one result for it.`}}},BYROW:{s:`Applies a LAMBDA function to each row and returns an array of the results.`,p:{array:{d:`is an array to be separated by row.`},fn:{d:`is a LAMBDA that takes a row as its single parameter and returns one result for it.`}}},FALSE:{s:`Returns the logical value FALSE.`,p:{}},FLATTEN:{s:`Flattens all the values from one or more ranges into a single column.`,c:`Sheets`,p:{ranges:{d:`One or more ranges or scalar values to flatten.`}}},IF:{s:`Checks whether a condition is met, and returns one value if TRUE, and another value if FALSE.`,p:{logicalTest:{d:`is any value or expression that can be evaluated to TRUE or FALSE.`},valueIfTrue:{d:`is the value that is returned if logicalTest is TRUE. If omitted, TRUE is returned. You can nest up to seven IF functions.`},valueIfFalse:{d:`is the value that is returned if logicalTest is FALSE. If omitted, FALSE is returned.`}}},IFERROR:{s:`Returns valueIfError if expression is an error and the value of the expression itself otherwise.`,p:{value:{d:`is any value or expression or reference.`},valueIfError:{d:`is any value or expression or reference.`}}},IFNA:{s:`Returns the value you specify if the expression resolves to #N/A, otherwise returns the result of the expression.`,p:{value:{d:`is any value or expression or reference.`},valueIfNA:{d:`is any value or expression or reference.`}}},IFS:{s:`Checks whether one or more conditions are met and returns a value corresponding to the first TRUE condition.`,p:{condition:{d:`the conditions to test and the values to return for them.`},"condition.logicalTest":{d:`is any value or expression that can be evaluated to TRUE or FALSE.`},"condition.logicalTrue":{d:`is the value returned if logicalTest is TRUE.`}}},LAMBDA:{s:`Creates a function value which can be called within formulas.`,p:{parameterOrCalculation:{d:`a parameter or a calculation that returns a value. If a parameter, it must be the last argument.`}}},LET:{s:`Assigns calculation results to names. Useful for storing intermediate calculations and values by defining names inside a formula. These names only apply within the scope of the LET function.`,p:{name:{d:`the name, or a calculation which can make use of all names within the LET. Names must start with a letter, cannot be the output of a formula, or conflict with range syntax.`},nameOrValue:{d:`the value associated with the name.`},calculationOrName:{},rest:{}}},MAKEARRAY:{s:`Returns a calculated array of a specified row and column size, by applying a LAMBDA function.`,p:{rows:{d:`is the number of rows in the array. Must be greater than zero.`},columns:{d:`is the number of columns in the array. Must be greater than zero.`},fn:{d:`is a LAMBDA that is called to create the array. The LAMBDA takes two parameters, row index and column index.`}}},MAP:{s:`Returns an array formed by 'mapping' each value in the array(s) to a new value by applying a lambda to create a new value.`,p:{array:{d:`is an array to be mapped.`},lambdaOrArray:{d:`is a LAMBDA which must be the last argument and must have a parameter for each array passed, or another array to be mapped.`}}},NOT:{s:`Changes FALSE to TRUE, or TRUE to FALSE.`,p:{logical:{d:`is a value or expression that can be evaluated to TRUE or FALSE.`}}},OR:{s:`Checks whether any of the arguments are TRUE, and returns TRUE or FALSE. Returns FALSE only if all arguments are FALSE.`,p:{logical:{d:`are 1 to 255 conditions that you want to test that can be either TRUE or FALSE.`}}},REDUCE:{s:`Reduces an array to an accumulated value by applying a LAMBDA function to each value and returning the total value in the accumulator.`,p:{initialValue:{d:`is the starting value for the accumulator.`},array:{d:`is an array to be reduced.`},fn:{d:`is a LAMBDA that is called to reduce the array. The LAMBDA takes two parameters, accumulator and value.`}}},REDUCEIF:{s:`Reduces the cells specified by a given condition or criteria.`,c:`SheetXL`,p:{range:{d:`is the range of cells you want evaluated.`},criteria:{d:`is the condition or criteria in the form of a number, expression, or text that defines which cells will be reduced.`},reduceRange:{d:`are the actual cells to reduce. If omitted, the cells in range are used. This can be blank.`},fn:{d:`is a LAMBDA that is called to reduce the array. The LAMBDA takes two parameters, accumulator and value.`}}},SCAN:{s:`Scans an array by applying a LAMBDA function to each value and returns an array that has each intermediate value.`,p:{initialValue:{d:`is the starting value for the accumulator.`},array:{d:`is an array to be reduced.`},fn:{d:`is a LAMBDA that is called to reduce the array. The LAMBDA takes two parameters, accumulator and value.`}}},SWITCH:{s:`Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If there is no match, an optional default value is returned.`,p:{expression:{d:`is an expression to be evaluated.`},match:{d:`the values to compare against expression and the results to return for them.`},"match.value":{d:`is a value to compare against expression.`},"match.result":{d:`is a result to be returned if the corresponding value matches expression.`},defaultResult:{d:`is the result to be returned when no value matches expression.`}}},TRUE:{s:`Returns the logical value TRUE.`,p:{}},XOR:{s:`Returns a logical 'Exclusive Or' of all arguments.`,p:{logical:{d:`are 1 to 254 conditions you want to test that can be either TRUE or FALSE and can be logical values, arrays, or references.`}}}};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={BESSELI:{s:`Returns the modified Bessel function In(x).`,p:{x:{d:`is the value at which to evaluate the function.`},n:{d:`is the order of the Bessel function.`}}},BESSELJ:{s:`Returns the Bessel function Jn(x).`,p:{x:{d:`is the value at which to evaluate the function.`},n:{d:`is the order of the Bessel function.`}}},BESSELK:{s:`Returns the modified Bessel function Kn(x).`,p:{x:{d:`is the value at which to evaluate the function.`},n:{d:`is the order of the function.`}}},BESSELY:{s:`Returns the Bessel function Yn(x).`,p:{x:{d:`is the value at which to evaluate the function.`},n:{d:`is the order of the function.`}}}};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t}from"./-cpi3yOZYn6GsYN4.js";var n=e(t(),1),r=(e,t,r)=>{let i=(0,n.useRef)(t);i.current=t;let o=(r=r?{...a,...r}:a).ignoreModelChange;(0,n.useEffect)(()=>{if(!e||!i.current)return;let t=Object.keys(i.current),n={},a=t.length;for(let e=0;e<a;e++){let r=t[e];n[r]=(e,t)=>i.current[r]?.(e,t)}let s=r?.debugText;s&&console.log(`Add: `+s);let c=e.addListeners(n,r);if(!o)for(let r=0;r<a;r++)n[t[r]]?.(e);return()=>{s&&console.log(`Remove: `+s),c?.()}},[e])};function i(e,t){let[i,a]=(0,n.useReducer)(e=>e+1,0);r(e,(0,n.useMemo)(()=>{let e=(e,t)=>{a()},n=Array.isArray(t)?t:[t],r={};for(let t of n)r[t]=e;return r},[e,...Array.isArray(t)?t:[t]]))}var a={transactional:!1,ignoreModelChange:!1};export{r as n,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e={PHONETIC:{s:`Returns the phonetic spelling of a text string.`,p:{reference:{d:`Text string or a reference to a single cell or a range of cells that contain a furigana text string.`}},h:`Unimplemented Japanese.`}};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t}from"./-cpi3yOZYn6GsYN4.js";var n=e(t(),1);function r(e,t){if(typeof e==`function`)return e(t);e&&(e.current=t)}var i=parseInt(n.version.split(`.`)[0],10)>=19?function(e){return t=>{let n=[];for(let i of e){let e=r(i,t),a=typeof e==`function`;n.push(a?e:()=>r(i,null))}return()=>{for(let e of n)e()}}}:function(e){return t=>{for(let n of e)r(n,t)}};function a(e){return(0,n.useMemo)(()=>i(e),e)}export{a as t};
|