@sheetxl/studio-vanilla 0.8.0-beta.2 → 0.8.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (359) hide show
  1. package/browser/cjs/{DIdPQwECld6gubdK2.cjs → 6V1LlorEUj_nSWnU.cjs} +1 -1
  2. package/browser/cjs/9Fb0mL7xhqVmVTQp.cjs +3 -0
  3. package/browser/cjs/{CKEselBM-qmMpQBW2.cjs → BFR2qcJJZqIGySId2.cjs} +2 -2
  4. package/browser/cjs/BItTNeA_ukOziuTp.cjs +41 -0
  5. package/browser/cjs/Be5j4deP5deGlAPe2.cjs +1 -0
  6. package/browser/cjs/{BQWmn92gYmxC8eWt.cjs → BhmvJA5P78JScqAa.cjs} +1 -1
  7. package/browser/cjs/{DLtFM988NCD-jeBV.cjs → Bj3YkKmVIoQ3YtYm.cjs} +4 -4
  8. package/browser/cjs/{C19UoK2TTtKU_faS.cjs → BqfmTrd9tnu_owvN.cjs} +1 -1
  9. package/browser/cjs/{DZBKNR9xUMTHWS_D.cjs → BtrnAiRF11y21NX4.cjs} +1 -1
  10. package/browser/cjs/CClH6iclautDoj8x2.cjs +1 -0
  11. package/browser/cjs/{GPlG4lbMP89VDHYJ.cjs → CIDcABwPAtKB7XVf.cjs} +3 -3
  12. package/browser/cjs/{Dg3GaW0QWwnlqetX2.cjs → CJK0UKBYYLMe5y7n2.cjs} +1 -1
  13. package/browser/cjs/{Bo7EQ8niKmwtAwo_2.cjs → CLHQ0mEi1NKau4Fd2.cjs} +1 -1
  14. package/browser/cjs/{CtsduUtTrkcWM02v.cjs → CMOeL2fuTqmW07BD.cjs} +199 -199
  15. package/browser/cjs/{BLAG3kDSthU0SH-E.cjs → CQd4PPsP2BuocLDM.cjs} +2 -2
  16. package/browser/cjs/{D_IilnLuy_hDaBmI.cjs → CRplh7TkT0zSJ0-T.cjs} +1 -1
  17. package/browser/cjs/{D5Gp16-G3pjMtypl2.cjs → CSWmGDsxPB7HVJiO2.cjs} +1 -1
  18. package/browser/cjs/{9vk-L6rRvx20jeQj.cjs → Cj57ZO62uLbSZ0gK.cjs} +1 -1
  19. package/browser/cjs/{C_T-ehCAzjaVRmTk.cjs → CjqMMBQ8Kk0moB_z.cjs} +1 -1
  20. package/browser/cjs/CnZ9pMlpPsqEhbLB2.cjs +1 -0
  21. package/browser/cjs/CpSKXzK-k_sOImbA.cjs +54 -0
  22. package/browser/cjs/{CTDN-AYeejrfopDC.cjs → CuANpK3BdrKl4Yhe.cjs} +1 -1
  23. package/browser/cjs/{DHMQnssVXWjGBSs-.cjs → Cw4BDzyIt0BkEzuh.cjs} +1 -1
  24. package/browser/cjs/D689Ek3LK_7M1YS9.cjs +14 -0
  25. package/browser/cjs/{ibvsavYh4kU-xxL8.cjs → D6OTRWh1ys5CR_lb.cjs} +1 -1
  26. package/browser/cjs/DDvxqFQeKcwQCcgl2.cjs +1 -0
  27. package/browser/cjs/{DA0nGLC0bEkOhh7G2.cjs → DOQTjBWUIU3tFiC42.cjs} +1 -1
  28. package/browser/cjs/{9rXsWW4SnEpudhfh.cjs → DOjeFFlUuGZs14pR.cjs} +1 -1
  29. package/browser/cjs/{3a3qEmdJWFXfGW0q.cjs → DRRqcawQ_OlK5O2S.cjs} +1 -1
  30. package/browser/cjs/{D-N5oLosHPjoj-oG.cjs → DW8fGIUUK-oUTjOo.cjs} +1 -1
  31. package/browser/cjs/{TZQc-szdIVnHDH6F.cjs → DggQv_m8hwCk0ZPk.cjs} +2 -2
  32. package/browser/cjs/{CX7VUEYca9dtWS0N.cjs → DjAg1qKbGRcCxZG2.cjs} +1 -1
  33. package/browser/cjs/DlAHUQXBMc-ZTn_c.cjs +32 -0
  34. package/browser/cjs/{Co31kjvOPAAYbeF-.cjs → DniLHjmREpdi1cFx.cjs} +1 -1
  35. package/browser/cjs/{BylqpwnwQYDHIWjX.cjs → DnjrhTDYSGg20fYP.cjs} +1 -1
  36. package/browser/cjs/DoFDjP2FgjU48C712.cjs +1 -0
  37. package/browser/cjs/DqnvNfw5YpO2rdty2.cjs +1 -0
  38. package/browser/cjs/{BdJvn1vLXMZvE-8h.cjs → DrdQTBiFulmvlRaX.cjs} +3 -3
  39. package/browser/cjs/DuQsMI_VBrtewlPT2.cjs +8 -0
  40. package/browser/cjs/DunGPPWyXlG69yIV2.cjs +1 -0
  41. package/browser/cjs/Dw7oGgh_7fEPOoIV2.cjs +3 -0
  42. package/browser/cjs/{DCRe7NqRclU-Jr7p.cjs → DxHsJ5c6KlwGpED6.cjs} +1 -1
  43. package/browser/cjs/LMZmmGBTj9hqFwwu2.cjs +1 -0
  44. package/browser/cjs/{Dg5fR9uTvYHyxOX62.cjs → Ugq14m_1jIROW2RN2.cjs} +2 -2
  45. package/browser/cjs/VSzadbRbgIx_c4Y7.cjs +1 -0
  46. package/browser/cjs/{DsqHxG-lGZxL1XgQ.cjs → ZsgZv9u2bNY2LY78.cjs} +1 -1
  47. package/browser/cjs/{BhcbKFKbSWEavYJm.cjs → axigL4G2Pi0ixZPE.cjs} +2 -2
  48. package/browser/cjs/bojG-rqzdkE9lH_h2.cjs +1 -0
  49. package/browser/cjs/{C-xC6h1TOBr5ZDSe2.cjs → e4jYID_FHS7YL-b22.cjs} +1 -1
  50. package/browser/cjs/{BF8ZxFWyAAnbe4mz.cjs → gsOqF4MyYN9gz4oo.cjs} +2 -2
  51. package/browser/cjs/{CH7BUjrXIKDIE7XE.cjs → hHVT-pzS2bhjFHSL.cjs} +43 -43
  52. package/browser/cjs/ihI3PbaHdmlJLCOt2.cjs +1 -0
  53. package/browser/cjs/index.cjs +1 -1
  54. package/browser/cjs/jW0ar9T4rYfgy_4N.cjs +1 -0
  55. package/browser/cjs/lc_UysVCoJyKATFy2.cjs +1 -0
  56. package/browser/cjs/{DHL7SVvz96-5zSWE2.cjs → nIKxgoGnF7yTmzVB2.cjs} +2 -2
  57. package/browser/cjs/{ClVLjLIRgWqX3Q-F.cjs → pWgqqjBa4jIrxyvw.cjs} +1 -1
  58. package/browser/cjs/{aBulzIf4cHnL7sbw.cjs → ufEYN2m0y5pER93_.cjs} +1 -1
  59. package/browser/cjs/{p3PYFz7cN2z4XQoU.cjs → v4gWTjOVv8h2S0zO.cjs} +1 -1
  60. package/browser/cjs/y4PTOoQv-PlD-vAG2.cjs +1 -0
  61. package/browser/esm/{C6X4CmElTpPxrad6.mjs → 00bUQB6RgRxfotbx.mjs} +1 -1
  62. package/{cdn/assets/BuyRy9BcgPYo8l8W.js → browser/esm/3763dmlGYD95oq8Z.mjs} +264 -264
  63. package/browser/esm/{BIab7njjwaSXjSEP2.mjs → 5FA-4PCi5EIs85WR2.mjs} +2 -2
  64. package/{cdn/assets/nBZATD4yR1W5D4Fi.js → browser/esm/7XkdeYBragcPQQS0.mjs} +1 -1
  65. package/browser/esm/{CTzKk6VuZTohsOIF2.mjs → 7bhO6Xzgwllu2tcj2.mjs} +1 -1
  66. package/browser/esm/{D5Pa9lfPfAcCGj_N.mjs → AwRapR2kwqYVijeW.mjs} +1 -1
  67. package/browser/esm/{LgoljOEffsYkpZZJ2.mjs → B0Z8VrL6RioP-2R02.mjs} +817 -817
  68. package/browser/esm/{bvuPDJZmI2O5oihy2.mjs → B1uljoK1sRsKmI6N2.mjs} +91 -91
  69. package/browser/esm/{j-9DpYsIlTN1mwql.mjs → B3WsFHUqTcKWNGy_.mjs} +5334 -5294
  70. package/browser/esm/{CaTmLXIsIxaOrLcZ.mjs → B5SNHCcrvOdUn7Vu.mjs} +74 -74
  71. package/browser/esm/{Be7--zCnU6JvLkK1.mjs → B6wW3holuLEkDOgD.mjs} +57 -57
  72. package/browser/esm/{B2vjec5TDs2ZJ1eI2.mjs → BCWx6QCIVIKOKt9n2.mjs} +1 -1
  73. package/browser/esm/{BPt7dDNLBsKrZgzO2.mjs → BCYJaBOW6d6KNCuQ2.mjs} +7 -7
  74. package/browser/esm/{C3qSUuVA-FII3rMU2.mjs → BCmGrMte2QyvzkAM2.mjs} +19 -19
  75. package/browser/esm/{R2c8rUTz1GjCQEp-2.mjs → BEsIwguAjJa2eS4g2.mjs} +22 -22
  76. package/browser/esm/{QNvOHujamKYSXWWA2.mjs → BFAAw3m7wW7Wnf8i2.mjs} +1 -1
  77. package/{cdn/assets/CQBSLdAdR53c7BVh.js → browser/esm/BG_6y3dWHiR8LpP-2.mjs} +1 -1
  78. package/browser/esm/{B-Zf8W3s_WXgYxhN.mjs → BJdwKtEOslRkGQhk.mjs} +7 -7
  79. package/browser/esm/{0YKBRd7eLIUmcKns.mjs → BJk7BkFlT-d2_MDc.mjs} +3 -3
  80. package/browser/esm/{Bc8-re9biUn57kdl.mjs → BO6Lz-qmEF5k4ZPU.mjs} +9659 -9661
  81. package/{cdn/assets/DgH-AoqKDdIWg0J8.js → browser/esm/BPh6sTO11J2UoKVG.mjs} +1 -1
  82. package/{cdn/assets/BEYY8z4FusH7S5K-2.js → browser/esm/BQRlxHPPnb-Xp7mx.mjs} +1 -1
  83. package/{cdn/assets/BdCn57ENgiC2kOsF.js → browser/esm/BThp5CcmvMVU7Frk.mjs} +2 -2
  84. package/browser/esm/{BG_hG8jUkf0aMzGK2.mjs → BThp5CcmvMVU7Frk2.mjs} +2 -2
  85. package/{cdn/assets/7lIMFL11BRZrMXdc.js → browser/esm/BUbwA9WVFeKfIV6H.mjs} +1 -1
  86. package/browser/esm/{DmPq6SwNcX1qXKct.mjs → BVri2gMOX526uJV5.mjs} +1 -1
  87. package/browser/esm/{DMMtONCySdMHoaMU.mjs → BYcIifmA2KfISUAD.mjs} +6 -6
  88. package/browser/esm/{9CP_UyAqmAHE7-mv.mjs → BYha1NqMzu8G7ReU.mjs} +7 -7
  89. package/browser/esm/{BuSBBEiK_3KnBr632.mjs → BZiMIYsX6zktg4iD2.mjs} +23 -23
  90. package/browser/esm/{xzoxSwyGoZdH-ysh.mjs → BcZHZLyy1g0r4Qk4.mjs} +23 -23
  91. package/{cdn/assets/DvfekR32WVFv_WrS.js → browser/esm/BcdWHWjggmDQ6_Zx2.mjs} +81 -81
  92. package/browser/esm/{CwDjNuGkKnVtfJo-.mjs → Bd-Kkar9gnLuKTRo2.mjs} +1 -1
  93. package/{cdn/assets/DoCYcvHzw3S0MDCW.js → browser/esm/BeQYgyU20NLEnFql2.mjs} +1 -1
  94. package/browser/esm/{B0aCnXuYD0ZopZdA.mjs → Be_zCt9smEb4NVGF.mjs} +2 -2
  95. package/{cdn/assets/CU1_-PzBC9cDsm5t.js → browser/esm/BfRnXrO08JOzICDf2.mjs} +1 -1
  96. package/{cdn/assets/B0FNPu0uhX_WW-aJ2.js → browser/esm/BfZiZa7P8RpKrStu.mjs} +1 -1
  97. package/browser/esm/{fJ0eqh3Ja3O0z1QL.mjs → BiHOntEpAjSdwJmu.mjs} +12 -12
  98. package/{cdn/assets/jQ5c7MGwQOZq4s5w2.js → browser/esm/BjCuy-yO9BQxUj_22.mjs} +1 -1
  99. package/browser/esm/{BhGgNWNVYntkJYgU.mjs → BnT_figq3Qu4_Tdm.mjs} +12 -12
  100. package/{cdn/assets/13CH9sjvoEqt6nbt.js → browser/esm/BouiFjb9pyWsROiW2.mjs} +1 -1
  101. package/browser/esm/{C1doaJjkCzQlB_3u2.mjs → BqT5uCSFT_HATJJw2.mjs} +1 -1
  102. package/browser/esm/{DeeFxCkhXDF0p1nl.mjs → BranNZUk8WXrCCjb.mjs} +3 -3
  103. package/browser/esm/{DBTB0moKfwOu0F47.mjs → BxrknRRdcnKV7-zU.mjs} +5 -5
  104. package/{cdn/assets/DuijhgjRhgWB9sCY2.js → browser/esm/C62Y8jSQuT2_lqUs.mjs} +240 -228
  105. package/browser/esm/{BJJBFdJaP2dMlug92.mjs → C9-p4koE4kCDp9UL2.mjs} +8 -8
  106. package/{cdn/assets/Bfq8Gdqf3I7y_Hju2.js → browser/esm/C9QsQZR03iUbXGDd.mjs} +1 -1
  107. package/browser/esm/{CYU_-DiQXjh1SEU1.mjs → CByxip-S_IKsaoyZ.mjs} +347 -347
  108. package/{cdn/assets/CAVONPXgoytyiNK-.js → browser/esm/CFKZFbkoc-8gG0EH.mjs} +1 -1
  109. package/browser/esm/{BEWsOD2JQ8dwQCEm2.mjs → CIfWyeqd8SBHxpym2.mjs} +17 -17
  110. package/browser/esm/{eTXmezPFvAwM_L-D2.mjs → CIsuqkDFqRaqaULt.mjs} +1 -1
  111. package/browser/esm/{iYNN3Px9AekrMEfu2.mjs → CMIHnlRJ6ctaJThm2.mjs} +12 -12
  112. package/browser/esm/{Bcjus_Q6f72kE1MK.mjs → CNBdjbsAfeLxOXNu2.mjs} +1 -1
  113. package/browser/esm/{rxlYDHBsenoxRx-K2.mjs → CNO2b9u-Zhj6V2us2.mjs} +6 -6
  114. package/browser/esm/{Cvw3poNlUmn3qAh0.mjs → CP2cFopeWN8lQpif.mjs} +5 -5
  115. package/browser/esm/{DYyxB53T5uaoyInL2.mjs → CPCWNpkZIX3cxPMS2.mjs} +2 -2
  116. package/browser/esm/{Bokc-Wu4XBPWKmdt.mjs → CPgdrQexyUXiviTo.mjs} +1 -1
  117. package/{cdn/assets/BDZAVKSYpcOp9Dve.js → browser/esm/CQi9Ek-nl9QWmoMC2.mjs} +1 -1
  118. package/browser/esm/{DtqMTXq5u5DmS5S1.mjs → CRNpbge-G8dLIqk9.mjs} +2 -2
  119. package/browser/esm/{sfOREE_huDAOcfYs.mjs → CSus1KY0Y1UJN-c6.mjs} +1495 -1495
  120. package/browser/esm/{lHpMVBxqkkCYD6d12.mjs → CVV-QxmM_7vUYzFC.mjs} +1 -1
  121. package/browser/esm/{DHzdEqMCGL_JPh9w2.mjs → CXT9wGUombXj7n-s2.mjs} +11 -11
  122. package/browser/esm/{gAriGKwELet15RCY2.mjs → CZrkJteg0C4_fGBy2.mjs} +10 -10
  123. package/browser/esm/{ep-IjWXOPg2b-REP2.mjs → C_6kPChYiQzj6w3V2.mjs} +1 -1
  124. package/{cdn/assets/yVLsr0rcaOFel2nS.js → browser/esm/ChKDkoQeoZMHq0r72.mjs} +1 -1
  125. package/browser/esm/{DTfDzhFtORWkuoRv.mjs → CiMRlH1xk4i9IiEn.mjs} +1 -1
  126. package/{cdn/assets/DbVSG7Uf7YDQbmc3.js → browser/esm/CiUtfAMZeVao4r9g.mjs} +1 -1
  127. package/browser/esm/{D13sLQRMMKrDHepu.mjs → ClQiq37bto-oxKtL.mjs} +1 -1
  128. package/browser/esm/{AAHsV9V95k39t9SD.mjs → ClrdhQeh_WoBg0Ws2.mjs} +1 -1
  129. package/browser/esm/{txVgXcuMeWVNWHnZ.mjs → CmNtmMkhbzV8j_I0.mjs} +1 -1
  130. package/browser/esm/{V-oO_EfTyth0iptZ2.mjs → Cm_bL9sY_cm-k_Pq.mjs} +1 -1
  131. package/browser/esm/{kcfC6hY47HklE6Om.mjs → CmmaFuVaTfOm96g4.mjs} +11 -11
  132. package/{cdn/assets/Dd80tsdITZsotoCX.js → browser/esm/CqheKk46etN--iuw2.mjs} +1 -1
  133. package/browser/esm/{DeSDYBzD8e5XXnvq.mjs → CqwPCy756gUmUtv1.mjs} +6 -6
  134. package/browser/esm/{BM343UBJqjbDokO62.mjs → CsDejQBEe09RdeRI.mjs} +1 -1
  135. package/browser/esm/{BBaNqp1ZjuO25FQg2.mjs → CsG9IQdgctp6tf2X2.mjs} +1 -1
  136. package/browser/esm/{C1EvC_qPiGiVMrkF.mjs → CxYnCECXc2PyTCrn.mjs} +499 -499
  137. package/{cdn/assets/DjNR_ZGCbg-xia15.js → browser/esm/Cz77LBaC6qe0hPm02.mjs} +1 -1
  138. package/browser/esm/{ZJ32DJlBpN_9fAph.mjs → Cz_f9WxedmIkn2jq.mjs} +3 -3
  139. package/browser/esm/{BVOTzF7NFvB20R7D.mjs → D36mtiddUg8k6tPW.mjs} +2 -2
  140. package/browser/esm/{BOhfbmK18Xj1P7-i.mjs → DCY3GQ5g02kgKrPz2.mjs} +1 -1
  141. package/{cdn/assets/CPgOplnn6NuHwsZ_2.js → browser/esm/DDfhrc6lUmerlDLA2.mjs} +1 -1
  142. package/browser/esm/{B2nEJHcip8raAhdc.mjs → DGjbC2bQDlXZu71U.mjs} +757 -757
  143. package/browser/esm/{yFldtlfN_ASKyMll.mjs → DIHvZTIPYMmuDQO4.mjs} +5 -5
  144. package/browser/esm/{CmSATmXaMlqwTjAe2.mjs → DN6XiWA9mgKCYBL72.mjs} +1 -1
  145. package/browser/esm/{DyPe20tPiPVm1PLe.mjs → DNtf7XnGnTZmf9SF.mjs} +6 -6
  146. package/browser/esm/{XB269tVMhdRHj10G.mjs → DOwrrqcb3f3wDR3B.mjs} +123 -208
  147. package/{cdn/assets/CULlzRLL3s2Dikjg.js → browser/esm/DQXXQ7c_080TSD18.mjs} +1 -1
  148. package/{cdn/assets/WFkg-W8MQ-V6F1Fu.js → browser/esm/DSuOkzhjUeUGtHv8.mjs} +3 -3
  149. package/browser/esm/{D-egzesxukW7Z_e3.mjs → DXuBmWXG49kvaZNr2.mjs} +1 -1
  150. package/{cdn/assets/B_49GiUSgx96vBvq.js → browser/esm/DYoBCnD1PVzOITgb2.mjs} +1 -1
  151. package/{cdn/assets/gCeoOjDjiVaX8dtF.js → browser/esm/D_tGKL5JvKpHg5Se2.mjs} +1 -1
  152. package/browser/esm/{Dz713G5R9JayR5v1.mjs → D_vJszM7OyxfNtiD.mjs} +2 -2
  153. package/browser/esm/{b49cTAZ6BWPQgfYu.mjs → DdNzoOIDRFbcy-qK.mjs} +14 -14
  154. package/browser/esm/{GDYIOITizuJ9xSUf2.mjs → DdSdpckWJszr8vE72.mjs} +13 -13
  155. package/browser/esm/{YC83lJ3yRZP57lBl2.mjs → Di2yc0eSWx4sqa1t2.mjs} +4 -4
  156. package/browser/esm/{Bvy9LWN5UHwJXV9i2.mjs → DiZjLPj4GVJccT-7.mjs} +2 -2
  157. package/browser/esm/{BcHN_VMA7bLNKKMO.mjs → DkUKK8YkXuoIqQIx.mjs} +1914 -1904
  158. package/browser/esm/{CA4eJpge9meoO0rj2.mjs → DmBNtqAUPAi3RnfW2.mjs} +11 -11
  159. package/{cdn/assets/CnvlkxK0pS02Z3gZ.js → browser/esm/Dr3NMWk6K4-HWYsp.mjs} +1 -1
  160. package/browser/esm/{B50P0gSziuG68Umu.mjs → DsGBg42mflMr5nWn.mjs} +1 -1
  161. package/{cdn/assets/C04uI3XsvTc6Cc7w.js → browser/esm/DtFBvTH8ScTC26Xd.mjs} +1 -1
  162. package/browser/esm/{CcK4ACF7d5ogFpAS.mjs → DuwZ5U8z5dBDeSgO.mjs} +8 -8
  163. package/browser/esm/{C3M_lKSZ_Fq1SQOn.mjs → DvFQ4AKUGVQ_qhdP.mjs} +2 -2
  164. package/browser/esm/{04mVsW7CTmUlxnOa.mjs → DvQg18Zd8rnQh20c.mjs} +3 -3
  165. package/browser/esm/{Dn8Z0WK2Hwi8MRnQ.mjs → DwpzhMm9SjvmHEpB.mjs} +1 -1
  166. package/browser/esm/{BnFriW2cIcOJkXU42.mjs → Dz6F8pPCO-Rr6Cab2.mjs} +12 -12
  167. package/{cdn/assets/D1bACCJy4F8kANLy2.js → browser/esm/ERmTt8XRToIi7stb.mjs} +1 -1
  168. package/browser/esm/{CUYBRp4sHMdGwkLT.mjs → I5pKfeOLCqhpzdsw.mjs} +1 -1
  169. package/{cdn/assets/C2JMpa_lWCs9k2ZI.js → browser/esm/Jsx_oA3RHPHgakon.mjs} +174 -174
  170. package/browser/esm/{BCQgeu38866r56Dh.mjs → LOn47j35pLEOdnml.mjs} +5 -5
  171. package/browser/esm/{DkuK8fY8vrl7aZpf2.mjs → LTN_uMk0eLGdRMPd2.mjs} +7 -7
  172. package/browser/esm/{f9r0yTaD2YChFtEg2.mjs → LryKLHFrshlshCEk2.mjs} +1 -1
  173. package/{cdn/assets/LfHB39-nf7mi9XC7.js → browser/esm/N9sXUCWDhn_zpuR2.mjs} +1 -1
  174. package/{cdn/assets/BF842ZtkvebA1LgR2.js → browser/esm/NLHUljnhbCboNbaU.mjs} +1 -1
  175. package/browser/esm/{S2_pz0y2RTJFpXkS.mjs → U7ZDW4cwSiPyirkE.mjs} +1 -1
  176. package/{cdn/assets/CThP3jXwDzLlUOeI2.js → browser/esm/XGGjX0z3ae_AWeTr.mjs} +1 -1
  177. package/{cdn/assets/DtQu3vHaJfA5KM2H.js → browser/esm/_WaFh_cvGeblogUn2.mjs} +1 -1
  178. package/browser/esm/{BZZ2IOkVKppFWNLE.mjs → cVFbVoYZRXdqyfp0.mjs} +5 -5
  179. package/browser/esm/{BBzzLAeBBFbVvgph2.mjs → cwwLkCUZ083FPUTU2.mjs} +2 -2
  180. package/browser/esm/{BTNqElWtYkKW47Vg.mjs → i8BR1tNQSYLz-zpk.mjs} +3 -3
  181. package/browser/esm/index.mjs +4 -4
  182. package/browser/esm/{apjOZ6N9KbmyErGz.mjs → ooXd7RLQr67NrRz9.mjs} +65 -65
  183. package/browser/esm/{Bl5xLu1ou-9zMIBZ2.mjs → p-0E4OSYsnvo4Jvb2.mjs} +1 -1
  184. package/browser/esm/{BA6JMESdvw_1-mFg2.mjs → q4b66GxkR8TkSiGY2.mjs} +17 -17
  185. package/{cdn/assets/Be2-C5U5LlfLTmyo.js → browser/esm/rUQqpcI_WXcsiwea2.mjs} +1 -1
  186. package/{cdn/assets/CjFOk9mcZqAngWD22.js → browser/esm/yg7AU6dKBI7tCqJd2.mjs} +1 -1
  187. package/browser/esm/{BiArrlzwKsOlSm00.mjs → z-KpvdyYTapfvTA-.mjs} +4 -4
  188. package/cdn/assets/{C6X4CmElTpPxrad6.js → 00bUQB6RgRxfotbx2.js} +1 -1
  189. package/cdn/assets/{Be_TDLQucHiVwNvT.js → 0Jeqx95iG9faxIsB.js} +8 -8
  190. package/cdn/assets/{QT-5i27zeGPhkyui2.js → 3o0o7-MzWgSJRADP2.js} +12 -12
  191. package/cdn/assets/{BIab7njjwaSXjSEP.js → 5FA-4PCi5EIs85WR.js} +2 -2
  192. package/cdn/assets/{BNm-ZCOBoBRceGXA2.js → 61OH_HiXgmNuRUDx2.js} +73 -73
  193. package/{browser/esm/nBZATD4yR1W5D4Fi.mjs → cdn/assets/7XkdeYBragcPQQS0.js} +1 -1
  194. package/cdn/assets/{CTzKk6VuZTohsOIF.js → 7bhO6Xzgwllu2tcj.js} +1 -1
  195. package/cdn/assets/{D5Pa9lfPfAcCGj_N2.js → AwRapR2kwqYVijeW2.js} +1 -1
  196. package/cdn/assets/{D6Uwvg4vo1g0pWZa.js → B1eVAWzwtBE6vo-r.js} +2 -2
  197. package/cdn/assets/{588lLflWQypQVzce.js → B3XQHzZTHSzv7fpC.js} +5 -5
  198. package/cdn/assets/{B2vjec5TDs2ZJ1eI.js → BCWx6QCIVIKOKt9n.js} +1 -1
  199. package/cdn/assets/{B66--qmqjDI4V95v2.js → BEcgIVa19rKPTwlt2.js} +8 -8
  200. package/cdn/assets/{QNvOHujamKYSXWWA.js → BFAAw3m7wW7Wnf8i.js} +1 -1
  201. package/{browser/esm/CQBSLdAdR53c7BVh2.mjs → cdn/assets/BG_6y3dWHiR8LpP-.js} +1 -1
  202. package/cdn/assets/{BWtyERLPrUmI8Qbi2.js → BInccbDEuHGg1a2y2.js} +92 -92
  203. package/cdn/assets/{b-o8RUlQpF1RaDgI.js → BJ74o1RxHOu_KTYD2.js} +130 -215
  204. package/cdn/assets/{XFQGB8ADW__0ZBoF2.js → BKrWCWpOpggPjFQq2.js} +3 -3
  205. package/cdn/assets/{BTB79KyzSZf-h-lm2.js → BLKL_d2AFcnL6fbw2.js} +16 -16
  206. package/cdn/assets/{gJT4n5za0DqWXFK12.js → BNSYILHKGtNTW6AH2.js} +22 -22
  207. package/{browser/esm/DgH-AoqKDdIWg0J8.mjs → cdn/assets/BPh6sTO11J2UoKVG.js} +1 -1
  208. package/{browser/esm/BEYY8z4FusH7S5K-.mjs → cdn/assets/BQRlxHPPnb-Xp7mx2.js} +1 -1
  209. package/{browser/esm/7lIMFL11BRZrMXdc2.mjs → cdn/assets/BUbwA9WVFeKfIV6H.js} +1 -1
  210. package/cdn/assets/{Bqe5WbSIlCRYLcqT.js → BVFVnXqCCuycZFnG.js} +4 -4
  211. package/cdn/assets/BVri2gMOX526uJV5.js +24 -0
  212. package/cdn/assets/BVri2gMOX526uJV52.js +24 -0
  213. package/cdn/assets/{CP0M0z_IaCwCMGNS.js → BXV_vaLwr-mEvH-k.js} +7 -7
  214. package/cdn/assets/{_gPnIgVx33slqynA.js → BY7a2KqdhpxV2mYN.js} +2 -2
  215. package/cdn/assets/{BKouftCLbhExXXXU.js → BZpQlzDFTqlBTj8r.js} +124 -125
  216. package/cdn/assets/{COk-0FZl3cv__3yY2.js → BcGLaH5XYmlLx2is2.js} +7 -7
  217. package/cdn/assets/{CwDjNuGkKnVtfJo-2.js → Bd-Kkar9gnLuKTRo.js} +1 -1
  218. package/{browser/esm/DoCYcvHzw3S0MDCW.mjs → cdn/assets/BeQYgyU20NLEnFql.js} +1 -1
  219. package/{browser/esm/CU1_-PzBC9cDsm5t2.mjs → cdn/assets/BfRnXrO08JOzICDf.js} +1 -1
  220. package/{browser/esm/B0FNPu0uhX_WW-aJ.mjs → cdn/assets/BfZiZa7P8RpKrStu2.js} +1 -1
  221. package/cdn/assets/{DPN0a43QHMUmHgo5.js → Bhat781Vzqa1jNlj.js} +3 -3
  222. package/cdn/assets/{CheDxDxt7x0CPz9P.js → BiQlKPbuRw8sLCC5.js} +7 -7
  223. package/cdn/assets/{Dlq2nAMNpWkqjt9Y.js → Bijn-3ZS9ONia1ja.js} +14 -14
  224. package/{browser/esm/jQ5c7MGwQOZq4s5w.mjs → cdn/assets/BjCuy-yO9BQxUj_2.js} +1 -1
  225. package/{browser/esm/CUMu_1tXFa0LPKGV.mjs → cdn/assets/BlPAZIJrjbcHxcJj.js} +316 -316
  226. package/cdn/assets/{CPjsJ0CY-AurDJgm2.js → BljA9tG92oDDEqjC2.js} +13 -13
  227. package/{browser/esm/13CH9sjvoEqt6nbt2.mjs → cdn/assets/BouiFjb9pyWsROiW.js} +1 -1
  228. package/cdn/assets/{C1doaJjkCzQlB_3u.js → BqT5uCSFT_HATJJw.js} +1 -1
  229. package/cdn/assets/{f1iQWnLWVpKZ34XR2.js → Buwn5fZU7jRx2O2L2.js} +8 -8
  230. package/cdn/assets/{CzEHYpK2SYTRpxDm2.js → ByMjPzoTrB6veNzc2.js} +25 -25
  231. package/cdn/assets/{CUrzB9ponX7LAYXR.js → Bzv3-2eiz66ZkXnN.js} +3 -3
  232. package/cdn/assets/{CUTnOs5iWyc3J2cN2.js → C1HfU9WnOyE_81Y22.js} +14 -14
  233. package/cdn/assets/{CWOPhBfYI6R0kz-p.js → C2-SeODnwo_GR5pz.js} +501 -501
  234. package/cdn/assets/{BT3KOuPzJsNUvy4B.js → C3D_ZF-8-b6d8y4e2.js} +2 -2
  235. package/cdn/assets/{C7ZHXwoL2A_nxZjl.js → C4cN9i6GMOS58iau.js} +65 -65
  236. package/cdn/assets/{CDijenaMI_dBIGU-.js → C5JHyXmpBXqT829C.js} +464 -464
  237. package/{browser/esm/DuijhgjRhgWB9sCY.mjs → cdn/assets/C62Y8jSQuT2_lqUs2.js} +240 -228
  238. package/cdn/assets/{BaEH7HZAJkFGHtNj2.js → C6FGZZf4iXdgdE2p2.js} +66 -66
  239. package/{browser/esm/Bfq8Gdqf3I7y_Hju.mjs → cdn/assets/C9QsQZR03iUbXGDd2.js} +1 -1
  240. package/{browser/esm/CAVONPXgoytyiNK-.mjs → cdn/assets/CFKZFbkoc-8gG0EH.js} +1 -1
  241. package/cdn/assets/{eTXmezPFvAwM_L-D.js → CIsuqkDFqRaqaULt2.js} +1 -1
  242. package/cdn/assets/{Bcjus_Q6f72kE1MK.js → CNBdjbsAfeLxOXNu.js} +1 -1
  243. package/cdn/assets/{BB6k7f_6TCVysy8a.js → CNJDMOYg-cuIfNfJ.js} +3 -3
  244. package/cdn/assets/{CA9oxppuFcYDyylE.js → CNJExdRjs2zrq2QI2.js} +12 -12
  245. package/{browser/esm/BG_hG8jUkf0aMzGK.mjs → cdn/assets/COqWk0Oh4IaPrTm7.js} +2 -2
  246. package/cdn/assets/{Bokc-Wu4XBPWKmdt.js → CPgdrQexyUXiviTo.js} +1 -1
  247. package/{browser/esm/BDZAVKSYpcOp9Dve2.mjs → cdn/assets/CQi9Ek-nl9QWmoMC.js} +1 -1
  248. package/cdn/assets/{B9hBziUoXFzKPWF02.js → CRGjj70fiZgAfoOZ2.js} +7 -7
  249. package/cdn/assets/{2QsTDWiE6SMelbNU2.js → CRepp6I1poWZwijy2.js} +7 -7
  250. package/cdn/assets/{B_sKE05xgjFFafjm.js → CU-pICtgXW5Kn0sP.js} +1839 -1839
  251. package/cdn/assets/{lHpMVBxqkkCYD6d1.js → CVV-QxmM_7vUYzFC2.js} +1 -1
  252. package/cdn/assets/{BPOi08RtEmQdlbtS2.js → CX7_0zQyYWqVfYUE2.js} +12 -12
  253. package/cdn/assets/{Ifw8W-tqHjQnCWZO2.js → CZuu-bOdg704oDMV2.js} +40 -40
  254. package/cdn/assets/{ep-IjWXOPg2b-REP2.js → C_6kPChYiQzj6w3V2.js} +1 -1
  255. package/cdn/assets/{UNtnFd2ssTtnrqRp.js → CdP9qTlDd3C1oYJE.js} +1917 -1907
  256. package/{browser/esm/yVLsr0rcaOFel2nS2.mjs → cdn/assets/ChKDkoQeoZMHq0r7.js} +1 -1
  257. package/cdn/assets/{DTfDzhFtORWkuoRv2.js → CiMRlH1xk4i9IiEn.js} +1 -1
  258. package/{browser/esm/DbVSG7Uf7YDQbmc32.mjs → cdn/assets/CiUtfAMZeVao4r9g2.js} +1 -1
  259. package/cdn/assets/{B9oLwnLz9m-TWSPJ2.js → CkGtAcs5pCYCEP8p.js} +65 -65
  260. package/cdn/assets/{D13sLQRMMKrDHepu2.js → ClQiq37bto-oxKtL2.js} +1 -1
  261. package/cdn/assets/{AAHsV9V95k39t9SD.js → ClrdhQeh_WoBg0Ws.js} +1 -1
  262. package/cdn/assets/{txVgXcuMeWVNWHnZ.js → CmNtmMkhbzV8j_I0.js} +1 -1
  263. package/cdn/assets/{V-oO_EfTyth0iptZ.js → Cm_bL9sY_cm-k_Pq2.js} +1 -1
  264. package/cdn/assets/{Bi9IWSBo7DDXROTC.js → CnBG1teWhE7BlvvP.js} +2 -2
  265. package/{browser/esm/Dd80tsdITZsotoCX2.mjs → cdn/assets/CqheKk46etN--iuw.js} +1 -1
  266. package/cdn/assets/{CCTYceFrydwG3Vyt2.js → Cr34xFdpfmYj3XVX.js} +6852 -6812
  267. package/cdn/assets/{BM343UBJqjbDokO6.js → CsDejQBEe09RdeRI2.js} +1 -1
  268. package/cdn/assets/{BBaNqp1ZjuO25FQg.js → CsG9IQdgctp6tf2X.js} +1 -1
  269. package/cdn/assets/{erwt6xEgCY7lDQWp.js → CweS1pLcEo28_Fd3.js} +3 -3
  270. package/{browser/esm/DjNR_ZGCbg-xia152.mjs → cdn/assets/Cz77LBaC6qe0hPm0.js} +1 -1
  271. package/{browser/esm/BVtQCzVeMOJZq64r2.mjs → cdn/assets/D6FSp0JpvARNns7B.js} +81 -81
  272. package/cdn/assets/{BsHFBjNwTzc_CKLq2.js → D6g5-9e1xAhCBLKs2.js} +9659 -9661
  273. package/cdn/assets/{BOhfbmK18Xj1P7-i2.js → DCY3GQ5g02kgKrPz.js} +1 -1
  274. package/{browser/esm/CPgOplnn6NuHwsZ_.mjs → cdn/assets/DDfhrc6lUmerlDLA.js} +1 -1
  275. package/cdn/assets/{DIlrvTRlRll76TiE2.js → DE2W5y4QJln8ofNW2.js} +117 -117
  276. package/cdn/assets/{DmRqcUu6qCPcOxgW.js → DFs_9gdet_-cO7iH.js} +2 -2
  277. package/cdn/assets/{DmQ4uKOlhrcJfgk82.js → DLBKxOA2T_WJvvvH2.js} +16 -16
  278. package/cdn/assets/{CmSATmXaMlqwTjAe.js → DN6XiWA9mgKCYBL7.js} +1 -1
  279. package/{browser/esm/CULlzRLL3s2Dikjg.mjs → cdn/assets/DQXXQ7c_080TSD18.js} +1 -1
  280. package/{browser/esm/BauR0SATr44ggHRU.mjs → cdn/assets/DVRMsPYzWC08As4p.js} +264 -264
  281. package/cdn/assets/{BsGz_0JrhSfOZ24Q.js → DW_9fxHbJWAA6hS7.js} +3 -3
  282. package/cdn/assets/{D-egzesxukW7Z_e32.js → DXuBmWXG49kvaZNr.js} +1 -1
  283. package/{browser/esm/B_49GiUSgx96vBvq2.mjs → cdn/assets/DYoBCnD1PVzOITgb.js} +1 -1
  284. package/{browser/esm/gCeoOjDjiVaX8dtF2.mjs → cdn/assets/D_tGKL5JvKpHg5Se.js} +1 -1
  285. package/cdn/assets/{ByHzW_x0qXsBJMwv2.js → DhJUo9PMmo1COlmU2.js} +1045 -1045
  286. package/cdn/assets/{CAOPlenSF-pjVfqt2.js → DiViqDuRVTrNy_8T2.js} +2 -2
  287. package/cdn/assets/{CqI09iUEId8rHfJ9.js → DilLxTePPshHHpSq.js} +6 -6
  288. package/cdn/assets/{CBQrIDBtf5Ibwi96.js → DoVrePIXmzfLRmKR2.js} +2 -2
  289. package/cdn/assets/{C2X9NooB33IkSomz.js → Doj9y5S2cMVRtP1D.js} +8 -8
  290. package/{browser/esm/CnvlkxK0pS02Z3gZ.mjs → cdn/assets/Dr3NMWk6K4-HWYsp.js} +1 -1
  291. package/{browser/esm/DZLyXICwEHYRnCuO.mjs → cdn/assets/DrVaoGzrL25jLUGy.js} +3 -3
  292. package/cdn/assets/{B50P0gSziuG68Umu2.js → DsGBg42mflMr5nWn2.js} +1 -1
  293. package/{browser/esm/C04uI3XsvTc6Cc7w2.mjs → cdn/assets/DtFBvTH8ScTC26Xd2.js} +1 -1
  294. package/cdn/assets/{B_UEqzmXZIhHAEyS.js → DtOWX0kdgZMsDoO7.js} +8 -8
  295. package/cdn/assets/{Dz0_oXqVesISvhbJ.js → DtumfSbgP4e8W8h3.js} +3 -3
  296. package/cdn/assets/{DJBTmv-rddT91Z-N2.js → DwB2Aw3VeP0bDUcu2.js} +18 -18
  297. package/cdn/assets/{Dn8Z0WK2Hwi8MRnQ2.js → DwpzhMm9SjvmHEpB2.js} +1 -1
  298. package/{browser/esm/D1bACCJy4F8kANLy.mjs → cdn/assets/ERmTt8XRToIi7stb2.js} +1 -1
  299. package/cdn/assets/{VEJV_bhNDNNyZAIA2.js → FG3AVHTW-X8T6X6V2.js} +8 -8
  300. package/cdn/assets/{Dg26zVdGlO10MX0h2.js → Ks5Tzjg6SEeoLe6a.js} +21 -21
  301. package/cdn/assets/{f9r0yTaD2YChFtEg.js → LryKLHFrshlshCEk.js} +1 -1
  302. package/{browser/esm/LfHB39-nf7mi9XC72.mjs → cdn/assets/N9sXUCWDhn_zpuR22.js} +1 -1
  303. package/cdn/assets/{BSixIKI7PxSqiUGB2.js → NHd14bmjDunGi64w2.js} +5 -5
  304. package/{browser/esm/BF842ZtkvebA1LgR.mjs → cdn/assets/NLHUljnhbCboNbaU2.js} +1 -1
  305. package/cdn/assets/{I2Cn0c2NkX845WIx.js → POvNgF4k1Kibh6Db.js} +6 -6
  306. package/cdn/assets/{C3KIo0iwLXhIIMG8.js → RnavifpmQlGK2gal.js} +2 -2
  307. package/cdn/assets/{DoBxkE57H5PfH7Or.js → TA52Zf5ZMCu6I721.js} +2 -2
  308. package/cdn/assets/{S2_pz0y2RTJFpXkS2.js → U7ZDW4cwSiPyirkE2.js} +1 -1
  309. package/{browser/esm/CThP3jXwDzLlUOeI.mjs → cdn/assets/XGGjX0z3ae_AWeTr2.js} +1 -1
  310. package/cdn/assets/{DYCh_5thAx4qo1ns2.js → ZGRko_YhO95NyKLu.js} +757 -757
  311. package/{browser/esm/DtQu3vHaJfA5KM2H2.mjs → cdn/assets/_WaFh_cvGeblogUn.js} +1 -1
  312. package/cdn/assets/{CZ3JFujrzd0iX0zL2.js → hbYg8nwB--Ouo3PE2.js} +72 -72
  313. package/cdn/assets/{DI4QTfUQPCjSn0kl.js → kgHG0ixsMXmNdu8U.js} +7 -7
  314. package/cdn/assets/{Bl5xLu1ou-9zMIBZ.js → p-0E4OSYsnvo4Jvb.js} +1 -1
  315. package/cdn/assets/{N5PCgig3g9yqotn9.js → qBcxlsrimi009WnV.js} +2 -2
  316. package/{browser/esm/Be2-C5U5LlfLTmyo2.mjs → cdn/assets/rUQqpcI_WXcsiwea.js} +1 -1
  317. package/{browser/esm/CjFOk9mcZqAngWD2.mjs → cdn/assets/yg7AU6dKBI7tCqJd.js} +1 -1
  318. package/cdn/index.js +2 -2
  319. package/package.json +3 -3
  320. package/browser/cjs/B0FCH1gFfg2bQiPi2.cjs +0 -1
  321. package/browser/cjs/B3WkiDqFBfA_xxJL2.cjs +0 -1
  322. package/browser/cjs/Bqup1MCJFqTZbLDd2.cjs +0 -1
  323. package/browser/cjs/BsJHSGeWLskirGXg.cjs +0 -14
  324. package/browser/cjs/Bsl_clm06l5cwpML.cjs +0 -32
  325. package/browser/cjs/BvVzIzXLyLxpBcia2.cjs +0 -3
  326. package/browser/cjs/C1tOH7BEpO_ANMsa.cjs +0 -1
  327. package/browser/cjs/CA_ZsYjkTHSpGK0j.cjs +0 -41
  328. package/browser/cjs/CoCKYtBIVeDXxSIq2.cjs +0 -1
  329. package/browser/cjs/CqPb6CbrHTRnbSKa2.cjs +0 -8
  330. package/browser/cjs/D2ZPx3v4EVejvhR2.cjs +0 -54
  331. package/browser/cjs/D8tkBbkGH5cZzIJP2.cjs +0 -1
  332. package/browser/cjs/DP1pufP3NJFoDa-g.cjs +0 -3
  333. package/browser/cjs/DTZiRVEB3kVK7eK-2.cjs +0 -1
  334. package/browser/cjs/DU2HMmI1EeHBTvuG.cjs +0 -1
  335. package/browser/cjs/DWzkpizTIJkaqf4J2.cjs +0 -1
  336. package/browser/cjs/Dk1WS0vM-LQJx_EO2.cjs +0 -1
  337. package/browser/cjs/DtlC63s51_88j6AY2.cjs +0 -1
  338. package/browser/cjs/Dx79LP1-YCQg8B872.cjs +0 -1
  339. package/browser/cjs/VgwyOcXDHhEp_NvH2.cjs +0 -1
  340. package/browser/cjs/xTT7lHV4HUjeNdMs2.cjs +0 -1
  341. package/cdn/assets/C6X4CmElTpPxrad62.js +0 -24
  342. package/cdn/assets/CUYBRp4sHMdGwkLT2.js +0 -24
  343. /package/browser/cjs/{1XrWGMP3GmsQOMIX2.cjs → 1XrWGMP3GmsQOMIX.cjs} +0 -0
  344. /package/browser/cjs/{B6vy56yEA1I3B74O2.cjs → B6vy56yEA1I3B74O.cjs} +0 -0
  345. /package/browser/cjs/{BK0SCfN_VZYqBxoQ2.cjs → BK0SCfN_VZYqBxoQ.cjs} +0 -0
  346. /package/browser/cjs/{BcROQ4pvVajDQ1em.cjs → BcROQ4pvVajDQ1em2.cjs} +0 -0
  347. /package/browser/cjs/{BvG8N7G_8CXIAlT-.cjs → BvG8N7G_8CXIAlT-2.cjs} +0 -0
  348. /package/browser/cjs/{C4cZxb9nRtzTCA40.cjs → C4cZxb9nRtzTCA402.cjs} +0 -0
  349. /package/browser/cjs/{C9q3zr8iCIoYDrdA.cjs → C9q3zr8iCIoYDrdA2.cjs} +0 -0
  350. /package/browser/cjs/{CVHc_cJddJk7J3Zt2.cjs → CVHc_cJddJk7J3Zt.cjs} +0 -0
  351. /package/browser/cjs/{CaJGoNwTL6pAJ6a42.cjs → CaJGoNwTL6pAJ6a4.cjs} +0 -0
  352. /package/browser/cjs/{D8-KovdJ0LjxqCe2.cjs → D8-KovdJ0LjxqCe22.cjs} +0 -0
  353. /package/browser/cjs/{DF4l8xrxkcLkgExp2.cjs → DF4l8xrxkcLkgExp.cjs} +0 -0
  354. /package/browser/cjs/{DG2kqsWRUtVugjay.cjs → DG2kqsWRUtVugjay2.cjs} +0 -0
  355. /package/browser/cjs/{DM7-R_ltoLbA9jde.cjs → DM7-R_ltoLbA9jde2.cjs} +0 -0
  356. /package/browser/cjs/{DNKyaSruDogoBd2H2.cjs → DNKyaSruDogoBd2H.cjs} +0 -0
  357. /package/browser/cjs/{Dtxj9JR14A-uliu5.cjs → Dtxj9JR14A-uliu52.cjs} +0 -0
  358. /package/browser/cjs/{Dx7GQ4ALtNG3kshu.cjs → Dx7GQ4ALtNG3kshu2.cjs} +0 -0
  359. /package/browser/cjs/{aONv0Ys3C8xmnaR82.cjs → aONv0Ys3C8xmnaR8.cjs} +0 -0
@@ -0,0 +1,41 @@
1
+ const e=require("./B7_pDFYCVzt-3hUs.cjs"),t=require("./Ytzw6iUYx5f19wfK.cjs"),n=require("./Bj3YkKmVIoQ3YtYm.cjs"),r=require("./CjqMMBQ8Kk0moB_z.cjs"),i=require("./DrdQTBiFulmvlRaX.cjs"),a=require("./BPWKnUtyoTrtW567.cjs"),o=require("./hHVT-pzS2bhjFHSL.cjs"),s=require("./9Fb0mL7xhqVmVTQp.cjs"),c=require("./CIDcABwPAtKB7XVf.cjs"),l=require("./CuANpK3BdrKl4Yhe.cjs");var u=e.r(t.i(),1),d=e.r(t.r(),1),f=e.r(t.n(),1);(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._grid-stage_rzp9d_1{width:100%;height:100%;position:absolute;top:0;left:0}._grid-stage_rzp9d_1>*{pointer-events:none;position:absolute;inset:0}._grid-stage_rzp9d_1>*>*{pointer-events:auto}._sheetxl-grid_5yo0n_7{box-sizing:border-box;user-select:none;contain:strict;width:100%;height:100%;position:relative}._sheetxl-grid_5yo0n_7 *{box-sizing:border-box!important}._sheetxl-grid_5yo0n_7 :focus{outline:none}._sheetxl-grid_5yo0n_7>*{contain:size layout style}._virtual-div_16eab_1{position:absolute}._tiles_ikr1b_7{will-change:transform}._tiles_ikr1b_7 .tile{white-space:pre;position:absolute}._tiles_ikr1b_7 .tile>*{contain:strict;position:absolute}._gridlines_ikr1b_26,._gridlines_ikr1b_26 *{pointer-events:none;position:absolute;overflow:visible}.cell{letter-spacing:-.25px;padding:2px 4px;font-family:Calibri;line-height:1.2}._search_b1nag_5{box-sizing:border-box;width:100%;min-width:0;font:inherit;color:inherit;background:light-dark(#fff,#2b2b2b);border:1px solid light-dark(#c4c4c4,#5a5a5a);border-radius:2px;outline:none;margin:0;padding:3px 8px}._search_b1nag_5:focus{border-color:var(--sxl-color-primary,#0078d7)}._search_b1nag_5::placeholder{opacity:.6}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var p=(e,t)=>{if(typeof t==`number`){let n=t;return{getOffset:e=>e<=0?0:e*n,getIndex:t=>t<=0?0:Math.min(e,Math.floor(t/n))}}let n=t,r=[],i=-1,a=e=>e<=0?0:((e=>{if(e<=i)return;let t=i>=0?r[i]+n(i):0;for(let a=i+1;a<=e;a++)r[a]=t,t+=n(a);i=e})(e),r[e]),o=(e,t,n)=>{for(;e<=t;){let r=e+(t-e>>1);a(r)<=n?e=r+1:t=r-1}return e>0?e-1:0};return{getOffset:a,getIndex:t=>{if(t<=0||e<=0)return 0;if((i>0?r[i]:0)>t)return o(0,i,t);let s=i>0?i:0,c=1;for(;s<e&&a(s)<=t;)s+=c,c*=2;if(s>=e){let r=e-1;if(t>=a(r)+n(r))return e}return o(Math.floor(s/2),Math.min(s,e-1),t)}}},m=e=>{let t=e!=null,n=e?.rowCount??0,r=e?.columnCount??0,i=e?.getRowHeight,a=e?.getColumnWidth;return(0,u.useMemo)(()=>{if(!t)return null;let e=p(n,i??20),o=p(r,a??75);return{getColOffset:o.getOffset,getColIndex:o.getIndex,getRowOffset:e.getOffset,getRowIndex:e.getIndex}},[t,n,r,i,a])},h=(0,u.createContext)(null),g=()=>(0,u.useContext)(h),_=e=>{let{linePoints:t,bounds:n,propsPath:r,style:i,...a}=e;return n?(0,d.jsx)(`svg`,{width:`${n.width}`,height:`${n.height}`,viewBox:`0 0 ${n.width} ${n.height}`,style:{position:`absolute`,left:`${n.x}px`,top:`${n.y}px`,width:`${n.width}px`,height:`${n.height}px`,overflow:`visible`,pointerEvents:`none`,transitionTimingFunction:`linear`,transitionProperty:`left, top, width, height`,willChange:`left, top, width, height, stroke-dashoffset`,...i},...a,children:(0,d.jsx)(`path`,{d:`M ${t[0]} ${t[1]} L ${t[2]} ${t[3]}`,fill:`none`,vectorEffect:`non-scaling-stroke`,stroke:`black`,...r})}):null},v=(0,u.memo)(e=>{let{bounds:t,fill:n,stroke:r,alignWidth:a=1,disableAlign:o=!1,disableEdgeAware:s=!1,inset:c=0,hole:l,animatedStroke:f,animatedTransition:p,strokeDasharray:m,strokeDashoffset:h,propsFillPath:_,propsStrokePath:v,className:x,style:C,propsRoot:w}=e,T=g(),E=t??T;if((0,u.useEffect)(()=>{f&&S()},[f]),!E)return null;let D,O,k,A,j,M,N,P=i.kt.getDevicePixelRatio(),F=o?a:a/P;if(o)D=E.x,O=E.y,k=E.x+E.width,A=E.y+E.height;else{let e=e=>s?i.kt.snapLineCenter(e,F,P):i.kt.edgeCenter(e,`leading`,a,P),t=e=>s?i.kt.snapLineCenter(e,F,P):i.kt.edgeCenter(e,`trailing`,a,P),n=c/P;D=e(E.x+n),O=e(E.y+n),k=t(E.x+E.width-n),A=t(E.y+E.height-n)}if(l)if(o)j=l;else{let e=i.kt.snapDeviceEdge(l.x,P),t=i.kt.snapDeviceEdge(l.y,P);j={x:e,y:t,width:i.kt.snapDeviceEdge(l.x+l.width,P)-e,height:i.kt.snapDeviceEdge(l.y+l.height,P)-t}}if(f){let e={dashGap:2,speed:50,dashLength:8,gapColor:`var(--sxl-color-base-100, #fff)`,...typeof f==`object`?f:void 0},t=e.dashGap+e.dashLength;M={strokeDasharray:`${e.dashLength}px ${e.dashGap}px`,strokeDashoffset:`${t}px`,animation:`${b} ${e.speed*t}ms linear infinite`,willChange:`stroke-dashoffset`},N=e.gapColor}let I=p?`d 60ms ease-in-out`:`none`,L=null;if(n){let e=y({top:O,left:D,bottom:A,right:k});j&&(e+=` `+y({top:j.y,left:j.x,bottom:j.y+j.height,right:j.x+j.width})),L=(0,d.jsx)(`path`,{style:{d:`path("${e}")`,transition:I,fill:n,..._?.style},stroke:`none`,fillRule:`evenodd`},`fill`)}let R=null;if(r&&a){let e=y({top:O,left:D,right:k,bottom:A});R=(0,d.jsxs)(d.Fragment,{children:[N&&(0,d.jsx)(`path`,{fill:`none`,vectorEffect:`non-scaling-stroke`,strokeWidth:F,style:{d:`path("${e}")`,transition:I,stroke:N}},`stroke-under`),(0,d.jsx)(`path`,{fill:`none`,strokeDasharray:m,strokeDashoffset:h,vectorEffect:`non-scaling-stroke`,strokeWidth:F,...v,style:{d:`path("${e}")`,transition:I,stroke:r,...M,...v?.style}},`stroke`)]})}return(0,d.jsxs)(`svg`,{className:x,width:`100%`,height:`100%`,style:{position:`absolute`,left:0,top:0,pointerEvents:`none`,overflow:`visible`,willChange:f||p?`d, stroke-dashoffset`:void 0,...C},...w,children:[L,R]})});v.displayName=`RectangleSVG`;var y=(e,t=!0)=>`M ${e.left} ${e.top} L ${e.right} ${e.top} L ${e.right} ${e.bottom} L ${e.left} ${e.bottom} L ${e.left} ${e.top} ${t?`Z`:``}`,b=`sxl-marching-ants`,x=!1,S=()=>{if(x||typeof document>`u`)return;x=!0;let e=document.createElement(`style`);e.appendChild(document.createTextNode(`@keyframes ${b} { to { stroke-dashoffset: 0; } }`)),document.head.appendChild(e)};function C(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=C(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function w(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=C(e))&&(r&&(r+=` `),r+=t);return r}var T=(e,t,n)=>Math.min(n,Math.max(t,e)),E=(e,t,n)=>{let r=[],i=t;for(;i<=n;){let t=e?Math.max(0,e(i)):0;t===0?(r.push(i),i++):i+=t}return r},D=(e,t,n,r,i,a)=>{if(n-t>=i-r)return r;let o=r;return e===`nearest`&&(r-t>0?e=`start`:n-i>0&&(e=`end`)),e===`start`?o=t:e===`end`?o=n-(i-r):e===`center`&&(o=t+(n-t)/2-(i-r)/2),o<r?Math.max(0,o):o>r?Math.min(o,a-(i-r)):void 0},O=(e,t=!1,n,r)=>{if(!n)return 0;let i=!t,a=i?1:-1,o=n(i?e:e+1),s=n(i?e+1:e),c=e+(i?2:-1),l=0;for(;(s-o)*a<=0;){if(i&&c-1>r+1||!i&&c+1<r)return l;o=s,s=n(c),c+=a,l++}return l},k=(e,t,n)=>{if(!n)return!1;let r=n.x;if(e<r||e>r+n.width)return!1;let i=n.y;return!(t<i||t>i+n.height)},A={pointerdown:`onPointerDown`,pointermove:`onPointerMove`,pointerup:`onPointerUp`,mousedown:`onMouseDown`,mousemove:`onMouseMove`,mouseup:`onMouseUp`,mouseover:`onMouseOver`,mouseout:`onMouseOut`,dblclick:`onDoubleClick`,contextmenu:`onContextMenu`},j=Object.values(A),M=[...Object.keys(A),`keydown`,`keypress`,`keyup`],N=new Set(M),P=e=>{let t=e?.getElement();return t&&typeof t.isStage==`function`&&t.isStage()?t:null},F=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{className:n,onFocus:r,onBlur:a,children:o,...s}=e,c=Z(),l=(0,u.useRef)(c);l.current=c;let f=(0,u.useRef)(new Set),p=(0,u.useRef)(0),m=(0,u.useCallback)(e=>{let t={responder:e,seq:p.current++};return f.current.add(t),()=>{f.current.delete(t)}},[]),h=(0,u.useRef)(new Set),g=(0,u.useRef)(0),_=(0,u.useCallback)(e=>(h.current.add(e),e.hasHandlers&&g.current++,()=>{h.current.delete(e),e.hasHandlers&&g.current--}),[]),v=(0,u.useRef)(null),y=(0,u.useRef)(0),b=(0,u.useCallback)((e,t)=>{let n=v.current;if(n&&n.x===e&&n.y===t)return n.stack;let r=document.elementsFromPoint(e,t);return v.current={x:e,y:t,stack:r},y.current||typeof requestAnimationFrame!=`function`||(y.current=requestAnimationFrame(()=>{y.current=0,v.current=null})),r},[]);(0,u.useEffect)(()=>()=>{y.current&&typeof cancelAnimationFrame==`function`&&cancelAnimationFrame(y.current)},[]);let x=(0,u.useCallback)((e,t,n)=>{if(!t&&!n)return()=>{};let r=(e,r)=>{t?.(e),n?.(e,r)};return m({getHandler:t=>t===e?r:void 0})},[m]),S=(0,u.useCallback)(e=>{if(!e||e===Y.current)return-1/0;let t=new Map;if(f.current.forEach(e=>{let n=e.responder.getElement?.();n&&t.set(n,e.responder.zIndex??0)}),t.size===0)return-1/0;let n=e;for(;n;){let e=t.get(n);if(e!==void 0)return e;if(n===Y.current)break;n=n.parentElement}return-1/0},[]),C=(0,u.useCallback)((e,t,n)=>{if(A[e]===void 0||g.current===0)return I;let r=t.nativeEvent;if(typeof r?.clientX!=`number`||typeof r?.clientY!=`number`)return I;let i=new Map;if(h.current.forEach(e=>{if(!e.hasHandlers||!e.getHandler)return;let t=e.getElement();t&&i.set(t,e)}),i.size===0)return I;let a=e=>{let t=e;for(;t;){if(i.has(t))return t;if(t===Y.current)break;t=t.parentElement}return null},o=a(t.target),s=e===`pointermove`||e===`mousemove`,c=s?b(r.clientX,r.clientY):document.elementsFromPoint(r.clientX,r.clientY),l=[],u=new Set;for(let e=0;e<c.length;e++){let t=a(c[e]);if(!t||u.has(t)||(u.add(t),t===o))continue;let r=i.get(t),s=r.zIndex??0;s>=n||l.push({slot:s,box:!0,ord:e,getHandler:r.getHandler})}return o&&!u.has(o)&&s?I:l},[b]),T=(0,u.useCallback)((e,t,n)=>{let r=Y.current;if(r&&t.target instanceof Node&&!r.contains(t.target))return;let i=N.has(e)?S(t.target):1/0,a=[...C(e,t,i)];if(f.current.forEach(e=>{let t=e.responder.zIndex??0;t>=i||a.push({slot:t,box:!1,ord:-e.seq,getHandler:t=>e.responder.getHandler(t)})}),a.length===0)return;a.sort((e,t)=>t.slot-e.slot||!e.box-+!t.box||e.ord-t.ord);let o=a.length;for(let r=0;r<o&&!t.isPropagationStopped();r++)a[r].getHandler(e)?.(t,n)},[C,S]);(0,u.useEffect)(()=>{let e=Y.current;if(!e)return;let t=t=>{let n=t.type,r=S(t.target),i=[];if(f.current.forEach(e=>{(e.responder.zIndex??0)>r&&i.push(e)}),i.length===0)return;i.sort((e,t)=>(t.responder.zIndex??0)-(e.responder.zIndex??0)||t.seq-e.seq);let a=L(t,e);for(let e=0;e<i.length&&!a.isPropagationStopped();e++)i[e].responder.getHandler(n)?.(a,l.current)};for(let n=0;n<M.length;n++)e.addEventListener(M[n],t,!0);return()=>{for(let n=0;n<M.length;n++)e.removeEventListener(M[n],t,!0)}},[S]);let E=i.X(e=>{T(`pointerdown`,e,l.current)},[]),D=i.X(e=>{T(`pointermove`,e,l.current)},[]),O=i.X(e=>{T(`pointerup`,e,l.current)},[]),k=i.X(e=>{T(`pointerleave`,e,l.current)},[]),j=i.X(e=>{T(`mousedown`,e,l.current)},[]),P=i.X(e=>{T(`mouseenter`,e,l.current)},[]),F=i.X(e=>{T(`mouseleave`,e,l.current)},[]),R=i.X(e=>{T(`mousemove`,e,l.current)},[]),z=i.X(e=>{T(`mouseout`,e,l.current)},[]),B=i.X(e=>{T(`mouseover`,e,l.current)},[]),V=i.X(e=>{T(`mouseup`,e,l.current)},[]),H=i.X(e=>{T(`dblclick`,e,l.current)},[]),U=i.X(e=>{T(`keydown`,e,l.current)},[]),W=i.X(e=>{T(`keypress`,e,l.current)},[]),G=i.X(e=>{T(`keyup`,e,l.current)},[]),K=i.X(e=>{r?.(e),T(`focus`,e,l.current)},[r]),q=i.X(e=>{a?.(e),T(`blur`,e,l.current)},[a]),J=i.X(e=>{T(`contextmenu`,e,l.current)},[]),Y=i.st(t,()=>({isStage:()=>!0,addReactEventListener:x,registerResponder:m,registerLayer:_}),[]);return(0,u.useEffect)(()=>_({getElement:()=>Y.current}),[_]),(0,d.jsx)(`div`,{className:w(n,`stage`,`_grid-stage_rzp9d_1`),ref:Y,tabIndex:0,...s,onPointerDown:E,onPointerMove:D,onPointerUp:O,onPointerLeave:k,onMouseDown:j,onMouseEnter:P,onMouseLeave:F,onMouseMove:R,onMouseOut:z,onMouseOver:B,onMouseUp:V,onDoubleClick:H,onKeyDown:U,onKeyUp:G,onKeyPress:W,onFocus:K,onBlur:q,onContextMenu:J,children:o})}));F.displayName=`Stage`;var I=Object.freeze([]),L=(e,t)=>{let n=!1;return new Proxy(e,{get(r,i){switch(i){case`nativeEvent`:return e;case`currentTarget`:return t;case`stopPropagation`:return()=>{n=!0,e.stopPropagation()};case`isPropagationStopped`:return()=>n;case`preventDefault`:return()=>e.preventDefault();case`isDefaultPrevented`:return()=>e.defaultPrevented;case`persist`:return()=>{};default:{let e=r[i];return typeof e==`function`?e.bind(r):e}}}})},R=e=>`${e.rowStart},${e.colStart},${e.rowEnd},${e.colEnd}`,z=(0,u.createContext)(0),B=(0,u.createContext)(!1),V=(e,t)=>{let{rowDims:n,columnDims:r,computeRowDims:i,computeColumnDims:a,viewport:o,zoom:s,containerWidth:c,containerHeight:l,getRangeFromCell:u,invalidate:d,totalRange:f,getSurfacePointFromPointer:p,scrollTo:m,scrollCellCoordsIntoView:h,getAllPanes:g}=t,_=e.anchor,v=n[e.rowIndex],y=r[e.columnIndex];if(v.minIndex>v.maxIndex||y.minIndex>y.maxIndex)return null;let b=e.scrollOrientation,x=Object.freeze({x:y.minBounds,y:v.minBounds,width:y.maxBounds,height:v.maxBounds}),S=Object.freeze({colStart:y.minCoord,rowStart:v.minCoord,colEnd:y.maxCoord,rowEnd:v.maxCoord}),C={width:y.maxVirtualBounds,height:v.maxVirtualBounds},w={left:y.freezeOffset,top:v.freezeOffset},T={width:c,height:l},E=null,D=null,O=()=>{let t=o.getSnapshot();if(D&&E===t)return D;let n=a(t.left)[e.columnIndex],r=i(t.top)[e.rowIndex],c=n.metrics,l=r.metrics,u=Object.freeze({rowStart:r.minIndex,colStart:n.minIndex,rowEnd:r.maxIndex,colEnd:n.maxIndex}),d=Object.freeze({getColIndex:e=>c.getColIndex(e),getColOffset:e=>c.getColOffset(e),getRowIndex:e=>l.getRowIndex(e),getRowOffset:e=>l.getRowOffset(e)}),f={left:n.scrollOffset,top:r.scrollOffset};return D={cellRange:u,metrics:d,scrollTopLeft:f,topLeft:{top:(w.top+(b.vertical?f.top:0))/s,left:(w.left+(b.horizontal?f.left:0))/s},colDims:n,rowDims:r},E=t,D},A=(e,t)=>{let n=O();return((e,t,n)=>{let r=e.getColOffset(t.colStart)+(n?.left??0),i=e.getRowOffset(t.rowStart)+(n?.top??0);return{x:r,y:i,width:e.getColOffset(t.colEnd+1)+(n?.right??0)-(n?.left??0)-r,height:e.getRowOffset(t.rowEnd+1)+(n?.bottom??0)-(n?.top??0)-i}})(n.metrics,e??n.cellRange,t)},j=e=>{if(e<0)return null;let t=O().colDims.metrics,n=t.getColOffset(e);return{index:e,offset:n,size:t.getColOffset(e+1)-n}},M=e=>{if(e<0)return null;let t=O().rowDims.metrics,n=t.getRowOffset(e);return{index:e,offset:n,size:t.getRowOffset(e+1)-n}},N=(e,t)=>{let n=Array(e.length);for(let r=0;r<e.length;r++)n[r]=t(e[r]);return n};return{addReactEventListener:(t,n,r)=>{let i=e.refStage;return i?i.addReactEventListener(t,n,r):()=>{}},getElement:()=>e.refStage,invalidate:d,focus(t){let n=e.refStage;n&&n.focus(t)},setPointerCapture:t=>{let n=e.refStage;n&&n.setPointerCapture(t)},releasePointerCapture(t){let n=e.refStage;n&&n.releasePointerCapture(t)},getVisibleRange:()=>O().cellRange,toClipBounds:(e,t)=>{let n,r=0;return t===void 0||typeof t==`number`?(n=A(O().cellRange),r=t):n=t,((e,t,n=0)=>{let r=e.x,i=e.y;if(r>t.width||i>t.height)return null;let a={left:r,top:i,bottom:e.height+i,right:e.width+r},o={left:t.x+n,top:t.y+n,bottom:t.height-2*n+t.y,right:t.width-2*n+t.x},s={left:Math.max(a.left,o.left),top:Math.max(a.top,o.top),bottom:Math.min(a.bottom,o.bottom),right:Math.min(a.right,o.right)},c={x:s.left,y:s.top,width:s.right-s.left,height:s.bottom-s.top};return c.height<0||c.width<0?null:c})(e??{x:0,y:0,width:x.width,height:x.height},n,r)},toPaneBounds:e=>{let t=O().topLeft;return t.left===0&&t.top===0&&s===1?e:{x:(e.x-t.left)*s,y:(e.y-t.top)*s,width:e.width*s,height:e.height*s}},toAbsoluteBounds:e=>{let t=O().topLeft;return t.left===0&&t.top===0&&s===1?e:{x:e.x/s+t.left,y:e.y/s+t.top,width:e.width/s,height:e.height/s}},getPanePointFromPointer:(e,t)=>{let n=p(e,t);return n?{x:n.x-x.x,y:n.y-x.y}:null},getMetrics:()=>O().metrics,getRangeFromCell:u,getVisibleColumns:(e,t)=>N(O().colDims.visibleIndices(e,t),j),getVisibleRows:(e,t)=>N(O().rowDims.visibleIndices(e,t),M),getColumnSize:j,getRowSize:M,getTotalRange:()=>f,getBoundsFromRange:A,getCellFromPointer:(e,t,n=!1)=>{let r=p(e,t);if(!r)return null;let i=O().metrics,a=i.getColIndex(r.x-x.x),o={rowIndex:i.getRowIndex(r.y-x.y),colIndex:a};if(n)return o;let s=u(o);return{rowIndex:s.rowStart,colIndex:s.colStart}},getPaneFromPointer:(e,t)=>{let n=p(e,t);if(!n)return null;let r=g();for(let e=0;e<H.length;e++){let t=r[H[e]];if(t&&k(n.x,n.y,t.getPaneBounds()))return t}return null},getZoom:()=>s,getAnchor:()=>_,getPaneRange:()=>S,getPaneBounds:()=>x,getInsets:()=>e.insets,getTotalSize:()=>C,getSurfaceSize:()=>T,getScrollTopLeft:()=>O().scrollTopLeft,getScrollTarget:()=>{let e=O().scrollTopLeft,t=o.getSnapshot(),n=o.getTarget();return{left:e.left+(b.horizontal?n.left-t.left:0),top:e.top+(b.vertical?n.top-t.top:0)}},getFreezeTopLeft:()=>w,getScrollOrientation:()=>b,scrollCellCoordsIntoView:(e,t)=>h(e,t,_),scrollTo:e=>m(e),getAllPanes:g}},H=[n.A.TopLeft,n.A.Top,n.A.Left,n.A.Center],U=(e,t,n)=>{let r=(t?.left??0)+(n?.x??0),i=(t?.top??0)+(n?.y??0);return{getColOffset:t=>e.getColOffset(t)-r,getColIndex:t=>e.getColIndex(t+r),getRowOffset:t=>e.getRowOffset(t)-i,getRowIndex:t=>e.getRowIndex(t+i)}},W=Object.freeze([{minIndex:0,maxIndex:0,minCoord:0,maxCoord:0,visibleIndices:()=>n.I.EmptyArray,minBounds:0,maxBounds:0,metrics:{getColOffset:()=>0,getColIndex:()=>0,getRowOffset:()=>0,getRowIndex:()=>0},maxVirtualBounds:0,scrollOffset:0,freezeOffset:0}]),G=(0,u.createContext)(null),K=({pane:e,viewport:t,children:n})=>{let r=(0,u.useMemo)(()=>({pane:e}),[e,i.in(t,e=>e.getSnapshot())]);return(0,d.jsx)(G.Provider,{value:r,children:n})},q=()=>{let e=new Map,t=new Map;return{has:t=>e.has(t),get:t=>e.get(t),set(n,r){if(e.has(n)&&Object.is(e.get(n),r))return;e.set(n,r);let i=t.get(n);if(i)for(let e of[...i])e()},subscribe(e,n){let r=t.get(e);return r||t.set(e,r=new Set),r.add(n),()=>{r.delete(n),r.size===0&&t.delete(e)}}}},J=(0,u.createContext)(null),Y=({store:e,children:t})=>{let n=(0,u.useContext)(J),r=(0,u.useRef)(null),i=e??n;return i||=(r.current||=q(),r.current),(0,d.jsx)(J.Provider,{value:i,children:t})},ee=`_sheetxl-grid_5yo0n_7`,X=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{rowCount:r=1,columnCount:a=1,viewport:o,metrics:s,getRangeFromCell:c=n.d.cellToRange,hiddenRowsAt:l,hiddenColumnsAt:f,freezeLeft:p=0,freezeTop:m=0,propsFreezeLeft:h,propsFreezeTop:g,onFirstRender:v,children:y,wrapPane:b,onFocus:x,onBlur:S,className:C,style:T,...A}=e,j=i.X(x,[x]),M=i.X(S,[S]),N=i.X(v,[v]),[P,I]=(0,u.useState)(n.A.Center),[L,R]=(0,u.useReducer)(e=>e+1,0),H=(0,u.useMemo)(()=>new i.wt({}),[]),G=o??H,[q,J]=(0,u.useState)(()=>{let e=G.getClient();return{zoom:G.getZoom(),w:e.width,h:e.height,ready:G.isReady()}});(0,u.useEffect)(()=>{let e=()=>J(e=>{let t=G.getClient(),n={zoom:G.getZoom(),w:t.width,h:t.height,ready:G.isReady()};return e.zoom===n.zoom&&e.w===n.w&&e.h===n.h&&e.ready===n.ready?e:n});return e(),G.subscribe(e)},[G]);let X=q.zoom,Z=(0,u.useMemo)(()=>{let e=s??te;return{getColOffset:t=>e.getColOffset(t)*X,getColIndex:t=>e.getColIndex(t/X),getRowOffset:t=>e.getRowOffset(t)*X,getRowIndex:t=>e.getRowIndex(t/X)}},[s,X]),de=i.X((e,t=!1)=>O(e,t,Z.getRowOffset,t?0:r),[r,Z?.getRowOffset]),Q=i.X(l??de,[l]),fe=i.X((e,t=!1)=>O(e,t,Z.getColOffset,t?a:0),[a,Z?.getColOffset]),pe=i.X(f??fe,[f]),me=(0,u.useCallback)(()=>{R()},[]),he=(0,u.useMemo)(()=>Math.min(q.w,Z.getColOffset(a)),[L,Z.getColOffset,a,q.w]),ge=(0,u.useMemo)(()=>Math.min(q.h,Z.getRowOffset(r)),[L,Z.getRowOffset,r,q.h]),_e=(0,u.useMemo)(()=>{let e=NaN,t=null;return n=>(n===e&&t||(e=n,t=(e=>{if(ge===0)return W;let t=[],n=0,i=0;typeof m==`number`?n=m:(n=m.index??0,i=(m.offset??0)*X);let a=i,o=Z.getRowOffset(n),s=o-a;if(n>0){let e,r=U(Z,{top:i+Z.getRowOffset(0)}),c=Z.getRowIndex(a),l=Z.getRowIndex(o-1);t[1]={minIndex:c,maxIndex:l,minCoord:0,maxCoord:n-1,minBounds:0,maxBounds:s,visibleIndices:(t,n)=>t!==void 0&&n!==void 0?E(Q,t,n):e||(e=Object.freeze(E(Q,c,l)),e),metrics:r,maxVirtualBounds:o,scrollOffset:i,freezeOffset:i}}let c,l=Math.max(0,ge-s),u=U(Z,{top:e+s}),d=u.getRowIndex(0),f=u.getRowIndex(l-1);return t[0]={minIndex:d,maxIndex:f,minCoord:n,maxCoord:r-1,minBounds:s,maxBounds:l,visibleIndices:(e,t)=>e!==void 0&&t!==void 0?E(Q,e,t):c||(c=Object.freeze(E(Q,d,f)),c),metrics:u,maxVirtualBounds:Z.getRowOffset(r),scrollOffset:e,freezeOffset:(n>0?Z.getRowOffset(n):0)-i},t})(n)),t)},[L,Z.getRowIndex,Z.getRowOffset,Q,ge,r,m,X]),ve=(0,u.useMemo)(()=>_e(0),[_e]),ye=(0,u.useMemo)(()=>{let e=NaN,t=null;return n=>(n===e&&t||(e=n,t=(e=>{if(he===0)return W;let t=[],n=0,r=0;typeof p==`number`?n=p:(n=p.index??0,r=(p.offset??0)*X);let i=r,o=Z.getColOffset(n),s=o-i;if(n>0){let e,a=U(Z,{left:r+Z.getColOffset(0)}),c=Z.getColIndex(i),l=Z.getColIndex(o-1);t[1]={minIndex:c,maxIndex:l,minCoord:0,maxCoord:n-1,minBounds:0,maxBounds:s,visibleIndices:(t,n)=>t!==void 0&&n!==void 0?E(pe,t,n):e||(e=Object.freeze(E(pe,c,l)),e),metrics:a,maxVirtualBounds:o,scrollOffset:r,freezeOffset:r}}let c,l=Math.max(0,he-s),u=U(Z,{left:e+s}),d=u.getColIndex(0),f=u.getColIndex(l-1);return t[0]={minIndex:d,maxIndex:f,minCoord:n,maxCoord:a-1,minBounds:s,maxBounds:l,visibleIndices:(e,t)=>e!==void 0&&t!==void 0?E(pe,e,t):c||(c=Object.freeze(E(pe,d,f)),c),metrics:u,maxVirtualBounds:Z.getColOffset(a),scrollOffset:e,freezeOffset:(n>0?Z.getColOffset(n):0)-r},t})(n)),t)},[L,Z.getColIndex,Z.getColOffset,pe,he,a,p,X]),be=(0,u.useMemo)(()=>ye(0),[ye]),xe=(0,u.useRef)([]),[Se,Ce]=(0,u.useReducer)(e=>e+1,0),we=ve.length,Te=be.length,Ee=(0,u.useMemo)(()=>{let e=[],t=(t,n,r,i,a)=>{if(t>=Te||n>=we)return null;let o={anchor:r,columnIndex:t,rowIndex:n,elemStage:null,refStage:null,scrollOrientation:{vertical:i?.vertical||!1,horizontal:i?.horizontal||!1},insets:Object.freeze({left:a?.left??0,top:a?.top??0,right:a?.right??0,bottom:a?.bottom??0})};o.elemStage=(0,d.jsx)(F,{ref:e=>{e?(o.refStage=e,Ce()):o.refStage=null},className:`stage stage-${r}`,onFocus:e=>{I(r),j(e)},onBlur:e=>{M(e)}}),e.push(o)};return t(0,0,n.A.Center,oe,ae),t(0,1,n.A.Top,se),t(1,0,n.A.Left,ce),t(1,1,n.A.TopLeft,le),e},[we,Te]),De=(0,u.useMemo)(()=>{let e={},t={colStart:0,rowStart:0,colEnd:a-1,rowEnd:r-1},n=n=>V(n,{rowDims:ve,columnDims:be,computeRowDims:_e,computeColumnDims:ye,viewport:G,zoom:X,containerWidth:he,containerHeight:ge,getRangeFromCell:c,invalidate:me,totalRange:t,getSurfacePointFromPointer:(e,t)=>Ne(e,t),scrollTo:e=>ze(e),scrollCellCoordsIntoView:(e,t,n)=>Re(e,t,n),getAllPanes:()=>e}),i=Ee.length;for(let t=0;t<i;t++){let r=Ee[t];e[r.anchor]=n(r)}return e=Object.freeze(e),e},[Ee,ve,be,_e,ye,G,c,Se]),Oe=be[0]?.maxVirtualBounds??0,ke=ve[0]?.maxVirtualBounds??0,Ae=q.ready,je=(0,u.useMemo)(()=>{let e=be[1],t=ve[1];return{left:e?e.metrics.getColOffset(e.maxIndex+1):0,top:t?t.metrics.getRowOffset(t.maxIndex+1):0}},[ve,be]),Me=i.X(e=>{n.b.canUseDOM&&setTimeout(()=>{(De[P]?.getElement()??De[n.A.Center]?.getElement())?.focus({preventScroll:!0,...e})},0)},[P,De]);(0,u.useEffect)(()=>{let e=xe.current,t=e.length;if(t>0){for(let n=0;n<t;n++)e[n]();xe.current=[]}},[De]);let Ne=(0,u.useCallback)((e,t)=>{(function(e){if(!e)throw Error(`Invariant failed`)})(typeof e==`number`&&typeof t==`number`);let n=Be.current?.getBoundingClientRect();return n?{x:e-n.x,y:t-n.y}:{x:e,y:t}},[]),Pe=i.X((e,t)=>{if(Object.keys(De).length===1)return De[n.A.Center];let r=Ne(e,t);if(!r)return De[n.A.Center];let{x:i,y:a}=r,o=null,s=ue,c=s.length;for(let e=0;!o&&e<c;e++){let t=De[s[e]];t&&k(i,a,t.getPaneBounds())&&(o=t)}return o||=De[n.A.Center],o},[De,c]);(0,u.useEffect)(()=>{let e=be?.[1]?.scrollOffset??0,t=ve?.[1]?.scrollOffset??0;G.setContent(Oe,ke,e,t)},[G,Oe,ke,be,ve]);let Fe=i.X(e=>{let t=e?.left??e?.[0],n=e?.top??e?.[1];if(t===void 0&&n===void 0)return;let r=e?.behavior??`auto`,i=G.getTarget();t!==void 0&&(t=i.left+(t??0)),n!==void 0&&(n=i.top+(n??0)),i.left===t&&i.top===n||ze({left:t,top:n,behavior:r})},[]),Ie=i.X(e=>e===void 0?De[P]??De[n.A.Center]??null:De[e]??null,[De,P]),Le=i.X(e=>{let t=De[P];if(!t)return De[n.A.Center];let r=t.getScrollOrientation(),i={...t.getVisibleRange()};return r.vertical&&(i.rowStart=ve[0].minCoord,i.rowEnd=ve[0].maxCoord),r.horizontal&&(i.colStart=be[0].minCoord,i.colEnd=be[0].maxCoord),r&&n.d.isCellWithinRange(e,i)?t:De[n.A.Center]},[De,P]),Re=i.X((e,t={inline:`nearest`,block:`nearest`},n=null)=>{let r={rowIndex:0,colIndex:0,...e},i=null;if(n!==null){if(i=De[n],!i)return new Promise((e,t)=>{t(`Invalid view`)})}else i=Le(r);let a=c(r),o=i.getMetrics(),s=o.getColOffset(a.colStart),l=o.getRowOffset(a.rowStart),u=o.getColOffset(a.colEnd+1),d=o.getRowOffset(a.rowEnd+1),f=i.getPaneBounds(),p=i.getTotalSize(),m=i.getScrollTopLeft(),h=((e,t,n=!0)=>{n=!0===n?{block:`start`,inline:`end`}:!1===n?{block:`end`,inline:`end`}:{block:`end`,inline:`end`,...n};let r=D(n.inline??`end`,e.x,e.x+e.width,t.left,t.left+t.width,t.totalWidth),i=D(n.block??`end`,e.y,e.y+e.height,t.top,t.top+t.height,t.totalHeight);if(r!==void 0||i!==void 0)return{left:r??t.left,top:i??t.top}})({x:s+m.left,y:l+m.top,width:u-s,height:d-l},{left:m.left,top:m.top,width:f.width,height:f.height,totalWidth:p.width,totalHeight:p.height},t);if(!h)return Promise.resolve({...m});let g={...h},{left:_,top:v}=G.getScroll();g.left!==void 0&&(g.left>_?g.left+=re:g.left<_&&(g.left-=ne)),g.top!==void 0&&(g.top>v?g.top+=re:g.top<v&&(g.top-=ne));let y=i.getScrollOrientation();y.horizontal&&e.colIndex!==void 0||delete g.left,y.vertical&&e.rowIndex!==void 0||delete g.top;let b=g.left===void 0?0:Math.abs(g.left-_),x=g.top===void 0?0:Math.abs(g.top-v),S=(typeof t==`object`?t?.behavior:void 0)??(Math.max(b,x)<ie||!G.isSettled()?`instant`:`smooth`);return new Promise((e,t)=>{try{ze({...g,behavior:S}),e(g)}catch(e){t(e)}})},[Oe,ke,De,c]),ze=i.X(e=>{let t=e?.left??e?.[0],n=e?.top??e?.[1],r=G.getTarget(),i=t??r.left,a=n??r.top,o=e?.behavior===`smooth`;G.setTarget(i,a,o)},[]),Be=i.st(t,()=>({focus:Me,invalidate:me,scrollTo:ze,scrollBy:Fe,scrollCellCoordsIntoView:Re,getPaneFromClient:Pe,getPaneFromCell:Le,getPane:Ie,onPaneChangeOnce:e=>{xe.current.push(e)}}),[De]);(0,u.useEffect)(()=>G.observe(Be.current),[G]);let Ve=(e,t)=>{let n=(e=>{if(!e)return null;if(!Array.isArray(e))return e;let t=e=>(0,u.isValidElement)(e)&&e.props?.zIndex!=null?e.props.zIndex:0;return[...e].sort((e,n)=>t(e)-t(n)).map((e,t)=>(0,u.isValidElement)(e)?(0,u.createElement)(z.Provider,{key:e.key??`layer-${t}`,value:t},e):e)})(t);return n?(0,d.jsx)(B.Provider,{value:!1,children:(0,d.jsx)(K,{pane:e,viewport:G,children:b?b(e,n):n})}):null},He=(0,u.useMemo)(()=>{let e={},t=Object.keys(De),n=t.length;for(let r=0;r<n;r++){let n=t[r];e[n]=Ve(De[n],y)}return e},[L,y,De,b,r,a]),Ue=(0,u.useMemo)(()=>je.left===0?null:(0,d.jsx)(_,{linePoints:[0,0,0,ge+1],bounds:{x:je.left,y:0,width:1,height:ge+1},...h}),[L,je.left,ge,h]),We=(0,u.useMemo)(()=>je.top===0?null:(0,d.jsx)(_,{linePoints:[0,0,he+1,0],bounds:{x:0,y:je.top,width:he+1,height:1},...g}),[L,je.top,he,g]),Ge=(0,u.useRef)(!1),Ke=(0,u.useMemo)(()=>{if(!Ae)return null;let e=(e,t)=>{let r=e.anchor,i=t.getPaneBounds(),a=je.left>0,o=je.top>0,s=o&&(r===n.A.Center||r===n.A.Left),c=o&&(r===n.A.Top||r===n.A.TopLeft),l=a&&(r===n.A.Center||r===n.A.Top),f=a&&(r===n.A.Left||r===n.A.TopLeft),p=1e6,m=s?-1:-1e6,h=l?-1:-1e6,g=f?i.width+2:p,_=c?i.height+2:p,v=s||c||l||f,y={position:`absolute`,left:i.x,top:i.y,width:i.width,height:i.height,clip:v?`rect(${m}px, ${g}px, ${_}px, ${h}px)`:void 0};return(0,d.jsx)(K,{pane:t,viewport:G,children:e.elemStage?(0,u.cloneElement)(e.elemStage,{style:y},He?.[r]):null},`pane:${r}`)},t=Ee.length,r=Array(t);for(let n=0;n<t;n++){let t=Ee[n],i=t.anchor,a=De[i];r[n]=a?e(t,a):null}return(0,d.jsxs)(d.Fragment,{children:[r,Ue,We]})},[De,Ee,He,he,ge,Ae,je]);return(0,u.useEffect)(()=>{!Ge.current&&Ke&&Ae&&(Ge.current=!0,N?.(Be.current))},[Ke,Ae]),(0,d.jsx)(`div`,{ref:Be,className:w(C,`grid-surface`,ee),style:{overflow:`hidden`,...T},...A,children:(0,d.jsx)(Y,{children:Ke})})}));X.displayName=`GridSurface`;var te=Object.freeze({getColOffset:e=>75*e,getColIndex:e=>Math.floor(e/75),getRowOffset:e=>20*e,getRowIndex:e=>Math.floor(e/20)}),ne=0,re=20,ie=150,ae=Object.freeze({bottom:-4,right:-4}),oe=Object.freeze({horizontal:!0,vertical:!0}),se=Object.freeze({horizontal:!0,vertical:!1}),ce=Object.freeze({horizontal:!1,vertical:!0}),le=Object.freeze({horizontal:!1,vertical:!1}),ue=[n.A.TopLeft,n.A.Top,n.A.Left,n.A.Center];function Z(){let e=(0,u.useContext)(G);if(!e)throw Error(`useGridPane must be used within a GridPaneProvider`);return e.pane}function de(){return(0,u.useContext)(G)?.pane??null}function Q(e,t){let n=(0,u.useContext)(J),r=(0,u.useRef)(null);r.current||=q();let i=n??r.current,a=`k:${e}`,o=(0,u.useRef)(null);o.current===null&&(o.current={v:typeof t==`function`?t():t});let s=(0,u.useCallback)(()=>i.has(a)?i.get(a):o.current.v,[i,a]);return[(0,u.useSyncExternalStore)((0,u.useCallback)(e=>i.subscribe(a,e),[i,a]),s,s),(0,u.useCallback)(e=>{let t=i.has(a)?i.get(a):o.current.v;i.set(a,typeof e==`function`?e(t):e)},[i,a])]}var fe=()=>({zIndex:(0,u.useContext)(z),pane:de()}),pe=(0,u.memo)(e=>{let{onPointerDown:t,onPointerMove:n,onPointerUp:r,onPointerLeave:i,onMouseDown:a,onMouseEnter:o,onMouseLeave:s,onMouseMove:c,onMouseOut:l,onMouseOver:f,onMouseUp:p,onDoubleClick:m,onKeyDown:h,onKeyPress:g,onKeyUp:_,onFocus:v,onBlur:y,onContextMenu:b,zIndex:x,className:S,children:C}=e,w=(0,u.useContext)(B);(0,u.useEffect)(()=>{w&&!he&&(he=!0,console.error(`<Layer> nested inside another <Layer>. Layers exist only as direct children of the grid (law 4: the stack is flat) — a composite renders exactly one Layer at its root. For a full-view container inside a layer, use <VirtualDiv fill>. This error fires once.`))},[w]);let T=P(de()),E=(0,u.useContext)(z),D=(0,u.useRef)({});D.current={pointerdown:me(t),pointermove:me(n),pointerup:me(r),pointerleave:me(i),mousedown:me(a),mouseenter:me(o),mouseleave:me(s),mousemove:me(c),mouseout:me(l),mouseover:me(f),mouseup:me(p),dblclick:me(m),keydown:me(h),keypress:me(g),keyup:me(_),focus:me(v),blur:me(y),contextmenu:me(b)};let O=(0,u.useRef)(null);return(0,u.useEffect)(()=>{if(T)return T.registerResponder({zIndex:E,getElement:()=>O.current,getHandler:e=>D.current[e]})},[T,E]),(0,d.jsx)(`div`,{ref:O,className:S,onPointerDown:t,onPointerMove:n,onPointerUp:r,onMouseDown:a,onMouseMove:c,onMouseUp:p,onMouseOver:f,onMouseOut:l,onDoubleClick:m,onKeyDown:h,onKeyPress:g,onKeyUp:_,onContextMenu:b,children:C==null?null:(0,d.jsx)(B.Provider,{value:!0,children:C})})});pe.displayName=`Layer`;var me=e=>e?t=>e(t):void 0,he=!1,ge=!1,_e=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{range:n,bounds:r,fill:a=!1,clipInsets:o,disableAlign:s=!1,coverGridlines:c=!1,alignWidth:l,keepMounted:f=!1,className:p,style:m,children:g,..._}=e;(0,u.useContext)(B)||ve||(ve=!0,console.warn(`VirtualDiv rendered outside a <Layer>. The grid's children are Layers; place VirtualDivs inside one (law 4: the stack is flat). This warning fires once.`));let v=(0,u.useRef)(null),y=(0,u.useCallback)(e=>{v.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]);(({getElement:e,handlerProps:t})=>{let n=P(de()),r=(0,u.useContext)(z),i=!1;if(t){for(let e=0;e<j.length;e++)if(typeof t[j[e]]==`function`){i=!0;break}}let a=(0,u.useRef)({getElement:e,handlerProps:t});a.current={getElement:e,handlerProps:t},(0,u.useEffect)(()=>{if(n)return n.registerLayer({zIndex:r,getElement:()=>a.current.getElement(),hasHandlers:i,getHandler:i?e=>{let t=A[e];if(t===void 0)return;let n=a.current.handlerProps?.[t];return typeof n==`function`?e=>n(e):void 0}:void 0})},[n,i,r])})({getElement:()=>v.current,handlerProps:_});let b=(({range:e,bounds:t,fill:n,clipInsets:r})=>{let i=Z();if(!i)return null;let a=null,o=!1;if(e)a=i.getBoundsFromRange(e),o=i.toClipBounds(a,r)===null;else if(t)o=i.toClipBounds(t,r)===null,a=t;else{if(!n)return ge||(ge=!0,console.warn(`VirtualDiv: provide exactly one of 'range' | 'bounds' | 'fill'. (The implicit "no placement = pane-sized" fallback was removed — use 'fill'.) This warning fires once.`)),null;{let e=i.getPaneBounds();a={x:0,y:0,width:e.width,height:e.height}}}return a?{pane:i,raw:a,culled:o}:null})({range:n,bounds:r,fill:a,clipInsets:o});if(!b)return null;let{raw:x,culled:S}=b;if(S&&!f)return null;let C,T,E,D,O=i.kt.getDevicePixelRatio(),k=l!=null,M=k?l/O:0;if(s)C=x.x,T=x.y,E=x.width,D=x.height;else if(k){let e=i.kt.edgeCenter(x.x,`leading`,l,O),t=i.kt.edgeCenter(x.y,`leading`,l,O);C=e-M/2,T=t-M/2,E=i.kt.edgeCenter(x.x+x.width,`trailing`,l,O)-e+M,D=i.kt.edgeCenter(x.y+x.height,`trailing`,l,O)-t+M}else{let e=c?1/O:0;C=i.kt.snapDeviceEdge(x.x,O),T=i.kt.snapDeviceEdge(x.y,O),E=i.kt.snapDeviceEdge(x.x+x.width,O)+e-C,D=i.kt.snapDeviceEdge(x.y+x.height,O)+e-T}let{transform:N,...F}=m??{},I={x:x.x-C,y:x.y-T,width:x.width,height:x.height};return(0,d.jsx)(`div`,{className:w(p,`_virtual-div_16eab_1`),style:{width:`${E}px`,height:`${D}px`,...k?{boxSizing:`border-box`,borderWidth:`${M}px`,borderStyle:`solid`}:void 0,...F,transform:`translate(${C}px, ${T}px)${N?` ${N}`:``}`},..._,ref:y,children:g==null?null:(0,d.jsx)(h.Provider,{value:I,children:g})})}));_e.displayName=`VirtualDiv`;var ve=!1,ye=(e,t,n,r)=>({x:e,y:t,width:n,height:r,top:t,left:e,right:e+n,bottom:t+r}),be=ye(0,0,0,0),xe=e=>{let t=e.getElement()?.getBoundingClientRect?.();return{x:t?.left??0,y:t?.top??0}},Se=e=>{let t=e.getElement()?.getBoundingClientRect?.();return t?ye(t.left,t.top,t.width,t.height):be},Ce={side:`t`,align:`center`},we=[n.A.TopLeft,n.A.Top,n.A.Left,n.A.Center],Te=new Set([n.A.Top,n.A.TopLeft]),Ee=new Set([n.A.Left,n.A.TopLeft]),De=(e,t,n,r,i)=>{let a=null,o=null,s=1/0,c=!1;for(let l=0;l<we.length;l++){let u=e[we[l]];if(!u)continue;let d=u.getVisibleRange(),f=t===`row`?d.rowStart:d.colStart,p=t===`row`?d.rowEnd:d.colEnd;if(n>p||r<f)continue;c=!0,!a&&i>=f&&i<=p&&(a=u);let m=i<f?f-i:i>p?i-p:0;m<s&&(s=m,o=u)}return{pane:a??o,visible:c}},Oe=(e,t)=>{let r=Te.has(e.getAnchor()),i=Ee.has(t.getAnchor());return r&&i?n.A.TopLeft:r?n.A.Top:i?n.A.Left:n.A.Center},ke=(e,t)=>{let n=Se(e),r=e.getBoundsFromRange(t);return ye(n.left+r.x,n.top+r.y,r.width,r.height)},Ae=(e,t)=>{let n=(t.left+t.right)/2,r=(t.top+t.bottom)/2;return r<e.top?`t`:r>e.bottom?`b`:n<e.left?`l`:n>e.right?`r`:null},je=(e,t,r=`data`,i=0,a=Ce,o=`hide`)=>{if(!e)return{rect:be,clipped:!0,boundaryRect:be,clampedTo:null,anchorPoint:{x:0,y:0},owner:null,slid:null,outOfView:!0};let s=((e,t)=>{if(t&&typeof t==`object`){let e=t;return ye(e.x,e.y,e.width,e.height)}if(t===`viewport`){let t=e.getElement()?.ownerDocument?.documentElement;if(t)return ye(0,0,t.clientWidth,t.clientHeight)}if(t===`pane`){let t=xe(e),n=e.getPaneBounds();return ye(t.x,t.y,n.width,n.height)}let n=e.getAllPanes(),r=1/0,i=1/0,a=-1/0,o=-1/0;for(let e of Object.keys(n)){let t=n[e]?.getElement()?.getBoundingClientRect?.();t&&(r=Math.min(r,t.left),i=Math.min(i,t.top),a=Math.max(a,t.right),o=Math.max(o,t.bottom))}if(r===1/0){let t=xe(e),n=e.getPaneBounds();return ye(t.x,t.y,n.width,n.height)}return ye(r,i,a-r,o-i)})(e,r),c=e=>{if(i<=0)return!1;let t=(n=e,r=s,{w:Math.min(n.right,r.right)-Math.max(n.left,r.left),h:Math.min(n.bottom,r.bottom)-Math.max(n.top,r.top)});var n,r;return t.w<=i||t.h<=i};if(`point`in t){let n=ye(t.point.x,t.point.y,0,0),r=Ae(s,n),i=e.getPaneFromPointer(t.point.x,t.point.y);return{rect:n,clipped:r!==null,boundaryRect:s,clampedTo:r,anchorPoint:{...t.point},owner:i?.getAnchor()??null,slid:null,outOfView:!1}}if(`edge`in t){let n=xe(e),r=e.getPaneBounds(),i=n.x+r.width/2,a=n.y+r.height/2;t.edge===`t`?a=n.y:t.edge===`b`?a=n.y+r.height:t.edge===`l`?i=n.x:t.edge===`r`&&(i=n.x+r.width);let o=e.getPaneFromPointer(i,a)??e;return{rect:ye(i,a,0,0),clipped:!1,boundaryRect:s,clampedTo:null,anchorPoint:{x:i,y:a},owner:o.getAnchor(),slid:null,outOfView:!1}}if(`bounds`in t){let n=xe(e),r=t.bounds,i=e.toClipBounds(r,0),o=ye(n.x+r.x,n.y+r.y,r.width,r.height),u=i===null||c(o),d=((e,t)=>{let{side:n,align:r=`center`}=t;if(n===`t`||n===`b`){let t=n===`t`?e.top:e.bottom;return{x:r===`start`?e.left:r===`end`?e.right:(e.left+e.right)/2,y:t}}return{x:n===`l`?e.left:e.right,y:r===`start`?e.top:r===`end`?e.bottom:(e.top+e.bottom)/2}})(o,a);return{rect:o,clipped:u,boundaryRect:s,clampedTo:Ae(s,(l=d,ye(l.x,l.y,0,0))),anchorPoint:d,owner:e.getAnchor(),slid:null,outOfView:u}}var l;let u,d,f=(e=>{if(`range`in e)return e.range;if(`cell`in e){let{rowIndex:t,colIndex:n}=e.cell;return{rowStart:t,colStart:n,rowEnd:t,colEnd:n}}return null})(t),p=e.getAllPanes(),m=((e,t)=>{let{side:n,align:r=`center`}=t,i=Math.round((e.rowStart+e.rowEnd)/2),a=Math.round((e.colStart+e.colEnd)/2);if(n===`t`||n===`b`)return{rowIndex:n===`t`?e.rowStart:e.rowEnd,colIndex:r===`start`?e.colStart:r===`end`?e.colEnd:a};let o=n===`l`?e.colStart:e.colEnd;return{rowIndex:r===`start`?e.rowStart:r===`end`?e.rowEnd:i,colIndex:o}})(f,a),h=De(p,`row`,f.rowStart,f.rowEnd,m.rowIndex),g=De(p,`col`,f.colStart,f.colEnd,m.colIndex),_=h.visible&&g.visible,v=h.pane??p[n.A.Center]??e,y=g.pane??p[n.A.Center]??e,b=ke(v,f),x=ke(y,f),{side:S,align:C=`center`}=a;S===`t`||S===`b`?(d=S===`t`?b.top:b.bottom,u=C===`start`?x.left:C===`end`?x.right:(x.left+x.right)/2):(u=S===`l`?x.left:x.right,d=C===`start`?b.top:C===`end`?b.bottom:(b.top+b.bottom)/2);let w=Se(y),T=Se(v),E=e=>Math.max(w.left,Math.min(w.right,e)),D=e=>Math.max(T.top,Math.min(T.bottom,e)),O=E(u),k=D(d),A={x:O,y:k},j=E(x.left),M=D(b.top),N=ye(j,M,E(x.right)-j,D(b.bottom)-M),P=O-u,F=k-d,I=Math.abs(F)>=Math.abs(P)?F<0?`b`:F>0?`t`:P<0?`r`:P>0?`l`:null:P<0?`r`:P>0?`l`:F<0?`b`:F>0?`t`:null,L=P||F?{dx:P,dy:F,distance:Math.hypot(P,F),direction:I??`t`}:null;return _||o!==`hide`?{rect:N,clipped:!1,boundaryRect:s,clampedTo:I,anchorPoint:A,owner:Oe(v,y),slid:L,outOfView:!_}:{rect:N,clipped:!0,boundaryRect:s,clampedTo:I,anchorPoint:A,owner:null,slid:null,outOfView:!0}},Me=(0,u.createContext)(null),Ne=e=>{let{anchor:t,placement:r=Ce,boundary:i=`data`,whenOff:a=`hide`,minVisible:o=0,children:s}=e,{reference:c,getBoundaryRect:l,getAnchorPoint:f,anchorPoint:p,owner:m,clipped:h,slid:g,outOfView:_,pane:v}=((e,t)=>{let n=de(),r=t?.pane??n,i=t?.boundary??`data`,a=t?.minVisible??0,o=t?.placement??Ce,s=t?.whenOff??`hide`,c=(0,u.useRef)({pane:r,anchor:e,boundary:i,minVisible:a,placement:o,whenOff:s});c.current={pane:r,anchor:e,boundary:i,minVisible:a,placement:o,whenOff:s};let l=(0,u.useMemo)(()=>({reference:{get contextElement(){return c.current.pane?.getElement()??void 0},getBoundingClientRect:()=>{let e=c.current;return je(e.pane,e.anchor,e.boundary,e.minVisible,e.placement,e.whenOff).rect}},getBoundaryRect:()=>{let e=c.current;return je(e.pane,e.anchor,e.boundary,e.minVisible,e.placement,e.whenOff).boundaryRect},getAnchorPoint:()=>{let e=c.current;return je(e.pane,e.anchor,e.boundary,e.minVisible,e.placement,e.whenOff).anchorPoint}}),[]),d=je(r,e,i,a,o,s);return{reference:l.reference,getBoundaryRect:l.getBoundaryRect,getAnchorPoint:l.getAnchorPoint,clipped:d.clipped,clampedTo:d.clampedTo,anchorPoint:d.anchorPoint,owner:d.owner,slid:d.slid,outOfView:d.outOfView,pane:r}})(t,{boundary:i,whenOff:a,minVisible:o,placement:r}),y=v!=null&&(m==null?v.getAnchor()===n.A.Center:v.getAnchor()===m),b=null;y&&v&&(`range`in t?b=v.getBoundsFromRange(t.range):`cell`in t?b=v.getBoundsFromRange({rowStart:t.cell.rowIndex,colStart:t.cell.colIndex,rowEnd:t.cell.rowIndex,colEnd:t.cell.colIndex}):`bounds`in t&&(b=t.bounds));let x=(0,u.useRef)(t);x.current=t;let S=(0,u.useRef)(v);S.current=v;let C=(0,u.useCallback)(e=>{let t=Pe(x.current),n=S.current;return n&&t?n.scrollCellCoordsIntoView(t,e):Promise.resolve(void 0)},[]),w=(0,u.useMemo)(()=>({reference:c,getBoundaryRect:l,getAnchorPoint:f,anchorPoint:p,bounds:b,owner:m,isOwner:y,clipped:h,slid:g,outOfView:_,placement:r,pane:v,scrollIntoView:C}),[c,l,f,p.x,p.y,b?.x,b?.y,b?.width,b?.height,m,y,h,g,_,r.side,r.align,v,C]),T=y&&!h&&v!=null,E=typeof s!=`function`,D=(0,u.useRef)(null),O=(0,u.useRef)(null),k=null;if(T&&!E)k=s(w);else if(T){let e=v.getElement()?.getBoundingClientRect();k=(0,d.jsx)(`div`,{ref:D,className:`sticky-layer`,style:{position:`absolute`,left:0,top:0,transform:`translate3d(${p.x-(e?.left??0)}px, ${p.y-(e?.top??0)}px, 0) ${Fe(r)}`,willChange:`transform`},children:(0,d.jsx)(`div`,{ref:O,children:s})})}return(0,u.useLayoutEffect)(()=>{let e=D.current,t=O.current;if(!(e&&t&&T&&v))return;let n=e.getBoundingClientRect(),r=v.getElement()?.getBoundingClientRect();if(!r)return;let i=0,a=0;n.left<r.left?i=r.left-n.left:n.right>r.right&&(i=Math.min(0,r.right-n.right)),n.top<r.top?a=r.top-n.top:n.bottom>r.bottom&&(a=Math.min(0,r.bottom-n.bottom)),t.style.transform=i||a?`translate(${i}px, ${a}px)`:``}),(0,d.jsx)(Me.Provider,{value:w,children:k})},Pe=e=>`range`in e?{rowIndex:e.range.rowStart,colIndex:e.range.colStart}:`cell`in e?{rowIndex:e.cell.rowIndex,colIndex:e.cell.colIndex}:null,Fe=e=>{let{side:t,align:n=`center`}=e,r=`-50%`,i=`-50%`;t===`t`?i=`-100%`:t===`b`?i=`0%`:t===`l`?r=`-100%`:t===`r`&&(r=`0%`);let a=n===`start`?`0%`:n===`end`?`-100%`:`-50%`;return t===`t`||t===`b`?r=a:i=a,`translate(${r}, ${i})`};Ne.displayName=`StickyAnchor`;var Ie=Math.min,Le=Math.max,Re=Math.round,ze=Math.floor,Be=e=>({x:e,y:e}),Ve={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function He(e,t){return typeof e==`function`?e(t):e}function Ue(e){return e.split(`-`)[0]}function We(e){return e.split(`-`)[1]}function Ge(e){return e===`x`?`y`:`x`}function Ke(e){return e===`y`?`height`:`width`}function qe(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Je(e){return Ge(qe(e))}function Ye(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Xe=[`left`,`right`],Ze=[`right`,`left`],Qe=[`top`,`bottom`],$e=[`bottom`,`top`];function et(e){let t=Ue(e);return Ve[t]+e.slice(t.length)}function tt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function nt(e,t,n){let r,{reference:i,floating:a}=e,o=qe(t),s=Je(t),c=Ke(s),l=Ue(t),u=o===`y`,d=i.x+i.width/2-a.width/2,f=i.y+i.height/2-a.height/2,p=i[c]/2-a[c]/2;switch(l){case`top`:r={x:d,y:i.y-a.height};break;case`bottom`:r={x:d,y:i.y+i.height};break;case`right`:r={x:i.x+i.width,y:f};break;case`left`:r={x:i.x-a.width,y:f};break;default:r={x:i.x,y:i.y}}let m=We(t);return m&&(r[s]+=p*(m===`end`?1:-1)*(n&&u?-1:1)),r}async function rt(e,t){var n;t===void 0&&(t={});let{x:r,y:i,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:l=`clippingAncestors`,rootBoundary:u=`viewport`,elementContext:d=`floating`,altBoundary:f=!1,padding:p=0}=He(t,e),m=function(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:function(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}(e)}(p),h=s[f?d===`floating`?`reference`:`floating`:d],g=tt(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(h)))==null||n?h:h.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:l,rootBoundary:u,strategy:c})),_=d===`floating`?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,v=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),y=await(a.isElement==null?void 0:a.isElement(v))&&await(a.getScale==null?void 0:a.getScale(v))||{x:1,y:1},b=tt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:_,offsetParent:v,strategy:c}):_);return{top:(g.top-b.top+m.top)/y.y,bottom:(b.bottom-g.bottom+m.bottom)/y.y,left:(g.left-b.left+m.left)/y.x,right:(b.right-g.right+m.right)/y.x}}var it,at=new Set([`left`,`top`]);function ot(){return typeof window<`u`}function st(e){return ut(e)?(e.nodeName||``).toLowerCase():`#document`}function ct(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function lt(e){return((ut(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ut(e){return!!ot()&&(e instanceof Node||e instanceof ct(e).Node)}function dt(e){return!!ot()&&(e instanceof Element||e instanceof ct(e).Element)}function ft(e){return!!ot()&&(e instanceof HTMLElement||e instanceof ct(e).HTMLElement)}function pt(e){return!(!ot()||typeof ShadowRoot>`u`)&&(e instanceof ShadowRoot||e instanceof ct(e).ShadowRoot)}function mt(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Ct(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ht(e){return/^(table|td|th)$/.test(st(e))}function gt(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var _t=/transform|translate|scale|rotate|perspective|filter/,vt=/paint|layout|strict|content/,yt=e=>!!e&&e!==`none`;function bt(e){let t=dt(e)?Ct(e):e;return yt(t.transform)||yt(t.translate)||yt(t.scale)||yt(t.rotate)||yt(t.perspective)||!xt()&&(yt(t.backdropFilter)||yt(t.filter))||_t.test(t.willChange||``)||vt.test(t.contain||``)}function xt(){return it??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),it}function St(e){return/^(html|body|#document)$/.test(st(e))}function Ct(e){return ct(e).getComputedStyle(e)}function wt(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tt(e){if(st(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||pt(e)&&e.host||lt(e);return pt(t)?t.host:t}function Et(e){let t=Tt(e);return St(t)?(e.ownerDocument||e).body:ft(t)&&mt(t)?t:Et(t)}function Dt(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Et(e),i=r===e.ownerDocument?.body,a=ct(r);if(i){let e=Ot(a);return t.concat(a,a.visualViewport||[],mt(r)?r:[],e&&n?Dt(e):[])}return t.concat(r,Dt(r,[],n))}function Ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function kt(e){let t=Ct(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ft(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Re(n)!==a||Re(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function At(e){return dt(e)?e:e.contextElement}function jt(e){let t=At(e);if(!ft(t))return Be(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=kt(t),o=(a?Re(n.width):n.width)/r,s=(a?Re(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Mt=Be(0);function Nt(e){let t=ct(e);return xt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Mt}function Pt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=At(e),o=Be(1);t&&(r?dt(r)&&(o=jt(r)):o=jt(e));let s=function(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ct(e)}(a,n,r)?Nt(a):Be(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=ct(a),t=dt(r)?ct(r):r,n=e,i=Ot(n);for(;i&&t!==n;){let e=jt(i),t=i.getBoundingClientRect(),r=Ct(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=ct(i),i=Ot(n)}}return tt({width:u,height:d,x:c,y:l})}function Ft(e,t){let n=wt(e).scrollLeft;return t?t.left+n:Pt(lt(e)).left+n}function It(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ft(e,n),y:n.top+t.scrollTop}}function Lt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=function(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=ct(e),a=lt(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!xt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Ft(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=25&&(s-=o)}return{width:s,height:c,x:l,y:u}}(e,n,t);else if(t===`document`)r=function(e){let t=wt(e),n=e.ownerDocument.body,r=Le(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Le(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Ft(e),o=-t.scrollTop;return Ct(n).direction===`rtl`&&(a+=Le(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}(lt(e));else if(dt(t))r=function(e,t){let n=Pt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=jt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}(t,n);else{let n=Nt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return tt(r)}function Rt(e,t){let n=t.get(e);if(n)return n;let r=Dt(e,[],!1).filter(e=>dt(e)&&st(e)!==`body`),i=null,a=Ct(e).position===`fixed`,o=a?Tt(e):e;for(;dt(o)&&!St(o);){let e=Ct(o),t=bt(o),n=i?i.position:a?`fixed`:``;t||n!==`fixed`&&(n!==`absolute`||e.position!==`static`)?i=e:r=r.filter(e=>e!==o),o=Tt(o)}return t.set(e,r),r}function zt(e,t,n){let r=ft(t),i=lt(t),a=n===`fixed`,o=Pt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=Be(0);if((r||!a)&&((st(t)!==`body`||mt(i))&&(s=wt(t)),r)){let e=Pt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Ft(i));let l=!i||r||a?Be(0):It(i,s);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Bt(e){return Ct(e).position===`static`}function Vt(e,t){if(!ft(e)||Ct(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return lt(e)===n&&(n=n.ownerDocument.body),n}function Ht(e,t){let n=ct(e);if(gt(e))return n;if(!ft(e)){let t=Tt(e);for(;t&&!St(t);){if(dt(t)&&!Bt(t))return t;t=Tt(t)}return n}let r=Vt(e,t);for(;r&&ht(r)&&Bt(r);)r=Vt(r,t);return r&&St(r)&&Bt(r)&&!bt(r)?n:r||function(e){let t=Tt(e);for(;ft(t)&&!St(t);){if(bt(t))return t;if(gt(t))return null;t=Tt(t)}return null}(e)||n}var Ut={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=lt(r),s=!!t&&gt(t.floating);if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Be(1),u=Be(0),d=ft(r);if((d||!a)&&((st(r)!==`body`||mt(o))&&(c=wt(r)),d)){let e=Pt(r);l=jt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=!o||d||a?Be(0):It(o,c);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}},getDocumentElement:lt,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?gt(t)?[]:Rt(t,this._c):[].concat(n),r],o=Lt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Lt(t,a[e],i);s=Le(n.top,s),c=Ie(n.right,c),l=Ie(n.bottom,l),u=Le(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}},getOffsetParent:Ht,getElementRects:async function(e){let t=this.getOffsetParent||Ht,n=this.getDimensions,r=await n(e.floating);return{reference:zt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){let{width:t,height:n}=kt(e);return{width:t,height:n}},getScale:jt,isElement:dt,isRTL:function(e){return Ct(e).direction===`rtl`}};function Wt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=At(e),u=i||a?[...l?Dt(l):[],...t?Dt(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d,f=l&&s?function(e,t,n){let r,i=null,a=lt(e);function o(){var e;clearTimeout(r),(e=i)==null||e.disconnect(),i=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m={rootMargin:-ze(d)+`px `+-ze(a.clientWidth-(u+f))+`px `+-ze(a.clientHeight-(d+p))+`px `+-ze(u)+`px`,threshold:Le(0,Ie(1,c))||1},h=!0;function g(t){let n=t[0].intersectionRatio;if(!Wt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!h)return s();n?s(!1,n):r=setTimeout(()=>{s(!1,1e-7)},1e3)}h=!1}try{i=new IntersectionObserver(g,{...m,root:a.ownerDocument})}catch{i=new IntersectionObserver(g,m)}i.observe(e)}let c=ct(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}(l,n,a):null,p=-1,m=null;o&&(m=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&m&&t&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;(e=m)==null||e.observe(t)})),n()}),l&&!c&&m.observe(l),t&&m.observe(t));let h=c?Pt(e):null;return c&&function t(){let r=Pt(e);h&&!Wt(h,r)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),f?.(),(e=m)==null||e.disconnect(),m=null,c&&cancelAnimationFrame(d)}}var Kt=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=He(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Ue(r),_=qe(o),v=Ue(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[et(o)]:function(e){let t=et(e);return[Ye(e),t,Ye(t)]}(o)),x=p!==`none`;!d&&x&&b.push(...function(e,t,n,r){let i=We(e),a=function(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ze:Xe:t?Xe:Ze;case`left`:case`right`:return t?Qe:$e;default:return[]}}(Ue(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ye)))),a}(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=function(e,t,n){n===void 0&&(n=!1);let r=We(e),i=Je(e),a=Ke(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=et(o)),[o,et(o)]}(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===qe(t)||T.every(e=>qe(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=qe(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},qt=typeof document<`u`?u.useLayoutEffect:function(){};function Jt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof||Jt(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Yt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xt(e,t){let n=Yt(e);return Math.round(t*n)/n}function Zt(e){let t=u.useRef(e);return qt(()=>{t.current=e}),t}function Qt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[d,p]=u.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=u.useState(r);Jt(m,r)||h(r);let[g,_]=u.useState(null),[v,y]=u.useState(null),b=u.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=u.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=u.useRef(null),T=u.useRef(null),E=u.useRef(d),D=c!=null,O=Zt(c),k=Zt(i),A=Zt(l),j=u.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),((e,t,n)=>{let r=new Map,i=n??{},a={...Ut,...i.platform,_c:r};return(async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:rt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=nt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<50&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=!0===x.rects?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=nt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}})(e,t,{...i,platform:a})})(w.current,T.current,e).then(e=>{let t={...e,isPositioned:!1!==A.current};M.current&&!Jt(E.current,t)&&(E.current=t,f.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);qt(()=>{!1===l&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[l]);let M=u.useRef(!1);qt(()=>(M.current=!0,()=>{M.current=!1}),[]),qt(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=u.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=u.useMemo(()=>({reference:S,floating:C}),[S,C]),F=u.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Xt(P.floating,d.x),r=Xt(P.floating,d.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Yt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,d.x,d.y]);return u.useMemo(()=>({...d,update:j,refs:N,elements:P,floatingStyles:F}),[d,j,N,P,F])}var $t=(e,t)=>{let n=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await async function(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Ue(n),s=We(n),c=qe(n)===`y`,l=at.has(o)?-1:1,u=a&&c?-1:1,d=He(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?-1*m:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>{let n=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=He(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=qe(i),p=Ge(f),m=u[p],h=u[f],g=(e,t)=>{return n=t+d[e===`y`?`top`:`left`],r=t,i=t-d[e===`y`?`bottom`:`right`],Le(n,Ie(r,i));var n,r,i};o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},tn=(e,t)=>{let n=Kt(e);return{name:n.name,fn:n.fn,options:[e,t]}},nn=e=>{let t=i.Ft(),n=i.Ht(),r=e?.getElement(),a={},o=r?.closest(`[${i.Yt}]`)?.getAttribute(i.Yt),s=r?.closest(`[${i.Ut}]`)?.getAttribute(i.Ut);o&&(a[`data-sxl-theme-mode`]=o),s&&(a[`data-sxl-theme-surface`]=s);let c=[...t?.themeScope?.classes??[],n?.scopeClass].filter(Boolean);return{className:c.length?c.join(` `):void 0,attrs:a}},rn=e=>{let{side:t,align:n=`center`}=e;return(t===`t`?`top`:t===`b`?`bottom`:t===`l`?`left`:`right`)+(n===`start`?`-start`:n===`end`?`-end`:``)},an=e=>{let{state:t,offset:n,alignOffset:r,open:a,container:o,className:s,style:c,zIndex:l,children:p}=e,{getPortalContainer:m}=i.Z(),{className:h,attrs:g}=nn(t.pane),{getBoundaryRect:_}=t,v=(0,u.useMemo)(()=>[$t({mainAxis:n,alignmentAxis:r}),tn(()=>({boundary:_()})),en(()=>({boundary:_(),padding:4}))],[n,r,_]),{refs:y,floatingStyles:b,update:x}=Qt({placement:rn(t.placement),strategy:`fixed`,elements:{reference:t.reference},whileElementsMounted:Gt,middleware:v});if((0,u.useLayoutEffect)(()=>{x()},[t,x]),!a)return null;let S=typeof p==`function`?p(t):p;return(0,f.createPortal)((0,d.jsx)(`div`,{ref:y.setFloating,className:[s,h].filter(Boolean).join(` `)||void 0,...g,style:{...b,zIndex:l,...c},children:S}),o??m())},on=e=>{let{anchor:t,placement:n,whenOff:r,boundary:i,minVisible:a,offset:o=4,alignOffset:s=0,open:c=!0,container:l,className:u,style:f,zIndex:p=1250,children:m}=e;return(0,d.jsx)(Ne,{anchor:t,placement:n,whenOff:r,boundary:i,minVisible:a,children:e=>(0,d.jsx)(an,{state:e,offset:o,alignOffset:s,open:c,container:l,className:u,style:f,zIndex:p,children:m})})};on.displayName=`StickyFloat`;var sn=e=>{let[t,n]=(e??`bottom-start`).split(`-`);return{side:t===`top`?`t`:t===`left`?`l`:t===`right`?`r`:`b`,align:n===`start`?`start`:n===`end`?`end`:`center`}},cn={update:()=>{}},ln=e=>{let{open:t,anchorEl:n,floatReference:r,createPopupPanel:a,propsPopper:o,onMount:s,onOpening:c,onOpen:l,onClosing:f,onClose:p,children:m,className:h,label:g,anchorPosition:_,...v}=e,y=(0,u.useRef)(null),[b,x]=(0,u.useState)(),S=i.X(s??(()=>{}),[s]),C=i.X(c??(()=>{}),[c]),w=i.X(l??(()=>{}),[l]),T=i.X(f??(()=>{}),[f]),E=i.X(p??(()=>{}),[p]);(0,u.useEffect)(()=>{if(t){let e=y.current;if(!e)return;x(e),S(e,cn),C(),w();return}T(),E()},[t]);let D=i.X(()=>{r?.close(0)},[r]),O=o?.offsets;return(0,d.jsx)(on,{anchor:n,placement:sn(o?.placement),offset:O?.[1]??2,alignOffset:O?.[0]??0,zIndex:1300,children:e=>(0,d.jsxs)(`div`,{onKeyDown:o?.onKeyDown,onMouseEnter:o?.onMouseEnter,children:[(0,d.jsx)(i.Kt,{ref:y,className:h,floatReference:r,popupContainer:b,createPopupPanel:a,...v,children:m}),(0,d.jsx)(un,{outOfView:t&&e.outOfView,close:D})]})})};ln.displayName=`GridFloatPanel`;var un=({outOfView:e,close:t})=>((0,u.useEffect)(()=>{e&&t()},[e]),null),dn=e=>(0,d.jsx)(ln,{...e}),fn={pointerEvents:`auto`},pn=(e={})=>{let{openDelay:t=300,closeDelay:n=150}=e,[r,i]=(0,u.useState)(!1),a=(0,u.useRef)(!1),o=(0,u.useRef)(null),s=(0,u.useRef)(!1),c=(0,u.useRef)(null),l=(0,u.useRef)(null),d=e=>{a.current=e,i(e)},f=()=>{c.current&&=(clearTimeout(c.current),null)},p=()=>{l.current&&=(clearTimeout(l.current),null)},m=(0,u.useCallback)(()=>{f(),p(),l.current=setTimeout(()=>{l.current=null,s.current||o.current!==null||d(!1)},n)},[n]),h=(0,u.useCallback)(e=>{if(e!==o.current)if(o.current=e,e!==null){if(p(),a.current)return;f(),c.current=setTimeout(()=>{c.current=null,o.current!==null&&d(!0)},t)}else m()},[t,m]),g=(0,u.useCallback)(()=>{f(),p(),o.current=null,s.current=!1,d(!1)},[]),_=(0,u.useMemo)(()=>({onPointerEnter:()=>{s.current=!0,p()},onPointerLeave:()=>{s.current=!1,m()},style:fn}),[m]);return(0,u.useEffect)(()=>()=>{f(),p()},[]),{open:r,setTarget:h,tipProps:_,close:g}},mn={target:null,aimed:null},hn=e=>({key:e.key??R(e.range),range:e.range,data:e.data,placement:e.placement}),gn=(e,t)=>Array.isArray(e)?e.includes(t):e===t,_n=e=>{let t=e.getCoords();return t?`${t.rowIndex},${t.colIndex}`:null},vn=e=>{let{activateOn:t,name:n,probe:r,selection:a,target:o,dismiss:s,placement:c,offset:l=6,alignOffset:f=0,openDelay:p=300,closeDelay:m=150,whenOff:h=`hide`,boundary:g,zIndex:_,children:v,className:y,style:b}=e,x=Z(),S=(0,u.useContext)(z),C=gn(t,`hover`),T=gn(t,`selection`),E=o!==void 0,{open:D,setTarget:O,tipProps:k,close:A}=pn({openDelay:p,closeDelay:m}),[j,M]=Q(`range-float:${n??S}`,mn),N=i.X(()=>{M(e=>e.aimed===null?e:{target:e.target,aimed:null})},[M]),P=i.X(e=>{let t=x.getCellFromPointer(e.clientX,e.clientY),n=t?r?.(t,x):null;if(!n?.range)return void N();let i=hn(n);M(e=>e.aimed===i.key&&e.target?.key===i.key?e:{target:i,aimed:i.key})},[x,r,M,N]),F=C?j.aimed:null;(0,u.useEffect)(()=>{O(F)},[F,O]),(0,u.useEffect)(()=>{s&&(A(),M(mn))},[s,A,M]);let I=i.in(T?a:void 0,_n),L=null;if(T&&!s&&a&&I!==null){let e=r?.(a.getCoords(),x);e&&e.range&&(L=hn(e))}let R=C?j.target:null,B=D&&R!==null,V=E?o===null?null:hn(o):B?R:L??R,H=E?V!==null:B||L!==null;return(0,d.jsx)(pe,{className:w(y,`range-float`),onPointerMove:C?P:void 0,onPointerLeave:C?N:void 0,children:V&&(0,d.jsx)(on,{anchor:{range:V.range},placement:V.placement??c,offset:l,alignOffset:f,boundary:g,zIndex:_,open:H,whenOff:h,style:b,children:e=>v({range:V.range,data:V.data,floatProps:k,state:e})})})};vn.displayName=`RangeFloatLayer`;var yn=e=>{let{children:t,className:n,...r}=e;return(0,d.jsx)(vn,{...r,activateOn:`hover`,className:w(n,`hover-tip`),children:({range:e,data:n,floatProps:r,state:i})=>t({range:e,data:n,tipProps:r,state:i})})};yn.displayName=`HoverTipLayer`;var bn={stroke:`var(--sxl-color-primary, rgb(33, 115, 70))`,alignWidth:2,fill:`color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) 10%, transparent)`},xn=(0,u.memo)(e=>{let{range:t,hole:n,clipInsets:r,alignWidth:a=1,animatedTransition:o,className:s,...c}=e,l=i.kt.getDevicePixelRatio(),u=a/l,f=r??-u/2,p=de(),m=p?p.getBoundsFromRange(t):null,h=u+4;if(p&&m&&!p.toClipBounds(m,f))return null;let g,_=p?p.getPaneBounds():null,y=_?{x:-h,y:-h,width:_.width+2*h,height:_.height+2*h}:m,b=y?i.kt.snapDeviceEdge(y.x,l):0,x=y?i.kt.snapDeviceEdge(y.y,l):0;if(m&&y){let e=u+2,t=Math.max(m.x,y.x-e),n=Math.max(m.y,y.y-e);g={x:t-b,y:n-x,width:Math.min(m.x+m.width,y.x+y.width+e)-t,height:Math.min(m.y+m.height,y.y+y.height+e)-n}}let S=n&&p?p.getBoundsFromRange(n):null,C=S?{x:S.x-b,y:S.y-x,width:S.width,height:S.height}:void 0;return(0,d.jsx)(_e,{className:w(s),bounds:y??void 0,clipInsets:f,style:{pointerEvents:`none`},children:(0,d.jsx)(v,{bounds:g,alignWidth:a,hole:C,animatedTransition:o,...c})})});xn.displayName=`RangeRect`;var Sn=(0,u.memo)(e=>{let{range:t,axis:r,color:a=`var(--sxl-color-primary, rgb(33, 115, 70))`,alignWidth:o=3,capExtent:s=3,transitionDuration:c=100,transitionEasing:l=`cubic-bezier(0.16, 1, 0.3, 1)`,axisDuration:u=70}=e,f=de(),p=f?.getBoundsFromRange(t);if(!f||!p)return null;let m=i.kt.getDevicePixelRatio(),h=o/m,g=s/m,_=f.getPaneBounds(),v=e=>e.x>=-g&&e.y>=-g&&e.x+e.width<=_.width+g&&e.y+e.height<=_.height+g,y=c>0?`${c}ms ${l}`:null,b=u>0?`${u}ms ${l}`:null,x=[y&&`transform ${y}, width ${y}, height ${y}, background-color ${y}`,b&&`scale ${b}`].filter(Boolean).join(`, `);return(0,d.jsx)(d.Fragment,{children:[!0,!1].map(e=>(e=>{let t=e?{x:p.x,y:p.y-h/2,width:p.width,height:h}:{x:p.x-h/2,y:p.y,width:h,height:p.height},n=h+2*g,r=e?{start:{x:t.x,y:t.y-g,width:h,height:n},end:{x:t.x+t.width-h,y:t.y-g,width:h,height:n}}:{start:{x:t.x-g,y:t.y,width:n,height:h},end:{x:t.x-g,y:t.y+t.height-h,width:n,height:h}};return[[`insert-bar`,f.toClipBounds(t,-h)],[`insert-bar-cap-start`,v(r.start)?r.start:null],[`insert-bar-cap-end`,v(r.end)?r.end:null]]})(e).map(([t,i])=>i&&(0,d.jsx)(_e,{className:w(t,e?`row`:`column`),bounds:i,style:{pointerEvents:`none`,background:a,scale:+(e===(r===n.R.Row)),transformOrigin:`${p.x}px ${p.y}px`,transition:x,willChange:`transform, width, height, scale`}},`${e?`row`:`column`}-${t}`)))})});Sn.displayName=`RangeInsertBar`;var Cn=()=>typeof window<`u`?window:null,wn=(e,t,r={x:!0,y:!0})=>{let i=e.getElement()?.getBoundingClientRect();if(!i)return!1;let a=!1===r.x?0:t.x<=i.left+24?-1:+(t.x>=i.right-24),o=!1===r.y?0:t.y<=i.top+24?-1:+(t.y>=i.bottom-24);if(!a&&!o)return!1;let s=e.getVisibleRange(),c=e.getTotalRange(),l=e.getCellFromPointer(t.x,t.y),u={};return a>0&&s.colEnd<c.colEnd?u.colIndex=Math.min(c.colEnd,Math.max(s.colEnd+1,l?.colIndex??0)):a<0&&s.colStart>c.colStart&&(u.colIndex=Math.max(c.colStart,Math.min(s.colStart-1,l?.colIndex??2**53-1))),o>0&&s.rowEnd<c.rowEnd?u.rowIndex=Math.min(c.rowEnd,Math.max(s.rowEnd+1,l?.rowIndex??0)):o<0&&s.rowStart>c.rowStart&&(u.rowIndex=Math.max(c.rowStart,Math.min(s.rowStart-1,l?.rowIndex??2**53-1))),(u.colIndex!==void 0||u.rowIndex!==void 0)&&((e.getAllPanes()[n.A.Center]??e).scrollCellCoordsIntoView(u),!0)},Tn=Object.freeze({ctrlKey:!1,shiftKey:!1,altKey:!1,metaKey:!1}),En=e=>({ctrlKey:!!e.ctrlKey,shiftKey:!!e.shiftKey,altKey:!!e.altKey,metaKey:!!e.metaKey}),Dn=(e,t,r,i)=>{let a=i??((t,n)=>e.getCellFromPointer(t,n)),o=null,s=null,c=null,l=null,u=null,d=()=>{u&&=(document.removeEventListener(`touchstart`,u,{capture:!0}),document.removeEventListener(`touchmove`,u,{capture:!0}),null)},f=()=>{l&&clearTimeout(l),l=null},p=Tn,m=null,h=e=>{if(!o)return;let t=En(e);((e,t)=>e.ctrlKey===t.ctrlKey&&e.shiftKey===t.shiftKey&&e.altKey===t.altKey&&e.metaKey===t.metaKey)(p,t)||(p=t,o.modifiers?.(t))},g=()=>{m&&=(Cn()?.removeEventListener(`keydown`,m,!0),Cn()?.removeEventListener(`keyup`,m,!0),null)},_=(t,r,i)=>{if(!o)return!1;let c=a(t,r);return c&&(n.d.isEqualCells(c,s)||(s=c,o.drag(c,i)),o.point?.(c,t,r,i)),(o.edgeScroll??(t=>wn(e,t)))({x:t,y:r})};return{hasSession:()=>o!==null,captureEvents:()=>o?.captureEvents,begin:e=>{let n=a(e.clientX,e.clientY);if(!n)return null;let i=t(n,e);return i?(o=i,s=n,c=null,e.pointerType===`touch`&&!1!==i.capture&&(()=>{if(u)return;let e=e=>{e.stopImmediatePropagation(),e.preventDefault()};u=e,document.addEventListener(`touchstart`,e,{capture:!0,passive:!1}),document.addEventListener(`touchmove`,e,{capture:!0,passive:!1})})(),(e=>{if(p=En(e),m)return;let t=e=>h(e);m=t,Cn()?.addEventListener(`keydown`,t,!0),Cn()?.addEventListener(`keyup`,t,!0)})(e),r?.(i.dragMode??null),i):null},move:(e,t,n)=>{o&&(n&&h(n),c={x:e,y:t},_(e,t,n)?(f(),l=setTimeout(function e(){l=o&&c&&_(c.x,c.y)?setTimeout(e,60):null},60)):f())},reset:()=>{let e=o;return o=null,s=null,c=null,f(),d(),g(),p=Tn,e&&r?.(null),e},dispose:()=>{f(),d(),g()}}},On=(e,t,n)=>{let r=Dn(e,t,n),i=!1,a=null,o=null,s=null,c=null,l=null,u=()=>{s&&a&&a.removeEventListener?.(`pointercancel`,s),s=null,c&&Cn()?.removeEventListener(`keydown`,c,!0),c=null},d=()=>{l&&=(Cn()?.removeEventListener(`pointerup`,l),Cn()?.removeEventListener(`pointercancel`,l),null)},f=()=>{a&&o!==null&&a.hasPointerCapture?.(o)&&a.releasePointerCapture(o),a=null,o=null},p=(e,t)=>{let n=i,a=r.reset();i=!1,u(),d(),f(),a&&(e?a.cancel?.(t):t&&(!1!==a.captureEvents&&n&&t.stopPropagation(),a.end?.(t)))};return{onPointerDown:e=>{let t=r.begin(e);if(t)if(!1!==t.capture){let t=e.currentTarget;t.setPointerCapture?.(e.pointerId),a=t,o=e.pointerId,i=!0,s=e=>p(!0,e),t.addEventListener?.(`pointercancel`,s),c=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),p(!0))},Cn()?.addEventListener(`keydown`,c,!0)}else i=!1,l=e=>p(e.type===`pointercancel`,e),Cn()?.addEventListener(`pointerup`,l),Cn()?.addEventListener(`pointercancel`,l)},onPointerMove:e=>{r.hasSession()&&i&&(!1!==r.captureEvents()&&e.stopPropagation(),r.move(e.clientX,e.clientY,e))},onPointerUp:e=>p(!1,e),onPointerCancel:e=>p(!0,e),dispose:()=>{u(),d(),f(),r.dispose()}}};function kn(e,t,n,r){let i=Dn(e,t,n,r),a=null,o=null,s=null,c=()=>{a?.(),a=null},l=()=>{o&&s!==null&&o.hasPointerCapture?.(s)&&o.releasePointerCapture(s),o=null,s=null};return{start:(e,t)=>{c(),l();let n=i.begin(e);if(!n)return;if(!1!==n.capture){let n=t??e.currentTarget;n&&(n.setPointerCapture?.(e.pointerId),o=n,s=e.pointerId)}let r=e=>i.move(e.clientX,e.clientY,e),u=(e,t)=>{c();let n=i.reset();l(),n&&(e?n.cancel?.(t):n.end?.(t))},d=e=>u(!1,e),f=e=>u(!0,e),p=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),u(!0))};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,d),window.addEventListener(`pointercancel`,f),window.addEventListener(`keydown`,p,!0),a=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,d),window.removeEventListener(`pointercancel`,f),window.removeEventListener(`keydown`,p,!0)}},dispose:()=>{c(),l(),i.dispose()}}}var An=e=>{let t=Z(),[n,r]=(0,u.useState)(null),i=(0,u.useRef)(e);i.current=e;let a=(0,u.useMemo)(()=>On(t,(e,t)=>i.current(e,t),r),[t]);return(0,u.useEffect)(()=>()=>a.dispose(),[a]),{onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.onPointerUp,onPointerCancel:a.onPointerCancel,dragMode:n}},jn=e=>{let t=Z(),[n,r]=(0,u.useState)(null),i=(0,u.useRef)(e);i.current=e;let a=(0,u.useMemo)(()=>kn(t,(e,t)=>i.current(e,t),r),[t]);return(0,u.useEffect)(()=>()=>a.dispose(),[a]),{start:a.start,dragMode:n}},Mn=e=>{let t=(0,u.useRef)(null),n=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{let e=e=>{n.current&&(n.current=!1,e.stopPropagation(),e.preventDefault())};return window.addEventListener(`dblclick`,e,!0),()=>window.removeEventListener(`dblclick`,e,!0)},[]),r=>{if(!e||r.button!==0)return!1;let i=t.current,a=!!i&&r.timeStamp-i.time<=500&&Math.abs(r.clientX-i.x)<=4&&Math.abs(r.clientY-i.y)<=4;return t.current=a?null:{time:r.timeStamp,x:r.clientX,y:r.clientY},!!a&&(r.stopPropagation(),n.current=!0,window.setTimeout(()=>{n.current=!1},500),!0)}},Nn=e=>{let{range:t,anchor:n,size:r=8,cursor:a,dragCursor:o,background:s=`var(--sxl-color-primary, rgb(33, 115, 70))`,onDragStart:c,onDragMove:l,onDragEnd:f,onDragCancel:p,onDoubleClick:m,onHoverChange:h,hoverStyle:g,animatedTransition:_,renderHandle:v,children:y,className:b,style:x,preserveFocus:S,clampToView:C,secondaryButton:T}=e,E=Z(),[D,O]=(0,u.useState)(!1),k=Mn(!!m),{start:A,dragMode:j}=jn((e,t)=>{let n=t.button===2&&!0===T;if(t.button!==0&&!n)return null;t.stopPropagation(),S&&t.preventDefault();let r=n?Pn():null,i=e,a=e;return c?.(i,t),{dragMode:`handle`,drag:(e,n)=>{a=e,l?.(i,e,n??t)},end:e=>{r?.(),f?.(i,a,e)},cancel:()=>{r?.(),p?.()}}}),M=j!==null&&o?o:a??Rn[n],N=E.getBoundsFromRange(t);if(!N)return null;let P=i.kt.getDevicePixelRatio(),F=Ln(N.x,N.x+N.width,Fn[n],P),I=Ln(N.y,N.y+N.height,In[n],P);if(C){if(!E.toClipBounds(E.getBoundsFromRange(t)))return null;let e=E.getPaneBounds(),n=r/2+1;!0!==C&&C!==`x`||(F=Math.max(n,Math.min(e.width-n,F))),!0!==C&&C!==`y`||(I=Math.max(n,Math.min(e.height-n,I)))}let L={position:`absolute`,cursor:M,pointerEvents:`all`,left:0,top:0,transform:`translate(${F}px, ${I}px) translate(-50%, -50%)`,..._?{transition:`transform 60ms ease-in-out`,willChange:`transform`}:void 0},R={className:w(`drag-handle`,b),onPointerDown:e=>{k(e)?m(e):A(e)},onDoubleClick:m?e=>e.stopPropagation():void 0,onPointerEnter:()=>{O(!0),h?.(!0)},onPointerLeave:()=>{O(!1),h?.(!1)}};return v?(0,d.jsx)(d.Fragment,{children:v({anchor:n,size:r,cursor:M,background:s,hovered:D,handleProps:{...R,style:L}})}):(0,d.jsx)(`div`,{...R,style:{...L,width:r,height:r,background:y==null?s:void 0,border:y==null?`1px solid var(--sxl-color-base-100, white)`:void 0,borderRadius:1,boxSizing:`border-box`,...x,...D?g:void 0},children:y})};Nn.displayName=`DragHandle`;var Pn=()=>{let e=e=>{e.preventDefault(),e.stopPropagation()};return window.addEventListener(`contextmenu`,e,!0),()=>{setTimeout(()=>window.removeEventListener(`contextmenu`,e,!0),0)}},Fn={tl:`leading`,l:`leading`,bl:`leading`,t:`center`,b:`center`,tr:`trailing`,r:`trailing`,br:`trailing`},In={tl:`leading`,t:`leading`,tr:`leading`,l:`center`,r:`center`,bl:`trailing`,b:`trailing`,br:`trailing`},Ln=(e,t,n,r)=>n===`center`?i.kt.snapDeviceEdge((e+t)/2,r):i.kt.edgeCenter(n===`leading`?e:t,n,2,r),Rn={tl:`nwse-resize`,br:`nwse-resize`,tr:`nesw-resize`,bl:`nesw-resize`,t:`ns-resize`,b:`ns-resize`,l:`ew-resize`,r:`ew-resize`},zn=(e,t,r,i,a,o)=>{let s=e.getPanePointFromPointer(r,i),c=e.getCellFromPointer(r,i,!0)??t,l=e.getBoundsFromRange(n.d.cellToRange(c));if(!s||!l||l.width<=0||l.height<=0)return o;let u=(s.x-l.x)/l.width,d=(s.y-l.y)/l.height,f=a??(u<.25||u>.75?n.R.Column:n.R.Row);return f===n.R.Column?{axis:f,origin:{rowIndex:c.rowIndex,colIndex:u<.5?c.colIndex:c.colIndex+1}}:{axis:f,origin:{rowIndex:d<.5?c.rowIndex:c.rowIndex+1,colIndex:c.colIndex}}},Bn=(e,t)=>e===t||!!e&&!!t&&e.axis===t.axis&&n.d.isEqualCells(e.origin,t.origin),Vn=e=>{let{range:t,children:r,grip:a=`entire`,hitSize:o=10,onHoverChange:s,onDragStateChange:c,onDragStart:l,onDragMove:f,onDragEnd:p,renderMove:m,dragCursor:h=`grabbing`,preserveFocus:g,onEdgeDoubleClick:_,className:y}=e,b=Z(),x=t?`range-move:${t.rowStart}:${t.colStart}:${t.rowEnd}:${t.colEnd}`:`range-move`,S=(0,u.useRef)(null),[C,T]=Q(x,null),{start:E,dragMode:D}=jn((e,r)=>{if(r.button!==0||!t)return null;r.stopPropagation(),g&&r.preventDefault();let i=e,a=t,o=a;r.clientX,r.clientY;let s=((e,t)=>e.colStart<=t.colStart&&e.colEnd>=t.colEnd?n.R.Row:e.rowStart<=t.rowStart&&e.rowEnd>=t.rowEnd?n.R.Column:null)(a,b.getTotalRange()),u={mods:En(r),insert:zn(b,e,r.clientX,r.clientY,s,null)},d=u.insert,h=r;c?.(!0),l?.(a,r,u);let _=()=>{m&&T({range:o,info:u}),f?.(o,h,u)},v=!1;return{dragMode:`move`,drag:e=>{o=(e=>Hn(a,e.rowIndex-i.rowIndex,e.colIndex-i.colIndex,b.getTotalRange()))(e),v=!0},point:(e,t,n,r)=>{r&&(h=r);let i=zn(b,e,t,n,s,u.insert),a=v||!Bn(i,u.insert);v=!1,a&&(u={...u,insert:i},_())},modifiers:e=>{u={...u,mods:e},_()},end:e=>{c?.(!1),m&&T(null);let t=En(e);(!n.d.isEqualRanges(o,a)||t.shiftKey&&!Bn(u.insert,d))&&p?.(o,e,{...u,mods:t})},cancel:()=>{c?.(!1),m&&T(null)}}}),O=Mn(!!_),k=D===null?`move`:h;if(!t)return null;let A={onPointerDown:e=>{if(O(e)){let n=(e=>{let n=b?.getPanePointFromPointer(e.clientX,e.clientY),r=b?.getBoundsFromRange(t);if(!n||!r)return null;let i=Math.abs(n.y-r.y),a=Math.abs(n.y-(r.y+r.height)),o=Math.abs(n.x-r.x),s=Math.abs(n.x-(r.x+r.width)),c=Math.min(i,a,o,s);return c===i?`top`:c===a?`bottom`:c===o?`left`:`right`})(e);n&&_(t,n,e);return}E(e,S.current)}},j=s?{onPointerEnter:()=>s(!0),onPointerLeave:()=>s(!1)}:void 0,M=o/i.kt.getDevicePixelRatio(),N=b?.getBoundsFromRange(t),P=N?{x:N.x-M,y:N.y-M,width:N.width+2*M,height:N.height+2*M}:void 0;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(_e,a===`entire`?{ref:S,className:w(`drag-grip`,y),...P?{bounds:P}:{range:t},style:{cursor:k},...A,...j}:{ref:S,className:w(`drag-grip`,y),range:t,clipInsets:-M/2,style:{pointerEvents:`none`,cursor:k},...A,children:(0,d.jsx)(v,{stroke:`transparent`,alignWidth:o,propsStrokePath:{cursor:`move`,pointerEvents:`stroke`,...j}})}),r,C&&m?.(C.range,C.info)]})};Vn.displayName=`Draggable`;var Hn=(e,t,n,r)=>{let i=e.rowEnd-e.rowStart,a=e.colEnd-e.colStart,o=T(e.rowStart+t,r.rowStart,r.rowEnd-i),s=T(e.colStart+n,r.colStart,r.colEnd-a);return{rowStart:o,colStart:s,rowEnd:o+i,colEnd:s+a}},Un=[`tl`,`tr`,`br`,`bl`],Wn=[`tl`,`t`,`tr`,`r`,`br`,`b`,`bl`,`l`],Gn=e=>{let{range:t,anchors:n=Wn,onDragStart:r,onDragMove:i,onDragEnd:a,onDragCancel:o,onHandleHoverChange:s,size:c=8,renderHandle:l,preserveFocus:f,...p}=e,m={...bn,...p},h=m.stroke??`rgb(33, 115, 70)`,g=Z(),[_,v]=(0,u.useState)(null),y=(0,u.useRef)(null);if(!t)return null;let b=_??t;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(xn,{className:`resizer-outline`,range:b,...m}),n.map(e=>(0,d.jsx)(Nn,{className:`resize-handle ${e}`,range:b,anchor:e,size:c,animatedTransition:m.animatedTransition,dragCursor:`grabbing`,renderHandle:l,preserveFocus:f,onHoverChange:s,style:{background:h,border:`1.5px solid var(--sxl-color-base-100, white)`,borderRadius:0},hoverStyle:{border:`1.5px solid ${h}`},onDragStart:(e,n)=>{y.current=t,r?.(t,n)},onDragMove:(n,r,a)=>{let o=Kn(y.current??t,e,r,g.getTotalRange());v(o),i?.(o,a)},onDragEnd:(n,r,i)=>{let o=Kn(y.current??t,e,r,g.getTotalRange());y.current=null,v(null),a?.(o,i)},onDragCancel:()=>{y.current=null,v(null),o?.()}},e))]})};Gn.displayName=`RangeResizer`;var Kn=(e,t,n,r)=>{let{rowStart:i,colStart:a,rowEnd:o,colEnd:s}=e;return t.includes(`t`)&&(i=T(n.rowIndex,r.rowStart,r.rowEnd)),t.includes(`b`)&&(o=T(n.rowIndex,r.rowStart,r.rowEnd)),t.includes(`l`)&&(a=T(n.colIndex,r.colStart,r.colEnd)),t.includes(`r`)&&(s=T(n.colIndex,r.colStart,r.colEnd)),{rowStart:Math.min(i,o),colStart:Math.min(a,s),rowEnd:Math.max(i,o),colEnd:Math.max(a,s)}},qn=e=>{let{range:t,snapDestination:r,onDragStart:i,onDragMove:a,onDragEnd:o,onMenu:s,onDragDone:c,onDoubleClick:l,renderHandle:f,...p}=e,m={...bn,fill:void 0,...p},h=m.stroke,g={...m,strokeDasharray:`3 2`},_=Z(),v=(0,u.useRef)(null),[y,b]=Q(`range-fill`,null);if(!t)return null;let x=_.getTotalRange(),S=t.rowStart===x.rowStart&&t.rowEnd===x.rowEnd,C=t.colStart===x.colStart&&t.colEnd===x.colEnd;if(S&&C)return null;let w=Object.keys(_.getAllPanes()).length<=1,T=_.getBoundsFromRange(t),E=_.getPaneBounds(),D=w&&T.y>=0&&T.y+T.height<=E.height,O=w&&T.x>=0&&T.x+T.width<=E.width,k=S&&!D?`tr`:C&&!O?`bl`:`br`,A=k===`tr`?`y`:k===`bl`&&`x`;if(A&&!((e,t,r,i)=>{let a=e.getAllPanes();if(Object.keys(a).length<=1)return!0;let o=e.getAnchor(),s=!!a[n.A.TopLeft],c=!!a[n.A.Top],l=!!a[n.A.Left],u=e.getVisibleRange();if(i){if(o===n.A.Top&&s||o===n.A.Center&&l||!n.d.isCellWithinRange({colIndex:t.colStart,rowIndex:t.rowEnd},u)&&!n.d.isCellWithinRange({colIndex:t.colStart,rowIndex:t.rowEnd+1},u))return!1}else if(r&&(o===n.A.Left&&s||o===n.A.Center&&c||!n.d.isCellWithinRange({colIndex:t.colEnd,rowIndex:t.rowStart},u)&&!n.d.isCellWithinRange({colIndex:t.colEnd+1,rowIndex:t.rowStart},u)))return!1;return!0})(_,t,S,C))return null;let j=y?((e,t)=>t.rowEnd<e.rowEnd?{...e,rowStart:t.rowEnd+1}:t.colEnd<e.colEnd?{...e,colStart:t.colEnd+1}:null)(t,y):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(Nn,{className:`fill-handle`,range:t,anchor:k,clampToView:A,cursor:`crosshair`,background:h,renderHandle:f,onDoubleClick:l?e=>l(t,e):void 0,secondaryButton:!!s,onDragStart:(e,n)=>{v.current=null,b(null),i?.(t,n)},onDragMove:(e,n,i)=>{let o=((e,t,n)=>{let r=t.rowIndex-e.rowEnd,i=e.rowStart-t.rowIndex,a=t.colIndex-e.colEnd,o=e.colStart-t.colIndex,s=Math.max(r,i,0),c=Math.max(a,o,0);if(s>0||c>0)return s>=c?r>0?{...e,rowEnd:Math.min(n.rowEnd,t.rowIndex)}:{...e,rowStart:Math.max(n.rowStart,t.rowIndex)}:a>0?{...e,colEnd:Math.min(n.colEnd,t.colIndex)}:{...e,colStart:Math.max(n.colStart,t.colIndex)};let l=e.rowStart===n.rowStart&&e.rowEnd===n.rowEnd,u=e.colStart===n.colStart&&e.colEnd===n.colEnd,d=l?0:e.rowEnd-t.rowIndex,f=u?0:e.colEnd-t.colIndex;return d<=0&&f<=0?null:d>=f?{...e,rowEnd:t.rowIndex}:{...e,colEnd:t.colIndex}})(t,n,_.getTotalRange());o&&r&&(o=r(t,o)),v.current=o,b(o),o&&a?.(o,i)},onDragEnd:(e,t,n)=>{let r=v.current;v.current=null,r&&n.button===2&&s?s(r,n,()=>b(null)):(b(null),r&&o?.(r,n)),c?.(n)},onDragCancel:()=>{v.current=null,b(null),c?.()}}),y&&(0,d.jsx)(xn,{className:`fill-preview`,range:y,...g}),j&&(0,d.jsx)(xn,{className:`fill-vacated`,range:j,fill:`rgba(128, 128, 128, 0.28)`})]})};qn.displayName=`FillHandle`,(0,u.memo)(e=>{let{value:t,zoom:n,bounds:r,cell:i,range:a,children:o,className:s,...c}=e;return(0,d.jsx)(`div`,{className:w(s,`cell`),...c,children:t})});var Jn=Object.freeze({cells:[],rangesH:[],rangesV:[]}),Yn=!1,Xn=new WeakMap,Zn=Object.freeze({rangesH:[],rangesV:[]}),Qn=new WeakMap,$n=(e,t)=>`${e}:${t}`,er=`_tiles_ikr1b_7`,tr=`_gridlines_ikr1b_26`,nr=(0,u.memo)(e=>{let{renderCell:t,cacheToken:r,getVisibleCells:i,hiddenCellAt:a,suppressCell:o,className:s,style:c}=e,l=Z(),f=l.getAnchor(),p=(0,u.useId)(),m=(0,u.useMemo)(()=>`sxl-cl-${p.replace(/[^a-zA-Z0-9_-]/g,``)}`,[p]),h=(0,u.useRef)({token:void 0,renderCell:void 0,getVisibleCells:void 0,hiddenCellAt:void 0,pane:null,rebaseLeft:0,rebaseTop:0,map:new Map}),g=l.getScrollTopLeft(),_=l.getFreezeTopLeft(),v=g.left+_.left,y=g.top+_.top,b=Math.floor(v/ar)*ar,x=Math.floor(y/ar)*ar,S=l.getVisibleRange(),C=0,T=-1,E=0,D=-1;S&&(C=Math.max(0,Math.floor(S.rowStart/ir)-or),T=Math.floor(S.rowEnd/ir)+or,E=Math.max(0,Math.floor(S.colStart/ir)-or),D=Math.floor(S.colEnd/ir)+or);let O=(0,u.useMemo)(()=>{if(!S||T<C)return null;let e=h.current;e.token===r&&e.pane===l&&e.renderCell===t&&e.getVisibleCells===i&&e.hiddenCellAt===a&&e.rebaseLeft===b&&e.rebaseTop===x||(e.map=new Map,e.token=r,e.pane=l,e.renderCell=t,e.getVisibleCells=i,e.hiddenCellAt=a,e.rebaseLeft=b,e.rebaseTop=x);let o=e.map,s=l.getZoom(),c=l.getTotalRange(),u={rowStart:Math.max(c.rowStart,C*ir),colStart:Math.max(c.colStart,E*ir),rowEnd:Math.min(c.rowEnd,(T+1)*ir-1),colEnd:Math.min(c.colEnd,(D+1)*ir-1)},{cells:p}=((e,t={})=>{let r=e.getVisibleRange(),i=e.getScrollTopLeft(),a=t.bufferRange,o=!!a,s=a?a.rowStart:0,c=a?a.colStart:0,l=a?a.rowEnd:0,u=a?a.colEnd:0,d=Xn.get(e);if(d&&d.rowStart===r.rowStart&&d.colStart===r.colStart&&d.rowEnd===r.rowEnd&&d.colEnd===r.colEnd&&d.scrollLeft===i.left&&d.scrollTop===i.top&&d.hasBuffer===o&&d.bRowStart===s&&d.bColStart===c&&d.bRowEnd===l&&d.bColEnd===u&&d.options.cacheToken===t.cacheToken&&d.options.getVisibleCells===t.getVisibleCells&&d.options.hiddenCellAt===t.hiddenCellAt)return d.model;let f=((e,t={})=>{let{getVisibleCells:r,hiddenCellAt:i,bufferRange:a}=t,o=e.getTotalRange(),s=a?{rowStart:Math.max(a.rowStart,o.rowStart),rowEnd:Math.min(a.rowEnd,o.rowEnd),colStart:Math.max(a.colStart,o.colStart),colEnd:Math.min(a.colEnd,o.colEnd)}:null,c=s?e.getVisibleColumns(s.colStart,s.colEnd):e.getVisibleColumns(),l=s?e.getVisibleRows(s.rowStart,s.rowEnd):e.getVisibleRows();if(c.length===0||l.length===0)return Jn;let u,d=t=>e.getRangeFromCell(t);if(r)u=r(e,a);else{u=[];let e=l.length,t=c.length;for(let r=0;r<e;r++){let e=l[r].index;for(let r=0;r<t;r++){let t={rowIndex:e,colIndex:c[r].index},a=d(t);n.d.isSingleCell(a)&&i?.(t)||u.push({cell:t,range:a})}}}let f=u?u.length:0;if(f===0)return Jn;let p=e.getVisibleRange(),m=a??p,h=[],g=[],_=[],v=new Set;for(let t=0;t<f;t++){let r=u[t],a=r?.cell??r;if(!a)continue;let o=r?.range??{rowStart:a.rowIndex,colStart:a.colIndex,rowEnd:a.rowIndex,colEnd:a.colIndex};if(!n.d.isRangesIntersect(o,m)&&!n.d.isRangeWithinRange(o,m))continue;let s=o&&!n.d.isSingleCell(o);if(!s&&i?.(a))continue;let c=null;if(s){let t=d(a);n.d.isSingleCell(t)||a.rowIndex===t.rowStart&&a.colIndex===t.colStart||(a={rowIndex:t.rowStart,colIndex:t.colStart});let r=$n(o.rowStart,o.colStart);if(v.has(r))continue;v.add(r),o.rowEnd-o.rowStart>0&&g.push(o),o.colEnd-o.colStart>0&&_.push(o),c=e.getBoundsFromRange(o)}else{let t=e.getRowSize(a.rowIndex),n=e.getColumnSize(a.colIndex);t&&n&&(c={x:n.offset,y:t.offset,width:n.size,height:t.size})}c||=e.getBoundsFromRange(o),c?h.push({cell:a,range:o,bounds:c,value:r?.value}):Yn||(Yn=!0,console.warn(`grid-react: no bounds for cell`,$n(o.rowStart,o.colStart)))}return{cells:h,rangesH:g,rangesV:_}})(e,t);return Xn.set(e,{rowStart:r.rowStart,colStart:r.colStart,rowEnd:r.rowEnd,colEnd:r.colEnd,scrollLeft:i.left,scrollTop:i.top,hasBuffer:o,bRowStart:s,bColStart:c,bRowEnd:l,bColEnd:u,options:t,model:f}),f})(l,{getVisibleCells:i,hiddenCellAt:a,bufferRange:u,cacheToken:r}),m=new Map;for(let e=0;e<p.length;e++){let t=p[e],n=`${Math.floor(t.cell.rowIndex/ir)}:${Math.floor(t.cell.colIndex/ir)}`,r=m.get(n);r||(r=[],m.set(n,r)),r.push(t)}let g=[],_=(e,n)=>{if(e*ir>c.rowEnd||n*ir>c.colEnd)return;let r=e>=C&&e<=T&&n>=E&&n<=D,i=`${e}:${n}`,a=o.get(i);if(a===void 0){let u=m.get(i);if(!u&&!cr)return;let p=l.getBoundsFromRange({rowStart:e*ir,colStart:n*ir,rowEnd:Math.min(c.rowEnd,e*ir+ir-1),colEnd:Math.min(c.colEnd,n*ir+ir-1)}),h=v+p.x-b,g=y+p.y-x,_=[];if(cr&&_.push((0,d.jsx)(`div`,{style:{position:`absolute`,left:0,top:0,width:p.width,height:p.height,background:(e+n)%2==0?`rgba(0,128,255,0.05)`:`rgba(255,140,0,0.05)`,pointerEvents:`none`}},`__bg`)),u)for(let e=0;e<u.length;e++){let{cell:n,range:r,bounds:i,value:a}=u[e];i&&_.push(t({key:`pane:${f}:cell:${$n(n.rowIndex,n.colIndex)}`,cell:n,bounds:i,range:r,zoom:s,value:a,"data-rc":$n(n.rowIndex,n.colIndex),style:{left:i.x-p.x,top:i.y-p.y,width:i.width,height:i.height}}))}if(a=(0,d.jsx)(`div`,{className:`tile`,style:{transform:`translate(${h}px, ${g}px)`},children:_},`pane:${f}:tile:${e}:${n}`),r&&(o.set(i,a),o.size>sr)){let e=o.keys().next().value;e!==void 0&&o.delete(e)}}a&&g.push(a)};if(cr){for(let e=C;e<=T&&!(e*ir>c.rowEnd);e++)for(let t=E;t<=D&&!(t*ir>c.colEnd);t++)_(e,t);for(let e of m.keys()){let t=e.indexOf(`:`),n=Number(e.slice(0,t)),r=Number(e.slice(t+1));(n<C||n>T||r<E||r>D)&&_(n,r)}}else for(let e of m.keys()){let t=e.indexOf(`:`);_(Number(e.slice(0,t)),Number(e.slice(t+1)))}return g},[`${C}:${T}:${E}:${D}`,r,t,i,a,l,f,b,x]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(_e,{fill:!0,className:w(`tiles`,er,m,s),style:{pointerEvents:`none`,...c,transform:`translate3d(${b-v}px, ${x-y}px, 0)`,willChange:`transform`},children:O}),o?(0,d.jsx)(`style`,{children:`.${m} [data-rc="${$n(o.rowIndex,o.colIndex)}"]{visibility:hidden !important;}`}):null]})});nr.displayName=`CellTileDiv`;var rr=(0,u.memo)(e=>{let{renderCell:t,cacheToken:n,getVisibleCells:r,hiddenCellAt:i,suppressCell:a,className:o,style:s,...c}=e;return(0,d.jsx)(pe,{className:w(o,`cells`),...c,children:(0,d.jsx)(nr,{renderCell:t,cacheToken:n,getVisibleCells:r,hiddenCellAt:i,suppressCell:a,style:s})})});rr.displayName=`CellLayer`;var ir=8,ar=1<<19,or=1,sr=512,cr=!1,lr=(e,t,r)=>{let a=i.kt.getDevicePixelRatio(),o=pr/a,s=e.getVisibleRange(),c=t=>e.getColumnSize(t).offset,l=t=>{let n=e.getColumnSize(t);return n.offset+n.size},u=t=>e.getRowSize(t).offset,d=t=>{let n=e.getRowSize(t);return n.offset+n.size},f=[],p=[],m=!1,h=``;if(t){let t=e.getVisibleRows(),u=t?t.length:0;if(u===0)return h;let g=[...r].sort(n.d.rowFirstRangeComparator),_=i.kt.snapDeviceEdge(0,a),v=Math.min(e.getPaneBounds().width,l(s.colEnd)),y=i.kt.snapDeviceEdge(v,a);for(let e=0;e<u&&t[e].index<=s.rowEnd;e++){let r=t[e],u=r.index;if(u<s.rowStart)continue;let b=r.offset+r.size;for(let e=f.length-1;e>=0;e--)d(f[e].rowEnd)<=b&&(f.splice(e,1),m=!1);let x=!1;for(;g.length>0&&g[0].rowStart<=u;){let e=g.shift();d(e.rowEnd)>b&&(f.push(e),x=!0,m=!1)}if(x&&f.sort(n.d.columnFirstRangeComparator),!m){p.length=0;for(let e=0;e<f.length;e++){let t=f[e];p.push(i.kt.snapDeviceEdge(Math.min(v,c(t.colStart)),a),i.kt.snapDeviceEdge(Math.min(v,l(t.colEnd)),a))}m=!0}let S=i.kt.snapLineCenter(b,o,a),C=_,w=p.length;for(let e=0;e<w;e+=2){let t=p[e];t>C&&(h+=`M ${C} ${S} L ${t} ${S} `),C=p[e+1]}y>C&&(h+=`M ${C} ${S} L ${y} ${S} `)}}else{let t=e.getVisibleColumns(),c=t?t.length:0;if(c===0)return h;let g=[...r].sort(n.d.columnFirstRangeComparator),_=i.kt.snapDeviceEdge(0,a),v=Math.min(e.getPaneBounds().height,d(s.rowEnd)),y=i.kt.snapDeviceEdge(v,a);for(let e=0;e<c&&t[e].index<=s.colEnd;e++){let r=t[e],c=r.index;if(c<s.colStart)continue;let b=r.offset+r.size;for(let e=f.length-1;e>=0;e--)l(f[e].colEnd)<=b&&(f.splice(e,1),m=!1);let x=!1;for(;g.length>0&&g[0].colStart<=c;){let e=g.shift();l(e.colEnd)>b&&(f.push(e),x=!0,m=!1)}if(x&&f.sort(n.d.rowFirstRangeComparator),!m){p.length=0;for(let e=0;e<f.length;e++){let t=f[e];p.push(i.kt.snapDeviceEdge(Math.min(v,u(t.rowStart)),a),i.kt.snapDeviceEdge(Math.min(v,d(t.rowEnd)),a))}m=!0}let S=i.kt.snapLineCenter(b,o,a),C=_,w=p.length;for(let e=0;e<w;e+=2){let t=p[e];t>C&&(h+=`M ${S} ${C} L ${S} ${t} `),C=p[e+1]}y>C&&(h+=`M ${S} ${C} L ${S} ${y} `)}}return h},ur=e=>{let t=``;for(let n=0;n<e.length;n++){let r=e[n];t+=`${r.rowStart},${r.colStart},${r.rowEnd},${r.colEnd};`}return t},dr=(e,t,n,r,a)=>{if(!n)return null;let o=e.getPaneBounds(),s=Math.ceil(o.width),c=Math.ceil(o.height),l=String(pr/i.kt.getDevicePixelRatio());return(0,d.jsx)(`svg`,{className:w(t?`horizontal`:`vertical`),width:`${s}`,height:`${c}`,viewBox:`0 0 ${s} ${c}`,preserveAspectRatio:`none`,children:(0,d.jsx)(`path`,{d:n,fill:`none`,stroke:r,strokeWidth:l,vectorEffect:`non-scaling-stroke`,...a})})},fr=(0,u.memo)(e=>{let{showGridLines:t=!0,gridLineColor:r=`var(--sxl-color-base-300, rgb(224, 224, 224))`,propsRows:a,propsColumns:o,getVisibleCells:s,hiddenCellAt:c,cacheToken:l,bufferRange:f,className:p,style:m,...h}=e,g=Z(),_=t,v=!0===t||!0===_?.horizontal,y=!0===t||!0===_?.vertical,{rangesH:b,rangesV:x}=((e,t={})=>{let r=e.getVisibleRange(),i=Qn.get(e);if(i&&i.rowStart===r.rowStart&&i.colStart===r.colStart&&i.rowEnd===r.rowEnd&&i.colEnd===r.colEnd&&i.cacheToken===t.cacheToken&&i.getVisibleCells===t.getVisibleCells)return i.ranges;let a=((e,t={})=>{let{getVisibleCells:r}=t,i=e.getVisibleRange(),a=[],o=[],s=new Set,c=e=>{if(n.d.isSingleCell(e)||!n.d.isRangesIntersect(e,i)&&!n.d.isRangeWithinRange(e,i))return;let t=$n(e.rowStart,e.colStart);s.has(t)||(s.add(t),e.rowEnd-e.rowStart>0&&a.push(e),e.colEnd-e.colStart>0&&o.push(e))};if(r){let t=r(e),n=t?t.length:0;for(let e=0;e<n;e++){let n=t[e]?.range;n&&c(n)}}else{let t=e.getVisibleColumns(),n=e.getVisibleRows(),r=n.length,i=t.length;for(let a=0;a<r;a++){let r=n[a].index;for(let n=0;n<i;n++)c(e.getRangeFromCell({rowIndex:r,colIndex:t[n].index}))}}return a.length===0&&o.length===0?Zn:{rangesH:a,rangesV:o}})(e,t);return Qn.set(e,{rowStart:r.rowStart,colStart:r.colStart,rowEnd:r.rowEnd,colEnd:r.colEnd,getVisibleCells:t.getVisibleCells,cacheToken:t.cacheToken,ranges:a}),a})(g,{getVisibleCells:s,cacheToken:l}),S=i.kt.getDevicePixelRatio(),{top:C,left:T}=g.getScrollTopLeft(),E=g.getPaneBounds(),D=g.getVisibleRange(),O=g.getColumnSize(D.colEnd),k=g.getRowSize(D.rowEnd),A=Math.min(E.width,O?O.offset+O.size:E.width),j=Math.min(E.height,k?k.offset+k.size:E.height),M=b.length===0?`${C}|${A}|${S}`:`${C}|${T}|${A}|${S}|${ur(b)}`,N=x.length===0?`${T}|${j}|${S}`:`${T}|${C}|${j}|${S}|${ur(x)}`,P=(0,u.useMemo)(()=>v?lr(g,!0,b):null,[g,v,M]),F=(0,u.useMemo)(()=>y?lr(g,!1,x):null,[g,y,N]);return v||y?(0,d.jsx)(pe,{...h,className:w(p,`gridlines`),children:(0,d.jsxs)(_e,{fill:!0,className:w(`gridlines-box`,tr),style:{pointerEvents:`none`,...m},children:[v&&P?dr(g,!0,P,r,a):null,y&&F?dr(g,!1,F,r,o):null]})}):null});fr.displayName=`GridlineLayer`;var pr=1,mr=class{constructor(e={}){this.listeners=new Set,this._coords=e.initial??{cell:{rowIndex:0,colIndex:0},ranges:n.d.EmptyRanges,rangeIndex:-1},this._getBounds=e.getBounds??(()=>_r)}getSelection(){return this._coords}setSelection(e){n.d.isEqualSelectionCoords(this._coords,e)||(this._coords=e,this.listeners.forEach(e=>e()))}navigate(e,t=!1,r=!1,i=1){let a=this._getBounds(),{cell:o}=this._coords,s=e===n.a.Down?1:e===n.a.Up?-1:0,c=e===n.a.Right?1:e===n.a.Left?-1:0,l=e=>e===0?0:r?e>0?1/0:-1/0:e*Math.max(1,i),u=this._activeRange(),d=t?o.rowIndex===u.rowStart?u.rowEnd:u.rowStart:o.rowIndex,f=t?o.colIndex===u.colStart?u.colEnd:u.colStart:o.colIndex,p=T(d+l(s),a.rowStart,a.rowEnd),m=T(f+l(c),a.colStart,a.colEnd);if(!t)return void this.setSelection({cell:{rowIndex:p,colIndex:m},ranges:n.d.EmptyRanges,rangeIndex:-1});let h={rowStart:Math.min(o.rowIndex,p),colStart:Math.min(o.colIndex,m),rowEnd:Math.max(o.rowIndex,p),colEnd:Math.max(o.colIndex,m)};this.setSelection({cell:o,ranges:[h],rangeIndex:0})}traverse(e=n.R.Row,t=!1,r){let i=e===n.R.Row?t?n.a.Left:n.a.Right:t?n.a.Up:n.a.Down,a=this._coords;if(!(a.ranges&&a.ranges.length>0)||n.d.isEqualRangesArrays([n.d.cellToRange(a.cell)],a.ranges)){if(r&&!n.d.isSingleCell(r)){let e=n.Y.findNextCellWithinSelection({ranges:[r],cell:a.cell,rangeIndex:0},i,e=>n.d.cellToRange(e));this.setSelection({cell:e.cell,ranges:n.I.EmptyArray,rangeIndex:-1});return}this.navigate(i);return}let o=n.Y.findNextCellWithinSelection(a,i,e=>n.d.cellToRange(e));this.setSelection(o)}_activeIndex(){let{ranges:e,rangeIndex:t}=this._coords;return e&&e.length!==0?t!==void 0&&t>=0&&t<e.length?t:e.length-1:-1}_activeRange(){let e=this._activeIndex();return e>=0?this._coords.ranges[e]:n.d.cellToRange(this._coords.cell)}modify(e,t=this._coords.cell){let n=this._activeRange(),r=hr({rowStart:Math.min(e.rowIndex??n.rowStart,t.rowIndex??n.rowStart),colStart:Math.min(e.colIndex??n.colStart,t.colIndex??n.colStart),rowEnd:Math.max(e.rowIndex??n.rowEnd,t.rowIndex??n.rowEnd),colEnd:Math.max(e.colIndex??n.colEnd,t.colIndex??n.colEnd)},this._getBounds()),i=this._coords,a=this._activeIndex(),o=a>=0?i.ranges.map((e,t)=>t===a?r:e):[r],s=gr(i.cell,r);this.setSelection({cell:s,ranges:o,rangeIndex:a>=0?a:0})}append(e,t=e){let r=hr({rowStart:Math.min(e.rowIndex,t.rowIndex),colStart:Math.min(e.colIndex,t.colIndex),rowEnd:Math.max(e.rowIndex,t.rowIndex),colEnd:Math.max(e.colIndex,t.colIndex)},this._getBounds()),i=this._coords,a=i.ranges&&i.ranges.length>0?[...i.ranges]:[n.d.cellToRange(i.cell)];a.push(r),this.setSelection({ranges:a,rangeIndex:a.length-1,cell:{rowIndex:r.rowStart,colIndex:r.colStart}})}deselect(e){let t=this._coords;if(!t.ranges||t.ranges.length===0)return;let r=[],i=-1,a=t.cell;for(let o of t.ranges){if(!n.d.isRangesIntersect(o,e)){r.push(o),i===-1&&n.d.isCellWithinRange(t.cell,o)&&(i=r.length-1);continue}let s=r.length,c=n.I.subtractRect({top:o.rowStart,left:o.colStart,bottom:o.rowEnd+1,right:o.colEnd+1},{top:e.rowStart,left:e.colStart,bottom:e.rowEnd+1,right:e.colEnd+1});for(let e of c){let a={rowStart:e.top,colStart:e.left,rowEnd:e.bottom-1,colEnd:e.right-1};r.push(a),i===-1&&n.d.isCellWithinRange(t.cell,a)&&(i=r.length-1)}if(i===-1&&r.length>s&&n.d.isCellWithinRange(t.cell,o)){i=r.length-1;let e=r[r.length-1];a={rowIndex:e.rowStart,colIndex:e.colStart}}}if(i===-1&&r.length>0&&t.ranges.some(e=>n.d.isCellWithinRange(t.cell,e))){i=r.length-1;let e=r[i];a={rowIndex:e.rowStart,colIndex:e.colStart}}this.setSelection({cell:a,rangeIndex:i,ranges:r})}getCoords(){return this._coords.cell}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}},hr=(e,t)=>({rowStart:T(e.rowStart,t.rowStart,t.rowEnd),colStart:T(e.colStart,t.colStart,t.colEnd),rowEnd:T(e.rowEnd,t.rowStart,t.rowEnd),colEnd:T(e.colEnd,t.colStart,t.colEnd)}),gr=(e,t)=>({rowIndex:T(e.rowIndex,t.rowStart,t.rowEnd),colIndex:T(e.colIndex,t.colStart,t.colEnd)}),_r={rowStart:0,colStart:0,rowEnd:2**53-1,colEnd:2**53-1},vr=`var(--sxl-color-primary, rgb(33, 115, 70))`,yr=`var(--sxl-color-base-100, rgb(255, 255, 255))`,br=`var(--sxl-color-warning, rgb(255, 0, 0))`,xr=e=>`color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) ${e}%, transparent)`,Sr={fill:{fill:xr(10)},border:{stroke:vr,alignWidth:2,style:{filter:`drop-shadow(1px 1px 0.3px var(--sxl-color-shadow, rgba(0, 0, 0, 0.24)))`}},inner:{stroke:yr,alignWidth:2,inset:1}},Cr={fill:{fill:xr(6)},border:{stroke:vr,alignWidth:1},inner:{stroke:yr,alignWidth:1,inset:1}},wr={stroke:vr,alignWidth:1,inset:2},Tr={fill:{fill:`color-mix(in srgb, ${br} 10%, transparent)`},border:{stroke:br,alignWidth:2}},Er={color:vr,refusedColor:br,alignWidth:3,capExtent:3,transitionDuration:100,transitionEasing:`cubic-bezier(0.16, 1, 0.3, 1)`,axisDuration:70},Dr={fill:{fill:`color-mix(in srgb, ${yr} 62%, transparent)`}},Or=e=>{let{selection:t,color:r=`var(--sxl-color-primary, rgb(33, 115, 70))`,size:a=22}=e,o=de(),s=jr(i.$(t,e=>e.getSelection())),c=o?o.getAllPanes()[n.A.Center]??o:void 0,l=((e,t,n)=>{let r=!!t&&e.rowStart===t.rowStart&&e.rowEnd===t.rowEnd,i=!!t&&e.colStart===t.colStart&&e.colEnd===t.colEnd;if(r&&i)return[];if(r){let t=n?Math.floor((n.rowStart+n.rowEnd)/2):e.rowStart;return[{key:`l`,placement:{side:`l`,align:`center`},cell:{rowIndex:t,colIndex:e.colStart},pivot:{colIndex:e.colEnd},axis:`col`,pin:`v`},{key:`r`,placement:{side:`r`,align:`center`},cell:{rowIndex:t,colIndex:e.colEnd},pivot:{colIndex:e.colStart},axis:`col`,pin:`v`}]}if(i){let t=n?Math.floor((n.colStart+n.colEnd)/2):e.colStart;return[{key:`t`,placement:{side:`t`,align:`center`},cell:{rowIndex:e.rowStart,colIndex:t},pivot:{rowIndex:e.rowEnd},axis:`row`,pin:`h`},{key:`b`,placement:{side:`b`,align:`center`},cell:{rowIndex:e.rowEnd,colIndex:t},pivot:{rowIndex:e.rowStart},axis:`row`,pin:`h`}]}return[{key:`tl`,placement:{side:`t`,align:`start`},cell:{rowIndex:e.rowStart,colIndex:e.colStart},pivot:{rowIndex:e.rowEnd,colIndex:e.colEnd},axis:`both`},{key:`br`,placement:{side:`b`,align:`end`},cell:{rowIndex:e.rowEnd,colIndex:e.colEnd},pivot:{rowIndex:e.rowStart,colIndex:e.colStart},axis:`both`}]})(s,o?.getTotalRange(),c?.getVisibleRange()),[f,p]=(0,u.useState)(!1),m=(0,u.useRef)(null);(0,u.useEffect)(()=>()=>m.current?.dispose(),[]);let h=(e,n,r,i)=>{m.current?.dispose();let a=r===`col`?{x:!0,y:!1}:r===`row`?{x:!1,y:!0}:{x:!0,y:!0},o=t.getSelection(),s=kn(e,()=>(p(!0),{dragMode:`grip`,drag:e=>{let i=r===`col`?{colIndex:e.colIndex}:r===`row`?{rowIndex:e.rowIndex}:e;t.modify(i,n)},edgeScroll:t=>wn(e,t,a),end:()=>p(!1),cancel:()=>{t.setSelection(o),p(!1)}}),void 0,(t,n)=>(e.getPaneFromPointer(t,n)??e).getCellFromPointer(t,n));m.current=s,s.start(i,i.currentTarget)};return(0,d.jsx)(d.Fragment,{children:l.map(e=>(0,d.jsx)(kr,{spec:e,size:a,color:r,dragging:f,onBeginDrag:h},e.key))})};Or.displayName=`SelectionTouchGrips`;var kr=e=>{let{spec:t,size:n,color:r,dragging:i,onBeginDrag:a}=e;return(0,d.jsx)(Ne,{anchor:{cell:t.cell},placement:t.placement,whenOff:`hide`,children:e=>e.slid?null:(0,d.jsx)(Ar,{state:e,size:n,color:r,dragging:i,pin:t.pin,onBeginDrag:n=>{e.pane&&a(e.pane,t.pivot,t.axis,n)}})})},Ar=e=>{let{state:t,size:n,color:r,dragging:a,pin:o,onBeginDrag:s}=e,{getPortalContainer:c}=i.Z(),{className:l,attrs:p}=nn(t.pane),m=(0,u.useRef)({state:t,pin:o});m.current={state:t,pin:o};let h=(0,u.useMemo)(()=>({get contextElement(){return m.current.state.reference.contextElement},getBoundingClientRect:()=>{let{state:e,pin:t}=m.current,{x:n,y:r}=e.getAnchorPoint();if(t){let i=e.pane?.getElement()?.getBoundingClientRect();i&&(t===`v`?r=i.top+i.height/2:n=i.left+i.width/2)}return{x:n,y:r,width:0,height:0,top:r,left:n,right:n,bottom:r}}}),[]),g=(0,u.useMemo)(()=>[$t(({rects:e})=>-e.floating.height/2)],[]),{refs:_,floatingStyles:v,update:y}=Qt({placement:`bottom`,strategy:`fixed`,elements:{reference:h},whileElementsMounted:Gt,middleware:g});return(0,u.useLayoutEffect)(()=>{y()},[t,y]),(0,f.createPortal)((0,d.jsx)(`div`,{ref:_.setFloating,className:[`touch-select-grip`,l].filter(Boolean).join(` `),...p,style:{...v,width:n,height:n,background:`var(--sxl-color-base-100, white)`,border:`3px solid ${r}`,borderRadius:`50%`,boxShadow:`0 0 0 1.5px var(--sxl-color-base-100, white)`,cursor:`grab`,touchAction:`none`,zIndex:1250,opacity:+!a,pointerEvents:a?`none`:`all`,transition:`opacity 160ms`},onPointerDown:e=>{e.button!==0&&e.pointerType!==`touch`||t.pane&&(e.preventDefault(),e.stopPropagation(),s(e))}}),c())},jr=e=>{let{ranges:t,rangeIndex:r,cell:i}=e;if(t&&t.length>0){let e=r??-1;return t[e>=0?e:t.length-1]}return n.d.cellToRange(i)},Mr=[n.a.Left,n.a.Right,n.a.Up,n.a.Down],Nr={[n.a.Left]:`ArrowLeft`,[n.a.Right]:`ArrowRight`,[n.a.Up]:`ArrowUp`,[n.a.Down]:`ArrowDown`},Pr={[n.a.Left]:`Left`,[n.a.Right]:`Right`,[n.a.Up]:`Up`,[n.a.Down]:`Down`},Fr=(e,t)=>t===void 0?e:t===null?null:{...e,...t},Ir=(e,t)=>t?{fill:Fr(e.fill,t.fill),border:Fr(e.border,t.border),inner:Fr(e.inner,t.inner)}:e,Lr={side:`b`,align:`end`},Rr=u.forwardRef((e,t)=>{let{selection:r,getContentBounds:a,getRegionBounds:o,scrollIntoView:s,singleStyle:c,multiStyle:l,multiAnchorStyle:f,singleAnchorStyle:p,removePreviewStyle:m,insertBarStyle:h,isDropRefused:g,moveSourceStyle:_,singleLayer:v,multiLayer:y,enabledMove:b,onMove:x,onMoveStart:S,onMoveUpdate:C,onMoveEnd:w,moveCursor:E,enableFill:D,snapFillDestination:O,onFill:k,onFillStart:A,onFillPreview:j,onFillEnd:M,onFillMenu:N,resolveFillExtent:P,onEdgeDoubleClick:F,onSelectionEnd:I,onDragModeChange:L,renderTip:R,tipPlacement:z,disableKeyboard:B,anchorHole:V=!0,...H}=e,U=i.$(r,e=>e.getSelection()),W=((e,t)=>{let r=Z(),i=t?.allowDeselect??!0,a=t?.allowMulti??!0,o=(0,u.useRef)(null),[s,c]=(0,u.useState)(null),l=(0,u.useRef)(t?.onSelectionEnd);l.current=t?.onSelectionEnd;let d=An((t,s)=>{if(s.pointerType===`touch`){let t=r.getScrollTopLeft(),i={x:s.clientX,y:s.clientY};return{capture:!1,drag:()=>{},end:a=>{let o=r.getScrollTopLeft();if(o.left===t.left&&o.top===t.top){let t=r.getCellFromPointer(i.x,i.y);t&&e.setSelection({cell:t,ranges:n.d.EmptyRanges,rangeIndex:-1})}l.current?.(a)}}}if(s.button===2){let r=e.getSelection();return n.d.isEqualCells(r.cell,t)||r.ranges&&r.ranges.some(e=>n.d.isCellWithinRange(t,e))||e.setSelection({cell:t,ranges:n.d.EmptyRanges,rangeIndex:-1}),null}if(s.button!==0)return null;s.stopPropagation();let u=e=>l.current?.(e),d=e.getSelection(),f=()=>e.setSelection(d);if(s.shiftKey)return e.modify(t),{dragMode:`extend`,drag:t=>e.modify(t),end:u,cancel:f};if((s.ctrlKey||s.metaKey)&&a){let a=e.getSelection().ranges,s=!!a&&a.some(e=>n.d.isCellWithinRange(t,e));return i&&s?(o.current=n.d.cellToRange(t),c(o.current),{dragMode:`remove`,drag:e=>{o.current=((e,t)=>{let n=r.getTotalRange();return{rowStart:Math.max(n.rowStart,Math.min(e.rowIndex,t.rowIndex)),colStart:Math.max(n.colStart,Math.min(e.colIndex,t.colIndex)),rowEnd:Math.min(n.rowEnd,Math.max(e.rowIndex,t.rowIndex)),colEnd:Math.min(n.colEnd,Math.max(e.colIndex,t.colIndex))}})(t,e),c(o.current)},end:t=>{let n=o.current;o.current=null,c(null),n&&e.deselect(n),u(t)},cancel:()=>{o.current=null,c(null)}}):(e.append(t),{dragMode:`extend`,drag:t=>e.modify(t),end:u,cancel:f})}return e.setSelection({cell:t,ranges:n.d.EmptyRanges,rangeIndex:-1}),{dragMode:`extend`,drag:t=>e.modify(t),end:u,cancel:f}});return{onPointerDown:d.onPointerDown,onPointerMove:d.onPointerMove,onPointerUp:d.onPointerUp,removePreview:s,dragMode:d.dragMode}})(r,{onSelectionEnd:I}),G=u.useRef(L);G.current=L,u.useEffect(()=>{G.current?.(W.dragMode)},[W.dragMode]);let[K,q]=u.useState(null),J=Z(),Y=u.useRef(r);Y.current=r;let ee=u.useRef(J);ee.current=J;let X=u.useRef(a);X.current=a;let te=u.useRef(o);te.current=o;let ne=u.useRef(s);ne.current=s;let re=u.useMemo(()=>function(e){let{getSelection:t,getPane:r,getContentBounds:a,getScrollIntoView:o=()=>{},getRegionBounds:s=()=>null}=e,c=()=>t(),l=()=>r(),u=()=>l().getTotalRange(),d=a??u,f=e=>s(e),p=e=>{let t=o();t?t(e):l().scrollCellCoordsIntoView(e)},m=()=>p(c().getSelection().cell),h=()=>{let e=c().getSelection();return e.ranges&&e.ranges.length>0&&e.rangeIndex!==void 0&&e.rangeIndex>=0?e.ranges[e.rangeIndex]:n.d.cellToRange(e.cell)},g=(e,t,r=!1)=>{if(c().navigate(e,t,r),o())return;let i=c().getSelection(),a=e===n.a.Left||e===n.a.Right;if(t){let t=u(),r=h(),o=i.cell.colIndex===r.colStart?r.colEnd:r.colStart,s=i.cell.rowIndex===r.rowStart?r.rowEnd:r.rowStart;if(e===n.a.Right&&o===t.colEnd||e===n.a.Left&&o===t.colStart||e===n.a.Up&&s===t.rowStart||e===n.a.Down&&s===t.rowEnd)return;p(a?{colIndex:o}:{rowIndex:s});return}p(a?{colIndex:i.cell.colIndex}:{rowIndex:i.cell.rowIndex})},_=(e,t)=>{let r=l(),i=r.getMetrics(),a=u(),o=r.getSurfaceSize(),s=r.getScrollTopLeft(),d=r.getScrollTarget?.()??s,f=h(),p=c().getSelection().cell,m=t?p.rowIndex===f.rowStart?f.rowEnd:f.rowStart:p.rowIndex,g=t?p.colIndex===f.colStart?f.colEnd:f.colStart:p.colIndex,_=m,v=g,y=null;switch(e){case n.a.Up:{let e=i.getRowOffset(m+1);_=Math.max(a.rowStart,i.getRowIndex(e-o.height)),y={top:i.getRowOffset(_+1)-(e-d.top)};break}case n.a.Down:{let e=i.getRowOffset(m);_=Math.min(a.rowEnd,i.getRowIndex(e+o.height)),y={top:i.getRowOffset(_)-(e-d.top)};break}case n.a.Left:{let e=i.getColOffset(g+1);v=Math.max(a.colStart,i.getColIndex(e-o.width)),y={left:i.getColOffset(v+1)-(e-d.left)};break}case n.a.Right:{let e=i.getColOffset(g);v=Math.min(a.colEnd,i.getColIndex(e+o.width)),y={left:i.getColOffset(v)-(e-d.left)};break}}let b={rowIndex:_,colIndex:v};t?c().modify(b):c().setSelection({cell:b,ranges:n.I.EmptyArray,rangeIndex:-1}),y&&r.scrollTo({...y,behavior:`instant`})},v=(e,t)=>{if(t)c().modify(e);else{let t=c().getSelection().cell;c().setSelection({cell:{rowIndex:e.rowIndex??t.rowIndex,colIndex:e.colIndex??t.colIndex},ranges:n.I.EmptyArray,rangeIndex:-1})}m()},y=(e,t)=>{let r=c().getSelection(),i=r.ranges&&r.ranges.length>0||e!==n.R.Row?void 0:f(r.cell)??void 0;c().traverse(e,t,i),m()},b=e=>{let t=c().getSelection();if(!t.ranges||t.ranges.length<=1)return;let n=(t.rangeIndex??t.ranges.length-1)+(e?-1:1);n<0?n=t.ranges.length-1:n>=t.ranges.length&&(n=0);let r=t.ranges[n];c().setSelection({...t,rangeIndex:n,cell:{rowIndex:r.rowStart,colIndex:r.colStart}}),m()},x=new Map,S=(e,t,n)=>{x.set(e,{shortcut:t,run:n})},C=i.Vt.Shift,w=i.Vt.Ctrl,T=i.Vt.Alt;for(let e of Mr){let t=Pr[e],n=Nr[e];S(`move${t}`,{key:n},()=>g(e,!1)),S(`select${t}`,{key:n,modifiers:[C]},()=>g(e,!0)),S(`moveContentful${t}`,{key:n,modifiers:[w]},()=>g(e,!1,!0)),S(`selectContentful${t}`,{key:n,modifiers:[w,C]},()=>g(e,!0,!0))}S(`moveToPageDown`,{key:`PageDown`},()=>_(n.a.Down,!1)),S(`selectToPageDown`,{key:`PageDown`,modifiers:[C]},()=>_(n.a.Down,!0)),S(`moveToPageUp`,{key:`PageUp`},()=>_(n.a.Up,!1)),S(`selectToPageUp`,{key:`PageUp`,modifiers:[C]},()=>_(n.a.Up,!0)),S(`moveToPageRight`,{key:`PageDown`,modifiers:[T]},()=>_(n.a.Right,!1)),S(`selectToPageRight`,{key:`PageDown`,modifiers:[T,C]},()=>_(n.a.Right,!0)),S(`moveToPageLeft`,{key:`PageUp`,modifiers:[T]},()=>_(n.a.Left,!1)),S(`selectToPageLeft`,{key:`PageUp`,modifiers:[T,C]},()=>_(n.a.Left,!0)),S(`traverseSelectionRight`,{key:`Tab`},()=>y(n.R.Row,!1)),S(`traverseSelectionLeft`,{key:`Tab`,modifiers:[C]},()=>y(n.R.Row,!0)),S(`traverseSelectionDown`,[{key:`Enter`},{key:`NumpadEnter`}],()=>y(n.R.Column,!1)),S(`traverseSelectionUp`,[{key:`Enter`,modifiers:[C]},{key:`NumpadEnter`,modifiers:[C]}],()=>y(n.R.Column,!0)),S(`traverseSelectionNextRange`,{key:`ArrowRight`,modifiers:[w,T]},()=>b(!1)),S(`traverseSelectionPreviousRange`,{key:`ArrowLeft`,modifiers:[w,T]},()=>b(!0)),S(`moveToRowStart`,{key:`Home`},()=>v({colIndex:u().colStart},!1)),S(`moveToGridStart`,{key:`Home`,modifiers:[w]},()=>v({rowIndex:u().rowStart,colIndex:u().colStart},!1)),S(`selectToRowStart`,{key:`Home`,modifiers:[C]},()=>v({colIndex:u().colStart},!0)),S(`selectToColumnStart`,void 0,()=>v({rowIndex:u().rowStart},!0)),S(`selectToGridStart`,{key:`Home`,modifiers:[w,C]},()=>v({rowIndex:u().rowStart,colIndex:u().colStart},!0)),S(`moveToRowEnd`,{key:`End`},()=>v({colIndex:d().colEnd},!1)),S(`moveToGridEnd`,{key:`End`,modifiers:[w]},()=>v({rowIndex:d().rowEnd,colIndex:d().colEnd},!1)),S(`selectToColumnEnd`,void 0,()=>v({rowIndex:u().rowEnd},!0)),S(`selectToRowEnd`,{key:`End`,modifiers:[C]},()=>v({colIndex:d().colEnd},!0)),S(`selectToGridEnd`,{key:`End`,modifiers:[w,C]},()=>v({rowIndex:d().rowEnd,colIndex:d().colEnd},!0)),S(`selectColumn`,{key:`Space`,modifiers:[w]},()=>{let e=f(c().getSelection().cell)??u();c().modify({rowIndex:e.rowStart},{rowIndex:e.rowEnd}),m()}),S(`selectRow`,{key:`Space`,modifiers:[C]},()=>{let e=f(c().getSelection().cell)??u();c().modify({colIndex:e.colStart},{colIndex:e.colEnd}),m()}),S(`scrollToActiveCoords`,{key:`Backspace`,modifiers:[w]},()=>m()),S(`scrollToActiveCoordsClearSelection`,{key:`Backspace`,modifiers:[C]},()=>{let e=c().getSelection().cell;c().setSelection({cell:e,ranges:n.I.EmptyArray,rangeIndex:-1}),m()});let E=(e,t)=>{let n=t.modifiers??[];return(n.includes(w)||n.includes(i.Vt.Meta))===(e.ctrlKey||e.metaKey)&&n.includes(C)===e.shiftKey&&n.includes(T)===e.altKey&&(e.key===t.key||e.code===t.key)};return{invoke(e){let t=x.get(e);return!!t&&(t.run(),!0)},supports:e=>x.has(e),getBindings:()=>x,handleKey(e){for(let t of x.values())if(t.shortcut&&(Array.isArray(t.shortcut)?t.shortcut:[t.shortcut]).some(t=>E(e,t)))return t.run(),!0;return!1}}}({getSelection:()=>Y.current,getPane:()=>ee.current,getContentBounds:()=>X.current?.()??ee.current.getTotalRange(),getScrollIntoView:()=>ne.current,getRegionBounds:e=>te.current?.(e)??null}),[]);u.useImperativeHandle(t,()=>re,[re]);let ie=!!U.ranges&&U.ranges.length>0,ae=ie?[...U.ranges]:[n.d.cellToRange(U.cell)],oe=ae.length>1,se=U.rangeIndex??-1,ce=ie?se>=0?se:ae.length-1:0,le=J.getRangeFromCell(U.cell),ue=n.d.unionRanges(ae[ce]??n.d.cellToRange(U.cell),le),de=ae.filter((e,t)=>t!==ce),Q=oe?Ir(Cr,l):Ir(Sr,c),fe={...wr,...f},me=Ir(Tr,m),{refusedColor:he,...ge}={...Er,...h},_e=_===null?null:Ir(Dr,_),ve=(e,t)=>{let r=t.mods.shiftKey?t.insert:null,i=t.mods.ctrlKey||t.mods.metaKey,a=r?((e,t,n)=>{let r=e.rowEnd-e.rowStart,i=e.colEnd-e.colStart,a=T(t.origin.rowIndex,n.rowStart,n.rowEnd-r),o=T(t.origin.colIndex,n.colStart,n.colEnd-i);return{...e,rowStart:a,rowEnd:a+r,colStart:o,colEnd:o+i}})(e,r,J.getTotalRange()):e,o={to:a,copy:i,insert:r?.axis};return o.refused=!!r&&!i&&(g?g(ue,o):n.d.isRefusedInsertCut(n.d.classifyInsertCut(ue,a,r.axis))),o},ye=e=>{let t=r.getSelection(),i=t.ranges,a=!!i&&i.length>0,o=a?t.rangeIndex!==void 0&&t.rangeIndex>=0&&t.rangeIndex<i.length?t.rangeIndex:i.length-1:0,s=a?i.map((t,n)=>n===o?e:t):[e],c=n.d.isCellWithinRange(t.cell,e)?t.cell:{rowIndex:e.rowStart,colIndex:e.colStart};r.setSelection({cell:c,ranges:s,rangeIndex:o})},be=K??(W.dragMode===`extend`?{kind:`select`,range:ue}:null),xe=be&&R?R(be):null,Se=u.Children.map(oe?y:v,e=>{if(!u.isValidElement(e))return e;let t=e.props;return u.cloneElement(e,{range:ue,onDragEnd:(e,n)=>{t.onDragEnd?.(e,n),ye(e)}})});return(0,d.jsxs)(pe,{...H,onPointerDown:W.onPointerDown,onPointerMove:W.onPointerMove,onPointerUp:W.onPointerUp,onKeyDown:B?void 0:e=>{re.handleKey(e)&&(e.preventDefault(),e.stopPropagation())},children:[K?.kind===`move`&&!K.drop.copy&&_e&&!n.d.isEqualRanges(K.to,K.from)&&zr(_e,K.from,void 0,!1,`move-source`),(0,d.jsxs)(d.Fragment,oe?{children:[de.map((e,t)=>(0,d.jsx)(u.Fragment,{children:zr(Q,e)},`other-${t}`)),zr(Q,ue,V?le:void 0),(0,d.jsx)(xn,{className:`anchor`,range:le,...fe})]}:{children:[zr(Q,ue,V?le:void 0),p&&(0,d.jsx)(xn,{className:`anchor`,range:le,...p})]}),!oe&&b&&(0,d.jsx)(Vn,{className:`move-grip`,range:ue,grip:`edges`,dragCursor:E,renderMove:(e,t)=>{let n=ve(e,t);return n.insert?(0,d.jsx)(Sn,{range:n.to,axis:n.insert,...ge,color:(n.refused?he:void 0)??ge.color}):Q.border&&(0,d.jsx)(xn,{className:`move-ghost`,range:n.to,...Q.border,animatedTransition:!0,style:{opacity:.6}})},onEdgeDoubleClick:F,onDragStart:(e,t,n)=>{let r=ve(e,n);S?.(e,t,r),q({kind:`move`,from:e,to:r.to,drop:r})},onDragMove:(e,t,n)=>{let r=ve(e,n);C?.(ue,r.to,t,r),q({kind:`move`,from:ue,to:r.to,drop:r})},onDragStateChange:e=>{e||(w?.(),q(null))},onDragEnd:(e,t,n)=>{let i=ve(e,n);i.refused||(x?.(ue,i.to,t,i),r.modify({rowIndex:i.to.rowEnd,colIndex:i.to.colEnd},{rowIndex:i.to.rowStart,colIndex:i.to.colStart}))}}),!oe&&D&&(0,d.jsx)(qn,{range:ue,snapDestination:O,...Q.border,onDragStart:(e,t)=>{A?.(e,t),q({kind:`fill`,template:e,destination:e})},onDragMove:(e,t)=>{j?.(ue,e,t),q({kind:`fill`,template:ue,destination:e})},onDragEnd:(e,t)=>{k?.(ue,e,t),ye(e)},onMenu:N?(e,t,n)=>{N(ue,e,t,n)}:void 0,onDragDone:()=>{M?.(),q(null)},onDoubleClick:P?(e,t)=>{let r=P(e);r&&!n.d.isEqualRanges(r,e)&&(k?.(e,r,t),ye(r))}:void 0}),W.removePreview&&zr(me,W.removePreview,void 0,!1,`remove-preview`),Se,xe!=null&&be&&(0,d.jsx)(on,{className:`gesture-tip`,anchor:{range:(Ce=be,Ce.kind===`move`?Ce.to:Ce.kind===`fill`?Ce.destination:Ce.range)},placement:z??Lr,offset:8,whenOff:`clamp`,open:!0,style:{pointerEvents:`none`},children:xe})]});var Ce});Rr.displayName=`SelectionLayer`;var zr=(e,t,n,r=!1,i=`range`)=>(0,d.jsxs)(d.Fragment,{children:[e.fill&&(0,d.jsx)(xn,{className:`${i} fill`,animatedTransition:r,range:t,hole:n,...e.fill}),e.inner&&(0,d.jsx)(xn,{className:`${i} inner`,animatedTransition:r,range:t,...e.inner}),e.border&&(0,d.jsx)(xn,{className:`${i} border`,animatedTransition:r,range:t,...e.border})]}),Br=[`#1a73e8`,`#d93025`,`#1e8e3e`,`#9334e6`,`#e37400`,`#12a4af`,`#d01884`],Vr=Array.from({length:7},(e,t)=>`var(--sxl-color-series-${t+1}, ${Br[t]})`),Hr=`var(--sxl-color-primary, rgb(0, 120, 215))`,Ur=(e,t,n)=>({rowStart:Math.max(n.rowStart,Math.min(e.rowIndex,t.rowIndex)),colStart:Math.max(n.colStart,Math.min(e.colIndex,t.colIndex)),rowEnd:Math.min(n.rowEnd,Math.max(e.rowIndex,t.rowIndex)),colEnd:Math.min(n.colEnd,Math.max(e.colIndex,t.colIndex))}),Wr=e=>({stroke:Vr.length?Vr[e%Vr.length]:Hr}),Gr=e=>{let{selection:t,getRangeStyle:r=Wr,anchors:a=Un,enabledMove:o,disableDraw:s,allowMulti:c=!0,size:l,animated:f,renderHandle:p,preserveFocus:m=!0,onDragActiveChange:h,rangeStyle:g=n.I.EmptyObject,className:_,...v}=e,y=Z(),b=i.$(t,e=>e.getSelection()),x=b.ranges??n.d.EmptyRanges,S=Math.min(Math.max(0,b.rangeIndex??x.length-1),Math.max(0,x.length-1)),[C,T]=(0,u.useState)(null),[E,D]=(0,u.useState)(null),[O,k]=(0,u.useState)(!1),A=E!==null||O,j=(0,u.useRef)(h);j.current=h,(0,u.useEffect)(()=>{j.current?.(A,E)},[A,E]),(0,u.useEffect)(()=>()=>{j.current?.(!1,null)},[]);let M=E??C,N=(e,t)=>T(n=>t?e:n===e?null:n),P=(e,r)=>{let i=t.getSelection(),a=i.ranges??n.d.EmptyRanges,o=e<a.length?a.map((t,n)=>n===e?{...t,...r}:t):[...a,r];t.setSelection({...i,cell:{rowIndex:r.rowStart,colIndex:r.colStart},ranges:o,rangeIndex:e})},F=e=>{let n=t.getSelection();(n.rangeIndex??-1)!==e&&t.setSelection({...n,rangeIndex:e})},I=An((e,t)=>{if(t.button!==0)return null;let r=(b.rangeIndex??-1)>=0?b.rangeIndex:-1;if(t.shiftKey&&r>=0&&x[r]){let t={rowIndex:x[r].rowStart,colIndex:x[r].colStart};return k(!0),P(r,Ur(t,e,y.getTotalRange())),{drag:e=>P(r,Ur(t,e,y.getTotalRange())),end:()=>k(!1),captureEvents:!1}}let i=(!t.ctrlKey&&!t.metaKey||!c)&&r>=0?r:x.length;return k(!0),P(i,n.d.cellToRange(e)),{drag:t=>P(i,Ur(e,t,y.getTotalRange())),end:()=>k(!1),captureEvents:!1}}),L=x.map((e,t)=>r(t,t===S)),R=[];for(let e=0;e<L.length;e++)L[e]&&R.push(e);return(0,d.jsxs)(pe,{...v,children:[(!s||O)&&(0,d.jsx)(_e,{fill:!0,className:w(_,`ranges-picker-draw`),onPointerDown:e=>{e.stopPropagation(),m&&e.preventDefault(),I.onPointerDown(e)},onPointerMove:I.onPointerMove,onPointerUp:e=>{e.stopPropagation(),I.onPointerUp(e)}}),o&&R.map(e=>(0,d.jsx)(Vn,{range:x[e],grip:`edges`,preserveFocus:m,onHoverChange:t=>N(e,t),onDragStateChange:t=>{t&&F(e),D(t?e:null)},onDragMove:t=>P(e,t),onDragEnd:t=>P(e,t)},`move-${e}`)),R.map(e=>{let t=e===S,n=e===M,r=((e,t,n)=>{let r=e.stroke??g.stroke??Hr;return{...g,...e,stroke:r,fill:e.fill??g.fill??`color-mix(in srgb, ${r} 12%, transparent)`,alignWidth:n?3:e.alignWidth??g.alignWidth??2,...f&&t?{animatedStroke:!0}:void 0}})(L[e],t,n);return(0,d.jsx)(Gn,{range:x[e],anchors:a,size:l,...r,renderHandle:p,preserveFocus:m,onHandleHoverChange:t=>N(e,t),onDragMove:t=>P(e,t),onDragStart:()=>{F(e),D(e)},onDragEnd:t=>{D(null),P(e,t)}},`resize-${e}`)})]})};Gr.displayName=`RangesPickerLayer`;var Kr=0,qr=class{constructor(e,t={}){this.listeners=new Set,this.commitListeners=new Set,this.cancelListeners=new Set,this.editors=new Set,this.activeEditor=null,this.activeEditorId=null,this.auxState=null,this.commitFn=e.commit,this.onCommitError=e.onCommitError,this.state={mode:t.mode??`enter`,coords:e.coords,clean:e.clean,dirty:t.dirty,initialSelection:t.initialSelection??null,autoFocus:t.autoFocus??!0,token:++Kr}}getState(){return this.state}getCoords(){return this.state.coords}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}registerEditor(e){return this.editors.add(e),()=>{this.editors.delete(e),this.activeEditor===e&&(this.activeEditor=null)}}setActiveEditor(e){this.activeEditor=e}getActiveEditor(){return this.activeEditor}setActiveEditorId(e){this.activeEditorId=e}getActiveEditorId(){return this.activeEditorId}getEditors(){return[...this.editors]}getAuxState(){return this.auxState}setAuxState(e){this.auxState!==e&&(this.auxState=e,this.notify())}setDirty(e){this.state.dirty!==e&&this.emit({...this.state,dirty:e})}setMode(e){this.state.mode!==e&&this.emit({...this.state,mode:e})}commit(e){let t=this.state,n=!1,r={coords:t.coords,dirty:t.dirty,args:e,veto:()=>{n=!0}};for(let e of this.commitListeners){try{e(r)}catch(e){console.error(`EditSession beforeCommit listener threw:`,e),n=!0}if(n)break}if(n)return!1;if(t.dirty===void 0)return!0;try{if(!1===this.commitFn(t.dirty,e))return!1}catch(e){return this.onCommitError?this.onCommitError(e):console.error(`EditSession commit rejected with an error:`,e),!1}return!0}cancel(){this.cancelListeners.forEach(e=>{try{e()}catch(e){console.error(`EditSession cancel listener threw:`,e)}})}addCommitListener(e){return this.commitListeners.add(e),()=>{this.commitListeners.delete(e)}}addCancelListener(e){return this.cancelListeners.add(e),()=>{this.cancelListeners.delete(e)}}emit(e){this.state=e,this.notify()}notify(){this.listeners.forEach(e=>e())}},Jr=(e,t)=>{let n=(0,u.useRef)(null);return(0,u.useLayoutEffect)(()=>{let t=n.current;t!==null&&(n.current=null,e.current?.setSelectionRange(t,t))},[t]),i.X(e=>{n.current=e},[])},Yr=e=>{let{mode:t,value:r,onDirtyChange:a,onModeChange:o,onCommit:s,onCancel:c,onNavigate:l,onTraverse:u,setCaret:d}=e;return i.X(e=>{let f=e.nativeEvent;if(f.isComposing)return void e.stopPropagation();if(e.which===i.Zt.Escape)return e.preventDefault(),e.stopPropagation(),void c();if(!(e.which!==i.Zt.F2||f.altKey||f.metaKey||f.ctrlKey||f.shiftKey))return e.preventDefault(),e.stopPropagation(),void o(t===`edit`?`enter`:`edit`);if(e.which===i.Zt.Enter&&(f.altKey||f.metaKey)){e.preventDefault(),e.stopPropagation();let t=e.currentTarget,n=t.selectionStart+1;d&&d(n),a(r.substring(0,t.selectionStart)+`
2
+ `+r.substring(t.selectionEnd)),d||requestAnimationFrame(()=>t.setSelectionRange(n,n));return}let p=e.which===i.Zt.Left||e.which===i.Zt.Right||e.which===i.Zt.Up||e.which===i.Zt.Down;if(p&&t===`edit`)return void e.stopPropagation();if(e.which===i.Zt.Enter||e.which===i.Zt.Tab||p&&t===`enter`){e.preventDefault();let t=((e,t)=>{if(e.which===i.Zt.Enter&&t.ctrlKey)return t.shiftKey?{arrayFixed:!0}:{broadcast:!0}})(e,f);if(!s(t)||t)return void e.stopPropagation();let r=e.which===i.Zt.Enter||e.which===i.Zt.Tab;r&&u?(e.stopPropagation(),u(e.which===i.Zt.Tab?n.R.Row:n.R.Column,e.shiftKey)):!r&&l&&(e.stopPropagation(),l((e=>{switch(e.which){case i.Zt.Enter:return e.shiftKey?n.a.Up:n.a.Down;case i.Zt.Tab:return e.shiftKey?n.a.Left:n.a.Right;case i.Zt.Up:return n.a.Up;case i.Zt.Left:return n.a.Left;case i.Zt.Right:return n.a.Right;default:return n.a.Down}})(e)));return}let m=f.ctrlKey||f.metaKey,h=e.key.length===1?e.key.toLowerCase():``;(!m||h!==`c`&&h!==`x`&&h!==`v`&&h!==`a`&&h!==`z`&&h!==`y`)&&(e.which!==i.Zt.Insert||!m&&!f.shiftKey)&&e.which!==i.Zt.Delete&&e.which!==i.Zt.BackSpace&&(t!==`edit`||e.which!==i.Zt.Home&&e.which!==i.Zt.End&&e.which!==i.Zt.PageUp&&e.which!==i.Zt.PageDown)||e.stopPropagation()},[t,r,s,c,o,a,l,u,d])},Xr=class{constructor(e,t,n){this.current=null,this.listeners=new Set,this.commitErrorListeners=new Set,this.anchor=e,this.createEdit=t,this.revertAnchor=n?.revertAnchor,this.unsubscribeAnchor=e.subscribe(()=>this.onAnchorChange())}onAnchorChange(){if(!this.current)return;let e=this.current.getState().coords;n.d.isEqualCells(this.anchor.getCoords(),e)||this.commit()||(this.revertAnchor?.(e),n.d.isEqualCells(this.anchor.getCoords(),e)||this.cancel())}getAnchor(){return this.anchor}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}subscribeCommitError(e){return this.commitErrorListeners.add(e),()=>{this.commitErrorListeners.delete(e)}}getSession(){return this.current}startEdit(e,t={}){let n=this.createEdit(e);return!!n&&(this.current=new qr({coords:e,...n,onCommitError:e=>{this.commitErrorListeners.size===0?console.error(`EditSession commit rejected with an error:`,e):this.commitErrorListeners.forEach(t=>t(e))}},t),this.notify(),!0)}commit(e){if(!this.current)return!1;let t=this.current.commit(e);return t&&(this.current=null,this.notify()),t}cancel(){this.current&&(this.current.cancel(),this.current=null,this.notify())}dispose(){this.unsubscribeAnchor(),this.cancel(),this.listeners.clear()}notify(){this.listeners.forEach(e=>e())}},Zr=96/72*11,Qr=`Calibri, sans-serif`,$r=e=>{let{open:t,mode:n,clean:r,dirty:i,token:a,autoFocus:o,initialSelection:s,zoom:c,readOnly:l,onDirtyChange:f,onModeChange:p,onCommit:m,onCancel:h,onNaturalSize:g}=e,_=i??r??``,v=(0,u.useRef)(null),y=(0,u.useRef)(null),b=(0,u.useRef)(0);(0,u.useLayoutEffect)(()=>{if(!t||!o)return;let e=v.current;if(!e||(e.focus(),b.current===a))return;b.current=a;let n=e.value.length,r=s??{start:n,end:n,direction:`forward`};e.setSelectionRange(r.start,r.end,r.direction)},[a,t,o]),(0,u.useLayoutEffect)(()=>{let e=y.current;e&&g&&g({width:e.offsetWidth+4,height:e.offsetHeight})},[_,g]);let x=Yr({mode:n,value:_,onDirtyChange:f,onModeChange:p,onCommit:m,onCancel:h,setCaret:Jr(v,_)});return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`textarea`,{ref:v,value:_,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,name:`cell-editor`,readOnly:l,style:{flex:`1 1 100%`,boxSizing:`border-box`,padding:`0px 2px`,margin:0,border:`none`,outline:`none`,resize:`none`,overflow:`hidden`,background:`transparent`,fontFamily:Qr,fontSize:Zr*c+`px`,lineHeight:1.2,whiteSpace:`pre`,userSelect:`text`},onChange:e=>f(e.target.value),onPointerDown:e=>{e.stopPropagation(),n!==`edit`&&p(`edit`)},onKeyDown:x}),(0,d.jsx)(`div`,{ref:y,"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,fontFamily:Qr,fontSize:`${Zr}px`,lineHeight:1.2},children:_.length===0?` `:_})]})};function ei(e){let{editable:t,renderEditor:n,idleClean:r=null,mapClean:a,editorId:o,readOnly:s,className:c,style:l}=e,u=i.$(t,e=>e.getSession()),f=i.in(u,e=>e.getState()),p=f?.clean??r,m=a?a(p):p,h=i.X(e=>t.commit(e),[t]),g=i.X(()=>t.cancel(),[t]),_=i.X(()=>{s||(t.getSession()||t.startEdit(t.getAnchor().getCoords(),{mode:`edit`,autoFocus:!1}),t.getSession()?.setActiveEditorId(o??null))},[t,o,s]),v={open:!!f,mode:f?.mode??`enter`,coords:f?.coords??t.getAnchor().getCoords(),clean:m,dirty:f?.dirty,token:f?.token??0,autoFocus:!1,readOnly:s,initialSelection:f?.initialSelection,zoom:1,onDirtyChange:e=>u?.setDirty(e),onModeChange:e=>u?.setMode(e),onCommit:h,onCancel:g};return(0,d.jsx)(`div`,{className:c,style:l,onFocus:_,children:n?n(v):(0,d.jsx)($r,{...v})})}$r.displayName=`DefaultEditorInput`,ei.displayName=`EditorDiv`;var ti=`ew-resize`,ni=`ns-resize`,ri=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{axis:r,index:a,className:o,style:s,disabled:c=!1,disabledResize:l=!1,isNextHidden:u,isHidden:f,isSelected:p,isSelectedAll:m,showTouchDivider:h,bounds:g,onPointerDown:_,onAutoFit:v,...y}=e,b=Z(),x=r===n.R.Column,S=1/i.kt.getDevicePixelRatio(),C=p||m,T=C?`color-mix(in srgb, var(--sxl-color-primary, rgb(33, 115, 70)) 35%, var(--sxl-color-base-300, rgb(171, 171, 171)))`:`var(--sxl-color-base-300, rgb(171, 171, 171))`,E=`var(--sxl-color-base-100, #f5f5f5)`,D=i.kt.detectIt().primaryInput===`touch`,O=x?14:8,k=b.getZoom();k<1&&(O=Math.max(2,O*k*.8));let A=O/2,j=0;u&&(j=-2),f&&(j=2),f&&(O=O/2+j,A=2*j);let M=T;return C||j!==0||(M=`linear-gradient(${x?180:90}deg, ${E}, ${T} 55%, ${T} 100%)`),(0,d.jsxs)(`div`,{className:w(`header-divider`,{disabled:c},o,`index-${a}`),ref:t,onPointerDown:D?void 0:_,onDoubleClick:D?void 0:()=>v?.(),style:{top:`${x?0:-O/2+j}px`,left:`${x?-O/2+j:0}px`,width:x?O:`calc(100%)`,height:x?`calc(100%)`:O,position:`absolute`,overflow:`visible`,pointerEvents:`auto`,cursor:c||l||D?void 0:x?ti:ni,...s},...y,children:[(0,d.jsx)(`div`,{style:{position:`relative`,top:`${x?0:A}px`,left:`${x?A:0}px`,width:x?S:`100%`,height:x?`100%`:S,background:M},onDoubleClick:()=>v?.()}),h&&D?(0,d.jsx)(`div`,{style:{position:`absolute`,cursor:`grab`,zIndex:1,borderRadius:`4px`,right:x?`-6px`:`2px`,bottom:x?`2px`:`-9px`,height:`24px`,width:x?`24px`:`18px`,maxHeight:x?`calc(100% - 4px)`:void 0,maxWidth:x?void 0:`calc(100% - 4px)`,background:E,border:`1px solid var(--sxl-color-base-300, rgb(171, 171, 171))`,boxShadow:`0.5px 0.5px 0px 0px var(--sxl-color-base-content, rgba(0,0,0,0.87))`,display:`flex`,alignItems:`center`,justifyContent:`center`},onPointerDown:_,children:(0,d.jsx)(`div`,{style:{width:`6.4px`,height:`12px`,backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='rgb(128%2C128%2C128)' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:`no-repeat`,backgroundPosition:`center`,transform:x?void 0:`rotate(90deg)`}})}):null]})})),ii=e=>(0,d.jsx)(ri,{...e}),ai=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{axis:r,index:a,disabled:o=!1,disabledResize:s=!1,resizeThreshold:c=1,renderDivider:l=ii,onDividerMouseDown:p,onDividerResizeStart:m,onDividerResize:h,onDividerResizeEnd:g,onDividerMouseUp:_,onDividerAutoFit:v,onPointerDown:y,...b}=e,x=Z(),S=i.X(y,[y]),C=i.X(v,[v]),T=r===n.R.Column,E=T?x.getVisibleColumns():x.getVisibleRows(),D=null;E.length>0&&(D=T?x.getBoundsFromRange({rowStart:0,rowEnd:0,colStart:E[0].index,colEnd:E[E.length-1].index}):x.getBoundsFromRange({rowStart:E[0].index,rowEnd:E[E.length-1].index,colStart:0,colEnd:0}),D=x.toClipBounds(D,-10));let O=(0,u.useRef)(null),[k,A]=(0,u.useState)(null),j=(e,t)=>T?e.clientX-t.clientX:e.clientY-t.clientY,M=x.getMetrics(),N=T?M.getColOffset(a+1):M.getRowOffset(a+1),P=i.kt.getDevicePixelRatio(),F=1/P,I=i.kt.snapLineCenter(N,F,P)-F/2,L=i.z({processTouch:!0,onPointerDown:e=>{if(S?.(e),!o&&!s){let e=T?M.getColOffset(a):M.getRowOffset(a),t=N-e;O.current={isResizing:!1,startSize:t,index:a,pane:x,axis:r,onDividerMouseDown:p,onDividerResizeStart:m,onDividerResize:h,onDividerResizeEnd:g,onDividerMouseUp:_},A(O.current),p?.(a,t)}e.stopPropagation(),e.preventDefault()},onPointerUp:(e,t,n)=>{if(!O.current)return;O.current.isResizing&&O.current.onDividerResizeEnd?.(O.current.index,Math.max(0,O.current.startSize+j(e,n)),O.current.startSize);let r=O.current;O.current=null,A(O.current),r.onDividerMouseUp?.(r.index)},onPointerMoveOrWait:(e,t,n)=>{if(!O.current)return;let r=j(e,n);O.current.isResizing?O.current.onDividerResize?.(O.current.index,Math.max(0,O.current.startSize+r),O.current.startSize):Math.abs(r)>=Math.max(0,c)&&(O.current={...O.current,isResizing:!0},A(O.current),O.current.onDividerResizeStart?.(O.current.index,Math.max(0,O.current.startSize+r))),e.stopPropagation(),e.preventDefault()}}),R=i.X(()=>{C?.(a)},[a]),{getPortalContainer:z}=i.Z();if(!D)return;let B=l({bounds:D,axis:r,index:a,disabled:o,disabledResize:s,onAutoFit:R,onPointerDown:L,ref:t,...b},x);if(!B)return;let V=null;return k&&k.isResizing&&k.index===a&&(V=(0,f.createPortal)((0,d.jsx)(`div`,{style:{position:`absolute`,cursor:T?ti:ni,left:0,top:0,width:`100%`,height:`100%`}}),z(),`divider:`+a)),(0,d.jsxs)(d.Fragment,{children:[V,(0,d.jsx)(`div`,{className:w(`header-divider-anchor`),style:{position:`absolute`,pointerEvents:`auto`,top:`${T?D.y:I}px`,left:`${T?I:D.x}px`,width:(T?0:D.width-1)+`px`,height:(T?D.height-1:0)+`px`,display:`flex`},tabIndex:-1,children:B})]})}));ai.displayName=`HeaderDividerAnchor`;var oi=(e,t,r)=>t===n.R.Column?{rowIndex:r.rowStart,colIndex:e.colIndex}:{rowIndex:e.rowIndex,colIndex:r.colStart},si=(e,t,r,i)=>r===n.R.Column?{rowStart:i.rowStart,rowEnd:i.rowEnd,colStart:Math.min(e.colIndex,t.colIndex),colEnd:Math.max(e.colIndex,t.colIndex)}:{colStart:i.colStart,colEnd:i.colEnd,rowStart:Math.min(e.rowIndex,t.rowIndex),rowEnd:Math.max(e.rowIndex,t.rowIndex)},ci=(e,t)=>{let r=Z(),i=(0,u.useRef)(t);i.current=t;let a=(0,u.useMemo)(()=>((e,t,r)=>{let i=null,a=null,o=0,s=()=>t.getAllPanes()[n.A.Center]??t,c=(t,r,i)=>{if(!e)return;let a=e.getSelection(),o=!!a.ranges&&a.ranges.length>0;if(i===`clear`)return void e.setSelection({cell:r,ranges:[t],rangeIndex:0});if(i===`append`){let i=o?[...a.ranges]:[n.d.cellToRange(a.cell)];i.push(t),e.setSelection({cell:r,ranges:i,rangeIndex:i.length-1});return}let s=a.rangeIndex??-1,c=o?s>=0?s:a.ranges.length-1:0,l=o?a.ranges.map((e,n)=>n===c?t:e):[t];e.setSelection({cell:r,ranges:l,rangeIndex:o?c:0})},l=(t,n,r)=>{if(!e)return;let i=e.getSelection(),a=i.ranges&&i.ranges.length>0?i.ranges:[],o=t<a.length?a.map((e,r)=>r===t?n:e):[...a,n];e.setSelection({cell:r,ranges:o,rangeIndex:t})},u=e=>{let{scrollIntoView:t}=r();t?t(e):s().scrollCellCoordsIntoView(e)},d=e=>{let{axis:t,entireRange:i}=r(),a=s().getElement()?.getBoundingClientRect();if(!a)return!1;let o=s().getVisibleRange(),c=null;return t===n.R.Column?e.x>=a.right-24&&o.colEnd<i.colEnd?c={colIndex:o.colEnd+1}:e.x<=a.left+24&&o.colStart>i.colStart&&(c={colIndex:o.colStart-1}):e.y>=a.bottom-24&&o.rowEnd<i.rowEnd?c={rowIndex:o.rowEnd+1}:e.y<=a.top+24&&o.rowStart>i.rowStart&&(c={rowIndex:o.rowStart-1}),!!c&&(u(c),!0)},f=e=>{let{axis:t,entireRange:n,replaceActive:u=!1}=r(),d=si(i??e,e,t,n),f=a??oi(e,t,s().getVisibleRange());u?l(o,d,f):c(d,f,`replace`)};return On(t,(t,p)=>{if(!e)return null;let m=p.button===0,h=p.button===2;if(!m&&!h)return null;let{axis:g,entireRange:_,allowMulti:v=!0,replaceActive:y=!1,preserveFocus:b=!1,onPointerDownInterceptor:x,onDragStart:S,onDragEnd:C,onPointerUp:w}=r();if(!1===x?.(p,t))return null;y&&p.stopPropagation(),b&&m&&p.preventDefault(),S?.();let T=oi(t,g,s().getVisibleRange()),E=p.shiftKey,D=(p.ctrlKey||p.metaKey)&&v;if(y){let n=e.getSelection(),r=n.ranges??[],s=n.rangeIndex??-1;E&&i?(o=s>=0?s:Math.max(0,r.length-1),l(o,si(i,t,g,_),a??T)):(i=t,a=T,o=D||s<0?r.length:s,l(o,si(t,t,g,_),T))}else E&&i?c(si(i,t,g,_),a??T,`replace`):D?(i=t,a=T,c(si(t,t,g,_),T,`append`)):(i=t,a=T,c(si(t,t,g,_),T,`clear`));return(e=>{u(r().axis===n.R.Column?{colIndex:e.colIndex}:{rowIndex:e.rowIndex})})(t),{drag:f,edgeScroll:d,end:e=>{C?.(e),w?.(e)},cancel:e=>{C?.(e)},capture:m,captureEvents:y}})})(e,r,()=>i.current),[e,r]);return(0,u.useEffect)(()=>()=>a.dispose(),[a]),{onPointerDown:a.onPointerDown,onPointerMove:a.onPointerMove,onPointerUp:a.onPointerUp}},li=e=>e==null?[]:Array.isArray(e)?e:[e],ui=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{rowCount:n=1,columnCount:r=1,getRowHeight:a,getColumnWidth:o,metrics:s,renderCells:c,renderBorders:l,showGridLines:f=!0,gridLineColor:p,propsGridLineRows:h,propsGridLineColumns:g,getVisibleCells:_,hiddenCellAt:v,renderBelow:y,children:b,...x}=e,S=m({rowCount:n,columnCount:r,getRowHeight:a,getColumnWidth:o}),C=s??S,[w,T]=(0,u.useReducer)(e=>e+1,0),E=(0,u.useMemo)(()=>({}),[w]),D=(0,u.useCallback)(e=>{T()},[]),O=i.st(t,()=>({invalidate:D}),[D]),k=(0,u.useMemo)(()=>{let e=[];return!1!==f&&e.push((0,d.jsx)(fr,{showGridLines:f,gridLineColor:p,propsRows:h,propsColumns:g,getVisibleCells:_,hiddenCellAt:v},`__gridlines`)),e.push(...li(y)),e.push(...li(l)),c&&e.push((0,d.jsx)(rr,{renderCell:c,getVisibleCells:_,hiddenCellAt:v,cacheToken:E},`__cells`)),e.push(...li(b)),e},[f,p,h,g,_,v,y,l,c,E,b]);return(0,d.jsx)(X,{ref:O,...x,rowCount:n,columnCount:r,metrics:C,children:k})}));ui.displayName=`Grid`;var di,fi=function(){},pi=typeof window<`u`,mi=pi?u.useLayoutEffect:u.useEffect,hi={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0},gi=pi&&window.ResizeObserver!==void 0?function(){var e=(0,u.useState)(null),t=e[0],n=e[1],r=(0,u.useState)(hi),i=r[0],a=r[1],o=(0,u.useMemo)(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,i=t.width,o=t.height,s=t.top,c=t.left,l=t.bottom,u=t.right;a({x:n,y:r,width:i,height:o,top:s,left:c,bottom:l,right:u})}})},[]);return mi(function(){if(t)return o.observe(t),function(){o.disconnect()}},[t]),[n,i]}:function(){return[fi,hi]};function _i(e,t){if(typeof e==`function`)return e(t);e&&(e.current=t)}var vi=parseInt(u.version.split(`.`)[0],10)>=19?function(e){return t=>{let n=[];for(let r of e){let e=_i(r,t),i=typeof e==`function`;n.push(i?e:()=>_i(r,null))}return()=>{for(let e of n)e()}}}:function(e){return t=>{for(let n of e)_i(n,t)}},yi={fill:{fill:`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 14%, transparent)`},border:null,inner:null},bi={stroke:`var(--sxl-color-primary, rgb(0, 120, 215))`,alignWidth:1,inset:1},xi=(0,u.forwardRef)(function(e,t){let{itemCount:n,renderCell:r,getVisibleCells:a,itemHeight:o=24,contentWidth:s,selection:c,propsLayer:l,autoFocus:f,showScrollbar:p=`auto`,scrollTo:h,viewport:g,cacheToken:_,className:v,style:y,children:b,...x}=e,S=(0,u.useMemo)(()=>new i.wt,[]),C=g??S,T=i.$(C,e=>e.getMetrics()),E=p===`auto`?T.totalHeight>T.height:p,D=(0,u.useRef)(null);(0,u.useEffect)(()=>{f&&D.current?.focus()},[f]),(0,u.useEffect)(()=>{if(!h)return;let e=!1,t=0,n=()=>{!e&&C.isReady()&&(e=!0,t=requestAnimationFrame(()=>{D.current?.scrollCellCoordsIntoView({rowIndex:h.row})}))};n();let r=e?null:C.subscribe(n);return()=>{e=!0,t&&cancelAnimationFrame(t),r?.()}},[h,C]);let O=(0,u.useMemo)(()=>new mr({getBounds:()=>({rowStart:0,colStart:0,rowEnd:Math.max(0,n-1),colEnd:0})}),[n]),k=c??O,[A,{width:j}]=gi(),[M,{width:N}]=gi(),P=N>0&&j>0?Math.max(0,N-j):0,F=(0,u.useMemo)(()=>vi([M,t]),[M,t]),I=m({rowCount:n,columnCount:1,getRowHeight:o,getColumnWidth:j||s||T.width||0});return(0,d.jsx)(`div`,{ref:F,className:w(`list-surface`,v),style:{position:`relative`,overflow:`hidden`,height:n*o,maxWidth:`100%`,maxHeight:`100%`,...y,...s==null?null:{width:s+P}},...x,children:(0,d.jsx)(i.Lt,{viewport:C,showVerticalScrollbar:E,showHorizontalScrollbar:!1,style:{width:`100%`,height:`100%`},children:(0,d.jsx)(`div`,{ref:A,style:{width:`100%`,height:`100%`},children:(0,d.jsxs)(X,{ref:D,viewport:C,style:{width:`100%`,height:`100%`},rowCount:n,columnCount:1,metrics:I,children:[(0,d.jsx)(Rr,{selection:k,anchorHole:!1,singleStyle:yi,singleAnchorStyle:bi,multiAnchorStyle:bi},`__selection`),(0,d.jsx)(rr,{renderCell:r,getVisibleCells:a,cacheToken:_},`__cells`),l?(0,d.jsx)(pe,{...l},`__taps`):null]})})})})}),Si=(0,u.forwardRef)(function(e,t){let{itemCount:n,renderItem:r,itemHeight:a,selection:o,onKeyDown:s,cacheToken:c,scrollTo:l,autoFocus:f,viewport:p,className:m,style:h,children:g,..._}=e,v=i.st(t,()=>({isList:()=>!0}),[]),y=(0,u.useCallback)(e=>{let{key:t,style:n,range:i,cell:a}=e,o=i?.rowStart??a.rowIndex;return(0,d.jsx)(`div`,{style:{...n,position:`absolute`,display:`flex`,alignItems:`center`,boxSizing:`border-box`,padding:`0 8px`,overflow:`hidden`,whiteSpace:`nowrap`,userSelect:`none`,pointerEvents:`none`,background:`transparent`},children:r(o)},t)},[r]),b=(0,u.useMemo)(()=>s?{onKeyDown:s}:void 0,[s]);return(0,d.jsx)(xi,{ref:v,className:w(`list`,m),style:h,itemCount:n,itemHeight:a,selection:o,renderCell:y,propsLayer:b,cacheToken:c,scrollTo:l,autoFocus:f,viewport:p,..._})}),Ci=(e,t)=>(0,d.jsx)(`input`,{type:`checkbox`,checked:e,ref:e=>{e&&(e.indeterminate=!!t)},readOnly:!0,tabIndex:-1,style:{margin:0}}),wi=(0,u.forwardRef)(function(e,t){let{itemCount:n,isChecked:r,onCheckedChange:a,renderValue:o,renderCheckbox:s=Ci,renderDivider:c,selectAllLabel:l,itemHeight:f,selection:p,cacheToken:m,autoFocus:h,viewport:g,className:_,style:v,children:y,...b}=e,x=(0,u.useMemo)(()=>new mr({getBounds:()=>({rowStart:0,colStart:0,rowEnd:Math.max(0,n-1),colEnd:0})}),[n]),S=p??x,C=i.X(()=>{if(n===0)return;let e=!r(S.getSelection().cell.rowIndex);a((e=>{let t=e.getSelection();return t.ranges&&t.ranges.length?t.ranges.flatMap(e=>Array.from({length:e.rowEnd-e.rowStart+1},(t,n)=>e.rowStart+n)):[t.cell.rowIndex]})(S),e)},[S,n,r,a]),T=(0,u.useRef)(null),[,E]=(0,u.useReducer)(e=>e+1,0),D=i.X(()=>n===0?-1:S.getSelection().cell.rowIndex,[S,n]),O=i.X(e=>{if(n===0)return;let t=Math.min(Math.max(0,S.getSelection().cell.rowIndex+e),n-1);S.setSelection({cell:{rowIndex:t,colIndex:0}}),T.current={row:t},E()},[S,n]),k=i.st(t,()=>({isCheckboxList:()=>!0,getHighlightIndex:D,moveHighlight:O,toggleHighlighted:C}),[D,O,C]),A=(0,u.useCallback)(e=>(0,d.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,flex:1,minWidth:0,pointerEvents:`auto`,cursor:`pointer`},onMouseDown:t=>{t.preventDefault(),a([e],!r(e))},children:[(0,d.jsx)(`div`,{style:{display:`inline-flex`,pointerEvents:`none`},children:s(r(e))}),(0,d.jsx)(`div`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:o(e)})]}),[r,a,o,s]),j=(0,u.useCallback)(e=>{e.key!==` `&&e.key!==`Enter`||(e.preventDefault(),e.stopPropagation(),C())},[C]),{allChecked:M,someChecked:N}=(0,u.useMemo)(()=>{if(l==null||n===0)return{allChecked:!1,someChecked:!1};let e=!0,t=!1;for(let i=0;i<n;i++)r(i)?t=!0:e=!1;return{allChecked:e,someChecked:t&&!e}},[l,n,r,m]);return(0,d.jsxs)(`div`,{ref:k,className:w(`checkbox-list`,_),style:{display:`flex`,flexDirection:`column`,minHeight:0,...v},...b,children:[l!=null&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,padding:`6px 8px`,userSelect:`none`,cursor:`pointer`},onMouseDown:e=>{e.preventDefault(),a(Array.from({length:n},(e,t)=>t),!M)},children:[(0,d.jsx)(`div`,{style:{display:`inline-flex`,pointerEvents:`none`},children:s(M,N)}),l]}),c?.()]}),(0,d.jsx)(Si,{itemCount:n,itemHeight:f,selection:S,renderItem:A,onKeyDown:j,cacheToken:m,scrollTo:T.current,autoFocus:h,viewport:g,style:{flex:`1 1 100%`,minHeight:0}})]})}),Ti=(e,t)=>t<=0?-1:Math.min(Math.max(0,e),t-1),Ei=(0,u.forwardRef)(function(e,t){let{items:n,onChoose:r,highlightIndex:a,itemHeight:o=24,visibleRows:s=8,contentWidth:c,measureText:l,renderItem:f,autoFocus:p,viewport:m,className:h,style:g,children:_,...v}=e,y=n.length,b=Ti(a??0,y),x=(0,u.useMemo)(()=>new mr({initial:{cell:{rowIndex:Math.max(0,b),colIndex:0}},getBounds:()=>({rowStart:0,colStart:0,rowEnd:Math.max(0,y-1),colEnd:0})}),[n,b,y]),S=(0,u.useRef)(null),[,C]=(0,u.useReducer)(e=>e+1,0),T=(0,u.useMemo)(()=>(S.current=null,b>=0?{row:b}:null),[n,b]),E=S.current??T,D=i.X(e=>!(e<0||e>=y||(r?.(e,n[e]),0)),[r,n,y]),O=i.X(()=>y===0?-1:x.getSelection().cell.rowIndex,[x,y]),k=i.X(e=>{if(y===0)return;let t=Ti(x.getSelection().cell.rowIndex+e,y);x.setSelection({cell:{rowIndex:t,colIndex:0}}),S.current={row:t},C()},[x,y]),A=i.st(t,()=>({isPickList:()=>!0,getHighlightIndex:O,moveHighlight:k,chooseHighlighted:()=>D(O())}),[O,k,D]),j=(0,u.useMemo)(()=>{if(l)return l;let e=(e=>{let t=e?.fontSize,n=e?.fontFamily,r=typeof t==`number`?`${t}px`:t??`16px`,i=[];return e?.fontStyle&&e.fontStyle!==`normal`&&i.push(String(e.fontStyle)),e?.fontWeight&&e.fontWeight!==`normal`&&i.push(String(e.fontWeight)),i.push(r,n?String(n):`sans-serif`),i.join(` `)})(g);return t=>((e,t)=>{let n=(()=>{if(di!==void 0)return di;try{di=(typeof document<`u`?document.createElement(`canvas`).getContext(`2d`):null)??null}catch{di=null}return di})();if(n)return n.font=t,n.measureText(e).width;let r=Number.parseFloat((/(\d+(?:\.\d+)?)px/.exec(t)??[])[1]??`16`)||16;return e.length*r*.55})(t,e)},[l,g]),M=(0,u.useMemo)(()=>{if(c!=null)return c;let e=0;for(let t=0;t<y;t++)e=Math.max(e,j(n[t].text));return Math.ceil(e)+16},[c,n,y,j]),N=(0,u.useCallback)(e=>{let{key:t,style:r,range:i,cell:a}=e,o=i?.rowStart??a.rowIndex,s=n[o];return s?(0,d.jsx)(`div`,{role:`option`,style:{...r,position:`absolute`,display:`flex`,alignItems:`center`,boxSizing:`border-box`,padding:`0 8px`,overflow:`hidden`,whiteSpace:`nowrap`,userSelect:`none`,pointerEvents:`none`,background:`transparent`},children:f?f(s,o):(0,d.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`},children:s.text||`\xA0`})},t):null},[n,f]),P=(0,u.useMemo)(()=>({onPointerUp:e=>{e.button===0&&D(O())},onKeyDown:e=>{e.which!==i.Zt.Enter&&e.which!==i.Zt.Space||(e.preventDefault(),e.stopPropagation(),D(O()))}}),[D,O]);return(0,d.jsx)(xi,{ref:A,className:w(`pick-list`,h),role:`listbox`,style:{maxHeight:s*o,...g},itemCount:y,itemHeight:o,contentWidth:M,selection:x,renderCell:N,propsLayer:P,scrollTo:E,viewport:m,autoFocus:p,cacheToken:n,...v})}),Di=(e,t)=>{let n=t.trim().toLowerCase();return n?e.filter(e=>e.text.toLowerCase().includes(n)):e},Oi=(0,u.forwardRef)(function(e,t){let{value:n,onChange:r,onClose:a,onKeyDown:o,className:s,...c}=e,l=(0,u.useCallback)(e=>{if(e.which===i.Zt.Escape)return e.preventDefault(),e.stopPropagation(),void(n?r(``):a?.());o?.(e)},[n,r,a,o]);return(0,d.jsx)(`input`,{ref:t,type:`text`,role:`searchbox`,autoComplete:`off`,spellCheck:!1,className:w(`_search_b1nag_5`,`list-search`,s),value:n,onChange:e=>r(e.target.value),onKeyDown:l,...c})}),ki={light:{},dark:{"color-base-100":`#1e1e1e`,"color-base-300":`#3a3a3a`}},Ai={light:{"color-base-100":`#f2f2f2`,"color-base-hover":`#ececec`,"color-base-300":`rgb(171, 171, 171)`},dark:{"color-base-100":`#262626`,"color-base-hover":`#2e2e2e`,"color-base-300":`#4a4a4a`}},ji=({app:e,grid:t=ki,header:n=Ai,layer:r=`sxl-defaults`,scope:a}={})=>{let o=e??i.ht,s=Object.fromEntries(Object.keys(n).map(e=>[e,{"color-base-100":o[e]?.[`color-base-200`],...n[e]}]));return i.jt({...e?{app:e}:{},surfaces:{grid:t,header:s},layer:r,scope:a})};(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._header_9ooz5_7{background:var(--sxl-color-base-100,#f5f5f5);color:color-mix(in srgb, var(--sxl-color-base-content,#000) 87%, transparent);line-height:1.2;font-family:var(--sxl-doc-font-minor,"Calibri", sans-serif);align-items:end;display:flex;overflow:hidden}._header_9ooz5_7._hover_9ooz5_18{background:var(--sxl-color-base-hover,#ececec)}._header_9ooz5_7._selected_9ooz5_26{background:var(--sxl-color-base-selected,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 20%, transparent));color:var(--sxl-color-base-selected-content,var(--sxl-color-primary,#1976d2))}._header_9ooz5_7._selectedAll_9ooz5_35{background:var(--sxl-color-base-emphasis,color-mix(in srgb, var(--sxl-color-primary,#1976d2) 75%, var(--sxl-color-base-100,#f5f5f5)));color:var(--sxl-color-base-emphasis-content,var(--sxl-color-primary-content,#fff))}._panel_14jxb_5{min-width:0;max-width:100%;color:var(--sxl-color-base-content,inherit);background:var(--sxl-color-base-100,transparent);flex-direction:column;display:flex}._search_14jxb_16{margin:4px 4px 2px}._values_14jxb_24{min-width:100%}._empty_14jxb_28{opacity:.6;white-space:nowrap;cursor:default;padding:4px 10px}._prompt_3a2hw_8{box-sizing:border-box;color:light-dark(#1f1f1f,#e8e8e8);white-space:pre-line;overflow-wrap:anywhere;cursor:default;user-select:none;background:light-dark(#fffbe6,#3d3a2a);border:1px solid light-dark(#c9c2a0,#6a6448);border-radius:3px;max-width:260px;padding:4px 8px;font:12px/1.4 system-ui,sans-serif;box-shadow:0 2px 6px light-dark(#0000002e,#00000080)}._title_3a2hw_26{font-weight:600}._title_3a2hw_26+._message_3a2hw_30{margin-top:2px}._movable-area_r4xkr_5{& .moveable-control-box{& .dragging{opacity:0}& .moveable-control{background-color:var(--sxl-color-base-100,white);background-image:var(--sxl-image-background);border:2px solid color-mix(in srgb, var(--sxl-color-primary) 70%, black);width:11px;height:11px;margin-top:-5.5px;margin-left:-5.5px}& .moveable-line{background:var(--sxl-color-neutral,grey)}}}@media (pointer:coarse){._movable-area_r4xkr_5{& .moveable-control-box{& .moveable-control{width:22px;height:22px;margin-top:-11px;margin-left:-11px}}}}._TaskPaneArea_1m8hz_5{flex-direction:row;width:100%;height:100%;display:flex;position:absolute}._TaskPaneTitle_1m8hz_13{box-sizing:border-box;border-bottom:1px solid #0003;flex-direction:row;flex:1 1 0;align-items:center;width:100%;height:100%;padding:8px 16px;font-size:1.25rem;display:flex;& .title{opacity:.87}&.focused{& .title{opacity:1}}}._TaskPaneFrame_1m8hz_36{box-sizing:border-box;border-radius:4px;outline:none;flex-direction:column;flex:1 1 0;justify-content:stretch;align-items:stretch;width:100%;min-height:0;margin-bottom:4px;display:flex;position:relative;overflow:hidden}._TaskPaneAreaFrames_1m8hz_55{flex:100%;min-width:0;min-height:0;display:flex;position:relative}._TaskPaneAreaFrameHost_1m8hz_63{flex:100%;min-width:0;min-height:0;display:flex}._TaskPaneAreaFrameHidden_1m8hz_71{display:none}._TaskPaneStrip_1m8hz_75{scrollbar-width:thin;flex-direction:column;gap:4px;min-height:0;margin-top:4px;margin-bottom:4px;margin-left:2px;display:flex;overflow:hidden auto}._TaskPaneStripItem_1m8hz_88{writing-mode:vertical-rl;text-orientation:mixed;cursor:pointer;user-select:none;opacity:.75;border:1px solid #0000;border-radius:4px;flex-direction:row;flex:none;align-items:center;min-width:0;padding:4px;transition:opacity .12s,background-color .12s;display:flex;&:hover{opacity:1;background-color:#8080801f}&.selected{opacity:1;border-color:gray;font-weight:700}}._TaskPaneStripItemIcon_1m8hz_117{transform-origin:50%;display:inline-block;transform:rotate(90deg)}._TaskPaneStripItemLabel_1m8hz_127{opacity:0;grid-template-columns:0fr;transition:grid-template-columns .2s,opacity .15s;display:grid}._TaskPaneStripItemLabelOpen_1m8hz_134{opacity:1;grid-template-columns:1fr}._TaskPaneStripItemLabelClip_1m8hz_139{white-space:nowrap;min-width:0;min-height:0;overflow:hidden}._TaskPaneStripItemLabelText_1m8hz_146{padding-top:4px;display:inline-block}._dropdown_1bnz9_13{box-sizing:border-box;cursor:pointer;user-select:none;color:light-dark(#444,#ccc);background:light-dark(#f4f4f4,#3a3a3a);border:1px solid light-dark(#b8b8b8,#5a5a5a);border-radius:2px;justify-content:center;align-items:center;transition:background-color .1s ease-out;display:flex}._dropdown_1bnz9_13:hover{background:light-dark(#e4e4e4,#4a4a4a)}._dropdown_1bnz9_13:active{background:light-dark(#d4d4d4,#565656)}@media (prefers-reduced-motion:reduce){._dropdown_1bnz9_13{transition:none}}:root{--sxl-cf-bar-fade:20%}._bar_6li90_16{box-sizing:border-box;pointer-events:none;position:absolute}._axis_6li90_23{pointer-events:none;width:1px;position:absolute}:root{--sxl-cf-icon-bad:#ec5753;--sxl-cf-icon-light-bad:#fc9f6e;--sxl-cf-icon-neutral:#f8cd3d;--sxl-cf-icon-good:#8cb354;--sxl-cf-icon-purple:#9b72cf;--sxl-cf-icon-gold:#ffc000;--sxl-cf-icon-gray:light-dark(#a6a6a6,#8a8a8a);--sxl-cf-icon-black:light-dark(#333,#d9d9d9)}._box_1qgal_41{pointer-events:auto;cursor:default;align-items:flex-end;position:absolute}._box_1qgal_41:hover{contain:none;z-index:1}._box_1qgal_41>svg{transform-origin:var(--sxl-cf-icon-origin,center bottom);transition:transform .12s ease-out,filter .12s ease-out}._box_1qgal_41:hover>svg{filter:drop-shadow(0 1px 2px #00000059);transform:scale(1.18)}@media (prefers-reduced-motion:reduce){._box_1qgal_41>svg{transition:none}._box_1qgal_41:hover>svg{transform:none}}._mark_p3uld_7{pointer-events:none;color:light-dark(#3a70b0,#80b8f0);position:absolute}._unresolved_p3uld_19{color:light-dark(#c82828,#ff6e6e)}._sheet-scrollbar_104cg_1{align-items:center;margin-bottom:1px;margin-left:2px}._sheetxl-sheet_3nny_5{& ._viewport-overlay_3nny_6{pointer-events:none;& *{pointer-events:initial}}& .tile{& .text-box{position:absolute}& .text-line{text-rendering:optimizespeed;vertical-align:baseline;white-space:pre;position:absolute}& .column-button{flex-direction:row;justify-content:center;align-items:center;margin-bottom:4px;display:flex;position:absolute}& .text-debug-bounds{pointer-events:none;opacity:.2;background:green;position:absolute}& .fill{position:absolute}& .pending{border:color-mix(in srgb, var(--sxl-color-primary) 70%, black) .5px;background-color:var(--sxl-color-base-200,grey);opacity:1;border-style:double;border-radius:50%;width:6px;height:6px;animation:1.5s infinite alternate _pulse_3nny_1;position:absolute;top:5px;left:4px}& .slider{opacity:0;width:130%;height:2px;animation:0s .5s forwards _fadeIn_3nny_1;position:absolute;bottom:1px;overflow-x:hidden}& .line{opacity:.3;background:color-mix(in srgb, var(--sxl-color-primary) 80%, white) .5px;width:100%;height:2px;position:absolute}& .subline{background:var(--sxl-color-primary,#4d4d4d) .5px;opacity:.9;height:3px;position:absolute}& .inc{animation:3s infinite _increase_3nny_1}}}@keyframes _pulse_3nny_1{0%{opacity:1;transform:scale(1)}50%{opacity:.8;transform:scale(1.2)}to{opacity:1;transform:scale(1)}}@keyframes _fadeIn_3nny_1{0%{opacity:0;height:0}to{opacity:1;height:2px}}@keyframes _increase_3nny_1{0%{width:30%;animation-timing-function:ease;left:-150%}to{width:30%;left:100%}}._themed_f2asj_9{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem));vertical-align:middle;width:var(--chart-icon-size);height:var(--chart-icon-size);fill:currentColor;flex:none;justify-content:center;align-items:center;line-height:1;display:inline-flex}._themed_f2asj_9>svg{width:var(--chart-icon-size);height:var(--chart-icon-size)}._small_f2asj_36{--chart-icon-size:calc(var(--icon-size-sm,.875rem) * .875)}._medium_f2asj_37{--chart-icon-size:var(--icon-size,var(--icon-size-md,1rem))}._large_f2asj_38{--chart-icon-size:calc(var(--icon-size-lg,1.25rem) * 1.5)}._themed_f2asj_9 .current_color{fill:currentColor}._themed_f2asj_9 .background{fill:var(--sxl-color-base-100,#fff)}._themed_f2asj_9 .high_contrast{fill:var(--sxl-color-primary,#595b5e)}._themed_f2asj_9 .info{fill:var(--sxl-color-info,#3b82f6)}._themed_f2asj_9 .info_tint{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 80%, white)}._themed_f2asj_9 .info_shade{fill:color-mix(in srgb, var(--sxl-color-info,#3b82f6) 70%, black)}._themed_f2asj_9 .accent_tint{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 80%, white)}._themed_f2asj_9 .accent_shade{fill:color-mix(in srgb, var(--sxl-color-accent,#9c27b0) 70%, black)}._editable-input_1u3oj_6{width:100%;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;letter-spacing:inherit;text-transform:inherit;background:0 0;border:none;outline:none;padding:0;line-height:1.2;position:absolute;top:50%;left:0;transform:translateY(-50%)}@keyframes _pop_10yib_1{0%{transform:scale(1)}to{transform:scale(var(--scale))}}@keyframes _fadeIn_10yib_29{0%{opacity:0}to{opacity:1}}._Wrapper_10yib_21{box-sizing:border-box;transform:translate3d(var(--translate-x,0), var(--translate-y,0), 0) scaleX(var(--scale-x,1)) scaleY(var(--scale-y,1));transform-origin:0 0;touch-action:manipulation;display:flex;&._dragOverlay_10yib_33{z-index:999}}._Item_10yib_43{box-sizing:border-box;transform-origin:50%;-webkit-tap-highlight-color:transparent;transform:scale(var(--scale,1));outline:none;align-items:center;display:flex;position:relative;&:not(._withHandle_10yib_57){touch-action:manipulation}&._dragging_10yib_62:not(._dragOverlay_10yib_33){opacity:var(--dragging-opacity,0);z-index:999}&._dragOverlay_10yib_33{cursor:inherit;transform:scale(var(--scale));opacity:1;animation:.2s cubic-bezier(.18,.67,.6,1.22) _pop_10yib_1}}._Row_1kr10_1{box-sizing:border-box;display:flex}._TabStrip_3x0dp_1{&::-webkit-scrollbar{height:0;display:none}position:relative;overflow:hidden auto}._sheet-tab_1cbiv_2 input{color:var(--sxl-sheet-tab-input-color,inherit);text-align:center;font-weight:500}._ghost_1cbiv_18{border:1px solid #0000;transition:background-color .12s,border-color .12s}._sheet-tab_1cbiv_2:hover ._ghost_1cbiv_18{background-color:var(--sxl-tab-hover-bg);border-color:var(--sxl-tab-hover-border)}._root_tn3se_6{box-sizing:border-box;min-width:0;min-height:0;color:var(--sxl-color-base-content,inherit);background:var(--sxl-color-base-100,transparent);border-radius:4px;flex-direction:column;gap:4px;padding:4px;display:flex}._list_tn3se_25{border:1px solid var(--sxl-color-base-300,light-dark(#0000001f,#ffffff29));border-radius:4px;flex:auto;min-height:0}._divider_tn3se_32{border:none;border-top:1px solid var(--sxl-color-base-300,light-dark(#0000001f,#ffffff29));margin:0 8px}._root_tn3se_6 input[type=checkbox]{accent-color:var(--sxl-color-primary,#0078d7);width:15px;height:15px}._footer_tn3se_44{opacity:.75;white-space:nowrap;align-items:center;gap:8px;padding:0 4px;font-size:12px;display:flex}._footer_tn3se_44 ._count_tn3se_54{flex:auto}._truncated_tn3se_58{white-space:normal}._empty_tn3se_62{opacity:.6;white-space:nowrap;cursor:default;padding:6px 10px}._add-button_1b4ig_1{cursor:pointer;color:color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent);background:0 0;border:none;justify-content:center;align-items:center;margin:0 2px;padding:0;display:flex}._add-button_1b4ig_1:hover:not(:disabled){color:var(--sxl-color-primary,#1976d2)}._add-button_1b4ig_1:disabled{cursor:default;opacity:.6}._loading-panel_bjv3h_1{box-sizing:border-box;justify-content:center;align-items:center;width:100%;height:100%;display:flex}._loading-spinner_bjv3h_10{border:3px solid color-mix(in srgb, var(--sxl-color-base-content) 44%, transparent);border-top-color:var(--sxl-color-primary,#1976d2);border-radius:50%;width:28px;height:28px;animation:.9s linear infinite _sxl-spin_bjv3h_1}@keyframes _sxl-spin_bjv3h_1{to{transform:rotate(360deg)}}:root{--icon-size:1.25rem}@media (pointer:coarse){:root{--icon-size:1.75rem}}._sheetxl-workbook_r60qk_11{outline:none;flex-direction:column;flex:100%;width:100%;min-width:0;height:100%;min-height:0;display:flex;position:relative;overflow:hidden}._sheetxl-workbook_r60qk_11 *{font-weight:400}._sheetxl-workbook_r60qk_11 .viewport-overlay{outline:none}._sheetxl-reset_r60qk_36{margin:0;padding:0;line-height:1;display:block}._sheetxl-reset_r60qk_36 table,._sheetxl-reset_r60qk_36 thead,._sheetxl-reset_r60qk_36 tbody,._sheetxl-reset_r60qk_36 tfoot,._sheetxl-reset_r60qk_36 tr,._sheetxl-reset_r60qk_36 th,._sheetxl-reset_r60qk_36 td{border-collapse:inherit;border-spacing:0;border:none;border-color:inherit;width:auto;height:auto;vertical-align:inherit;text-align:left;font-weight:inherit;-webkit-border-horizontal-spacing:0;-webkit-border-vertical-spacing:0;margin:0;padding:0;display:block}._sheetxl-reset_r60qk_36 th,._sheetxl-reset_r60qk_36 td{display:inline}._viewport_r60qk_30>:first-child{position:relative}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();var Mi=Object.defineProperty,Ni=(e,t,n)=>{let r=(0,u.useRef)(t);r.current=t;let i=(n=n?{...Fi,...n}:Fi).ignoreModelChange;(0,u.useEffect)(()=>{if(!e||!r.current)return;let t=Object.keys(r.current),a={},o=t.length;for(let e=0;e<o;e++){let n=t[e];a[n]=(e,t)=>r.current[n]?.(e,t)}let s=n?.debugText;s&&console.log(`Add: `+s);let c=e.addListeners(a,n);if(!i)for(let n=0;n<o;n++)a[t[n]]?.(e);return()=>{s&&console.log(`Remove: `+s),c?.()}},[e])};function Pi(e,t){let[n,r]=(0,u.useReducer)(e=>e+1,0);Ni(e,(0,u.useMemo)(()=>{let e=(e,t)=>{r()},n=Array.isArray(t)?t:[t],i={};for(let t of n)i[t]=e;return i},[e,...Array.isArray(t)?t:[t]]))}var Fi={transactional:!1,ignoreModelChange:!1},Ii=(e,t,n,r)=>{let i=(0,u.useRef)(n);i.current=n;let a=r?.fireOnAddressChange??!0;(0,u.useEffect)(()=>{let n=Date.now();if(!e||!t||!i.current){let e={getSource:Li,getFrom:Li,getTo:Li,trigger:`delete`,isDataChange:!1,getTransactionId:Li,isUndo:!1,timeStamp:n};i.current?.(e);return}let o=e=>{i.current?.(e)},s=e.getRange(t).addListener(o,r);if(a){let r=e.getRange(t);o({getSource:()=>r,getFrom:Li,getTo:Li,trigger:`modelChange`,isDataChange:!1,getTransactionId:Li,isUndo:!1,timeStamp:n})}return()=>{s?.()}},[e,t])},Li=()=>null,Ri=(0,u.createContext)(null);function zi(e){let{sheet:t,children:n}=e;return(0,d.jsx)(Ri.Provider,{value:t,children:n})}function Bi(){return(0,u.useContext)(Ri)}var Vi=(0,u.createContext)(null);function Hi(e){let{workbook:t,children:n}=e;return Pi(t,[`onSelectedSheetChange`]),(0,d.jsx)(Vi.Provider,{value:t,children:(0,d.jsx)(zi,{sheet:t?t.getSelectedSheet():null,children:n})})}function Ui(){return(0,u.useContext)(Vi)}var Wi=(0,u.memo)(e=>{let{anchorLocation:t=n.A.TopLeft,cellWidth:r=0,cellHeight:i=0,size:a=7,inset:o=1,fill:s,propsPath:c,style:l,...u}=e,f=a,p=o,m=`red`,h=[],g=[];return t===n.A.TopLeft?(m=`light-dark(green, rgb(255, 198, 246))`,h.push(p),g.push(p),h.push(p+f),g.push(p),h.push(p),g.push(p+f)):t===n.A.TopRight?(m=`light-dark(red, rgb(0, 255, 255))`,h.push(r-p),g.push(p),h.push(r-(p+f)),g.push(p),h.push(r-p),g.push(p+f)):t===n.A.BottomRight?(m=`light-dark(purple, rgb(236, 252, 211))`,h.push(r-p),g.push(i-p),h.push(r-(p+f)),g.push(i-p),h.push(r-p),g.push(i-(p+f))):t===n.A.BottomLeft&&(m=`light-dark(blue, rgb(255, 236, 183))`,h.push(p),g.push(i-p),h.push(p+f),g.push(i-p),h.push(p),g.push(i-(p+f))),(0,d.jsx)(`svg`,{width:`${r}`,height:`${i}`,viewBox:`0 0 ${r} ${i}`,style:{position:`absolute`,width:`${r}px`,height:`${i}px`,pointerEvents:`none`,...l},...u,children:(0,d.jsx)(`path`,{d:`M ${h[0]} ${g[0]} L ${h[1]} ${g[1]} L ${h[2]} ${g[2]} L ${h[0]} ${g[0]} Z`,fill:s??m,...c})})}),Gi=e=>{let{value:t,cell:r,bounds:i,children:s,style:c={},range:l,zoom:u=1,normalStyle:f,showFormulas:p,showZeros:m,allowTextOverflow:h=!0,docTheme:g,onLinkMouseDown:_,...v}=e,y=i.height/u,b=i.width/u,x=t,S=x.getValue(),C=t.getStyle(),w=null,T=null,E=a.i.isError(S),D=E&&S instanceof a.i.Parse,O=p||D;if(O)if(x.isSpillOverflow())T=``;else{let e=x.getFormulaText({target:`display`});e?T=e:w=x.getNumberFormat(o.It.Type.General)}else w=x.getNumberFormat();let k=null;!O&&h&&(k=x.getTextOverflow());let A=k?k.colBounds.width+k.leftOffset+k.rightOffset:b,j=k?k.anchorBounds.x-k.leftOffset:0,M=k?k.anchorBounds.width:b,N=k?k.anchorBounds.x:0,P=x.getRenderHorizontalAlignment(),F=null;w&&(F=w?.formattedRuns,T=F?.runs[0]?.text??w.displayText);let I=x.getCalculationStatus()===o.N.ResultStatus.Pending,L=null,R=0,z=0;if(!C.getBorders().isEmpty()){let e=C.getBorders().getRight();!e.isNone()&&(o.W.BuiltInDefinitions.get(e.getStyle())?.width??0)>1&&(R=1);let t=C.getBorders().getBottom();!t.isNone()&&(o.W.BuiltInDefinitions.get(t.getStyle())?.width??0)>1&&(z=1)}let B=null,V=x.getComments(),H=x.getWarnings(),U=x.getErrors(),W=H.length===1&&U.length===0&&!E&&x.getCircularReference()!==null;if(V||E||U.length>0||H.length>0&&!W){let e={size:7*u,cellWidth:M*u+2,cellHeight:y*u+2,style:{left:N*u,top:0}};B??=[],(H.length>0&&!W||U.length>0||E)&&B.push((0,d.jsx)(Wi,{anchorLocation:n.A.TopLeft,...e},`indicator-${B.length}`)),V&&B.push((0,d.jsx)(Wi,{anchorLocation:n.A.TopRight,...e},`indicator-${B.length}`))}let G=C.getFont(),K=G.getUnderline()===o._.UnderlineStyle.SingleAccounting||G.getUnderline()===o._.UnderlineStyle.DoubleAccounting,q=w?.conditionalColor??null,J=C.getAlignment(),Y=J.getHorizontal()===o.Y.HorizontalAlignment.Fill,ee=J.getHorizontal()===o.Y.HorizontalAlignment.CenterContinuous||Y,X=!ee&&!O&&J.getStacked(),te=ee||O||X?0:J.getRotation(),ne=x.getInsets(),re=ne.top+ne.bottom,ie=ne.left,ae=ne.right,oe=A-1-(ie+ae),se={...c,left:c.left-1,top:c.top-1,width:c.width+1+R,height:c.height+1+z},ce=null;I&&(ce=(0,d.jsxs)(`div`,{className:`slider`,children:[(0,d.jsx)(`div`,{className:`line`}),(0,d.jsx)(`div`,{className:`subline inc`})]},`pending`));let le=!qi&&!(I||_||B||s||(F?.runs.length??0)>1||k||te%360!=0||X||K),ue=ee||!(!k||!(k.rightIndex>0||k.leftIndex>0||k.colSpan>1));if(!ue){let e=x.getSpans();(e.width>1||e.height>1)&&(ue=!0)}let Z={...se};if(!n.I.isEmpty(T)||!n.I.isEmpty(w?.errorPlaceholder)){let e,t,r=w?.canWrap??!1,i=[],s=0,l=!0;m||O||S!==0||(l=!1);let f=x.getTextFrame(O);if(l&&f&&(oe>0||te||X)){let l=oe,p=Y||ee||w&&(w.repeatChars.length>0||w.spacingChars.length>0),m=!te&&!O,h=m&&!X&&!r&&!f.wrapped&&!k&&!p,g=m||te?x.getTextPlacement({width:b,height:y},O):null,T=g?.rotation??null,E=g?.stacked??null,I=!g||T||E?null:g.bounds.y;T?l=T.lineLength:E&&(l=2**53-1);let L=null;r&&!T&&(L={width:l});let R=null,z=w?.errorPlaceholder,B=g?.frame??f.layout(L??void 0);if(e=B.bounds,O?e={...e,width:0}:F&&(e={...e,width:w.errorPlaceholder||w.repeatChars.length>0?l:F.width}),!z&&x.getType()!==a.t.String&&Math.floor(e.width)>l){if(C.getNumberFormat()===`General`&&x.getType()===a.t.Number){let e=C.measureText(`0`),t=Math.floor(l/e.width),r=S,i=Math.abs(r),a=r<0,o=i>=1e5||r!==0&&i<=1e-5,s=n.I.splitNumber(r),c=e=>Math.floor(C.measureText(e).width)<=l,u=Math.min(10,t-(Math.max(1,s?.ipLength??0)+1)-+!!a);if(u>=-1){let e=`0${u>0?`.`:``}${`#`.repeat(Math.max(0,u))}`,t=x.getNumberFormat(e).displayText.replace(/\.$/,``),n=t===`0`&&a?`-0`:t;o&&!/[1-9]/.test(t)||!c(n)||(R=n)}if(!R&&o){let e=t-+!!a-5,n=t-+!!a-4,r=null;if(e>=2?r=`0.${`0`.repeat(e-1)}E+00`:n>=1&&(r=`0E+00`),r){let e=x.getNumberFormat(r).displayText;c(e)&&(R=e)}}}R||(z=`#`)}if(!z&&F&&F.lastRepeatIndex>=0&&F.width>l&&(z=`#`),z&&l>0){let e=C.measureText(z),t=Math.max(1,Math.floor((l||1)/(e?.width||1)));R=z.repeat(t),P=o.Y.HorizontalAlignment.Center}if(O&&(P=o.Y.HorizontalAlignment.Left),R){let t=C.measureText(R).width;t&&(e={...e,width:t})}t={...e,width:e.width+ie+ae,height:e.height},T&&(t={...T.bounds});let V=I!==null&&h&&!R&&!z;T||E||(V?(t.x=g.bounds.x,t.y=I):(P===o.Y.HorizontalAlignment.Center||P===o.Y.HorizontalAlignment.CenterContinuous?t.x=(A-t.width)/2:P===o.Y.HorizontalAlignment.Right?t.x=A-t.width-.5:t.x=.5,I===null?J.getVertical()===o.Y.VerticalAlignment.Center?t.y=(y-t.height)/2:J.getVertical()===o.Y.VerticalAlignment.Bottom?t.y=y-t.height-re:t.y=re:t.y=I));let H=le?{...v}:void 0,U={style:{left:c.left-1,top:c.top-1,width:c.width+1,height:c.height+1,transform:te&&!T?`rotate(${te}deg)`:void 0,cursor:_?`pointer`:void 0,pointerEvents:_?`auto`:void 0,zIndex:ue?1:void 0},onMouseDown:_,onDoubleClick:_?e=>{e.stopPropagation(),e.preventDefault()}:void 0,...H};D&&(U.style.textDecorationStyle=`wavy`,U.style.textDecorationColor=`light-dark(red, rgb(0, 255, 255))`,U.style.textDecorationLine=`underline`);let W=G.getSize(),se=G.toCSS(`adaptive`,u,!0);K&&(se.textDecoration=G.getStrike()?`line-through`:void 0);let ce=(n,r,a,s,c,f,p,m=null)=>{let h=W*u,g=a,_=p?.runs?p.runs:[{type:o.It.ParseRunType.Text,text:n,width:C.measureText(n,h).width}];p&&p?.width!==e.width&&(e={...e,width:p?.width});let v=V?0:ie;if(p&&p.lastRepeatIndex>=0&&l>p.width){let t=p.runs[p.lastRepeatIndex];if(t){let n=[..._],r=Math.max(0,l-1-p.width),i=0,a=``;if(r>0){let e=Math.floor(r/t.width);a=e>0?t.text.repeat(e):``,i=r}n[p.lastRepeatIndex]={type:o.It.ParseRunType.Repeat,text:a,width:i},_=n,e={...e,width:p.width+i}}}let y=(e,t,n,r,a,s,l,p,m,_=null)=>{let y,b=g.width;c===o.Y.HorizontalAlignment.Justify?(b=a,f||(y=`justify`)):c===o.Y.HorizontalAlignment.Distributed&&(b=a,y=f||e.text.split(` `).length-1==0?`center`:`justify`);let{style:x,className:S,...C}=_??{},T=e.text;if(c===o.Y.HorizontalAlignment.Fill&&w?.repeatChars.length===0){let e=Math.max(1,Math.floor((g?.width??0)/(l?.width??1)));T=T.repeat(e)}let E=g.height,D=G.getVerticalAlignment(),O=D===o._.VerticalAlignment.Sub,k=D===o._.VerticalAlignment.Super;if(O||k){let e=G.getSuperSubScale();h*=e,E*=e}let A={textAlign:y,textAlignLast:y,...x,...se,fontSize:h*o._.getDeviceScale()};le||(A.background=Ki?`pink`:void 0),q&&(A.color=q.toCSS(`adaptive`));let j=v+t,M=(I===null?ne.top:0)+g.y+0;if(O&&(M+=m-h),s){let e=(l.x+j)*u+1,t=(l.y+M)*u+1;t<0?A.marginTop=t:A.paddingTop=t,e<0?(A.width=(x?.width??0)-e,A.left=(x?.left??0)+e):A.paddingLeft=e,A.paddingRight=Math.max(0,(x?.width??0)-b*u-e),A.paddingBottom=Math.max(0,(x?.height??0)-g.height*u-t),A.height=(x?.height??0)+(t<0?-t:0),(t<0||e<0)&&(A.clipPath=`inset(${t<0?-t:0}px 0px 0px ${e<0?1-e:0}px)`)}else A.left=(l.x+j)*u+1,A.top=(l.y+M)*u+1,A.width=l.width*u,A.height=l.height*u;A.lineHeight=E*u+`px`;let N=le?void 0:`text-line`;i.push((0,d.jsx)(`div`,{className:S?`${S} ${N}`:N,style:A,...C,children:T},`text-${g.y}-${r}-${n}`))};if(J.getOverflow()===o.Y.Overflow.Shrink&&l>0){let t=e?.width??0,r=0;for(;t>1&&t>l&&h>2&&r<100;)h*=l/t,t=C.measureText(n,h).width,r++;e={...e,width:t}}let b=g.x;c===o.Y.HorizontalAlignment.Right?b+=e.width-g.width:c!==o.Y.HorizontalAlignment.Center&&c!==o.Y.HorizontalAlignment.CenterContinuous||(b+=(e.width-g.width)/2),p&&p.lastRepeatIndex>=0&&(b=g.x);let x=_.length;for(let n=0;n<x;n++){let i=_[n];(i.type===o.It.ParseRunType.Text||i.type===o.It.ParseRunType.Repeat)&&(i.type,o.It.ParseRunType.Repeat,y(i,b,n,r,c===o.Y.HorizontalAlignment.Justify||c===o.Y.HorizontalAlignment.Distributed||p&&p.lastRepeatIndex>=0?l:g.width,le,{x:t.x+j,y:t.y,width:i.width,height:e.height},0,s,m)),b+=i.width}};if(E){let e=E.pitch,t=E;(R||z)&&(t=o.rn.layoutColumns(o.rn.toColumns(R??z??``,!1,2**53-1),e,g.content,P,J.getVertical()));let n={lineHeight:e*u+`px`,textAlign:`center`,...se,fontSize:W*u*o._.getDeviceScale()};q&&(n.color=q.toCSS(`adaptive`));let r=[];for(let e=0;e<t.columns.length;e++){let i=t.columns[e];i.glyphs.length!==0&&r.push((0,d.jsx)(`div`,{className:`text-line`,style:{...n,left:i.bounds.x*u,top:i.bounds.y*u,width:i.bounds.width*u,height:i.bounds.height*u},children:i.glyphs.join(`
3
+ `)},`col-${e}`))}i.push((0,d.jsx)(`div`,{style:{position:`absolute`,left:1,top:1,width:b*u,height:y*u,overflow:`hidden`,cursor:_?`pointer`:void 0,pointerEvents:_?`auto`:void 0,zIndex:ue?1:void 0,background:Ki?`pink`:void 0},onMouseDown:U.onMouseDown,onDoubleClick:U.onDoubleClick,children:r},`text-stacked`))}else if(T){let t=T.angle,n=g.lineHeight,r=W*u,a=J.getVertical(),s=(e,a,s,c,l)=>{let f={left:a.x*u+1,top:a.y*u+1,width:s*u,height:n*u,lineHeight:n*u+`px`,transform:`rotate(${t}deg)`,transformOrigin:`0 0`,textAlign:l,textAlignLast:l,whiteSpace:l===`justify`?`normal`:void 0,cursor:_?`pointer`:void 0,pointerEvents:_?`auto`:void 0,zIndex:ue?1:void 0,...se,fontSize:r*o._.getDeviceScale()};Ki&&(f.background=`pink`),q&&(f.color=q.toCSS(`adaptive`)),i.push((0,d.jsx)(`div`,{className:`text-line`,style:f,onMouseDown:U.onMouseDown,onDoubleClick:U.onDoubleClick,children:c},`text-rot-${e}`))},c=(e,r)=>o.qt.layoutLines([{width:e,height:n}],t,g.content,r,a);if(R||z){let t=R??z??``;s(`override`,c(e.width,P).lines[0].origin,e.width,t)}else if(F&&B.lines.length===1){let e=F.runs,t=F.width,n=P;if(F.lastRepeatIndex>=0&&l>F.width){let r=F.runs[F.lastRepeatIndex];if(r){let i=[...e],a=Math.max(0,l-F.width),s=``;if(a>0&&r.width>0){let e=Math.floor(a/r.width);s=e>0?r.text.repeat(e):``}i[F.lastRepeatIndex]={type:o.It.ParseRunType.Repeat,text:s,width:a},e=i,t=F.width+a,n=o.Y.HorizontalAlignment.Left}}let r=c(t,n),i=0,a=[];for(let t=0;t<e.length;t++){let n=e[t];n.type!==o.It.ParseRunType.Text&&n.type!==o.It.ParseRunType.Repeat||!n.text||a.push((0,d.jsx)(`span`,{style:{position:`absolute`,left:i*u,top:0,whiteSpace:`pre`},children:n.text},`run-${t}`)),i+=n.width}s(`runs`,r.lines[0].origin,t,a)}else{let e=a===o.Y.VerticalAlignment.Distributed&&t%90==0&&t%180!=0,n=T.lines.length;for(let t=0;t<n;t++){let r,i=T.lines[t],a=B.lines[t],c=a.runs[0].text.replace(/\s+$/,``),l=t===n-1,u=i.size.width;P!==o.Y.HorizontalAlignment.Justify||l||a.runs[0].text.endsWith(`
4
+ `)?(P===o.Y.HorizontalAlignment.Distributed||e)&&(u=T.lineLength,r=l||c.split(` `).length-1==0?`center`:`justify`):(u=T.lineLength,r=`justify`),s(`${t}`,i.origin,u,c,r)}}}else R||z?(s=e.y??0,ce(R??z??``,0,{...e,x:e.x??0,y:e.y??0},B.lines[0].baseline,P,!0,null,U)):B.visitLines({visitTextLine:(t,n,r)=>{let i=t.runs[0].text.replace(/\s+$/,``),a=n===r-1,c=P===o.Y.HorizontalAlignment.Justify&&(a||t.runs[0].text.endsWith(`
5
+ `))?o.Y.HorizontalAlignment.Left:P,u=0;n>0&&(J.getVertical()===o.Y.VerticalAlignment.Distributed||J.getVertical()===o.Y.VerticalAlignment.Justify)&&(u=Math.max(0,(y-(re+3)-t.bounds.height*r)/(r-1)*n)),J.getVertical()===o.Y.VerticalAlignment.Distributed&&te&&te%90==0&&te%180!=0&&(c=o.Y.HorizontalAlignment.Distributed),c!==o.Y.HorizontalAlignment.Justify&&c!==o.Y.HorizontalAlignment.Distributed&&c!==o.Y.HorizontalAlignment.Fill||(e={...e,width:l});let d=Y||w&&(w.repeatChars.length>0||w.spacingChars.length>0)?e.width:t.bounds.width,p={...t.bounds,y:t.bounds.y+u+0,width:d};s=p.y,ce(i,n,p,f.lines[0].baseline,c,a,r===1?F:null,le&&n>0?{...U,style:{...U.style,background:void 0}}:U)}});if(K&&!T&&!E&&!O&&i.length>0){let e=C.measureText(``),n=Math.max(1,Math.round(G.getSize()/10)),r=(e.baseline??e.lineHeight)+n,a=C.getInsets(),c=N+a.left,l=N+M-a.right;if(F&&!R&&!z){let e=F.runs,t=0;for(;t<e.length&&e[t].type===o.It.ParseRunType.Spacing;)c+=e[t].width,t++;let n=e.length-1;for(;n>=t&&e[n].type===o.It.ParseRunType.Spacing;)l-=e[n].width,n--}if(l>c){let e=t.y+(I===null?ne.top:0)+s+r,a=G.getUnderline()===o._.UnderlineStyle.DoubleAccounting?[e,e+2*n]:[e],f=(q??G.getColor()).toCSS(`adaptive`);for(let e=0;e<a.length;e++)i.push((0,d.jsx)(`div`,{style:{position:`absolute`,left:c*u+1,top:a[e]*u+1,width:(l-c)*u,height:Math.max(1,n*u),background:f,zIndex:ue?1:void 0}},`accounting-underline-${e}`))}}}i.length>0&&(L=i),Ki&&!le&&L&&(L=[L,(0,d.jsx)(`div`,{style:{left:t.x*u,top:t.y*u,width:t.width*u,height:t.height*u}},`text-debug-bounds`)])}if(le)return L&&L.length>0?L:oe<=0?null:(0,d.jsx)(`div`,{style:Z,...v});I&&!L&&(L=(0,d.jsx)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,bottom:0,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:`...`},`pending-ellipsis`));let de=null;if(qi){let e=x.getTextPlacement({width:b,height:y},O);e&&(de=(0,d.jsx)(`div`,{style:{position:`absolute`,left:e.bounds.x*u+1,top:e.bounds.y*u+1,width:e.bounds.width*u,height:e.bounds.height*u,outline:`1px solid rgba(0,120,255,0.8)`,background:`rgba(0,120,255,0.08)`,pointerEvents:`none`}},`placement-debug`))}let Q=[L,s,B,ce,de];return(0,d.jsx)(`div`,{style:{...se,zIndex:ue?1:void 0},...v,children:Q})},Ki=!1,qi=!1;function Ji(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Ji(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function $(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Ji(e))&&(r&&(r+=` `),r+=t);return r}var Yi=(0,u.createContext)(null);Yi.displayName=`DocThemesContext`;var Xi=()=>{let e=(0,u.useContext)(Yi),[t]=(0,u.useState)(()=>new o.st);return(0,u.useMemo)(()=>e||t,[e])},Zi=`sxl-system-colors`,Qi=e=>{let t={};for(let n in e)t[`${o.cn}${n.toLowerCase()}`]=e[n];return t},$i=()=>{(0,u.useMemo)(()=>{(()=>{if(typeof document>`u`||document.getElementById(Zi))return;let e=o.sn.getSystemColorDefaults(),t=Object.keys(e).map(t=>`${o.cn}${t}:${e[t]};`).join(``),n=document.createElement(`style`);n.id=Zi,n.textContent=`:root{${t}}`,document.head.appendChild(n)})()},[])},ea=[[o.Gt.Named.Window,`var(--sxl-color-base-100)`],[o.Gt.Named.Menu,`var(--sxl-color-base-100)`],[o.Gt.Named.BtnFace,`var(--sxl-color-base-100)`],[o.Gt.Named.InfoBk,`var(--sxl-color-base-100)`],[o.Gt.Named.ScrollBar,`var(--sxl-color-base-100)`],[o.Gt.Named.AppWorkspace,`var(--sxl-color-base-100)`],[o.Gt.Named.Background,`var(--sxl-color-base-100)`],[o.Gt.Named.WindowText,`var(--sxl-color-base-content)`],[o.Gt.Named.MenuText,`var(--sxl-color-base-content)`],[o.Gt.Named.BtnText,`var(--sxl-color-base-content)`],[o.Gt.Named.InfoText,`var(--sxl-color-base-content)`],[o.Gt.Named.CaptionText,`var(--sxl-color-base-content)`],[o.Gt.Named.GrayText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[o.Gt.Named.InactiveCaptionText,`color-mix(in srgb, var(--sxl-color-base-content) 45%, transparent)`],[o.Gt.Named.Highlight,`var(--sxl-color-primary)`],[o.Gt.Named.ActiveCaption,`var(--sxl-color-primary)`],[o.Gt.Named.HotLight,`var(--sxl-color-primary)`],[o.Gt.Named.HighlightText,`var(--sxl-color-primary-content)`],[o.Gt.Named.BtnHighlight,`var(--sxl-color-base-200)`],[o.Gt.Named.Light3d,`var(--sxl-color-base-200)`],[o.Gt.Named.InactiveCaption,`var(--sxl-color-base-200)`],[o.Gt.Named.ActiveBorder,`var(--sxl-color-base-300)`],[o.Gt.Named.InactiveBorder,`var(--sxl-color-base-300)`],[o.Gt.Named.WindowFrame,`var(--sxl-color-base-300)`],[o.Gt.Named.BtnShadow,`var(--sxl-color-neutral)`],[o.Gt.Named.DkShadow3d,`var(--sxl-color-neutral)`]],ta={};for(let[e,t]of ea)ta[`sys-color-${e.toLowerCase()}`]=t;var na={light:ta,dark:ta},ra=(e=`sxl-defaults`,t)=>i.jt({app:na,surfaces:{grid:na,header:na},layer:e,scope:t}),ia=(e,t)=>{let n=``;if(e&&(n=e.includes(` `)?`"${e}"`:e),t)for(let e=0;e<t.length;e++)n.length>0&&(n+=`, `),n+=t[e];return n},aa=(e,t)=>{let n=t??[];return e===`Aptos Narrow`?[`Calibri`,...n]:n},oa=(e,t,n)=>{let r=e.getColorScheme(),i=e.getFontScheme();return{"doc-color-dk1":r.getDk1().toCSS(n),"doc-color-dk2":r.getDk2().toCSS(n),"doc-color-lt1":r.getLt1().toCSS(n),"doc-color-lt2":r.getLt2().toCSS(n),"doc-color-accent1":r.getAccent1().toCSS(n),"doc-color-accent2":r.getAccent2().toCSS(n),"doc-color-accent3":r.getAccent3().toCSS(n),"doc-color-accent4":r.getAccent4().toCSS(n),"doc-color-accent5":r.getAccent5().toCSS(n),"doc-color-accent6":r.getAccent6().toCSS(n),"doc-color-hlink":r.getHlink().toCSS(n),"doc-color-fol-hlink":r.getFolHlink().toCSS(n),"doc-font-major":ia(i.getMajorFont(),aa(i.getMajorFont(),i.getMajorFallbacks())),"doc-font-minor":ia(i.getMinorFont(),aa(i.getMinorFont(),i.getMinorFallbacks())),"doc-font-size":`${t}pt`,"doc-line-height":`${o._.getSharedMeasurer()(``,t*o._.getDeviceScale(),i.getMinorFont()).lineHeight}px`}},sa={Mode:`themeMode`,DarkGrid:`enableDarkGrid`,DarkImages:`enableDarkImages`},ca=e=>{let[t]=i.Gt(sa.Mode,null),[n]=i.Gt(sa.DarkGrid,!1),{themeMode:r}=i.Tt({mode:e??t??void 0});return e||(r===`dark`&&n?`dark`:`light`)},la=e=>{let{length:t=0,width:n=1,dashArray:r=null,dashArrayAdditional:a=null,isDouble:o=!1,isAngled:s=!1,offsetX:c=0,offsetY:l=0,isVertical:u=!1,...f}=e,p=e=>{let t=null;if(e&&n>0){t=``;for(let n=0;n<e.length;n++)t+=e[n],n<e.length-1&&(t+=`,`)}return t},m=p(r),h=m;a&&(h=p(a));let g=i.kt.getDevicePixelRatio(),_=(e,t,n,r)=>{let a=i.kt.snapLineCenter(e,r/g,g),o=i.kt.snapDeviceEdge(t,g),s=i.kt.snapDeviceEdge(n,g);return u?`M ${a} ${o} L ${a} ${s}`:`M ${o} ${a} L ${s} ${a}`},v=n,y=t,b=null;if(o){v=Math.floor(n/2);let e=u?l:c;b=(0,d.jsx)(`path`,{strokeWidth:v/g,strokeDasharray:h??void 0,d:_((u?c:l)+(v+v/2+1)/g,e,e+y,v),...f})}if(s){v=n/2;let e=u?l:c;b=(0,d.jsx)(`path`,{strokeWidth:v/g,strokeDasharray:h??void 0,strokeDashoffset:`1`,d:_((u?c:l)+(v+v/2)/g,e,e+y,v),...f})}let x=u?l:c;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`path`,{strokeWidth:v/g,strokeDasharray:m??void 0,d:_((u?c:l)+v/2/g,x,x+y,v),...f}),b]})};function ua(e,t){if(typeof e==`function`)return e(t);e&&(e.current=t)}var da=parseInt(u.version.split(`.`)[0],10)>=19?function(e){return t=>{let n=[];for(let r of e){let e=ua(r,t),i=typeof e==`function`;n.push(i?e:()=>ua(r,null))}return()=>{for(let e of n)e()}}}:function(e){return t=>{for(let n of e)ua(n,t)}},fa=function(){},pa=typeof window<`u`,ma=pa?u.useLayoutEffect:u.useEffect,ha=function(e){var t=window.history,n=t[e];t[e]=function(t){var r=n.apply(this,arguments),i=new Event(e.toLowerCase());return i.state=t,window.dispatchEvent(i),r}};pa&&(ha(`pushState`),ha(`replaceState`));var ga={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0},_a=pa&&window.ResizeObserver!==void 0?function(){var e=(0,u.useState)(null),t=e[0],n=e[1],r=(0,u.useState)(ga),i=r[0],a=r[1],o=(0,u.useMemo)(function(){return new window.ResizeObserver(function(e){if(e[0]){var t=e[0].contentRect,n=t.x,r=t.y,i=t.width,o=t.height,s=t.top,c=t.left,l=t.bottom,u=t.right;a({x:n,y:r,width:i,height:o,top:s,left:c,bottom:l,right:u})}})},[]);return ma(function(){if(t)return o.observe(t),function(){o.disconnect()}},[t]),[n,i]}:function(){return[fa,ga]},va=({getBorderAt:e,rendererBorder:t=ya,getVisibleCells:r,forceThinBorder:a=!1,defaultColor:s=`black`})=>{let c=i.X(r,[r]);return{renderLayer:(0,u.useMemo)(()=>(r,l)=>{if(!e)return null;let u=l.toClipBounds(l.getBoundsFromRange(),-3);if(!u)return;let f=c(l);if(!f||f.length===0)return;let p=[],m=[],h=l.getVisibleColumns(),g=l.getVisibleRows(),_=h.map(e=>e.index),v=g.map(e=>e.index),y=new Map(_.map((e,t)=>[e,t])),b=new Map(v.map((e,t)=>[e,t])),x=[],S=[],C=[],w=[],T=(e,t,n,r,i,a,o)=>{let s={index:r,stroke:i,visibleIndex:n,edge:a,length:o};e[t]||(e[t]=[]);let c=e[t],l=c.length,u=c[l-1];l>0&&u?.index===r?c[l-1]=s:c.push(s)},E=l.getVisibleRange(),D=f.length;for(let t=0;t<D;t++){let r=f[t],i=r.cell;if(!i)continue;let a=r?.range??{rowStart:i.rowIndex,colStart:i.colIndex,rowEnd:i.rowIndex,colEnd:i.colIndex};if(!n.d.isRangesIntersect(a,E)&&!n.d.isRangeWithinRange(a,E))continue;let s=i.colIndex,c=i.rowIndex,l=y.get(s),u=b.get(c);if(a.rowEnd!==a.rowStart){let e=b.get(a.rowStart)??-1,t=b.get(a.rowEnd)??g.length;p.push({...a,rowStart:e,rowEnd:t})}if(a.colEnd!==a.colStart){let e=y.get(a.colStart)??-1,t=y.get(a.colEnd)??h.length;m.push({...a,colStart:e,colEnd:t})}let d=r.value,_=e(d,t);if(!_||_.isEmpty())continue;let v=_.getLeft(),C=_.getTop(),w=_.getRight(),D=_.getBottom();if(l===void 0||u===void 0)continue;let O=l,k=u;v.isNone()||T(x,O,k,c,v,o.W.Edge.Left,1),C.isNone()||T(S,k,O,s,C,o.W.Edge.Top,1),w.isNone()||T(x,O+1,k,c,w,o.W.Edge.Right,1),D.isNone()||T(S,k+1,O,s,D,o.W.Edge.Bottom,1)}let O=(e,t,n)=>{let r=[];return e.forEach((e,i)=>{let a=null;e.sort((e,t)=>e.visibleIndex-t.visibleIndex);let o=e.length;for(let c=0;c<o;c++){let o=e[c];if(!o?.stroke||t[i]===void 0&&t[i-1]===void 0)continue;let l=!1;if(n){let e=p.length;for(let t=0;!l&&t<e;t++){let e=p[t];e.colStart<=o.index&&e.colEnd>=o.index&&e.rowStart<i&&e.rowEnd>=i&&(l=!0)}}else{let e=m.length;for(let t=0;!l&&t<e;t++){let e=m[t];e.rowStart<=o.index&&e.rowEnd>=o.index&&e.colStart<i&&e.colEnd>=i&&(l=!0)}}if(l)continue;let u=o.stroke?.getColor(),d=u?u.toCSS(`adaptive`):s,f=o.stroke.getStyle()+`:`+d;(!a||f!==a.key||a.visibleIndex+1<o.visibleIndex)&&(a&&r.push(a),a={key:f,index:t[i]??t[i-1]+1,visibleIndex:o.visibleIndex,edge:o.edge,stroke:o.stroke,from:o.index,to:o.index+o.length-1,intersections:[],startExtend:0,endExtend:0,length:1}),a.to=o.index+o.length-1,a.visibleIndex=o.visibleIndex}a&&r.push(a)}),r};p=p.sort(n.d.rowFirstRangeComparator),m=m.sort(n.d.columnFirstRangeComparator);let k=O(x,_,!1),A=O(S,v,!0);if(k.length===0&&A.length===0)return null;let j=i.kt.getDevicePixelRatio(),M=l.getMetrics(),N=(e,t,n)=>{let r=n===o.W.Edge.Right||n===o.W.Edge.Bottom?`trailing`:`leading`;return i.kt.edgeCenter(e,r,t,j)},P=A.length;for(let e=0;e<P;e++){let t=A[e],r=n.I.findEqualOrGreater(k,t.from,e=>e.index);for(;r>0&&k[r-1].index>=t.from;)r--;let i=!1;for(;!i;){let e=k[r++];if(e&&e.index>=t.from&&e.index<=t.to+1&&e.from<=t.index&&e.to+1>=t.index){t.intersections.push({stroke:e.stroke,edge:e.edge,range:{rowStart:e.from,rowEnd:e.to+1,colStart:e.index,colEnd:e.index}}),e.intersections.push({stroke:t.stroke,edge:t.edge,range:{rowStart:t.index,rowEnd:t.index,colStart:t.from,colEnd:t.to+1}});let n=e.index===t.from||e.index===t.to+1,r=t.index===e.from||t.index===e.to+1;if(n&&r){let n=o.W.BuiltInDefinitions.get(e.stroke.getStyle())?.width??1,r=o.W.BuiltInDefinitions.get(t.stroke.getStyle())?.width??1,i=n/2/j,a=r/2/j,s=M.getColOffset(e.index),c=N(s,n,e.edge);e.index===t.to+1?t.endExtend=c+i-s:t.startExtend=s-(c-i);let l=M.getRowOffset(t.index),u=N(l,r,t.edge);t.index===e.to+1?e.endExtend=u+a-l:e.startExtend=l-(u-a)}}i=!e||e.index>t.to+1}}for(let e=0;e<P;e++){let n=A[e],r=n.stroke,i=`rBorder:${n.index}:${n.from}:${n.to}:${n.edge}`,o={rowStart:n.index,rowEnd:n.index,colStart:n.from,colEnd:n.to+1},s=l.getMetrics(),c=s.getColOffset(o.colStart),u=s.getRowOffset(o.rowStart),d=[c,u,s.getColOffset(o.colEnd),u];C.push(t({key:i,points:d,stroke:r,forceThinBorder:a,range:o,edge:n.edge,intersections:n.intersections,startExtend:n.startExtend,endExtend:n.endExtend,metrics:s,isVertical:!1}))}let F=k.length;for(let e=0;e<F;e++){let n=k[e],r=n.stroke,i=`cBorder:${n.index}:${n.from}:${n.to}:${n.edge}`,o={rowStart:n.from,rowEnd:n.to+1,colStart:n.index,colEnd:n.index},s=l.getMetrics(),c=s.getColOffset(o.colStart),u=[c,s.getRowOffset(o.rowStart),c,s.getRowOffset(o.rowEnd)];w.push(t({key:i,stroke:r,points:u,forceThinBorder:a,range:o,edge:n.edge,intersections:n.intersections,startExtend:n.startExtend,endExtend:n.endExtend,metrics:s,isVertical:!0}))}let I=u.width,L=u.height;return(0,d.jsxs)(`svg`,{width:`${I}`,height:`${L}`,viewBox:`0 0 ${I} ${L}`,preserveAspectRatio:`none`,style:{position:`absolute`,left:`0px`,top:`0px`,width:`${I}px`,height:`${L}px`,pointerEvents:`none`,willChange:`left, top, width, height, stroke-dashoffset`,overflow:`visible`},children:[w,C]},`borders`)},[e])}},ya=e=>{let{key:t,points:n,range:r,stroke:a,forceThinBorder:s=!1,isVertical:c=!1,edge:l,intersections:u,startExtend:f=0,endExtend:p=0,metrics:m}=e,h=o.W.BuiltInDefinitions.get(s?o.W.StrokeStyle.Thin:a.getStyle());if(!h)return null;let g,_,v=i.kt.getDevicePixelRatio(),y=n[0],b=n[1],x=n[2],S=n[3],C=c?`rowStart`:`colStart`,w=c?b:y,T=f,E=(c?S-b:x-y)+p,D=a.getColor().toCSS(`adaptive`),O=h.description.toLowerCase().includes(`double`),k=h.description.toLowerCase().includes(`slant`),A=e=>{if(!e)return 0;let t=o.W.BuiltInDefinitions.get(e.stroke.getStyle()),n=e.edge===o.W.Edge.Right||e.edge===o.W.Edge.Bottom;return t&&t.width%2==0&&n?1/v:0};if(u&&u.length>0&&O){let e=c?`colStart`:`rowStart`,t=c?`colEnd`:`rowEnd`,n=c?m?.getRowOffset:m?.getColOffset,i=0,a=0;g=[],_=[];let s=u.length;for(let c=0;c<s;c++){let s=u[c];if(s.stroke.getStyle()===o.W.StrokeStyle.Double&&n){let o=n(s.range[C])-(w-T)+A(s);s.range[e]<r[e]&&o-i>=0&&(g.push(o-i),g.push(1/v),i=o+1/v),s.range[t]>r[t]&&o-a>=0&&(_.push(o-a),_.push(1/v),a=o+1/v)}}g.length>0&&i<E&&g.push(E-i),_.length>0&&a<E&&_.push(E-a)}let j=l===o.W.Edge.Right||l===o.W.Edge.Bottom?`trailing`:`leading`,M=i.kt.edgeTrailingShift(j,h.width,v),N=c?-h.width/2/v+M:-T,P=c?-T:-h.width/2/v+M;return(0,d.jsx)(la,{offsetX:y+N,offsetY:b+P,length:E+T,isVertical:c,stroke:D,width:h.width,dashArray:g??h.pattern,dashArrayAdditional:_,isDouble:O,isAngled:k},t)},ba=n.A.Center,xa=Object.freeze({horizontal:!1,vertical:!1}),Sa=n.v.EmptyTopLeft,Ca=(e,t)=>n.d.EmptyCell,wa=(e,t)=>new Promise((e,t)=>{t(`StaticBorderRenderer does not support scrolling`)}),Ta=(0,u.memo)(e=>{let{getBorderAt:t,width:r,height:i,style:a,rowCount:o=2,columnCount:s=2,forceThinBorder:c,children:l,...f}=e,p=(0,u.useRef)(null),[m,{width:h,height:g}]=_a(),_=r??h,v=i??g,y=(0,u.useMemo)(()=>{let e=[];for(let t=0;t<o;t++)for(let n=0;n<s;n++){let r={colIndex:n,rowIndex:t};e.push({cell:r,value:r})}return e},[o,s]),{renderLayer:b}=va({getVisibleCells:(0,u.useCallback)(e=>y,[y]),getBorderAt:t,forceThinBorder:c}),x=Math.floor(_/s),S=Math.floor(v/o),C={getColOffset:e=>e*_/s+0,getRowOffset:e=>e*v/o+0,getColIndex:e=>Math.floor((e-0)/x)-1,getRowIndex:e=>Math.floor((e-0)/S)-1},w={rowStart:0,colStart:0,rowEnd:o,colEnd:s},T={x:0,y:0,width:Math.max(0,_)+0,height:Math.max(0,v)+0},E={left:0,top:0,right:0,bottom:0},D=s>0?Math.floor(_/s):0,O=o>0?Math.floor(v/o):0,k=e=>e<0||e>=s?null:{index:e,offset:e*D,size:D},A=e=>e<0||e>=o?null:{index:e,offset:e*O,size:O};if(!b)return null;let j={width:_,height:v},M={width:_,height:v},N={addReactEventListener:()=>()=>{},getElement:()=>p.current,focus:e=>{p.current?.focus(e)},invalidate:Ea,setPointerCapture(e){p.current?.setPointerCapture(e)},releasePointerCapture(e){p.current?.releasePointerCapture(e)},getTotalSize:()=>j,getSurfaceSize:()=>M,getMetrics:()=>C,getRangeFromCell:e=>n.d.cellToRange(e),getVisibleRange:()=>w,getVisibleRows:()=>{let e=[];for(let t=0;t<o;t++)e.push(A(t));return e},getPaneRange:()=>w,getTotalRange:()=>w,getPanePointFromPointer:(e,t)=>({x:e,y:t}),getVisibleColumns:()=>{let e=[];for(let t=0;t<s;t++)e.push(k(t));return e},toClipBounds:(e,t)=>T,toPaneBounds:e=>e,toAbsoluteBounds:e=>e,getPaneBounds:()=>T,getInsets:()=>E,getBoundsFromRange:(e,t)=>T,getColumnSize:k,getRowSize:A,getAllPanes:()=>({[ba]:N}),getAnchor:()=>ba,getZoom:()=>1,scrollTo:(e,t)=>Promise.resolve(n.v.EmptyTopLeft),scrollCellCoordsIntoView:wa,getCellFromPointer:Ca,getPaneFromPointer:()=>N,getScrollOrientation:()=>xa,getScrollTopLeft:()=>Sa,getFreezeTopLeft:()=>Sa},P=b(n.I.EmptyObject,N);return(0,d.jsxs)(`div`,{style:{...a,position:`relative`,display:`flex`},...f,children:[(0,d.jsx)(`div`,{ref:da([p,m]),style:{flex:`1 1 100%`,display:`flex`,maxWidth:`100%`,maxHeight:`100%`},children:l}),P]})}),Ea=()=>{},Da=e=>{switch(e){case`right`:return`flex-end`;case`center`:return`center`;default:return`flex-start`}},Oa=e=>{switch(e){case o.Y.VerticalAlignment.Top:return`flex-start`;case o.Y.VerticalAlignment.Bottom:return`flex-end`;case o.Y.VerticalAlignment.Center:return`center`;default:return`stretch`}},ka=(0,u.memo)(e=>{let{value:t,cellStyle:n,createCell:r,cell:i,propsBorder:a,disabled:s,className:c,style:l,ref:f,...p}=e,m=ca(),h=m===`dark`,g=(0,u.useMemo)(()=>i||(r?.({value:t,style:n})??null),[i,t,n,r]),_=g?.getStyle(),v=(0,u.useMemo)(()=>_?.getFill().toCSS(h),[_,h]),y=(0,u.useMemo)(()=>_?.getFont().toCSS(h,1),[_,h]),b=(0,u.useMemo)(()=>_?.getInsets()??null,[_]),x=(0,u.useCallback)(()=>_?.getBorders()??null,[_]),S=_?.getAlignment(),C=S?.getRotation()??0,w=S?.getStacked()??!1,T=S?.getOverflow()===o.Y.Overflow.Wrap,E=9*(S?.getIndent()??0),D=g?o.Y.toCSSHorizontalTextAlign(g.getRenderHorizontalAlignment())??`left`:`left`,O=i?i.getNumberFormat().displayText??``:t??``,k=g?.getNumberFormat(),A=k?.formattedRuns?.runs,j=!k?.errorPlaceholder&&!!A&&A.some(e=>e.type!==o.It.ParseRunType.Text),M=j?k.formattedRuns.lastRepeatIndex??-1:-1,N=j?A.map((e,t)=>{if(e.type===o.It.ParseRunType.Spacing)return(0,d.jsx)(`span`,{style:{visibility:`hidden`,whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t);if(e.type===o.It.ParseRunType.Repeat&&t===M){let n=e.width>0?Math.ceil(1e3/e.width):1;return(0,d.jsx)(`span`,{style:{flex:`1 1 0%`,minWidth:0,overflow:`hidden`,whiteSpace:`pre`},children:e.text.repeat(n)},t)}return(0,d.jsx)(`span`,{style:{whiteSpace:`pre`,flex:`0 0 auto`},children:e.text},t)}):O;return(0,d.jsx)(`div`,{ref:f,className:$(`sxl-static-cell`,c),"data-sxl-theme-surface":`grid`,"data-sxl-theme-mode":m,style:{width:`100px`,height:`100%`,boxSizing:`border-box`,display:`flex`,alignItems:`stretch`,textOverflow:`ellipsis`,background:`var(--sxl-color-base-100)`,filter:s?`grayscale(0.4) opacity(0.8)`:`none`,...l},...p,children:(0,d.jsx)(Ta,{getBorderAt:x,rowCount:1,columnCount:1,...a,style:{height:`100%`,width:`100%`,...a?.style},children:(0,d.jsx)(`div`,{className:`fill`,style:{flex:`1 1 100%`,overflow:`hidden`,display:`flex`,alignItems:Oa(S?.getVertical()??o.Y.VerticalAlignment.Bottom),paddingLeft:`4px`,paddingRight:`4px`,marginLeft:`-1px`,marginTop:`-1px`,marginRight:`-2px`,marginBottom:`-2px`,...v},children:(0,d.jsx)(`div`,{className:`text`,style:{flex:`1 1 100%`,boxSizing:`border-box`,paddingTop:`${b?.top??0}px`,paddingRight:`${b?.right??0}px`,paddingBottom:`${b?.bottom??0}px`,paddingLeft:`${(b?.left??0)+E}px`,margin:`0px`,outline:`none`,overflow:`hidden`,textOverflow:`ellipsis`,maxHeight:`100%`,background:`transparent`,textAlign:D,whiteSpace:T?`pre-wrap`:`pre`,display:j?`flex`:void 0,alignItems:j?`baseline`:void 0,justifyContent:j&&M<0?Da(D):void 0,transform:C?`rotate(${-C}deg)`:void 0,writingMode:w?`vertical-rl`:void 0,textOrientation:w?`upright`:void 0,...y},children:N})})})})});ka.displayName=`StaticCellRenderer`;var Aa=(e,t)=>{if(t<=0||t>e.length||!`/*^&<>=:,+-@( `.includes(e[t-1]))return!1;let n=t;for(;n<e.length&&e[n]===` `;)n++;return n>=e.length||`/*^&<>=:,)`.includes(e[n])},ja=e=>e.length>0&&`=+-`.includes(e[0]),Ma=e=>+(e[0]===`=`),Na=e=>e.referenceIndex===void 0?e.type===`error`?`var(--sxl-color-error, light-dark(#a31515, #ce9178))`:void 0:Vr[e.referenceIndex%Vr.length],Pa=(e,t,n)=>{let r=n,i=-1,a=-1;for(let n of e){let e=(n.text??``).length;n.referenceIndex===t&&(i<0&&(i=r),a=r+e),r+=e}return i<0?null:{start:i,end:a}},Fa=(e,t)=>{for(let n of e)if(n.referenceIndex===t&&n.type===`tableReference`)return!0;return!1},Ia=async(e,t,n,r)=>{if(!ja(t))return null;try{let i=e.createFormula(t,r,{target:`display`}),a=-1,o=`self`,s=-1,c=Ma(t);for(let e of i.getTokens()){let t=(e.text??``).length;if(e.referenceIndex!==void 0&&e.refSide&&n>=c&&n<=c+t){a=e.referenceIndex,o=e.refSide,s=c+t;break}c+=t}if(a<0)return null;let l=await i.setReferenceModeAt(a,o),u=t.slice(0,Ma(t))+l.getExpression({target:`display`});return{value:u,caret:s+(u.length-t.length)}}catch{return null}},La=e=>{let{cell:t,tokens:n,zoom:r,style:i,...a}=e,s=t.getStyle(),c=s.getFont(),l=t.getInsets(),u=s.getAlignment().getVertical(),f=u===o.Y.VerticalAlignment.Top?`flex-start`:u===o.Y.VerticalAlignment.Center?`center`:`flex-end`,p=[];for(let e=0;e<n.length;e++){let t=n[e],r=Na(t);p.push((0,d.jsx)(`span`,r===void 0?{children:t.text??``}:{style:{color:r},children:t.text??``},e))}return(0,d.jsxs)(`div`,{...a,style:{position:`absolute`,inset:0,display:`flex`,alignItems:f,justifyContent:`flex-start`,overflow:`hidden`,whiteSpace:`pre`,pointerEvents:`none`,paddingLeft:(l.left+1)*r,paddingTop:l.top*r,paddingBottom:l.bottom*r,...c.toCSS(`adaptive`,r,!0),fontSize:c.getSize()*r*o._.getDeviceScale(),...i},children:[`=`,p]})};La.displayName=`FormulaCellRenderer`;var Ra=(e,t,n)=>{Pi(e,[`onSelectionChange`]);let r=t?e.getSelection().getCoords().cell:null;return(0,u.useMemo)(()=>{if(!t||!r)return null;try{let t={rowIndex:r.rowIndex,colIndex:r.colIndex},n=e.getRange(t).getCell();if(n.isSpillOverflow())return null;let i=n.getFormulaText({target:`display`});if(i==null)return null;let a=e.getName(),o=e.getCalculation().createFormula(i,{...t,scope:a},{target:`display`}),s=o.getTokens();if(s.length===0)return null;let c=[];try{let e=o.getReferences();c=e?e.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[]}catch{}return{coords:t,cell:n,tokens:s,ranges:c}}catch{return null}},[e,t,r,n])},za=`M 7.4530672,10.134098 2.6725085,5.2978998 3.370275,4.5911648 7.4530672,8.7264777 11.530095,4.5911648 l 0.697764,0.706735M 7.4529247,10.134098 2.9086709,5.2978998 3.5719465,4.5911648 7.4529247,8.7264777 11.328423,4.5911648 l 0.663274,0.70673`,Ba=e=>{let{renderBounds:t,zoom:n,disabled:r,column:i,onColumnButtonMouseDown:a,style:o,...s}=e,[c,l]=(0,u.useState)(!1),f=Mn(!0);Pi(i.getTable(),[`onAnyChange`]);let p=za,m=i?i.getFilter():null,h=i?i.getSort():null,g=h?h.getCriteria():null,_=m&&m.getCondition(),v=g?g.reverse??!1:null;p=!0===v?_?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,9.452298 H 4.24187 V 2.0761788 H 3.170122 V 9.452298 H 1.5625 l 2.143496,2.950446 z`:`m 13.109228,9.865914 h -1.607622 v -7.37612 h -1.071748 v 7.37612 H 8.822236 l 2.143496,2.950446 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:!1===v?_?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 5.849492,5.0266248 H 4.24187 V 12.402744 H 3.170122 V 5.0266248 H 1.5625 l 2.143496,-2.950446 z`:`m 13.109228,5.44024 h -1.607622 v 7.37612 H 10.429858 V 5.44024 H 8.822236 L 10.965732,2.489794 Z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:_?`m 9.429858,10.25386 2,-1 v -3 l 3,-4 h -8 l 3,4 z M 0.75000004,9.15 4.3000002,13.094444 7.8500003,9.15 Z`:za;let y=Math.min(Math.min(18,t.height-8),t.width);return(0,d.jsx)(`div`,{style:{width:`${y}px`,height:`${y}px`,right:`1px`,boxShadow:`0px 0px 0px 0.5px `+(c&&!r?`color-mix(in srgb, var(--sxl-color-primary) 80%, white)`:`var(--sxl-color-base-300, grey)`),backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,borderRadius:+(y>12)+`px`,marginRight:`2px`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:r?void 0:`pointer`,...o},onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),onPointerDown:e=>{f(e),a?.(e,i),e.stopPropagation(),e.preventDefault()},...s,children:(0,d.jsx)(`svg`,{width:``+15*n,height:``+15*n,viewBox:`0 0 15 15`,style:{fill:c&&!r?`color-mix(in srgb, var(--sxl-color-primary) 70%, black)`:`var(--sxl-color-base-content, grey)`,opacity:r?.6:1},children:(0,d.jsx)(`path`,{d:p})})})},Va=`_hover_9ooz5_18`,Ha=`_selected_9ooz5_26`,Ua=`_selectedAll_9ooz5_35`,Wa=()=>!1,Ga=(0,u.memo)(e=>{let{index:t,value:r,zoomScale:i=100,headerText:a=e=>`${e}`,verticalPadding:o=0,horizontalPadding:s=0,isSelected:c=Wa,isSelectedAll:l=Wa,cell:f,bounds:p,range:m,axis:h,zoom:g=1,onColumnButtonMouseDown:_,propsColumnButton:v,renderColumnButton:y=Ba,className:b,style:x={},...S}=e,C=Z(),w=r?.getColumn(),T=w&&!w.isHiddenButton(),E=(0,u.useRef)(null),[D,O]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=null,t=C.addReactEventListener(`pointermove`,t=>{let{clientX:n,clientY:r}=t;e&&cancelAnimationFrame(e),e=requestAnimationFrame(()=>{if(!E.current)return;let e=E.current.getBoundingClientRect(),t=n>=e.left&&n<=e.right&&r>=e.top&&r<=e.bottom;O(t)})}),n=C.addReactEventListener(`pointerleave`,()=>{e&&cancelAnimationFrame(e),O(!1)});return()=>{e&&cancelAnimationFrame(e),t?.(),n?.()}},[C]),(0,u.useEffect)(()=>{if(!D)return;let e=e=>{let t=E.current;if(!t)return;let n=t.getBoundingClientRect();(e.clientX<n.left||e.clientX>n.right||e.clientY<n.top||e.clientY>n.bottom)&&O(!1)};return document.addEventListener(`pointermove`,e,!0),()=>document.removeEventListener(`pointermove`,e,!0)},[D]);let k=i/100,A=c?.(t)||!1,j=l?.(t)||!1,M=h===n.R.Column,N=a(t),P=M?`center`:`end`,F=0,I=null;if(T){F=4,P=`start`;let e={x:p.x-1,y:-1,width:p.width+1-F,height:p.height+1};I=(0,d.jsx)(`div`,{style:{...e,position:`absolute`,zIndex:2,display:`flex`,alignItems:`end`,justifyContent:`end`,flexDirection:`row`},onDoubleClick:e=>{e.stopPropagation(),e.preventDefault()},children:(0,u.createElement)(y,{renderBounds:e,className:`column-button`,disabled:!1,zoom:g,column:w,onColumnButtonMouseDown:_,...v,style:{pointerEvents:`auto`,...v?.style,backgroundColor:`var(--sxl-color-base-100, white)`,marginBottom:`4px`,backgroundImage:void 0}})},`columnButton`)}return(0,d.jsxs)(`div`,{ref:E,className:$(b,`_header_9ooz5_7`,{[Va]:D,[Ha]:A&&!j,[Ua]:j}),style:{fontSize:`calc(var(--sxl-doc-font-size, 11pt) * ${k})`,lineHeight:`calc(var(--sxl-doc-line-height, 1.2em) * ${k})`,justifyContent:P,paddingLeft:F,paddingBottom:0,paddingRight:M?void 0:`4px`,...x,left:x.left,top:x.top,width:x.width,height:x.height},...S,children:[M?N:(0,d.jsx)(`span`,{style:{position:`relative`,top:`${k}px`},children:N}),I]})});Ga.displayName=`SheetHeaderRenderer`;var Ka=(()=>{let e=null,t=new Set;return{getMode:()=>e,setMode:n=>{let r=typeof n==`function`?n(e):n;r!==e&&(e=r,t.forEach(e=>e()))},subscribe:e=>(t.add(e),()=>{t.delete(e)})}})(),qa=()=>Ka.getMode(),Ja=e=>Ka.setMode(e),Ya=(0,u.createContext)(null),Xa=()=>(0,u.useContext)(Ya)??Ka,Za=()=>{let e=Xa();return(0,u.useSyncExternalStore)(e.subscribe,e.getMode,e.getMode),e},Qa=e=>!e||e===`none`||e===`transparent`,$a=(e,t,n)=>{if(!e||!t)return n;try{return e.getSheet(t)??n}catch{return n}},eo=(e,t)=>{let r,a=e.getWorkbook(),o=t?.referenceMode??{getMode:qa,setMode:Ja},{anchor:s,notifySessionChange:c}=((e,t,n)=>{let r=()=>{let r=n();return r?$a(t,r.getCoords().scope,e):t?.getSelectedSheet()??e},i=null,a=null,o=null,s=()=>{let e=r();e!==i&&(a?.(),i=e,a=e.getSelection().addListeners({onChange:()=>o?.()}),o?.())};return{anchor:{getCoords:()=>{let e=r();return{...e.getSelection().getCoords().cell,scope:e.getName()}},subscribe:e=>{o=e,s();let n=t?.addListeners({onSelectedSheetChange:()=>s()})??null;return()=>{a?.(),n?.(),o=null}}},notifySessionChange:s}})(e,a,()=>r?.getSession()??null);return r=new Xr(s,((e,t=e.getWorkbook())=>r=>{if(t?.getProtection().isReadOnly())throw Error(`Cannot start an edit session on a write-protected (read-only) workbook.`);let i=$a(t,r.scope,e),a={rowIndex:r.rowIndex,colIndex:r.colIndex},o=i.getRange(a),s=o.getCell();if(!s.isEditAllowed())return null;let c=s.getSpillKind()===`fixed`?s.getSpill()?.getCoords()??null:null,l=!!c&&c.colStart===a.colIndex&&c.rowStart===a.rowIndex;return!c||l||((e,t)=>{let n=e.getSelection().getRanges();if(n.getCount()!==1)return!1;let r=n.at(0).getCoords();return r.colStart===t.colStart&&r.rowStart===t.rowStart&&r.colEnd===t.colEnd&&r.rowEnd===t.rowEnd})(i,c)?{clean:()=>{if(c)return i.getRange(c).getCell();let e=i.getRange(a).getCell();return e.isSpillOverflow()?e.createCell({value:null}):e},commit:(e,t)=>{let r=((e,t,n)=>{if(typeof t!=`string`||t.charAt(0)!==`=`||t.length<2)return t;try{let r=e.getCalculation().createFormula(t,n,{target:`display`});r.isValid()||(r=r.autoCorrect()??r);let i=r.getExpression();return i?`=`+i:t}catch{return t}})(i,e,a),s=e.replace(/\s+/g,` `),l=s.length>20?`${s.slice(0,20)}…`:s,u=typeof r==`string`&&r.charAt(0)===`=`;if(c&&(!t?.arrayFixed||!u)){let e=i.getRange(c),t=n.r(`op.typeInto`,{text:l,range:e.toString()});u?e.setFormula(r,{arrayFixed:!0,description:t,autoFit:!0,autoFormat:!0,autoSelectRestore:!0}):e.setValue(r,{description:t,autoFit:!0,autoFormat:!0,autoSelectRestore:!0});return}if(t?.arrayFixed&&u){let e=i.getSelection().getRanges();if(e.getCount()!==1)throw new n.c(n.r(`error.sheet.arrayFixedMultipleRanges`));let t=e.at(0);t.setFormula(r,{arrayFixed:!0,description:n.r(`op.typeInto`,{text:l,range:t.toString()}),autoFit:!0,autoFormat:!0,autoSelectRestore:!0});return}let d=t?.broadcast?i.getSelection().getRanges():o;d.setValue(r,{description:n.r(`op.typeInto`,{text:l,range:d.toString()}),autoFit:!0,autoFormat:!0,autoSelectRestore:!0})}}:null})(e,a),{revertAnchor:t=>{$a(a,t.scope,e).getSelection().clearAndModify({rowIndex:t.rowIndex,colIndex:t.colIndex})}}),r.subscribe(()=>c()),(e=>{let t=null,r=null,a=t=>{var r;i.It(t?{key:`edit`,description:(r=t.getState().mode,n.r(r===`edit`?`editMode.edit`:`editMode.enter`)),args:{editable:e},onModeChange:t=>{t?.args?.editable!==e&&queueMicrotask(()=>e.cancel())}}:t=>t?.args?.editable===e?null:t)};e.subscribe(()=>{let n=e.getSession();t?.(),t=null,n&&(r=n.getState().mode,t=n.subscribe(()=>{let e=n.getState().mode;e!==r&&(r=e,a(n))})),a(n)})})(r),((e,t,n,r)=>{e.subscribe(()=>{let i=e.getSession(),a=r.getMode();if(i){if(!a){let a=$a(n,i.getCoords().scope,t).getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});r.setMode({mode:`show`,selection:a,activeInput:null,allowMulti:!0,onDone:({reason:t})=>{t===`cancel`?e.cancel():e.commit()}})}}else if(a&&(r.setMode(null),a.mode===`point`&&n)){let e=a.selection.getSheet();e&&!e.isDeleted()&&n.getSelectedSheet()!==e&&e.getSelection().getRanges().select({scrollIntoView:!0,autoFocus:!0})}})})(r,e,a,o),((e,t,n)=>{t&&t.addListeners({onSelectedSheetChange:()=>{let r=e.getSession();if(!r)return;let i=t.getSelectedSheet();i&&i.getName()!==r.getCoords().scope&&n.getMode()?.mode!==`point`&&e.commit()}})})(r,a,o),r},to={position:`fixed`,transform:`translate(-50%, -100%)`,pointerEvents:`none`,zIndex:12e3,maxWidth:`24rem`,padding:`2px 8px`,borderRadius:`4px`,border:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`,background:`var(--sxl-color-base-100, rgb(255,255,255))`,color:`var(--sxl-color-base-content, rgb(37,36,35))`,fontFamily:`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,fontSize:`0.85em`,lineHeight:1.4,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`,boxShadow:`0 2px 8px rgba(0,0,0,0.18)`},no=(e,t)=>{let n=(0,u.useRef)(!1),r=(0,u.useRef)(e);r.current=e;let a=(0,u.useRef)(t);a.current=t;let o=(0,u.useRef)(null),s=(0,u.useRef)(null);(0,u.useEffect)(()=>()=>{s.current?.()},[]);let c=i.ut(),l=(0,u.useCallback)(e=>{if(e?.button!==void 0&&e.button!==0||(o.current=e?.clientX!==void 0&&e?.clientY!==void 0?{x:e.clientX,y:e.clientY}:null,n.current))return;n.current=!0,c.onPointerDown(e);let t=()=>{n.current=!1,s.current=null,window.removeEventListener(`pointerup`,t,!0),window.removeEventListener(`pointercancel`,t,!0),a.current?.()};s.current=t,window.addEventListener(`pointerup`,t,!0),window.addEventListener(`pointercancel`,t,!0),r.current?.()},[c]),d=(0,u.useCallback)(e=>{if(n.current)return!0;let t=o.current;return!!t&&(Math.abs(e.clientX-t.x)<=3&&Math.abs(e.clientY-t.y)<=3||(o.current=null,!1))},[]);return(0,u.useMemo)(()=>({isDragging:()=>n.current,blocksHover:d,begin:l,onDragStart:c.onDragStart}),[d,l,c])},ro=e=>!!e&&e.selectionStart!==null&&e.selectionEnd!==null&&e.selectionStart!==e.selectionEnd,io=(e,t)=>{let n=e[t]?.evalIndex;if(n===void 0)return null;let r=t,i=t;for(;r>0;){let t=e[r-1].evalIndex;if(t===void 0||t<n)break;r--}for(;i<e.length-1;){let t=e[i+1].evalIndex;if(t===void 0||t<n)break;i++}return{lo:r,hi:i,evalIndex:n}},ao=(e,t,n,r,i,a)=>{if(!e||e.length===0||r>=i)return null;let o=t,s=-1,c=-1,l=t,u=t;for(let t=0;t<e.length;t++){let n=(e[t].text??``).length,a=o;o+=n,n!==0&&e[t].type!==`whitespace`&&a<i&&o>r&&(s<0&&(s=t,l=a),c=t,u=o)}if(s<0)return null;let d=null,f=null;for(let t=s;t<=c;t++){let n=io(e,t);n&&((!f||n.evalIndex<f.evalIndex)&&(f=n),n.lo<=s&&n.hi>=c&&(!d||n.hi-n.lo<d.hi-d.lo)&&(d=n))}if(d&&d.lo===s&&d.hi===c)return{lo:s,hi:c,start:l,end:u,fragment:null,evalIndex:d.evalIndex};if(a&&l>=r&&u<=i){let e=n.slice(l,u);if(a(e))return{lo:s,hi:c,start:l,end:u,fragment:e,evalIndex:0}}let p=d??f;if(!p)return null;let m=so(e,t,p.lo,p.hi);return{lo:p.lo,hi:p.hi,start:m.start,end:m.end,fragment:null,evalIndex:p.evalIndex}},oo=e=>{if(!e)return null;let t=e.length-1;for(;t>=0&&e[t].evalIndex===void 0;)t--;return t<0?null:{lo:0,hi:t,evalIndex:0}},so=(e,t,n,r)=>{let i=t,a=t;for(let t=0;t<e.length&&(t===n&&(a=i),i+=(e[t].text??``).length,t!==r);t++);return{start:a,end:i}},co=e=>e===`,`?{decimal:`,`,column:`;`,row:`|`}:{decimal:`.`,column:`,`,row:`;`},lo=(e,t,n)=>{if(e==null)return`0`;if(a.i.isError(e))return String(e);let r=typeof e;if(r===`number`){if(!Number.isFinite(e))return null;let n=String(e);return t.decimal===`.`?n:n.replace(`.`,t.decimal)}return r===`boolean`?e?n.t:n.f:r===`string`?`"${e.replace(/"/g,`""`)}"`:null},uo=(e,t,n={t:`TRUE`,f:`FALSE`})=>{if(a.i.isError(e,a.i.Code.Parse))return null;let r=e;if(e!=null&&typeof r?.getRowCount==`function`){let e=r.getRowCount(),i=r.getColumnCount(),a=e*i;if(a===0||a>1024)return null;if(a===1)return lo(r.getValueAt(0,0),t,n);let o=[];for(let a=0;a<e;a++){let e=[];for(let o=0;o<i;o++){let i=lo(r.getValueAt(a,o),t,n);if(i===null)return null;e.push(i)}o.push(e.join(t.column))}return`{${o.join(t.row)}}`}return lo(e,t,n)},fo=e=>e==null?``:(a.i.isError(e),String(e)),po=e=>{if(e==null)return`0`;if(a.i.isError(e,a.i.Code.Parse))return null;if(a.i.isError(e))return String(e);let t=typeof e;if(t===`number`||t===`boolean`||t===`string`)return String(e);let n=e;if(typeof n?.getRowCount==`function`){let e=n.getRowCount(),t=n.getColumnCount(),r=e*t;if(r<=1)return fo(n.getValueAt?.(0,0));if(r>12)return`{${e}×${t}}`;let i=[];for(let r=0;r<e;r++){let e=[];for(let i=0;i<t;i++)e.push(fo(n.getValueAt(r,i)));i.push(e.join(`, `))}return`{${i.join(`; `)}}`}return String(e)},mo=!1,ho=()=>mo,go=(e,t,r)=>{if(e.nativeEvent.isComposing||t?.mode!==`point`)return!1;let a=t.selection;if(!a)return!1;let o=e.which===i.Zt.Left?n.a.Left:e.which===i.Zt.Right?n.a.Right:e.which===i.Zt.Up?n.a.Up:e.which===i.Zt.Down?n.a.Down:null,s=e.ctrlKey||e.metaKey,c=e.which===i.Zt.Space?s&&e.shiftKey?n.V.Both:s?n.V.Column:e.shiftKey?n.V.Row:null:null;if(o===null&&c===null)return!1;e.preventDefault(),e.stopPropagation();let l=a.getSheet().getName(),u=a.getCoords(),d=u.ranges??[],f=u.rangeIndex??-1;mo=!0;try{if(f<0){let e={rowStart:u.cell.rowIndex,colStart:u.cell.colIndex,rowEnd:u.cell.rowIndex,colEnd:u.cell.colIndex,scope:r};a.updateCoords({cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:r},ranges:[...d,e],rangeIndex:d.length})}else{let e=d[f];e&&(e.scope??l)!==r&&a.updateCoords({...u,ranges:d.map((e,t)=>t===f?{...e,scope:r}:e)})}}finally{mo=!1}return c===null?a.navigate(o,e.shiftKey,s):a.selectRegion({axis:c,contentOnly:!1}),!0},_o=e=>{let t=(0,u.useRef)(e);t.current=e;let[n,r]=(0,u.useState)(e.initialText??``),[a,o]=(0,u.useState)(null),[s,c]=(0,u.useState)(!1),l=(0,u.useRef)(n),d=(0,u.useRef)(n),f=(0,u.useRef)(n),p=(0,u.useRef)(!1),m=(0,u.useRef)(null),h=(0,u.useRef)(null),g=(0,u.useRef)(!1),_=(0,u.useRef)(!1),v=(0,u.useRef)(!0),y=e=>{l.current=e,r(e),g.current=!0;let n=e!==d.current;p.current=n,c(n),v.current&&t.current.onChangeText?.(e)},b=e=>{m.current=e,o(e)},x=i.X(e=>{let{parse:n,changeOn:r=`live`,onChange:i}=t.current,{value:a,error:o}=n(e);o?b(o):(b(null),a!==void 0&&(h.current=a,r!==`done`&&i?.(a)))},[]),S=i.X(e=>{let{onDone:n}=t.current;n&&(e.reason!==`cancel`&&m.current||(n(h.current,e),e.reason!==`cancel`&&(d.current=l.current,p.current=!1,c(!1))))},[]),C=e=>{y(e),b(null),x(e)},w=i.X(()=>{C(d.current)},[]),T=i.X(()=>{C(f.current)},[]),E=i.X((e,t)=>{d.current=e,t!==void 0&&(h.current=t);let n=g.current;v.current=!1;try{y(e)}finally{v.current=!0}g.current=n,b(null)},[]),D=i.X(()=>{f.current=l.current,g.current=!1},[]),O=i.X(()=>{_.current=!1},[]),k=i.X(()=>{let e=_.current;return _.current=!1,e},[]);return{text:n,error:a,dirty:s,textRef:l,committedTextRef:d,baselineTextRef:f,dirtyRef:p,errorRef:m,touchedRef:g,lastValidRef:h,setText:y,setError:b,liveChange:x,notifyDone:S,revertToCommitted:w,revertToBaseline:T,resetCommitted:E,beginSession:D,handleDoneKeys:i.X(e=>{let{changeOn:n=`live`,session:r}=t.current;return e.key===`Escape`?(r.isActive()&&g.current?(e.preventDefault(),e.stopPropagation(),r.end({reason:`cancel`,key:`Escape`})):!r.isActive()&&p.current&&(e.preventDefault(),e.stopPropagation(),w()),!0):e.key!==`Enter`||e.altKey||e.ctrlKey||e.metaKey?!(e.key!==`Tab`||e.altKey||e.ctrlKey||e.metaKey||(_.current=!0,m.current?r.isActive()?r.end({reason:`cancel`,key:`Tab`,shiftKey:e.shiftKey}):w():r.isActive()?r.end({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}):p.current&&S({reason:`accept`,key:`Tab`,shiftKey:e.shiftKey}),0)):m.current?(e.preventDefault(),e.stopPropagation(),!0):n===`done`?(e.preventDefault(),e.stopPropagation(),r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0):(_.current=!0,r.isActive()?r.end({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}):p.current&&S({reason:`accept`,key:`Enter`,shiftKey:e.shiftKey}),!0)},[]),handleTextKeys:i.X(e=>!!i.Jt.isCaretKey(e)&&(e.stopPropagation(),!0),[]),resetBlurGuard:O,consumeBlurGuard:k,commit:i.X(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`accept`}):S({reason:`accept`})},[]),cancel:i.X(()=>{let{session:e}=t.current;e.isActive()?e.end({reason:`cancel`}):(w(),S({reason:`cancel`}))},[])}},vo=(e,t,n)=>{let r=e.getSheet(),i=r.getRange(t).toString();return n&&n!==r.getName()?o.nt.sheetAndRangeToString(o.nt.sheetNameToString(n),i):i},yo=(e,t)=>{try{let n={rowStart:t.rowStart,rowEnd:t.rowEnd,colStart:t.colStart,colEnd:t.colEnd,scope:t.scope},r=e.getSheet(),i={...e.getCoords(),scope:r.getName()};return r.getNames().getByRanges([n],{includeParts:!0,home:i})[0]??null}catch{return null}},bo=(e,t)=>{let n=t.scope&&t.scope!==e.getName()?e.getWorkbook()?.getSheet(t.scope):e;if(!n)return null;let r=n.getCell({rowIndex:t.rowStart,colIndex:t.colStart}),i=r.getSpillKind();if(!i||i===`error`)return null;let a=r.getSpill()?.getCoords();return a&&a.rowStart===t.rowStart&&a.colStart===t.colStart?{coords:a,kind:i}:null},xo=(e,t)=>{if(t.rowStart===t.rowEnd&&t.colStart===t.colEnd)return!1;try{let n=bo(e,t);return n?.kind===`dynamic`&&n.coords.rowEnd===t.rowEnd&&n.coords.colEnd===t.colEnd}catch{return!1}},So=(e,t,n)=>{try{return xo(e.getSheet(),t)?vo(e,{rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowStart,colEnd:t.colStart,$rowStart:n?.$rowStart,$colStart:n?.$colStart},t.scope)+`#`:null}catch{return null}},Co=(e,t,n)=>{let r=null;for(let i of t){let t=i.referenceIndex;if(t===void 0||i.value!==`#`)continue;let a=n[t];if(a)try{let i=bo(e,a);if(!i)continue;r??=n.slice(),r[t]={...a,rowEnd:i.coords.rowEnd,colEnd:i.coords.colEnd}}catch{}}return r??n},wo=e=>e.length>o.N.MAX_EXPRESSION_LENGTH,To=e=>{let t=[],n=0,r=!1;for(let i=0;i<e.length;i++){let a=e[i];a===`'`?r=!r:a!==`,`||r||(t.push({text:e.slice(n,i),start:n,end:i}),n=i+1)}return t.push({text:e.slice(n),start:n,end:e.length}),t},Eo=(e,t,n)=>{let r=t.trim();if(!r)return null;let i=e=>{if(!e||e.getCount()!==1)return null;let t=e.at(0),n=t.getCoords();return{rowStart:n.rowStart,colStart:n.colStart,rowEnd:n.rowEnd,colEnd:n.colEnd,scope:t.getSheet().getName()}};try{let t=n?.scope&&!r.includes(`!`)?e.getSheet(n.scope):null;return i(t?t.getRanges(r):e.getRanges(r))}catch{}try{let t=e.getSelectedSheet().getCalculation().createFormula(`=`+r,n,{target:`display`});return t.isValid()&&t.isReferenceOnly()?i(t.getReferences()):null}catch{return null}},Do=(e,t,n,r)=>{let i=t.trim();if(!i)return null;let a=!ja(i);if(a&&!r)return null;try{let r=e.getSelectedSheet().getCalculation().createFormula(a?`=`+t:t,n,{target:`display`}),i=r.getTokens();if(i.length===0)return{tokens:[],ranges:[]};let o=[];try{let t=r.getReferences(),a=n?.scope??e.getSelectedSheet().getName();o=t?t.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[],o=Co(e.getSelectedSheet(),i,o)}catch{}return{tokens:i,ranges:o}}catch{return{tokens:[],ranges:[]}}},Oo=(e,t,n)=>{if(!n||!e)return t.toString();try{let r=t.getCoords(),i=t.getSheet?.()?.getName()??n;if(!r.every(e=>!e||(e.scope??i)===n))return t.toString();let a=e.getSheet(n);return a?a.getRanges(r).toString():t.toString()}catch{return t.toString()}},ko=(e,t)=>{let n=e.trim();if(!n)return e;let r=(ja(n)?n.slice(Ma(n)):n).trim();return r?t?r:`=`+r:e},Ao=(e,t,n,r,i)=>{if(e==null)return``;let a=r?.scope??null,o=t===`formula`,s=i===`bare`;if(typeof e==`string`)return i===`literal`?e:o?ko(e,s):e;try{if(e.isICellRanges){let t=Oo(n,e,a);return o?ko(t,s):t}if(!o){let t=e.getReferences();return t?Oo(n,t,a):``}let t=e.getExpression({target:`display`});return t?ko(t,s):``}catch{return``}},jo=(e,t=`formula`)=>{let{value:r,onChange:a,onChangeText:s,changeOn:c=`live`,allowMulti:l=!1,allowCrossSheet:d=!0,disabled:f=!1,onDone:p,home:m,equals:h=`optional`,pickAs:g=`relative`,pickSpills:_=!1}=e,v=Ui(),y=e.workbook===void 0?v:e.workbook,b=t===`formula`,x=h!==`required`&&h!==`literal`,S=Za(),[C,w]=(0,u.useState)(!1),[T,E]=(0,u.useState)(!1),D=(0,u.useRef)(null),O=(0,u.useRef)(null),k=(0,u.useRef)(!1),A=(0,u.useRef)(!1),j=(0,u.useRef)(!1),M=(0,u.useRef)(y??null);M.current=y??null;let N=(0,u.useRef)(m);N.current=m;let[P,F]=(0,u.useState)(0);(0,u.useEffect)(()=>{if(!y)return;let e=!0;return Promise.resolve(y.whenCalculationReady()).then(()=>{e&&F(e=>e+1)}).catch(()=>{}),()=>{e=!1}},[y]);let[I]=(0,u.useState)(()=>Ao(r,t,y??null,m,h)),L=_o({initialText:I,parse:e=>ne(e),changeOn:c,onChange:a,onChangeText:s,onDone:p,session:{isActive:()=>A.current,end:e=>de(e)}}),{text:R,error:z,dirty:B,textRef:V,committedTextRef:H,baselineTextRef:U,dirtyRef:W,errorRef:G,lastValidRef:K,setText:q,setError:J,liveChange:Y,notifyDone:ee}=L,X=()=>N.current?.scope??M.current?.getSelectedSheet()?.getName()??null,te=e=>{let t=X();if(!t)return!0;try{return(e.getReferences()?.getCoords()??[]).every(e=>!e||(e.scope??t)===t)}catch{return!0}},ne=e=>{let t=e.trim();if(!t)return{value:null,error:null};let r=M.current;if(!r)return{error:null};let i=r.getSelectedSheet().getCalculation();if(!b){if(t.startsWith(`=`))return{error:n.q(`referenceInput.invalid`)};try{let e=i.createFormula(`=`+t,N.current,{target:`display`});if(e.isValid()&&e.isReferenceOnly()&&e.getReferences())return d||te(e)?{value:e,error:null}:{error:n.q(`referenceInput.crossSheet`)}}catch{}return{error:n.q(`referenceInput.invalid`)}}if(h===`required`&&!ja(t))return{error:n.q(`formulaInput.equalsRequired`)};if(h===`literal`&&!ja(t))return{error:null};let a=ja(t)?t:`=`+t;try{let e=i.createFormula(a,N.current,{target:`display`});if(!e.isValid()){let t=e.autoCorrect();if(!t)return{error:n.q(`formulaInput.invalid`)};e=t}return d||te(e)?{value:e,error:null}:{error:n.q(`referenceInput.crossSheet`)}}catch{return{error:n.q(`formulaInput.invalid`)}}};(0,u.useEffect)(()=>{if(P===0)return;let e=V.current;if(!e.trim())return;if(W.current)return void Y(e);let{value:t,error:n}=ne(e);J(n),t&&(K.current=t)},[P]);let re=wo(R),ie=re?(e=>{let t=e.slice(0,o.N.MAX_EXPRESSION_LENGTH),n=t.lastIndexOf(`,`);return`${n>0?t.slice(0,n):t}…`})(R):R,ae=(0,u.useMemo)(()=>b&&!re&&y?Do(y,R,N.current,x):null,[b,re,y,R,P,x]),oe=b?Ma(R):0,se=(0,u.useMemo)(()=>ae&&ae.tokens.length!==0&&ae.tokens.map(e=>e.text??``).join(``)===R.slice(oe)?ae.tokens:null,[ae,R,oe]),ce=i.X(()=>{let e=O.current;if(!e||!y)return;let t=V.current;if(wo(t))return;if(b){let r=Do(y,t,N.current,x),i=r?.ranges??[],a=D.current?.selectionStart??t.length,o=-1;if(r){let e=Ma(t);for(let t of r.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&a>=e&&a<=e+n){o=t.referenceIndex;break}e+=n}o>=0&&(o>=i.length||!i[o])&&(o=-1)}let s=y.getSelectedSheet(),c={...s.getSelection().getCoords().cell,scope:s.getName()},l=i.some(Boolean)?{cell:c,ranges:i,rangeIndex:o}:{cell:c,ranges:n.d.EmptyRanges,rangeIndex:-1};k.current=!0;try{e.updateCoords(l)}finally{k.current=!1}return}let r=t.trim()?To(t):[],i=r.map(e=>Eo(y,e.text,N.current)),a=-1;if(l){if(i.length){let e=D.current?.selectionStart??t.length,n=r.findIndex(t=>e>=t.start&&e<=t.end),i=n>=0&&!r[n].text.trim();a=n<0||i?-1:n}}else a=i.length?0:-1;a>=0&&!i[a]&&(a=-1);let o=y.getSelectedSheet(),s={...o.getSelection().getCoords().cell,scope:o.getName()};k.current=!0;try{e.updateCoords({cell:s,ranges:i,rangeIndex:a})}finally{k.current=!1}},[y,l,b]),le=(e,t)=>{let n=M.current,r=e.scope??N.current?.scope??null;if(_&&n&&r&&xo(n.getSelectedSheet(),{...e,scope:r})){let n=ue({...e,rowEnd:e.rowStart,colEnd:e.colStart},t);return n===null?null:n+`#`}return ue(e,t)},ue=(e,t)=>{let n=M.current;if(!n)return null;let r=t?((e,t,n)=>{let r=t.trim().replace(/^=\s*/,``).trim();if(!r)return null;try{let t=e.getSelectedSheet().getCalculation().createFormula(`=`+r,n,{target:`display`});if(!t.isValid()||!t.isReferenceOnly()||Fa(t.getTokens(),0))return null;let i=t.getReferences()?.getCoords(),a=i?.length===1?i[0]:void 0;return a?{$rowStart:!!a.$rowStart,$colStart:!!a.$colStart,$rowEnd:!!a.$rowEnd,$colEnd:!!a.$colEnd}:null}catch{return null}})(n,t,N.current):null,i=g===`absolute`,a=N.current?.scope??null,o=e.scope??a;if(!o)return null;if(o!==a)return((e,t,n,r)=>{if(!t?.scope)return null;try{let i={rowStart:t.rowStart,colStart:t.colStart,rowEnd:t.rowEnd,colEnd:t.colEnd,scope:t.scope};if(r)return e.getRanges([{...i,...r}]).toString();let a=e.getRanges([i]);return(n?a.getFixed(!0):a).toString()}catch{return null}})(n,{...e,scope:o},i,r);try{let t=n.getSheet(o);if(!t)return null;let a={rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd};if(r)return t.getRanges([{...a,...r}]).toString();let s=t.getRange(a);return(i?s.getFixed(!0):s).toString()}catch{return null}};(0,u.useEffect)(()=>{if(!C)return;let e=O.current;return e&&y?e.addListeners({onChange:()=>{if(k.current||ho())return;let t=e.getCoords(),n=t.rangeIndex??-1,r=n>=0?t.ranges?.[n]:null;if(b){let e=n>=0?t.ranges?.[n]:null;if(!e)return;let r,i,a=V.current,o=D.current,s=Do(y,a,N.current,x),c=s?.ranges.length??0,l=s&&n<c?Pa(s.tokens,n,Ma(a)):null,u=le(e,l?a.slice(l.start,l.end):null);if(u==null)return;if(s)if(n<c){if(!l)return;r=a.slice(0,l.start)+u+a.slice(l.end),i=l.start+u.length}else{let e=o?.selectionStart??a.length,t=o?.selectionEnd??a.length,n=(e>0&&!`/*^&<>=:,+-@( `.includes(a[e-1])?`,`:``)+u;r=a.slice(0,e)+n+a.slice(t),i=e+n.length}else{if(a.trim())return;r=(h===`bare`?``:`=`)+u,i=r.length}q(r),ge(!0),Y(r),requestAnimationFrame(()=>{D.current?.setSelectionRange?.(i,i),ce()});return}if(!r)return;let i,a,o=V.current,s=o.trim()?To(o):[],c=n>=0&&n<s.length&&s[n].text.trim()?s[n]:!l&&s.length===1&&s[0].text.trim()?s[0]:null,u=le(r,c?.text??null);if(u){if(n>=0&&n<s.length&&s[n].text.trim()){let e=s[n],t=e.text.match(/^\s*/)?.[0]??``;i=o.slice(0,e.start)+t+u+o.slice(e.end),a=e.start+t.length+u.length}else if(l){let e=o.replace(/\s+$/,``);i=(e?e.endsWith(`,`)?`${e} `:`${e}, `:``)+u,a=i.length}else i=u,a=i.length;q(i),ge(!0),Y(i),requestAnimationFrame(()=>{D.current?.setSelectionRange?.(a,a),ce()})}}}):void 0},[C,y,l,b,g,_,h,Y,ce]);let Z=()=>{if(!b)return;let e=V.current.trim();if(!e||!x&&!ja(e))return;let t=e.startsWith(`=`);if(!t&&ja(e))return;let n,r=M.current?.getSelectedSheet().getCalculation();if(r){try{let i=r.createFormula(t?e:`=`+e,N.current,{target:`display`});if(i.isValid())return;let a=i.autoCorrect();if(!a)return;let o=a.getExpression({target:`display`});n=t?`=`+o:o}catch{return}q(n),Y(n)}},de=i.X(e=>{e.reason===`cancel`?L.revertToBaseline():Z(),ve();let t=D.current;t&&typeof document<`u`&&document.activeElement!==t&&(j.current=!0,t.focus()),ee(e)},[ee,Y]),Q=(0,u.useRef)(null);Q.current||={insertText:e=>{let t=D.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length,i=t.value.slice(0,n)+e+t.value.slice(r);q(i),Y(i),requestAnimationFrame(()=>t.setSelectionRange(n+e.length,n+e.length))},selectAll:()=>{D.current?.select()},setSelection:e=>{D.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{D.current?.focus()},toggleReferences:()=>{(async()=>{let e=D.current,t=M.current;if(!e||!t||wo(V.current))return;let n=e.value,r=e.selectionStart??n.length;try{let i=t.getSelectedSheet().getCalculation();if(b){if(!ja(n))return;let t=await Ia(i,n,r,N.current);if(!t)return;q(t.value),Y(t.value),A.current&&ce(),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret));return}let a=To(n).find(e=>r>=e.start&&r<=e.end);if(!a)return;let o=(a.text.match(/^\s*/)?.[0]??``).length,s=a.text.trim();if(!s)return;let c=a.start+o,l=Math.min(Math.max(r-c,0),s.length),u=await Ia(i,`=`+s,l+1);if(!u)return;let d=n.slice(0,c)+u.value.slice(1)+n.slice(c+s.length),f=c+(u.caret-1);q(d),Y(d),A.current&&ce(),requestAnimationFrame(()=>e.setSelectionRange(f,f))}catch{}})()}};let fe=(0,u.useRef)(!1),pe=()=>{fe.current||(fe.current=!0,console.warn(`[sheetxl] ${t} input has no workbook (pass the 'workbook' prop or wrap in a WorkbookProvider) — picking, select-current, and validation are disabled; the field degrades to plain text.`))},me=()=>{let e=V.current,t=D.current?.selectionStart??e.length;if(!e.trim())return{kind:`insert`,at:t};if(!x&&!ja(e.trimStart()))return null;let n=M.current;if(n){let r=Do(n,e,N.current,x);if(r){let n=Ma(e);for(let e=0;e<r.ranges.length;e++){if(!r.ranges[e])continue;let i=Pa(r.tokens,e,n);if(i&&t>=i.start&&t<=i.end)return{kind:`replace`,start:i.start,end:i.end}}}}return Aa(e,t)?{kind:`insert`,at:t}:null},he=()=>me()!==null,ge=e=>{if(E(e),!b||!A.current)return;let t=O.current;S.setMode(n=>n&&n.selection===t&&n.mode!==(e?`point`:`show`)?{...n,mode:e?`point`:`show`}:n)},_e=i.X(()=>{if(f||A.current||wo(V.current))return;if(!y)return void pe();L.beginSession();let t=y.getSelectedSheet().getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});O.current=t,A.current=!0,w(!0);let n=!b||he();E(n),S.setMode({mode:n?`point`:`show`,selection:t,activeInput:Q.current,allowMulti:b?e.allowMulti??!0:l,scope:d?void 0:X()??void 0,onDone:de}),ce()},[f,y,l,e.allowMulti,d,b]),ve=i.X(()=>{if(!A.current)return;A.current=!1,w(!1);let e=O.current;O.current=null,S.setMode(t=>t&&t.selection===e?null:t)},[]),ye=S.getMode();(0,u.useEffect)(()=>{A.current&&O.current&&ye?.selection!==O.current&&(A.current=!1,w(!1),O.current=null)},[ye]),(0,u.useEffect)(()=>()=>{ve()},[ve]),(0,u.useEffect)(()=>{let e=Ao(r,t,M.current,N.current,h),n=ne(e),i=r==null||typeof r==`string`||r.isICellRanges?n.value??null:r;L.resetCommitted(e,i),J(n.error??null),A.current&&ce()},[r]);let be=i.X(e=>{A.current||_e(),q(e.target.value),b?ge(he()):c===`done`&&E(!1),Y(e.target.value),A.current&&ce()},[_e,Y,ce,c]),xe=i.X(e=>{if(L.resetBlurGuard(),!(e.key!==`F2`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void ge(!T);if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey))return e.preventDefault(),e.stopPropagation(),void Q.current?.toggleReferences();if(A.current&&T){let t=S.getMode(),n=y?.getSelectedSheet()?.getName();if(t&&n&&go(e,t,n))return}L.handleDoneKeys(e)||L.handleTextKeys(e)},[T,y]),Se=i.X(e=>{L.resetBlurGuard(),j.current?j.current=!1:_e()},[_e]),Ce=i.X(e=>{let t=L.consumeBlurGuard(),n=e.relatedTarget;(n&&(n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable)||b&&!T)&&(ve(),t||Z(),!t&&W.current&&ee({reason:`accept`}))},[ve,ee,b,T]),we=i.X(e=>{A.current&&c===`done`&&!b&&E(!1)},[c,b]),Te=i.X(e=>{A.current&&(b&&ge(he()),ce())},[ce,b]),Ee=i.X((e,t)=>{A.current||_e(),q(e),Y(e),A.current&&ce(),t!==void 0&&requestAnimationFrame(()=>D.current?.setSelectionRange?.(t,t))},[_e,Y,ce]),De=i.X(()=>{A.current?de({reason:`accept`}):(D.current?.focus(),_e())},[_e,de]),Oe=i.X(()=>{if(!y)return void pe();let e=y.getSelectedSheet().getSelectedRanges(),t=e?.getCount()??0;if(!t)return;if(b){let t=me();if(!t)return;let n,r,i=D.current,a=V.current,o=e.at(0),s=o.getCoords(),c=le({rowStart:s.rowStart,colStart:s.colStart,rowEnd:s.rowEnd,colEnd:s.colEnd,scope:o.getSheet().getName()},t.kind===`replace`?a.slice(t.start,t.end):null);if(!c)return;if(t.kind===`replace`)n=a.slice(0,t.start)+c+a.slice(t.end),r=t.start+c.length;else if(a.trim()){let e=i?.selectionStart??a.length,t=i?.selectionEnd??a.length,o=(e>0&&!`/*^&<>=:,+-@( `.includes(a[e-1])?`,`:``)+c;n=a.slice(0,e)+o+a.slice(t),r=e+o.length}else n=(h===`bare`?``:`=`)+c,r=n.length;q(n),Y(n),A.current&&ce(),requestAnimationFrame(()=>i?.setSelectionRange?.(r,r));return}let n=[];for(let r=0;r<t;r++){let t=e.at(r),i=t.getCoords(),a=le({rowStart:i.rowStart,colStart:i.colStart,rowEnd:i.rowEnd,colEnd:i.colEnd,scope:t.getSheet().getName()});a&&n.push(a)}if(!n.length)return;let r=l?n.join(`, `):n[0];q(r),Y(r),A.current&&ce()},[y,l,b,g,_,h,Y,ce]),ke=i.X(()=>{L.revertToCommitted(),A.current&&ce()},[ce]),Ae=(0,u.useMemo)(()=>b||re||!R.trim()||!y?[]:To(R).map(e=>({text:e.text,start:e.start,end:e.end,valid:!!Eo(y,e.text,N.current)})),[b,re,R,y,P]),je=i.X(async e=>{let t=y,n=Ae[e]?.text.trim();if(!t||!n)return null;try{return po(await t.getSelectedSheet().getCalculation().createFormula(`=`+n,void 0,{target:`display`}).evaluate())}catch{return null}},[y,Ae]),Me=i.X(()=>{try{return K.current?.getReferences()??null}catch{return null}},[]);return{inputProps:{value:ie,readOnly:re,onChange:be,onKeyDown:xe,onFocus:Se,onBlur:Ce,onMouseDown:we,onSelect:Te,ref:e=>{D.current=e}},text:R,overLength:re,segments:Ae,tokens:se,tokenBase:oe,error:z,dirty:B,engaged:C,pointArmed:T,togglePoint:De,engage:_e,replaceText:Ee,selectCurrent:Oe,canSelectCurrent:!b||he(),revert:ke,commit:L.commit,cancel:L.cancel,getRanges:Me,evaluateSegment:je}},Mo={function:`Function`,named:`NamedRange`,lambda:`FormulaCustom`,table:`Table`,parameter:`Named`,column:`Table`,specifier:`Table`,enum:`DataValidation`},No=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,Po=e=>{let{item:t,summary:n,wrapSummary:i=!1,rowHeight:a=22}=e;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,height:a,padding:`0 10px`},children:[(0,d.jsx)(r.r,{iconKey:t.iconKey??Mo[t.kind??`function`],size:16,style:{color:No,flex:`0 0 auto`}}),(0,d.jsx)(`span`,{className:`named-item-name`,style:{fontWeight:600,color:`var(--sxl-color-primary, rgb(33,115,70))`,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:t.name}),t.detail&&(0,d.jsx)(`span`,{style:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:t.detail}),t.category&&(0,d.jsx)(`span`,{style:{marginLeft:`auto`,flex:`0 0 auto`,color:No},children:t.category})]}),n&&(0,d.jsx)(`div`,{title:i?void 0:n,style:{padding:`0 10px 4px 34px`,fontSize:11,lineHeight:`14px`,color:No,...i?{whiteSpace:`normal`}:{whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`}},children:n})]})};Po.displayName=`NamedItemLabel`;var Fo=8,Io=e=>{let{items:t,selectedIndex:r,selectedSummary:i,onSelect:a,onHighlight:o,maxVisibleRows:s=Fo}=e,c=(0,u.useRef)(null);return(0,u.useLayoutEffect)(()=>{let e=c.current,t=e?.children[r];e&&t&&n.b.scrollIntoContainer(e,t)},[r]),t.length===0?null:(0,d.jsx)(`div`,{ref:c,role:`listbox`,style:{maxHeight:22*s,overflowY:`auto`,position:`relative`,width:`20rem`,padding:`2px 0`,fontFamily:`var(--sxl-font-family)`,fontSize:12,lineHeight:1.5,color:`var(--sxl-color-base-content, rgb(37,36,35))`},children:t.map((e,t)=>{let n=t===r;return(0,d.jsx)(`div`,{role:`option`,"aria-selected":n,onMouseDown:n=>{n.preventDefault(),a(e,t)},onMouseMove:()=>{n||o?.(t)},style:{cursor:`pointer`,background:n?`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`:`transparent`},children:(0,d.jsx)(Po,{item:e,summary:n?i:null,rowHeight:22})},`${t}:${e.name}`)})})};Io.displayName=`NamedItemsPanel`;var Lo=e=>{let t=/(\d+)$/.exec(e);return t?{base:e.slice(0,-t[1].length),n:parseInt(t[1],10)}:{base:e,n:1}},Ro=e=>!!e&&e.trim()!==``,zo=(e,t=[])=>{let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=i.getName(),o=i.getRepeatingTypes();if(!o&&!i.isRest()){n.push({key:`${r}`,label:a,param:i,descKey:a,optional:i.isOptional()});continue}let s=o??[i],c=s.length,{base:l,n:u}=Lo(a),d=n.length,f=Math.max(d,t.length-(e.length-r-1)),p=-1;for(let e=d;e<f;e++)Ro(t[e])&&(p=e);let m=+!i.isOptional(),h=Math.max(m+1,Math.ceil((p-d+1)/c)+1);for(let e=0;e<h;e++)for(let t=0;t<c;t++){let o=s[t];n.push({key:`${r}r${e}s${t}`,label:`${c===1?l:o.getName()}${u+e}`,param:o,descKey:c===1?a:`${a}.${o.getName()}`,optional:e>0||o.isOptional()||i.isOptional(),repeat:e===h-1})}}return n},Bo=(e,t)=>{if(t<0)return null;for(let n=0;n<e.length;n++){let r=e[n],i=r.getRepeatingTypes();if(i||r.isRest()){let e=i??[r];return e[(t-n)%e.length]}if(n===t)return r}return null},Vo=(e,t,n,r)=>{let i=r?.equals??1?`=`:``,a=t.map((e,t)=>(n[t]??``).trim()),o=t.length;for(;o>0&&a[o-1]===``&&t[o-1].optional;)o--;return a.some(Ro)||(o=0),`${i}${e}(${a.slice(0,o).join(r?.separator??`,`)})`},Ho=`0.6em`,Uo=`calc(${Ho} + 1px)`,Wo=()=>{let[e,t]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{let e=requestAnimationFrame(()=>t(!0));return()=>cancelAnimationFrame(e)},[]),(0,d.jsx)(`span`,{"aria-hidden":!0,style:{display:`inline-block`,width:0,overflow:`visible`,verticalAlign:`baseline`},children:(0,d.jsx)(`span`,{style:{display:`inline-block`,verticalAlign:`baseline`,width:Ho,margin:`0 0 -1px 1px`,opacity:e?.6:0,transition:`opacity 0.2s ease-out`},children:(0,d.jsx)(`svg`,{viewBox:`0 0 10 3`,width:`100%`,style:{display:`block`,overflow:`visible`},children:(0,d.jsx)(`path`,{d:`M1.5 0.5v2h8v-2`,fill:`none`,stroke:`#a3a3a3`,strokeWidth:1,strokeLinecap:`round`,vectorEffect:`non-scaling-stroke`})})})})},Go=new Set([`number`,`string`,`boolean`]),Ko=`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 120, 215)) 45%, transparent)`,qo={backgroundColor:i.yt,borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${Ko}`},Jo={borderRadius:`2px`,boxShadow:`inset 0 0 0 1px ${Ko}`},Yo=[`#0431fa`,`#319331`,`#7b3814`],Xo=[`#ffd700`,`#da70d6`,`#179fff`],Zo=e=>{let t=e%Yo.length;return`light-dark(${Yo[t]}, ${Xo[t]})`},Qo={display:`inline-block`,width:0,overflow:`visible`,whiteSpace:`pre`},$o=e=>({display:`inline-block`,transform:`scale(1.15)`,transformOrigin:`center 78%`,opacity:.7,fontWeight:700,color:e}),es=`var(--sxl-color-error, #d93025)`,ts=`var(--sxl-color-warning, #b26a00)`,ns={textDecorationLine:`underline`,textDecorationStyle:`wavy`,textDecorationColor:ts,textDecorationSkipInk:`none`},rs={matchOf:new Map,depthOf:new Map,unmatched:new Set},is=e=>{if(!e)return rs;let t=new Map,n=new Map,r=new Set,i=[];return e.forEach((e,a)=>{if(e.type===`paren`){if(e.text===`(`)n.set(a,i.length),i.push(a);else if(e.text===`)`){let e=i.pop();e===void 0?r.add(a):(t.set(a,e),t.set(e,a),n.set(a,n.get(e)))}}}),{matchOf:t,depthOf:n,unmatched:r}},as=(e,t,n,r)=>{let i=r,a=-1,o=-1;for(let t=0;t<e.length;t++){let r=e[t],s=(r.text??``).length;r.type!==`paren`||r.text!==`(`&&r.text!==`)`||(n===i+s?a=t:n===i&&(o=t)),i+=s}let s=a>=0?a:o;if(s<0)return null;let c=t.get(s);return c===void 0?null:s<c?[s,c]:[c,s]},os=(e,t)=>e===t||!!e&&!!t&&e[0]===t[0]&&e[1]===t[1],ss=(e,t,n)=>{let r=new Set;if(e){let t=1/0;for(let r=e.lo;r<=e.hi;r++){let e=n.depthOf.get(r);e!==void 0&&e<t&&(t=e)}if(t===1/0)return r;for(let i=e.lo;i<=e.hi;i++){if(n.depthOf.get(i)!==t)continue;let a=n.matchOf.get(i);if(!(a===void 0||a<e.lo||a>e.hi)){r.add(i),r.add(a);break}}return r}return t&&(r.add(t[0]),r.add(t[1])),r},cs=`var(--sxl-color-base-content, rgb(37,36,35))`,ls=`color-mix(in srgb, var(--sxl-color-base-content, rgb(0,0,0)) 70%, transparent)`,us=`var(--sxl-color-primary, rgb(33,115,70))`,ds=`var(--sxl-font-family-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)`,fs=`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif)`,ps={color:us,fontWeight:700},ms=[],hs=(e,t)=>{let n=e.length?Math.min(t,e.length-1):-1,r=[];return e.forEach((e,i)=>{let a=e.getName(),o=e.getRepeatingTypes();if(o){let e=o.length,{base:s,n:c}=Lo(a),l=Math.max(0,t-i),u=c+Math.floor(l/e),d=i===n?l%e:-1,f=(t,n)=>{let r=`${e===1?s:t.getName()}${n}`;return n>c||t.isOptional()?`[${r}]`:r};o.forEach((t,n)=>{r.push({key:`${i}s${n}`,param:t,descKey:e===1?a:`${a}.${t.getName()}`,isRepeat:!1,optional:u>c||t.isOptional(),active:n===d,label:f(t,u),ellipsisBefore:n===0&&u>c})}),r.push({key:`${i}next`,param:o[0],descKey:e===1?a:`${a}.${o[0].getName()}`,isRepeat:!0,optional:!0,active:!1,label:`[${e===1?s:o[0].getName()}${u+1}]`,ellipsisAfter:!0});return}if(e.isRest()){let{base:o,n:s}=Lo(a),c=s+Math.max(0,t-i),l=i===n,u=c>s;r.push({key:`${i}a`,param:e,descKey:a,isRepeat:!1,optional:u,active:l,label:u?`[${o}${c}]`:`${o}${c}`,ellipsisBefore:c>s}),r.push({key:`${i}b`,param:e,descKey:a,isRepeat:!0,optional:!0,active:!1,label:`[${o}${c+1}]`,ellipsisAfter:!0})}else{let t=e.isOptional();r.push({key:`${i}`,label:t?`[${a}]`:a,param:e,descKey:a,isRepeat:!1,optional:t,active:i===n})}}),r},gs=e=>(0,d.jsx)(`button`,{type:`button`,"aria-label":e.label,title:e.label,onMouseDown:e=>e.preventDefault(),onClick:e.onClick,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:20,height:20,padding:0,border:`none`,borderRadius:4,background:`transparent`,color:ls,cursor:`pointer`},onMouseEnter:e=>{e.currentTarget.style.background=`var(--sxl-color-base-hover, rgba(0,0,0,0.08))`},onMouseLeave:e=>{e.currentTarget.style.background=`transparent`},children:e.children}),_s=({up:e})=>(0,d.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,d.jsx)(`path`,{d:e?`M2.5 7.5 L6 4 L9.5 7.5`:`M2.5 4.5 L6 8 L9.5 4.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`,strokeLinejoin:`round`})}),vs=()=>(0,d.jsx)(`svg`,{width:`12`,height:`12`,viewBox:`0 0 12 12`,"aria-hidden":!0,focusable:`false`,children:(0,d.jsx)(`path`,{d:`M2.5 2.5 L9.5 9.5 M9.5 2.5 L2.5 9.5`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.3`,strokeLinecap:`round`})}),ys={number:n.q(`functionPreview.typeName.number`),string:n.q(`functionPreview.typeName.string`),boolean:n.q(`functionPreview.typeName.boolean`),error:n.q(`functionPreview.typeName.error`),richData:n.q(`functionPreview.typeName.richData`),null:n.q(`functionPreview.typeName.null`)},bs=e=>{let t=e.getScalarType();return t&&t!==`*`?ys[t]:n.q(`functionPreview.anyValue`)},xs=e=>{let{param:t,repeat:n=!1,optional:a=!1,showType:o=!0,size:s=15,style:c}=e,l=i.Ot(),u=bs(t),f=u===`functionPreview.anyValue`?l(u):l(`functionPreview.type`,{type:l(u)}),p={color:ls};return(0,d.jsxs)(`span`,{style:{display:`flex`,alignItems:`center`,gap:3,flex:`0 0 auto`,...c},children:[n&&(0,d.jsx)(r.r,{iconKey:`Repeat`,title:l(`functionPreview.repeatable`),size:s,style:p}),a&&(0,d.jsx)(r.r,{iconKey:`DataArray`,title:l(`functionPreview.optional`),size:s,style:p}),o&&(0,d.jsx)(r.r,{iconKey:`DataObject`,title:f,size:s,style:p})]})};xs.displayName=`FunctionArgIcons`;var Ss=({hint:e,wrap:t=!1})=>{let n=hs(e.params,e.argIndex),r=e.argSeparator??`,`,i=[];for(let e of n)e.ellipsisBefore&&i.push({key:`${e.key}-lead`,text:`…`,active:!1}),i.push({key:e.key,text:e.label,active:e.active}),e.ellipsisAfter&&i.push({key:`${e.key}-trail`,text:`…`,active:!1});return(0,d.jsxs)(`span`,{style:{whiteSpace:t?`normal`:`nowrap`,fontFamily:ds,cursor:`default`},children:[(0,d.jsx)(`span`,{style:{fontWeight:600,color:us},children:e.nameLocal??e.name}),`(`,i.map((e,t)=>(0,d.jsxs)(u.Fragment,{children:[t>0?(0,d.jsx)(`span`,{style:{color:ls},children:`${r} `}):null,(0,d.jsx)(`span`,{style:e.active?ps:{color:ls},children:e.text})]},e.key)),`)`]})};Ss.displayName=`FunctionSignature`;var Cs=({hint:e,descriptor:t,showParameters:n=!0})=>{let r=i.Ot(),{name:a,argIndex:o,params:s,warning:c}=e,l=n?hs(s,o):ms,u=!!c&&c.argIndex===o,f=t?.name===a,p=f?t.summary:void 0;return p||l.length!==0?(0,d.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:10,padding:`8px 10px 10px`,fontFamily:fs},children:[p&&(0,d.jsx)(`div`,{style:{color:cs},children:p}),l.length>0&&(0,d.jsx)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:8},children:l.map(e=>{let n=(e=>f?t.params?.[e.descKey]?.description:void 0)(e);return(0,d.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:1,opacity:e.active?1:.6},children:[(0,d.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,d.jsx)(`span`,{style:{fontFamily:ds,fontWeight:e.active?700:600,color:e.active?us:cs,whiteSpace:`nowrap`},children:e.label}),(0,d.jsx)(xs,{param:e.param,repeat:e.isRepeat,optional:e.optional,style:{marginLeft:`auto`}})]}),n&&(0,d.jsx)(`div`,{style:{color:ls},children:n}),e.active&&u&&(0,d.jsx)(`div`,{className:`function-preview-warning`,style:{color:ts},children:r(`functionPreview.enumOutOfSet`,{value:c.value,values:c.values})})]},e.key)})})]}):null};Cs.displayName=`FunctionPreviewContent`;var ws=e=>{let{hint:t,collapsed:n,onToggle:r,onClose:a}=e,o=i.Ot(),s=o(n?`functionPreview.expand`:`functionPreview.collapse`);return(0,d.jsxs)(`div`,{role:`button`,"aria-expanded":!n,onMouseDown:e=>e.preventDefault(),onClick:r,style:{display:`flex`,alignItems:`center`,gap:6,padding:`5px 6px 5px 10px`,cursor:`pointer`,borderBottom:n?`none`:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.12))`},children:[(0,d.jsx)(`div`,{style:{flex:1,minWidth:0,whiteSpace:`nowrap`,overflow:`hidden`,textOverflow:`ellipsis`},children:(0,d.jsx)(Ss,{hint:t})}),(0,d.jsx)(gs,{label:s,onClick:e=>{e.stopPropagation(),r()},children:(0,d.jsx)(_s,{up:!n})}),a&&(0,d.jsx)(gs,{label:o(`functionPreview.close`),onClick:e=>{e.stopPropagation(),a()},children:(0,d.jsx)(vs,{})})]})};ws.displayName=`FunctionPreviewHeader`;var Ts=e=>{let{hint:t,descriptor:n,onClose:r}=e,[a,o]=i.Gt(`editor.functionPreview.collapsed`,!1);return(0,d.jsxs)(`div`,{style:{minWidth:300,maxWidth:460,fontFamily:fs,fontSize:12,lineHeight:`16px`,color:cs},children:[(0,d.jsx)(ws,{hint:t,collapsed:a,onToggle:()=>o(e=>!e),onClose:r}),(0,d.jsx)(`div`,{style:{display:`grid`,gridTemplateRows:a?`0fr`:`1fr`,transition:`grid-template-rows 160ms ease`},children:(0,d.jsx)(`div`,{style:{overflow:`hidden`,minHeight:0},children:(0,d.jsx)(Cs,{hint:t,descriptor:n})})})]})};Ts.displayName=`FunctionPreviewPanel`;var Es=e=>{let{list:t,preview:n}=e;return t&&t.items.length>0?(0,d.jsx)(Io,{items:t.items,selectedIndex:t.selectedIndex,selectedSummary:t.selectedSummary,onSelect:t.onSelect,onHighlight:t.onHighlight}):n?(0,d.jsx)(Ts,{hint:n.hint,descriptor:n.descriptor}):null};Es.displayName=`NamedHintPanel`;var Ds=(e,t)=>{let n=e.getName();return{name:n,nameLocal:o.yt()?.functions?.[n]??n,argSeparator:o.r(t?.locale??`en`).listSeparator,argIndex:t?.argIndex??-1,params:e.getDeclaration().getParameters()}},Os=(e,t)=>({name:e,summary:t.getSummary(),params:t.getParameters(),enums:t.getEnums()}),ks=(e,t,n=1)=>{let r=n;for(let n=0;n<e.length;n++){let i=e[n],a=(i.text??``).length;if(a>0&&t>r&&t<=r+a)return{token:i,start:r,index:n};r+=a}return null},As=e=>{switch(e.type){case`function`:case`named`:case`tableReference`:return!0;case`tableColumn`:case`tableSpecifier`:return!!e.value?.partial;case`parameter`:return!e.value?.declaration;default:return!1}},js=(e,t,n)=>n?{name:e,argIndex:t,bound:n}:{name:e,argIndex:t},Ms=(e,t,n=1)=>{let r=n;for(let n of e){let e=(n.text??``).length;if(e>0&&t>r&&t<=r+e)return n.type===`function`?js(n.value,0,n.context?.bound):n.type===`paren`&&n.text===`)`||n.context?.type===`table`?null:n.type===`separator`&&n.context?.name?js(n.context.name,n.context.argIndex+1,n.context.bound):n.context?.name?js(n.context.name,Math.max(0,n.context.argIndex),n.context.bound):null;r+=e}return null},Ns=(e,t)=>typeof e==`string`?`"${e.replace(/"/g,`""`)}"`:String(e).replace(`.`,t),Ps=e=>e.type===`whitespace`||e.type===`empty`,Fs=(e,t,n)=>{let r=[],i=[],a=n;for(let e of t)i.push(a),a+=(e.text??``).length;let o=a;for(let n=0;n<t.length;n++){let a,s=t[n],c=s.context;if(!c?.name||c.type===`table`)continue;if(s.type===`paren`&&s.text===`(`&&c.argIndex===-1)a=0;else{if(s.type!==`separator`)continue;a=c.argIndex+1}let l=n+1;for(;l<t.length&&Ps(t[l]);)l++;let u=t[l]?.type===`prefix`&&t[l].text===`-`,d=l;u&&l++;let f=t[l];if(!f||f.type!==`number`&&(f.type!==`string`||u)||f.context?.name!==c.name||f.context.argIndex!==a)continue;let p=l+1;for(;p<t.length&&Ps(t[p]);)p++;let m,h=t[p];if(h&&h.type!==`separator`&&(h.type!==`paren`||h.text!==`)`))continue;try{m=e.getFunctions().getByName(c.name)}catch{continue}if(!m||m.isLambda())continue;let g=Bo(m.getDeclaration().getParameters(),a)?.getEnum();if(!g)continue;let _,v=g.getMembers(),y=v.map(e=>e.getValue());if(f.type===`number`){if(g.getScalarType()!==`number`)continue;let e=(u?-1:1)*f.value;_=y.includes(e)}else{if(g.getScalarType()!==`string`)continue;let e=String(f.value).slice(1,-1).replace(/""/g,`"`).toLowerCase();_=y.some(t=>String(t).toLowerCase()===e)}if(_)continue;let b=u?[d,l]:[l];r.push({name:c.name,argIndex:a,tokens:b,text:b.map(e=>t[e].text??``).join(``),argStart:i[n]+(s.text??``).length,argEnd:h?i[p]:o,values:v.filter(e=>!e.isDeprecated()).map(e=>e.getValue())})}return r},Is=(e,t)=>{let n=e.getFunctions().getByName(t.name);if(n&&!n.isLambda())return{fn:n};let r=t.name.toUpperCase(),i=t.bound?.find(e=>e.name.toUpperCase()===r);return i?i.params?{bound:i}:null:n?{fn:n}:null},Ls=e=>{let t=e?.enumOf;return t&&`${t.fn}:${t.id}`},Rs=(e,t,n)=>{let r=t.getEnum();if(!r)return[];let i=e.getName(),a=r.getId(),s=o.r(n??`en`).decimal;return r.getMembers().filter(e=>!e.isDeprecated()).map(e=>{let t=e.getName(),n=e.getValue(),r=Ns(n,s),o={fn:i,id:a,member:t};return t===String(n)?{name:r,kind:`enum`,enumOf:o}:{name:t,detail:r,insert:r,kind:`enum`,enumOf:o}})},zs=e=>({getName:()=>e.name,isOptional:()=>!0===e.optional,isRest:()=>!1,getRepeatingTypes:()=>null,getScalarType:()=>null,getRangeType:()=>null,getLambda:()=>null,getArrayDepth:()=>0,isAcceptError:()=>!1,isNoLift:()=>!1,isNoFilter:()=>!1,isLazy:()=>!1,isValueOrRange:()=>!1,getDefaultValue:()=>{},getEnum:()=>null}),Bs=[[`All`,`all`],[`Data`,`data`],[`Headers`,`headers`],[`Totals`,`totals`]],Vs=e=>{let t=(0,u.useRef)(e);t.current=e;let[n,r]=(0,u.useState)(null),[a,s]=(0,u.useState)(null),[c,l]=(0,u.useState)([]),[f,p]=(0,u.useState)(0),m=(0,u.useRef)(null),[h,g]=(0,u.useState)(null),_=(0,u.useRef)(c);_.current=c;let v=(0,u.useRef)(null),y=(e,t,n)=>{if(v.current!==null){if(v.current===e.text)return null;v.current=null}return((e,t,n)=>{let r=((e,t,n)=>{let r=n;for(let n=0;n<e.length&&!(r>t);n++){let i=e[n],a=(i.text??``).length;if(a===0&&r===t&&As(i))return{token:i,start:r,index:n};r+=a}return null})(e,t,n)??ks(e,t,n);if(!r||!As(r.token))return null;let{token:i,start:a,index:o}=r,s=a+(i.text??``).length;if(i.type===`tableColumn`||i.type===`tableSpecifier`){let t=i.value,n=o-1;for(;n>=0&&(e[n].type!==`paren`||e[n].text!==`[`);)n--;return e[n]?.context?.argIndex===-1?{start:a,end:s,part:t}:{start:a,end:s,part:t,nested:!0}}let c=e[o+1],l=c?.type===`paren`?c.text:void 0;if(l===`(`||i.type===`tableReference`&&l===`[`)return null;let u=i.context?.bound;return u?{start:a,end:s,bound:u}:{start:a,end:s}})(t,n,Ma(e.text))},b=i.X(()=>{let e=t.current,n=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!i||!n)return void r(null);let a=e.getCaret(),s=Ma(e.text);if(y(e,i,a))return void r(null);let c=Ms(i,a,s),l=c?Is(n,c):null;if(!l||!c)return void r(null);let u=o.r(e.getLocale()??`en`).listSeparator,d=c.argIndex;if(`bound`in l){let{name:e,params:t}=l.bound;r(n=>n?.bound&&n.name===e&&n.argIndex===d&&n.params.length===t.length&&n.params.every((e,n)=>e.getName()===t[n].name&&e.isOptional()===(!0===t[n].optional))?n:{name:e,nameLocal:e,argSeparator:u,argIndex:d,params:t.map(zs),bound:!0});return}let f=l.fn,p=f.getName(),m=o.yt()?.functions?.[p]??p,h=Fs(n,i,s).find(e=>e.name===c.name&&e.argIndex===d&&a>=e.argStart&&a<=e.argEnd),g=o.r(e.getLocale()??`en`).decimal,_=h?{argIndex:d,value:h.text,values:h.values.map(e=>Ns(e,g)).join(`${u} `)}:void 0;r(e=>e&&!e.bound&&e.name===p&&e.argIndex===d&&e.warning?.value===_?.value?e:{name:p,nameLocal:m,argSeparator:u,argIndex:d,params:f.getDeclaration().getParameters(),..._?{warning:_}:null})},[]),x=i.X(()=>{let e=t.current,n=()=>{m.current=null,_.current.length&&l([])},r=e.active?e.getCalculation():null,i=e.getTokens();if(!e.active||!r)return void n();let a=e.getArgument?.()??null,s=Ma(e.text);if(a&&e.text.slice(s).trim()===``){let t=Rs(a.fn,a.param,e.getLocale());t.length===0?n():(m.current={start:s,end:e.text.length},Ls(_.current[0])!==Ls(t[0])&&(l(t),p(-1)));return}if(!i)return void n();let c,u=e.getCaret(),d=y(e,i,u),f=d??{start:u,end:u};if(d){let t=e.text.slice(f.start,u);c=d.part?((e,t,n,r={})=>{let i=e.toUpperCase(),a=[],s=o.yt()?.specifiers,c=(e,t)=>{let n=`#`+(s?.[t]?.trim()||e);return{name:n,matches:n.toUpperCase().startsWith(i)||(`#`+e).toUpperCase().startsWith(i)}};try{let e=n.table.toUpperCase(),o=(e?t?.getItems().find(t=>t.getType()===`table`&&t.getName().toUpperCase()===e):null)?.getValue();if(!o)return a;let s=r.home??null,l=o.getRange().getCoords(),u=o.getDataRange().getCoords(),d=s?.getCoords()??null,f=!!d&&o.getSheet()?.getName()===s.getSheet().getName()&&d.rowIndex>=l.rowStart&&d.rowIndex<=l.rowEnd&&d.colIndex>=l.colStart&&d.colIndex<=l.colEnd,p=(e,t)=>e?((e,t,n)=>{try{let{colStart:r,colEnd:i,...a}=t.getCoords(),o={colStart:r,colEnd:i,rowStart:n?.rowStart??a.rowStart,rowEnd:n?.rowEnd??a.rowEnd};return e?vo(e,o,t.getSheet().getName()):t.getSheet().getRange(o).toString()}catch{return}})(s,e,t):void 0,m=d&&d.rowIndex>=u.rowStart&&d.rowIndex<=u.rowEnd?{rowStart:d.rowIndex,rowEnd:d.rowIndex}:void 0;if(n.partial!==`column`){let e=c(`This Row`,`thisRow`);if(e.matches){let t=m?p(o.getDataRange(),m):void 0;a.push(r.nested?{name:e.name,kind:`specifier`,detail:t}:{name:`@ - `+e.name.slice(1),insert:`@`,kind:`specifier`,detail:t})}}if(n.partial!==`specifier`)for(let e of o.getColumns()){let t=e.getName();t.toUpperCase().startsWith(i)&&a.push({name:t,kind:`column`,detail:p(e.getRange(),u)})}if(n.partial===`column`||f)return a;let h={all:o.getRange(),data:o.getDataRange(),headers:o.isShowHeaders()?o.getHeaderRowRange():null,totals:o.isShowTotals()?o.getTotalRowRange():null};for(let[e,t]of Bs){let{name:n,matches:r}=c(e,t);r&&a.push({name:n,kind:`specifier`,detail:p(h[t])})}}catch{}return a})(t,e.getNames?.()??null,d.part,{home:e.getCell?.()??null,nested:d.nested}):((e,t,n,r=[])=>{let i=t.toUpperCase(),a=[],s=[];try{let t=o.yt()?.functions,n=e=>t?.[e]??e,r=e.getFunctions().getItems();s=r.filter(e=>e.isLambda()),a=r.filter(e=>!e.isLambda()).map(e=>({name:n(e.getName()),canonical:e.getName()})).filter(e=>e.name.toUpperCase().startsWith(i)||e.canonical.toUpperCase().startsWith(i)).map(e=>({name:e.name,kind:`function`})).sort((e,t)=>e.name.localeCompare(t.name)).slice(0,50)}catch{a=[]}let c=new Set(a.map(e=>e.name.toUpperCase())),l=(e,t)=>{let n=e.toUpperCase();n.startsWith(i)&&!c.has(n)&&(c.add(n),a.push({name:e,kind:t}))};for(let e of r)l(e.name,e.params?`lambda`:`parameter`);for(let e of s)l(e.getName(),`lambda`);try{for(let e of n?.getItems()??[])l(e.getName(),e.getType()===`table`?`table`:`named`)}catch{}return a.sort((e,t)=>e.name.localeCompare(t.name))})(r,t,e.getNames?.()??null,d.bound)}else c=((e,t,n,r,i)=>{let a=Ms(t,n,r);if(!a||!((e,t,n,r)=>{let i=n;for(let n=0;n<e.length&&i<=t;n++){let a=e[n];if(a.type===`empty`&&a.context?.name===r.name&&a.context.argIndex===r.argIndex){let r=i,a=n+1;for(;a<e.length&&e[a].type===`whitespace`;)r+=(e[a++].text??``).length;if(t>=i&&t<=r){let t=e[a];return!t||t.type===`separator`||t.type===`paren`&&t.text===`)`}}i+=(a.text??``).length}return!1})(t,n,r,a))return[];let o=Is(e,a);if(!o||!(`fn`in o))return[];let s=Bo(o.fn.getDeclaration().getParameters(),a.argIndex);return s?Rs(o.fn,s,i):[]})(r,i,u,Ma(e.text),e.getLocale());if(c.length===0)return void n();m.current=f;let h=_.current;(h.length!==c.length||h.some((e,t)=>e.name!==c[t].name||Ls(e)!==Ls(c[t])))&&(l(c),p(0))},[]),S=i.X(()=>{b(),x()},[]),C=i.X(e=>{let n=t.current,r=m.current;if(!r)return;let i=n.text,a=e.kind??`function`,o=a===`function`||a===`lambda`,s=i[r.end]===`(`,c=(e.insert??e.name)+(o&&!s?`(`:``);a===`column`&&(c=e.name.replace(/['#[\]]/g,`'$&`));let u=i.slice(0,r.start)+c+i.slice(r.end),d=r.start+(o?e.name.length+1:c.length);l([]),v.current=c===`@`?null:u,n.applyText(u,d)},[]),w=i.X(e=>{let t=_.current.length;if(t===0)return!1;switch(e.which){case i.Zt.Down:return e.preventDefault(),e.stopPropagation(),p(e=>(e+1)%t),!0;case i.Zt.Up:return e.preventDefault(),e.stopPropagation(),p(e=>e<=0?t-1:e-1),!0;case i.Zt.Enter:case i.Zt.Tab:return!(T.current<0||(e.preventDefault(),e.stopPropagation(),C(_.current[Math.min(T.current,t-1)]),0));case i.Zt.Escape:return e.preventDefault(),e.stopPropagation(),m.current=null,l([]),!0;default:return!1}},[]),T=(0,u.useRef)(f);T.current=f;let E=i.X(()=>{m.current=null,v.current=null,_.current.length&&l([]),r(null)},[]),D=(0,u.useCallback)(()=>{let e=t.current,n=e.getCaret(),r=e.getTokens();if(!r)return n;let i=Ma(e.text);if(_.current.length>0&&_.current[0].kind!==`enum`){let e=ks(r,n,i);return e?e.start:n}let a=((e,t,n)=>{let r=n,i=[],a=null;for(let n of e){if(r>=t)break;let e=r;n.type===`function`?a=e:n.type===`paren`&&n.text===`(`?(i.push(a??-1),a=null):(n.type===`paren`&&n.text===`)`&&i.pop(),a=null),r=e+(n.text??``).length}for(let e=i.length-1;e>=0;e--)if(i[e]>=0)return i[e];return null})(r,n,i);if(a!==null)return a;let o=ks(r,n,i);return o?o.start:n},[]),O=(n&&!n.bound?n.name:null)??c[0]?.enumOf?.fn??null;(0,u.useEffect)(()=>{if(!O)return void s(null);let e=!1,n=t.current,r=n.getArgument?.()?.fn;return(r?.getName()===O?r:n.getCalculation()?.getFunctions().getByName(O))?.getDescriptor().then(t=>{e||s(Os(O,t))}).catch(()=>{e||s(null)}),()=>{e=!0}},[O]);let k=c[f]??null,A=k?.name??null,j=k?.kind??`function`;(0,u.useEffect)(()=>{if(!A||j===`column`||j===`specifier`||j===`enum`)return void g(null);if(j!==`function`){let e=t.current.getNames?.()?.getItems()??[];g((e=>{if(!e)return null;let t=e.getComment?.();if(t)return t;try{let t=e.getRanges?.()?.toString();if(t)return t}catch{}let n=e.getValue?.();return typeof n==`string`?n:null})(e.find(e=>e.getName()===A)??null));return}let e=!1;return(t.current.getCalculation()?.getFunctions().getByName(A))?.getDescriptor().then(t=>{e||g(t.getSummary())}).catch(()=>{e||g(null)}),()=>{e=!0}},[A,j]);let{hoveredTokenIndex:M,text:N}=e,P=(0,u.useCallback)(()=>{let e=e=>{let t=e.enumOf;if(t&&a?.name===t.fn)return a.enums?.[t.id]?.members[t.member]},r=c.map(t=>{let n=t.insert===void 0?void 0:e(t);return n?{...t,name:n.nameLocal}:t}),i=c[f],o=i?.kind===`enum`?e(i)?.description:h,s=c.length>0?{items:r,selectedIndex:f,selectedSummary:o??void 0,onSelect:C,onHighlight:p}:null,l=t.current.getTokens(),u=M!=null&&l&&n?((e,t,n,r)=>{if(t<0||t>=e.length)return null;let i=n;for(let n=0;n<=t;n++)i+=(e[n].text??``).length;let a=Ms(e,i,n);return a&&a.name===r?a.argIndex:null})(l,M,Ma(N),n.name):null,m=n?{hint:u===null?n:{...n,argIndex:u},descriptor:a}:null;return s||m?(0,d.jsx)(Es,{list:s,preview:m}):null},[c,f,h,n,a,C,M,N]);return{active:!!n||c.length>0,update:S,handleKeyDown:w,dismiss:E,getAnchorOffset:D,renderPanel:P}},Hs={placement:`bottom-start`,followAnchor:!0},Us=e=>{let t=e.getFormulaText({target:`display`});if(t)return t;let n=e.getText({useFormattingCategory:!0})??``;return e.getStyle().getQuotePrefix()?`'`+n:n},Ws=e=>{if(!e||!e.isSpillOverflow())return null;let t=e.getSpill();if(!t)return null;let n=t.getCell(),r=n.getFormulaText({target:`display`});return!r||n.isEqual(e)?null:r},Gs=e=>{let{selection:t,fillNone:r}=e,s=e=>{let{open:s,mode:c,clean:l,dirty:p,token:m,autoFocus:h,initialSelection:g,zoom:_,cellSize:v,readOnly:y,onDirtyChange:b,onModeChange:x,onCommit:S,onCancel:C,onNaturalSize:w,editable:T,placeholder:E,maxContentWidth:D,lineHeight:O}=e,k=l?l():null,A=p??(k?s?Us(k):(e=>{if(e.getSpillKind()!==`fixed`)return Us(e);let t=e.getFormulaText({target:`display`})??e.getSpill()?.getCell().getFormulaText({target:`display`});return t?`{${t}}`:Us(e)})(k):``),j=ja(A),M=Ma(A),N=(0,u.useRef)(null),P=(0,u.useRef)(null),F=Jr(N,A),I=(0,u.useRef)(k);I.current=k;let[L,R]=(0,u.useState)(!1),[z,B]=(0,u.useState)(0),[V,H]=(0,u.useState)(void 0),[U,W]=(0,u.useState)(null),[G,K]=(0,u.useState)(0),q=(0,u.useRef)(null),J=(0,u.useRef)(null),Y=(0,u.useRef)(!1),ee=(0,u.useRef)(null),X=Za(),te=X.getMode(),ne=te?.dragging??!1,re=te?.draggingIndex??null,[ie,ae]=(0,u.useState)(null),[oe,se]=(0,u.useState)(null),ce=(0,u.useRef)(null),le=(0,u.useRef)(ie);le.current=ie;let ue=k?.getType(),Z=(ue===a.t.Number||ue===a.t.Null)&&k.getStyle().getNumberFormat().includes(`%`),de=e=>{if(!Z)return null;let t=e.replace(/%/g,``);return t.length===0||isNaN(Number(t))?null:{value:t+`%`,caret:t.length}},Q=(0,u.useRef)(0);(0,u.useLayoutEffect)(()=>{if(!s||!h)return;let e=N.current;if(!e||(e.focus(),Q.current===m))return;Q.current=m;let t=de(A);if(t&&t.value!==A)return F(t.caret),void b(t.value);let n=e.value.length,r=X.getMode()?.selection?.getCoords()?.rangeIndex??-1,i=r>=0&&tt?Pa(tt.tokens,r,M):null,a=i?{start:i.end,end:i.end,direction:`forward`}:g??{start:n,end:n,direction:`forward`};e.setSelectionRange(a.start,a.end,a.direction)},[m,s,h]);let fe=k?k.getStyle():null,pe=fe?fe.getFont():null,me=pe?pe.toCSS(`adaptive`,_):{},he=pe?pe.toCSS(`adaptive`,1):{};r&&(he.color=`inherit`,he.fontStyle=`inherit`,he.fontWeight=`inherit`,he.textDecoration=`inherit`,me.color=`inherit`,me.fontStyle=`inherit`,me.fontWeight=`inherit`,me.textDecoration=`inherit`);let ge=(k&&A[0]!==`=`?o.Y.toCSSHorizontalTextAlign(k.getRenderHorizontalAlignment()):`left`)??`left`,_e=fe?.getAlignment(),ve=_e?.getOverflow()===o.Y.Overflow.Wrap,ye=_e?(e=>{switch(e){case o.Y.VerticalAlignment.Center:return`center`;case o.Y.VerticalAlignment.Bottom:return`flex-end`;default:return`flex-start`}})(_e.getVertical()):`flex-start`,be=!!v,xe=(ve||!be)&&!j,Se=j,Ce=be&&k&&v?k.getTextPlacement(v):null,we=k?k.getInsets():null,Te=Ce?.lineHeight??O,Ee=L?Math.min(G,A.length):A.length,De=j&&Aa(A,Ee),Oe=De&&Ee>=A.length;(0,u.useLayoutEffect)(()=>{let e,t,n=we?we.left+we.right:4;if(xe){let n=N.current;if(!n)return;let r=n.style.height;n.style.height=`auto`,t=n.scrollHeight/_,n.style.height=r,e=0}else{let r=P.current;if(!r)return;t=r.offsetHeight,e=r.offsetWidth+n}B(t),w?.({width:e,height:t})},[A,xe,_,w,we?.left,we?.right,Se,D,Oe]);let ke=Yr({mode:c,value:A,onDirtyChange:b,onModeChange:x,onCommit:S,onCancel:C,onNavigate:e=>{t.navigate(e)},onTraverse:(e,n)=>{t.traverse(e,n)},setCaret:F}),Ae=(0,u.useRef)(b);Ae.current=b;let je=(0,u.useRef)(null);je.current||={insertText:e=>{let t=N.current;if(!t)return;let n=t.selectionStart??t.value.length,r=t.selectionEnd??t.value.length;Ae.current(t.value.slice(0,n)+e+t.value.slice(r));let i=n+e.length;requestAnimationFrame(()=>t.setSelectionRange(i,i))},selectAll:()=>{N.current?.select()},setSelection:e=>{N.current?.setSelectionRange(e.start,e.end,e.direction??`forward`)},focus:()=>{N.current?.focus()},toggleReferences:()=>{let e=N.current,t=I.current;if(!e||!t)return;let n=e.value,r=e.selectionStart??n.length;Ia(t.getSheet().getCalculation(),n,r,Ue(t)).then(t=>{t&&(Ae.current(t.value),requestAnimationFrame(()=>e.setSelectionRange(t.caret,t.caret)))})}};let Me=Vs({text:A,getTokens:()=>nt.current?.tokens??null,active:L,getCaret:()=>N.current?.selectionStart??N.current?.value.length??0,getCalculation:()=>I.current?.getSheet().getCalculation()??null,getNames:()=>I.current?.getSheet().getNames()??null,getCell:()=>I.current??null,getLocale:()=>I.current?.getSheet().getWorkbook()?.getLocale()??null,applyText:(e,t)=>{Ae.current(e),requestAnimationFrame(()=>N.current?.setSelectionRange(t,t))},hoveredTokenIndex:ie?.ti??null}),{caretAnchor:Ne}=i.ft(N),Pe=(0,u.useMemo)(()=>Ne(Me.getAnchorOffset,0),[Ne,Me.getAnchorOffset]),Fe=(0,u.useRef)(null),Ie=(0,u.useCallback)(e=>!!Fe.current?.contains(e),[]),Le=i.R({label:`formula-editor-hint`,anchor:Pe,autoFocus:!1,disableClickAway:Ie,propsPopper:Hs,createPopupPanel:Me.renderPanel}),Re=Le.reference,ze=Me.active&&!X.getMode()?.dragging;(0,u.useEffect)(()=>{ze?Re.open(0):Re.close(0)},[ze,Re]);let Be=i.Ct(),Ve=(0,u.useRef)(Be);Ve.current=Be;let He=()=>{if(T)return T.getSession();let e=Ve.current.getMode();return e?.key===`edit`?e.args.editable.getSession():null},Ue=e=>({...e.getCoords(),scope:He()?.getCoords().scope??e.getSheet().getName()}),We=X.getMode(),Ge=We?.selection??null,Ke=!!We&&We.activeInput===je.current;(0,u.useEffect)(()=>{if(s)return He()?.registerEditor(je.current)},[s,m]),(0,u.useEffect)(()=>{L&&He()?.setActiveEditor(je.current)},[L,s,m]);let qe,Je=_e?.getVertical(),Ye=Ce?.bounds.y??we?.top??0,Xe=Ce?Ce.bounds.y+Ce.bounds.height:null,Ze=Ce&&Je===o.Y.VerticalAlignment.Top?Ye:we?.top??0;qe=Xe!==null&&Je===o.Y.VerticalAlignment.Bottom?Xe:Xe!==null&&Je===o.Y.VerticalAlignment.Center?Xe+(Ye-Ze):v?v.height-(we?.bottom??0)+2:0;let Qe=!z||z<=qe-Ze,$e=be?{position:`absolute`,left:(we?.left??0)*_,top:Ze*_,right:(we?.right??0)*_,height:Math.max(0,qe-Ze)*_,display:`flex`,flexDirection:`column`,justifyContent:Qe?ye:`flex-start`}:{position:`absolute`,inset:0,display:`flex`,flexDirection:`column`,justifyContent:`flex-start`},et=(0,u.useRef)(null),tt=(0,u.useMemo)(()=>{let e=I.current;if(!e||!j)return null;try{let t=e.getSheet().getCalculation().createFormula(A,Ue(e),{target:`display`}),n=t.getTokens();if(n.length===0)return{tokens:[],ranges:[],valid:!1};let r=[];try{let i=t.getReferences(),a=He()?.getCoords().scope??e.getSheet().getName();r=i?i.getCoords().map(e=>e?{rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowEnd,colEnd:e.colEnd,scope:e.scope??a}:null):[],r=Co(e.getSheet(),n,r)}catch{}return{tokens:n,ranges:r,valid:t.isValid()}}catch{return{tokens:[],ranges:[],valid:!1}}},[A]),nt=(0,u.useRef)(tt);nt.current=tt;let rt=(0,u.useMemo)(()=>tt&&tt.tokens.map(e=>e.text??``).join(``)===A.slice(M)?tt.tokens:null,[tt,A,M]),it=!!rt,at=(0,u.useMemo)(()=>is(rt??null),[rt]),ot=(0,u.useMemo)(()=>{let e=I.current?.getSheet().getCalculation();return rt&&e?new Set(Fs(e,rt,M).flatMap(e=>e.tokens)):new Set},[rt,M]),st=(0,u.useMemo)(()=>ss(ie?{lo:ie.lo,hi:ie.hi}:null,U,at),[U,ie,at]),ct=i.X(()=>{let e=N.current?.selectionStart??A.length;K(e);let t=rt;if(!t)return H(void 0),void W(null);let n=Ma(A),r=((e,t,n)=>{let r=n;for(let n=0;n<e.length;n++){let i=(e[n].text??``).length;if(t>=r&&t<=r+i)return n;r+=i}return-1})(t,e,n);H(r>=0?Na(t[r]):void 0);let i=L?as(t,at.matchOf,e,n):null;W(e=>os(e,i)?e:i)},[rt,A,L,at]);(0,u.useEffect)(()=>{ct()},[ct,rt,L]);let lt=i.X(()=>{ce.current=null,ae(null)},[]),ut=i.X(()=>{le.current?.fromSelection||lt()},[]),dt=no(()=>lt(),()=>mt()),ft=i.X(e=>{let t=et.current;if(!it||!tt||!t)return void lt();if(dt.blocksHover(e)||ro(N.current))return void ut();let n=e.clientX,r=e.clientY,i=t.querySelectorAll(`[data-ti]`),a=-1,o=null;for(let e=0;e<i.length;e++){let t=i[e].getBoundingClientRect();if(n>=t.left&&n<=t.right&&r>=t.top&&r<=t.bottom){a=Number(i[e].getAttribute(`data-ti`)),o=t;break}}let s=tt.tokens;if(a<0){let e=t.querySelector(`[data-eq]`),i=e?.getBoundingClientRect();if(!e||!i||n<i.left||n>i.right||r<i.top||r>i.bottom)return void lt();let a=oo(s);if(!a)return void lt();let o=a.hi;if(ce.current===`root`)return;ce.current=`root`;let c=t.querySelector(`[data-ti="${o}"]`)?.getBoundingClientRect(),l=c&&Math.abs(c.top-i.top)<1?{left:i.left,right:c.right,top:i.top}:{left:i.left,right:i.right,top:i.top};ae({rect:l,evalIndex:0,ti:-1,lo:0,hi:o,overEq:!0});return}let c=s[a];if(!c||c.type===`whitespace`)return void lt();let l=io(s,a);if(!l){if(Go.has(c.type)&&c.text){let e=`literal:${a}`;if(e===ce.current)return;if(ce.current=e,!o)return void lt();let t={left:o.left,right:o.right,top:o.top};ae({rect:t,evalIndex:-1,ti:a,lo:a,hi:a,literal:c.text})}else lt();return}let u=`${l.evalIndex}:${l.lo}:${l.hi}`;if(u===ce.current)return;ce.current=u;let d=t.querySelector(`[data-ti="${l.lo}"]`),f=t.querySelector(`[data-ti="${l.hi}"]`),p=d?.getBoundingClientRect(),m=f?.getBoundingClientRect(),h=p&&m&&Math.abs(m.top-p.top)<1?{left:p.left,right:m.right,top:p.top}:o?{left:o.left,right:o.right,top:o.top}:null;h?ae({rect:h,evalIndex:l.evalIndex,ti:a,lo:l.lo,hi:l.hi}):lt()},[it,tt]),pt=i.X(e=>{let t=I.current;if(!t)return!1;try{return t.getSheet().getCalculation().createFormula(`=`+e,Ue(t),{target:`display`}).isValid()}catch{return!1}},[]),mt=i.X(()=>{let e=()=>{le.current?.fromSelection&&lt()},t=N.current,n=et.current;if(!(t&&n&&it&&tt&&L))return void e();if(dt.isDragging())return;let r=t.selectionStart??0,i=t.selectionEnd??0;if(r===i)return void e();let a=ao(tt.tokens,M,A,r,i,pt);if(!a)return void e();let o=`sel:${a.lo}:${a.hi}:${a.fragment??a.evalIndex}`;if(o===ce.current)return;ce.current=o;let s=n.querySelector(`[data-ti="${a.lo}"]`)?.getBoundingClientRect(),c=n.querySelector(`[data-ti="${a.hi}"]`)?.getBoundingClientRect(),l=s&&c&&Math.abs(c.top-s.top)<1?{left:s.left,right:c.right,top:s.top}:s?{left:s.left,right:s.right,top:s.top}:null;l?ae({rect:l,ti:-1,lo:a.lo,hi:a.hi,fromSelection:!0,evalIndex:a.fragment===null?a.evalIndex:-1,literal:a.fragment??void 0}):lt()},[it,tt,M,A,L]);(0,u.useEffect)(()=>{L||lt()},[L,lt]);let ht=ie?.evalIndex??null,gt=ie?.literal??null;(0,u.useEffect)(()=>{let e=I.current;if(!e||gt===null&&(ht===null||!ja(A)))return void se(null);let t=!1;try{let n=e.getSheet().getCalculation(),r=gt===null?n.createFormula(A,Ue(e),{target:`display`}):n.createFormula(`=`+gt,Ue(e),{target:`display`});Promise.resolve(gt===null?r.evaluate({evalIndex:ht}):r.evaluate()).then(e=>{t||se(po(e))}).catch(()=>{t||se(null)})}catch{se(null)}return()=>{t=!0}},[ht,gt,A]),(0,u.useEffect)(()=>{lt()},[A,lt]),(0,u.useLayoutEffect)(()=>{let e=J.current;if(e)return J.current=null,q.current=null,void N.current?.setSelectionRange(e.start,e.end);let t=q.current;t!==null&&(q.current=null,N.current?.setSelectionRange(t,t))},[A]);let _t=i.X((e,t)=>{let n=I.current;if(n&&ja(A))try{let r=n.getSheet().getCalculation().createFormula(A,Ue(n),{target:`display`}),i=Ma(A),a=Pa(r.getTokens(),e,i);if(!a)return;let o=Fa(r.getTokens(),e)?void 0:r.getReferences()?.getCoords()?.[e],s={colStart:t.colStart,rowStart:t.rowStart,colEnd:t.colEnd,rowEnd:t.rowEnd,$colStart:o?.$colStart,$rowStart:o?.$rowStart,$colEnd:o?.$colEnd,$rowEnd:o?.$rowEnd},c=yo(n,t)??So(n,t,s)??vo(n,s,t.scope),l=A.slice(0,a.start)+c+A.slice(a.end);if(l!==A){let e=l.length-A.length,t=L?N.current?.selectionStart??A.length:null;q.current=t===null||t>=a.start&&t<=a.end?a.end+e:t<=a.start?t:t+e}Ae.current(l)}catch{}},[A]),vt=i.X(e=>{let t=I.current;if(t&&ja(A))try{let n,r=yo(t,e)??So(t,e)??vo(t,{colStart:e.colStart,rowStart:e.rowStart,colEnd:e.colEnd,rowEnd:e.rowEnd},e.scope);if(L)n={start:N.current?.selectionStart??A.length,end:N.current?.selectionEnd??A.length};else{let e=ee.current;n=e!==null&&e<=A.length?{start:e,end:e}:{start:A.length,end:A.length}}if(tt&&n.start===n.end){let e=Ma(A),t=e;for(let r of tt.tokens){let i=(r.text??``).length;if(r.referenceIndex!==void 0&&n.start>=t&&n.start<=t+i){let t=Pa(tt.tokens,r.referenceIndex,e);t&&(n={start:t.end,end:t.end});break}t+=i}}let i=(n.start>0&&!`/*^&<>=:,+-@( `.includes(A[n.start-1])?`,`:``)+r,a=A.slice(0,n.start)+i+A.slice(n.end);q.current=n.start+i.length,L||(ee.current=n.start+i.length),Ae.current(a)}catch{}},[A,L,tt]),yt=(0,u.useRef)(0);yt.current=tt?.ranges.length??0;let bt=i.X(()=>{let e=X.getMode();if(!e||e.activeInput!==je.current||!L)return;let t=e.selection,r=I.current,i=tt?.ranges??null,a=N.current?.selectionStart??A.length,o=-1;if(i&&tt){let e=Ma(A);for(let t of tt.tokens){let n=(t.text??``).length;if(t.referenceIndex!==void 0&&a>=e&&a<=e+n){o=t.referenceIndex;break}e+=n}o>=i.length&&(o=-1),o>=0&&!i[o]&&(o=-1)}let s=o>=0,c=j&&Aa(A,a)&&!s&&!!tt,l=c||s&&!!tt;ee.current=c?a:null;let u,d=i??[],f=r?{rowIndex:r.getCoords().rowIndex,colIndex:r.getCoords().colIndex,scope:r.getSheet().getName()}:n.d.EmptyCell;if(c)u={cell:f,ranges:d,rangeIndex:-1};else if(d.some(Boolean)){let e=(o>=0?d[o]:null)??d.find(Boolean);u={cell:{rowIndex:e.rowStart,colIndex:e.colStart,scope:e.scope},ranges:d,rangeIndex:o}}else u={cell:f,ranges:n.d.EmptyRanges,rangeIndex:-1};Y.current=!0;try{t.updateCoords(u)}finally{Y.current=!1}let p=l?`point`:`show`;e.mode!==p&&X.setMode(e=>e&&e.mode!==p?{...e,mode:p}:e)},[tt,A,c,L]),xt=Be.getMode()?.key??null;(0,u.useEffect)(()=>{bt(),Me.update()},[bt,Me.update,tt,L,A,s,xt,c,Ke,Ge]),(0,u.useEffect)(()=>{L&&We&&We.activeInput!==je.current&&X.setMode(e=>e&&{...e,activeInput:je.current})},[L,We]),(0,u.useEffect)(()=>{s&&We&&!We.activeInput&&X.setMode(e=>e&&!e.activeInput?{...e,activeInput:je.current}:e)},[s,We]),(0,u.useEffect)(()=>{s||(ee.current=null)},[s]),(0,u.useEffect)(()=>()=>{X.setMode(e=>e&&e.activeInput===je.current?{...e,activeInput:null}:e)},[]),(0,u.useEffect)(()=>{if(Ke&&Ge)return Ge.addListeners({onChange:e=>{if(Y.current||ho())return;let t=e.getCoords(),n=t.rangeIndex??-1;n<0||!t.ranges||n>=t.ranges.length||(n<yt.current?_t(n,t.ranges[n]):vt(t.ranges[n]))}})},[Ke,Ge,_t,vt]);let St=me.color,Ct=be?0:2,wt={boxSizing:`border-box`,paddingTop:0,paddingBottom:0,paddingLeft:Ct,paddingRight:it&&Oe?`calc(${Ct}px + ${Uo})`:Ct,margin:0,whiteSpace:xe||Se?`pre-wrap`:`pre`,wordBreak:Se?`break-all`:xe?`break-word`:`normal`,textAlign:ge,...me,...Te?{lineHeight:Te*_+`px`}:null};return(0,d.jsxs)(`div`,{ref:Fe,style:{position:`relative`,flex:`1 1 100%`,minWidth:0},onMouseDown:e=>{let t=N.current;if(!t||e.target===t||!Ie(e.target))return;e.preventDefault();let n=t.getBoundingClientRect(),r=e.clientY<n.top?0:t.value.length;t.focus(),t.setSelectionRange(r,r),c!==`edit`&&x(`edit`)},onPointerDown:e=>{e.stopPropagation()},children:[(0,d.jsx)(`div`,{style:$e,children:(0,d.jsxs)(`div`,{style:{position:`relative`,flex:be?`0 0 auto`:`1 1 100%`,width:`100%`,minWidth:0,...fe&&!r?fe.getFill()?.toCSS(`adaptive`):n.I.EmptyObject},children:[!!E&&!A&&(0,d.jsx)(`div`,{"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...wt,color:St,opacity:.55},children:E}),it&&(0,d.jsxs)(`div`,{ref:et,"aria-hidden":!0,style:{position:`absolute`,inset:0,overflow:`hidden`,pointerEvents:`none`,...wt},children:[(()=>{let e=ne&&re!==null&&rt.some(e=>e.referenceIndex===re),t=De&&!Oe?Ee:-1,n=M,r=rt.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=M===1?(0,d.jsx)(`span`,{"data-eq":!0,style:{color:St,opacity:e?.5:void 0},children:`=`},`eq`):null,a=rt.map((n,i)=>{let a,o=at.unmatched.has(i),s=st.has(i),c=at.depthOf.get(i),l=o||c===void 0||n.referenceIndex!==void 0?void 0:Zo(c),u=o?es:l??Na(n),f=e&&n.referenceIndex!==re;(u||s||o||f)&&(a={},u&&(a.color=u),o&&(a.fontWeight=`bold`),f&&(a.opacity=.5),s&&(a.color=`transparent`)),ot.has(i)&&(a={...a,...ns});let p=n.text??``,m=t>=r[i]&&t<r[i]+p.length;return(0,d.jsxs)(`span`,{"data-ti":i,style:a,children:[s&&(0,d.jsx)(`span`,{"aria-hidden":!0,style:Qo,children:(0,d.jsx)(`span`,{style:$o(u??St??`inherit`),children:n.text})}),m?(0,d.jsxs)(d.Fragment,{children:[p.slice(0,t-r[i]),(0,d.jsx)(Wo,{}),p.slice(t-r[i])]}):p]},i)});if(!ie)return(0,d.jsxs)(d.Fragment,{children:[i,a]});let{lo:o,hi:s,overEq:c}=ie,l=ie.fromSelection?Jo:qo,u=[...c||!i?[]:[i],...a.slice(0,o)],f=[...c&&i?[i]:[],...a.slice(o,s+1)],p=a.slice(s+1);return(0,d.jsxs)(d.Fragment,{children:[u,(0,d.jsx)(`span`,{className:`formula-eval-run`,style:l,children:f},`eval-run`),p]})})(),Oe&&(0,d.jsx)(Wo,{})]}),(0,d.jsx)(`textarea`,{ref:N,value:A,spellCheck:!1,autoComplete:`off`,autoCapitalize:`off`,name:`cell-editor`,readOnly:y,style:{position:`relative`,display:`block`,width:`100%`,height:be?z?z*_:void 0:`100%`,border:`none`,outline:`none`,resize:`none`,overflow:`hidden`,background:`transparent`,userSelect:`text`,...wt,color:St,...it?{WebkitTextFillColor:`transparent`}:null,caretColor:V??`auto`,...ie&&!ie.fromSelection?{[i.Q]:`transparent`}:null},onChange:e=>{let t=de(e.target.value);if(t)return requestAnimationFrame(()=>N.current?.setSelectionRange(t.caret,t.caret)),void b(t.value);b(e.target.value)},onSelect:()=>{bt(),Me.update(),ct(),mt()},onScroll:e=>{let t=et.current;t&&(t.scrollTop=e.currentTarget.scrollTop,t.scrollLeft=e.currentTarget.scrollLeft,lt(),mt())},onMouseMove:ft,onMouseLeave:ut,onDragStart:dt.onDragStart,onPointerDown:e=>{e.stopPropagation(),dt.begin(e),ze&&!Le.isOpen&&Re.open(0),c!==`edit`&&x(`edit`)},onKeyDown:e=>{if(!Me.handleKeyDown(e))return e.which===i.Zt.Escape&&Le.isOpen?(e.preventDefault(),e.stopPropagation(),void Re.close(0)):void((e=>{if(e.which!==i.Zt.F9||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return!1;let t=N.current,n=I.current;if(!t||!n||y||!j||!tt||tt.tokens.length===0)return!1;let r,a=t.selectionStart??0,s=t.selectionEnd??0;if(a!==s)r=ao(tt.tokens,M,A,a,s,pt);else{let e=oo(tt.tokens);r=e?{...e,...so(tt.tokens,M,e.lo,e.hi),fragment:null}:null}if(!r)return!1;e.preventDefault(),e.stopPropagation();let c=A,l=n.getSheet().getCalculation(),u=Ue(n),d=co(o.r(n.getSheet().getWorkbook()?.getLocale()??null??`en`).decimal),f=o.yt(),p={t:f?.booleans?.true??`TRUE`,f:f?.booleans?.false??`FALSE`};return(async()=>{let e=null,t=``;try{if(e=uo(r.fragment===null?await l.createFormula(c,u,{target:`display`}).evaluate({evalIndex:r.evalIndex}):await l.createFormula(`=`+r.fragment,u,{target:`display`}).evaluate(),d,p),e===null||(t=c.slice(0,r.start)+e+c.slice(r.end),!l.createFormula(t,u,{target:`display`}).isValid()))return}catch{return}let n=N.current;n&&n.value===c&&(J.current={start:r.start,end:r.start+e.length},i.kt.replaceRangeText(n,r.start,r.end,e))})(),!0})(e)||(e=>{if(c===`edit`||!Ke||!We)return!1;let t=I.current?.getSheet(),n=(t?.getWorkbook()?.getSelectedSheet()??t)?.getName();return!!n&&go(e,We,n)})(e)||ke(e))},onFocus:()=>{R(!0),He()?.setActiveEditor(je.current)},onBlur:e=>{let t=Re.floatElement?.();t&&e.relatedTarget instanceof Node&&t.contains(e.relatedTarget)||R(!1)}})]})}),(0,d.jsxs)(`div`,{ref:P,"aria-hidden":!0,style:{position:`absolute`,top:0,left:0,visibility:`hidden`,pointerEvents:`none`,whiteSpace:`pre`,...he,...Te?{lineHeight:`${Te}px`}:null,...Se&&D!==void 0?{whiteSpace:`pre-wrap`,wordBreak:`break-all`,width:`max-content`,maxWidth:Math.max(1,D-(we?we.left+we.right:4))}:null},children:[(()=>{if(A.length===0)return` `;if(A.endsWith(`
6
+ `))return A+` `;if(!it||Oe)return A;let e=(A.codePointAt(A.length-2)??0)>65535?2:1;return(0,d.jsxs)(d.Fragment,{children:[A.slice(0,-e),(0,d.jsx)(`span`,{style:{display:`inline-block`,minWidth:Uo},children:A.slice(-e)})]})})(),it&&Oe&&(0,d.jsx)(`span`,{style:{display:`inline-block`,width:`0.6em`,marginLeft:`1px`}})]}),!1,Le.component,ie&&oe!==null&&(0,f.createPortal)((0,d.jsx)(`div`,{"aria-hidden":!0,style:{...to,left:(ie.rect.left+ie.rect.right)/2,top:ie.rect.top-6},children:oe}),document.body)]})};return s.displayName=`SheetCellInput`,s};function Ks(e,t,n={}){let{mode:r=`edit`,initialSelection:i}=n;e.startEdit(e.getAnchor().getCoords(),{dirty:t,mode:r,initialSelection:i})}function qs(e,t){let n=e.getSession()?.getActiveEditor();return!!n&&(n.insertText(t),!0)}function Js(e,t,n,r){let{autoRange:i,direction:o}=function(e){let t=e.getSelectedCell().getCoords(),n=null,r=0,i=t.rowIndex>0?e.getRange({rowIndex:t.rowIndex,colIndex:t.colIndex}).getExtended(a.l.Direction.Up):null;i&&e.getRange({colStart:t.colIndex,rowStart:i.getCoords().rowStart,colEnd:t.colIndex,rowEnd:i.getCoords().rowStart}).isContentful()&&(n=a.l.Direction.Up,r=t.rowIndex-i.getCoords().rowEnd);let o=t.colIndex>0?e.getRange({rowIndex:t.rowIndex,colIndex:t.colIndex-1}).getExtended(a.l.Direction.Left):null;if(o&&e.getRange({colStart:o.getCoords().colStart,rowStart:t.rowIndex,colEnd:o.getCoords().colStart,rowEnd:t.rowIndex}).isContentful()){let e=t.colIndex-o.getCoords().colEnd;(e<r||!n)&&(n=a.l.Direction.Left,r=e)}let s=null;if(n===a.l.Direction.Up&&i){if(s={...i.getCoords()},(s.rowEnd===t.rowIndex||!e.getRange({colIndex:t.colIndex,rowIndex:t.rowIndex-1}).isContentful())&&s.rowStart>0&&e.getRange({colIndex:t.colIndex,rowIndex:s.rowStart-1}).isContentful()){let e=i.getExtended(a.l.Direction.Up);s={colStart:t.colIndex,rowStart:e.getCoords().rowStart,colEnd:t.colIndex,rowEnd:i.getCoords().rowEnd}}s.rowEnd=t.rowIndex-1}else if(n===a.l.Direction.Left&&o){if(s={...o.getCoords()},(s.colEnd===t.colIndex||!e.getRange({colIndex:t.colIndex-1,rowIndex:t.rowIndex}).isContentful())&&s.colStart>0&&e.getRange({colIndex:s.colStart-1,rowIndex:t.rowIndex}).isContentful()){let e=o.getExtended(a.l.Direction.Left);s={colStart:e.getCoords().colStart,rowStart:t.rowIndex,colEnd:e.getCoords().colEnd,rowEnd:t.rowIndex}}s.colEnd=t.colIndex-1}return{autoRange:s,direction:n}}(t),s=t.getSelectedRange();if(r===`caret`||s.size===1||!o||!i){let a=i?t.getRange(i).toString():``,o=`=${n}(`,s=`${o}${a})`;r===`caret`?qs(e,s):Ks(e,s,{mode:`edit`,initialSelection:{start:o.length,end:o.length+a.length}});return}let{rowStart:c,rowEnd:l,colStart:u,colEnd:d}=s.getCoords(),f=o===a.l.Direction.Up;s.doBatch(async()=>{let e=s.createSparseBuilder({axis:a.l.Axis.Column}),r={...i};for(let a=u;a<=d;a++){r.colStart=f?a:i.colStart+(a-u),r.colEnd=f?a:i.colEnd+(a-u);for(let o=c;o<=l;o++)r.rowStart=f?i.rowStart+(o-c):o,r.rowEnd=f?i.rowEnd+(o-c):o,e.pushAt(o,a,`=${n}(${t.getRange(r).toString()})`)}e.apply()})}var Ys=[[`insertFunctionSum`,`SUM`],[`insertFunctionAverage`,`AVERAGE`],[`insertFunctionCount`,`COUNT`],[`insertFunctionMax`,`MAX`],[`insertFunctionMin`,`MIN`]];function Xs(e,t){let{editable:n,sheet:r,flavor:i}=t,a=e=>{e!=null&&(i===`caret`?qs(n,e):Ks(n,e))};e.updateCommand(`insertCurrentTime`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:o.h.nowWithPrecision(),style:{numberFormat:`Medium Time`}}).getText())}),e.updateCommand(`insertCurrentDate`,{tags:[`noTransaction`],callback:()=>a(r.createCell({value:o.h.nowWithPrecision(),style:{numberFormat:`Short Date`}}).getText())}),e.updateCommand(`insertValueAbove`,{tags:[`noTransaction`],callback:()=>{let e=r.getSelectedCell().getCoords();if(!e||e.rowIndex<=0)return;let t=r.getRange({rowIndex:e.rowIndex-1,colIndex:e.colIndex}).getCell();if(!t)return;let n=t.getFormulaText({target:`display`});a(n??t.getText({useFormattingCategory:!0}))}});for(let[t,a]of Ys)e.updateCommand(t,{tags:[`noTransaction`],callback:()=>Js(n,r,a,i)});return()=>{}}function Zs(e,t){let{editable:n,sheet:r,active:i=!0}=t;if(!i)return()=>{};let a=Xs(e,{editable:n,sheet:r,flavor:`caret`}),o=function(e,t){let{editable:n}=t;return e.updateCommand(`relativeReferencesToggle`,{callback:()=>{(n.getSession()?.getActiveEditor())?.toggleReferences()}}),e.updateCommand(`toggleEditorFocus`,{callback:()=>{let e=n.getSession();if(!e)return;let t=e.getEditors();if(t.length<2)return;let r=e.getActiveEditor();t[((r?t.indexOf(r):-1)+1)%t.length]?.focus()}}),()=>{}}(e,{editable:n});return()=>{a(),o()}}var Qs=async(e,t)=>{let r=[];for(let e of t)e.hasPassword()&&!e.isUnlocked()&&r.push(e);return r.length===0||!!e?.showInput&&(await e.showInput({title:n.r(`dialog.unlockRange.title`),description:r.length===1?n.r(`dialog.unlockRange.description`,{name:r[0].getName()}):n.r(`dialog.unlockRange.descriptionMany`),inputType:`password`,options:[{id:`Unlock`,label:()=>n.r(`dialog.unlock`)},`Cancel`],defaultOption:`Unlock`,cancelOption:`Cancel`,onValidateInput:async(e,t)=>{if(t!==`Unlock`)return{valid:!0};if(!e)return{valid:!1,message:n.r(`dialog.password.required`)};let i=!1;for(let t of r)await t.unlock(e)&&(i=!0);return i?{valid:!0}:{valid:!1,message:n.r(`dialog.password.incorrect`)}}}))?.option===`Unlock`},$s=e=>{let t=i.ot(),n=i.Ot(),r=(0,u.useRef)(!1);return(0,u.useEffect)(()=>{r.current=!1},[e]),i.X((a,o)=>{if(e.getProtection().isLocked()){if(a){let n=e.getProtectedRanges().getItems({address:{rowIndex:a.rowIndex,colIndex:a.colIndex}}).filter(e=>e.hasPassword()&&!e.isUnlocked());if(n.length>0)return void Qs(t,n).then(e=>{e&&o?.()})}if(r.current)return;r.current=!0,t?.showMessage?.(n(`error.sheet.protectedSheet`),{type:i.rt.Error});return}a&&e.getRange({rowIndex:a.rowIndex,colIndex:a.colIndex}).getCell().getSpillKind()===`fixed`&&t?.showMessage?.(n(`error.sheet.changePartOfArray`),{type:i.rt.Error})},[e,t])},{CommandScopeProvider:ec}=i.Jt,tc=Object.freeze({x:0,y:0,width:0,height:0}),nc=({alignWidth:e,children:t})=>{let n=g(),r=e/i.kt.getDevicePixelRatio();return(0,d.jsx)(`div`,{style:n?{position:`absolute`,left:n.x-r,top:n.y-r,width:n.width,height:n.height,display:`flex`}:{position:`absolute`,inset:0,display:`flex`},children:t})};function rc(e){let{sheet:t,editable:n,darkMode:r,alignment:a,alignWidth:s=2,zIndex:c,onEditRejected:l,className:f,style:p,...m}=e,h=de(),g=$s(t),_=l??g,v=(0,u.useMemo)(()=>Gs({selection:t.getSelection()}),[t]),y=i.$(n,e=>e.getSession()),b=i.in(y,e=>e.getState()),x=!b||!b.coords.scope||b.coords.scope===t.getName(),S=(0,u.useMemo)(()=>({editable:n,sheet:t,active:!!b}),[n,t,b]),[C,w]=(0,u.useState)(null),T=i.X(e=>{w(t=>t&&t.width===e.width&&t.height===e.height?t:e)},[]),E=i.X(e=>{if(n.getSession())return;let t=n.getAnchor().getCoords();if(!t)return;let r=(e=>e.ctrlKey||e.metaKey||e.altKey||e.isComposing?null:e.key===`Process`||e.keyCode===229?{mode:`enter`,dirty:``}:e.key.length===1?e.key===` `&&e.shiftKey?null:{mode:`enter`,dirty:e.key}:e.shiftKey?null:e.key===`F2`?{mode:`edit`}:e.key===`Backspace`?{mode:`enter`,dirty:``}:null)(e.nativeEvent);if(!r)return;e.nativeEvent.key!==`Process`&&e.nativeEvent.keyCode!==229&&e.preventDefault(),e.stopPropagation();let i=()=>n.startEdit(t,r);i()||_(t,()=>{i()})},[n,_]),D=i.X(e=>{if(n.getSession())return;let r=h?.getCellFromPointer(e.clientX,e.clientY),i=r?{...r,scope:t.getName()}:n.getAnchor().getCoords();if(!i)return;let a=()=>n.startEdit(i,{mode:`edit`});a()||_(i,()=>{a()})},[h,n,t,_]),O=i.X(e=>n.commit(e),[n]),k=i.X(()=>{n.cancel()},[n]);(0,u.useEffect)(()=>{b&&h&&x&&h.scrollCellCoordsIntoView(b.coords)},[b?.token,x]);let A=b?b.coords:n.getAnchor().getCoords(),j=A?{rowIndex:A.rowIndex,colIndex:A.colIndex}:null,M=(()=>{if(!b||!x)return`left`;let e=b.clean();if((b.dirty??(e?Us(e):``))[0]===`=`)return`left`;switch(e?.getRenderHorizontalAlignment()){case o.Y.HorizontalAlignment.Right:return`right`;case o.Y.HorizontalAlignment.Center:case o.Y.HorizontalAlignment.CenterContinuous:return`center`;default:return`left`}})(),N=a??M,P=null,F=!1,I=!1;if(h&&j){let e=h.getRangeFromCell(j);if(I=h.toClipBounds(h.getBoundsFromRange({rowStart:e.rowStart,colStart:e.colStart,rowEnd:e.rowStart,colEnd:e.colStart}))!==null,b){let e=((e,t,n,r=`left`,i=0)=>{if(!t)return null;let a=e.getRangeFromCell(t),o=e.getBoundsFromRange(a);if(!o)return null;let s=e.toClipBounds(e.getBoundsFromRange(a))!==null,c=e.getZoom(),l=n?.width?n.width*c:void 0,u=n?.height?n.height*c:void 0,d={...o};if(l!==void 0){let t=e.getPaneRange(),n=e.getMetrics(),i={...a},o=!1,s=0;for(;!o&&d.width<=l&&s<20;)s++,r===`left`?i.colEnd+1<t.colEnd?i.colEnd=n.getColIndex(d.x+l):o=!0:r===`right`?i.colStart-1>=0?i.colStart=n.getColIndex(d.x-(l-d.width)):o=!0:i.colEnd+1<t.colEnd&&i.colStart-1>=0?(i.colStart=n.getColIndex(d.x-(l-d.width)/2),i.colEnd=n.getColIndex(d.x+d.width+(l-d.width)/2)):o=!0,o||(d=e.getBoundsFromRange(i))}d.height=o.height,u!==void 0&&(d.height=Math.max(u+1,o.height));let f=e.getSurfaceSize(),p=Math.max(o.width,f.width-d.x-i);return{bounds:{x:d.x??0,y:d.y??0,width:Math.min(p,d.width),height:Math.min(f.height-d.y,d.height)},inView:s}})(h,j,C,N,s);P=e?.bounds??null,F=e?.inView??!1}else P=h.getBoundsFromRange(e)}let L,R=null;if(h&&j){let e=h.getBoundsFromRange(h.getRangeFromCell(j)),t=h.getZoom()||1;if(e){R={width:e.width/t,height:e.height/t};let n=h.getSurfaceSize();n?.width&&(L=Math.max(e.width,n.width-e.x-s)/t)}}let z=!!b&&!!P&&F&&x,B=`inline:${t.getId()}:${h?.getAnchor()??``}`,V=i.X(()=>{n.getSession()?.setActiveEditorId(B)},[n,B]),H=y?.getActiveEditorId()??null,U=!H||H===B,W={open:!!b,mode:b?.mode??`enter`,coords:b?.coords??null,clean:b?.clean??null,dirty:b?.dirty,token:b?.token??0,autoFocus:(b?.autoFocus??!0)&&U&&z&&I,initialSelection:b?.initialSelection,zoom:h?.getZoom()??1,cellSize:R,onDirtyChange:e=>y?.setDirty(e),onModeChange:e=>y?.setMode(e),onCommit:O,onCancel:k,onNaturalSize:T},G=A&&x?((e,t,n,r)=>{let i=e.getStyle().getFill()?.toCSS(n)?.background;return Qa(i)&&(i=t.getStyles().getNormal().getFill().toCSS(n)?.background),Qa(i)&&(i=r??`#ffffff`),i})(t.getRange(A).getCell(),t,r,`var(--sxl-color-base-100)`):`transparent`;return(0,d.jsx)(ec,{spec:{scopeName:{key:`layer:editor`,name:`editor`},contributor:{dynamic:Zs},data:S},order:fe().zIndex,children:(0,d.jsx)(pe,{className:$(f,`editor`),onKeyDown:E,onDoubleClick:D,children:P||b?(0,d.jsx)(_e,{...m,bounds:P??tc,alignWidth:s,keepMounted:!0,onFocus:V,style:{borderColor:`var(--sxl-color-primary, rgb(33, 115, 70))`,...p,display:`flex`,overflow:`hidden`,background:G,boxShadow:z?`rgba(60,64,67,.35) 2px 2px 6px 3px`:`none`,opacity:+!!z,pointerEvents:z?`auto`:`none`},children:(0,d.jsx)(nc,{alignWidth:s,children:(0,d.jsx)(v,{...W,editable:n,maxContentWidth:L})})}):null})})}rc.displayName=`SheetCellEditorLayer`;var ic=class{constructor(e){this._listeners=new Set,this._removeSdkListener=null,this._sel=e}get selection(){return this._sel}getSelection(){return this._sel.getCoords()}setSelection(e){this._sel.updateCoords(e)}navigate(e,t=!1,n=!1,r){this._sel.navigate(e,t,n,r)}traverse(e=n.R.Row,t=!1,r){this._sel.traverse(e,t,r)}modify(e,t){this._sel.modify(e,t)}append(e,t=e){this._sel.append(e,t)}deselect(e){let t=this._sel.getCoords();if(!t.ranges||t.ranges.length===0)return;let r=[],i=-1,a=t.cell;for(let o of t.ranges){if(n.d.isRangesIntersect(o,e)){let a=n.I.subtractRect({top:o.rowStart,left:o.colStart,bottom:o.rowEnd+1,right:o.colEnd+1},{top:e.rowStart,left:e.colStart,bottom:e.rowEnd+1,right:e.colEnd+1});for(let e of a){let a={rowStart:e.top,colStart:e.left,rowEnd:e.bottom-1,colEnd:e.right-1};r.push(a),n.d.isCellWithinRange(t.cell,a)&&(i=r.length-1)}}else r.push(o);if(r.length>0&&i===-1&&n.d.isCellWithinRange(t.cell,o)){i=r.length-1;let e=r[r.length-1];a={rowIndex:e.rowStart,colIndex:e.colStart}}}this._sel.updateCoords({cell:a,rangeIndex:i,ranges:r})}getCoords(){return this._sel.getCoords().cell}subscribe(e){return this._listeners.add(e),this._listeners.size===1&&(this._removeSdkListener=this._sel.addListeners({onChange:()=>{this._listeners.forEach(e=>e())}})),()=>{this._listeners.delete(e),this._listeners.size===0&&(this._removeSdkListener?.(),this._removeSdkListener=null)}}},ac=Object.freeze({[o.D.Presets.Copy.id]:n.q(`autoFill.preset.copy`),[o.D.Presets.Series.id]:n.q(`autoFill.preset.series`),[o.D.Presets.Linear.id]:n.q(`autoFill.preset.linear`),[o.D.Presets.Growth.id]:n.q(`autoFill.preset.growth`),[o.D.Presets.DateYears.id]:n.q(`autoFill.preset.dateYears`),[o.D.Presets.DateMonthEnd.id]:n.q(`autoFill.preset.dateMonthEnd`),[o.D.Presets.DateMonths.id]:n.q(`autoFill.preset.dateMonths`),[o.D.Presets.DateWeekdays.id]:n.q(`autoFill.preset.dateWeekdays`),[o.D.Presets.DateDays.id]:n.q(`autoFill.preset.dateDays`),[o.D.Presets.LinearTrend.id]:n.q(`autoFill.preset.linearTrend`),[o.D.Presets.GrowthTrend.id]:n.q(`autoFill.preset.growthTrend`)});function oc(e){let{sheet:t,notifier:n,range:r,byDirection:i,direction:a,presetId:o,onClosed:s}=e,c={range:r,direction:a,offered:e=>i.get(e)?.offered??[],resolve:e=>{let n=i.get(e);return n?{template:t.getRange(n.template).getAddress(),destination:t.getRange(n.destination).getAddress(),templateSize:n.templateSize,size:n.size}:null},preview:e=>{let n=i.get(e.direction);if(!n)return null;try{return t.getRange(n.template).autoFill(n.destination,{...sc(e),preview:!0})}catch{return null}}},l={initialValue:{presetId:o,direction:a},context:()=>c,onInput:e=>{try{let r=e?i.get(e.direction):void 0;if(!e||!r)return;try{t.getRange(r.template).autoFill(r.destination,{...sc(e),autoSelect:!0})}catch(e){n?.showError?.(e)}}finally{s?.()}}};n?.showWindow?.(`fillSeries`,l)}function sc(e){let t=o.D.getPreset(e.presetId);if(!t)throw new n.c(n.r(`error.fillSeries.unknownType`));return o.D.toFillOptions(t,{trend:e.trend,stepValue:e.stepValue,stopValue:e.stopValue})}function cc(e,t){let{navigation:n,sheet:r}=t;if(!n)return()=>{};let i=[...n.getBindings().keys()].map(e=>({key:e,callback:()=>{n.invoke(e)}}));r&&(i.push({key:`traverseSelectionCorners`,callback:()=>{r.getSelection().traverseCorners()}}),i.push({key:`selectArray`,callback:()=>{(e=>{let t=e.getSelection(),n=e.getRange(t.getCoords().cell).getCell().getSpill()?.getCoords();n&&t.updateCoords({cell:{rowIndex:n.rowStart,colIndex:n.colStart},ranges:[n],rangeIndex:0})})(r)}}));for(let t of i){let{key:n,...r}=t;e.updateCommand(n,r)}return()=>{}}var lc={top:a.l.Direction.Up,bottom:a.l.Direction.Down,left:a.l.Direction.Left,right:a.l.Direction.Right},uc=({sheet:e,isActive:t=!0,onShowTooltip:r,onCloseTooltip:s,onFillMenu:c,className:l,...f})=>{let p=i.ot(),m=i.Ot(),h=i.Ct(),g=Z(),[_,v]=(0,u.useState)(null),y=!!i.Jt.useCommandScope(),b=(0,u.useMemo)(()=>({navigation:_,sheet:e}),[_,e]),x=i.X(r,[r]),S=i.X(s,[s]),[C]=i.Jt.useCommands([`pasteFormats`]),w=i.X(async()=>{h.getMode()?.key===`formatPainter`&&(await C?.execute(),h.setMode(null))},[h,C]),T=(0,u.useMemo)(()=>new ic(e.getSelection()),[e]),E=i.X(t=>{let n=e.getSelection();n.setAdjusting(t===`extend`?n.getCoords():null)},[e]),D=i.X(()=>e.getUsedRange()?.getCoords()??n.d.EmptyRange,[e]),O=i.X(t=>{let r=e.getTables().getItems();for(let e=0;e<r.length;e++){let i=r[e];if(n.d.isCellWithinRange(t,i.getRange().getCoords()))return i.getDataRange().getCoords()}return null},[e]),k=i.X(t=>{e.scrollTo({colStart:t.colIndex,colEnd:t.colIndex,rowStart:t.rowIndex,rowEnd:t.rowIndex},{})},[e]);Pi(e,[`onProtectionChange`,`onSelectionChange`]);let A=h.getMode(),j=A?.key===`edit`,M=A?.key===`copy`||A?.key===`cut`,N=A?.key===`fill`,P=e.getSelectedRanges().getCount(),F=e.getProtection().isLocked(),I=t&&P<=1&&!j&&!F,L=i.kt.detectIt().supportsTouchEvents,R=L&&t&&!j&&P<=1,z=I&&!L&&(!A||M||N),B=A&&_c.includes(A)?A.cursor:void 0,V=u.useMemo(()=>{if(!L)return;let e=Math.max(2,Math.round(2*i.kt.getDevicePixelRatio()));return{border:{alignWidth:e},inner:{alignWidth:e}}},[L]),H=i.X((e,t,n)=>{h.setMode(vc(n))},[h]),U=i.X((e,t,n,r)=>{h.setMode(vc(r))},[h]),W=i.X(()=>{h.setMode(null)},[h]),G=i.X((t,n)=>!!n.insert&&!e.getRange(n.to).canInsertFrom(t,{isCut:!n.copy,axis:n.insert}),[e]),K=i.X(async(t,r)=>{let i=await p?.showBusy?.(m(`op.autoFill`));try{await e.doBatch(()=>{e.getRange(t).autoFill(r,{snap:!0}),e.getRange(r).autoFit({axes:a.l.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:n.q(`op.autoFill`),autoSelect:!0})}catch(e){p?.showError?.(e)}finally{i?.()}},[e,p]),q=i.X((t,n)=>e.getRange(t).autoFill(n,{preview:!0,snap:!0}).getCoords(),[e]),J=i.X((t,o)=>{if(!r)return;if(h.setMode(gc),n.d.isRangeWithinRange(o,t)&&!n.d.isEqualRanges(o,t))return void S?.();let s=dc(t,o);try{let r=e.getRange(t).autoFill(o,{preview:!0,snap:!0}),c=r.getCell({rowIndex:s===a.l.Direction.Up?o.rowStart:o.rowEnd,colIndex:s===a.l.Direction.Left?o.colStart:o.colEnd}),l=c.getSpans(),u=l.width>1||l.height>1?c.getExtrusions():null,d=u?r.getCell({rowIndex:u.rowStart,colIndex:u.colStart}):c;if(d.isEmpty())return void S?.();let f=d.getText({hideStringPrefix:!0});if(!f)return void S?.();let p=u??n.d.cellToRange(c.getCoords()),m=g.getMetrics(),h=g.getPanePointFromPointer(0,0);if(!h)return void S?.();let _=0,v=0,y=i.nn.Bottom;if(s===a.l.Direction.Down){_=m.getColOffset(p.colEnd+1)-h.x;let e=m.getRowOffset(p.rowEnd),t=m.getRowOffset(p.rowEnd+1);v=t-(t-e)/2-h.y,y=i.nn.Right}else if(s===a.l.Direction.Right){v=m.getRowOffset(p.rowEnd+1)-h.y;let e=m.getColOffset(p.colEnd),t=m.getColOffset(p.colEnd+1);_=t-(t-e)/2-h.x,y=i.nn.Bottom}else if(s===a.l.Direction.Up){_=m.getColOffset(p.colEnd+1)-h.x;let e=m.getRowOffset(p.rowStart),t=m.getRowOffset(p.rowStart+1);v=t-(t-e)/2-h.y,y=i.nn.Right}else if(s===a.l.Direction.Left){v=m.getRowOffset(p.rowEnd+1)-h.y;let e=m.getColOffset(p.colStart),t=m.getColOffset(p.colStart+1);_=t-(t-e)/2-h.x,y=i.nn.Bottom}x({anchor:{x:_,y:v},display:f,placement:y})}catch(e){p?.showError?.(e)}},[e,p,h,g,r]),Y=i.X((t,r,i)=>{let a=lc[r],o=e.getRange(t).getExtended(a,{basis:`content`,fromBlank:`before`}).getCoords();if(n.d.isEqualRanges(o,t))return;if(i.shiftKey)return void e.getRange(o).select();let s=e.getSelectedCell().getCoords(),c=r===`top`||r===`bottom`;e.getRange(c?{rowIndex:r===`top`?o.rowStart:o.rowEnd,colIndex:s.colIndex}:{rowIndex:s.rowIndex,colIndex:r===`left`?o.colStart:o.colEnd}).select()},[e]),ee=i.X(t=>e.getRange(t).getExtended(a.l.Direction.Down,{basis:`adjacent`}).getCoords(),[e]),X=i.X(()=>{h.setMode(null),S?.()},[h]),te=i.X((t,r,i,s)=>{if(!c)return;let l=function(e){let{sheet:t,template:r,destination:i,notifier:s,onSettled:c}=e,l=t.getRange(r),u=l.getDefaultAutoFillCriteria(void 0,i);if(!u)return null;let d=t.getRange(i),f=!1,p=!1,m=()=>{p||(p=!0,c?.())};return{template:l,destination:d,direction:u.direction,offered:u.offered,fill:async e=>{f=!0;let r=await s?.showBusy?.(n.r(`op.autoFill`));try{let r=e.presetId===void 0?void 0:o.D.getPreset(e.presetId);if(e.presetId!==void 0&&!r)throw new n.c(n.r(`error.fillSeries.unknownType`));let s={...r?o.D.toFillOptions(r):void 0,type:e.type,snap:!0};await t.doBatch(()=>{l.autoFill(i,s),d.autoFit({axes:a.l.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:n.q(`op.autoFill`),autoSelect:!0})}catch(e){s?.showError?.(e)}finally{r?.(),m()}},series:()=>{f=!0,oc({sheet:t,notifier:s,range:d,byDirection:new Map([[u.direction,u]]),direction:u.direction,presetId:u.presetId,onClosed:m}),s?.showWindow||m()},cancel:()=>{f||m()}}}({sheet:e,template:t,destination:r,notifier:p,onSettled:s});if(!l)return s(),void K(t,r);c({clientX:i.clientX,clientY:i.clientY,originalEvent:i},l)},[e,p,c,K]),ne=i.X(async(t,r,i,o)=>{if(n.d.isEqualRanges(t,r))return;let s=!o.copy,c=!!o.insert,l=e.getRange(r);if(!c&&p?.showOptions){let e=l.getDifferences(t),n=!1,r=e?.getCount()??0;for(let t=0;!n&&t<r;t++)n=e.at(t).isContentful();if(n&&await p.showOptions({title:m(`dialog.confirm.title`),description:m(`selection.replaceData`),options:[{id:`Replace`,label:()=>m(`selection.replace`)},`Cancel`],defaultOption:`Replace`})!==`Replace`)return void T.setSelection({cell:{rowIndex:t.rowStart,colIndex:t.colStart},rangeIndex:0,ranges:[t]})}let u=n.q(c?s?`op.insertMovedCells`:`op.insertCopiedCells`:s?`op.moveCells`:`op.copyCells`),d=await p?.showBusy?.(m(u));try{let n=e.getRange(t);await l.doBatch(async()=>{c?await l.insertFrom(t,{isCut:s,axis:o.insert,undoRange:n}):await l.copyFrom(t,{isCut:s,undoRange:n}),n.autoFit({skipCustomSize:!0,axes:a.l.AxisSelection.Row,minContent:!0}),l.autoFit({skipCustomSize:!0,axes:a.l.AxisSelection.Row,minContent:!0})},{description:u,autoSelect:!0})}catch(e){p?.showError?.(e)}finally{d?.()}},[e,p,T]);return(0,d.jsxs)(i.Jt.CommandScopeProvider,{spec:{scopeName:{key:`layer:selection`,name:`selection`},contributor:{dynamic:cc},data:b},order:fe().zIndex,children:[(0,d.jsx)(Rr,{className:$(l,`selection`),selection:T,...f,singleStyle:V,getContentBounds:D,getRegionBounds:O,scrollIntoView:k,enabledMove:I,onMove:ne,isDropRefused:G,onMoveStart:H,onMoveUpdate:U,onMoveEnd:W,moveCursor:B,enableFill:z,snapFillDestination:q,onFill:K,onFillPreview:J,onFillEnd:X,onFillMenu:c?te:void 0,resolveFillExtent:ee,onEdgeDoubleClick:Y,onSelectionEnd:w,onDragModeChange:E,disableKeyboard:y,ref:v}),R&&(0,d.jsx)(Or,{selection:T})]})};uc.displayName=`SheetSelectionLayer`;var dc=(e,t)=>t.rowEnd>e.rowEnd?a.l.Direction.Down:t.rowStart<e.rowStart?a.l.Direction.Up:t.colEnd>e.colEnd?a.l.Direction.Right:a.l.Direction.Left,fc={key:`dragCut`,description:n.q(`editMode.dragCut`),cursor:`move`},pc={key:`dragCutInsert`,description:n.q(`editMode.dragCutInsert`),cursor:`move`},mc={key:`dragCopy`,description:n.q(`editMode.dragCopy`),cursor:`copy`},hc={key:`dragCopyInsert`,description:n.q(`editMode.dragCopyInsert`),cursor:`copy`},gc={key:`fill`,description:n.q(`editMode.fill`),cursor:`crosshair`},_c=[fc,pc,mc,hc],vc=e=>e.copy?e.insert?hc:mc:e.insert?pc:fc,yc=(e,t)=>Object.assign(Object.create(e),{setSelection:n=>{let r=e.getSelection(),i=n.ranges,a=n.rangeIndex??-1;i&&a>=0&&a<i.length&&i[a]&&i[a]!==r?.ranges?.[a]&&i[a].scope!==t&&(n={...n,ranges:i.map((e,n)=>n===a?{...e,scope:t}:e)}),e.setSelection(n)}});function bc(e){let{sheet:t,sheetView:n,className:r,onKeyDown:a,...o}=e,s=Za(),c=s.getMode(),l=c?.selection??null,f=l?.getSheet().getName(),p=t.getName(),m=f===p,h=!!c?.scope&&c.scope!==p,g=Ra(t,(n?.isShowFormulas()??!1)&&!l),_=(0,u.useMemo)(()=>{if(!g||!g.ranges.some(Boolean))return null;let e=t.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return e.updateCoords({cell:{rowIndex:g.coords.rowIndex,colIndex:g.coords.colIndex,scope:p},ranges:g.ranges,rangeIndex:-1}),new ic(e)},[t,g,p]),v=i.X((e,t)=>{s.setMode(n=>n&&{...n,dragging:e,draggingIndex:e&&t!==null?t:void 0})},[]),y=i.X(e=>{if(a?.(e),e.defaultPrevented)return;let t=s.getMode();if(t?.mode!==`point`||t.scope&&t.scope!==p||go(e,t,p))return;if(!(e.key!==`F4`||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)){if(!t.activeInput||e.nativeEvent.isComposing)return;e.preventDefault(),e.stopPropagation(),t.activeInput.toggleReferences();return}if(!t.onDone)return;let n=e.key;n!==`Enter`&&n!==`Tab`&&n!==`Escape`||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||(e.preventDefault(),e.stopPropagation(),t.onDone({reason:n===`Escape`?`cancel`:`accept`,key:n,shiftKey:e.shiftKey,altKey:e.altKey}))},[a,p]),b=(0,u.useMemo)(()=>l?yc(new ic(l),p):null,[l,p]),x=i.in(b,e=>e.getSelection()),S=e=>!!e&&(e.scope===void 0&&m||e.scope===p),C=!!x?.ranges?.some(S),w=!h&&c?.mode===`point`,T=C||w;if(!c)return _&&g?(0,d.jsx)(Gr,{className:$(r,`reference-picker`,`formula-view`),selection:_,getRangeStyle:(e,t)=>{let n=g.ranges[e];return n&&n.scope===p?Wr(e):null},...o,animated:!1,disableDraw:!0,allowMulti:!1,anchors:xc,onKeyDown:a}):null;if(!b||!x||!T)return null;let E=!0===c?.readOnly;return(0,d.jsx)(Gr,{className:$(r,`reference-picker`,E?`read-only`:void 0),selection:b,getRangeStyle:(e,t)=>{let n=x.ranges?.[e];return n&&S(n)?Wr(e):null},...o,animated:!E&&(x.rangeIndex??-1)>=0,enabledMove:!E,anchors:E?xc:void 0,disableDraw:!w||E,allowMulti:!1!==c?.allowMulti,onDragActiveChange:v,onKeyDown:y})}bc.displayName=`SheetReferenceLayer`;var xc=[],Sc=Object.freeze([]),Cc=e=>{let t=Z(),[n,r]=(0,u.useReducer)(e=>e+1,0),i=(0,u.useMemo)(()=>({}),[n]);Ni(e,{onTablesChange:()=>r(),onAutoTableChange:()=>r(),onLayoutChange:()=>r(),onInvalidated:()=>r()},wc);let a=t.getVisibleRange(),o=(0,u.useMemo)(()=>{if(!a)return Sc;let t=e.getTables().getItems({address:a});return t.length>0?t:Sc},[e,a?.rowStart,a?.colStart,a?.rowEnd,a?.colEnd,n]);return(0,u.useEffect)(()=>{if(o.length===0)return;let e=o.map(e=>e.addListeners({onAnyChange:()=>r()},Tc));return()=>{for(let t of e)t?.()}},[o]),{visibleTables:o,cacheToken:i}},wc={transactional:!1,ignoreModelChange:!0},Tc={transactional:!1},Ec={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Dc=(e,t)=>{let n=Z(),r=t?.showFormulas??!1,o=t?.showZeros??!0,s=t?.contentOnly??!1,[c,l]=(0,u.useReducer)(e=>e+1,0),d=(0,u.useMemo)(()=>({}),[c,r,o,s]),f=(0,u.useRef)(new Map),p=(0,u.useRef)({showFormulas:r,showZeros:o,contentOnly:s});p.current.showFormulas===r&&p.current.showZeros===o&&p.current.contentOnly===s||(p.current={showFormulas:r,showZeros:o,contentOnly:s},f.current.clear());let m=n.getVisibleRange();Ii(e,(0,u.useMemo)(()=>m?{rowStart:m.rowStart,colStart:m.colStart,rowEnd:m.rowEnd,colEnd:m.colEnd}:null,[m?.rowStart,m?.colStart,m?.rowEnd,m?.colEnd]),e=>{e.isDataChange&&(f.current.clear(),l())},Oc);let h=()=>{f.current.clear(),l()};return Ni(e,{onConditionalFormatsChange:h,onLayoutChange:h},{ignoreModelChange:!0}),{getVisibleCells:i.X((t,n)=>{let i=f.current,c=n??t.getVisibleRange();if(!c)return[];let l=`${c.rowStart}:${c.colStart}:${c.rowEnd}:${c.colEnd}`,u=i.get(l);if(u)return u;let d=[];return e.getRange(c).forEach((e,t)=>{let n=t.getCoords(),i=t.getCell();if(!(e=>{if(e.isEmpty())return!1;if(s){let t=e.getConditionalDecorations();if(!1===t.dataBar?.showValue||!1===t.iconSet?.showValue)return!1}let t=e.getSpans();if(t.width>1||t.height>1||!s&&e.getStyle().hasVisibleStyling()||r&&e.getFormula()!==null)return!0;let n=e.getValue();return n!==null&&!(!o&&n===0&&e.getType()===a.t.Number)})(i))return;let c=r?null:i.getExtrusions();d.push({cell:n,value:i,range:c??void 0})},Ec),i.set(l,d),i.size>12&&i.delete(i.keys().next().value),d},[e,r,o,s]),cacheToken:d}},Oc={fireOnAddressChange:!1,transactional:!1},kc=(e,t)=>{let n=Z(),[r,a]=(0,u.useReducer)(e=>e+1,0),o=(0,u.useMemo)(()=>({}),[r,t,e]),s=(0,u.useRef)(new Map),c=i.X(()=>{s.current.clear(),a()},[]);Ni(e,{onStyleChange:c,onLayoutChange:c,onProtectionChange:c});let l=n.getVisibleRange();return Ii(e,(0,u.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.isDataChange&&c()},Ac),{getRegions:i.X((n,r)=>{let i=r??n.getVisibleRange();if(!i)return[];let a=s.current,o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,c=a.get(o);if(c)return c;let l=[...e.getRange(i).getRegions(t)];return a.set(o,l),a.size>12&&a.delete(a.keys().next().value),l},[e,t]),cacheToken:o}},Ac={fireOnAddressChange:!1,transactional:!1},jc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Mc=(e,t)=>{let n=Z(),[r,a]=(0,u.useReducer)(e=>e+1,0),o=(0,u.useMemo)(()=>({}),[r,t]),s=(0,u.useRef)(new Map),c=i.X(()=>{s.current.clear(),a()},[]);Ni(e,{onConditionalFormatsChange:c},{ignoreModelChange:!0});let l=n.getVisibleRange();return Ii(e,(0,u.useMemo)(()=>l?{rowStart:l.rowStart,colStart:l.colStart,rowEnd:l.rowEnd,colEnd:l.colEnd}:null,[l?.rowStart,l?.colStart,l?.rowEnd,l?.colEnd]),e=>{e.isDataChange&&c()},Pc),{getVisibleDecorations:i.X((n,r)=>{let i=s.current,a=r??n.getVisibleRange();if(!a)return Nc;let o=`${a.rowStart}:${a.colStart}:${a.rowEnd}:${a.colEnd}`,c=i.get(o);if(c)return c;let l=e.getRange(a),u=Nc;if(l.getConditionalFormats().length>0){let e=[];l.forEach((n,r)=>{let i=r.getCell(),a=i.getConditionalDecorations();if(!a[t])return;let o=i.getSpans(),s=o.width>1||o.height>1?i.getRange().getCoords():void 0;e.push({cell:r.getCoords(),value:i,range:s,decorations:a})},jc),e.length>0&&(u=e)}return i.set(o,u),i.size>12&&i.delete(i.keys().next().value),u},[e,t]),cacheToken:o}},Nc=[],Pc={fireOnAddressChange:!1,transactional:!1},Fc=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:r,getVisibleCells:a,className:s,style:c,...l}=e,u=Z();Pi(r,[`onStyleChange`,`onLayoutChange`]);let f=i.X(a,[a]),p=u.getPaneBounds();if(p.width===0||p.height===0)return null;if(!u.toClipBounds(u.getBoundsFromRange(),-3))return;let m=f(u),h=m?m.length:0;if(h===0)return;let g=null,_=null,v=u.getVisibleRange();for(let e=0;e<h;e++){let t=m[e],i=t.cell;if(!i)continue;let a=t.value,o=t?.range;if(o){let e=a.getSpans();e.height===1&&e.width===1&&(o=null)}let s=a;if(o){let e=`${o.rowStart}:${o.colStart}`;if(_?.has(e))continue;(_??=new Set).add(e),a.isTopLeft()||(s=r.getRange({rowIndex:o.rowStart,colIndex:o.colStart}).getCell())}let c=o?{...o}:n.d.cellToRange(i);if(!n.d.isRangesIntersect(c,v)&&!n.d.isRangeWithinRange(c,v))continue;let l=s.getStyle().getFill();l.hasVisibleStyling()&&(c.value=l,g||=[],g.push(c))}if(!g)return;let y=n.d.mergeRangeCoordValues(g,2,(e,t)=>{let n=e[0].value,r=e[1].value;if(n.isEqual(r))return t}),b=[],x=y.length;for(let e=0;e<x;e++){let t,n=y[e],r=n.value,i=r.getType()===o.S.Type.Pattern?r.toCSSMask(`adaptive`):null,a=null;if(i)t=i.base,a=(0,d.jsx)(`div`,{className:`cell-fill-marks`,style:{position:`absolute`,inset:0,...i.marks}});else{let e=u.getBoundsFromRange(n);t=r.toCSS(`adaptive`,e)}b.push((0,d.jsx)(_e,{className:`cell-fill`,range:n,clipInsets:-10,coverGridlines:!0,style:{pointerEvents:`none`,...t},children:a},`fill-${e}`))}return(0,d.jsx)(pe,{...l,className:$(s,`fills`),children:(0,d.jsx)(_e,{fill:!0,ref:t,className:`fills-box`,style:{pointerEvents:`none`,overflow:`visible`,...c},children:b})})})),Ic=e=>{let t=e.getUsedRange();if(!t)return null;let n=e.getName(),r=null;for(let e of t.getRegions(o.I.Feature.Circular)){let t=e.getCell().getCircularReference();if(!t||t.isIterative())continue;let i=e.getCoords(),a={rowIndex:i.rowStart,colIndex:i.colStart,scope:n};if(t.isMember(a))return a;r??=t.getRepresentative()}return r},Lc=(e,t)=>{let n=o.nt.cellToString(e)??``;return e.scope&&e.scope!==t?o.nt.sheetAndRangeToString(o.nt.sheetNameToString(e.scope)??e.scope,n):n},Rc=(e,t)=>{let n=t.scope,r=e;if(n&&n!==e.getName())try{r=e.getWorkbook()?.getSheet(n)??null}catch{r=null}return r?r.getRange({rowStart:t.rowIndex,colStart:t.colIndex,rowEnd:t.rowIndex,colEnd:t.colIndex}).select({scrollIntoView:!0}):null},zc=e=>{let{items:t,currentText:n,onChoose:r,minWidth:a,search:o=!1,onClose:s,style:c,className:l,measureText:f,viewport:p,visibleRows:m}=e,h=i.Ot(),g=ca(),_=(0,u.useRef)(null),[v,y]=(0,u.useState)(``),b=(0,u.useMemo)(()=>o?Di(t,v):t,[t,v,o]),x=(0,u.useMemo)(()=>n==null?0:Math.max(0,b.findIndex(e=>e.text===n)),[b,n]),S=i.X((e,t)=>{r(t)},[r]),C=(0,u.useCallback)(e=>{let t=_.current;t&&(e.which===i.Zt.Down||e.which===i.Zt.Up?(e.preventDefault(),t.moveHighlight(e.which===i.Zt.Down?1:-1)):e.which===i.Zt.Enter&&(e.preventDefault(),t.chooseHighlighted()))},[]),w=o?(0,d.jsx)(Oi,{className:`_search_14jxb_16`,value:v,onChange:y,onClose:s,onKeyDown:C,placeholder:h(`picker.search`),autoFocus:!0}):null;return(0,d.jsxs)(`div`,{className:$(`_panel_14jxb_5`,`cell-picker`,l),style:{minWidth:a,...c},...i.qt(`grid`,g),children:[w,b.length===0?(0,d.jsx)(`div`,{className:`_empty_14jxb_28`,children:h(v?`picker.noMatches`:`picker.noValues`)}):(0,d.jsx)(Ei,{ref:_,className:`_values_14jxb_24`,items:b,highlightIndex:x,onChoose:S,measureText:f,viewport:p,visibleRows:m,autoFocus:!o})]})};zc.displayName=`PickerPanel`;var Bc=null,Vc=new Set,Hc=e=>(Vc.add(e),()=>{Vc.delete(e)}),Uc=e=>{Bc!==e&&(Bc=e,Vc.forEach(e=>e()))},Wc=e=>(0,u.useSyncExternalStore)(Hc,()=>Bc===e,()=>!1),Gc={placement:`bottom-end`,offsets:[0,1]},Kc=e=>{let{sheet:t,editable:r,resolveItems:a,getCurrentText:o,onChoose:s,search:c,visibleRows:l,label:f=`cell-picker`}=e,[p,m]=(0,u.useState)(null),h=p?.cell??e.cell,g=p?p.anchor:e.anchor,_=p?p.minWidth:e.minWidth,[v,y]=(0,u.useState)([]),[b,x]=(0,u.useState)(null),S=(0,u.useRef)(0),C=(0,u.useMemo)(()=>t.getStyles().getNormal().getFont().toCSS(`adaptive`),[t]),w=(0,u.useMemo)(()=>h?{rowIndex:h.rowIndex,colIndex:h.colIndex,scope:t.getName()}:null,[h,t]),T=i.X(e=>{w&&(s?s(e,w):r&&((e,t,r)=>{let i=e.getSession();i?n.d.isEqualCells(i.getCoords(),t)&&(i.setDirty(r),e.commit()):!e.startEdit(t,{dirty:r,autoFocus:!1})||!e.commit()&&e.cancel()})(r,w,e.text))},[r,w,s]),E=(0,u.useCallback)(e=>{let{closeFloat:t}=e;return(0,d.jsx)(zc,{items:v,currentText:b,minWidth:_,search:c,visibleRows:l,style:C,onChoose:e=>{T(e),t?.()},onClose:()=>t?.()})},[v,b,_,c,l,C,T]),D=i.X(()=>Uc(t),[t]),O=i.X(()=>Uc(null),[]);(0,u.useEffect)(()=>()=>Uc(null),[]);let k=i.R({label:f,anchor:g,autoFocus:!1,propsPopper:Gc,renderFloatPanel:dn,createPopupPanel:E,onOpen:D,onClose:O}),A=k.reference,j=i.X(async n=>{let r=n?.cell??e.cell;if(!r)return;let i=++S.current,s=await a(r);i===S.current&&(m(n??null),y(s),x(o?o(r):t.getCell(r).getText({hideStringPrefix:!0})),A.open(0))},[e.cell,a,o,t,A]);return{component:k.component,open:j,close:i.X(()=>{S.current++,A.close(0)},[A]),isOpen:k.isOpen}},qc=(e,t)=>{let r=e.getRange(n.d.cellToRange(t)).getDataValidations();for(let i=0;i<r.length;i++){let a=r[i];if(!a.isShowPromptMessage())continue;let o=a.getPromptTitle()??``,s=a.getPromptMessage()??``;if(!o&&!s)continue;let c=e.getCell(t),l=c.getSpans();return{range:l.width>1||l.height>1?c.getRange().getCoords():n.d.cellToRange(c.getCoords()),title:o,message:s,dataValidation:a}}return null},Jc=(0,u.memo)(e=>{let{sheet:t,offset:n=2,renderPrompt:r,className:a,style:o,...s}=e,c=(0,u.useMemo)(()=>new ic(t.getSelection()),[t]),l=Wc(t),f=i.X((e,n)=>{let r=qc(t,e);return r?{range:r.range,key:`${r.range.rowStart},${r.range.colStart}:${r.dataValidation.getIndex()}`,data:r}:null},[t]);return(0,d.jsx)(vn,{...s,className:$(a,`validation-prompt`),style:o,activateOn:`selection`,selection:c,probe:f,placement:{side:`b`,align:`start`},offset:n,whenOff:`hide`,dismiss:l,children:({data:e,floatProps:t})=>r?r(e,t):(0,d.jsxs)(`div`,{...t,className:`_prompt_3a2hw_8`,style:t.style,role:`note`,children:[e.title?(0,d.jsx)(`div`,{className:`_title_3a2hw_26`,children:e.title}):null,e.message?(0,d.jsx)(`div`,{className:`_message_3a2hw_30`,children:e.message}):null]})})});Jc.displayName=`ValidationPromptLayer`;var Yc=(e,t,n)=>{let r=null,i=null,a=0;for(let o=0;o<e.length;o++){let s=e[o];s.getAlertAt(t,n)&&(a++,i??=s,!r&&s.isShowAlertMessage()&&(r=s))}return i?r?{state:r.getAlertStyle(),rule:r,others:a-1}:{state:`failed`,rule:i,others:a-1}:null},Xc={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Zc={...Xc,includeEmpty:!0},Qc={failed:`var(--sxl-color-neutral, #9ca3af)`,[o.d.AlertStyle.Information]:`var(--sxl-color-info, #3b82f6)`,[o.d.AlertStyle.Warning]:`var(--sxl-color-warning, #f59e0b)`,[o.d.AlertStyle.Stop]:`var(--sxl-color-error, #ef4444)`},$c={failed:`ValidationFailed`,[o.d.AlertStyle.Information]:`ValidationInformation`,[o.d.AlertStyle.Warning]:`ValidationWarning`,[o.d.AlertStyle.Stop]:`ValidationStop`},el={side:`b`,align:`start`},tl=({sheet:e,cycle:t})=>(((e,t)=>{let n=Za();(0,u.useEffect)(()=>{if(!e||!t||n.getMode())return;let r=t.getMembers();if(r.length===0)return;let i=r.map(t=>({rowStart:t.rowIndex,rowEnd:t.rowIndex,colStart:t.colIndex,colEnd:t.colIndex,scope:t.scope??e.getName()})),a=e.getSelection().createSelection({shapePolicy:`ranges`,navigationPolicy:`modify`});return a.updateCoords({cell:{rowIndex:i[0].rowStart,colIndex:i[0].colStart,scope:i[0].scope},ranges:i,rangeIndex:-1}),n.setMode({mode:`show`,selection:a,activeInput:null,readOnly:!0}),()=>{n.setMode(e=>e?.selection===a?null:e)}},[e,t,n])})(e,t),null),nl={error:`rgb(200,40,40)`,warning:`rgb(200,140,0)`,circular:`rgb(200,40,40)`,validation:`rgb(200,40,40)`},rl={failed:`rgb(96,96,96)`,information:`rgb(58,112,176)`,warning:`rgb(200,140,0)`,stop:`rgb(200,40,40)`},il=(e,t,n)=>({font:`11px/1.5 system-ui, sans-serif`,color:`white`,background:n?rl[n]:t?`rgb(58,112,176)`:nl[e],padding:`3px 8px`,borderRadius:4,maxWidth:260,whiteSpace:`pre-line`,boxShadow:`0 2px 8px rgba(0,0,0,0.35)`,cursor:`default`}),al={display:`inline-flex`,marginTop:2,"--icon-error":`currentColor`,"--icon-warning":`currentColor`,"--icon-info":`currentColor`},ol={padding:0,border:0,background:`none`,color:`inherit`,font:`inherit`,textDecoration:`underline`,cursor:`pointer`},sl=(0,u.memo)(e=>{let{sheet:t,placement:a={side:`r`,align:`start`},offset:o=6,alignOffset:s=2,openDelay:c=300,closeDelay:l=150,renderTip:u,className:f,...p}=e,m=i.Ct(),h=m.getMode()?.key===`edit`,g=Wc(t),_=i.Ot(),v=i.X(e=>{let r=m.getMode();if(r?.key===`edit`){let i=r.args?.editable.getSession()?.getState().coords;if(i&&n.d.isEqualCells({...i,scope:i.scope??t.getName()},{...e,scope:t.getName()}))return null}let i=t.getCell(e),a=i.getRange().getCoords(),o=i.getErrors();if(o.length)return{range:a,data:{kind:`error`,message:o.join(`
7
+ `)}};let s=i.getCircularReference();if(s){let e=i.getCoords();return{range:a,data:{kind:`circular`,message:i.getWarnings().join(`
8
+ `),cycle:s,path:s.getPath({rowIndex:e.rowIndex,colIndex:e.colIndex,scope:t.getName()}),representative:s.getRepresentative()}}}let c=((e,t)=>{if(!e.getView().isShowInvalid())return null;let r=e.getCell(t),i=r.getCoords(),a=r.getSpans(),o=a.width>1||a.height>1?r.getRange().getCoords():n.d.cellToRange(i),s=e.getRange(o).getDataValidations();if(s.length===0)return null;let c=Yc(s,i.rowIndex,i.colIndex);if(!c)return null;let l=e.getSelectedCell().getCoords();if(l.rowIndex===i.rowIndex&&l.colIndex===i.colIndex&&qc(e,i))return null;let u=c.rule,d=c.state===`failed`?[]:[u.getAlertTitle(),u.getAlertMessage()].filter(e=>!!e);return{range:o,message:d.length>0?d.join(`
9
+ `):u.getCondition()?.toString()??``,mark:c}})(t,e);if(c)return{range:a,placement:el,data:{kind:`validation`,message:c.message,validation:c.mark}};let l=i.getWarnings();return l.length?{range:a,data:{kind:`warning`,message:l.join(`
10
+ `)}}:null},[t,m]),y=e=>{let t=e.validation;return(0,d.jsxs)(`div`,{style:{display:`flex`,gap:6,alignItems:`flex-start`},children:[(0,d.jsx)(`span`,{style:al,children:(0,d.jsx)(r.r,{iconKey:$c[t.state],size:14,ariaHidden:!0})}),(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{children:e.message}),t.others>0?(0,d.jsx)(`div`,{style:{opacity:.8},children:_(`validationTip.more`,{count:t.others})}):null]})]})},b=(e,n,r,i)=>{let a=t.getName(),o=Lc(e,a);return e.rowIndex===n.rowStart&&e.colIndex===n.colStart&&(e.scope??a)===a?(0,d.jsx)(`span`,{style:i?{color:i}:void 0,children:o},r):(0,d.jsx)(`button`,{type:`button`,style:i?{...ol,color:i}:ol,onMouseDown:e=>e.preventDefault(),onClick:()=>{Rc(t,e)},children:o},r)},x=(e,t)=>{let n=t.path,r=(e=>{if(!e||Vr.length===0)return()=>{};let t=e.getMembers();return e=>{for(let n=0;n<t.length;n++){let r=t[n];if(r.rowIndex===e.rowIndex&&r.colIndex===e.colIndex&&(r.scope??null)===(e.scope??null))return Vr[n%Vr.length]}}})(t.cycle);if(n&&n.length>0){let i=[];for(let t=0;t<n.length;t++)t>0&&i.push(` → `),i.push(b(n[t],e,t,r(n[t])));return i.push(` → `,b(n[0],e,`back`,r(n[0]))),(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{children:_(`circular.title`)}),(0,d.jsx)(`div`,{children:i}),S(t)]})}let i=t.representative;return i?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`div`,{children:[_(`circular.reads`),` `,b(i,e,`rep`,r(i))]}),S(t)]}):(0,d.jsx)(`div`,{children:t.message})},S=e=>{let t=e.cycle;if(!t?.isIterative())return null;let n=t.getIterationCount();if(t.isConverged())return(0,d.jsx)(`div`,{children:_(`circular.converged`,{count:n})});let r=t.getLastChange();return(0,d.jsx)(`div`,{children:Number.isFinite(r)?_(`circular.unconverged`,{count:n,change:r}):_(`circular.unconvergedNoChange`,{count:n})})};return(0,d.jsx)(yn,{...p,className:$(f,`cell-error`),probe:v,placement:a,offset:o,alignOffset:s,openDelay:c,closeDelay:l,dismiss:h||g,children:({range:e,data:n,tipProps:r,state:i})=>{let a=n.kind===`circular`&&!!n.cycle?.isConverged();return(0,d.jsxs)(d.Fragment,{children:[n.kind===`circular`?(0,d.jsx)(tl,{sheet:t,cycle:n.cycle}):null,u?u({range:e,message:n.message,kind:n.kind,state:i,cycle:n.cycle,path:n.path,representative:n.representative}):(0,d.jsx)(`div`,{...r,style:{...il(n.kind,a,n.validation?.state),...r.style},children:n.kind===`circular`?x(e,n):n.kind===`validation`?y(n):n.message})]})}})});sl.displayName=`CellErrorLayer`;var cl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:n,getVisibleCells:r,className:a,...o}=e,s=Z();Pi(n,[`onStyleChange`,`onLayoutChange`]);let{renderLayer:c}=va({getVisibleCells:r,getBorderAt:i.X((e,t)=>e.getStyle().getBorders(),[])});if(s.getPaneBounds().width===0||s.getPaneBounds().height===0)return null;let l=c?.(o,s);return l&&s?(0,d.jsx)(pe,{...o,className:$(a,`borders`),children:(0,d.jsx)(_e,{fill:!0,className:`borders-box`,style:{pointerEvents:`none`},children:l})}):null})),ll=(0,u.memo)(e=>{let{sheet:t,sheetView:n,renderCell:r,propsCellRender:a,editable:o,className:s,...c}=e,l=Z(),f=i.ot();Pi(n,[`onZoomScaleChange`]);let p=n.isShowFormulas(),m=n.isShowZeros(),{getVisibleCells:h,cacheToken:g}=Dc(t,{showFormulas:p,showZeros:m,contentOnly:!0}),_=i.X(e=>{let n,{value:r,key:i,...o}=e,s=r;if(!s){let n=e.range;if(!n||(s=t.getRange({rowIndex:n.rowStart,colIndex:n.colStart}).getCell(),s.isEmpty()))return null}s.getHyperlink()&&(n=async e=>{if(a?.onLinkMouseDown?.(e),e.button===0&&!e.isDefaultPrevented()){e.stopPropagation(),e.preventDefault();try{await s.getHyperlink()?.open()}catch(e){f.showError?.(e instanceof Error?e:String(e))}}});let{onColumnButtonMouseDown:c,propsColumnButton:l,renderColumnButton:d,...h}=a??{},g=t.getStyles();return(0,u.createElement)(Gi,{...o,key:i,docTheme:g.getTheme(),normalStyle:g.getNormal(),showFormulas:p,showZeros:m,onLinkMouseDown:n,...h,value:s})},[t,p,m]),v=r??_,y=i.in(o,e=>e.getSession()),b=Ra(t,p,g),x=y?.getCoords()??b?.coords??null,S=null;if(b&&!y){let e={rowIndex:b.coords.rowIndex,colIndex:b.coords.colIndex},t=l.getBoundsFromRange(l.getRangeFromCell(e));t&&(S=(0,d.jsx)(_e,{bounds:t,className:`formula-view-anchor`,style:{pointerEvents:`none`},children:(0,d.jsx)(La,{cell:b.cell,tokens:b.tokens,zoom:l.getZoom()||1})}))}return S||h(l).length!==0?(0,d.jsxs)(pe,{...c,className:$(s,`cells`),children:[(0,d.jsx)(nr,{renderCell:v,getVisibleCells:h,cacheToken:g,suppressCell:x}),S]}):null});ll.displayName=`SheetCellLayer`;var ul=(0,u.memo)(e=>{let{sheet:t,onColumnButtonMouseDown:n,propsColumnButton:r,renderColumnButton:a=Ba,...o}=e,{cacheToken:s}=Cc(t),c=i.X((e,n)=>{let r=n??e.getVisibleRange();if(!r)return[];let i=t.getTables().getItems({address:r}),a=t.getAutoTable(),o=a&&a.getRange().getIntersect(r)?[...i,a]:i;if(o.length===0)return[];let s=[],c=o.length;for(let e=0;e<c;e++){let n=o[e];if(n.isDeleted())continue;let r=n.getHeaderRowRange()?.getCoords();if(!r)continue;let i=n.getColumns(),a=i.length;for(let e=0;e<a;e++){let n=i[e];if(n.isHiddenButton())continue;let a={rowIndex:r.rowStart,colIndex:r.colStart+n.getIndex()};s.push({cell:a,value:t.getRange(a).getCell()})}}return s},[t]),l=i.X(e=>{let{value:t,style:i,zoom:o=1,key:s}=e,c=t,l=c?.getColumn();if(!l||!i)return null;let f={x:0,y:0,width:i.width,height:i.height},p=(0,u.createElement)(a,{renderBounds:f,className:`column-button`,disabled:!c.isEditAllowed(),zoom:o,column:l,onColumnButtonMouseDown:n,...r,style:{pointerEvents:`auto`,...r?.style}});return p?(0,d.jsx)(`div`,{style:{...i,position:`absolute`,display:`flex`,alignItems:`end`},children:p},s):null},[n,r,a]);return(0,d.jsx)(rr,{...o,className:`column-buttons`,renderCell:l,getVisibleCells:c,cacheToken:s})});ul.displayName=`SheetColumnButtonLayer`;var dl=(e,t)=>{if(e===void 0&&t===void 0)return;let n={};return e!==void 0&&(n.stroke=e),t!==void 0&&(n.strokeDasharray=t),n},fl=(0,u.memo)(e=>{let{sheet:t,sheetView:n,className:r,...i}=e;Pi(t,[`onStyleChange`]),Pi(n,[`onZoomScaleChange`]);let{getVisibleCells:a,cacheToken:s}=Dc(t,{showFormulas:n.isShowFormulas()}),c=(n?.getZoomScale()??100)/100,l=n.isShowColumnGridlines(),f=n.isShowRowGridlines(),p=(0,u.useMemo)(()=>({vertical:l&&c>=.4,horizontal:f&&c>=.4}),[l,f,c]),m=n?.getGridLineColor(),h=t.getStyles().getNormal(),g=h.getBorders(),_=h.getFill().getType()===o.S.Type.None,v=m?.toCSS(`adaptive`)??`var(--sxl-color-base-300)`,y=e=>e.isNone()?_?void 0:`none`:e.getColor().toCSS(`adaptive`),b=y(g.getBottom().isNone()?g.getTop():g.getBottom()),x=y(g.getRight().isNone()?g.getLeft():g.getRight()),S=m?`1,1`:void 0,C=(0,u.useMemo)(()=>dl(b,S),[b,S]),w=(0,u.useMemo)(()=>dl(x,S),[x,S]);return(0,d.jsx)(fr,{...i,className:r,showGridLines:p,gridLineColor:v,propsRows:C,propsColumns:w,getVisibleCells:a,cacheToken:s})});fl.displayName=`SheetGridLineLayer`;var pl=`data:image/webp;base64,UklGRhIPAABXRUJQVlA4TAYPAAAv/8F/EM8HIZJtWU0fdlTh3wRCIMlkE+EqkiTFyt57/KQ8/zKeEf5iaseNJClS1DGDxWcwvhfuCo5tW88SHw8Xh5ypbC3tnf8QHEfOB/D97w4PuFHBIx6MHJ74zvj/0aLdlH9AYWEjHiwOJR5M7Q+FAigmTRQOJRqczrVUKABQSMYgoAFFAhIwBkgaYEkBSABowDGgcYakUZirArQhRMUIIHGLBIAEEoDRfyokIAEAMhrSRmEOSPyS/jvR+BYFIWkUhLQhCpLGGQ2rhPiCOKPxDIVQmAZQDMYIjCTfNQXVJv8pnQqhuAonnczGDPv0VwFw/w+uGiAwQYjJXxffaJzROKPHoArGAPA+6o9AtiIj4XgAWGKCwAQBVNMSHQNEjTMqOSWPQEFRHOVl4vp/nnhI/DBNK8CGXCpeFvONip/jvPn67qb957v+Nssyv96/Jwg/xzT9yORhfR4fb6vF9ef39Nt62g55v37/7dRzfx9xFLRtIyX8ae+/AxARE8APxbCQtkidoqVGDBDxR3r8/59vo88vnW07v9nrY+l0tn0zemuSnn03W83Otn2zcarbfIrZqnG7Ykr77/nS5PP+/E6/iP7DgiRJiZX13F2QhYM/OrBtm7at/ZB927Zt27ZtPr/oK7Jt27b9x7dtGxcv1sFcc/R1woj+S2IkSZGkaXMpD2sZhqf3R5Y/23+2/2z/2f6z/Wf7z/af7T/bf7b/bP/97S8/r8tpn2+Rafa98ufeMc3nfK8v3V9QZHWVtFs5f/i2z8bd7+E/nX/Vuk9+uO6dF3IuWEy12r0S9eGUdA5q0RtuvnxxXpUFVPf5eQlfe7jG8j58Q6+uZZZNRGmv+GgOidbMMHMMy/WbJu7az/wcUqUk9C01LJNj5tZsDsnuizfPWh/F3WdN4FDO/eiYow4LozJuhpfDoPtcywyr8pAYDpv2RlmOB1TF7fBymPXAqA4Wwskrp3JY9oVZZA2efmm8m8O2Xa796tcoMprDvA2DAprXfkYWC9C0eflat2xrBgtRrKuDwgXemsKS5I6vr2zVzq9ZnLbUUzSHL5lFast+JTPi1rJUZWzN1bBuSSxZ7pvqaFfeVpYub2QtzaqI3McCtsppqPXPTWc0C9kjB3TqyFcsZ54b8/XpXJSHRW23qU1LJrC4PdFRlWsMzWCJ815ZpUYDU1no7mqiQ7VvYbnz9zIUaOkqFr3tZ7XnfKSHhe/+ON3pNJblL8N1QXEG+xlCXzXXmvKZjKJYn9IWKV7POMqIqlaYVtEMpU0l6lq46Eo3g2lvO2WtRPoB48m/SFXjwt3JiMqYp6eJkHWTGVQ3BZSky30Mq0/KVMTnZ2BN6aggV2UwtPa0UI+rGV1pylkm1RjB+IpZqpoxRG5ghGW/oZjr9xlj+xarZSiBBEaZe5BSxhK4jXHmeVElj/2Bkeb2KeQVzWKs7eumDnMZbemtlGEU4236UVUYyojb3UATK5Yx5lY30sOqRVlBn3YPdqKCgrexZ7SwcknQP13bfjWC6nD1XEcreHs8QgXOTg369bDmlxFQNU28mRpwYUMNXDcTQVXC2woYTOo2DrJxk1+ZQ9/9PIeNprjRs72ij4H2wbdZjdzdTDYizUXG9P3gnfZGDVy3gFMxD5ZBN9U7BWoJpoK2OpBvHvbYArWBUlFDgXu8QG2BVJanG2xLxC/UckNZZ6Om5VZmnd1NQfvtrRJzByPGXHr8ohqyn/eOr0MIZXAJZFvF1zGAUvC0AuzT+LpgXxJ7K/BuK/jA8LpiXhpPwZ3dcFN4XbIukUVgnVR01Y4WhVi19KLTC6Ca/vD4uevReM40PgHVY9GFMC2bHkAtG10Qy9K5rzHOLQkcGVwYwxJ6H+fspuAC2ZVSG5Rbjg0ulFk5Ta2FcUHTvcqtGrCo7aqZFo2EaK3oOXi0mpOO+xoinOB8cGgF2JTYrQC9EFoRJqV2Gp6Z3oisEItymxKBbniR+yIrxqDsBoCzUGQFpS+93fnYNiO4Z6FVwxc1WjXpotdCc0HoXHRMPucfY0qQTXJ6L+jqGCY0EzekcaOm+LY/g4PSCGCuirwgDtJ4dePy/uCvg2tJ8wNkhDzmObBsJDkhj7OagtL3rrwAhX84mnWiv8Yz+M/IXgyZHTFNc3jZ7dLYfSNo5uA2EpLzJT/c8b1liOY47CtHKOEfj+xcyRJ2vCqAx0MyRR2zE88uwr4hV9RxkoHGeIDv93Cf8aVotiT/uiTb0X+uKfFgnCw5Y473FWJxu7whx/wull0JkMwhx5MMJJ6UPeKYjyCZ43iw/BHHTwOxtAQAOPafwGEExem+vKd794bhxzckhNFvDgGbYbhCgoAbe46jcKsw0MbcH4Qv3hAH2vgOHIsbg4CNPScxuFcoWGPuhWFX8WnO/gt7hufPIVhSEstIOjN7ChF4WDhIY34RwcqGb4uHWfjnPZwmAQGN73PI7xkh4Yy5nvzuFhPOeKj4OkhQsqeJF9qz0DXAWB45sBFU7K6QXoKENTLOzPyC9PYIDGR8sfBOscikTwfzHp3MJlOPcujyB2TnYjiEMbeUfn0jOoRxP9GVeRgPYPyk6FqH3AaAUh5ZkOL4hpC/XLOim8/yXQ3yxXxWck9o4gb3h85/inFrhLfLQf3iIZIPNfmWLFQvniG4DyUPtYvHij7V0UXl4uxqua0vG3WLOUduNxjdELBn98vm8Jroy5z5jCSzJpY9m/CWnF43NYtvlHu8CclKxeJPxDabzNQrfkBsZ8pNteLMCKmdIDu1irmj1LaRn1rFraT2oAxVKh4oNcuHj7aRx9FNhof3pPaq5Djyzsi2RD3sDXmCSAejD/wqmeIM3y7JzS1b9YkfkfpAIchXdeI1Yu9ZqrHaxNOFdqGcVSbmgMyW974v2DmPb3A+lMhsbcl6rMrMXCCz9WSuKnFDmW0gdzWJc2S2suxVJO4s9YiT/uoRt5TZ1gJQjbitzMaJQC3iFVJfqhAElYiX6M3VCQ7FijMOokpYIfSTMFQLbYV+QQhlobUXtDJB9dBZ6OnOAFVEjtDznfyribpCz3e2ryoKLP9yJ4Uyu9x+rsmYUS2zS7yrjDSpjwuidbXxtdCmda46NghtGuPq4yOphx071LYKeZ+E7hXXamTk37XjTjzo+gqq0ThI7L2Nq9X7Z7Gexp1aq1ofnovVNO7cmfX67FyspXEnP/P74qxa1uho3Omrm6ZePpF73PkPzL41q5gbSOzu8PrOvGbek9uoXvF2Z1bKbQOvd8yajU3kdpHRx+W6yY4QfGfjfT4tV87dJLfBD1y+Kqudm0jwjjX5orx6+ol+ISM9viernxV/5+53wqw94f3OSCHJ/XII3Z/23S+tgPeHH5DovQgYoAWye5ovQkdldwpehNIDspuOLkSPkfDdCXaXo+7Pdj8G87pGemPRgnRI/Eua2/Pd78zMMvH3OhxtZhw/I/G7AytM78lvS6o4lQI4YuRQcbofwH5n//w6UqDeJwDtSBSpNyEcXSigSHkgHIqUqXq6x53xGUFoV56ZdHwZg41hYuU5jsF0b6AE6zEC0fEk0RqAwpIg0XKXwDiC6G9ghGsLwWgXolUZFzVxWAxjph3TgRyLsuFHIATsfQLS1gQRWw7laOMARGyyQUi61z5k/QiKRd1Dtq8Qi79e847ZDst/3Al+ROO7N6xn5HGtQWh62DdqiwiOWWyjtipAeLrXNGzvQjq40J5hu/ccIoPvOcbtUlBnFMF8VdZFswowGX6U4Yl+2KOLQHWiW+D2NUPl5/29Ijcb2NEGtYqc/ySw0wlzV2+038muI2AtFXWS2zCsewq3gsl+ZytEZnC/Xmi/011M0FpQYSPW/QRcwWC/80WfA3fcCXdOr2+ElFz+/U74CoFrnkPjFCy97I2tInRdo9T6RkgGku93yrYEz68HZdY3QrKQungC2DoKVCQTifM3g3g6yfboZfY76zCC2CeKHAvMNmPW/U47vogw9kKo4KzkLGMFzONOfFSo0Myk3O3A3xLMLlKowOxk3O/MtQlnj8QKy1C+/U69koCa6/BYQVnK1kcEtUV6kP1OvqsRVkOuV+wYMpuOqfY7ew8C26/7B+s6Y4maQXC7VMG6zFqaHigmvK0aravMZfm5E7SFfMJhdo/WRfZy/NwZ5hHk5vkgWscByNAj1YS5CxStwxCUb3dTQt2T4ToKQvGfO0kbgu3f28J1EIbCP3eWKwl40x8Yrm0ginaLQcg79ZCgX7UJRcEmnSPsncBBv2oZjGLF5sA/70y3oj/vTIcVcIpRHw3+nS1mnLHIzH1JAdV+MPhXk4WkRC5SQU1Sg3711QgJSnwfRWjhFPPuQ33e2b4oIi30WgZDblUd0kPzIbsvhzTRMMCm1yNddClc3iPqOO+ULrD2HSJ15EiEyr2YFFJVPFCeHqSSAh/gvPsZtZx32ptQPkd3xZx24NkYX1EbIsVczQUotivppivhSW1J2undDHDzGhqQfno+HZmHCkhDtYzG5fZzpKOOTUblxmrSUic2gjrv9KSoym8GJH0l6SozC40J9UlbHUnB4vETpK9OPorkZURWkcY6H4VjEbPupLWe9WKwriHpreZfIniyqPOkuSLmuaU3rRtpr4N7hf9/4yfSX+d2Sj6tqZdBKsx5j9Tu6EBa7IRLZLt6OUiRHZoqr62NSJddiHTLKsVJ+uzAWElXLBheRhrN4ZwmpcdakFarNS9bxDnMToMUW9148cTMKyfldvpu0WTecJz0mxEn1x2e+DzScQ6fTAsmZ2xtTz+n5juS5bGlM+m66meSZPl7Y2dnUnjLtmaIsSpxVEdSerkuvwiTmOedIMV38uKUcHfXqwFSflVL4zPDeJxhV3uyBB2/cnx4+sK8QJahqm47Y8PNg9c0JItRedyM2PAxMWqZQVakyrgZMeFg7y8PsS7VeuO70P4bxP3ZRaUGWZ6OmVv9oSk63llBVqkLh4Zt9IaW1Tt6tjfIYhWRY86YGCKH/WWGmUOWraaHxzw1yV2DMxQ2zHq51Tmyfl2o99bI25Jig2vP54ljDp9ykLWsdj3fkO9vvWPKtL8wndo7YeztOy8bcKh5OVncyhq2XNrd96ZpLrjy5/qYb/l8S7q2r1NJlj/bf7b/bP/Z/rP9Z/vP9p/tP9t/tv9s//3djwA=`,ml=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,disabled:r,style:a,picture:o,description:s,tile:c,offsetX:l=0,offsetY:f=0,isDragging:p,onHide:m,onShow:h,onKeyDownCapture:g,onFocus:_,onBlur:v,loadingPanel:y,...b}=e,[x,S]=(0,u.useState)(!1),[C,w]=(0,u.useState)(null),[T,E]=(0,u.useState)(null),[D,O]=(0,u.useState)(null);(0,u.useEffect)(()=>{E(null),o.getDetails().then(e=>{S(!1),E(e.asUrl()),e.asSVGText?.()&&O(e.asSVGText())}).catch(e=>{console.warn(e),S(!0),E(pl),O(null)})},[o]);let k=i.st(t,()=>({isPictureEditor:()=>!0}),[]),A=(0,u.useMemo)(()=>{if(T||D)return c?(0,d.jsx)(`div`,{style:{backgroundPosition:`${l}px ${f}px`,backgroundImage:`url(${T})`,backgroundRepeat:`repeat`,backgroundSize:`auto`,width:`100%`,height:`100%`,filter:`var(--sxl-image-filter)`}}):(0,d.jsx)(`img`,{style:{flex:`1`,width:`100%`,height:`100%`,border:x?`var(--sxl-color-neutral, grey) solid 1px`:void 0,backgroundColor:x?`var(--sxl-color-base-100, white)`:void 0,boxShadow:x?`0px 0px 3px var(--sxl-color-error, red)`:void 0,objectFit:x?`contain`:void 0,opacity:+!!C,filter:`var(--sxl-image-filter)`},draggable:!1,src:T??void 0,onLoad:()=>{w(!0)},onError:({currentTarget:e})=>{console.log(`error`),e.onerror=null,E(pl),S(!0)},alt:s??`${o.getType()}`})},[C,o,T,D,p,c,l,f]);if(!o.isDeleted())return(0,d.jsxs)(`div`,{className:`picture-editor`,style:{position:`relative`,display:`flex`,flex:`1 1 100%`,filter:p?`drop-shadow(1px 1px 1.5px var(--sxl-color-shadow, rgba(0, 0, 0, .25)))`:void 0,...a,width:`100%`,height:`100%`},tabIndex:0,...b,onKeyDownCapture:e=>{g?.(e)},ref:k,children:[C||x?void 0:y,A]})}));ml.displayName=`PictureEditor`;var hl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:n,className:r,style:i,...a}=e,s=Z(),[c,l]=(0,u.useState)(()=>n.getPicture()),f=(0,u.useMemo)(()=>{let e=n.getStyles();return e.getNormal().getFill().getType()===o.S.Type.None?{backgroundColor:`var(--sxl-sys-color-window)`}:e.getNormal().getFill().toCSS(`adaptive`)},[n]);Ni(n,{onStyleChange:()=>{l(n.getPicture())},onInvalidated:()=>{l(n.getPicture())}});let p=s?.getPaneBounds();if(!s||!p||p.width===0||p.height===0)return null;let m=s.getBoundsFromRange({rowStart:0,colStart:0,rowEnd:0,colEnd:0});return(0,d.jsx)(pe,{...a,className:$(r,`background`),children:(0,d.jsx)(_e,{fill:!0,ref:t,className:`background-box`,style:{pointerEvents:`none`,...f,...i},children:c?(0,d.jsx)(ml,{picture:c,tile:!0,offsetX:m?.x??0,offsetY:m?.y??0}):null})})}));hl.displayName=`SheetBackgroundLayer`;var gl=e=>e.getSelectedRuns().map(e=>`${e.min}-${e.max}:${e.value?`A`:`s`}`).join(`|`),_l=(0,u.memo)(e=>{let{header:t,renderCell:n,className:r,...i}=e,[a,o]=(0,u.useReducer)(e=>e+1,0),s=(0,u.useMemo)(()=>({}),[a]);Ni(t,{onSizesChange:()=>o()},{ignoreModelChange:!0});let c=(0,u.useRef)(gl(t));return Ni(t.getSheet()?.getSelection(),{onChange:()=>{let e=gl(t);e!==c.current&&(c.current=e,o())}}),(0,d.jsx)(rr,{...i,className:$(r,t.getAxis()===`row`?`headers row`:`headers column`),renderCell:n,cacheToken:s})});_l.displayName=`SheetHeaderCellLayer`;var vl=Object.freeze({x:0,y:0,width:0,height:0}),yl={ignoreModelChange:!0},bl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:r,movable:i,overrideBounds:a,onRefLoad:o,onRefUnload:s,onHide:c,onShow:l,onUnFocus:f,isDragging:p,dragStart:m,style:h,disabled:g,renderMovable:_,onReposition:v,...y}=e,b=Z(),[x,S]=(0,u.useState)(null),[C,w]=(0,u.useState)(!1),[,T]=(0,u.useReducer)(e=>e+1,0),E=(0,u.useRef)(null),D=a??i.getBounds(),O=D?b.toPaneBounds(D):vl;(0,u.useLayoutEffect)(()=>{i.isSelected()&&!p&&v?.()},[v,i,p,O.x,O.y,O.width,O.height]),Ni(i,{onBoundsChange:()=>{T()},onSelectionChange:()=>{let e=!!E.current&&n.b.hasFocus(E.current,!0);!C&&!e||i.isSelected()||(b.focus(),f?.())}}),Ni(i,{onRequestFocus:()=>E.current?n.b.whenFocus(E.current,!0):Promise.resolve(!1)},yl),(0,u.useEffect)(()=>{let e=E.current;if(e)return o(e),()=>{s(e)}},[]);let k=(0,u.useMemo)(()=>{let{width:e,height:t}=O;return _({movable:i,disabled:g,isDragging:p,style:{position:`relative`,left:0,top:0,width:e,height:t},onHide:c,onShow:l})},[b,i,O.width,O.height,g,p]);return(0,d.jsx)(`div`,{className:`movable`,tabIndex:0,ref:da([E,t]),style:{display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,position:`absolute`,maxWidth:`auto`,maxHeight:`auto`,minWidth:`auto`,minHeight:`auto`,left:O.x,top:O.y,width:O.width,height:O.height,...h},onMouseDown:async e=>{let t=e.shiftKey||e.ctrlKey,n=i.isSelected(),r=e.currentTarget;t&&n?i.unselect():(n&&!t||await i.select({addToSelection:t}),m(e.nativeEvent,r),r.focus())},onFocus:e=>{e.relatedTarget&&!x&&S(e.relatedTarget),w(!0)},onBlur:e=>{x&&!E?.current?.contains(e.relatedTarget)&&S(null),e.relatedTarget&&w(!1)},...y,children:k})})),xl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{movables:r,movablesView:a,renderMovable:o,onUnFocus:s,onFocus:c,disabled:l=!1,disableDrag:f=!1,disableResize:p=!1,className:m,style:h,renderDirections:g=[`nw`,`n`,`ne`,`w`,`e`,`sw`,`s`,`se`],onFirstRender:_,...v}=e,y=Z(),b=y.getPaneBounds(),x=y.getVisibleRange(),S=`${x.rowStart}:${x.colStart}:${x.rowEnd}:${x.colEnd}`,C=i.X(_,[_]),w=i.X(s,[s]),T=i.X(c,[c]),[E,D]=(0,u.useState)([]),[O,k]=(0,u.useState)(!1),[A,j]=(0,u.useState)(!1),M=(0,u.useRef)(!0),N=(0,u.useRef)(new Map),P=(0,u.useRef)(new Map),F=(0,u.useRef)(new Map),I=(0,u.useRef)(new Map),L=(0,u.useRef)(null),[R,z]=Q(`movable-drag`,null),B=(0,u.useRef)(null),V=(0,u.useRef)(``),H=(0,u.useCallback)(e=>{B.current=e,z(e)},[z]),U=(0,u.useRef)(new Map),W=(0,u.useRef)({onRequestFocus:e=>(le(e),Promise.resolve(!1))}),G=(0,u.useRef)(null),K=(0,u.useRef)(null),[q,J]=(0,u.useReducer)(e=>e+1,0);(0,u.useLayoutEffect)(()=>{J()},[r]),Ni(r,{onCollectionChange:()=>{let e=r.getItems({address:y.getVisibleRange(),ignoreHidden:!0}),t=U.current;t.forEach(e=>{e()}),t.clear();let n=W.current,i=e.length;for(let r=0;r<i;r++){let i=e[r];if(i.isDeleted())continue;let a=i.addListeners(n);t.set(i,a)}J()},onInvalidated:()=>{J()}}),Ni(a,{onMovableSelectionChange(e){ee(),J()}});let Y=(0,u.useCallback)(()=>{K.current?.updateRect()},[]),ee=()=>{let e=[],t=a.getMovableSelection();t.forEach(n=>{let r=F.current.get(n);r&&t.indexOf(n)!==-1&&e.push(r)}),D(t=>n.I.isEqualArrays(t,e)?t:e)},X=(0,u.useRef)(null),te=(0,u.useRef)(null),ne=(0,u.useMemo)(()=>(te.current||=new Promise(e=>{X.current=e}),te.current),[]),re=(0,u.useRef)(null),ie=i.X(async(e,t)=>{re.current=t??null,await(async()=>!(!await ne.then()||!K.current))()&&re.current===t&&K.current.dragStart(e,t)},[E]),[ae,oe]=(0,u.useState)(!1),se=(0,u.useRef)(null),ce=(0,u.useRef)(null),le=i.X(async(e=null)=>{if(e||=a.getMovableSelection()[0],!e)return w?.(),!1;let t=F.current.get(e);return t?(await n.b.whenFocus(t),t.focus(),ce.current=t,se.current=null,!0):(se.current=e,!1)},[a]);(0,u.useEffect)(()=>{ae&&E.length>0&&ce.current!==E[0]&&le(),M.current&&=(C?.(),!1)},[E]);let ue=(0,u.useMemo)(()=>{let e=r.getItems({address:y.getVisibleRange(),ignoreHidden:!0});if(e.length===0&&N.current.size===0&&!R)return null;let t=(t,n,r,i=!0)=>{let a=t.isSelected(),s=R?R[t.getId()]??null:null,c=!!s||a&&(A||O);return(0,d.jsx)(bl,{tabIndex:r,movable:t,overrideBounds:s,onRefLoad:e=>{se.current===t&&(e.focus(),ce.current=e,se.current=null),F.current.set(t,e),P.current.set(e,t),n.rendered=!0,ee()},onRefUnload:e=>{F.current.delete(t),P.current.delete(e),n.rendered=!1,ee()},onUnFocus:w,onHide:e=>{n.onHide=e},onShow:e=>{n.onShow=e},isDragging:c,disabled:l,renderMovable:o,onReposition:Y,dragStart:ie,onMouseUp:()=>{re.current=null,I.current.size>0&&(k(!1),j(!1),fe())},style:{opacity:s?.7:i?O&&a?.7:void 0:0,zIndex:c?t.getZIndex()+e.length:void 0,pointerEvents:i?void 0:`none`,cursor:A&&a?`grabbing`:l||f?`initial`:`move`,boxShadow:!a||A&&!O?void 0:`1px 1px 2px 2px rgba(0,0,0,.15)`}},`movable-${t.getId()}`)},n=N.current,i=new Map,s=[],c=()=>({frame:null,shown:null,onShow:null,onHide:null,rendered:!1,doShow:(e,t)=>{if(!t||!0===t.shown)return;t.shown=!0;let n=++t.visibilityRequestId;requestAnimationFrame(()=>{let r=N.current.get(e);r&&n===t.visibilityRequestId&&(t.onShow?.(e),r.shown=!0)})},doHide:async(e,t)=>{if(!t||!1===t?.shown)return;t.shown=!1;let n=++t.visibilityRequestId,r=await Promise.resolve(t.onHide?.(e));n===t.visibilityRequestId&&!1!==r&&(t.shown=!1,N.current.delete(e),J())},visibilityRequestId:0}),u=e.length;for(let r=0;r<u;r++){let a=e[r];if(a.isDeleted())continue;let o=n.get(a)??c();o.previewOnly=!1,o.frame=t(a,o,r,!0),s.push(o.frame),o.doShow(a,o),n.delete(a),i.set(a,o)}let p=[];return a.getMovableSelection().forEach(e=>{if(i.has(e))return;let r=n.get(e),a=!!R?.[e.getId()];if(r){if(r.previewOnly&&!a)return}else{if(!a)return;r=c(),r.previewOnly=!0}r.frame=t(e,r,-1,!1),p.push(r.frame),n.delete(e),i.set(e,r)}),n.forEach((e,r)=>{e.frame=t(r,e,-1,!1),p.push(e.frame),e.doHide(r,e),n.delete(r),i.set(r,e)}),N.current=i,ee(),[...p,...s]},[q,y,S,R,o,l,f,p,O,A]),de=i.X((e,t)=>{V.current=t,I.current.clear();let n=E.length;for(let e=0;e<n;e++){let t=E[e],n=P.current?.get(t);if(!n){console.warn(`invalid element`,n);continue}let r=n.getBounds();r&&I.current.set(t,{movable:n,startBounds:y.toPaneBounds(r)})}L.current?.();let r={capture:!0,once:!0},i=()=>he();window.addEventListener(`pointerup`,i,r),L.current=()=>window.removeEventListener(`pointerup`,i,r)},[y,E]),fe=(0,u.useCallback)(()=>{let e=B.current,t=I.current;if(I.current=new Map,!e||t.size===0)return void H(null);let i=!1;if(t.forEach(t=>{let r=e[t.movable.getId()];r&&!n.I.isEqualBounds(r,t.movable.getBounds()??void 0)&&(i=!0)}),i){try{r.updateSelected(t=>{let n=e[t.getId()];n&&t.setBounds(n)},V.current)}catch(e){console.warn(e)}H(null)}else H(null)},[r,H]),me=(0,u.useCallback)(()=>{L.current?.(),L.current=null,I.current=new Map,H(null)},[H]),he=i.X(()=>{L.current=null,re.current=null,I.current.size!==0&&(k(!1),j(!1),fe())},[fe]),ge=(0,u.useRef)(null);(0,u.useEffect)(()=>{ge.current&&(ge.current.onscroll=e=>{e.preventDefault(),e.srcElement.scrollTop=0,e.srcElement.scrollLeft=0})},[ge.current]);let ve=i.st(t,()=>({isMovableLayer:()=>!0,focusMovable:le,focus:()=>{le()}}),[a]),[ye,be]=(0,u.useState)(null),xe=(0,u.useCallback)(e=>{e&&be(e)},[]),[Se,Ce]=(0,u.useState)(null),we=(0,u.useRef)(!1),Te=(0,u.useRef)(!1),Ee=(0,u.useRef)(!1);(0,u.useEffect)(()=>{if(l||E.length===0||Ee.current||we.current)return;if(Te.current)return void requestAnimationFrame(()=>{K.current&&G.current&&K.current.refTargets.length>0&&(Ee.current=!0,X.current?.(!0),K.current.updateRect()),D([...E])});we.current=!0;let e=(0,u.lazy)(async()=>{try{let e=await Promise.resolve().then(()=>require("./B_WV3e3yexp3dKaz.cjs"));return we.current=!1,Te.current=!0,D([...E]),e}catch(e){return console.warn(e),X.current?.(!1),we.current=!1,Ce(null),{default:()=>null}}});Ce(e)},[E,l,f,p]);let De=(0,u.useMemo)(()=>!Se||l?null:(0,d.jsx)(u.Suspense,{children:(0,d.jsx)(Se,{className:$({dragging:O||A||!!R,resizing:O,moving:A}),container:null,ref:K,target:K.current?E:[],draggable:!l&&!f,resizable:!l&&!p,individualGroupable:!0,edgeDraggable:!1,throttleDrag:2,throttleResize:2,origin:!1,keepRatio:!1,renderDirections:g,onResizeStart:e=>{de(e.target,n.q(`op.resizeMovable`))},onResize:e=>{if(I.current.size===0)return void e.stopDrag();k(!0);let t=e.direction[0]!==0&&e.direction[1]!==0,n={},r=0,i=0,a=E.length;for(let o=0;o<a;o++){let a=E[o],s=I.current.get(a),c=P.current.get(a);if(!s||!c){console.warn(`invalid element`);continue}let l=e.dist[0],u=e.dist[1],d=e.drag.dist[0],f=e.drag.dist[1],p=s.startBounds.width,m=s.startBounds.height;o===0?(r=p,i=m):(l*=p/r,d*=p/r,u*=m/i,f*=m/i);let h={...s.startBounds};if(h.width=Math.max(0,p+l),h.height=Math.max(0,m+u),e.direction[0]===-1&&(h.width=Math.max(0,Math.min(s.startBounds.x+p,p-d))),e.direction[1]===-1&&(h.height=Math.max(0,Math.min(s.startBounds.y+m,m-f))),t&&(c.isLockAspectRatio()||e.inputEvent?.shiftKey)){let e=p/m,t=h.width/h.height;t>e?h.height=h.width/e:t<e&&(h.width=h.height*e)}e.direction[0]===-1&&(h.x=Math.max(0,Math.min(s.startBounds.x+p,s.startBounds.x+p-h.width))),e.direction[1]===-1&&(h.y=Math.min(s.startBounds.y+m,s.startBounds.y+m-h.height)),n[s.movable.getId()]=y.toAbsoluteBounds(h)}H(n)},onResizeEnd:e=>{k(!1),fe()},onDragStart:e=>{de(e.target,n.q(`op.moveMovable`))},onDrag:e=>{if(I.current.size===0)return void e.stopDrag();j(!0);let t={};for(let n=0;n<E.length;n++){let r=E[n],i=I.current.get(r);i?t[i.movable.getId()]=y.toAbsoluteBounds({...i.startBounds,x:i.startBounds.x+e.translate[0],y:i.startBounds.y+e.translate[1]}):console.warn(`invalid element`)}H(t)},onDragEnd:e=>{},onMouseUp:e=>{}})}),[q,Se,E,y,l,f,p,O,A,R]);return De||ue?(0,d.jsx)(pe,{className:$(m,`movable-area`),onPointerDown:e=>{e.button===0&&a.getMovableSelection().length!==0&&(a.selectMovables([]),w?.())},children:(0,d.jsx)(_e,{fill:!0,className:`_movable-area_r4xkr_5`,style:{pointerEvents:`none`,...h,overflow:`hidden`,willChange:`transform`},ref:da([ve,ge,xe]),...v,children:(0,d.jsx)(`div`,{className:`movable-scroll`,style:{position:`absolute`,left:0,top:0,width:b.width,height:b.height},...v,children:(0,d.jsxs)(`div`,{ref:G,style:{position:`absolute`,pointerEvents:`auto`},onFocus:e=>{T?.(),oe(!0)},onBlur:e=>{oe(!1)},onKeyDownCapture:e=>{if(e.isDefaultPrevented())return;let t=()=>{e.preventDefault(),e.stopPropagation()};if(e.which===i.Zt.Escape){if(I.current.size>0)return K.current?.stopDrag(),k(!1),j(!1),me(),void t();let e=a.getMovableSelection(),n=[...e];E.forEach(e=>{if(n.length===0)return;let t=P.current.get(e);if(!t)return;let r=n.indexOf(t);n.splice(r,1)}),n.length!==e.length&&a.selectMovables(n),n.length===0&&w?.(),t();return}},onPointerDown:e=>{e.stopPropagation()},children:[ue,De]})})})}):null})),Sl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,disabled:r,style:a,movable:o,description:s,isDragging:c,onHide:l,onShow:f,...p}=e;(0,u.useEffect)(()=>{},[s]);let m=i.st(t,()=>({isEmptyFrame:()=>!0}),[]),[h,{height:g,width:_}]=_a(),v=Z();return(0,d.jsx)(`div`,{className:`unknown-editor`,...p,ref:da([m,h]),style:{width:`100%`,height:`100%`,border:`var(--sxl-color-neutral, grey) solid 1px`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:v.getZoom(),display:`flex`,position:`relative`,filter:r?`blur(1px)`:void 0,boxShadow:c?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,overflow:`hidden`,wordBreak:`break-word`,...a},children:s})})),Cl=e=>{let t=2**53-1,n=2**53-1,r=0,i=0;for(let a of e){let e=a.getBounds();e&&(t=Math.min(e.x,t),n=Math.min(e.y,n),r=Math.max(e.x+e.width,r),i=Math.max(e.y+e.height,i))}return{x:t,y:n,width:r-t,height:i-n}},wl=(e,t=!0)=>{let n=[],r=t?`x`:`y`,i=t?`y`:`x`,a=t?`width`:`height`,o=0,s=2**53-1,c=0;for(let t of e){let e=t.getBounds();e&&(o+=e[a],s=Math.min(e[r],s),c=Math.max(e[r]+e[a],c),n.push({bounds:e,movable:t}))}let l=(c-s-o)/(e.length-1);n.sort((e,t)=>e.bounds[r]===t.bounds[r]?e.bounds[i]-t.bounds[i]:e.bounds[r]-t.bounds[r]);let u=new Map;u.set(n[0].movable,n[0].bounds);for(let e=1;e<n.length-1;e++){let t=n[e-1].bounds,i={...n[e].bounds};i[r]=t[r]+t[a]+l,n[e].bounds=i,u.set(n[e].movable,i)}return u.set(n[n.length-1].movable,n[n.length-1].bounds),u},Tl=(e,t)=>n=>{let r=n.getBounds();r&&n.setBounds({x:r.x+e,y:r.y+t})},El=(e,t)=>n=>{let r=n.getBounds();if(!r)return;let i=t?1+e:1/(1+e),a=Math.sqrt(r.width**2+r.height**2),o=Math.atan2(r.height,r.width),s=i*a;if(s<10)return;let c=s*Math.cos(o),l=s*Math.sin(o);n.setBounds({x:r.x+(r.width-c)/2,y:r.y+(r.height-l)/2,width:c,height:l})},Dl=e=>t=>{t.setRotation(t.getRotation()+e)};function Ol(e,t){let r=t.sheet;if(!r)return()=>{};let i=t,a=i?.notifier,s=i?.editModeHandler,c=(t,n,i,o)=>{e.updateCommand(t,{tags:[`noTransaction`,`noRepeat`],callback:()=>((e,t,n)=>{let i=r.getView();if(i.getMovableSelection().length!==0)try{r.doBatch(()=>{let e=i.getMovableSelection();if(e.length===0)return;let r=n?.(e);for(let n of e)t(n,r)},{description:e}),s?.setMode(null)}catch(e){a?.showError?.(e)}})(n,i,o)})},l=!1,u=()=>{r.getView().getMovableSelection().length===0?l&&=(e.remove(),!1):(l||=(c(`moveToFront`,n.q(`op.bringToFront`),e=>e.moveToFront()),c(`moveForward`,n.q(`op.bringForward`),e=>e.moveForward()),c(`moveToBack`,n.q(`op.sendToBack`),e=>e.moveToBack()),c(`moveBackward`,n.q(`op.sendBackward`),e=>e.moveBackward()),c(`toggleLockAspectRatio`,n.q(`op.lockAspectRatio`),e=>e.setLockAspectRatio(!e.isLockAspectRatio())),c(`formatAnchorTypeTwoCell`,n.q(`op.anchor`),e=>e.setAnchorType(o.x.Type.TwoCell)),c(`formatAnchorTypeOneCell`,n.q(`op.anchor`),e=>e.setAnchorType(o.x.Type.OneCell)),c(`formatAnchorTypeAbsolute`,n.q(`op.anchor`),e=>e.setAnchorType(o.x.Type.Absolute)),c(`formatDrawAlignLeft`,n.q(`op.alignLeft`),(e,t)=>e.setBounds({x:t.x}),Cl),c(`formatDrawAlignCenter`,n.q(`op.alignCenter`),(e,t)=>e.setBounds({x:(t.width-e.getBounds().width)/2+t.x}),Cl),c(`formatDrawAlignRight`,n.q(`op.alignRight`),(e,t)=>e.setBounds({x:t.width-e.getBounds().width+t.x}),Cl),c(`formatDrawAlignTop`,n.q(`op.alignTop`),(e,t)=>e.setBounds({y:t.y}),Cl),c(`formatDrawAlignMiddle`,n.q(`op.alignMiddle`),(e,t)=>e.setBounds({y:(t.height-e.getBounds().height)/2+t.y}),Cl),c(`formatDrawAlignBottom`,n.q(`op.alignBottom`),(e,t)=>e.setBounds({y:t.height-e.getBounds().height+t.y}),Cl),c(`formatDrawDistributeHorz`,n.q(`op.distributeHorizontally`),(e,t)=>e.setBounds(t.get(e)),e=>wl(e,!0)),c(`formatDrawDistributeVert`,n.q(`op.distributeVertically`),(e,t)=>e.setBounds(t.get(e)),e=>wl(e,!1)),c(`formatDrawNudgeLeft`,n.q(`op.nudgeMovable`),Tl(-1,0)),c(`formatDrawNudgeRight`,n.q(`op.nudgeMovable`),Tl(1,0)),c(`formatDrawNudgeUp`,n.q(`op.nudgeMovable`),Tl(0,-1)),c(`formatDrawNudgeDown`,n.q(`op.nudgeMovable`),Tl(0,1)),c(`formatDrawNudgeLeftLarge`,n.q(`op.nudgeMovable`),Tl(-10,0)),c(`formatDrawNudgeRightLarge`,n.q(`op.nudgeMovable`),Tl(10,0)),c(`formatDrawNudgeUpLarge`,n.q(`op.nudgeMovable`),Tl(0,-10)),c(`formatDrawNudgeDownLarge`,n.q(`op.nudgeMovable`),Tl(0,10)),c(`formatDrawSizeIncrease`,n.q(`op.resizeMovable`),El(.1,!0)),c(`formatDrawSizeDecrease`,n.q(`op.resizeMovable`),El(.1,!1)),c(`formatDrawRotateLeft`,n.q(`op.rotateMovable`),Dl(-10)),c(`formatDrawRotateRight`,n.q(`op.rotateMovable`),Dl(10)),c(`deleteDrawings`,n.q(`op.deleteMovable`),e=>e.delete()),e.updateCommand(`selectAllDrawings`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=r.getView(),t=e.getMovableSelection();e.selectMovables(r.getMovables().getItems(),!0),e.selectMovables(t,!0)}}),!0),(()=>{let t=r.getView().getMovableSelection()[0]??null;e.updateCommand(`formatAnchorTypeTwoCell`,{state:t?.getAnchorType?.()===o.x.Type.TwoCell}),e.updateCommand(`formatAnchorTypeOneCell`,{state:t?.getAnchorType?.()===o.x.Type.OneCell}),e.updateCommand(`formatAnchorTypeAbsolute`,{state:t?.getAnchorType?.()===o.x.Type.Absolute}),e.updateCommand(`toggleLockAspectRatio`,{state:t?.isLockAspectRatio()??!1})})())};return u(),r.getView().addListeners({onMovableSelectionChange:u})}var{CommandScopeProvider:kl}=i.Jt,Al=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:n,className:r,propsMovable:a,renderMovable:o}=e;Pi(n,[`onProtectionChange`]);let s=!n.getProtection().isObjectsAllowed();(0,u.useEffect)(()=>{s&&n.getView().getMovableSelection().length>0&&n.getView().selectMovables([])},[s,n]);let c=i.ot(),l=i.Ct(),f=(0,u.useMemo)(()=>({sheet:n,notifier:c,editModeHandler:l}),[n,c,l]);return(0,d.jsx)(kl,{spec:{scopeName:{key:`layer:movable`,name:`movable`},contributor:{dynamic:Ol},data:f},order:fe().zIndex,children:(0,d.jsx)(xl,{ref:t,className:$(r,`movable`),movables:n.getMovables(),disableResize:s,disableDrag:s,disabled:s,movablesView:n.getView(),renderMovable:o,...a,onFocus:()=>{a?.onFocus?.()}})})})),jl=new class{constructor(){this._taskPanes=new Map}registerTaskPane(e,t=!1){let r=e.key.toLowerCase();if(!t&&this._taskPanes.has(r))throw Error(`Task pane with key '${r}' is already registered.`);this._taskPanes.set(r,function(e){let{getTitle:t,getIcon:r}=e,a=e.key;return{...e,getTitle:()=>{let r=i.Jt.DefaultCommandRegistry.findByKey(a)?.def;return typeof r?.label==`string`?r.label:n.D.lookup(`cmd.${a}.label`)??t.call(e)},getIcon:()=>{let t=i.Jt.DefaultCommandRegistry.findByKey(a)?.def;return typeof t?.icon==`string`?t.icon:r?.call(e)}}}(e))}unregisterTaskPane(e){if(e=e.toLowerCase(),!this._taskPanes.has(e))throw Error(`Task pane with key '${e}' is not registered.`);this._taskPanes.delete(e)}getRegisteredTaskPane(e){return e=e.toLowerCase(),this._taskPanes.get(e)??null}findContributions(e){if(!e)return n.I.EmptyArray;let t=[];e=(e=e.toLowerCase()).replace(/\/+$/g,``);for(let n of this._taskPanes.values()){let r=n.contributionPoints;if(r&&r.length!==0)for(let i of r)i=i.toLowerCase().replace(/\/+$/g,``),i.startsWith(e)&&t.push(n)}return t}},Ml=(0,u.createContext)(void 0),Nl=({children:e,renderArea:t,onUpdateArea:r,registry:a=jl})=>{let o=(0,u.useRef)(null),s=(0,u.useRef)(null),[c,l]=(0,u.useState)(null),[d,f]=(0,u.useState)(null),p=i.X(e=>{let n=t({registry:a,onClose:()=>{f(null),r?.(null)},ref:e=>{e&&f(e)}});return r?.(n),n},[t,a,c]);(0,u.useEffect)(()=>{if(d&&!s.current){let e=d.getActive();e&&p(e)}},[t,a]);let m=(0,u.useMemo)(()=>({activate(e,t){s.current!==e&&(o.current?o.current.activate(e,t):(l({key:e,options:t}),p(e)))},getActive(){let e=o.current;return e?e.getActive():null},getOpen:()=>[],close:e=>n.I.DonePromise,addListener:()=>()=>{}}),[]);return(0,u.useEffect)(()=>{d&&c&&(d.activate(c.key,{autoFocus:!0,...c.options}),l(null))},[c,d]),(0,u.createElement)(Ml.Provider,{value:d??m},e)},Pl={activate(e,t){console.warn(`No TaskPaneArea available to activate task pane`,e,t)},getActive:()=>null,getOpen:()=>n.I.EmptyArray,close:e=>n.I.DonePromise,addListener:()=>()=>{}},Fl=(e=!1)=>{let t=(0,u.useContext)(Ml),[n,r]=(0,u.useReducer)(e=>e+1,0);return(0,u.useEffect)(()=>{if(!e&&t)return t.addListener({onChange:()=>{r()}})},[t]),t||Pl},Il={TaskPaneArea:`_TaskPaneArea_1m8hz_5`,TaskPaneTitle:`_TaskPaneTitle_1m8hz_13`,TaskPaneFrame:`_TaskPaneFrame_1m8hz_36`,TaskPaneAreaFrames:`_TaskPaneAreaFrames_1m8hz_55`,TaskPaneAreaFrameHost:`_TaskPaneAreaFrameHost_1m8hz_63`,TaskPaneAreaFrameHidden:`_TaskPaneAreaFrameHidden_1m8hz_71`,TaskPaneStrip:`_TaskPaneStrip_1m8hz_75`,TaskPaneStripItem:`_TaskPaneStripItem_1m8hz_88`,TaskPaneStripItemIcon:`_TaskPaneStripItemIcon_1m8hz_117`,TaskPaneStripItemLabel:`_TaskPaneStripItemLabel_1m8hz_127`,TaskPaneStripItemLabelOpen:`_TaskPaneStripItemLabelOpen_1m8hz_134`,TaskPaneStripItemLabelClip:`_TaskPaneStripItemLabelClip_1m8hz_139`,TaskPaneStripItemLabelText:`_TaskPaneStripItemLabelText_1m8hz_146`},Ll=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,title:r,icon:i,onClose:a,readOnly:o,focused:s,side:c=`right`,style:l,className:f,...p}=e;return(0,d.jsxs)(`div`,{ref:t,className:(0,u.useMemo)(()=>$(`taskpane-title`,f,Il.TaskPaneTitle,{focused:s}),[f,s]),style:l,...p,children:[(0,d.jsx)(`div`,{className:`title`,style:{flex:`1 1 100%`},children:r}),(0,d.jsx)(`div`,{"aria-label":`close`,role:`button`,style:{width:24,height:24,borderRadius:`50%`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`},onPointerDown:e=>{e.stopPropagation()},onPointerUp:()=>{a()},children:(0,d.jsx)(`div`,{style:{fontSize:`0.7em`},children:`✕`})})]})}));Ll.displayName=`TaskPaneTitle`;var Rl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,entry:r,close:a,listenerContainer:o,model:s,args:c,onMounted:l,onUnmounted:f,wrapperPane:p,propsPane:m,componentTitle:h=Ll,style:g,className:_,...v}=e,[y,b]=(0,u.useState)(null),[x,S]=(0,u.useState)(null),C=i.X(a,[a]),w=i.rn(),T=(0,u.useRef)(null),E=(0,u.useRef)(null);(0,u.useEffect)(()=>(l?.(r),()=>{f?.(r)}),[r]);let D=(0,u.useRef)([]),O=(0,u.useMemo)(()=>({addListener:e=>{let t=o?.(e)??(()=>{});return D.current.push(t),t},close:()=>{C?.()},focus:e=>{T.current?.focus(e)}}),[o]);(0,u.useEffect)(()=>()=>{for(let e of D.current)e();D.current=[]},[]);let k=(0,u.useMemo)(()=>(0,d.jsx)(r.componentTitle??h,{ref:E,title:r.getTitle(),icon:null,readOnly:!1,focused:x!==null,onClose:C,onPointerDown:e=>{}}),[r,h,x,w]),A=(0,u.useMemo)(()=>{let e=r.component,n=p,i=(0,d.jsx)(e,{entryKey:r.key,model:s,args:c,frame:O,ref:t,...m});return n&&(i=(0,d.jsx)(n,{children:i})),i},[r,s,c,O,t,p]);return(0,d.jsxs)(`div`,{className:$(`taskpane-frame`,_,Il.TaskPaneFrame),tabIndex:0,ref:T,style:g,onPointerDown:async e=>{let t=e.currentTarget;t.contains(document.activeElement)||t.focus()},onFocus:e=>{e.relatedTarget&&!y&&b(e.relatedTarget),S(e.currentTarget)},onBlur:e=>{y&&!T?.current?.contains(e.relatedTarget)&&b(null),e.relatedTarget&&S(null)},...v,children:[(0,d.jsx)(`div`,{style:{flex:`0 0 auto`,display:`flex`,flexDirection:`column`,width:`100%`,alignItems:`stretch`,justifyContent:`stretch`},children:k}),(0,d.jsx)(`div`,{className:`taskpane-frame-content`,style:{flex:`1 1 auto`,minHeight:0,width:`100%`,overflow:`auto`,height:`100%`,display:`flex`},children:A})]})}));Rl.displayName=`TaskPaneFrame`;var zl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,title:a,side:o=`right`,taskPanes:s,onSelect:c,selected:l,registry:f=jl,style:p,iconsOnly:m,className:h,...g}=e,_=(0,u.useMemo)(()=>s.map(e=>{let t=f.getRegisteredTaskPane(e);if(!t)return null;let n=t.getIcon?.();typeof n==`string`&&(n=(0,d.jsx)(r.r,{iconKey:n}));let i=t.getTitle(),a=e===l,o=!n||!m&&a;return(0,d.jsxs)(`div`,{title:o?void 0:i,className:$(`taskpane-strip-item`,Il.TaskPaneStripItem,{selected:a}),onClick:()=>c(e),children:[n?(0,d.jsx)(`span`,{className:Il.TaskPaneStripItemIcon,children:n}):null,(0,d.jsx)(`span`,{className:$(Il.TaskPaneStripItemLabel,{[Il.TaskPaneStripItemLabelOpen]:o}),children:(0,d.jsx)(`span`,{className:Il.TaskPaneStripItemLabelClip,children:(0,d.jsx)(`span`,{className:Il.TaskPaneStripItemLabelText,children:i})})})]},e)}),[s,l,c,f,m,i.rn()]);return(0,d.jsx)(`div`,{ref:i.st(t,()=>({isTaskPaneStrip:()=>!0}),[]),className:(0,u.useMemo)(()=>$(`taskpane-strip`,h,Il.TaskPaneStrip),[h]),style:p,...g,children:_})}));zl.displayName=`TaskPaneStrip`;var Bl=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{className:n=``,registry:r=jl,model:a,onOpen:o,onClose:s,wrapperPane:c,propsPane:l,wrapperFrame:f,propsFrame:p,componentTitle:m,componentStrip:h=zl,alwaysShowStrip:g,side:_=`right`,style:v}=e,y=_!==`right`,b=i.X(o,[o]),x=i.X(s,[s]),[S,C]=(0,u.useState)(null),w=(0,u.useRef)(null),[T,E]=(0,u.useState)([]),[D,O]=(0,u.useState)({}),k=i.X((e,t)=>{O(n=>{if(n[e]===t)return n;let r={...n};return t===void 0?delete r[e]:r[e]=t,r})},[]),A=(0,u.useRef)(new Set),j=(0,u.useRef)(new Set),M=i.X(()=>{let e=Array.from(j.current);for(let t of e)try{t.onChange?.()}catch(e){console.error(`Error in TaskPaneArea listener:`,e)}},[]),N=i.X(async(e,t=!1)=>{let n=Array.from(A.current),r=n.length,i=!0;for(let e=0;i&&e<r;e++){let t=n[e];if(t.onBeforeHide)try{!1===await Promise.resolve(t.onBeforeHide())&&(i=!1)}catch{i=!1}}return i},[]),P=i.X(e=>{let t=Array.from(A.current),n=t.length,r=T.findIndex(t=>t.key===e);if(r===-1)return;let i=[...T];if(i.splice(r,1),k(e,void 0),E(i),i.length===0)C(null),w.current=null,x?.();else{let e=i[Math.min(r,i.length-1)];C(e),w.current=e.key,e.keepMounted&&requestAnimationFrame(()=>e.refPaneEl?.current?.focus?.())}for(let e=0;e<n;e++){let n=t[e];try{n.onHide?.()}catch{}}},[x,T]),F=i.X(async(e,t)=>{let n=r.getRegisteredTaskPane(e);if(!n)return void console.warn(`Invalid taskpane '${e}'`);let i=w.current===e,o=T.find(t=>t.key===e);if(i&&!o)return void k(e,t?.args);if(!i&&S&&!await N(S.key))return;if(o)return k(e,t?.args),C(o),w.current=e,void((o.keepMounted||i)&&requestAnimationFrame(()=>o.refPaneEl?.current?.focus?.()));k(e,t?.args);let s=(0,u.createRef)(),f={current:null},h={key:e,elem:(0,d.jsx)(Rl,{ref:e=>{f.current=e,e===null&&(w.current=null)},entry:n,model:a,close:async()=>{await N(e)&&P(e)},wrapperPane:c,propsPane:l,componentTitle:m,listenerContainer:e=>(A.current.add(e),()=>{A.current.delete(e)}),onMounted:t=>{t.key===e&&(w.current=null),b?.()},onUnmounted:e=>{},...p}),ref:s,keepMounted:n.keepMounted,refPaneEl:f};E(t=>{if(t.findIndex(t=>t.key===e)!==-1)return t;let n=[...t];return n.push(h),n}),C(h),w.current=e},[S,T,l,m]);(0,u.useEffect)(()=>{S&&!w.current&&F(S.key,{args:D[S.key]}),M()},[p,a,T,S,D]);let I=i.st(t,()=>{let e=Object.freeze(T.map(e=>e.key));return{activate:F,getActive:()=>S?.key??null,getOpen:()=>e,async close(e){await N(e)&&P(e)},addListener:e=>(j.current.add(e),()=>{j.current.delete(e)})}},[r,l,a,S,T]),L=(0,u.useMemo)(()=>{if(T.length<=1&&!g)return null;let e={className:Il.TaskPaneAreaStrip,taskPanes:Object.freeze(T.map(e=>e.key)),selected:S?.key,side:_,onSelect:e=>{F(e)},registry:r};return(0,d.jsx)(h,{...e})},[T,S,r,g,_,h]),R=e=>(0,u.cloneElement)(e.elem,{model:a,args:D[e.key],propsPane:l,wrapperPane:c,componentTitle:m,...p}),z=S?.key??null,B=f,V=T.length===0?null:(0,d.jsx)(`div`,{className:Il.TaskPaneAreaFrames,style:{display:`flex`,flex:`1 1 100%`,minWidth:0,minHeight:0,position:`relative`},children:T.map(e=>{let t=e.key===z;return t||e.keepMounted?(0,d.jsx)(`div`,{className:$(Il.TaskPaneAreaFrameHost,!t&&Il.TaskPaneAreaFrameHidden),style:{display:t?`flex`:`none`,flex:`1 1 100%`,minWidth:0,minHeight:0},children:B?(0,d.jsx)(B,{children:R(e)}):R(e)},e.key):null})}),H=y?L:V,U=y?V:L;return(0,d.jsxs)(`div`,{ref:I,className:$(`taskpane-area`,n,Il.TaskPaneArea),style:v,children:[H,U]})}));Bl.displayName=`TaskPaneArea`;var Vl=`_dropdown_1bnz9_13`,Hl=`white`,Ul=`black`,Wl=(e,t)=>{let n=e.getStyle().getProperties(),r=n.headerRow?.fill?.background??n.wholeTable?.borders?.top?.color?.toString();if(r&&t){let e=t.getStyles().parseColor(r);if(e)return e.toCSS(`adaptive`)}return`var(--sxl-color-neutral, grey)`},Gl={font:`11px/1.5 system-ui, sans-serif`,color:`white`,padding:`1px 8px`,borderRadius:4,whiteSpace:`nowrap`,boxShadow:`0 1px 4px rgba(0,0,0,0.3)`,cursor:`default`},Kl=({handleProps:e,size:t,background:n})=>{let r=t/2-1.5,i=t/3;return(0,d.jsx)(`div`,{...e,style:{...e.style,width:t,height:t},children:(0,d.jsx)(`svg`,{width:t,height:t,viewBox:`0 0 ${t} ${t}`,style:{display:`block`,overflow:`visible`},children:(0,d.jsx)(`path`,{shapeRendering:`crispEdges`,d:`M ${r-i} ${r} L ${r} ${r} L ${r} ${r-i}`,stroke:n,strokeWidth:2,strokeLinejoin:`miter`,fill:`none`})})})},ql=(e,t)=>({rowStart:e.rowStart,colStart:e.colStart,rowEnd:Math.max(e.rowStart,t.rowIndex),colEnd:Math.max(e.colStart,t.colIndex)}),Jl=e=>[{text:e(`table.totals.none`),totals:null},{text:e(`table.totals.average`),totals:101},{text:e(`table.totals.count`),totals:103},{text:e(`table.totals.countNumbers`),totals:102},{text:e(`table.totals.max`),totals:104},{text:e(`table.totals.min`),totals:105},{text:e(`table.totals.stdDev`),totals:107},{text:e(`table.totals.sum`),totals:109},{text:e(`table.totals.var`),totals:110},{text:e(`table.totals.moreFunctions`),totals:`more`}],Yl=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${Ul}' fill='${Hl}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`,Xl=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${Ul}' fill='${Hl}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`,Zl=`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 13.24564,12.979958 H 5.2023009 L 7.500398,10.681861 2.3296796,5.5111425 5.7768252,2.0639969 10.947543,7.2347153 13.24564,4.9366182 Z' stroke='${Ul}' fill='${Hl}'/%3E%3C/g%3E%3C/svg%3E%0A") 12 12, pointer`,Ql=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:a,onEditTable:o,className:s,...c}=e,l=Z(),{visibleTables:f,cacheToken:p}=Cc(a),m=Fl(),h=i.X(async e=>{o?await o(e):(await e.select(),m.activate(`tableDetails`,{}))},[o]),[g,_]=(0,u.useState)(()=>a.getSelection()?.getCoords().cell??null),[v,y]=(0,u.useState)(null),[b,x]=(0,u.useState)(null),S=pn({openDelay:0,closeDelay:400}),[C,w]=(0,u.useState)(null),T=(0,u.useRef)(null),[E,D]=(0,u.useState)(null),[O,k]=(0,u.useState)(null),A=(0,u.useRef)(!1),j=i.X(e=>{e.preventDefault(),e.stopPropagation();let t=l.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let n=a.getTables().getItems({address:t});n.length===1&&n[0].select()},[l,a]),M=i.X(e=>{e.preventDefault(),e.stopPropagation();let t=l.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let n=a.getTables().getItems({address:t});if(n.length===1){let e=n[0].getRange().getCoords(),r={colStart:e.colStart,rowStart:t.rowIndex,colEnd:e.colEnd,rowEnd:t.rowIndex};a.getRange(r).select()}},[l,a]),N=i.X(e=>{e.preventDefault(),e.stopPropagation();let t=l.getCellFromPointer(e.clientX,e.clientY);if(!t)return;let n=a.getTables().getItems({address:t});if(n.length===1){let e=n[0].getRange().getCoords(),r={colStart:t.colIndex,rowStart:e.rowStart,colEnd:t.colIndex,rowEnd:e.rowEnd};a.getRange(r).select()}},[l,a]);Ni(a?.getSelection(),{onChange(e){_(a.getSelection().getCoords().cell)}}),(0,u.useEffect)(()=>{let e=null;if(f&&g){let t=f.length;for(let r=0;r<t&&!e;r++){let t=f[r];if(t.isDeleted())continue;let i=t.getRange().getCoords();n.d.isCellWithinRange(g,i)&&(e=t)}}y(e)},[g,f]);let P=i.X(e=>{if(A.current)return;let t=null;if(f){let n=f.length;for(let r=0;!t&&r<n;r++){let n=f[r];if(n.isClosed()||n.isDeleted())continue;let i=n.getRange().getCoords(),a=l.getBoundsFromRange(i),o=l.getPanePointFromPointer(e.clientX,e.clientY);if(!o)continue;let s=o.x,c=o.y;if(s>=a.x&&s<=a.x+a.width&&c>=a.y&&c<=a.y+a.height){let e=l.getSurfaceSize();s<=0||c<=0||s>=e.width||c>=e.height||(t=n)}}}x(t);let n=t?t.getName():null;t&&n!==T.current&&w(t),T.current=n,S.setTarget(n)},[l,f]),F=i.X(()=>{A.current||(x(null),T.current=null,S.setTarget(null))},[]),I=i.Ct().getMode()?.key===`edit`,L=(0,u.useMemo)(()=>{if(!v||!g||I||!v.isShowTotals())return null;let e=v.getTotalRowRange().getCoords();if(!e||g.rowIndex!==e.rowStart)return null;let t=v.getColumnAt(g.colIndex-e.colStart);return t&&a.getCell(g).isEditAllowed()?{cell:g,column:t}:null},[a,v,g,I,p]),R=i.Ot(),z=(0,u.useRef)(null);z.current=L;let[B]=i.Jt.useCommands([`insertFunctionDialog`]),V=Kc({sheet:a,cell:null,anchor:null,resolveItems:i.X(async()=>Jl(R),[R]),getCurrentText:i.X(()=>{let e=z.current?.column.getTotalsRowFormula();return Jl(R).find(t=>t.totals===e)?.text??null},[R]),onChoose:i.X(e=>{let{totals:t}=e;t===`more`?B?.execute():z.current?.column.setTotalsRowFormula(t??void 0)},[B]),visibleRows:10,label:`totals-picker`}),H=(0,u.useRef)(V);H.current=V;let U=Mn(!0),W=(0,u.useMemo)(()=>({}),[p,L?`${L.cell.rowIndex},${L.cell.colIndex}`:null]),G=i.X((e,t)=>{let r=z.current;return!r||t&&!n.d.isCellWithinRange(r.cell,t)?[]:[{cell:r.cell,value:r}]},[]),K=i.X(e=>{let{value:t,style:i,zoom:a=1,key:o}=e,s=t;if(!i)return null;let c=i.width,l=i.height,u=17*a,f=Math.max(0,(u-l)/2);return(0,d.jsx)(`div`,{style:{...i,position:`absolute`,top:i.top-f,width:c+u,height:l+2*f},children:(0,d.jsx)(`div`,{className:Vl,style:{position:`absolute`,left:c,top:f+(l-u)/2,width:u,height:u,pointerEvents:`auto`},role:`button`,"aria-haspopup":`listbox`,onPointerDown:e=>{if(e.button!==0)return;U(e),e.stopPropagation(),e.preventDefault();let t=H.current;t.isOpen?t.close():t.open({cell:s.cell,anchor:{range:n.d.cellToRange(s.cell)},minWidth:c})},children:(0,d.jsx)(r.r,{iconKey:`ExpandMore`,size:.75*u})})},o)},[]),q=(0,u.useMemo)(()=>{if(!f||f.length===0)return null;let e=[],t=f.length;for(let n=0;n<t;n++){let t=f[n];if(t.isDeleted())continue;let r,i=t===b,o=t===v,s=t.getRange().getCoords(),c=l.getBoundsFromRange(s);if(i||o){let e=t.getStyle().getProperties(),n=e.headerRow?.fill?.background??e.wholeTable?.borders?.top?.color?.toString();if(n&&a){let e=a.getStyles().parseColor(n);e&&(r=e.toCSS(`adaptive`))}r||=`var(--sxl-color-shadow, rgba(0,0,0,.15))`}e.push((0,d.jsx)(`div`,{className:`table-select-row`,style:{position:`absolute`,left:c.x,top:c.y,width:Math.min(16,c.width),height:c.height,pointerEvents:`all`,cursor:Xl},onMouseDown:M},`table-select-row-${t.getName()}`)),e.push((0,d.jsx)(`div`,{className:`table-select-column`,style:{position:`absolute`,left:c.x,top:c.y,width:c.width,height:Math.min(7,c.height),pointerEvents:`all`,cursor:Yl},onMouseDown:N},`table-select-column-${t.getName()}`)),e.push((0,d.jsx)(`div`,{className:`table-select-all`,style:{position:`absolute`,left:c.x,top:c.y,width:Math.min(16,c.width),height:Math.min(16,c.height),pointerEvents:`all`,cursor:Zl},onMouseDown:j},`table-select-${t.getName()}`)),e.push((0,d.jsx)(xn,{className:`table-outline`,range:s,stroke:r??`var(--sxl-color-neutral, grey)`,propsStrokePath:{strokeWidth:.5,style:{willChange:`opacity, filter`,transition:`opacity 80ms ease-in-out, filter 80ms ease-in-out`,opacity:o||i?1:0,filter:i?`drop-shadow(0px 0px 1px ${r})`:void 0}}},`table-outline-${t.getName()}`))}return e},[a,l,b,v,f,p]),J=S.open&&C&&!C.isDeleted()?(0,d.jsx)(on,{className:`table-toolbar`,anchor:{range:C.getRange().getCoords()},placement:{side:`r`,align:`start`},offset:4,whenOff:`clamp`,children:(0,d.jsxs)(`div`,{...S.tipProps,onPointerDown:async e=>{h&&h(C),e.stopPropagation()},style:{...Gl,...S.tipProps.style,background:Wl(C,a),cursor:`pointer`,padding:`2px 6px`,display:`inline-flex`,alignItems:`center`,gap:6},children:[(0,d.jsx)(`span`,{children:C.getName()}),(0,d.jsx)(r.r,{iconKey:`Table`,size:14})]})}):null,Y=l.getVisibleRange(),ee=(f??[]).map(e=>{if(e.isDeleted())return null;let t=e.getRange().getCoords();return n.d.isCellWithinRange({rowIndex:t.rowEnd,colIndex:t.colEnd},Y)?(0,d.jsx)(Nn,{className:`table-resize-handle`,range:e===O&&E?E:t,anchor:`br`,size:12,background:Wl(e,a),renderHandle:Kl,onDragStart:()=>{A.current=!0,k(e)},onDragMove:(e,n)=>D(ql(t,n)),onDragEnd:(n,r)=>{A.current=!1,k(null),D(null);let i=ql(t,r);if(i.rowEnd!==t.rowEnd||i.colEnd!==t.colEnd)try{e.resize(i)}catch{}}},`table-resize-${e.getName()}`):null}),X=O&&E?(0,d.jsx)(xn,{className:`table-resize-preview`,range:E,stroke:Wl(O,a),alignWidth:1}):null;return(0,d.jsxs)(pe,{onMouseMove:P,onMouseLeave:F,className:$(s,`table`),children:[q,X,ee,J,(0,d.jsx)(nr,{className:`table-totals-dropdown`,renderCell:K,getVisibleCells:G,cacheToken:W}),V.component]})})),$l=(0,u.createContext)(null),eu=()=>(0,u.useContext)($l),tu=(e,t)=>!!e&&(e.getTags?.()??[]).includes(t);function nu(e){let{transaction:t,notifier:n,manager:r}=e,i=e.isRepeatable??(e=>!tu(e,`noRepeat`)),a=Promise.resolve();return e=>(o,s)=>{if(tu(s,`noTransaction`))return e(o,s);let c=a.then(async()=>{let a=s?.getLabel?.()??void 0,c=n?await Promise.resolve(n.showBusy(a??`Working…`)):null;try{let n;return await t.doBatch(async()=>{n=await e(o,s)},a),r&&s&&i(s)&&r.setRepeatableOperation({description:a??`last action`,repeat:()=>{s.execute(o)}}),n}catch(e){e&&n?.showError?.(e)}finally{c?.()}});return a=c.then(()=>{},()=>{}),c}}var ru=i.kt.isEditable,iu=[`copy`,`cut`,`paste`,`selectAll`,`undo`,`redo`];function au(e){let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`}function ou(e){if(au(e))return(e.selectionStart??0)!==(e.selectionEnd??0);let t=typeof window<`u`?window.getSelection():null;return!!t&&!t.isCollapsed&&t.toString().length>0}function su(e){return au(e)?e.value.length>0:(e.textContent??``).length>0}function cu(e){return au(e)?e.value.substring(e.selectionStart??0,e.selectionEnd??0):(typeof window<`u`?window.getSelection()?.toString():``)??``}function lu(e){typeof document<`u`&&document.execCommand(e)}var{useCommandResolver:uu}=i.Jt,du=()=>{let e=i.q(),t=(0,u.useRef)(e);t.current=e;let r=(0,u.useMemo)(()=>function(e){let{clipboard:t}=e,r=new Set(e.keys??iu);return(e,a)=>{if(!r.has(e)||!ru(a))return;let o=a;switch(e){case`copy`:return{callback:()=>async function(e,t){let n=cu(e);n&&await t.writeText(n)}(o,t.getClipboard()),disabledReasons:ou(o)?[]:[n.q(`reason.noSelection`)]};case`cut`:return{callback:()=>async function(e,t){let n=cu(e);n&&(await t.writeText(n),function(e){if(!(typeof document<`u`&&document.execCommand(`delete`))&&au(e)){let t=e.selectionStart??0,n=e.selectionEnd??t;if(t===n)return;e.setRangeText(``,t,n,`end`),e.dispatchEvent(new Event(`input`,{bubbles:!0}))}}(e))}(o,t.getClipboard()),disabledReasons:ou(o)?[]:[n.q(`reason.noSelection`)]};case`paste`:return{callback:()=>async function(e,t){let n=await t.readText();n&&function(e,t){if(au(e)){let n=e.selectionStart??e.value.length;i.kt.replaceRangeText(e,n,e.selectionEnd??n,t);return}typeof document<`u`&&document.execCommand(`insertText`,!1,t)}(e,n)}(o,t.getClipboard())};case`selectAll`:return{callback:()=>function(e){au(e)?e.select():typeof document<`u`&&document.execCommand(`selectAll`)}(o),disabledReasons:su(o)?[]:[n.q(`reason.nothingToSelect`)]};case`undo`:return{callback:()=>lu(`undo`)};case`redo`:return{callback:()=>lu(`redo`)};default:return}}}({clipboard:{getClipboard:()=>t.current.getClipboard()}}),[]),a=uu();return(0,u.useEffect)(()=>{if(!a)return;let e=a.addResolveInjector(r),t=()=>a.invalidate();return document.addEventListener(`selectionchange`,t),()=>{e(),document.removeEventListener(`selectionchange`,t)}},[a,r]),null};du.displayName=`InputClipboardInjector`;var fu=(0,u.createContext)(null),{CommandScopeContext:pu,CommandChainContext:mu,useCommandScope:hu,LayerActivation:gu}=i.Jt,_u=({pane:e,children:t})=>{let n=hu(),r=e.getAnchor(),a=(0,u.useMemo)(()=>n?new gu(n.createChild(`pane:${r}`)):null,[n,r]);return(0,u.useEffect)(()=>{let e=a?.getBase();return()=>e?.dispose()},[a]),(0,u.useEffect)(()=>{if(a)return i.Jt.attachWhenReady({get current(){return e.getElement()??null}},e=>a.getBase().attachElement(e,a))},[e,a]),a?(0,d.jsx)(mu.Provider,{value:a,children:(0,d.jsx)(pu.Provider,{value:a.getBase(),children:t})}):t};_u.displayName=`PaneScopeProvider`;var vu={"autoFill.preset.copy":`Copy Cells`,"autoFill.preset.dateDays":`Day`,"autoFill.preset.dateMonthEnd":`Month End`,"autoFill.preset.dateMonths":`Month`,"autoFill.preset.dateWeekdays":`Weekday`,"autoFill.preset.dateYears":`Year`,"autoFill.preset.growth":`Growth`,"autoFill.preset.growthTrend":`Growth Trend`,"autoFill.preset.linear":`Linear`,"autoFill.preset.linearTrend":`Linear Trend`,"autoFill.preset.series":`AutoFill`,"chart.type.area":`Area Chart`,"chart.type.areaStacked":`Stacked Area Chart`,"chart.type.areaStackedPercent":`Percentage Area Chart`,"chart.type.bar":`Bar Chart`,"chart.type.barStacked":`Bar Stacked Chart`,"chart.type.barStackedPercent":`Bar Percent Chart`,"chart.type.bubble":`Bubble Chart`,"chart.type.bubble3D":`3D Bubble Chart`,"chart.type.column":`Column Chart`,"chart.type.columnStacked":`Stacked Column Chart`,"chart.type.columnStackedPercent":`Stacked Percentage Column Chart`,"chart.type.line":`Line Chart`,"chart.type.lineMarkers":`Line with Markers Chart`,"chart.type.lineStacked":`Stacked Line Chart`,"chart.type.lineStackedMarkers":`Line Stacked with Markers Chart`,"chart.type.lineStackedPercent":`Stacked Percentage Line Chart`,"chart.type.lineStackedPercentMarkers":`Line Percentage with Markers Chart`,"chart.type.pie":`Pie Chart`,"chart.type.pieDoughnut":`Pie Doughnut Chart`,"chart.type.scatterLines":`Scatter Chart with Lines`,"chart.type.scatterLinesMarkers":`Scatter Chart with Markers and Lines`,"chart.type.scatterLinesMarkersSmooth":`Scatter Chart with Markers and Smooth Lines`,"chart.type.scatterLinesSmooth":`Scatter Chart with Smooth Lines`,"chart.type.scatterMarkers":`Scatter Chart with Markers`,"checklist.blanks":`(Blanks)`,"checklist.count":`{checked} / {total}`,"checklist.countFiltered":`{checked} / {total} (filtered)`,"checklist.selectAll":`(Select All)`,"checklist.truncated":`This column has more than 10,000 unique items. Only the first 10,000 unique items are displayed.`,"circular.converged":`{count, plural, one {Converged after # iteration} other {Converged after # iterations}}`,"circular.reads":`Reads a circular reference at`,"circular.title":`Circular reference`,"circular.unconverged":`{count, plural, one {Did not converge after # iteration} other {Did not converge after # iterations}} (last change {change})`,"circular.unconvergedNoChange":`{count, plural, one {Did not converge after # iteration} other {Did not converge after # iterations}}`,"clipboard.pasting":`Pasting...`,"dialog.activate":`Activate`,"dialog.activateTask.inputLabel":`Task Name`,"dialog.activateTask.title":`Activate Task`,"dialog.confirm.title":`Confirm`,"dialog.goTo":`Go To`,"dialog.goTo.inputLabel":`Location`,"dialog.goTo.title":`Go To`,"dialog.insert":`Insert`,"dialog.insertImage.description":`Enter the web address for the image to insert.`,"dialog.insertImage.inputLabel":`Address`,"dialog.insertImage.title":`Insert Image from Web`,"dialog.newCellStyle.description":`Enter a name for the new cell style.`,"dialog.newCellStyle.inputLabel":`Style Name`,"dialog.newCellStyle.title":`New Cell Style`,"dialog.password.description":`Enter the password to unprotect this sheet.`,"dialog.password.incorrect":`That password is incorrect.`,"dialog.password.pauseDescription":`Enter the password to pause protection on this sheet.`,"dialog.password.required":`Enter a password.`,"dialog.password.title":`Password Required`,"dialog.pause":`Pause`,"dialog.sheetBackground.description":`Enter the web address for the background image.`,"dialog.sheetBackground.title":`Sheet Background from Web`,"dialog.unlock":`Unlock`,"dialog.unlockRange.description":`Enter the password to edit ''{name}''.`,"dialog.unlockRange.descriptionMany":`Enter the password for one of the ranges that cover this cell.`,"dialog.unlockRange.title":`Unlock Range`,"dialog.unprotect":`Unprotect`,"editMode.copy":`'Copy' Select destination and press ENTER or choose Paste.`,"editMode.cut":`'Cut' Select destination and press ENTER or choose Paste.`,"editMode.dragCopy":`Drag selection to copy cell contents.`,"editMode.dragCopyInsert":`Drag selection to insert copied cell contents.`,"editMode.dragCut":`Drag selection to move cell contents.`,"editMode.dragCutInsert":`Drag selection to insert cell contents.`,"editMode.edit":`Edit`,"editMode.enter":`Enter`,"editMode.fill":`Drag selection to extend series or fill.`,"editMode.formatPainter":`Use the mouse to apply the copied format to another selection.`,"error.clipboard.perms":`You do not have permissions to access the clipboard.
11
+ All copy and paste operations will be limited to the browser tab.`,"error.clipboard.safari":`The Safari browser does not support advanced copy and paste.
12
+ Copy and paste will be limited to within the browser tab.
13
+
14
+ Please use Chrome or Edge if external copy and paste is required.`,"error.fillSeries.invalidSelection":`Can not fill a series from this selection. Select the values to continue along with the cells to fill.`,"error.fillSeries.multipleRanges":`Can not fill a series across multiple cell ranges. Please select a single range and try again.`,"error.fillSeries.unknownType":`Unknown fill type.`,"error.insertImage.unresolved":`Unable to resolve image. {detail}`,"error.removeDuplicates.multipleRanges":`Can not perform Remove Duplicates on multiple cell ranges. Please select a single range and try again.`,"error.sheet.arrayFixedMultipleRanges":`An array formula can't be entered over a multiple selection.`,"error.sort.invalidSelection":`Invalid sort selection. Sort requires a single range with data.`,"error.sort.multipleRanges":`Can not sort on multiple cell ranges. Please select a single range and try again.`,"error.textToColumns.multipleRanges":`Can not perform Text to Columns on multiple cell ranges. Please select a single range and try again.`,"findReplace.replaced":`We replaced {count} cells.`,"formulaInput.equalsRequired":`Formula must start with '='.`,"formulaInput.invalid":`Invalid Formula`,"formulaTrace.noDependents":`No formulas refer to the selected cells.`,"formulaTrace.noPrecedents":`The selected cells have no formulas that refer to other cells.`,"functionPreview.anyValue":`Any value`,"functionPreview.close":`Close`,"functionPreview.collapse":`Collapse`,"functionPreview.enumOutOfSet":`{value} is not one of this argument's values: {values}`,"functionPreview.expand":`Expand`,"functionPreview.optional":`Optional`,"functionPreview.repeatable":`Repeatable`,"functionPreview.type":`Type: {type}`,"functionPreview.typeName.boolean":`logical`,"functionPreview.typeName.error":`error`,"functionPreview.typeName.null":`empty`,"functionPreview.typeName.number":`number`,"functionPreview.typeName.richData":`data`,"functionPreview.typeName.string":`text`,"namedInput.invalid":`Invalid Name`,"op.alignBottom":`Align Bottom`,"op.alignCenter":`Align Center`,"op.alignLeft":`Align Left`,"op.alignMiddle":`Align Middle`,"op.alignRight":`Align Right`,"op.alignTop":`Align Top`,"op.anchor":`Anchor`,"op.bringForward":`Bring Forward`,"op.bringToFront":`Bring to Front`,"op.convertTableToRange":`Convert Table to Range`,"op.copyCells":`Copy Cells`,"op.deleteMovable":`Delete`,"op.deleteTable":`Delete Table`,"op.distributeHorizontally":`Distribute Horizontally`,"op.distributeVertically":`Distribute Vertically`,"op.findReplace":`Find & Replace`,"op.insertMovedCells":`Insert Moved Cells`,"op.lockAspectRatio":`Lock Aspect Ratio`,"op.mergeCells":`Merge Cells`,"op.moveCells":`Move Cells`,"op.moveMovable":`Move`,"op.nudgeMovable":`Nudge`,"op.resizeColumnsNamed":`{count, plural, one {Resize Column ''{name}''} other {Resize Columns ''{name}''}}`,"op.resizeMovable":`Resize`,"op.resizeRowsNamed":`{count, plural, one {Resize Row ''{name}''} other {Resize Rows ''{name}''}}`,"op.rotateMovable":`Rotate`,"op.sendBackward":`Send Backward`,"op.sendToBack":`Send to Back`,"op.sortCustom":`Custom Sort`,"op.typeInto":`Type ''{text}'' into {range}`,"op.unmergeCells":`Unmerge Cells`,"op.updateHyperlink":`Update Hyperlink`,"picker.noMatches":`No matches`,"picker.noValues":`No values`,"picker.search":`Search`,"reason.alreadyTable":`The selection is already in a table.`,"reason.continuousSpan":`Not available with continuous / fill alignment.`,"reason.entireColumn":`Not available when entire columns are selected.`,"reason.entireRow":`Not available when entire rows are selected.`,"reason.freezeOrigin":`Select a cell below and/or right of where the panes should freeze.`,"reason.mergeUnavailable":`Merge is not available for this selection.`,"reason.mixedSelection":`Not available for a mixed full / partial selection.`,"reason.noFreeze":`No frozen panes.`,"reason.noMerge":`No merged cells in the selection.`,"reason.noPreviousSearch":`Nothing has been searched for yet.`,"reason.noSelection":`Nothing is selected.`,"reason.noSheetBackground":`The sheet has no background.`,"reason.noTableStyle":`No table style to clear.`,"reason.nothingToRedo":`Nothing to redo.`,"reason.nothingToSelect":`Nothing to select.`,"reason.nothingToUndo":`Nothing to undo.`,"reason.notImplemented":`Not yet implemented.`,"reason.overlap":`Not available for an overlapping selection.`,"reason.protectionNotPausable":`Pausing needs a protected sheet.`,"reason.sheetLocked":`The sheet is locked.`,"reason.sheetProtected":`The sheet is protected.`,"reason.singleColumn":`Select a single column.`,"reason.sortRange":`Sort requires a single range.`,"reason.tableAmbiguous":`Select cells within a single table.`,"reason.tableBodyRows":`Select rows within the table body.`,"referenceInput.cancel":`Cancel`,"referenceInput.commit":`Commit`,"referenceInput.crossSheet":`Reference must be on the same sheet`,"referenceInput.invalid":`Invalid Reference`,"referenceInput.selectCurrent":`Select Current Range`,"resizeIndicator.height":`Height`,"resizeIndicator.hiddenDisplay":`{label}: Hidden`,"resizeIndicator.sizeDisplay":`{label}: {unit} ({px} pixels)`,"resizeIndicator.width":`Width`,"scrollbar.column":`Column: {title}`,"scrollbar.row":`Row: {title}`,"selection.replace":`Replace`,"selection.replaceData":`There is already data here. Do you want to replace it?`,"sheet.merge":`Merge`,"sheet.mergeCellsWarning":`Merging cells will only keep the upper-left value. Some data will be discarded. Continue?`,"table.columns.compact":`{count, plural, one{Table Column} other{# Table Columns}}`,"table.convert":`Convert`,"table.convertToRangeWarning":`Converting a table to range with ''{count}'' cells will set a large number of cell styles and may affect performance.
15
+ Continue?`,"table.deleteColumns":`{count, plural, one{Delete Table Column} other{Delete # Table Columns}}`,"table.deleteColumns.description":`Delete the selected table columns, shifting cells left only within the table.`,"table.deleteRows":`{count, plural, one{Delete Table Row} other{Delete # Table Rows}}`,"table.deleteRows.description":`Delete the selected table rows, shifting cells up only within the table.`,"table.insertColumns":`{count, plural, one{Insert Table Column} other{Insert # Table Columns}}`,"table.insertColumns.description":`Insert columns to the left of the selection, shifting cells right only within the table.`,"table.insertRows":`{count, plural, one{Insert Table Row} other{Insert # Table Rows}}`,"table.insertRows.description":`Insert rows above the selection, shifting cells down only within the table.`,"table.rows.compact":`{count, plural, one{Table Row} other{# Table Rows}}`,"table.totals.average":`Average`,"table.totals.count":`Count`,"table.totals.countNumbers":`Count Numbers`,"table.totals.max":`Max`,"table.totals.min":`Min`,"table.totals.moreFunctions":`More Functions...`,"table.totals.none":`None`,"table.totals.stdDev":`StdDev`,"table.totals.sum":`Sum`,"table.totals.var":`Var`,"validationTip.more":`{count, plural, one {# more rule} other {# more rules}}`,"workbook.untitled":`Untitled`,"workbookStrip.newSheet":`New sheet`},yu=[{sourceId:`clipboard`,catalog:{scope:`app`,label:`Application`,tag:`en`,version:1,commands:{cut:{label:`Cut`,description:`Remove the selection and put it on the clipboard so you can paste it somewhere else.`,icon:`cut`,shortcut:[`ctrl+X`,`shift+Delete`]},copy:{label:`Copy`,description:`Put a copy of the selection on the clipboard so you can paste it somewhere else.`,icon:`copy`,shortcut:[`ctrl+C`,`ctrl+Insert`]},paste:{label:`Paste`,description:`Add content on the clipboard to your document.`,icon:`paste.yellow`,shortcut:[`ctrl+V`,`shift+Insert`]}}}},{sourceId:`editor`,catalog:{scope:`editor`,label:`Cell Editor`,tag:`en`,version:1,commands:{relativeReferencesToggle:{label:`Toggle References`,description:`Toggle cell references from relative to absolute, to partially absolute, back to relative again.`,shortcut:`F4`,tags:[`editor`]},toggleEditorFocus:{label:`Toggle Editor Focus`,description:`Move focus between editors such as the formula editor and the inline editor.`,shortcut:`ctrl+F2`,tags:[`editor`]},insertFunctionSum:{label:`Quick Sum`,description:`Quick sum of the cells.`,groupLabels:{insertFunctionSumOptions:`Sum`},icon:`FunctionSum`,shortcut:`alt+=`,tags:[`mutator`],borrow:[`sheet`]},insertFunctionAverage:{label:`Quick Average`,description:`Quick average of the cells.`,groupLabels:{insertFunctionSumOptions:`Average`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionCount:{label:`Quick Count`,description:`Quick count of the cells.`,groupLabels:{insertFunctionSumOptions:`Count Numbers`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMax:{label:`Quick Max`,description:`Quick maximum of the cells.`,groupLabels:{insertFunctionSumOptions:`Max`},tags:[`mutator`],borrow:[`sheet`]},insertFunctionMin:{label:`Quick Min`,description:`Quick minimum of the cells.`,groupLabels:{insertFunctionSumOptions:`Min`},tags:[`mutator`],borrow:[`sheet`]},insertCurrentTime:{label:`Current Time`,description:`Insert the current time.`,shortcut:`ctrl+shift+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertCurrentDate:{label:`Current Date`,description:`Insert the current date.`,shortcut:`ctrl+Semicolon`,tags:[`mutator`],borrow:[`sheet`]},insertValueAbove:{label:`Copy From Above`,description:`Copy the value from the cell above the active cell into the cell or the formula bar.`,shortcut:[`ctrl+Quote`,`ctrl+shift+"`],tags:[`mutator`],borrow:[`sheet`]}}}},{sourceId:`movable`,catalog:{scope:`movable`,label:`Objects`,tag:`en`,version:1,commands:{moveToFront:{label:`Bring to Front`,description:`Move to the front of all of the other drawings.`,icon:`DrawToFront`,shortcut:`ctrl+shift+BracketRight`},moveForward:{label:`Bring Forward`,description:`Move forward one layer in the z order.`,icon:`DrawMoveForward`,shortcut:`ctrl+BracketRight`},moveToBack:{label:`Send to Back`,description:`Move to the back of all of the other drawings.`,icon:`DrawToBack`,shortcut:`ctrl+shift+BracketLeft`},moveBackward:{label:`Send Backward`,description:`Move backwards one layer in the z order.`,icon:`DrawMoveBackward`,shortcut:`ctrl+BracketLeft`},deleteDrawings:{label:`Delete`,description:`Delete the selected drawings.`,shortcut:`Delete`},selectAllDrawings:{label:`Select All Drawings`,description:`Select all of the drawings on the sheet.`,shortcut:`ctrl+A`},toggleLockAspectRatio:{label:`Lock Aspect Ratio`,description:`Toggle whether the aspect ratio should be maintained when resizing from corners.`,icon:`DrawAspect`},formatAnchorTypeTwoCell:{label:`Move and size with cells`,description:`Set your drawing to move and resize when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeOneCell:{label:`Move but don't size with cells`,description:`Set your drawing to only move when underling sheet resizes.`,icon:`DrawResize`},formatAnchorTypeAbsolute:{label:`Don't move or size with cells`,description:`Set your drawing to never move or resize when underling sheet resizes.`,icon:`DrawResize`},formatDrawNudgeLeft:{label:`Nudge Left`,description:`Move the selected drawings 1 pixel left.`,shortcut:`ArrowLeft`},formatDrawNudgeRight:{label:`Nudge Right`,description:`Move the selected drawings 1 pixel right.`,shortcut:`ArrowRight`},formatDrawNudgeUp:{label:`Nudge Up`,description:`Move the selected drawings 1 pixel up.`,shortcut:`ArrowUp`},formatDrawNudgeDown:{label:`Nudge Down`,description:`Move the selected drawings 1 pixel down.`,shortcut:`ArrowDown`},formatDrawNudgeLeftLarge:{label:`Nudge Left (Large)`,description:`Move the selected drawings 10 pixels left.`,shortcut:`ctrl+ArrowLeft`},formatDrawNudgeRightLarge:{label:`Nudge Right (Large)`,description:`Move the selected drawings 10 pixels right.`,shortcut:`ctrl+ArrowRight`},formatDrawNudgeUpLarge:{label:`Nudge Up (Large)`,description:`Move the selected drawings 10 pixels up.`,shortcut:`ctrl+ArrowUp`},formatDrawNudgeDownLarge:{label:`Nudge Down (Large)`,description:`Move the selected drawings 10 pixels down.`,shortcut:`ctrl+ArrowDown`},formatDrawSizeIncrease:{label:`Increase Size`,description:`Grow the selected drawings by 10%.`,shortcut:[`shift+ArrowRight`,`shift+ArrowUp`,`ctrl+shift+ArrowRight`,`ctrl+shift+ArrowUp`]},formatDrawSizeDecrease:{label:`Decrease Size`,description:`Shrink the selected drawings by 10%.`,shortcut:[`shift+ArrowLeft`,`shift+ArrowDown`,`ctrl+shift+ArrowLeft`,`ctrl+shift+ArrowDown`]},formatDrawRotateLeft:{label:`Rotate Left`,description:`Rotate the selected drawings 10 degrees counterclockwise.`,shortcut:[`alt+ArrowLeft`,`ctrl+alt+ArrowLeft`]},formatDrawRotateRight:{label:`Rotate Right`,description:`Rotate the selected drawings 10 degrees clockwise.`,shortcut:[`alt+ArrowRight`,`ctrl+alt+ArrowRight`]},formatDrawAlignLeft:{label:`Align Left`,description:`Align the selected drawings to the left.`,icon:`DrawAlignLeft`},formatDrawAlignCenter:{label:`Align Center`,description:`Align the selected drawings vertically relative to each other.`,icon:`DrawAlignCenter`},formatDrawAlignRight:{label:`Align Right`,description:`Align the selected drawings to the right.`,icon:`DrawAlignRight`},formatDrawAlignTop:{label:`Align Top`,description:`Align the selected drawings to the top.`,icon:`DrawAlignTop`},formatDrawAlignMiddle:{label:`Align Middle`,description:`Align the selected drawings horizontally relative to each other.`,icon:`DrawAlignMiddle`},formatDrawAlignBottom:{label:`Align Bottom`,description:`Align the selected drawings to the bottom.`,icon:`DrawAlignBottom`},formatDrawDistributeHorz:{label:`Distribute Horizontally`,description:`Distribute the selected drawings horizontally with equal spacing between each.`,icon:`DrawDistributeHorz`},formatDrawDistributeVert:{label:`Distribute Vertically`,description:`Distribute the selected drawings vertically with equal spacing between each.`,icon:`DrawDistributeVert`},formatDrawFlipHorz:{label:`Flip Horizontally`,description:`Flip the selected drawings horizontally.`},formatDrawFlipVert:{label:`Flip Vertically`,description:`Flip the selected drawings vertically.`},formatDrawGroup:{label:`Group`,description:`Group the selected drawings into a single drawing.`,icon:`DrawGroup`},formatDrawUngroup:{label:`Ungroup`,description:`Break the group of a drawing into individual drawings.`,icon:`DrawUngroup`},formatDrawSwapShapes:{label:`Swap Shapes`,description:`Swap the positions of the swap.`},formatDrawSwapShapesHorz:{label:`Swap Shapes Horizontally`,description:`Swap the positions of the swap horizontally.`},formatDrawSwapShapesVert:{label:`Swap Shapes Vertically`,description:`Swap the positions of the swap vertically.`}}}},{sourceId:`selection`,catalog:{scope:`selection`,label:`Selection`,tag:`en`,version:1,commands:{moveToPageDown:{label:`Page Down`,description:`Shift viewport down one page.`,shortcut:`PageDown`,tags:[`selection`]},selectToPageDown:{label:`Select To Page Down`,description:`Shift viewport and select down one page.`,shortcut:`shift+PageDown`,tags:[`selection`]},moveToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`alt+PageDown`,tags:[`selection`]},selectToPageRight:{label:`Page Right`,description:`Shift viewport right one page.`,shortcut:`shift+alt+PageDown`,tags:[`selection`]},moveToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`PageUp`,tags:[`selection`]},selectToPageUp:{label:`Page Up`,description:`Shift viewport up one page.`,shortcut:`shift+PageUp`,tags:[`selection`]},moveToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`alt+PageUp`,tags:[`selection`]},selectToPageLeft:{label:`Page Left`,description:`Shift viewport left one page.`,shortcut:`shift+alt+PageUp`,tags:[`selection`]},selectArray:{label:`Select Array`,description:`Select the whole spilled or array-entered block containing the active cell.`,shortcut:`ctrl+shift+?`,tags:[`selection`]},selectColumn:{label:`Select Column`,description:`Select the columns for the selected cells.`,shortcut:`ctrl+Space`,tags:[`selection`]},selectRow:{label:`Select Row`,description:`Select the rows for the selected cells.`,shortcut:`shift+Space`,tags:[`selection`]},selectToColumnStart:{label:`Select To Column Start`,description:`Select the columns to the beginning of the sheet.`,tags:[`selection`]},selectToColumnEnd:{label:`Select To Column End`,description:`Select the columns to the end of the sheet.`,tags:[`selection`]},moveToRowStart:{label:`Move to Row Home`,description:`Move to the beginning of the row.`,shortcut:`Home`,tags:[`selection`]},selectToRowStart:{label:`Select to Row Home`,description:`Select to the beginning of the row.`,shortcut:`shift+Home`,tags:[`selection`]},moveToGridStart:{label:`Move to Grid Home`,description:`Move to the beginning of the grid.`,shortcut:`ctrl+Home`,tags:[`selection`]},selectToGridStart:{label:`Select to Grid Home`,description:`Select to the beginning of the grid.`,shortcut:`ctrl+shift+Home`,tags:[`selection`]},moveToRowEnd:{label:`Move to Row End`,description:`Move to the end of the row.`,shortcut:`End`,tags:[`selection`]},selectToRowEnd:{label:`Select to Row End`,description:`Select to the end of the row.`,shortcut:`shift+End`,tags:[`selection`]},moveToGridEnd:{label:`Move to Grid End`,description:`Move to the end of the grid.`,shortcut:`ctrl+End`,tags:[`selection`]},selectToGridEnd:{label:`Select to Grid End`,description:`Select to the end of the grid.`,shortcut:`ctrl+shift+End`,tags:[`selection`]},scrollToActiveCoords:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell.`,shortcut:`ctrl+Backspace`,tags:[`selection`]},scrollToActiveCoordsClearSelection:{label:`Scroll to Active Cell`,description:`Scroll to the Active Cell and clear selection.`,shortcut:`shift+Backspace`,tags:[`selection`]},traverseSelectionRight:{label:`Traverse Right`,description:`Traverse the selection moving rightward.`,shortcut:`Tab`,tags:[`selection`]},traverseSelectionLeft:{label:`Traverse Left`,description:`Traverse the selection moving leftward.`,shortcut:`shift+Tab`,tags:[`selection`]},traverseSelectionDown:{label:`Traverse Down`,description:`Traverse the selection moving downward.`,shortcut:[`Enter`,`NumpadEnter`],tags:[`selection`]},traverseSelectionUp:{label:`Traverse Up`,description:`Traverse the selection moving upward.`,shortcut:[`shift+Enter`,`shift+NumpadEnter`],tags:[`selection`]},moveLeft:{label:`Move Left`,description:`Move active cell to the left.`,shortcut:`ArrowLeft`,tags:[`selection`]},selectLeft:{label:`Select Left`,description:`Extend selection left.`,shortcut:`shift+ArrowLeft`,tags:[`selection`]},moveContentfulLeft:{label:`Move Left Contentful`,description:`Move left to the next cell with content.`,shortcut:`ctrl+ArrowLeft`,tags:[`selection`]},selectContentfulLeft:{label:`Select Left Contentful`,description:`Extend selection left to the next cell with content.`,shortcut:`ctrl+shift+ArrowLeft`,tags:[`selection`]},moveRight:{label:`Move Right`,description:`Move active cell to the right.`,shortcut:`ArrowRight`,tags:[`selection`]},selectRight:{label:`Select Right`,description:`Extend selection right.`,shortcut:`shift+ArrowRight`,tags:[`selection`]},moveContentfulRight:{label:`Move Right Contentful`,description:`Move right to the next cell with content.`,shortcut:`ctrl+ArrowRight`,tags:[`selection`]},selectContentfulRight:{label:`Select Right Contentful`,description:`Extend selection right to the next cell with content.`,shortcut:`ctrl+shift+ArrowRight`,tags:[`selection`]},moveUp:{label:`Move Up`,description:`Move active cell to the up.`,shortcut:`ArrowUp`,tags:[`selection`]},selectUp:{label:`Select Up`,description:`Extend selection up.`,shortcut:`shift+ArrowUp`,tags:[`selection`]},moveContentfulUp:{label:`Move Up Contentful`,description:`Move up to the next cell with content.`,shortcut:`ctrl+ArrowUp`,tags:[`selection`]},selectContentfulUp:{label:`Select Up Contentful`,description:`Extend selection up to the next cell with content.`,shortcut:`ctrl+shift+ArrowUp`,tags:[`selection`]},moveDown:{label:`Move Down`,description:`Move active cell to the down.`,shortcut:`ArrowDown`,tags:[`selection`]},selectDown:{label:`Select Down`,description:`Extend selection down.`,shortcut:`shift+ArrowDown`,tags:[`selection`]},moveContentfulDown:{label:`Move Down Contentful`,description:`Move down to the next cell with content.`,shortcut:`ctrl+ArrowDown`,tags:[`selection`]},selectContentfulDown:{label:`Select Down Contentful`,description:`Extend selection down to the next cell with content.`,shortcut:`ctrl+shift+ArrowDown`,tags:[`selection`]},traverseSelectionPreviousRange:{label:`Traverse Previous Range`,description:`Traverse the selection to the previous range.`,shortcut:`ctrl+alt+ArrowLeft`,tags:[`selection`]},traverseSelectionNextRange:{label:`Traverse Next Range`,description:`Traverse the selection to the next range.`,shortcut:`ctrl+alt+ArrowRight`,tags:[`selection`]},traverseSelectionCorners:{label:`Traverse Corners`,description:`Traverse the selection through the corners of the selected range.`,shortcut:`ctrl+.`,tags:[`selection`]}}}},{sourceId:`sheet`,catalog:{scope:`sheet`,label:`Sheet`,tag:`en`,version:1,commands:{gridlinesToggle:{label:`Gridlines`,description:`Toggle whether the lines between rows and columns in the sheet are displayed.`,groupLabels:{view:`Gridlines`}},sheetViewToggleGridlinesRows:{label:`Row Gridlines`,description:`Toggle whether the lines between rows in the sheet are displayed.`,groupLabels:{view:`Row Gridlines`,gridlinesOptions:`Rows`}},sheetViewToggleGridlinesColumns:{label:`Column Gridlines`,description:`Toggle whether the lines between columns in the sheet are displayed.`,groupLabels:{view:`Columns Gridlines`,gridlinesOptions:`Columns`}},sheetViewFormatGridlinesColor:{label:`Gridlines Color`,description:`Color the rows and column gridlines.`},sheetViewToggleShowHeadings:{label:`Headings`,description:`Toggle whether the row and column headings are displayed.`,groupLabels:{view:`Headings`}},sheetViewToggleShowHeadingRows:{label:`Row Headings`,description:`Toggle whether the row headings are displayed.`,groupLabels:{view:`Row Headings`,headingsOptions:`Rows`}},sheetViewToggleShowHeadingColumns:{label:`Column Headings`,description:`Toggle whether the column headings are displayed.`,groupLabels:{view:`Columns Headings`,headingsOptions:`Columns`}},sheetViewToggleShowHeadingsNumeric:{label:`Numeric Headers`,description:`Toggle whether cell headings show numbers or A1 conventions.`,shortcut:`ctrl+shift+h`},sheetViewToggleFormulaView:{label:`Show Formulas`,description:`Toggle whether cells show formula or values.`,icon:`FormulaView`,shortcut:"ctrl+`"},sheetViewToggleShowZeros:{label:`Show Zeros`,description:`Toggle whether cell with zero value shows '0' or blank.`,icon:`ViewZero`},selectComments:{label:`Select Comments`,description:`Select the cells with comments.`,shortcut:`ctrl+shift+O`},selectAll:{label:`Select All`,description:`Select the closest data or the entire sheet if no data is nearby.`,shortcut:[`ctrl+A`,`ctrl+shift+Space`]},selectRegion:{label:`Select Region`,description:`Select the closest data.`,shortcut:`ctrl+shift+*`},clearHiddenSelection:{label:`Select Visible Cells`,description:`Break the selection around hidden rows and columns, leaving only the visible cells selected.`,shortcut:`alt+Semicolon`},formatTextRotate0:{label:`No Text Rotation`,description:`Remove all text rotation.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotate45:{label:`Angle Clockwise`,description:`Angle text 45 degrees downward.`,icon:`TextRotation45`,tags:[`mutator`]},formatTextRotate90:{label:`Rotate Text Down`,description:`Angle your text so that it aligns with the left.`,icon:`TextRotation90`,tags:[`mutator`]},formatTextRotate270:{label:`Rotate Text Up`,description:`Angle your text so that it aligns with the right.`,icon:`TextRotation2702`,tags:[`mutator`]},formatTextRotate315:{label:`Angle Counterclockwise`,description:`Angle text 45 degrees upward.`,icon:`TextRotation315`,tags:[`mutator`]},formatTextRotateCustom:{label:`Custom Text Rotation`,description:`Angle your text using a custom angle.`,icon:`TextRotationCustom`,tags:[`mutator`],groupLabels:{textRotateOptions:`Custom`}},formatTextRotateVertical:{label:`Vertical Text`,description:`Stack text vertically.`,icon:`TextRotationVertical`,tags:[`mutator`]},sortAscending:{label:`Sort Ascending`,description:`Lowest to Highest.`,groupLabels:{sortOptions:`Ascending`,sortFilterOptions:`Ascending`},icon:`SortIncrease`,tags:[`mutator`]},sortDescending:{label:`Sort Descending`,description:`Highest to Lowest.`,groupLabels:{sortOptions:`Descending`,sortFilterOptions:`Descending`},icon:`SortDecrease`,tags:[`mutator`]},sortCustom:{label:`Custom Sort…`,description:`Choose more options, such as sorting by multiple columns or rows, and case-sensitive sorts.`,groupLabels:{sortOptions:`Custom…`,sortFilterOptions:`Custom…`},icon:`SortCustom`,tags:[`mutator`]},protectionSheetToggle:{label:`{locked, select, true{Unprotect Sheet} other{Protect Sheet}}`,description:`Prevent unwanted changes from others by limiting their ability to edit.
16
+ For example, you can prevent people from editing locked cells or making formatting changes.`,groupLabels:{sheet:`{locked, select, true{Unprotect} other{Protect}}`},icon:`Lock`,params:{locked:!1}},protectionSheetPause:{label:`{paused, select, true{Resume Protection} other{Pause Protection}}`,description:`Temporarily lift protection on this sheet without unprotecting it.
17
+ Asks for the sheet password, if there is one. It applies to this session only and is never saved with the file.`,groupLabels:{protectionOptions:`{paused, select, true{Resume Protection} other{Pause Protection}}`},icon:`LockOpen`,params:{paused:!1}},protectionSheetProtectOrPause:{label:`{state, select, paused{Resume Protection} locked{Pause Protection} other{Protect Sheet}}`,description:`Protect the sheet, or pause protection on a protected one.
18
+ Never unprotects: pausing keeps the password and options, and applies to this session only.`,icon:`Lock`,params:{state:`none`}},protectionHighlight:{label:`Highlight Locked Cells`,description:`Shade the cells sheet protection locks, leaving the ranges that stay editable clear.
19
+ A view setting: it changes nothing in the workbook, and works whether or not the sheet is protected.`,groupLabels:{protectionOptions:`Highlight Locked Cells`}},manageProtection:{label:`Manage Protection`,description:`Sheet protection and its options, the ranges that stay editable, and workbook protection - in one place.`,groupLabels:{protectionOptions:`Manage Protection…`,sheetTabMenu:`Manage Protection…`,contextMenu:`Manage Protection…`},icon:`Lock`},protectionUnlockRange:{label:`Unlock Range…`,description:`Let the selected cells stay editable while the rest of the sheet is protected.`,groupLabels:{protectionOptions:`Unlock Range…`},icon:`LockRange`},formatSheetTabColor:{label:`Tab Color`,description:`Color the tab to help differentiate for other sheets.`,icon:`stroke.colored`},formatCellStyle:{label:`Cell Styles`,description:`A colorful style is a great way to make important data stand out on the sheet.`,groupLabels:{cellStyle:`Apply`},icon:`PresetStyles`,tags:[`mutator`]},formatTableStyle:{label:`{hasTable, select, true{Apply Table Style} other{Format as Table}}`,description:`Create a table or apply style to the current table.`,groupLabels:{tableStyleOptions:`Apply (Keep Styles)`},icon:`PresetStyles`,tags:[`mutator`],params:{hasTable:!1}},formatTableStyleClearCellStyles:{label:`Format as Table (Clear Styles)`,description:`Create a table or apply style to the current table and clears all cell styles.`,groupLabels:{tableStyleOptions:`Apply (Clear Styles)`},icon:`PresetStyles`},setDefaultTableStyle:{label:`Set Default Table Style`,description:`Sets the default table style used when a table is inserted.`,groupLabels:{tableStyleOptions:`Set As Default`}},deleteTableStyle:{label:`Delete Table Style`,description:`Remove the current table style.`,groupLabels:{tableStyleOptions:`Delete`}},formatBorder:{label:`Border`,description:`Create an outline border.`,tags:[`mutator`]},formatFillColor:{label:`Fill Color`,description:`Color the background of the cells to make them stand out.`,icon:`fill.colored`,tags:[`mutator`]},formatFontColor:{label:`Font Color`,description:`Change the color of your text.`,icon:`text.colored`,tags:[`mutator`]},formatBoldToggle:{label:`Bold`,description:`Toggle bold formatting of text.`,icon:`TextBold`,shortcut:[`ctrl+B`,`ctrl+2`],tags:[`mutator`]},formatItalicToggle:{label:`Italic`,description:`Toggle italic formatting of text.`,icon:`TextItalic`,shortcut:[`ctrl+I`,`ctrl+3`],tags:[`mutator`]},formatUnderlinedToggle:{label:`Underline`,description:`Underline the text.`,groupLabels:{underlineOptions:`Single`},icon:`TextUnderline`,shortcut:[`ctrl+u`,`ctrl+4`],tags:[`mutator`]},formatUnderlinedDoubleToggle:{label:`Double Underline`,description:`Double underline the text.`,groupLabels:{underlineOptions:`Double`},icon:`TextUnderlineDouble`},formatUnderlinedAccountingToggle:{label:`Accounting Underline`,description:`Use accounting underline for the text.`,groupLabels:{underlineOptions:`Accounting`},icon:`TextUnderlineAccounting`},formatUnderlinedAccountingDoubleToggle:{label:`Double Accounting Underline`,description:`Use accounting double underline the text.`,groupLabels:{underlineOptions:`Double Accounting`},icon:`TextUnderlineAccountingDouble`},formatStrikeThroughToggle:{label:`Strikethrough`,description:`Toggle strike-through formatting of text.`,icon:`TextStrike`,shortcut:`ctrl+5`,tags:[`mutator`]},formatSuperscriptToggle:{label:`Superscript`,description:`Format your text to be smaller and sit at the top of the line.`,icon:`TextSuperscript`,tags:[`mutator`]},formatSubscriptToggle:{label:`Subscript`,description:`Format your text to be smaller and sit at the bottom of the line.`,icon:`TextSubscript`,tags:[`mutator`]},formatAlignTopToggle:{label:`Align Top`,description:`Align text to the top.`,icon:`TextVerticalTop`,tags:[`mutator`]},formatTextOverflowVisibleToggle:{label:`Overflow Text`,description:`Overflow text to the next cells.`,icon:`TextHorizontalOverflow`,tags:[`mutator`]},formatTextOverflowWrapToggle:{label:`Wrap Text`,description:`Wrap text with the existing cell and increase the height as required.`,icon:`TextHorizontalWrap`,tags:[`mutator`]},formatTextOverflowClipToggle:{label:`Clip Text`,description:`Clip text that falls outside of the existing cell.`,icon:`TextHorizontalClip`,tags:[`mutator`]},formatTextOverflowShrinkToggle:{label:`Shrink Text`,description:`Shrink the text font to fit within existing cell.`,icon:`TextHorizontalShrink`,tags:[`mutator`]},formatTextOverflowEllipsisToggle:{label:`Ellipsis Text`,description:`Add a trailing '…' to the text to indicate text is partially hidden.`},formatAlignMiddleToggle:{label:`Align Middle`,description:`Align text so that it is centered between the top and bottom of the cell.`,icon:`TextVerticalCenter`,tags:[`mutator`]},formatAlignBottomToggle:{label:`Align Bottom`,description:`Align text to the bottom.`,icon:`TextVerticalBottom`,tags:[`mutator`]},formatAlignJustifyVerticalToggle:{label:`Justify Vertically`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the height of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedVerticalToggle:{label:`Distribute Vertically`,description:`Justify your content vertically.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignLeftToggle:{label:`Align Left`,description:`Align your content to the left.`,icon:`FormatAlignLeft`,tags:[`mutator`]},formatAlignCenterToggle:{label:`Align Center`,description:`Center your content.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignRightToggle:{label:`Align Right`,description:`Align your content to the right.`,icon:`FormatAlignRight`,tags:[`mutator`]},formatAlignJustifyToggle:{label:`Align Justify`,description:`Justify your content.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignCenterContinuousToggle:{label:`Center Across`,description:`Center your content across multiple cells.`,icon:`FormatAlignCenter`,tags:[`mutator`]},formatAlignFillToggle:{label:`Fill Across`,description:`Repeat the value to fill the entire cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatAlignDistributedHorizontalToggle:{label:`Distribute Horizontally`,description:`Each 'word' in each line of text inside the cell is evenly distributed across the width of the cell.`,icon:`FormatAlignJustify`,tags:[`mutator`]},formatFontSizeIncrease:{label:`Increase Font Size`,description:`Make your text a bit bigger.`,icon:`TextSizeIncrease`,shortcut:`ctrl+shift+>`,tags:[`mutator`,`quickAction`]},formatFontSizeDecrease:{label:`Decrease Font Size`,description:`Make your text a bit smaller.`,icon:`TextSizeDecrease`,shortcut:`ctrl+shift+<`,tags:[`mutator`,`quickAction`]},formatFontFamily:{label:`Font`,description:`Select the font your text.`,tags:[`mutator`]},formatFontSize:{label:`Font Size`,description:`Change the size of your text.`,tags:[`mutator`]},formatCells:{label:`Format Cells`,description:`Open the Format Cells pane — number, alignment, font, fill and borders.`,icon:`CellsFormat`,groupLabels:{numberFormatOptions:`More Number Formats…`,cellsFormatOptions:`Format Cells…`,contextMenu:`Format Cells…`}},formatCellsNumber:{label:`Format Cells: Number`,description:`Open the Format Cells pane on the Number tab.`,icon:`CellsFormat`,shortcut:[`ctrl+1`,`ctrl+alt+1`]},formatCellsFont:{label:`Format Cells: Font`,description:`Open the Format Cells pane on the Font tab.`,icon:`CellsFormat`,shortcut:[`ctrl+shift+F`,`ctrl+alt+F`]},formatNumberFormat:{label:`Number Format`,description:`Choose the format for your cells, such as percentage, currency, date or time.`,tags:[`mutator`]},formatNumberFormatGeneralStyle:{label:`General Style`,description:`Remove all specific formatting.`,shortcut:`ctrl+shift+Backquote`,tags:[`mutator`]},formatNumberFormatNumberStyle:{label:`Number Style`,description:`Format as number with two decimals and comma.`,shortcut:`ctrl+shift+1`,tags:[`mutator`]},formatNumberFormatTimeStyle:{label:`Time Style`,description:`Format as time with hour and minute, and AM or PM.`,shortcut:`ctrl+shift+2`,tags:[`mutator`]},formatNumberFormatDateStyle:{label:`Date Style`,description:`Format as date with day, month, and year.`,shortcut:`ctrl+shift+3`,tags:[`mutator`]},formatNumberFormatAccountingStyle:{label:`Accounting Style`,description:`Format as Dollars, Euros, or other currency.`,icon:`CurrencyDollar`,shortcut:`ctrl+shift+4`,tags:[`mutator`,`quickAction`]},formatNumberFormatPercentStyle:{label:`Percent Style`,description:`Format as a percentage.`,icon:`Percent`,shortcut:`ctrl+shift+5`,tags:[`mutator`,`quickAction`]},formatNumberFormatScientificStyle:{label:`Scientific Style`,description:`Format as a scientific number with two decimal places .`,shortcut:`ctrl+shift+6`,tags:[`mutator`]},formatNumberFormatCommaStyle:{label:`Comma Style`,description:`Format with a thousands separator.`,icon:`Comma`,shortcut:`ctrl+,`,tags:[`mutator`,`quickAction`]},formatNumberFormatIncreaseDecimal:{label:`Increase Decimal`,description:`Show more decimal places for a more precise value.`,icon:`IncreaseDecimal2`,tags:[`mutator`,`quickAction`]},formatNumberFormatDecreaseDecimal:{label:`Decrease Decimal`,description:`Show few decimal places.`,icon:`DecreaseDecimal2`,tags:[`mutator`,`quickAction`]},displayPlaceholdersToggle:{label:`Display Placeholders`,description:`Switch between hiding objects, displaying objects, and displaying placeholders for objects.`,shortcut:`ctrl+6`},noOp:{label:`Do nothing`,description:`Do Nothing.`,shortcut:`ctrl+7`},displayOutlineSymbolsToggle:{label:`Display Outline Symbols`,description:`Display or hide the outline symbols.`,shortcut:`ctrl+8`},hideRows:{label:`{count, plural, one{Hide Row} other{Hide # Rows}}`,description:`Hide the rows.`,icon:`HideRow`,shortcut:`ctrl+9`,tags:[`mutator`],params:{count:1}},unhideRows:{label:`Unhide Rows`,description:`Unhide the rows.`,icon:`ShowRow`,shortcut:`ctrl+shift+(`,tags:[`mutator`]},hideColumns:{label:`{count, plural, one{Hide Column} other{Hide # Columns}}`,description:`Hide the columns.`,icon:`HideColumn`,shortcut:[`ctrl+0`,`ctrl+alt+0`],tags:[`mutator`],params:{count:1}},unhideColumns:{label:`Unhide Columns`,description:`Unhide the columns.`,icon:`ShowColumn`,shortcut:`ctrl+shift+)`,tags:[`mutator`]},calculate:{label:`Calculate Sheet`,description:`Recalculate the formulas on the current sheet.`,icon:`CalculateSheet`,shortcut:[`shift+F9`,`ctrl+=`]},insertFunctionDialog:{label:`Insert Function`,description:`Work with the function in the current cell.`,groupLabels:{insertFunctionSumOptions:`Function…`},icon:`FunctionThin`,shortcut:`shift+F3`,borrow:[`workbook`],tags:[`mutator`]},sheetZoomOut:{label:`Zoom Out`,description:`Zoom out to see less detail but more area.`,shortcut:[`ctrl+alt+-`,`ctrl+alt+NumpadSubtract`]},sheetZoomIn:{label:`Zoom In`,description:`Zoom in to see more detail but less area.`,shortcut:[`ctrl+alt+=`,`ctrl+alt+NumpadAdd`]},sheetZoom100:{label:`Zoom 100%`,description:`Zoom document to 100%.`,shortcut:`ctrl+alt+o`},sheetZoom200:{label:`Zoom 200%`,description:`Zoom document to 200%.`},sheetZoom75:{label:`Zoom 75%`,description:`Zoom document to 75%.`},sheetZoom50:{label:`Zoom 50%`,description:`Zoom document to 50%.`},sheetZoom25:{label:`Zoom 25%`,description:`Zoom document to 25%.`},sheetZoomCustom:{label:`Custom Zoom`,description:`Zoom document to a custom scale.`,groupLabels:{sheetZoomOptions:`Custom`}},updateHyperlink:{label:`Link`,description:`Create a hyperlink to either another webpage or another location within this document.`,groupLabels:{contextMenu:`Insert Link…`,hyperlinkOptions:`Edit…`},icon:`HyperlinkInsert`,shortcut:[`ctrl+K`,`ctrl+alt+K`]},openContextMenu:{label:`Context Menu`,description:`Open the context menu.`,shortcut:[`shift+F10`,`ContextMenu`]},openHyperlink:{label:`Open Link`,description:`Open the hyperlink or goto another location within this document.`,groupLabels:{hyperlinkOptions:`Open`},icon:`HyperlinkGoto`,shortcut:`ctrl+Enter`},deleteHyperlink:{label:`Delete Link`,description:`Remove the hyperlink.`,groupLabels:{hyperlinkOptions:`Delete`},icon:`HyperlinkDelete`},insertNote:{label:`Insert Note`,description:`Add a note to the cell.`,groupLabels:{contextMenu:`Insert Note…`},shortcut:`shift+F2`},updateComments:{label:`Comments`,description:`Add a comment to the current cell.`,groupLabels:{contextMenu:`Insert Comments…`},icon:`CommentInsert`,shortcut:`ctrl+alt+M`,tags:[`mutator`]},deleteComments:{label:`Delete Comments`,description:`Remove any comments.`,icon:`CommentDelete`,tags:[`mutator`]},insertImageFromFile:{label:`Insert Image`,description:`Insert a picture from your device.`,groupLabels:{contextMenu:`Insert Image…`,insertImageOptions:`From Device…`},icon:`InsertImage`,tags:[`mutator`]},insertImageFromURL:{label:`Insert Image From Web`,description:`Insert a picture from the web.`,groupLabels:{insertImageOptions:`From the Web…`},icon:`InsertImage`,tags:[`mutator`]},sheetBackgroundToggle:{label:`Background`,description:`Add or remove the picture that is tiled behind the sheet's cells.`,icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundFromFile:{label:`Sheet Background`,description:`Use a picture from your device as the sheet's background.`,groupLabels:{sheetBackgroundOptions:`From Device…`},icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundFromURL:{label:`Sheet Background From Web`,description:`Use a picture from the web as the sheet's background.`,groupLabels:{sheetBackgroundOptions:`From the Web…`},icon:`BackgroundImage`,tags:[`mutator`]},sheetBackgroundDelete:{label:`Delete Background`,description:`Remove the sheet's background picture.`,groupLabels:{sheetBackgroundOptions:`Delete Background`},icon:`Delete`,tags:[`mutator`]},manageDataValidation:{label:`Data Validation`,description:`Manage data validation rules to limit the type of data entered in a cell.`,groupLabels:{contextMenu:`Data Validation…`,dataValidationOptions:`Manage Rules…`},icon:`DataValidation`},dataValidationList:{label:`Data Validation List`,description:`Limit the selected cells to a list, seeded with the values already there.`,groupLabels:{dataValidationOptions:`List…`}},dataValidationUnique:{label:`Require Unique Values`,description:`Allow each value only once in the selected cells.`,groupLabels:{dataValidationOptions:`Unique`},tags:[`mutator`]},dataValidationShowInvalid:{label:`Show Invalid Data`,description:`Mark the cells whose value fails a data validation.
20
+ A view setting: it changes nothing in the rules.`,groupLabels:{dataValidationOptions:`Show Invalid`}},dataValidationNewRule:{label:`New Data Validation Rule`,description:`Create a new data validation rule for the selected cells.`,groupLabels:{dataValidationOptions:`New Rule…`}},dataValidationClearSelection:{label:`Clear Data Validation from Selected Cells`,description:`Remove the selected cells from every data validation rule covering them.`,groupLabels:{dataValidationClearOptions:`From Selected Cells`},tags:[`mutator`]},dataValidationClearSheet:{label:`Clear Data Validation from Entire Sheet`,description:`Remove every data validation rule on this sheet.`,groupLabels:{dataValidationClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageConditionalFormat:{label:`Conditional Formatting`,description:`Manage conditional formatting rules to change how cells look based on their values.`,groupLabels:{contextMenu:`Conditional Formatting…`,conditionalFormatOptions:`Manage Rules…`},icon:`ConditionalFormatOptions`},conditionalFormatNewRule:{label:`New Conditional Formatting Rule`,description:`Create a new conditional formatting rule for the selected cells.`,groupLabels:{conditionalFormatOptions:`New Rule…`}},conditionalFormatGreaterThan:{label:`Highlight Cells Greater Than`,description:`Highlight cells whose value is greater than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Greater Than…`},tags:[`mutator`]},conditionalFormatLessThan:{label:`Highlight Cells Less Than`,description:`Highlight cells whose value is less than a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Less Than…`},tags:[`mutator`]},conditionalFormatBetween:{label:`Highlight Cells Between`,description:`Highlight cells whose value is between two values you set.`,groupLabels:{conditionalFormatHighlightOptions:`Between…`},tags:[`mutator`]},conditionalFormatEqualTo:{label:`Highlight Cells Equal To`,description:`Highlight cells whose value equals a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Equal To…`},tags:[`mutator`]},conditionalFormatTextContains:{label:`Highlight Cells with Text that Contains`,description:`Highlight cells whose text contains a value you set.`,groupLabels:{conditionalFormatHighlightOptions:`Text that Contains…`},tags:[`mutator`]},conditionalFormatDateOccurring:{label:`Highlight Cells with a Date Occurring`,description:`Highlight cells whose date falls in a period you set.`,groupLabels:{conditionalFormatHighlightOptions:`A Date Occurring…`},tags:[`mutator`]},conditionalFormatDuplicateValues:{label:`Highlight Duplicate Values`,description:`Highlight cells whose value appears more than once in the selection.`,groupLabels:{conditionalFormatHighlightOptions:`Duplicate Values…`},tags:[`mutator`]},conditionalFormatTopItems:{label:`Highlight Top 10 Items`,description:`Highlight the highest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10 Items…`},tags:[`mutator`]},conditionalFormatTopPercent:{label:`Highlight Top 10%`,description:`Highlight the top percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Top 10%…`},tags:[`mutator`]},conditionalFormatBottomItems:{label:`Highlight Bottom 10 Items`,description:`Highlight the lowest-ranked values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10 Items…`},tags:[`mutator`]},conditionalFormatBottomPercent:{label:`Highlight Bottom 10%`,description:`Highlight the bottom percentage of values in the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Bottom 10%…`},tags:[`mutator`]},conditionalFormatAboveAverage:{label:`Highlight Above Average`,description:`Highlight values above the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Above Average…`},tags:[`mutator`]},conditionalFormatBelowAverage:{label:`Highlight Below Average`,description:`Highlight values below the average of the selection.`,groupLabels:{conditionalFormatTopBottomOptions:`Below Average…`},tags:[`mutator`]},conditionalFormatDataBar:{label:`Data Bars`,description:`Add a colored bar to each cell whose length represents its value.`,groupLabels:{conditionalFormatOptions:`Data Bars`},tags:[`mutator`]},conditionalFormatColorScale:{label:`Color Scales`,description:`Color each cell along a gradient according to its value.`,groupLabels:{conditionalFormatOptions:`Color Scales`},tags:[`mutator`]},conditionalFormatIconSet:{label:`Icon Sets`,description:`Show an icon in each cell according to its value.`,groupLabels:{conditionalFormatOptions:`Icon Sets`},tags:[`mutator`]},conditionalFormatClearSelection:{label:`Clear Rules from Selected Cells`,description:`Remove the conditional formatting rules that touch the selected cells.`,groupLabels:{conditionalFormatClearOptions:`From Selected Cells`},tags:[`mutator`]},conditionalFormatClearSheet:{label:`Clear Rules from Entire Sheet`,description:`Remove every conditional formatting rule on this sheet.`,groupLabels:{conditionalFormatClearOptions:`From Entire Sheet`},tags:[`mutator`]},manageProtectedRange:{label:`Allow Edit Ranges`,description:`Manage ranges that stay editable while the sheet is protected.`,groupLabels:{contextMenu:`Allow Edit Ranges…`},icon:`Lock`},dataRemoveDuplicates:{label:`Remove Duplicates`,description:`Remove duplicate rows from a sheet.`,icon:`DataRemoveDuplicates`,tags:[`mutator`]},dataTextToColumns:{label:`Text to Columns`,description:`Split a single columns of text into multiple columns.`,icon:`DataTextToColumns`,tags:[`mutator`]},insertTable:{label:`Insert Table`,description:`Create a table. Tables enable auto formatting, sorting, filtering, and other advanced features.`,groupLabels:{contextMenu:`Insert Table…`},icon:`TableInsert`,shortcut:[`ctrl+L`]},editTable:{label:`Edit Table…`,description:`Edit the table to adjust formatting, sorting, filtering, or other advanced features.`,groupLabels:{tableOptions:`Edit…`,namedItem:`Edit…`},icon:`TableInsert`},deleteTable:{label:`Delete Table`,description:`Remove the table.
21
+
22
+ The table and table specific styling will be removed but the values will be preserved.`,groupLabels:{tableOptions:`Delete`,namedItem:`Delete`},icon:`TableInsert`,tags:[`mutator`]},convertTableToRange:{label:`Convert To Range`,description:`Convert the table into a normal range of cells.
23
+
24
+ The values and the formatting are preserved.`,icon:`TableInsert`,tags:[`mutator`]},tableFilterToggle:{label:`Sort & Filter`,description:`Toggle Auto Table on/off.`,groupLabels:{filterOptions:`Filter`,sortFilterOptions:`Sort & Filter`},icon:`FilterToggle`,shortcut:`ctrl+shift+L`},formatPainterToggle:{label:`Format Painter`,description:`Apply style to another part of your workbook.`,icon:`FormatPaint.yellow`},insertCells:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{{mode, select, copy{Insert Copied Cells} cut{Insert Cut Cells} other{Insert Cells}}{shift, select, right{ (Shift Right)} down{ (Shift Down)} other{}}}}`,description:`Inserts cells at the current selection.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied At Selection} cut{Cut At Selection} other{At Selection}}`},icon:`InsertCells`,shortcut:`ctrl+shift+Equal`,params:{mode:`none`,shift:`none`,span:`none`,count:1}},insertCellsShiftRight:{label:`{span, select, columns{{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}} other{Insert Cells (Shift Right)}}`,description:`Insert cells to the left and shift the current cells to the right.`,groupLabels:{insertCellsOptions:`{span, select, columns{{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}} other{Shift Right}}`},icon:`InsertCellsRight`,params:{mode:`none`,span:`none`,count:1}},insertCellsShiftDown:{label:`{span, select, rows{{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}} other{Insert Cells (Shift Down)}}`,description:`Insert cells above and shift the current cells downward.`,groupLabels:{insertCellsOptions:`{span, select, rows{{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}} other{Shift Down}}`},icon:`InsertCellsDown`,params:{mode:`none`,span:`none`,count:1}},insertRows:{label:`{mode, select, copy{Insert Copied Rows} cut{Insert Cut Rows} other{{count, plural, one{Insert Row} other{Insert # Rows}}}}`,description:`Insert a row above the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Rows} cut{Cut Rows} other{{count, plural, one{Row} other{# Rows}}}}`},icon:`InsertRow`,params:{count:1,mode:`none`}},insertColumns:{label:`{mode, select, copy{Insert Copied Columns} cut{Insert Cut Columns} other{{count, plural, one{Insert Column} other{Insert # Columns}}}}`,description:`Insert a column before the current position.`,groupLabels:{insertCellsOptions:`{mode, select, copy{Copied Columns} cut{Cut Columns} other{{count, plural, one{Column} other{# Columns}}}}`},icon:`InsertColumn2`,params:{count:1,mode:`none`}},insertRowsAfter:{label:`{mode, select, copy{Insert Copied Rows Below} cut{Insert Cut Rows Below} other{{count, plural, one{Insert Row Below} other{Insert # Rows Below}}}}`,description:`Insert a row below the current position.`,groupLabels:{insertCellsOptions:`Row Below`},params:{count:1,mode:`none`}},insertColumnsAfter:{label:`{mode, select, copy{Insert Copied Columns After} cut{Insert Cut Columns After} other{{count, plural, one{Insert Column After} other{Insert # Columns After}}}}`,description:`Insert a column after the current position.`,groupLabels:{insertCellsOptions:`Column After`},params:{count:1,mode:`none`}},deleteCells:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells{shift, select, left{ (Shift Left)} up{ (Shift Up)} other{}}}}`,description:`Delete the cells.`,groupLabels:{deleteCellsOptions:`At Selection`},icon:`DeleteCells`,shortcut:`ctrl+Minus`,params:{span:`none`,count:1,shift:`none`}},deleteCellsShiftUp:{label:`{span, select, rows{{count, plural, one{Delete Row} other{Delete # Rows}}} other{Delete Cells (Shift Up)}}`,description:`Delete cells the current current downward.`,groupLabels:{deleteCellsOptions:`{span, select, rows{{count, plural, one{Row} other{# Rows}}} other{Shift up}}`},icon:`DeleteCellsUp`,params:{span:`none`,count:1}},deleteCellsShiftLeft:{label:`{span, select, columns{{count, plural, one{Delete Column} other{Delete # Columns}}} other{Delete Cells (Shift Left)}}`,description:`Delete cells the current cells to the right.`,groupLabels:{deleteCellsOptions:`{span, select, columns{{count, plural, one{Column} other{# Columns}}} other{Shift Left}}`},icon:`DeleteCellsLeft`,params:{span:`none`,count:1}},deleteRows:{label:`{count, plural, one{Delete Row} other{Delete # Rows}}`,description:`Delete the rows at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Row} other{# Rows}}`},icon:`DeleteRows`,params:{count:1}},deleteColumns:{label:`{count, plural, one{Delete Column} other{Delete # Columns}}`,description:`Delete the columns at the current selection.`,groupLabels:{deleteCellsOptions:`{count, plural, one{Column} other{# Columns}}`},icon:`DeleteColumns`,params:{count:1}},flashFill:{label:`Flash Fill`,description:`Do a flash fill.`,shortcut:[`ctrl+e`,`ctrl+alt+e`]},fillDown:{label:`Fill Down`,description:`Copy the top-most value from the selection to the bottom of the selection.`,icon:`FillDown`,shortcut:[`ctrl+d`,`ctrl+alt+d`],tags:[`mutator`]},fillRight:{label:`Fill Right`,description:`Copy the left-most value from the selection to the right of the selection.`,icon:`FillRight`,shortcut:[`ctrl+r`],tags:[`mutator`]},fillUp:{label:`Fill Up`,description:`Copy the bottom-most value from the selection to the top of the selection.`,icon:`FillUp`,tags:[`mutator`]},fillLeft:{label:`Fill Left`,description:`Copy the right-most value from the selection to the left of the selection.`,icon:`FillLeft`,tags:[`mutator`]},fillSeries:{label:`Series…`,description:`Fill the selection with a series of numbers or dates, choosing the type, step value and stop value.`,tags:[`mutator`]},formatBorderAddOutline:{label:`Add Outline Border`,description:`Apply an outline border.`,shortcut:`ctrl+shift+7`,tags:[`mutator`]},formatBorderClearOutline:{label:`Remove Outline Border`,description:`Remove the outline border.`,shortcut:`ctrl+shift+_`,tags:[`mutator`]},formatIndentDecrease:{label:`Decrease Indent`,description:`Move your content closer to the border.`,icon:`FormatIndentDecrease`,tags:[`mutator`,`quickAction`]},formatIndentIncrease:{label:`Increase Indent`,description:`Move your content further from the border.`,icon:`FormatIndentIncrease`,tags:[`mutator`,`quickAction`]},mergeToggle:{label:`Merge`,description:`Combine and center the contents into a single cell.`,icon:`MergeAll`,shortcut:`ctrl+m`},mergeHorizontal:{label:`Merge Horizontally`,description:`Combine the contents into horizontal rows.`,icon:`MergeHorizontal`},mergeVertical:{label:`Merge Vertically`,description:`Combine the contents into vertical columns.`,icon:`MergeVertical`},unmerge:{label:`Unmerge`,description:`Split merged cells into multiple cells.`,icon:`MergeUnMerge`},clearContents:{label:`Clear Contents`,description:`Clear only the contents in the cells.
25
+
26
+ The formatting is not cleared.`,groupLabels:{clearOptions:`Contents`},icon:`ClearContents`,shortcut:`Delete`,tags:[`mutator`]},clearFormats:{label:`Clear Formats`,description:`Clear only the formatting that is applied to the cells.`,groupLabels:{clearOptions:`Formats`},icon:`ClearFormats`,tags:[`mutator`]},clearHyperlinks:{label:`Clear Hyperlinks`,description:`Clear only the hyperlinks in the cells.`,groupLabels:{clearOptions:`Hyperlinks`},tags:[`mutator`]},clearComments:{label:`Clear Comments`,description:`Clear the comments from the cells.`,groupLabels:{clearOptions:`Comments`},tags:[`mutator`]},clearAll:{label:`Clear All`,description:`Clears everything from the cells.
27
+
28
+ All contents and formatting are removed.`,groupLabels:{clearOptions:`All`},icon:`ClearAll`,shortcut:`ctrl+shift+Delete`,tags:[`mutator`]},freezeToggle:{label:`Freeze Panes`,description:`Keep rows and columns visible while the rest of the sheet scrolls (based on current selection).`,icon:`FreezeBoth`},freezeToggleHorizontal:{label:`Freeze Top Rows`,description:`Keep the top rows visible while scrolling through the rest of the sheet.`,icon:`FreezeRows`},freezeToggleVertical:{label:`Freeze Left Columns`,description:`Keep the left columns visible while scrolling through the rest of the sheet.`,icon:`FreezeColumns`},unfreeze:{label:`Unfreeze Panes`,description:`Unfreeze both the rows and columns.`,icon:`MergeUnMerge`},autoFitRows:{label:`Autofit Rows`,description:`Adjust the rows to the best height.`,icon:`RowsResizeAuto`,tags:[`mutator`]},resizeRows:{label:`Resize Rows`,description:`Resize the rows to the specified height.`,icon:`RowsResize`,tags:[`mutator`]},autoFitColumns:{label:`Autofit Columns`,description:`Adjust the columns to the best width.`,icon:`ColumnsResizeAuto`,tags:[`mutator`]},resizeColumns:{label:`Resize Columns`,description:`Resize the columns to the specified width.`,icon:`ColumnsResize`,tags:[`mutator`]},pasteValues:{label:`Paste Values`,description:`Paste only the values of the selected cells.
29
+
30
+ The formatting is not applied.`,groupLabels:{pasteOptions:`Values`},icon:`PasteValues`,shortcut:`ctrl+shift+V`},pasteFormats:{label:`Paste Formatting`,description:`Paste only the formats of the selected cells.
31
+
32
+ The content is not applied.`,groupLabels:{pasteOptions:`Formatting`},icon:`PasteFormats`},pasteFormulas:{label:`Paste Formulas`,description:`Paste only the formulas of the selected cells. The values and formatting is not applied.`,groupLabels:{pasteOptions:`Formulas`},icon:`PasteFormulas`},pasteTranspose:{label:`Paste Transpose`,description:`Paste with the rows and columns flipped.`,groupLabels:{pasteOptions:`Transpose`},icon:`PasteTranspose`},pasteLinks:{label:`Paste Links`,description:`Paste as formula references to the original cells.`,groupLabels:{pasteOptions:`Links`},icon:`PasteLinks`},undo:{label:`Undo`,icon:`Undo`,shortcut:`ctrl+z`,borrow:[`workbook`],description:`{hasAction, select, true{Undo {action}} other{Undo the last action.}}`,params:{hasAction:!1,action:``}},redo:{label:`Redo`,icon:`Redo`,shortcut:[`ctrl+y`,`F4`,`alt+Enter`],borrow:[`workbook`],description:`{hasAction, select, true{Redo {action}} other{Repeat the last action or undo the redo.}}`,params:{hasAction:!1,action:``}}}}},{sourceId:`table`,catalog:{scope:`table`,label:`Table`,tag:`en`,version:1,commands:{tableStyleOptions:{label:`Table Style Options`,description:`Toggle which structural elements (header, total, banded rows/columns, filter) the table shows.`},tableTotalRowToggle:{label:`Toggle Table Total Row`,description:`Toggle Total Row on/off.`,groupLabels:{tableStyleOptions:`Total Row`},shortcut:`ctrl+alt+T`},tableHeaderRowToggle:{label:`Toggle Table Header Row`,description:`Toggle Header Row on/off.`,groupLabels:{tableStyleOptions:`Header Row`}},tableBandedRowsToggle:{label:`Toggle Table Banded Rows`,description:`Toggle Banded Rows on/off.`,groupLabels:{tableStyleOptions:`Banded Rows`}},tableFirstColumnToggle:{label:`Toggle Table First Column`,description:`Toggle First Column on/off.`,groupLabels:{tableStyleOptions:`First Column`}},tableLastColumnToggle:{label:`Toggle Table Last Column`,description:`Toggle Last Column on/off.`,groupLabels:{tableStyleOptions:`Last Column`}},tableBandedColumnsToggle:{label:`Toggle Table Banded Columns`,description:`Toggle Banded Columns on/off.`,groupLabels:{tableStyleOptions:`Banded Columns`}},tableFilterRefresh:{label:`Reapply Sort & Filter`,description:`Reapply the sort and filter with the latest changes.`,groupLabels:{filterOptions:`Reapply`,sortFilterOptions:`Reapply`},icon:`FilterReapply`,shortcut:`ctrl+alt+L`},tableFilterClear:{label:`Clear Sort & Filter`,description:`Clear the sort and filters criteria from the current area..`,groupLabels:{filterOptions:`Clear`,sortFilterOptions:`Clear`},icon:`FilterClear`},formatTableStyleClearTableStyle:{label:`Clear Table Style`,description:`Remove all the styling that is specific for the table.`,groupLabels:{tableStyleOptions:`Clear Style`},icon:`ClearFormats`}}}},{sourceId:`workbook`,catalog:{scope:`workbook`,label:`Workbook`,tag:`en`,version:1,commands:{addSheet:{label:`Insert Sheet`,description:`Insert sheet before the current sheet.`,groupLabels:{sheet:`Insert`},shortcut:[`shift+F11`,`shift+alt+F1`]},deleteSheet:{label:`Delete Sheet`,description:`Delete the sheet and all the data.`,groupLabels:{sheet:`Delete`}},duplicateSheet:{label:`Duplicate Sheet`,description:`Duplicate the current sheet.`,groupLabels:{sheet:`Duplicate`}},hideSheet:{label:`Hide Sheet`,description:`Hide the sheet from appearing in the tabs. This keeps the data but de-clutters the tabs.`,groupLabels:{sheet:`Hide`},icon:`VisibilityOff`},nextSheet:{label:`Next Sheet`,description:`Activate the next sheet.`,groupLabels:{sheet:`Next`},shortcut:`ctrl+PageDown`},previousSheet:{label:`Previous Sheet`,description:`Activate the previous sheet.`,groupLabels:{sheet:`Previous`},shortcut:`ctrl+PageUp`},selectNextSheet:{label:`Select Next Sheet`,description:`Select the next sheet.`,groupLabels:{sheet:`Select Next`},shortcut:`ctrl+shift+PageDown`},selectPreviousSheet:{label:`Select Previous Sheet`,description:`Select the previous sheet.`,groupLabels:{sheet:`Select Previous`},shortcut:`ctrl+shift+PageUp`},workbookViewToggleShowFormulaBar:{label:`View Formula bar`,description:`Show or hide the formula bar.`,groupLabels:{view:`Formula Bar`}},workbookViewToggleShowTabs:{label:`View Sheet Tabs`,description:`Show or hide the sheet tabs.`,groupLabels:{view:`Sheet Tabs`}},workbookViewToggleShowStatusBar:{label:`View Status Bar`,description:`Show or hide the status bar.`,groupLabels:{view:`Status Bar`}},workbookViewToggleShowHorizontalScrollBar:{label:`View Horizontal Scrollbar`,description:`Show or hide the horizontal scrollbar.`,groupLabels:{view:`Horizontal Scrollbar`}},workbookViewToggleShowVerticalScrollBar:{label:`View Vertical Scrollbar`,description:`Show or hide the vertical scrollbar.`,groupLabels:{view:`Vertical Scrollbar`}},workbookViewToggleExpandFormulaBar:{label:`Toggle Expand Formula bar`,description:`Expand or collapse the formula bar.`,shortcut:`ctrl+shift+U`},locale:{label:`Regional Format`,description:`The regional format used for numbers and dates. This is saved with the workbook.`,icon:`Locale`},newCellStyle:{label:`New Cell Style…`,description:`Create a new named style can can be quickly used later.`,groupLabels:{cellStyle:`New Cell Style`},icon:`NewPresetStyles`},deleteCellStyle:{label:`Delete Cell Style`,description:`Remove a named style that is no longer needed.`,groupLabels:{cellStyle:`Delete`}},modifyCellStyle:{label:`Modify Cell Style`,description:`Update a style with the currently style.`,groupLabels:{cellStyle:`Modify`}},find:{label:`Find`,description:`Open the Find window.`,icon:`Find`,shortcut:[`ctrl+F`,`shift+F5`]},findReplace:{label:`Find & Replace`,description:`Open the Find & Replace window.`,icon:`FindReplace`,shortcut:[`ctrl+H`,`ctrl+alt+H`]},findNext:{label:`Find Next`,description:`Find the next match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`shift+F4`},findPrevious:{label:`Find Previous`,description:`Find the previous match of the last search, without opening the Find window.`,icon:`Find`,shortcut:`ctrl+shift+F4`},goto:{label:`Go To`,description:`Open the 'Go To' window.`,icon:`GoTo`,shortcut:`ctrl+G`},selectNamed:{label:`Select Named`,description:`Select the named item.`},addNamedReference:{label:`Define Named Reference`,description:`Add a new named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Define Name…`},icon:`InsertNamedRange`},editNamedReference:{label:`Edit Named Reference…`,description:`Edit the named reference. Names can be used as a substitute for cell references.`,groupLabels:{namedItem:`Edit…`},icon:`NamedRangeEdit`},deleteNamedReference:{label:`Delete Named Reference`,description:`Remove the named reference.`,groupLabels:{namedItem:`Delete`},icon:`DeleteNamedRange`},manageExternalLinks:{label:`Workbook Links`,description:`See every workbook this one links to, go to the formulas that cite one, and break a link.`,icon:`DataSetLinked`},insertFunction:{label:`Insert Function`,description:`Insert a function into the current cell.`,icon:`FunctionThin`},selectTheme:{label:`Theme`,description:`Select a theme that coveys a style suitable for your data.`},calculateAll:{label:`Calculate Now`,description:`Recalculate the formulas whose values are out of date, on every sheet.`,icon:`Calculate`,shortcut:`F9`},calculateFull:{label:`Calculate Full`,description:`Recalculate every formula in the workbook, including those already up to date. Use this to replace the values a file was opened with.`,icon:`Calculate`,shortcut:`ctrl+alt+F9`},calcModeAutomatic:{label:`Automatic`,description:`Recalculate formulas whenever their inputs change.`},calcModeAutomaticExceptTables:{label:`Automatic Except for Data Tables`,description:`Recalculate formulas whenever their inputs change, except what-if data tables. Without data tables this is the same as Automatic.`},calcModeManual:{label:`Manual`,description:`Recalculate only when you ask (F9). Edits leave dependent formulas out of date until then.`},calcIterativeToggle:{label:`Enable Iterative Calculation`,description:`Resolve circular references by recalculating them repeatedly until they settle or the maximum iterations is reached. Off, a circular reference evaluates to 0.`},selectDirectPrecedents:{label:`Select Direct Precedents`,description:`Select the cells directly referenced by the formulas in the selection.`,shortcut:`ctrl+[`},selectPrecedents:{label:`Select All Precedents`,description:`Select all cells that contribute to the formulas in the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+{`},selectDirectDependents:{label:`Select Direct Dependents`,description:`Select the cells with formulas that directly reference the selection.`,shortcut:`ctrl+]`},selectDependents:{label:`Select All Dependents`,description:`Select all cells that are eventually affected by the selection, following the entire calculation chain.`,shortcut:`ctrl+shift+}`},maximumWorkbookToggle:{label:`Maximize`,description:`Toggle showing the workbook maximized.`,shortcut:`ctrl+F10`},activeNameBox:{label:`Activate Name Box`,description:`Move the focus to the name box.`,shortcut:`alt+F3`},activeNameManager:{label:`Name Manager`,description:`Create, edit, delete, and find all the names used in the workbook.
33
+
34
+ Names can be used as a substitute for cell references.`,shortcut:`ctrl+F3`,icon:`NamedManager`,groupLabels:{namedItem:`Manage Names…`}},createNamedReferenceFromSelection:{label:`Create from Selection`,description:`Automatically generate names from the selected cells.`,shortcut:`ctrl+shift+F3`},spellCheck:{label:`Spell Check`,description:`Check the workbook for spelling mistakes.`,shortcut:`F7`},workbookStatistics:{label:`Workbook Statistics`,description:`Show the workbook statistics.`,shortcut:`ctrl+shift+G`}}}}],{DefaultCommandCatalogService:bu}=i.Jt,xu=!1;function Su(){xu||(xu=!0,bu.registerFromManifest(`@sheetxl/react`,{}.url,{messages:vu,catalogs:yu}))}Su();var{CommandScope:Cu,DefaultCommandRegistry:wu,FocusActivation:Tu,CommandRegistryContext:Eu,CommandScopeContext:Du,CommandAnchorProvider:Ou,CommandFallbackProvider:ku,useCommandScope:Au}=i.Jt,ju=({initialAnchor:e,children:t})=>Au()?(0,d.jsx)(d.Fragment,{children:t}):(0,d.jsx)(Mu,{initialAnchor:e,children:t});ju.displayName=`CommandRootProvider`;var Mu=({initialAnchor:e,children:t})=>{let n=(0,u.useRef)(e),{root:r,registry:i,studioTracker:a}=(0,u.useMemo)(()=>{let e=wu,t=new Cu(`app`,null,{registry:e});return{root:t,registry:e,studioTracker:new Tu(t,n.current)}},[]);(0,u.useEffect)(()=>(r.connect(),()=>r.dispose()),[r]);let o=(0,u.useMemo)(()=>i.getDynamic(r.name),[i,r]);return(0,d.jsx)(Eu.Provider,{value:i,children:(0,d.jsx)(fu.Provider,{value:a,children:(0,d.jsx)(Du.Provider,{value:r,children:(0,d.jsxs)(Ou,{tracker:a,keyBindings:`synthetic`,debounce:100,children:[(0,d.jsx)(du,{}),(0,d.jsxs)(ku,{children:[o.map((e,t)=>(0,d.jsx)(e,{scope:r,data:void 0},t)),t]})]})})})})};Mu.displayName=`CommandRootProviderOwn`;var Nu=`workbookToolbars`,Pu={key:`tableStyleOptions`,showLabel:!0,members:[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`,`tableFilterToggle`]},Fu={key:`tableToolbar`,contributions:{[Nu]:{order:1}},members:[`editTable`,`-`,`tableStyleOptions`,`-`,`sortOptions`,`filterOptions`,`-`,`dataRemoveDuplicates`,{key:`convertTableToRange`,showLabel:!0},`-`,`formatTableStyle`]},Iu=0,Lu=()=>{Iu>0&&--Iu===0&&(i.Jt.DefaultCommandButtonRegistry.get(`tableToolbar`)&&i.Jt.DefaultCommandButtonRegistry.unregister(`tableToolbar`),i.Jt.DefaultCommandButtonRegistry.get(`tableStyleOptions`)&&i.Jt.DefaultCommandButtonRegistry.unregister(`tableStyleOptions`))},Ru=(e,t)=>e?[t]:[],zu=[`tableHeaderRowToggle`,`tableTotalRowToggle`,`tableBandedRowsToggle`,`tableFirstColumnToggle`,`tableLastColumnToggle`,`tableBandedColumnsToggle`];function Bu(e,t){let r=t.sheet;if(!r)return()=>{};let o=t.notifier,s=()=>{let e=r.getSelectedRanges();if(e.getCount()!==1)return null;let t=e.at(0).getCoords();for(let e of r.getTables().getItems()){let n=e.getRange().getCoords();if(t.rowStart>=n.rowStart&&t.rowEnd<=n.rowEnd&&t.colStart>=n.colStart&&t.colEnd<=n.colEnd)return e}return null},c=e=>{let t=e.getDataRange().getCoords(),n=r.getSelectedRange().getCoords(),i=Math.min(Math.max(n.rowStart,t.rowStart),t.rowEnd),a=Math.min(Math.max(n.rowEnd,t.rowStart),t.rowEnd);return{index:i-t.rowStart,count:a-i+1,valid:n.rowStart>=t.rowStart&&n.rowEnd<=t.rowEnd}},l=e=>{let t=e.getRange().getCoords(),n=r.getSelectedRange().getCoords(),i=Math.min(Math.max(n.colStart,t.colStart),t.colEnd),a=Math.min(Math.max(n.colEnd,t.colStart),t.colEnd);return{index:i-t.colStart,count:a-i+1}},u=e=>()=>{let t=s(),r=t?c(t):null;return n.r(e,{count:r?.valid?r.count:1})},d=e=>()=>{let t=s();return n.r(e,{count:t?l(t).count:1})},f=()=>{let e=s();e&&c(e).valid&&r.getSelectedRange().insert({axis:a.l.Axis.Row,span:!0})},p=()=>{let e=s();e&&c(e).valid&&r.getSelectedRange().delete({axis:a.l.Axis.Row,span:!0})},m=()=>{s()&&r.getSelectedRange().insert({axis:a.l.Axis.Column,span:!0})},h=()=>{s()&&r.getSelectedRange().delete({axis:a.l.Axis.Column,span:!0})},g=()=>r.getSelectedRanges().getDefaultShiftAxis()===a.l.Axis.Column,_=()=>{let t=s();e.updateCommand(`tableTotalRowToggle`,{state:t?.isShowTotals()??!1}),e.updateCommand(`tableHeaderRowToggle`,{state:t?.isShowHeaders()??!1}),e.updateCommand(`tableBandedRowsToggle`,{state:t?.isShowBandedRows()??!1}),e.updateCommand(`tableFirstColumnToggle`,{state:t?.isShowHighlightFirstColumn()??!1}),e.updateCommand(`tableLastColumnToggle`,{state:t?.isShowHighlightLastColumn()??!1}),e.updateCommand(`tableBandedColumnsToggle`,{state:t?.isShowBandedColumns()??!1});let i=r.getProtection(),a=Ru(!i.isFormatCellsAllowed(),n.q(`reason.sheetProtected`));for(let t of zu)e.updateCommand(t,{disabledReasons:a});let o=Ru(!i.isAutoTableAllowed()||!i.isSortAllowed(),n.q(`reason.sheetProtected`));if(e.updateCommand(`tableFilterRefresh`,{disabledReasons:o}),e.updateCommand(`tableFilterClear`,{disabledReasons:o}),e.updateCommand(`formatTableStyleClearTableStyle`,{disabledReasons:[...a,...Ru(!t||t.getStyleOptions().name===null,n.q(`reason.noTableStyle`))]}),t){let r=Ru(!c(t).valid,n.q(`reason.tableBodyRows`));e.updateCommand(`insertCellsShiftDown`,{disabledReasons:r}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:r});let i=g()?[]:r;e.updateCommand(`insertCells`,{disabledReasons:i}),e.updateCommand(`deleteCells`,{disabledReasons:i})}},v=null,y=null,b=e=>{e!==v&&(y?.(),y=null,v=e,e&&(y=e.addListeners({onAnyChange:()=>{x!==null&&_()}},{transactional:!1})))},x=null,S=()=>{let a=s();b(a);let c=a?`table`:r.getAutoTable()?`auto`:null;c!==x&&(x!==null&&e.remove(),c===null?Lu():(x===null&&Iu++===0&&(i.Jt.DefaultCommandButtonRegistry.register(Pu,!0),i.Jt.DefaultCommandButtonRegistry.register(Fu,!0)),e.use(nu({transaction:r,notifier:o,manager:t.manager})),e.updateCommand(`tableTotalRowToggle`,{callback:()=>{let e=s();e&&e.setShowTotals(!e.isShowTotals())}}),e.updateCommand(`tableHeaderRowToggle`,{callback:()=>{let e=s();e&&e.setShowHeaders(!e.isShowHeaders())}}),e.updateCommand(`tableBandedRowsToggle`,{callback:()=>{let e=s();e&&e.setShowBandedRows(!e.isShowBandedRows())}}),e.updateCommand(`tableFirstColumnToggle`,{callback:()=>{let e=s();e&&e.setShowHighlightFirstColumn(!e.isShowHighlightFirstColumn())}}),e.updateCommand(`tableLastColumnToggle`,{callback:()=>{let e=s();e&&e.setShowHighlightLastColumn(!e.isShowHighlightLastColumn())}}),e.updateCommand(`tableBandedColumnsToggle`,{callback:()=>{let e=s();e&&e.setShowBandedColumns(!e.isShowBandedColumns())}}),e.updateCommand(`tableFilterRefresh`,{callback:async()=>{await(s()??r.getAutoTable())?.applySortsAndFilters()}}),e.updateCommand(`tableFilterClear`,{callback:async e=>{if(e)return e.getSort()?.delete(),void await e.getFilter()?.delete();await(s()??r.getAutoTable())?.deleteSortsAndFilters()}}),e.updateCommand(`formatTableStyleClearTableStyle`,{tags:[`noTransaction`],callback:()=>{s()?.updateStyleOptions({name:null})},context:()=>({styles:()=>r.getStyles(),table:()=>s(),getNames:()=>r.getNames(),resolveRanges:e=>(r.getWorkbook()??r).getRanges(e).getFixed(!0)})}),c===`table`&&(e.updateCommand(`insertCellsShiftDown`,{label:u(n.q(`table.insertRows`)),groupLabels:{insertCellsOptions:u(n.q(`table.rows.compact`))},description:()=>n.r(`table.insertRows.description`),icon:`InsertRow`,callback:f}),e.updateCommand(`deleteCellsShiftUp`,{label:u(n.q(`table.deleteRows`)),groupLabels:{deleteCellsOptions:u(n.q(`table.rows.compact`))},description:()=>n.r(`table.deleteRows.description`),icon:`DeleteRows`,callback:p}),e.updateCommand(`insertCellsShiftRight`,{label:d(n.q(`table.insertColumns`)),groupLabels:{insertCellsOptions:d(n.q(`table.columns.compact`))},description:()=>n.r(`table.insertColumns.description`),icon:`InsertColumn2`,callback:m}),e.updateCommand(`deleteCellsShiftLeft`,{label:d(n.q(`table.deleteColumns`)),groupLabels:{deleteCellsOptions:d(n.q(`table.columns.compact`))},description:()=>n.r(`table.deleteColumns.description`),icon:`DeleteColumns`,callback:h}),e.updateCommand(`insertCells`,{label:()=>(g()?d(n.q(`table.insertColumns`)):u(n.q(`table.insertRows`)))(),groupLabels:{insertCellsOptions:()=>(g()?d(n.q(`table.columns.compact`)):u(n.q(`table.rows.compact`)))()},description:()=>g()?n.r(`table.insertColumns.description`):n.r(`table.insertRows.description`),callback:()=>{g()?m():f()}}),e.updateCommand(`deleteCells`,{label:()=>(g()?d(n.q(`table.deleteColumns`)):u(n.q(`table.deleteRows`)))(),groupLabels:{deleteCellsOptions:()=>(g()?d(n.q(`table.columns.compact`)):u(n.q(`table.rows.compact`)))()},description:()=>g()?n.r(`table.deleteColumns.description`):n.r(`table.deleteRows.description`),callback:()=>{g()?h():p()}}))),x=c),c!==null&&_()};S();let C=r.getSelection().addListeners({onChange:S}),w=r.addListeners({onTablesChange:S,onAutoTableChange:S,onProtectionChange:S});return()=>{C(),w(),b(null),x!==null&&(Lu(),x=null)}}var{CommandScopeProvider:Vu}=i.Jt,Hu=(0,u.memo)(e=>{let{sheet:t}=e,n=i.ot(),r=eu(),a=(0,u.useMemo)(()=>({sheet:t,notifier:n,manager:r??void 0}),[t,n,r]);return(0,d.jsx)(Vu,{spec:{scopeName:{key:`layer:table`,name:`table`},contributor:{dynamic:Bu},data:a},order:fe().zIndex})});Hu.displayName=`SheetTableCommandLayer`;var Uu=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:r,animationTime:o=60,className:s,style:c,...l}=e,f=Z(),[p,m]=(0,u.useState)(null),[h,g]=(0,u.useState)(!1),[_,v]=(0,u.useState)(null),y=(0,u.useRef)(null),b=i.X(()=>{let e=r.getSelectedCell(),t=e.getSpill()?.getCoords()??null;g(!!t&&e.getSpillKind()===`fixed`),n.d.isEqualRanges(t,p)||(v(t?{transition:p?`move`:`in`,coords:t}:{transition:`out`,coords:p}),m(t))},[r,f,p]);(0,u.useEffect)(()=>(y.current&&=(clearTimeout(y.current),null),_&&(y.current=setTimeout(()=>{v(null),y.current=null},o)),()=>{y.current&&=(clearTimeout(y.current),null)}),[_,o]);let x=(0,u.useMemo)(()=>n.u.debounce(n.u.throttle(b,80),80),[]);if(Ni(r?.getSelection(),{onChange(e){x()}}),Ni(r,{onSpillsChange(e){b()},onInvalidated(e){b()}}),!f)return null;let S=p??_?.coords;if(!S)return null;let C=!!p&&r.getRange(p).getValue()instanceof a.i.Spill,w=h?`var(--sxl-color-accent)`:`var(--sxl-color-primary)`,T=`color-mix(in srgb, ${w} 70%, black)`;return(0,d.jsx)(pe,{className:$(s,`spill-outline`,h&&`spill-outline-fixed`),children:(0,u.createElement)(xn,{...l,key:`spill-outline`,className:`spill-outline-box`,range:S,alignWidth:1,stroke:T,clipInsets:-10,style:{...c,opacity:_?.transition===`out`?0:1},propsStrokePath:{strokeDasharray:C?`6 3`:void 0,style:{filter:`drop-shadow(0px 0px 2px color-mix(in srgb, color-mix(in srgb, ${w} 80%, white) 80%, transparent))`}}})})})),Wu=Object.freeze([{key:`lightRedFillDarkRedText`,style:{font:{color:`#9C0006`},fill:{type:`solid`,color:`#FFC7CE`}}},{key:`yellowFillDarkYellowText`,style:{font:{color:`#9C6500`},fill:{type:`solid`,color:`#FFEB9C`}}},{key:`greenFillDarkGreenText`,style:{font:{color:`#006100`},fill:{type:`solid`,color:`#C6EFCE`}}},{key:`lightRedFill`,style:{fill:{type:`solid`,color:`#FFC7CE`}}},{key:`redText`,style:{font:{color:`#9C0006`}}},{key:`redBorder`,style:{borders:{[o.W.Edge.Left]:{style:o.W.StrokeStyle.Thin,color:`#9C0006`},[o.W.Edge.Top]:{style:o.W.StrokeStyle.Thin,color:`#9C0006`},[o.W.Edge.Right]:{style:o.W.StrokeStyle.Thin,color:`#9C0006`},[o.W.Edge.Bottom]:{style:o.W.StrokeStyle.Thin,color:`#9C0006`}}}}]),Gu=`#F8696B`,Ku=`#FFEB84`,qu=`#63BE7B`,Ju=`#FCFCFF`,Yu=`#5A8AC6`,Xu=`#FFEF9C`,Zu=e=>{let t=e.map((t,n)=>n===0?{type:o.Xt.ColorStopType.Min,color:t}:n===e.length-1?{type:o.Xt.ColorStopType.Max,color:t}:{type:o.Xt.ColorStopType.Percentile,value:50,color:t});return{type:o.Xt.ScaleType.ColorScale,stops:t}},Qu=Object.freeze([Zu([qu,Ku,Gu]),Zu([Gu,Ku,qu]),Zu([qu,Ju,Gu]),Zu([Gu,Ju,qu]),Zu([Yu,Ju,Gu]),Zu([Gu,Ju,Yu]),Zu([Ju,Gu]),Zu([Gu,Ju]),Zu([qu,Ju]),Zu([Ju,qu]),Zu([qu,Xu]),Zu([Xu,qu])]),$u=Object.freeze([`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`]),ed=(e,t)=>({type:o.Xt.ScaleType.DataBar,stops:[{type:o.Xt.ColorStopType.AutoMin},{type:o.Xt.ColorStopType.AutoMax}],color:e,...t?{gradient:!0,borderColor:e}:null}),td=Object.freeze([...$u.map(e=>ed(e,!0)),...$u.map(e=>ed(e,!1))]),nd=()=>structuredClone(Qu[1]),rd=()=>structuredClone(td[0]),id=e=>{let t=[];for(let n=0;n<e;n++)t.push({type:o.Xt.ColorStopType.Percent,value:Math.round(100*n/e)});return t},ad=()=>({type:o.Xt.ScaleType.IconSet,iconSet:o.it.IconSet.TrafficLights3,stops:id(3)}),od=Object.freeze([{key:`directional`,rows:[[o.it.IconSet.Arrows3,o.it.IconSet.ArrowsGray3],[o.it.IconSet.Arrows4,o.it.IconSet.ArrowsGray4],[o.it.IconSet.Arrows5,o.it.IconSet.ArrowsGray5],[o.it.IconSet.Triangles3,null]]},{key:`shapes`,rows:[[o.it.IconSet.Signs3,o.it.IconSet.TrafficLights3_2],[o.it.IconSet.TrafficLights3,o.it.IconSet.TrafficLights4],[o.it.IconSet.RedToBlack4,null]]},{key:`indicators`,rows:[[o.it.IconSet.Symbols3,o.it.IconSet.Symbols3_2],[o.it.IconSet.Flags3,null]]},{key:`ratings`,rows:[[o.it.IconSet.Stars3,o.it.IconSet.Rating4],[o.it.IconSet.Quarters5,o.it.IconSet.Rating5],[o.it.IconSet.Boxes5,null]]}]),sd=e=>{if(e===o.it.IconSet.NoIcons)return 0;let t=parseInt(e,10);return Number.isFinite(t)&&t>0?t:3},cd=e=>({type:o.Xt.ScaleType.IconSet,iconSet:e,stops:id(sd(e))}),ld=Object.freeze({set:o.it.IconSet.NoIcons,id:0}),ud=(e,t)=>({set:e,id:t}),dd=(e,t,n)=>{let r=e.iconSet??o.it.IconSet.TrafficLights3,i=e.stops?.length??sd(r),a=[];for(let o=0;o<i;o++){let i=o===t?n:e.icon?.[o];a.push(i?{set:i.set,id:i.id}:ud(r,o))}let s=a.every((e,t)=>e.set===r&&e.id===t),c={...e};return s?delete c.icon:c.icon=a,c},fd={bad:`var(--sxl-cf-icon-bad)`,lightBad:`var(--sxl-cf-icon-light-bad)`,neutral:`var(--sxl-cf-icon-neutral)`,good:`var(--sxl-cf-icon-good)`,purple:`var(--sxl-cf-icon-purple)`,gold:`var(--sxl-cf-icon-gold)`,gray:`var(--sxl-cf-icon-gray)`,black:`var(--sxl-cf-icon-black)`},pd=(e,t)=>({iconKey:`cf:${e}`,color:t}),md=[`arrowDown`,`arrowRight`,`arrowUp`],hd=[`arrowDown`,`arrowDownRight`,`arrowUpRight`,`arrowUp`],gd=[`arrowDown`,`arrowDownRight`,`arrowRight`,`arrowUpRight`,`arrowUp`],_d=[fd.bad,fd.neutral,fd.good],vd=[fd.bad,fd.lightBad,fd.lightBad,fd.good],yd=[fd.bad,fd.lightBad,fd.lightBad,fd.lightBad,fd.good],bd=(e,t)=>e.map((e,n)=>pd(e,t[n])),xd=(e,t)=>e.map(e=>pd(e,t)),Sd=(e,t)=>t.map(t=>pd(e,t)),Cd=[`rating0`,`rating1`,`rating2`,`rating3`,`rating4`],wd={[o.it.IconSet.Arrows3]:bd(md,_d),[o.it.IconSet.ArrowsGray3]:xd(md,fd.gray),[o.it.IconSet.Flags3]:Sd(`flag`,_d),[o.it.IconSet.Signs3]:bd([`diamond`,`triangleUp`,`circle`],_d),[o.it.IconSet.Symbols3]:bd([`circleCross`,`circleExclamation`,`circleCheck`],_d),[o.it.IconSet.Symbols3_2]:bd([`cross`,`exclamation`,`check`],_d),[o.it.IconSet.TrafficLights3]:Sd(`circle`,_d),[o.it.IconSet.TrafficLights3_2]:Sd(`circleRimmed`,_d),[o.it.IconSet.Triangles3]:bd([`triangleDownSharp`,`dash`,`triangleUpSharp`],_d),[o.it.IconSet.Stars3]:xd([`star0`,`star1`,`star2`],fd.gold),[o.it.IconSet.Arrows4]:bd(hd,vd),[o.it.IconSet.ArrowsGray4]:xd(hd,fd.gray),[o.it.IconSet.Rating4]:xd(Cd.slice(1),fd.gray),[o.it.IconSet.RedToBlack4]:Sd(`circle`,[fd.black,fd.gray,fd.purple,fd.bad]),[o.it.IconSet.TrafficLights4]:Sd(`circleRimmed`,[fd.black,fd.bad,fd.neutral,fd.good]),[o.it.IconSet.Arrows5]:bd(gd,yd),[o.it.IconSet.ArrowsGray5]:xd(gd,fd.gray),[o.it.IconSet.Quarters5]:xd([`quarters0`,`quarters1`,`quarters2`,`quarters3`,`quarters4`],fd.black),[o.it.IconSet.Rating5]:xd(Cd,fd.gray),[o.it.IconSet.Boxes5]:xd([`boxes0`,`boxes1`,`boxes2`,`boxes3`,`boxes4`],fd.black),[o.it.IconSet.NoIcons]:[]},Td=(e,t)=>wd[e]?.[t]??null,Ed=e=>wd[e]??Dd,Dd=Object.freeze([]),Od=e=>{let t=e.iconSet,n=e.stops?.length??(t?sd(t):0),r=[];for(let i=0;i<n;i++){let a=e.reverse?n-1-i:i,o=e.icon?.[a];o?r.push(Td(o.set,o.id)):r.push(t?Td(t,a):null)}return r},kd=new Map(Object.keys(fd).map(e=>[fd[e],e])),Ad=e=>({shape:e.iconKey.slice(e.iconKey.indexOf(`:`)+1),tone:kd.get(e.color)??`black`}),jd=(()=>{let e=new Set,t=[];for(let n of od)for(let r of n.rows)for(let n of r){if(!n)continue;let r=wd[n]??Dd;for(let i=r.length-1;i>=0;i--){let a=r[i],o=`${a.iconKey}|${a.color}`;e.has(o)||(e.add(o),t.push({set:n,id:i,spec:a}))}}return Object.freeze(t)})(),Md=(0,u.memo)(e=>{let{sheet:t,margin:n=1,className:r,style:a,...o}=e,s=Z(),{getVisibleDecorations:c,cacheToken:l}=Mc(t,`dataBar`),f=(0,u.useMemo)(()=>({}),[l,n]),p=i.X(e=>{let{value:t,style:r,zoom:a=1,key:o}=e,s=t?.getConditionalDecorations().dataBar;if(!s||!r)return null;let c=Math.max(1,Math.round(n*a)),l=1/i.kt.getDevicePixelRatio();return(0,d.jsx)(Nd,{bar:s,track:{x:r.left+c+l,y:r.top+c+l,width:r.width-2*c-l,height:r.height-2*c-l}},o)},[n]);return c(s).length===0?null:(0,d.jsx)(pe,{...o,className:$(r,`conditional-bars`),children:(0,d.jsx)(nr,{renderCell:p,getVisibleCells:c,cacheToken:f,style:a})})});Md.displayName=`ConditionalBarLayer`;var Nd=({bar:e,track:t})=>{let{value:n,axis:r,gradient:i,direction:a}=e,o=n<r,s=Math.min(n,r)*t.width,c=Math.abs(n-r)*t.width,l=a===`rightToLeft`,f=(e,n)=>l?t.x+t.width-e-n:t.x+e,p=!!e.axisColor&&r>0&&r<1;if(c<=0&&!p)return null;let m=(o?e.negativeColor:void 0)??e.color,h=(o?e.negativeBorderColor:void 0)??e.borderColor,g=i?`linear-gradient(to ${o===l?`right`:`left`}, ${m}, color-mix(in srgb, ${m} var(--sxl-cf-bar-fade), transparent))`:m;return(0,d.jsxs)(u.Fragment,{children:[c>0?(0,d.jsx)(`div`,{className:$(`_bar_6li90_16`,`conditional-bar`),style:{left:f(s,c),top:t.y,width:c,height:t.height,background:g,border:h?`1px solid ${h}`:void 0}}):null,p?(0,d.jsx)(`div`,{className:$(`_axis_6li90_23`,`conditional-bar-axis`),style:{left:f(r*t.width,1),top:t.y,height:t.height,background:e.axisColor}}):null]})},Pd=(0,u.memo)(e=>{let{sheet:t,className:n,style:a,...o}=e,s=Z(),{getVisibleDecorations:c,cacheToken:l}=Mc(t,`iconSet`),u=i.X(e=>{let{value:t,style:n,zoom:i=1,key:a}=e,o=t,s=o?.getConditionalDecorations().iconSet;if(!s||!n)return null;let c=Td(s.set,s.index);if(!c)return null;let l=o.getStyle(),u=l.getInsets(),f=l.measureText(``),p=((f.ascent??f.lineHeight)+(f.descent??0))*i,m=l.getAlignment().getVertical(),h=Fd[m]??`flex-end`,g=Id[m]??`center bottom`;return(0,d.jsx)(r.r,{className:`_box_1qgal_41`,iconKey:c.iconKey,size:p,style:{left:n.left+u.left*i,top:n.top+u.top*i,width:p,height:n.height-(u.top+u.bottom)*i,minHeight:0,alignItems:h,color:c.color,"--sxl-cf-icon-origin":g}},a)},[]);return c(s).length===0?null:(0,d.jsx)(pe,{...o,className:$(n,`conditional-icons`),children:(0,d.jsx)(nr,{renderCell:u,getVisibleCells:c,cacheToken:l,style:a})})});Pd.displayName=`ConditionalIconsLayer`;var Fd={[o.Y.VerticalAlignment.Top]:`flex-start`,[o.Y.VerticalAlignment.Center]:`center`,[o.Y.VerticalAlignment.Bottom]:`flex-end`,[o.Y.VerticalAlignment.Justify]:`center`,[o.Y.VerticalAlignment.Distributed]:`center`},Id={[o.Y.VerticalAlignment.Top]:`center top`,[o.Y.VerticalAlignment.Center]:`center`,[o.Y.VerticalAlignment.Bottom]:`center bottom`,[o.Y.VerticalAlignment.Justify]:`center`,[o.Y.VerticalAlignment.Distributed]:`center`},Ld=(0,u.memo)(e=>{let{sheet:t,markSize:r=7,className:a,style:o,...s}=e,c=Z(),{getVisibleCells:l,cacheToken:f}=Rd(t),p=(0,u.useMemo)(()=>({}),[f,r]),m=i.X(e=>{let{style:t,zoom:i=1,key:a,value:o}=e;return t&&o?(0,d.jsx)(Wi,{anchorLocation:n.A.BottomRight,size:r*i,cellWidth:t.width,cellHeight:t.height,fill:Qc[o.state],style:{left:t.left,top:t.top}},a):null},[r]);return Pi(t.getView(),`onAnyChange`),t.getView().isShowInvalid()?l(c).length===0?null:(0,d.jsx)(pe,{...s,className:$(a,`validation-marks`),children:(0,d.jsx)(nr,{renderCell:m,getVisibleCells:l,cacheToken:p,style:o})}):null});Ld.displayName=`ValidationIndicatorLayer`;var Rd=e=>{let t=Z(),[n,r]=(0,u.useReducer)(e=>e+1,0),a=(0,u.useMemo)(()=>({}),[n,e]),o=(0,u.useRef)(new Map),s=i.X(()=>{o.current.clear(),r()},[]);Ni(e,{onDataValidationsChange:s},{ignoreModelChange:!0});let c=t.getVisibleRange();return Ii(e,(0,u.useMemo)(()=>c?{rowStart:c.rowStart,colStart:c.colStart,rowEnd:c.rowEnd,colEnd:c.colEnd}:null,[c?.rowStart,c?.colStart,c?.rowEnd,c?.colEnd]),e=>{e.isDataChange&&s()},Bd),{getVisibleCells:i.X((t,n)=>{let r=o.current,i=n??t.getVisibleRange();if(!i)return zd;let a=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,s=r.get(a);if(s)return s;let c=((e,t)=>{let n=e.getRange(t),r=n.getDataValidations();if(r.length===0)return[];let i=r.some(e=>!!e.getCondition()&&!e.isIncludeBlanks()),a=i?new Set:null,o=[];return n.forEach((e,t)=>{let n=t.getCoords(),i=Yc(r,n.rowIndex,n.colIndex);if(!i)return;let s=t.getCell(),c=s.getSpans(),l=c.width>1||c.height>1?s.getRange().getCoords():void 0;if(l&&a){let e=`${l.rowStart}:${l.colStart}`;if(a.has(e))return;a.add(e)}o.push({cell:n,range:l,value:i})},i?Zc:Xc),o})(e,i),l=c.length>0?c:zd;return r.set(a,l),r.size>12&&r.delete(r.keys().next().value),l},[e]),cacheToken:a}},zd=[],Bd={fireOnAddressChange:!1,transactional:!1},Vd=(0,u.memo)(e=>{let{sheet:t,editable:r,dropdownWidth:a=17,onOpenDropdown:o,className:s,style:c,...l}=e,f=(0,u.useMemo)(()=>new ic(t.getSelection()),[t]),p=i.Ct().getMode()?.key===`edit`,m=i.X((e,r)=>{let i=t.getRange(n.d.cellToRange(e)).getDataValidations();if(i.length===0)return null;let a=[];for(let e=0;e<i.length;e++)i[e].getRenderHints().includes(`list`)&&a.push(i[e]);if(a.length===0||a[0].isHideDropdown())return null;let o=t.getCell(e),s=o.getCoords();if(!s)return null;let c=o.getSpans(),l=c.width>1||c.height>1?o.getRange().getCoords():void 0;return{range:l??n.d.cellToRange(s),key:`${s.rowIndex},${s.colIndex}`,data:{dataValidation:a[0],dataValidations:a,cell:s,merge:l}}},[t]);return(0,d.jsx)(vn,{...l,className:$(s,`validation-dropdown`),style:c,activateOn:`selection`,selection:f,probe:m,placement:{side:`r`,align:`center`},offset:0,whenOff:`hide`,dismiss:p,children:({data:e,floatProps:n,state:i})=>(0,d.jsx)(Hd,{sheet:t,editable:r,data:e,floatProps:n,state:i,dropdownWidth:a,onOpenDropdown:o})})});Vd.displayName=`ValidationDropdownLayer`;var Hd=e=>{let{sheet:t,editable:i,data:a,floatProps:o,state:s,dropdownWidth:c,onOpenDropdown:l}=e,{pane:f}=s,p=(0,u.useMemo)(()=>({range:a.merge??n.d.cellToRange(a.cell)}),[a.merge,a.cell]),m=(e=>{let{sheet:t,editable:n,dataValidations:r,cell:i,anchor:a,minWidth:o}=e,s=(0,u.useCallback)(e=>(async(e,t)=>e.length===0?[]:(e=>{if(e.length===0)return[];if(e.length===1)return e[0];let t=e.slice(1).map(e=>new Set(e.map(e=>e.text)));return e[0].filter(e=>t.every(t=>t.has(e.text)))})(await Promise.all(e.map(e=>e.getListItemsAt(t.rowIndex,t.colIndex)))))(r,e),[r]);return Kc({sheet:t,editable:n,cell:n?i:null,anchor:a,minWidth:o,resolveItems:s,label:`validation-picker`})})({sheet:t,editable:i,dataValidations:a.dataValidations,cell:a.cell,anchor:p,minWidth:s.bounds?.width}),h=c*(f?.getZoom()||1);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`div`,{...o,className:Vl,style:{...o.style,width:h,height:h},role:`button`,"aria-haspopup":`listbox`,onPointerDown:e=>{e.button===0&&(e.stopPropagation(),e.preventDefault(),l?l(a.cell,a.dataValidation):m.isOpen?m.close():m.open())},children:(0,d.jsx)(r.r,{iconKey:`ExpandMore`,size:.75*h})}),m.component]})};Hd.displayName=`DropdownButton`;var Ud={ignoreHidden:!0,reuseContext:!0},Wd=(0,u.memo)(e=>{let{sheet:t,markSize:n=11,inset:a=1,className:s,style:c,...l}=e,f=Z(),{getRegions:p,cacheToken:m}=kc(t,o.I.Feature.Circular),h=(0,u.useMemo)(()=>({}),[m,n,a]),g=i.X((e,n)=>{let r=p(e,n);if(r.length===0)return Gd;let i=t.getName(),a=[];for(let e=0;e<r.length;e++){let n=r[e],o=n.getCell().getCircularReference();if(!o)continue;let s=n.getCoords(),c={rowIndex:s.rowStart,colIndex:s.colStart,scope:i};o.isMember(c)&&t.getRange(s).forEach((e,t)=>{a.push({cell:t.getCoords(),value:t.getCell()})},Ud)}return a.length>0?a:Gd},[t,p]),_=i.X(e=>{let{value:t,style:i,zoom:o=1,key:s}=e,c=t?.getCircularReference();if(!c||!i)return null;let l=n*o,u=a*o;return(0,d.jsx)(r.r,{iconKey:`CircularReferenceIndicator`,className:$(`_mark_p3uld_7`,!c.isConverged()&&`_unresolved_p3uld_19`),style:{left:i.left+u,top:i.top+u,width:l,height:l},size:l,ariaHidden:!0},s)},[n,a]);return g(f).length===0?null:(0,d.jsx)(pe,{...l,className:$(s,`circular-indicators`),children:(0,d.jsx)(nr,{renderCell:_,getVisibleCells:g,cacheToken:h,style:c})})});Wd.displayName=`CircularIndicatorLayer`;var Gd=[],Kd=Symbol(`unlock.uniform`),qd=e=>Kd,Jd=(0,u.memo)(e=>{let{sheet:t,sheetView:r,className:i,...a}=e,s=Z();Pi(r,[`onAnyChange`]),Pi(t,[`onProtectionChange`]);let{getRegions:c}=kc(t,o.I.Feature.Unlock),l=(0,u.useId)().replace(/[^a-zA-Z0-9_-]/g,``),f=`sxl-locked-hatch-${l}`,p=`sxl-locked-holes-${l}`;if(!s||!r?.isShowLockedShading()||!t.getProtection().isLocked())return null;let m=s.getPaneBounds(),h=m.width,g=m.height;if(h<=0||g<=0)return null;let _=[];for(let e of(e=>{let t=[];for(let n=0;n<e.length;n++)t.push({...e[n].getCoords(),value:qd(e[n])});return t.length<=1?t:n.d.mergeRangeCoordValues(t,2,(e,t)=>e[0].value===e[1].value?t:void 0)})(c(s))){let t=s.getBoundsFromRange(e),n=Math.round(t.x),r=Math.round(t.y),i=Math.round(t.x+t.width),a=Math.round(t.y+t.height);i<=n||a<=r||_.push({x:n,y:r,width:i-n,height:a-r})}return(0,d.jsx)(pe,{...a,className:$(i,`locked-hatch`),children:(0,d.jsx)(_e,{fill:!0,className:`locked-hatch-box`,style:{pointerEvents:`none`,overflow:`hidden`},children:(0,d.jsxs)(`svg`,{width:h,height:g,viewBox:`0 0 ${h} ${g}`,style:{display:`block`},"aria-hidden":`true`,focusable:`false`,children:[(0,d.jsxs)(`defs`,{children:[(0,d.jsx)(`pattern`,{id:f,patternUnits:`userSpaceOnUse`,width:7,height:7,patternTransform:`rotate(45)`,children:(0,d.jsx)(`line`,{x1:0,y1:0,x2:0,y2:7,stroke:`color-mix(in srgb, var(--sxl-color-base-content, rgb(0, 0, 0)) 26%, transparent)`,strokeWidth:1})}),(0,d.jsxs)(`mask`,{id:p,children:[(0,d.jsx)(`rect`,{x:0,y:0,width:h,height:g,fill:`white`}),_.map((e,t)=>(0,d.jsx)(`rect`,{x:e.x,y:e.y,width:e.width,height:e.height,fill:`black`},`hole-${t}`))]})]}),(0,d.jsx)(`rect`,{x:0,y:0,width:h,height:g,fill:`url(#${f})`,mask:`url(#${p})`}),_.map((e,t)=>(0,d.jsx)(`rect`,{x:e.x+.5,y:e.y+.5,width:Math.max(0,e.width-1),height:Math.max(0,e.height-1),fill:`none`,stroke:`color-mix(in srgb, var(--sxl-color-primary, rgb(0, 90, 158)) 60%, transparent)`,strokeWidth:1},`outline-${t}`))]})})})});Jd.displayName=`ProtectionLayer`;var Yd=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{selection:n,adapter:r,axis:o,entireCoords:s,edgeSize:c=1,edgeColor:l=`var(--sxl-color-base-300)`,scrollIntoView:f,renderBorders:p=!0,preserveFocus:m=!1,replaceActive:h=!1,allowMulti:g=!0,onPointerDownInterceptor:_,onSelectionStart:v,onSelectionEnd:y,zIndex:b,className:x,style:S,...C}=e,w=Z(),T=o===a.l.Axis.Column?w.getPaneBounds().height:w.getPaneBounds().width,E=(0,u.useMemo)(()=>r??new ic(n),[r,n]);i.in(E,e=>e.getSelection());let D=ci(E,{axis:o,entireRange:s,scrollIntoView:f,replaceActive:h,allowMulti:g,preserveFocus:m,onPointerDownInterceptor:_,onDragStart:i.X(()=>{v?.(),n.setAdjusting(n.getCoords())},[n,v]),onDragEnd:i.X(()=>{n.setAdjusting(null),y?.()},[n,y]),onPointerUp:i.X(()=>{m||w.focus()},[w,m])}),O=p?n.getSelectedRuns(o):null,k=w.getAnchor(),A=[];if(p){A.push(Xd(`edge:${k}`,o,T,c,l));for(let e=0;O&&e<O.length;e++){let t=O[e],n=Qd(t.min,t.max,o,w);n&&A.push(Zd(`selection:${k}:${e}`,n,o,T))}}return(0,d.jsx)(pe,{...C,className:$(x,`header-selection`),onPointerDown:D.onPointerDown,onPointerMove:D.onPointerMove,onPointerUp:D.onPointerUp,children:(0,d.jsx)(_e,{fill:!0,className:`header-selection-box`,style:{pointerEvents:`none`,...S},ref:t,children:A})})})),Xd=(e,t,n,r,o)=>{let s=i.kt.getDevicePixelRatio(),c=r/s,l=i.kt.snapDeviceEdge(n-c,s);return(0,d.jsx)(`div`,{className:`header-selection-edge`,style:t===a.l.Axis.Column?{position:`absolute`,background:o,pointerEvents:`none`,left:0,width:`100%`,top:`${l}px`,height:`${c}px`}:{position:`absolute`,background:o,pointerEvents:`none`,top:0,height:`100%`,left:`${l}px`,width:`${c}px`}},e)},Zd=(e,t,n,r)=>{if(!t)return;let o,s=`var(--sxl-color-primary)`,c=i.kt.getDevicePixelRatio(),l=2/c,u=i.kt.edgeCenter(r,`leading`,2,c);if(n===a.l.Axis.Column){let e=i.kt.edgeCenter(t.x,`leading`,2,c);o={position:`absolute`,background:s,pointerEvents:`none`,top:u-l/2+`px`,height:`${l}px`,left:e-l/2+`px`,width:`${i.kt.edgeCenter(t.x+t.width,`trailing`,2,c)-e+l}px`}}else{let e=i.kt.edgeCenter(t.y,`leading`,2,c);o={position:`absolute`,background:s,pointerEvents:`none`,left:u-l/2+`px`,width:`${l}px`,top:e-l/2+`px`,height:`${i.kt.edgeCenter(t.y+t.height,`trailing`,2,c)-e+l}px`}}return(0,d.jsx)(`div`,{className:`header-selection-border`,style:o},e)},Qd=(e,t,n,r)=>{let i={x:0,y:0,width:0,height:0};if(n===a.l.Axis.Column){let n=r.toClipBounds(r.getBoundsFromRange({colStart:e,rowStart:0,colEnd:t,rowEnd:0}),-10);if(!n)return null;i.x=n.x,i.width=n.width}else{let n=r.toClipBounds(r.getBoundsFromRange({colStart:0,rowStart:e,colEnd:0,rowEnd:t}),-10);if(!n)return null;i.y=n.y,i.height=n.height}return{x:i.x,y:i.y,width:i.width,height:i.height}},$d=e=>`resize-indicator:`+(e===a.l.Axis.Column?`col`:`row`),ef=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheetHeader:r,isColumn:o,oppositeSize:s=30,onResizeHeadersStart:c,onResizeHeaders:l,onResizeHeadersEnd:f,onResizeHeadersDown:p,onResizeHeadersUp:m}=e,h=Z(),[g,_]=(0,u.useState)(r.getSelectedRuns()),[v,y]=(0,u.useReducer)(e=>e+1,0),b=i.Ot(),x=(0,u.useCallback)(n.u.debounce(()=>{y()},10),[]);Ni(r?.getSheet(),{onSelectionChange(e){let t=r.getSelectedRuns();_(t),x()},onProtectionChange(){y()},onViewChange(){x()}});let[S,C]=(0,u.useState)(r?.getSheet().getView().getZoomScale()/100),w=o?a.l.Axis.Column:a.l.Axis.Row,[,T]=Q($d(w),null),E=(0,u.useRef)(null),D=(0,u.useRef)(null),O=(0,u.useCallback)(()=>{D.current&&=(clearTimeout(D.current),null)},[]);(0,u.useEffect)(()=>O,[O]),Ni(r,{onSizesChange:e=>{C(r?.getSheet().getView().getZoomScale()/100)}});let k=(0,u.useCallback)(e=>r.at(e)?.isHidden()||r.at(e)?.getSize()===0,[r]),A=(0,u.useCallback)((e,t)=>r.hiddenHeadersAt(e,t),[k]),j=(0,u.useCallback)(()=>r.getMinSize(),[r]),M=(0,u.useCallback)(()=>r.getMaxSize(),[r]),N=i.X((e,t,i)=>{t/=S;let o={size:t=Math.max(j(),Math.min(n.I.roundAccurately(t,j())??t,M())),hidden:!1},s=[];t<=0&&(o.hidden=!0,o.size=i),s.push({address:{min:e,max:e},update:o});let c=h.getMetrics();if(t<0){let n=w===a.l.Axis.Column,r=n?c.getColOffset:c.getRowOffset,i=n?c.getColIndex:c.getRowIndex,o=r(e),l=i(o+t),u=r(l);u===o+t?l--:s.push({address:{min:l,max:l},update:{size:o-u+t}}),e-l>1&&s.push({address:{min:l+1,max:e-1},update:{hidden:!0}})}r.updateHeaderPairs(s),T({index:e,sizePX:t}),l?.(e,t,i)},[v,h,r,S,l]),P=i.X((e,t,i)=>{let o=w===a.l.Axis.Column,s=null,c={min:e,max:e};if(r.isSelectedAll(e)){let a=r.getSelectedRuns();a.length>1?s=n.q(o?`op.resizeColumns`:`op.resizeRows`):c=a[0];let l={hidden:t<=0,size:(t<=0?i:t)/S};r.updateHeaderPairs(tf(a,l,e))}if(c){let e,t=c.max-c.min+1;e=t===1?r.getRange(c).at(0).getText():r.getRange(c).toString(),s=b(o?`op.resizeColumnsNamed`:`op.resizeRowsNamed`,{count:t,name:e})}E.current?.commit({description:s??void 0}),E.current=null,T(null),f?.(e,t,s)},[v,b,r,f]),F=i.X((e,t)=>{let i=w===a.l.Axis.Column?n.q(`op.resizeColumns`):n.q(`op.resizeRows`);E.current=r.getSheet().beginCommit(i),O(),T({index:e,sizePX:t}),c?.(e,t,i)},[w,r]),I=i.X((e,t)=>{O(),D.current=setTimeout(()=>{D.current=null,T({index:e,sizePX:t})},360),p?.(e,t)},[p]),L=i.X(e=>{O(),T(null),m?.(e)},[m]),R=i.X(e=>{let t=!1,i=w===a.l.Axis.Column,o=r.getSheet().getEntireRange().getCoords(),s=[],c=r.getSelectedRuns(),l=e=>{let t;t=i?{colStart:e.min,rowStart:o.rowStart,colEnd:e.max,rowEnd:o.rowEnd}:{colStart:o.colStart,rowStart:e.min,colEnd:o.colEnd,rowEnd:e.max},s.push(t)},u=c.length;for(let n=0;n<u;n++){let r=c[n];r.value&&(r.min<=e&&r.max>=e&&(t=!0),l(r))}t||l({min:e,max:e}),r.getSheet().getRanges(s).autoFit({axes:i?a.l.AxisSelection.Column:a.l.AxisSelection.Row}),O(),T(null),f?.(e,null,n.q(`op.resizeColumns`))},[v,r,f,k]),z=r.isProtected()?void 0:N,B=null,V=(o?h.getVisibleColumns():h.getVisibleRows()).map(e=>e.index),H=o?h.getPaneRange().colStart:h.getPaneRange().rowStart;V.length>0&&V[0]>H&&(V=[V[0]-1,...V]);let U=[],W=[],G=V.length;for(let e=0;e<G;e++){let t=V[e],r=e<G-1?V[e+1]:t+A(t+1,!1)+1,i=t+1!==r;(!B||B.max<t)&&(B=g.length>0&&g[g.length-1].max>=t?g[n.I.findEqualOrGreater(g,t,e=>e.max)]:null);let a=!1,o=!1;if(B&&(B.min<=t||B.min<=r&&!i)&&(a=!0,o=B.value??!1),t===H){let e=!1,n=!1;B&&B.min<=t&&(e=!0,n=B.value??!1),t>0&&W.push({index:t-1,isNextHidden:i,isSelected:e,isSelectedAll:n,disabledResize:!0})}if(o&&U.push(W.length),W.push({index:t,isHidden:e===0&&A(t,!1)>0,isNextHidden:i,isSelected:a,isSelectedAll:o,onDividerMouseDown:I,onDividerResizeStart:F,onDividerResize:z,onDividerMouseUp:L,onDividerResizeEnd:P,onDividerAutoFit:R}),i){let e=!1,i=!1;B&&B.min>=t&&B.max<=r-1&&B.value&&U.push(W.length),B&&B.max>=r||(B=g.length>0&&g[g.length-1].max>=r?g[n.I.findEqualOrGreater(g,r,e=>e.max)]:null),B&&B.min<=r&&(e=!0,i=B.value??!1),r>0&&W.push({index:r-1,isHidden:!0,isSelected:e,isSelectedAll:i,onDividerMouseDown:I,onDividerResizeStart:F,onDividerResize:z,onDividerMouseUp:L,onDividerResizeEnd:P,onDividerAutoFit:R})}}if(U.length>0){let e=U.length-1;if(U.length>0){let t=W[U[e]].index,n=null;o?(n=h.getBoundsFromRange({rowStart:0,rowEnd:0,colStart:t,colEnd:t}),n.x+n.width>h.getPaneBounds().width&&(--e,e===0&&(e=-1))):(n=h.getBoundsFromRange({rowStart:t,rowEnd:t,colStart:0,colEnd:0}),n.y+n.height>h.getPaneBounds().height&&(--e,e===0&&(e=-1)))}let t=g?.[g.length-1],n=h.getAnchor();if(n===`t`||n===`l`){let e=W[U[Math.max(0,U.length-1)]];e.showTouchDivider=!!t&&t.max<=e.index}else e>=0&&(W[U[e]].showTouchDivider=!0)}let K=W.length,q=Array(K);for(let e=0;e<K;e++)q[e]=(0,d.jsx)(ai,{...W[e],axis:w,disabled:r.isProtected()},`divider${e}`);return(0,d.jsx)(pe,{children:q})})),tf=(e,t,n=null)=>{let r=[],i=e.length;for(let a=0;a<i;a++){let i=e[a];if(!i.value)continue;let o=i.min,s=i.max;o===s&&o===n||r.push({address:{min:o,max:s},update:t})}return r},nf=`var(--sxl-color-primary)`,rf=`var(--sxl-color-base-100)`,af={side:`b`,align:`center`},of={side:`r`,align:`center`},sf=(0,u.memo)(e=>{let{sheet:t}=e,r=Z(),o=i.Ot(),[s]=Q($d(a.l.Axis.Column),null),[c]=Q($d(a.l.Axis.Row),null),l=!!s,f=s??c;if(!f)return null;let{index:p,sizePX:m}=f,h=m===0,g=t.getEntireRange().getCoords(),v=l?{rowStart:0,rowEnd:g.rowEnd,colStart:p,colEnd:p}:{rowStart:p,rowEnd:p,colStart:0,colEnd:g.colEnd},y=null;if(r.toClipBounds(r.getBoundsFromRange(v))){let e,t,n,i,a=r.getMetrics(),o=r.getPaneBounds(),s=l?Math.max(0,a.getColOffset(p)):Math.max(0,a.getRowOffset(p)),c=l?Math.min(o.x+o.width,a.getColOffset(p+1)):Math.min(o.y+o.height,a.getRowOffset(p+1));if(l){let r=o.height;e=[0,0,0,r],t=`-0.5px 0px 0px 0px ${rf}`,n={x:s-1,y:0,width:1,height:r},i={x:c,y:0,width:1,height:r}}else{let r=o.width;e=[0,0,r,0],t=`0px -0.5px 0px 0px ${rf}`,n={x:0,y:s-1,width:r,height:1},i={x:0,y:c,width:r,height:1}}let f={style:{boxShadow:t},propsPath:{stroke:nf,strokeWidth:`2px`,strokeDasharray:`0 0 8 4`}};y=(0,d.jsxs)(u.Fragment,{children:[h?void 0:(0,d.jsx)(_,{linePoints:e,bounds:n,propsPath:{stroke:nf,strokeWidth:`2px`}}),(0,d.jsx)(_,{linePoints:e,bounds:i,...f})]},`resize-dividers`)}let b=null;if(m!==null){let e=Math.floor(10*n.b.getDPI())/10,r=n.I.roundAccurately(m*e,0)??0,i=l?t.getColumnHeaders():t.getRowHeaders(),a=(t.getView()?.getZoomScale()??100)/100,s=(n.I.roundAccurately(r/a/(i?.getScaleFactor()*n.b.getDPI()),2)??0).toFixed(2),c=o(l?`resizeIndicator.width`:`resizeIndicator.height`),u=h?o(`resizeIndicator.hiddenDisplay`,{label:c}):o(`resizeIndicator.sizeDisplay`,{label:c,unit:s,px:r});b=(0,d.jsx)(on,{anchor:{range:l?{colStart:p,colEnd:p,rowStart:0,rowEnd:0}:{rowStart:p,rowEnd:p,colStart:0,colEnd:0}},placement:l?af:of,whenOff:`clamp`,style:cf,children:u})}return y||b?(0,d.jsxs)(d.Fragment,{children:[b,y]}):null});sf.displayName=`ResizeIndicator`;var cf={font:`11px/1.5 system-ui, sans-serif`,color:`var(--sxl-color-base-content, white)`,background:`var(--sxl-color-base-100, rgb(60,60,60))`,padding:`2px 6px`,borderRadius:3,border:`1px solid var(--sxl-color-base-300, rgba(0,0,0,0.2))`,boxShadow:`0 2px 8px rgba(0,0,0,0.35)`,whiteSpace:`nowrap`,pointerEvents:`none`},{CommandScopeProvider:lf}=i.Jt,uf=(e,t)=>(e.updateCommand(`openContextMenu`,{callback:()=>{t.openAtSelectedCell()}}),()=>{}),df=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:n,onSheetContextMenu:r,className:i,...a}=e,o=Z(),s=(0,u.useCallback)(e=>{let t=o.getCellFromPointer(e.clientX,e.clientY);t&&r&&(r({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:t.rowIndex,colIndex:t.colIndex}),e.stopPropagation(),e.preventDefault())},[o,r]),c=(0,u.useCallback)(()=>{if(!o||!r)return;let e=n.getSelection().getCoords().cell;o.scrollCellCoordsIntoView(e).then(t=>{requestAnimationFrame(()=>{let n=o.getMetrics().getColOffset(e.colIndex+1),i=o.getMetrics().getRowOffset(e.rowIndex+1),a=o.getPanePointFromPointer(0,0)||{x:0,y:0};r({clientX:n-a.x-(t.left??0)+6,clientY:i-a.y-(t.top??0)+6})})})},[o,n,r]),l=(0,u.useMemo)(()=>({openAtSelectedCell:c}),[c]);return(0,d.jsx)(lf,{spec:{scopeName:`layer:contextmenu`,contributor:{dynamic:uf},data:l},order:fe().zIndex,children:(0,d.jsx)(pe,{onContextMenu:s,className:$(i,`contextMenu`),...a})})}));function ff(e){let{axis:t,entireCoords:n,scrollIntoView:r,className:i,...a}=e,o=Za().getMode(),s=o?.selection??null,c=Bi()?.getName(),l=(0,u.useMemo)(()=>{if(!s)return null;let e=new ic(s);return c?yc(e,c):e},[s,c]);return o&&o.mode===`point`&&s?o.scope&&o.scope!==c?null:(0,d.jsx)(Yd,{className:$(i,`reference-header`),selection:s,adapter:l,axis:t,entireCoords:n,scrollIntoView:r,renderBorders:!1,preserveFocus:!0,replaceActive:!0,allowMulti:!1!==o.allowMulti,...a}):null}df.displayName=`ContextMenuLayer`,ff.displayName=`SheetReferenceHeaderLayer`;var pf=e=>{let{style:t,...n}=e??{};return(0,d.jsxs)(`svg`,{style:{width:`135px`,height:`37px`,...t},viewBox:`0 0 135 37`,...n,children:[(0,d.jsx)(`path`,{d:`M 1.0984,0 C 0.4978,0 0.01,0.40548 0.01,0.90302 v 19.5766 H 0 v 15.61762 c 0,0.30574 0.185,0.57535 0.466,0.73886 v 0.1426 H 0.8565 C 0.9315,36.992 1.0086,37 1.0883,37 H 13.063 25.9706 v 0 h 8.7553 c 0.08,0 0.1563,-0.008 0.2308,-0.0213 h 0.054 v -0.0141 c 0.4621,-0.10457 0.8035,-0.45175 0.8035,-0.86739 v -15.312 c 0,-0.0328 0.01,-0.0658 0.01,-0.0995 V 0.90304 C 35.8242,0.4052 35.3363,6e-5 34.7358,6e-5 H 22.5969 V 1.7e-4 H 21.0014 V 6e-5 Z`,fill:`#547dbe`,fillRule:`evenodd`}),(0,d.jsx)(`path`,{d:`M 1.4849,2.09543 V 9.06408 H 8.1947 V 2.09543 Z m 8.6592,0 V 9.06408 H 16.854 V 2.09543 Z m 8.685,0 v 6.96865 h 6.7098 V 2.09543 Z m 8.7355,0 v 6.96865 h 6.7099 V 2.09543 Z M 1.4849,11.04391 v 6.81444 h 6.7098 v -6.81444 z m 8.6592,0 v 6.81444 h 6.7099 v -6.81444 z m 8.685,0 v 6.81444 h 6.7098 v -6.81444 z m 8.7355,0 v 6.81444 h 6.7099 V 11.04391 Z M 1.4849,19.83872 v 6.68584 h 6.7098 v -6.68584 z m 8.6592,0 v 6.68584 h 6.7351 v -6.68584 z m 8.685,0 v 6.68584 h 6.7098 v -6.68584 z m 8.7355,0 v 6.68584 h 6.7099 v -6.68584 z m -26.052,8.38811 v 6.68588 h 6.7098 v -6.68588 z m 8.6592,0 v 6.68588 h 6.7355 v -6.68588 z m 8.685,0 v 6.68588 h 6.7099 v -6.68588 z m 8.7356,0 v 6.68588 h 6.7098 v -6.68588 z`,fill:`#ffffff`,fillRule:`evenodd`}),(0,d.jsx)(`path`,{d:`m 1.4785,2.09737 v 6.96865 h 6.741 V 2.09737 Z m 0,8.94851 v 6.81449 h 6.741 v -6.81449 z m 0,8.79485 v 6.6858 h 6.741 v -6.6858 z m 0.028,8.388 v 6.68588 h 6.741 v -6.68588 z`,fill:`#547dbe`,fillRule:`evenodd`,strokeWidth:`0.4`}),(0,d.jsx)(`path`,{d:`M 120.9895,32.82218 V 10.13469 h 4.7986 v 18.71559 h 9.2153 v 3.9719 z m 0.4853,0 h -5.4976 l -5.275,-8.57923 -5.2751,8.57923 h -5.1481 l 7.5314,-11.69325 -7.0545,-10.99424 h 5.3067 l 4.8936,8.16618 4.7986,-8.16618 h 5.1796 l -7.118,11.24826 z M 95.9361,29.04099 c 0.5297,0 1.0381,-0.053 1.5254,-0.15888 0.4872,-0.10591 0.9745,-0.23299 1.4617,-0.3813 v 3.52703 c -0.5084,0.21183 -1.144,0.39189 -1.9066,0.54018 -0.7415,0.16946 -1.5571,0.2542 -2.4469,0.2542 -1.038,0 -1.9701,-0.16947 -2.7964,-0.5084 -0.805,-0.33894 -1.4511,-0.92148 -1.9384,-1.74763 -0.466,-0.84734 -0.6991,-2.01241 -0.6991,-3.49526 v -8.35686 h -2.2562 v -2.00181 l 2.6058,-1.58876 1.3664,-3.65411 h 3.0189 v 3.6859 h 4.8619 v 3.55878 h -4.8619 v 8.35686 c 0,0.65668 0.1906,1.15449 0.5719,1.49342 0.3814,0.31776 0.8792,0.47664 1.4935,0.47664 z M 79.1445,14.83743 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3983,1.35581 2.0972,3.29411 2.0972,5.81491 v 2.28769 H 75.7444 c 0.042,1.33475 0.4342,2.38315 1.1758,3.14596 0.7626,0.76244 1.8113,1.14385 3.1459,1.14385 1.1227,0 2.1396,-0.10609 3.0506,-0.3179 0.9109,-0.23311 1.8536,-0.58257 2.8283,-1.0484 v 3.654 c -0.8476,0.42362 -1.7479,0.73087 -2.7012,0.92139 -0.9322,0.21181 -2.0655,0.3179 -3.4001,0.3179 -1.7373,0 -3.2731,-0.3179 -4.6078,-0.95333 -1.3346,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0169,-5.05235 0.6991,-1.35578 1.6629,-2.37258 2.8917,-3.0504 1.2286,-0.67783 2.6586,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.2879,0.88967 -0.5933,0.59322 -0.9428,1.51461 -1.0487,2.76455 h 6.6415 c -0.021,-1.05904 -0.2967,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3559,-1.04855 -2.4787,-1.04855 z m -17.011,-3.36815 c 2.3939,0 4.29,0.68847 5.6882,2.06535 1.3982,1.35581 2.0973,3.29411 2.0973,5.81491 v 2.28769 H 58.7653 c 0.042,1.33475 0.4343,2.38315 1.1758,3.14596 0.7627,0.76244 1.8113,1.14385 3.1459,1.14385 1.1228,0 2.1397,-0.10609 3.0507,-0.3179 0.911,-0.23311 1.8536,-0.58257 2.8282,-1.0484 v 3.654 c -0.8475,0.42362 -1.7478,0.73087 -2.7011,0.92139 -0.9321,0.21181 -2.0655,0.3179 -3.4002,0.3179 -1.7372,0 -3.273,-0.3179 -4.6077,-0.95333 -1.3347,-0.65673 -2.3833,-1.64162 -3.1459,-2.95507 -0.7627,-1.31344 -1.144,-2.96571 -1.144,-4.9568 0,-2.03367 0.3389,-3.71788 1.0168,-5.05235 0.6991,-1.35578 1.6631,-2.37258 2.8918,-3.0504 1.2287,-0.67783 2.6587,-1.0168 4.2899,-1.0168 z m 0.032,3.36815 c -0.911,0 -1.6736,0.29653 -2.288,0.88967 -0.5931,0.59322 -0.9427,1.51461 -1.0486,2.76455 h 6.6414 c -0.021,-1.05904 -0.2965,-1.92796 -0.8262,-2.60567 -0.5297,-0.69905 -1.3558,-1.04855 -2.4786,-1.04855 z M 41.7033,13.59817 c 0,0.84739 -0.032,1.66288 -0.095,2.44668 -0.042,0.78385 -0.085,1.33456 -0.1271,1.65231 h 0.2542 c 0.5508,-0.88968 1.2605,-1.53575 2.1291,-1.93827 0.8686,-0.40251 1.8325,-0.60371 2.8917,-0.60371 1.8855,0 3.3896,0.50838 4.5124,1.52518 1.144,0.99558 1.716,2.60556 1.716,4.82998 V 32.82218 H 48.2498 V 22.68575 c 0,-2.49951 -0.9322,-3.74937 -2.7964,-3.74937 -1.4194,0 -2.4045,0.49788 -2.9553,1.49362 -0.5297,0.97424 -0.7945,2.38314 -0.7945,4.22592 v 8.16626 H 36.9688 V 8.67305 h 4.7348 z`,fill:`#eb594d`}),(0,d.jsx)(`path`,{d:`m 23.345,4.88926 c 1.4307,0 2.8282,0.229 4.1916,0.68692 1.3636,0.45803 2.6999,1.15712 4.0084,2.09748 l -1.8344,2.50966 C 28.6222,9.40175 27.5522,8.82162 26.5004,8.44306 25.4486,8.0645 24.3968,7.87524 23.345,7.87524 c -1.9935,0 -3.5435,0.40902 -4.6503,1.22728 -1.1068,0.81819 -1.6601,1.97842 -1.6601,3.48048 v 0.0183 c 0,1.05019 0.3179,1.8502 0.9538,2.39973 0.636,0.54952 1.4615,0.95869 2.4765,1.22731 1.015,0.26862 2.0975,0.51907 3.2468,0.75111 1.003,0.20755 1.9996,0.44872 2.9905,0.7235 0.9905,0.27478 1.8922,0.66562 2.7057,1.1724 0.813,0.50679 1.4615,1.1937 1.9444,2.06075 0.4832,0.86705 0.7247,1.99672 0.7247,3.38884 v 0.0367 c 0,2.45464 -0.8561,4.35355 -2.5682,5.69703 -1.7122,1.34311 -4.1216,2.01505 -7.2278,2.01505 -1.2963,0 -2.5162,-0.12207 -3.6598,-0.36658 -1.1434,-0.24413 -2.2134,-0.61071 -3.2102,-1.09898 -0.9968,-0.48864 -1.9292,-1.09897 -2.7975,-1.83175 l 1.9628,-2.47308 c 1.0763,0.92809 2.2534,1.62428 3.5314,2.08825 1.2779,0.46431 2.669,0.69627 4.1733,0.69627 2.1158,0 3.7513,-0.40613 4.9071,-1.21827 1.1558,-0.81214 1.7335,-1.95096 1.7335,-3.4164 v -0.0183 c 0,-1.06247 -0.2872,-1.87762 -0.8622,-2.44543 -0.5746,-0.56786 -1.3267,-0.99528 -2.2563,-1.28234 -0.9292,-0.28695 -1.9383,-0.52812 -3.0267,-0.72354 -1.0397,-0.18314 -2.0822,-0.39685 -3.1278,-0.64117 -1.0457,-0.24417 -2.0026,-0.60444 -2.8709,-1.08076 -0.8683,-0.47621 -1.5685,-1.15396 -2.1005,-2.0333 -0.532,-0.87933 -0.798,-2.05162 -0.798,-3.5171 v -0.0183 c 0,-2.4792 0.8255,-4.39955 2.4766,-5.7611 1.651,-1.36167 3.9807,-2.04258 6.9892,-2.04258 z`,stroke:`#eb594d`,strokeWidth:`2`,fill:`#f9cecb`})]})},mf=(0,u.memo)(e=>{let{colorLicensee:t=`blue`,colorError:n=`red`,colorCredits:r=`grey`,credits:i=`All rights reserved - Michael Ford`,feature:a,style:s,...c}=e??{},[l,f]=(0,u.useState)(null);(0,u.useEffect)(()=>{(async()=>{let e=await o.a.getDetails();f(e)})()},[]);let[p,m]=(0,u.useState)(!1),h={opacity:.65},g=(0,u.useMemo)(()=>{let e=l?.getExceptions(),t=e?.length??0;if(t===0)return null;let r=[];for(let i=0;i<t;i++){let t=e[i];r.push((0,d.jsx)(`div`,{style:{opacity:.8,fontSize:`16px`,textAlign:`left`,color:n},children:t},i))}return r},[l,n]);if(l===null||l.isValidFor(a??``))return null;let _=l.getType(),v=!g&&_.endsWith(`ity`),y=l.getLicensee(),b=v?1.6:1,x=135/b,S=37/b,C=null;return(y?.length??0)>0&&(C=(0,d.jsx)(`div`,{style:{opacity:.7,fontWeight:`500`,fontSize:`16px`,textAlign:`left`,color:t},children:y})),(0,d.jsx)(`div`,{style:{pointerEvents:`none`,display:`flex`,flexDirection:`column`,overflow:`hidden`,...s},...c,children:(0,d.jsxs)(`div`,{style:{position:`relative`,display:`flex`,flexDirection:`column`},children:[p?(0,d.jsx)(pf,{style:h}):(0,d.jsx)(`svg`,{width:x,height:S,style:h,children:(0,d.jsx)(`image`,{style:{width:x,height:S},href:`https://www.sheetxl.com/watermark.svg`,onError:()=>m(!0)})}),(0,d.jsxs)(`div`,{children:[C,g,(0,d.jsx)(`div`,{style:{height:`0px`,fontSize:`16px`,textAlign:`left`,width:`0px`,opacity:.8,color:r},children:i})]})]})})}),hf={key:`copy`,description:n.q(`editMode.copy`)},gf={key:`cut`,description:n.q(`editMode.cut`)},_f={type:o.n.Content.Values},vf={fitDestination:!0,type:o.n.Content.Formats},yf={fitDestination:!0,type:o.n.Content.Formulas},bf={transpose:!0},xf={fitDestination:!0,adjustCells:(e,t,n)=>({value:`=${t.getAddress({$colIndex:!0,$rowIndex:!0})}`})};function Sf(e,t){let r=t.sheet,i=t,{notifier:c,editModeHandler:l,globalClipboard:u,element:d}=t,f={element:d,doCopy:e=>new s.l(r.getSelectedRanges().getSnapshot(e))},p={element:d,importFromExternal:async(e,t)=>{let n=r.getSelectedRange().getTopLeft().getCoords(),i=new s.n(r.getRuntime(),e,{colIndex:n.colStart,rowIndex:n.rowStart},t,r.getStyles());return await i.parse()?i:null},doPaste:async(e,t)=>{if(e?.getItemType()!==`range`)return!1;t?.contentsOnly&&delete(t={...t,type:o.n.Content.Values}).contentsOnly;let i=e.getItem?.();if(!i)return!1;let s=i.getName?.(),c=r.getSelectedRange();if(s===`HTML`&&c.size>1){let e=i.getCoords?.();e&&n.d.isSingleCell(e)&&(c=c.getResizeTo(1,1))}return await c.doBatch(async()=>{let e=await c.copyFrom(i,{...t});!e||e.isEntireRows()||e.isEntireColumns()||e.autoFit({axes:a.l.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},{description:s?n.r(`op.pasteNamed`,{name:s}):n.q(`op.paste`),autoSelect:!0}),!0}},m=async e=>{if(f.element?.())try{await(async e=>{if(!f.element)return;let t=u.getClipboard(),n=f.doCopy?.(e);typeof n==`string`?await t.writeText(n):await t.writeReference(n)})(e??{})}catch(e){c?.showError(e)}},h=async(e,t,a)=>{try{if(!1===await e.doPaste?.(t,a))return;((e,t)=>{if(e?.getItemType()!==`range`)return;let a=l.getMode()?.key===`cut`||e.isCut?.();if(!a&&l.getMode()?.key===`copy`){let t=e.getItem?.()?.getCoords?.(),i=r.getSelectedRanges().getCoords(),o=!1;if(t&&i&&e.getItem?.()?.getSource?.()===r)for(let e=0;!o&&e<i.length;e++)o=n.d.isRangesIntersect(t,i[e]);a=o}a&&l.setMode(null),d?.()?.focus(),i.onPaste?.(e,t)})(t,a)}catch(e){c?.showError(e)}},g=async(e,t,r)=>{let i=p.element?.();if(i&&await n.b.whenFocus(i),!e&&!t)return;let a=await c?.showBusy?.(n.r(`clipboard.pasting`));if(t)try{await h(p,t,r),a?.();return}catch(e){a?.(),c?.showError(e)}if(!e)return void a?.();let o=p.importFromExternal;o||=()=>({getItemType:()=>`text`,toText:()=>e?.text??``,isClipboardItem:!0});let s=null;try{s=await o(e,{isCut:!1})}catch(e){a?.(),c?.showError(e)}if(s)try{let e=await Promise.resolve(s);await h(p,e,r),a?.()}catch(e){a?.(),c?.showError(e)}else a?.()},_=async e=>{if(!p.element)return;let t=u.getClipboard();try{let r=await t.readReference();if(r)return void await g(null,r,e??{});let i=[];i[0]=await n.W.readStringFromClipboard(t,n.h.Plain),i[1]=await n.W.readHTMLFromClipboard(t,n.h.Html),i[2]=await n.W.readBlobFromClipboard(t,n.h.Png);let a={text:i[0]??null,html:i[1]??null,image:i[2]??null};await g(a,null,e??{})}catch(e){if(e?.message===`Document is not focused.`)return;c?.showError(e)}};e.updateCommand(`copy`,{callback:()=>m()}),e.updateCommand(`cut`,{callback:()=>m({isCut:!0})}),e.updateCommand(`paste`,{callback:()=>_()}),e.updateCommand(`pasteValues`,{callback:e=>_({..._f,...e})}),e.updateCommand(`pasteFormats`,{callback:(e,t)=>_({...vf,description:t?.getLabel(),...e})}),e.updateCommand(`pasteFormulas`,{callback:(e,t)=>_({...yf,description:t?.getLabel(),...e})}),e.updateCommand(`pasteTranspose`,{callback:(e,t)=>_({...bf,description:t?.getLabel(),...e})}),e.updateCommand(`pasteLinks`,{callback:(e,t)=>_({...xf,description:t?.getLabel(),...e})}),e.updateCommand(`formatPainterToggle`,{state:l.getMode()?.key===`formatPainter`,callback:()=>{if(l.getMode()?.key!==`formatPainter`)return m({editMode:{key:`formatPainter`,description:n.q(`editMode.formatPainter`),cursor:`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='black' fill='white'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`}});l.setMode(null)}});let v=[`cut`,`paste`,`pasteValues`,`pasteFormats`,`pasteFormulas`,`pasteTranspose`,`pasteLinks`,`formatPainterToggle`],y=()=>{let t=r.getProtection().isFormatCellsAllowed()?[]:[n.q(`reason.sheetProtected`)];for(let n of v)e.updateCommand(n,{disabledReasons:t})};y();let b=u.getClipboard(),x=async()=>{l.getMode()?.key!==`edit`&&(e=>{let t=e?.getItemType()===`range`?e:null;if(t){let n=e.editMode?.(),r={...e?.isCut?.()?gf:hf,...n,args:{isClipboard:!0,reference:t,...n?.args},onModeChange:e=>{e?.args?.isClipboard||u.getClipboard().clear(!0),n?.onModeChange?.(e)}};l.setMode(r)}i.onClipboardUpdate?.(t)})(await b.readReference())},S={safari:n.q(`error.clipboard.safari`),perms:n.q(`error.clipboard.perms`)},C=e=>c?.showMessage?.(n.r(S[e.code]),{onceKey:`clipboard.features`}),w=()=>C(n.S.ErrorMessages.PermsRead),T=()=>C(n.S.ErrorMessages.PermsWrite);b.addEventListener(`clipboardchange`,x),b.addEventListener(`clipboarderrorread`,w),b.addEventListener(`clipboarderrorwrite`,T);let E=r.addListeners({onProtectionChange:y,onInvalidated:y});return()=>{b.removeEventListener(`clipboardchange`,x),b.removeEventListener(`clipboarderrorread`,w),b.removeEventListener(`clipboarderrorwrite`,T),E()}}var{CommandScopeProvider:Cf,useCommandExecute:wf}=i.Jt,Tf=({sheet:e,className:t,...n})=>{let r=i.ot(),a=i.Ct(),o=i.q(),s=Z(),c=wf(),l=a.getMode(),f=(0,u.useMemo)(()=>({sheet:e,notifier:r,editModeHandler:a,globalClipboard:o,element:s.getElement}),[e,r,a,o,s]),p=l?.key,m=p===`copy`||p===`cut`||p===`formatPainter`,h=l?.args?.reference,g=h?.getItem?.(),_=g?.getSource()===e,v=g?.getCoords?.();return(0,d.jsx)(Cf,{spec:{scopeName:`layer:clipboard`,contributor:{dynamic:Sf},data:f},order:fe().zIndex,children:(0,d.jsx)(pe,{onKeyDown:async e=>{let t=a.getMode()?.key,n=t===`copy`||t===`cut`;(n||t===`formatPainter`)&&(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),a.setMode(null)):n&&e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),await c(`paste`),a.setMode(null)))},...n,className:$(t,`clipboard`),children:m&&h&&_&&v&&(0,d.jsx)(xn,{range:v,alignWidth:2,stroke:h.isCut?.()?`var(--sxl-color-warning)`:`var(--sxl-color-primary)`,animatedStroke:!0,clipInsets:-10})})})};Tf.displayName=`SheetClipboardLayer`;var Ef=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{style:r=i.kt.EmptyCssProperties,orientation:a,sheet:o,onShowTooltip:s,onCloseTooltip:c,onScrollOffset:l,showCustomScrollButtons:f,offset:p=0,totalSize:m=0,viewportSize:h=0,className:g,endGap:_,...v}=e;if(!o)throw Error(`SheetScrollbar needs an ISheet`);let y=i.X(s,[s]),b=i.X(c,[c]),x=(0,u.useRef)(null),S=da([x,t]),C=a===i.bt.Vertical,w=i.Ot(),[T,E]=(0,u.useState)(()=>{let e=(o.getView().getZoomScale()??100)/100,t=o.getView().getTopLeft();return(C?t.top:t.left)*e}),D=()=>{let e=o.getView().getFreezePanes(),t=(o.getView().getZoomScale()??100)/100;if(C){let n=e.coords?.rowIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.top??0;return{shift:(o.getRowHeaders().getOffset(n)-r)*t,scroll:r*t}}{let n=e.coords?.colIndex??0;if(n===0)return{shift:0,scroll:0};let r=e.topLeft?.left??0;return{shift:(o.getColumnHeaders().getOffset(n)-r)*t,scroll:r*t}}},[O,k]=(0,u.useState)(D),[A,j]=(0,u.useState)(null),[M,N]=(0,u.useState)(!1),P=a===i.bt.Vertical?o.getRowHeaders():o.getColumnHeaders(),F=()=>{let e=o.getUsedRange()?.getCoords()??n.d.EmptyRange,t=o.getSelection().getCoords().cell;return{colIndex:Math.max(e.colEnd,t.colIndex),rowIndex:Math.max(e.rowEnd,t.rowIndex)}},[I,L]=(0,u.useState)(F),R=I?(C?I.rowIndex:I.colIndex)+1:0,z=()=>{let e=F();n.d.isEqualCells(I,e)||L(e)};Ni(o.getView(),{onFreezePaneChange:()=>{k(D)}}),Ni(o.getSelection(),{onChange:z}),Ni(o,{onUsedRangeChange:z}),(0,u.useEffect)(()=>{L(F())},[o]);let B=p-O.scroll,V=h-O.shift,H=m-(O.shift+O.scroll),U=P.getOffset(R)*(o.getView().getZoomScale()/100)-(O.scroll+O.shift);(0,u.useEffect)(()=>{if(!A)return M&&b?.(),void N(!1);K(C,T,V,_,A,o,P,O)},[C,p,T,V,_,O,a,A,P,M,o]);let W=i.X((e,t,n)=>{E(e);let r=e+O.scroll,i=t+O.shift,a=n+O.shift+O.scroll;l?.(r,i,a)},[l,O]),G=(0,u.useCallback)((e,t,n,r,o,s,c,l)=>{let u=c.getTextAt(c.getIndex(t/(s.getView().getZoomScale()/100)+l.scroll+l.shift)),d={...o,display:a===i.bt.Vertical?w(`scrollbar.row`,{title:u}):w(`scrollbar.column`,{title:u})},f=o.element??x.current?.querySelector(`[role="slider"]`);if(f){let t=f.getBoundingClientRect();d.anchor=e?{x:t.left,y:t.top+t.height/2}:{x:t.left+t.width/2,y:t.top}}d.anchor&&(N(!0),y?.(d))},[w]),K=i.X(n.u.debounce(G,0),[G]),q=i.X(e=>{j(e.dragging?{element:e.element}:null)},[]);return(0,u.useMemo)(()=>(0,d.jsx)(i.et,{ref:S,className:$(g,`_sheet-scrollbar_104cg_1`),style:r,offset:B,viewportSize:V,totalSize:H,orientation:a,showCustomScrollButtons:f,onMouseDown:e=>{e.preventDefault()},onScrollOffset:W,minSize:U,onThumbDrag:q,...v}),[g,B,V,H,a,f,r,U,_])}));Ef.displayName=`SheetScrollbar`;var Df=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheetHeader:n,oppositeSize:r=30,edgeSize:o=1,edgeColor:s=`var(--sxl-color-base-300)`,headerText:c,freezeStart:l,colorScheme:f,verticalPadding:p,horizontalPadding:m,onSheetContextMenu:h,onResizeHeadersStart:g,onResizeHeaders:_,onResizeHeadersEnd:v,onResizeHeadersDown:y,onResizeHeadersUp:b,viewport:x,onSelectionStart:S,onSelectionEnd:C,propsCellRender:w,style:T,className:E,...D}=e,O=(0,u.useMemo)(()=>n.getAxis(),[n]),k=i.X(g,[g]),A=i.X(_,[_]),j=i.X(v,[v]),M=i.X(y,[y]),N=i.X(b,[b]),P=(0,u.useRef)(null),[F,I]=(0,u.useReducer)(e=>e+1,0),L=n?.getSheet(),R=(0,u.useRef)(!1);(0,u.useLayoutEffect)(()=>{R.current=!0},[n]);let[z,B]=(0,u.useState)(0),[V,H]=(0,u.useState)(L?.getView().getZoomScale()/100);Ni(n,{onSizesChange:e=>{H(L?.getView().getZoomScale()/100),J(K()),B(n.getEntireRange().getCoords().max+1)}}),(0,u.useLayoutEffect)(()=>{H(n?.getSheet().getView().getZoomScale()/100),J(K())},[n,r]);let U=(0,u.useCallback)((e,t)=>n.hiddenHeadersAt(e,t),[(0,u.useCallback)(e=>n.at(e)?.isHidden()||n.at(e)?.getSize()===0,[n])]),W=i.X(e=>n.isSelected(e),[n]),G=i.X(e=>n.isSelectedAll(e),[n]),K=()=>{let e=O===a.l.Axis.Column;return{getColOffset:t=>e?n.getOffset(t):t===0?0:r/V,getColIndex:t=>e?n.getIndex(t):0,getRowOffset:t=>e?t===0?0:r/V:n.getOffset(t),getRowIndex:t=>e?0:n.getIndex(t)}},[q,J]=(0,u.useState)(()=>K()),Y=(0,u.useMemo)(()=>(0,d.jsx)(ef,{sheetHeader:n,isColumn:O===a.l.Axis.Column,oppositeSize:r,onResizeHeadersStart:k,onResizeHeaders:A,onResizeHeadersEnd:j,onResizeHeadersDown:M,onResizeHeadersUp:N},`header-resizer-layer-${O}-[${n.getSheet().getId()}]`),[n,r,O,F]),ee=i.X(e=>{let t=O===a.l.Axis.Column;h?.({...e,rowIndex:t?-1:e.rowIndex,colIndex:t?e.colIndex:-1})},[O,h]),te=i.X(e=>{L?.scrollTo({colStart:e.colIndex,colEnd:e.colIndex,rowStart:e.rowIndex,rowEnd:e.rowIndex},{})},[L]),ne=(0,u.useMemo)(()=>(0,d.jsx)(Yd,{selection:n.getSheet().getSelection(),axis:O,entireCoords:n.getSheet().getEntireRange().getCoords(),edgeSize:o,edgeColor:s,scrollIntoView:te,onPointerDownInterceptor:(e,t)=>!(e.button===2&&n.isSelectedAll(O===a.l.Axis.Column?t.colIndex:t.rowIndex)),onSelectionStart:S,onSelectionEnd:C},`header-selection-layer-${O}-[${n.getSheet().getId()}]`),[n,z,l,o,s,te]),re=(0,u.useMemo)(()=>(0,d.jsx)(ff,{axis:O,entireCoords:n.getSheet().getEntireRange().getCoords(),scrollIntoView:te},`header-reference-layer-${O}-[${n.getSheet().getId()}]`),[n,z,l,O,te]),ie=(0,u.useMemo)(()=>h?(0,d.jsx)(df,{sheet:n.getSheet(),onSheetContextMenu:ee},`context-menu-layer-${O}-[${n.getSheet().getId()}]`):null,[n,h,F]),ae=i.X(e=>c?c(e):n.getTextAt(e),[c,n]),oe=i.X(e=>{let{range:t,key:r,...i}=e,o=O===a.l.Axis.Column?t?.colStart??e.cell.colIndex:t?.rowStart??e.cell.rowIndex,s=n.at(o);return(0,d.jsx)(Ga,{axis:O,index:o,isSelected:W,isSelectedAll:G,zoomScale:100*V,headerText:ae,verticalPadding:p,horizontalPadding:m,onColumnButtonMouseDown:w?.onColumnButtonMouseDown,propsColumnButton:w?.propsColumnButton,renderColumnButton:w?.renderColumnButton,...i,value:s},`${r}-${O}-[${n.getSheet().getId()}]`)},[F,w,z,V,n]),se=i.Ct(),ce=i.st(t,()=>({scrollTo:e=>{P.current?.scrollTo(e)},forceRender:()=>{I()},getGridSurface:()=>P.current}),[]),le=(0,u.useMemo)(()=>{if(x)return O===a.l.Axis.Column?new i.J(x,new i.wt,!0,!1,x):new i.J(new i.wt,x,!1,!0,x)},[x,O]),ue=f===`dark`?`dark`:`light`,Z=(0,u.useMemo)(()=>{let e={overflow:`visible`,...(L?.getStyles().getNormal().getFont()).toCSS(`adaptive`,1),...T},t=`white`,n=`black`;if(i.kt.detectIt().primaryInput!==`touch`){let r=O===a.l.Axis.Column?`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 8,14.5 2.3125,8.8125 h 3.25 V 1.5 h 4.875 v 7.3125 h 3.25 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 8 15, pointer`:`url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='m 14.5,8 -5.6875,5.6875 v -3.25 H 1.5 v -4.875 h 7.3125 v -3.25 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 15 8, pointer`;se.getMode()?.key===`formatPainter`&&(r=`url("data:image/svg+xml,%3Csvg width='30' height='22' viewBox='0 0 30 22' xmlns='http://www.w3.org/2000/svg' %3E%3Cg%3E%3Cpath d='M 26.737611,2.811068 V 2.0241451 c 0,-0.4328075 -0.354115,-0.7869227 -0.786923,-0.7869227 h -9.443074 c -0.432808,0 -0.786923,0.3541152 -0.786923,0.7869227 v 3.1476914 c 0,0.4328076 0.354115,0.7869235 0.786923,0.7869235 h 9.443074 c 0.432808,0 0.786923,-0.3541159 0.786923,-0.7869235 V 4.3849137 h 0.786923 v 3.1476915 h -7.869229 v 8.6561518 c 0,0.432808 0.354116,0.786923 0.786923,0.786923 h 1.573846 c 0.432807,0 0.786923,-0.354115 0.786923,-0.786923 V 9.1064513 H 29.09838 V 2.811068 Z M 10.714339,6.2116849 c -1.60877,0.0017 -3.2175361,0.00425 -4.8263048,0.00609 0.0012,1.5756989 0.00158,3.1513905 0.00244,4.7270891 -1.5978311,0.0017 -3.1956617,0.0034 -4.7934919,0.0043 0.00335,1.740011 0.00655,3.480012 0.00988,5.220023 1.5954589,0 3.1909181,0 4.7863775,0 -0.0017,1.606793 -0.00353,3.213585 -0.0051,4.820375 1.7440936,0.0016 3.4881881,0.0033 5.2322842,0.005 -0.0014,-1.608503 -0.0018,-3.217015 -0.0028,-4.825519 1.58518,0 3.17036,0 4.755543,0 0.0033,-1.741851 0.0073,-3.483705 0.01072,-5.225556 -1.58808,0 -3.176158,0 -4.764238,0 0,-1.5775391 0,-3.1550792 0,-4.7326117 -0.135065,1.3e-4 -0.270128,1.982e-4 -0.40519,4.047e-4 z' stroke='${n}' fill='${t}'/%3E%3C/g%3E%3C/svg%3E%0A") 7 12, pointer`),e.cursor=r}e.backgroundColor=`var(--sxl-color-base-100)`;let o=O===a.l.Axis.Column;return e.boxSizing=`border-box`,e.width=o?`100%`:r,e.height=o?r:`100%`,e.contain=`size layout style`,e.clipPath=o?`inset(-9999px 0px -9999px 0px)`:`inset(0px -9999px 0px -9999px)`,e},[O,se,f,T,r,F]),de=(0,u.useMemo)(()=>[(0,d.jsx)(_l,{header:n,renderCell:oe},`header-cells-${O}-[${n.getSheet().getId()}]`),ne,re,Y,ie],[Y,ne,re,ie,n,oe,O]),Q=(0,u.useMemo)(()=>{let e=O===a.l.Axis.Column;return(0,d.jsx)(X,{ref:da([ce,P]),className:$(E,`sheet-header`),style:Z,...i.qt(`header`,ue),viewport:le,columnCount:e?z:1,rowCount:e?1:z,freezeLeft:e?l:void 0,freezeTop:e?void 0:l,hiddenColumnsAt:e?U:void 0,hiddenRowsAt:e?void 0:U,metrics:q,...D,children:de})},[z,de,q,le,Z,E,ue,D]);return(0,u.useEffect)(()=>{R.current=!1,P.current?.invalidate()},[n]),Q})),Of=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:n,colorScheme:r,className:a,style:o,width:s,height:c,onMouseDown:l,...f}=e,[p,m]=(0,u.useState)(n.getSelection().isEntire()),[h,g]=(0,u.useState)(!1),[_]=i.Xt(`selectAll`);Ni(n?.getSelection(),{onChange:()=>{m(n.getSelection().isEntire()),g(n.getSelection().hasTopOrLeft())}});let v=r===`dark`?`dark`:`light`,y=p?`var(--sxl-color-primary)`:`var(--sxl-color-base-100)`,b=p?`color-mix(in srgb, var(--sxl-color-primary) 20%, transparent)`:`var(--sxl-color-base-hover)`,x=`var(--sxl-color-base-300)`,S=i.kt.getDevicePixelRatio(),C=e=>e/S+`px`;return(0,d.jsxs)(`div`,{tabIndex:-1,className:$(a,`top-left-corner`),...i.qt(`header`,v),...f,onMouseDown:e=>{_?.execute(e.ctrlKey||e.button!==0),l?.(e)},style:{gridColumn:`1 / 2`,gridRow:`1 / 2`,width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,boxSizing:`border-box`,position:`relative`,cursor:`cell`,zIndex:100,borderRight:`solid ${C(1)} ${x}`,borderBottom:`solid ${C(1)} ${x}`,...o},ref:t,children:[(0,d.jsx)(`div`,{style:{height:c-5+`px`,width:c-5+`px`,clipPath:`path('M${c-5} 0 L0 ${c-5} L${c-5} ${c-5} L${c-5} 0 Z')`,borderRight:`${C(2)} solid ${y}`,borderBottom:`${C(2)} solid ${y}`,background:`${b}`,boxSizing:`border-box`,position:`absolute`,right:C(2),bottom:C(2)}}),(0,d.jsx)(`div`,{style:{position:`absolute`,right:C(-2),bottom:C(-2),width:C(h?2:1),height:C(h?2:1),background:h?`var(--sxl-color-primary)`:`var(--sxl-color-base-300)`}})]})}));Of.displayName=`TopLeftCorner`;var kf=(e,t)=>e?[t]:[],Af=new Set([`formatTextRotate0`,`formatTextRotate45`,`formatTextRotate90`,`formatTextRotate270`,`formatTextRotate315`,`formatTextRotateCustom`,`formatTextRotateVertical`]),jf=new Set([`dataTextToColumns`,`sortAscending`,`sortDescending`,`sheetBackgroundDelete`]),Mf=new o.sn(`transparent`);function Nf(e){let t=e.getStyles();return{schemeLookup:t.schemeLookup(),recentColors:()=>t.recentColors(),addRecentColor:e=>t.addRecentColor(e),clearRecentColors:()=>t.clearRecentColors()}}function Pf(e,t){let r=t.sheet;if(!r)return()=>{};let c=t,l=c?.notifier;e.use(nu({transaction:r,notifier:l,manager:c?.manager})),e.updateCommand(`protectionSheetToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let i=r.getProtection(),a=null;try{if(i.isLocked()||i.isPaused()){let e=null;if(i.hasPassword()){let t=await l?.showInput({title:n.r(`dialog.password.title`),description:n.r(`dialog.password.description`),options:[{id:`Unprotect`,label:()=>n.r(`dialog.unprotect`)},`Cancel`],defaultOption:`Unprotect`,inputType:`password`});if(t?.option!==`Unprotect`)return;e=t.input}a=await Promise.resolve(l?.showBusy(t?.getLabel?.())??null),await i.unlock(e??void 0)}else a=await Promise.resolve(l?.showBusy(t?.getLabel?.())??null),await i.lock();a?.()}catch(e){a?.(),l?.showError(e)}}});let u=async e=>{let t,i=r.getProtection();if(i.isPaused())return void i.resume();if(i.hasPassword()){let e=await l?.showInput({title:n.r(`dialog.password.title`),description:n.r(`dialog.password.pauseDescription`),options:[{id:`Pause`,label:()=>n.r(`dialog.pause`)},`Cancel`],defaultOption:`Pause`,inputType:`password`});if(e?.option!==`Pause`)return;t=e.input??void 0}let a=null;try{a=await Promise.resolve(l?.showBusy(e?.getLabel?.())??null),await i.pause(t),a?.()}catch(e){a?.(),l?.showError(e)}};e.updateCommand(`protectionSheetPause`,{tags:[`noTransaction`,`noRepeat`],callback:(e,t)=>u(t)}),e.updateCommand(`protectionSheetProtectOrPause`,{tags:[`noTransaction`,`noRepeat`],callback:async(e,t)=>{let n=r.getProtection();if(n.isLocked()||n.isPaused())return void await u(t);let i=null;try{i=await Promise.resolve(l?.showBusy(t?.getLabel?.())??null),await n.lock(),i?.()}catch(e){i?.(),l?.showError(e)}}}),e.updateCommand(`manageProtection`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=e===`sheet`||e===`ranges`||e===`cells`||e===`workbook`?e:`sheet`;c?.activateTaskPane?.(`manageProtection`,{args:{tab:t}})}}),e.updateCommand(`manageDataValidation`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`dataValidationDetails`)}}),e.updateCommand(`manageConditionalFormat`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`conditionalFormatDetails`)}}),e.updateCommand(`conditionalFormatNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`conditionalFormatDetails`,{args:{insert:!0}})}});let d=e=>{r.getConditionalFormats().add(r.getSelectedRanges(),{...e,replaceExisting:!0})},f=e=>({tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`conditionalFormatDetails`,{args:{draft:{condition:e,style:structuredClone(Wu[0].style)}}})}}),p=o.ct.BuiltInOperatorNames,m=o.ct.BuiltInSelectorNames;e.updateCommand(`conditionalFormatGreaterThan`,f({selector:m.Number,operator:p.GreaterThan,param:10})),e.updateCommand(`conditionalFormatLessThan`,f({selector:m.Number,operator:p.LessThan,param:10})),e.updateCommand(`conditionalFormatBetween`,f({selector:m.Number,operator:p.Between,param:{from:10,to:20}})),e.updateCommand(`conditionalFormatEqualTo`,f({selector:m.Number,operator:p.EqualTo,param:10})),e.updateCommand(`conditionalFormatTextContains`,f({selector:m.Text,operator:p.TextContains,param:``})),e.updateCommand(`conditionalFormatDateOccurring`,f({operator:p.TimePeriod,param:{type:o.ct.TimePeriodType.Today}})),e.updateCommand(`conditionalFormatDuplicateValues`,f({operator:p.Not,param:{operator:p.Unique}})),e.updateCommand(`conditionalFormatTopItems`,f({operator:p.TopN,param:{top:!0,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatTopPercent`,f({operator:p.TopN,param:{top:!0,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatBottomItems`,f({operator:p.TopN,param:{top:!1,limit:10,percent:!1}})),e.updateCommand(`conditionalFormatBottomPercent`,f({operator:p.TopN,param:{top:!1,limit:10,percent:!0}})),e.updateCommand(`conditionalFormatAboveAverage`,f({operator:p.Average,param:{type:o.ct.AverageType.Above}})),e.updateCommand(`conditionalFormatBelowAverage`,f({operator:p.Average,param:{type:o.ct.AverageType.Below}})),e.updateCommand(`conditionalFormatDataBar`,{callback:e=>{d({scale:e?structuredClone(e):rd()})}}),e.updateCommand(`conditionalFormatColorScale`,{callback:e=>{d({scale:e?structuredClone(e):nd()})}}),e.updateCommand(`conditionalFormatIconSet`,{callback:e=>{d({scale:e?structuredClone(e):ad()})}}),e.updateCommand(`conditionalFormatClearSelection`,{callback:()=>{let e=r.getConditionalFormats(),t=new Set;for(let n of r.getSelectedRanges().getCoords())for(let r of e.getItems({address:n}))t.add(r);for(let e of t)e.delete()}}),e.updateCommand(`conditionalFormatClearSheet`,{callback:()=>{for(let e of r.getConditionalFormats().getItems())e.delete()}}),e.updateCommand(`dataValidationNewRule`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`dataValidationDetails`,{args:{insert:!0}})}}),e.updateCommand(`dataValidationList`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=o.B.BuiltInSelectors.List.getDefaultCondition({ranges:r.getSelectedRanges()});c?.activateTaskPane?.(`dataValidationDetails`,{args:{draft:{condition:{selector:m.List,...e,includeBlanks:!0}}}})}}),e.updateCommand(`dataValidationUnique`,{callback:()=>{let e=r.getSelectedRanges(),t=e.getCoords();r.getDataValidations().getItems().some(e=>e.getCondition()?.getOperator()?.getName()===p.Unique&&n.d.isEqualRangesArrays(e.getRanges().getCoords(),t))||r.getDataValidations().add(e,{condition:{operator:p.Unique,includeBlanks:!0},alertStyle:o.d.AlertStyle.Stop,showAlertMessage:!0})}}),e.updateCommand(`dataValidationClearSelection`,{callback:()=>{r.getSelectedRanges().clear(o.n.Content.DataValidations)}}),e.updateCommand(`dataValidationClearSheet`,{callback:()=>{for(let e of r.getDataValidations().getItems())e.delete()}}),e.updateCommand(`protectionUnlockRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`manageProtection`,{args:{tab:`ranges`,items:{insert:!0}}})}}),e.updateCommand(`manageProtectedRange`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{c?.activateTaskPane?.(`manageProtection`,{args:{tab:`ranges`}})}});let h=async e=>{let t=t=>{r.doBatch(()=>{let n=r.getSelectedRanges();n.merge({axes:e,discardMultipleValues:t}),e===a.l.AxisSelection.Both&&n.getStyle().update({alignment:{horizontal:o.Y.HorizontalAlignment.Center}})},{description:n.q(`op.mergeCells`)})};try{t(!1)}catch(e){if(e?.type===`discardMultipleValues`&&l?.showOptions){if(await l.showOptions({title:n.r(`dialog.confirm.title`),description:n.r(`sheet.mergeCellsWarning`),options:[{id:`Merge`,label:()=>n.r(`sheet.merge`)},`Cancel`],defaultOption:`Merge`})!==`Merge`)return;try{t(!0)}catch(e){l?.showError?.(e)}}else l?.showError?.(e)}},g=()=>{r.doBatch(()=>{let e=r.getSelectedRanges();e.unmerge(),e.getStyle().update({alignment:{horizontal:null}})},{description:n.q(`op.unmergeCells`)})};e.updateCommand(`mergeToggle`,{tags:[`noTransaction`],callback:()=>{n.d.isSingleCell(r.getSelectedRange().getCoords())||(r.getSelectedRanges().getMerges().length===0?h(a.l.AxisSelection.Both):g())}}),e.updateCommand(`mergeHorizontal`,{tags:[`noTransaction`],callback:()=>{h(a.l.AxisSelection.Column)}}),e.updateCommand(`mergeVertical`,{tags:[`noTransaction`],callback:()=>{h(a.l.AxisSelection.Row)}}),e.updateCommand(`unmerge`,{tags:[`noTransaction`],callback:()=>g()});let _=e.getKeysByTag(`mutator`),v=()=>{let t=r.getProtection(),i=t.isLocked(),s=!t.isFormatCellsAllowed(),l=kf(s,n.q(`reason.sheetProtected`)),u=t.isPaused(),d=i||u;e.updateCommand(`protectionSheetToggle`,{state:d,params:{locked:d}}),e.updateCommand(`protectionSheetPause`,{state:u,params:{paused:u},disabledReasons:kf(!u&&!i,n.q(`reason.protectionNotPausable`))}),e.updateCommand(`protectionSheetProtectOrPause`,{state:d,params:{state:u?`paused`:i?`locked`:`none`},icon:u?`LockOpen`:`Lock`}),e.updateCommand(`protectionUnlockRange`,{disabledReasons:kf(i,n.q(`reason.sheetProtected`))}),e.updateCommand(`conditionalFormatNewRule`,{disabledReasons:l});let f=kf(i,n.q(`reason.sheetProtected`));e.updateCommand(`dataValidationNewRule`,{disabledReasons:f}),e.updateCommand(`dataValidationList`,{disabledReasons:f});let p=r.getSelectedRanges(),m=r.getSelectedRange(),h=p.getCoords(),g=p.getMerges().length>0,v=p.isOverlapping(),y=!0;for(let e=0;y&&e<h.length;e++)y=n.d.isSingleCell(h[e]);let b=h.length===1&&h[0].colStart===h[0].colEnd,x=!(r.getTables().getItems({address:m}).length>0)&&!v&&(g||!y),S=!1,C=!1,w=!1,T=!1;s||(S=p.isEntireColumnsAny(),C=S&&!p.isEntireColumns(),w=p.isEntireRowsAny(),T=w&&!p.isEntireRows());for(let t of _)Af.has(t)||jf.has(t)||e.updateCommand(t,{disabledReasons:l});let E=r.getSelectedCell().getStyle().getAlignment().getHorizontal(),D=E===o.Y.HorizontalAlignment.CenterContinuous||E===o.Y.HorizontalAlignment.Fill;for(let t of Af)e.updateCommand(t,{disabledReasons:[...l,...kf(D,n.q(`reason.continuousSpan`))]});e.updateCommand(`dataTextToColumns`,{disabledReasons:[...l,...kf(!b,n.q(`reason.singleColumn`)),...kf(i,n.q(`reason.sheetLocked`))]});let O=[...l,...kf(p.getCount()!==1,n.q(`reason.sortRange`))];e.updateCommand(`sortAscending`,{disabledReasons:O}),e.updateCommand(`sortDescending`,{disabledReasons:O}),e.updateCommand(`sheetBackgroundDelete`,{disabledReasons:[...l,...kf(!r.getPicture(),n.q(`reason.noSheetBackground`))]});let k=kf(!x,n.q(`reason.mergeUnavailable`));e.updateCommand(`mergeToggle`,{state:g,disabledReasons:[...l,...k]}),e.updateCommand(`mergeHorizontal`,{disabledReasons:[...l,...k]}),e.updateCommand(`mergeVertical`,{disabledReasons:[...l,...k]}),e.updateCommand(`unmerge`,{disabledReasons:[...l,...kf(!g,n.q(`reason.noMerge`)),...k]});let A=kf(v,n.q(`reason.overlap`)),j=[...l,...kf(w,n.q(`reason.entireColumn`)),...A,...kf(C,n.q(`reason.mixedSelection`))],M=[...l,...kf(S,n.q(`reason.entireRow`)),...A,...kf(T,n.q(`reason.mixedSelection`))];e.updateCommand(`insertCellsShiftDown`,{disabledReasons:j}),e.updateCommand(`deleteCellsShiftUp`,{disabledReasons:j}),e.updateCommand(`insertCellsShiftRight`,{disabledReasons:M}),e.updateCommand(`deleteCellsShiftLeft`,{disabledReasons:M});let N=[...l,...kf(w,n.q(`reason.entireRow`)),...A,...kf(C,n.q(`reason.mixedSelection`))],P=[...l,...kf(S,n.q(`reason.entireColumn`)),...A,...kf(T,n.q(`reason.mixedSelection`))];for(let t of[`insertRows`,`insertRowsAfter`,`deleteRows`])e.updateCommand(t,{disabledReasons:N});for(let t of[`insertColumns`,`insertColumnsAfter`,`deleteColumns`])e.updateCommand(t,{disabledReasons:P});let F=c?.editModeHandler?.getMode()?.key,I=F===`copy`?`copy`:F===`cut`?`cut`:`none`,L=v?1:p.getRowCount(),R=v?1:p.getColumnCount(),z=p.getDefaultShiftAxis()===a.l.Axis.Column,B=S&&!C,V=w&&!T,H=B?`rows`:V?`columns`:`none`,U=V?R:L;e.updateCommand(`insertCells`,{params:{mode:I,shift:z?`right`:`down`,span:H,count:U}}),e.updateCommand(`deleteCells`,{params:{shift:z?`left`:`up`,span:H,count:U}}),e.updateCommand(`insertCellsShiftDown`,{params:{mode:I,span:B?`rows`:`none`,count:L}}),e.updateCommand(`deleteCellsShiftUp`,{params:{span:B?`rows`:`none`,count:L}}),e.updateCommand(`insertCellsShiftRight`,{params:{mode:I,span:V?`columns`:`none`,count:R}}),e.updateCommand(`deleteCellsShiftLeft`,{params:{span:V?`columns`:`none`,count:R}});for(let t of[`insertRows`,`insertRowsAfter`])e.updateCommand(t,{params:{mode:I,count:L}});for(let t of[`insertColumns`,`insertColumnsAfter`])e.updateCommand(t,{params:{mode:I,count:R}});e.updateCommand(`deleteRows`,{params:{count:L}}),e.updateCommand(`deleteColumns`,{params:{count:R}}),e.updateCommand(`hideRows`,{params:{count:p.getRowCount()}}),e.updateCommand(`hideColumns`,{params:{count:p.getColumnCount()}})};v();let y=r.addListeners({onProtectionChange:v,onStyleChange:v,onInvalidated:v,onClose:()=>e.remove()}),b=r.getSelection().addListeners({onChange:v}),x=function(e,t){let r=()=>t.getView();e.updateCommand(`gridlinesToggle`,{callback:()=>{let e=r().isShowColumnGridlines()&&r().isShowRowGridlines();r().update({showColumnGridlines:!e,showRowGridlines:!e})}}),e.updateCommand(`sheetViewToggleGridlinesRows`,{callback:()=>{r().setShowRowGridlines(!r().isShowRowGridlines())}}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{callback:()=>{r().setShowColumnGridlines(!r().isShowColumnGridlines())}}),e.updateCommand(`sheetViewFormatGridlinesColor`,{callback:e=>{r().setGridLineColor(e)},context:()=>({...Nf(t),autoColor:null,onColorSelect:()=>{}})}),e.updateCommand(`sheetViewToggleShowHeadings`,{callback:()=>{let e=r().isShowColumnHeaders()&&r().isShowRowHeaders();r().update({showColumnHeaders:!e,showRowHeaders:!e})}}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{callback:()=>{r().setShowColumnHeaders(!r().isShowColumnHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{callback:()=>{r().setShowRowHeaders(!r().isShowRowHeaders())}}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{callback:()=>{let e=r(),t=e.getColumnHeaderStyle()===o.s.HeaderTextStyle.Zero&&e.getRowHeaderStyle()===o.s.HeaderTextStyle.Zero;e.update({columnHeaderStyle:t?o.s.HeaderTextStyle.A1:o.s.HeaderTextStyle.Zero,rowHeaderStyle:t?o.s.HeaderTextStyle.One:o.s.HeaderTextStyle.Zero})}}),e.updateCommand(`sheetViewToggleFormulaView`,{callback:()=>{r().setShowFormulas(!r().isShowFormulas())}}),e.updateCommand(`sheetViewToggleShowZeros`,{callback:()=>{r().setShowZeros(!r().isShowZeros())}}),e.updateCommand(`protectionHighlight`,{callback:()=>{r().setShowLockedShading(!r().isShowLockedShading())}}),e.updateCommand(`dataValidationShowInvalid`,{callback:()=>{r().setShowInvalid(!r().isShowInvalid())}}),e.updateCommand(`calculate`,{callback:()=>{t.calculate()}}),e.updateCommand(`sheetZoomOut`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomOut()}}),e.updateCommand(`sheetZoomIn`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().zoomIn()}}),e.updateCommand(`sheetZoom100`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(100)}}),e.updateCommand(`sheetZoom200`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(200)}}),e.updateCommand(`sheetZoom75`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(75)}}),e.updateCommand(`sheetZoom50`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(50)}}),e.updateCommand(`sheetZoom25`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setZoomScale(25)}}),e.updateCommand(`sheetZoomCustom`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{r().setZoomScale(e??100)}});let i=()=>(r().getFreezePanes().coords?.rowIndex??0)!==0,a=()=>(r().getFreezePanes().coords?.colIndex??0)!==0;e.updateCommand(`freezeToggle`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();i()||a()?r().setFreezePanes(null):r().setFreezePanes({coords:e})}}),e.updateCommand(`freezeToggleHorizontal`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();r().setFreezePanes({coords:{rowIndex:i()?0:e.rowIndex}})}}),e.updateCommand(`freezeToggleVertical`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{let e=t.getSelectedCell().getCoords();r().setFreezePanes({coords:{colIndex:a()?0:e.colIndex}})}}),e.updateCommand(`unfreeze`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r().setFreezePanes(null)}});let s=()=>{let s=r(),c=s.getColumnHeaderStyle()===o.s.HeaderTextStyle.Zero&&s.getRowHeaderStyle()===o.s.HeaderTextStyle.Zero;e.updateCommand(`gridlinesToggle`,{state:s.isShowColumnGridlines()||s.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleGridlinesColumns`,{state:s.isShowColumnGridlines()}),e.updateCommand(`sheetViewToggleGridlinesRows`,{state:s.isShowRowGridlines()}),e.updateCommand(`sheetViewToggleShowHeadings`,{state:s.isShowColumnHeaders()||s.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingColumns`,{state:s.isShowColumnHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingRows`,{state:s.isShowRowHeaders()}),e.updateCommand(`sheetViewToggleShowHeadingsNumeric`,{state:c}),e.updateCommand(`sheetViewToggleFormulaView`,{state:s.isShowFormulas()}),e.updateCommand(`sheetViewToggleShowZeros`,{state:s.isShowZeros()}),e.updateCommand(`protectionHighlight`,{state:s.isShowLockedShading()}),e.updateCommand(`dataValidationShowInvalid`,{state:s.isShowInvalid()}),e.updateCommand(`sheetViewFormatGridlinesColor`,{state:s.getGridLineColor()});let l=s.getZoomScale();e.updateCommand(`sheetZoom200`,{state:l===200}),e.updateCommand(`sheetZoom100`,{state:l===100}),e.updateCommand(`sheetZoom75`,{state:l===75}),e.updateCommand(`sheetZoom50`,{state:l===50}),e.updateCommand(`sheetZoom25`,{state:l===25}),e.updateCommand(`sheetZoomCustom`,{state:l});let u=t.getSelectedCell().getCoords();if(!u)return;let d=i(),f=a(),p=d||f;e.updateCommand(`freezeToggle`,{state:p,disabledReasons:p||u.rowIndex!==0||u.colIndex!==0?[]:[n.q(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleHorizontal`,{state:d,disabledReasons:d||u.rowIndex!==0?[]:[n.q(`reason.freezeOrigin`)]}),e.updateCommand(`freezeToggleVertical`,{state:f,disabledReasons:f||u.colIndex!==0?[]:[n.q(`reason.freezeOrigin`)]}),e.updateCommand(`unfreeze`,{disabledReasons:p?[]:[n.q(`reason.noFreeze`)]})};s();let c=t.addListeners({onViewChange:s}),l=t.getSelection().addListeners({onChange:s});return()=>{c(),l()}}(e,r),S=function(e,t,r,i,a,c){let l=(e,n=!1,r)=>{let i=r??{autoSelect:!0,autoFit:!0},a=t.getSelectedRanges();n&&a.getStyle().update(null,i),a.getStyle().update(e,i)},u=()=>t.getSelectedCell().getStyle().getFont(),d=()=>t.getSelectedCell().getStyle().getAlignment(),f=()=>{let e=u().getWeight();return!isNaN(e)&&e>500};e.updateCommand(`formatBoldToggle`,{callback:()=>{l({font:{weight:f()?400:700}})}}),e.updateCommand(`formatItalicToggle`,{callback:()=>{l({font:{style:u().getStyle()===o._.Style.Italic?o._.Style.Normal:o._.Style.Italic}})}}),e.updateCommand(`formatStrikeThroughToggle`,{callback:()=>{l({font:{strike:!u().getStrike()}})}});let p=(t,n)=>{e.updateCommand(t,{callback:()=>{l({font:{underline:u().getUnderline()===n?o._.UnderlineStyle.None:n}})}})};p(`formatUnderlinedToggle`,o._.UnderlineStyle.Single),p(`formatUnderlinedDoubleToggle`,o._.UnderlineStyle.Double),p(`formatUnderlinedAccountingToggle`,o._.UnderlineStyle.SingleAccounting),p(`formatUnderlinedAccountingDoubleToggle`,o._.UnderlineStyle.DoubleAccounting);let m=(t,n)=>{e.updateCommand(t,{callback:()=>{l({font:{verticalAlign:u().getVerticalAlignment()===n?o._.VerticalAlignment.Baseline:n}})}})};m(`formatSuperscriptToggle`,o._.VerticalAlignment.Super),m(`formatSubscriptToggle`,o._.VerticalAlignment.Sub);let h=(t,n)=>{e.updateCommand(t,{callback:()=>{l({alignment:{overflow:d().getOverflow()===n?o.Y.Overflow.Visible:n}})}})};h(`formatTextOverflowVisibleToggle`,o.Y.Overflow.Visible),h(`formatTextOverflowWrapToggle`,o.Y.Overflow.Wrap),h(`formatTextOverflowClipToggle`,o.Y.Overflow.Clip),h(`formatTextOverflowShrinkToggle`,o.Y.Overflow.Shrink),e.updateCommand(`formatTextOverflowEllipsisToggle`,{callback:()=>{l({alignment:{overflow:d().getOverflow()===o.Y.Overflow.Ellipsis?o.Y.Overflow.Visible:o.Y.Overflow.Ellipsis}})},disabledReasons:[n.q(`reason.notImplemented`)]});let g=(t,n)=>{e.updateCommand(t,{callback:()=>{l({alignment:{vertical:d().getVertical()===n?o.Y.VerticalAlignment.Bottom:n}})}})};g(`formatAlignTopToggle`,o.Y.VerticalAlignment.Top),g(`formatAlignMiddleToggle`,o.Y.VerticalAlignment.Center),g(`formatAlignBottomToggle`,o.Y.VerticalAlignment.Bottom),g(`formatAlignJustifyVerticalToggle`,o.Y.VerticalAlignment.Justify),g(`formatAlignDistributedVerticalToggle`,o.Y.VerticalAlignment.Distributed);let _=(t,n,r=!1)=>{e.updateCommand(t,{callback:()=>{let e=d().getHorizontal()===n?o.Y.HorizontalAlignment.General:n;l({alignment:r?{horizontal:e,rotation:null,stacked:null}:{horizontal:e}})}})};_(`formatAlignLeftToggle`,o.Y.HorizontalAlignment.Left),_(`formatAlignCenterToggle`,o.Y.HorizontalAlignment.Center),_(`formatAlignCenterContinuousToggle`,o.Y.HorizontalAlignment.CenterContinuous,!0),_(`formatAlignFillToggle`,o.Y.HorizontalAlignment.Fill,!0),_(`formatAlignDistributedHorizontalToggle`,o.Y.HorizontalAlignment.Distributed),_(`formatAlignRightToggle`,o.Y.HorizontalAlignment.Right),_(`formatAlignJustifyToggle`,o.Y.HorizontalAlignment.Justify),e.updateCommand(`formatBorder`,{callback:e=>{l({borders:e})}}),e.updateCommand(`formatFillColor`,{callback:e=>{l({fill:e})}}),e.updateCommand(`formatFontColor`,{callback:e=>{l({font:{color:e}})}}),e.updateCommand(`formatFillColor`,{context:()=>({...Nf(t),autoColor:Mf,quickColor:i?.getLastFillColor?.()??void 0,onColorSelect:e=>i?.setLastFillColor?.(e??Mf)})}),e.updateCommand(`formatFontColor`,{context:()=>({...Nf(t),autoColor:t.getStyles().getNormal().getFont().getColor(),quickColor:i?.getLastFontColor?.()??void 0,onColorSelect:e=>i?.setLastFontColor?.(e)})}),e.updateCommand(`formatBorder`,{context:()=>{let e=t.getStyles();return{autoColor:e.getNormal().getFont().getColor(),autoStyle:o.W.StrokeStyle.Thin,schemeLookup:e.schemeLookup(),quickBorder:i?.getLastBorder?.()??void 0,createBorder:t=>e.getNormal().createStyle({borders:t}).getBorders(),onBorderSelect:e=>i?.setLastBorder?.(e)}}}),e.updateCommand(`formatFontFamily`,{callback:e=>{l({font:{family:e}})}}),e.updateCommand(`formatFontSize`,{callback:e=>{l({font:{size:e}})}}),e.updateCommand(`formatFontSizeIncrease`,{callback:()=>{l(e=>({font:{size:s.f.findNextFontSize(e.getFont().getSize(),!0)}}))}}),e.updateCommand(`formatFontSizeDecrease`,{callback:()=>{l(e=>({font:{size:s.f.findNextFontSize(e.getFont().getSize(),!1)}}))}}),e.updateCommand(`formatNumberFormat`,{callback:e=>{l({numberFormat:e})}}),e.updateCommand(`formatNumberFormatGeneralStyle`,{callback:()=>{l({numberFormat:o.It.Type.General})}}),e.updateCommand(`formatNumberFormatNumberStyle`,{callback:()=>{l({numberFormat:4})}}),e.updateCommand(`formatNumberFormatTimeStyle`,{callback:()=>{l({numberFormat:18})}}),e.updateCommand(`formatNumberFormatDateStyle`,{callback:()=>{l({numberFormat:15})}}),e.updateCommand(`formatNumberFormatAccountingStyle`,{callback:e=>{l(e?{numberFormat:e}:{named:o.it.BuiltInName.Currency})}}),e.updateCommand(`formatNumberFormatPercentStyle`,{callback:()=>{l({named:o.it.BuiltInName.Percent})}}),e.updateCommand(`formatNumberFormatScientificStyle`,{callback:()=>{l({numberFormat:11})}}),e.updateCommand(`formatNumberFormatCommaStyle`,{callback:()=>{l({named:o.it.BuiltInName.Comma})}}),e.updateCommand(`formatNumberFormatIncreaseDecimal`,{callback:()=>{l(e=>({numberFormat:o.It.Parser.adjustDecimalPlaces(e.getNumberFormat(),1)}))}}),e.updateCommand(`formatNumberFormatDecreaseDecimal`,{callback:()=>{l(e=>({numberFormat:o.It.Parser.adjustDecimalPlaces(e.getNumberFormat(),-1)}))}});let v={style:o.W.StrokeStyle.Thin,color:null};e.updateCommand(`formatBorderAddOutline`,{callback:()=>{l({borders:{left:v,top:v,right:v,bottom:v}})}}),e.updateCommand(`formatBorderClearOutline`,{callback:()=>{l({borders:null})}}),e.updateCommand(`formatIndentDecrease`,{callback:()=>{l(e=>{let t=e.getAlignment().getIndent()-1;return{alignment:{indent:t>0?t:0}}})}}),e.updateCommand(`formatIndentIncrease`,{callback:()=>{l(e=>{let t={alignment:{indent:e.getAlignment().getIndent()+1}};return e.getAlignment().getHorizontal()===o.Y.HorizontalAlignment.General&&(t.alignment.horizontal=o.Y.HorizontalAlignment.Left),t})}}),e.updateCommand(`formatCellStyle`,{callback:e=>{t.getSelectedRanges().getStyle().setNamed(e,{autoSelect:!0,autoFit:!0})},context:()=>({styles:()=>t.getStyles(),named:()=>t.getSelectedCell().getStyle().getNamed(),createCell:e=>t.createCell(e)})});let y=e=>{l({alignment:{rotation:e}})};e.updateCommand(`formatTextRotate0`,{callback:()=>y(0)}),e.updateCommand(`formatTextRotate45`,{callback:()=>y(45)}),e.updateCommand(`formatTextRotate90`,{callback:()=>y(90)}),e.updateCommand(`formatTextRotate270`,{callback:()=>y(270)}),e.updateCommand(`formatTextRotate315`,{callback:()=>y(315)}),e.updateCommand(`formatTextRotateCustom`,{callback:e=>y(e??0)}),e.updateCommand(`formatTextRotateVertical`,{callback:()=>{l({alignment:{stacked:!d().getStacked()}})}});let b=e=>{a?.(`formatCells`,{args:{tab:e}})};e.updateCommand(`formatCells`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{b(e)}}),e.updateCommand(`formatCellsNumber`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{b(`number`)}}),e.updateCommand(`formatCellsFont`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{b(`font`)}}),e.updateCommand(`formatSheetTabColor`,{callback:e=>{t.setTabColor(e)},state:t.getTabColor()??Mf,context:()=>({...Nf(t),autoColor:Mf,onColorSelect:()=>{}})});let x=()=>{let n=u(),r=n.getUnderline(),i=n.getVerticalAlignment();e.updateCommand(`formatBoldToggle`,{state:f()}),e.updateCommand(`formatItalicToggle`,{state:n.getStyle()===o._.Style.Italic}),e.updateCommand(`formatStrikeThroughToggle`,{state:n.getStrike()}),e.updateCommand(`formatUnderlinedToggle`,{state:r===o._.UnderlineStyle.Single}),e.updateCommand(`formatUnderlinedDoubleToggle`,{state:r===o._.UnderlineStyle.Double}),e.updateCommand(`formatUnderlinedAccountingToggle`,{state:r===o._.UnderlineStyle.SingleAccounting}),e.updateCommand(`formatUnderlinedAccountingDoubleToggle`,{state:r===o._.UnderlineStyle.DoubleAccounting}),e.updateCommand(`formatSuperscriptToggle`,{state:i===o._.VerticalAlignment.Super}),e.updateCommand(`formatSubscriptToggle`,{state:i===o._.VerticalAlignment.Sub}),e.updateCommand(`formatFontFamily`,{state:n.getFamily()}),e.updateCommand(`formatFontSize`,{state:n.getSize()});let a=t.getSelectedCell().getStyle().getNumberFormat();e.updateCommand(`formatNumberFormat`,{state:a,context:()=>t.getSelectedCell()});let s=t.getSelectedCell().getStyle().getFill(),c=null;s?.getType()===o.S.Type.Solid?c=s.getColor():s?.getType()===o.S.Type.Gradient?c=s.getStops()?.[0]?.getColor()??null:s?.getType()===o.S.Type.Pattern&&(c=s.getBackground()),e.updateCommand(`formatFillColor`,{state:c}),e.updateCommand(`formatFontColor`,{state:n.toJSON()?.color?n.getColor():null});let l=d(),p=l.getOverflow();e.updateCommand(`formatTextOverflowVisibleToggle`,{state:p===o.Y.Overflow.Visible}),e.updateCommand(`formatTextOverflowWrapToggle`,{state:p===o.Y.Overflow.Wrap}),e.updateCommand(`formatTextOverflowClipToggle`,{state:p===o.Y.Overflow.Clip}),e.updateCommand(`formatTextOverflowShrinkToggle`,{state:p===o.Y.Overflow.Shrink}),e.updateCommand(`formatTextOverflowEllipsisToggle`,{state:p===o.Y.Overflow.Ellipsis});let m=l.getVertical();e.updateCommand(`formatAlignTopToggle`,{state:m===o.Y.VerticalAlignment.Top}),e.updateCommand(`formatAlignMiddleToggle`,{state:m===o.Y.VerticalAlignment.Center}),e.updateCommand(`formatAlignBottomToggle`,{state:m===o.Y.VerticalAlignment.Bottom}),e.updateCommand(`formatAlignJustifyVerticalToggle`,{state:m===o.Y.VerticalAlignment.Justify}),e.updateCommand(`formatAlignDistributedVerticalToggle`,{state:m===o.Y.VerticalAlignment.Distributed});let h=l.getHorizontal();e.updateCommand(`formatAlignLeftToggle`,{state:h===o.Y.HorizontalAlignment.Left}),e.updateCommand(`formatAlignCenterToggle`,{state:h===o.Y.HorizontalAlignment.Center}),e.updateCommand(`formatAlignCenterContinuousToggle`,{state:h===o.Y.HorizontalAlignment.CenterContinuous}),e.updateCommand(`formatAlignFillToggle`,{state:h===o.Y.HorizontalAlignment.Fill}),e.updateCommand(`formatAlignDistributedHorizontalToggle`,{state:h===o.Y.HorizontalAlignment.Distributed}),e.updateCommand(`formatAlignRightToggle`,{state:h===o.Y.HorizontalAlignment.Right}),e.updateCommand(`formatAlignJustifyToggle`,{state:h===o.Y.HorizontalAlignment.Justify});let g=l.getStacked(),_=g?0:l.getRotation();e.updateCommand(`formatTextRotate0`,{state:_===0&&!g}),e.updateCommand(`formatTextRotate45`,{state:_===45}),e.updateCommand(`formatTextRotate90`,{state:_===90}),e.updateCommand(`formatTextRotate270`,{state:_===270}),e.updateCommand(`formatTextRotate315`,{state:_===315}),e.updateCommand(`formatTextRotateVertical`,{state:g}),e.updateCommand(`formatTextRotateCustom`,{state:_??0})};x();let S=()=>{e.updateCommand(`formatCells`,{state:c?.getActive()===`formatCells`})};S();let C=c?.addListener({onChange:S}),w=t.addListeners({onStyleChange:x}),T=t.getSelection().addListeners({onChange:x});return()=>{w(),T(),C?.()}}(e,r,0,c?.pickerMemory,c?.activateTaskPane,c?.taskPaneArea),C=function(e,t){let n=e=>{t.getSelectedRanges().clear(e)};return e.updateCommand(`clearContents`,{callback:()=>{n(o.n.Content.Values)}}),e.updateCommand(`clearFormats`,{callback:()=>{n(o.n.Content.Formats)}}),e.updateCommand(`clearHyperlinks`,{callback:()=>{n(o.n.Content.Hyperlinks)}}),e.updateCommand(`clearComments`,{callback:()=>{n(o.n.Content.Comments)}}),e.updateCommand(`clearAll`,{callback:()=>{n()}}),e.updateCommand(`deleteHyperlink`,{callback:()=>{t.getSelectedRange().setHyperlink(null)}}),e.updateCommand(`deleteComments`,{callback:()=>{t.getSelectedRange().setComments(null)}}),()=>{}}(e,r),w=function(e,t){let r=(e,n)=>{t.getSelection().selectRegion({contentOnly:e,entireRegion:n})};return e.updateCommand(`selectAll`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{r(!1,e??!1)}}),e.updateCommand(`selectRegion`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{r(!0,!1)}}),e.updateCommand(`selectComments`,{tags:[`noTransaction`,`noRepeat`],disabledReasons:[n.q(`reason.notImplemented`)],callback:()=>{}}),e.updateCommand(`clearHiddenSelection`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.getSelection().clearHidden()}}),()=>{}}(e,r),T=function(e,t){let r=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null;e.updateCommand(`tableFilterToggle`,{callback:()=>{let e=r();if(e)return void e.setHiddenButtons(!e.isHiddenButtons());let n=t.getAutoTable();n?n.delete():t.addAutoTable()}});let i=()=>{let i=r()??t.getAutoTable(),a=t.getProtection(),o=!a.isAutoTableAllowed()||!a.isSortAllowed();e.updateCommand(`tableFilterToggle`,{state:!!i&&!i.isHiddenButtons(),disabledReasons:kf(o,n.q(`reason.sheetProtected`))})};i();let a=t.getSelection().addListeners({onChange:i}),o=t.addListeners({onTablesChange:i,onProtectionChange:i});return()=>{a(),o()}}(e,r),E=function(e,t,r){let i=()=>t.getSelectedRanges();e.updateCommand(`hideRows`,{callback:()=>{i().getRowHeaders().setHidden(!0)}}),e.updateCommand(`hideColumns`,{callback:()=>{i().getColumnHeaders().setHidden(!0)}}),e.updateCommand(`unhideRows`,{callback:()=>{i().getRowHeaders().setHidden(!1)}}),e.updateCommand(`unhideColumns`,{callback:()=>{i().getColumnHeaders().setHidden(!1)}}),e.updateCommand(`autoFitRows`,{callback:()=>{i().autoFit({axes:a.l.AxisSelection.Row})}}),e.updateCommand(`autoFitColumns`,{callback:()=>{i().autoFit({axes:a.l.AxisSelection.Column})}});let o=(e,o)=>{let s=e===a.l.Axis.Row,c=n.q(s?`op.resizeRows`:`op.resizeColumns`),l={initialValue:{size:o,unit:`Px`},context:()=>({getAxis:()=>e,getUnitText:()=>`Pt`}),onInput:(e,r)=>{if(r===`Autofit`)return void t.doBatch(()=>i().autoFit({axes:s?a.l.AxisSelection.Row:a.l.AxisSelection.Column}),{description:n.q(`op.autofit`),autoSelect:!0});if(!e)return;let o=s?i().getRowHeaders():i().getColumnHeaders();t.doBatch(()=>o.setSize(e.size+e.unit),{description:c,autoSelect:!0})}};r?.showWindow(`resizeHeader`,l)};return e.updateCommand(`resizeRows`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(a.l.Axis.Row,20)}),e.updateCommand(`resizeColumns`,{tags:[`noTransaction`,`noRepeat`],callback:()=>o(a.l.Axis.Column,100)}),()=>{}}(e,r,l),D=function(e,t,r){let i=(e,n)=>{let r=t.getSelectedRanges();r.doBatch(()=>{let n=e===a.l.Direction.Up||e===a.l.Direction.Down,i=e===a.l.Direction.Up||e===a.l.Direction.Left,s=t.getEntireCoords(),c=n?s.rowEnd:s.colEnd,l=e=>n?[e.rowStart,e.rowEnd]:[e.colStart,e.colEnd],u=(e,t,r)=>n?{...e,rowStart:t,rowEnd:r}:{...e,colStart:t,colEnd:r},d=e=>{let n=e;for(;;){let[e,r]=l(n),i=e,a=r;for(let e of t.getRange(n).getMerges()){let[t,n]=l(e);i=Math.min(i,t),a=Math.max(a,n)}if(i===e&&a===r)return n;n=u(n,i,a)}},f=r.getCoords(),p=f.length===1;for(let e of f){let n,[r,s]=l(e);if(r!==s)n=d(i?u(e,s,s):u(e,r,r));else{if(!p)continue;let t=i?s+1:r-1;if(t<0||t>c)continue;n=d(u(e,t,t))}let[f,m]=l(n),h=u(e,Math.min(r,f),Math.max(s,m));t.getRange(n).autoFill(h,{filler:o.D.Types.Copy}),t.getRange(e).autoFit({axes:a.l.AxisSelection.Row,skipCustomSize:!0,minContent:!0})}},{autoSelect:!0,description:n})};return e.updateCommand(`fillDown`,{callback:()=>i(a.l.Direction.Down,`Fill Down`)}),e.updateCommand(`fillRight`,{callback:()=>i(a.l.Direction.Right,`Fill Right`)}),e.updateCommand(`fillUp`,{callback:()=>i(a.l.Direction.Up,`Fill Up`)}),e.updateCommand(`fillLeft`,{callback:()=>i(a.l.Direction.Left,`Fill Left`)}),e.updateCommand(`fillSeries`,{tags:[`noTransaction`],callback:()=>{let e=t.getSelectedRanges();if(e.getCount()>1)throw new n.c(n.r(`error.fillSeries.multipleRanges`));let i=e.at(0),o=i.getDefaultAutoFillCriteria(),s=o?.direction!==a.l.Direction.Right,c=i.getDefaultAutoFillCriteria(s?a.l.Direction.Right:a.l.Direction.Down),l=new Map([[a.l.Direction.Down,s?o:c],[a.l.Direction.Right,s?c:o]]),u=(o?.offered.length?o:null)??(c?.offered.length?c:null);if(!u)throw new n.c(n.r(`error.fillSeries.invalidSelection`));oc({sheet:t,notifier:r,range:i,byDirection:l,direction:u.direction,presetId:u.presetId})}}),()=>{}}(e,r,l),O=function(e,t,n,r){let i=async(e,i=!1,o=!1)=>{let s=t.getSelectedRanges();i&&(e===a.l.Axis.Row?s=s.getEntireRows(o):e===a.l.Axis.Column&&(s=s.getEntireColumns(o)));let c=null,l=n?.getMode()?.key;if((l===`copy`||l===`cut`)&&r){let e=await r.getClipboard().readReference();e&&e.getItemType()===`range`&&(c=e.getItem?.()??null,c?.getCoords?.()||(c=null))}if(c){let t=await s.insertFrom(c,{...c.getMarkOptions(),axis:e,autoSelect:!0});!t||t.isEntireRows()||t.isEntireColumns()||t.autoFit({axes:a.l.AxisSelection.Row,skipCustomSize:!0,minContent:!0}),n?.setMode(null)}else s.insert({axis:e,autoSelect:!0})},o=(e,n=!1)=>{let r=t.getSelectedRanges();n&&(e===a.l.Axis.Row?r=r.getEntireRows():e===a.l.Axis.Column&&(r=r.getEntireColumns())),r.delete(e)};return e.updateCommand(`insertCells`,{callback:()=>i()}),e.updateCommand(`insertCellsShiftRight`,{callback:()=>i(a.l.Axis.Column)}),e.updateCommand(`insertCellsShiftDown`,{callback:()=>i(a.l.Axis.Row)}),e.updateCommand(`insertRows`,{callback:()=>i(a.l.Axis.Row,!0)}),e.updateCommand(`insertColumns`,{callback:()=>i(a.l.Axis.Column,!0)}),e.updateCommand(`insertRowsAfter`,{callback:()=>i(a.l.Axis.Row,!0,!0)}),e.updateCommand(`insertColumnsAfter`,{callback:()=>i(a.l.Axis.Column,!0,!0)}),e.updateCommand(`deleteCells`,{callback:()=>o()}),e.updateCommand(`deleteCellsShiftUp`,{callback:()=>o(a.l.Axis.Row)}),e.updateCommand(`deleteCellsShiftLeft`,{callback:()=>o(a.l.Axis.Column)}),e.updateCommand(`deleteRows`,{callback:()=>o(a.l.Axis.Row,!0)}),e.updateCommand(`deleteColumns`,{callback:()=>o(a.l.Axis.Column,!0)}),()=>{}}(e,r,c?.editModeHandler,c?.globalClipboard),k=function(e,t,r){e.updateCommand(`dataRemoveDuplicates`,{callback:async e=>{let i=t.getSelectedRanges();i.getCount()>1?r?.showError(new n.c(n.r(`error.removeDuplicates.multipleRanges`))):i.at(0).removeDuplicates({autoSelect:!0,...e})}}),e.updateCommand(`dataTextToColumns`,{callback:async e=>{let i=t.getSelectedRanges();if(i.getCount()>1)return void r?.showError(new n.c(n.r(`error.textToColumns.multipleRanges`)));let a=typeof e==`string`?{delimiter:e}:e;i.at(0).textToColumns({autoSelect:!0,...a})}});let i=async(e,i,o,s)=>{let c,l=i,u=t.getSelectedRange(),d=t.getSelectedCell(),f=d.getCoords(),p=null;if(l){let e=l.getRange().getCoords();p=t.getTables().getItems({address:{colIndex:e.colStart,rowIndex:e.rowStart}})[0]??t.getAutoTable(),p&&!p.getRange().getIntersect(e)&&(p=null)}else if(p=t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??t.getAutoTable(),p){let e=p.getRange();e.getIntersect(f)?l=p.getSortAt(f.colIndex-e.getCoords().colStart):p=null}if(l){let e=l,t=p;c=n=>{if(o&&t)return void t.sort({...n,description:s});let r={...n};delete r.sorts,e.setCriteria(r)},d=e.getRange().getCell(),u=t?t.getRange():e.getRange()}else{let r=t.getSelectedRanges();if(r.getCount()>1)throw new n.c(n.r(`error.sort.multipleRanges`));let i=r.at(0);i.size===1&&(i=i.getSurrounding({contentOnly:!0})),u=i,c=t=>{i.doBatch(()=>{let n={...t,...e};i.sort(n),i.autoFit({axes:n?.axis===a.l.Axis.Column?a.l.AxisSelection.Column:a.l.AxisSelection.Row,skipCustomSize:!0,minContent:!0})},s)}}let m=async e=>{if(!e)return;let t=await Promise.resolve(r?.showBusy?.(n.r(s))??null);try{c(e)}catch(e){t?.(),r?.showError?.(e);return}t?.()},h=u.getDefaultSortCriteria(a.l.Axis.Row,d);if(!h){if(o)throw new n.c(n.r(`error.sort.invalidSelection`));return}if(!o)return void await m({...h.options,...e});let g=u,_=h.options;_.hasHeader&&(g=u.getIntersect(h.sortCoords)),g.select();let v={range:u,cell:d},y={initialValue:_,context:()=>v,onInput:e=>{e&&m(e)}};r?.showWindow?.(`sort`,y)};return e.updateCommand(`sortAscending`,{tags:[`noTransaction`],callback:e=>i({reverse:!1},e,!1,n.q(`op.sortAscending`))}),e.updateCommand(`sortDescending`,{tags:[`noTransaction`],callback:e=>i({reverse:!0},e,!1,n.q(`op.sortDescending`))}),e.updateCommand(`sortCustom`,{tags:[`noTransaction`],callback:e=>i({},e,!0,n.q(`op.sortCustom`))}),()=>{}}(e,r,l),A=function(e,t,r){return e.updateCommand(`updateHyperlink`,{tags:[`noTransaction`],callback:()=>{r?.showWindow?.(`hyperlink`,{context:()=>t.getSelectedCell(),onInput:e=>{t.doBatch(()=>{t.getSelectedRange().setHyperlink(e)},{description:n.q(`op.updateHyperlink`)})}})}}),e.updateCommand(`openHyperlink`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{let e=t.getSelectedCell().getHyperlink();if(e)try{await e.open()}catch(e){r?.showError?.(e)}}}),e.updateCommand(`updateComments`,{tags:[`noTransaction`],callback:()=>{r?.showWindow?.(`comments`,{context:()=>t.getSelectedCell(),onInput:e=>{t.doBatch(()=>{t.getSelectedRange().setComments(e)},{description:n.q(`op.updateComment`)})}})}}),()=>{}}(e,r,l),j=function(e,t,r,a){let o=async(e,o,s=n.q(`op.insertImage`))=>{let c=await Promise.resolve(r?.showBusy?.(n.r(s))??null);try{await t.getMovables().addPicture(e,{autoSelect:!0,...o}),c?.(),a?.setMode(null)}catch(e){c?.();let t=e;if(typeof t!=`string`){console.warn(e);let r=typeof e?.cause==`string`?e.cause:``,i=typeof e?.message==`string`?e.message:``;r&&(i=i?`${i} (${r})`:r),t=n.r(`error.insertImage.unresolved`,{detail:i})}r?.showMessage?.(t,{type:i.rt.Error})}};e.updateCommand(`insertImageFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{let t=null,r=null;if(typeof e==`string`?r=e:t=e?.file?e.file:e??null,!t&&(t=await n.b.openFileDialog(r??`image/*`),!t))return;let i=await Promise.resolve(t);await o({source:{file:i}},e?.options)}}),e.updateCommand(`insertImageFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{if(!e){let t=await r?.showInput?.({title:n.r(`dialog.insertImage.title`),description:n.r(`dialog.insertImage.description`),inputLabel:n.r(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>n.r(`dialog.insert`)}]});if(!t||t.option!==`Insert`)return;e=t.input}e&&await o({source:{fetch:e}})}});let s=async e=>{let a=await Promise.resolve(r?.showBusy?.(n.r(n.q(`op.setPicture`)))??null);try{let n=t.getResources().add(e);await n.toBuffer(),t.setPicture(n),a?.()}catch(e){a?.();let t=e;if(typeof t!=`string`){console.warn(e);let r=typeof e?.cause==`string`?e.cause:``,i=typeof e?.message==`string`?e.message:``;r&&(i=i?`${i} (${r})`:r),t=n.r(`error.insertImage.unresolved`,{detail:i})}r?.showMessage?.(t,{type:i.rt.Error})}},c=async e=>{let t=null,r=null;typeof e==`string`?r=e:t=e??null,(t||(t=await n.b.openFileDialog(r??`image/*`),t))&&await s({source:{file:await Promise.resolve(t)}})};e.updateCommand(`sheetBackgroundFromFile`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{await c(e)}}),e.updateCommand(`sheetBackgroundFromURL`,{tags:[`noTransaction`,`noRepeat`],callback:async e=>{if(!e){let t=await r?.showInput?.({title:n.r(`dialog.sheetBackground.title`),description:n.r(`dialog.sheetBackground.description`),inputLabel:n.r(`dialog.insertImage.inputLabel`),initialValue:`https://picsum.photos/360`,propsInput:{style:{minWidth:`440px`}},options:[{id:`Insert`,label:()=>n.r(`dialog.insert`)}]});if(!t||t.option!==`Insert`)return;e=t.input}e&&await s({source:{fetch:e}})}}),e.updateCommand(`sheetBackgroundDelete`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{t.setPicture(null)}}),e.updateCommand(`sheetBackgroundToggle`,{tags:[`noTransaction`,`noRepeat`],callback:async()=>{t.getPicture()?t.setPicture(null):await c()}});let l=()=>{e.updateCommand(`sheetBackgroundToggle`,{state:!!t.getPicture()})};l();let u=t.addListeners({onStyleChange:l,onInvalidated:l});return()=>{u()}}(e,r,l,c?.editModeHandler),M=function(e,t,r,i,a){let o=()=>t.getTables().getItems({address:t.getSelectedCell().getCoords()})[0]??null,s=(e,i=!1)=>{let a=o();if(a)return void a.updateStyleOptions(e);let s=t.getSelectedRanges(),c=s.getCount()===1&&s.at(0).size===1?s.at(0).getSurrounding({contentOnly:!0}):null,l=c?t.getRanges(c).getFixed(!0):s.getFixed(!0),u=(c??t.getSelectedRange()).getDefaultSortCriteria(),d={getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0),table:()=>null,styles:()=>null},f={initialValue:{ranges:l,hasHeader:u?.options?.hasHeader??!1},context:()=>d,onInput:r=>{var a;(a=r??null)&&t.doBatch(async()=>{let n=a.ranges.at(0);i&&n.getStyle().clear(),await t.getTables().add(n,{hasHeader:a.hasHeader,properties:{name:a.name,style:e?.name}}).getRange().select()},{description:n.q(`op.insertTable`)})}};r?.showWindow?.(`tableNew`,f)};e.updateCommand(`insertTable`,{tags:[`noTransaction`],callback:()=>s()});let c=()=>({styles:()=>t.getStyles(),table:()=>o(),getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)});e.updateCommand(`formatTableStyle`,{tags:[`noTransaction`],callback:e=>s(e),context:c}),e.updateCommand(`formatTableStyleClearCellStyles`,{tags:[`noTransaction`],callback:e=>s(e,!0),context:c}),e.updateCommand(`editTable`,{tags:[`noTransaction`,`noRepeat`],callback:async n=>{let r=null,a=!1;if(n?.isITable?r=n:n?.getValue?.()&&(r=n.getValue(),a=!0),!r&&(r=o(),r)){let e=t.getSelectedRange();e.size===1&&(e=e.getSurrounding()),await e.select()}if(!r)return;let s=r;if(a)try{await s.select()}catch{}let c={styles:()=>t.getStyles(),table:()=>s,getNames:()=>t.getNames(),resolveRanges:e=>(t.getWorkbook()??t).getRanges(e).getFixed(!0)};e.updateCommand(`editTable`,{context:()=>c}),i?.(`tableDetails`)}});let l=async(e,i)=>{let a=(e=>e?e.isITable?e:e.getValue?.()??null:o())(e);if(a){if(!i){let e=a.getRange().getCoords(),t=(e.colEnd-e.colStart+1)*(e.rowEnd-e.rowStart+1);if(t>1e4&&r?.showOptions&&await r.showOptions({title:n.r(`dialog.confirm.title`),description:n.r(`table.convertToRangeWarning`,{count:t}),options:[{id:`Convert`,label:()=>n.r(`table.convert`)},`Cancel`],defaultOption:`Convert`})!==`Convert`)return}await t.doBatch(()=>{i?a.delete():a.convertToRange()},{description:n.q(i?`op.deleteTable`:`op.convertTableToRange`)})}};e.updateCommand(`deleteTable`,{tags:[`noTransaction`,`noRepeat`],callback:e=>l(e,!0)}),e.updateCommand(`convertTableToRange`,{tags:[`noTransaction`,`noRepeat`],callback:e=>l(e,!1)}),e.updateCommand(`setDefaultTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyles().setDefault(e)}}),e.updateCommand(`deleteTableStyle`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{t.getStyles().getTableStyles().getByName(e)?.delete()}});let u=()=>{let r=o(),i=t.getTables().getItems({address:t.getSelectedRange()}),a=[...kf(!t.getProtection().isFormatCellsAllowed(),n.q(`reason.sheetProtected`)),...kf(i.length>0&&!r,n.q(`reason.tableAmbiguous`))];e.updateCommand(`formatTableStyle`,{params:{hasTable:!!r},disabledReasons:a}),e.updateCommand(`formatTableStyleClearCellStyles`,{disabledReasons:a}),e.updateCommand(`insertTable`,{disabledReasons:[...a,...kf(i.length>0,n.q(`reason.alreadyTable`))]})};u();let d=()=>{e.updateCommand(`editTable`,{state:a?.getActive()===`tableDetails`})};d();let f=a?.addListener({onChange:d}),p=t.getSelection().addListeners({onChange:u}),m=t.addListeners({onTablesChange:u,onProtectionChange:u});return()=>{p(),m(),f?.()}}(e,r,l,c?.activateTaskPane,c?.taskPaneArea);return()=>{y(),b(),x(),S(),C(),w(),T(),E(),D(),O(),k(),A(),j(),M()}}var{CommandScopeProvider:Ff}=i.Jt;Su();var If={dynamic:(e,t)=>{let n=Pf(e,t),r=t.editable&&t.sheet?Xs(e,{editable:t.editable,sheet:t.sheet,flavor:`startEdit`}):void 0;return()=>{n(),r?.()}}},Lf=({sheet:e,editable:t,scopeRef:n,elementRef:r,children:a})=>i.Jt.useCommandScope()?(0,d.jsx)(Rf,{sheet:e,editable:t,scopeRef:n,elementRef:r,children:a}):(0,d.jsx)(d.Fragment,{children:a}),Rf=({sheet:e,editable:t,scopeRef:n,elementRef:r,children:a})=>{let s=i.ot(),c=Fl(),l=i.Ct(),f=i.q(),p=eu(),m=(0,u.useMemo)(()=>({serializer:{parse:t=>t?e?.getStyles().parseColor(t)??null:null,stringify:e=>e?e.toString():``}}),[e]),[h,g]=i.Gt(`sheet.lastFillColor`,e?.getStyles().parseColor(o.Gt.Scheme.Bg2),m),[_,v]=i.Gt(`sheet.lastFontColor`,e?.getStyles().parseColor(e?.getStyles().getNormal().getFont().getColor()),m),[y,b]=i.Gt(`sheet.lastBorder`,null),x=(0,u.useRef)(h);x.current=h;let S=(0,u.useRef)(_);S.current=_;let C=(0,u.useRef)(y);C.current=y;let w=(0,u.useMemo)(()=>({getLastFillColor:()=>x.current,setLastFillColor:g,getLastFontColor:()=>S.current,setLastFontColor:v,getLastBorder:()=>C.current,setLastBorder:b}),[g,v,b]);return(0,d.jsx)(Ff,{spec:(0,u.useMemo)(()=>({scopeName:`sheet`,contributor:If,data:{sheet:e,editable:t,notifier:s,manager:p??void 0,activateTaskPane:(e,t)=>c.activate(e,t),taskPaneArea:c,editModeHandler:l,globalClipboard:f,pickerMemory:w}}),[e,t,s,p,c,l,f,w]),scopeRef:n,elementRef:r,children:a})};Rf.displayName=`SheetCommandProviderInner`;var zf=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{sheet:r,className:s,style:c=i.kt.EmptyCssProperties,ref:l,colorScheme:f,gridColorScheme:p,onSheetContextMenu:m,onFillMenu:h,showColumnHeaders:g,propsColumnHeader:_,showRowHeaders:v,propsRowHeader:y,showScrollbars:b=!0,showCellErrors:x=!0,showCircularReferences:S=!0,propsScrollPane:C,viewport:w,onViewportChange:T,layers:E,renderMovable:D,viewportComponent:O,onFirstRender:k,editable:A,onFocus:j,onBlur:M,onShowTooltip:N,onCloseTooltip:P,propsGrid:F,propsCellRender:I,...L}=e;if((0,u.useEffect)(()=>{o.a._validate(!0)},[]),!r)throw Error(`ISheet must be provided.`);let[R,z]=(0,u.useReducer)(e=>e+1,0),[,B]=(0,u.useReducer)(e=>e+1,0),V=(0,u.useRef)(null),H=i.X(N,[N]),U=i.X(P,[P]),W=(0,u.useRef)(null),G=(0,u.useRef)(null);(0,u.useMemo)(()=>{G.current!==r&&(W.current=r?r.getId():null),G.current=r},[r]);let K=ca(p)===`dark`,q=(()=>{let[e]=i.Gt(sa.Mode,null),{themeMode:t}=i.Tt({mode:e??void 0});return t})();$i();let J=(0,u.useId)(),ee=(0,u.useMemo)(()=>i.Rt(`sheet`,J),[J]),te=(0,u.useMemo)(()=>ji({scope:`.${ee}`}),[ee]),ne=(0,u.useMemo)(()=>ra(`sxl-defaults`,`.${ee}`),[ee]),re=r.getStyles(),ie=re.getTheme(),ae=re.getDefaultFontSize(),oe=(0,u.useMemo)(()=>((e,t=11,n=`sxl-defaults`,r)=>i.jt({app:{light:oa(e,t,!1),dark:oa(e,t,!0)},layer:n,scope:r}))(ie,ae,`sxl-defaults`,`.${ee}`),[ie,ae,ee]),se=i.Ct(),ce=(0,u.useCallback)(e=>{},[]),[le,ue]=(0,u.useState)(null),Z=(0,u.useRef)(null),de=(0,u.useCallback)(e=>{e&&(ue(e),Z.current=e)},[]),[Q,fe]=(0,u.useState)(()=>r?.getView()),me=(Q?.getZoomScale()??100)/100,he=g??Q?.isShowColumnHeaders(),ge=v??Q?.isShowRowHeaders(),[ve,ye]=(0,u.useState)({width:0,height:0}),be=ve.width,xe=ve.height,Se=(0,u.useMemo)(()=>{let e=Gf,t=Wf,n=r?.getStyles().getNormal().getFont();if(ve.width>0&&ve.height>0){let r=n?.toCSS()?.fontFamily??`Calibri`,i=n?.getSize()??8.25,a=o._.getSharedMeasurer()(``+ve.height,Math.ceil(i*o._.getDeviceScale()),r);e=a.width??e,t=(a.ascent??a.lineHeight)+(a.descent??0)}return{width:Math.round(e+5),height:Math.round(t+3)}},[be,xe,r]),Ce=ge?me*Se.width:1,we=he?me*Se.height:1,Te=(r?.getColumnHeaders().getDefaultSize()??Se.width)+Ce+1,Ee=(r?.getRowHeaders().getDefaultSize()??Se.height)+we+1,De=(0,u.useRef)(new Map),Oe=(0,u.useRef)(null),ke=(0,u.useMemo)(()=>({getColOffset:e=>r.getColumnHeaders().getOffset(e),getColIndex:e=>r.getColumnHeaders().getIndex(e),getRowOffset:e=>r.getRowHeaders().getOffset(e),getRowIndex:e=>r.getRowHeaders().getIndex(e)}),[r]),[Ae,je]=(0,u.useState)(!1),Me=Xa(),Ne=(0,u.useMemo)(()=>eo(r,{referenceMode:Me}),[r.getWorkbook()??r,Me]),Pe=A??Ne,Fe=i.ot();(0,u.useEffect)(()=>Pe.subscribeCommitError(e=>{Fe?.showError?.(e instanceof Error?e:String(e))}),[Pe,Fe]),(0,u.useEffect)(()=>{if(!Pe)return;let e=Pe.getSession();return Pe.subscribe(()=>{let t=e;if(e=Pe.getSession(),!t||e||!t.getActiveEditorId()?.startsWith(`inline:`))return;let n=Z.current;n?.contains(document.activeElement)&&n.focus()})},[Pe]);let Ie=i.in(Pe,e=>e.getSession())?.getCoords()??null,[Le,Re]=(0,u.useState)(),ze=(0,u.useRef)(null),Be=i.X(()=>{if(ze.current?.(),ze.current=null,!Le||!r)return;let e=W.current;if(e&&e===r.getId()||r.isDeleted())return;let t=r.getRangeAtBounds({x:Le.left,y:Le.top,width:Le.width,height:Le.height});ze.current=t.addListener(()=>{ft.current.clear()})},[r,Le]),Ve=i.X(e=>{if(Re(e),Be(),!r||W.current)return;let t=(r.getView().getZoomScale()??100)/100;r.getView().setTopLeft(e?{left:e.left/t,top:e.top/t}:null),T?.(e)},[r,T]),[He,Ue]=(0,u.useState)(()=>r?.getView().getTopLeft()),We=(0,u.useMemo)(()=>{let e=r?.getView().getTopLeft();return new i.wt({topLeft:{left:(e?.left??0)*me,top:(e?.top??0)*me},zoom:me})},[]),Ge=w??We;(0,u.useEffect)(()=>Ge.subscribe(()=>{Ge.isReady()&&Ge.isSettled()&&Ve(Ge.getMetrics())}),[Ge]),(0,u.useLayoutEffect)(()=>{Ge.setZoom(me)},[Ge,me]),(0,u.useLayoutEffect)(()=>{He?.left!=null&&Ge.setTarget(He.left*me,Ge.getTarget().top)},[Ge,He?.left,me]),(0,u.useLayoutEffect)(()=>{He?.top!=null&&Ge.setTarget(Ge.getTarget().left,He.top*me)},[Ge,He?.top,me]);let Ke=(0,u.useRef)(r?.getId()??null);(0,u.useLayoutEffect)(()=>{let e=r?.getId();if(Ke.current===e)return;Ke.current=e;let t=r?.getView().getTopLeft(),n=(r?.getView().getZoomScale()??100)/100;Ge.setTarget((t?.left??0)*n,(t?.top??0)*n)},[Ge,r]);let qe=i.X(e=>{let t=n.d.cellToRange(e);if(W.current||r.isDeleted())return t;let i=r.getRange(t,{ignoreHidden:!0}).getMerges();return i.length===0?t:i[0]},[r]),Je=e=>{let t=e?.coords?.colIndex??0,r=e?.coords?.rowIndex??0;if(!e||t===0&&r===0)return null;let i={};return t>0&&(i[n.A.Left]={index:t,offset:e.topLeft?.left??0}),r>0&&(i[n.A.Top]={index:r,offset:e.topLeft?.top??0}),i},[Ye,Xe]=(0,u.useState)(()=>Je(r.getView().getFreezePanes())),Ze=$s(r),Qe=i.X(e=>{let t=e?.cell??Pe.getAnchor().getCoords();if(!t)return;let n=()=>Pe.startEdit(t,{mode:e?.editMode?`edit`:`enter`,dirty:e?.text??void 0,initialSelection:e?.initialSelection??null,autoFocus:!1!==e?.autoFocus});n()||Ze(t,()=>{n()})},[Pe]),$e=i.X(()=>Le,[Le]),[et,tt]=(0,u.useState)(Q?.getMovableSelection().length>0),nt=Ie!==null||et,rt=(0,u.useMemo)(()=>{let e=se.getMode();return e?.cursor?e.cursor:null},[null,se]);Ni(r?.getView(),{onFreezePaneChange:()=>{Xe(Je(r.getView().getFreezePanes()))},onTopLeftChange:()=>{Ue(r.getView().getTopLeft())},onZoomScaleChange:()=>{B()},onMovableSelectionChange:()=>{tt(r.getView().getMovableSelection().length>0)}}),Ni(r,{onViewChange(){fe(r.getView())},onLayoutChange:()=>{let e=r.getEntireRange();ye({height:e.getRowCount(),width:e.getColumnCount()}),at()},onStyleChange:()=>{at()},onMovablesChange:()=>{},onTablesChange:()=>{at()},onInvalidated:()=>{at()}}),Ni(r,{onRequestScrollIntoView:async(e,t)=>{if(!t)return!1;let n={colIndex:t?.coords?.colStart,rowIndex:t?.coords?.rowStart};return await Z.current?.scrollCellCoordsIntoView(n,t?.scroll),!0},onRequestFocus:()=>n.b.whenFocus(it.current),onRequestViewport:async()=>{let e=$e();return e?{x:e.left,y:e.top,width:e.width,height:e.height}:null}},Hf);let it=i.st(t,()=>{let e=e=>{r?.getView()&&r.getView().selectMovables([]),Oe.current=null,Z.current?.focus(e)},t=async(e=null)=>{if(e||=r?.getView().getMovableSelection()[0],!e)return!1;let t=e.getRange().getCoords();if(!t)return!1;let n=Z.current?.getPaneFromCell({colIndex:t.colStart,rowIndex:t.rowStart});if(!n)return!1;let i=n.getAnchor();r?.getView().getMovableSelection().indexOf(e)===-1&&r?.getView().selectMovables([e]);let a=De.current?.get(i);return a?.current?(await a.current.focusMovable(e),!0):(Oe.current={movable:e,anchor:i},!0)};return{getGridSurface:()=>Z.current,getRowHeaderElement:()=>ht.current,getColumnHeaderElement:()=>_t.current,rowHeaderHeight:()=>we,colHeaderWidth:()=>Ce,startEdit:Qe,submitEdit:()=>{Pe.commit()},cancelEdit:()=>{Pe.cancel()},isEditing:Ie!==null,focus:n=>{let i=Pe.getSession(),a=i?.getCoords().scope;(!i||a&&a!==r.getName())&&(r?.getView().getMovableSelection().length>0?t():e(n))},focusSheet:e,focusMovable:t,contains:e=>Z.current?.contains?.(e)??!1,invalidate:at,isSheetElement:()=>!0,getSheet:()=>r,onWheelScroll:lt}},[r,Pe,Ie]),at=(0,u.useCallback)(()=>{W.current||(ft.current.clear(),Z.current?.invalidate(),z?.())},[]),ot=(0,u.useMemo)(()=>O?(0,d.jsx)(`div`,{className:$(`viewport-overlay`,`_viewport-overlay_3nny_6`),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`},children:O}):(0,d.jsx)(d.Fragment,{}),[O]),st=null;he&&ge&&(st=(0,d.jsx)(Of,{width:Ce,height:we,sheet:r,colorScheme:f,onMouseDown:e=>{e.nativeEvent.which===i.At.Right?m?.({originalEvent:e,clientX:e.clientX,clientY:e.clientY,rowIndex:-1,colIndex:-1}):Z.current?.focus()}}));let ct=(0,u.useRef)(null),lt=i.X(e=>{if(e.shiftKey||!e.ctrlKey&&!e.metaKey)return;let{deltaY:t}=e,n=t>0?`sheetZoomOut`:t<0?`sheetZoomIn`:null;if(n){let e=ct.current;e?.resolve(n,e)?.execute()}return t===0},[]);(0,u.useEffect)(()=>{fe(r.getView()),Xe(Je(r.getView().getFreezePanes())),ft.current.clear(),z()},[le,r?.getView()]);let ut=(0,u.useCallback)((e,t)=>r.getRowHeaders().hiddenHeadersAt(e,t),[r]),dt=(0,u.useCallback)((e,t)=>r.getColumnHeaders().hiddenHeadersAt(e,t),[r]),ft=(0,u.useRef)(new Map),pt=i.X((e,t)=>{if(W.current)return[];let n=ft.current,i=t??e.getVisibleRange();if(!i)return[];let o=`${i.rowStart}:${i.colStart}:${i.rowEnd}:${i.colEnd}`,s=n.get(o);if(s)return s;let c=[];if(r.getRange(i).forEach((e,t)=>{let n,r=t.getCoords(),i=t.getCell();(e=>{if(e.isEmpty())return!1;let t=e.getSpans();if(t.width>1||t.height>1||e.getStyle().hasVisibleStyling()||Q.isShowFormulas()&&e.getFormula()!==null)return!0;let n=e.getValue();return n!==null&&!(!Q.isShowZeros()&&n===0&&e.getType()===a.t.Number)})(i)&&(Q.isShowFormulas()||(n=i.getExtrusions()??void 0),c.push({cell:r,value:i,range:n}))},Uf),n.set(o,c),n.size>12){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return c},[r,Q.isShowZeros(),Q.isShowFormulas()]),mt=(0,u.useMemo)(()=>({style:{boxShadow:`0.5px 0.5px 0px 0px var(--sxl-color-base-100)`},propsPath:{stroke:`var(--sxl-color-base-content)`}}),[]),ht=(0,u.useRef)(null),gt=(0,u.useMemo)(()=>(0,d.jsx)(Df,{ref:ht,tabIndex:-1,freezeStart:Ye?.[n.A.Top],oppositeSize:Ce,sheetHeader:r.getRowHeaders(),colorScheme:f,propsCellRender:I,verticalPadding:Math.max(0,Math.floor(r.getStyles().getNormal().getFont().getSize()/10)),viewport:Ge,onSheetContextMenu:m,onFocus:()=>{Z.current?.focus()},style:{position:`relative`,flex:`0`,gridColumn:`1 / 2`,gridRow:`2 / 3`,zIndex:1}}),[Ce,we,r,I,Ge,Ye?.[n.A.Top],m,y,le]),_t=(0,u.useRef)(null),vt=(0,u.useMemo)(()=>(0,d.jsx)(Df,{ref:_t,tabIndex:-1,freezeStart:Ye?.[n.A.Left],oppositeSize:we,sheetHeader:r.getColumnHeaders(),colorScheme:f,propsCellRender:I,viewport:Ge,onSheetContextMenu:m,onFocus:()=>{Z.current?.focus()},style:{position:`relative`,display:`flex`,gridColumn:`2 / 3`,gridRow:`1 / 2`,zIndex:1}}),[we,r,I,Ge,Ye?.[n.A.Left],m,_,le]),yt=(0,u.useMemo)(()=>{let e=r.getId();return[(0,d.jsx)(df,{sheet:r,onSheetContextMenu:m},`context-menu-[${e}]`),(0,d.jsx)(hl,{sheet:r},`background-[${e}]`),(0,d.jsx)(fl,{sheet:r,sheetView:Q},`gridlines-[${e}]`),(0,d.jsx)(Fc,{getVisibleCells:pt,sheet:r},`fills-[${e}]`),(0,d.jsx)(Md,{sheet:r},`conditional-bars-[${e}]`),(0,d.jsx)(ll,{sheet:r,sheetView:Q,propsCellRender:I,editable:Pe},`cells-[${e}]`),(0,d.jsx)(cl,{getVisibleCells:pt,sheet:r},`cell-borders-[${e}]`),(0,d.jsx)(Pd,{sheet:r},`conditional-icons-[${e}]`),(0,d.jsx)(Uu,{sheet:r},`spill-[${e}]`),(0,d.jsx)(Jd,{sheet:r,sheetView:Q},`locked-hatch-[${e}]`),S?(0,d.jsx)(Wd,{sheet:r},`circular-[${e}]`):null,(0,d.jsx)(uc,{sheet:r,onShowTooltip:H,onCloseTooltip:U,onFillMenu:h},`selection-[${e}]`),(0,d.jsx)(Ql,{sheet:r},`table-[${e}]`),(0,d.jsx)(Hu,{sheet:r},`table-commands-[${e}]`),(0,d.jsx)(bc,{sheet:r,sheetView:Q,className:`references`},`ref-picker-[${e}]`),(0,d.jsx)(Tf,{sheet:r},`clipboard-[${e}]`),(0,d.jsx)(ul,{sheet:r,onColumnButtonMouseDown:I?.onColumnButtonMouseDown,propsColumnButton:I?.propsColumnButton,renderColumnButton:I?.renderColumnButton},`column-buttons-[${e}]`),(0,d.jsx)(Ld,{sheet:r},`validation-[${e}]`),(0,d.jsx)(Jc,{sheet:r},`validation-prompt-[${e}]`),(0,d.jsx)(Vd,{sheet:r,editable:Pe},`validation-dropdown-[${e}]`),(0,d.jsx)(Al,{sheet:r,renderMovable:D},`movable-[${e}]`),(0,d.jsx)(pe,{className:`grid-border`,children:(0,d.jsx)(_e,{fill:!0,className:`grid-border-box`,...i.qt(`app`,q),style:qf})},`grid-border-[${e}]`),(0,d.jsx)(rc,{sheet:r,editable:Pe,darkMode:K,onEditRejected:Ze},`editor-[${e}]`),x?(0,d.jsx)(sl,{className:`errors`,sheet:r},`cell-errors-[${e}]`):null,(0,d.jsx)(sf,{sheet:r},`resize-indicator-[${e}]`),E]},[r,re,D,m,h,E,Pe,x,S,Q,K,q,pt,I,Ze]),bt=(0,u.useCallback)((e,t)=>(0,d.jsx)(_u,{pane:e,children:t}),[]),[xt,St]=(0,u.useState)(!1),Ct=(0,u.useMemo)(()=>{let e=r.getStyles().getNormal(),t=e.getFont(),i=e.getFill();return(0,d.jsx)(X,{className:`sheetxl-sheet-primary`,wrapPane:bt,style:{...Vf,cursor:rt??null??`cell`,...i.toCSS(`adaptive`),...t.toCSS(`adaptive`,me),minWidth:Te,minHeight:Ee},ref:de,...F,onFirstRender:e=>{St(!0),F?.onFirstRender?.(e)},freezeLeft:Ye?.[n.A.Left],propsFreezeLeft:mt,freezeTop:Ye?.[n.A.Top],propsFreezeTop:mt,columnCount:ve.width,rowCount:ve.height,metrics:ke,getRangeFromCell:qe,hiddenRowsAt:ut,hiddenColumnsAt:dt,viewport:Ge,children:yt},`grid-main`)},[be,xe,rt,null,Te,Ee,R,yt]);(0,u.useEffect)(()=>{W.current||(ft.current.clear(),z())},[Ye,me,He?.left,He?.top,F,Te,Ee,rt,yt,null]);let wt=Bf;b||(wt={...wt,...c});let Tt=K?`dark`:`light`,Et=i.X(e=>{let{style:t,...n}=e;return(0,d.jsx)(Ef,{...n,style:{...t,paddingLeft:`4px`,paddingRight:`4px`},sheet:r})},[r]),Dt=(0,d.jsxs)(`div`,{...i.qt(`grid`,Tt),style:{gridColumn:`2 / 3`,gridRow:`2 / 3`,overflow:`hidden`,position:`relative`},ref:V,children:[Ct,ot,(0,d.jsx)(mf,{style:{position:`absolute`,right:24,bottom:4},colorLicensee:`var(--sxl-color-primary)`,colorCredits:`var(--sxl-color-base-content)`})]}),Ot=(0,d.jsxs)(`div`,{className:ee,style:wt,onTouchStart:()=>{jt()},onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||(je(!0),j?.(e))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(je(!1),M?.(e))},ref:da([it,ce]),...L,children:[(0,d.jsx)(`style`,{children:te}),(0,d.jsx)(`style`,{children:ne}),(0,d.jsx)(`style`,{children:oe}),(0,d.jsx)(`div`,{className:$(s,`sheetxl-sheet`,`_sheetxl-sheet_3nny_5`),ref:l,...i.qt(`grid`,Tt),style:{position:`absolute`,width:`100%`,height:`100%`,display:`grid`,gridTemplateColumns:`auto 1fr`,gridTemplateRows:`auto 1fr`,flex:`1 1 100%`},children:(0,d.jsxs)(Y,{children:[st,vt,gt,Dt]})})]});b&&(Ot=(0,d.jsx)(i.Lt,{style:{flex:`1 1 100%`,width:`100%`,height:`100%`,overflow:`hidden`,background:`var(--sxl-color-base-100)`,minHeight:2*Se.height,minWidth:2*Se.width,...c},viewport:Ge,disableTouch:nt,onWheelScroll:lt,renderScrollbarHorizontal:Et,renderScrollbarVertical:Et,...C,children:Ot})),(0,u.useEffect)(()=>{W.current=null,ft.current.clear(),Be(),z?.(),Ae&&it.current?.focus()},[r]);let[kt,At]=(0,u.useState)(!1),jt=i.X(()=>{kt||At(!0)},[kt]);return(0,u.useEffect)(()=>{if(xt)return typeof k==`function`&&k(),i.kt.detectIt().primaryInput===`touch`&&jt(),()=>{}},[k,xt,kt]),(0,d.jsx)(Lf,{sheet:r,editable:A,scopeRef:ct,elementRef:it,children:(0,d.jsx)(i.lt,{themeScopeClass:ee,themeSurface:`app`,themeMode:f,children:(0,d.jsx)(zi,{sheet:r,children:Ot})})})}));zf.displayName=`SheetElement`;var Bf=Object.freeze({flex:`1 1 100%`,width:`100%`,height:`100%`,minWidth:0,minHeight:0,display:`flex`,alignContent:`stretch`,position:`relative`}),Vf={position:`absolute`,top:0,left:0,bottom:0,right:0},Hf={ignoreModelChange:!0},Uf={ignoreHidden:!0,includeMergeOverflow:!0,reuseContext:!0},Wf=20,Gf=40,Kf=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,qf={pointerEvents:`none`,borderTop:Kf,borderLeft:Kf,borderRight:Kf,borderBottom:`none`},Jf=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,disabled:r,style:a,shape:o,isDragging:s,onHide:c,onShow:l,...f}=e,p=(0,u.useMemo)(()=>o?.toJSON()??null,[o]),m=p?.type===`grpSp`,h=m||p?.type===`cxnSp`?void 0:o.getName(),g=Z(),_=i.st(t,()=>({isShapeEditor:()=>!0}),[]),[v,{height:y,width:b}]=_a();if(!o.isDeleted()&&!m)return(0,d.jsx)(`div`,{className:`shape-editor`,...f,ref:da([_,v]),style:{width:`100%`,height:`100%`,border:`var(--sxl-color-neutral, grey) solid 1px`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:g.getZoom(),display:`flex`,position:`relative`,filter:r?`blur(1px)`:void 0,boxShadow:s?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0,overflow:`hidden`,wordBreak:`break-word`,...a},children:h})}));Jf.displayName=`ShapeEditor`;var Yf={themed:`_themed_f2asj_9`,small:`_small_f2asj_36`,medium:`_medium_f2asj_37`,large:`_large_f2asj_38`},Xf=(0,u.memo)(e=>{let{size:t=`medium`,className:n,children:r,...i}=e;return(0,d.jsx)(`span`,{className:$(`icon`,Yf.themed,Yf[t],n),...i,children:r})});Xf.displayName=`ThemedChartIcon`;var Zf=`column`,Qf=`columnStacked`,$f=`columnStackedPercent`,ep=`line`,tp=`lineStacked`,np=`lineStackedPercent`,rp=`lineMarkers`,ip=`lineStackedMarkers`,ap=`lineStackedPercentMarkers`,op=`pie`,sp=`pieDoughnut`,cp=`bar`,lp=`barStacked`,up=`barStackedPercent`,dp=`area`,fp=`areaStacked`,pp=`areaStackedPercent`,mp=`scatterMarkers`,hp=`scatterLinesMarkersSmooth`,gp=`scatterLinesMarkers`,_p=`scatterLinesSmooth`,vp=`scatterLines`,yp=`bubble`,bp=`bubble3D`,xp=new Map;xp.set(Zf,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),description:n.q(`chart.type.column`),template:{types:{0:{type:`column`}}}}),xp.set(Qf,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1195 h 512 v 1195 h 256 v -1621 h 512 v 1621 m -810 -512 h -427 v 512 h 427 m 768 -768 h -427 v 768 h 427 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -554 h 469 m 768 554 h -469 v -810 h 469 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -555 h 512 v 555 h 256 v -811 h 512 v 811 m -469 0 h 427 v -768 h -427 m -768 768 h 427 v -512 h -427 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1387 h -469 v -640 h 469 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 341 725 h 512 v 683 h -512 m 43 -640 v 597 h 427 v -597 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 1131 h -469 v -811 h 469 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 853 h -512 m 43 -811 v 768 h 427 v -768 z`})]}),description:n.q(`chart.type.columnStacked`),template:{types:{0:{type:`column`,grouping:`stacked`}}}}),xp.set($f,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -1621 h 512 v 1621 h 256 v -1621 h 512 v 1621 m -810 -384 h -427 v 384 h 427 m 768 -1024 h -427 v 1024 h 427 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 832 1941 h -469 v -426 h 469 m 768 426 h -469 v -1066 h 469 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 213 v -427 h 512 v 427 h 256 v -1067 h 512 v 1067 m -469 0 h 427 v -1024 h -427 m -768 1024 h 427 v -384 h -427 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 832 1515 h -469 v -1195 h 469 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 341 299 h 512 v 1237 h -512 m 43 -1195 v 1152 h 427 v -1152 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 1600 875 h -469 v -555 h 469 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1109 299 h 512 v 597 h -512 m 43 -555 v 512 h 427 v -512 z`})]}),description:n.q(`chart.type.columnStackedPercent`),template:{types:{0:{type:`column`,grouping:`percentStacked`}}}}),xp.set(ep,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 197 144 l 402 -402 l 361 360 l 263 -301 l 32 28 l -265 303 l 264 265 l -30 30 l -262 -263 l -317 362 l -444 -326 l -775 776 v 268 m 806 -1074 l 407 299 l 292 -335 l -332 -332 m -1173 832 v 281 l 740 -740 l -162 -119 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 122 1658 l -30 -30 l 1209 -1210 l 655 655 l -30 30 l -625 -625 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1165 l 574 -574 l 639 469 l 584 -668 l 32 28 l -610 697 l -641 -470 l -578 578 v 610 z`})]}),description:n.q(`chart.type.line`),template:{types:{0:{type:`line`}}}}),xp.set(tp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1037 l 571 -570 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 l -581 582 v 452 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 121 1189 l -29 -31 l 607 -606 l 535 259 l 651 -550 l 27 33 l -669 565 l -534 -259 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),description:n.q(`chart.type.lineStacked`),template:{types:{0:{type:`line`,grouping:`stacked`}}}}),xp.set(np,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1749 v 43 h -1749 v 1335 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1877 299 h -1770 v -43 h 1770 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1549 l 573 -574 l 576 424 l 563 -751 l 32 27 l -587 781 l -578 -425 l -579 578 v 226 z`})]}),description:n.q(`chart.type.lineStackedPercent`),template:{types:{0:{type:`line`,grouping:`percentStacked`}}}}),xp.set(rp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 99 73 l 175 -190 h -18 v -170 h 170 v 140 l 233 233 l 280 -373 v -171 h 170 v 171 h -118 l -302 402 l 194 195 h 98 v 171 h -171 v -171 h 13 l -160 -160 l -109 144 v 144 h -170 v -104 l -279 -205 l -703 759 v 147 h -85 m 1015 -1152 l -199 215 l 251 184 v -15 h 139 l 110 -147 l -237 -237 m -1079 726 v 256 h 48 l 705 -761 l -70 -52 v 2 h -171 v -12 l -427 426 v 141 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -640 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 416 -554 v -171 h 170 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1694 1024 h 98 v 171 h -171 v -171 h 13 l -427 -427 h -64 l -930 1005 v 147 h -170 v -170 h 133 l 909 -982 h -18 v -170 h 170 v 140 z`})]}),description:n.q(`chart.type.lineMarkers`),template:{types:{0:{type:`line`,scatterStyle:`lineMarker`}}}}),xp.set(ip,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -256 h -42 v -171 h 42 v -1067 h 43 v 1067 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 h -118 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -85 v 256 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1802 427 l -437 581 v 144 h -170 v -104 l -384 -282 v 2 h -171 v -12 l -427 426 v 141 h -170 v -171 h 140 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -554 v -171 h 171 v 171 z`})]}),description:n.q(`chart.type.lineStackedMarkers`),template:{types:{0:{type:`line`,scatterStyle:`lineMarker`,grouping:`stacked`}}}}),xp.set(ap,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1195 h -42 v -171 h 42 v -128 h 43 v 128 h 85 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 h 171 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -85 v 1195 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -214 h -42 v -170 h 42 v -1494 h 43 v 1494 h 55 l 457 -457 v -98 h 171 v 117 l 384 282 v -15 h 139 l 415 -555 v -170 h 171 v 170 h -118 l -437 582 v 144 h -170 v -104 l -384 -283 v 3 h -171 v -13 l -427 427 v 140 h -85 v 171 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1920 213 v 171 h -171 v -85 h -384 v 85 h -170 v -85 h -427 v 85 h -171 v -85 h -384 v 85 h -170 v -171 h 170 v 43 h 384 v -43 h 171 v 43 h 427 v -43 h 170 v 43 h 384 v -43 z`})]}),description:n.q(`chart.type.lineStackedPercentMarkers`),template:{types:{0:{type:`line`,scatterStyle:`lineMarker`,grouping:`percentStacked`}}}}),xp.set(op,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 130 -33 250 q -34 119 -95 224 q -62 104 -147 190 q -86 86 -190 147 q -105 61 -225 95 q -120 33 -249 33 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 32 -243 q 31 -117 89 -219 q 58 -102 140 -187 q 82 -86 182 -148 q 100 -62 217 -99 q 116 -37 243 -43 m -862 939 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 173 0 325 -61 q 151 -61 272 -167 l -638 -638 v -924 q -121 6 -230 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -55 97 -85 209 q -31 111 -31 231 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1941 1024 q 0 127 -32 244 q -33 117 -93 219 q -60 102 -143 186 q -84 83 -186 143 q -102 60 -219 93 q -117 32 -244 32 q -127 0 -244 -32 q -117 -33 -219 -93 q -102 -60 -185 -143 q -84 -84 -144 -186 q -60 -102 -92 -219 q -33 -117 -33 -244 q 0 -127 33 -244 q 32 -117 92 -219 q 60 -102 144 -185 q 83 -84 185 -144 q 102 -60 219 -92 q 117 -33 244 -33 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1666 1709 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -97 59 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 238 q 32 114 91 214 q 58 99 140 181 q 82 82 182 141 q 99 58 214 90 q 114 32 237 32 q 178 0 334 -65 q 156 -65 277 -177 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 1024 107 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -647 -648 v -937 q 5 0 11 0 q 5 -1 10 -1 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -62 187 q -41 89 -99 168 q -58 78 -130 142 q -9 -8 -15 -15 q -6 -6 -10 -10 q -5 -5 -5 -6 l -639 -638 v -969 m 670 1578 q 62 -61 112 -133 q 50 -72 85 -153 q 35 -82 54 -170 q 18 -89 18 -183 q 0 -123 -32 -237 q -32 -115 -90 -214 q -59 -100 -141 -182 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -238 -32 v 908 z`})]}),description:n.q(`chart.type.pie`),template:{types:{0:{type:`pie`}}}}),xp.set(sp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 187 q -41 89 -98 168 q -58 78 -130 142 q -125 112 -284 176 q -160 64 -342 64 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -126 33 -244 q 33 -118 93 -221 q 59 -104 144 -190 q 84 -86 187 -148 q 102 -62 221 -97 q 118 -36 247 -39 m 307 1305 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 q -90 8 -167 48 q -78 39 -135 102 q -58 62 -91 144 q -33 81 -33 173 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 84 0 159 -27 q 74 -28 134 -76 m -293 530 q 173 0 325 -60 q 151 -61 270 -168 l -272 -272 q -66 54 -148 85 q -82 31 -175 31 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -100 37 -189 q 36 -90 100 -158 q 63 -69 149 -112 q 85 -43 183 -51 v -384 q -119 6 -228 41 q -109 35 -204 94 q -95 59 -172 140 q -78 81 -133 179 q -56 97 -86 209 q -30 111 -30 231 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1658 1692 q -125 119 -286 187 q -162 68 -348 68 q -127 0 -244 -33 q -118 -33 -220 -93 q -103 -60 -186 -143 q -84 -84 -144 -186 q -60 -103 -93 -220 q -33 -118 -33 -245 q 0 -125 32 -241 q 32 -116 90 -217 q 58 -101 140 -184 q 81 -84 181 -144 q 99 -61 214 -95 q 115 -35 239 -38 v 429 q -97 5 -181 45 q -85 40 -148 106 q -63 65 -99 152 q -36 86 -36 184 q 0 101 39 190 q 38 89 104 155 q 66 66 155 105 q 89 38 190 38 q 91 0 171 -30 q 80 -31 144 -85 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1364 1406 q -69 61 -155 96 q -86 34 -185 34 q -106 0 -199 -40 q -94 -40 -163 -109 q -70 -70 -110 -163 q -40 -94 -40 -200 q 0 -103 39 -194 q 38 -92 105 -161 q 66 -69 156 -110 q 89 -42 191 -46 v 42 q -94 4 -175 43 q -82 38 -142 101 q -61 63 -96 147 q -35 84 -35 178 q 0 97 37 183 q 37 85 101 149 q 63 63 149 100 q 85 37 182 37 q 90 0 169 -31 q 79 -31 141 -86 m 332 333 q -127 118 -291 186 q -164 68 -351 68 q -130 0 -249 -33 q -120 -34 -224 -95 q -105 -62 -191 -147 q -86 -86 -147 -190 q -61 -105 -94 -225 q -34 -120 -34 -249 q 0 -128 33 -246 q 32 -119 92 -222 q 59 -103 143 -188 q 84 -86 186 -147 q 102 -62 220 -97 q 117 -35 244 -38 v 43 q -121 3 -233 37 q -112 33 -209 92 q -98 58 -177 140 q -80 81 -137 180 q -57 98 -88 211 q -31 113 -31 235 q 0 124 32 239 q 32 114 91 214 q 58 99 140 181 q 81 81 181 140 q 99 58 214 90 q 114 32 238 32 q 179 0 335 -64 q 155 -65 276 -178 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 1515 1024 q 0 -102 -38 -191 q -39 -89 -106 -156 q -67 -67 -156 -105 q -89 -39 -191 -39 q -5 0 -10 1 q -6 0 -11 0 v -426 q 5 0 11 0 q 5 -1 10 -1 q 127 0 244 33 q 117 32 219 92 q 102 60 186 144 q 83 83 143 185 q 60 102 93 219 q 32 117 32 244 q 0 99 -20 193 q -21 93 -58 178 q -38 85 -92 160 q -54 75 -121 138 l -302 -301 q 77 -68 122 -162 q 45 -95 45 -206 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 1024 85 q 129 0 249 34 q 120 33 225 95 q 104 61 190 147 q 85 85 147 190 q 61 104 95 224 q 33 120 33 249 q 0 104 -22 202 q -22 98 -63 188 q -41 89 -98 168 q -58 78 -130 142 l -333 -334 q 81 -65 129 -159 q 47 -95 47 -207 q 0 -97 -37 -182 q -37 -86 -100 -149 q -64 -64 -149 -101 q -86 -37 -183 -37 q -11 0 -21 1 q -11 0 -22 1 v -471 q 11 0 22 0 q 10 -1 21 -1 m 627 1579 q 62 -61 112 -133 q 50 -73 85 -154 q 35 -81 54 -170 q 18 -89 18 -183 q 0 -124 -32 -238 q -32 -115 -90 -214 q -59 -100 -140 -181 q -82 -82 -181 -140 q -100 -59 -214 -91 q -115 -32 -239 -32 v 384 q 106 0 200 40 q 93 40 163 110 q 69 69 109 163 q 40 93 40 199 q 0 109 -42 204 q -42 94 -114 164 z`})]}),description:n.q(`chart.type.pieDoughnut`),template:{types:{0:{type:`pie`,holeSize:50}}}}),xp.set(cp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 171 h 1707 v 341 h -640 v 299 h -1067 v 171 h 811 v 298 h 512 v 342 h -1323 v 213 m 0 -1067 h 1024 v -256 h -1024 m 0 1067 h 1280 v -256 h -1280 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1429 1387 v 298 h -1322 v -298 m 1066 -811 v 299 h -1066 v -299 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 1813 277 v 299 h -1706 v -299 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 101 597 v -42 h 1691 v -256 h -1691 v -43 h 1734 v 341 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1088 v 299 h -810 v -299 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 896 1109 h -795 v -42 h 838 v 322 h -43 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 768 h 1024 v -256 h 43 v 299 h -1067 v 469 h 1323 v 342 h -1323 v 213 m 0 -512 v 256 h 1280 v -256 z`})]}),description:n.q(`chart.type.bar`),template:{types:{0:{type:`bar`}}}}),xp.set(lp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1237 v 512 h -1237 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 555 v -427 h -555 m 0 1195 h 768 v -427 h -768 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 597 v 469 m -597 768 v -469 h 810 v 469 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 597 v 512 h -597 v 256 h 811 v 512 h -811 v 299 m 0 -768 v 427 h 768 v -427 m -768 -768 v 427 h 555 v -427 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 704 832 v -469 h 640 v 469 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 1365 341 v 512 h -682 v -512 m 640 43 h -598 v 427 h 598 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 917 1600 v -469 h 811 v 469 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -853 v -512 m 811 43 h -768 v 427 h 768 z`})]}),description:n.q(`chart.type.barStacked`),template:{types:{0:{type:`bar`,grouping:`stacked`}}}}),xp.set(up,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 1621 v 512 h -1621 v 256 h 1621 v 512 h -1621 v 299 m 0 -1109 h 384 v -427 h -384 m 0 1195 h 1024 v -427 h -1024 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 107 832 v -469 h 426 v 469 m -426 768 v -469 h 1066 v 469 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 256 h 427 v 512 h -427 v 256 h 1067 v 512 h -1067 v 299 m 0 -768 v 427 h 1024 v -427 m -1024 -768 v 427 h 384 v -427 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 533 832 v -469 h 1195 v 469 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 1749 341 v 512 h -1237 v -512 m 1195 43 h -1152 v 427 h 1152 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 1173 1600 v -469 h 555 v 469 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1749 1109 v 512 h -597 v -512 m 555 43 h -512 v 427 h 512 z`})]}),description:n.q(`chart.type.barStackedPercent`),template:{types:{0:{type:`bar`,grouping:`percentStacked`}}}}),xp.set(dp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 253 256 l 544 -345 l 74 -91 l 644 466 l 277 -464 m 0 718 l -913 -662 l -476 591 l -403 -408 v 785 h 1792 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 530 1511 l 473 -588 l 914 656 l 24 53 v 304 h -1834 l 2 -864 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 1939 923 v 658 l -288 -192 m -1272 -40 l 525 -312 l -374 474 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 361 1342 l 572 -362 l 22 36 l -571 362 m 1248 1 l 287 -483 l 37 22 l -287 482 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 896 v 1067 h -1878 v -1878 h 43 v 989 l 400 405 l 471 -585 l 921 667 v -665 m 0 1024 v -306 l -913 -662 l -476 591 l -403 -408 v 785 z`})]}),description:n.q(`chart.type.area`),template:{types:{0:{type:`area`}}}}),xp.set(fp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 640 v 926 l -641 -554 l -618 703 l -576 -575 v 780 h 1835 v 43 h -1878 v -1878 h 43 v 353 l 576 577 l 661 -704 l 276 329 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1963 1941 h -1856 v -853 l 597 597 l 618 -704 l 641 555 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 1963 1536 l -641 -555 l -618 704 l -597 -597 v -640 l 597 597 l 661 -704 l 269 319 h 329 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 640 v 43 h -342 l -258 -310 l -659 702 l -597 -598 v -60 l 597 598 l 661 -704 l 276 329 m 322 866 v 60 l -641 -554 l -618 703 l -597 -597 v -62 l 597 599 l 618 -704 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),description:n.q(`chart.type.areaStacked`),template:{types:{0:{type:`area`,grouping:`stacked`}}}}),xp.set(pp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 1524 l -788 -746 l -576 662 l -428 -428 v 823 h 1792 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1941 1941 h -1834 v -1834 h 1834 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 85 v 1878 h -1878 v -1878 m 1835 43 h -1792 v 1792 h 1792 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 1941 107 v 1493 l -810 -768 l -576 661 l -448 -448 v -938 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 1963 1649 l -831 -786 l -576 662 l -471 -467 v -973 h 1878 m -43 1465 v -1422 h -1792 v 908 l 426 426 l 575 -661 z`})]}),description:n.q(`chart.type.areaStackedPercent`),template:{types:{0:{type:`area`,grouping:`percentStacked`}}}}),xp.set(mp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 m 768 384 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1195 1344 q 22 0 42 9 q 19 8 33 23 q 14 14 23 34 q 8 19 8 41 q 0 45 -30 76 q -31 30 -76 30 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -14 -23 -33 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 m -427 -341 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m 939 -512 q 45 0 76 31 q 30 30 30 75 q 0 22 -8 42 q -9 19 -23 34 q -14 14 -33 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 m -1323 -256 q 22 0 42 9 q 19 8 34 22 q 14 14 23 34 q 8 19 8 41 q 0 22 -8 42 q -9 19 -23 34 q -15 14 -34 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -14 34 -22 q 19 -9 41 -9 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 384 213 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 1323 42 q 26 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 7 33 7 m -939 298 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 m 0 214 q 18 0 34 -7 q 15 -7 27 -18 q 11 -12 18 -27 q 6 -16 6 -34 q 0 -35 -25 -60 q -25 -25 -60 -25 q -35 0 -60 25 q -25 25 -25 60 q 0 18 7 34 q 6 15 18 27 q 11 11 27 18 q 15 7 33 7 m 427 128 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m 0 213 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1579 -213 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 m -854 -982 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m -469 982 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 m 1024 -640 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 z`})]}),description:n.q(`chart.type.scatterMarkers`),template:{types:{0:{type:`scatter`,scatterStyle:`marker`}}}}),xp.set(hp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 l -7 2 q -26 93 -66 161 q -40 68 -88 116 q -48 47 -101 76 q -54 29 -108 44 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -115 -15 -221 -84 q -107 -69 -207 -190 q -36 91 -59 176 q -24 85 -38 152 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 15 -73 42 -167 q 26 -95 69 -195 q -48 -62 -94 -141 q -47 -80 -89 -168 q -43 -88 -80 -178 q -37 -91 -64 -176 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 19 59 48 135 q 29 75 67 158 q 37 82 84 167 q 47 85 103 163 q 33 -72 76 -141 q 42 -70 96 -131 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 5 0 9 1 q 3 0 7 0 q 1 -20 2 -40 q 0 -21 0 -43 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 q 18 113 27 215 q 8 102 8 193 q 0 25 0 48 q 0 23 -2 46 q 32 16 51 46 q 19 30 19 68 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 m -171 -1206 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 m -1408 86 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 354 -278 q 59 -80 92 -194 q -23 -4 -42 -15 q -19 -12 -33 -28 q -14 -17 -22 -38 q -8 -21 -8 -45 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -57 63 -101 136 q -44 73 -77 150 q 41 53 87 99 q 45 46 96 82 q 50 36 106 60 q 55 23 115 32 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1305 1497 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 m -890 -1072 q 0 23 -9 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -42 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 22 0 42 9 q 20 8 35 23 q 15 15 24 35 q 9 20 9 43 m 1317 -167 q 0 23 -8 43 q -9 20 -24 35 q -15 15 -35 24 q -20 8 -43 8 q -23 0 -43 -8 q -20 -9 -35 -24 q -15 -15 -23 -35 q -9 -20 -9 -43 q 0 -23 9 -43 q 8 -20 23 -35 q 15 -15 35 -23 q 20 -9 43 -9 q 23 0 43 9 q 20 8 35 23 q 15 15 24 35 q 8 20 8 43 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1689 365 q 18 112 27 213 q 8 101 8 193 q 0 183 -35 322 q -35 138 -106 234 q -29 38 -60 67 q -32 29 -65 51 q -34 21 -68 36 q -35 14 -68 24 q -2 24 -13 46 q -11 21 -28 37 q -17 15 -39 24 q -22 9 -47 9 q -45 0 -78 -26 q -34 -26 -45 -66 q -114 -15 -224 -87 q -110 -72 -211 -196 q -101 -125 -189 -299 q -89 -174 -160 -393 q -25 -2 -46 -12 q -22 -11 -37 -28 q -16 -17 -25 -39 q -9 -23 -9 -48 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 45 -26 79 q -27 33 -69 44 q 23 69 59 161 q 35 92 83 191 q 48 99 109 197 q 61 98 136 179 q 74 81 161 137 q 87 55 187 70 q 1 -25 12 -47 q 11 -22 28 -38 q 17 -16 40 -25 q 22 -10 48 -10 q 45 0 79 28 q 34 27 45 69 q 61 -19 120 -56 q 59 -37 110 -105 q 133 -178 133 -530 q 0 -174 -33 -390 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 35 -16 64 q -17 28 -44 45 m -1476 62 q 0 18 7 34 q 7 15 19 27 q 11 11 27 18 q 15 6 33 6 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -19 27 q -7 15 -7 33 m 982 1152 q 35 0 60 -25 q 25 -25 25 -61 q 0 -35 -25 -60 q -25 -25 -60 -25 q -18 0 -33 7 q -16 6 -27 18 q -12 11 -19 27 q -7 15 -7 33 q 0 18 7 34 q 7 15 19 27 q 11 12 27 19 q 15 6 33 6 m 341 -1323 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1664 1501 q 37 13 61 46 q 24 33 24 75 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 v -34 q 0 -140 -15 -248 q -16 -108 -42 -191 q -14 3 -28 3 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -29 13 -54 q 12 -26 32 -43 q -45 -61 -95 -94 q -51 -34 -93 -49 q -43 -15 -71 -17 q -29 -3 -31 -3 q -78 0 -144 16 q -67 15 -126 46 q 3 14 3 28 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -29 0 -55 -13 q -66 73 -115 161 q -49 87 -84 176 q -35 88 -58 172 q -24 83 -37 148 q 41 12 67 46 q 26 33 26 78 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -26 10 -48 q 9 -23 25 -40 q 16 -18 38 -28 q 22 -10 47 -12 q 14 -67 38 -152 q 23 -86 59 -177 q 36 -92 87 -182 q 50 -90 118 -167 q -38 -36 -38 -90 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 35 0 64 17 q 28 16 45 43 q 63 -32 133 -48 q 70 -17 154 -17 q 6 0 39 4 q 32 3 79 21 q 47 17 102 54 q 55 37 107 105 q 21 -9 45 -9 q 27 0 50 10 q 23 10 41 28 q 17 17 27 41 q 10 23 10 49 q 0 35 -16 63 q -17 28 -43 45 q 30 96 45 210 q 14 114 14 248 z`})]}),description:n.q(`chart.type.scatterLinesMarkersSmooth`),template:{types:{0:{type:`scatter`,scatterStyle:`smoothMarker`}}}}),xp.set(gp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 213 342 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 361 762 l 165 -282 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 78 89 l 449 -570 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -258 814 l 410 467 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 l 70 565 l -482 -549 l -46 145 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 53 -166 l -189 -214 l -295 375 l -69 -146 l -147 251 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 166 -283 l -375 -789 q -14 3 -28 3 m 982 1109 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1323 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 m -105 275 l -401 509 l 176 200 m -355 -301 l -187 301 l 52 129 l 258 -327 l -93 -106 q -15 3 -30 3 m -638 -683 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1771 296 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -35 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 m -1320 7 q 0 22 -8 42 q -9 19 -23 34 q -15 15 -34 24 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -35 -24 q -15 -15 -23 -34 q -9 -20 -9 -42 q 0 -22 9 -41 q 8 -20 23 -34 q 15 -15 35 -23 q 19 -9 41 -9 q 22 0 42 9 q 19 8 34 23 q 14 14 23 34 q 8 19 8 41 m 902 1232 q 0 23 -8 43 q -9 19 -23 34 q -15 14 -35 23 q -20 8 -42 8 q -22 0 -41 -8 q -20 -9 -34 -23 q -15 -15 -23 -34 q -9 -20 -9 -43 q 0 -22 9 -41 q 8 -20 23 -34 q 14 -15 34 -23 q 19 -9 41 -9 q 22 0 42 9 q 20 8 35 23 q 14 14 23 34 q 8 19 8 41 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1664 171 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 26 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -11 0 -20 -2 q -10 -2 -19 -5 l -319 1008 q 26 17 43 45 q 16 28 16 63 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -23 10 -50 10 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 15 0 29 3 l 293 -923 l -724 918 l -466 -982 q -14 3 -28 3 q -26 0 -49 -10 q -24 -10 -41 -27 q -18 -18 -28 -41 q -10 -24 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 63 q -17 28 -44 45 l 435 919 l 734 -932 q -20 -18 -31 -42 q -11 -25 -11 -53 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 m -1323 213 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 m 982 1152 q 0 -18 -7 -33 q -7 -16 -18 -27 q -12 -12 -27 -18 q -16 -7 -34 -7 q -35 0 -60 25 q -25 25 -25 60 q 0 35 25 60 q 25 25 60 25 q 18 0 34 -6 q 15 -7 27 -18 q 11 -12 18 -27 q 7 -16 7 -34 m 341 -1152 q 35 0 60 -25 q 25 -25 25 -60 q 0 -18 -6 -33 q -7 -16 -18 -27 q -12 -12 -27 -19 q -16 -7 -34 -7 q -18 0 -33 7 q -16 7 -27 19 q -12 11 -18 27 q -7 15 -7 33 q 0 35 25 60 q 25 25 60 25 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 128 1920 h 1835 v 43 h -1878 v -1878 h 43 m 1636 1182 l 70 565 l -825 -939 q -15 3 -30 3 l -360 615 q 29 17 47 46 q 17 29 17 64 q 0 27 -10 50 q -10 23 -27 41 q -18 17 -41 27 q -24 10 -50 10 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -26 10 -49 q 10 -24 28 -41 q 17 -18 40 -28 q 23 -10 50 -10 q 11 0 23 3 l 357 -609 q -36 -14 -59 -46 q -23 -32 -23 -73 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 41 -28 q 23 -10 49 -10 q 27 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 34 -16 62 q -16 28 -42 45 l 726 826 l -54 -422 q -5 1 -8 1 q -4 0 -8 0 q -27 0 -50 -10 q -23 -10 -40 -27 q -18 -18 -28 -41 q -10 -23 -10 -50 q 0 -27 10 -50 q 10 -23 28 -40 q 17 -18 40 -28 q 23 -10 50 -10 q 26 0 50 10 q 23 10 41 28 q 17 17 27 40 q 10 23 10 50 q 0 38 -19 69 q -20 30 -52 46 z`})]}),description:n.q(`chart.type.scatterLinesMarkers`),template:{types:{0:{type:`scatter`,scatterStyle:`lineMarker`}}}}),xp.set(_p,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1577 -902 q 93 215 93 547 q 0 88 -6 184 l -43 -3 q 3 -47 5 -92 q 2 -45 2 -88 q 0 -277 -68 -470 q -25 97 -65 167 q -40 70 -89 119 q -49 48 -104 78 q -55 29 -108 46 q -54 16 -103 22 q -49 5 -87 5 q -74 0 -141 -21 q -68 -21 -129 -58 q -62 -37 -116 -88 q -55 -51 -104 -111 q -39 93 -64 181 q -25 88 -40 157 q -15 69 -21 112 q -6 42 -6 44 l -42 -4 q 0 -2 7 -48 q 6 -46 23 -120 q 16 -74 44 -168 q 27 -94 70 -192 q -60 -79 -109 -167 q -50 -88 -90 -174 q -40 -86 -70 -164 q -30 -79 -50 -141 q -21 -62 -32 -102 q -11 -40 -13 -47 l 42 -11 q 0 2 10 37 q 10 35 29 93 q 19 58 48 135 q 28 76 66 160 q 38 83 86 170 q 47 86 104 165 q 45 -96 106 -184 q 61 -89 142 -156 q 80 -68 181 -108 q 101 -40 227 -40 q 3 0 22 2 q 19 1 49 9 q 30 8 68 25 q 38 16 80 46 q 41 29 83 75 q 42 46 80 112 q 5 -42 8 -87 q 2 -45 2 -93 q 0 -243 -64 -562 l 42 -8 q 65 325 65 569 q 0 68 -5 130 q -5 61 -15 117 m -156 283 q 79 -106 111 -275 q -33 -74 -72 -125 q -40 -51 -81 -84 q -41 -34 -80 -52 q -39 -19 -69 -27 q -31 -9 -49 -11 q -19 -2 -20 -2 q -121 0 -218 41 q -97 40 -173 107 q -77 67 -135 155 q -58 87 -101 181 q 47 60 100 112 q 53 51 112 89 q 58 37 123 59 q 65 21 136 21 q 45 0 99 -7 q 54 -7 110 -27 q 55 -21 109 -58 q 54 -37 98 -97 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1792 1749 l -43 -3 q 6 -93 6 -178 q 0 -244 -51 -422 q -51 -179 -152 -287 q -47 -49 -93 -76 q -46 -28 -83 -40 q -38 -13 -62 -15 q -24 -3 -25 -3 q -124 0 -223 44 q -99 43 -177 114 q -78 71 -136 162 q -58 90 -100 186 q -42 95 -69 187 q -28 91 -44 164 q -16 72 -22 118 q -7 46 -7 49 l -42 -4 q 0 -3 5 -34 q 4 -32 14 -84 q 10 -52 27 -120 q 17 -68 43 -144 q 25 -76 60 -156 q 35 -80 82 -155 q 46 -76 105 -143 q 58 -67 131 -117 q 73 -51 161 -80 q 88 -29 193 -29 q 3 0 30 3 q 27 2 69 16 q 41 14 92 44 q 51 30 102 84 q 216 231 216 735 q 0 45 -2 91 q -2 45 -5 93 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 m 1004 -387 q -111 0 -207 -46 q -97 -46 -179 -121 q -83 -75 -151 -172 q -68 -97 -122 -199 q -55 -102 -96 -201 q -41 -99 -68 -178 q -28 -80 -43 -132 q -15 -53 -17 -62 l 42 -11 q 1 2 14 50 q 13 47 40 124 q 26 76 66 173 q 39 96 91 197 q 52 101 118 197 q 65 96 144 171 q 79 75 171 121 q 92 46 197 46 q 45 0 99 -7 q 54 -7 110 -27 q 56 -21 110 -58 q 54 -37 98 -97 q 133 -180 133 -528 q 0 -121 -16 -261 q -16 -141 -48 -302 l 42 -8 q 65 325 65 569 q 0 364 -142 556 q -50 67 -111 108 q -62 40 -123 62 q -62 22 -119 29 q -57 7 -98 7 z`})]}),description:n.q(`chart.type.scatterLinesSmooth`),template:{types:{0:{type:`scatter`,scatterStyle:`smooth`}}}}),xp.set(vp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1503 1457 l -10 61 l -42 -6 l 16 -96 l -334 -380 l -309 389 l -72 -147 l -248 421 l -37 -21 l 262 -446 l -463 -951 l 39 -18 l 451 925 l 227 -387 l 149 168 l 564 -710 l -184 1143 l 263 299 l -68 -525 l 42 -5 l 83 661 m -728 -828 l -114 -130 l -212 360 l 54 112 m 644 14 l 155 -951 l -471 593 m 803 918 v 43 h -1878 v -1878 h 43 v 1835 z`}),(0,d.jsx)(`path`,{className:`styled info`,d:`M 1493 1518 l -42 -6 l 180 -1103 l -807 1016 l -558 -1144 l 39 -18 l 527 1083 l 864 -1087 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1832 1832 l -842 -958 l -486 825 l -37 -21 l 516 -877 l 792 900 l -68 -525 l 42 -5 m 214 749 v 43 h -1878 v -1878 h 43 v 1835 z`})]}),description:n.q(`chart.type.scatterLines`),template:{types:{0:{type:`scatter`,scatterStyle:`line`}}}}),xp.set(yp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),description:n.q(`chart.type.bubble`),template:null}),xp.set(bp,{Icon:e=>(0,d.jsxs)(`svg`,{viewBox:`0,0,2048,2048`,...e,children:[(0,d.jsx)(`path`,{className:`styled high_contrast`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 171 v -1323 h 341 v 512 h 299 v 811 h 170 v -1067 h 299 v -640 h 341 v 1707 m -853 0 v -768 h -256 v 768 m 1067 0 v -1664 h -256 v 1664 z`}),(0,d.jsx)(`path`,{className:`styled background`,d:`M 1728 1941 h -299 v -1706 h 299 m -811 1706 h -298 v -810 h 298 z`}),(0,d.jsx)(`path`,{className:`styled info_tint`,d:`M 619 1941 h -299 v -1322 h 299 z`}),(0,d.jsx)(`path`,{className:`styled info_shade`,d:`M 640 1941 h -43 v -1301 h -256 v 1301 h -42 v -1344 h 341 z`}),(0,d.jsx)(`path`,{className:`styled accent_tint`,d:`M 1429 1941 h -298 v -1066 h 298 z`}),(0,d.jsx)(`path`,{className:`styled accent_shade`,d:`M 1432 896 h -280 v 1050 h -43 v -1093 h 323 z`}),(0,d.jsx)(`path`,{className:`styled current_color`,d:`M 1963 1920 v 43 h -1878 v -1878 h 43 v 1835 h 768 v -768 h -256 v -43 h 299 v 811 h 469 v -1707 h 341 v 1707 m -42 0 v -1664 h -256 v 1664 z`})]}),description:n.q(`chart.type.bubble3D`),template:null});var Sp=e=>xp.get(e),Cp=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:r,disabled:a,chart:o,isDragging:s,onHide:c,onShow:l,...f}=e;(0,u.useEffect)(()=>{},[o]);let p=Z(),m=i.st(t,()=>({isChartEditor:()=>!0}),[]),[h,{height:g,width:_}]=_a();if(o.isDeleted())return;let v=Sp(o.getChartType());v||=Sp(Zf);let y=v.Icon;return(0,d.jsx)(`div`,{...f,ref:da([m,h]),children:(0,d.jsxs)(`div`,{className:`chart-editor`,style:{width:`100%`,height:`100%`,paddingTop:`20px`,paddingBottom:`20px`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:p.getZoom(),display:`flex`,flexDirection:`column`,rowGap:`8px`,position:`relative`,border:`var(--sxl-color-neutral, grey) solid 1px`,filter:a?`blur(1px)`:void 0,boxShadow:s?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0},children:[o.getChartTitle(),(0,d.jsx)(y,{style:{maxWidth:`260px`,fill:`grey`,opacity:.4}}),(0,d.jsx)(`div`,{style:{textAlign:`center`},children:n.I.camelToPrettyCase(o.getChartType())})]})})}));Cp.displayName=`ChartEditor`;var wp=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,disabled:r,slicer:a,isDragging:o,onHide:s,onShow:c,...l}=e;(0,u.useEffect)(()=>{},[a]);let f=Z(),p=i.st(t,()=>({isSlicerEditor:()=>!0}),[]),[m,{height:h,width:g}]=_a();if(!a.isDeleted())return(0,d.jsx)(`div`,{...l,ref:da([p,m]),children:(0,d.jsx)(`div`,{className:`slicer-editor`,style:{width:`100%`,height:`100%`,backgroundColor:`var(--sxl-color-base-100, white)`,backgroundImage:`var(--sxl-image-background)`,alignItems:`center`,justifyContent:`center`,zoom:f.getZoom(),display:`flex`,position:`relative`,border:`var(--sxl-color-neutral, grey) solid 1px`,filter:r?`blur(1px)`:void 0,boxShadow:o?`1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))`:void 0},children:(0,d.jsx)(`div`,{style:{textAlign:`center`},children:a.getDescription()})})})}));wp.displayName=`SlicerEditor`;var Tp=e=>{let{value:t,onChange:r,onChangeText:a,onDone:o,changeOn:s=`live`,onValidate:c,invalidKey:l=n.q(`namedInput.invalid`),disabled:d=!1}=e,[f,p]=(0,u.useState)(!1),m=(0,u.useRef)(!1),h=(0,u.useRef)(null),g=(0,u.useRef)(e);g.current=e;let _=e=>{m.current=e,p(e)},v=_o({initialText:t??``,parse:e=>{let{onValidate:t,invalidKey:r=n.q(`namedInput.invalid`)}=g.current;try{t?.(e)}catch(e){return{error:e?.message||r}}return{value:e,error:null}},changeOn:s,onChange:r?e=>r(e??``):void 0,onChangeText:a,onDone:o?(e,t)=>o(e??``,t):void 0,session:{isActive:()=>m.current,end:e=>b(e)}}),y=i.X(()=>{g.current.disabled||m.current||(v.beginSession(),_(!0))},[]),b=i.X(e=>{e.reason===`cancel`&&v.revertToBaseline(),_(!1),v.notifyDone(e)},[]);(0,u.useEffect)(()=>{let e=t??``;v.resetCommitted(e,e)},[t]);let x=i.X(e=>{m.current||y(),v.setText(e.target.value),v.liveChange(e.target.value)},[]),S=i.X(e=>{v.resetBlurGuard(),v.handleDoneKeys(e)||v.handleTextKeys(e)},[]),C=i.X(e=>{v.resetBlurGuard(),y()},[]),w=i.X(e=>{let t=v.consumeBlurGuard();_(!1),!t&&v.dirtyRef.current&&v.notifyDone({reason:`accept`})},[]);return{inputProps:{value:v.text,onChange:x,onKeyDown:S,onFocus:C,onBlur:w,ref:e=>{h.current=e}},text:v.text,error:v.error,dirty:v.dirty,engaged:f&&!d,revert:v.revertToCommitted,commit:v.commit,cancel:v.cancel}},Ep={placement:`bottom-start`,followAnchor:!0},Dp=new Set,Op={x:0,y:0,top:0,left:0,bottom:0,right:0,width:0,height:0,toJSON:()=>({})},kp=e=>{let{api:t,grammar:n,disabled:r}=e,a=n===`formula`,s=Ui(),c=e.workbook===void 0?s:e.workbook,l=Za().getMode(),p=!!l?.activeInput&&!t.engaged,[m,h]=(0,u.useState)(-1),[g,_]=(0,u.useState)(null),[v,y]=(0,u.useState)(null),b=(0,u.useMemo)(()=>is(a?t.tokens:null),[a,t.tokens]),x=(0,u.useMemo)(()=>{if(!a||!t.tokens)return Dp;let e;try{e=c?.getSelectedSheet().getCalculation()}catch{e=null}return e?new Set(Fs(e,t.tokens,t.tokenBase).flatMap(e=>e.tokens)):Dp},[a,t.tokens,t.tokenBase,c]),[S,C]=(0,u.useState)(null);(0,u.useEffect)(()=>{let e=t.tokens,n=a&&t.engaged&&e&&m>=0?as(e,b.matchOf,m,t.tokenBase):null;C(e=>os(e,n)?e:n)},[a,t.engaged,t.tokens,t.tokenBase,m,b]);let w=(0,u.useMemo)(()=>ss(a?g:null,S,b),[a,g,S,b]),T=m>=0?Math.min(m,t.text.length):t.text.length,E=a&&t.engaged&&t.text.length>0&&Aa(t.text,T),D=E&&T>=t.text.length,O=E&&!D?T:-1,k=(0,u.useMemo)(()=>{if(a){let e=t.tokens;if(!e)return null;let n=t.tokenBase,r=e.map(e=>{let t=n;return n+=(e.text??``).length,t}),i=e.map((e,t)=>{let n,i=b.unmatched.has(t),a=w.has(t),o=b.depthOf.get(t),s=i||o===void 0||e.referenceIndex!==void 0?void 0:Zo(o),c=i?es:s??Na(e);(c||a||i)&&(n={},c&&(n.color=c),i&&(n.fontWeight=`bold`),a&&(n.color=`transparent`)),x.has(t)&&(n={...n,...ns});let l=e.text??``,u=O>=r[t]&&O<r[t]+l.length;return(0,d.jsxs)(`span`,{"data-si":t,style:n,children:[a&&(0,d.jsx)(`span`,{"aria-hidden":!0,style:Qo,children:(0,d.jsx)(`span`,{style:$o(c??`inherit`),children:e.text})}),u?(0,d.jsxs)(d.Fragment,{children:[l.slice(0,O-r[t]),(0,d.jsx)(Wo,{}),l.slice(O-r[t])]}):l]},`t-${t}`)}),a=t.tokenBase>0?(0,d.jsx)(`span`,{children:t.text.slice(0,t.tokenBase)},`eq`):null,o=D?(0,d.jsx)(Wo,{},`expected`):null;if(!g)return[a,...i,o].filter(Boolean);let{lo:s,hi:c,outline:l}=g,u=l?Jo:qo;return[a,...i.slice(0,s),(0,d.jsx)(`span`,{className:`formula-eval-run`,style:u,children:i.slice(s,c+1)},`eval-run`),...i.slice(c+1),o].filter(Boolean)}if(t.segments.length===0)return null;let e=[];return t.segments.forEach((t,n)=>{n>0&&e.push((0,d.jsx)(`span`,{children:`,`},`sep-${n}`));let r=g&&g.lo===n;e.push((0,d.jsx)(`span`,{"data-si":n,style:{...t.valid?{color:Vr[n%Vr.length]}:null,...r?g.outline?Jo:qo:null},children:t.text},`seg-${n}`))}),e},[a,t.tokens,t.tokenBase,t.text,t.segments,b,w,g,D,O,x]),A=!r&&!p&&!!k,j=(0,u.useRef)(null),M=(0,u.useRef)(null),N=(0,u.useRef)(null),[P,F]=(0,u.useState)(null),[I,L]=(0,u.useState)(!1);(0,u.useEffect)(()=>{let e=M.current;if(!e)return;L(e.ownerDocument.activeElement===e);let t=()=>L(!0),n=()=>L(!1);return e.addEventListener(`focus`,t),e.addEventListener(`blur`,n),()=>{e.removeEventListener(`focus`,t),e.removeEventListener(`blur`,n)}},[]),(0,u.useLayoutEffect)(()=>{if(!A)return void F(null);let e=M.current,t=j.current;if(!e||!t)return;let n=()=>{let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=window.getComputedStyle(e);F({position:`absolute`,left:n.left-r.left,top:n.top-r.top,width:n.width,height:n.height,boxSizing:`border-box`,paddingLeft:i.paddingLeft,paddingRight:i.paddingRight,paddingTop:i.paddingTop,paddingBottom:i.paddingBottom,font:i.font,letterSpacing:i.letterSpacing,display:`flex`,alignItems:`center`,whiteSpace:`pre`,overflow:`hidden`,pointerEvents:`none`,textAlign:`left`});let a=N.current;a&&(a.scrollLeft=e.scrollLeft)};if(n(),typeof ResizeObserver>`u`)return;let r=new ResizeObserver(n);return r.observe(e),()=>r.disconnect()},[A,t.text]);let R=Vs({text:t.text,getTokens:()=>a?t.tokens:null,active:a&&t.engaged,getCaret:()=>M.current?.selectionStart??t.text.length,getCalculation:()=>{try{return c?.getSelectedSheet().getCalculation()??null}catch{return null}},getNames:()=>{try{return c?.getSelectedSheet().getNames()??null}catch{return null}},getLocale:()=>c?.getLocale()??null,applyText:(e,n)=>{t.replaceText(e,n)},hoveredTokenIndex:v,getArgument:()=>a?e.argument??null:null});(0,u.useEffect)(()=>{R.update()},[R.update,t.text,m,t.engaged]);let z=i.R({label:`formula-field-hint`,anchor:(0,u.useMemo)(()=>({getBoundingClientRect:()=>M.current?.getBoundingClientRect()??Op}),[]),autoFocus:!1,disableClickAway:u.useCallback(e=>!!j.current?.contains(e),[]),propsPopper:Ep,createPopupPanel:R.renderPanel}),B=R.active&&!l?.dragging,V=z.reference;(0,u.useEffect)(()=>{B?V.open(0):V.close(0)},[B,V]);let[H,U]=(0,u.useState)(null),W=(0,u.useRef)(null),G=(0,u.useRef)(!1),K=()=>{W.current=null,G.current=!1,U(null),_(null),y(null)},q=()=>{G.current||K()},J=no(()=>K(),()=>ee()),Y=t=>{if(!c)return!1;try{return c.getSelectedSheet().getCalculation().createFormula(`=`+t,e.home,{target:`display`}).isValid()}catch{return!1}},ee=()=>{let n=M.current,r=N.current,i=()=>{G.current&&K()};if(!n||!r||!A)return void i();if(J.isDragging())return;let o=n.selectionStart??0,s=n.selectionEnd??0;if(o===s)return void i();let l=null;if(a){let n=c?ao(t.tokens,t.tokenBase,t.text,o,s,Y):null;n&&(l={lo:n.lo,hi:n.hi,key:`sel:f:${n.lo}:${n.hi}:${n.fragment??n.evalIndex}`,evaluate:async()=>{let r=c.getSelectedSheet().getCalculation();return po(n.fragment===null?await r.createFormula(t.text,e.home,{target:`display`}).evaluate({evalIndex:n.evalIndex}):await r.createFormula(`=`+n.fragment,e.home,{target:`display`}).evaluate())}})}else{let e=0,n=-1;for(let r=0;r<t.segments.length;r++){r>0&&(e+=1);let i=e;if(e+=t.segments[r].text.length,i<s&&e>o){if(n>=0){n=-1;break}n=r}}if(n>=0&&t.segments[n].valid){let e=n;l={lo:e,hi:e,key:`sel:s:${e}:${t.segments[e].text}`,evaluate:()=>t.evaluateSegment(e)}}}if(!l)return void i();if(l.key===W.current)return;W.current=l.key,G.current=!0,U(null),y(null),_({lo:l.lo,hi:l.hi,outline:!0});let u=r.querySelector(`[data-si="${l.lo}"]`)?.getBoundingClientRect(),d=r.querySelector(`[data-si="${l.hi}"]`)?.getBoundingClientRect();if(!u)return void K();let f=d&&Math.abs(d.top-u.top)<1?{left:(u.left+d.right)/2,top:u.top-6}:{left:(u.left+u.right)/2,top:u.top-6},p=l.key;l.evaluate().then(e=>{W.current===p&&e!=null&&U({...f,text:e})}).catch(()=>{})};(0,u.useEffect)(()=>{t.engaged||K()},[t.engaged]);let X=n=>{if(n.which!==i.Zt.F9||n.shiftKey||n.ctrlKey||n.altKey||n.metaKey)return!1;let s=M.current;if(!a||!s||!c||r||!t.tokens?.length)return!1;let l,u=s.selectionStart??0,d=s.selectionEnd??0;if(u!==d)l=ao(t.tokens,t.tokenBase,t.text,u,d,Y);else{let e=oo(t.tokens);l=e?{...e,...so(t.tokens,t.tokenBase,e.lo,e.hi),fragment:null}:null}if(!l)return!1;n.preventDefault(),n.stopPropagation();let f=t.text,p=c.getSelectedSheet().getCalculation(),m=co(o.r(c.getLocale()??`en`).decimal),h=o.yt(),g={t:h?.booleans?.true??`TRUE`,f:h?.booleans?.false??`FALSE`};return(async()=>{let t=null,n=``;try{if(t=uo(l.fragment===null?await p.createFormula(f,e.home,{target:`display`}).evaluate({evalIndex:l.evalIndex}):await p.createFormula(`=`+l.fragment,e.home,{target:`display`}).evaluate(),m,g),t===null||(n=f.slice(0,l.start)+t+f.slice(l.end),!p.createFormula(n,e.home,{target:`display`}).isValid()))return}catch{return}let r=M.current;if(!r||r.value!==f)return;i.kt.replaceRangeText(r,l.start,l.end,t);let a=l.start,o=l.start+t.length;requestAnimationFrame(()=>{M.current?.value===n&&M.current.setSelectionRange(a,o)})})(),!0};(0,u.useEffect)(()=>{K()},[t.text]);let te={onScroll:e=>{let t=N.current;t&&(t.scrollLeft=e.currentTarget.scrollLeft),K(),ee()},onMouseMove:n=>{let r=N.current;if(!r)return;if(J.blocksHover(n)||ro(M.current))return void q();let i=n.clientX,o=n.clientY,s=r.querySelectorAll(`[data-si]`),l=-1,u=null;for(let e=0;e<s.length;e++){let t=s[e].getBoundingClientRect();if(i>=t.left&&i<=t.right&&o>=t.top&&o<=t.bottom){l=Number(s[e].getAttribute(`data-si`)),u=t;break}}if(l<0||!u)return void K();if(a){let n=t.tokens;if(!n||!c)return void K();let i=io(n,l);if(!i)return void K();let a=`f:${i.evalIndex}:${i.lo}:${i.hi}`;if(a===W.current)return;W.current=a,U(null),_({lo:i.lo,hi:i.hi}),y(l);let o=r.querySelector(`[data-si="${i.lo}"]`)?.getBoundingClientRect(),s=r.querySelector(`[data-si="${i.hi}"]`)?.getBoundingClientRect(),d=o&&s&&Math.abs(s.top-o.top)<1?{left:(o.left+s.right)/2,top:o.top-6}:{left:(u.left+u.right)/2,top:u.top-6};try{let n=c.getSelectedSheet().getCalculation().createFormula(t.text,e.home,{target:`display`});Promise.resolve(n.evaluate({evalIndex:i.evalIndex})).then(e=>{if(W.current!==a)return;let t=po(e);t!=null&&U({...d,text:t})}).catch(()=>{})}catch{}return}if(!t.segments[l]?.valid)return void K();let d=`s:${l}:${t.segments[l].text}`;if(d===W.current)return;W.current=d,U(null),_({lo:l,hi:l});let f={left:(u.left+u.right)/2,top:u.top-6};t.evaluateSegment(l).then(e=>{W.current===d&&e!=null&&U({...f,text:e})})},onMouseLeave:q,onDragStart:J.onDragStart,onSelect:e=>{h(M.current?.selectionStart??-1),ee()},onPointerDown:e=>{J.begin(e),B&&!z.isOpen&&V.open(0)}},ne=A&&P?(0,d.jsx)(`div`,{ref:N,"aria-hidden":!0,style:P,children:(0,d.jsx)(`span`,{style:{whiteSpace:`pre`},children:k})}):null,re=H?(0,f.createPortal)((0,d.jsx)(`div`,{className:`sxl-formula-eval-tip`,style:{...to,left:H.left,top:H.top},children:H.text}),document.body):null;return{containerRef:j,inputElRef:M,overlayActive:A,inputHandlers:te,inputExpected:E&&I,handleKeyDown:e=>!!R.handleKeyDown(e)||(e.which===i.Zt.Escape&&z.isOpen?(e.preventDefault(),e.stopPropagation(),V.close(0),!0):!!X(e)),overlayElement:ne,tipElement:re,hintElement:z.component}},Ap=e=>{e.button===0&&e.preventDefault()},jp=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{grammar:n=`formula`,value:a,onChangeInput:o,onChangeText:s,onDone:c,changeOn:l,workbook:f,apiRef:p,hideAdornment:m,hideError:h,home:g,equals:_,pickAs:v,pickSpills:y,allowMulti:b,allowCrossSheet:x,argument:S,disabled:C,className:w,style:T,onKeyDown:E,onFocus:D,onBlur:O,placeholder:k,...A}=e,j=i.Ot(),M=jo({value:a,onChange:o,onChangeText:s,onDone:c,changeOn:l,workbook:f,home:g,equals:_,pickAs:v,pickSpills:y,allowMulti:b,allowCrossSheet:x,disabled:C},n);(0,u.useImperativeHandle)(p,()=>M,[M]);let N=kp({api:M,grammar:n,disabled:C,workbook:f,home:g,argument:S}),P=!!M.error&&!N.inputExpected,F=!!c,I={display:`inline-flex`,alignItems:`center`,justifyContent:`center`,border:`none`,background:`none`,padding:`0 2px`,margin:0,cursor:`pointer`,color:`inherit`,opacity:.8},L=m?null:(0,d.jsx)(`span`,{className:`sxl-input-adornment`,onMouseDown:Ap,style:{display:`inline-flex`,alignItems:`center`,flex:`0 0 auto`},children:M.engaged&&F?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(`button`,{type:`button`,"aria-label":`commit-reference`,title:j(`referenceInput.commit`),style:I,disabled:!!M.error,tabIndex:-1,onMouseDown:Ap,onClick:()=>{M.commit()},children:(0,d.jsx)(r.r,{iconKey:`CheckSuccess`})}),(0,d.jsx)(`button`,{type:`button`,"aria-label":`cancel-reference`,title:j(`referenceInput.cancel`),style:I,tabIndex:-1,onMouseDown:Ap,onClick:()=>{M.cancel()},children:(0,d.jsx)(r.r,{iconKey:`CloseError`})})]}):(0,d.jsx)(`button`,{type:`button`,"aria-label":`select-current-range`,title:j(`referenceInput.selectCurrent`),style:C||!M.canSelectCurrent?{...I,opacity:.3,cursor:`default`}:I,disabled:C||!M.canSelectCurrent,tabIndex:-1,onMouseDown:Ap,onClick:()=>{M.engaged||M.togglePoint(),M.selectCurrent()},children:(0,d.jsx)(r.r,{iconKey:`SelectRangeMode`})})});return(0,d.jsxs)(`div`,{ref:e=>{N.containerRef.current=e,typeof t==`function`?t(e):t&&(t.current=e)},className:$(`sxl-formula-input`,w),"data-grammar":n,"data-error":P?``:void 0,"data-engaged":M.engaged?``:void 0,style:{position:`relative`,display:`inline-flex`,flexDirection:`column`,minWidth:0,fontFamily:`var(--sxl-font-family, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif)`,...T},children:[(0,d.jsxs)(`span`,{style:{display:`inline-flex`,flexDirection:`row`,alignItems:`center`,border:`1px solid `+(P?`var(--sxl-color-error, #d93025)`:`var(--sxl-color-input-border, light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.2)))`),borderRadius:`var(--sxl-input-radius, 4px)`,background:`var(--sxl-input-bg, transparent)`},children:[(0,d.jsx)(`input`,{...A,type:`text`,spellCheck:!1,autoComplete:`off`,placeholder:k,disabled:C,readOnly:C||M.inputProps.readOnly,"aria-invalid":!!P||void 0,value:M.inputProps.value,ref:e=>{N.inputElRef.current=e,M.inputProps.ref(e)},onChange:M.inputProps.onChange,onKeyDown:e=>{N.handleKeyDown(e)||(M.inputProps.onKeyDown(e),e.defaultPrevented||E?.(e))},onPointerDown:N.inputHandlers.onPointerDown,onMouseDown:M.inputProps.onMouseDown,onSelect:e=>{M.inputProps.onSelect(e),N.inputHandlers.onSelect(e)},onFocus:e=>{M.inputProps.onFocus(e),D?.(e)},onBlur:e=>{M.inputProps.onBlur(e),O?.(e)},onScroll:N.inputHandlers.onScroll,onMouseMove:N.inputHandlers.onMouseMove,onMouseLeave:N.inputHandlers.onMouseLeave,onDragStart:N.inputHandlers.onDragStart,onContextMenu:e=>{e.stopPropagation()},style:{flex:`1 1 auto`,minWidth:0,font:`inherit`,color:`inherit`,background:`none`,border:`none`,outline:`none`,padding:`var(--sxl-input-padding, 4px 6px)`,...N.overlayActive?{color:`transparent`,caretColor:`var(--sxl-color-text, light-dark(#000, #fff))`}:null}}),L]}),!h&&(0,d.jsx)(`span`,{className:`sxl-formula-input-error`,style:{display:`block`,visibility:P?`visible`:`hidden`,color:`var(--sxl-color-error, #d93025)`,fontSize:`0.75em`,paddingTop:`2px`},children:P?j(M.error):`\xA0`}),N.overlayElement,N.tipElement,N.hintElement]})}));jp.displayName=`FormulaInput`;var Mp=e=>(0,d.jsx)(`input`,{...e}),Np=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{style:n={},className:r,value:a=``,onSubmit:o,onChange:s,onCancel:c,renderInput:l=Mp,styleHover:f={},dragging:p,maxLength:m,disabled:h=!1,readOnly:g=!1,..._}=e,[v,y]=(0,u.useState)(!1),[b,x]=(0,u.useState)(!1),[S,C]=(0,u.useState)(a);(0,u.useEffect)(()=>{C(a)},[a]);let w=(0,u.useRef)(null),[T,E]=(0,u.useState)(null),D=i.ot(),O=(0,u.useCallback)(function(e){let t=e.message;T!==t&&(D?.showMessage?.(t,{type:i.rt.Error}),E(t))},[D,T]),k=(0,u.useCallback)(e=>{let t=!1;try{t=o?.(e)??!0}catch(e){O(e)}return t?(w.current=null,x(!1),C(e),t):(setTimeout(()=>{w.current?.focus()},0),t)},[o]),A=i.X(()=>{C(a),w.current=null,x(!1),c?.()},[c,a]),j=(0,u.useMemo)(()=>{if(!b)return null;let e={className:$(`_editable-input_1u3oj_6`),autoFocus:!0,spellCheck:!1,name:`editable-label`,autoComplete:`off`,maxLength:m,type:`text`,value:S,onFocus:e=>{w.current||(w.current=e.target,setTimeout(()=>{e.target?.select()},0))},onBlur:e=>{w.current&&k(S)},onChange:e=>{b&&C(e.target.value)},onMouseDown:e=>e.stopPropagation(),onKeyDown:e=>e.code===`Escape`?(e.preventDefault(),void A()):e.code===`Enter`?(e.preventDefault(),void k(e.target.value)):void(e.code===`Tab`?k(e.target.value):e.stopPropagation())};return(0,d.jsx)(d.Fragment,{children:l(e)})},[b,S,k,A,l,h]),[M,N]=(0,u.useState)();(0,u.useLayoutEffect)(()=>{let e=Object.assign({},n);(p||v)&&(e=Object.assign(e,f)),N(e)},[p,v,f,n]),(0,u.useEffect)(()=>{j&&s?.(S)},[j,s,S]);let P=i.st(t,()=>({startEdit(){h||g||x(!0)},cancel(){A()}}),[]);return(0,d.jsxs)(`div`,{..._,ref:P,style:{flexDirection:`column`,display:`flex`,...M},className:$(r),children:[(0,d.jsxs)(`div`,{style:{position:`relative`,boxSizing:`content-box`,whiteSpace:`pre`,userSelect:`none`,display:`flex`,justifyContent:`center`},onDoubleClick:()=>{h||g||x(!0)},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[(0,d.jsx)(`div`,{className:`editable-label-container`,style:{textAlign:`center`,display:`flex`,minHeight:`1em`,opacity:+!b},children:S}),j]}),(0,d.jsx)(`div`,{style:{whiteSpace:`pre`,position:`relative`,maxHeight:`0px`,height:`0px`,visibility:`hidden`,marginLeft:`1px`,marginRight:`1px`,overflow:`hidden`,...f},children:S})]})})),Pp=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Fp(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ip(e){return`nodeType`in e}function Lp(e){var t;return e?Fp(e)?e:Ip(e)&&(t=e.ownerDocument?.defaultView)!=null?t:window:window}function Rp(e){let{Document:t}=Lp(e);return e instanceof t}function zp(e){return!Fp(e)&&e instanceof Lp(e).HTMLElement}function Bp(e){return e instanceof Lp(e).SVGElement}function Vp(e){return e?Fp(e)?e.document:Ip(e)?Rp(e)?e:zp(e)||Bp(e)?e.ownerDocument:document:document:document}var Hp=Pp?u.useLayoutEffect:u.useEffect;function Up(e){let t=(0,u.useRef)(e);return Hp(()=>{t.current=e}),(0,u.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Wp(e,t){t===void 0&&(t=[e]);let n=(0,u.useRef)(e);return Hp(()=>{n.current!==e&&(n.current=e)},t),n}function Gp(e,t){let n=(0,u.useRef)();return(0,u.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function Kp(e){let t=Up(e),n=(0,u.useRef)(null);return[n,(0,u.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function qp(e){let t=(0,u.useRef)();return(0,u.useEffect)(()=>{t.current=e},[e]),t.current}var Jp={};function Yp(e,t){return(0,u.useMemo)(()=>{if(t)return t;let n=Jp[e]==null?0:Jp[e]+1;return Jp[e]=n,e+`-`+n},[e,t])}function Xp(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Zp=Xp(1),Qp=Xp(-1);function $p(e){if(!e)return!1;let{KeyboardEvent:t}=Lp(e.target);return t&&e instanceof t}function em(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=Lp(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return function(e){return`clientX`in e&&`clientY`in e}(e)?{x:e.clientX,y:e.clientY}:null}var tm=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[tm.Translate.toString(e),tm.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),nm=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function rm(e){return e.matches(nm)?e:e.querySelector(nm)}var im={display:`none`};function am(e){let{id:t,value:n}=e;return u.createElement(`div`,{id:t,style:im},n)}function om(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return u.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}var sm,cm,lm=(0,u.createContext)(null),um={draggable:`
35
+ To pick up a draggable item, press the space bar.
36
+ While dragging, use the arrow keys to move the item.
37
+ Press space again to drop the item in its new position, or press escape to cancel.
38
+ `},dm={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function fm(e){let{announcements:t=dm,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=um}=e,{announce:a,announcement:o}=function(){let[e,t]=(0,u.useState)(``);return{announce:(0,u.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}(),s=Yp(`DndLiveRegion`),[c,l]=(0,u.useState)(!1);if((0,u.useEffect)(()=>{l(!0)},[]),function(e){let t=(0,u.useContext)(lm);(0,u.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}((0,u.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let d=u.createElement(u.Fragment,null,u.createElement(am,{id:r,value:i.draggable}),u.createElement(om,{id:s,announcement:o}));return n?(0,f.createPortal)(d,n):d}function pm(){}function mm(e,t){return(0,u.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}(cm=sm||={}).DragStart=`dragStart`,cm.DragMove=`dragMove`,cm.DragEnd=`dragEnd`,cm.DragCancel=`dragCancel`,cm.DragOver=`dragOver`,cm.RegisterDroppable=`registerDroppable`,cm.SetDroppableDisabled=`setDroppableDisabled`,cm.UnregisterDroppable=`unregisterDroppable`;var hm=Object.freeze({x:0,y:0});function gm(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function _m(e,t){let n=em(e);return n?(n.x-t.left)/t.width*100+`% `+(n.y-t.top)/t.height*100+`%`:`0 0`}function vm(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function ym(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function bm(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function xm(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Sm(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}var Cm=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Sm(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=gm(Sm(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(vm)};function wm(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s;return Number((i/(n+r-i)).toFixed(4))}return 0}var Tm=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=wm(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(ym)};function Em(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:hm}var Dm,Om=function(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}(1);function km(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}var Am={ignoreTransform:!1};function jm(e,t){t===void 0&&(t=Am);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=Lp(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=km(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function Mm(e){return jm(e,{ignoreTransform:!0})}function Nm(e,t){let n=[];return e?function r(i){if(t!=null&&n.length>=t||!i)return n;if(Rp(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!zp(i)||Bp(i)||n.includes(i))return n;let a=Lp(e).getComputedStyle(i);return i!==e&&function(e,t){t===void 0&&(t=Lp(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`&&n.test(r)})}(i,a)&&n.push(i),function(e,t){return t===void 0&&(t=Lp(e).getComputedStyle(e)),t.position===`fixed`}(i,a)?n:r(i.parentNode)}(e):n}function Pm(e){let[t]=Nm(e,1);return t??null}function Fm(e){return Pp&&e?Fp(e)?e:Ip(e)?Rp(e)||e===Vp(e).scrollingElement?window:zp(e)?e:null:null:null}function Im(e){return Fp(e)?e.scrollX:e.scrollLeft}function Lm(e){return Fp(e)?e.scrollY:e.scrollTop}function Rm(e){return{x:Im(e),y:Lm(e)}}function zm(e){return!(!Pp||!e)&&e===document.scrollingElement}function Bm(e){let t={x:0,y:0},n=zm(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(Dm||={});var Vm,Hm,Um={x:.2,y:.2};function Wm(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=Um);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=Bm(e),p={x:0,y:0},m={x:0,y:0},h=t.height*i.y,g=t.width*i.x;return!l&&a<=t.top+h?(p.y=Dm.Backward,m.y=r*Math.abs((t.top+h-a)/h)):!u&&c>=t.bottom-h&&(p.y=Dm.Forward,m.y=r*Math.abs((t.bottom-h-c)/h)),!f&&s>=t.right-g?(p.x=Dm.Forward,m.x=r*Math.abs((t.right-g-s)/g)):!d&&o<=t.left+g&&(p.x=Dm.Backward,m.x=r*Math.abs((t.left+g-o)/g)),{direction:p,speed:m}}function Gm(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Km(e){return e.reduce((e,t)=>Zp(e,Rm(t)),hm)}function qm(e,t){if(t===void 0&&(t=jm),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);Pm(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var Jm=[[`x`,[`left`,`right`],function(e){return e.reduce((e,t)=>e+Im(t),0)}],[`y`,[`top`,`bottom`],function(e){return e.reduce((e,t)=>e+Lm(t),0)}]],Ym=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=Nm(t),r=Km(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of Jm)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},Xm=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function Zm(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t&&r>t.y}function Qm(e){e.preventDefault()}function $m(e){e.stopPropagation()}(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(Vm||={}),function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`}(Hm||={});var eh={start:[Hm.Space,Hm.Enter],cancel:[Hm.Esc],end:[Hm.Space,Hm.Enter,Hm.Tab]},th=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Hm.Right:return{...n,x:n.x+25};case Hm.Left:return{...n,x:n.x-25};case Hm.Down:return{...n,y:n.y+25};case Hm.Up:return{...n,y:n.y-25}}},nh=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new Xm(Vp(t)),this.windowListeners=new Xm(Lp(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Vm.Resize,this.handleCancel),this.windowListeners.add(Vm.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Vm.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&qm(n),t(hm)}handleKeyDown(e){if($p(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=eh,coordinateGetter:a=th,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s))return void this.handleEnd(e);if(i.cancel.includes(s))return void this.handleCancel(e);let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:hm;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=Qp(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=Bm(n),p=Gm(n),m={x:Math.min(i===Hm.Right?p.right-p.width/2:p.right,Math.max(i===Hm.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===Hm.Down?p.bottom-p.height/2:p.bottom,Math.max(i===Hm.Down?p.top:p.top+p.height/2,u.y))},h=i===Hm.Right&&!s||i===Hm.Left&&!c,g=i===Hm.Down&&!l||i===Hm.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===Hm.Right&&e<=d.x||i===Hm.Left&&e>=f.x;if(a&&!t.y)return void n.scrollTo({left:e,behavior:o});r.x=a?n.scrollLeft-e:i===Hm.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===Hm.Down&&e<=d.y||i===Hm.Up&&e>=f.y;if(a&&!t.x)return void n.scrollTo({top:e,behavior:o});r.y=a?n.scrollTop-e:i===Hm.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Zp(Qp(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};function rh(e){return!(!e||!(`distance`in e))}function ih(e){return!(!e||!(`delay`in e))}nh.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=eh,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return!(t&&e.target!==t||(e.preventDefault(),i?.({event:e.nativeEvent}),0))}return!1}}];var ah,oh=class{constructor(e,t,n){n===void 0&&(n=function(e){let{EventTarget:t}=Lp(e);return e instanceof t?e:Vp(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=Vp(i),this.documentListeners=new Xm(this.document),this.listeners=new Xm(n),this.windowListeners=new Xm(Lp(i)),this.initialCoordinates=em(r)??hm,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(Vm.Resize,this.handleCancel),this.windowListeners.add(Vm.DragStart,Qm),this.windowListeners.add(Vm.VisibilityChange,this.handleCancel),this.windowListeners.add(Vm.ContextMenu,Qm),this.documentListeners.add(Vm.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ih(t))return this.timeoutId=setTimeout(this.handleStart,t.delay),void this.handlePending(t);if(rh(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(Vm.Click,$m,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Vm.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=em(e)??hm,s=Qp(n,o);if(!t&&a){if(rh(a)){if(a.tolerance!=null&&Zm(s,a.tolerance))return this.handleCancel();if(Zm(s,a.distance))return this.handleStart()}return ih(a)&&Zm(s,a.tolerance)?this.handleCancel():void this.handlePending(a,s)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===Hm.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},sh={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},ch=class extends oh{constructor(e){let{event:t}=e,n=Vp(t.target);super(e,sh,n)}};ch.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!(!n.isPrimary||n.button!==0||(r?.({event:n}),0))}}];var lh={move:{name:`mousemove`},end:{name:`mouseup`}};(function(e){e[e.RightClick=2]=`RightClick`})(ah||={});var uh,dh,fh=class extends oh{constructor(e){super(e,lh,Vp(e.event.target))}};fh.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==ah.RightClick&&(r?.({event:n}),!0)}}];var ph,mh,hh={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},gh=class extends oh{constructor(e){super(e,hh)}static setup(){return window.addEventListener(hh.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(hh.move.name,e)};function e(){}}};gh.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return!(i.length>1||(r?.({event:n}),0))}}],function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`}(uh||={}),function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`}(dh||={});var _h={x:{[Dm.Backward]:!1,[Dm.Forward]:!1},y:{[Dm.Backward]:!1,[Dm.Forward]:!1}};(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(ph||={}),(mh||={}).Optimized=`optimized`;var vh=new Map;function yh(e,t){return Gp(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function bh(e){let{callback:t,disabled:n}=e,r=Up(t),i=(0,u.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,u.useEffect)(()=>()=>i?.disconnect(),[i]),i}function xh(e){return new Ym(jm(e),e)}function Sh(e,t,n){t===void 0&&(t=xh);let[r,i]=(0,u.useState)(null);function a(){i(r=>{if(!e)return null;if(!1===e.isConnected)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=function(e){let{callback:t,disabled:n}=e,r=Up(t),i=(0,u.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,u.useEffect)(()=>()=>i?.disconnect(),[i]),i}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=bh({callback:a});return Hp(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}var Ch=[];function wh(e,t){t===void 0&&(t=[]);let n=(0,u.useRef)(null);return(0,u.useEffect)(()=>{n.current=null},t),(0,u.useEffect)(()=>{let t=e!==hm;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?Qp(e,n.current):hm}function Th(e){return(0,u.useMemo)(()=>e?function(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}(e):null,[e])}var Eh=[];function Dh(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return zp(t)?t:e}var Oh,kh=[{sensor:ch,options:{}},{sensor:nh,options:{}}],Ah={current:{}},jh={draggable:{measure:Mm},droppable:{measure:Mm,strategy:ph.WhileDragging,frequency:mh.Optimized},dragOverlay:{measure:jm}},Mh=class extends Map{get(e){var t;return e!=null&&(t=super.get(e))!=null?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},Nh={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:pm},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:jh,measureDroppableContainers:pm,windowRect:null,measuringScheduled:!1},Ph={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:pm,draggableNodes:new Map,over:null,measureDroppableContainers:pm},Fh=(0,u.createContext)(Ph),Ih=(0,u.createContext)(Nh);function Lh(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mh}}}function Rh(e,t){switch(t.type){case sm.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case sm.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case sm.DragEnd:case sm.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case sm.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new Mh(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case sm.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new Mh(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case sm.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new Mh(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function zh(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,u.useContext)(Fh),a=qp(r),o=qp(n?.id);return(0,u.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!$p(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=rm(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function Bh(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}var Vh=(0,u.createContext)({...hm,scaleX:1,scaleY:1});(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(Oh||={});var Hh=(0,u.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=kh,collisionDetection:o=Tm,measuring:s,modifiers:c,...l}=e,[d,p]=(0,u.useReducer)(Rh,void 0,Lh),[m,h]=function(){let[e]=(0,u.useState)(()=>new Set),t=(0,u.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,u.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}(),[g,_]=(0,u.useState)(Oh.Uninitialized),v=g===Oh.Initialized,{draggable:{active:y,nodes:b,translate:x},droppable:{containers:S}}=d,C=y==null?null:b.get(y),w=(0,u.useRef)({initial:null,translated:null}),T=(0,u.useMemo)(()=>y==null?null:{id:y,data:C?.data??Ah,rect:w},[y,C]),E=(0,u.useRef)(null),[D,O]=(0,u.useState)(null),[k,A]=(0,u.useState)(null),j=Wp(l,Object.values(l)),M=Yp(`DndDescribedBy`,t),N=(0,u.useMemo)(()=>S.getEnabled(),[S]),P=(0,u.useMemo)(()=>({draggable:{...jh.draggable,...F?.draggable},droppable:{...jh.droppable,...F?.droppable},dragOverlay:{...jh.dragOverlay,...F?.dragOverlay}}),[(F=s)?.draggable,F?.droppable,F?.dragOverlay]);var F;let{droppableRects:I,measureDroppableContainers:L,measuringScheduled:R}=function(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,u.useState)(null),{frequency:s,measure:c,strategy:l}=i,d=(0,u.useRef)(e),f=function(){switch(l){case ph.Always:return!1;case ph.BeforeDragging:return n;default:return!n}}(),p=Wp(f),m=(0,u.useCallback)(function(e){e===void 0&&(e=[]),p.current||o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[p]),h=(0,u.useRef)(null),g=Gp(t=>{if(f&&!n)return vh;if(!t||t===vh||d.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new Ym(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,f,c]);return(0,u.useEffect)(()=>{d.current=e},[e]),(0,u.useEffect)(()=>{f||m()},[n,f]),(0,u.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,u.useEffect)(()=>{f||typeof s!=`number`||h.current!==null||(h.current=setTimeout(()=>{m(),h.current=null},s))},[s,f,m,...r]),{droppableRects:g,measureDroppableContainers:m,measuringScheduled:a!=null}}(N,{dragging:v,dependencies:[x.x,x.y],config:P.droppable}),z=function(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return Gp(e=>t==null?null:r??e??null,[r,t])}(b,y),B=(0,u.useMemo)(()=>k?em(k):null,[k]),V=function(){let e=!1===D?.autoScrollEnabled,t=typeof r==`object`?!1===r.enabled:!1===r,n=v&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}(),H=function(e,t){return yh(e,t)}(z,P.draggable.measure);(function(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,u.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;Hp(()=>{if(!o&&!s||!t)return void(a.current=!1);if(a.current||!r)return;let e=t?.node.current;if(!e||!1===e.isConnected)return;let i=Em(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=Pm(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])})({activeNode:y==null?null:b.get(y),config:V.layoutShiftCompensation,initialRect:H,measure:P.draggable.measure});let U=Sh(z,P.draggable.measure,H),W=Sh(z?z.parentElement:null),G=(0,u.useRef)({activatorEvent:null,active:null,activeNode:z,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:S,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=S.getNodeFor(G.current.over?.id),q=function(e){let{measure:t}=e,[n,r]=(0,u.useState)(null),i=bh({callback:(0,u.useCallback)(e=>{for(let{target:n}of e)if(zp(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=Kp((0,u.useCallback)(e=>{let n=Dh(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,u.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}({measure:P.dragOverlay.measure}),J=q.nodeRef.current??z,Y=v?q.rect??U:null,ee=!(!q.nodeRef.current||!q.rect),X=Em(te=ee?null:U,yh(te));var te;let ne=Th(J?Lp(J):null),re=function(e){let t=(0,u.useRef)(e),n=Gp(n=>e?n&&n!==Ch&&e&&t.current&&e.parentNode===t.current.parentNode?n:Nm(e):Ch,[e]);return(0,u.useEffect)(()=>{t.current=e},[e]),n}(v?K??z:null),ie=function(e,t){t===void 0&&(t=jm);let[n]=e,r=Th(n?Lp(n):null),[i,a]=(0,u.useState)(Eh);function o(){a(()=>e.length?e.map(e=>zm(e)?r:new Ym(t(e),e)):Eh)}let s=bh({callback:o});return Hp(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}(re),ae=Bh(c,{transform:{x:x.x-X.x,y:x.y-X.y,scaleX:1,scaleY:1},activatorEvent:k,active:T,activeNodeRect:U,containerNodeRect:W,draggingNodeRect:Y,over:G.current.over,overlayNodeRect:q.rect,scrollableAncestors:re,scrollableAncestorRects:ie,windowRect:ne}),oe=B?Zp(B,x):null,se=function(e){let[t,n]=(0,u.useState)(null),r=(0,u.useRef)(e),i=(0,u.useCallback)(e=>{let t=Fm(e.target);t&&n(e=>e?(e.set(t,Rm(t)),new Map(e)):null)},[]);return(0,u.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=Fm(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,Rm(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{Fm(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,u.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Zp(e,t),hm):Km(e):hm,[e,t])}(re),ce=wh(se),le=wh(se,[U]),ue=Zp(ae,ce),Z=Y?Om(Y,ae):null,de=T&&Z?o({active:T,collisionRect:Z,droppableRects:I,droppableContainers:N,pointerCoordinates:oe}):null,Q=xm(de,`id`),[fe,pe]=(0,u.useState)(null),me=function(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}(ee?ae:Zp(ae,le),fe?.rect??null,U),he=(0,u.useRef)(null),ge=(0,u.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(E.current==null)return;let i=b.get(E.current);if(!i)return;let a=e.nativeEvent,o=new n({active:E.current,activeNode:i,event:a,options:r,context:G,onAbort(e){if(!b.get(e))return;let{onDragAbort:t}=j.current,n={id:e};t?.(n),m({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!b.get(e))return;let{onDragPending:i}=j.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),m({type:`onDragPending`,event:a})},onStart(e){let t=E.current;if(t==null)return;let n=b.get(t);if(!n)return;let{onDragStart:r}=j.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:w}};(0,f.unstable_batchedUpdates)(()=>{r?.(i),_(Oh.Initializing),p({type:sm.DragStart,initialCoordinates:e,active:t}),m({type:`onDragStart`,event:i}),O(he.current),A(a)})},onMove(e){p({type:sm.DragMove,coordinates:e})},onEnd:s(sm.DragEnd),onCancel:s(sm.DragCancel)});function s(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=G.current,o=null;if(t&&i){let{cancelDrop:s}=j.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===sm.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=sm.DragCancel)}E.current=null,(0,f.unstable_batchedUpdates)(()=>{p({type:e}),_(Oh.Uninitialized),pe(null),O(null),A(null),he.current=null;let t=e===sm.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=j.current[t];e?.(o),m({type:t,event:o})}})}}he.current=o},[b]),_e=function(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}))]},[]),[e,t])}(a,(0,u.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=b.get(r);if(E.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};!0===e(n,t.options,o)&&(i.dndKit={capturedBy:t.sensor},E.current=r,ge(n,t))},[b,ge]));(function(e){(0,u.useEffect)(()=>{if(!Pp)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))})(a),Hp(()=>{U&&g===Oh.Initializing&&_(Oh.Initialized)},[U,g]),(0,u.useEffect)(()=>{let{onDragMove:e}=j.current,{active:t,activatorEvent:n,collisions:r,over:i}=G.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:ue.x,y:ue.y},over:i};(0,f.unstable_batchedUpdates)(()=>{e?.(a),m({type:`onDragMove`,event:a})})},[ue.x,ue.y]),(0,u.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=G.current;if(!e||E.current==null||!t||!i)return;let{onDragOver:a}=j.current,o=r.get(Q),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,f.unstable_batchedUpdates)(()=>{pe(s),a?.(c),m({type:`onDragOver`,event:c})})},[Q]),Hp(()=>{G.current={activatorEvent:k,active:T,activeNode:z,collisionRect:Z,collisions:de,droppableRects:I,draggableNodes:b,draggingNode:J,draggingNodeRect:Y,droppableContainers:S,over:fe,scrollableAncestors:re,scrollAdjustedTranslate:ue},w.current={initial:Y,translated:Z}},[T,z,de,Z,b,J,Y,I,S,fe,re,ue]),function(e){let{acceleration:t,activator:n=uh.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=dh.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:d,delta:f,threshold:p}=e,m=function(e){let{delta:t,disabled:n}=e,r=qp(t);return Gp(e=>{if(n||!r||!e)return _h;let i=Math.sign(t.x-r.x),a=Math.sign(t.y-r.y);return{x:{[Dm.Backward]:e.x[Dm.Backward]||i===-1,[Dm.Forward]:e.x[Dm.Forward]||i===1},y:{[Dm.Backward]:e.y[Dm.Backward]||a===-1,[Dm.Forward]:e.y[Dm.Forward]||a===1}}},[n,t,r])}({delta:f,disabled:!a}),[h,g]=function(){let e=(0,u.useRef)(null);return[(0,u.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,u.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}(),_=(0,u.useRef)({x:0,y:0}),v=(0,u.useRef)({x:0,y:0}),y=(0,u.useMemo)(()=>{switch(n){case uh.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case uh.DraggableRect:return i}},[n,i,c]),b=(0,u.useRef)(null),x=(0,u.useCallback)(()=>{let e=b.current;if(!e)return;let t=_.current.x*v.current.x,n=_.current.y*v.current.y;e.scrollBy(t,n)},[]),S=(0,u.useMemo)(()=>s===dh.TreeOrder?[...l].reverse():l,[s,l]);(0,u.useEffect)(()=>{if(a&&l.length&&y){for(let e of S){if(!1===r?.(e))continue;let n=l.indexOf(e),i=d[n];if(!i)continue;let{direction:a,speed:s}=Wm(e,i,y,t,p);for(let e of[`x`,`y`])m[e][a[e]]||(s[e]=0,a[e]=0);if(s.x>0||s.y>0)return g(),b.current=e,h(x,o),_.current=s,void(v.current=a)}_.current={x:0,y:0},v.current={x:0,y:0},g()}else g()},[t,x,r,g,a,o,JSON.stringify(y),JSON.stringify(m),h,l,S,d,JSON.stringify(p)])}({...V,delta:x,draggingRect:Z,pointerCoordinates:oe,scrollableAncestors:re,scrollableAncestorRects:ie});let ve=(0,u.useMemo)(()=>({active:T,activeNode:z,activeNodeRect:U,activatorEvent:k,collisions:de,containerNodeRect:W,dragOverlay:q,draggableNodes:b,droppableContainers:S,droppableRects:I,over:fe,measureDroppableContainers:L,scrollableAncestors:re,scrollableAncestorRects:ie,measuringConfiguration:P,measuringScheduled:R,windowRect:ne}),[T,z,U,k,de,W,q,b,S,I,fe,L,re,ie,P,R,ne]),ye=(0,u.useMemo)(()=>({activatorEvent:k,activators:_e,active:T,activeNodeRect:U,ariaDescribedById:{draggable:M},dispatch:p,draggableNodes:b,over:fe,measureDroppableContainers:L}),[k,_e,T,U,p,M,b,fe,L]);return u.createElement(lm.Provider,{value:h},u.createElement(Fh.Provider,{value:ye},u.createElement(Ih.Provider,{value:ve},u.createElement(Vh.Provider,{value:me},i)),u.createElement(zh,{disabled:!1===n?.restoreFocus})),u.createElement(fm,{...n,hiddenTextDescribedById:M}))}),Uh=(0,u.createContext)(null),Wh=`button`;function Gh(){return(0,u.useContext)(Ih)}var Kh={timeout:25};function qh(e){let{animation:t,children:n}=e,[r,i]=(0,u.useState)(null),[a,o]=(0,u.useState)(null),s=qp(n);return n||r||!s||i(s),Hp(()=>{if(!a)return;let e=r?.key,n=r?.props.id;e!=null&&n!=null?Promise.resolve(t(n,a)).then(()=>{i(null)}):i(null)},[t,r,a]),u.createElement(u.Fragment,null,n,r?(0,u.cloneElement)(r,{ref:o}):null)}var Jh={x:0,y:0,scaleX:1,scaleY:1};function Yh(e){let{children:t}=e;return u.createElement(Fh.Provider,{value:Ph},u.createElement(Vh.Provider,{value:Jh},t))}var Xh={position:`fixed`,touchAction:`none`},Zh=e=>$p(e)?`transform 250ms ease`:void 0,Qh=(0,u.forwardRef)((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:a,className:o,rect:s,style:c,transform:l,transition:d=Zh}=e;if(!s)return null;let f=i?l:{...l,scaleX:1,scaleY:1},p={...Xh,width:s.width,height:s.height,top:s.top,left:s.left,transform:tm.Transform.toString(f),transformOrigin:i&&r?_m(r,s):void 0,transition:typeof d==`function`?d(r):d,...c};return u.createElement(n,{className:o,style:p,ref:t},a)}),$h=e=>t=>{let{active:n,dragOverlay:r}=t,i={},{styles:a,className:o}=e;if(a!=null&&a.active)for(let[e,t]of Object.entries(a.active))t!==void 0&&(i[e]=n.node.style.getPropertyValue(e),n.node.style.setProperty(e,t));if(a!=null&&a.dragOverlay)for(let[e,t]of Object.entries(a.dragOverlay))t!==void 0&&r.node.style.setProperty(e,t);return o!=null&&o.active&&n.node.classList.add(o.active),o!=null&&o.dragOverlay&&r.node.classList.add(o.dragOverlay),function(){for(let[e,t]of Object.entries(i))n.node.style.setProperty(e,t);o!=null&&o.active&&n.node.classList.remove(o.active)}},eg={duration:250,easing:`ease`,keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:tm.Transform.toString(t)},{transform:tm.Transform.toString(n)}]},sideEffects:$h({styles:{active:{opacity:`0`}}})},tg=0,ng=u.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:a,modifiers:o,wrapperElement:s=`div`,className:c,zIndex:l=999}=e,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggableNodes:h,droppableContainers:g,dragOverlay:_,over:v,measuringConfiguration:y,scrollableAncestors:b,scrollableAncestorRects:x,windowRect:S}=Gh(),C=(0,u.useContext)(Vh),w=function(e){return(0,u.useMemo)(()=>{if(e!=null)return++tg},[e])}(f?.id),T=Bh(o,{activatorEvent:d,active:f,activeNodeRect:p,containerNodeRect:m,draggingNodeRect:_.rect,over:v,overlayNodeRect:_.rect,scrollableAncestors:b,scrollableAncestorRects:x,transform:C,windowRect:S}),E=yh(p),D=function(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return Up((e,a)=>{if(t===null)return;let o=n.get(e);if(!o)return;let s=o.node.current;if(!s)return;let c=Dh(a);if(!c)return;let{transform:l}=Lp(a).getComputedStyle(a),u=km(l);if(!u)return;let d=typeof t==`function`?t:function(e){let{duration:t,easing:n,sideEffects:r,keyframes:i}={...eg,...e};return e=>{let{active:a,dragOverlay:o,transform:s,...c}=e;if(!t)return;let l=o.rect.left-a.rect.left,u=o.rect.top-a.rect.top,d={scaleX:s.scaleX===1?1:a.rect.width*s.scaleX/o.rect.width,scaleY:s.scaleY===1?1:a.rect.height*s.scaleY/o.rect.height},f={x:s.x-l,y:s.y-u,...d},p=i({...c,active:a,dragOverlay:o,transform:{initial:s,final:f}}),[m]=p,h=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(h))return;let g=r?.({active:a,dragOverlay:o,...c}),_=o.node.animate(p,{duration:t,easing:n,fill:`forwards`});return new Promise(e=>{_.onfinish=()=>{g?.(),e()}})}}(t);return qm(s,i.draggable.measure),d({active:{id:e,data:o.data,node:s,rect:i.draggable.measure(s)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:u})})}({config:r,draggableNodes:h,droppableContainers:g,measuringConfiguration:y}),O=E?_.setRef:void 0;return u.createElement(Yh,null,u.createElement(qh,{animation:D},f&&w?u.createElement(Qh,{key:w,id:f.id,ref:O,as:s,activatorEvent:d,adjustScale:t,className:c,transition:a,rect:E,style:{zIndex:l,...i},transform:T},n):null))});function rg(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ig(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function ag(e){return e!==null&&e>=0}var og={scaleX:1,scaleY:1},sg=e=>{let{rects:t,activeNodeRect:n,activeIndex:r,overIndex:i,index:a}=e,o=t[r]??n;if(!o)return null;let s=function(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r&&(i||a)?n<t?i?r.left-(i.left+i.width):a.left-(r.left+r.width):a?a.left-(r.left+r.width):r.left-(i.left+i.width):0}(t,a,r);if(a===r){let e=t[i];return e?{x:r<i?e.left+e.width-(o.left+o.width):e.left-o.left,y:0,...og}:null}return a>r&&a<=i?{x:-o.width-s,y:0,...og}:a<r&&a>=i?{x:o.width+s,y:0,...og}:{x:0,y:0,...og}},cg=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=rg(t,r,n),o=t[i],s=a[i];return s&&o?{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}:null},lg=`Sortable`,ug=u.createContext({activeIndex:-1,containerId:lg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:cg,disabled:{draggable:!1,droppable:!1}});function dg(e){let{children:t,id:n,items:r,strategy:i=cg,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:d}=Gh(),f=Yp(lg,n),p=s.rect!==null,m=(0,u.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),h=o!=null,g=o?m.indexOf(o.id):-1,_=l?m.indexOf(l.id):-1,v=(0,u.useRef)(m),y=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(m,v.current),b=_!==-1&&g===-1||y,x=function(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}(a);Hp(()=>{y&&h&&d(m)},[y,m,h,d]),(0,u.useEffect)(()=>{v.current=m},[m]);let S=(0,u.useMemo)(()=>({activeIndex:g,containerId:f,disabled:x,disableTransforms:b,items:m,overIndex:_,useDragOverlay:p,sortedRects:ig(m,c),strategy:i}),[g,f,x.draggable,x.droppable,b,m,_,c,p,i]);return u.createElement(ug.Provider,{value:S},t)}var fg=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return rg(n,r,i).indexOf(t)},pg=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!(!l||!r||s!==a&&i===o||!n&&(o===i||t!==c))},mg={duration:200,easing:`ease`},hg=`transform`,gg=tm.Transition.toString({property:hg,duration:0,easing:`linear`}),_g={roleDescription:`sortable`};function vg(e){let{animateLayoutChanges:t=pg,attributes:n,disabled:r,data:i,getNewIndex:a=fg,id:o,strategy:s,resizeObserverConfig:c,transition:l=mg}=e,{items:d,containerId:f,activeIndex:p,disabled:m,disableTransforms:h,sortedRects:g,overIndex:_,useDragOverlay:v,strategy:y}=(0,u.useContext)(ug),b=function(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}(r,m),x=d.indexOf(o),S=(0,u.useMemo)(()=>({sortable:{containerId:f,index:x,items:d},...i}),[f,i,x,d]),C=(0,u.useMemo)(()=>d.slice(d.indexOf(o)),[d,o]),{rect:w,node:T,isOver:E,setNodeRef:D}=function(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=Yp(`Droppable`),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,u.useContext)(Fh),d=(0,u.useRef)({disabled:n}),f=(0,u.useRef)(!1),p=(0,u.useRef)(null),m=(0,u.useRef)(null),{disabled:h,updateMeasurementsFor:g,timeout:_}={...Kh,...i},v=Wp(g??r),y=bh({callback:(0,u.useCallback)(()=>{f.current?(m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{l(Array.isArray(v.current)?v.current:[v.current]),m.current=null},_)):f.current=!0},[_]),disabled:h||!o}),[b,x]=Kp((0,u.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))},[y])),S=Wp(t);return(0,u.useEffect)(()=>{y&&b.current&&(y.disconnect(),f.current=!1,y.observe(b.current))},[b,y]),(0,u.useEffect)(()=>(s({type:sm.RegisterDroppable,element:{id:r,key:a,disabled:n,node:b,rect:p,data:S}}),()=>s({type:sm.UnregisterDroppable,key:a,id:r})),[r]),(0,u.useEffect)(()=>{n!==d.current.disabled&&(s({type:sm.SetDroppableDisabled,id:r,key:a,disabled:n}),d.current.disabled=n)},[r,a,n,s]),{active:o,rect:p,isOver:c?.id===r,node:b,over:c,setNodeRef:x}}({id:o,data:S,disabled:b.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...c}}),{active:O,activatorEvent:k,activeNodeRect:A,attributes:j,setNodeRef:M,listeners:N,isDragging:P,over:F,setActivatorNodeRef:I,transform:L}=function(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=Yp(`Draggable`),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:d,draggableNodes:f,over:p}=(0,u.useContext)(Fh),{role:m=Wh,roleDescription:h=`draggable`,tabIndex:g=0}=i??{},_=c?.id===t,v=(0,u.useContext)(_?Vh:Uh),[y,b]=Kp(),[x,S]=Kp(),C=function(e,t){return(0,u.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}(o,t),w=Wp(n);return Hp(()=>(f.set(t,{id:t,key:a,node:y,activatorNode:x,data:w}),()=>{let e=f.get(t);e&&e.key===a&&f.delete(t)}),[f,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,u.useMemo)(()=>({role:m,tabIndex:g,"aria-disabled":r,"aria-pressed":!(!_||m!==Wh)||void 0,"aria-roledescription":h,"aria-describedby":d.draggable}),[r,m,g,_,h,d.draggable]),isDragging:_,listeners:r?void 0:C,node:y,over:p,setNodeRef:b,setActivatorNodeRef:S,transform:v}}({id:o,data:S,attributes:{..._g,...n},disabled:b.draggable}),R=function(){var e=[...arguments];return(0,u.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}(D,M),z=!!O,B=z&&!h&&ag(p)&&ag(_),V=!v&&P,H=B?(V&&B?L:null)??(s??y)({rects:g,activeNodeRect:A,activeIndex:p,overIndex:_,index:x}):null,U=ag(p)&&ag(_)?a({id:o,items:d,activeIndex:p,overIndex:_}):x,W=O?.id,G=(0,u.useRef)({activeId:W,items:d,newIndex:U,containerId:f}),K=d!==G.current.items,q=t({active:O,containerId:f,isDragging:P,isSorting:z,id:o,index:x,items:d,newIndex:G.current.newIndex,previousItems:G.current.items,previousContainerId:G.current.containerId,transition:l,wasDragging:G.current.activeId!=null}),J=function(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,u.useState)(null),s=(0,u.useRef)(n);return Hp(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=jm(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,u.useEffect)(()=>{a&&o(null)},[a]),a}({disabled:!q,index:x,node:T,rect:w});return(0,u.useEffect)(()=>{z&&G.current.newIndex!==U&&(G.current.newIndex=U),f!==G.current.containerId&&(G.current.containerId=f),d!==G.current.items&&(G.current.items=d)},[z,U,f,d]),(0,u.useEffect)(()=>{if(W===G.current.activeId)return;if(W!=null&&G.current.activeId==null)return void(G.current.activeId=W);let e=setTimeout(()=>{G.current.activeId=W},50);return()=>clearTimeout(e)},[W]),{active:O,activeIndex:p,attributes:j,data:S,rect:w,index:x,newIndex:U,items:d,isOver:E,isSorting:z,isDragging:P,listeners:N,node:T,overIndex:_,over:F,setNodeRef:R,setActivatorNodeRef:I,setDroppableNodeRef:D,setDraggableNodeRef:M,transform:J??H,transition:J||K&&G.current.newIndex===x?gg:V&&!$p(k)||!l||!z&&!q?void 0:tm.Transition.toString({...l,property:hg})}}function yg(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var bg=[Hm.Down,Hm.Right,Hm.Up,Hm.Left],xg=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(bg.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case Hm.Down:r.top<a.top&&t.push(n);break;case Hm.Up:r.top>a.top&&t.push(n);break;case Hm.Left:r.left>a.left&&t.push(n);break;case Hm.Right:r.left<a.left&&t.push(n)}});let u=(e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=bm(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=bm(r),o=i.reduce((e,t,r)=>e+gm(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(vm)})({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),d=xm(u,`id`);if(d===o?.id&&u.length>1&&(d=u[1].id),d!=null){let e=a.get(n.id),t=a.get(d),o=t?i.get(t.id):null,u=t?.node.current;if(u&&o&&e&&t){let n=Nm(u).some((e,t)=>s[t]!==e),i=Sg(e,t),a=(l=t,!(!yg(c=e)||!yg(l))&&!!Sg(c,l)&&c.data.current.sortable.index<l.data.current.sortable.index),d=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},f={x:o.left,y:o.top};return d.x&&d.y?f:Qp(f,d)}}}var c,l};function Sg(e,t){return!(!yg(e)||!yg(t))&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var Cg=e=>{let{transform:t}=e;return{...t,y:0}},wg=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return n&&t?function(e,t,n){let r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}(r,n,t):r},Tg=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,style:r,className:i,index:a,editing:o,editable:s,selectedIndex:c,background:l,activeColor:u,borderColor:f,borderWidth:p,dragging:m,...h}=e;return(0,d.jsxs)(`div`,{ref:t,className:$(i),style:{...r,display:`flex`,flexDirection:`column`,background:c===a?`white`:l,minHeight:`0px`,fontFamily:`inherit`,fontSize:`16px`,fontWeight:c===a?`700`:`400`,lineHeight:`1`,letterSpacing:`0px`,textTransform:`none`,minWidth:`unset`},...h,children:[(0,d.jsxs)(`div`,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},children:[(0,d.jsx)(`div`,{style:{marginLeft:c===a?`0px`:`-1px`,marginTop:c===a?`0px`:`4px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}),n,c===a?(0,d.jsx)(`div`,{style:{marginLeft:`0px`,marginTop:`0px`,marginBottom:`0px`,background:`grey`,minWidth:`1px`}}):(0,d.jsx)(d.Fragment,{})]}),(0,d.jsx)(`div`,{style:{flex:`1 1 100%`,background:c===a&&u?u:`none`,minHeight:`2px`}})]})})),Eg={Wrapper:`_Wrapper_10yib_21`,fadeIn:`_fadeIn_10yib_29`,dragOverlay:`_dragOverlay_10yib_33`,Item:`_Item_10yib_43`,pop:`_pop_10yib_1`,withHandle:`_withHandle_10yib_57`,dragging:`_dragging_10yib_62`,disabled:`_disabled_10yib_72`},Dg=(0,u.memo)((0,u.forwardRef)(({color:e,dragOverlay:t,dragging:n,disabled:r,fadeIn:i,handle:a,height:o,index:s,listeners:c,onRemove:l,renderItem:f,sorting:p,style:m,transition:h,transform:g,value:_,wrapperStyle:v,...y},b)=>{(0,u.useEffect)(()=>{if(t)return document.body.style.cursor=`grabbing`,()=>{document.body.style.cursor=``}},[t]);let x=f?f({dragOverlay:!!t,dragging:!!n,sorting:!!p,index:s,fadeIn:!!i,listeners:c,ref:b,style:m,transform:g,transition:h,value:_}):(0,d.jsx)(d.Fragment,{children:_});return(0,d.jsx)(`div`,{className:$(`tab-item`,Eg.Wrapper,i&&Eg.fadeIn,p&&Eg.sorting,t&&Eg.dragOverlay),style:{...v,transition:[h,v?.transition].filter(Boolean).join(`, `),"--translate-x":g?`${Math.round(g.x)}px`:void 0,"--translate-y":g?`${Math.round(g.y)}px`:void 0,"--scale-x":g?.scaleX?`${g.scaleX}`:void 0,"--scale-y":g?.scaleY?`${g.scaleY}`:void 0,"--index":s},ref:b,children:(0,d.jsx)(`div`,{className:$(Eg.Item,n&&Eg.dragging,a&&Eg.withHandle,t&&Eg.dragOverlay,r&&Eg.disabled,e&&Eg.color,`dragging`),style:m,"data-cypress":`draggable-item`,...a?void 0:c,...y,tabIndex:a?void 0:-1,children:x})})})),Og={Row:`_Row_1kr10_1`},kg=(0,u.memo)((0,u.forwardRef)(({children:e,horizontal:t,style:n},r)=>(0,d.jsx)(`div`,{ref:r,style:{...n},className:$(Og.Row,t&&Og.horizontal),children:e}))),Ag={...eg,sideEffects:$h({styles:{active:{opacity:`0`}}})},jg=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{className:n,activationConstraint:r,animateLayoutChanges:a,adjustScale:o=!1,collisionDetection:s=Cm,coordinateGetter:c=xg,dropAnimation:l=Ag,getItemStyles:p=()=>({}),getNewIndex:m,handle:h=!1,items:g,onMove:_,isDisabled:v=()=>!1,measuring:y,modifiers:b,renderItem:x,renderDivider:S,reorderItems:C=rg,strategy:w=cg,style:T,useDragOverlay:E=!0,onDragStart:D,wrapperStyle:O=()=>({})}=e,[k,A]=(0,u.useState)(()=>g);(0,u.useEffect)(()=>{A(g)},[g]);let[j,M]=(0,u.useState)(null),N=function(){var e=[...arguments];return(0,u.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}(mm(fh,{activationConstraint:r}),mm(gh,{activationConstraint:r}),mm(nh,{scrollBehavior:`Cypress`in window?`auto`:void 0,coordinateGetter:c})),P=k.indexOf.bind(k),F=j?P(String(j)):-1,I=[];k.map((e,t)=>{I.push((0,d.jsx)(Mg,{id:e,handle:h,index:t,style:p,wrapperStyle:O,disabled:v(e),renderItem:x,animateLayoutChanges:a,useDragOverlay:E,getNewIndex:m},e));let n=S?.({key:`divider-`+e});n&&I.push(n)});let{getPortalContainer:L}=i.Z(),R=i.Ft()?.themeScope,z={};R?.mode&&(z[`data-sxl-theme-mode`]=R.mode),R?.surface&&(z[`data-sxl-theme-surface`]=R.surface);let B=R?.classes?.join(` `),V=(0,u.useRef)(null),H=(0,u.useRef)(null),U=()=>{let e=H.current;H.current=null,e&&setTimeout(()=>{let{el:t,start:n,end:r}=e;if(document.activeElement!==t)return;let i=r??t.value.length;try{t.setSelectionRange(n??i,i)}catch{}},80)};return(0,d.jsxs)(Hh,{sensors:N,collisionDetection:s,onDragStart:e=>{let{active:t}=e;t&&(D?.(e),M(t.id))},autoScroll:{canScroll:e=>{if(e===document.scrollingElement||e===document.documentElement||e===document.body)return!1;let t=V.current;return!!t&&e.contains(t)}},onDragEnd:e=>{if(M(null),U(),e.over){let t=P(String(e.over.id));F!==t&&(_?.(F,t),A(e=>C(e,F,t)))}},onDragCancel:()=>{M(null),U()},measuring:y,modifiers:b,children:[(0,d.jsx)(`div`,{ref:V,style:{display:`flex`,justifyContent:`flex-start`,boxSizing:`border-box`,...T},className:$(n,Eg.Wrapper),onMouseDown:e=>{(()=>{let e=document.activeElement;H.current=e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?{el:e,start:e.selectionStart,end:e.selectionEnd}:null})();let t=e.target;t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable||e.preventDefault()},children:(0,d.jsx)(dg,{items:k,strategy:w,children:(0,d.jsx)(kg,{ref:t,children:I})})}),E?(0,f.createPortal)((0,d.jsx)(ng,{adjustScale:o,dropAnimation:l,children:j?(0,d.jsx)(`div`,{className:B,...z,style:{display:`flex`},children:(0,d.jsx)(Dg,{value:k[F],handle:h,renderItem:x,wrapperStyle:O({index:F,isDragging:!0,id:k[F]}),index:F,dragging:!0,style:p({id:k[F],index:F,isSorting:j!==null,isDragging:!0,overIndex:-1,isDragOverlay:!0}),dragOverlay:!0})}):null}),L()):null]})}));function Mg({disabled:e,animateLayoutChanges:t,getNewIndex:n,handle:r,id:i,index:a,onRemove:o,style:s,renderItem:c,useDragOverlay:l,wrapperStyle:u}){let{attributes:f,isDragging:p,isSorting:m,listeners:h,overIndex:g,setNodeRef:_,transform:v,transition:y}=vg({id:i,animateLayoutChanges:t,disabled:e,getNewIndex:n});return(0,d.jsx)(Dg,{ref:_,value:i,disabled:e,dragging:p,sorting:m,handle:r,renderItem:c,index:a,style:s({index:a,id:i,isDragging:p,isSorting:m,overIndex:g}),onRemove:o?()=>o(i):void 0,transform:v,transition:y,wrapperStyle:u({index:a,isDragging:p,id:i}),listeners:h,"data-index":a,"data-id":i,dragOverlay:!l&&p,...f})}var Ng=`rgb(33, 115, 70)`,Pg=`#eee`,Fg=e=>(0,d.jsx)(Tg,{...e}),Ig=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,style:r,className:a,selectedTabIndex:o=0,tabNames:s=[],onSelectedTabIndexChange:c,onTabNameChange:l,onTabMove:f,renderScrollButtonStart:p=i.K,renderScrollButtonEnd:m=i.U,renderScrollButtonEdge:h=i.it,renderTabButton:g=Fg,renderTabDivider:_,propsEditLabel:v,disabled:y=!1,disableDrag:b=!1,background:x=`white`,activeColor:S=Ng,borderColor:C=Pg,borderWidth:w=1}=e,[T,E]=(0,u.useState)(o),[D,O]=(0,u.useState)(s),k=(0,u.useCallback)(e=>{let t=I.current?.[e]?.closest(`.tab-item`)??I.current?.[e];if(!t||!U.current)return;let n=U.current,r=t.getBoundingClientRect(),i=n.getBoundingClientRect();r.left>=i.left&&r.right<=i.right&&r.top>=i.top&&r.bottom<=i.bottom||n.scrollTo({top:t.offsetTop,left:t.offsetLeft,behavior:`smooth`})},[]);(0,u.useEffect)(()=>{k(o)},[o]);let A=(0,u.useCallback)((e,t)=>{t!==T&&(E(t),c?.(t))},[c,T]),j=(0,u.useCallback)((e,t)=>{f?.(e,t),E(n=>n===e?t:e<n&&t>=n?n-1:e>n&&t<=n?n+1:n)},[f]),M=(0,u.useRef)(null),[N,P]=(0,u.useState)(-1),F=(0,u.useCallback)((e,t)=>{l?.(e,t)},[l]);(0,u.useLayoutEffect)(()=>{E(o)},[o]),(0,u.useLayoutEffect)(()=>{O(s)},[s]);let I=(0,u.useRef)([]),L=(0,u.useRef)(null);(0,u.useImperativeHandle)(t,()=>Object.assign({startEdit(e){I.current?.[e]?.startEdit()},cancel(e){I.current?.[e]?.cancel()}},L.current),[T,N]);let R=(0,u.useCallback)(({value:e,index:t,dragging:n})=>{let{style:r,maxLength:i,...a}=v||{},o=(0,d.jsx)(Np,{ref:e=>{I.current[t]=e},value:e,disabled:y,maxLength:i,style:{color:T===t&&S?S:`inherit`,flex:`1 1 100%`,paddingTop:`1px`,paddingBottom:`1px`,...r},styleHover:{},onSubmit:e=>(M.current=!1,P(-1),F(t,e)),onCancel:()=>{M.current=!1,P(-1)},onChange:e=>{M.current=!0,P(t)},...a});return g({onClick:e=>A(e,t),value:e,index:t,editing:N===t&&M.current,editable:!0,disabled:y,selectedIndex:T,background:x,activeColor:S,borderColor:C,borderWidth:w,dragging:n,children:o})},[T,F,A,v,y,N,g]),[z,{width:B}]=_a(),[V,{width:H}]=_a(),U=(0,u.useRef)(null),[W,G]=(0,u.useState)({left:0,top:0,width:0,height:0}),[K,q]=(0,u.useState)(null);(0,u.useEffect)(()=>{K!==null&&U.current&&U.current.scrollTo({left:K,behavior:`smooth`})},[K]);let J=(0,u.useCallback)((e,t=!1)=>{if(!U.current)return 0;let n=U.current.firstChild.getBoundingClientRect(),r=U.current.firstChild.firstChild.children,a=0;return a=t?0:i.Et.getScrollTo(e,n.left,r,!0,Math.max(0,e-200)),q(a),Math.max(0,a)},[]),Y=(0,u.useCallback)((e,t=!1)=>{if(!U.current)return 0;let n=U.current.firstChild.getBoundingClientRect(),r=U.current.firstChild.firstChild.children,a=0,o=Math.ceil(H-B);return a=t?o:i.Et.getScrollTo(e,n.left,r,!1,Math.max(0,e+200)),q(a),Math.min(o,a)},[H,B]),ee=(0,u.useRef)(null),X=(0,u.useRef)(null),te=(0,u.useCallback)(()=>{X.current&&(clearTimeout(X.current),X.current=null,ee.current=null)},[]),ne=(0,u.useCallback)((e,t,n=260)=>{ee.current=e,X.current=setTimeout(()=>{let n=t?J(ee.current||e):Y(ee.current||e);n===ee.current?te():ne(n,t,120)},n)},[J,Y,te]);(0,u.useEffect)(()=>()=>te(),[te]);let re=(0,u.useMemo)(()=>({style:{marginLeft:`4px`,marginRight:`6px`},disabled:Math.floor(W.left)<=0||Math.floor(H-B)===0,orientation:i.bt.Horizontal,isBefore:!0,onMouseUp:te,onMouseLeave:te,onMouseDown:e=>{e.preventDefault(),ne(U.current.scrollLeft,!0)},onClick:e=>J(Math.min(U.current.scrollLeft,K??2**53-1),e.ctrlKey)}),[W,K,H,B]),ie=(0,u.useMemo)(()=>({style:{marginLeft:`6px`,marginRight:`4px`},disabled:Math.floor(H-B)<=Math.ceil(W.left),orientation:i.bt.Horizontal,isBefore:!1,onMouseUp:te,onMouseLeave:te,onMouseDown:e=>{e.preventDefault(),ne(U.current.scrollLeft,!1)},onClick:e=>Y(Math.max(U.current.scrollLeft,K??0),e.ctrlKey)}),[W,K,H,B]),ae=(0,u.useMemo)(()=>(0,d.jsxs)(d.Fragment,{children:[h?(0,d.jsx)(`div`,{style:{minWidth:`16px`}}):null,n,h?.(re)]}),[re,ie,p,m,n,h]);return(0,d.jsxs)(`div`,{style:{...r,display:`flex`,alignItems:`stretch`},className:$(a,`_TabStrip_3x0dp_1`),ref:L,children:[(0,d.jsx)(`div`,{style:{borderTop:`solid ${C} ${w}px`,position:`absolute`,width:`100%`}}),(0,d.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:ae}),(0,d.jsx)(`div`,{className:`Tabs`,ref:z,style:{flex:`1 1 100%`,display:`flex`,position:`relative`,overflow:`hidden`},children:(0,d.jsx)(`div`,{style:{position:`relative`,overflowY:`hidden`,overflowX:`hidden`,marginBottom:`3px`},ref:U,onScroll:e=>{G({left:e.target.scrollLeft,top:e.target.scrollTop,width:e.target.scrollWidth,height:e.target.scrollHeight})},children:(0,d.jsx)(jg,{isDisabled:e=>y||b,items:D,strategy:sg,modifiers:[Cg,wg],ref:V,renderItem:R,renderDivider:_,onMove:j,activationConstraint:{distance:15}})})}),(0,d.jsx)(`div`,{style:{flex:`none`,display:`flex`,alignItems:`center`},children:h?.(ie)})]})}));Ig.displayName=`TabStrip`;var Lg={"sheet-tab":`_sheet-tab_1cbiv_2`,ghost:`_ghost_1cbiv_18`},Rg=e=>{let{disabled:t,editing:n,...r}=e;return(0,d.jsx)(`div`,{...r})},zg=(e,t)=>`color-mix(in srgb, ${e} ${t}%, transparent)`,Bg={top:3,right:4.5,bottom:1.5,left:4},Vg=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,sheet:a,style:o,className:s,value:c,index:l,editing:f,editable:p,disabled:m,selectedIndex:h,dragging:g,borderColor:_,borderWidth:v,activeColor:y,background:b=`white`,tabRadius:x=4,slotSurface:S=Rg,inverted:C=!0,...w}=e,T=()=>{let e=a?.getProtection();return e?e.isPaused()?`LockOpen`:e.isLocked()?`Lock`:null:null},[E,D]=(0,u.useState)(T),[O,k]=(0,u.useState)(()=>a?a.getTabColor():null);Ni(a,{onProtectionChange:()=>{D(T())},onTabColorChange:()=>{k(a.getTabColor())},onStyleChange:()=>{k(a.getTabColor())}});let A=h===l,j=ca(),M=!A&&!g&&!O,N=g&&!O&&!A,P=null,F=null;if(O||g||M){let e=b,t=e,n=e;O?(F=O.toBlackOrWhite().toCSS(),e=O.toCSS(),t=zg(e,75),n=zg(e,10)):A||(e=`var(--sxl-color-base-100)`);let r=`linear-gradient(0deg, ${e} 0%, ${t} 60%, ${n} 90%, transparent 100%)`;P=(0,d.jsx)(`div`,{className:$(Lg.pill,M&&Lg.ghost),style:{position:`absolute`,boxSizing:`border-box`,top:`3px`,left:`4px`,right:`4.5px`,bottom:`1.5px`,opacity:A?.5:1,borderRadius:`4px`,border:M?void 0:N?`1px solid var(--sxl-tab-hover-border)`:A?`${b} solid 1px`:`var(--sxl-color-base-300) solid 1px`,background:M?void 0:N?`linear-gradient(var(--sxl-tab-hover-bg), var(--sxl-tab-hover-bg)), var(--sxl-color-base-100)`:A&&O?r:e}})}let I=_??null,L=A?(0,d.jsx)(`div`,{style:{width:`100%`,borderRadius:`4px`,minWidth:`4px`,height:`2px`,backgroundColor:`var(--sxl-color-primary)`}}):null,R=A?`var(--sxl-color-primary)`:F||`color-mix(in srgb, var(--sxl-color-base-content) 70%, transparent)`;return(0,d.jsx)(`div`,{ref:t,className:$(s),"data-sxl-theme-surface":A?`grid`:void 0,"data-sxl-theme-mode":A?j:void 0,style:{...o,display:`flex`,flexDirection:`column`,minHeight:`0px`,fontFamily:`var(--sxl-font-family)`,fontWeight:A?700:400,fontSize:`0.85rem`,letterSpacing:`0`,lineHeight:`1`,textTransform:`none`,minWidth:`unset`,cursor:g?`grabbing`:void 0,"--sxl-tab-hover-bg":`var(--sxl-color-base-100)`,"--sxl-tab-hover-border":`var(--sxl-color-base-300)`},...w,children:(0,d.jsx)(i.tn,{style:{flex:`1 1 100%`,display:`flex`,flexDirection:`row`},radius:x,variant:A&&C?`tab`:`rounded`,clipInset:A&&C?void 0:Bg,strokeColor:A?I:`transparent`,children:(0,d.jsxs)(S,{className:Lg[`sheet-tab`],disabled:m,editing:f,style:{position:`relative`,boxSizing:`border-box`,display:`flex`,alignItems:`center`,justifyContent:`center`,textTransform:`none`,borderRadius:`0px`,minHeight:`0px`,paddingLeft:`11px`,paddingRight:`12px`,paddingTop:`3px`,paddingBottom:`3px`,flex:`1 1 100%`,fontWeight:A?700:400,fontSize:`0.85rem`,letterSpacing:`0`,cursor:g?`grabbing`:m?`default`:`pointer`,color:R,backgroundColor:A?b:`transparent`,minWidth:`unset`,"--sxl-sheet-tab-input-color":`var(--sxl-color-base-content)`},children:[P,(0,d.jsxs)(`div`,{style:{zIndex:1,display:`flex`,flexDirection:`row`,alignItems:`center`},children:[(0,d.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,rowGap:`1px`,lineHeight:`1`,marginTop:A?void 0:`1px`},children:[n,L]}),E?(0,d.jsx)(r.r,{iconKey:E,style:{scale:`0.80`,marginLeft:`2px`,width:`22px`,height:`22px`}}):(0,d.jsx)(`div`,{style:{minHeight:`22px`}})]})]},c+`:`+l)})})}));Vg.displayName=`SheetTab`;var Hg=e=>(0,d.jsxs)(`svg`,{...e,viewBox:`0 0 48 48`,children:[(0,d.jsx)(`path`,{d:`M 2.2827924,0 C 1.5038324,0 0.87090248,0.52603 0.87090248,1.17149 v 25.39667 h -0.01 v 20.2607 c 0,0.39663 0.24025002,0.74639 0.60481992,0.95852 v 0.18499 h 0.50664 c 0.0972,0.0173 0.19732,0.0276 0.30092,0.0276 h 15.5346916 16.7448 v 0 h 11.35822 c 0.10311,0 0.20276,-0.0104 0.29945,-0.0276 h 0.0696 v -0.0182 c 0.59938,-0.13566 1.04238,-0.58606 1.04238,-1.12526 V 26.96484 c 0.006,-0.0429 0.009,-0.0853 0.009,-0.12925 V 1.17154 c 0,-0.64586 -0.63293,-1.17149 -1.41189,-1.17149 h -15.7478 v 2e-4 h -2.06997 V 5e-5 Z`,fill:`#547DBE`}),(0,d.jsx)(`path`,{d:`m 2.8338324,2.7184 v 9.0404 H 11.538484 V 2.7184 Z m 11.2334116,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.26696,0 v 9.0404 h 8.70465 V 2.7184 Z m 11.33258,0 v 9.0404 h 8.70465 V 2.7184 Z M 2.8338324,14.32723 v 8.84046 h 8.7046516 v -8.84046 z m 11.2334116,0 v 8.84046 h 8.70465 v -8.84046 z m 11.26696,0 v 8.84046 h 8.70465 v -8.84046 z m 11.33258,0 v 8.84046 h 8.70465 V 14.32723 Z M 2.8338324,25.73691 v 8.67308 h 8.7046516 v -8.67308 z m 11.2334116,0 v 8.67308 h 8.73721 v -8.67308 z m 11.26696,0 v 8.67308 h 8.70465 v -8.67308 z m 11.33258,0 v 8.67308 h 8.70465 V 25.73691 Z M 2.8693424,36.61859 v 8.67357 h 8.7046616 v -8.67357 z m 11.2339116,0 v 8.67357 h 8.73771 v -8.67357 z m 11.26697,0 v 8.67357 h 8.70465 v -8.67357 z m 11.33257,0 v 8.67357 h 8.70465 v -8.67357 z`,fill:`#FFFFFF`}),(0,d.jsx)(`path`,{d:`m 2.8254424,2.72091 v 9.04041 H 11.570544 V 2.72091 Z m 0,11.60889 v 8.84036 H 11.570544 V 14.3298 Z m 0,11.40958 v 8.67357 h 8.7451016 v -8.67357 z m 0.036,10.88167 v 8.67358 h 8.7451116 v -8.67358 z`,fill:`#547DBE`,fillOpacity:`0.4`}),(0,d.jsx)(`path`,{d:`m 30.820434,6.19497 c 1.85291,0 3.66241,0.29708 5.4285,0.89113 1.7656,0.5942 3.49568,1.50108 5.19073,2.72107 l -2.37584,3.25571 c -1.40941,-1.01391 -2.79515,-1.76647 -4.15721,-2.25759 -1.36206,-0.49111 -2.72412,-0.73667 -4.08618,-0.73667 -2.5817,0 -4.58902,0.53064 -6.02232,1.59218 -1.43334,1.06143 -2.14989,2.56661 -2.14989,4.51523 v 0.0237 c 0,1.36241 0.41177,2.40021 1.23532,3.11315 0.82355,0.71288 1.89253,1.24367 3.20703,1.59217 1.31446,0.3485 2.71608,0.67341 4.20493,0.97439 1.29842,0.26929 2.58944,0.58216 3.87257,0.9386 1.28263,0.3565 2.45032,0.8635 3.50356,1.52097 1.05324,0.65747 1.89288,1.5486 2.51841,2.6734 0.62553,1.12485 0.93829,2.59035 0.93829,4.39635 v 0.0477 c 0,3.18435 -1.10849,5.64817 -3.32597,7.39066 -2.21698,1.7425 -5.33724,2.61399 -9.35978,2.61399 -1.67882,0 -3.25863,-0.15841 -4.73958,-0.47523 -1.4808,-0.31681 -2.86644,-0.79204 -4.15737,-1.42617 -1.29077,-0.63363 -2.49827,-1.42567 -3.6227,-2.37612 l 2.54179,-3.20819 c 1.39383,1.204 2.91819,2.10717 4.57323,2.70928 1.6549,0.60205 3.45641,0.90307 5.40463,0.90307 2.73991,0 4.85823,-0.52704 6.35447,-1.58048 1.49674,-1.05359 2.24511,-2.53098 2.24511,-4.43213 v -0.0237 c 0,-1.37834 -0.37197,-2.43583 -1.11639,-3.17245 -0.74442,-0.73668 -1.71824,-1.2912 -2.92194,-1.66359 -1.2037,-0.37223 -2.51051,-0.6851 -3.91993,-0.9386 -1.34627,-0.23762 -2.69635,-0.51485 -4.05046,-0.83182 -1.35417,-0.31677 -2.59339,-0.7841 -3.71782,-1.40204 -1.12448,-0.61779 -2.03125,-1.49708 -2.72017,-2.63782 -0.68898,-1.14078 -1.03341,-2.66156 -1.03341,-4.5627 v -0.0237 c 0,-3.21623 1.06898,-5.70753 3.20718,-7.47386 2.13805,-1.76648 5.15506,-2.64981 9.05121,-2.64981 z`,strokeWidth:`2.5`,stroke:`#EB594D`,fill:`#f9CECB`})]}),Ug=e=>{let{items:t,checked:n,onCheckedChange:r,hasBlanks:a=!1,blanksChecked:o=!1,onBlanksChange:s,truncated:c=!1,search:l=!0,onApply:f,onClose:p,autoFocus:m=!0,renderCheckbox:h,renderItem:g,itemHeight:_=24,className:v,style:y,viewport:b}=e,x=i.Ot(),S=ca(),C=(0,u.useRef)(null),[w,T]=(0,u.useState)(``),E=(0,u.useMemo)(()=>Di(t,w),[t,w]),D=a&&!w,O=E.length+ +!!D,k=e=>E[D?e-1:e],A=e=>D&&e===0,j=i.X(e=>A(e)?o:n.has(k(e).text),[D,o,n,E]),M=i.X((e,t)=>{let n=[],i=!1;for(let t=0;t<e.length;t++)A(e[t])?i=!0:n.push(k(e[t]).text);n.length>0&&r(n,t),i&&s?.(t)},[D,E,r,s]),N=(0,u.useCallback)(e=>{if(A(e))return x(`checklist.blanks`);let t=k(e);return g?g(t):t.text},[D,E,g,x]),P=(0,u.useCallback)(e=>{let t=C.current;e.which===i.Zt.Down||e.which===i.Zt.Up?(e.preventDefault(),t?.moveHighlight(e.which===i.Zt.Down?1:-1)):e.which===i.Zt.Space?(e.preventDefault(),t?.toggleHighlighted()):e.which===i.Zt.Enter&&(e.preventDefault(),f?.())},[f]),F=(0,u.useMemo)(()=>{let e=0;for(let t=0;t<O;t++)j(t)&&e++;return e},[O,j,n,o]),I=(0,u.useMemo)(()=>({}),[n,o,E,D]);return(0,d.jsxs)(`div`,{className:$(`_root_tn3se_6`,`value-checklist`,v),style:y,...i.qt(`grid`,S),children:[l?(0,d.jsx)(Oi,{value:w,onChange:T,onClose:p,onKeyDown:P,placeholder:x(`picker.search`),autoFocus:m}):null,O===0?(0,d.jsx)(`div`,{className:`_empty_tn3se_62`,children:x(w?`picker.noMatches`:`picker.noValues`)}):(0,d.jsx)(wi,{ref:C,className:`_list_tn3se_25`,itemCount:O,itemHeight:_,isChecked:j,onCheckedChange:M,renderValue:N,renderCheckbox:h,renderDivider:()=>(0,d.jsx)(`hr`,{className:`_divider_tn3se_32`}),selectAllLabel:x(`checklist.selectAll`),cacheToken:I,autoFocus:m&&!l,viewport:b}),(0,d.jsxs)(`div`,{className:`_footer_tn3se_44`,children:[(0,d.jsx)(`span`,{className:`_count_tn3se_54`,children:x(w?`checklist.countFiltered`:`checklist.count`,{checked:F,total:O})}),c?(0,d.jsx)(`span`,{className:`_truncated_tn3se_58`,children:x(`checklist.truncated`)}):null]})]})};Ug.displayName=`ValueChecklist`;var Wg=(0,u.memo)(e=>{let{icons:t,order:n=`ascending`,size:i=16,gap:a=4,style:o,...s}=e,c=n===`descending`?[...t].reverse():t;return(0,d.jsx)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`${a}px`,lineHeight:1,...o},...s,children:c.map((e,t)=>e?(0,d.jsx)(r.r,{iconKey:e.iconKey,size:i,style:{color:e.color,flex:`0 0 auto`}},t):(0,d.jsx)(`span`,{style:{width:`${i}px`,height:`${i}px`,flex:`0 0 auto`}},t))})});Wg.displayName=`IconSetGlyphs`;var Gg=((e,t)=>{let n={};for(var r in e)Mi(n,r,{get:e[r],enumerable:!0});return t||Mi(n,Symbol.toStringTag,{value:`Module`}),n})({FindScopeOptions:()=>Kg}),Kg={Workbook:`workbook`,Sheet:`sheet`};function qg(e,t){let r=t.workbook;if(!r)return()=>{};let a=t,s=a?.notifier,c=e=>e??r.getSelectedSheetIndex();e.updateCommand(`addSheet`,{callback:e=>{r.getSheets().add({index:e,autoSelect:!0})}}),e.updateCommand(`deleteSheet`,{callback:e=>{r.getSheetAt(c(e))?.delete()}}),e.updateCommand(`duplicateSheet`,{callback:async e=>{(await r.getSheetAt(c(e))?.duplicate())?.select()}}),e.updateCommand(`hideSheet`,{callback:e=>{r.getSheetAt(c(e)).setVisibility(o.St.Visibility.Hidden)}}),e.updateCommand(`nextSheet`,{callback:e=>{r.getNextSheet(c(e)).select()}}),e.updateCommand(`previousSheet`,{callback:e=>{r.getPreviousSheet(c(e)).select()}}),e.updateCommand(`selectNextSheet`,{callback:e=>{r.getNextSheet(c(e)).select()}}),e.updateCommand(`selectPreviousSheet`,{callback:e=>{r.getPreviousSheet(c(e)).select()}}),a?.focusNameBox&&e.updateCommand(`activeNameBox`,{callback:()=>{a.focusNameBox()}}),e.updateCommand(`activeNameManager`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{a?.activateTaskPane?.(`managedNames`)}});let l,u=e=>{if(!e||!a.editable)return;let t=`=${e.getName()}(`;(function(e,t,n={}){qs(e,t)||Ks(e,t,n)})(a.editable,`${t})`,{mode:`edit`,initialSelection:{start:t.length,end:t.length}}),a.editable.getSession()?.getActiveEditor()?.focus()},d=()=>({searchByCategory:e=>r.getScripts().searchFunctions({category:e,type:`formula`,includeBuiltIn:!0,includeDeprecated:!1}),searchByText:(e,t)=>e?.trim()?r.getScripts().searchFunctions({text:e,category:t?.category,limit:t?.limit,type:`formula`,includeBuiltIn:!0}):Promise.resolve(n.I.EmptyArray),getCategories:()=>r.getScripts().getFunctionCategories({type:`formula`,includeBuiltIn:!0})});e.updateCommand(`insertFunction`,{tags:[`noTransaction`],callback:e=>{u(e)},context:d}),e.updateCommand(`insertFunctionDialog`,{tags:[`noTransaction`],callback:s?.showWindow?()=>{let e=a.editable?.getAnchor().getCoords()??null;s.showWindow(`insertFunction`,{context:d,onInput:t=>{typeof t==`string`?((e,t)=>{let n=a.editable;n&&(qs(n,e)?n.getSession()?.getActiveEditor()?.focus():n.startEdit(t??n.getAnchor().getCoords(),{dirty:e,mode:`edit`,autoFocus:!1})&&n.commit())})(t,e):u(t)}})}:void 0,context:d});let f=()=>{let t=r.getSelectedSheet(),i=t&&!t.getProtection().isFormatCellsAllowed()?[n.q(`reason.sheetProtected`)]:[];e.updateCommand(`insertFunction`,{disabledReasons:i}),e.updateCommand(`insertFunctionDialog`,{disabledReasons:i})},p=()=>{l?.(),l=r.getSelectedSheet()?.addListeners({onProtectionChange:f}),f()};p();let m=e=>{let t=r.getCalculation(),n=t.getStatus();t.calculate(e).then(t=>{globalThis.__sxlKeyDebug&&console.log(`[calc] ${e?`calculateFull`:`calculateAll`}: status ${n} -> ${t}`)})};e.updateCommand(`calculateAll`,{callback:()=>{m(!1)}}),e.updateCommand(`calculateFull`,{callback:()=>{m(!0)}});let h=[`noTransaction`,`noRepeat`],g=()=>{let t=r.getCalculation(),n=t.getCalculationMode(),a=[[`calcModeAutomatic`,o.N.CalculationMode.Automatic],[`calcModeAutomaticExceptTables`,o.N.CalculationMode.AutomaticExceptTables],[`calcModeManual`,o.N.CalculationMode.Manual]];for(let[r,i]of a)e.updateCommand(r,{state:n===i,tags:h,callback:()=>{t.setCalculationMode(i)}});e.updateCommand(`calcIterativeToggle`,{state:t.getIterativeCalculation().enabled,tags:[...h,i.en],callback:()=>{t.setIterativeCalculation(!t.getIterativeCalculation().enabled)}})};g();let _=r.getCalculation().addListeners({onOptionsChange:g});e.updateCommand(`workbookStatistics`,{callback:()=>{s?.showWindow&&s.showWindow(`workbookStatistics`,{context:()=>({getWorkbook:()=>r})})}});let v=async(e,t)=>{let i,a=r.getSelectedRanges();try{i=await(e?a?.getDependents(t):a?.getPrecedents(t))}catch(e){s?.showError?.(e);return}if(i)try{await i.select()}catch(e){s?.showError?.(e)}else s?.showMessage?.(n.r(e?`formulaTrace.noDependents`:`formulaTrace.noPrecedents`))};e.updateCommand(`selectDirectPrecedents`,{callback:()=>v(!1,!1)}),e.updateCommand(`selectPrecedents`,{callback:()=>v(!1,!0)}),e.updateCommand(`selectDirectDependents`,{callback:()=>v(!0,!1)}),e.updateCommand(`selectDependents`,{callback:()=>v(!0,!0)}),e.updateCommand(`selectTheme`,{callback:e=>{e&&r.setTheme(e)},...a?.themes?{context:()=>({theme:r.getTheme(),themes:a.themes})}:{}}),e.updateCommand(`deleteCellStyle`,{callback:e=>{e?.delete()}}),e.updateCommand(`modifyCellStyle`,{callback:e=>{let t=e?.named;t&&r.getStyles().getNamedStyles().set({name:t.getName(),style:r.getSelectedSheet().getSelectedRange().getCell().getStyle()})}}),e.updateCommand(`newCellStyle`,{callback:()=>{s?.showInput&&s.showInput({initialValue:(()=>{let e=0;for(;;){e++;let t=`Style ${e}`;try{return r.getStyles().validateStyleName(t,!0),t}catch{}}})(),title:n.r(`dialog.newCellStyle.title`),description:n.r(`dialog.newCellStyle.description`),inputLabel:n.r(`dialog.newCellStyle.inputLabel`),propsInput:{style:{minWidth:`300px`}},options:[`Ok`,`Cancel`],defaultOption:`Ok`,onValidateInput:async e=>{let t=e??``,n=null;try{r.getStyles().validateStyleName(t,!1)}catch(e){n=e.message}let i=r.getStyles().getNamedStyles().getByName(t);return{valid:n===null,message:n??(i?`Update style '${i.getName()}'.`:void 0)}}}).then(({input:e,option:t})=>{if(t!==`Ok`)return;let n=r.getSelectedSheet().getSelectedRange(),i=r.getStyles().getNamedStyles().set({name:e,style:n.getCell().getStyle()});n.getStyle().update({named:i.getName()})})}});let y=a?.findMemory,b=()=>y?.getLastFind?.()??null,x=async e=>{let t=0,i=null,a=n.q(`op.findReplace`);e?.replace&&!e?.replaceOptions?.maxCount&&(a=n.q(`op.replaceAll`));let o=await Promise.resolve(s?.showBusy?.(n.r(a))??null);try{let a=r.getSelectedSheet(),c={from:a.getSelectedCell(),...e.findOptions},l=(e?.scope??`sheet`)===`sheet`?a.find(c):r.find(c);if(e.replace){let n=r.replace(l,e.replaceText,e.replaceOptions);t=n.count,e.replaceOptions?.maxCount&&(i=n.last)}else{let e=l.next();e.done||(t++,i=e.value)}i?.select({scrollIntoView:!0,autoFocus:!1}),o?.(),!e.replaceOptions?.maxCount&&t>1&&s?.showMessage?.(n.r(`findReplace.replaced`,{count:t}))}catch(e){o?.(),s?.showError?.(e)}return t},S=async e=>{let t=await x(e),n=(e=>{let t=e.findOptions;return t?.text?{text:t.text,matchCase:t.matchCase,matchEntireCell:t.matchEntireCell,useRegex:t.useRegex,fields:t.fields,axis:t.axis,scope:e.scope}:null})(e);return n&&(y?.setLastFind?.(n),T()),t},C=(e=!1)=>{if(!s?.showWindow)return;let t=r.getSelectedCell(),n={initialValue:{findOptions:{text:(t.getFormulaText({target:`display`})??t.getText({useFormattingCategory:!0}))||b()?.text||``},replace:e},context:()=>S,autoFocus:!0,disableAutoDestroy:!0};s.showWindow(`find`,n)};e.updateCommand(`find`,{callback:()=>C(!1)}),e.updateCommand(`findReplace`,{callback:()=>C(!0)});let w=e=>{let t=b();if(!t)return;let{scope:n,...r}=t;return x({findOptions:{...r,reverse:e},scope:n,replace:!1})};function T(){let t=b()?[]:[n.q(`reason.noPreviousSearch`)];e.updateCommand(`findNext`,{disabledReasons:t}),e.updateCommand(`findPrevious`,{disabledReasons:t})}e.updateCommand(`findNext`,{callback:()=>{w(!1)}}),e.updateCommand(`findPrevious`,{callback:()=>{w(!0)}}),T(),e.updateCommand(`goto`,{callback:()=>{s?.showInput&&s.showInput({title:n.r(`dialog.goTo.title`),inputLabel:n.r(`dialog.goTo.inputLabel`),options:[{id:`Go To`,label:()=>n.r(`dialog.goTo`)}],onInput:async e=>{if(e)try{await r.getRanges(e).select()}catch(e){s.showMessage?.(e.message,{type:i.rt.Error})}}})}}),e.updateCommand(`selectNamed`,{callback:async e=>{if(e)try{await e.select()}catch(e){s?.showError?.(e)}}}),e.updateCommand(`addNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:()=>{a?.activateTaskPane?.(`managedNames`,{args:{insert:!0}})}}),e.updateCommand(`editNamedReference`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{e&&a?.activateTaskPane?.(`managedNames`,{args:{edit:e}})}}),e.updateCommand(`deleteNamedReference`,{callback:e=>{e?.delete?.()}}),e.updateCommand(`manageExternalLinks`,{tags:[`noTransaction`,`noRepeat`],callback:e=>{let t=e===`settings`?`settings`:`links`;a?.activateTaskPane?.(`externalLinks`,{args:{tab:t}})}}),e.updateCommand(`activateTask`,{callback:()=>{s?.showInput&&s.showInput({title:n.r(`dialog.activateTask.title`),inputLabel:n.r(`dialog.activateTask.inputLabel`),options:[{id:`Activate`,label:()=>n.r(`dialog.activate`)}],onInput:async e=>{if(e)try{a?.activateTaskPane?.(e)}catch(e){s.showError?.(e.message)}}})}});let E=()=>{let t=r.getView();t&&(e.updateCommand(`workbookViewToggleShowFormulaBar`,{state:t.isShowFormulaBar(),callback:()=>{t.setShowFormulaBar(!t.isShowFormulaBar())}}),e.updateCommand(`workbookViewToggleShowTabs`,{state:t.isShowTabs(),callback:()=>{t.setShowTabs(!t.isShowTabs())}}),e.updateCommand(`workbookViewToggleShowStatusBar`,{state:t.isShowStatusBar(),callback:()=>{t.setShowStatusBar(!t.isShowStatusBar())}}),e.updateCommand(`workbookViewToggleShowHorizontalScrollBar`,{state:t.isShowHorizontalScrollbar(),callback:()=>{t.setShowHorizontalScrollbar(!t.isShowHorizontalScrollbar())}}),e.updateCommand(`workbookViewToggleShowVerticalScrollBar`,{state:t.isShowVerticalScrollbar(),callback:()=>{t.setShowVerticalScrollbar(!t.isShowVerticalScrollbar())}}))};E();let D=()=>{e.updateCommand(`locale`,{state:r.getPinnedLocale(),callback:e=>{r.setLocale(e??null)}})};D();let O=()=>{let t=r.getProtection().isStructureAllowed()?[]:[`The workbook structure is protected.`];for(let n of[`addSheet`,`duplicateSheet`,`selectTheme`,`addNamedReference`,`editNamedReference`,`deleteNamedReference`])e.updateCommand(n,{disabledReasons:t});let n=r.getSheets().getCount()<=1,i=[...t,...n?[`A workbook must have at least one visible sheet.`]:[]];e.updateCommand(`hideSheet`,{disabledReasons:i}),e.updateCommand(`deleteSheet`,{disabledReasons:i})};O();let k=r.addListeners({onSheetsChange:()=>{O()},onViewChange:()=>{E(),D()},onProtectionChange:()=>{O()},onSelectedSheetChange:()=>{p()}});return()=>{k(),_(),l?.()}}var Jg={dynamic:(e,t)=>{let r=t.manager?function(e,t){let{manager:r,notifier:i}=t;if(!r)return()=>{};let a={undoManager:r},o=()=>{let t=r.getTopUndoDescription(),o=r.getTopRedoDescription();e.updateCommand(`undo`,{context:a,callback:e=>{try{r.undo(e??1)}catch(e){i?.showError?.(e)}},disabledReasons:r.hasUndo()?[]:[n.q(`reason.nothingToUndo`)],params:{hasAction:!!t,action:t?n.r(t):``}}),e.updateCommand(`redo`,{context:a,callback:e=>{try{r.redo(e??1)}catch(e){i?.showError?.(e)}},disabledReasons:r.hasRedo()?[]:[n.q(`reason.nothingToRedo`)],params:{hasAction:!!o,action:o?n.r(o):``}})};o();let s=r.addListener({onStackChange:o});return()=>{s()}}(e,{manager:t.manager,notifier:t.notifier}):void 0,i=qg(e,t);return()=>{r?.(),i()}}},Yg=new class{constructor(){this._loadedIO=null,this._loadPromise=null,this._backingStore=null,this._listeners=new Set,this._lazyDefaultStore={write:async e=>(await this._loadIO()).getBackingStore().write?.(e)??null}}async _loadIO(){return this._loadedIO?this._loadedIO:(this._loadPromise||=(async()=>{try{let e=await Promise.resolve().then(()=>require("./DW8fGIUUK-oUTjOo.cjs")).then(e=>e.t);return await s.d.install(e.IOPlugin),this._loadedIO=s.d,this._loadedIO.addListeners({onRead:(e,t)=>{for(let e of this._listeners)e.onRead?.(this,t)},onWrite:(e,t)=>{for(let e of this._listeners)e.onWrite?.(this,t)}}),this._backingStore&&this._loadedIO.setBackingStore(this._backingStore),this._loadedIO}catch(e){throw this._loadPromise=null,e}})(),this._loadPromise)}async getReadFormats(e){return(await this._loadIO()).getReadFormats(e)}async getWriteFormats(e){return(await this._loadIO()).getWriteFormats(e)}async install(e){return(await this._loadIO()).install(e)}getOrigin(e){return new s.c(e)}async read(e){return(await this._loadIO()).read(e)}async writeArrayBuffer(e,t){return(await this._loadIO()).writeArrayBuffer(e,t)}async write(e,t,n){return(await this._loadIO()).write(e,t,n)}async writeAs(e,t,n){return(await this._loadIO()).writeAs(e,t,n)}getBackingStore(){return this._backingStore??(this._loadedIO?this._loadedIO.getBackingStore():this._lazyDefaultStore)}setBackingStore(e){this._backingStore=e??null,this._loadedIO?.setBackingStore(this._backingStore)}canWrite(){return typeof this.getBackingStore().write==`function`}canRead(){return typeof this.getBackingStore().read==`function`}addListeners(e,t){return this._listeners.add(e),()=>{this._listeners.delete(e)}}addCommitListener(e){return this.addListeners({onWrite:(t,n)=>{n.save&&e.onCommit?.({store:n.workbook.getTransactions(),commitId:n.commitId})}})}get isIWorkbookIO(){return!0}},Xg=(e,t={})=>{let{io:r,defaultTheme:i,reloadKey:a}=t,o=(0,u.useRef)({io:r,defaultTheme:i});o.current={io:r,defaultTheme:i};let[c,l]=(0,u.useState)(()=>e instanceof s.g?{status:`loaded`,workbook:e}:{status:`loading`}),d=(0,u.useRef)(c);return d.current=c,(0,u.useEffect)(()=>{let t=!0;return l(e=>e.status===`loaded`?e:{status:`loading`}),(async()=>{try{let r=await(async(e,t={})=>{let{io:r=Yg,defaultTheme:i}=t;if(e instanceof s.g)return e;if(!e||!n.I.isPromiseLike(e)&&Object.keys(e).length===0)return new s.g({theme:i});let a=await Promise.resolve(e);return a instanceof s.g?a:a&&a.source?r.read(a):a})(e,o.current);if(!t)return;let i=d.current,a=r??(i.status===`loaded`?i.workbook:new s.g({theme:o.current.defaultTheme}));l(e=>e.status===`loaded`&&e.workbook===a?e:{status:`loaded`,workbook:a})}catch(e){if(!t)return;l({status:`error`,error:e})}})(),()=>{t=!1}},[e,a]),c},Zg=!1,Qg=!1,$g=null,e_=e=>{Qg=e},t_=e=>(0,d.jsx)(Vg,{...e}),n_=`var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3)))`,r_=`1px`,i_=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{children:n,workbook:a,onBeforeUserChange:o,onUserChange:s,disabled:c=!1,readOnly:l=!1,className:f,style:p,condensed:m=!1,renderSheetTab:h=t_,onTabContextMenu:g,renderScrollButtonStart:_,renderScrollButtonEnd:v,renderScrollButtonEdge:y,...b}=e,x=i.Ot(),S=m?null:_,C=m?null:v,w=m?null:y,T=(0,u.useRef)(null),E=(0,u.useRef)(null);(0,u.useImperativeHandle)(t,()=>Object.assign({startEdit(e){E.current?.startEdit(e)},cancel(e){E.current?.cancel(e)}},T.current),[]);let[D,O]=(0,u.useState)(a?.getSelectedSheetIndex()),[k,A]=(0,u.useState)(a?.getSheets().getItems()),[j,M]=(0,u.useState)(()=>a?.getProtection().isStructureAllowed()??!0);Ni(a,{onViewChange(e){O(e?.getSelectedSheetIndex())},onSheetsChange:e=>{A(e.getSheets().getItems())},onProtectionChange:e=>{M(e?.getProtection().isStructureAllowed()??!0)}});let N=l||!j,P=`color-mix(in srgb, var(--sxl-color-base-300) 25%, transparent)`,F=(0,u.useMemo)(()=>{let e=[];for(let t=0;t<k.length;t++)e.push(k[t].getName());return e},[k]),I=(0,u.useCallback)(e=>{!1!==o?.(e)&&(a.getSheetAt(e).select(),s?.(e))},[a,o,s]),L=(0,u.useCallback)((e,t)=>{a.getSheetAt(e).setName(t),s?.(e)},[a,s]),R=(0,u.useCallback)((e,t)=>{a.getSheetAt(e).setIndex(t),s?.(t)},[a,s]),z=i.X(()=>{if(!1===o?.(D))return;let e=D+1;a.getSheets().add({name:void 0,index:e,autoSelect:!0}),s?.(e)},[a,o,s,D]),B=i.X(e=>{let t;try{t=a.getSheetAt(e.index)}catch{}return t?h({sheet:t,inverted:!m,onContextMenu:g?t=>{I(e.index),g(t,e.index)}:void 0,...e}):(0,d.jsx)(d.Fragment,{})},[a,m,h,g,I]),V=i.X(e=>{let{key:t,style:n,...r}=e;return(0,d.jsx)(`div`,{...r,style:{alignSelf:`stretch`,width:`1px`,marginLeft:`-1px`,marginTop:`6px`,marginBottom:`6px`,background:P,...n}},t)},[P]),H=(0,u.useMemo)(()=>N?null:(0,d.jsx)(`button`,{type:`button`,className:$(`workbook-strip-add`,`_add-button_1b4ig_1`),disabled:c,"aria-label":`addTab`,title:x(`workbookStrip.newSheet`),onMouseDown:e=>{e.button===0&&e.preventDefault()},onClick:()=>z(),children:(0,d.jsx)(r.r,{iconKey:`AddCircle`,style:{width:`18px`,height:`18px`}})}),[c,N,z,x]);return(0,d.jsxs)(`div`,{ref:T,className:$(`workbook-strip`,f),style:{position:`relative`,display:`flex`,alignItems:`stretch`,flex:`1 1 100%`,maxWidth:`100%`,...p},...b,children:[(0,d.jsx)(Ig,{ref:E,selectedTabIndex:D,tabNames:F,onSelectedTabIndexChange:I,onTabNameChange:L,onTabMove:R,background:`var(--sxl-color-base-100)`,borderColor:n_,activeColor:null,disabled:c,disableDrag:N,renderTabButton:B,renderTabDivider:V,renderScrollButtonStart:S,renderScrollButtonEnd:C,renderScrollButtonEdge:w,propsEditLabel:{readOnly:N,maxLength:31,styleHover:{fontWeight:`700`},onKeyPress:e=>{a.isValidSheetNameCharacter(e.key)||e.preventDefault()},onCancel:()=>{s?.(D)}},children:n}),(0,d.jsx)(`div`,{style:{borderTop:`solid ${n_} ${r_}`,minWidth:`4px`}}),(0,d.jsx)(`div`,{style:{borderTop:`solid ${n_} ${r_}`,flex:`none`,display:`flex`,alignItems:`center`},children:H}),(0,d.jsx)(`div`,{style:{borderTop:`solid ${n_} ${r_}`,flex:1,minWidth:`24px`}})]})}));i_.displayName=`WorkbookStrip`;var a_=e=>{let{key:t,...n}=e;return(0,d.jsx)(zf,{...n},t)},o_=e=>(0,d.jsx)(i_,{...e}),s_=e=>{let{transitionDelay:t,transparentBackground:n,onMount:r,onUnmount:i,className:a,style:o,...s}=e;return(0,d.jsx)(`div`,{className:$(`_loading-panel_bjv3h_1`,a),style:{background:n?`transparent`:`var(--sxl-color-base-100, #fff)`,...o},...s,children:(0,d.jsx)(`div`,{className:`_loading-spinner_bjv3h_10`})})},c_={"sheetxl-workbook":`_sheetxl-workbook_r60qk_11`,"sheetxl-reset":`_sheetxl-reset_r60qk_36`,viewport:`_viewport_r60qk_30`},l_={version:1};Su();var u_={ignoreModelChange:!0},d_={flex:`1 1 100%`,display:`flex`,boxSizing:`border-box`},f_=`solid var(--sxl-color-base-border, light-dark(rgba(0, 0, 0, 0.26), rgba(255, 255, 255, 0.3))) 1px`,p_=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{workbook:r,onWorkbookLoad:a,autoFocus:c=!1,style:l,className:f,onFocus:p,onBlur:m,onKeyDown:h,undoManager:g,focusNameBox:_,showTabs:v,propsTabs:y,renderTabs:b=o_,propsContextMenu:x,renderContextMenu:S,renderColumnMenu:C,renderMovableMenu:w,renderFillMenu:T,propsFloatPanel:E,renderFloatPanel:D,renderWorkbookLoading:O=s_,propsWorkbookLoading:k,propsSheet:A,editable:j,renderSheet:M=a_,wrapperMain:N,showHorizontalScrollbar:P,showVerticalScrollbar:F,colorScheme:I,gridColorScheme:L,...R}=e;if(!r)throw Error(`IWorkbook must be provided.`);let z=(0,u.useRef)(null),B=(0,u.useRef)(null),V=(0,u.useMemo)(()=>(0,d.jsx)(`div`,{className:$(`sheetxl-viewport`,c_.viewport),style:{width:`100%`,height:`100%`,boxSizing:`border-box`,position:`absolute`,pointerEvents:`none`},ref:B}),[]),[H,U]=(0,u.useState)(!1),[W,G]=(0,u.useState)(!1),K=(0,u.useCallback)(()=>{U(!0)},[]),q=(0,u.useRef)(null),J=i.st(t,()=>({isWorkbookElement:()=>!0,getWorkbook:()=>r,getSheetElement:()=>z.current,getViewportElement:()=>B.current,getCommandScope:()=>q.current,focus(){z&&z.current&&z.current.focus()}}),[r]),[Y,ee]=(0,u.useState)(null),X=(0,u.useCallback)(e=>{e&&ee(e)},[]),te=(0,u.useRef)(null);(0,u.useLayoutEffect)(()=>{!H||!Y||(async()=>{te.current!==a&&(await a?.({source:Y}),te.current=a??null),G(!0)})()},[H,Y]);let ne=i.X(e=>{y?.onUserChange?.(e);let t=document.activeElement;t&&t!==document.body&&!J.current?.contains(t)||requestAnimationFrame(()=>{z?.current?.focus()})},[y]),[re,ie]=(0,u.useState)(r.getSelectedSheet()),[ae,oe]=(0,u.useState)(r.getProtection());Ni(r,{onSheetsChange:e=>{ie(e?.getSelectedSheet())},onViewChange(e){ie(e?.getSelectedSheet())},onProtectionChange:e=>{oe(e?.getProtection())}}),Ni(r,{onRequestSelect:async(e,t)=>new Promise(e=>{let n=z.current;n?n.getSheet()===t?e(!0):n.getGridSurface()?.onPaneChangeOnce(()=>{z.current?.getSheet()!==t&&e(!1),e(!0)}):e(!1)})},u_);let[se,ce]=(0,u.useReducer)(e=>e+1,0),le=r.getView();Ni(le,{onViewChange:e=>{ce()}});let[ue]=i.Gt(sa.Mode,null),[Z]=i.Gt(sa.DarkImages,!1),{themeMode:de}=i.Tt({mode:I??ue??void 0}),Q=ca(L),fe=(0,u.useId)(),pe=(0,u.useMemo)(()=>i.Rt(`workbook`,fe),[fe]),me=(0,u.useMemo)(()=>ji({scope:`.${pe}`}),[pe]),he=(0,u.useMemo)(()=>ra(`sxl-defaults`,`.${pe}`),[pe]),[ge,_e]=(0,u.useState)({});(0,u.useLayoutEffect)(()=>{if(!Y)return;let e=getComputedStyle(Y),t=t=>e.getPropertyValue(t).trim()||void 0,n=t(`--icon-color`);_e({base100:t(`--sxl-color-base-100`),primary:t(`--sxl-color-primary`),icon:n&&n!==`currentColor`?n:e.color||void 0})},[Y,de]);let ve=(0,u.useMemo)(()=>({backgroundColor:ge.base100,borderColor:ge.primary,fillColor:ge.icon??`grey`}),[ge]),ye=(0,u.useMemo)(()=>new i.wt,[]),be=i.Jt.useCommandScope(),xe=i.ot(),Se=Fl(),Ce=Xi(),[we,Te]=(0,u.useState)(g??null);(0,u.useEffect)(()=>{if(!be)return void Te(null);if(g)return void Te(g);if(!r)return void Te(null);let e=new s.r(r.getTransactions());return Te(e),()=>e.close()},[be,r,g]);let[Ee,De]=i.Gt(`workbook.lastFind`,null,l_),Oe=(0,u.useRef)(Ee);Oe.current=Ee;let ke=(0,u.useMemo)(()=>({getLastFind:()=>Oe.current,setLastFind:De}),[De]),Ae=(0,u.useMemo)(()=>({scopeName:{key:r?`workbook:${r.getId()}`:`workbook`,name:`workbook`},contributor:Jg,data:{workbook:r,editable:j,notifier:xe,manager:we??void 0,activateTaskPane:(e,t)=>Se.activate(e,t),themes:Ce,focusNameBox:_,findMemory:ke}}),[r,j,xe,we,Se,Ce,_,ke]),[je,Me]=(0,u.useState)(!1),[Ne,Pe]=(0,u.useState)(null),[Fe,Ie]=(0,u.useState)(i.nn.Top),[Le,Re]=(0,u.useState)(n.v.EmptyBounds),ze=(0,u.useCallback)(()=>{Me(!1),Pe(null)},[]),Be=(0,u.useCallback)((e,t,n=i.nn.Top)=>{Re(e),Ie(n),Pe(t),Me(!0)},[]),Ve=v??le?.isShowTabs(),He=P??le?.isShowHorizontalScrollbar(),Ue=F??le?.isShowVerticalScrollbar(),[We,{width:Ge}]=_a(),Ke=Ge===0||Ge>560,qe=(0,u.useMemo)(()=>{if(!Ve||!b)return null;let e=b({condensed:!Ke,workbook:r,...y,onUserChange:ne});return e.type===u.Fragment?null:(Ke||(e=(0,d.jsx)(`div`,{style:{flex:`none`,display:`flex`},children:e})),e)},[b,y,r,Ke,Ve]),Je=(0,u.useCallback)(e=>{let{style:t,...n}=e,a=null,o=null,s=null;if(He&&(o=(0,d.jsx)(`div`,{className:`workbook-strip-scrollbar`,style:{display:`flex`,flex:`1 1 100%`,borderTop:f_,flexDirection:`column`,justifyContent:`center`},children:(0,d.jsx)(Ef,{...n,style:{paddingLeft:`4px`,paddingRight:`4px`,...t},propsTouchThumb:ve,endGap:700,sheet:re,onShowTooltip:e=>{Be({x:e.anchor.x,y:e.anchor.y,width:0,height:0},e.display??``,e.placement)},onCloseTooltip:()=>ze()})})),Ve&&Ke&&(s=qe),Ve&&Ke&&!He&&(s=(0,d.jsxs)(`div`,{style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`},children:[s,(0,d.jsx)(`div`,{style:{borderTop:f_,flex:`1`}})]})),s&&He){let e=ge.icon??`grey`;a=(0,d.jsx)(i.Wt,{position:r.getView().getTabRatio()/10+`%`,onPositionChange:({percent:e})=>{r.getView().setTabRatio(Math.round(10*e))},minBefore:`200px`,minAfter:`180px`,propsResizer:{style:{minWidth:`11px`,backgroundImage:`url("data:image/svg+xml,%3Csvg width='6.4' height='12' viewBox='0 0 9.6 16' version='1.1' fill='${e}' xmlns='http://www.w3.org/2000/svg' xmlns:svg='http://www.w3.org/2000/svg'%3E%3Cpath d='M 9.60008,14.40009 C 9.60008,15.28374 8.88368,16 8.00003,16 7.11639,16 6.40012,15.28374 6.40012,14.40009 c 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40012 c 0,0.88364 -0.7164,1.60004 -1.60005,1.60004 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60004 0,-0.88365 0.71627,-1.60005 1.59991,-1.60005 0.88365,0 1.60005,0.7164 1.60005,1.60005 m 0,-6.40006 c 0,0.88365 -0.7164,1.60005 -1.60005,1.60005 -0.88364,0 -1.59991,-0.7164 -1.59991,-1.60005 C 6.40012,0.71626 7.11639,0 8.00003,0 8.88368,0 9.60008,0.71626 9.60008,1.59991 M 3.19996,14.40009 C 3.19996,15.28374 2.48369,16 1.60005,16 0.7164,16 0,15.28374 0,14.40009 c 0,-0.88365 0.7164,-1.60005 1.60005,-1.60005 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40012 c 0,0.88364 -0.71627,1.60004 -1.59991,1.60004 C 0.7164,9.60001 0,8.88361 0,7.99997 0,7.11632 0.7164,6.39992 1.60005,6.39992 c 0.88364,0 1.59991,0.7164 1.59991,1.60005 m 0,-6.40006 c 0,0.88365 -0.71627,1.60005 -1.59991,1.60005 C 0.7164,3.19996 0,2.48356 0,1.59991 0,0.71626 0.7164,0 1.60005,0 2.48369,0 3.19996,0.71626 3.19996,1.59991' /%3E%3C/svg%3E%0A")`,backgroundRepeat:`no-repeat`,backgroundPosition:`center`,borderTop:f_,borderBottom:`solid 3px transparent`}},elementBefore:s,elementAfter:o??void 0})}else if(He)a=o;else{if(!s)return(0,d.jsx)(`div`,{className:$(`workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,alignContent:`center`,height:`1px`,width:`100%`,borderTop:f_}});a=s}return(0,d.jsx)(`div`,{className:$(`workbook-strip-area`),style:{display:`flex`,flex:`1`,position:`relative`,width:`100%`,alignContent:`center`},children:a})},[re,r,Ve,He,Ke,qe,ve,ge]),[Ye,Xe]=(0,u.useState)(null),Ze=(0,u.useContext)(fu),Qe=(0,u.useMemo)(()=>new i.Jt.ManualActivation(null),[]),{reference:$e,component:et}=i.R({label:`contextMenu`,propsPopper:(0,u.useMemo)(()=>({placement:`right-start`,...Ye?.propsPopper}),[Ye?.propsPopper]),anchor:Ye?.anchor??{getBoundingClientRect:()=>new DOMRect(Ye?.clientX||0,Ye?.clientY||0)},onClose:()=>{Ye?.onClose?.(),Xe(null)},createPopupPanel:Ye?.createPopupPanel,renderFloatPanel:D});(0,u.useEffect)(()=>{Ye?$e.open(0):$e.close(0)},[Ye]);let tt=i.X((e,t)=>!!e?.isDefaultPrevented()||!!C&&(e.preventDefault(),e.stopPropagation(),Ye&&Ye.anchor===e.currentTarget?(Xe(null),!0):(Qe.setAnchor(Ze?.getAnchor()??null),Xe({anchor:e.currentTarget,propsPopper:{offsets:[-4,2]},createPopupPanel:e=>{let{floatReference:n}=e;return C({column:t,floatReference:n,...x})}}),!0)),[C,x,r,Ye]),nt=i.X(e=>!!e.originalEvent?.isDefaultPrevented()||!!S&&(e.originalEvent?.preventDefault(),Qe.setAnchor(Ze?.getAnchor()??null),Xe({clientX:e.clientX,clientY:e.clientY,createPopupPanel:e=>{let{floatReference:t}=e;return S({workbook:r,floatReference:t,...x})}}),!0),[S,x,r]),rt=i.X((e,t)=>!!T&&(e.originalEvent?.preventDefault(),Qe.setAnchor(Ze?.getAnchor()??null),Xe({clientX:e.clientX,clientY:e.clientY,onClose:()=>{t.cancel()},createPopupPanel:e=>{let{floatReference:n}=e;return T({workbook:r,menu:t,floatReference:n,...x})}}),!0),[T,x,r]),it=i.X((e,t)=>!!e?.isDefaultPrevented()||!!w&&(e.preventDefault(),Qe.setAnchor(Ze?.getAnchor()??null),Xe({clientX:e.clientX,clientY:e.clientY,createPopupPanel:e=>{let{floatReference:n}=e;return w({movable:t,floatReference:n,...x})}}),!0),[w,x,r]),at=i.X(()=>{Y&&(async e=>{let t=await o.a.getDetails();if(Qg||t.isEval()){try{let e=top??window;e.SheetXL||=Object.freeze({getSelectedWorkbook:()=>$g?.getWorkbook(),getSelectedSheet:()=>$g?.getWorkbook().getSelectedSheet(),getSelectedRange:()=>$g?.getWorkbook().getSelectedRange(),getSelectedRanges:()=>$g?.getWorkbook().getSelectedRanges(),getRange:e=>$g?.getWorkbook().getRange(e),getSelectedWorkbookElement:()=>$g,getLicenseManager:()=>o.a,moreExamples:()=>{console.table({"SheetXL.getRange('Sheet1!e5:f6').setValues([[110, 220], [210, 220]])":{Summary:`Set an array of values.`},"SheetXL.getRange('a1:e5').setValue(100, { autoSelect: true })":{Summary:`Set a single repeating value to a range.`},"SheetXL.getRange('Sheet1!e5:f6').getValues()":{Summary:`Get the values as a 2d array (see forEach).`},"SheetXL.getSelectedRange().setValue(new Date())":{Summary:`Set current date/time using Javascript Date.`},"SheetXL.getSelectedRange().setValue('10/23/95')":{Summary:`Set current date/time using string.`},"SheetXL.getSelectedSheet().getUsedRange().getValues()":{Summary:`Get all of the values in a sheet.`},"SheetXL.getSelectedRange().getStyle().update({ fill: 'accent4' })":{Summary:`Set fill to theme color 4.`},"SheetXL.getRange('E:L').getStyle().update({ fill: 'accent1 lumMod 90 lumOff 40' })":{Summary:`Set some columns to a modified theme color.`},"SheetXL.getRange('e5:f10').getStyle().update({ style: { border: 'double blue' }})":{Summary:`Set border.`},"SheetXL.getSelectedRange().getStyle().getFill().toCSS()":{Summary:`Get the fill style as css for the selected range.`},"SheetXL.getRange('a1:a3').autoFill('a1:a7')":{Summary:`Autofill down.`},"SheetXL.getRange('e7:i9').merge({ axis: 'rows' })":{Summary:`Merge cells horizontally.`},"SheetXL.getSelectedRange().sort({ ascending: false, hasHeader: false })":{Summary:`Sort selected cells ascending with a header.`},"SheetXL.getSelectedRange().clear('all')":{Summary:`Clear the current range a different way.`},"SheetXL.getSelectedSheet().getTables().add('b2:e9')":{Summary:`Create a 4x8 table at b2 for current sheet.`},"SheetXL.getRange('a1:c3').copyFrom('e1:g3')":{Summary:`Copy cells.`},"SheetXL.getRange('c:t').getColumnHeaders().setSize(30)":{Summary:`Set the size of columns to 30 pixels.`},"SheetXL.getRange('2:3').delete()":{Summary:`Remove rows 2 and 3 and shift up.`},"SheetXL.getSelectedSheet().getMovables().addPicture('https://www.sheetxl.com/logo-text.svg')":{Summary:`Add an image.`},"SheetXL.getSelectedSheet().getMovables().addPicture('https://www.sheetxl.com/logo-text.svg', { bounds: { height: 100 } })":{Summary:`Add an image of height 100.`},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue(1.50).getStyle().update({ numberFormat: '0%' }).autoFit(); }, 'Enter 150%')":{Summary:`Set value to 100 and numberformat to 0% as a single.`},"SheetXL.getSelectedRange().doBatch(() => { SheetXL.getSelectedRange().setValue('Remind Me Later').getStyle().update({ namedStyle: 'Note'}).autoFit(); }, 'Set Reminder')":{Summary:`Set a value and style to Note style and autofit text.`},"SheetXL.getSelectedWorkbook().getNames().addFormula('Small_Range', 'A2:E5');":{Summary:`Add a named range.`},"SheetXL.getSelectedWorkbook().getRange('a1:e5').addListener((e) => { console.log('got an update for:', e.getSource().toString()) })":{Summary:`Listen for updates at a range.`}})}})}catch(e){e instanceof DOMException||console.error(e),Zg=!0}if($g!==e&&($g=e,!Zg))try{Zg=!0,(top??window).SheetXL&&(await o.a._validate(!0),o.a.wasPrinted()&&(()=>{n.I.consoleWithNoSource(`%cTip: You can access the API directly in the console.
39
+ Try
40
+ %c>%c SheetXL.getRange('b2:c3').setValues([[42, 'Hello Word'], [new Date(), true]]) %c
41
+ >%c SheetXL.moreExamples()`,`color:#ffa726;`,`font-family:monospace;color:#1976d2;font-size:12px;`,`font-family:monospace;`,`font-family:monospace;color:#1976d2;font-size:12px;`,`font-family:monospace;`),Zg=!0;let e=document.getElementById(`openEditorLink`);e&&e.addEventListener(`click`,e=>{e.preventDefault(),console.log(`openScriptEditor called from console`)})})())}catch(e){e instanceof DOMException||console.error(e)}}})(Y)},[Y]),ot=(0,u.useCallback)(e=>{let{style:t,...n}=e;return(0,d.jsx)(Ef,{...n,style:{...t,paddingTop:`4px`,paddingBottom:`4px`},propsTouchThumb:ve,sheet:re,endGap:700,onShowTooltip:e=>{Be(e.anchor,e.display??``,i.nn.Left)},onCloseTooltip:()=>ze()})},[re,ve]);(0,u.useEffect)(()=>{c&&W&&z.current&&z.current.focus(typeof c==`object`?c:void 0)},[c,W]);let st=(0,u.useRef)(null),ct=(0,u.useMemo)(()=>W||!O?null:O?.({...k})??null,[W,O,k]),lt=(0,u.useMemo)(()=>ct?(0,d.jsx)(`div`,{ref:st,style:{display:`flex`,alignItems:`center`,justifyContent:`center`,left:`0px`,top:`0px`,width:`100%`,height:`100%`,position:`absolute`,boxSizing:`border-box`,pointerEvents:l?.pointerEvents},children:ct}):null,[ct,l]),ut=(0,u.useCallback)(e=>{let{movable:t,...n}=e;if(!t)return(0,d.jsx)(d.Fragment,{});let r={movable:t,onContextMenuCapture:e=>{it(e,t)},...n},i=t.getContent().getType(),a=null;return i===`picture`?(0,d.jsx)(ml,{loadingPanel:(0,d.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`}}),picture:t.getContent(),description:t.getDescription()??t.getName()??void 0,...r}):i===`chart`?(0,d.jsx)(Cp,{...r,chart:t.getContent()}):i===`slicer`?(0,d.jsx)(wp,{...r,slicer:t.getContent()}):i===`shape`?(0,d.jsx)(Jf,{...r,shape:t.getContent()}):(a=`Unsupported type: '${i}'.`,typeof a==`string`&&(a=(0,d.jsx)(Sl,{...r,style:{border:`red solid 2px`},description:a})),(0,d.jsx)(`div`,{style:{position:`absolute`,width:`100%`,height:`100%`,clipPath:`inset(0px)`,display:`flex`,alignItems:`stretch`,justifyContent:`stretch`,pointerEvents:`all`},children:a},t.getId()))},[]),dt=(0,u.useMemo)(()=>M({ref:z,style:d_,colorScheme:de,gridColorScheme:Q,sheet:re,editable:j,onSheetContextMenu:nt,onFillMenu:rt,viewport:ye,showScrollbars:!1,viewportComponent:V,onFirstRender:K,onShowTooltip:e=>{Be({x:e.anchor.x,y:e.anchor.y,width:0,height:0},e.display??``,e.placement)},onCloseTooltip:()=>ze(),renderMovable:ut,...A,propsCellRender:{onColumnButtonMouseDown:(e,t)=>{A?.propsCellRender?.onColumnButtonMouseDown?.(e,t),tt(e,t)},...A?.propsCellRender}}),[A,re,de,Q,j]),ft=(0,u.useMemo)(()=>{let e=(0,d.jsx)(i.Lt,{ref:We,style:d_,viewport:ye,onWheelScroll:e=>z.current?.onWheelScroll?.(e),showHorizontalScrollbar:He||Ve,showVerticalScrollbar:Ue,renderScrollbarHorizontal:Je,renderScrollbarVertical:ot,children:dt});return Ke||Ge===0||(e=(0,d.jsxs)(d.Fragment,{children:[e,qe]})),N?N(e):e},[He,Ve,Je,Ue,ye,Ke,dt,qe,N]),pt=(0,u.useMemo)(()=>(0,d.jsx)(i._t,{open:je,title:Ne,placement:Fe,anchorEl:{getBoundingClientRect:()=>new DOMRect(Le.x,Le.y,Le.width,Le.height)}}),[je,Ne,Fe,Le]),mt=(0,u.useMemo)(()=>({boxSizing:`border-box`,fontFamily:`var(--sxl-font-family)`,"--sxl-image-filter":Q===`dark`&&Z?`hue-rotate(180deg) invert(1) brightness(95%)`:`none`,...l}),[Q,Z,l]),ht=(0,u.useMemo)(()=>({flex:`1 1 100%`,width:`100%`,display:`flex`,flexDirection:`column`,opacity:!W&&ct?0:void 0}),[W,ct]);return(0,d.jsx)(i.lt,{renderFloatPanel:D,propsFloatPanel:E,themeScopeClass:pe,themeSurface:`app`,themeMode:de,children:(0,d.jsx)(Hi,{workbook:r,children:(0,d.jsx)(i.Jt.CommandScopeProvider,{spec:Ae,scopeRef:q,elementRef:J,children:(0,d.jsx)($l.Provider,{value:we,children:(0,d.jsxs)(`div`,{className:$(`sheetxl-workbook`,c_[`sheetxl-workbook`],c_[`sheetxl-theme`],i.nt,pe,f),style:mt,"data-sxl-theme-mode":de,...R,ref:da([J,X]),onFocus:e=>{at(),p?.(e)},onBlur:e=>{m?.(e)},onKeyDown:e=>{h?.(e)},children:[(0,d.jsx)(`style`,{children:me}),(0,d.jsx)(`style`,{children:he}),(0,d.jsxs)(`div`,{className:c_[`sheetxl-reset`],style:ht,children:[ft,pt,(0,d.jsx)(i.Jt.CommandAnchorProvider,{tracker:Qe,keyBindings:!1,children:et})]}),lt]})})})})})}));p_.displayName=`WorkbookElementBase`;var m_=(0,u.memo)((0,u.forwardRef)((e,t)=>{let n,{workbook:r,renderWorkbookError:i,renderWorkbookLoading:a=s_,propsWorkbookLoading:o,...s}=e,c=Xg(r);return n=c.status===`error`?i?i({error:c.error}):(0,d.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,padding:24,textAlign:`center`,boxSizing:`border-box`},children:c.error instanceof Error?c.error.message:String(c.error)}):c.status===`loaded`?(0,d.jsx)(p_,{ref:t,...s,workbook:c.workbook,renderWorkbookLoading:a,propsWorkbookLoading:o}):(0,d.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`},children:a?.({...o})}),(0,d.jsx)(d.Fragment,{children:n})}));m_.displayName=`WorkbookElement`;var h_=(e,t)=>{let[n,r]=(0,u.useState)(null),[i,a]=(0,u.useState)(!1);return(0,u.useEffect)(()=>{if(!e)return r(null),void a(!1);let n=new s.i(e.getTransactions(),t);r(n),a(n.isDirty());let i=n.addListeners({onDirty:()=>a(!0),onClean:()=>a(!1)});return()=>{i(),n.close(),r(null)}},[e,t]),{isDirty:i,saveState:n}},g_=e=>{let[t,n]=(0,u.useState)(()=>e?.getName()??null);return(0,u.useEffect)(()=>{if(e)return n(e.getName()??null),e.addListeners({onNameChange:e=>n(e.getName()??null)});n(null)},[e]),t},__=(e,t)=>{let n,r=()=>{n?.();let r=e.getOrigin?.()??null;t(r),n=r?.addListeners({onChange:()=>t(r)})};r();let i=e.addListeners({onOriginChange:r});return()=>{i(),n?.()}},v_=e=>{let[t,n]=(0,u.useState)(()=>e?.getOrigin?.()?.isEncrypted?.()??!1);return(0,u.useEffect)(()=>{if(e)return __(e,e=>n(e?.isEncrypted?.()??!1));n(!1)},[e]),t},y_=e=>{let[t,n]=(0,u.useState)(()=>e?.getOrigin?.()?.getFormat?.()??null);return(0,u.useEffect)(()=>{if(e)return __(e,e=>n(e?.getFormat?.()??null));n(null)},[e]),t},b_=[`o`,`s`,`w`,`n`,`t`,`m`],x_=class{constructor(e={}){this.name=null,this.dirty=!1,this.removeLangListener=null,this.base=null,this.originalTitle=null,this.windowInstalled=!1,this.handleBeforeUnload=e=>{this.dirty&&(e.preventDefault(),e.returnValue=``)},this.handleKey=e=>{!e.defaultPrevented&&this.guardKeys&&(e.altKey?e.key!==`ArrowLeft`&&e.key!==`ArrowRight`||e.preventDefault():(e.ctrlKey||e.metaKey)&&this.guardKeys.includes(e.key)&&e.preventDefault())},this.documentTitle=e.documentTitle??!0,this.confirmOnClose=e.confirmOnClose??!0;let t=e.keyboardGuard??!0;this.guardKeys=!1===t?null:Array.isArray(t)?t:b_}update(e,t){this.name=e,this.dirty=t,this.installWindowListeners(),this.applyTitle()}dispose(){this.removeLangListener?.(),this.removeLangListener=null,this.windowInstalled&&typeof window<`u`&&(window.removeEventListener(`beforeunload`,this.handleBeforeUnload),document.removeEventListener(`keydown`,this.handleKey),document.removeEventListener(`keyup`,this.handleKey),this.windowInstalled=!1),this.documentTitle&&this.originalTitle!==null&&typeof document<`u`&&(document.title=this.originalTitle),this.base=null,this.originalTitle=null,this.name=null,this.dirty=!1}installWindowListeners(){this.windowInstalled||typeof window>`u`||(this.confirmOnClose&&window.addEventListener(`beforeunload`,this.handleBeforeUnload),this.guardKeys&&(document.addEventListener(`keydown`,this.handleKey),document.addEventListener(`keyup`,this.handleKey)),this.removeLangListener=n.D.addChangeListener(()=>this.applyTitle()),this.windowInstalled=!0)}applyTitle(){if(!this.documentTitle||typeof document>`u`)return;this.base===null&&(this.originalTitle=document.title,this.base=typeof this.documentTitle==`string`?this.documentTitle:document.title);let e=this.dirty?` ●`:``,t=this.name,r=`${t??n.r(`workbook.untitled`)}${e}`;document.title=t||e?`${r} - ${this.base}`:`${this.base}`}},S_=(e,t,n={})=>{let{documentTitle:r,confirmOnClose:i,keyboardGuard:a}=n,o=(0,u.useRef)(null);o.current||=new x_({documentTitle:r,confirmOnClose:i,keyboardGuard:a}),(0,u.useEffect)(()=>{o.current.update(e,t)},[e,t]),(0,u.useEffect)(()=>()=>o.current?.dispose(),[])},C_=c.ut(`div`,{name:`MuiDivider`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,n.absolute&&t.absolute,t[n.variant],n.orientation===`vertical`&&t.vertical,n.flexItem&&t.flexItem,n.children&&t.withChildren,n.textAlign===`right`&&n.orientation!==`vertical`&&t.textAlignRight,n.textAlign===`left`&&n.orientation!==`vertical`&&t.textAlignLeft]}})(c.lt(({theme:e})=>({margin:0,flexShrink:0,borderWidth:0,borderStyle:`solid`,borderColor:(e.vars||e).palette.divider,borderBottomWidth:`thin`,variants:[{props:{absolute:!0},style:{position:`absolute`,bottom:0,left:0,width:`100%`}},{props:{variant:`inset`},style:{marginLeft:72}},{props:{variant:`middle`,orientation:`horizontal`},style:{marginLeft:e.spacing(2),marginRight:e.spacing(2)}},{props:{variant:`middle`,orientation:`vertical`},style:{marginTop:e.spacing(1),marginBottom:e.spacing(1)}},{props:{orientation:`vertical`},style:{height:`100%`,borderBottomWidth:0,borderRightWidth:`thin`}},{props:{flexItem:!0},style:{alignSelf:`stretch`,height:`auto`}},{props:({ownerState:e})=>!!e.children,style:{display:`flex`,textAlign:`center`,border:0,borderTopStyle:`solid`,borderLeftStyle:`solid`,"&::before, &::after":{content:`""`,alignSelf:`center`}}},{props:({ownerState:e})=>e.children&&e.orientation!==`vertical`,style:{"&::before, &::after":{width:`100%`,borderTop:`thin solid ${(e.vars||e).palette.divider}`,borderTopStyle:`inherit`}}},{props:({ownerState:e})=>e.orientation===`vertical`&&e.children,style:{flexDirection:`column`,"&::before, &::after":{height:`100%`,borderLeft:`thin solid ${(e.vars||e).palette.divider}`,borderLeftStyle:`inherit`}}},{props:({ownerState:e})=>e.textAlign===`right`&&e.orientation!==`vertical`,style:{"&::before":{width:`90%`},"&::after":{width:`10%`}}},{props:({ownerState:e})=>e.textAlign===`left`&&e.orientation!==`vertical`,style:{"&::before":{width:`10%`},"&::after":{width:`90%`}}}]}))),w_=c.ut(`span`,{name:`MuiDivider`,slot:`Wrapper`,overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.wrapper,n.orientation===`vertical`&&t.wrapperVertical]}})(c.lt(({theme:e})=>({display:`inline-block`,paddingLeft:`calc(${e.spacing(1)} * 1.2)`,paddingRight:`calc(${e.spacing(1)} * 1.2)`,whiteSpace:`nowrap`,variants:[{props:{orientation:`vertical`},style:{paddingTop:`calc(${e.spacing(1)} * 1.2)`,paddingBottom:`calc(${e.spacing(1)} * 1.2)`}}]}))),T_=u.forwardRef(function(e,t){let n=c.ct({props:e,name:`MuiDivider`}),{absolute:r=!1,children:a,className:o,orientation:s=`horizontal`,component:u=a||s===`vertical`?`div`:`hr`,flexItem:f=!1,role:p=u===`hr`?void 0:`separator`,textAlign:m=`center`,variant:h=`fullWidth`,...g}=n,_={...n,absolute:r,component:u,flexItem:f,orientation:s,role:p,textAlign:m,variant:h},v=(e=>{let{absolute:t,children:n,classes:r,flexItem:i,orientation:a,textAlign:o,variant:s}=e;return c._t({root:[`root`,t&&`absolute`,s,a===`vertical`&&`vertical`,i&&`flexItem`,n&&`withChildren`,o===`right`&&a!==`vertical`&&`textAlignRight`,o===`left`&&a!==`vertical`&&`textAlignLeft`],wrapper:[`wrapper`,a===`vertical`&&`wrapperVertical`]},l.i,r)})(_);return(0,d.jsx)(C_,{as:u,className:i.h(v.root,o),role:p,ref:t,ownerState:_,"aria-orientation":p!==`separator`||u===`hr`&&s!==`vertical`?void 0:s,...g,children:a?(0,d.jsx)(w_,{className:v.wrapper,ownerState:_,children:a}):null})});Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return Qu}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return ad}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return la}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return h_}}),Object.defineProperty(exports,"Ct",{enumerable:!0,get:function(){return Ic}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return Qi}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return dd}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return Ed}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return Ug}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return bs}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return ra}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return Ta}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return Ni}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return Rc}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return Os}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return cd}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return Zs}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return Ws}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return e_}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return Gs}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return Nl}}),Object.defineProperty(exports,"St",{enumerable:!0,get:function(){return S_}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return jo}}),Object.defineProperty(exports,"Tt",{enumerable:!0,get:function(){return ei}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return Cs}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return eo}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return rd}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return Po}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return m_}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Xg}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return jd}}),Object.defineProperty(exports,"_t",{enumerable:!0,get:function(){return Ss}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Lc}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return Ad}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return sa}}),Object.defineProperty(exports,"bt",{enumerable:!0,get:function(){return Bi}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return kp}}),Object.defineProperty(exports,"ct",{enumerable:!0,get:function(){return Yg}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return pf}}),Object.defineProperty(exports,"dt",{enumerable:!0,get:function(){return xs}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return Gg}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return Vg}}),Object.defineProperty(exports,"ft",{enumerable:!0,get:function(){return td}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return zo}}),Object.defineProperty(exports,"gt",{enumerable:!0,get:function(){return Hi}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return y_}}),Object.defineProperty(exports,"ht",{enumerable:!0,get:function(){return id}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Xi}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return ju}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return Ui}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return Vo}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return ld}}),Object.defineProperty(exports,"lt",{enumerable:!0,get:function(){return Wg}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return Xa}}),Object.defineProperty(exports,"mt",{enumerable:!0,get:function(){return sd}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return Qs}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return ac}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return Tp}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return ca}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Od}}),Object.defineProperty(exports,"pt",{enumerable:!0,get:function(){return Ds}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return Ii}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Bl}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return Pi}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return od}}),Object.defineProperty(exports,"st",{enumerable:!0,get:function(){return zc}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return T_}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return Wu}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return v_}}),Object.defineProperty(exports,"ut",{enumerable:!0,get:function(){return po}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return Fl}}),Object.defineProperty(exports,"vt",{enumerable:!0,get:function(){return i_}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return g_}}),Object.defineProperty(exports,"wt",{enumerable:!0,get:function(){return ji}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return Za}}),Object.defineProperty(exports,"xt",{enumerable:!0,get:function(){return ka}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return Hg}}),Object.defineProperty(exports,"yt",{enumerable:!0,get:function(){return nd}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return jl}});