@sheetxl/sdk 0.8.0-beta.1 → 0.8.0-beta.11

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 (775) hide show
  1. package/README.md +1 -1
  2. package/THIRD-PARTY-NOTICES.md +1 -1
  3. package/browser/esm/B7aUIvgUjncMMD_i.mjs +394 -0
  4. package/browser/esm/BFagR2JeWs74iAG3.mjs +171 -0
  5. package/browser/esm/BGOFfpxr2jPIdqmV.mjs +40 -0
  6. package/browser/esm/BLoUBId2xZpXAK_H.mjs +698 -0
  7. package/browser/esm/BMyDRQ716j79h_bH.mjs +86 -0
  8. package/browser/esm/BVDiOXGMc5_FMGfy.mjs +400 -0
  9. package/browser/esm/BjkCiv5Jz6WYKZeu.mjs +598 -0
  10. package/browser/esm/BkBhLS0l6z8sxI6D.mjs +441 -0
  11. package/browser/esm/BnG31I6Oj_HEtSPS.mjs +167 -0
  12. package/browser/esm/BoV6zPBnfqCBCqZ7.mjs +7729 -0
  13. package/browser/esm/BpgskG1Er_lGQ_yS.mjs +142 -0
  14. package/browser/esm/BtvLTTfSBdAKplVG.mjs +466 -0
  15. package/browser/esm/C16ycKja6zG0crV_.mjs +55580 -0
  16. package/browser/esm/C2VbEI_XVAoseAwa.mjs +1552 -0
  17. package/browser/esm/C4MqfLn9Dm-l3OIk.mjs +540 -0
  18. package/browser/esm/C5E6zSGAALWf61n4.mjs +199 -0
  19. package/browser/esm/CHU6iu_WGlm7fLET.mjs +1001 -0
  20. package/browser/esm/CQYjO777cmAznUzK.mjs +527 -0
  21. package/browser/esm/CU3DmJ-YnVVrC1_k.mjs +1123 -0
  22. package/browser/esm/CV5EGEjG5_-CPpP0.mjs +8212 -0
  23. package/browser/esm/{uyWBMSIxMlt8n5Z3.mjs → CaB7J-xgfKO2uAkG.mjs} +2 -2
  24. package/browser/esm/CkxWugaJFjDGZNZ-.mjs +12 -0
  25. package/browser/esm/ClPfI4lODvCece29.mjs +632 -0
  26. package/browser/esm/ClbvFbFzFzXLBKNN.mjs +193 -0
  27. package/browser/esm/{DlPMeIyxT9tG_WDk.mjs → Ctjb0SsxV4K4MMqG.mjs} +179 -202
  28. package/browser/esm/D5np__Jb1euAyaLw.mjs +7 -0
  29. package/browser/esm/DEiPS3Dr-s4fPbVZ.mjs +607 -0
  30. package/browser/esm/DLLE0FZNsKxbBzRn.mjs +128 -0
  31. package/browser/esm/DWNzqw7DUKwoxjri.mjs +20 -0
  32. package/browser/esm/{B0HS42a7lga1k1U_.mjs → Dlmig06rIo7cInRk.mjs} +2 -2
  33. package/browser/esm/{f2G3QRgEbvFJcoa2.mjs → DvAaxH6z_tGvrRzl.mjs} +1704 -1008
  34. package/browser/esm/Dyq_ivuHvlXLwPCl.mjs +12831 -0
  35. package/browser/esm/PcHFjNzQsE54POri.mjs +1141 -0
  36. package/browser/esm/S2dNNx1a5ydRnARM.mjs +367 -0
  37. package/browser/esm/f1IoRb7tEb0QmCSt.mjs +110 -0
  38. package/browser/esm/gssVX_FH1XFN-twD.mjs +210 -0
  39. package/browser/esm/index.mjs +1759 -1161
  40. package/browser/esm/nvU0ClAbf0g94YBK.mjs +1695 -0
  41. package/browser/esm/zlLuW405RSguy4Kn.mjs +357 -0
  42. package/licenses/dependencies.txt +141 -141
  43. package/node/esm/2Kihw_-5lVTEnwMa.mjs +1132 -0
  44. package/node/esm/857CIBgQgGpnqrXk.mjs +199 -0
  45. package/node/esm/B084DssTcdBheTp_.mjs +7966 -0
  46. package/node/esm/B21JjOLghRoDOrkx.mjs +134 -0
  47. package/node/esm/BIRq1kT7lLRzns9t.mjs +610 -0
  48. package/node/esm/BIwObuhTJYf0jpUa.mjs +451 -0
  49. package/node/esm/Bbf1Pm9Gk7YpLTvg.mjs +12 -0
  50. package/node/esm/BqiexuA89caYnAPz.mjs +1135 -0
  51. package/node/esm/BrCKGFRsX_ezFJ4B.mjs +811 -0
  52. package/node/esm/CCN5vD410obwdz38.mjs +405 -0
  53. package/node/esm/{Cku7XiUvw1xrRasi.mjs → CDHdgJXH2vS71WMc.mjs} +1 -1
  54. package/node/esm/CGp6VZL-gZa9Uezx.mjs +1860 -0
  55. package/node/esm/CNCNJNg890KdgkWh.mjs +142 -0
  56. package/node/esm/CZICGK_ss0HoGHCP.mjs +7 -0
  57. package/node/esm/CZiqiay42tFTrLI4.mjs +171 -0
  58. package/node/esm/CdJHUJSBRHZoryPe.mjs +360 -0
  59. package/node/esm/Ct3h15sCus4Tgt6M.mjs +1762 -0
  60. package/node/esm/CwePQwTILHHjGDkZ.mjs +1033 -0
  61. package/node/esm/CzXT00vrQa1_gvW9.mjs +28 -0
  62. package/node/esm/D1TKBVmoKGAXf37B.mjs +402 -0
  63. package/node/esm/D2KBymQJd1XhpeQD.mjs +540 -0
  64. package/node/esm/D6e2z7eZpxOJXHc7.mjs +1783 -0
  65. package/node/esm/D8zEN-6ZdDqDvTxM.mjs +639 -0
  66. package/node/esm/DNRhGK-8Tr9xcRyc.mjs +8320 -0
  67. package/node/esm/DOU54VsOjG-m-NyQ.mjs +210 -0
  68. package/node/esm/DUTskXCXref-IJnI.mjs +133 -0
  69. package/node/esm/D_t5AUxSm7_icjzq.mjs +638 -0
  70. package/node/esm/Db0v7zXNnyjBIjjI.mjs +372 -0
  71. package/node/esm/De2IONBxQhz-Qbyh.mjs +596 -0
  72. package/node/esm/Df1bL6VFvrqIdSLB.mjs +40 -0
  73. package/node/esm/DkwIPzKc3UwdUIfM.mjs +86 -0
  74. package/node/esm/DrTZbfemSLq2mseG.mjs +111 -0
  75. package/node/esm/OVfaSb506tNSIvbv.mjs +57107 -0
  76. package/node/esm/cGwrLA1RCE-WhJ7w.mjs +255 -0
  77. package/node/esm/index.mjs +2873 -53929
  78. package/node/esm/mFiBSM7XgBHV9AY7.mjs +13010 -0
  79. package/node/esm/yavzZOiZW_EjG9lE.mjs +15 -0
  80. package/package.json +15 -17
  81. package/resources/contents.json +184 -0
  82. package/resources/fonts/arial-bold-italic.hinted.json +125 -0
  83. package/resources/fonts/arial-bold-italic.metrics.json +139 -0
  84. package/resources/fonts/arial-bold-italic.rows.json +9 -0
  85. package/resources/fonts/arial-bold.hinted.json +125 -0
  86. package/resources/fonts/arial-bold.metrics.json +139 -0
  87. package/resources/fonts/arial-bold.rows.json +9 -0
  88. package/resources/fonts/arial-italic.hinted.json +125 -0
  89. package/resources/fonts/arial-italic.metrics.json +139 -0
  90. package/resources/fonts/arial-italic.rows.json +9 -0
  91. package/resources/fonts/arial-regular.hinted.json +125 -0
  92. package/resources/fonts/arial-regular.metrics.json +139 -0
  93. package/resources/fonts/arial-regular.rows.json +9 -0
  94. package/resources/fonts/calibri-bold-italic.hinted.json +122 -0
  95. package/resources/fonts/calibri-bold-italic.metrics.json +137 -0
  96. package/resources/fonts/calibri-bold-italic.rows.json +9 -0
  97. package/resources/fonts/calibri-bold.hinted.json +122 -0
  98. package/resources/fonts/calibri-bold.metrics.json +137 -0
  99. package/resources/fonts/calibri-bold.rows.json +9 -0
  100. package/resources/fonts/calibri-italic.hinted.json +121 -0
  101. package/resources/fonts/calibri-italic.metrics.json +137 -0
  102. package/resources/fonts/calibri-italic.rows.json +9 -0
  103. package/resources/fonts/calibri-regular.hinted.json +121 -0
  104. package/resources/fonts/calibri-regular.metrics.json +137 -0
  105. package/resources/fonts/calibri-regular.rows.json +9 -0
  106. package/resources/fonts/cambria-bold-italic.hinted.json +105 -0
  107. package/resources/fonts/cambria-bold-italic.metrics.json +66 -0
  108. package/resources/fonts/cambria-bold-italic.rows.json +9 -0
  109. package/resources/fonts/cambria-bold.hinted.json +108 -0
  110. package/resources/fonts/cambria-bold.metrics.json +66 -0
  111. package/resources/fonts/cambria-bold.rows.json +9 -0
  112. package/resources/fonts/cambria-italic.hinted.json +102 -0
  113. package/resources/fonts/cambria-italic.metrics.json +66 -0
  114. package/resources/fonts/cambria-italic.rows.json +9 -0
  115. package/resources/fonts/cambria-regular.hinted.json +110 -0
  116. package/resources/fonts/cambria-regular.metrics.json +66 -0
  117. package/resources/fonts/cambria-regular.rows.json +9 -0
  118. package/resources/fonts/contents.json +406 -0
  119. package/resources/fonts/courier-new-bold-italic.hinted.json +11 -0
  120. package/resources/fonts/courier-new-bold-italic.metrics.json +143 -0
  121. package/resources/fonts/courier-new-bold-italic.rows.json +9 -0
  122. package/resources/fonts/courier-new-bold.hinted.json +11 -0
  123. package/resources/fonts/courier-new-bold.metrics.json +143 -0
  124. package/resources/fonts/courier-new-bold.rows.json +9 -0
  125. package/resources/fonts/courier-new-italic.hinted.json +11 -0
  126. package/resources/fonts/courier-new-italic.metrics.json +143 -0
  127. package/resources/fonts/courier-new-italic.rows.json +9 -0
  128. package/resources/fonts/courier-new-regular.hinted.json +11 -0
  129. package/resources/fonts/courier-new-regular.metrics.json +143 -0
  130. package/resources/fonts/courier-new-regular.rows.json +9 -0
  131. package/resources/fonts/times-new-roman-bold-italic.hinted.json +125 -0
  132. package/resources/fonts/times-new-roman-bold-italic.metrics.json +141 -0
  133. package/resources/fonts/times-new-roman-bold-italic.rows.json +9 -0
  134. package/resources/fonts/times-new-roman-bold.hinted.json +125 -0
  135. package/resources/fonts/times-new-roman-bold.metrics.json +141 -0
  136. package/resources/fonts/times-new-roman-bold.rows.json +9 -0
  137. package/resources/fonts/times-new-roman-italic.hinted.json +125 -0
  138. package/resources/fonts/times-new-roman-italic.metrics.json +143 -0
  139. package/resources/fonts/times-new-roman-italic.rows.json +9 -0
  140. package/resources/fonts/times-new-roman-regular.hinted.json +125 -0
  141. package/resources/fonts/times-new-roman-regular.metrics.json +141 -0
  142. package/resources/fonts/times-new-roman-regular.rows.json +9 -0
  143. package/resources/locales/de/model.msg.json +199 -21
  144. package/resources/locales/en/model.msg.json +207 -23
  145. package/types/scripting-api.json +10663 -0
  146. package/types/scripting-enums.json +435 -130
  147. package/types/scripting.d.ts +33010 -15730
  148. package/types/src/.generated/wasm/fonts.d.ts +161 -0
  149. package/types/src/.generated/wasm/fonts_bg.inline.d.ts +3 -0
  150. package/types/src/.generated/wasm/sdk.d.ts +122 -0
  151. package/types/src/.generated/wasm/sdk_bg.inline.d.ts +3 -0
  152. package/types/src/address/AddressUtils.d.ts +10 -1
  153. package/types/src/address/_StructuredAddress.d.ts +58 -0
  154. package/types/src/anchored/AbstractAnchored.d.ts +18 -8
  155. package/types/src/anchored/AnchoredMap.d.ts +2 -0
  156. package/types/src/anchored/IAnchoredMap.d.ts +52 -4
  157. package/types/src/autoFill/AutoFill.d.ts +316 -32
  158. package/types/src/autoFill/IAutoFill.d.ts +232 -15
  159. package/types/src/border/{IBorder.d.ts → IBorders.d.ts} +58 -41
  160. package/types/src/border/index.d.ts +1 -1
  161. package/types/src/calculation/Calculation.d.ts +584 -149
  162. package/types/src/calculation/ExternalBookBindings.d.ts +118 -0
  163. package/types/src/calculation/FormulaLiterals.d.ts +2 -1
  164. package/types/src/calculation/FormulaText.d.ts +98 -0
  165. package/types/src/calculation/ICalculation.d.ts +353 -88
  166. package/types/src/calculation/INamedFormulasCollection.d.ts +9 -8
  167. package/types/src/calculation/NamedFormulaCollection.d.ts +322 -115
  168. package/types/src/calculation/NamedLambdaFunction.d.ts +28 -0
  169. package/types/src/calculation/TokenType.d.ts +9 -0
  170. package/types/src/calculation/Types.d.ts +83 -2
  171. package/types/src/calculation/_CloneBoundary.d.ts +80 -0
  172. package/types/src/calculation/_FormulaToolkit.d.ts +9 -0
  173. package/types/src/calculation/_TableExtent.d.ts +60 -0
  174. package/types/src/calculation/_TableRename.d.ts +13 -0
  175. package/types/src/calculation/compiler/ASTTypes.d.ts +71 -0
  176. package/types/src/calculation/compiler/CompilerUtils.d.ts +152 -44
  177. package/types/src/calculation/compiler/FormulaCompiler.d.ts +29 -4
  178. package/types/src/calculation/compiler/FormulaParser.d.ts +1 -2
  179. package/types/src/calculation/compiler/LiteTransform.d.ts +17 -0
  180. package/types/src/calculation/compiler/ParserUtils.d.ts +42 -1
  181. package/types/src/calculation/compiler/SRParser.d.ts +2 -1
  182. package/types/src/calculation/compiler/Types.d.ts +79 -9
  183. package/types/src/calculation/engine/CalcBackend.d.ts +855 -0
  184. package/types/src/calculation/engine/index.d.ts +10 -0
  185. package/types/src/calculation/executor/CalcExecutor.d.ts +331 -33
  186. package/types/src/calculation/executor/CalcExecutorUtils.d.ts +49 -2
  187. package/types/src/calculation/executor/CircularReference.d.ts +2 -0
  188. package/types/src/calculation/formula/Formula.d.ts +67 -21
  189. package/types/src/calculation/formula/FormulaBlock.d.ts +131 -23
  190. package/types/src/calculation/formula/FormulaRecordView.d.ts +79 -0
  191. package/types/src/calculation/formula/FunctionValues.d.ts +10 -0
  192. package/types/src/calculation/formula/IFormulaBlock.d.ts +277 -67
  193. package/types/src/calculation/formula/LambdaValue.d.ts +51 -26
  194. package/types/src/calculation/formula/LazyValue.d.ts +96 -0
  195. package/types/src/calculation/formula/TokenUtils.d.ts +25 -1
  196. package/types/src/calculation/formula/index.d.ts +1 -0
  197. package/types/src/calculation/functions/FunctionDeclarations.d.ts +35 -0
  198. package/types/src/calculation/functions/Operators.d.ts +8 -0
  199. package/types/src/calculation/functions/expandDeclaration.d.ts +15 -0
  200. package/types/src/calculation/functions/initializeFunctions.d.ts +3 -2
  201. package/types/src/calculation/grid/CalcGrid.d.ts +443 -158
  202. package/types/src/calculation/grid/CalcGridBackend.d.ts +523 -0
  203. package/types/src/calculation/grid/CalcGridProxy.d.ts +135 -0
  204. package/types/src/calculation/grid/CalcGridUtils.d.ts +69 -12
  205. package/types/src/calculation/grid/FormulaEntry.d.ts +129 -0
  206. package/types/src/calculation/grid/FormulaHost.d.ts +284 -0
  207. package/types/src/calculation/grid/ICalcGrid.d.ts +528 -141
  208. package/types/src/calculation/grid/_CalcRequest.d.ts +299 -0
  209. package/types/src/calculation/grid/_CellValueRun.d.ts +21 -0
  210. package/types/src/calculation/grid/index.d.ts +4 -0
  211. package/types/src/calculation/index.d.ts +2 -0
  212. package/types/src/calculation/spatial/ContentfulSpatialValue.d.ts +6 -2
  213. package/types/src/calculation/spatial/FormulaSpatialValue.d.ts +364 -11
  214. package/types/src/calculation/spatial/SpillEntry.d.ts +20 -5
  215. package/types/src/calculation/spatial/TouchedWindows.d.ts +86 -0
  216. package/types/src/calculation/spatial/index.d.ts +1 -0
  217. package/types/src/calculation/state/CalcInputs.d.ts +41 -0
  218. package/types/src/calculation/state/CalcNode.d.ts +141 -30
  219. package/types/src/calculation/state/CalcScope.d.ts +46 -0
  220. package/types/src/calculation/state/CalcState.d.ts +32 -1
  221. package/types/src/calculation/state/CalculationContext.d.ts +50 -3
  222. package/types/src/calculation/state/IContextContainer.d.ts +141 -27
  223. package/types/src/calculation/state/_PendingOverlayGrid.d.ts +163 -0
  224. package/types/src/calculation/state/_ReadObservedGrid.d.ts +74 -8
  225. package/types/src/calculation/state/index.d.ts +1 -0
  226. package/types/src/calculation/symbol/ExternalSheetSymbols.d.ts +80 -0
  227. package/types/src/calculation/symbol/ISymbolRegistry.d.ts +23 -0
  228. package/types/src/calculation/symbol/IndirectSymbolProvider.d.ts +16 -2
  229. package/types/src/calculation/symbol/SheetSymbolProvider.d.ts +63 -3
  230. package/types/src/calculation/symbol/SymbolRegistry.d.ts +20 -0
  231. package/types/src/calculation/symbol/index.d.ts +3 -2
  232. package/types/src/calculation/toolkit/FormulaLiteralReader.d.ts +4 -0
  233. package/types/src/calculation/toolkit/FormulaTextParser.d.ts +10 -0
  234. package/types/src/calculation/toolkit/FunctionDeclarationTable.d.ts +4 -0
  235. package/types/src/calculation/toolkit/index.d.ts +12 -0
  236. package/types/src/cell/ICell.d.ts +357 -33
  237. package/types/src/cell/ICellHeader.d.ts +31 -8
  238. package/types/src/cell/ICellProtection.d.ts +50 -10
  239. package/types/src/cellRange/ICellHeaderRange.d.ts +6 -9
  240. package/types/src/cellRange/ICellHeaderRanges.d.ts +5 -0
  241. package/types/src/cellRange/ICellRange.d.ts +737 -130
  242. package/types/src/cellRange/ICellRanges.d.ts +31 -24
  243. package/types/src/chart/Chart.d.ts +246 -16
  244. package/types/src/chart/ChartCollection.d.ts +31 -0
  245. package/types/src/chart/IChart.d.ts +2058 -18
  246. package/types/src/chart/IChartCollection.d.ts +50 -0
  247. package/types/src/chart/_ChartParts.d.ts +1066 -0
  248. package/types/src/chart/_ChartSource.d.ts +47 -0
  249. package/types/src/chart/createChart.d.ts +26 -0
  250. package/types/src/chart/index.d.ts +5 -3
  251. package/types/src/chart/kinds/ChartKind.d.ts +252 -0
  252. package/types/src/chart/kinds/_Area.d.ts +3 -0
  253. package/types/src/chart/kinds/_Bar.d.ts +4 -0
  254. package/types/src/chart/kinds/_BoxWhisker.d.ts +4 -0
  255. package/types/src/chart/kinds/_Bubble.d.ts +3 -0
  256. package/types/src/chart/kinds/_Funnel.d.ts +4 -0
  257. package/types/src/chart/kinds/_Hierarchy.d.ts +31 -0
  258. package/types/src/chart/kinds/_Histogram.d.ts +4 -0
  259. package/types/src/chart/kinds/_HitKinds.d.ts +23 -0
  260. package/types/src/chart/kinds/_Line.d.ts +4 -0
  261. package/types/src/chart/kinds/_OfPie.d.ts +4 -0
  262. package/types/src/chart/kinds/_Pie.d.ts +4 -0
  263. package/types/src/chart/kinds/_Placeholder.d.ts +6 -0
  264. package/types/src/chart/kinds/_Radar.d.ts +4 -0
  265. package/types/src/chart/kinds/_Scatter.d.ts +8 -0
  266. package/types/src/chart/kinds/_Sunburst.d.ts +4 -0
  267. package/types/src/chart/kinds/_Surface.d.ts +4 -0
  268. package/types/src/chart/kinds/_Treemap.d.ts +4 -0
  269. package/types/src/chart/kinds/_Waterfall.d.ts +18 -0
  270. package/types/src/chart/kinds/_builtIns.d.ts +11 -0
  271. package/types/src/chart/layout/ChartLayout.d.ts +825 -0
  272. package/types/src/chart/layout/TextMeasurer.d.ts +38 -0
  273. package/types/src/chart/layout/_HitGeometry.d.ts +50 -0
  274. package/types/src/chart/layout/_HitTest.d.ts +36 -0
  275. package/types/src/chart/layout/_Layout.d.ts +25 -0
  276. package/types/src/chart/layout/_LayoutUtils.d.ts +97 -0
  277. package/types/src/chart/math/BoxStats.d.ts +35 -0
  278. package/types/src/chart/math/DateUnitCalcs.d.ts +80 -0
  279. package/types/src/chart/math/DisplayUnits.d.ts +53 -0
  280. package/types/src/chart/math/Histogram.d.ts +48 -0
  281. package/types/src/chart/math/OrdUnitCalcs.d.ts +166 -0
  282. package/types/src/chart/math/Treemap.d.ts +28 -0
  283. package/types/src/chart/math/Trendlines.d.ts +71 -0
  284. package/types/src/chart/math/UnitCalcs.d.ts +98 -0
  285. package/types/src/chart/model/ChartModel.d.ts +681 -0
  286. package/types/src/chart/model/_ChartType.d.ts +14 -0
  287. package/types/src/chart/model/_Edits.d.ts +489 -0
  288. package/types/src/chart/model/_Grouping.d.ts +83 -0
  289. package/types/src/chart/model/_Inference.d.ts +52 -0
  290. package/types/src/chart/model/_ModelFacts.d.ts +112 -0
  291. package/types/src/chart/model/_NewChart.d.ts +208 -0
  292. package/types/src/chart/model/_OfPie.d.ts +18 -0
  293. package/types/src/chart/resolve/_LegacyStyles.d.ts +48 -0
  294. package/types/src/chart/resolve/_Resolve.d.ts +51 -0
  295. package/types/src/chart/resolve/_ResolvedChart.d.ts +444 -0
  296. package/types/src/collections/ArraysGrid.d.ts +1 -1
  297. package/types/src/collections/IGrid.d.ts +1 -1
  298. package/types/src/collections/ISparseGrid.d.ts +9 -0
  299. package/types/src/collections/ISpatialMap.d.ts +59 -21
  300. package/types/src/collections/ImmutableList.d.ts +28 -0
  301. package/types/src/collections/MixedTypedArrayList.d.ts +168 -108
  302. package/types/src/collections/RTree.d.ts +116 -36
  303. package/types/src/collections/RepeatingList.d.ts +7 -0
  304. package/types/src/collections/ScalarGrid.d.ts +50 -0
  305. package/types/src/collections/SparseGrid.d.ts +7 -4
  306. package/types/src/collections/SpatialMap.d.ts +15 -29
  307. package/types/src/collections/SpatialMap3D.d.ts +2 -0
  308. package/types/src/collections/Tuple.d.ts +128 -16
  309. package/types/src/collections/_GridUtils.d.ts +19 -6
  310. package/types/src/collections/_SpatialUtils.d.ts +20 -2
  311. package/types/src/collections/index.d.ts +2 -1
  312. package/types/src/color/_BuiltInIndexDefs.d.ts +6 -0
  313. package/types/src/comment/Comment.d.ts +246 -0
  314. package/types/src/comment/CommentCollection.d.ts +40 -0
  315. package/types/src/comment/IComment.d.ts +377 -50
  316. package/types/src/comment/ICommentCollection.d.ts +90 -0
  317. package/types/src/comment/NoteMovable.d.ts +26 -0
  318. package/types/src/comment/_CommentUtils.d.ts +50 -0
  319. package/types/src/comment/_NoteBox.d.ts +67 -0
  320. package/types/src/comment/index.d.ts +1 -0
  321. package/types/src/condition/AnchoredConditional.d.ts +110 -19
  322. package/types/src/condition/BuiltInOperators/AbstractOperator.d.ts +42 -12
  323. package/types/src/condition/BuiltInOperators/AfterEqualToOperator.d.ts +2 -0
  324. package/types/src/condition/BuiltInOperators/AfterOperator.d.ts +2 -0
  325. package/types/src/condition/BuiltInOperators/AndOperator.d.ts +3 -1
  326. package/types/src/condition/BuiltInOperators/AverageOperator.d.ts +2 -0
  327. package/types/src/condition/BuiltInOperators/BeforeEqualToOperator.d.ts +2 -0
  328. package/types/src/condition/BuiltInOperators/BeforeOperator.d.ts +2 -0
  329. package/types/src/condition/BuiltInOperators/BetweenOperator.d.ts +2 -0
  330. package/types/src/condition/BuiltInOperators/ColorOperator.d.ts +4 -0
  331. package/types/src/condition/BuiltInOperators/ContainsOperator.d.ts +2 -0
  332. package/types/src/condition/BuiltInOperators/EndsWithOperator.d.ts +2 -0
  333. package/types/src/condition/BuiltInOperators/EqualToOperator.d.ts +4 -1
  334. package/types/src/condition/BuiltInOperators/ExpressionOperator.d.ts +5 -6
  335. package/types/src/condition/BuiltInOperators/GreaterThanEqualToOperator.d.ts +2 -0
  336. package/types/src/condition/BuiltInOperators/GreaterThanOperator.d.ts +2 -0
  337. package/types/src/condition/BuiltInOperators/IconOperator.d.ts +4 -0
  338. package/types/src/condition/BuiltInOperators/InSetOperator.d.ts +22 -5
  339. package/types/src/condition/BuiltInOperators/LessThanEqualToOperator.d.ts +2 -0
  340. package/types/src/condition/BuiltInOperators/LessThanOperator.d.ts +2 -0
  341. package/types/src/condition/BuiltInOperators/NotOperator.d.ts +2 -0
  342. package/types/src/condition/BuiltInOperators/OrOperator.d.ts +3 -1
  343. package/types/src/condition/BuiltInOperators/StartsWithOperator.d.ts +2 -0
  344. package/types/src/condition/BuiltInOperators/TimePeriodOperator.d.ts +2 -0
  345. package/types/src/condition/BuiltInOperators/TopNOperator.d.ts +6 -0
  346. package/types/src/condition/BuiltinSelectors/BaseSelector.d.ts +21 -6
  347. package/types/src/condition/BuiltinSelectors/DateSelector.d.ts +4 -5
  348. package/types/src/condition/BuiltinSelectors/DisplaySelector.d.ts +20 -0
  349. package/types/src/condition/BuiltinSelectors/TextLengthSelector.d.ts +7 -5
  350. package/types/src/condition/BuiltinSelectors/TimeSelector.d.ts +3 -5
  351. package/types/src/condition/BuiltinSelectors/WholeSelector.d.ts +3 -5
  352. package/types/src/condition/BuiltinSelectors/index.d.ts +12 -6
  353. package/types/src/condition/Condition.d.ts +19 -1
  354. package/types/src/condition/ICondition.d.ts +296 -75
  355. package/types/src/condition/_ConditionFormula.d.ts +152 -0
  356. package/types/src/condition/_ConditionUtils.d.ts +167 -13
  357. package/types/src/conditionalFormat/ConditionalEntry.d.ts +3 -3
  358. package/types/src/conditionalFormat/ConditionalFormat.d.ts +34 -17
  359. package/types/src/conditionalFormat/ConditionalFormatCollection.d.ts +19 -8
  360. package/types/src/conditionalFormat/IConditionalFormat.d.ts +16 -13
  361. package/types/src/conditionalFormat/IConditionalFormatCollection.d.ts +2 -0
  362. package/types/src/dataTable/DataTable.d.ts +67 -0
  363. package/types/src/dataTable/DataTableCollection.d.ts +19 -0
  364. package/types/src/dataTable/IDataTable.d.ts +99 -0
  365. package/types/src/dataTable/IDataTableCollection.d.ts +18 -0
  366. package/types/src/dataTable/index.d.ts +6 -0
  367. package/types/src/dataValidation/DataValidation.d.ts +70 -4
  368. package/types/src/dataValidation/DataValidationCollection.d.ts +23 -9
  369. package/types/src/dataValidation/IDataValidation.d.ts +150 -31
  370. package/types/src/dataValidation/IDataValidationCollection.d.ts +34 -2
  371. package/types/src/date/DateUtils.d.ts +20 -0
  372. package/types/src/date/_DateUtils.d.ts +91 -7
  373. package/types/src/documentProperties/DocumentProperties.d.ts +66 -0
  374. package/types/src/documentProperties/ICustomProperty.d.ts +69 -0
  375. package/types/src/documentProperties/IDocumentProperties.d.ts +110 -0
  376. package/types/src/documentProperties/index.d.ts +3 -0
  377. package/types/src/externalBook/ExternalBookCollection.d.ts +145 -12
  378. package/types/src/externalBook/ExternalBookName.d.ts +96 -0
  379. package/types/src/externalBook/IExternalBook.d.ts +171 -19
  380. package/types/src/externalBook/IExternalBookCollection.d.ts +79 -7
  381. package/types/src/externalBook/index.d.ts +1 -0
  382. package/types/src/{lib/file → file}/file.browser.d.ts +22 -8
  383. package/types/src/{lib/file → file}/file.node.d.ts +7 -2
  384. package/types/src/fill/IEffect.d.ts +5 -5
  385. package/types/src/fill/IFill.d.ts +129 -77
  386. package/types/src/fill/IFillable.d.ts +47 -0
  387. package/types/src/fill/IStroke.d.ts +204 -64
  388. package/types/src/fill/PaintUtils.d.ts +22 -0
  389. package/types/src/fill/RectAlignment.d.ts +20 -0
  390. package/types/src/fill/_Fills.d.ts +187 -0
  391. package/types/src/fill/_Stroke.d.ts +89 -0
  392. package/types/src/fill/index.d.ts +3 -0
  393. package/types/src/filter/IFilter.d.ts +188 -5
  394. package/types/src/font/AdvanceBuilder.d.ts +59 -0
  395. package/types/src/font/AdvanceTable.d.ts +228 -0
  396. package/types/src/font/CanvasAdvanceBuilder.d.ts +54 -0
  397. package/types/src/font/FontCapture.d.ts +4 -0
  398. package/types/src/font/FontCollection.d.ts +108 -0
  399. package/types/src/font/FontPlatform.d.ts +20 -0
  400. package/types/src/font/FontUtils.d.ts +5 -0
  401. package/types/src/font/IFont.d.ts +208 -61
  402. package/types/src/font/IFontCollection.d.ts +126 -22
  403. package/types/src/font/IFontStyle.d.ts +207 -0
  404. package/types/src/font/TableFileAdvanceBuilder.d.ts +36 -0
  405. package/types/src/font/_BuiltinFontTables.d.ts +10 -0
  406. package/types/src/font/_FontUtils.d.ts +11 -4
  407. package/types/src/font/_FontsVersion.d.ts +7 -0
  408. package/types/src/font/index.d.ts +2 -1
  409. package/types/src/font/platform.browser.d.ts +15 -0
  410. package/types/src/font/platform.node.d.ts +5 -0
  411. package/types/src/group/Group.d.ts +141 -0
  412. package/types/src/group/GroupMovableCollection.d.ts +41 -0
  413. package/types/src/group/IGroup.d.ts +129 -0
  414. package/types/src/group/index.d.ts +2 -0
  415. package/types/src/history/IHistory.d.ts +21 -3
  416. package/types/src/hyperlink/IHyperlink.d.ts +20 -1
  417. package/types/src/hyperlink/_Hyperlink.d.ts +5 -1
  418. package/types/src/i18n/LanguagePack.d.ts +12 -4
  419. package/types/src/index.d.ts +8 -0
  420. package/types/src/io/AbstractBackingStore.d.ts +24 -1
  421. package/types/src/io/ArrayBackingStore.d.ts +1 -1
  422. package/types/src/io/EmbeddedPart.d.ts +20 -0
  423. package/types/src/io/IEmbeddedPart.d.ts +63 -0
  424. package/types/src/io/IWorkbookIO.d.ts +185 -18
  425. package/types/src/io/WorkbookIO.d.ts +9 -0
  426. package/types/src/io/WorkbookOrigin.d.ts +20 -11
  427. package/types/src/io/WorkbookOriginProvider.d.ts +46 -0
  428. package/types/src/io/_XmlFragment.d.ts +49 -0
  429. package/types/src/io/index.d.ts +1 -0
  430. package/types/src/license/LicenseDetails.d.ts +1 -0
  431. package/types/src/license/LicenseManager.d.ts +25 -1
  432. package/types/src/license/Types.d.ts +38 -0
  433. package/types/src/license/_Utils.d.ts +39 -0
  434. package/types/src/license/details.d.ts +24 -0
  435. package/types/src/license/license-key.d.ts +49 -2
  436. package/types/src/license/runtime.browser.d.ts +46 -0
  437. package/types/src/{lib/utils/utils.node.d.ts → license/runtime.node.d.ts} +19 -12
  438. package/types/src/listener/IListener.d.ts +23 -6
  439. package/types/src/listener/ListenerEmitter.d.ts +55 -6
  440. package/types/src/model/AbstractModel.d.ts +14 -5
  441. package/types/src/movable/AbstractMovableContent.d.ts +182 -0
  442. package/types/src/movable/CustomElement.d.ts +4 -5
  443. package/types/src/movable/ErrorContent.d.ts +49 -0
  444. package/types/src/movable/FormControl.d.ts +285 -0
  445. package/types/src/movable/GroupMember.d.ts +87 -0
  446. package/types/src/movable/ICustomElement.d.ts +7 -2
  447. package/types/src/movable/IErrorContent.d.ts +23 -0
  448. package/types/src/movable/IFormControl.d.ts +455 -0
  449. package/types/src/movable/IMovable.d.ts +405 -60
  450. package/types/src/movable/IMovableCollection.d.ts +64 -4
  451. package/types/src/movable/Movable.d.ts +161 -50
  452. package/types/src/movable/MovableCollection.d.ts +21 -10
  453. package/types/src/movable/MovableContentRegistry.d.ts +113 -0
  454. package/types/src/movable/_BuiltInContents.d.ts +14 -0
  455. package/types/src/movable/_ContentFactory.d.ts +35 -0
  456. package/types/src/movable/_DrawnBounds.d.ts +37 -0
  457. package/types/src/movable/_InsertableCollection.d.ts +39 -0
  458. package/types/src/movable/_MovableUtils.d.ts +5 -0
  459. package/types/src/movable/_PendingContent.d.ts +25 -0
  460. package/types/src/movable/_PlacementUtils.d.ts +55 -0
  461. package/types/src/movable/_RotatedFrame.d.ts +20 -0
  462. package/types/src/movable/index.d.ts +7 -1
  463. package/types/src/named/AbstractNamed.d.ts +1 -1
  464. package/types/src/named/INamed.d.ts +34 -1
  465. package/types/src/named/INamedCollection.d.ts +28 -2
  466. package/types/src/named/NamedCollection.d.ts +32 -19
  467. package/types/src/numFmt/BuiltInFormats.d.ts +20 -7
  468. package/types/src/numFmt/IFormatEngine.d.ts +2 -0
  469. package/types/src/numFmt/NumberFormatParser.d.ts +5 -0
  470. package/types/src/numFmt/NumfmtFormatEngine.d.ts +2 -0
  471. package/types/src/numFmt/_FormatCell.d.ts +11 -2
  472. package/types/src/numFmt/_NumFmtUtils.d.ts +0 -1
  473. package/types/src/numFmt/vendor/numfmt/_sheetxl.d.ts +6 -0
  474. package/types/src/outline/IOutline.d.ts +186 -0
  475. package/types/src/outline/Outline.d.ts +157 -0
  476. package/types/src/outline/index.d.ts +2 -0
  477. package/types/src/person/IPerson.d.ts +99 -0
  478. package/types/src/person/IPersonCollection.d.ts +51 -0
  479. package/types/src/person/Person.d.ts +32 -0
  480. package/types/src/person/PersonCollection.d.ts +49 -0
  481. package/types/src/person/index.d.ts +4 -0
  482. package/types/src/picture/IPicture.d.ts +131 -4
  483. package/types/src/picture/Picture.d.ts +42 -14
  484. package/types/src/pivot/IPivotTable.d.ts +72 -0
  485. package/types/src/pivot/IPivotTableCollection.d.ts +25 -0
  486. package/types/src/pivot/PivotCache.d.ts +34 -0
  487. package/types/src/pivot/PivotTable.d.ts +61 -0
  488. package/types/src/pivot/PivotTableCollection.d.ts +25 -0
  489. package/types/src/pivot/_PivotXml.d.ts +24 -0
  490. package/types/src/pivot/index.d.ts +6 -0
  491. package/types/src/primitives/CompositeRangeStats.d.ts +2 -0
  492. package/types/src/primitives/Criteria.d.ts +1 -1
  493. package/types/src/primitives/Grouping.d.ts +65 -0
  494. package/types/src/primitives/LambdaBrand.d.ts +26 -0
  495. package/types/src/primitives/PrimitiveUtils.d.ts +56 -19
  496. package/types/src/primitives/Range.d.ts +133 -25
  497. package/types/src/primitives/RangeStats.d.ts +30 -2
  498. package/types/src/primitives/ReferenceRange.d.ts +44 -0
  499. package/types/src/primitives/Runtime.d.ts +15 -2
  500. package/types/src/primitives/environment.browser.d.ts +9 -0
  501. package/types/src/primitives/environment.node.d.ts +10 -0
  502. package/types/src/primitives/stats/AggregateStats.d.ts +49 -15
  503. package/types/src/primitives/stats/Cancellation.d.ts +13 -0
  504. package/types/src/primitives/stats/FrequencyStats.d.ts +10 -1
  505. package/types/src/primitives/stats/LookupIndex.d.ts +46 -0
  506. package/types/src/primitives/stats/Ranked.d.ts +1 -1
  507. package/types/src/primitives/stats/SortedNumbers.d.ts +4 -2
  508. package/types/src/primitives/stats/index.d.ts +1 -0
  509. package/types/src/print/IPageLayout.d.ts +635 -0
  510. package/types/src/print/PageLayout.d.ts +258 -0
  511. package/types/src/print/index.d.ts +1 -1
  512. package/types/src/protectedRange/IProtectedRange.d.ts +6 -2
  513. package/types/src/protectedRange/IProtectedRangeCollection.d.ts +2 -0
  514. package/types/src/protectedRange/ProtectedRange.d.ts +1 -4
  515. package/types/src/protectedRange/ProtectedRangeCollection.d.ts +19 -8
  516. package/types/src/protection/DefaultProtection.d.ts +12 -1
  517. package/types/src/protection/IProtection.d.ts +42 -2
  518. package/types/src/protection/PasswordHasher.d.ts +13 -0
  519. package/types/src/reference/ReferenceUtils.d.ts +80 -0
  520. package/types/src/reference/index.d.ts +2 -0
  521. package/types/src/resource/IResource.d.ts +21 -1
  522. package/types/src/resource/IResourceCollection.d.ts +9 -1
  523. package/types/src/resource/ResourceCollection.d.ts +6 -6
  524. package/types/src/richData/IRichDataKind.d.ts +22 -0
  525. package/types/src/richData/RichDataRegistry.d.ts +57 -0
  526. package/types/src/richData/RichText.d.ts +59 -0
  527. package/types/src/richData/index.d.ts +3 -0
  528. package/types/src/scripting/FunctionCollection.d.ts +49 -15
  529. package/types/src/scripting/IFunctionCollection.d.ts +62 -32
  530. package/types/src/scripting/IModule.d.ts +25 -0
  531. package/types/src/scripting/IModuleCollection.d.ts +17 -0
  532. package/types/src/scripting/IScript.d.ts +30 -28
  533. package/types/src/scripting/ITypedFunction.d.ts +1 -1
  534. package/types/src/scripting/Module.d.ts +34 -6
  535. package/types/src/scripting/ModuleCollection.d.ts +17 -12
  536. package/types/src/scripting/Runtime.d.ts +15 -0
  537. package/types/src/scripting/Scripts.d.ts +3 -7
  538. package/types/src/scripting/TypedFunction.d.ts +154 -18
  539. package/types/src/scripting/_FunctionIndex.d.ts +8 -3
  540. package/types/src/scripting/_ModuleUtils.d.ts +11 -1
  541. package/types/src/scripting/_ScriptUtils.d.ts +3 -0
  542. package/types/src/scripting/declarations.browser.d.ts +10 -0
  543. package/types/src/scripting/declarations.d.ts +52 -0
  544. package/types/src/scripting/declarations.node.d.ts +9 -0
  545. package/types/src/scripting/index.d.ts +3 -0
  546. package/types/src/selection/ChartElementSelection.d.ts +39 -0
  547. package/types/src/selection/IChartElementSelection.d.ts +103 -0
  548. package/types/src/selection/IItemSelection.d.ts +131 -0
  549. package/types/src/selection/IMovableSelection.d.ts +120 -0
  550. package/types/src/selection/IRangeSelection.d.ts +13 -8
  551. package/types/src/selection/ItemSelection.d.ts +49 -0
  552. package/types/src/selection/MovableSelection.d.ts +29 -0
  553. package/types/src/selection/RangeSelection.d.ts +19 -4
  554. package/types/src/selection/index.d.ts +4 -0
  555. package/types/src/shape/GeometryPreset.d.ts +197 -0
  556. package/types/src/shape/IGeometry.d.ts +380 -0
  557. package/types/src/shape/IShape.d.ts +342 -194
  558. package/types/src/shape/IShapeStyle.d.ts +109 -0
  559. package/types/src/shape/ITextBoxStyle.d.ts +85 -0
  560. package/types/src/shape/Shape.d.ts +107 -21
  561. package/types/src/shape/ShapeStyleUtils.d.ts +66 -0
  562. package/types/src/shape/_ConnectorFrame.d.ts +32 -0
  563. package/types/src/shape/_ConnectorRoute.d.ts +33 -0
  564. package/types/src/shape/_Connectors.d.ts +108 -0
  565. package/types/src/shape/_Geometry.d.ts +14 -0
  566. package/types/src/shape/_GeometryLoader.d.ts +21 -0
  567. package/types/src/shape/_ShapeStyle.d.ts +79 -0
  568. package/types/src/shape/_builtIn/_BuiltInChunks.d.ts +10 -0
  569. package/types/src/shape/_builtIn/_BuiltInDef.d.ts +9 -0
  570. package/types/src/shape/_builtIn/arrows.d.ts +6 -0
  571. package/types/src/shape/_builtIn/basic.d.ts +6 -0
  572. package/types/src/shape/_builtIn/callouts.d.ts +6 -0
  573. package/types/src/shape/_builtIn/flowchart.d.ts +6 -0
  574. package/types/src/shape/_builtIn/lines.d.ts +6 -0
  575. package/types/src/shape/_builtIn/math.d.ts +6 -0
  576. package/types/src/shape/_builtIn/other.d.ts +6 -0
  577. package/types/src/shape/_builtIn/rectangles.d.ts +6 -0
  578. package/types/src/shape/_builtIn/starsBanners.d.ts +6 -0
  579. package/types/src/shape/geometry/_strokeEnds.d.ts +7 -0
  580. package/types/src/shape/geometry/format.d.ts +3 -0
  581. package/types/src/shape/geometry/geometry.d.ts +85 -0
  582. package/types/src/shape/geometry/guides.d.ts +54 -0
  583. package/types/src/shape/geometry/handles.d.ts +14 -0
  584. package/types/src/shape/geometry/index.d.ts +7 -0
  585. package/types/src/shape/geometry/lineEnds.d.ts +54 -0
  586. package/types/src/shape/geometry/paths.d.ts +35 -0
  587. package/types/src/shape/geometry/segments.d.ts +114 -0
  588. package/types/src/shape/index.d.ts +4 -0
  589. package/types/src/sheet/CellRegion.d.ts +43 -3
  590. package/types/src/sheet/ICellContainerOptions.d.ts +50 -0
  591. package/types/src/sheet/IOpaqueSheet.d.ts +46 -0
  592. package/types/src/sheet/ISheet.d.ts +81 -931
  593. package/types/src/sheet/IWorksheet.d.ts +1514 -0
  594. package/types/src/sheet/{ISheetCollection.d.ts → IWorksheetCollection.d.ts} +38 -16
  595. package/types/src/sheet/NamedCellRange.d.ts +17 -8
  596. package/types/src/sheet/NamedRange.d.ts +10 -2
  597. package/types/src/sheet/OpaqueSheet.d.ts +114 -0
  598. package/types/src/sheet/SheetCell.d.ts +96 -39
  599. package/types/src/sheet/SheetRange.d.ts +130 -27
  600. package/types/src/sheet/SheetRanges.d.ts +33 -18
  601. package/types/src/sheet/Worksheet.d.ts +2250 -0
  602. package/types/src/sheet/WorksheetCollection.d.ts +39 -0
  603. package/types/src/sheet/_Anomalies.d.ts +109 -0
  604. package/types/src/sheet/_AnomalyFormulaChecks.d.ts +125 -0
  605. package/types/src/sheet/_AnomalyLabelChecks.d.ts +21 -0
  606. package/types/src/sheet/_CellBuffer.d.ts +224 -0
  607. package/types/src/sheet/_CopyUtils.d.ts +13 -6
  608. package/types/src/sheet/_HeldFormula.d.ts +69 -0
  609. package/types/src/sheet/_IgnoredErrors.d.ts +46 -0
  610. package/types/src/sheet/_InvalidSheetRange.d.ts +10 -9
  611. package/types/src/sheet/_Kinds.d.ts +34 -0
  612. package/types/src/sheet/_Labels.d.ts +38 -0
  613. package/types/src/sheet/_ListenerAnchor.d.ts +104 -0
  614. package/types/src/sheet/_RangeStateSweep.d.ts +15 -0
  615. package/types/src/sheet/_ScalarListFactory.d.ts +61 -0
  616. package/types/src/sheet/_SheetAutoFillUtils.d.ts +74 -0
  617. package/types/src/sheet/_SheetAutoFitUtils.d.ts +5 -5
  618. package/types/src/sheet/_SheetChangeEvent.d.ts +72 -0
  619. package/types/src/sheet/_SheetCoords.d.ts +3 -3
  620. package/types/src/sheet/_SheetEvents.d.ts +43 -0
  621. package/types/src/sheet/_SheetFilterUtils.d.ts +51 -3
  622. package/types/src/sheet/_SheetIntents.d.ts +314 -0
  623. package/types/src/sheet/_SheetMessages.d.ts +1 -1
  624. package/types/src/sheet/_SheetMutations.d.ts +185 -66
  625. package/types/src/sheet/_SheetSortUtils.d.ts +2 -2
  626. package/types/src/sheet/_SheetStateReader.d.ts +35 -11
  627. package/types/src/sheet/_SheetStateTypes.d.ts +143 -79
  628. package/types/src/sheet/_SheetUtils.d.ts +59 -41
  629. package/types/src/sheet/_WatchAnchor.d.ts +106 -0
  630. package/types/src/sheet/clipboard/RangeClipboardItems.d.ts +4 -4
  631. package/types/src/sheet/clipboard/SheetHTMLTableParser.d.ts +3 -3
  632. package/types/src/sheet/clipboard/SheetHTMLTableWriter.d.ts +3 -3
  633. package/types/src/sheet/index.d.ts +5 -2
  634. package/types/src/sheet/spatial/HeldFormulaEntry.d.ts +36 -0
  635. package/types/src/sheet/spatial/index.d.ts +1 -0
  636. package/types/src/sheet/style/SheetCellStyle.d.ts +223 -337
  637. package/types/src/sheet/style/SheetDirectStyle.d.ts +31 -20
  638. package/types/src/sheet/style/SheetNamedStyle.d.ts +19 -17
  639. package/types/src/sheet/style/SheetTableStyle.d.ts +5 -5
  640. package/types/src/sheet/style/_DigitWidth.d.ts +7 -0
  641. package/types/src/sheet/style/_Resolvers.d.ts +17 -10
  642. package/types/src/sheet/style/_StyleUtils.d.ts +34 -40
  643. package/types/src/sheetHeader/ISheetHeader.d.ts +96 -55
  644. package/types/src/sheetHeader/SheetCellHeader.d.ts +6 -0
  645. package/types/src/sheetHeader/SheetCellHeaderRange.d.ts +2 -0
  646. package/types/src/sheetHeader/SheetCellHeaderRanges.d.ts +2 -0
  647. package/types/src/sheetHeader/SheetHeader.d.ts +48 -27
  648. package/types/src/sheetHeader/_HeaderMetrics.d.ts +37 -0
  649. package/types/src/sheetHeader/_HeaderUtils.d.ts +5 -4
  650. package/types/src/sheetProtection/{ISheetProtection.d.ts → IWorksheetProtection.d.ts} +64 -30
  651. package/types/src/sheetProtection/WorksheetProtection.d.ts +51 -0
  652. package/types/src/sheetProtection/index.d.ts +1 -1
  653. package/types/src/sheetView/{ISheetView.d.ts → IWorksheetView.d.ts} +230 -69
  654. package/types/src/sheetView/WorksheetView.d.ts +139 -0
  655. package/types/src/sheetView/_SheetViewUtils.d.ts +5 -3
  656. package/types/src/sheetView/index.d.ts +1 -1
  657. package/types/src/slicer/ISlicer.d.ts +304 -17
  658. package/types/src/slicer/ISlicerStyle.d.ts +109 -0
  659. package/types/src/slicer/Slicer.d.ts +128 -13
  660. package/types/src/slicer/SlicerStyle.d.ts +25 -0
  661. package/types/src/slicer/_BuiltInSlicerStyles.d.ts +13 -0
  662. package/types/src/slicer/_SlicerUtils.d.ts +30 -0
  663. package/types/src/slicer/index.d.ts +1 -0
  664. package/types/src/sort/ISort.d.ts +39 -7
  665. package/types/src/string/IStringCollection.d.ts +5 -0
  666. package/types/src/string/StringCollection.d.ts +6 -6
  667. package/types/src/style/{IStyle.d.ts → ICellStyle.d.ts} +117 -85
  668. package/types/src/style/INamedStyleCollection.d.ts +72 -0
  669. package/types/src/style/ISlicerStyleCollection.d.ts +77 -0
  670. package/types/src/style/IStyleCollection.d.ts +91 -60
  671. package/types/src/style/ITableStyleCollection.d.ts +89 -0
  672. package/types/src/style/NamedStyleCollection.d.ts +39 -0
  673. package/types/src/style/SlicerStyleCollection.d.ts +46 -0
  674. package/types/src/style/StyleCollection.d.ts +81 -26
  675. package/types/src/style/TableStyleCollection.d.ts +49 -0
  676. package/types/src/style/_BuiltInStyleDefs.d.ts +9 -8
  677. package/types/src/style/_BuiltInStyleNames.d.ts +2 -2
  678. package/types/src/style/index.d.ts +7 -1
  679. package/types/src/table/AnchoredTable.d.ts +723 -78
  680. package/types/src/table/AutoTable.d.ts +8 -6
  681. package/types/src/table/ITable.d.ts +289 -49
  682. package/types/src/table/ITableCollection.d.ts +12 -0
  683. package/types/src/table/ITableStyle.d.ts +37 -37
  684. package/types/src/table/TableCollection.d.ts +19 -8
  685. package/types/src/table/_FilterField.d.ts +19 -6
  686. package/types/src/table/_NamedTable.d.ts +20 -4
  687. package/types/src/table/_NamedTableSource.d.ts +3 -2
  688. package/types/src/table/_SortField.d.ts +2 -0
  689. package/types/src/table/_TableColumn.d.ts +13 -2
  690. package/types/src/table/_TableMessages.d.ts +1 -0
  691. package/types/src/table/_TableUtils.d.ts +40 -0
  692. package/types/src/text/Bullet.d.ts +4 -0
  693. package/types/src/text/IText.d.ts +150 -15
  694. package/types/src/text/ITextFrame.d.ts +110 -1
  695. package/types/src/text/TextBoxAlignment.d.ts +25 -16
  696. package/types/src/text/TextEngine.d.ts +34 -0
  697. package/types/src/text/TextFrame.d.ts +8 -2
  698. package/types/src/text/TextLine.d.ts +4 -0
  699. package/types/src/text/TextParagraph.d.ts +4 -0
  700. package/types/src/text/TextRotation.d.ts +3 -3
  701. package/types/src/text/TextRun.d.ts +12 -2
  702. package/types/src/text/TextStacked.d.ts +83 -0
  703. package/types/src/text/TextWrapper.d.ts +32 -26
  704. package/types/src/text/_TextUtils.d.ts +5 -5
  705. package/types/src/text/_TextWrapperFallback.d.ts +49 -0
  706. package/types/src/text/impl/TabStrategy.d.ts +3 -1
  707. package/types/src/text/index.d.ts +1 -0
  708. package/types/src/text/richtext/IRichText.d.ts +50 -0
  709. package/types/src/text/richtext/index.d.ts +1 -1
  710. package/types/src/theme/ITheme.d.ts +153 -11
  711. package/types/src/theme/IThemeCollection.d.ts +2 -0
  712. package/types/src/theme/ThemeCollection.d.ts +16 -7
  713. package/types/src/theme/_OfficeFontScheme.d.ts +8 -0
  714. package/types/src/theme/_OfficeFormatScheme.d.ts +3 -0
  715. package/types/src/transaction/ITransaction.d.ts +277 -45
  716. package/types/src/transaction/Transaction.d.ts +108 -11
  717. package/types/src/transaction/TransactionUndoManager.d.ts +4 -1
  718. package/types/src/transaction/_BatchHandle.d.ts +118 -0
  719. package/types/src/type/AbstractCollection.d.ts +92 -0
  720. package/types/src/type/ICollection.d.ts +131 -1
  721. package/types/src/type/IProperties.d.ts +1 -1
  722. package/types/src/type/ITypes.d.ts +9 -7
  723. package/types/src/type/index.d.ts +1 -0
  724. package/types/src/utils/_CSSUtils.d.ts +4 -4
  725. package/types/src/wasm/_fontsWasm.d.ts +7 -0
  726. package/types/src/wasm/_sdkWasm.d.ts +7 -0
  727. package/types/src/wasm/fontsWasm.d.ts +32 -0
  728. package/types/src/wasm/index.d.ts +3 -0
  729. package/types/src/wasm/loader.browser.d.ts +9 -0
  730. package/types/src/wasm/loader.node.d.ts +9 -0
  731. package/types/src/wasm/sdkWasm.d.ts +32 -0
  732. package/types/src/workbook/IWorkbook.d.ts +404 -73
  733. package/types/src/workbook/Workbook.d.ts +196 -28
  734. package/types/src/workbook/WorkbookRange.d.ts +2 -2
  735. package/types/src/workbook/WorkbookRanges.d.ts +2 -2
  736. package/types/src/workbook/_WorkbookIntents.d.ts +36 -0
  737. package/types/src/workbook/_WorkbookMessages.d.ts +5 -0
  738. package/types/src/workbookProtection/IWorkbookProtection.d.ts +7 -0
  739. package/types/src/workbookProtection/WorkbookProtection.d.ts +3 -0
  740. package/types/src/workbookView/IWorkbookView.d.ts +94 -0
  741. package/types/src/workbookView/WorkbookView.d.ts +26 -0
  742. package/browser/cjs/B7_pDFYCVzt-3hUs.cjs +0 -1
  743. package/browser/cjs/BatsV2UUraVDCRXm.cjs +0 -57
  744. package/browser/cjs/CUz53T65cRGQRgvv.cjs +0 -33
  745. package/browser/cjs/DU0kYUtdFa3jK-im.cjs +0 -1
  746. package/browser/cjs/Dv3x6zut1ZRUt3IF.cjs +0 -10
  747. package/browser/cjs/Dv4yIPLV98M5zLHa.cjs +0 -1
  748. package/browser/cjs/a0Z-SXs_N71CtqYb.cjs +0 -1
  749. package/browser/cjs/index.cjs +0 -3
  750. package/browser/esm/6JKSOvc5czaQB2Bj.mjs +0 -109
  751. package/browser/esm/BtuJ9AGzeURtAsGo.mjs +0 -51241
  752. package/browser/esm/DGU6sM25u0EWCKl1.mjs +0 -824
  753. package/node/esm/-pxdn3M3tc6PLHs7.mjs +0 -114
  754. package/node/esm/0n5bslM9jhO1JnI2.mjs +0 -843
  755. package/types/src/cellRange/_GraphNode.d.ts +0 -38
  756. package/types/src/collections/OverlappingRangeIterator.d.ts +0 -91
  757. package/types/src/condition/BuiltinSelectors/ListSelector.d.ts +0 -12
  758. package/types/src/dataValidation/_Utils.d.ts +0 -10
  759. package/types/src/font/CanvasFontMeasurer.d.ts +0 -25
  760. package/types/src/font/FontKitFontMeasurer.d.ts +0 -11
  761. package/types/src/font/SimpleFontMeasurer.d.ts +0 -4
  762. package/types/src/lib/utils/_Utils.d.ts +0 -27
  763. package/types/src/lib/utils/utils.browser.d.ts +0 -33
  764. package/types/src/movable/IGroup.d.ts +0 -30
  765. package/types/src/movable/IMovableSelection.d.ts +0 -49
  766. package/types/src/print/IPrint.d.ts +0 -234
  767. package/types/src/sheet/Sheet.d.ts +0 -1107
  768. package/types/src/sheet/SheetCollection.d.ts +0 -18
  769. package/types/src/sheet/listener/RangesListener.d.ts +0 -32
  770. package/types/src/sheet/listener/RangesListenerEntry.d.ts +0 -19
  771. package/types/src/sheet/listener/index.d.ts +0 -3
  772. package/types/src/sheetProtection/SheetProtection.d.ts +0 -39
  773. package/types/src/sheetView/SheetView.d.ts +0 -113
  774. package/types/src/text/richtext/IStyledFont.d.ts +0 -330
  775. /package/types/src/{lib/utils → license}/banner.d.ts +0 -0
