@sheetxl/mcp 0.8.0-beta.20 → 0.8.0-beta.21
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/assets/{BieAybaOdneMdvBS.js → -NFft0E2Wj6WH3X9.js} +1 -1
- package/assets/{Bp9zuG6P6r9GEb6G.js → 0ewqK5X66DZmbhVR.js} +1 -1
- package/assets/{Dc2LiflUYpt0nVVk.js → 1bSTbCnkTWvsV82p.js} +4 -4
- package/assets/{DMDx0fX8tHKH0DdL.js → 4-DOIpV6Hjaymwy7.js} +2 -2
- package/assets/{BKc7zTK6ZIhcD_Wu.js → 69EXDk0YRdjdM86i.js} +1 -1
- package/assets/{DNwyEanz3LqtOorY.js → 8wMcuw3b1CFk-D5A.js} +1 -1
- package/assets/{IDq3QQa5uRqjVJx_.js → AGdlSbOsXWO1oZAE.js} +1 -1
- package/assets/{C9eaFlFi_4GmymzP.js → B1l0k4ErELObdQKE.js} +40 -40
- package/assets/{CrULZhDt8uE-MR2s.js → B4Z_YneQya9mUTN5.js} +1 -1
- package/assets/{eV0oowKJe44NBnWj.js → B8NDzDM0Gpwmkylq.js} +1 -1
- package/assets/{CoOIn2wx6je_rMDO.js → B8URptQcztz4DRvS.js} +23 -23
- package/assets/{D--emvI048MvLsXl.js → BABP2ffkRrOs7_Ym.js} +1 -1
- package/assets/{C7oUg84aGjYrJUc6.js → BAqvmoeYqG6dwX3I.js} +2 -2
- package/assets/{CgIHqG1qp9n1Gwm7.js → BC2Y5XPkMBKS6jQX.js} +274 -270
- package/assets/{rtUwIBgECTX9UO_B.js → BEOwJnsyIuMC4SaI.js} +4 -4
- package/assets/{Bg8EN9R3hbeNfFyU.js → BJo3edG_rqch-Kw2.js} +52 -52
- package/assets/{DnDTldUjKy0O586y.js → BM9zwvBRXNbO_uD-.js} +2 -2
- package/assets/{YG5hEr6CzWNmNJQ2.js → BMkhJwKP7goV0vlJ.js} +1 -1
- package/assets/{BYYbglFmasE5PrS2.js → BRiLNigzVwOBIxBy.js} +1 -1
- package/assets/{DV_nCOON8Fgq5RBt.js → BU7t2vK3_DH_BbMd.js} +2 -2
- package/assets/{C9wXzrhl0dwqZgJ6.js → BVDaUnmVOSaDw9e3.js} +1 -1
- package/assets/{DndzARNYtmumqGnG.js → BWqKV3QuZX31WPsa.js} +1 -1
- package/assets/{C0MAjW1vgsw6o0fx.js → BZJvWc-5DdAyHXFk.js} +1 -1
- package/assets/{PMBjuoD2MpG87dao.js → B_RppF41PrYlelc_.js} +1 -1
- package/assets/{mYZ9Z5AKCn7zltHw.js → B_n6s7Kj4_5BWn1q.js} +2 -2
- package/assets/{Dv9ZDmKuxn2tQDGb.js → Bagfe_VVU6NyQNS6.js} +1 -1
- package/assets/{DcwqgbgqPyzQxSsQ.js → BbsMdXiRzPW9BCEK.js} +1 -1
- package/assets/{C46dyA4YSP1-iTSN.js → BeMLPoHRWacCbpl2.js} +1 -1
- package/assets/{BHiZ3GtGCWUWwHqY.js → BneTvtEMcBoSiQnw.js} +3 -3
- package/assets/{klKXcdZmbQmsK2rt.js → BrgptoFtJepXL46Z.js} +1 -1
- package/assets/{CbTKUrroY9PQ6eTu.js → BtiRDaBbNpPpKelt.js} +3 -3
- package/assets/{Dsjx528shW3GcGpD.js → BtjG4s0StUieGI5b.js} +3 -3
- package/assets/{CW2Ca6tsd0aLTz88.js → C0pbMKm0FzhOek9r.js} +1 -1
- package/assets/{DALP-GkmzCJdFIV9.js → C1ZP9W2tiVQUwLqZ.js} +1 -1
- package/assets/{YGYD-116vlZfzPn1.js → C1xe-BzKWT17OO8a.js} +15 -15
- package/assets/{BJYl-kvBtcnMVP8W.js → C27330XswujHKrLu.js} +1 -1
- package/assets/{C3BZQ5NFwAU_ZdeQ.js → C2YOx4ianxuIIeMP.js} +1 -1
- package/assets/{B4ii9PGvnlYkSX2q.js → C8huq6_Gvbeyf6Zy.js} +2 -2
- package/assets/{C9aV1SF8uCWIB4zU.js → CB9TsE5n0FEyFnAz.js} +15 -15
- package/assets/{BBm3Xjnehvx2fYj8.js → CBTQ8dknYY7RVQgL.js} +8 -8
- package/assets/{nV0eE4R3npcOHLbx.js → CBqpH_MpBSmQRaGE.js} +1 -1
- package/assets/{swG-DVTsez1uNW8c.js → CC2hfzradb2KOvtU.js} +1 -1
- package/assets/{93ksqLKL1o40anfw.js → CDKZI2IIZ9boo7zG.js} +1 -1
- package/assets/{I7LAF1nLmYqQwt9i.js → CDYMLTHkkpRV9igv.js} +1 -1
- package/assets/{DwsoGIyPuoQij_vi.js → CL348305B-kpRYzz.js} +1 -1
- package/assets/{CaI562iJKKOoMw8p.js → CLT0k5UJYPmi8ked.js} +1 -1
- package/assets/{DsSlUklPSAsh9DhW.js → CME1jbwnNlBD66aW.js} +312 -312
- package/assets/{DjH6ckvISyssOSit.js → CPmMYI4DPQcXrZ-g.js} +1 -1
- package/assets/{Co_ZOyp4mKmSfh0A.js → CSd5XfU4JBASIwTI.js} +1 -1
- package/assets/{DzLrAy24em5k5en0.js → CTLGMulzw-oFbgHy.js} +3 -3
- package/assets/{Dx_IFz5FEPKw-HC1.js → CVlsdN5C8QL-Kljv.js} +1 -1
- package/assets/{CTGfmocA1WgM0_e0.js → CXb2mlCk1s1VFPHU.js} +536 -536
- package/assets/{LugZP3XHNnoiiTJO.js → CZ5v2vTWktJ7qAj1.js} +1 -1
- package/assets/{Cheq-qaVWm7EaIlQ.js → CcaH1FoDC8o3dzqp.js} +1 -1
- package/assets/{CyYbUk6pGr3NIBsy.js → Cg05U6rbXUnaz0rA.js} +30 -30
- package/assets/{BEq2PSZQN7VV19RQ.js → ChpUbgXIWuQFoXyL.js} +1 -1
- package/assets/{Ti7kMsQ-Eo3lkfIh.js → ChwSFUzi5mMzUwdW.js} +6 -6
- package/assets/{C9w-KoMwxvouC73F.js → CkGQV_x1SpyzePln.js} +221 -217
- package/assets/{BMH_wtFTiRj43c69.js → CmUz8bVbJgWVT-OB.js} +2 -2
- package/assets/{CpfpXfCqzZumY4pf.js → CpLUgqgBDtlfFRj3.js} +1 -1
- package/assets/{NiD8iNE47sjggYTx.js → CrLDmJU84Dbwl6DZ.js} +1 -1
- package/assets/{Dlbgs8csKymbxu7r.js → CudjOMo6X7FRW6ME.js} +1 -1
- package/assets/{DBfBV-tvRxCLgdvs.js → CzQ2o7qoMm0K7KSb.js} +4 -4
- package/assets/{wYvkLI8IeHaWTtAx.js → D-INtJnS1lCrEs8s.js} +68 -68
- package/assets/{DYRis8fOyk2uIZ-1.js → D1HLIgumuUqrSyYB.js} +4 -4
- package/assets/{Z1zwOeCe-JTLgkxf.js → D2XmpdMAe0SAuQWo.js} +53 -53
- package/assets/{BkhWR4P1Evw_VP5z.js → D3RuKyCyAzvT0bGL.js} +1 -1
- package/assets/{CrRJqUPbvvhnp4p4.js → D5mfuGSeGXSDHj9-.js} +1 -1
- package/assets/{uMoGfJGab8mZX6eN.js → D7WSYqvuwNQjOIuO.js} +1 -1
- package/assets/{B-7inN76S1zUWSAt.js → D9F0224gK4j4Iuq9.js} +1 -1
- package/assets/{CpLTCQemd_cJ4yFu.js → DBgOeiZg40MS63pB.js} +8 -8
- package/assets/{TdK2ciXA5BAlGjbR.js → DG3hKZ75iK2wrCcz.js} +1 -1
- package/assets/{BGlx7_eRiv47Hu9C.js → DITcEcZJ58z5yOx7.js} +1 -1
- package/assets/{noAnElnMhF05bfJN.js → DO86fHS3WYzHN_Rv.js} +1 -1
- package/assets/{Cm2WENwEZ0KMyF--.js → DO9RVxvm9vQh8A_j.js} +2 -2
- package/assets/{B5UmlawoCVwHHM_e.js → DOYXEbY_WslpyqXW.js} +5 -5
- package/assets/{DPUXpIzEs1t-jBiv.js → DP-m2vK0GTaYqQZM.js} +1 -1
- package/assets/{u-pSumbU-rgT6eLF.js → DRiAktGToP73uwgm.js} +224 -224
- package/assets/{q57cDvIPcIvWlh5T.js → DRqBWzdn9KKN68o8.js} +11 -11
- package/assets/{Drmg3-gF0VJs4Yx3.js → DX0znk3xZmL1AyX8.js} +1 -1
- package/assets/{BGQ1GrnQ-X16GU8k.js → Deu2acNFlgo__Mcd.js} +2 -2
- package/assets/{DSy6cpdU-KNWsbSj.js → DjCHmGw-ixoQ6ZTA.js} +2 -2
- package/assets/{CyOyY32LLW-Pj_L7.js → DjbBTiei0H-BIJaN.js} +1 -1
- package/assets/{B5yaBbFj2Np9Eh8b.js → DmJc5VoPPwBBtLIG.js} +1 -1
- package/assets/{Bndiqwoh132Upow1.js → DnQM29yv6KQQOVfl.js} +2 -2
- package/assets/{D4lMEKXi13vhDJbE.js → Dnn8laImZHy8LouL.js} +1 -1
- package/assets/{uoUKT9hTrwZ2INHN.js → DpgBOcByebrqzUrC.js} +3 -3
- package/assets/{MpvZt7VpFWEINIT6.js → DqxW6EBLDV_6Eegk.js} +1 -1
- package/assets/DrgkN0g7OHuD4iD6.js +14 -0
- package/assets/{_LMcVYWJksPfGVxz.js → DsK1Adz0vo-1zPkp.js} +1 -1
- package/assets/{CDvP9QyhDwdm3MZn.js → Dt5rA9gefJFLoaeI.js} +2 -2
- package/assets/{CUJiePMri5kkpdA7.js → DuCNecyIYfZL27SV.js} +1 -1
- package/assets/{hcXZqO-0tG873E-L.js → DwqgvpYiTLOQd5wm.js} +2 -2
- package/assets/{yDh_W6M1rvuDhFv1.js → Dzxe5kLF5GOfh0_l.js} +1 -1
- package/assets/{tCavNu-Tru6yRbec.js → FOKynZCiA0wU2Spf.js} +1 -1
- package/assets/{DsWJ-YRyuwDUuSge.js → H1ICg_-K5ADFNHJj.js} +1 -1
- package/assets/{eWHWPRWHX6YU8bJU.js → H89MX09YsAj7NAk3.js} +1 -1
- package/assets/{Xkr_4WLwk0ZPaYH2.js → I-GZ5PL9n_Sv5yAJ.js} +1 -1
- package/assets/{DvRH46hupHUjkc7a.js → IEmEQHg895CUpAQq.js} +1 -1
- package/assets/{B6J8XN1FRN00a_ps.js → I_yb1hhLA5bYPpWx.js} +1 -1
- package/assets/{DAVN6N3srI1WMHCN.js → KQGPPHM486XPeClF.js} +2 -2
- package/assets/{4Qlx8FuxoYbVTgNW.js → KSE7OWDMxhbfYt82.js} +21 -21
- package/assets/{ltqqdJxoPnLCjhBV.js → M62BqR7TbmgOzAEW.js} +3 -3
- package/assets/{ndBoGVVjmy3vkff8.js → NEzc406_2k2MuiE3.js} +2 -2
- package/assets/{CDmri0gcZxpVZfWn.js → Q2j8yQZX1kL_MbbB.js} +425 -425
- package/assets/{BVdH9-49M3APSiPy.js → QMCI00ZCedkNJd8C.js} +1 -1
- package/assets/{DIntlX_ha_wRdxYj.js → RFPO1vKnkkgwx5Bs.js} +1 -1
- package/assets/{BghxJxTwaebNVcIS.js → VcTnn2qw_4tmyctb.js} +1 -1
- package/assets/{DTXRsv2Ww7WbIwCb.js → Vo34QvIefEN595xl.js} +8645 -8636
- package/assets/{Cirpx81bWi4G2foA.js → _l84VPWmScznS-9F.js} +5 -5
- package/assets/{CLFe9HgUi_83dE3d.js → _oaPA65Bm2idKW7f.js} +1 -1
- package/assets/{DZ2Njh8YgfXcv7EM.js → bpjLDXWxL6nDt4Mv.js} +1 -1
- package/assets/{8FzS1bgbz4U1QE_m.js → fUmGsmpgGhd8eZn2.js} +1 -1
- package/assets/{C9JUgNS6CrdgIcW3.js → pg0OaBJVRnW7uSz5.js} +1 -1
- package/assets/{BItblzoSm0lN3bTV.js → rIQ1pzaGFqvCfzOk.js} +1 -1
- package/assets/{-qQT-DFFz0CqGx5C.js → raa4clZOm0L5A0zR.js} +503 -503
- package/assets/{CaOEaghQqXiA1ZzO.js → rejXA2fTAujW3QRv.js} +251 -251
- package/assets/{DMMw2v0iTuBnUjMI.js → rhT64BvdSLOEwglQ.js} +1 -1
- package/assets/{BmmIukrNOivfENgD.js → vItpZkDtFsjwsJzb.js} +35 -35
- package/assets/{4Za9gEGCvms62R7k.js → vXmCJwJaPhkPVhy8.js} +1 -1
- package/index.js +1766 -1703
- package/lib.js +1 -1
- package/licenses/dependencies.txt +32 -32
- package/package.json +2 -2
- package/screenshot-page/assets/{BLPyKyNun9-SHQBZ.js → 1s5we6Eqz8n3o0X_.js} +1 -1
- package/screenshot-page/assets/9WplgXo__vp3e1Su.js +2 -0
- package/screenshot-page/assets/B2oadmu_j6WfNbZ1.js +1 -0
- package/screenshot-page/assets/{BOjOE9CEMSzcij2W.js → B5ujsbfF1ZBkPI4d.js} +2 -2
- package/screenshot-page/assets/BEzCH6tp_dlxe7BH.js +1 -0
- package/screenshot-page/assets/BJvuevnsIw3DXQds.js +2 -0
- package/screenshot-page/assets/BLON9pILfrgdZqAM.js +5 -0
- package/screenshot-page/assets/BVx7CEdRItIR30Fz.js +1 -0
- package/screenshot-page/assets/{Dkr-6Z1RJsAp9Xrv.js → Bdt92xZzFotX0vdt.js} +1 -1
- package/screenshot-page/assets/{DKWRl8rs3K9jBYtr.js → Ble2ESZnJzZnd3cc.js} +1 -1
- package/screenshot-page/assets/{BUO6zT3gqK0uOOa-.js → Blg5f-jAtZfGnZ71.js} +1 -1
- package/screenshot-page/assets/{XiUItCqTNNEApgfa.js → Bozva6Wr4B8Q5QZN.js} +2 -2
- package/screenshot-page/assets/{C0AbuMHcIS9oy4XL.js → Brp37MPC60tt9V3N.js} +1 -1
- package/screenshot-page/assets/{Bh2PQ0zsoGtMKWp1.js → Bs65RHirk11sxOB9.js} +4 -4
- package/screenshot-page/assets/{H_hWDMWfWmjTui7V.js → BtydzT-AjL_LBr8x.js} +1 -1
- package/screenshot-page/assets/Bu5h0ACtvNxDBmqw.js +1 -0
- package/screenshot-page/assets/BwFvwFIcX0dmcBt7.js +1 -0
- package/screenshot-page/assets/C0rOvlmOfLDpClJ_.js +1 -0
- package/screenshot-page/assets/{C4v6Ljs6kwQJu06t.js → CBuH_YHDn7A9E_hX.js} +2 -2
- package/screenshot-page/assets/CHZ1925OpIa8ssZn.js +1 -0
- package/screenshot-page/assets/{BuzI4z8RJGOw8BZD.js → CN3dPtUjDVvcnA4e.js} +1 -1
- package/screenshot-page/assets/COO3CwHTbCgxybBd.js +1 -0
- package/screenshot-page/assets/CR8Rj_GpSbIqbaEO.js +13 -0
- package/screenshot-page/assets/CV9T0juyAiRmwTR-.js +4 -0
- package/screenshot-page/assets/ClC7zkHPp6egPrjL.js +2 -0
- package/screenshot-page/assets/{BZpFWPd0PR1kPT-A.js → CtS8qZB4_3skg_zL.js} +1 -1
- package/screenshot-page/assets/{BaCs7lUeZ7NidSkP.js → CwutTi2EnNm_hyVj.js} +1 -1
- package/screenshot-page/assets/{FjOiReLnknWbsRRr.js → CxithxkenssFkfTT.js} +19 -19
- package/screenshot-page/assets/{BWtLNVUXjY6EBdEt.js → CzZu7Fd_VeHHL-4i.js} +1 -1
- package/screenshot-page/assets/CzijGQrSoteeqwmH.js +2 -0
- package/screenshot-page/assets/{RutPv2GFWmeBiWvn.js → D4VgxwLDPUfCxPS9.js} +2 -2
- package/screenshot-page/assets/DG6q1MKITeSM4XMx.js +1 -0
- package/screenshot-page/assets/DHTXoT_pArB1opyI.js +48 -0
- package/screenshot-page/assets/{B9kA0vdaFJi9iRGo.js → DHUomRu_S2zcBWwt.js} +3 -3
- package/screenshot-page/assets/DP2wwd1IM_gQtEaG.js +1 -0
- package/screenshot-page/assets/{Bf9AN5sYHaxae0vV.js → DQeIWKasFD3DnWL7.js} +6 -6
- package/screenshot-page/assets/Ja-xcEStEdmh2Gwb.js +2 -0
- package/screenshot-page/assets/ODq-dKb9mTtqEIJl.js +1 -0
- package/screenshot-page/assets/VF7dro9jrDEAX6kD.js +3 -0
- package/screenshot-page/assets/{CXmrXx6MZ5ApF3co.js → Yz4ksf-M05RGdHO3.js} +1 -1
- package/screenshot-page/assets/{BMKiUDjoabO4aG1U.js → Z7Av7oqfaK7wy7Eb.js} +1 -1
- package/screenshot-page/assets/{TwKKik-YQENv52LX.js → bdWMVOcMKRI8kCDE.js} +1 -1
- package/screenshot-page/assets/{LCjlxIt1dn3smVjX.js → kJwY8fmEeWlAtTAc.js} +1 -1
- package/screenshot-page/assets/{BnPHZ_1rjv6kQgsL.js → p9abCAJQdpScjZVK.js} +1 -1
- package/screenshot-page/index.html +8 -8
- package/types/scripting-api.json +7060 -7060
- package/types/scripting.d.ts +8 -0
- package/assets/CCl8x9s8Bujsew7W.js +0 -14
- package/screenshot-page/assets/1yHlU53ypZZelMPx.js +0 -1
- package/screenshot-page/assets/BQ5BNe1adYfpa2OH.js +0 -1
- package/screenshot-page/assets/BkhZQsVlVHOiKGTJ.js +0 -1
- package/screenshot-page/assets/Bzf_upccQ2ho6mX0.js +0 -13
- package/screenshot-page/assets/C7YRL2bVWHPIwzn_.js +0 -1
- package/screenshot-page/assets/CImp91jfSuqX0Wz-.js +0 -1
- package/screenshot-page/assets/C_vPl50T1L5HWnhv.js +0 -1
- package/screenshot-page/assets/Cv-YUArreXqhafcU.js +0 -2
- package/screenshot-page/assets/D23_69pojBfIh4nV.js +0 -5
- package/screenshot-page/assets/D2q4M3I5Jmxm85P2.js +0 -1
- package/screenshot-page/assets/D8QsCbSaWCLAYYso.js +0 -1
- package/screenshot-page/assets/DC_Hdwa9KL7xKU8u.js +0 -2
- package/screenshot-page/assets/DHtL9Iawmr2Uo5VV.js +0 -2
- package/screenshot-page/assets/DNYWB6WNZTquqQ9v.js +0 -4
- package/screenshot-page/assets/DegZKTNqt1LRnSxY.js +0 -1
- package/screenshot-page/assets/Dhh1xqujbhLa8WFd.js +0 -1
- package/screenshot-page/assets/DllI8kZZZ5LG0Mjd.js +0 -2
- package/screenshot-page/assets/DrcpGT9FLbDzeLeG.js +0 -2
- package/screenshot-page/assets/XrFpPrRqQNE9AAwH.js +0 -1
- package/screenshot-page/assets/mBuOPJeUPXlKwfPZ.js +0 -48
- package/screenshot-page/assets/zSnM7GhGzLu1MM_u.js +0 -3
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/mcp - MCP server exposing SheetXL spreadsheet operations as tools and resources. - v0.8.0-beta.21
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { p as e, tt as t } from "./
|
|
8
|
-
import { d as n, en as s, f as r, vt as o } from "./
|
|
9
|
-
import { u as a } from "./
|
|
10
|
-
import { $ as l, Ba as i,
|
|
11
|
-
import { a as K, i as Q, n as J, o as W, r as X } from "./
|
|
7
|
+
import { p as e, tt as t } from "./DjbBTiei0H-BIJaN.js";
|
|
8
|
+
import { d as n, en as s, f as r, vt as o } from "./CB9TsE5n0FEyFnAz.js";
|
|
9
|
+
import { u as a } from "./D5mfuGSeGXSDHj9-.js";
|
|
10
|
+
import { $a as l, Ba as i, Ga as d, Ja as u, Lr as c, Ma as f, Oa as m, Qr as p, Sr as h, Ta as g, Tn as w, Vn as v, aa as F, ao as b, b as y, bi as I, ci as x, dr as A, ft as C, gi as E, gn as S, gt as P, ka as k, kr as M, li as T, nn as O, pi as R, q as N, qi as $, qr as L, ti as _, ua as D, ui as V, un as U, w as H, wa as B, wi as q, yt as z, zi as G, zr as j } from "./Vo34QvIefEN595xl.js";
|
|
11
|
+
import { a as K, i as Q, n as J, o as W, r as X } from "./B1l0k4ErELObdQKE.js";
|
|
12
12
|
var Y = [
|
|
13
13
|
"Jan",
|
|
14
14
|
"Feb",
|
|
@@ -61,20 +61,20 @@ var Y = [
|
|
|
61
61
|
default: return null;
|
|
62
62
|
}
|
|
63
63
|
}, te = (e, t) => {
|
|
64
|
-
const n = e.fields ?? [], s =
|
|
65
|
-
if (!n.some(
|
|
66
|
-
const r =
|
|
64
|
+
const n = e.fields ?? [], s = g(e.records, n.length);
|
|
65
|
+
if (!n.some(f)) return s;
|
|
66
|
+
const r = g(e.items, n.length), o = e.recordCount ?? 0, a = s.slice();
|
|
67
67
|
for (let e = 0; e < n.length; e++) {
|
|
68
68
|
const l = n[e];
|
|
69
|
-
if (!
|
|
70
|
-
const i = l.group,
|
|
71
|
-
for (let e = 0; e <
|
|
72
|
-
const n = i.range ? ee(i.range, i.items.length,
|
|
73
|
-
|
|
69
|
+
if (!f(l)) continue;
|
|
70
|
+
const i = l.group, d = s[i.base] ?? [], u = r[i.base] ?? [], c = new Int32Array(u.length);
|
|
71
|
+
for (let e = 0; e < u.length; e++) {
|
|
72
|
+
const n = i.range ? ee(i.range, i.items.length, C(u[e]), t) : i.discrete?.[e] ?? null;
|
|
73
|
+
c[e] = n ?? -1;
|
|
74
74
|
}
|
|
75
75
|
const m = new Array(o);
|
|
76
76
|
for (let e = 0; e < o; e++) {
|
|
77
|
-
const t =
|
|
77
|
+
const t = c[d[e]];
|
|
78
78
|
if (void 0 === t || t < 0) return null;
|
|
79
79
|
m[e] = t;
|
|
80
80
|
}
|
|
@@ -231,10 +231,10 @@ var Y = [
|
|
|
231
231
|
if (t.includes(e)) return !1;
|
|
232
232
|
const i = [];
|
|
233
233
|
oe(n[e].formula, (e) => {
|
|
234
|
-
const t = n.findIndex((t) =>
|
|
234
|
+
const t = n.findIndex((t) => h(t.name, e));
|
|
235
235
|
return t >= 0 && i.push(t), t >= 0 ? "" : null;
|
|
236
236
|
});
|
|
237
|
-
for (const r of i) if (
|
|
237
|
+
for (const r of i) if (M(n[r])) {
|
|
238
238
|
if (!l(r, [...t, e])) return !1;
|
|
239
239
|
} else s.includes(r) || s.push(r);
|
|
240
240
|
return o.set(e, r.length), a.set(e, n[e].formula), r.push({
|
|
@@ -242,7 +242,7 @@ var Y = [
|
|
|
242
242
|
expression: ""
|
|
243
243
|
}), !0;
|
|
244
244
|
}, i = [];
|
|
245
|
-
for (const [t, s] of (e.dataFields ?? []).entries()) if (
|
|
245
|
+
for (const [t, s] of (e.dataFields ?? []).entries()) if (M(n[s.field])) {
|
|
246
246
|
if (!l(s.field, [])) return null;
|
|
247
247
|
i.push({
|
|
248
248
|
data: t,
|
|
@@ -251,8 +251,8 @@ var Y = [
|
|
|
251
251
|
}
|
|
252
252
|
const d = (e, t) => {
|
|
253
253
|
if (null !== t) return null;
|
|
254
|
-
const r = n.findIndex((t) =>
|
|
255
|
-
return r >= 0 ? ae(
|
|
254
|
+
const r = n.findIndex((t) => h(t.name, e));
|
|
255
|
+
return r >= 0 ? ae(M(n[a = r]) ? s.length + o.get(a) : s.indexOf(a)) : null;
|
|
256
256
|
var a;
|
|
257
257
|
};
|
|
258
258
|
for (const e of r) {
|
|
@@ -343,75 +343,75 @@ var Y = [
|
|
|
343
343
|
percent: 13,
|
|
344
344
|
percentDiff: 14
|
|
345
345
|
}, Ie = (e, t, n, s) => {
|
|
346
|
-
const r =
|
|
346
|
+
const r = P.peek(), o = e.fields, a = t.fields;
|
|
347
347
|
if (!r || !o || !a || o.length !== a.length) return null;
|
|
348
|
-
if (
|
|
348
|
+
if (A(e)) return {
|
|
349
349
|
cells: [],
|
|
350
|
-
...
|
|
350
|
+
...U,
|
|
351
351
|
rowPageCount: 0,
|
|
352
352
|
columnPageCount: 0,
|
|
353
|
-
header:
|
|
353
|
+
header: m(e),
|
|
354
354
|
rowLines: [],
|
|
355
355
|
columnLines: [],
|
|
356
356
|
viewValues: [],
|
|
357
357
|
firstKey: null,
|
|
358
358
|
...s?.roles ? { roles: /* @__PURE__ */ new Map() } : {}
|
|
359
359
|
};
|
|
360
|
-
const i =
|
|
361
|
-
if (i && !
|
|
362
|
-
const
|
|
363
|
-
if (
|
|
364
|
-
const
|
|
365
|
-
if (!
|
|
360
|
+
const i = j(e, a), d = i ? s?.filters : null;
|
|
361
|
+
if (i && !d) return null;
|
|
362
|
+
const u = o.some((e) => e.items?.some((e) => e.calculated));
|
|
363
|
+
if (u && !d?.calculatedRecords) return null;
|
|
364
|
+
const c = de(e, t);
|
|
365
|
+
if (!c || c.measures.length > 0 && !d?.fieldValues) return null;
|
|
366
366
|
if ((e.dataFields ?? []).some((e) => void 0 === ye[e.showDataAs ?? "normal"] || void 0 === pe[e.subtotal ?? "sum"])) return null;
|
|
367
|
-
const p = xe(e, t, n,
|
|
367
|
+
const p = xe(e, t, n, d?.calculatedRecords, c.operands);
|
|
368
368
|
if (!p) return null;
|
|
369
|
-
const { items: h, records:
|
|
369
|
+
const { items: h, records: g, values: w, n: v } = p, F = (e) => !!e && (!e.noRecords || f(e)), b = e.form ?? "compact", y = (e) => {
|
|
370
370
|
const t = [];
|
|
371
371
|
for (const n of e ?? []) {
|
|
372
372
|
if (n === ce) {
|
|
373
373
|
t.push({
|
|
374
374
|
field: n,
|
|
375
|
-
form:
|
|
375
|
+
form: b
|
|
376
376
|
});
|
|
377
377
|
continue;
|
|
378
378
|
}
|
|
379
379
|
const e = o[n], s = e?.subtotals;
|
|
380
|
-
if (!e || !
|
|
381
|
-
if (
|
|
380
|
+
if (!e || !F(a[n])) return null;
|
|
381
|
+
if (u && s && s.some((e) => "default" !== e)) return null;
|
|
382
382
|
t.push({
|
|
383
383
|
field: n,
|
|
384
384
|
form: e.form ?? "compact"
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
return t;
|
|
388
|
-
},
|
|
389
|
-
if (!
|
|
390
|
-
const
|
|
391
|
-
return
|
|
388
|
+
}, I = y(e.rowFields), x = y(e.columnFields), C = e.pageFields ?? [];
|
|
389
|
+
if (!I || !x || C.some((e) => !F(a[e.field]))) return null;
|
|
390
|
+
const E = l(e, s?.slicerFields);
|
|
391
|
+
return E.pageFields?.some((e) => !F(a[e.field])) ? null : Te(e, t, h, I, x, Se(r, E, h, g, w, I, x, v, d?.keep, d?.records, c.operands.length, d?.fieldValues, !0), n, !0 === s?.roles, "columns" === s?.cellOrder);
|
|
392
392
|
}, xe = (e, t, n, s, r = []) => {
|
|
393
|
-
const o = t.fields?.length ?? 0, a =
|
|
393
|
+
const o = t.fields?.length ?? 0, a = V(t);
|
|
394
394
|
if (!t.records) return null;
|
|
395
395
|
const l = te(t, n.isDate1904());
|
|
396
396
|
if (!l) return null;
|
|
397
|
-
const i = !0 === t.fields?.some(
|
|
398
|
-
const s = !t.fields?.[e]?.noRecords, r = s ?
|
|
399
|
-
for (let e = 0; e <
|
|
400
|
-
for (let e = 0; e < m; e++) i[
|
|
397
|
+
const i = !0 === t.fields?.some(f), d = i ? g(t.items, o) : a, u = i ? g(t.records, o) : l, c = t.recordCount ?? 0, m = s?.count ?? 0, p = c + m, h = (e, n) => {
|
|
398
|
+
const s = !t.fields?.[e]?.noRecords, r = s ? u[e] : l[e] ?? [], o = s ? d[e] : a[e], i = new Array(p);
|
|
399
|
+
for (let e = 0; e < c; e++) i[e] = C(o[r[e]]);
|
|
400
|
+
for (let e = 0; e < m; e++) i[c + e] = n?.[e] ?? null;
|
|
401
401
|
return i;
|
|
402
|
-
},
|
|
402
|
+
}, w = [...(e.dataFields ?? []).map((e, t) => h(e.field, s?.values[t])), ...r.map((e) => h(e))];
|
|
403
403
|
return {
|
|
404
404
|
items: a,
|
|
405
405
|
records: s ? l.map((e, t) => e.concat(s.ids[t] ?? [])) : l,
|
|
406
|
-
values:
|
|
406
|
+
values: w,
|
|
407
407
|
n: p
|
|
408
408
|
};
|
|
409
409
|
}, Ae = async (e, t, n, s, r, o, a, l, i) => {
|
|
410
|
-
const d =
|
|
410
|
+
const d = P.peek(), u = e.dataFields?.[r];
|
|
411
411
|
if (!d || !e.fields || !u || void 0 === pe[u.subtotal ?? "sum"]) return null;
|
|
412
|
-
const c = [e.rowFields, e.columnFields].map((e) => (e ?? []).filter((e) => e !== ce)), f = c.findIndex((e) => e.includes(s)),
|
|
413
|
-
if (!
|
|
414
|
-
const
|
|
412
|
+
const c = [e.rowFields, e.columnFields].map((e) => (e ?? []).filter((e) => e !== ce)), f = c.findIndex((e) => e.includes(s)), m = c[f];
|
|
413
|
+
if (!m) return null;
|
|
414
|
+
const p = m.slice(0, m.indexOf(s)), h = e.fields.map((e) => {
|
|
415
415
|
const { blankRowAfter: t, showItemsWithNoData: n, sort: s, ...r } = e;
|
|
416
416
|
return {
|
|
417
417
|
...r,
|
|
@@ -421,46 +421,46 @@ var Y = [
|
|
|
421
421
|
return n;
|
|
422
422
|
})
|
|
423
423
|
};
|
|
424
|
-
}), { columnGrandTotals:
|
|
425
|
-
...
|
|
426
|
-
fields:
|
|
427
|
-
rowFields: [...
|
|
424
|
+
}), { columnGrandTotals: g, ...w } = e, { showDataAs: v, ...F } = u, b = {
|
|
425
|
+
...w,
|
|
426
|
+
fields: h,
|
|
427
|
+
rowFields: [...p, s],
|
|
428
428
|
columnFields: [],
|
|
429
|
-
dataFields: [
|
|
429
|
+
dataFields: [F],
|
|
430
430
|
rowGrandTotals: !1
|
|
431
|
-
},
|
|
431
|
+
}, y = l ? {
|
|
432
432
|
...l,
|
|
433
433
|
values: [l.values[r] ?? []]
|
|
434
|
-
} : l,
|
|
435
|
-
if (!
|
|
436
|
-
const
|
|
437
|
-
if (!
|
|
438
|
-
const { items:
|
|
434
|
+
} : l, I = de(b, t);
|
|
435
|
+
if (!I || I.measures.length > 0 && !i) return null;
|
|
436
|
+
const x = xe(b, t, n, y, I.operands);
|
|
437
|
+
if (!x) return null;
|
|
438
|
+
const { items: A, records: C, values: E, n: S } = x, k = b.rowFields.map((e) => ({
|
|
439
439
|
field: e,
|
|
440
440
|
form: "compact"
|
|
441
441
|
}));
|
|
442
442
|
let M;
|
|
443
443
|
if (a) {
|
|
444
444
|
const e = 0 === f ? 1 : 2;
|
|
445
|
-
M = new Uint8Array(
|
|
446
|
-
for (let t = 0; t <
|
|
445
|
+
M = new Uint8Array(S);
|
|
446
|
+
for (let t = 0; t < S; t++) {
|
|
447
447
|
const n = a[t];
|
|
448
448
|
M[t] = (n & e ? 1 : 0) | (3 === n ? 2 : 0);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
|
-
const T =
|
|
452
|
-
return
|
|
453
|
-
if (0 !== e.kind || e.path.length !==
|
|
454
|
-
const n =
|
|
451
|
+
const T = I.measures.length > 0 ? await Ee(d, I, b, A, C, E, k, [], S, o, M, i) : void 0, O = Se(d, b, A, C, E, k, [], S, o, M, I.operands.length, T), R = (t, n) => e.fields[t].items?.[n]?.item ?? n, N = /* @__PURE__ */ new Map(), $ = O.columns.length;
|
|
452
|
+
return O.rows.forEach((e, t) => {
|
|
453
|
+
if (0 !== e.kind || e.path.length !== p.length + 1) return;
|
|
454
|
+
const n = p.map((t, n) => R(t, e.path[n])).join(",");
|
|
455
455
|
let r = N.get(n);
|
|
456
456
|
r || N.set(n, r = {
|
|
457
457
|
ids: [],
|
|
458
458
|
totals: []
|
|
459
|
-
}), r.ids.push(
|
|
459
|
+
}), r.ids.push(R(s, e.path[p.length])), r.totals.push(O.values[t * $]);
|
|
460
460
|
}), {
|
|
461
|
-
outer:
|
|
461
|
+
outer: p,
|
|
462
462
|
groups: N,
|
|
463
|
-
records:
|
|
463
|
+
records: C
|
|
464
464
|
};
|
|
465
465
|
}, Ce = (e, t, n) => {
|
|
466
466
|
const s = new Uint32Array(t).fill(fe), r = new Uint8Array(t), o = e.items;
|
|
@@ -649,51 +649,51 @@ var Y = [
|
|
|
649
649
|
} else s.type = 1 === e.kind ? null !== e.function ? t[e.function] : "default" : 2 === e.kind ? "grand" : "blank", s.items = 2 === e.kind ? [0] : e.path.slice();
|
|
650
650
|
return null !== e.data && e.data > 0 && (s.dataField = e.data), s;
|
|
651
651
|
});
|
|
652
|
-
}, Te = (e, t, n, r, o, l, d,
|
|
653
|
-
const
|
|
654
|
-
if (e === ce) return
|
|
655
|
-
const s =
|
|
652
|
+
}, Te = (e, t, n, r, o, l, d, u, c) => {
|
|
653
|
+
const f = e.fields, p = t.fields, h = e.dataFields ?? [], g = (t) => t === ce ? e.valuesCaption ?? "Values" : f[t].name ?? p[t].name, w = (e, t) => {
|
|
654
|
+
if (e === ce) return h[t]?.name ?? "";
|
|
655
|
+
const s = f[e].items?.[t];
|
|
656
656
|
if (void 0 !== s?.name) return s.name;
|
|
657
|
-
const r =
|
|
658
|
-
return null === r ?
|
|
659
|
-
},
|
|
660
|
-
const n =
|
|
657
|
+
const r = C(n[e][s?.item ?? t]);
|
|
658
|
+
return null === r ? F : r;
|
|
659
|
+
}, v = (e, t) => {
|
|
660
|
+
const n = w(e, t);
|
|
661
661
|
if ("number" == typeof n) {
|
|
662
|
-
const o =
|
|
663
|
-
return s(d, a ?
|
|
662
|
+
const o = f[e].items?.[t]?.item ?? t, a = void 0 === (f[e].numberFormat ?? p[e].numberFormat) && E(p[e], o);
|
|
663
|
+
return s(d, a ? R(H(p[e], o), d) : R(f[r = e].numberFormat ?? p[r].numberFormat, d), n);
|
|
664
664
|
}
|
|
665
665
|
var r;
|
|
666
666
|
return a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
667
667
|
}, b = (e) => {
|
|
668
|
-
if (void 0 !== e.item) return
|
|
669
|
-
const t =
|
|
668
|
+
if (void 0 !== e.item) return w(e.field, e.item);
|
|
669
|
+
const t = f[e.field].items ?? [];
|
|
670
670
|
if (!t.some((e) => e.hidden)) return "(All)";
|
|
671
|
-
const n = t.flatMap((e, t) =>
|
|
672
|
-
return 1 === n.length ?
|
|
673
|
-
},
|
|
671
|
+
const n = t.flatMap((e, t) => y(e) && !e.hidden ? [t] : []);
|
|
672
|
+
return 1 === n.length ? w(e.field, n[0]) : "(Multiple Items)";
|
|
673
|
+
}, A = e.grandTotalCaption ?? "Grand Total", S = u ? /* @__PURE__ */ new Map() : null, P = (e, t) => e === ce ? {
|
|
674
674
|
kind: "dataCaption",
|
|
675
675
|
data: t
|
|
676
676
|
} : {
|
|
677
677
|
kind: "item",
|
|
678
678
|
field: e,
|
|
679
679
|
rank: t
|
|
680
|
-
},
|
|
680
|
+
}, k = (e) => e === ce ? null : {
|
|
681
681
|
kind: "fieldCaption",
|
|
682
682
|
field: e
|
|
683
|
-
},
|
|
683
|
+
}, M = (e, t) => 2 === e.kind && t === A ? { kind: "grandTotal" } : null, T = 0 === r.length && 0 === o.length && 0 === h.length, O = T ? {
|
|
684
684
|
firstHeaderRow: 0,
|
|
685
685
|
firstDataRow: 0,
|
|
686
686
|
firstDataCol: 0
|
|
687
|
-
} :
|
|
687
|
+
} : m(e), N = T ? [] : Me(l.rows, l.functions), $ = T ? [] : Me(l.columns, l.functions), L = I({
|
|
688
688
|
...e,
|
|
689
|
-
header:
|
|
690
|
-
rowLines:
|
|
691
|
-
columnLines:
|
|
692
|
-
}),
|
|
689
|
+
header: O,
|
|
690
|
+
rowLines: N,
|
|
691
|
+
columnLines: $
|
|
692
|
+
}), _ = l.columns.length, D = (e) => "row" === e ? r : o, V = (t) => {
|
|
693
693
|
switch (t.kind) {
|
|
694
694
|
case "pageCaption": {
|
|
695
695
|
const n = e.pageFields[t.page].field;
|
|
696
|
-
return [
|
|
696
|
+
return [g(n), {
|
|
697
697
|
kind: "fieldCaption",
|
|
698
698
|
field: n
|
|
699
699
|
}];
|
|
@@ -705,35 +705,35 @@ var Y = [
|
|
|
705
705
|
page: t.page
|
|
706
706
|
}];
|
|
707
707
|
}
|
|
708
|
-
case "dataCaption": return [
|
|
708
|
+
case "dataCaption": return [h[t.data]?.name ?? null, {
|
|
709
709
|
kind: "dataCaption",
|
|
710
710
|
data: t.data
|
|
711
711
|
}];
|
|
712
712
|
case "rowHeader": return [r.every((e) => e.field === ce) ? e.valuesCaption ?? "Values" : e.rowHeaderCaption ?? "Row Labels", { kind: "rowHeader" }];
|
|
713
713
|
case "columnHeader": return [e.columnHeaderCaption ?? "Column Labels", { kind: "columnHeader" }];
|
|
714
714
|
case "fieldCaption": {
|
|
715
|
-
const e =
|
|
716
|
-
return [
|
|
715
|
+
const e = D(t.axis)[t.level].field;
|
|
716
|
+
return [g(e), k(e)];
|
|
717
717
|
}
|
|
718
718
|
case "label": {
|
|
719
|
-
const e =
|
|
720
|
-
return [
|
|
719
|
+
const e = D(t.axis)[t.level].field, n = t.line.path[t.level];
|
|
720
|
+
return [w(e, n), P(e, n)];
|
|
721
721
|
}
|
|
722
722
|
case "total": {
|
|
723
723
|
const e = ("row" === t.axis ? l.rows : l.columns)[t.line.index], n = ((e, t) => {
|
|
724
|
-
const n = e.findIndex((e) => e.field === ce) >= t.path.length && null !== t.data, s = n ?
|
|
725
|
-
if (2 === t.kind) return n ? `Total ${s}` :
|
|
726
|
-
const r = t.path.length - 1, o = e[r].field, a =
|
|
724
|
+
const n = e.findIndex((e) => e.field === ce) >= t.path.length && null !== t.data, s = n ? h[t.data]?.name ?? "" : "";
|
|
725
|
+
if (2 === t.kind) return n ? `Total ${s}` : A;
|
|
726
|
+
const r = t.path.length - 1, o = e[r].field, a = v(o, t.path[r]);
|
|
727
727
|
if (null !== t.function) {
|
|
728
728
|
const e = we[l.functions[t.function]];
|
|
729
|
-
return (n || t.across) && null !== t.data ? `${a} ${e} of ${
|
|
729
|
+
return (n || t.across) && null !== t.data ? `${a} ${e} of ${g(h[t.data].field)}` : `${a} ${e}`;
|
|
730
730
|
}
|
|
731
|
-
return
|
|
732
|
-
})(
|
|
733
|
-
return [n,
|
|
731
|
+
return f[o]?.subtotalCaption ?? (n ? `${a} ${s}` : `${a} Total`);
|
|
732
|
+
})(D(t.axis), e);
|
|
733
|
+
return [n, M(e, n)];
|
|
734
734
|
}
|
|
735
735
|
case "value": {
|
|
736
|
-
const n = t.row.index *
|
|
736
|
+
const n = t.row.index * _ + t.column.index, s = l.states[n];
|
|
737
737
|
let r = null;
|
|
738
738
|
return 0 === s ? (r = l.values[n], e.showError && a.isError(r) && (r = e.errorCaption ?? "")) : 1 === s && (r = !1 === e.showEmpty ? 0 : ((e) => {
|
|
739
739
|
if (void 0 === e) return null;
|
|
@@ -744,207 +744,207 @@ var Y = [
|
|
|
744
744
|
})(e.emptyCaption)), [r, null];
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
},
|
|
748
|
-
const n =
|
|
747
|
+
}, U = new B.Builder(), q = L.top, z = L.pages.reduce((e, t) => Math.max(e, t.column + 2), 0), G = (e, t) => {
|
|
748
|
+
const n = x(L, e, t);
|
|
749
749
|
if (!n) return;
|
|
750
|
-
const [s, r] =
|
|
750
|
+
const [s, r] = V(n);
|
|
751
751
|
((e, t, n) => {
|
|
752
|
-
|
|
753
|
-
})(e -
|
|
752
|
+
S && n && S.set(e + "," + t, n);
|
|
753
|
+
})(e - q, t, r), null !== s && (c ? U.pushAt(t, e - q, s) : U.pushAt(e - q, t, s));
|
|
754
754
|
};
|
|
755
|
-
if (
|
|
756
|
-
const e = Math.max(
|
|
757
|
-
for (let t = 0; t < e; t++) for (let e = 0; e <
|
|
758
|
-
} else for (let e = 0; e <
|
|
759
|
-
const t = e <
|
|
760
|
-
for (let n = 0; n < t; n++)
|
|
755
|
+
if (c) {
|
|
756
|
+
const e = Math.max(z, L.columns.length);
|
|
757
|
+
for (let t = 0; t < e; t++) for (let e = 0; e < L.rows.length; e++) t < (e < q ? z : L.columns.length) && G(e, t);
|
|
758
|
+
} else for (let e = 0; e < L.rows.length; e++) {
|
|
759
|
+
const t = e < q ? z : L.columns.length;
|
|
760
|
+
for (let n = 0; n < t; n++) G(e, n);
|
|
761
761
|
}
|
|
762
|
-
if (
|
|
763
|
-
const t =
|
|
762
|
+
if (T) {
|
|
763
|
+
const t = i(e);
|
|
764
764
|
return {
|
|
765
|
-
cells:
|
|
765
|
+
cells: U.build()?.tuples ?? [],
|
|
766
766
|
rows: 1,
|
|
767
767
|
columns: 1,
|
|
768
768
|
rowPageCount: t.rows,
|
|
769
769
|
columnPageCount: t.columns,
|
|
770
|
-
header:
|
|
770
|
+
header: O,
|
|
771
771
|
rowLines: [],
|
|
772
772
|
columnLines: [],
|
|
773
773
|
viewValues: [],
|
|
774
774
|
firstKey: null,
|
|
775
|
-
...
|
|
775
|
+
...S ? { roles: S } : {}
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
const
|
|
778
|
+
const j = (e, t) => {
|
|
779
779
|
const n = [];
|
|
780
780
|
return e.forEach((e, s) => {
|
|
781
781
|
e.field !== ce && n.push(s < t.path.length ? t.path[s] : -1);
|
|
782
782
|
}), n;
|
|
783
|
-
}, Q = (e, t) => K(e.data ?? t.data ?? 0, [...
|
|
783
|
+
}, Q = (e, t) => K(e.data ?? t.data ?? 0, [...j(r, e), ...j(o, t)]), [J] = l.rows, [W] = l.columns, X = J && W && 3 !== J.kind && 3 !== W.kind ? Q(J, W) : null, Y = [], Z = (e) => 1 === e.kind && null !== e.function;
|
|
784
784
|
l.rows.forEach((t, n) => {
|
|
785
|
-
3 === t.kind || Z(t) || (
|
|
786
|
-
const o = l.states[n *
|
|
785
|
+
3 === t.kind || Z(t) || (j(r, t), l.columns.forEach((s, r) => {
|
|
786
|
+
const o = l.states[n * _ + r];
|
|
787
787
|
if (3 === s.kind || Z(s) || 0 !== o && 1 !== o) return;
|
|
788
|
-
let i = 0 === o ? l.values[n *
|
|
788
|
+
let i = 0 === o ? l.values[n * _ + r] : 0;
|
|
789
789
|
e.showError && a.isError(i) && (i = e.errorCaption || 0), Y.push([Q(t, s), i]);
|
|
790
790
|
}));
|
|
791
791
|
});
|
|
792
|
-
const ee =
|
|
792
|
+
const ee = i(e);
|
|
793
793
|
return {
|
|
794
|
-
cells:
|
|
795
|
-
rows:
|
|
796
|
-
columns:
|
|
794
|
+
cells: U.build()?.tuples ?? [],
|
|
795
|
+
rows: L.rows.length - q,
|
|
796
|
+
columns: L.columns.length,
|
|
797
797
|
rowPageCount: ee.rows,
|
|
798
798
|
columnPageCount: ee.columns,
|
|
799
|
-
header:
|
|
800
|
-
rowLines:
|
|
801
|
-
columnLines:
|
|
799
|
+
header: O,
|
|
800
|
+
rowLines: N,
|
|
801
|
+
columnLines: $,
|
|
802
802
|
viewValues: Y,
|
|
803
803
|
firstKey: X,
|
|
804
|
-
...
|
|
804
|
+
...S ? { roles: S } : {}
|
|
805
805
|
};
|
|
806
|
-
},
|
|
807
|
-
const
|
|
806
|
+
}, Oe = (e, t, n, r, o = !1, l, i) => {
|
|
807
|
+
const d = Ie(e, t, r, {
|
|
808
808
|
filters: l,
|
|
809
|
-
slicerFields:
|
|
809
|
+
slicerFields: i
|
|
810
810
|
});
|
|
811
|
-
if (!
|
|
812
|
-
const
|
|
813
|
-
if (
|
|
814
|
-
const
|
|
815
|
-
rowStart:
|
|
816
|
-
colStart:
|
|
817
|
-
rowEnd:
|
|
818
|
-
colEnd:
|
|
819
|
-
},
|
|
820
|
-
const n =
|
|
821
|
-
const n =
|
|
822
|
-
var
|
|
823
|
-
const
|
|
811
|
+
if (!d) return null;
|
|
812
|
+
const u = d.rowPageCount > 0 ? d.rowPageCount + 1 : 0, c = d.rowPageCount > 0 ? 3 * d.columnPageCount - 1 : 0, { rowStart: m, colStart: p } = n;
|
|
813
|
+
if (m - u < 0) return null;
|
|
814
|
+
const h = {
|
|
815
|
+
rowStart: m - u,
|
|
816
|
+
colStart: p,
|
|
817
|
+
rowEnd: m + d.rows - 1,
|
|
818
|
+
colEnd: p + Math.max(d.columns, c) - 1
|
|
819
|
+
}, g = e.fields, w = t.fields, v = V(t), F = (e, t) => {
|
|
820
|
+
const n = g[e], o = n.numberFormat ?? w[e].numberFormat, l = R(o, r), i = f(w[e]), d = v[e], u = (n.items ?? []).filter((e) => void 0 !== e.item && void 0 === e.type), c = u.length > 0 ? u : d.map((e, t) => ({ item: t })), m = c.map((t) => {
|
|
821
|
+
const n = C(d[t.item]), u = E(w[e], t.item), c = null === n ? "(blank)" : "number" == typeof n ? s(r, u ? (f = t.item, void 0 === o ? R(H(w[e], f), r) : l) : l, n) : a.isError(n) ? n.getLabel() : "boolean" == typeof n ? n ? "TRUE" : "FALSE" : String(n);
|
|
822
|
+
var f;
|
|
823
|
+
const m = i && u ? c : n;
|
|
824
824
|
return void 0 !== t.name ? {
|
|
825
|
-
value:
|
|
826
|
-
text:
|
|
825
|
+
value: m,
|
|
826
|
+
text: c,
|
|
827
827
|
name: t.name
|
|
828
828
|
} : {
|
|
829
|
-
value:
|
|
830
|
-
text:
|
|
829
|
+
value: m,
|
|
830
|
+
text: c
|
|
831
831
|
};
|
|
832
|
-
}),
|
|
833
|
-
name: n.name ??
|
|
834
|
-
items:
|
|
832
|
+
}), p = {
|
|
833
|
+
name: n.name ?? w[e].name,
|
|
834
|
+
items: m
|
|
835
835
|
};
|
|
836
836
|
if (t) {
|
|
837
837
|
const e = void 0 !== t.item ? (n.items ?? [])[t.item]?.item : void 0;
|
|
838
|
-
|
|
838
|
+
p.page = void 0 !== e ? c.findIndex((t) => t.item === e) : -1;
|
|
839
839
|
}
|
|
840
|
-
return
|
|
841
|
-
},
|
|
840
|
+
return p;
|
|
841
|
+
}, b = (e) => (e ?? []).filter((e) => -2 !== e);
|
|
842
842
|
return {
|
|
843
843
|
view: {
|
|
844
|
-
range:
|
|
844
|
+
range: h,
|
|
845
845
|
dataFields: (e.dataFields ?? []).map((e) => ({
|
|
846
846
|
name: e.name,
|
|
847
|
-
sourceName:
|
|
847
|
+
sourceName: w[e.field].name
|
|
848
848
|
})),
|
|
849
849
|
fields: [
|
|
850
|
-
...
|
|
851
|
-
...
|
|
852
|
-
...(e.pageFields ?? []).map((e) =>
|
|
850
|
+
...b(e.rowFields).map((e) => F(e)),
|
|
851
|
+
...b(e.columnFields).map((e) => F(e)),
|
|
852
|
+
...(e.pageFields ?? []).map((e) => F(e.field, e))
|
|
853
853
|
],
|
|
854
|
-
values:
|
|
854
|
+
values: d.viewValues,
|
|
855
855
|
block: {
|
|
856
856
|
anchor: {
|
|
857
|
-
row:
|
|
858
|
-
column:
|
|
857
|
+
row: m,
|
|
858
|
+
column: p
|
|
859
859
|
},
|
|
860
860
|
...o ? { blocked: !0 } : {},
|
|
861
|
-
...null !==
|
|
861
|
+
...null !== d.firstKey ? { first: d.firstKey } : {}
|
|
862
862
|
}
|
|
863
863
|
},
|
|
864
864
|
size: {
|
|
865
|
-
rows:
|
|
866
|
-
columns:
|
|
865
|
+
rows: d.rows,
|
|
866
|
+
columns: d.columns
|
|
867
867
|
}
|
|
868
868
|
};
|
|
869
|
-
},
|
|
870
|
-
const o = /* @__PURE__ */ new Map(), l = (e.filters ?? []).filter((t) =>
|
|
871
|
-
if (0 === l.length && !
|
|
872
|
-
const
|
|
873
|
-
for (const s of l.filter(
|
|
874
|
-
const a = s.field, l =
|
|
869
|
+
}, Re = async (e, t, n, r) => {
|
|
870
|
+
const o = /* @__PURE__ */ new Map(), l = (e.filters ?? []).filter((t) => $(t) || e.rowFields?.includes(t.field) || e.columnFields?.includes(t.field)), i = e.fields?.some((e) => e.items?.some((e) => e.calculated)), d = e.dataFields?.some((e) => M(t.fields?.[e.field]));
|
|
871
|
+
if (0 === l.length && !i && !d) return { keep: o };
|
|
872
|
+
const u = V(t);
|
|
873
|
+
for (const s of l.filter($)) {
|
|
874
|
+
const a = s.field, l = u[a];
|
|
875
875
|
if (!l) continue;
|
|
876
|
-
const i =
|
|
877
|
-
for (let e = 0; e < l.length; e++) d[e] = i ? i[e] :
|
|
878
|
-
const
|
|
879
|
-
if (f) for (let e = 0; e <
|
|
880
|
-
else o.set(a,
|
|
876
|
+
const i = k(s.condition) ? Le(e, t, l, a, n) : null, d = new Array(l.length);
|
|
877
|
+
for (let e = 0; e < l.length; e++) d[e] = i ? i[e] : C(l[e]);
|
|
878
|
+
const c = await $e(s.condition, d, n, r), f = o.get(a);
|
|
879
|
+
if (f) for (let e = 0; e < c.length; e++) f[e] &= c[e];
|
|
880
|
+
else o.set(a, c);
|
|
881
881
|
}
|
|
882
|
-
const
|
|
883
|
-
const l = t.fields ?? [],
|
|
884
|
-
if (1 !==
|
|
885
|
-
const
|
|
886
|
-
if (!
|
|
887
|
-
const
|
|
882
|
+
const c = i && r ? await (async (e, t, n, r, o) => {
|
|
883
|
+
const l = t.fields ?? [], i = e.fields ?? [], d = l.flatMap((e, t) => e.calculatedItems?.length ? [t] : []), u = e.dataFields ?? [];
|
|
884
|
+
if (1 !== d.length || u.some((e) => M(l[e.field]) || !ue.has(e.subtotal ?? "sum"))) return null;
|
|
885
|
+
const c = d[0], f = l[c].calculatedItems, m = te(t, n.isDate1904());
|
|
886
|
+
if (!m) return null;
|
|
887
|
+
const p = V(t), g = V({
|
|
888
888
|
...t,
|
|
889
889
|
fields: l.map(({ group: e, ...t }) => t)
|
|
890
|
-
}), w = (e.rowFields ?? []).filter((e) => e >= 0), v = (e.columnFields ?? []).filter((e) => e >= 0),
|
|
891
|
-
if (!
|
|
892
|
-
const y =
|
|
893
|
-
const n =
|
|
890
|
+
}), w = (e.rowFields ?? []).filter((e) => e >= 0), v = (e.columnFields ?? []).filter((e) => e >= 0), b = w.includes(c) ? w : v.includes(c) ? v : null;
|
|
891
|
+
if (!b) return null;
|
|
892
|
+
const y = b.slice(0, b.indexOf(c)), I = [...b.slice(b.indexOf(c) + 1), ...b === w ? v : w], x = [...y, ...I], A = t.recordCount ?? 0, S = (e, t) => {
|
|
893
|
+
const n = i[e]?.items, s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
894
894
|
return !(n && (!s || s.hidden) || o?.get(e) && 0 === o.get(e)[t]);
|
|
895
|
-
},
|
|
896
|
-
const n =
|
|
895
|
+
}, P = (e, t) => {
|
|
896
|
+
const n = i[e.field]?.items;
|
|
897
897
|
if (void 0 !== e.item) return n?.[e.item]?.item === t;
|
|
898
898
|
const s = n?.find((e) => e.item === t && void 0 === e.type);
|
|
899
899
|
return !n || !!s && !s.hidden;
|
|
900
|
-
},
|
|
901
|
-
const o =
|
|
902
|
-
return "number" == typeof o && (l[
|
|
903
|
-
}),
|
|
904
|
-
let t =
|
|
905
|
-
return void 0 === t &&
|
|
900
|
+
}, k = e.pageFields ?? [], T = R(l[c].numberFormat ?? 14, n), O = (e) => p[c].findIndex((t, r) => {
|
|
901
|
+
const o = C(t);
|
|
902
|
+
return "number" == typeof o && (l[c].dates || E(l[c], r)) ? h(s(n, T, o), e) : h(null === o ? F : D(o), e);
|
|
903
|
+
}), N = /* @__PURE__ */ new Map(), $ = new Map(f.map((e) => [e.item, e.formula])), L = (e) => {
|
|
904
|
+
let t = N.get(e);
|
|
905
|
+
return void 0 === t && N.set(e, t = N.size), t;
|
|
906
906
|
};
|
|
907
|
-
for (const e of
|
|
908
|
-
if (null === t || !
|
|
909
|
-
const n =
|
|
910
|
-
return n < 0 ? null : (
|
|
907
|
+
for (const e of f) if (null === oe(e.formula, (e, t) => {
|
|
908
|
+
if (null === t || !h(l[c].name, e)) return null;
|
|
909
|
+
const n = O(t);
|
|
910
|
+
return n < 0 ? null : ($.has(n) || L(n), "");
|
|
911
911
|
})) return null;
|
|
912
|
-
const
|
|
913
|
-
column:
|
|
912
|
+
const _ = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), H = u.map((e) => ({
|
|
913
|
+
column: m[e.field],
|
|
914
914
|
values: g[e.field],
|
|
915
915
|
fold: e.subtotal ?? "sum"
|
|
916
|
-
})),
|
|
917
|
-
for (let e = 0; e <
|
|
918
|
-
if (!
|
|
919
|
-
if (!
|
|
916
|
+
})), B = N.size;
|
|
917
|
+
for (let e = 0; e < A; e++) {
|
|
918
|
+
if (!k.every((t) => P(t, m[t.field][e]))) continue;
|
|
919
|
+
if (!x.every((t) => S(t, m[t][e]))) continue;
|
|
920
920
|
let t = "";
|
|
921
|
-
for (const n of y) t +=
|
|
922
|
-
|
|
923
|
-
const n =
|
|
921
|
+
for (const n of y) t += m[n][e] + ",";
|
|
922
|
+
U.has(t) || U.set(t, e);
|
|
923
|
+
const n = N.get(m[c][e]);
|
|
924
924
|
if (void 0 === n) continue;
|
|
925
925
|
let s = t;
|
|
926
|
-
for (const t of
|
|
927
|
-
let r =
|
|
926
|
+
for (const t of I) s += m[t][e] + ",";
|
|
927
|
+
let r = _.get(s);
|
|
928
928
|
r || (r = {
|
|
929
|
-
sums:
|
|
930
|
-
errors:
|
|
931
|
-
},
|
|
929
|
+
sums: u.map(() => new Array(B).fill(0)),
|
|
930
|
+
errors: u.map(() => new Array(B).fill(void 0))
|
|
931
|
+
}, _.set(s, r));
|
|
932
932
|
const { sums: o, errors: l } = r;
|
|
933
|
-
|
|
934
|
-
const d =
|
|
933
|
+
H.forEach(({ column: t, values: s, fold: r }, i) => {
|
|
934
|
+
const d = C(s[t[e]]);
|
|
935
935
|
"sum" === r ? "number" == typeof d ? o[i][n] += d : a.isError(d) && (l[i][n] ??= d) : ("countNums" === r ? "number" == typeof d : null !== d) && (o[i][n] += 1);
|
|
936
936
|
});
|
|
937
937
|
}
|
|
938
|
-
const
|
|
939
|
-
const t =
|
|
940
|
-
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing &&
|
|
938
|
+
const q = I.map((e) => {
|
|
939
|
+
const t = i[e]?.items;
|
|
940
|
+
return t ? t.flatMap((t) => void 0 !== t.item && void 0 === t.type && !t.missing && S(e, t.item) ? [t.item] : []) : p[e].map((e, t) => t);
|
|
941
941
|
});
|
|
942
|
-
if (
|
|
943
|
-
const
|
|
944
|
-
for (const [e, t] of
|
|
942
|
+
if (q.reduce((e, t) => e * t.length, U.size) > 5e5) return null;
|
|
943
|
+
const z = [];
|
|
944
|
+
for (const [e, t] of U) {
|
|
945
945
|
const n = (e, s, r) => {
|
|
946
|
-
if (e !==
|
|
947
|
-
else
|
|
946
|
+
if (e !== q.length) for (const t of q[e]) n(e + 1, [...s, t], r + t + ",");
|
|
947
|
+
else z.push({
|
|
948
948
|
exemplar: t,
|
|
949
949
|
path: s,
|
|
950
950
|
key: r
|
|
@@ -952,45 +952,45 @@ var Y = [
|
|
|
952
952
|
};
|
|
953
953
|
n(0, [], e);
|
|
954
954
|
}
|
|
955
|
-
const
|
|
956
|
-
if (0 ===
|
|
955
|
+
const G = z.length;
|
|
956
|
+
if (0 === G) return {
|
|
957
957
|
count: 0,
|
|
958
958
|
ids: l.map(() => []),
|
|
959
|
-
values:
|
|
959
|
+
values: u.map(() => [])
|
|
960
960
|
};
|
|
961
|
-
const
|
|
962
|
-
for (let e = 0; e <
|
|
963
|
-
const s =
|
|
961
|
+
const j = u.length * B, K = (e, t) => e * B + t, Q = (e, t) => j + e * f.length + t, J = [];
|
|
962
|
+
for (let e = 0; e < u.length; e++) for (let t = 0; t < B; t++) J.push(z.map(({ key: n }) => {
|
|
963
|
+
const s = _.get(n);
|
|
964
964
|
return s ? s.errors[e][t] ?? s.sums[e][t] : 0;
|
|
965
965
|
}));
|
|
966
966
|
const W = [];
|
|
967
|
-
for (let e = 0; e <
|
|
968
|
-
const n = oe(
|
|
967
|
+
for (let e = 0; e < u.length; e++) for (let t = 0; t < f.length; t++) {
|
|
968
|
+
const n = oe(f[t].formula, (t, n) => {
|
|
969
969
|
if (null === n) return null;
|
|
970
|
-
const s =
|
|
971
|
-
return ae(r >= 0 ? Q(e, r) : K(e,
|
|
970
|
+
const s = O(n), r = f.findIndex((e) => e.item === s);
|
|
971
|
+
return ae(r >= 0 ? Q(e, r) : K(e, N.get(s)));
|
|
972
972
|
});
|
|
973
973
|
if (null === n) return null;
|
|
974
974
|
W.push({
|
|
975
975
|
expression: n,
|
|
976
|
-
coords: le(Q(e, t),
|
|
976
|
+
coords: le(Q(e, t), G)
|
|
977
977
|
});
|
|
978
978
|
}
|
|
979
979
|
const X = await r.evaluateBatch({
|
|
980
|
-
values: ie(J,
|
|
980
|
+
values: ie(J, G),
|
|
981
981
|
formulas: W
|
|
982
|
-
}), Y = l.map(() => []), Z =
|
|
983
|
-
|
|
984
|
-
const r =
|
|
985
|
-
Y[s].push(s ===
|
|
982
|
+
}), Y = l.map(() => []), Z = u.map(() => []), ee = (e, t, n, s) => {
|
|
983
|
+
m.forEach((n, s) => {
|
|
984
|
+
const r = I.indexOf(s);
|
|
985
|
+
Y[s].push(s === c ? t : r >= 0 ? e.path[r] : n[e.exemplar] ?? 0);
|
|
986
986
|
}), Z.forEach((e, t) => {
|
|
987
987
|
e.push(t === n ? s : null);
|
|
988
988
|
});
|
|
989
989
|
};
|
|
990
|
-
return
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
const a = X[o *
|
|
990
|
+
return z.forEach((e, t) => {
|
|
991
|
+
f.forEach(({ item: n }, s) => {
|
|
992
|
+
u.forEach((r, o) => {
|
|
993
|
+
const a = X[o * f.length + s].getValueAt(t, 0) ?? 0;
|
|
994
994
|
if ("sum" !== (r.subtotal ?? "sum") && "number" == typeof a) for (let t = 0; t < Math.round(a); t++) ee(e, n, o, 1);
|
|
995
995
|
else ee(e, n, o, a);
|
|
996
996
|
});
|
|
@@ -1000,14 +1000,14 @@ var Y = [
|
|
|
1000
1000
|
ids: Y,
|
|
1001
1001
|
values: Z
|
|
1002
1002
|
};
|
|
1003
|
-
})(e, t, n, r, o) : void 0,
|
|
1003
|
+
})(e, t, n, r, o) : void 0, f = l.filter((e) => !$(e)).map((e, t) => ({
|
|
1004
1004
|
filter: e,
|
|
1005
1005
|
index: t
|
|
1006
|
-
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index),
|
|
1007
|
-
let
|
|
1008
|
-
const
|
|
1009
|
-
for (const { filter: s } of
|
|
1010
|
-
const a = await Ae(e, t, n, s.field, s.dataField, o,
|
|
1006
|
+
})).sort((e, t) => (e.filter.evalOrder ?? -1) - (t.filter.evalOrder ?? -1) || e.index - t.index), m = (t.recordCount ?? 0) + (c?.count ?? 0);
|
|
1007
|
+
let p;
|
|
1008
|
+
const g = e.rowFields ?? [];
|
|
1009
|
+
for (const { filter: s } of f) {
|
|
1010
|
+
const a = await Ae(e, t, n, s.field, s.dataField, o, p, c, r);
|
|
1011
1011
|
if (!a) continue;
|
|
1012
1012
|
const l = /* @__PURE__ */ new Set();
|
|
1013
1013
|
for (const [e, t] of a.groups) {
|
|
@@ -1017,17 +1017,17 @@ var Y = [
|
|
|
1017
1017
|
});
|
|
1018
1018
|
}
|
|
1019
1019
|
if (0 === l.size) continue;
|
|
1020
|
-
|
|
1021
|
-
const i = a.outer.map((e) => a.records[e]), d = a.records[s.field], u =
|
|
1022
|
-
for (let e = 0; e <
|
|
1023
|
-
if (!(
|
|
1020
|
+
p ??= new Uint8Array(m).fill(3);
|
|
1021
|
+
const i = a.outer.map((e) => a.records[e]), d = a.records[s.field], u = g.includes(s.field) ? 1 : 2;
|
|
1022
|
+
for (let e = 0; e < m; e++) {
|
|
1023
|
+
if (!(p[e] & u)) continue;
|
|
1024
1024
|
let t = "";
|
|
1025
1025
|
for (let n = 0; n < i.length; n++) t += (n > 0 ? "," : "") + i[n][e];
|
|
1026
|
-
l.has(`${t}|${d[e]}`) && (
|
|
1026
|
+
l.has(`${t}|${d[e]}`) && (p[e] &= ~u);
|
|
1027
1027
|
}
|
|
1028
1028
|
}
|
|
1029
|
-
const
|
|
1030
|
-
const l =
|
|
1029
|
+
const w = d && r ? await (async (e, t, n, s, r, o, a) => {
|
|
1030
|
+
const l = P.peek(), i = de(e, t);
|
|
1031
1031
|
if (!l || !i) return null;
|
|
1032
1032
|
const d = xe(e, t, n, a, i.operands);
|
|
1033
1033
|
if (!d) return null;
|
|
@@ -1036,19 +1036,19 @@ var Y = [
|
|
|
1036
1036
|
form: t === ce ? e.form ?? "compact" : e.fields?.[t]?.form ?? "compact"
|
|
1037
1037
|
}));
|
|
1038
1038
|
return Ee(l, i, e, d.items, d.records, d.values, u(e.rowFields), u(e.columnFields), d.n, r, o, s);
|
|
1039
|
-
})(e, t, n, r, o,
|
|
1039
|
+
})(e, t, n, r, o, p, c) : void 0;
|
|
1040
1040
|
return {
|
|
1041
1041
|
keep: o,
|
|
1042
|
-
...
|
|
1043
|
-
...
|
|
1044
|
-
...
|
|
1042
|
+
...p ? { records: p } : {},
|
|
1043
|
+
...c ? { calculatedRecords: c } : {},
|
|
1044
|
+
...w ? { fieldValues: w } : {}
|
|
1045
1045
|
};
|
|
1046
1046
|
}, Ne = (e, t) => {
|
|
1047
1047
|
const n = e.filters;
|
|
1048
1048
|
if (!n) return e;
|
|
1049
1049
|
let s = !1;
|
|
1050
1050
|
const r = n.map((e) => {
|
|
1051
|
-
const n = e.condition &&
|
|
1051
|
+
const n = e.condition && c(e.condition, t);
|
|
1052
1052
|
return n === e.condition ? e : (s = !0, {
|
|
1053
1053
|
...e,
|
|
1054
1054
|
condition: n
|
|
@@ -1061,10 +1061,10 @@ var Y = [
|
|
|
1061
1061
|
}, $e = async (e, t, n, s) => {
|
|
1062
1062
|
const r = t.length, o = new Uint8Array(r);
|
|
1063
1063
|
if (0 === r) return o;
|
|
1064
|
-
const a = new
|
|
1064
|
+
const a = new p();
|
|
1065
1065
|
for (let e = 0; e < r; e++) null !== t[e] && a.setValueAt(e, 0, t[e]);
|
|
1066
1066
|
let l = !1;
|
|
1067
|
-
return await
|
|
1067
|
+
return await T({
|
|
1068
1068
|
conditions: [e],
|
|
1069
1069
|
runtime: n,
|
|
1070
1070
|
calculation: s ?? null,
|
|
@@ -1087,19 +1087,19 @@ var Y = [
|
|
|
1087
1087
|
}
|
|
1088
1088
|
}), l || o.fill(1), o;
|
|
1089
1089
|
}, Le = (e, t, n, r, o) => {
|
|
1090
|
-
const l = e.fields?.[r],
|
|
1091
|
-
for (const e of l?.items ?? []) void 0 !== e.item && void 0 === e.type && void 0 !== e.name &&
|
|
1092
|
-
const
|
|
1090
|
+
const l = e.fields?.[r], i = /* @__PURE__ */ new Map();
|
|
1091
|
+
for (const e of l?.items ?? []) void 0 !== e.item && void 0 === e.type && void 0 !== e.name && i.set(e.item, e.name);
|
|
1092
|
+
const d = l?.numberFormat ?? t.fields?.[r]?.numberFormat, u = R(d, o), c = (e) => void 0 === d ? R(H(t.fields?.[r], e), o) : u, f = new Array(n.length);
|
|
1093
1093
|
for (let e = 0; e < n.length; e++) {
|
|
1094
|
-
const l =
|
|
1094
|
+
const l = i.get(e);
|
|
1095
1095
|
if (void 0 !== l) {
|
|
1096
|
-
|
|
1096
|
+
f[e] = l;
|
|
1097
1097
|
continue;
|
|
1098
1098
|
}
|
|
1099
|
-
const
|
|
1100
|
-
null ===
|
|
1099
|
+
const d = C(n[e]);
|
|
1100
|
+
null === d ? f[e] = F : "number" == typeof d ? f[e] = s(o, E(t.fields?.[r], e) ? c(e) : u, d) : "boolean" == typeof d ? f[e] = d ? "TRUE" : "FALSE" : a.isError(d) ? f[e] = d.getLabel() : f[e] = String(d);
|
|
1101
1101
|
}
|
|
1102
|
-
return
|
|
1102
|
+
return f;
|
|
1103
1103
|
}, _e = (e) => {
|
|
1104
1104
|
const t = e.getCoords(), n = t.colEnd - t.colStart + 1, s = t.rowEnd - t.rowStart, r = e.getWorksheet(), o = r.getRange({
|
|
1105
1105
|
rowStart: t.rowStart,
|
|
@@ -1185,8 +1185,8 @@ var Y = [
|
|
|
1185
1185
|
} : a.isError(e) ? {
|
|
1186
1186
|
t: "e",
|
|
1187
1187
|
v: e.getCode()
|
|
1188
|
-
} : e,
|
|
1189
|
-
const r = e.fields ?? [], o =
|
|
1188
|
+
} : e, qe = (e, t) => (t && "number" == typeof e ? "date:" : "") + d(C(e)), ze = (e, t, n, s = !1) => {
|
|
1189
|
+
const r = e.fields ?? [], o = g(e.items, r.length), a = /\smissingItemsLimit="0"/.test(e.rest ?? ""), l = ((e) => {
|
|
1190
1190
|
const t = /* @__PURE__ */ new Set();
|
|
1191
1191
|
return e.map((e, n) => {
|
|
1192
1192
|
const s = "" === e ? `Field${n + 1}` : e;
|
|
@@ -1199,8 +1199,8 @@ var Y = [
|
|
|
1199
1199
|
const n = e.name.toLocaleLowerCase();
|
|
1200
1200
|
e.noRecords || i.has(n) || i.set(n, t);
|
|
1201
1201
|
});
|
|
1202
|
-
const
|
|
1203
|
-
|
|
1202
|
+
const d = t.recordCount, u = r.map(() => -1), c = r.map((e, t) => o[t].map(() => -1)), m = [], p = [], h = [], w = [], v = [], F = [], b = [], y = (e, t, n) => {
|
|
1203
|
+
w[t] = n.items, F[t] = n.items.length, b[t] = !0, c[e] = ((e, t) => {
|
|
1204
1204
|
const n = /* @__PURE__ */ new Map();
|
|
1205
1205
|
return t.forEach((e, t) => {
|
|
1206
1206
|
n.set(e, t);
|
|
@@ -1209,108 +1209,108 @@ var Y = [
|
|
|
1209
1209
|
};
|
|
1210
1210
|
t.columns.forEach((e, t) => {
|
|
1211
1211
|
const n = i.get(l[t].toLocaleLowerCase());
|
|
1212
|
-
void 0 !== n && (i.delete(l[t].toLocaleLowerCase()),
|
|
1213
|
-
const
|
|
1214
|
-
for (let t = 0; t <
|
|
1212
|
+
void 0 !== n && (i.delete(l[t].toLocaleLowerCase()), u[n] = t);
|
|
1213
|
+
const g = new Int32Array(e.values.length).fill(-1), I = [], x = [], A = new Array(d);
|
|
1214
|
+
for (let t = 0; t < d; t++) {
|
|
1215
1215
|
const n = e.ids[t];
|
|
1216
|
-
let s =
|
|
1217
|
-
s < 0 && (s =
|
|
1216
|
+
let s = g[n];
|
|
1217
|
+
s < 0 && (s = g[n] = I.length, I.push(Be(e.values[n])), x.push(e.dates || !!e.dateIds?.has(n))), A[t] = s;
|
|
1218
1218
|
}
|
|
1219
|
-
const
|
|
1220
|
-
if (void 0 !== n &&
|
|
1219
|
+
const S = (e) => void 0 !== n && (!!r[n].dates || E(r[n], e)), P = I.length, k = void 0 !== n ? !0 === r[n].inline : I.every((e) => "number" == typeof e || "object" == typeof e && "z" === e?.t), M = [];
|
|
1220
|
+
if (void 0 !== n && k) {
|
|
1221
1221
|
const e = /* @__PURE__ */ new Map();
|
|
1222
|
-
for (let t = 0; t <
|
|
1222
|
+
for (let t = 0; t < P; t++) e.set(qe(I[t], x[t]), t);
|
|
1223
1223
|
o[n].forEach((t, s) => {
|
|
1224
|
-
|
|
1224
|
+
c[n][s] = e.get(qe(t, S(s))) ?? -1;
|
|
1225
1225
|
});
|
|
1226
1226
|
} else if (void 0 !== n) {
|
|
1227
1227
|
const e = /* @__PURE__ */ new Map();
|
|
1228
|
-
for (let t = 0; t <
|
|
1228
|
+
for (let t = 0; t < P; t++) e.set(qe(I[t], x[t]), t);
|
|
1229
1229
|
const t = new Set(r[n].calculatedItems?.map((e) => e.item));
|
|
1230
1230
|
o[n].forEach((s, r) => {
|
|
1231
1231
|
if (t.has(r)) return;
|
|
1232
|
-
const o =
|
|
1232
|
+
const o = qe(s, S(r));
|
|
1233
1233
|
let l = e.get(o);
|
|
1234
|
-
void 0 !== l || a ||
|
|
1234
|
+
void 0 !== l || a || S(r) || (l = I.length, I.push(s), x.push(S(r)), M.push(l), e.set(o, l)), c[n][r] = l ?? -1;
|
|
1235
1235
|
});
|
|
1236
1236
|
}
|
|
1237
|
-
const
|
|
1238
|
-
|
|
1239
|
-
const
|
|
1237
|
+
const T = { name: l[t] };
|
|
1238
|
+
k && (T.inline = !0), void 0 !== e.numberFormat && (T.numberFormat = e.numberFormat);
|
|
1239
|
+
const O = [];
|
|
1240
1240
|
let R = !1;
|
|
1241
|
-
|
|
1242
|
-
"number" == typeof e && (
|
|
1243
|
-
}),
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
-
const s =
|
|
1249
|
-
return
|
|
1241
|
+
I.forEach((e, t) => {
|
|
1242
|
+
"number" == typeof e && (x[t] ? O.push(t) : R = !0);
|
|
1243
|
+
}), O.length > 0 && !R ? T.dates = !0 : O.length > 0 && (T.dateItems = O), v[t] = T.dateItems ? new Set(T.dateItems) : void 0, M.length > 0 && (T.unused = M);
|
|
1244
|
+
const N = void 0 !== n ? r[n].rest : void 0;
|
|
1245
|
+
N && (T.rest = N);
|
|
1246
|
+
const $ = void 0 !== n ? r[n].calculatedItems : void 0;
|
|
1247
|
+
$?.length && (T.calculatedItems = $.map(({ item: e, formula: t }) => {
|
|
1248
|
+
const s = I.length;
|
|
1249
|
+
return I.push(o[n][e]), c[n][e] = s, {
|
|
1250
1250
|
item: s,
|
|
1251
1251
|
formula: t
|
|
1252
1252
|
};
|
|
1253
|
-
})), m.push(
|
|
1254
|
-
const
|
|
1255
|
-
if (
|
|
1256
|
-
const e = re(
|
|
1257
|
-
e ? (
|
|
1253
|
+
})), m.push(T), p.push([t, [[0, I]]]), h.push([t, [[0, A]]]), w.push(I), F.push(P), b.push(!1);
|
|
1254
|
+
const L = void 0 !== n ? r[n].group : void 0;
|
|
1255
|
+
if (L?.range && L.base === n) {
|
|
1256
|
+
const e = re(L, I.slice(0, P).map(C), s);
|
|
1257
|
+
e ? (T.group = {
|
|
1258
1258
|
...e,
|
|
1259
1259
|
base: t
|
|
1260
|
-
},
|
|
1261
|
-
} else
|
|
1260
|
+
}, y(n, t, e)) : c[n] = o[n].map(() => -1);
|
|
1261
|
+
} else L && !f(r[n]) && (T.group = L);
|
|
1262
1262
|
}), r.forEach((e, t) => {
|
|
1263
1263
|
if (!e.noRecords) return;
|
|
1264
|
-
if (
|
|
1264
|
+
if (M(e)) return u[t] = m.length, m.push(e), w.push([]), F.push(0), void b.push(!1);
|
|
1265
1265
|
const n = e.group;
|
|
1266
1266
|
if (!n) return;
|
|
1267
|
-
const r =
|
|
1267
|
+
const r = u[n.base];
|
|
1268
1268
|
if (void 0 === r || r < 0) return;
|
|
1269
|
-
const o =
|
|
1269
|
+
const o = w[r];
|
|
1270
1270
|
let a, l = [];
|
|
1271
|
-
if (n.range) a = re(n, o.slice(0,
|
|
1271
|
+
if (n.range) a = re(n, o.slice(0, F[r]).map(C), s);
|
|
1272
1272
|
else {
|
|
1273
|
-
const e = Ge(n,
|
|
1273
|
+
const e = Ge(n, c[n.base], o, m[r]);
|
|
1274
1274
|
a = e.group, l = e.itemMap;
|
|
1275
1275
|
}
|
|
1276
1276
|
if (!a) return;
|
|
1277
1277
|
const i = m.length;
|
|
1278
|
-
|
|
1278
|
+
u[t] = i, m.push({
|
|
1279
1279
|
...e,
|
|
1280
1280
|
group: {
|
|
1281
1281
|
...a,
|
|
1282
1282
|
base: r
|
|
1283
1283
|
}
|
|
1284
|
-
}),
|
|
1284
|
+
}), w.push(a.items), v[i] = a.dateItems ? new Set(a.dateItems) : void 0, F.push(a.items.length), b.push(!1), n.range ? y(t, i, a) : c[t] = l;
|
|
1285
1285
|
}), m.forEach((e, t) => {
|
|
1286
1286
|
const n = e.group;
|
|
1287
1287
|
if (void 0 === n?.parent) return;
|
|
1288
|
-
const s =
|
|
1288
|
+
const s = u[n.parent], { parent: r, ...o } = n;
|
|
1289
1289
|
void 0 !== s && s >= 0 ? e.group = {
|
|
1290
1290
|
...n,
|
|
1291
1291
|
parent: s
|
|
1292
|
-
} :
|
|
1292
|
+
} : f(e) ? e.group = o : delete e.group, e.group && !f(e) && (e.group = {
|
|
1293
1293
|
...e.group,
|
|
1294
1294
|
base: t
|
|
1295
1295
|
});
|
|
1296
1296
|
});
|
|
1297
|
-
const { cacheId:
|
|
1297
|
+
const { cacheId: I, part: x, partFormats: A, fields: S, items: P, records: k, ...T } = e;
|
|
1298
1298
|
return {
|
|
1299
1299
|
model: {
|
|
1300
|
-
...
|
|
1300
|
+
...T,
|
|
1301
1301
|
source: n ?? e.source,
|
|
1302
1302
|
fields: m,
|
|
1303
1303
|
items: p,
|
|
1304
1304
|
records: h,
|
|
1305
|
-
recordCount:
|
|
1305
|
+
recordCount: d
|
|
1306
1306
|
},
|
|
1307
1307
|
remap: {
|
|
1308
|
-
fields:
|
|
1309
|
-
items:
|
|
1310
|
-
newItems:
|
|
1311
|
-
usedCounts:
|
|
1312
|
-
inItemOrder:
|
|
1313
|
-
dateItems:
|
|
1308
|
+
fields: u,
|
|
1309
|
+
items: c,
|
|
1310
|
+
newItems: w,
|
|
1311
|
+
usedCounts: F,
|
|
1312
|
+
inItemOrder: b,
|
|
1313
|
+
dateItems: v
|
|
1314
1314
|
}
|
|
1315
1315
|
};
|
|
1316
1316
|
}, Ge = (e, t, n, s) => {
|
|
@@ -1319,7 +1319,7 @@ var Y = [
|
|
|
1319
1319
|
const s = t?.[n] ?? -1;
|
|
1320
1320
|
s < 0 || (o[s] = e, r.add(e));
|
|
1321
1321
|
});
|
|
1322
|
-
const a = [], l = [], i = new Set(e.dateItems), d = e.items.map((e, t) => r.has(t) ? (i.has(t) && l.push(a.length), a.push(e), a.length - 1) : -1), u = o.map((e, t) => e >= 0 ? d[e] : ((s.dates ||
|
|
1322
|
+
const a = [], l = [], i = new Set(e.dateItems), d = e.items.map((e, t) => r.has(t) ? (i.has(t) && l.push(a.length), a.push(e), a.length - 1) : -1), u = o.map((e, t) => e >= 0 ? d[e] : ((s.dates || E(s, t)) && l.push(a.length), a.push(n[t]), a.length - 1)), { dateItems: c, ...f } = e;
|
|
1323
1323
|
return {
|
|
1324
1324
|
group: {
|
|
1325
1325
|
...f,
|
|
@@ -1329,7 +1329,7 @@ var Y = [
|
|
|
1329
1329
|
},
|
|
1330
1330
|
itemMap: d
|
|
1331
1331
|
};
|
|
1332
|
-
},
|
|
1332
|
+
}, je = (e, t, n = !1, s = !1) => {
|
|
1333
1333
|
const r = (e, t) => null === e ? 5 : "number" == typeof e ? t ? 3 : 0 : "string" == typeof e ? 1 : "boolean" == typeof e ? 2 : 4, o = r(e, n), a = r(t, s);
|
|
1334
1334
|
return o !== a ? o - a : 0 === o || 3 === o ? e - t : 1 === o ? e.localeCompare(t, void 0, { sensitivity: "base" }) : 2 === o ? Number(e) - Number(t) : 4 === o ? e.getCode() - t.getCode() : 0;
|
|
1335
1335
|
}, Ke = (e, t) => {
|
|
@@ -1438,7 +1438,7 @@ var Y = [
|
|
|
1438
1438
|
}, Je = (e, t, n, s, r = !1, o) => {
|
|
1439
1439
|
const a = e.items ?? [], l = [], i = [], d = /* @__PURE__ */ new Set();
|
|
1440
1440
|
for (const e of a) {
|
|
1441
|
-
if (!
|
|
1441
|
+
if (!y(e)) {
|
|
1442
1442
|
i.push(l.length), l.push(e);
|
|
1443
1443
|
continue;
|
|
1444
1444
|
}
|
|
@@ -1454,13 +1454,13 @@ var Y = [
|
|
|
1454
1454
|
};
|
|
1455
1455
|
n >= s && !e.calculated ? r.missing = !0 : delete r.missing, i.push(l.length), l.push(r);
|
|
1456
1456
|
}
|
|
1457
|
-
const
|
|
1458
|
-
for (let e = 0; e < n.length; e++) d.has(e) ||
|
|
1457
|
+
const u = [];
|
|
1458
|
+
for (let e = 0; e < n.length; e++) d.has(e) || u.push(e);
|
|
1459
1459
|
if (r) {
|
|
1460
1460
|
const t = void 0 === e.sort?.dataField && "descending" === e.sort?.order, n = !e.includeNewItemsInFilter && a.some((e) => e.hidden), s = l.map((e, t) => ({
|
|
1461
1461
|
item: e,
|
|
1462
1462
|
at: t
|
|
1463
|
-
})), r = s.filter((e) => !
|
|
1463
|
+
})), r = s.filter((e) => !y(e.item)), o = [...[...s.filter((e) => y(e.item)), ...u.map((e) => ({
|
|
1464
1464
|
item: n ? {
|
|
1465
1465
|
item: e,
|
|
1466
1466
|
hidden: !0
|
|
@@ -1472,38 +1472,38 @@ var Y = [
|
|
|
1472
1472
|
positions: i.map((e) => e < 0 ? e : d.get(e) ?? -1)
|
|
1473
1473
|
};
|
|
1474
1474
|
}
|
|
1475
|
-
if (0 ===
|
|
1475
|
+
if (0 === u.length) return {
|
|
1476
1476
|
items: l,
|
|
1477
1477
|
positions: i
|
|
1478
1478
|
};
|
|
1479
|
-
const
|
|
1479
|
+
const c = !e.includeNewItemsInFilter && a.some((e) => e.hidden), f = (e) => c ? {
|
|
1480
1480
|
item: e,
|
|
1481
1481
|
hidden: !0
|
|
1482
1482
|
} : { item: e };
|
|
1483
1483
|
if (e.sort && void 0 === e.sort.dataField) {
|
|
1484
|
-
const t = "descending" === e.sort.order, s = (e, t) =>
|
|
1485
|
-
for (const e of
|
|
1486
|
-
const n =
|
|
1487
|
-
let r = l.findIndex((n) =>
|
|
1484
|
+
const t = "descending" === e.sort.order, s = (e, t) => je(S(e, n), C(n[t]), void 0 === e.name && o?.has(e.item), o?.has(t));
|
|
1485
|
+
for (const e of u) {
|
|
1486
|
+
const n = f(e);
|
|
1487
|
+
let r = l.findIndex((n) => y(n) && (t ? s(n, e) < 0 : s(n, e) > 0));
|
|
1488
1488
|
r < 0 && (r = We(l)), l.splice(r, 0, n);
|
|
1489
1489
|
for (let e = 0; e < i.length; e++) i[e] >= r && i[e]++;
|
|
1490
1490
|
}
|
|
1491
1491
|
} else {
|
|
1492
1492
|
const e = We(l);
|
|
1493
|
-
l.splice(e, 0, ...
|
|
1494
|
-
for (let t = 0; t < i.length; t++) i[t] >= e && (i[t] +=
|
|
1493
|
+
l.splice(e, 0, ...u.map(f));
|
|
1494
|
+
for (let t = 0; t < i.length; t++) i[t] >= e && (i[t] += u.length);
|
|
1495
1495
|
}
|
|
1496
1496
|
return {
|
|
1497
1497
|
items: l,
|
|
1498
1498
|
positions: i
|
|
1499
1499
|
};
|
|
1500
1500
|
}, We = (e) => {
|
|
1501
|
-
const t = e.findIndex((e) => !
|
|
1501
|
+
const t = e.findIndex((e) => !y(e));
|
|
1502
1502
|
return t < 0 ? e.length : t;
|
|
1503
1503
|
}, Xe = (e, t) => {
|
|
1504
1504
|
if (!(t < 0)) for (let n = 0; n < e.length; n++) {
|
|
1505
1505
|
const s = (t + n) % e.length, r = e[s];
|
|
1506
|
-
if (
|
|
1506
|
+
if (y(r) && !r.missing) return s;
|
|
1507
1507
|
}
|
|
1508
1508
|
}, Ye = (e, t, n, s, r) => {
|
|
1509
1509
|
const o = { ...e };
|
|
@@ -1578,43 +1578,43 @@ var Y = [
|
|
|
1578
1578
|
areas: e.areas.map(d)
|
|
1579
1579
|
}))), a;
|
|
1580
1580
|
}, et = (e, t, n, s) => {
|
|
1581
|
-
const r = (e.fields ?? [])[n]?.items ?? [], o =
|
|
1581
|
+
const r = (e.fields ?? [])[n]?.items ?? [], o = V(t)[n] ?? [], a = t.fields?.[n], l = void 0 !== a?.group?.range, i = (e) => void 0 === e.name && E(a, e.item), d = r.map((e, t) => ({
|
|
1582
1582
|
item: e,
|
|
1583
1583
|
at: t
|
|
1584
|
-
})),
|
|
1585
|
-
|
|
1586
|
-
let
|
|
1587
|
-
const
|
|
1584
|
+
})), u = d.filter((e) => y(e.item));
|
|
1585
|
+
u.sort((e, t) => l ? e.item.item - t.item.item : je(S(e.item, o), S(t.item, o), i(e.item), i(t.item))), "descending" === s && u.reverse();
|
|
1586
|
+
let c = 0;
|
|
1587
|
+
const f = Ze(e, n, d.map((e) => y(e.item) ? u[c++] : e).map((e) => e.at));
|
|
1588
1588
|
return {
|
|
1589
|
-
...
|
|
1590
|
-
fields:
|
|
1589
|
+
...f,
|
|
1590
|
+
fields: f.fields.map((e, t) => t === n ? {
|
|
1591
1591
|
...e,
|
|
1592
1592
|
sort: { order: s }
|
|
1593
1593
|
} : e)
|
|
1594
1594
|
};
|
|
1595
1595
|
}, tt = (n, s, r) => {
|
|
1596
1596
|
const o = n.fields?.[s]?.items?.[r];
|
|
1597
|
-
if (!o || !
|
|
1597
|
+
if (!o || !y(o)) throw new t(e("error.pivotTable.changePart"));
|
|
1598
1598
|
return o;
|
|
1599
1599
|
}, nt = (n, s, r, o, a) => {
|
|
1600
|
-
const l = tt(n, r, o), i = n.fields[r].items, d =
|
|
1601
|
-
const t =
|
|
1602
|
-
return null === t ?
|
|
1600
|
+
const l = tt(n, r, o), i = n.fields[r].items, d = V(s)[r] ?? [], u = (e) => {
|
|
1601
|
+
const t = C(d[e.item]);
|
|
1602
|
+
return null === t ? F : D(t);
|
|
1603
1603
|
};
|
|
1604
|
-
if (i.some((e, t) => t !== o &&
|
|
1605
|
-
const { name:
|
|
1604
|
+
if (i.some((e, t) => t !== o && y(e) && h(e.name ?? u(e), a))) throw new t(e("error.pivotTable.itemNameExists", { name: a }));
|
|
1605
|
+
const { name: c, ...f } = l, m = a === u(l) ? f : {
|
|
1606
1606
|
...l,
|
|
1607
1607
|
name: a
|
|
1608
1608
|
};
|
|
1609
|
-
if (
|
|
1610
|
-
const
|
|
1609
|
+
if (m.name === l.name) return n;
|
|
1610
|
+
const p = {
|
|
1611
1611
|
...n,
|
|
1612
1612
|
fields: n.fields.map((e, t) => t === r ? {
|
|
1613
1613
|
...e,
|
|
1614
|
-
items: i.map((e, t) => t === o ?
|
|
1614
|
+
items: i.map((e, t) => t === o ? m : e)
|
|
1615
1615
|
} : e)
|
|
1616
1616
|
}, g = n.fields[r].sort;
|
|
1617
|
-
return g && void 0 === g.dataField ? et(
|
|
1617
|
+
return g && void 0 === g.dataField ? et(p, s, r, g.order) : p;
|
|
1618
1618
|
}, st = (e, t, n, s) => {
|
|
1619
1619
|
tt(e, t, n);
|
|
1620
1620
|
const r = e.fields[t].items.map((e, t) => t).filter((e) => e !== n);
|
|
@@ -1631,11 +1631,11 @@ var Y = [
|
|
|
1631
1631
|
})
|
|
1632
1632
|
} : a;
|
|
1633
1633
|
}, rt = (n, s, r, o) => {
|
|
1634
|
-
const a =
|
|
1634
|
+
const a = D(o), l = n.fields, i = s.fields, d = n.dataFields ?? [], u = V(s), c = (e, t) => {
|
|
1635
1635
|
if (void 0 !== t.name) return t.name;
|
|
1636
|
-
const n =
|
|
1637
|
-
return null === n ?
|
|
1638
|
-
},
|
|
1636
|
+
const n = C(u[e][t.item]);
|
|
1637
|
+
return null === n ? F : D(n);
|
|
1638
|
+
}, f = (r) => {
|
|
1639
1639
|
if (void 0 !== r.field && a === (l[r.field].name ?? i[r.field].name)) return;
|
|
1640
1640
|
const o = void 0 === r.field ? n : {
|
|
1641
1641
|
...n,
|
|
@@ -1644,18 +1644,18 @@ var Y = [
|
|
|
1644
1644
|
name: "\0"
|
|
1645
1645
|
} : e)
|
|
1646
1646
|
};
|
|
1647
|
-
if (
|
|
1647
|
+
if (z(o, s, a, r.data) !== a) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1648
1648
|
};
|
|
1649
1649
|
switch (r.kind) {
|
|
1650
1650
|
case "item": {
|
|
1651
1651
|
const { field: e, rank: t } = r;
|
|
1652
1652
|
tt(n, e, t);
|
|
1653
|
-
const o = l[e].items.findIndex((n, s) => s !== t &&
|
|
1653
|
+
const o = l[e].items.findIndex((n, s) => s !== t && y(n) && h(c(e, n), a));
|
|
1654
1654
|
return o >= 0 ? st(n, e, o, t) : nt(n, s, e, t, a);
|
|
1655
1655
|
}
|
|
1656
1656
|
case "fieldCaption": {
|
|
1657
1657
|
const { field: e } = r;
|
|
1658
|
-
return
|
|
1658
|
+
return f({ field: e }), ((e, t) => ({
|
|
1659
1659
|
...n,
|
|
1660
1660
|
fields: l.map((n, s) => s === e ? t(n) : n)
|
|
1661
1661
|
}))(e, (t) => {
|
|
@@ -1668,7 +1668,7 @@ var Y = [
|
|
|
1668
1668
|
}
|
|
1669
1669
|
case "dataCaption": {
|
|
1670
1670
|
const { data: e } = r;
|
|
1671
|
-
return
|
|
1671
|
+
return f({ data: e }), {
|
|
1672
1672
|
...n,
|
|
1673
1673
|
dataFields: d.map((t, n) => n === e ? {
|
|
1674
1674
|
...t,
|
|
@@ -1691,14 +1691,14 @@ var Y = [
|
|
|
1691
1691
|
case "pageItem": {
|
|
1692
1692
|
const s = n.pageFields, o = s[r.page];
|
|
1693
1693
|
let i;
|
|
1694
|
-
if (!
|
|
1695
|
-
const { item: d, ...
|
|
1694
|
+
if (!h(a, "(All)") && (i = (l[o.field].items ?? []).findIndex((e) => y(e) && h(c(o.field, e), a)), i < 0)) throw new t(e("error.pivotTable.notAnItem", { name: a }));
|
|
1695
|
+
const { item: d, ...u } = o, f = void 0 === i ? u : {
|
|
1696
1696
|
...o,
|
|
1697
1697
|
item: i
|
|
1698
1698
|
};
|
|
1699
1699
|
return {
|
|
1700
1700
|
...n,
|
|
1701
|
-
pageFields: s.map((e, t) => t === r.page ?
|
|
1701
|
+
pageFields: s.map((e, t) => t === r.page ? f : e)
|
|
1702
1702
|
};
|
|
1703
1703
|
}
|
|
1704
1704
|
}
|
|
@@ -1717,8 +1717,8 @@ var Y = [
|
|
|
1717
1717
|
...e.columnFields ?? [],
|
|
1718
1718
|
...(e.pageFields ?? []).map((e) => e.field)
|
|
1719
1719
|
].filter((e) => e >= 0), it = (e, t) => {
|
|
1720
|
-
const n = e.fields[t], s =
|
|
1721
|
-
|
|
1720
|
+
const n = e.fields[t], s = V(e)[t], r = s.map((e, t) => t);
|
|
1721
|
+
f(n) || r.sort((e, t) => je(C(s[e]), C(s[t]), E(n, e), E(n, t)));
|
|
1722
1722
|
const o = new Set(n.calculatedItems?.map((e) => e.item)), a = new Set(n.unused);
|
|
1723
1723
|
return [...r.map((e) => ({
|
|
1724
1724
|
item: e,
|
|
@@ -1728,11 +1728,11 @@ var Y = [
|
|
|
1728
1728
|
}, dt = (s) => {
|
|
1729
1729
|
if (!("number" == typeof s ? void 0 !== o(s) : "" !== s && n.isValidFormat(s))) throw new t(e("error.pivotTable.notANumberFormat", { name: String(s) }));
|
|
1730
1730
|
}, ut = (n, s, r, o) => {
|
|
1731
|
-
const a = o?.function ?? ((e, t) => "number" ===
|
|
1731
|
+
const a = o?.function ?? ((e, t) => "number" === _(e, t) ? "sum" : "count")(s.fields[r], V(s)[r]), l = v[a];
|
|
1732
1732
|
if (!l) throw new t(e("error.pivotTable.notAFunction", { name: a }));
|
|
1733
1733
|
let i = o?.name;
|
|
1734
|
-
if (void 0 === i) i =
|
|
1735
|
-
else if (
|
|
1734
|
+
if (void 0 === i) i = z(n, s, `${l} of ${w(n, s, r)}`);
|
|
1735
|
+
else if (z(n, s, i) !== i) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
1736
1736
|
const d = {
|
|
1737
1737
|
name: i,
|
|
1738
1738
|
field: r,
|
|
@@ -1742,7 +1742,7 @@ var Y = [
|
|
|
1742
1742
|
return "sum" !== a && (d.subtotal = a), void 0 !== o?.numberFormat && (dt(o.numberFormat), d.numberFormat = o.numberFormat), d;
|
|
1743
1743
|
}, ct = (n, s) => {
|
|
1744
1744
|
const r = n.fields ?? [], o = (n) => {
|
|
1745
|
-
const s = r.findIndex((e) =>
|
|
1745
|
+
const s = r.findIndex((e) => h(e.name, n));
|
|
1746
1746
|
if (s < 0) throw new t(e("error.pivotTable.notAField", { name: n }));
|
|
1747
1747
|
return s;
|
|
1748
1748
|
}, a = /* @__PURE__ */ new Map(), l = (e, t) => {
|
|
@@ -1772,14 +1772,14 @@ var Y = [
|
|
|
1772
1772
|
showColumnStripes: !1,
|
|
1773
1773
|
showLastColumn: !0
|
|
1774
1774
|
}
|
|
1775
|
-
},
|
|
1776
|
-
|
|
1777
|
-
const
|
|
1778
|
-
return
|
|
1775
|
+
}, g = i("row");
|
|
1776
|
+
g.length > 0 && (p.rowFields = g), m.length > 0 && (p.columnFields = m);
|
|
1777
|
+
const w = i("page");
|
|
1778
|
+
return w.length > 0 && (p.pageFields = w.map((e) => ({ field: e }))), d.length > 0 && (p.dataFields = d), c && (p.form = c), p;
|
|
1779
1779
|
}, ft = (e, t) => t.map((t) => {
|
|
1780
1780
|
const n = t.sort?.scope;
|
|
1781
1781
|
if (!n) return t;
|
|
1782
|
-
const s = ((t.axis ===
|
|
1782
|
+
const s = ((t.axis === L.Axis.Row ? e.columnFields : t.axis === L.Axis.Column ? e.rowFields : void 0) ?? []).filter((e) => -2 !== e);
|
|
1783
1783
|
if (!n.items.every((e, t) => s[t] === e.field)) {
|
|
1784
1784
|
const { sort: e, ...n } = t;
|
|
1785
1785
|
return n;
|
|
@@ -1796,37 +1796,37 @@ var Y = [
|
|
|
1796
1796
|
}
|
|
1797
1797
|
};
|
|
1798
1798
|
}), mt = (n, s, r, o, a) => {
|
|
1799
|
-
const l =
|
|
1799
|
+
const l = L.Axis, i = s.fields?.[r], d = n.fields?.[r]?.axis ?? null;
|
|
1800
1800
|
if (o === l.Values) throw new t(e("error.pivotTable.valuesNotAnAxis"));
|
|
1801
1801
|
if (null === o) {
|
|
1802
1802
|
if (null === d) return n;
|
|
1803
1803
|
} else if (void 0 !== i?.formula || o === l.Page && (i?.calculatedItems?.length ?? 0) > 0) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
1804
|
-
const
|
|
1805
|
-
if (void 0 !== a && (!Number.isInteger(a) || a < 1 || a >
|
|
1806
|
-
const
|
|
1807
|
-
if (o === d && (void 0 === a ||
|
|
1808
|
-
|
|
1809
|
-
const { rowFields:
|
|
1810
|
-
|
|
1811
|
-
let
|
|
1812
|
-
...
|
|
1813
|
-
...
|
|
1804
|
+
const c = o ? G(n, o).filter((e) => e !== r) : [];
|
|
1805
|
+
if (void 0 !== a && (!Number.isInteger(a) || a < 1 || a > c.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
1806
|
+
const f = (a ?? c.length + 1) - 1;
|
|
1807
|
+
if (o === d && (void 0 === a || G(n, o)[f] === r)) return n;
|
|
1808
|
+
c.splice(f, 0, r);
|
|
1809
|
+
const { rowFields: m, columnFields: p, pageFields: h, ...g } = n, w = {}, v = (e) => (e ?? []).filter((e) => e !== r), F = o === l.Row ? c : v(n.rowFields), b = o === l.Column ? c : v(n.columnFields), y = o === l.Page ? c.map((e) => n.pageFields?.find((t) => t.field === e) ?? { field: e }) : (n.pageFields ?? []).filter((e) => e.field !== r);
|
|
1810
|
+
F.length > 0 && (w.rowFields = F), b.length > 0 && (w.columnFields = b), y.length > 0 && (w.pageFields = y);
|
|
1811
|
+
let I = {
|
|
1812
|
+
...g,
|
|
1813
|
+
...w
|
|
1814
1814
|
};
|
|
1815
|
-
o === l.Page && d !== l.Page && (
|
|
1816
|
-
const
|
|
1817
|
-
o ?
|
|
1818
|
-
const
|
|
1819
|
-
if (
|
|
1820
|
-
...
|
|
1821
|
-
fields: ft(
|
|
1815
|
+
o === l.Page && d !== l.Page && (I = u(I, r, () => !0));
|
|
1816
|
+
const x = { ...n.fields?.[r] };
|
|
1817
|
+
o ? x.axis = o : delete x.axis, o && !x.items && i && (x.items = q(it(s, r), x.subtotals)), o && void 0 === x.numberFormat && i?.dates && void 0 !== i.numberFormat && (x.numberFormat = i.numberFormat), o === l.Page && x.items?.some((e) => e.hidden) && (x.multipleItemSelection = !0);
|
|
1818
|
+
const A = (n.fields ?? []).map((e, t) => t === r ? x : e);
|
|
1819
|
+
if (I = {
|
|
1820
|
+
...I,
|
|
1821
|
+
fields: ft(I, A)
|
|
1822
1822
|
}, null === o && n.formats?.some((e) => e.area.references?.some((e) => e.field === r))) {
|
|
1823
|
-
const e = n.formats.filter((e) => !e.area.references?.some((e) => e.field === r)), { formats: t, ...s } =
|
|
1824
|
-
|
|
1823
|
+
const e = n.formats.filter((e) => !e.area.references?.some((e) => e.field === r)), { formats: t, ...s } = I;
|
|
1824
|
+
I = e.length > 0 ? {
|
|
1825
1825
|
...s,
|
|
1826
1826
|
formats: e
|
|
1827
1827
|
} : s;
|
|
1828
1828
|
}
|
|
1829
|
-
return
|
|
1829
|
+
return I;
|
|
1830
1830
|
}, pt = -2, ht = /* @__PURE__ */ new Set([
|
|
1831
1831
|
"percentOfTotal",
|
|
1832
1832
|
"percentOfRow",
|
|
@@ -1955,7 +1955,7 @@ var Y = [
|
|
|
1955
1955
|
l[e] = t;
|
|
1956
1956
|
}), It(n, a.map((e) => o[e]), l);
|
|
1957
1957
|
}, Et = (e, t, n, s) => {
|
|
1958
|
-
const r =
|
|
1958
|
+
const r = O(e, t, n, s);
|
|
1959
1959
|
return (e.dataFields[n].subtotal ?? "sum") === s ? e : bt(e, n, (e) => {
|
|
1960
1960
|
const { subtotal: t, ...n } = e, o = {
|
|
1961
1961
|
...n,
|
|
@@ -1966,34 +1966,34 @@ var Y = [
|
|
|
1966
1966
|
}, St = (n, s, r, o) => {
|
|
1967
1967
|
const a = n.dataFields[r], l = a.showDataAs ?? "normal", i = o?.kind ?? "normal";
|
|
1968
1968
|
if (o && !wt.has(o.kind)) throw new t(e("error.pivotTable.notAShowAs", { name: o.kind }));
|
|
1969
|
-
const { showDataAs: d, baseField: u, baseItem: c, ...
|
|
1970
|
-
"normal" !== i && (
|
|
1971
|
-
let
|
|
1969
|
+
const { showDataAs: d, baseField: u, baseItem: c, ...f } = a, m = { ...f };
|
|
1970
|
+
"normal" !== i && (m.showDataAs = i);
|
|
1971
|
+
let p = a.baseField, g = a.baseItem;
|
|
1972
1972
|
if (void 0 !== o?.baseField) {
|
|
1973
|
-
const r = o.baseField, a = (s.fields ?? []).findIndex((e, t) =>
|
|
1973
|
+
const r = o.baseField, a = (s.fields ?? []).findIndex((e, t) => h(w(n, s, t), r));
|
|
1974
1974
|
if (a < 0) throw new t(e("error.pivotTable.notAField", { name: r }));
|
|
1975
|
-
a !==
|
|
1975
|
+
a !== p && (p = a, g = 0);
|
|
1976
1976
|
}
|
|
1977
1977
|
if (void 0 !== o?.baseItem) {
|
|
1978
|
-
const r =
|
|
1979
|
-
if (
|
|
1980
|
-
else if (
|
|
1978
|
+
const r = p ?? 0;
|
|
1979
|
+
if (h(o.baseItem, "(previous)")) g = "previous";
|
|
1980
|
+
else if (h(o.baseItem, "(next)")) g = "next";
|
|
1981
1981
|
else {
|
|
1982
1982
|
const a = n.fields?.[r]?.items ? n : { fields: (n.fields ?? []).map((e, t) => t === r ? {
|
|
1983
1983
|
...e,
|
|
1984
1984
|
items: it(s, r)
|
|
1985
|
-
} : e) }, l =
|
|
1985
|
+
} : e) }, l = b(a, s, r).findIndex((e) => null !== e && h(e, o.baseItem));
|
|
1986
1986
|
if (l < 0) throw new t(e("error.pivotTable.notAnItem", { name: o.baseItem }));
|
|
1987
1987
|
g = l;
|
|
1988
1988
|
}
|
|
1989
1989
|
}
|
|
1990
|
-
if (void 0 !==
|
|
1991
|
-
const
|
|
1990
|
+
if (void 0 !== p && (m.baseField = p), void 0 !== g && (m.baseItem = g), i === l) return m.baseField === a.baseField && m.baseItem === a.baseItem ? n : bt(n, r, () => m);
|
|
1991
|
+
const v = ((e, t, n) => {
|
|
1992
1992
|
if (gt.has(n)) return gt.has(t) ? e : void 0;
|
|
1993
1993
|
const s = ((e) => N(e).replace(/"[^"]*"|\\./g, "").includes("%"))(e);
|
|
1994
1994
|
return ht.has(n) ? ht.has(t) || s ? e : 10 : ht.has(t) && s ? void 0 : e;
|
|
1995
1995
|
})(a.numberFormat, l, i);
|
|
1996
|
-
return
|
|
1996
|
+
return v === a.numberFormat ? bt(n, r, () => m) : bt(Ft(n, r), r, () => yt(m, v));
|
|
1997
1997
|
}, Pt = (e, t, n) => {
|
|
1998
1998
|
dt(n);
|
|
1999
1999
|
const s = N(n), r = e.dataFields[t], o = e.formats?.[e.formats.length - 1];
|
|
@@ -2014,16 +2014,16 @@ var Y = [
|
|
|
2014
2014
|
};
|
|
2015
2015
|
}, kt = (n, s, r) => {
|
|
2016
2016
|
if (null === s) return At(n);
|
|
2017
|
-
const o =
|
|
2017
|
+
const o = L.Axis;
|
|
2018
2018
|
if (s !== o.Row && s !== o.Column) throw new t(e("error.pivotTable.fieldNotPlaceable"));
|
|
2019
2019
|
const a = n.rowFields?.includes(pt) ? o.Row : n.columnFields?.includes(pt) ? o.Column : null;
|
|
2020
2020
|
if (!a) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2021
|
-
const l =
|
|
2021
|
+
const l = G(n, s).filter((e) => e !== pt);
|
|
2022
2022
|
if (void 0 !== r && (!Number.isInteger(r) || r < 1 || r > l.length + 1)) throw new t(e("error.pivotTable.fieldPosition"));
|
|
2023
2023
|
const i = (r ?? l.length + 1) - 1;
|
|
2024
|
-
if (s === a && (void 0 === r ||
|
|
2024
|
+
if (s === a && (void 0 === r || G(n, s)[i] === pt)) return n;
|
|
2025
2025
|
l.splice(i, 0, pt);
|
|
2026
|
-
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m =
|
|
2026
|
+
const { rowFields: d, columnFields: u, valuesOnRows: c, ...f } = n, m = G(n, s === o.Row ? o.Column : o.Row).filter((e) => e !== pt), p = { ...f }, h = s === o.Row ? l : m, g = s === o.Column ? l : m;
|
|
2027
2027
|
return h.length > 0 && (p.rowFields = [...h]), g.length > 0 && (p.columnFields = [...g]), s === o.Row && (p.valuesOnRows = !0), p;
|
|
2028
2028
|
}, Mt = (n, s, r) => {
|
|
2029
2029
|
if (r === (n.valuesCaption ?? "Values")) return n;
|
|
@@ -2031,10 +2031,10 @@ var Y = [
|
|
|
2031
2031
|
...a,
|
|
2032
2032
|
valuesCaption: "\0"
|
|
2033
2033
|
};
|
|
2034
|
-
if (
|
|
2034
|
+
if (z(l, s, r) !== r) throw new t(e("error.pivotTable.fieldNameExists"));
|
|
2035
2035
|
return "Values" === r ? a : {
|
|
2036
2036
|
...a,
|
|
2037
2037
|
valuesCaption: r
|
|
2038
2038
|
};
|
|
2039
2039
|
};
|
|
2040
|
-
export { xt as addPivotDataField, Ne as anchorPivotPeriods, dt as assertNumberFormat, lt as axisFieldsOf,
|
|
2040
|
+
export { xt as addPivotDataField, Ne as anchorPivotPeriods, dt as assertNumberFormat, lt as axisFieldsOf, Oe as buildPivotView, Re as evaluatePivotFilters, $ as isItemFilter, Ie as layOutPivot, it as listedItemsOf, Ct as movePivotDataField, mt as movePivotField, st as movePivotItem, kt as movePivotValues, ot as newPivotCache, ct as newPivotTable, _e as readPivotSource, ze as refreshPivotCache, Ke as remapPivotTable, At as removePivotDataField, nt as renamePivotItem, Mt as renamePivotValues, Ze as reorderPivotItems, Et as setPivotDataFunction, Pt as setPivotDataNumberFormat, St as setPivotDataShowAs, et as sortPivotItemsByLabel, rt as typeOverPivot, at as withListedFields };
|