@sheetxl/mcp 0.8.0-beta.24 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/{Cf0zmfQYfJ7zM0Ya.js → 0WuReGsjIpidu0Cr.js} +1 -1
- package/assets/{B6caaQsfOpFEgYQ4.js → 13QanvzRbNib7VHR.js} +1 -1
- package/assets/{DGI_8HyNF0eAv0P5.js → 2c1OYsVAy_w-ex-F.js} +1 -1
- package/assets/{B-t1q2NS61c2B8E4.js → 8114GVvAL1oaiJLV.js} +1 -1
- package/assets/{B16G2473LTkZP6Mq.js → 8hLtXHueDl7B_SEn.js} +1417 -1356
- package/assets/{DRzZ4bEyLRGVOLzV.js → 8mWHFnE0j-CaNsxr.js} +1 -1
- package/assets/{DaF9L7No8h8a-cqb.js → B-b7HyruDF2gdj3R.js} +2 -2
- package/assets/{CmkgQ5-IG0BSCM3R.js → B3J6davzttys1e7l.js} +3 -3
- package/assets/{doqBmhonQlHp-1Ud.js → B3lrS_GHkG6Mw5pN.js} +1 -1
- package/assets/{CnI4Nli8vtWdFKvf.js → B5rrqMYFybo3oW9k.js} +21 -21
- package/assets/{D6d1DKL15m52ZCuC.js → BB39UJoWw8tjThqY.js} +1 -1
- package/assets/{DtVSjxL6N_7WyM8Z.js → BBF_CDIKB2NIXiHg.js} +1 -1
- package/assets/{DE7G34oYbvrfXbJ7.js → BBLuTiY3V4MpFphK.js} +294 -294
- package/assets/{DM-yGHahbfA_uarn.js → BBZUslaSLC0vlZEb.js} +1 -1
- package/assets/{sJVPCrgeh0U6LbAK.js → BCdXK-2-AE6FAdRs.js} +1 -1
- package/assets/{CUYQlZz5zWsUdmRy.js → BF0C-5gSMHWBXI_k.js} +1 -1
- package/assets/{Xccc6oxtlSvJUDsC.js → BKGTzaNNBlRh7ua3.js} +1 -1
- package/assets/BOa1dD_9H3g65WbP.js +14 -0
- package/assets/{C-nA4SXN5hWHaxV6.js → BPlrBhzIqyWK19E2.js} +526 -526
- package/assets/{xD41vsQY6h60lCqz.js → BR4Wpxs0eSlaoLOl.js} +8 -8
- package/assets/{CSXmTA6w6Pnbtqvb.js → BTB4fa2DU21pP7At.js} +1 -1
- package/assets/{bv3fZLUPzd14I58C.js → BTamKr78GfsihW1a.js} +485 -485
- package/assets/{BPNLZ07Bu_B8Yhf1.js → BVfjBXAMgo4u8Y72.js} +1 -1
- package/assets/{TZnuVwhVjkOBax9F.js → BaZAIwIrqn1x69WH.js} +2 -2
- package/assets/{b8yACuWy67eIj_j2.js → Ban4yk1SYcz9Cs7n.js} +1 -1
- package/assets/{Ds4TB1hn56-RK6_f.js → BfB7Vq09p5uO-L88.js} +1 -1
- package/assets/{DOSWSyKkK4eSi4PD.js → BfEmSaLbKgcjIIpn.js} +2 -2
- package/assets/{DkQ4kxEKhKYQgfjK.js → Bfpf9b1s1bWyBXIw.js} +1 -1
- package/assets/{BrYc6PLonux_gI6b.js → BgHOi7rAHLhztiz-.js} +215 -215
- package/assets/{3VycPrqi6qgLOgGY.js → BgN67gyTyx_xz2Ny.js} +6 -6
- package/assets/{yz2PTfYm_8EGJPM5.js → BhxIJ8xdUxyMPJ_m.js} +1 -1
- package/assets/{Jy-_0a72nn5Iv1NK.js → BlMUrEA8V2S2KH0D.js} +1 -1
- package/assets/{CM-q_J5aF6YXmjeu.js → BloJ-e8xad1b_H7X.js} +3 -3
- package/assets/{C6PNMev7cs5JLgwy.js → Bm-wDNSoT-3JD2bJ.js} +1 -1
- package/assets/{BaYk1vO2hP2S3_1w.js → BoE9cj92LVH2LLy0.js} +2 -2
- package/assets/{g2Nu44uuSJFMzxEV.js → BqH4txhrgR2S-2ji.js} +2 -2
- package/assets/{DPYFRLJbHGlrcrJq.js → BrHXHm2FNXsL53bo.js} +2 -2
- package/assets/{CnKX5SPVE2iuSK42.js → BuFb0lPxYlHccrD9.js} +1 -1
- package/assets/{BkekCZ17YTtd07_C.js → ByGn4tk2SE1MH_sZ.js} +2 -2
- package/assets/{Cxzowsi6ASdZtzeI.js → C1IE0F-y65XqEYRl.js} +1 -1
- package/assets/{7vPlH3_rhJxmmBvG.js → C1JeIUEWW-RL1Rnu.js} +1 -1
- package/assets/{a2e_g9YI3J-lUD7-.js → C2sDVxKGBNlTFg6y.js} +1 -1
- package/assets/{D_tdoUtUe7cApQJn.js → C30apcFVvDHn2M4R.js} +4 -4
- package/assets/{TdDTOcC1TYhk6UuR.js → C3c2PUtIo-aWbjw4.js} +1 -1
- package/assets/{suLYEZBtGUhSYeB7.js → C4C3Ot0xeo1O0wm5.js} +1 -1
- package/assets/{By1QPrSxtnRiJu0R.js → C8zzCf71C976X7SG.js} +2 -2
- package/assets/{BxwB3iTNSE1TgHkb.js → CCS6r_ru_-bq12nu.js} +1 -1
- package/assets/{DNSWaXblwhTtI3w7.js → CDDtXZTG6nNFBQZP.js} +1 -1
- package/assets/{DL8pez0eKo8arYPj.js → CEa6wNiDRZrans9S.js} +3 -3
- package/assets/{Daaro0HbHkKXkBP-.js → CF1fqmS030ry2XQ0.js} +2 -2
- package/assets/{P6V3JAiRpC3BWceC.js → CFqF3aUKvOGFOK9O.js} +1 -1
- package/assets/{BH7ctzMzOYVTGxzA.js → CI8Pu3ko8VzQYdRD.js} +1 -1
- package/assets/{9GnbVPKozgrJpeLW.js → CICMJpasl9o4FaZi.js} +1 -1
- package/assets/{CIw6ZC3K9x-ccacl.js → CJcyMzG19TOjqNHS.js} +1 -1
- package/assets/{2YT_wstXIH6UIigi.js → CJoREr6-3iOl7iU_.js} +1 -1
- package/assets/{B4uS01J0mrSJSftQ.js → CMd7aLIwOA7bxcZm.js} +88 -88
- package/assets/{CpvJUGg9ckuCIpIS.js → CNikOloX_losH8Nz.js} +1 -1
- package/assets/{C0uu0vLKQh0S508B.js → CRZMD-wS-944FnD_.js} +40 -40
- package/assets/{CJ2hV-9ipqOEkLSG.js → CRlLpD9cfhJ9Ov9L.js} +1 -1
- package/assets/{DwNcvKM47ZHfvQM6.js → CS07BBUu6ZtXk4TZ.js} +1 -1
- package/assets/{DyiH3LlinD-38bG7.js → CX-LNahzNZRc78er.js} +1 -1
- package/assets/{DuEtCJEnG_GnJzTX.js → CY3Lmr-fgs6NqXRp.js} +1 -1
- package/assets/{KMzONx2Ps841nJHj.js → CbkCnjWs7Fpj5iQY.js} +8 -8
- package/assets/{Dlqk7XqKnAZ8Pcj3.js → CdbucPAmUkkc5pcM.js} +155 -156
- package/assets/{DRq6lQLndj73WT35.js → CfBJzpZuy1o216iZ.js} +1 -1
- package/assets/{Dk9zYXO3VoBhTdex.js → CoSNTR-pg7BZAU7o.js} +1 -1
- package/assets/{CFWwwr74qRKOBrg9.js → CpoqmW4E7rFdkRpf.js} +1 -1
- package/assets/{BAVltO4Xf7lC0Xr6.js → Cs1df4D35bBjqyvX.js} +1 -1
- package/assets/{DIgPlkEabQdKNUQn.js → CsPyLus3kh4QnahD.js} +1 -1
- package/assets/{DXCTHw-ZutNIuo_2.js → Cwe_kiigxAfceEK9.js} +1 -1
- package/assets/{CzRvg04_TIbwBH5C.js → CwzSgovxnBMrgLmJ.js} +3 -3
- package/assets/{BnNB_ejvNaLu6B3o.js → D31pY9r4JAFWw3E4.js} +1 -1
- package/assets/DCWHNfq5qCxvALwe.js +199 -0
- package/assets/{DGOgx3-IyO8bjF_t.js → DF9WfdyjHuCpsEXh.js} +63 -63
- package/assets/{LM2rVDHdB0jVUFcT.js → DOIpXsEXCaI-8VwJ.js} +1 -1
- package/assets/{76dPHG5RYA7MUV_g.js → DOXj80NXiglJXsMZ.js} +3 -3
- package/assets/{CR1aLf7CWEfPTO9a.js → DQ2vEDfVfsIGSmId.js} +1 -1
- package/assets/{Dhy6iU_09lrQnOAV.js → DQtnL5nOzSzVJhit.js} +61 -61
- package/assets/{CCF6CwJ6cbeLRl23.js → DRcmbp80jMRjxelW.js} +1 -1
- package/assets/{CFNtPYPfDPH-3BXK.js → DRy0AcTiSKQY3bih.js} +1 -1
- package/assets/{tWO-mE87mAuj1qih.js → DWr6GqsnMpLwSUno.js} +2 -2
- package/assets/{ByYJTTTUuu67hDF-.js → DXrX5tIZ1J5BhpFk.js} +4 -4
- package/assets/{CmwNIrRssYuLN2fn.js → DZxHk5oKIVvu3iJR.js} +458 -458
- package/assets/{CbJWbjmv4bz4ppIZ.js → Da0CtWhc7saaOdER.js} +318 -318
- package/assets/{mZt9BTEejCJZ4YK4.js → Dbi1_JHT_4u0nhwc.js} +1 -1
- package/assets/{C9iFJ52KwQTePQ81.js → Dcw7GSCgw_dgsum7.js} +11490 -11497
- package/assets/{fEfisM0E2fUYKIyU.js → DfuY8GdoSk8LxDFW.js} +5 -5
- package/assets/{CT4czEKWIj1GeQN8.js → DlARYdaCOVKiQzMH.js} +1 -1
- package/assets/{BJwiwzwx4Bl5L4Vq.js → DngX5ZuqqFGTp44B.js} +1 -1
- package/assets/{DFVQIZ2zZyAphhCF.js → DpwdC4SN_VYB9_ho.js} +1 -1
- package/assets/{CIY_RiLu1_FmRLAA.js → Dst0tyK__q2Q_AKk.js} +1 -1
- package/assets/{BrJd9jVVv9SQzZol.js → DvHZEP1wpb6549uf.js} +423 -423
- package/assets/{DMDTS0LH9Ke9t-3z.js → DzYvbv5u7E2H7IoB.js} +12 -7
- package/assets/{BjyXkr-CzV8mVx0t.js → G489eYf-lt3D1riX.js} +1 -1
- package/assets/{CKD460cQOgwF6uSV.js → L42Y17f0HUEpfS6U.js} +1 -1
- package/assets/{flby0g5gyZ9P2Wu2.js → O3m_QwxIRXMPFTB8.js} +1 -1
- package/assets/{7IzItpr7MkdnaAwh.js → P3Or6rEY-fHmQZbH.js} +69 -69
- package/assets/{DaHD9SY75O8wDy3p.js → PAzPVx_0jajb_7cO.js} +2 -2
- package/assets/{DJfpKncnYnrr28G0.js → PvRzzufo1V8BuC-I.js} +1 -1
- package/assets/{CFT_tDogP98gTbh7.js → Sm1ouHLiXlCuQVKV.js} +79 -79
- package/assets/{D-vo2bQyAmStQmD9.js → WC-THJfezYSFdiMF.js} +1 -1
- package/assets/{DczQhB3mRSUw6GCf.js → YK80feN98r6GVZv5.js} +1 -1
- package/assets/{DPLTGglaPovTg9e5.js → cl0C9YlF3Ds-lHps.js} +1 -1
- package/assets/{BXWGS09xFG81nnIT.js → eExV3IoVMxYkv5GO.js} +1 -1
- package/assets/{qc7rA-Z3a4rkVQPx.js → g3TrQtFS0qJZeshT.js} +215 -215
- package/assets/{B8bEJ65vQRqsfBlS.js → gf6l-4XXMXtq8hpJ.js} +5 -5
- package/assets/{CEk658HeLJk2cAjM.js → hiKRbrdbpmJglbWC.js} +3 -3
- package/assets/{D8k9de_hen-KqBWe.js → j4zqu8S2Be_yum7W.js} +1 -1
- package/assets/{Ch9w7xFxVMrvGuC_.js → jNZ7exipVCGRPbzr.js} +1 -1
- package/assets/{MosMza0-rXD8uHX_.js → kThU6e6dkzEoaK6n.js} +2 -2
- package/assets/{DJGYlGr2Zj7SkYqc.js → knMcDWv3xN7yJBTT.js} +1 -1
- package/assets/{BJqo8c5bFKjnq69G.js → ov7L79VlksT4fw7T.js} +11 -11
- package/assets/{BifwlrCmEVtjh_1U.js → pLM8Pxl1CscUdvMh.js} +1 -1
- package/assets/{NAWWzA_hk4wYtsPP.js → pfa2CH5NQuzku6FP.js} +2 -2
- package/assets/{B-5mBXpY9i6-eCrZ.js → q6advQx4x6PXvl0i.js} +35 -35
- package/assets/{BWLavTnANLUerdS0.js → qVBjd-c5B8neljc0.js} +2 -2
- package/assets/{DqSBb1HmgeU7eg_i.js → rlgXnCh6A88ozBRz.js} +110 -110
- package/assets/{DUbIxDAzW1dzrtdI.js → rzi2XAwlfy8BsGEa.js} +1 -1
- package/assets/{B7lATTNffVTrDsKE.js → xGASRbzSVVKfEAh-.js} +2 -2
- package/assets/{BkHeIMSE7-LehRCs.js → ybnQoU8_KttlHjiy.js} +1 -1
- package/index.js +145 -145
- package/lib.js +1 -1
- package/licenses/dependencies.txt +45 -45
- package/package.json +2 -2
- package/screenshot-page/assets/-HdF7KAN8PKqrASL.js +1 -0
- package/screenshot-page/assets/{C_YKEkTsGB_5gFNg.js → 0P0DnZolMnjPhiea.js} +2 -2
- package/screenshot-page/assets/{FcTM4SB17cEX1M3X.js → 5Y11BWntgqmzo9dz.js} +1 -1
- package/screenshot-page/assets/{Cx9eq2x1gIXGki3Q.js → B-E9Dzx1wh9RA2yC.js} +1 -1
- package/screenshot-page/assets/{CXwbGzavyvYgDbWU.js → B0CDAMDdxSN4en9k.js} +1 -1
- package/screenshot-page/assets/B39YZkEvc1U8ZQ8H.js +2 -0
- package/screenshot-page/assets/B8Dy_WA9RlWuvMqF.js +4 -0
- package/screenshot-page/assets/BAzHRU12l2vyyXq-.js +39 -0
- package/screenshot-page/assets/{DR-og7vslxlOZd8j.js → BGIujWi3UayyIWlg.js} +1 -1
- package/screenshot-page/assets/BNjmzbnQlBmX-HPQ.js +1 -0
- package/screenshot-page/assets/{B-0-chiwq4MIUQy9.js → BOF6KOmT8mH_NQnA.js} +1 -1
- package/screenshot-page/assets/{DcrVJCyDwGKeil2U.js → BQTLEc84Eql61S2m.js} +1 -1
- package/screenshot-page/assets/{clrFU8i-0wNkmbs7.js → BfkbiKKbYlPpRZqZ.js} +1 -1
- package/screenshot-page/assets/{DGkaCFHx4PsOJkFu.js → BhHceo22V3IBfap0.js} +1 -1
- package/screenshot-page/assets/{Cx1kZ2u_8JFV2Q8D.js → BiRVjUOUI8Qv0CE1.js} +1 -1
- package/screenshot-page/assets/{D6EXAYU-ZH8hjx_7.js → Bne-AygyF1USkPAy.js} +2 -2
- package/screenshot-page/assets/{Dkf51CnZh2zPEGMd.js → BpJaTpbR_CQzXj9M.js} +1 -1
- package/screenshot-page/assets/{B7pXfEVkcbaMBMhc.js → BrEXXxB9tAI5mmZP.js} +1 -1
- package/screenshot-page/assets/{CwCu_r0BW41uLt3P.js → Bt7fKk5ZupUuo_xD.js} +2 -2
- package/screenshot-page/assets/BwYQTcPRDDYIeAA5.js +586 -0
- package/screenshot-page/assets/ByyC3p23DsLAbUpr.js +1 -0
- package/screenshot-page/assets/{D7Yt7xmUlA6-Lq0Q.js → BzI5CCx73aXausKb.js} +9 -9
- package/screenshot-page/assets/{DM6hr-bvWV50-Oex.js → C-2hBFk27roWkIrQ.js} +2 -2
- package/screenshot-page/assets/{BTJ1NNUzHotNDiDe.js → CAKBmg6tXRtjEWgb.js} +2 -2
- package/screenshot-page/assets/CALWodHqzUTIv9le.js +5 -0
- package/screenshot-page/assets/{BcZPWw18bdj_ZvA9.js → CGNsyKbDXXz9qMa2.js} +1 -1
- package/screenshot-page/assets/CGZYePkVGI5DPBBY.js +1 -0
- package/screenshot-page/assets/{Bfq6-treWd_rRiWl.js → CJAgr6wyQGYAd3ZV.js} +1 -1
- package/screenshot-page/assets/{BKwDvElKinpn1IK0.js → CL_hAngRQwm_KGdR.js} +1 -1
- package/screenshot-page/assets/COL9dj40ytErlGak.js +2 -0
- package/screenshot-page/assets/CWA4xGjOeBuxJOzW.js +3 -0
- package/screenshot-page/assets/{r2HZG9_SMzF3__ID.js → CX-ITg5RXdV2cefd.js} +6 -6
- package/screenshot-page/assets/{C7mXat-6esc1AmRD.js → CXeDqC02BZcixiHS.js} +2 -2
- package/screenshot-page/assets/{Pt9ne0xkE2icD3Ih.js → CZaKvnrRdlLj1_X8.js} +1 -1
- package/screenshot-page/assets/{a3fvt1Klg1uGE7p6.js → Cg9eIWL8fPmeZFHG.js} +7 -7
- package/screenshot-page/assets/{DyxJBLjUkeDuu96F.js → CltB1nb5HHSmYrNG.js} +1 -1
- package/screenshot-page/assets/{FqdZRM336KMEcsbU.js → Cq1EzIAt4dHBkzfP.js} +1 -1
- package/screenshot-page/assets/{D6Yv5cc1JE7DGd6j.js → CqBSIwwGzWl8mrBe.js} +1 -1
- package/screenshot-page/assets/D2TibFqUBAPLcu_2.js +1 -0
- package/screenshot-page/assets/{ChSvXfVMLxZsP9zG.js → D4RZZdlItfrgQHcE.js} +1 -1
- package/screenshot-page/assets/{J73KTOmdZGNmnq-z.js → D72Rp__0TEqJ972a.js} +1 -1
- package/screenshot-page/assets/D8EmNst-H2v0eWcf.js +1 -0
- package/screenshot-page/assets/{Tj3B5At0OAN3tDza.js → DACqwpSwlZka3b7s.js} +1 -1
- package/screenshot-page/assets/DEy3e1rY-XMdI309.js +1 -0
- package/screenshot-page/assets/{CI3Z1f4amZ9G2rPD.js → DJebrQ5mu8uxpX3b.js} +1 -1
- package/screenshot-page/assets/{DynKB5GH-vfFMJEy.js → DOsZiE9rOdS_Mm2Q.js} +1 -1
- package/screenshot-page/assets/{CSFFMEKyxEFaykqL.js → DTAKTGn53yF_B621.js} +1 -1
- package/screenshot-page/assets/{D6Ciix7JAZtdKqmj.js → DYYzsN95gWMsxOaj.js} +1 -1
- package/screenshot-page/assets/{DOVt9zHz7FQ2KUQM.js → Da_VIghRFdNrmfZT.js} +1 -1
- package/screenshot-page/assets/DaqAdr-mtpVZMOS8.js +2 -0
- package/screenshot-page/assets/{0UZBKpOOsp7P-DkP.js → DdmX3djBOA6UCZtf.js} +2 -2
- package/screenshot-page/assets/{DEpn6VGd30cHEJOS.js → DfQS5zAy3pN31xNb.js} +1 -1
- package/screenshot-page/assets/DhnaoxNYwMobAVP6.js +1 -0
- package/screenshot-page/assets/{B-8IMo2f1yGNXOyz.js → GxbRmvyoKhHl0ZYY.js} +13 -8
- package/screenshot-page/assets/{zvxBjll3jnL0-vNn.js → Np3jWxG724t5hLHZ.js} +2 -2
- package/screenshot-page/assets/{Bg9UyX4yrB2mSdJt.js → QVGvXAvlw1c8vZjy.js} +12 -12
- package/screenshot-page/assets/{BbT5KRhoeAKLzy54.js → d8BvDCByceUNvHp7.js} +2 -2
- package/screenshot-page/assets/eR9_DaySoB72PvMo.js +1 -0
- package/screenshot-page/assets/{CtiTwHzd_ZSzd3W2.js → hB5riGkPy0wXVIig.js} +1 -1
- package/screenshot-page/assets/hHvAGynpTvAb97GX.js +1 -0
- package/screenshot-page/assets/jFfcyGJ9xruiOUyS.js +1 -0
- package/screenshot-page/assets/{DmDFKv_3APEWI-IY.js → jKvAZg0Tp701aw1o.js} +2 -2
- package/screenshot-page/assets/{DACSL7FA_J91Z_H7.js → jteb4n23QwBT9m_4.js} +1 -1
- package/screenshot-page/assets/mzrDp0emvkWnkXBt.js +1 -0
- package/screenshot-page/index.html +15 -15
- package/types/scripting-api.json +1 -1
- package/types/scripting.d.ts +2 -2
- package/assets/6CBUVbF01Bedq0e2.js +0 -199
- package/assets/Dfv_T_PQVL0O3lu5.js +0 -14
- package/screenshot-page/assets/BDRMUi2BsnBqytIq.js +0 -2
- package/screenshot-page/assets/BEjJHVSbtlsNtoq7.js +0 -3
- package/screenshot-page/assets/BIuMiduMHSsTGacU.js +0 -2
- package/screenshot-page/assets/BPMQ22uISGOm3ymr.js +0 -1
- package/screenshot-page/assets/Bxq4FCQhyPbVhhaR.js +0 -2
- package/screenshot-page/assets/CNB6WmYfGVZjlCKV.js +0 -5
- package/screenshot-page/assets/CXeJV1BW2CVemhPE.js +0 -1
- package/screenshot-page/assets/CkxmJxdtjBIxYoMq.js +0 -1
- package/screenshot-page/assets/D43IayseD2Cy8OZo.js +0 -4
- package/screenshot-page/assets/D8KyhLvfyjLZW92H.js +0 -39
- package/screenshot-page/assets/DBxAatsD6aWk7Zb6.js +0 -586
- package/screenshot-page/assets/DMhOGCTy8V0N14gY.js +0 -1
- package/screenshot-page/assets/DSTlKGmqncM7XHeW.js +0 -1
- package/screenshot-page/assets/Dh14XQinAphjZOKC.js +0 -1
- package/screenshot-page/assets/Dt8JxbBBr2TeDflQ.js +0 -1
- package/screenshot-page/assets/Dxi-bXNjS-CpC5Qr.js +0 -1
- package/screenshot-page/assets/Oay0yGsGYgJDzy8r.js +0 -1
- package/screenshot-page/assets/QZg76Jflu3Q808W3.js +0 -1
- package/screenshot-page/assets/WTrYzPnMQhYDILMR.js +0 -1
- package/screenshot-page/assets/qFyplGXRu7IepHio.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./gU2zeJaXoNh7QI_e.js";import{n as r}from"./CQ-33-es3XJ56pR4.js";import{
|
|
1
|
+
import{n as e}from"./CbXtAM7H-Jg_J0dk.js";import{i as t,t as n}from"./gU2zeJaXoNh7QI_e.js";import{n as r}from"./CQ-33-es3XJ56pR4.js";import{I as i}from"./COL9dj40ytErlGak.js";var a=e(t(),1),o=n(),s=e=>{let t=e.getFont();if(!t)return{};let n={};return t.name&&(n.fontFamily=i.toCSSFontFamily(t.name)),t.size!==void 0&&(n.fontSize=`${t.size}pt`),t.bold&&(n.fontWeight=`bold`),t.italic&&(n.fontStyle=`italic`),t.color&&(n.color=t.color),n},c={pointerEvents:`none`,width:`100%`,height:`100%`,boxSizing:`border-box`,margin:0},l={...c,display:`flex`,alignItems:`center`,gap:`0.35em`,padding:`0 2px`,overflow:`hidden`,whiteSpace:`nowrap`},u=(e,t)=>{let n=(0,a.memo)(t=>{let{children:n,disabled:i,style:s,movable:l,zoom:u=1,isDragging:d,onHide:f,onShow:p,onDragZone:m,onTap:h,adornmentHost:g,flip:_,...v}=t,y=l.getContent(),[,b]=(0,a.useReducer)(e=>e+1,0);r(y,{onAnyChange(){b()}});let x=y,S=y,C=x.getLinkedCell?.()??null;(0,a.useEffect)(()=>{if(C)return x.getLinkedRange?.()?.addListener(()=>b(),{ignoreAddressChanges:!0})},[y,C]);let w=S.getListFillRange?.()??null;if((0,a.useEffect)(()=>{if(w)return S.getListSourceRange?.()?.addListener(()=>b(),{ignoreAddressChanges:!0})},[y,w]),y.isDeleted())return null;let T=l.getBounds();return(0,o.jsx)(`div`,{className:`sxl-form-control-renderer`,...v,style:{width:`100%`,height:`100%`,zoom:u,position:`relative`,boxShadow:d?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,overflow:`hidden`,...s},children:(0,o.jsx)(`div`,{inert:!0,style:c,children:(0,o.jsx)(e,{control:y,width:T?.width??0,height:T?.height??0})})})});return n.displayName=t,n},d=u(({control:e})=>(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,style:{...c,...s(e)},children:e.getCaption()??``}),`ButtonRenderer`),f=u(({control:e})=>{let t=(0,a.useRef)(null),n=e.isMixed();return(0,a.useEffect)(()=>{t.current&&(t.current.indeterminate=n)},[n]),(0,o.jsxs)(`label`,{style:{...l,...s(e)},children:[(0,o.jsx)(`input`,{ref:t,type:`checkbox`,checked:e.isChecked(),readOnly:!0}),(0,o.jsx)(`span`,{children:e.getCaption()??``})]})},`CheckBoxRenderer`),p=u(({control:e})=>(0,o.jsxs)(`label`,{style:{...l,...s(e)},children:[(0,o.jsx)(`input`,{type:`radio`,checked:e.isChecked(),readOnly:!0}),(0,o.jsx)(`span`,{children:e.getCaption()??``})]}),`OptionButtonRenderer`),m=u(({control:e})=>{let t=e.isHorizontal();return(0,o.jsx)(`input`,{type:`range`,tabIndex:-1,readOnly:!0,min:e.getMin()??0,max:e.getMax()??100,step:e.getIncrement()??1,value:e.getValue()??e.getMin()??0,style:{...c,writingMode:t?void 0:`vertical-lr`}})},`ScrollBarRenderer`),h=e=>{let t={up:`2,7 5,4 8,7`,down:`2,3 5,6 8,3`,left:`7,2 4,5 7,8`,right:`3,2 6,5 3,8`}[e.direction];return(0,o.jsx)(`svg`,{viewBox:`0 0 10 10`,style:{width:`100%`,height:`100%`,maxWidth:10,maxHeight:10},children:(0,o.jsx)(`polyline`,{points:t,fill:`none`,stroke:`currentColor`,strokeWidth:1.5})})},g={flex:`1 1 0`,minWidth:0,minHeight:0,margin:0,padding:0,display:`flex`,alignItems:`center`,justifyContent:`center`},_=u(({width:e,height:t})=>{let n=((e,t,n)=>e>0&&t>0?e>t:n)(e,t,!1);return(0,o.jsxs)(`div`,{style:{...c,display:`flex`,flexDirection:n?`row`:`column`},children:[(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,style:g,children:(0,o.jsx)(h,{direction:n?`left`:`up`})}),(0,o.jsx)(`button`,{type:`button`,tabIndex:-1,style:g,children:(0,o.jsx)(h,{direction:n?`right`:`down`})})]})},`SpinnerRenderer`),v=e=>e.getListItems().map((e,t)=>(0,o.jsx)(`option`,{value:t,children:e},t)),y=u(({control:e})=>(0,o.jsxs)(`select`,{tabIndex:-1,value:e.getSelectedIndex()??-1,style:c,onChange:()=>{},children:[e.getSelectedIndex()===null?(0,o.jsx)(`option`,{value:-1}):null,v(e)]}),`DropDownRenderer`),b=u(({control:e})=>(0,o.jsx)(`select`,{tabIndex:-1,size:Math.max(2,e.getListItems().length),value:e.getSelectedIndex()??void 0,style:c,onChange:()=>{},children:v(e)}),`ListBoxRenderer`),x=u(({control:e})=>(0,o.jsx)(`fieldset`,{style:{...c,padding:0,...s(e)},children:(0,o.jsx)(`legend`,{style:{marginLeft:`6px`,padding:`0 2px`},children:e.getCaption()??``})}),`GroupBoxRenderer`),S=u(({control:e})=>(0,o.jsx)(`span`,{style:{...l,...s(e)},children:e.getCaption()??``}),`LabelRenderer`),C=u(({control:e})=>(0,o.jsx)(`div`,{style:{...c,border:`var(--sxl-color-neutral, grey) solid 1px`,backgroundColor:`var(--sxl-color-base-100, white)`,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`hidden`,whiteSpace:`nowrap`},children:e.getName?.()??e.getTypeDescription()}),`UnmodeledControlRenderer`);export{d as ButtonRenderer,f as CheckBoxRenderer,y as DropDownRenderer,x as GroupBoxRenderer,S as LabelRenderer,b as ListBoxRenderer,p as OptionButtonRenderer,m as ScrollBarRenderer,_ as SpinnerRenderer,C as UnmodeledControlRenderer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./CnXLpFE_vFrJ5Jbf.js";import"./BiRVjUOUI8Qv0CE1.js";export{r as ScriptCompiler,n as loadCompiledModule}from"./Np3jWxG724t5hLHZ.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./
|
|
1
|
+
import{l as e}from"./B8Dy_WA9RlWuvMqF.js";import{n as t}from"./Cenh1POxiGMxIQlv.js";var n=async(n,r)=>{let i=n;(function(e){if(e.byteLength<4)return!1;let t=new Uint8Array(e),n={gzip:[31,139],zip:[80,75,3,4],bz2:[66,90,104],br:[206,178,207,129]},r=Object.keys(n);for(let e=0;e<r.length;e++){let i=r[e],a=n[i],o=!0;for(let e=0;e<a.length;e++)if(t[e]!==a[e]){o=!1;break}if(o)return i}return!1})(i)&&(i=await t(i));let a=new TextDecoder().decode(i),o=JSON.parse(a),s={...r?.createWorkbookOptions??{},json:o};return new e(s)};export{n as readSXL};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as e,Z as t,f as n,y as r}from"./ChSvXfVMLxZsP9zG.js";var i=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{t.get(r)!==e&&n.set(r,e)}),n},a=!1,o=0,s=e=>{if(typeof e!=`string`)throw Error(`A stateId (string) is required. Register with 'ITransaction.IStore.create'.`);return e},c=class extends Error{constructor(e,t,n){super(e===`open`?`Transaction conflict: an operation is open on commit '${t}' and this write is not part of it.`:`Transaction conflict: expected commit '${t}' but current is '${n}'.`),this.name=`TransactionConflictError`,this.reason=e,this.expectedCommitId=t,this.actualCommitId=n}},l=(e,t,n=0)=>{for(let r=n;r<t.length;r++){let[n,i]=t[r];e[n]=typeof i==`function`?i(e[n]):i}},u=class{constructor(e){this._record=e}getId(){return this._record.id}getDescription(){return this._record.description}getMeta(){return Object.freeze(this._record.meta)}getAuthor(){return this._record.author}getTimestamp(){return this._record.timestamp}getOperation(){return this._record.operation}getIntents(){return Object.freeze({...this._record.intents})}},d=class{constructor(e){this._listeners=new Set,this._listenersState=new Map,this._commits=new Map,this._locked=!1,this._pending=null,this._versionCounter=0,this._flushOnRead=0,this._isSync=e?.sync??a,this._isTransient=e?.transient??!1,this._author=e?.author,this._maxCommits=e?.maxCommits??1e3;let t={id:`0`,description:`initial`,meta:{},author:this._author,timestamp:Date.now(),states:new Map,intents:{},intentWrites:[],version:0,previousId:null},n={record:t,commit:new u(t)};this._current=n,this._cacheId=null,this._cacheState=null,this._states=t.states,this._transactionStack=[],this._restoring=!1;let r=new Map;r.set(t.id,n),this._commits=r,this._tipId=t.id}static{this.setDefaultSync=e=>{a=e}}getLog(e,t=100){let n=[],r=e;do{let e=this._commits.get(r);if(!e)throw Error(`Invalid commit id: '${r}'`);if(n.push(e.commit),r=e.record.previousId,!r)return n}while(n.length<t);return n}getCommitCount(){return this._commits.size}isOpenTransaction(){return this._transactionStack.length>0}isRestoring(){return this._restoring}isAmendingOtherCommit(){let e=this._transactionStack[0];return e instanceof p&&e._isRetargeted()}getPendingTransaction(){return this._transactionStack[0]??null}getCurrentTransaction(){let e=this._transactionStack;return e[e.length-1]??null}amend(e,t){let n=this.beginCommit(),r=n.getDepth()===0?this._commits.get(e):void 0;n.getDepth()===0&&(n._setAmendOf(e),r&&r!==this._current&&n._retarget(r));try{let e=t(r?r.commit:this._current.commit);return n.commit(),e}catch(e){throw n.rollback(),e}}_squashTip(e){if(this._transactionStack.length>0)return!1;let t=this._commits.get(this._tipId),n=t?.record.previousId;if(!t||!n)return!1;let r=this._commits.get(n);return!!r&&(r.record.states=t.record.states,r.record.intents=e(r.record.intents,t.record.intents),r.record.timestamp=t.record.timestamp,this._commits.delete(t.record.id),this._tipId=n,this._current===t&&(this._current=r,this._states=r.record.states,this._cacheId=null,this._cacheState=null),!0)}create(t){let n=e.uuidV4();if(t!==void 0){let e=this.beginCommit();try{e.updateState(n,t),e.commit()}catch(t){throw e.rollback(),t}}return n}getStateAt(e,t){return s(t),this._commits.get(e)?.record.states.get(t)}getState(e){s(e);let t=this._transactionStack;if(t.length===0){if(this._cacheId===e)return this._cacheState;let t=this._states.get(e);return this._cacheId=e,this._cacheState=t,t}if(this._flushOnRead>0)for(let n=t.length-1;n>=0;n--)t[n]._isFlushedBy(e)&&t[n]._flush();return t[t.length-1].getState(e)}getCurrentCommit(e=!0){return(e?this._pending?.commit:null)??this._current.commit}getTipCommit(){return this._commits.get(this._tipId).commit}getVersionId(e){return s(e),this._states.get(e)?.version??0}restore(e,t){let n=this._getCommitContainer(e,t);if(this._current.commit.getId()===n.commit.getId())return n.commit;let r=i(n.record.states,this._current.record.states);this._notifyStates(`onBeforeCommitStart`,this._current,r,!0,!1,!1,n);let a=this._current.commit;this._current=n,this._states=this._current.record.states,this._cacheId=null,this._cacheState=null,this._notifyStates(`onAfterStateChange`,n,r,!1,!0,!0,n,a),this._notify(`onCommitChange`,n.commit,!0),this._restoring=!0;try{this._notifyStates(`onRestoreOrRevert`,n,n.record.states,!1,!0)}finally{this._restoring=!1}return n.commit}revert(e,t){let n=this._getCommitContainer(e,t),r=this._commits.get(n.record.previousId);if(!r)throw Error(`Invalid commit id: '${n.record.previousId}'`);let a=i(r.record.states,this._current.record.states);this._notifyStates(`onBeforeCommitStart`,this._current,a,!0,!1,!1,n);let o=this._current.commit;this._current=r,this._states=this._current.record.states,this._cacheId=null,this._cacheState=null,this._notifyStates(`onAfterStateChange`,r,a,!0,!1,!0,n,o),this._notify(`onCommitChange`,r.commit,!0),this._restoring=!0;try{this._notifyStates(`onRestoreOrRevert`,r,r.record.states,!0,!0,!1,n)}finally{this._restoring=!1}return r.commit}_getCommitContainer(e,t){let n=this._commits.get(e);if(!n)throw Error(`Invalid commit id: '${e}'`);if(this._isTransient)throw Error(`Cannot revert transient store`);if(t?.force&&this._transactionStack.length>0&&this._transactionStack[0].rollback(),this._transactionStack.length!==0)throw Error(`Open transactions.`);return n}_pruneForwards(e){let t=this._tipId;for(;t&&t!==e;){let e=this._commits.get(t);if(!e)break;this._commits.delete(t),t=e.record.previousId}}_trimOldest(){if(this._commits.size<=this._maxCommits)return;let e=this._commits.keys();for(;this._commits.size>this._maxCommits;)this._commits.delete(e.next().value);let t=this._commits.get(e.next().value);t&&(t.record.previousId=null)}beginCommit(t,n){let r=this._transactionStack;r.length>0&&r[r.length-1]._flush();let i=r.length;typeof t==`string`&&(t={description:t});let a=t?.expectedCommitId;if(a!==void 0){let e=this._current.record.id;if(i>0||this._restoring)throw new c(`open`,a,e);if(e!==a)throw new c(`stale`,a,e)}if(this._locked)throw console.warn(`TransactionStore locked`,r),Error(`TransactionStore is locked by '${r[i-1].getDescription()}`);let o=t?.preventFurtherTransactions,s=this,l=(e,t,r)=>{let a=s._transactionStack;i!==a.length-1&&console.warn(`Transaction stack out of sync`,i,a.length,a),o&&(this._locked=!1),a.pop(),e._isFlushedOnRead()&&s._flushOnRead--,n?.(e,t,r),a.length===0&&(s._pending=null,s._notifyClose(e._getCommit(),t,e._isElided(),e._isAmendClose()))},d;if(r.length===0){let n=this._current.record,r={states:new Map,id:e.uuidV4(),description:typeof t==`string`?t:t?.description??null,meta:{},timestamp:Date.now(),author:(typeof t==`object`?t?.author:void 0)??this._author??null,version:n.version+1,previousId:n.id,intents:{},intentWrites:[],operation:t?.operation},i={record:r,commit:new u(r)};this._pending=i,this._notify(`onCommitStart`,i.commit),d=new p(this,i,n?.states,t,l)}else d=r[r.length-1].beginTransaction(t,l);return o&&(this._locked=!0),this._transactionStack.push(d),d._isFlushedOnRead()&&this._flushOnRead++,d}doBatch(e,t,n){let r,i=this.beginCommit(t,n),a=this.getCurrentCommit();try{r=e?.(a);let n=()=>{i.commit(t)};if(r&&typeof r.then==`function`)return new Promise((e,t)=>{r.then(r=>{try{n(),e(r)}catch(e){t(e)}}).catch(e=>{i.rollback(),t(e)})});n()}catch(e){throw i.rollback(),e}return r}remove(e){s(e);let t=!1,n=this._listenersState.get(e);if(n){let r=this.getCurrentCommit();n.forEach(e=>{e.onClose?.(r)}),this._listenersState.delete(e),t=!0}this._current.record.states.delete(e)&&(t=!0),this._commits.forEach(n=>{n.record.states.delete(e)&&(t=!0)});let r=this._transactionStack;return r.length>0&&r[0]._purgeState(e),this._cacheId=null,this._cacheState=null,t}addListener(e){let t=this._listeners;return t.add(e),()=>{t.delete(e)}}addStateListener(e,t){if(s(e),!t)throw Error(`Listener is required`);let n=this._listenersState.get(e);return n||(n=new Set,this._listenersState.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this._listenersState.delete(e)}}dispatchEvents(e,t=!1){!t||this._isSync?e():setTimeout(e,0)}_commitRecord(t,n,r){let i=t.record,a=t.commit,o=t,s=++this._versionCounter;if(n.forEach((e,t)=>{e!=null&&((e,t,n)=>{Object.defineProperty(e,"id",{value:t,enumerable:!1,configurable:!0,writable:!1}),Object.defineProperty(e,"version",{value:n,enumerable:!1,configurable:!0,writable:!1})})(e,t,s)}),!this._isTransient){let n=!1;if(r!==null){let s=this._current,c=this._commits.get(r)??s,u=c.record,d=c!==s,f=d?u.states:s.record.states;if(i.states.forEach((e,t)=>{f.set(t,e)}),l(u.intents,i.intentWrites),u.meta={...u.meta,...i.meta},u.timestamp=i.timestamp,n=!0,d)return void(o.record.intentWrites=e.EmptyArray);i=s.record,a=s.commit,t=s}this._commits.set(i.id,t),n||(i.previousId!==this._tipId&&this._pruneForwards(i.previousId),this._tipId=i.id,this._trimOldest())}this._current=t,this._states=this._current.record.states,this._cacheId=null,this._cacheState=null,o.record.intentWrites=e.EmptyArray,r===null&&this._notify(`onCommitChange`,a);let c=i.previousId?this._commits.get(i.previousId)?.commit??null:null;this._notifyStates(`onAfterStateChange`,t,n,!1,!1,!0,o,c),this._notify(r===null?`onCommitEnd`:`onAmendEnd`,a,!0)}_notifyStates(e,t,n,r=!1,i=!1,a=!1,o=t,s=null){let c=t.commit,l=o.record.intents,u=this._listenersState;n.forEach((t,n)=>{let o=u.get(n);o&&this.dispatchEvents(()=>{o.forEach(n=>{n[e]?.(t,c,r,i,l,s)})},a)})}_notifyClose(e,t,n=!1,r=!1){this._listeners.forEach(i=>{i.onCommitClose?.(e,t,n,r)})}_notify(e,t,n=!1){return this.dispatchEvents(()=>{this._listeners.forEach(n=>{n[e]?.(t)})},n)}},f=class{constructor(e,t,n){if(this._children=new Set,this._depth=0,this._closed=!1,this._isAmend=!1,this._readOnly=!1,this._hooks=null,this._flushing=!1,this._outcomes=null,this._intentMark=-1,this._store=e,this._container=t,n=typeof n==`string`?{description:n}:n,this._description=n?.description??``,this._operation=n?.operation??null,this._readOnly=n?.readOnly??!1,n?.flush||n?.onCommit||n?.onRollback||n?.onChildCommit){let e={flush:n.flush,writes:n.writes,onCommit:n.onCommit,onRollback:n.onRollback,onChildCommit:n.onChildCommit};this._hooks=e,(e.onCommit||e.onRollback)&&(this._outcomes=[e])}}_isFlushedOnRead(){return!(!this._hooks?.flush||!this._hooks.writes?.length)}_isFlushedBy(e){let t=this._hooks?.writes;return!!t&&t.includes(e)}_flush(){let e=this._hooks?.flush;if(e&&!this._flushing){this._flushing=!0;try{e()}finally{this._flushing=!1}}}_settle(e){let t=this._children;for(;t.size>0;)t.values().next().value.commit(e);this._flush()}_adoptOutcomes(e){let t=e._outcomes;if(t){if(this._outcomes)for(let e=0;e<t.length;e++)this._outcomes.push(t[e]);else this._outcomes=t}}_childCommitted(e){let t=this._hooks?.onChildCommit;if(!t)return;let n={};l(n,this._container.record.intentWrites,e._intentMark),t(e,n)}_notifyOutcome(e){let t=this._outcomes;if(t){this._outcomes=null;for(let n=0;n<t.length;n++)try{e?t[n].onCommit?.(e):t[n].onRollback?.()}catch(e){console.warn(e)}}}_getCommit(){return this._container.commit}_isElided(){return!1}_setAmendOf(e){this._container.amendOf=e}_isAmendClose(){return this._isAmend||this._container.amendOf!==void 0}getIntent(e){return this._container.record.intents?.[e]}setIntent(e,t){let n=this._container.record,r=n.intents??={};r[e]=typeof t==`function`?t(r[e]):t,(n.intentWrites??=[]).push([e,t])}getDepth(){return this._depth}getDescription(){return this._description}getOperation(){return this._operation}getStates(){return this._states}beginTransaction(e,t){this._ensureOpen();let n=new m(this._store,this,this._container,typeof e==`string`?{description:e}:e,t);return this._hooks?.onChildCommit&&(n._intentMark=this._container.record.intentWrites.length),this._children||this._children,this._children.add(n),n}isReadOnly(){return this._readOnly}updateState(e,t){if(this._ensureOpen(),s(e),this._readOnly)throw Error(`Transaction is read-only`+(this._description?`: '${this._description}'`:``));let n=this.getState(e),r;if(typeof t==`function`){if(r=t(n),r===n)return n;r&&={...r}}else{if(t===void 0)return n;r={...n,...t}}if(r){let t=this._states;t||(t=new Map,this._states=t),t.set(e,r)}return r}amend(e){return this._isAmend=!0,this.commit(e)}commit(t){return this._ensureOpen(),typeof t==`string`&&(t={description:t}),t&&(t.description&&(this._description=t.description),t.meta&&(this._meta=e.mergeContentful(t.meta,this._meta))),this._children&&this._children.forEach(e=>{e.commit(t)}),this}isClose(){return this._closed}_ensureOpen(){if(this._closed)throw this._descriptions?console.warn(`stack: [${this._descriptions.join(`,`)}]`):this._description&&console.warn(`description: [${this._description}]`),Error(`Transaction already closed`)}_removeChild(e,t=!1){this._children.delete(e),t||this._mergeStates(e._states)}_purgeState(e){this._states?.delete(e),this._children.forEach(t=>{t._purgeState(e)})}_mergeStates(e){if(!e||e.size===0)return;let t=this._states;return t?(e.forEach((e,n)=>{t.set(n,e)}),t):(this._states=e,e)}get isITransaction(){return!0}},p=class extends f{constructor(e,t,n,r,i){super(e,t,r),this._retargeted=!1,this._elided=!1,this._prevStates=n,this._onClose=i,this._states=new Map,this._meta=t.record.meta}_isElided(){return this._elided}_retarget(e){this._prevStates=e.record.states,this._retargeted=!0}_isRetargeted(){return this._retargeted}getId(){return this._container.commit.getId()}getSavepointId(){return this.getId()}getParent(){return this}commit(e){this._ensureOpen(),this._settle(e);let t=this._states,n=this._container;if(this._store._notifyStates(`onBeforeCommitStart`,n,t,!1,!1),super.commit(e),this._states.size===0)return this._closed=!0,this._elided=!0,this._onClose?.(this,!1,e),this._notifyOutcome(n.commit),this;this._store._notifyStates(`onBeforeCommitEnd`,n,t,!1,!1),this._settle(e);let r=new Map(this._prevStates);this._states.forEach((e,t)=>{e===null?r.delete(t):r.set(t,e)}),this._states=r,this._description&&(n.record.description=this._description),this._meta&&(n.record.meta=this._meta),n.record.states=r,this._closed=!0,this._onClose?.(this,!1,e);let i=n.amendOf??(this._isAmend?n.record.previousId:null);return this._store._commitRecord(n,t,i),this._notifyOutcome(n.commit),this}rollback(){return this._ensureOpen(),this._children&&this._children.forEach(e=>{e.rollback()}),this._notifyOutcome(null),this._closed=!0,this._onClose?.(this,!0,null),this}updateState(e,t){let n=this.getState(e),r=super.updateState(e,t);return r===n||this._states.set(e,r),r}getState(e){s(e);let t=this._states.get(e);return t||=this._prevStates.get(e),t}},m=class extends f{constructor(e,t,n,r,i){if(super(e,n,r),this._savepointId=null,!t)throw Error(`Parent transaction required`);this._parent=t,this._depth=this._parent.getDepth()+1,!1!==(typeof r==`string`?void 0:r?.savepoint)&&(this._savepointId=`${t.getId()}:${++o}`),t.isReadOnly()&&(this._readOnly=!0),this._onClose=i}getId(){return this._parent.getId()}getSavepointId(){return this._savepointId??this._parent.getSavepointId()}getParent(){return this._parent}getState(e){if(this._states){let t=this._states.get(e);if(t!==void 0)return t}return this._parent.getState(e)}commit(e){return this._ensureOpen(),this._settle(e),super.commit(e),this._parent._removeChild(this),this._parent._adoptOutcomes(this),this._closed=!0,this._onClose?.(this,!1,e),this._intentMark>=0&&this._parent._childCommitted(this),this._parent??this}rollback(){return this._ensureOpen(),this._children&&this._children.forEach(e=>{e.rollback()}),this._notifyOutcome(null),this._parent._removeChild(this,!0),this._closed=!0,this._onClose?.(this,!0,null),this._parent??this}},h=class e{constructor(e){this._closed=!1,this._commitId=null,this._stepListeners=null,this._toWrapped=new WeakMap,this._methods=new WeakMap,this._callbacks=new WeakMap,this._outward=new WeakMap,this._inward=new WeakMap,this._store=e}getStore(){return this._store}getCommitId(){return this._commitId}isClosed(){return this._closed}close(){this._closed||(this._closed=!0,this._stepListeners&&b(this._store,-1),this._stepListeners=null)}addStepListener(e){return this._closed?M:(this._stepListeners||(this._stepListeners=new Set,b(this._store,1)),this._stepListeners.add(e),()=>{this._stepListeners?.delete(e)})}_onStep(e,t){let n=this._stepListeners;if(n&&n.size!==0)for(let r of[...n])r(e,t)}wrap(e){if(typeof e==`function`)return this._wrapFunction(e,!0);if(typeof e!=`object`||!e)return e;let t=e;if(_.has(t))return e;let n=this._toWrapped.get(t);return n===void 0?t instanceof Promise?t.then(e=>this.wrap(e)):Array.isArray(t)?this._wrapArray(t):T(t)?this._wrapModel(t):O(t)?this._wrapIterator(t):e:n}unwrap(e){if(typeof e!=`object`||!e)return e;let t=e,n=g.get(t);return n===void 0?Array.isArray(t)?k(t):Object.getPrototypeOf(t)===Object.prototype?A(t):e:n}_wrapModel(e){let t=this,n=new Proxy(e,{get(e,n){let r=Reflect.get(e,n,e);if(r===null||typeof r!=`object`&&typeof r!=`function`)return r;let i=Object.getOwnPropertyDescriptor(e,n);return!i||i.configurable||i.writable?typeof r==`function`?t._wrapMethod(e,r):t.wrap(r):r},set:(e,n,r)=>Reflect.set(e,n,t.unwrap(r),e)});return this._toWrapped.set(e,n),g.set(n,e),_.set(n,this),n}_wrapMethod(e,t){let n=this._methods.get(e);n||(n=new Map,this._methods.set(e,n));let r=n.get(t);if(r)return r;let i=this;return r=function(...n){let r=n.length;for(let e=0;e<r;e++)n[e]=i._unwrapArg(n[e]);return i._inScope(()=>i.wrap(t.apply(e,n)))},n.set(t,r),r}_unwrapArg(e){return typeof e==`function`?this._wrapFunction(e,!1):typeof e!=`object`||!e||Object.getPrototypeOf(e)!==Object.prototype||g.has(e)?this.unwrap(e):this._unwrapCallbacks(e)}_unwrapCallbacks(e){let t=!1;for(let n in e)if(typeof e[n]==`function`){t=!0;break}if(!t)return this.unwrap(e);let n=this._callbacks.get(e);if(n)return n;let r={};for(let t in e){let n=e[t];r[t]=typeof n==`function`?this._wrapFunction(n,!1):this.unwrap(n)}return this._callbacks.set(e,r),r}_wrapFunction(e,t){let n=t?this._outward:this._inward,r=n.get(e);if(r)return r;let i=this;return r=t?function(...t){let n=t.length;for(let e=0;e<n;e++)t[e]=i._unwrapArg(t[e]);return i._inScope(()=>i.wrap(e.apply(i.unwrap(this),t)))}:function(...t){let n=t.length;for(let e=0;e<n;e++)t[e]=i.wrap(t[e]);return i.unwrap(e.apply(i.wrap(this),t))},n.set(e,r),r}_wrapArray(e){let t=e.length>0?e[0]:void 0;return typeof t!=`object`||!t||Array.isArray(t)||!T(t)?e:e.map(e=>this.wrap(e))}_wrapIterator(e){let t=this,n={next(...n){let r=e.next(...n);return r.done?r:{done:!1,value:t.wrap(r.value)}},[Symbol.iterator]:()=>n};return e.return&&(n.return=t=>e.return(t)),n}_inScope(e){if(this._closed)return e();let t=v;v=this;try{return e()}finally{v=t}}static bind(t,n,r){let i=new e(t);return{callback:e=>{i._commitId=e.getId();let t=r(e,i.wrap(n));return t instanceof Promise?t.then(e=>i.unwrap(e)):i.unwrap(t)},close:()=>i.close(),onChildCommit:(e,n)=>{i._onStep(t.getCurrentCommit(),n)}}}static isStepping(e){return(y.get(e)??0)>0}static of(e){return e===null||typeof e!=`object`&&typeof e!=`function`?null:_.get(e)??null}},g=new WeakMap,_=new WeakMap,v=null,y=new WeakMap,b=(e,t)=>{y.set(e,(y.get(e)??0)+t)},x=()=>v,S=e=>v!==null&&v.getStore()===e,C=new WeakMap,w=[`addListener`,`addListeners`,`doBatch`,`getWorkbook`,`getWorksheet`,`update`],T=e=>{let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype||t===Array.prototype)return!1;let n=C.get(t);return n===void 0&&(n=!E(e)&&D(t),C.set(t,n)),n},E=e=>e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Error||e instanceof ArrayBuffer||ArrayBuffer.isView(e),D=e=>{for(let t=0;t<w.length;t++)if(typeof e[w[t]]==`function`)return!0;let t=e;for(;t&&t!==Object.prototype;){let e=Object.getOwnPropertyNames(t);for(let n=0;n<e.length;n++){let r=e[n];if(r.length>3&&r.startsWith(`set`)&&r.charCodeAt(3)>=65&&r.charCodeAt(3)<=90&&typeof Object.getOwnPropertyDescriptor(t,r)?.value==`function`)return!0}t=Object.getPrototypeOf(t)}return!1},O=e=>typeof e.next==`function`&&typeof e[Symbol.iterator]==`function`,k=e=>{let t=null,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(typeof n!=`object`||!n)continue;let i=j(n);i!==n&&(t??=e.slice(),t[r]=i)}return t??e},A=e=>{let t=null;for(let n in e){let r=e[n];if(typeof r!=`object`||!r)continue;let i=j(r);i!==r&&(t??={...e},t[n]=i)}return t??e},j=e=>{let t=g.get(e);return t===void 0?Array.isArray(e)?k(e):Object.getPrototypeOf(e)===Object.prototype?A(e):e:t},M=()=>{},N=(e,t,...n)=>{let r=globalThis.__SXL_LOG_EVENTS;r&&(typeof r!=`string`||e.includes(r))&&console.log(`[sxl:${e}] ${t}`,...n)},P=class{constructor(e,t){this._listeners=new Set,this._pending=null,this._landing=null,this._listeners=new Set,this._transactions=t??new d({transient:!0}),this._stateId=this._transactions.create(),this._src=e;let n=this,r=()=>{let e=n._landing;if(N(n._label(),`drain landing=${e?e.length:`null`}`),!e)return;n._landing=null;let t=new Set,r=e.length,i=null;for(let t=0;t<r;t++){let n=e[t].options,r=n?.merge;if(!r)continue;i??=new Map;let a=e[t].listeners;for(let e=0;e<a.length;e++){let t=a[e];i.set(t,i.has(t)?r(i.get(t),n.params):n.params)}}for(let a=0;a<r;a++){let r=e[a];n._doNotify(r.listeners,r.removes,r.options,t,i)}};this._transactionsRemoveListener=this._transactions.addListener({onCommitClose(e,t,i){let a=n._pending;N(n._label(),`commitClose rollback=${t} elided=${i} pending=${a?a.length:`null`}`),n._pending=null,t||(a&&(n._landing?n._landing.push(...a):n._landing=a),i&&r())},onCommitEnd:r,onAmendEnd:r})}_label(){return this._src?.constructor?.name??`unknown`}_inOperation(){return this._transactions.isOpenTransaction()||this._transactions.isRestoring()}addListeners(e,t){let n=t?.transactional??S(this._transactions),r={listeners:e},i=this,a=()=>{n?i._updateEntries(e=>{e.delete(r)}):i._listeners.delete(r)};return r.remove=t?.once?a:null,n?i._updateEntries(e=>{e.add(r)}):i._listeners.add(r),a}_updateEntries(e){let t=this._transactions,n=t.getState(this._stateId)?.listeners,r=new Set(n);e(r);let i=t.beginCommit();try{i.updateState(this._stateId,{listeners:r}),i.amend()}catch(e){throw i.rollback(),e}}async _doNotify(e,t=null,n,r,i){let a=n?.source??this._src,o=[],s=n?.params,c=e.length;for(let t=0;t<c;t++){let n=e[t];r&&r.has(n)||(r?.add(n),o.push(n(a,i?.has(n)?i.get(n):s)))}let l=null;if(t&&(l=()=>{let e=t.length;for(let n=0;n<e;n++)t[n]()}),n?.async)return new Promise(async(e,t)=>{try{let t=await Promise.all(o);l?.(),e(t)}catch(e){l?.(),t(e)}});l?.()}hasTransactional(e){let t=this._transactions.getState(this._stateId)?.listeners;if(!t||t.size===0)return!1;for(let n of t)if(n.listeners[e])return!0;return!1}_collect(e,t){if(!e)return null;let n=null,r=null;return e.forEach(e=>{let i=e.listeners[t];i&&((n??=[]).push(i),e.remove&&(r??=[]).push(e.remove))}),n?{listeners:n,removes:r}:null}notify(e,t){let n=this._transactions,r=t?.transactional??this._inOperation();if(r){let r=this._collect(n.getState(this._stateId)?.listeners,e);r&&this._doNotify(r.listeners,r.removes,t)}let i=this._collect(this._listeners,e);if(i)return!r||n.isRestoring()||t?.async?(N(this._label(),`notify ${String(e)} delivered to ${i.listeners.length}`),this._doNotify(i.listeners,i.removes,t)):((this._pending??=[]).push({listeners:i.listeners,removes:i.removes,options:t}),void N(this._label(),`notify ${String(e)} QUEUED (open transaction) pending=${this._pending.length}`));N(this._label(),`notify ${String(e)} inOperation=${r} listeners=0`)}close(){this._transactions.remove(this._stateId),this._transactionsRemoveListener(),this._listeners.clear(),this._pending=null,this._landing=null}},F=`Item has been closed. No further operations are allowed.`,I=(e=t(`op.update`))=>r(`error.anchor.protected`,{description:r(e)}),L=class{constructor(e){this._closed=!1,this._options={...e};let t=this;this._transactions=this._options?.transactions??new d({transient:!0}),this._id=this._transactions.create({isDeleted:!1}),this._emitter=new P(this,this._transactions),e?.json&&this._fromJSON(e.json),this._options?.setContainerReadOnlyCallback?.(()=>{t._processOnContainerReadOnly()}),this._transactionsRemoveListener=this._transactions.addStateListener(this._id,{onAfterStateChange(e,n){t._processAfterStateChange(e,n)},onRestoreOrRevert(e,n){t._processRestoreOrRevert(e,n)}}),this._processInit()}_fromJSON(e){}isReadOnly(){return this._options.isReadOnly?.()??!1}isDeleted(){let e=this._getState();return e===void 0||(e.isDeleted??!1)}getType(){return this._options.type}get isIModel(){return!0}_processTransactionDone(e){}_getActionDescription(e){return null}_getState(){if(this._closed)throw Error(r(`error.model.modelClosed`));return this._transactions.getState(this._id)}_beginCommit(e){return this._transactions.beginCommit(typeof e==`string`?{description:e}:e)}_getTransactions(){return this._transactions}_updateState(e,t,n){return this._writeState(e,t,n,!1)}_amendState(e,t,n){return this._writeState(e,t,n,!0)}_writeState(e,t,n,i=!1){if(this._closed)throw Error(r(`error.model.modelClosed`));if(!e)return this;let a=this._beginCommit(t?.description);try{a.updateState(this._id,e);let r=!1,o=n?n.length:0;for(let e=0;e<o;e++){let t=n[e];r||=t===`onAnyChange`,this._emitter.notify(t)}!r&&n&&o>0&&this._emitter.notify(`onAnyChange`),i?a.amend(t):a.commit(t)}catch(e){throw a.rollback(),e}return this}_getEmitter(){return this._emitter}_processInit(){}_processAfterStateChange(e,t){}_processRestoreOrRevert(e,t){this._emitter.notify(`onInvalidated`)}delete(e){this._getState().isDeleted||this._delete(e)}_delete(e){e={description:this._getActionDescription(`delete`)??t(`op.delete`),...e};let n=this._beginCommit(e?.description);try{this._options.deleteFromContainer&&this._options.deleteFromContainer?.(e),this._processDelete(),n.commit()}catch(e){throw n.rollback(),e}}_processOnContainerDeleted(){this._processDelete()}_processDelete(){this._updateState({isDeleted:!0},void 0,[`onDelete`])}_processOnContainerReadOnly(){this._emitter.notify(`onReadOnlyChange`)}addListeners(e,t){return this._emitter.addListeners(e,t)}getId(){return this._id}getVersionId(){return this._transactions.getVersionId(this._id)}beginCommit(e){return this._beginCommit(e)}doBatch(e,t){let n=this;return this._transactions.doBatch(e,typeof t==`string`?{description:t}:t,e=>{n._processTransactionDone(e)})}isClosed(){return this._closed}close(){this._closed||(this._emitter.notify(`onClose`),this._closed=!0,this._transactionsRemoveListener?.(),this._transactions.remove(this._id))}},R=class e extends L{static{this.instanceCounter=0}constructor(t){super(t),this._watches=new Set,this._watchesReleased=!1,this._getMovable=t.getMovable??null,this._addWatchOption=t.addWatch??null,this._getRangeOption=t.getRange??null;let n=t.name??null;!n&&this._getMovable&&(n=`${this.getTypeDescription()} ${++e.instanceCounter}`);let r=t.description??null;n===null&&r===null||this._updateState({name:n,description:r})}getName(){return this._closed?null:this._getState()?.name??null}setName(e){let n={description:t(`op.setMovableName`)};return this._protectionCheck(n.description),this._updateState({name:e},n,[`onAnyChange`]),this}getDescription(){return this._closed?null:this._getState()?.description??null}setDescription(e){let n={description:t(`op.setMovableDescription`)};return this._protectionCheck(n.description),this._updateState({description:e||null},n,[`onAnyChange`]),this}getMovable(){return this._getMovable?.()??null}getReferences(){if(this._closed||this._watchesReleased||this._watches.size===0)return null;let e=[],t=new Set;for(let n of this._watches){let r=n.formula?.getReferences()??this._parseReference(n.expression);if(!r)continue;let i=r.getCount();for(let n=0;n<i;n++){let i=r.at(n);if(i.isInvalid())continue;let a=`${i.getWorksheet().getId()}!${i.getAddress()}`;t.has(a)||(t.add(a),e.push(i))}}return e.length===0?null:e[0].getWorksheet().getRanges(e)}_addWatch(e,t,n){let r=typeof e==`string`?e:e.getExpression(),i={expression:r.startsWith(`=`)?r.substring(1):r,formula:null,callback:t,options:n,release:null};return this._watches.add(i),this._watchesReleased||this._hold(i,typeof e==`string`?void 0:e),()=>{this._watches.delete(i)&&(i.release?.(),i.release=null,this._notifyReferencesChange())}}_resolveRange(e){return this._getRangeOption?.(e)??null}_hold(e,t){let n=this._addWatchOption;n&&(e.release=n(t??e.expression,t=>{e.formula=t.formula,e.expression=t.formula.getExpression(),e.callback?.(t),this._notifyReferencesChange()},e.options))}_parseReference(e){if(!e||e.includes(`#REF!`))return null;try{let t=e.includes(`!`)?null:this.getMovable()?.getRange().getWorksheet(),n=t?t.getRange(e):this._resolveRange(e);return n&&!n.isInvalid()?n.getWorksheet().getRanges([n]):null}catch{return null}}_notifyReferencesChange(){this._closed||(this._emitter.notify(`onReferencesChange`),this._emitter.notify(`onAnyChange`))}_releaseWatches(){this._watchesReleased=!0;for(let e of this._watches)e.release?.(),e.release=null}_holdWatches(){this._watchesReleased=!1;for(let e of this._watches)this._hold(e,e.formula??void 0)}_processDelete(){this._releaseWatches(),super._processDelete()}_processRestoreOrRevert(e,t){super._processRestoreOrRevert(e,t);let n=e===void 0||!0===e.isDeleted;n&&!this._watchesReleased?this._releaseWatches():!n&&this._watchesReleased&&this._holdWatches()}_getSourceId(){let e=this._getState()?.data;return typeof e?.sourceId==`number`?e.sourceId:void 0}_ensureSourceId(e){let n=this._getSourceId();if(n!==void 0)return n;let r=e(),i=this._getState()?.data??{};return this._updateState({data:{...i,sourceId:r}},{description:t(`op.connectShape`)}),r}_protectionCheck(e){if(this.isReadOnly())throw new n(I(e))}};export{R as a,h as c,P as i,x as l,I as n,S as o,L as r,d as s,F as t};
|
|
1
|
+
import{I as e,Z as t,f as n,y as r}from"./D4RZZdlItfrgQHcE.js";var i=(e,t)=>{let n=new Map;return e.forEach((e,r)=>{t.get(r)!==e&&n.set(r,e)}),n},a=!1,o=0,s=e=>{if(typeof e!=`string`)throw Error(`A stateId (string) is required. Register with 'ITransaction.IStore.create'.`);return e},c=class extends Error{constructor(e,t,n){super(e===`open`?`Transaction conflict: an operation is open on commit '${t}' and this write is not part of it.`:`Transaction conflict: expected commit '${t}' but current is '${n}'.`),this.name=`TransactionConflictError`,this.reason=e,this.expectedCommitId=t,this.actualCommitId=n}},l=(e,t,n=0)=>{for(let r=n;r<t.length;r++){let[n,i]=t[r];e[n]=typeof i==`function`?i(e[n]):i}},u=class{constructor(e){this._record=e}getId(){return this._record.id}getDescription(){return this._record.description}getMeta(){return Object.freeze(this._record.meta)}getAuthor(){return this._record.author}getTimestamp(){return this._record.timestamp}getOperation(){return this._record.operation}getIntents(){return Object.freeze({...this._record.intents})}},d=class{constructor(e){this._listeners=new Set,this._listenersState=new Map,this._commits=new Map,this._locked=!1,this._pending=null,this._versionCounter=0,this._flushOnRead=0,this._isSync=e?.sync??a,this._isTransient=e?.transient??!1,this._author=e?.author,this._maxCommits=e?.maxCommits??1e3;let t={id:`0`,description:`initial`,meta:{},author:this._author,timestamp:Date.now(),states:new Map,intents:{},intentWrites:[],version:0,previousId:null},n={record:t,commit:new u(t)};this._current=n,this._cacheId=null,this._cacheState=null,this._states=t.states,this._transactionStack=[],this._restoring=!1;let r=new Map;r.set(t.id,n),this._commits=r,this._tipId=t.id}static{this.setDefaultSync=e=>{a=e}}getLog(e,t=100){let n=[],r=e;do{let e=this._commits.get(r);if(!e)throw Error(`Invalid commit id: '${r}'`);if(n.push(e.commit),r=e.record.previousId,!r)return n}while(n.length<t);return n}getCommitCount(){return this._commits.size}isOpenTransaction(){return this._transactionStack.length>0}isRestoring(){return this._restoring}isAmendingOtherCommit(){let e=this._transactionStack[0];return e instanceof p&&e._isRetargeted()}getPendingTransaction(){return this._transactionStack[0]??null}getCurrentTransaction(){let e=this._transactionStack;return e[e.length-1]??null}amend(e,t){let n=this.beginCommit(),r=n.getDepth()===0?this._commits.get(e):void 0;n.getDepth()===0&&(n._setAmendOf(e),r&&r!==this._current&&n._retarget(r));try{let e=t(r?r.commit:this._current.commit);return n.commit(),e}catch(e){throw n.rollback(),e}}_squashTip(e){if(this._transactionStack.length>0)return!1;let t=this._commits.get(this._tipId),n=t?.record.previousId;if(!t||!n)return!1;let r=this._commits.get(n);return!!r&&(r.record.states=t.record.states,r.record.intents=e(r.record.intents,t.record.intents),r.record.timestamp=t.record.timestamp,this._commits.delete(t.record.id),this._tipId=n,this._current===t&&(this._current=r,this._states=r.record.states,this._cacheId=null,this._cacheState=null),!0)}create(t){let n=e.uuidV4();if(t!==void 0){let e=this.beginCommit();try{e.updateState(n,t),e.commit()}catch(t){throw e.rollback(),t}}return n}getStateAt(e,t){return s(t),this._commits.get(e)?.record.states.get(t)}getState(e){s(e);let t=this._transactionStack;if(t.length===0){if(this._cacheId===e)return this._cacheState;let t=this._states.get(e);return this._cacheId=e,this._cacheState=t,t}if(this._flushOnRead>0)for(let n=t.length-1;n>=0;n--)t[n]._isFlushedBy(e)&&t[n]._flush();return t[t.length-1].getState(e)}getCurrentCommit(e=!0){return(e?this._pending?.commit:null)??this._current.commit}getTipCommit(){return this._commits.get(this._tipId).commit}getVersionId(e){return s(e),this._states.get(e)?.version??0}restore(e,t){let n=this._getCommitContainer(e,t);if(this._current.commit.getId()===n.commit.getId())return n.commit;let r=i(n.record.states,this._current.record.states);this._notifyStates(`onBeforeCommitStart`,this._current,r,!0,!1,!1,n);let a=this._current.commit;this._current=n,this._states=this._current.record.states,this._cacheId=null,this._cacheState=null,this._notifyStates(`onAfterStateChange`,n,r,!1,!0,!0,n,a),this._notify(`onCommitChange`,n.commit,!0),this._restoring=!0;try{this._notifyStates(`onRestoreOrRevert`,n,n.record.states,!1,!0)}finally{this._restoring=!1}return n.commit}revert(e,t){let n=this._getCommitContainer(e,t),r=this._commits.get(n.record.previousId);if(!r)throw Error(`Invalid commit id: '${n.record.previousId}'`);let a=i(r.record.states,this._current.record.states);this._notifyStates(`onBeforeCommitStart`,this._current,a,!0,!1,!1,n);let o=this._current.commit;this._current=r,this._states=this._current.record.states,this._cacheId=null,this._cacheState=null,this._notifyStates(`onAfterStateChange`,r,a,!0,!1,!0,n,o),this._notify(`onCommitChange`,r.commit,!0),this._restoring=!0;try{this._notifyStates(`onRestoreOrRevert`,r,r.record.states,!0,!0,!1,n)}finally{this._restoring=!1}return r.commit}_getCommitContainer(e,t){let n=this._commits.get(e);if(!n)throw Error(`Invalid commit id: '${e}'`);if(this._isTransient)throw Error(`Cannot revert transient store`);if(t?.force&&this._transactionStack.length>0&&this._transactionStack[0].rollback(),this._transactionStack.length!==0)throw Error(`Open transactions.`);return n}_pruneForwards(e){let t=this._tipId;for(;t&&t!==e;){let e=this._commits.get(t);if(!e)break;this._commits.delete(t),t=e.record.previousId}}_trimOldest(){if(this._commits.size<=this._maxCommits)return;let e=this._commits.keys();for(;this._commits.size>this._maxCommits;)this._commits.delete(e.next().value);let t=this._commits.get(e.next().value);t&&(t.record.previousId=null)}beginCommit(t,n){let r=this._transactionStack;r.length>0&&r[r.length-1]._flush();let i=r.length;typeof t==`string`&&(t={description:t});let a=t?.expectedCommitId;if(a!==void 0){let e=this._current.record.id;if(i>0||this._restoring)throw new c(`open`,a,e);if(e!==a)throw new c(`stale`,a,e)}if(this._locked)throw console.warn(`TransactionStore locked`,r),Error(`TransactionStore is locked by '${r[i-1].getDescription()}`);let o=t?.preventFurtherTransactions,s=this,l=(e,t,r)=>{let a=s._transactionStack;i!==a.length-1&&console.warn(`Transaction stack out of sync`,i,a.length,a),o&&(this._locked=!1),a.pop(),e._isFlushedOnRead()&&s._flushOnRead--,n?.(e,t,r),a.length===0&&(s._pending=null,s._notifyClose(e._getCommit(),t,e._isElided(),e._isAmendClose()))},d;if(r.length===0){let n=this._current.record,r={states:new Map,id:e.uuidV4(),description:typeof t==`string`?t:t?.description??null,meta:{},timestamp:Date.now(),author:(typeof t==`object`?t?.author:void 0)??this._author??null,version:n.version+1,previousId:n.id,intents:{},intentWrites:[],operation:t?.operation},i={record:r,commit:new u(r)};this._pending=i,this._notify(`onCommitStart`,i.commit),d=new p(this,i,n?.states,t,l)}else d=r[r.length-1].beginTransaction(t,l);return o&&(this._locked=!0),this._transactionStack.push(d),d._isFlushedOnRead()&&this._flushOnRead++,d}doBatch(e,t,n){let r,i=this.beginCommit(t,n),a=this.getCurrentCommit();try{r=e?.(a);let n=()=>{i.commit(t)};if(r&&typeof r.then==`function`)return new Promise((e,t)=>{r.then(r=>{try{n(),e(r)}catch(e){t(e)}}).catch(e=>{i.rollback(),t(e)})});n()}catch(e){throw i.rollback(),e}return r}remove(e){s(e);let t=!1,n=this._listenersState.get(e);if(n){let r=this.getCurrentCommit();n.forEach(e=>{e.onClose?.(r)}),this._listenersState.delete(e),t=!0}this._current.record.states.delete(e)&&(t=!0),this._commits.forEach(n=>{n.record.states.delete(e)&&(t=!0)});let r=this._transactionStack;return r.length>0&&r[0]._purgeState(e),this._cacheId=null,this._cacheState=null,t}addListener(e){let t=this._listeners;return t.add(e),()=>{t.delete(e)}}addStateListener(e,t){if(s(e),!t)throw Error(`Listener is required`);let n=this._listenersState.get(e);return n||(n=new Set,this._listenersState.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this._listenersState.delete(e)}}dispatchEvents(e,t=!1){!t||this._isSync?e():setTimeout(e,0)}_commitRecord(t,n,r){let i=t.record,a=t.commit,o=t,s=++this._versionCounter;if(n.forEach((e,t)=>{e!=null&&((e,t,n)=>{Object.defineProperty(e,"id",{value:t,enumerable:!1,configurable:!0,writable:!1}),Object.defineProperty(e,"version",{value:n,enumerable:!1,configurable:!0,writable:!1})})(e,t,s)}),!this._isTransient){let n=!1;if(r!==null){let s=this._current,c=this._commits.get(r)??s,u=c.record,d=c!==s,f=d?u.states:s.record.states;if(i.states.forEach((e,t)=>{f.set(t,e)}),l(u.intents,i.intentWrites),u.meta={...u.meta,...i.meta},u.timestamp=i.timestamp,n=!0,d)return void(o.record.intentWrites=e.EmptyArray);i=s.record,a=s.commit,t=s}this._commits.set(i.id,t),n||(i.previousId!==this._tipId&&this._pruneForwards(i.previousId),this._tipId=i.id,this._trimOldest())}this._current=t,this._states=this._current.record.states,this._cacheId=null,this._cacheState=null,o.record.intentWrites=e.EmptyArray,r===null&&this._notify(`onCommitChange`,a);let c=i.previousId?this._commits.get(i.previousId)?.commit??null:null;this._notifyStates(`onAfterStateChange`,t,n,!1,!1,!0,o,c),this._notify(r===null?`onCommitEnd`:`onAmendEnd`,a,!0)}_notifyStates(e,t,n,r=!1,i=!1,a=!1,o=t,s=null){let c=t.commit,l=o.record.intents,u=this._listenersState;n.forEach((t,n)=>{let o=u.get(n);o&&this.dispatchEvents(()=>{o.forEach(n=>{n[e]?.(t,c,r,i,l,s)})},a)})}_notifyClose(e,t,n=!1,r=!1){this._listeners.forEach(i=>{i.onCommitClose?.(e,t,n,r)})}_notify(e,t,n=!1){return this.dispatchEvents(()=>{this._listeners.forEach(n=>{n[e]?.(t)})},n)}},f=class{constructor(e,t,n){if(this._children=new Set,this._depth=0,this._closed=!1,this._isAmend=!1,this._readOnly=!1,this._hooks=null,this._flushing=!1,this._outcomes=null,this._intentMark=-1,this._store=e,this._container=t,n=typeof n==`string`?{description:n}:n,this._description=n?.description??``,this._operation=n?.operation??null,this._readOnly=n?.readOnly??!1,n?.flush||n?.onCommit||n?.onRollback||n?.onChildCommit){let e={flush:n.flush,writes:n.writes,onCommit:n.onCommit,onRollback:n.onRollback,onChildCommit:n.onChildCommit};this._hooks=e,(e.onCommit||e.onRollback)&&(this._outcomes=[e])}}_isFlushedOnRead(){return!(!this._hooks?.flush||!this._hooks.writes?.length)}_isFlushedBy(e){let t=this._hooks?.writes;return!!t&&t.includes(e)}_flush(){let e=this._hooks?.flush;if(e&&!this._flushing){this._flushing=!0;try{e()}finally{this._flushing=!1}}}_settle(e){let t=this._children;for(;t.size>0;)t.values().next().value.commit(e);this._flush()}_adoptOutcomes(e){let t=e._outcomes;if(t){if(this._outcomes)for(let e=0;e<t.length;e++)this._outcomes.push(t[e]);else this._outcomes=t}}_childCommitted(e){let t=this._hooks?.onChildCommit;if(!t)return;let n={};l(n,this._container.record.intentWrites,e._intentMark),t(e,n)}_notifyOutcome(e){let t=this._outcomes;if(t){this._outcomes=null;for(let n=0;n<t.length;n++)try{e?t[n].onCommit?.(e):t[n].onRollback?.()}catch(e){console.warn(e)}}}_getCommit(){return this._container.commit}_isElided(){return!1}_setAmendOf(e){this._container.amendOf=e}_isAmendClose(){return this._isAmend||this._container.amendOf!==void 0}getIntent(e){return this._container.record.intents?.[e]}setIntent(e,t){let n=this._container.record,r=n.intents??={};r[e]=typeof t==`function`?t(r[e]):t,(n.intentWrites??=[]).push([e,t])}getDepth(){return this._depth}getDescription(){return this._description}getOperation(){return this._operation}getStates(){return this._states}beginTransaction(e,t){this._ensureOpen();let n=new m(this._store,this,this._container,typeof e==`string`?{description:e}:e,t);return this._hooks?.onChildCommit&&(n._intentMark=this._container.record.intentWrites.length),this._children||this._children,this._children.add(n),n}isReadOnly(){return this._readOnly}updateState(e,t){if(this._ensureOpen(),s(e),this._readOnly)throw Error(`Transaction is read-only`+(this._description?`: '${this._description}'`:``));let n=this.getState(e),r;if(typeof t==`function`){if(r=t(n),r===n)return n;r&&={...r}}else{if(t===void 0)return n;r={...n,...t}}if(r){let t=this._states;t||(t=new Map,this._states=t),t.set(e,r)}return r}amend(e){return this._isAmend=!0,this.commit(e)}commit(t){return this._ensureOpen(),typeof t==`string`&&(t={description:t}),t&&(t.description&&(this._description=t.description),t.meta&&(this._meta=e.mergeContentful(t.meta,this._meta))),this._children&&this._children.forEach(e=>{e.commit(t)}),this}isClose(){return this._closed}_ensureOpen(){if(this._closed)throw this._descriptions?console.warn(`stack: [${this._descriptions.join(`,`)}]`):this._description&&console.warn(`description: [${this._description}]`),Error(`Transaction already closed`)}_removeChild(e,t=!1){this._children.delete(e),t||this._mergeStates(e._states)}_purgeState(e){this._states?.delete(e),this._children.forEach(t=>{t._purgeState(e)})}_mergeStates(e){if(!e||e.size===0)return;let t=this._states;return t?(e.forEach((e,n)=>{t.set(n,e)}),t):(this._states=e,e)}get isITransaction(){return!0}},p=class extends f{constructor(e,t,n,r,i){super(e,t,r),this._retargeted=!1,this._elided=!1,this._prevStates=n,this._onClose=i,this._states=new Map,this._meta=t.record.meta}_isElided(){return this._elided}_retarget(e){this._prevStates=e.record.states,this._retargeted=!0}_isRetargeted(){return this._retargeted}getId(){return this._container.commit.getId()}getSavepointId(){return this.getId()}getParent(){return this}commit(e){this._ensureOpen(),this._settle(e);let t=this._states,n=this._container;if(this._store._notifyStates(`onBeforeCommitStart`,n,t,!1,!1),super.commit(e),this._states.size===0)return this._closed=!0,this._elided=!0,this._onClose?.(this,!1,e),this._notifyOutcome(n.commit),this;this._store._notifyStates(`onBeforeCommitEnd`,n,t,!1,!1),this._settle(e);let r=new Map(this._prevStates);this._states.forEach((e,t)=>{e===null?r.delete(t):r.set(t,e)}),this._states=r,this._description&&(n.record.description=this._description),this._meta&&(n.record.meta=this._meta),n.record.states=r,this._closed=!0,this._onClose?.(this,!1,e);let i=n.amendOf??(this._isAmend?n.record.previousId:null);return this._store._commitRecord(n,t,i),this._notifyOutcome(n.commit),this}rollback(){return this._ensureOpen(),this._children&&this._children.forEach(e=>{e.rollback()}),this._notifyOutcome(null),this._closed=!0,this._onClose?.(this,!0,null),this}updateState(e,t){let n=this.getState(e),r=super.updateState(e,t);return r===n||this._states.set(e,r),r}getState(e){s(e);let t=this._states.get(e);return t||=this._prevStates.get(e),t}},m=class extends f{constructor(e,t,n,r,i){if(super(e,n,r),this._savepointId=null,!t)throw Error(`Parent transaction required`);this._parent=t,this._depth=this._parent.getDepth()+1,!1!==(typeof r==`string`?void 0:r?.savepoint)&&(this._savepointId=`${t.getId()}:${++o}`),t.isReadOnly()&&(this._readOnly=!0),this._onClose=i}getId(){return this._parent.getId()}getSavepointId(){return this._savepointId??this._parent.getSavepointId()}getParent(){return this._parent}getState(e){if(this._states){let t=this._states.get(e);if(t!==void 0)return t}return this._parent.getState(e)}commit(e){return this._ensureOpen(),this._settle(e),super.commit(e),this._parent._removeChild(this),this._parent._adoptOutcomes(this),this._closed=!0,this._onClose?.(this,!1,e),this._intentMark>=0&&this._parent._childCommitted(this),this._parent??this}rollback(){return this._ensureOpen(),this._children&&this._children.forEach(e=>{e.rollback()}),this._notifyOutcome(null),this._parent._removeChild(this,!0),this._closed=!0,this._onClose?.(this,!0,null),this._parent??this}},h=class e{constructor(e){this._closed=!1,this._commitId=null,this._stepListeners=null,this._toWrapped=new WeakMap,this._methods=new WeakMap,this._callbacks=new WeakMap,this._outward=new WeakMap,this._inward=new WeakMap,this._store=e}getStore(){return this._store}getCommitId(){return this._commitId}isClosed(){return this._closed}close(){this._closed||(this._closed=!0,this._stepListeners&&b(this._store,-1),this._stepListeners=null)}addStepListener(e){return this._closed?M:(this._stepListeners||(this._stepListeners=new Set,b(this._store,1)),this._stepListeners.add(e),()=>{this._stepListeners?.delete(e)})}_onStep(e,t){let n=this._stepListeners;if(n&&n.size!==0)for(let r of[...n])r(e,t)}wrap(e){if(typeof e==`function`)return this._wrapFunction(e,!0);if(typeof e!=`object`||!e)return e;let t=e;if(_.has(t))return e;let n=this._toWrapped.get(t);return n===void 0?t instanceof Promise?t.then(e=>this.wrap(e)):Array.isArray(t)?this._wrapArray(t):T(t)?this._wrapModel(t):O(t)?this._wrapIterator(t):e:n}unwrap(e){if(typeof e!=`object`||!e)return e;let t=e,n=g.get(t);return n===void 0?Array.isArray(t)?k(t):Object.getPrototypeOf(t)===Object.prototype?A(t):e:n}_wrapModel(e){let t=this,n=new Proxy(e,{get(e,n){let r=Reflect.get(e,n,e);if(r===null||typeof r!=`object`&&typeof r!=`function`)return r;let i=Object.getOwnPropertyDescriptor(e,n);return!i||i.configurable||i.writable?typeof r==`function`?t._wrapMethod(e,r):t.wrap(r):r},set:(e,n,r)=>Reflect.set(e,n,t.unwrap(r),e)});return this._toWrapped.set(e,n),g.set(n,e),_.set(n,this),n}_wrapMethod(e,t){let n=this._methods.get(e);n||(n=new Map,this._methods.set(e,n));let r=n.get(t);if(r)return r;let i=this;return r=function(...n){let r=n.length;for(let e=0;e<r;e++)n[e]=i._unwrapArg(n[e]);return i._inScope(()=>i.wrap(t.apply(e,n)))},n.set(t,r),r}_unwrapArg(e){return typeof e==`function`?this._wrapFunction(e,!1):typeof e!=`object`||!e||Object.getPrototypeOf(e)!==Object.prototype||g.has(e)?this.unwrap(e):this._unwrapCallbacks(e)}_unwrapCallbacks(e){let t=!1;for(let n in e)if(typeof e[n]==`function`){t=!0;break}if(!t)return this.unwrap(e);let n=this._callbacks.get(e);if(n)return n;let r={};for(let t in e){let n=e[t];r[t]=typeof n==`function`?this._wrapFunction(n,!1):this.unwrap(n)}return this._callbacks.set(e,r),r}_wrapFunction(e,t){let n=t?this._outward:this._inward,r=n.get(e);if(r)return r;let i=this;return r=t?function(...t){let n=t.length;for(let e=0;e<n;e++)t[e]=i._unwrapArg(t[e]);return i._inScope(()=>i.wrap(e.apply(i.unwrap(this),t)))}:function(...t){let n=t.length;for(let e=0;e<n;e++)t[e]=i.wrap(t[e]);return i.unwrap(e.apply(i.wrap(this),t))},n.set(e,r),r}_wrapArray(e){let t=e.length>0?e[0]:void 0;return typeof t!=`object`||!t||Array.isArray(t)||!T(t)?e:e.map(e=>this.wrap(e))}_wrapIterator(e){let t=this,n={next(...n){let r=e.next(...n);return r.done?r:{done:!1,value:t.wrap(r.value)}},[Symbol.iterator]:()=>n};return e.return&&(n.return=t=>e.return(t)),n}_inScope(e){if(this._closed)return e();let t=v;v=this;try{return e()}finally{v=t}}static bind(t,n,r){let i=new e(t);return{callback:e=>{i._commitId=e.getId();let t=r(e,i.wrap(n));return t instanceof Promise?t.then(e=>i.unwrap(e)):i.unwrap(t)},close:()=>i.close(),onChildCommit:(e,n)=>{i._onStep(t.getCurrentCommit(),n)}}}static isStepping(e){return(y.get(e)??0)>0}static of(e){return e===null||typeof e!=`object`&&typeof e!=`function`?null:_.get(e)??null}},g=new WeakMap,_=new WeakMap,v=null,y=new WeakMap,b=(e,t)=>{y.set(e,(y.get(e)??0)+t)},x=()=>v,S=e=>v!==null&&v.getStore()===e,C=new WeakMap,w=[`addListener`,`addListeners`,`doBatch`,`getWorkbook`,`getWorksheet`,`update`],T=e=>{let t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype||t===Array.prototype)return!1;let n=C.get(t);return n===void 0&&(n=!E(e)&&D(t),C.set(t,n)),n},E=e=>e instanceof Date||e instanceof RegExp||e instanceof Map||e instanceof Set||e instanceof WeakMap||e instanceof WeakSet||e instanceof Error||e instanceof ArrayBuffer||ArrayBuffer.isView(e),D=e=>{for(let t=0;t<w.length;t++)if(typeof e[w[t]]==`function`)return!0;let t=e;for(;t&&t!==Object.prototype;){let e=Object.getOwnPropertyNames(t);for(let n=0;n<e.length;n++){let r=e[n];if(r.length>3&&r.startsWith(`set`)&&r.charCodeAt(3)>=65&&r.charCodeAt(3)<=90&&typeof Object.getOwnPropertyDescriptor(t,r)?.value==`function`)return!0}t=Object.getPrototypeOf(t)}return!1},O=e=>typeof e.next==`function`&&typeof e[Symbol.iterator]==`function`,k=e=>{let t=null,n=e.length;for(let r=0;r<n;r++){let n=e[r];if(typeof n!=`object`||!n)continue;let i=j(n);i!==n&&(t??=e.slice(),t[r]=i)}return t??e},A=e=>{let t=null;for(let n in e){let r=e[n];if(typeof r!=`object`||!r)continue;let i=j(r);i!==r&&(t??={...e},t[n]=i)}return t??e},j=e=>{let t=g.get(e);return t===void 0?Array.isArray(e)?k(e):Object.getPrototypeOf(e)===Object.prototype?A(e):e:t},M=()=>{},N=(e,t,...n)=>{let r=globalThis.__SXL_LOG_EVENTS;r&&(typeof r!=`string`||e.includes(r))&&console.log(`[sxl:${e}] ${t}`,...n)},P=class{constructor(e,t){this._listeners=new Set,this._pending=null,this._landing=null,this._listeners=new Set,this._transactions=t??new d({transient:!0}),this._stateId=this._transactions.create(),this._src=e;let n=this,r=()=>{let e=n._landing;if(N(n._label(),`drain landing=${e?e.length:`null`}`),!e)return;n._landing=null;let t=new Set,r=e.length,i=null;for(let t=0;t<r;t++){let n=e[t].options,r=n?.merge;if(!r)continue;i??=new Map;let a=e[t].listeners;for(let e=0;e<a.length;e++){let t=a[e];i.set(t,i.has(t)?r(i.get(t),n.params):n.params)}}for(let a=0;a<r;a++){let r=e[a];n._doNotify(r.listeners,r.removes,r.options,t,i)}};this._transactionsRemoveListener=this._transactions.addListener({onCommitClose(e,t,i){let a=n._pending;N(n._label(),`commitClose rollback=${t} elided=${i} pending=${a?a.length:`null`}`),n._pending=null,t||(a&&(n._landing?n._landing.push(...a):n._landing=a),i&&r())},onCommitEnd:r,onAmendEnd:r})}_label(){return this._src?.constructor?.name??`unknown`}_inOperation(){return this._transactions.isOpenTransaction()||this._transactions.isRestoring()}addListeners(e,t){let n=t?.transactional??S(this._transactions),r={listeners:e},i=this,a=()=>{n?i._updateEntries(e=>{e.delete(r)}):i._listeners.delete(r)};return r.remove=t?.once?a:null,n?i._updateEntries(e=>{e.add(r)}):i._listeners.add(r),a}_updateEntries(e){let t=this._transactions,n=t.getState(this._stateId)?.listeners,r=new Set(n);e(r);let i=t.beginCommit();try{i.updateState(this._stateId,{listeners:r}),i.amend()}catch(e){throw i.rollback(),e}}async _doNotify(e,t=null,n,r,i){let a=n?.source??this._src,o=[],s=n?.params,c=e.length;for(let t=0;t<c;t++){let n=e[t];r&&r.has(n)||(r?.add(n),o.push(n(a,i?.has(n)?i.get(n):s)))}let l=null;if(t&&(l=()=>{let e=t.length;for(let n=0;n<e;n++)t[n]()}),n?.async)return new Promise(async(e,t)=>{try{let t=await Promise.all(o);l?.(),e(t)}catch(e){l?.(),t(e)}});l?.()}hasTransactional(e){let t=this._transactions.getState(this._stateId)?.listeners;if(!t||t.size===0)return!1;for(let n of t)if(n.listeners[e])return!0;return!1}_collect(e,t){if(!e)return null;let n=null,r=null;return e.forEach(e=>{let i=e.listeners[t];i&&((n??=[]).push(i),e.remove&&(r??=[]).push(e.remove))}),n?{listeners:n,removes:r}:null}notify(e,t){let n=this._transactions,r=t?.transactional??this._inOperation();if(r){let r=this._collect(n.getState(this._stateId)?.listeners,e);r&&this._doNotify(r.listeners,r.removes,t)}let i=this._collect(this._listeners,e);if(i)return!r||n.isRestoring()||t?.async?(N(this._label(),`notify ${String(e)} delivered to ${i.listeners.length}`),this._doNotify(i.listeners,i.removes,t)):((this._pending??=[]).push({listeners:i.listeners,removes:i.removes,options:t}),void N(this._label(),`notify ${String(e)} QUEUED (open transaction) pending=${this._pending.length}`));N(this._label(),`notify ${String(e)} inOperation=${r} listeners=0`)}close(){this._transactions.remove(this._stateId),this._transactionsRemoveListener(),this._listeners.clear(),this._pending=null,this._landing=null}},F=`Item has been closed. No further operations are allowed.`,I=(e=t(`op.update`))=>r(`error.anchor.protected`,{description:r(e)}),L=class{constructor(e){this._closed=!1,this._options={...e};let t=this;this._transactions=this._options?.transactions??new d({transient:!0}),this._id=this._transactions.create({isDeleted:!1}),this._emitter=new P(this,this._transactions),e?.json&&this._fromJSON(e.json),this._options?.setContainerReadOnlyCallback?.(()=>{t._processOnContainerReadOnly()}),this._transactionsRemoveListener=this._transactions.addStateListener(this._id,{onAfterStateChange(e,n){t._processAfterStateChange(e,n)},onRestoreOrRevert(e,n){t._processRestoreOrRevert(e,n)}}),this._processInit()}_fromJSON(e){}isReadOnly(){return this._options.isReadOnly?.()??!1}isDeleted(){let e=this._getState();return e===void 0||(e.isDeleted??!1)}getType(){return this._options.type}get isIModel(){return!0}_processTransactionDone(e){}_getActionDescription(e){return null}_getState(){if(this._closed)throw Error(r(`error.model.modelClosed`));return this._transactions.getState(this._id)}_beginCommit(e){return this._transactions.beginCommit(typeof e==`string`?{description:e}:e)}_getTransactions(){return this._transactions}_updateState(e,t,n){return this._writeState(e,t,n,!1)}_amendState(e,t,n){return this._writeState(e,t,n,!0)}_writeState(e,t,n,i=!1){if(this._closed)throw Error(r(`error.model.modelClosed`));if(!e)return this;let a=this._beginCommit(t?.description);try{a.updateState(this._id,e);let r=!1,o=n?n.length:0;for(let e=0;e<o;e++){let t=n[e];r||=t===`onAnyChange`,this._emitter.notify(t)}!r&&n&&o>0&&this._emitter.notify(`onAnyChange`),i?a.amend(t):a.commit(t)}catch(e){throw a.rollback(),e}return this}_getEmitter(){return this._emitter}_processInit(){}_processAfterStateChange(e,t){}_processRestoreOrRevert(e,t){this._emitter.notify(`onInvalidated`)}delete(e){this._getState().isDeleted||this._delete(e)}_delete(e){e={description:this._getActionDescription(`delete`)??t(`op.delete`),...e};let n=this._beginCommit(e?.description);try{this._options.deleteFromContainer&&this._options.deleteFromContainer?.(e),this._processDelete(),n.commit()}catch(e){throw n.rollback(),e}}_processOnContainerDeleted(){this._processDelete()}_processDelete(){this._updateState({isDeleted:!0},void 0,[`onDelete`])}_processOnContainerReadOnly(){this._emitter.notify(`onReadOnlyChange`)}addListeners(e,t){return this._emitter.addListeners(e,t)}getId(){return this._id}getVersionId(){return this._transactions.getVersionId(this._id)}beginCommit(e){return this._beginCommit(e)}doBatch(e,t){let n=this;return this._transactions.doBatch(e,typeof t==`string`?{description:t}:t,e=>{n._processTransactionDone(e)})}isClosed(){return this._closed}close(){this._closed||(this._emitter.notify(`onClose`),this._closed=!0,this._transactionsRemoveListener?.(),this._transactions.remove(this._id))}},R=class e extends L{static{this.instanceCounter=0}constructor(t){super(t),this._watches=new Set,this._watchesReleased=!1,this._getMovable=t.getMovable??null,this._addWatchOption=t.addWatch??null,this._getRangeOption=t.getRange??null;let n=t.name??null;!n&&this._getMovable&&(n=`${this.getTypeDescription()} ${++e.instanceCounter}`);let r=t.description??null;n===null&&r===null||this._updateState({name:n,description:r})}getName(){return this._closed?null:this._getState()?.name??null}setName(e){let n={description:t(`op.setMovableName`)};return this._protectionCheck(n.description),this._updateState({name:e},n,[`onAnyChange`]),this}getDescription(){return this._closed?null:this._getState()?.description??null}setDescription(e){let n={description:t(`op.setMovableDescription`)};return this._protectionCheck(n.description),this._updateState({description:e||null},n,[`onAnyChange`]),this}getMovable(){return this._getMovable?.()??null}getReferences(){if(this._closed||this._watchesReleased||this._watches.size===0)return null;let e=[],t=new Set;for(let n of this._watches){let r=n.formula?.getReferences()??this._parseReference(n.expression);if(!r)continue;let i=r.getCount();for(let n=0;n<i;n++){let i=r.at(n);if(i.isInvalid())continue;let a=`${i.getWorksheet().getId()}!${i.getAddress()}`;t.has(a)||(t.add(a),e.push(i))}}return e.length===0?null:e[0].getWorksheet().getRanges(e)}_addWatch(e,t,n){let r=typeof e==`string`?e:e.getExpression(),i={expression:r.startsWith(`=`)?r.substring(1):r,formula:null,callback:t,options:n,release:null};return this._watches.add(i),this._watchesReleased||this._hold(i,typeof e==`string`?void 0:e),()=>{this._watches.delete(i)&&(i.release?.(),i.release=null,this._notifyReferencesChange())}}_resolveRange(e){return this._getRangeOption?.(e)??null}_hold(e,t){let n=this._addWatchOption;n&&(e.release=n(t??e.expression,t=>{e.formula=t.formula,e.expression=t.formula.getExpression(),e.callback?.(t),this._notifyReferencesChange()},e.options))}_parseReference(e){if(!e||e.includes(`#REF!`))return null;try{let t=e.includes(`!`)?null:this.getMovable()?.getRange().getWorksheet(),n=t?t.getRange(e):this._resolveRange(e);return n&&!n.isInvalid()?n.getWorksheet().getRanges([n]):null}catch{return null}}_notifyReferencesChange(){this._closed||(this._emitter.notify(`onReferencesChange`),this._emitter.notify(`onAnyChange`))}_releaseWatches(){this._watchesReleased=!0;for(let e of this._watches)e.release?.(),e.release=null}_holdWatches(){this._watchesReleased=!1;for(let e of this._watches)this._hold(e,e.formula??void 0)}_processDelete(){this._releaseWatches(),super._processDelete()}_processRestoreOrRevert(e,t){super._processRestoreOrRevert(e,t);let n=e===void 0||!0===e.isDeleted;n&&!this._watchesReleased?this._releaseWatches():!n&&this._watchesReleased&&this._holdWatches()}_getSourceId(){let e=this._getState()?.data;return typeof e?.sourceId==`number`?e.sourceId:void 0}_ensureSourceId(e){let n=this._getSourceId();if(n!==void 0)return n;let r=e(),i=this._getState()?.data??{};return this._updateState({data:{...i,sourceId:r}},{description:t(`op.connectShape`)}),r}_protectionCheck(e){if(this.isReadOnly())throw new n(I(e))}};export{R as a,h as c,P as i,x as l,I as n,S as o,L as r,d as s,F as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./CQukCzhuewMuFOlO.js";import{
|
|
1
|
+
import{i as e}from"./CQukCzhuewMuFOlO.js";import{ja as t,ji as n,jr as r}from"./BwYQTcPRDDYIeAA5.js";var i=r.Type,a={SUM:0,COUNT:1,COUNTA:2,AVERAGE:3,MIN:4,MAX:5,PRODUCT:6,"VAR.S":7,VAR:7,"VAR.P":8,VARP:8,"STDEV.S":9,STDEV:9,"STDEV.P":10,STDEVP:10},o=class{constructor(){this._next=1,this._numbers=new Map,this._keys=new Map,this._strings=new Map,this.values=[null]}of(e){if(e==null)return 0;if(typeof e==`number`)return this._number(e);let n=t(e),r=this._keys.get(n);return r===void 0&&(r=this._next++,this._keys.set(n,r),this.values[r]=e),r}fill(e,t){if(e instanceof n&&e._visitColumnRuns((e,n,r,i)=>this._run(t,e,n,r,i)))return;let r=t.length;for(let n of e.entries()){let e=n.coords.rowIndex;e<r&&(t[e]=this.of(n.value))}}_number(e){let t=this._numbers.get(e);return t===void 0&&(t=this._next++,this._numbers.set(e,t),this.values[t]=e),t}_run(e,t,n,a,o){if(!(n instanceof r&&n.codec)){for(let r=a,i=t;r<=o;r++,i++)e[i]=this.of(n.at(r));return}let s=n.codec,c=this._strings.get(s);c||this._strings.set(s,c=new Map);let{types:l,defaultType:u,ints:d,doubles:f,intShift:p,intOffset:m}=n.getViews();for(let r=a,h=t;r<=o;r++,h++){let t=l?l[r]:u;if(t===i.Int32)e[h]=this._number(d[(r<<p)+m]);else if(t===i.Float64)e[h]=this._number(f[r]);else if(t===i.String){let t=d[(r<<p)+m],n=c.get(t);n===void 0&&c.set(t,n=this.of(s.decodeString(t))),e[h]=n}else t===i.Blank?e[h]=0:e[h]=this.of(n.at(r))}}},s=class{constructor(){this.table=[e.BuiltIn.Div0],this._codes=new Map}codeOf(e){let t=this._codes.get(e);return t===void 0&&(t=this.table.length,this.table.push(e),this._codes.set(e,t)),t}},c=(e,t,a)=>{let o=t.types.length,s={ok:!0,numeric:!0},c=(e,n)=>l(t,e,n,a,s);if(!(e instanceof n&&e._visitColumnRuns((e,n,a,o)=>{if(!(n instanceof r&&n.codec)){for(let t=a,r=e;t<=o;t++,r++)c(r,n.at(t));return}let{types:s,defaultType:l,ints:u,doubles:d,intShift:f,intOffset:p}=n.getViews();if(!s&&l===i.Float64)return t.doubles.set(d.subarray(a,o+1),e),void t.types.fill(i.Float64,e,e+o-a+1);for(let r=a,m=e;r<=o;r++,m++){let e=s?s[r]:l;e===i.Int32?(t.ints[m<<1]=u[(r<<f)+p],t.types[m]=i.Int32):e===i.Float64?(t.doubles[m]=d[r],t.types[m]=i.Float64):e!==i.Blank&&c(m,n.at(r))}})))for(let t of e.entries()){let e=t.coords.rowIndex;e<o&&c(e,t.value)}return s},l=(t,n,r,a,o)=>{if(r!=null){switch(typeof r){case`number`:t.doubles[n]=r,t.types[n]=i.Float64;return;case`string`:t.types[n]=i.String,o.numeric=!1;return;case`boolean`:t.types[n]=r?i.True:i.False,o.numeric=!1;return}if(e.isError(r))return t.ints[n<<1]=a.codeOf(r),void(t.types[n]=i.Error);o.ok=!1}},u=(t,n,a)=>{let o=a.table,s=new r(((e,t,n,r)=>{let a=!!(r&r-1),o=1<<i.Blank|1<<i.False|1<<i.True;return{buffer:e,byteOffset:t,length:n,width:r&1<<i.Float64?8:4,defaultType:a?i.Blank:31-Math.clz32(r),typeMask:r,hasTypes:a,hasSlots:(r&~o)!==0}})(t,n.ptr(),n.length(),n.type_mask()),{isError:()=>!1,encodeString:()=>0,decodeString:()=>null,encodeError:()=>0,decodeError:e=>o[e]??null});return t=>{let n=s.at(t)??null;return typeof n!=`number`||Number.isFinite(n)?n:e.BuiltIn.Num}},d=(e,t)=>`${e}|${t.join(`,`)}`,f=class{constructor(e,t){this._json=e,this._values=new Map(e.values),this._mode=t}getDataFields(){return this._json.dataFields}getFields(){return this._json.fields}getValue(t,n){let r=this._json.fields,i=[];for(let e=0;e<r.length;e++){let t=r[e].page,a=n.get(e);if(t===void 0)i.push(a??-1);else if(a!==void 0&&a!==t)return}let a=d(t,i);return this._mode===`blocked`?a===this._json.block?.first?e.BuiltIn.Spill:void 0:this._mode===`wanted`?void 0:this._values.get(a)}isComputed(){return!1!==this._json.computed}},p={placed:new WeakMap,blocked:new WeakMap,wanted:new WeakMap},m=(e,t=`placed`)=>{let n=p[t],r=n.get(e);return r||(r=new f(e,t),n.set(e,r)),r};export{c as a,l as c,m as i,u as n,a as o,d as r,o as s,s as t};
|