@@ -0,0 +1,1762 @@
1
+ /**
2
+ * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.8.0-beta.11
3
+ *
4
+ * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
+ * License: The license can be found at https://www.sheetxl.com/license.
6
+ */
7
+ import { $n as e, An as t, En as n, Gr as r, Ht as i, Nt as l, On as s, Pt as o, Qn as a, St as u, Vn as c, Wn as f, Zr as p, _ as d, ar as g, dr as v, f as h, fn as m, h as y, jt as I, kn as b, lr as x, mi as R, n as E, ni as T, or as A, p as S, s as w, tr as C, u as N, ur as F } from "./OVfaSb506tNSIvbv.mjs";
8
+ import { Qt as P } from "./DNRhGK-8Tr9xcRyc.mjs";
9
+ import { FormulaError as k, Scalar as L, ScalarType as $, ValueKind as O, isLazyValue as B } from "@sheetxl/primitives";
10
+ import { CommonUtils as V } from "@sheetxl/utils";
11
+ var z = (e, t) => e + t, D = (e, t) => e - t, W = (e, t) => u(e + t, e), M = (e, t) => u(e - t, e), U = (e, t) => h(e * t), _ = (e, t) => 0 === t ? k.BuiltIn.Div0 : h(e / t), j = (e, t) => {
12
+ if (0 === e) {
13
+ if (t < 0) return k.BuiltIn.Div0;
14
+ if (0 === t) return NaN;
15
+ }
16
+ if (e < 0) {
17
+ if (Number.isInteger(t) && Math.abs(t) <= 4294967294) return h(e ** t);
18
+ const n = Number((1 / t).toPrecision(15));
19
+ return Number.isInteger(n) && 1 === Math.abs(n % 2) ? h(-((-e) ** t)) : NaN;
20
+ }
21
+ return h(e ** t);
22
+ }, G = (e = "", t = "") => {
23
+ null === e && (e = ""), null === t && (t = "");
24
+ const n = typeof t;
25
+ "boolean" === typeof e && (e = R(e)), "boolean" === n && (t = R(t));
26
+ const r = "" + e + t;
27
+ return r.length > L.MAX_TEXT_LENGTH ? r.slice(0, L.MAX_TEXT_LENGTH) : r;
28
+ }, H = (e, t = null, n = null) => 0 === e.compare(t, n), X = (e, t = null, n = null) => 0 !== e.compare(t, n), Z = (e, t = null, n = null) => e.compare(t, n) > 0, K = (e, t = null, n = null) => e.compare(t, n) >= 0, Q = (e, t = null, n = null) => e.compare(t, n) < 0, q = (e, t = null, n = null) => e.compare(t, n) <= 0, J = {
29
+ type: $.Number,
30
+ coerce: [$.Boolean, $.String],
31
+ onError: "value",
32
+ misalignValue: k.BuiltIn.NA
33
+ }, Y = {
34
+ type: $.String,
35
+ coerce: [$.Boolean, $.Number],
36
+ onError: "value",
37
+ misalignValue: k.BuiltIn.NA
38
+ }, ee = {
39
+ onError: "value",
40
+ misalignValue: k.BuiltIn.NA
41
+ }, te = (e) => null !== e && "object" == typeof e && !0 === e.isIReferenceRange && 1 === e.size ? e.getValueAt(0, 0) ?? null : e, ne = (e, t, n, r) => {
42
+ if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && k.isError(t)) return t;
43
+ if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && k.isError(n)) return n;
44
+ if (t = te(t), n = te(n), "number" == typeof t && "number" == typeof n) return r(t, n);
45
+ let i, l;
46
+ if (t?.isIRange ? i = t : n?.isIRange && (l = n), !i && !l) {
47
+ const i = e.getRuntime();
48
+ return t = w(i, t, d(t, !0), $.Number, !0), n = w(i, n, d(n, !0), $.Number, !0), t && k.isError(t) ? t : n && k.isError(n) ? n : r(t, n);
49
+ }
50
+ const s = !i, o = s ? t : n;
51
+ return (i ?? l).broadcast(o, (t, n) => t && k.isError(t) ? t : n && k.isError(n) ? n : y(s ? r(n, t) : r(t, n), e), J).fillEmpty(0);
52
+ }, re = (e, t, n, r) => {
53
+ if (m(t) || m(n)) return k.BuiltIn.Value;
54
+ if (B(t) || B(n)) return k.BuiltIn.Value;
55
+ if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && k.isError(t)) return t;
56
+ if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && k.isError(n)) return n;
57
+ let i, l;
58
+ t = te(t), n = te(n);
59
+ let s = !1;
60
+ return t?.isIRange ? (i = t, l = n) : n?.isIRange && (i = n, l = t, s = !0), i ? i.broadcast(l, (t, n) => t && k.isError(t) ? t : n && k.isError(n) ? n : (t = ie(t), n = ie(n), s ? r(e, n, t) : r(e, t, n)), ee) : k.isError(t) ? t : k.isError(n) ? n : r(e, ie(t), ie(n));
61
+ }, ie = (e) => {
62
+ if (!0 !== e?.isIRichData) return e;
63
+ const t = e.toPrimitive?.();
64
+ return null == t ? e : t;
65
+ }, le = (e, t, n) => {
66
+ if (null == n && (n = 0), null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && k.isError(n)) return n;
67
+ n = te(n);
68
+ let r, i = 1;
69
+ if ("+" === t) return n;
70
+ if ("-" !== t) throw new k.Value(`Unrecognized prefix: ${t}`);
71
+ if (i = -i, n?.isIRange && (r = n), !r) {
72
+ const t = e.getRuntime();
73
+ return "number" != typeof (n = w(t, n, d(n, !0), $.Number, !0)) ? k.BuiltIn.Value : n * i;
74
+ }
75
+ return r.broadcast(i, (e, t) => e && k.isError(e) ? e : t && k.isError(t) ? t : U(e, t), J);
76
+ }, se = (e) => e.getCode() <= k.Code.NA ? e : k.BuiltIn.Value, oe = (e, t, n, r, i) => {
77
+ if (k.isError(t)) return se(t);
78
+ if (n && k.isError(n)) return se(n);
79
+ if (!t) return k.BuiltIn.Ref;
80
+ if (t.isIReferenceRange && n && !n.isIReferenceRange ? n = e.getReference(n) : n && n.isIReferenceRange && t && !t.isIReferenceRange && (t = e.getReference(t)), t.isIReferenceRange && (t = t.getCoords()), void 0 === t.colStart) return k.BuiltIn.Value;
81
+ if (n.isIReferenceRange && (n = n.getCoords()), void 0 === n.colStart) return k.BuiltIn.Value;
82
+ const l = t.scope ? "either" !== i || n.scope ? null : t : n;
83
+ if (l?.scope) {
84
+ const t = e.getReference(l);
85
+ if (k.isError(t)) return t;
86
+ if (e.getSheetIndex() !== e.getSheetIndex(t)) return k.BuiltIn.Value;
87
+ }
88
+ const s = r(t, n);
89
+ return k.isError(s) ? s : s ? e.getReference(s) : k.BuiltIn.Null;
90
+ }, ae = {
91
+ "+": (e, t, n) => ne(e, t, n, z),
92
+ "-": (e, t, n) => ne(e, t, n, D),
93
+ "*": (e, t, n) => ne(e, t, n, U),
94
+ "/": (e, t, n) => ne(e, t, n, _),
95
+ "^": (e, t, n) => ne(e, t, n, j),
96
+ " ": (e, t, n, i) => oe(e, t, n, r, "either"),
97
+ ":": (e, t, n, r) => oe(e, t, n, T, "start"),
98
+ ".:.": (e, t, n, r) => {
99
+ const i = oe(e, t, n, T, "start");
100
+ return e.getFunction("TRIMRANGE").execute(i, 3, 3);
101
+ },
102
+ ".:": (e, t, n, r) => {
103
+ const i = oe(e, t, n, T, "start");
104
+ return e.getFunction("TRIMRANGE").execute(i, 1, 1);
105
+ },
106
+ ":.": (e, t, n, r) => {
107
+ const i = oe(e, t, n, T, "start");
108
+ return e.getFunction("TRIMRANGE").execute(i, 2, 2);
109
+ },
110
+ "&": (e, t, n) => ((e, t, n, r) => {
111
+ if (null !== t && void 0 !== t.colStart && (t = e.getValueAt(t.rowStart, t.colStart, t.scope)) && k.isError(t)) return t;
112
+ if (null !== n && void 0 !== n.colStart && (n = e.getValueAt(n.rowStart, n.colStart, n.scope)) && k.isError(n)) return n;
113
+ if (t = te(t), n = te(n), "string" == typeof t && "string" == typeof n) return r(t, n);
114
+ let i, l;
115
+ if (t?.isIRange ? i = t : n?.isIRange && (l = n), !i && !l) {
116
+ const i = e.getRuntime();
117
+ return t = w(i, t, d(t, !0), $.String, !1), n = w(i, n, d(n, !0), $.String, !1), k.isError(t) ? t : k.isError(n) ? n : r(t, n);
118
+ }
119
+ const s = !i, o = s ? t : n;
120
+ return (i ?? l).broadcast(o, (e, t) => e && k.isError(e) ? e : t && k.isError(t) ? t : s ? r(t, e) : r(e, t), Y);
121
+ })(e, t, n, G),
122
+ "=": (e, t, n) => re(e, t, n, H),
123
+ "<>": (e, t, n) => re(e, t, n, X),
124
+ ">": (e, t, n) => re(e, t, n, Z),
125
+ "<": (e, t, n) => re(e, t, n, Q),
126
+ ">=": (e, t, n) => re(e, t, n, K),
127
+ "<=": (e, t, n) => re(e, t, n, q)
128
+ }, ue = {
129
+ "+": (e, t, n) => ne(e, t, n, W),
130
+ "-": (e, t, n) => ne(e, t, n, M)
131
+ }, ce = {
132
+ "-": (e, t) => le(e, "-", t),
133
+ "+": (e, t) => le(e, "+", t),
134
+ "@": (e, t) => {
135
+ if (!t || !t.isIRange) return t;
136
+ const n = t;
137
+ if (!t.isIReferenceRange) return n.getValueAt(0, 0);
138
+ const r = t.getCoords(), i = n.getRowCount(), l = n.getColumnCount(), s = e.getRow() - r.rowStart, o = e.getColumn() - r.colStart, a = s >= 0 && s < i, u = o >= 0 && o < l;
139
+ return a && u ? n.getValueAt(s, o) : a && 1 === l ? n.getValueAt(s, 0) : u && 1 === i ? n.getValueAt(0, o) : 1 === i && 1 === l ? n.getValueAt(0, 0) : k.BuiltIn.Value;
140
+ }
141
+ }, fe = {
142
+ "%": (e, t) => ne(e, t, 100, _),
143
+ "#": (e, t) => {
144
+ if (k.isError(t)) return se(t);
145
+ if (!t) return k.BuiltIn.Ref;
146
+ if (t.isIReferenceRange && (t = t.getCoords()), void 0 === t.colStart) return k.BuiltIn.Value;
147
+ if (t.rowStart !== t.rowEnd || t.colStart !== t.colEnd) return k.BuiltIn.Ref;
148
+ return e.getSpillAt(t.rowStart, t.colStart, t.scope) || k.BuiltIn.Ref;
149
+ }
150
+ };
151
+ function pe(e, t) {
152
+ for (let n = e.length - 1; n >= 0; n--) if (e[n].type === t) return e[n];
153
+ }
154
+ var de = class {
155
+ constructor() {
156
+ this.referenceIndices = [], this.rootReferences = /* @__PURE__ */ new Set(), this.cells = /* @__PURE__ */ new Map(), this.references = /* @__PURE__ */ new Map(), this.names = /* @__PURE__ */ new Map();
157
+ }
158
+ processNode(e, t) {
159
+ const n = e.type;
160
+ if (e.isReference) {
161
+ const t = {
162
+ node: e,
163
+ index: this.references.size,
164
+ op: null,
165
+ value: null,
166
+ inputs: null
167
+ };
168
+ if (this.references.set(e, t), n === v.Cell) {
169
+ const n = e.value;
170
+ n.$colIndex && (t.hasHorizontalAbs = !0), n.$rowIndex && (t.hasVerticalAbs = !0), t.value = this.cells.size, this.cells.set(e, this.cells.size), this.rootReferences.add(t), e.referenceIndex = this.referenceIndices.length, this.referenceIndices.push(t.index);
171
+ return;
172
+ }
173
+ if (n === v.Infix || n === v.Prefix || n === v.Postfix || n === v.List) {
174
+ const n = e.inputs || [], r = n.length, i = e.value;
175
+ t.op = i;
176
+ const l = N(r);
177
+ t.inputs = l;
178
+ for (let e = 0; e < r; e++) {
179
+ const r = n[e], i = this.references.get(r);
180
+ i ? (i.hasHorizontalAbs && (t.hasHorizontalAbs = !0), i.hasVerticalAbs && (t.hasVerticalAbs = !0), l[e] = i.index) : l[e] = -1, i && this.rootReferences.delete(i);
181
+ }
182
+ if (this.rootReferences.add(t), Xe.includes(i)) {
183
+ const r = n[0], i = !!r && r.type === v.Cell, l = n[1], s = !!l && l.type === v.Cell;
184
+ i && s && void 0 !== l.referenceIndex && void 0 !== r.referenceIndex && (this.referenceIndices.splice(l.referenceIndex, 1), l.referenceIndex = r.referenceIndex, e.referenceIndex = r.referenceIndex, this.referenceIndices[r.referenceIndex] = t.index);
185
+ } else "#" === i && n[0] && (e.referenceIndex = n[0].referenceIndex);
186
+ return;
187
+ }
188
+ if (n === v.Error || n === v.Named) {
189
+ const r = n === v.Named ? e.value.nameId : a(e.value);
190
+ let i = this.names.get(r);
191
+ t.op = n, void 0 === i && (i = this.names.size, this.names.set(r, i)), t.value = i, this.rootReferences.add(t), e.referenceIndex = this.referenceIndices.length, this.referenceIndices.push(t.index);
192
+ return;
193
+ }
194
+ if (n === v.TableReference) return t.op = n, this.rootReferences.add(t), e.referenceIndex = this.referenceIndices.length, void this.referenceIndices.push(t.index);
195
+ } else if (t && t.isReference) {
196
+ const t = {
197
+ node: e,
198
+ index: this.references.size,
199
+ op: v.Function,
200
+ value: e.value,
201
+ inputs: null
202
+ };
203
+ this.references.set(e, t);
204
+ }
205
+ }
206
+ };
207
+ function ge(t, r = !1, i = x) {
208
+ const l = [], o = /* @__PURE__ */ new Set(), a = (t, n, i) => {
209
+ const s = {
210
+ type: t.type,
211
+ value: t.type === v.Error ? e(t.value) : t.value
212
+ };
213
+ void 0 !== t.image && (s.text = ((e) => {
214
+ const t = r ? e.value?.scopeImage : void 0;
215
+ return "string" == typeof t ? t : "";
216
+ })(t) + t.image);
217
+ const a = t.evalIndex ?? i;
218
+ return void 0 !== a && (s.evalIndex = a), n && (s.context = n), void 0 !== t.referenceIndex && (s.referenceIndex = t.referenceIndex), t.isReference && o.add(s), l.push(s), s;
219
+ }, u = (e, t, n, r, i) => {
220
+ if (null == t) return;
221
+ if (l.length > 1 && e === v.Whitespace && l[l.length - 1].type === v.Whitespace) return;
222
+ const s = {
223
+ type: e,
224
+ value: t,
225
+ text: i ?? t
226
+ };
227
+ void 0 !== r && (s.evalIndex = r), n && (s.context = n), l.push(s);
228
+ };
229
+ (function e(t, c, f) {
230
+ const p = t.evalIndex ?? f ?? 0, d = t.type, g = (t, n, r) => {
231
+ if (!t) return;
232
+ const l = t.length;
233
+ for (let s = 0; s < l; s++) e(t[s], n, r), s < l - 1 && u(v.Separator, ",", n, r, i.separatorFunction);
234
+ };
235
+ if (t.isLiteral) {
236
+ if (u(v.Whitespace, t.wsBefore, c, p), d === v.Array) {
237
+ u(v.Type, "{", c, p);
238
+ const n = t.value, r = n.length;
239
+ for (let t = 0; t < r; t++) {
240
+ const l = n[t], s = l.value, o = s.length;
241
+ for (let t = 0; t < o; t++) {
242
+ const n = s[t];
243
+ u(v.Whitespace, n.wsBefore, c, p), e(n, c, p), u(v.Whitespace, n.wsAfter, c, p), t < o - 1 && u(v.Separator, ",", c, p, i.separatorColumn);
244
+ }
245
+ t < r - 1 && (u(v.Whitespace, l.wsBefore, c, p), u(v.Separator, ";", c, p, i.separatorRow), u(v.Whitespace, l.wsAfter, c, p));
246
+ }
247
+ t.error || u(v.Type, "}", c, p);
248
+ } else d === v.String ? (t = {
249
+ type: d,
250
+ value: "\"" + `${t.value}`.replace(/"/g, "\"\"") + "\"",
251
+ image: t.image
252
+ }, a(t, c, p)) : a(t, c, p);
253
+ u(v.Whitespace, t.wsAfter, c, p);
254
+ } else if (d === v.Infix) e(t.inputs[0], c, p), u(v.Whitespace, t.wsBefore, c, p), a(t, c, p), u(v.Whitespace, t.wsAfter, c, p), e(t.inputs[1], c, p);
255
+ else if (d === v.Prefix) u(v.Whitespace, t.wsBefore, c, p), a(t, c, p), u(v.Whitespace, t.wsAfter, c, p), t.inputs && e(t.inputs[0], c, p);
256
+ else if (d === v.Postfix) {
257
+ t.inputs?.[0] && e(t.inputs[0], c, p), u(v.Whitespace, t.wsBefore, c, p);
258
+ const n = a(t, c, p), r = l[l.length - 2];
259
+ "#" === t.value && void 0 !== n.text && !t.wsBefore && o.has(r) && (r.text = (r.text ?? "") + n.text, n.text = ""), u(v.Whitespace, t.wsAfter, c, p);
260
+ } else {
261
+ u(v.Whitespace, t.wsBefore, c, p);
262
+ const f = t.inputs;
263
+ switch (d) {
264
+ case v.Function: {
265
+ const n = String(t.value), r = {
266
+ type: v.Function,
267
+ value: n,
268
+ text: t.image ?? n,
269
+ evalIndex: t.evalIndex
270
+ };
271
+ c && (r.context = c), l.push(r);
272
+ const s = {
273
+ name: n,
274
+ argIndex: -1,
275
+ type: t.binder?.kind ?? "function"
276
+ };
277
+ if (c?.bound && (s.bound = c.bound), u(v.Paren, "(", s, t.evalIndex), f) {
278
+ const n = f.length, r = t.binder?.kind, l = "lambda" === r ? 1 : "let" === r ? 2 : 0;
279
+ let o = s.bound;
280
+ for (let t = 0; t < n; t++) {
281
+ const a = l && t >= l ? f[t - l] : void 0;
282
+ if (a?.binding?.declaration) {
283
+ const e = a.value.nameId, n = "let" === r ? It(f[t - 1]) : void 0;
284
+ o = yt(o, n ? {
285
+ name: e,
286
+ params: n
287
+ } : { name: e });
288
+ }
289
+ const c = {
290
+ ...s,
291
+ argIndex: t
292
+ };
293
+ o && (c.bound = o), e(f[t], c, p), t < n - 1 && u(v.Separator, ",", c, p, i.separatorFunction);
294
+ }
295
+ }
296
+ t.error || u(v.Paren, ")", s, t.evalIndex);
297
+ break;
298
+ }
299
+ case v.Call: {
300
+ const r = s(t), o = l.length;
301
+ if (r && e(r, c, p), r?.type === v.Named) for (let e = o; e < l.length; e++) {
302
+ const n = l[e];
303
+ n.type !== v.Whitespace && (n.evalIndex = t.evalIndex, n.type === v.Named && (n.type = v.Function, n.value = n.value.name));
304
+ }
305
+ const a = {
306
+ name: r?.type === v.Named ? r.value.nameId : "",
307
+ argIndex: -1,
308
+ type: "function"
309
+ };
310
+ c?.bound && (a.bound = c.bound), u(v.Paren, "(", a, t.evalIndex);
311
+ const f = n(t), d = f.length;
312
+ for (let t = 0; t < d; t++) {
313
+ const n = {
314
+ ...a,
315
+ argIndex: t
316
+ };
317
+ e(f[t], n, p), t < d - 1 && u(v.Separator, ",", n, p, i.separatorFunction);
318
+ }
319
+ t.error || u(v.Paren, ")", a, t.evalIndex);
320
+ break;
321
+ }
322
+ case v.Cell:
323
+ a(t, c, p);
324
+ break;
325
+ case v.Paren:
326
+ u(d, "(", c, p), g(f, c, p), t.error || u(d, ")", c, p);
327
+ break;
328
+ case v.TableReference: {
329
+ const n = t.value?.tableId ?? "", i = {
330
+ name: n,
331
+ argIndex: -1,
332
+ type: "table"
333
+ }, s = l.length, a = t.image;
334
+ let d, g = !1;
335
+ if (n && a) {
336
+ let e = 0;
337
+ if (91 === a.charCodeAt(0)) {
338
+ const t = a.indexOf("]");
339
+ -1 !== t && 33 === a.charCodeAt(t + 1) && (e = t + 2);
340
+ }
341
+ const t = a.indexOf("[", e);
342
+ if (g = 0 === t && null != f, t > 0) d = a.slice(0, t);
343
+ else if (!f) {
344
+ const e = a.lastIndexOf("!");
345
+ d = r || -1 === e ? a : a.slice(e + 1);
346
+ }
347
+ }
348
+ if (!n || g && r || u(v.TableReference, n, c, p, d), f && u(v.Paren, "[", i, p), f) {
349
+ const t = f.length;
350
+ for (let n = 0; n < t; n++) {
351
+ const r = {
352
+ ...i,
353
+ argIndex: n
354
+ };
355
+ e(f[n], r, p), n < t - 1 && u(v.Separator, ",", r, p);
356
+ }
357
+ }
358
+ f && !t.error && u(v.Paren, "]", i, p);
359
+ const h = t.referenceIndex;
360
+ for (let e = s; e < l.length; e++) void 0 !== h && (l[e].referenceIndex = h), o.add(l[e]);
361
+ break;
362
+ }
363
+ case v.TableSpecifier:
364
+ case v.TableColumn: {
365
+ const e = t.image, n = null != e && e.startsWith("[") && e.endsWith("]");
366
+ n && u(v.Paren, "[", c, p);
367
+ const r = {
368
+ table: "table" === c?.type ? c.name : "",
369
+ name: t.value
370
+ }, i = {
371
+ type: d,
372
+ value: r,
373
+ text: n ? e.slice(1, -1) : e ?? r.name
374
+ };
375
+ void 0 !== p && (i.evalIndex = p), c && (i.context = c), l.push(i), n && u(v.Paren, "]", c, p);
376
+ break;
377
+ }
378
+ case v.List:
379
+ g(f, c, p);
380
+ break;
381
+ case v.Named: {
382
+ const e = a(t, c, p), n = t.value;
383
+ e.value = n.scope ? {
384
+ name: n.nameId,
385
+ scope: n.scope
386
+ } : { name: n.nameId }, t.binding?.declaration && t.binding.optional && (e.value.optional = !0), t.binding && (e.type = v.Parameter, t.binding.declaration && (e.value.declaration = !0)), delete e.referenceIndex;
387
+ break;
388
+ }
389
+ default: void 0 !== t.value && a(t, c, p), f && f.forEach((t) => e(t, c, p));
390
+ }
391
+ u(v.Whitespace, t.wsAfter, c, p);
392
+ }
393
+ })(t);
394
+ const c = /* @__PURE__ */ new Map();
395
+ for (const e of l) if (e.type === v.Cell && void 0 !== e.referenceIndex) {
396
+ const t = c.get(e.referenceIndex);
397
+ t ? t.push(e) : c.set(e.referenceIndex, [e]);
398
+ }
399
+ for (const e of c.values()) 1 === e.length ? e[0].refSide = "self" : (e[0].refSide = "left", e[e.length - 1].refSide = "right");
400
+ const f = /* @__PURE__ */ new Map();
401
+ for (const e of l) if (void 0 !== e.referenceIndex && void 0 !== e.evalIndex) {
402
+ const t = f.get(e.referenceIndex);
403
+ (void 0 === t || e.evalIndex < t) && f.set(e.referenceIndex, e.evalIndex);
404
+ }
405
+ if (f.size > 0) {
406
+ for (const e of l) if (void 0 !== e.referenceIndex) {
407
+ const t = f.get(e.referenceIndex);
408
+ void 0 !== t && (e.evalIndex = t);
409
+ }
410
+ }
411
+ return l;
412
+ }
413
+ function ve(e, t) {
414
+ let n = "";
415
+ for (let r = 0; r < e.length; r++) {
416
+ const l = e[r], s = l.type;
417
+ if (s === v.Cell || s === v.Named || s === v.Error) {
418
+ const e = s === v.Cell ? l.value?.scope : (v.Named, l.value?.scope ?? void 0), r = s === v.Error ? void 0 !== l.text && C(l.text) : l.text?.includes("!") ?? !1;
419
+ if (e && void 0 !== l.text && !r) {
420
+ const r = t?.resolve(i.Sheet, e)?.toString() ?? e;
421
+ n += p(r) + "!" + l.text;
422
+ continue;
423
+ }
424
+ if (s === v.Named) {
425
+ n += l.text ?? l.value?.name ?? "";
426
+ continue;
427
+ }
428
+ }
429
+ if (s === v.Parameter) {
430
+ n += l.text ?? l.value?.name ?? "";
431
+ continue;
432
+ }
433
+ const o = l.text ?? l.value;
434
+ "string" == typeof o && (n += o);
435
+ }
436
+ return n;
437
+ }
438
+ function he(e, t) {
439
+ let n;
440
+ if (A(e, (e) => {
441
+ e.evalIndex === t && (n = e);
442
+ }), !n) return [];
443
+ const r = ge(n);
444
+ return r.length > 1 && r[0].type === v.Whitespace && r.shift(), r.length > 1 && r[r.length - 1].type === v.Whitespace && r.pop(), r;
445
+ }
446
+ function me(e) {
447
+ return A(e, (e) => {
448
+ if (e.type !== v.TableReference) return;
449
+ const t = function(e) {
450
+ if (null !== e.value && "object" == typeof e.value) return e.value;
451
+ const t = e.value, n = e.inputs;
452
+ let r = !1, i = !1, l = !1, s = !1, o = null, a = null, u = !1;
453
+ const c = (e) => {
454
+ e?.type === v.TableColumn && (o = e.value, a = e.value);
455
+ };
456
+ if (n) for (const e of n) {
457
+ const t = e.type;
458
+ if (t === v.TableSpecifier) {
459
+ const t = e.value.toUpperCase().trim();
460
+ "#ALL" === t ? i = !0 : "#HEADERS" === t ? l = !0 : "#TOTALS" === t ? s = !0 : "#DATA" === t ? r = !0 : "@" !== t && "#THIS ROW" !== t || (u = !0);
461
+ } else if (t === v.TableColumn) c(e);
462
+ else if (t === v.Infix && ":" === e.value) {
463
+ const t = e.inputs?.[0], n = e.inputs?.[1];
464
+ t?.type === v.TableColumn && (o = t.value), n?.type === v.TableColumn && (a = n.value);
465
+ } else if (t === v.Prefix && "@" === e.value) {
466
+ u = !0;
467
+ const t = e.inputs?.[0];
468
+ t?.type === v.Infix && ":" === t.value ? (t.inputs?.[0]?.type === v.TableColumn && (o = t.inputs[0].value), t.inputs?.[1]?.type === v.TableColumn && (a = t.inputs[1].value)) : c(t);
469
+ }
470
+ }
471
+ return {
472
+ tableId: t,
473
+ spec: g(i, l, r, s),
474
+ columnFromId: o,
475
+ columnToId: a,
476
+ isThisRow: u
477
+ };
478
+ }(e);
479
+ return {
480
+ ...e,
481
+ value: t
482
+ };
483
+ });
484
+ }
485
+ function ye(e) {
486
+ return A(e, (e) => {
487
+ if (e.type !== v.TableReference) return;
488
+ const t = e.inputs;
489
+ if (!t) return;
490
+ if (-1 === t.findIndex((e) => e.type === v.TableSpecifier && "#THIS ROW" === e.value.toUpperCase().trim())) return;
491
+ const n = [];
492
+ let r;
493
+ for (const e of t) {
494
+ if (e.type === v.TableSpecifier && "#THIS ROW" === e.value.toUpperCase().trim()) continue;
495
+ e.type !== v.TableColumn && (e.type !== v.Infix || ":" !== e.value) || r ? n.push(e) : r = e;
496
+ }
497
+ if (!r) return n.push({
498
+ type: v.Prefix,
499
+ value: "@",
500
+ inputs: null,
501
+ isReference: !0
502
+ }), {
503
+ ...e,
504
+ inputs: n
505
+ };
506
+ const i = r.image ?? r.value, l = i.startsWith("[") && i.endsWith("]") ? {
507
+ ...r,
508
+ image: i.slice(1, -1)
509
+ } : r;
510
+ return n.push(f("@", l, !0)), {
511
+ ...e,
512
+ inputs: n
513
+ };
514
+ });
515
+ }
516
+ function Ie(e) {
517
+ return A(e, (e) => {
518
+ if (e.type !== v.TableReference) return;
519
+ if (0 !== e.inputs?.length || e.error) return;
520
+ const t = e.value;
521
+ return ("string" == typeof t ? t : t?.tableId) ? {
522
+ ...e,
523
+ inputs: null
524
+ } : void 0;
525
+ });
526
+ }
527
+ function be(e) {
528
+ return A(e, (e) => {
529
+ if (e.type !== v.TableReference || !e.inputs) return;
530
+ const t = e.value, n = "string" == typeof t ? t : t?.tableId, r = e.image;
531
+ if (!n || 91 !== r?.charCodeAt(0)) return;
532
+ const i = r.indexOf("]");
533
+ if (-1 !== i && 33 === r.charCodeAt(i + 1)) return;
534
+ const l = { ...e };
535
+ return delete l.image, l;
536
+ });
537
+ }
538
+ var xe = (e) => {
539
+ if (e?.type !== v.TableSpecifier) return 4;
540
+ switch (e.value.toUpperCase().trim()) {
541
+ case "#ALL": return 0;
542
+ case "#HEADERS": return 1;
543
+ case "#DATA": return 2;
544
+ case "#TOTALS": return 3;
545
+ default: return 4;
546
+ }
547
+ };
548
+ function Re(e) {
549
+ return A(e, (e) => {
550
+ if (e.type !== v.TableReference) return;
551
+ const t = e.inputs;
552
+ if (!t || t.length < 2) return;
553
+ const n = t.map((e, t) => ({
554
+ input: e,
555
+ index: t,
556
+ rank: xe(e)
557
+ })).sort((e, t) => e.rank - t.rank || e.index - t.index).map((e) => e.input);
558
+ return n.every((e, n) => e === t[n]) ? void 0 : {
559
+ ...e,
560
+ inputs: n
561
+ };
562
+ });
563
+ }
564
+ function Ee(e) {
565
+ if (!e) return V.EmptyArray;
566
+ let t = V.EmptyArray;
567
+ return A(e, (e) => {
568
+ if (e.type !== v.Named || e.binding) return;
569
+ const n = e.value.nameId;
570
+ n && (t === V.EmptyArray && (t = []), t.includes(n) || t.push(n));
571
+ }), t;
572
+ }
573
+ function Te(e, t) {
574
+ if (!e) return V.EmptyArray;
575
+ let n = V.EmptyArray;
576
+ return A(e, (e, r, i) => {
577
+ if (!e.isReference) return;
578
+ if (r?.isReference) return;
579
+ const l = e.type;
580
+ if (l === v.Named || l === v.Error || l === v.TableReference) return;
581
+ if (pe(i, v.TableReference)) return;
582
+ const s = function(e) {
583
+ let t = e;
584
+ for (; t;) {
585
+ if (void 0 !== t.referenceIndex) return t.referenceIndex;
586
+ if (!t.isReference) return;
587
+ t = t.inputs?.[0];
588
+ }
589
+ }(e);
590
+ void 0 !== s && function(e, t, n) {
591
+ let r = e;
592
+ for (let e = t.length - 1; e >= 0; e--) {
593
+ const i = t[e];
594
+ if (i.type === v.Paren || i.isReference) {
595
+ r = i;
596
+ continue;
597
+ }
598
+ if (i.type !== v.Function) return !0;
599
+ const l = n?.(String(i.value));
600
+ if (!l) return !0;
601
+ const s = i.inputs ? i.inputs.indexOf(r) : -1;
602
+ return "p" !== (s >= 0 ? $e(l.getDeclaration().getParameters(), s) : null)?.getRangeType();
603
+ }
604
+ return !0;
605
+ }(e, i, t) && (n === V.EmptyArray && (n = []), n.includes(s) || n.push(s));
606
+ }), n.length > 1 && n.sort((e, t) => e - t), n;
607
+ }
608
+ var Ae = /* @__PURE__ */ new Set(["SUBTOTAL", "AGGREGATE"]);
609
+ function Se(e, t) {
610
+ if (!e || !t) return !1;
611
+ let n = !1;
612
+ return A(e, (e) => {
613
+ if (n || e.type !== v.Function) return;
614
+ const r = t(e.value)?.getName();
615
+ r && Ae.has(r.toUpperCase()) && (n = !0);
616
+ }), n;
617
+ }
618
+ function we(e, t) {
619
+ if (!e || !t) return !1;
620
+ let n = !1;
621
+ return A(e, (e) => {
622
+ n || e.type !== v.Function || !0 === t(e.value)?.getDeclaration().getReturnType()?.isVolatile() && (n = !0);
623
+ }), n;
624
+ }
625
+ var Ce = Object.freeze({
626
+ value: !1,
627
+ array: !1
628
+ }), Ne = (e, t) => {
629
+ const n = function(e, t) {
630
+ if (!e || !t) return Ce;
631
+ let n = !1, r = !1;
632
+ return A(e, (e) => {
633
+ if (n) return;
634
+ const i = e.type;
635
+ if (i === v.Named) return void (void 0 === e.binding && (n = !0));
636
+ if (i === v.Prefix) return void ("@" === e.value && (n = !0));
637
+ if (i === v.Call) return void (n = !0);
638
+ if (i !== v.Function) return;
639
+ if (void 0 !== e.binder) return;
640
+ const l = t(e.value);
641
+ if (!l) return void (n = !0);
642
+ if (r || !0 !== e.implicitIntersect) return;
643
+ const s = l.getDeclaration().getParameters(), o = e.inputs;
644
+ if (o) for (let e = 0; e < o.length; e++) {
645
+ const n = $e(s, e);
646
+ if (null !== n && n.isValueOrRange() && De(o[e], t)) return void (r = !0);
647
+ }
648
+ }), {
649
+ value: !n && !r,
650
+ array: !n
651
+ };
652
+ }(e, t);
653
+ return {
654
+ isBlankCacheable: n.value,
655
+ isBlankCacheableArray: n.array
656
+ };
657
+ }, Fe = (e, t) => {
658
+ const n = e.length;
659
+ if (0 === n) return null;
660
+ if (t < n - 1) return e[t];
661
+ const r = e[n - 1], i = r.getRepeatingTypes();
662
+ return i && 0 !== i.length ? i[(t - (n - 1)) % i.length] : t < n ? e[t] : r.isRest() ? r : null;
663
+ };
664
+ function Pe(e) {
665
+ if (!e) return V.EmptyArray;
666
+ let t = V.EmptyArray;
667
+ const n = (e) => {
668
+ e && (t === V.EmptyArray && (t = []), t.includes(e) || t.push(e));
669
+ }, r = (e) => {
670
+ "string" == typeof e && n(o(e)?.bookId);
671
+ };
672
+ return A(e, (e) => {
673
+ if (e.type === v.Named) {
674
+ if (e.binding) return;
675
+ const t = e.value;
676
+ n(t.nameId), r(t.scope);
677
+ } else if (e.type === v.TableReference) {
678
+ const t = e.value;
679
+ n("string" == typeof t ? t : t?.tableId);
680
+ } else if (e.type === v.Cell) {
681
+ const t = e.value?.scope;
682
+ r(t), I(t) && n(t);
683
+ } else e.type === v.Error && r(e.value?.scope);
684
+ }), t;
685
+ }
686
+ var ke = (e, t) => {
687
+ if (!0 === e.lazyArg) return !0;
688
+ if ("lambda" !== t?.binder?.kind) return !1;
689
+ const n = t.inputs;
690
+ return n[n.length - 1] === e;
691
+ }, Le = /* @__PURE__ */ new Set([
692
+ "IF",
693
+ "IFS",
694
+ "SWITCH",
695
+ "CHOOSE",
696
+ "IFERROR",
697
+ "IFNA"
698
+ ]), $e = (e, t) => {
699
+ const n = e.length;
700
+ if (0 === n) return null;
701
+ if (t < n) return e[t];
702
+ const r = e[n - 1];
703
+ if (!r.isRest()) return null;
704
+ const i = r.getRepeatingTypes();
705
+ return i && 0 !== i.length ? i[(t - (n - 1)) % i.length] : r;
706
+ }, Oe = (e) => null !== e.getScalarType() && null === e.getRangeType() && null === e.getLambda() && !e.isValueOrRange(), Be = (e, t, n) => !(e.isRest() || !Oe(e) || !De(t, n)) && !(e.isNoLift() && Ve(t, n)), Ve = (e, t) => {
707
+ if (!e) return !1;
708
+ const n = e.inputs;
709
+ switch (e.type) {
710
+ case v.Cell:
711
+ case v.Named:
712
+ case v.TableReference: return !0;
713
+ case v.Infix:
714
+ case v.Prefix:
715
+ case v.Postfix: return !0 === e.isReference && "@" !== e.value;
716
+ case v.Paren:
717
+ case v.List: return !!n && 1 === n.length && Ve(n[0], t);
718
+ case v.Function: {
719
+ if (void 0 !== e.binder) return !1;
720
+ const r = String(e.value).toUpperCase();
721
+ if (Le.has(r)) {
722
+ if (!n) return !1;
723
+ for (let e = 0; e < n.length; e++) if (Ve(n[e], t)) return !0;
724
+ return !1;
725
+ }
726
+ const i = t?.(e.value);
727
+ return !!i && i.getDeclaration().getReturnType().getKind() === O.Reference;
728
+ }
729
+ default: return !1;
730
+ }
731
+ }, ze = (e, t) => {
732
+ if (!e) return !1;
733
+ for (let n = 0; n < e.length; n++) if (De(e[n], t)) return !0;
734
+ return !1;
735
+ };
736
+ function De(e, t) {
737
+ if (!e) return !1;
738
+ if (void 0 !== e.arrayValued) return e.arrayValued;
739
+ let n;
740
+ const r = e.type, i = e.inputs;
741
+ switch (r) {
742
+ case v.Array:
743
+ n = !0;
744
+ break;
745
+ case v.Cell: {
746
+ const t = e.value;
747
+ n = t.rowIndex === Number.MIN_SAFE_INTEGER || t.colIndex === Number.MIN_SAFE_INTEGER;
748
+ break;
749
+ }
750
+ case v.Named:
751
+ case v.Call:
752
+ case v.TableReference:
753
+ n = !0;
754
+ break;
755
+ case v.Infix:
756
+ case v.Prefix:
757
+ case v.Postfix:
758
+ n = e.isReference ? "@" !== e.value : ze(i, t);
759
+ break;
760
+ case v.Paren:
761
+ case v.List:
762
+ n = !i || 1 !== i.length || De(i[0], t);
763
+ break;
764
+ case v.Function: {
765
+ const r = e.binder;
766
+ if (void 0 !== r) {
767
+ n = "lambda" === r.kind || !!i && De(i[i.length - 1], t);
768
+ break;
769
+ }
770
+ const l = String(e.value).toUpperCase();
771
+ if (Le.has(l)) {
772
+ n = ze(i, t);
773
+ break;
774
+ }
775
+ if ("INDEX" === l) {
776
+ if (n = !1, i) for (let e = 1; e < i.length; e++) {
777
+ const r = i[e];
778
+ if (!r || r.type === v.Empty || r.isLiteral && 0 === r.value || De(r, t)) {
779
+ n = !0;
780
+ break;
781
+ }
782
+ }
783
+ break;
784
+ }
785
+ const s = t?.(e.value);
786
+ if (!s) {
787
+ n = !0;
788
+ break;
789
+ }
790
+ const o = s.getDeclaration().getReturnType(), a = o.getKind();
791
+ n = a === O.Array || a === O.Reference || null === a && null !== o.getRangeType();
792
+ break;
793
+ }
794
+ default: n = !1;
795
+ }
796
+ return e.arrayValued = n, n;
797
+ }
798
+ function We(e, t) {
799
+ if (void 0 !== e.firstCell) return;
800
+ const n = (e, r) => {
801
+ if (!e) return;
802
+ e.firstCell = r;
803
+ const i = e.inputs;
804
+ if (!i) return;
805
+ const l = e.type;
806
+ if (l === v.Infix || l === v.Prefix || l === v.Postfix) {
807
+ const t = r && !e.isReference;
808
+ for (let e = 0; e < i.length; e++) n(i[e], t);
809
+ return;
810
+ }
811
+ if (l === v.Paren || l === v.List) {
812
+ const e = r && 1 === i.length;
813
+ for (let t = 0; t < i.length; t++) n(i[t], e);
814
+ return;
815
+ }
816
+ if (l === v.Function) {
817
+ const l = e.binder;
818
+ if (void 0 !== l) {
819
+ const e = i.length - 1;
820
+ for (let t = 0; t < i.length; t++) n(i[t], r && "let" === l.kind && t === e);
821
+ return;
822
+ }
823
+ const s = r ? t?.(e.value)?.getDeclaration().getParameters() : null;
824
+ for (let e = 0; e < i.length; e++) {
825
+ const t = s ? $e(s, e) : null;
826
+ n(i[e], null !== t && (Oe(t) || je(t)));
827
+ }
828
+ return;
829
+ }
830
+ for (let e = 0; e < i.length; e++) n(i[e], !1);
831
+ };
832
+ n(e, !0);
833
+ }
834
+ var Me = /* @__PURE__ */ new Set([
835
+ "=",
836
+ "<>",
837
+ "<",
838
+ ">",
839
+ "<=",
840
+ ">="
841
+ ]), Ue = /* @__PURE__ */ new Set(["ROW", "COLUMN"]);
842
+ function _e(e, n) {
843
+ if (!e || !n) return null;
844
+ const r = (e) => n(e.value)?.getName().toUpperCase() ?? null;
845
+ let i = !1;
846
+ if (A(e, (e) => {
847
+ (e.hasLazyArgs || e.type === v.Call || void 0 !== e.binder) && (i = !0);
848
+ }), i) return null;
849
+ const l = (e) => e.type === v.Number, s = (e) => e.type === v.Number || e.type === v.String || e.type === v.Boolean, o = (e) => {
850
+ if (!e) return !1;
851
+ const t = e.inputs;
852
+ switch (e.type) {
853
+ case v.Paren: return 1 === t?.length && o(t[0]);
854
+ case v.Prefix: return ("-" === e.value || "+" === e.value) && o(t?.[0]);
855
+ case v.Infix: {
856
+ if ("+" !== e.value && "-" !== e.value && "*" !== e.value) return !1;
857
+ const [n, r] = t ?? [];
858
+ return !(!n || !r) && (o(n) && (o(r) || l(r)) || l(n) && o(r));
859
+ }
860
+ case v.Function: {
861
+ const n = r(e);
862
+ if (null !== n && Ue.has(n)) return !t || 0 === t.length || 1 === t.length && t[0]?.type === v.Cell;
863
+ if ("MOD" === n && 2 === t?.length) {
864
+ const e = t[1];
865
+ return o(t[0]) && l(e) && 0 !== e.value;
866
+ }
867
+ return !1;
868
+ }
869
+ }
870
+ return !1;
871
+ }, a = (e) => {
872
+ if (!e) return !1;
873
+ const t = e.inputs;
874
+ switch (e.type) {
875
+ case v.Paren: return 1 === t?.length && a(t[0]);
876
+ case v.Infix: {
877
+ if (!Me.has(e.value)) return !1;
878
+ const [n, r] = t ?? [];
879
+ return !(!n || !r) && (o(n) && (o(r) || s(r)) || s(n) && o(r));
880
+ }
881
+ case v.Function: {
882
+ const n = r(e);
883
+ if (!t || 0 === t.length) return !1;
884
+ if ("ISODD" === n || "ISEVEN" === n) return 1 === t.length && o(t[0]);
885
+ if ("NOT" === n) return 1 === t.length && a(t[0]);
886
+ if ("AND" === n || "OR" === n || "XOR" === n) {
887
+ let e = !1;
888
+ for (let n = 0; n < t.length; n++) {
889
+ const r = t[n];
890
+ if (!r) return !1;
891
+ if (r.type !== v.Boolean) {
892
+ if (!a(r)) return !1;
893
+ e = !0;
894
+ }
895
+ }
896
+ return e;
897
+ }
898
+ return !1;
899
+ }
900
+ }
901
+ return !1;
902
+ }, u = [], c = (e) => {
903
+ if (!e) return;
904
+ if (a(e)) return void u.push(e);
905
+ const t = e.inputs;
906
+ if (t) for (let e = 0; e < t.length; e++) c(t[e]);
907
+ };
908
+ c(e);
909
+ const f = u.length;
910
+ if (0 === f || f > 4) return null;
911
+ const p = [];
912
+ for (let n = 0; n < 1 << f; n++) {
913
+ const r = (e) => {
914
+ const i = u.indexOf(e);
915
+ if (-1 !== i) return t(n & 1 << i ? "TRUE" : "FALSE");
916
+ const l = { ...e };
917
+ return delete l.evalIndex, delete l.firstCell, delete l.inLazy, delete l.lazyArg, delete l.hasLazyArgs, delete l.deferred, e.inputs && (l.inputs = e.inputs.map((e) => e ? r(e) : e)), l;
918
+ };
919
+ p.push(r(e));
920
+ }
921
+ return p;
922
+ }
923
+ var je = (e) => "*" === e.getRangeType() && null === e.getLambda() && e.getArrayDepth() <= (e.isRest() ? 1 : 0);
924
+ function Ge(e, t, n, r = !1, i = null, l = null) {
925
+ let s, o, u = n;
926
+ u = me(u), r || (u = ye(u), u = Re(u), u = Ie(u), u = be(u)), [s, o] = function(e) {
927
+ const t = /* @__PURE__ */ new Map();
928
+ let n = 0;
929
+ const r = [e];
930
+ for (; r.length > 0;) {
931
+ const e = r.shift();
932
+ if (t.set(e, {
933
+ ...e,
934
+ evalIndex: n++
935
+ }), e && e.inputs) for (const t of e.inputs) r.push(t);
936
+ }
937
+ return t.forEach((e, n) => {
938
+ n && n.inputs && (e.inputs = n.inputs.map((e) => t.get(e) ?? e));
939
+ }), [t.get(e), n];
940
+ }(u);
941
+ const c = N(o), f = [], p = [], d = new de();
942
+ let g, h = !1;
943
+ (function(e, t) {
944
+ if (!e || !t) return;
945
+ const n = (e) => {
946
+ if (!e) return;
947
+ e.inLazy = !0, e.type === v.Named && (e.deferredResolve = !0);
948
+ const t = e.inputs;
949
+ if (t) for (let e = 0; e < t.length; e++) n(t[e]);
950
+ };
951
+ A(e, (e) => {
952
+ if (e.type !== v.Function) return;
953
+ if (void 0 !== e.binder) return;
954
+ const r = e.inputs;
955
+ if (!r || 0 === r.length) return;
956
+ const i = t(e.value)?.getDeclaration().getParameters();
957
+ if (i) for (let t = 0; t < r.length; t++) {
958
+ const l = r[t];
959
+ l && l.type !== v.Empty && Fe(i, t)?.isLazy() && (l.lazyArg = !0, e.hasLazyArgs = !0, n(l));
960
+ }
961
+ });
962
+ })(s, l);
963
+ const m = (e) => {
964
+ void 0 === g && (g = /* @__PURE__ */ new Map());
965
+ let t = g.get(e);
966
+ return void 0 === t && g.set(e, t = []), t;
967
+ }, y = (e, t) => {
968
+ void 0 === e ? f.push(t) : m(e).push(t);
969
+ }, I = (e) => {
970
+ e?.type !== v.Infix || "+" !== e.value && "-" !== e.value || (e.snapsCancellation = !0);
971
+ };
972
+ s = A(s, (t, n, r) => {
973
+ const i = t.type, l = t.evalIndex;
974
+ if (c[l] = null, i === v.TableColumn || i === v.TableSpecifier || t.isReference && pe(r, v.TableReference)) return;
975
+ if (h = h || !Je(t), t.binding?.declaration) return p[t.binding.slot] = -1, void (c[l] = void 0);
976
+ const s = ((e, t, n) => {
977
+ if (ke(e, t)) return e;
978
+ for (let e = n.length - 1; e >= 0; e--) if (ke(n[e], n[e - 1])) return n[e];
979
+ })(t, n, r);
980
+ s === t && m(t), void 0 !== s && i === v.Named && (t.deferredResolve = !0);
981
+ const o = t.binder;
982
+ if (o && "let" === o.kind) {
983
+ const e = t.inputs, n = e?.length ?? 0;
984
+ let r = 0;
985
+ for (let t = 0; t + 1 < n && r < o.slots.length; t += 2) e[t]?.binding?.declaration && (p[o.slots[r++]] = e[t + 1]?.evalIndex ?? -1);
986
+ }
987
+ if ((t.isReference || n && n.isReference) && (d.processNode(t, n), t.isReference)) {
988
+ if (i === v.Named) return void (void 0 !== s && y(s, t));
989
+ if (i === v.Cell || i === v.TableReference || i === v.Error) return;
990
+ if (i === v.Infix || i === v.Prefix || i === v.Postfix || i === v.List) return void y(s, t);
991
+ }
992
+ if (t.isLiteral) if (i !== v.Array) c[l] = t.value;
993
+ else {
994
+ const n = t.value, r = n.length, i = N(r);
995
+ for (let e = 0; e < r; e++) {
996
+ const t = n[e].value, r = t.length, l = N(r);
997
+ for (let e = 0; e < r; e++) {
998
+ const n = t[e];
999
+ let r = null;
1000
+ if (n && (r = n.type === v.Error ? a(n.value) : n.value, n.type === v.Prefix)) {
1001
+ const e = n.value;
1002
+ r = n.inputs[0].value, "-" === e && (r = -r);
1003
+ }
1004
+ l[e] = r;
1005
+ }
1006
+ i[e] = l;
1007
+ }
1008
+ const s = S(i);
1009
+ c[l] = new E(e, s.values, s.coords, void 0, s.isLiteral);
1010
+ }
1011
+ else {
1012
+ if (i !== v.Empty) return "lambda" === t.binder?.kind && I(t.inputs[t.inputs.length - 1]), y(s, t), t;
1013
+ c[l] = void 0;
1014
+ }
1015
+ }), I(s), g?.forEach((e, t) => {
1016
+ t.deferred = e;
1017
+ });
1018
+ const b = N(d.cells.size);
1019
+ d.cells.forEach((e, t) => {
1020
+ const n = t.value, r = n.colIndex, i = n.rowIndex, l = n.$colIndex, s = n.$rowIndex, o = {
1021
+ colStart: r,
1022
+ rowStart: i,
1023
+ colEnd: r,
1024
+ rowEnd: i,
1025
+ $colStart: l,
1026
+ $rowStart: s,
1027
+ $colEnd: l,
1028
+ $rowEnd: s
1029
+ };
1030
+ r === Number.MIN_SAFE_INTEGER && (o.colEnd = Number.MAX_SAFE_INTEGER), i === Number.MIN_SAFE_INTEGER && (o.rowEnd = Number.MAX_SAFE_INTEGER), n.scope && (o.scope = n.scope), b[e] = o;
1031
+ });
1032
+ const R = b.length, T = N(R);
1033
+ for (let e = 0; e < R; e++) T[e] = {
1034
+ colStart: 0,
1035
+ rowStart: 0,
1036
+ colEnd: 0,
1037
+ rowEnd: 0,
1038
+ scope: null
1039
+ };
1040
+ const w = N(d.references.size);
1041
+ d.references.forEach((e) => {
1042
+ w[e.index] = e;
1043
+ });
1044
+ const C = [];
1045
+ d.rootReferences.forEach((e) => {
1046
+ C.push(e.index);
1047
+ }), function(e, t, n = !1) {
1048
+ if (n) {
1049
+ const t = (e) => {
1050
+ if (!e) return;
1051
+ const n = e.type;
1052
+ n !== v.Function && n !== v.Call || (e.implicitIntersect = !0);
1053
+ const r = e.inputs;
1054
+ if (r) for (let e = 0; e < r.length; e++) t(r[e]);
1055
+ };
1056
+ t(e);
1057
+ return;
1058
+ }
1059
+ const r = (e) => De(e, t), i = (e, n) => {
1060
+ if (!e) return;
1061
+ const l = e.type;
1062
+ l !== v.Function && l !== v.Call || (e.implicitIntersect = n);
1063
+ const s = e.inputs;
1064
+ if (s) {
1065
+ if (l === v.Infix || l === v.Prefix || l === v.Postfix) {
1066
+ const t = !e.isReference;
1067
+ for (let e = 0; e < s.length; e++) i(s[e], (!t || !r(s[e])) && n);
1068
+ return;
1069
+ }
1070
+ if (l === v.Function) {
1071
+ const r = e.binder;
1072
+ if (void 0 !== r) {
1073
+ const e = "lambda" !== r.kind && n;
1074
+ for (let t = 0; t < s.length; t++) i(s[t], e);
1075
+ return;
1076
+ }
1077
+ const l = t?.(e.value)?.getDeclaration().getParameters();
1078
+ let o = !1;
1079
+ if (l) for (let e = 0; e < s.length && !o; e++) {
1080
+ const n = s[e];
1081
+ if (!n) continue;
1082
+ const r = $e(l, e);
1083
+ r && Be(r, n, t) && (o = !0);
1084
+ }
1085
+ o && (e.implicitIntersect = !1);
1086
+ for (let e = 0; e < s.length; e++) i(s[e], !o && n);
1087
+ return;
1088
+ }
1089
+ for (let e = 0; e < s.length; e++) i(s[e], n);
1090
+ }
1091
+ };
1092
+ i(e, !r(e));
1093
+ }(s, l, !0 === n.legacyIntersect);
1094
+ const k = (e) => {
1095
+ const t = e.length;
1096
+ for (let n = 0; n < t; n++) {
1097
+ const t = e[n], r = t.type;
1098
+ if (r === v.Infix) {
1099
+ if (!0 === t.snapsCancellation) {
1100
+ t.fn = ue[t.value];
1101
+ continue;
1102
+ }
1103
+ t.fn = ae[t.value];
1104
+ } else if (r === v.Prefix) t.fn = ce[t.value];
1105
+ else if (r === v.Postfix) t.fn = fe[t.value];
1106
+ }
1107
+ };
1108
+ let L;
1109
+ k(f), g?.forEach(k);
1110
+ const $ = r ? F(P(e.getLocale()).decimal) : x, O = {
1111
+ runtime: e,
1112
+ symbols: t,
1113
+ getFunction: l,
1114
+ ast: s,
1115
+ evaluations: c,
1116
+ executions: f,
1117
+ bindings: p,
1118
+ referencesAbsolute: T,
1119
+ referencesExecute: w,
1120
+ referencesRelative: b,
1121
+ referencesRoot: C,
1122
+ referenceIndices: d.referenceIndices,
1123
+ formatReferenceIndices: Te(s, l),
1124
+ getTokens: () => L ??= ge(s, r, $),
1125
+ namedIds: Ee(s),
1126
+ symbolIds: Pe(s),
1127
+ hasTotals: Se(s, l),
1128
+ hasVolatile: we(s, l),
1129
+ ...Ne(s, l),
1130
+ isReferenceOnly: !h,
1131
+ error: i,
1132
+ transform: (n) => {
1133
+ let o = A(s, n);
1134
+ return o === s ? O : Ge(e, t, o, r, i, l);
1135
+ }
1136
+ };
1137
+ return O;
1138
+ }
1139
+ function He(e) {
1140
+ let t = -1, n = -1;
1141
+ return Number.isSafeInteger(e.previousToken?.startLine) ? (t = e.previousToken.startLine, n = e.previousToken.endColumn + 1) : Number.isSafeInteger(e.token?.startLine) && (t = e.token.startLine, n = e.token.startColumn), -1 !== t ? (e.errorLocation = {
1142
+ line: t,
1143
+ column: n
1144
+ }, new k.Parse(e.message, {
1145
+ line: t,
1146
+ column: n,
1147
+ cause: e
1148
+ })) : new k.Parse(e.message, { cause: e });
1149
+ }
1150
+ Object.freeze([
1151
+ [
1152
+ ":",
1153
+ ".:.",
1154
+ ".:",
1155
+ ":."
1156
+ ],
1157
+ ["^"],
1158
+ ["*", "/"],
1159
+ ["+", "-"],
1160
+ ["&"],
1161
+ [
1162
+ "<",
1163
+ ">",
1164
+ "=",
1165
+ "<>",
1166
+ "<=",
1167
+ ">="
1168
+ ]
1169
+ ]);
1170
+ var Xe = Object.freeze([
1171
+ ":",
1172
+ ".:.",
1173
+ ".:",
1174
+ ":."
1175
+ ]), Ze = Object.freeze([
1176
+ ":",
1177
+ " ",
1178
+ ".:.",
1179
+ ".:",
1180
+ ":."
1181
+ ]), Ke = Object.freeze(["@"]), Qe = Object.freeze(["#"]), qe = Object.freeze(Ze.concat(Qe)), Je = (Object.freeze(Ze.concat(Ke).concat(Qe)), (e) => {
1182
+ if (!e) return !1;
1183
+ const t = e.type;
1184
+ if (t === v.Cell) return !0;
1185
+ if (t === v.TableReference) return !0;
1186
+ if (t === v.Infix) {
1187
+ if (!Ze.includes(e.value)) return !1;
1188
+ const t = e.inputs, n = t[0], r = t[1];
1189
+ return Je(n) && Je(r);
1190
+ }
1191
+ return t === v.List && (e.inputs?.every(Je) ?? !1);
1192
+ }), Ye = (e) => !!e && (!(e.type !== v.Infix || !qe.includes(e.value)) || !(e.type !== v.Postfix || !Qe.includes(e.value)) || e.type === v.Array || e.type === v.TableReference), et = Object.freeze([
1193
+ "+",
1194
+ "-",
1195
+ "*",
1196
+ "/",
1197
+ "^",
1198
+ "&",
1199
+ "=",
1200
+ "<>",
1201
+ ">",
1202
+ "<",
1203
+ ">=",
1204
+ "<="
1205
+ ]), tt = Object.freeze(["-", "+"]), nt = (e, t) => {
1206
+ if (!e) return !1;
1207
+ const n = e.type;
1208
+ if (e.isLiteral) return n !== v.Error;
1209
+ if (n === v.Paren || n === v.List) {
1210
+ const n = e.inputs;
1211
+ return !(!n || 0 === n.length) && n.every((e) => nt(e, t));
1212
+ }
1213
+ if (n === v.Infix) return et.includes(e.value);
1214
+ if (n === v.Prefix) return tt.includes(e.value);
1215
+ if (n === v.Postfix) return "%" === e.value;
1216
+ if (n === v.Function) {
1217
+ if (!t) return !1;
1218
+ const n = t(e.value);
1219
+ if (!n) return !1;
1220
+ const r = n.getDeclaration().getReturnType(), i = r.getRangeType();
1221
+ return "p" !== i && (null !== i || null === r.getLambda() && null != r.getScalarType());
1222
+ }
1223
+ return !1;
1224
+ }, rt = (e, t) => {
1225
+ if (!e) return null;
1226
+ let n = null;
1227
+ const r = (e) => {
1228
+ if (n || !e) return;
1229
+ if (e.type === v.Infix && " " === e.value) {
1230
+ const r = e.inputs, i = r?.[0], l = r?.[1];
1231
+ if (nt(i, t)) return void (n = i);
1232
+ if (nt(l, t)) return void (n = l);
1233
+ }
1234
+ const i = e.inputs;
1235
+ if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
1236
+ };
1237
+ return r(e), n;
1238
+ }, it = (e, t) => {
1239
+ if (!e) return null;
1240
+ let n = null;
1241
+ const r = (e) => {
1242
+ if (n || !e) return;
1243
+ if (e.type === v.Postfix && "#" === e.value) {
1244
+ const r = e.inputs?.[0];
1245
+ if (r && nt(r, t)) return void (n = r);
1246
+ }
1247
+ const i = e.inputs;
1248
+ if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
1249
+ };
1250
+ return r(e), n;
1251
+ }, lt = (e) => {
1252
+ for (let t = 0; t < e.length; t++) if (e[t].getRepeatingTypes()) return t;
1253
+ return -1;
1254
+ }, st = (e, t, n) => {
1255
+ const r = e[t].getRepeatingTypes(), i = r.length, l = t, s = e.length - t - 1;
1256
+ let o = s;
1257
+ for (; o > 0 && e[t + o].isOptional();) o--;
1258
+ const a = e[t].isOptional() ? 0 : 1, u = r[i - 1].isOptional();
1259
+ for (let e = o; e <= s; e++) {
1260
+ const t = n - l - e;
1261
+ if (t >= 0 && t % i === 0 && t / i >= a) return {
1262
+ n: t / i,
1263
+ short: !1,
1264
+ variable: t,
1265
+ period: i,
1266
+ prefix: l,
1267
+ suffix: e
1268
+ };
1269
+ if (u && t === i - 1) return {
1270
+ n: 1,
1271
+ short: !0,
1272
+ variable: t,
1273
+ period: i,
1274
+ prefix: l,
1275
+ suffix: e
1276
+ };
1277
+ }
1278
+ return null;
1279
+ }, ot = (e) => {
1280
+ if (!e) return null;
1281
+ let t = null;
1282
+ const n = (e) => {
1283
+ if (t || !e) return;
1284
+ if (e.type === v.Array && Array.isArray(e.value)) {
1285
+ const n = e.value, r = (n[0]?.value)?.length ?? 0;
1286
+ for (let e = 1; e < n.length && !t; e++) {
1287
+ const i = (n[e]?.value)?.length ?? 0;
1288
+ i !== r && (t = `Array rows must all be the same length — row ${e + 1} has ${i} value${1 === i ? "" : "s"}, but row 1 has ${r}.`);
1289
+ }
1290
+ }
1291
+ const r = e.inputs;
1292
+ if (r) for (let e = 0; e < r.length && !t; e++) n(r[e]);
1293
+ };
1294
+ return n(e), t;
1295
+ }, at = (e, t) => {
1296
+ if (!e || !t) return null;
1297
+ let n = null;
1298
+ const r = (e) => {
1299
+ if (n || !e) return;
1300
+ if (e.type === v.Function) {
1301
+ const r = e.value, i = t(r);
1302
+ if (i) {
1303
+ const t = i.getDeclaration(), l = t.getParameters(), s = e.inputs?.length ?? 0, o = t.getMaxArguments();
1304
+ if (s > o) return void (n = `Too many arguments for ${r}. The most it accepts is ${o}, but got ${s}.`);
1305
+ const a = l.length > 0 ? lt(l) : -1, u = l.length > 0 && l[l.length - 1].isRest();
1306
+ if (a >= 0) {
1307
+ if (!st(l, a, s)) {
1308
+ const e = l[a].getRepeatingTypes().length, t = l.length - 1;
1309
+ n = 1 === e ? `Too few arguments for ${r}. Expected at least ${t + 1}, but got ${s}.` : `Wrong number of arguments for ${r}. Expected ${t} plus a multiple of ${e}, but got ${s}.`;
1310
+ }
1311
+ } else if (!u && s > l.length) n = `Too many arguments for ${r}. Expected ${l.length}, but got ${s}.`;
1312
+ else for (let e = s; e < l.length && !n; e++) {
1313
+ const t = l[e];
1314
+ t.isOptional() || t.isRest() || (n = `Parameter ${t.getName()} is missing for ${r}.`);
1315
+ }
1316
+ }
1317
+ }
1318
+ const i = e.inputs;
1319
+ if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
1320
+ };
1321
+ return r(e), n;
1322
+ }, ut = (e, t) => {
1323
+ if (!e || !t) return null;
1324
+ let n = null;
1325
+ const r = (e) => {
1326
+ if (n || !e) return;
1327
+ if (e.type === v.Function) {
1328
+ const r = t(e.value);
1329
+ if (r) {
1330
+ const i = r.getDeclaration().getParameters(), l = e.inputs;
1331
+ if (i.length > 0 && l) {
1332
+ const e = ((e, t) => {
1333
+ const n = new Array(t), r = e.length, i = r > 0 ? lt(e) : -1;
1334
+ if (i < 0) {
1335
+ const i = r > 0 ? e[r - 1] : null, l = !!i && i.isRest();
1336
+ for (let s = 0; s < t; s++) n[s] = s < r ? e[s] : l ? i : null;
1337
+ return n;
1338
+ }
1339
+ const l = e[i].getRepeatingTypes(), s = l.length, o = i, a = st(e, i, t), u = a ? a.suffix : r - i - 1, c = Math.max(0, t - o - u);
1340
+ for (let a = 0; a < t; a++) if (a < o) n[a] = e[a];
1341
+ else if (a < o + c) n[a] = l[(a - o) % s];
1342
+ else {
1343
+ const t = i + 1 + (a - o - c);
1344
+ n[a] = t < r ? e[t] : null;
1345
+ }
1346
+ return n;
1347
+ })(i, l.length);
1348
+ for (let r = 0; r < l.length && !n; r++) {
1349
+ const i = e[r];
1350
+ i && "p" === i.getRangeType() && nt(l[r], t) && (n = l[r]);
1351
+ }
1352
+ }
1353
+ }
1354
+ }
1355
+ const i = e.inputs;
1356
+ if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
1357
+ };
1358
+ return r(e), n;
1359
+ }, ct = (e, t) => {
1360
+ if (!e) return null;
1361
+ let n = null;
1362
+ const r = (e) => {
1363
+ if (n || !e) return;
1364
+ if (e.type === v.Call) {
1365
+ const r = e.inputs?.[0];
1366
+ if (r && nt(r, t)) return void (n = "This expression always produces a value, so it cannot be called as a function.");
1367
+ }
1368
+ const i = e.inputs;
1369
+ if (i) for (let e = 0; e < i.length && !n; e++) r(i[e]);
1370
+ };
1371
+ return r(e), n;
1372
+ }, ft = (e, t) => {
1373
+ if (e.type !== v.Function) return;
1374
+ const n = e.value;
1375
+ if ("string" != typeof n) return;
1376
+ const r = (t?.(n)?.getName() ?? n).toUpperCase();
1377
+ return "LET" === r ? "let" : "LAMBDA" === r ? "lambda" : void 0;
1378
+ }, pt = (e) => {
1379
+ if (e?.type !== v.Named) return;
1380
+ const t = e.value;
1381
+ return t?.nameId && !t.scope && !0 !== t.optional ? t.nameId : void 0;
1382
+ }, dt = /^[A-Za-z_\\][A-Za-z0-9_\\]*$/, gt = /* @__PURE__ */ new Set(["TRUE", "FALSE"]), vt = (e) => {
1383
+ if (e?.type === v.Named) {
1384
+ const t = e.value;
1385
+ if (!0 !== t?.optional || !t.nameId || t.scope) return;
1386
+ return t.nameId;
1387
+ }
1388
+ if (e?.type !== v.TableReference) return;
1389
+ const t = e.value;
1390
+ let n;
1391
+ if (null === t || "string" == typeof t) {
1392
+ if (t) return;
1393
+ const r = e.inputs;
1394
+ if (!r || 1 !== r.length || r[0]?.type !== v.TableColumn) return;
1395
+ const i = r[0].value;
1396
+ if ("string" != typeof i) return;
1397
+ n = i;
1398
+ } else {
1399
+ const e = t;
1400
+ if (!e || "" !== e.tableId || 0 !== e.spec || !0 === e.isThisRow) return;
1401
+ if (!e.columnFromId || e.columnFromId !== e.columnToId) return;
1402
+ n = e.columnFromId;
1403
+ }
1404
+ return dt.test(n) && !gt.has(n.toUpperCase()) && e.image === `[${n}]` ? n : void 0;
1405
+ }, ht = (e) => {
1406
+ const t = c(e.image ?? e.value);
1407
+ t.image = e.image ?? e.value, t.wsBefore = e.wsBefore;
1408
+ const n = {
1409
+ type: v.Call,
1410
+ value: null,
1411
+ inputs: [t, ...e.inputs ?? []],
1412
+ wsAfter: e.wsAfter
1413
+ };
1414
+ return e.error && (n.error = e.error), n;
1415
+ };
1416
+ function mt(e, t) {
1417
+ return e && t ? A(e, (e) => {
1418
+ if (e.type === v.Function && "string" == typeof e.value && !t(e.value)) return ht(e);
1419
+ }) : e;
1420
+ }
1421
+ function yt(e, t) {
1422
+ const n = t.name.toUpperCase(), r = e ? e.filter((e) => e.name.toUpperCase() !== n) : [];
1423
+ return r.push(t), r;
1424
+ }
1425
+ function It(e) {
1426
+ if (e?.type !== v.Function || "lambda" !== e.binder?.kind) return;
1427
+ const t = e.inputs ?? [], n = [];
1428
+ for (let e = 0; e < t.length - 1; e++) {
1429
+ const r = t[e];
1430
+ if (!r?.binding?.declaration) return;
1431
+ const i = r.value.nameId;
1432
+ n.push(r.binding.optional ? {
1433
+ name: i,
1434
+ optional: !0
1435
+ } : { name: i });
1436
+ }
1437
+ return n;
1438
+ }
1439
+ var bt = /* @__PURE__ */ new Set([
1440
+ "IF",
1441
+ "IFERROR",
1442
+ "IFNA"
1443
+ ]);
1444
+ function xt(e, t) {
1445
+ if (!e || e.type !== v.Function || "string" != typeof e.value) return e;
1446
+ const n = (t?.(e.value)?.getName() ?? e.value).toUpperCase();
1447
+ if (!bt.has(n)) return e;
1448
+ const r = e.inputs;
1449
+ let i;
1450
+ if (r) for (let e = 0; e < r.length; e++) {
1451
+ const n = xt(r[e], t);
1452
+ n !== r[e] && ((i ??= [...r])[e] = n);
1453
+ }
1454
+ return {
1455
+ ...e,
1456
+ inputs: i ?? r,
1457
+ passOmitted: !0
1458
+ };
1459
+ }
1460
+ function Rt(e, t = null) {
1461
+ if (!e) return e;
1462
+ const n = [];
1463
+ let r = 0;
1464
+ const i = (e) => {
1465
+ const t = e.inputs;
1466
+ if (!t) return e;
1467
+ let n;
1468
+ for (let e = 0; e < t.length; e++) {
1469
+ const r = t[e];
1470
+ if (!r) continue;
1471
+ const i = l(r);
1472
+ i !== r && (n || (n = [...t]), n[e] = i);
1473
+ }
1474
+ return n ? {
1475
+ ...e,
1476
+ inputs: n
1477
+ } : e;
1478
+ }, l = (e) => {
1479
+ if (!e) return e;
1480
+ const s = ft(e, t);
1481
+ if (s) return ((e, s) => {
1482
+ const o = e.inputs, a = o?.length ?? 0;
1483
+ if (!o || a < 1) return i(e);
1484
+ const u = n.length, c = [], f = [...o], p = (e, t = !1) => {
1485
+ const i = f[e];
1486
+ let l = pt(i), s = !1;
1487
+ if (void 0 === l && t) {
1488
+ if (l = vt(i), void 0 === l) return;
1489
+ s = !0;
1490
+ } else if (void 0 === l) return;
1491
+ const o = r++;
1492
+ n.push({
1493
+ key: l.toUpperCase(),
1494
+ slot: o,
1495
+ name: l
1496
+ }), c.push(o), f[e] = s ? {
1497
+ ...i,
1498
+ type: v.Named,
1499
+ value: {
1500
+ nameId: l,
1501
+ scope: null
1502
+ },
1503
+ inputs: null,
1504
+ binding: {
1505
+ slot: o,
1506
+ declaration: !0,
1507
+ optional: !0
1508
+ },
1509
+ isReference: !1
1510
+ } : {
1511
+ ...i,
1512
+ binding: {
1513
+ slot: o,
1514
+ declaration: !0
1515
+ },
1516
+ isReference: !1
1517
+ };
1518
+ };
1519
+ if ("lambda" === s) {
1520
+ for (let e = 0; e < a - 1; e++) p(e, !0);
1521
+ f[a - 1] && (f[a - 1] = l(f[a - 1]));
1522
+ } else {
1523
+ for (let e = 0; e + 1 < a; e += 2) f[e + 1] && (f[e + 1] = xt(l(f[e + 1]), t)), p(e);
1524
+ a % 2 == 1 && f[a - 1] && (f[a - 1] = l(f[a - 1]));
1525
+ }
1526
+ for (; n.length > u;) n.pop();
1527
+ return {
1528
+ ...e,
1529
+ inputs: f,
1530
+ binder: {
1531
+ kind: s,
1532
+ slots: c
1533
+ }
1534
+ };
1535
+ })(e, s);
1536
+ if (e.type === v.Function && "string" == typeof e.value) {
1537
+ const r = e.value.toUpperCase();
1538
+ if (n.some((e) => e.key === r) && !t?.(e.value)) return i(ht(e));
1539
+ }
1540
+ if (n.length > 0 && e.isReference && ":" === e.value && 2 === e.inputs?.length) {
1541
+ const [t, r] = e.inputs;
1542
+ if (Et(t) && Et(r)) {
1543
+ const l = t.image.toUpperCase(), s = r.image.toUpperCase();
1544
+ if (n.some((e) => e.key === l || e.key === s)) return i({
1545
+ ...e,
1546
+ inputs: [Tt(t), Tt(r)]
1547
+ });
1548
+ }
1549
+ }
1550
+ if (e.type === v.Named) {
1551
+ const t = pt(e);
1552
+ if (void 0 !== t) {
1553
+ const r = t.toUpperCase();
1554
+ for (let i = n.length - 1; i >= 0; i--) {
1555
+ if (n[i].key !== r) continue;
1556
+ const l = {
1557
+ ...e,
1558
+ binding: { slot: n[i].slot },
1559
+ isReference: !1
1560
+ };
1561
+ return t !== n[i].name && (l.value = {
1562
+ ...e.value,
1563
+ nameId: n[i].name
1564
+ }), l;
1565
+ }
1566
+ }
1567
+ return e;
1568
+ }
1569
+ const o = i(e);
1570
+ if (o.type === v.Function && "string" == typeof o.value && "ISOMITTED" === (t?.(o.value)?.getName() ?? o.value).toUpperCase()) {
1571
+ const e = o.inputs;
1572
+ if (e) {
1573
+ let n;
1574
+ for (let r = 0; r < e.length; r++) {
1575
+ const i = e[r];
1576
+ if (i?.binding && !i.binding.declaration && !0 !== i.rawFrameRead) {
1577
+ (n ??= [...e])[r] = {
1578
+ ...i,
1579
+ rawFrameRead: !0
1580
+ };
1581
+ continue;
1582
+ }
1583
+ const l = xt(i, t);
1584
+ l !== i && ((n ??= [...e])[r] = l);
1585
+ }
1586
+ if (n) return {
1587
+ ...o,
1588
+ inputs: n
1589
+ };
1590
+ }
1591
+ }
1592
+ return o;
1593
+ };
1594
+ return l(e);
1595
+ }
1596
+ var Et = (e) => {
1597
+ if (e?.type !== v.Cell || void 0 === e.image) return !1;
1598
+ const t = e.value;
1599
+ return t.rowIndex === Number.MIN_SAFE_INTEGER && !0 !== t.$colIndex && !t.scope;
1600
+ }, Tt = (e) => {
1601
+ const t = c(e.image);
1602
+ return b(t, e), t;
1603
+ }, At = (e) => e?.type === v.Cell, St = (e, t = null) => {
1604
+ if (!e) return e;
1605
+ let n = !1;
1606
+ const r = (e) => {
1607
+ if (n || !e) return;
1608
+ const i = ft(e, t), l = e.inputs;
1609
+ if (i && l) {
1610
+ const e = "let" === i ? 2 : 1;
1611
+ for (let t = 0; t < l.length - 1; t += e) if (At(l[t])) return void (n = !0);
1612
+ }
1613
+ if (l) for (let e = 0; e < l.length && !n; e++) r(l[e]);
1614
+ };
1615
+ if (r(e), !n) return e;
1616
+ let i = null;
1617
+ const l = A(e, (e) => {
1618
+ if (e?.type !== v.Cell) return;
1619
+ const t = e.value, n = e.image;
1620
+ if (!0 === t?.$colIndex || !0 === t?.$rowIndex) return void (i ??= `'${n ?? "a reference"}' cannot be absolute here. A LET/LAMBDA name that is a cell reference makes every reference in the formula a name, and a name cannot contain '$'.`);
1621
+ if (void 0 === n) return;
1622
+ const r = c(n);
1623
+ b(r, e);
1624
+ const l = t?.scope;
1625
+ return l && (r.value.scope = l, r.value.scopeImage = t.scopeImage), r;
1626
+ });
1627
+ return i ?? l;
1628
+ }, wt = (e, t) => {
1629
+ if (!e) return null;
1630
+ let n = null;
1631
+ const r = (e) => {
1632
+ if (n || !e) return;
1633
+ const i = ft(e, t);
1634
+ i && ((e, t) => {
1635
+ const r = "let" === t ? "LET" : "LAMBDA", i = e.inputs, l = i?.length ?? 0;
1636
+ if (!i || l < 2) return;
1637
+ if ("let" === t && l % 2 == 0) return void (n = `Wrong number of arguments for LET. Expected name/value pairs followed by a calculation, but got ${l}.`);
1638
+ if ("lambda" === t && i[l - 1]?.type === v.Empty) return void (n = "LAMBDA has no calculation: the last argument is empty.");
1639
+ const s = /* @__PURE__ */ new Set(), o = "let" === t ? 2 : 1;
1640
+ let a = !1;
1641
+ for (let e = 0; e < l - 1; e += o) {
1642
+ let l = pt(i[e]);
1643
+ if (void 0 === l && "lambda" === t) l = vt(i[e]), void 0 !== l && (a = !0);
1644
+ else if (void 0 !== l && a) return void (n = `Required name '${l}' cannot follow an optional name in ${r}.`);
1645
+ if (void 0 === l) return void (n = `Expected a name in ${r} argument ${e + 1}; a name cannot be the output of a formula.`);
1646
+ if (l.includes(".")) return void (n = `Expected a name in ${r} argument ${e + 1}; a name cannot contain '.'.`);
1647
+ const o = l.toUpperCase();
1648
+ if (s.has(o)) return void (n = `Duplicate name '${l}' in ${r}.`);
1649
+ s.add(o);
1650
+ }
1651
+ })(e, i);
1652
+ const l = e.inputs;
1653
+ if (l) for (let e = 0; e < l.length && !n; e++) r(l[e]);
1654
+ };
1655
+ return r(e), n;
1656
+ };
1657
+ function Ct(e, t, n, r, s) {
1658
+ const o = r;
1659
+ let a;
1660
+ const u = () => (void 0 === a && (a = s && n ? t.bind(i.Table, "", { at: {
1661
+ scope: n,
1662
+ rowIndex: s.rowIndex,
1663
+ colIndex: s.colIndex
1664
+ } }) : null), a);
1665
+ return A(e, (e, r, s = []) => {
1666
+ let a;
1667
+ const c = e.type;
1668
+ if (c === v.Cell) {
1669
+ const n = e.value;
1670
+ if (n?.scope) {
1671
+ const r = t.bind(i.Sheet, n.scope, o);
1672
+ null !== r && (a || (a = { ...e }), a.value = {
1673
+ ...n,
1674
+ scope: r
1675
+ });
1676
+ }
1677
+ } else if (c === v.Named) {
1678
+ const r = e.value;
1679
+ if (r && !e.binding) {
1680
+ const s = function(e, t, n, r) {
1681
+ if (t.scope) {
1682
+ const e = n.bind(i.Sheet, t.scope, r);
1683
+ if (null === e || l(e)) return;
1684
+ }
1685
+ const s = n.bind(i.Table, t.nameId, { existing: !0 });
1686
+ if (null === s) return;
1687
+ const o = {
1688
+ type: v.TableReference,
1689
+ value: s,
1690
+ inputs: null,
1691
+ isReference: !0
1692
+ };
1693
+ b(o, e);
1694
+ const a = t.scopeImage;
1695
+ return "string" == typeof a && void 0 !== e.image && (o.image = a + e.image), o;
1696
+ }(e, r, t, o);
1697
+ if (s) return s;
1698
+ const u = r.scope ? t.bind(i.Sheet, r.scope, o) : null, c = (null !== u ? l(u) ? u : t.resolve(i.Sheet, u)?.toString() ?? r.scope : r.scope) ?? n, f = t.bind(i.NamedFormula, r.nameId, c ? { scope: c } : void 0);
1699
+ null === f && null === u || (a || (a = { ...e }), a.value = {
1700
+ ...r,
1701
+ nameId: f ?? r.nameId,
1702
+ ...null !== u ? { scope: u } : void 0
1703
+ });
1704
+ }
1705
+ } else if (c === v.Error) {
1706
+ const n = e.value;
1707
+ if (n?.scope) {
1708
+ const r = t.bind(i.Sheet, n.scope, o);
1709
+ null !== r && (a || (a = { ...e }), a.value = {
1710
+ ...n,
1711
+ scope: r
1712
+ });
1713
+ }
1714
+ } else if (c === v.TableReference) {
1715
+ const n = e.value;
1716
+ if (n) {
1717
+ const r = t.bind(i.Table, n);
1718
+ a || (a = { ...e }), null !== r && (a.value = r);
1719
+ } else if ("string" == typeof n) {
1720
+ const n = u();
1721
+ if (null !== n && Nt(e, t)) return {
1722
+ ...e,
1723
+ value: n
1724
+ };
1725
+ }
1726
+ } else if (c === v.TableColumn) {
1727
+ const n = e.value;
1728
+ if (n) {
1729
+ const r = pe(s, v.TableReference), l = r?.value || (r ? u() ?? void 0 : void 0), o = t.bind(i.TableColumn, n, l ? { tableName: l } : void 0);
1730
+ a || (a = { ...e }), null !== o && (a.value = o);
1731
+ }
1732
+ } else if (c === v.Function) {
1733
+ const n = e.value;
1734
+ if (n) {
1735
+ const r = t.bind(i.Function, n);
1736
+ a || (a = { ...e }), null !== r && (a.value = r);
1737
+ }
1738
+ }
1739
+ return a;
1740
+ });
1741
+ }
1742
+ function Nt(e, t) {
1743
+ let n = !0;
1744
+ const r = e.inputs;
1745
+ if (!r) return !0;
1746
+ for (let e = 0; e < r.length && n; e++) A(r[e], (e) => {
1747
+ e.type === v.TableColumn && null === t.resolve(i.TableColumn, e.value) && (n = !1);
1748
+ });
1749
+ return n;
1750
+ }
1751
+ function Ft(e, t) {
1752
+ let n = null;
1753
+ return A(e, (e) => {
1754
+ if (n || e.type !== v.TableReference) return;
1755
+ if ("" === e.value) return void (n = "A structured reference without a table name must be in a table that has its columns.");
1756
+ const r = e.value;
1757
+ if (!t || "string" != typeof r) return;
1758
+ const l = t.resolve(i.Table, r)?.toString() ?? r;
1759
+ null === t.bind(i.Table, l, { existing: !0 }) ? n = `There is no table named '${l}'.` : Nt(e, t) || (n = "The table has no such column.");
1760
+ }), n;
1761
+ }
1762
+ export { ce as A, Re as C, ve as D, mt as E, ae as O, Xe as S, ye as T, Ye as _, Ge as a, _e as b, ct as c, rt as d, Ft as f, he as g, ge as h, Ie as i, ue as j, fe as k, ot as l, He as m, yt as n, at as o, ut as p, Rt as r, wt as s, We as t, it as u, Ct as v, St as w, be as x, me as y };