allyhub 0.6.0 → 0.7.1

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 (632) hide show
  1. package/dist/audio-text.js +1 -1
  2. package/dist/commands/add.js +2 -2
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/dev.js +1 -1
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames/sheet.js +1 -1
  7. package/dist/commands/frames.js +8 -8
  8. package/dist/commands/index.js +1 -1
  9. package/dist/commands/inspect/common.js +1 -1
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/render.js +1 -1
  12. package/dist/commands/sheet.js +5 -5
  13. package/dist/commands/site.js +3 -2
  14. package/dist/commands/skills.js +3 -3
  15. package/dist/commands/slides.js +2 -2
  16. package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
  17. package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
  18. package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
  19. package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
  20. package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
  21. package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
  22. package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
  23. package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
  24. package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
  25. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
  26. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
  27. package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
  28. package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
  29. package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
  30. package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
  31. package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
  32. package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
  33. package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
  34. package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
  35. package/dist/node_modules/@allyhub-next/build/package.json +1 -1
  36. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
  38. package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
  39. package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
  40. package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
  41. package/dist/node_modules/@allyhub-next/check/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
  43. package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
  44. package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
  45. package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
  46. package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
  47. package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
  48. package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
  49. package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
  50. package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
  51. package/dist/node_modules/@allyhub-next/components/package.json +1 -1
  52. package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
  53. package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
  54. package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
  55. package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
  56. package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
  57. package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
  58. package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
  59. package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
  60. package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
  61. package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
  62. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
  63. package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
  64. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.js +2 -2
  65. package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
  66. package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
  67. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
  68. package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
  69. package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
  70. package/dist/node_modules/@allyhub-next/export/package.json +1 -1
  71. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
  72. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
  73. package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
  74. package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
  75. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +69 -18
  76. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
  77. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +847 -116
  78. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
  79. package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
  80. package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
  81. package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +3 -0
  82. package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
  83. package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
  84. package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
  85. package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
  86. package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
  87. package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +501 -38
  88. package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
  89. package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
  90. package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
  91. package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
  92. package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
  93. package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
  94. package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
  95. package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
  96. package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
  97. package/dist/node_modules/@allyhub-next/media/package.json +1 -1
  98. package/dist/node_modules/@allyhub-next/model/package.json +1 -1
  99. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
  100. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
  101. package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
  102. package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
  103. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
  104. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
  105. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
  106. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
  107. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
  108. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
  109. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
  110. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
  111. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
  112. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
  113. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
  114. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
  115. package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
  116. package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
  117. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
  118. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
  119. package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
  120. package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
  121. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
  122. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
  123. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
  124. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
  125. package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
  126. package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
  127. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
  128. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
  129. package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
  130. package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
  131. package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
  132. package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
  133. package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
  134. package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
  135. package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
  136. package/dist/node_modules/@allyhub-next/project/package.json +1 -1
  137. package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
  138. package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
  139. package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
  140. package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
  141. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
  142. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
  143. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
  144. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
  145. package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +79 -5
  146. package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
  147. package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
  148. package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
  149. package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
  150. package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +21 -0
  151. package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
  152. package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
  153. package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
  154. package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
  155. package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
  156. package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
  157. package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
  158. package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
  159. package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
  160. package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
  161. package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
  162. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +396 -0
  163. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
  164. package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
  165. package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
  166. package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
  167. package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
  168. package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
  169. package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
  170. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
  171. package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
  172. package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
  173. package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
  174. package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
  175. package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
  176. package/dist/node_modules/@allyhub-next/render/package.json +1 -1
  177. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
  178. package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
  179. package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
  180. package/dist/node_modules/@allyhub-next/runtimes/dist/download.d.ts +19 -1
  181. package/dist/node_modules/@allyhub-next/runtimes/dist/download.js +1 -1
  182. package/dist/node_modules/@allyhub-next/runtimes/dist/index.d.ts +2 -2
  183. package/dist/node_modules/@allyhub-next/runtimes/dist/index.js +1 -1
  184. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
  185. package/dist/node_modules/@allyhub-next/runtimes/dist/lock.js +1 -1
  186. package/dist/node_modules/@allyhub-next/runtimes/dist/packages.d.ts +19 -2
  187. package/dist/node_modules/@allyhub-next/runtimes/dist/packages.js +3 -3
  188. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +3 -0
  189. package/dist/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -3
  190. package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
  191. package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
  192. package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
  193. package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
  194. package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
  195. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
  196. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
  197. package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  198. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
  199. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
  200. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
  201. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
  202. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
  203. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
  204. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
  205. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
  206. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
  207. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
  208. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
  209. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
  210. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
  211. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
  212. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
  213. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
  214. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
  215. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
  216. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
  217. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
  218. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
  219. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
  220. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
  221. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
  222. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
  223. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
  224. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
  225. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
  226. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
  227. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
  228. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
  229. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
  230. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
  231. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
  232. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
  233. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
  234. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
  235. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
  236. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
  237. package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
  238. package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
  239. package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
  240. package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
  241. package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
  242. package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
  243. package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
  244. package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
  245. package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
  246. package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
  247. package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
  248. package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
  249. package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
  250. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
  251. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
  252. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
  253. package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
  254. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
  255. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
  256. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
  257. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
  258. package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
  259. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
  260. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
  261. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +10 -1
  262. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
  263. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
  264. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
  265. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
  266. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
  267. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +3 -1
  268. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
  269. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +42 -1
  270. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
  271. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
  272. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
  273. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
  274. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
  275. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
  276. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
  277. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
  278. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
  279. package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
  280. package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
  281. package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +59 -39
  282. package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
  283. package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
  284. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +27 -13
  285. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
  286. package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
  287. package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
  288. package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
  289. package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
  290. package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
  291. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +179 -16
  292. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
  293. package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
  294. package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
  295. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
  296. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
  297. package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -1
  298. package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
  300. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
  301. package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
  302. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
  303. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
  304. package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +2 -4
  305. package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +17 -1
  306. package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
  307. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +21 -5
  308. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
  309. package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
  310. package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
  311. package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
  312. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
  313. package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
  314. package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
  315. package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
  316. package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
  317. package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
  318. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
  319. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
  320. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
  321. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
  322. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
  323. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
  324. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
  325. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
  326. package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
  327. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
  328. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
  329. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
  330. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
  331. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
  332. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
  333. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
  334. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
  335. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
  336. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
  337. package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
  338. package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
  339. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
  340. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
  341. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
  342. package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
  343. package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
  344. package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
  345. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
  346. package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
  347. package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
  348. package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
  349. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
  350. package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
  351. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
  352. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
  353. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
  354. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
  355. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
  356. package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
  357. package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
  358. package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
  359. package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
  360. package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
  361. package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
  362. package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
  363. package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
  364. package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
  365. package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
  366. package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
  367. package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
  368. package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
  369. package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
  370. package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
  371. package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
  372. package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
  373. package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
  374. package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
  375. package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
  376. package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
  377. package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
  378. package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
  379. package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
  380. package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
  381. package/dist/node_modules/@allyhub-next/website/package.json +13 -0
  382. package/dist/text/facts-text.js +4 -4
  383. package/dist/works.js +1 -1
  384. package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
  385. package/editor-web/assets/dist-B-BI8jma.js +37 -0
  386. package/editor-web/assets/dist-CS-Z5JSF.js +224 -0
  387. package/editor-web/assets/dist-ClE1xUdI.js +10 -0
  388. package/editor-web/assets/dist-Cqu9f1N5.js +1 -0
  389. package/editor-web/assets/dist-CsDICOqP.js +36 -0
  390. package/editor-web/assets/dist-DegNYCaB.js +10 -0
  391. package/editor-web/assets/dist-EotuIcA_.js +2 -0
  392. package/editor-web/assets/index-CwDs3z43.js +69 -0
  393. package/editor-web/assets/index-ujKjdu_s.css +2 -0
  394. package/editor-web/assets/minus-DLhpe7h_.js +1 -0
  395. package/editor-web/assets/react-CT8OUeCe.js +101 -0
  396. package/editor-web/assets/tabs-BEPTOFm5.js +105 -0
  397. package/editor-web/assets/text-align-start-CfqIQSWH.js +1 -0
  398. package/editor-web/index.html +5 -5
  399. package/package.json +8 -14
  400. package/dist/astro.d.ts +0 -2
  401. package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
  402. package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
  403. package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
  404. package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
  405. package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
  406. package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
  407. package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
  408. package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
  409. package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
  410. package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
  411. package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
  412. package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
  413. package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
  414. package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
  415. package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
  416. package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
  417. package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
  418. package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
  419. package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
  420. package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
  421. package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
  422. package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
  423. package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
  424. package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
  425. package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
  426. package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
  427. package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
  428. package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
  429. package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
  430. package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
  431. package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
  432. package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
  433. package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
  434. package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
  435. package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
  436. package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
  437. package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
  438. package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
  439. package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
  440. package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
  441. package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
  442. package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
  443. package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
  444. package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
  445. package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
  446. package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
  447. package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
  448. package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
  449. package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
  450. package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
  451. package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
  452. package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
  453. package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
  454. package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
  455. package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
  456. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
  457. package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
  458. package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
  459. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
  460. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
  461. package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
  462. package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
  463. package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
  464. package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
  465. package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
  466. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
  467. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
  468. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
  469. package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
  470. package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
  471. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
  472. package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
  473. package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
  474. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
  475. package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
  476. package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
  477. package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
  478. package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
  479. package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
  480. package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
  481. package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
  482. package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
  483. package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
  484. package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
  485. package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
  486. package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
  487. package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
  488. package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
  489. package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
  490. package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
  491. package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
  492. package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
  493. package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
  494. package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
  495. package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
  496. package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
  497. package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
  498. package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
  499. package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
  500. package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
  501. package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
  502. package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
  503. package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
  504. package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
  505. package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
  506. package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
  507. package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
  508. package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
  509. package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
  510. package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
  511. package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
  512. package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
  513. package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
  514. package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
  515. package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
  516. package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
  517. package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
  518. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
  519. package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
  520. package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
  521. package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
  522. package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
  523. package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -67
  524. package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
  525. package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
  526. package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
  527. package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
  528. package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
  529. package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
  530. package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -178
  531. package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
  532. package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
  533. package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
  534. package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
  535. package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
  536. package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
  537. package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
  538. package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
  539. package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
  540. package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
  541. package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
  542. package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
  543. package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
  544. package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
  545. package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
  546. package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
  547. package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
  548. package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
  549. package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
  550. package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
  551. package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
  552. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
  553. package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
  554. package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
  555. package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
  556. package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
  557. package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
  558. package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
  559. package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
  560. package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
  561. package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
  562. package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
  563. package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
  564. package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
  565. package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
  566. package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
  567. package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
  568. package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
  569. package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
  570. package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
  571. package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
  572. package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
  573. package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
  574. package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
  575. package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
  576. package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
  577. package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
  578. package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
  579. package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
  580. package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
  581. package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
  582. package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
  583. package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
  584. package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
  585. package/dist/node_modules/@allyhub-next/site/package.json +0 -25
  586. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +0 -5
  587. package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +0 -2
  588. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
  589. package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
  590. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
  591. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
  592. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
  593. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -56
  594. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
  595. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -72
  596. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -32
  597. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
  598. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
  599. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
  600. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -32
  601. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -43
  602. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
  603. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
  604. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
  605. package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
  606. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
  607. package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
  608. package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
  609. package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
  610. package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
  611. package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
  612. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
  613. package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
  614. package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
  615. package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
  616. package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
  617. package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
  618. package/dist/site.d.ts +0 -2
  619. package/editor-web/assets/dist-BW2s9FMO.js +0 -4
  620. package/editor-web/assets/dist-C-6JmebI.js +0 -233
  621. package/editor-web/assets/dist-CCYMLMKN.js +0 -6
  622. package/editor-web/assets/dist-CHzurjMx.js +0 -33
  623. package/editor-web/assets/dist-DF7H1dxw.js +0 -1
  624. package/editor-web/assets/dist-Da5AUSKX.js +0 -2
  625. package/editor-web/assets/index-B7S9RZhL.css +0 -2
  626. package/editor-web/assets/index-CovQYWvD.js +0 -69
  627. package/editor-web/assets/minus-BrvjaJyO.js +0 -1
  628. package/editor-web/assets/react-DV5fPdiH.js +0 -101
  629. package/editor-web/assets/textarea-B0vCGdZI.js +0 -105
  630. package/editor-web/assets/trash-2-B0dvc1cZ.js +0 -1
  631. package/editor-web/assets/undo-2-A1EPubPO.js +0 -1
  632. /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
@@ -1,33 +0,0 @@
1
- import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{Bt as r,Ct as i,Dt as a,Lt as o,Mt as s,Ot as c,Pt as l,St as u,Tt as d,Ut as f,Vt as p,Yt as m,_ as h,a as g,an as _,bt as v,c as y,cn as b,d as x,f as S,g as C,gn as w,h as T,in as ee,l as E,m as D,n as te,on as ne,p as re,qt as ie,r as ae,s as oe,sn as se,u as ce,v as le,xt as ue,y as de,zt as fe}from"./react-DV5fPdiH.js";import{a as pe,b as me,c as he,d as ge,f as _e,g as ve,h as ye,i as be,l as xe,m as Se,n as Ce,o as we,p as Te,r as Ee,s as De,t as Oe,u as ke,w as Ae,x as je,y as Me}from"./dist-CCYMLMKN.js";import{a as Ne,c as Pe,d as Fe,f as Ie,i as Le,l as Re,n as ze,o as Be,r as Ve,s as He,t as Ue,u as We}from"./textarea-B0vCGdZI.js";import{t as Ge}from"./minus-BrvjaJyO.js";import{i as Ke,n as qe,r as Je,t as Ye}from"./undo-2-A1EPubPO.js";import{a as O,i as Xe,l as Ze,n as Qe,o as $e,r as et,t as tt}from"./index-CovQYWvD.js";var nt=r(`arrow-down-a-z`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 20V4`,key:`1yoxec`}],[`path`,{d:`M20 8h-5`,key:`1vsyxs`}],[`path`,{d:`M15 10V6.5a2.5 2.5 0 0 1 5 0V10`,key:`ag13bf`}],[`path`,{d:`M15 14h5l-5 6h5`,key:`ur5jdg`}]]),rt=r(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),it=r(`arrow-down-z-a`,[[`path`,{d:`m3 16 4 4 4-4`,key:`1co6wj`}],[`path`,{d:`M7 4v16`,key:`1glfcx`}],[`path`,{d:`M15 4h5l-5 6h5`,key:`8asdl1`}],[`path`,{d:`M15 20v-3.5a2.5 2.5 0 0 1 5 0V20`,key:`r6l5cz`}],[`path`,{d:`M20 18h-5`,key:`18j1r2`}]]),at=r(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),ot=r(`chart-column`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]]),st=r(`chart-line`,[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`m19 9-5 5-4-4-3 3`,key:`2osh9i`}]]),ct=r(`chart-pie`,[[`path`,{d:`M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z`,key:`pzmjnu`}],[`path`,{d:`M21.21 15.89A10 10 0 1 1 8 2.83`,key:`k2fpak`}]]),lt=r(`chart-scatter`,[[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}],[`circle`,{cx:`18.5`,cy:`5.5`,r:`.5`,fill:`currentColor`,key:`lysivs`}],[`circle`,{cx:`11.5`,cy:`11.5`,r:`.5`,fill:`currentColor`,key:`byv1b8`}],[`circle`,{cx:`7.5`,cy:`16.5`,r:`.5`,fill:`currentColor`,key:`nkw3mc`}],[`circle`,{cx:`17.5`,cy:`14.5`,r:`.5`,fill:`currentColor`,key:`1gjh6j`}],[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}]]),ut=r(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),dt=r(`decimals-arrow-left`,[[`path`,{d:`m13 21-3-3 3-3`,key:`s3o1nf`}],[`path`,{d:`M20 18H10`,key:`14r3mt`}],[`path`,{d:`M3 11h.01`,key:`1eifu7`}],[`rect`,{x:`6`,y:`3`,width:`5`,height:`8`,rx:`2.5`,key:`v9paqo`}]]),ft=r(`decimals-arrow-right`,[[`path`,{d:`M10 18h10`,key:`1y5s8o`}],[`path`,{d:`m17 21 3-3-3-3`,key:`1ammt0`}],[`path`,{d:`M3 11h.01`,key:`1eifu7`}],[`rect`,{x:`15`,y:`3`,width:`5`,height:`8`,rx:`2.5`,key:`76md6a`}],[`rect`,{x:`6`,y:`3`,width:`5`,height:`8`,rx:`2.5`,key:`v9paqo`}]]),pt=r(`dollar-sign`,[[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`22`,key:`7eqyqh`}],[`path`,{d:`M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6`,key:`1b0p4s`}]]),mt=r(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),ht=r(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),gt=r(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),_t=r(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),vt=r(`heading`,[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]]),yt=r(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),bt=r(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),xt=r(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),St=r(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Ct=r(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),wt=r(`percent`,[[`line`,{x1:`19`,x2:`5`,y1:`5`,y2:`19`,key:`1x9vlm`}],[`circle`,{cx:`6.5`,cy:`6.5`,r:`2.5`,key:`4mh3h7`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`2.5`,key:`1mdrzq`}]]),Tt=r(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Et=r(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),Dt=r(`square-function`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`path`,{d:`M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3`,key:`m1af9g`}],[`path`,{d:`M9 11.2h5.7`,key:`3zgcl2`}]]),Ot=r(`swatch-book`,[[`path`,{d:`M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z`,key:`1ldrpk`}],[`path`,{d:`M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7`,key:`11i5po`}],[`path`,{d:`M 7 17h.01`,key:`1euzgo`}],[`path`,{d:`m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8`,key:`o2gii7`}]]),kt=r(`table-cells-merge`,[[`path`,{d:`M12 21v-6`,key:`lihzve`}],[`path`,{d:`M12 9V3`,key:`da5inc`}],[`path`,{d:`M3 15h18`,key:`5xshup`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]),At=r(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),jt=r(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),k=t(w(),1),A=p(),Mt=Object.defineProperty,j=(e,t)=>Mt(e,`name`,{value:t,configurable:!0}),Nt={Automatic:`automatic`,Manual:`manual`},Pt=`Tabs`,[M,Ft]=a(Pt,[de]),It=de(),[Lt,Rt]=M(Pt),zt=k.forwardRef(j(function(e,t){let{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:s=`horizontal`,dir:l,activationMode:u=Nt.Automatic,...d}=e,f=v(l),[p,m]=i({prop:r,onChange:a,defaultProp:o??``,caller:Pt});return(0,A.jsx)(Lt,{scope:n,baseId:ue(),value:p,onValueChange:m,orientation:s,dir:f,activationMode:u,children:(0,A.jsx)(c.div,{dir:f,"data-orientation":s,...d,ref:t})})},`Tabs`)),Bt=`TabsList`,Vt=k.forwardRef(j(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=Rt(Bt,n),o=It(n);return(0,A.jsx)(h,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,A.jsx)(c.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),Ht=`TabsTrigger`,Ut=k.forwardRef(j(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Rt(Ht,n),s=It(n),l=Kt(o.baseId,r),u=qt(o.baseId,r),f=r===o.value;return(0,A.jsx)(le,{asChild:!0,...s,focusable:!i,active:f,children:(0,A.jsx)(c.button,{type:`button`,role:`tab`,"aria-selected":f,"aria-controls":u,"data-state":f?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:l,...a,ref:t,onMouseDown:d(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?(e.currentTarget.focus(),o.onValueChange(r)):e.preventDefault()}),onKeyDown:d(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:d(e.onFocus,()=>{let e=o.activationMode!==Nt.Manual;!f&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),Wt=`TabsContent`,Gt=k.forwardRef(j(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Rt(Wt,n),l=Kt(s.baseId,r),d=qt(s.baseId,r),f=r===s.value,p=k.useRef(f);return k.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,A.jsx)(u,{present:i||f,children:({present:n})=>(0,A.jsx)(c.div,{"data-state":f?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":l,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function Kt(e,t){return`${e}-trigger-${t}`}j(Kt,`makeTriggerId`);function qt(e,t){return`${e}-content-${t}`}j(qt,`makeContentId`);var Jt=1048576,Yt=16384;function Xt(e){let t=``;for(let n=e+1;n>0;n=Math.floor((n-1)/26))t=String.fromCharCode(65+(n-1)%26)+t;return t}function Zt(e){if(!/^[A-Za-z]{1,3}$/u.test(e))return;let t=0;for(let n of e.toUpperCase())t=t*26+n.charCodeAt(0)-64;return t<=16384?t-1:void 0}var Qt=e=>`${Xt(e.col)}${String(e.row+1)}`;function $t(e){let t=Qt({row:e.top,col:e.left});return e.top===e.bottom&&e.left===e.right?t:`${t}:${Qt({row:e.bottom,col:e.right})}`}function en(e){let t=/^\$?([A-Za-z]{1,3})\$?([1-9]\d*)$/u.exec(e.trim());if(!t)return;let n=Zt(t[1]??``),r=Number(t[2])-1;return n===void 0||r>=1048576?void 0:{row:r,col:n}}function tn(e){let[t=``,n,r]=e.split(`:`);if(r!==void 0)return;let i=en(t),a=n===void 0?i:en(n);if(i&&a)return{top:Math.min(i.row,a.row),left:Math.min(i.col,a.col),bottom:Math.max(i.row,a.row),right:Math.max(i.col,a.col)}}function nn(e){let t=[];for(let n of e.trim().split(/\s+/u)){let e=tn(n);if(!e)return;t.push(e)}return t}var rn=(e,t,n)=>t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right,an=(e,t)=>e.top<=t.bottom&&t.top<=e.bottom&&e.left<=t.right&&t.left<=e.right,on={delimiter:`,`,newline:`
2
- `,bom:!1,finalNewline:!0};function sn(e,t=`,`){let n=e.startsWith(``),r=[],i=[],a=0,o=0,s=+!!n,c=1,l=e.length;for(;s<l;){let n=s,u=c,d=[],f=``,p=!1,m=!1,h=!1;for(;s<l;){let i=e.charAt(s);if(p){if(i===`"`){if(e.charAt(s+1)===`"`){f+=`"`,s+=2;continue}p=!1,s+=1;continue}i===`
3
- `&&(c+=1),f+=i,s+=1}else if(i===`"`&&f===``&&!m)p=!0,m=!0,s+=1;else if(i===t)d.push(f),f=``,m=!1,s+=1;else{if(i===`\r`||i===`
4
- `){let t=s;i===`\r`&&e.charAt(s+1)===`
5
- `?(a+=1,s+=2):(i===`
6
- `&&(o+=1),s+=1),c+=1,d.push(f),r.push({fields:d,start:n,end:t,line:u}),h=!0;break}f+=i,s+=1}}h||(p&&i.push({line:u,message:`a quoted field is never closed: a " is missing`}),d.push(f),r.push({fields:d,start:n,end:l,line:u}))}let u=e.charAt(l-1);return{source:e,records:r,dialect:{delimiter:t,newline:a>o?`\r
7
- `:`
8
- `,bom:n,finalNewline:l>+!!n&&(u===`
9
- `||u===`\r`)},problems:i}}function cn(e,t=`,`){return e.includes(t)||e.includes(`"`)||e.includes(`
10
- `)||e.includes(`\r`)?`"${e.replace(/"/g,`""`)}"`:e}function ln(e,t=`,`){return e.length===1&&e[0]===``?`""`:e.map(e=>cn(e,t)).join(t)}function un(e,t=on){let n=e.map(e=>ln(e,t.delimiter)).join(t.newline);return`${t.bom?``:``}${n}${t.finalNewline&&e.length>0?t.newline:``}`}function dn(e){return e.map(e=>ln(e,` `)).join(`
11
- `)}function fn(e){return sn(e,` `).records.map(e=>e.fields)}var pn=(e,t)=>{if(e.length===0)return``;let n=[];for(let r=0;r<t;r++)n.push(e[r]??``);return n.join(`\0`)},mn=(e,t)=>pn(e.end===e.start?[]:e.fields,t);function hn(e,t){let{dialect:n,records:r,source:i}=e,a=t.reduce((e,t)=>Math.max(e,t.length),0);if(t.length===0)return n.bom?``:``;let o=new Map;for(let e of r)o.set(e.fields,e);let s=new Set,c=Array(t.length);t.forEach((e,t)=>{let n=o.get(e);n&&!s.has(n)&&(s.add(n),c[t]=i.slice(n.start,n.end))});let l;t.forEach((e,t)=>{if(c[t]!==void 0)return;if(!l){l=new Map;for(let e of r){if(s.has(e)||e.fields.length>a)continue;let t=mn(e,a),n=l.get(t);n?n.push(e):l.set(t,[e])}}let o=l.get(pn(e,a))?.shift();if(o){c[t]=i.slice(o.start,o.end);return}let u=[...e];for(;u.length<a;)u.push(``);c[t]=e.length===0?``:ln(u,n.delimiter)});let u=n.finalNewline||c[c.length-1]===``;return`${n.bom?``:``}${c.join(n.newline)}${u?n.newline:``}`}var N=class e{static all=new Map;code;constructor(e){this.code=e}static of(t){let n=e.all.get(t);return n||(n=new e(t),e.all.set(t,n)),n}toString(){return this.code}toJSON(){return this.code}},P={NULL:N.of(`#NULL!`),DIV0:N.of(`#DIV/0!`),VALUE:N.of(`#VALUE!`),REF:N.of(`#REF!`),NAME:N.of(`#NAME?`),NUM:N.of(`#NUM!`),NA:N.of(`#N/A`),SPILL:N.of(`#SPILL!`),CALC:N.of(`#CALC!`),CYCLE:N.of(`#CYCLE!`)},gn=[`#NULL!`,`#DIV/0!`,`#VALUE!`,`#REF!`,`#NAME?`,`#NUM!`,`#N/A`,`#GETTING_DATA`,`#SPILL!`,`#CALC!`,`#CYCLE!`];function _n(e){let t=e.toUpperCase(),n=gn.find(e=>e===t);return n===void 0?void 0:N.of(n)}var F=class{rows;cols;data;constructor(e,t,n){this.rows=e,this.cols=t,this.data=n}at(e,t){return this.data[e*this.cols+t]??null}},vn=864e5,yn=25569;function bn(e){let t=e+yn;return t<61?t-1:t}function xn(e){let t=Math.floor(e);if(t!==60)return(t<60?t+1:t)-yn}function Sn(e,t,n){let r=new Date(Date.UTC(2e3,t-1,1));return r.setUTCFullYear(r.getUTCFullYear()-2e3+e),bn(Math.floor(r.getTime()/vn))+n-1}function Cn(e){let t=xn(e);if(t===void 0)return{year:1900,month:2,day:29};if(Math.floor(e)===0)return{year:1900,month:1,day:0};let n=new Date(t*vn);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate()}}function wn(e){let t=e.getTime(),n=Math.floor(t/vn);return bn(n)+(t-n*vn)/vn}function Tn(e){let t=xn(e);if(t===void 0)return;let n=e-Math.floor(e);return new Date(t*vn+Math.round(n*vn))}var En=(e,t=2)=>String(e).padStart(t,`0`);function Dn(e){let{year:t,month:n,day:r}=Cn(e),i=`${En(t,4)}-${En(n)}-${En(r)}`,a=Math.round((e-Math.floor(e))*86400);if(a===0)return i;let o=a%60;return`${i}T${En(Math.floor(a/3600))}:${En(Math.floor(a/60)%60)}${o===0?``:`:${En(o)}`}`}function On(e){if(e===0)return`0`;let t=Number(e.toPrecision(15)),n=Math.floor(Math.log10(Math.abs(t)));if(n>=15||n<-10){let[e=``,n=`0`]=t.toExponential().split(`e`),r=Number(n);return`${e}E${r<0?`-`:`+`}${En(Math.abs(r))}`}let r=String(t);return r.includes(`e`)?t.toFixed(Math.min(20,Math.abs(n)+15)).replace(/0+$/u,``):r}var kn=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/u,An=/^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d+)?$/u,jn=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,Mn=e=>/^[+-]?\d+$/u.test(e)&&e.replace(/^[+-]?0*/u,``).length>15;function Nn(e){let t=jn.exec(e);if(!t)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],a=Sn(n,r,i),o=Cn(a);if(o.month!==r||o.day!==i)return;if(t[4]===void 0)return{value:a,format:`yyyy-mm-dd`};let[s,c,l]=[Number(t[4]),Number(t[5]),Number(t[6]??0)];if(s>23||c>59||l>59)return;let u=t[7],d=0;if(u!==void 0&&u!==`Z`){let e=u.replace(`:`,``);d=(e.startsWith(`-`)?1:-1)*(Number(e.slice(1,3))*60+Number(e.slice(3,5)))/1440}return{value:a+(s*3600+c*60+l)/86400+d,format:t[6]===void 0?`yyyy-mm-dd hh:mm`:`yyyy-mm-dd hh:mm:ss`}}function Pn(e){if(e===``)return{value:null};if(e.startsWith(`'`))return{value:e.slice(1)};if(e.length>1&&e.startsWith(`=`))return{value:null,formula:e};let t=e.trim();if(t===``)return{value:e};let n=t.toUpperCase();if(n===`TRUE`)return{value:!0};if(n===`FALSE`)return{value:!1};if(kn.test(t))return Mn(t)?{value:e}:{value:Number(t)};if(t.endsWith(`%`)){let e=t.slice(0,-1).trim();if(kn.test(e))return{value:Number(e)/100,format:e.includes(`.`)?`0.00%`:`0%`}}if(An.test(t))return{value:Number(t.replaceAll(`,`,``)),format:t.includes(`.`)?`#,##0.00`:`#,##0`};let r=/^([+-]?)\$(\d[\d,]*(?:\.\d+)?)$/u.exec(t),i=r?.[2]?.replaceAll(`,`,``);if(r&&i!==void 0)return{value:Number(`${r[1]??``}${i}`),format:t.includes(`.`)?`$#,##0.00`:`$#,##0`};let a=Nn(t);if(a)return a;let o=_n(t);return o?{value:o}:{value:e}}function Fn(e){if(e===null)return``;if(typeof e==`number`){let t=String(e);return Mn(t)?e.toExponential():t}if(typeof e==`boolean`)return e?`TRUE`:`FALSE`;if(e instanceof N)return e.code;let t=Pn(e);return t.value===e&&t.formula===void 0?e:`'${e}`}var In=`sheet.yaml`;function Ln(e){let{file:t}=Rn(e);return[...new Set(t?.sheets.flatMap(e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)])??[])]}function Rn(e){let t=new Ve,n=ze(e,{lineCounter:t}),r=e=>{for(let r=e.length;r>=0;r--){let i=n.getIn(e.slice(0,r),!0)?.range?.[0];if(i!==void 0)return t.linePos(i).line}};if(n.errors.length>0)return{problems:n.errors.map(e=>({file:In,line:t.linePos(e.pos[0]).line,message:`not YAML: ${e.message.split(`
12
- `)[0]??``}`})),lineOf:r};let i=ee(`sheet`,n.toJS()??{});return i.ok?{file:i.value,problems:[],lineOf:r}:{problems:i.problems.map(e=>{let t=r(e.path===``?[]:e.path.split(`.`).map(e=>/^\d+$/u.test(e)?Number(e):e));return{file:In,...t===void 0?{}:{line:t},message:`${e.path===``?``:`${e.path}: `}${e.message}`}}),lineOf:r}}var zn=e=>e.toLowerCase();function Bn(e,t){let n=e.sheets.length;if(!t)return{file:e,own:n,names:new Set,ordinary:[]};let r=new Set(e.sheets.map(e=>zn(e.name))),i=t.sheets.filter(e=>!r.has(zn(e.name))),a=t.sheets.filter(e=>r.has(zn(e.name))).map(e=>e.name),o=new Set(Object.keys(e.names??{}).map(zn)),s=Object.entries(t.names??{}).filter(([e])=>!o.has(zn(e)));return{file:{...e,sheets:[...e.sheets,...i],...s.length===0?{}:{names:{...e.names,...Object.fromEntries(s)}}},own:n,names:new Set(s.map(([e])=>e)),ordinary:a}}var Vn=e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)],Hn=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-|-$/gu,``);function Un(e,t,n,r=()=>!1){let i=t.sheets.find(e=>zn(e.name)===zn(n));if(!i)return{rows:new Map,cells:[],whole:!1,refused:`no-sheet`};let a=new Map,o=new Map;for(let e of Vn(i)){let n=t.csv[e];if(n===void 0)continue;let s=Hn(`${i.name} ${e.split(`/`).pop()??``}`).replace(/-csv$/u,``),c=`${ne}/${s}.csv`;for(let e=2;r(c)||a.has(c);e++)c=`${ne}/${s}-${String(e)}.csv`;o.set(e,c),a.set(c,sn(n).records.map(e=>e.end===e.start?[]:e.fields))}let s=e=>o.get(e)??e,c=structuredClone(i);for(let e of c.tables??[])e.rows=s(e.rows);for(let e of c.blocks??[])e.rows=s(e.rows);return{file:{...e.file,sheets:[...e.file.sheets,c]},rows:a,cells:[],whole:!0}}function Wn(e,t){return t(Gn(e,t))}function Gn(e,t){switch(e.kind){case`unary`:case`postfix`:case`paren`:{let n=Wn(e.arg,t);return n===e.arg?e:{...e,arg:n}}case`binary`:{let n=Wn(e.left,t),r=Wn(e.right,t);return n===e.left&&r===e.right?e:{...e,left:n,right:r}}case`call`:{let n=e.args.map(e=>Wn(e,t));return n.every((t,n)=>t===e.args[n])?e:{...e,args:n}}case`invoke`:{let n=Wn(e.callee,t),r=e.args.map(e=>Wn(e,t));return n===e.callee&&r.every((t,n)=>t===e.args[n])?e:{...e,callee:n,args:r}}case`array`:{let n=e.rows.map(e=>e.map(e=>Wn(e,t)));return n.every((t,n)=>t.every((t,r)=>t===e.rows[n]?.[r]))?e:{...e,rows:n}}default:return e}}function Kn(e,t){switch(t(e),e.kind){case`unary`:case`postfix`:case`paren`:Kn(e.arg,t);break;case`binary`:Kn(e.left,t),Kn(e.right,t);break;case`call`:for(let n of e.args)Kn(n,t);break;case`invoke`:Kn(e.callee,t);for(let n of e.args)Kn(n,t);break;case`array`:for(let n of e.rows)for(let e of n)Kn(e,t)}}function qn(e,t,n){if(e.abs||t===0)return e;let r=e.index+t;return r<0||r>=n?void 0:{...e,index:r}}function Jn(e,t,n){let r=e.col&&qn(e.col,n,16384),i=e.col2&&qn(e.col2,n,16384),a=e.row&&qn(e.row,t,1048576),o=e.row2&&qn(e.row2,t,1048576),s=(e,t)=>e!==void 0&&t===void 0;return s(e.col,r)||s(e.col2,i)||s(e.row,a)||s(e.row2,o)?{kind:`error`,code:`#REF!`,...e.sheet===void 0?{}:{sheet:e.sheet}}:r===e.col&&i===e.col2&&a===e.row&&o===e.row2?e:{...e,...r?{col:r}:{},...i?{col2:i}:{},...a?{row:a}:{},...o?{row2:o}:{}}}function Yn(e,t,n){return t===0&&n===0?e:Wn(e,e=>e.kind===`ref`?Jn(e,t,n):e)}function Xn(e,t,n){return JSON.stringify(e,(e,r)=>{let i=r;return(e===`col`||e===`col2`||e===`row`||e===`row2`)&&i?.abs===!1?[i.index-(e.startsWith(`col`)?n:t)]:r})}var Zn=[`#All`,`#Data`,`#Headers`,`#Totals`,`#This Row`],Qn=class extends Error{at;constructor(e,t){super(e),this.at=t}},$n=new Set([`=`,`<>`,`<`,`<=`,`>`,`>=`]),er={"=":1,"<>":1,"<":1,"<=":1,">":1,">=":1,"&":2,"+":3,"-":3,"*":4,"/":4,"^":5},tr=e=>e>=`0`&&e<=`9`,nr=e=>/[\p{L}_\\]/u.test(e)||e>=`\ud800`&&e<=`\udfff`,rr=e=>/[\p{L}\p{N}\p{M}_.?\\]/u.test(e)||e>=`\ud800`&&e<=`\udfff`,ir=(e,t)=>({index:e,abs:t}),ar=class{at=0;s;constructor(e){this.s=e}blanks(){let e=this.at;for(;/\s/u.test(this.s.charAt(this.at));)this.at+=1;return this.at>e}peek(e){return this.s.startsWith(e,this.at)}eat(e){return this.peek(e)?(this.at+=e.length,!0):!1}stop(e,t=this.at){throw new Qn(e,t)}parse(){this.eat(`=`),this.blanks(),this.at>=this.s.length&&this.stop(`a formula with nothing in it`);let e=this.expression(0);return this.blanks(),this.at<this.s.length&&this.stop(`"${this.s.charAt(this.at)}" where an operator should be`),e}operator(){this.blanks();let e=this.s.slice(this.at,this.at+2);if($n.has(e))return e;let t=this.s.charAt(this.at);return er[t]===void 0?void 0:t}expression(e){let t=this.prefix();for(;;){let n=this.operator();if(n===void 0)return t;let r=er[n]??0;if(r<=e)return t;this.at+=n.length,this.blanks();let i=this.expression(r);t={kind:`binary`,op:n,left:t,right:i}}}prefix(){this.blanks();for(let e of[`-`,`+`,`@`])if(this.eat(e))return{kind:`unary`,op:e,arg:this.prefix()};return this.postfix()}postfix(){let e=this.references();for(;;){let t=this.at;if(this.blanks(),this.eat(`%`))e={kind:`postfix`,op:`%`,arg:e};else if(this.at=t,this.peek(`#`)&&!sr(this.s,this.at))this.at+=1,e={kind:`postfix`,op:`#`,arg:e};else if(this.peek(`(`)&&(e.kind===`call`||e.kind===`paren`)){let{args:t}=this.call(``);e={kind:`invoke`,callee:e,args:t}}else return e}}references(){let e=this.primary();for(;;){if(this.peek(`:`)){this.at+=1,this.blanks();let t=this.primary();e={kind:`binary`,op:`:`,left:e,right:t};continue}let t=this.at;if(or(e)&&this.blanks()&&this.startsReference()){let t=this.primary();e={kind:`binary`,op:` `,left:e,right:t}}else return this.at=t,e}}startsReference(){let e=this.s.charAt(this.at);return e===`$`||e===`'`||e===`(`||e===`[`||nr(e)}primary(){this.blanks();let e=this.s.charAt(this.at);if(e===``&&this.stop(`the formula ends where a value should be`),e===`(`)return this.parenthesis();if(e===`{`)return this.arrayConstant();if(e===`"`)return{kind:`string`,value:this.text()};if(tr(e)||e===`.`){let e=dr(this.s,this.at);return e?(this.at=e.end,{kind:`ref`,...e.ref}):this.number()}return e===`#`?this.errorLiteral(void 0):e===`[`?this.bracket(void 0):e===`$`||e===`'`||nr(e)?this.word():this.stop(`"${e}" where a value should be`)}parenthesis(){let e=this.at;this.at+=1;let t=this.expression(0);for(this.blanks();this.eat(`,`);){let e=this.expression(0);t={kind:`binary`,op:`,`,left:t,right:e},this.blanks()}return this.eat(`)`)||this.stop(`a ( that is never closed`,e),{kind:`paren`,arg:t}}number(){let e=/^(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/u.exec(this.s.slice(this.at));return e?(this.at+=e[0].length,{kind:`number`,value:Number(e[0]),raw:e[0]}):this.stop(`a number that is not one`)}text(){let e=this.at;this.at+=1;let t=``;for(;;){this.at>=this.s.length&&this.stop(`a " that is never closed`,e);let n=this.s.charAt(this.at);if(n===`"`){if(this.s.charAt(this.at+1)!==`"`)return this.at+=1,t;this.at+=1}t+=n,this.at+=1}}errorLiteral(e){let t=sr(this.s,this.at);return t===void 0?this.stop(`a # that names no error`):(this.at+=t.length,{kind:`error`,code:t,...e===void 0?{}:{sheet:e}})}arrayConstant(){let e=this.at;this.at+=1;let t=[[]];for(;;)if(this.blanks(),t[t.length-1]?.push(this.arrayItem()),this.blanks(),!this.eat(`,`)){if(this.eat(`;`))t.push([]);else{if(this.eat(`}`))break;this.stop(`a { that is never closed`,e)}}let n=t[0]?.length;return t.some(e=>e.length!==n)&&this.stop(`an array whose rows are not all as long`,e),{kind:`array`,rows:t}}arrayItem(){let e=this.s.charAt(this.at);if(e===`"`)return{kind:`string`,value:this.text()};if(e===`#`)return this.errorLiteral(void 0);if(e===`-`||e===`+`)return this.at+=1,{kind:`unary`,op:e,arg:this.number()};if(tr(e)||e===`.`)return this.number();let t=this.name(),n=t.toUpperCase();return n===`TRUE`||n===`FALSE`?{kind:`boolean`,value:n===`TRUE`}:this.stop(`${t} in an array: an array holds only constants`)}name(){let e=this.at;for(;this.at<this.s.length&&rr(this.s.charAt(this.at));)this.at+=1;return this.s.slice(e,this.at)}quoted(){let e=this.at;this.at+=1;let t=``;for(;;){this.at>=this.s.length&&this.stop(`a ' that is never closed`,e);let n=this.s.charAt(this.at);if(n===`'`){if(this.s.charAt(this.at+1)!==`'`)return this.at+=1,t;this.at+=1}t+=n,this.at+=1}}word(){let e=this.sheetPrefix();if(e)return this.afterSheet(e.first,e.last);let t=dr(this.s,this.at);if(t)return this.at=t.end,{kind:`ref`,...t.ref};let n=lr(this.s,this.at);if(n)return this.at=n.end,{kind:`ref`,...n.ref};if(this.peek(`$`))return this.stop(`a "$" that is not part of a reference`);let r=this.at,i=this.name();if(i===``)return this.stop(`"${this.s.charAt(r)}" in a name`);if(this.peek(`(`))return this.call(i);if(this.peek(`[`))return this.bracket(i);let a=i.toUpperCase();return a===`TRUE`||a===`FALSE`?{kind:`boolean`,value:a===`TRUE`}:{kind:`name`,name:i}}sheetPrefix(){let e=this.at;if(this.peek(`'`)){let t=this.quoted();if(!this.eat(`!`)){this.at=e;return}let n=t.indexOf(`:`);return n>0?{first:t.slice(0,n),last:t.slice(n+1)}:{first:t}}let t=this.name();if(t!==``&&this.eat(`!`))return{first:t};if(t!==``&&this.eat(`:`)){let e=this.name();if(e!==``&&this.eat(`!`))return{first:t,last:e}}this.at=e}afterSheet(e,t){let n={sheet:e,...t===void 0?{}:{lastSheet:t}};if(this.peek(`#`))return this.errorLiteral(e);let r=dr(this.s,this.at);if(r)return this.at=r.end,{kind:`ref`,...n,...r.ref};let i=lr(this.s,this.at);if(i)return this.at=i.end,{kind:`ref`,...n,...i.ref};let a=this.name();return a===``?this.stop(`nothing after ${e}!`):{kind:`name`,name:a,sheet:e}}call(e){let t=this.at;this.at+=1;let n=[];this.blanks();let r=()=>({kind:`call`,name:e.toUpperCase(),written:e,args:n});if(this.eat(`)`))return r();for(;;)if(this.blanks(),this.peek(`,`)||this.peek(`)`)?n.push({kind:`missing`}):n.push(this.expression(0)),this.blanks(),!this.eat(`,`)){if(this.eat(`)`))return r();this.stop(`a ( of ${e.toUpperCase()} that is never closed`,t)}}columnName(){let e=``;for(;;){this.at>=this.s.length&&this.stop(`a [ that is never closed`);let t=this.s.charAt(this.at);if(t===`]`)return e;t===`[`&&this.stop(`a [ inside a column's name`),t===`'`?(this.at+=1,e+=this.s.charAt(this.at),this.at+=1):(e+=t,this.at+=1)}}bracket(e){let t=this.at;this.at+=1;let n={kind:`structured`,...e===void 0?{}:{table:e},sections:[],columns:[],thisRow:!1};if(this.eat(`]`))return n;if(!(this.peek(`[`)||this.peek(`#`)||this.peek(`@`))){let r=this.columnName();return this.at+=1,e===void 0&&/[!']/u.test(this.s.charAt(this.at))&&this.stop(`a formula that reaches into another workbook`,t),e===void 0&&nr(this.s.charAt(this.at))&&this.stop(`a formula that reaches into another workbook`,t),n.columns=[r.trim()],n}return this.eat(`@`)?(n.thisRow=!0,this.eat(`]`)||(this.peek(`[`)?this.items(n):n.columns=[this.columnName().trim()],this.eat(`]`)||this.stop(`a [ that is never closed`,t)),n):(this.items(n),this.eat(`]`)||this.stop(`a [ that is never closed`,t),n)}items(e){for(;;){if(this.blanks(),this.peek(`#`))this.section(e);else if(this.eat(`[`)){if(this.peek(`#`))this.section(e),this.eat(`]`)||this.stop(`a [ that is never closed`);else{let t=this.columnName().trim();this.at+=1,e.columns.push(t),this.eat(`:`)&&(this.eat(`[`)||this.stop(`a column's name after :`),e.columns.push(this.columnName().trim()),this.at+=1)}}else this.stop(`a column or a section of a table`);if(this.blanks(),!this.eat(`,`))return}}section(e){let t=this.s.slice(this.at).toLowerCase(),n=Zn.find(e=>t.startsWith(e.toLowerCase()));n===void 0&&this.stop(`a section of a table that is not one`),this.at+=n.length,n===`#This Row`?e.thisRow=!0:e.sections.push(n)}},or=e=>e.kind===`ref`||e.kind===`name`||e.kind===`structured`||e.kind===`call`||e.kind===`paren`||e.kind===`binary`&&(e.op===`:`||e.op===` `);function sr(e,t){let n=/^#[A-Za-z0-9_/]+[!?]?/u.exec(e.slice(t));return n?_n(n[0])?.code:void 0}var cr=(e,t)=>{let n=e.charAt(t);return n!==``&&(rr(n)||n===`(`||n===`!`||n===`[`)};function lr(e,t){let n=e.slice(t),r=/^(\$?)([A-Za-z]{1,3}):(\$?)([A-Za-z]{1,3})/u.exec(n);if(r){let n=t+r[0].length,i=Zt(r[2]??``),a=Zt(r[4]??``);if(i!==void 0&&a!==void 0&&!cr(e,n))return{ref:{col:ir(i,r[1]===`$`),col2:ir(a,r[3]===`$`),range:!0},end:n}}let i=/^(\$?)([A-Za-z]{1,3})(\$?)([1-9]\d*)/u.exec(n);if(!i)return;let a=ur(i),o=t+i[0].length;if(a&&!cr(e,o)){if(e.charAt(o)===`:`){let t=/^(\$?)([A-Za-z]{1,3})(\$?)([1-9]\d*)/u.exec(e.slice(o+1));if(t){let n=ur(t),r=o+1+t[0].length;if(n&&!cr(e,r))return{ref:{...a,col2:n.col,row2:n.row,range:!0},end:r}}}return{ref:{...a,range:!1},end:o}}}function ur(e){let t=Zt(e[2]??``),n=Number(e[4])-1;if(!(t===void 0||t>=16384||n>=1048576))return{col:ir(t,e[1]===`$`),row:ir(n,e[3]===`$`)}}function dr(e,t){let n=/^(\$?)([1-9]\d*):(\$?)([1-9]\d*)/u.exec(e.slice(t));if(!n)return;let r=t+n[0].length,i=Number(n[2])-1,a=Number(n[4])-1;if(!(i>=1048576||a>=1048576||cr(e,r)))return{ref:{row:ir(i,n[1]===`$`),row2:ir(a,n[3]===`$`),range:!0},end:r}}function fr(e){try{return{ok:!0,node:new ar(e).parse()}}catch(e){if(e instanceof Qn)return{ok:!1,error:{message:e.message,at:e.at}};throw e}}var pr=e=>`${e.abs?`$`:``}${Xt(e.index)}`,mr=e=>`${e.abs?`$`:``}${String(e.index+1)}`;function hr(e,t){let n=t===void 0?e:`${e}:${t}`;return/^[\p{L}_][\p{L}\p{N}_.]*$/u.test(e)&&!/^[A-Za-z]{1,3}\d+$/u.test(e)&&!/^(?:TRUE|FALSE)$/iu.test(e)&&(t===void 0||/^[\p{L}_][\p{L}\p{N}_.]*$/u.test(t))?`${n}!`:`'${n.replaceAll(`'`,`''`)}'!`}function gr(e){let t=e.sheet===void 0?``:hr(e.sheet,e.lastSheet);if(e.row===void 0&&e.col&&e.col2)return`${t}${pr(e.col)}:${pr(e.col2)}`;if(e.col===void 0&&e.row&&e.row2)return`${t}${mr(e.row)}:${mr(e.row2)}`;if(!e.col||!e.row)return`${t}#REF!`;let n=`${pr(e.col)}${mr(e.row)}`;return e.col2&&e.row2?`${t}${n}:${pr(e.col2)}${mr(e.row2)}`:`${t}${n}`}var _r=e=>e.replace(/([[\]#'@])/gu,`'$1`),vr=e=>/^[\p{L}\p{N}_]+$/u.test(e);function yr(e){let t=e.table??``,[n,r]=e.columns,i=e.columns.map(e=>`[${_r(e)}]`).join(`:`);if(e.sections.length===0)return e.thisRow?n===void 0?`${t}[@]`:r===void 0?`${t}[@${vr(n)?_r(n):i}]`:`${t}[@${i}]`:n===void 0?t===``?`[]`:t:r===void 0?`${t}[${_r(n)}]`:`${t}[${i}]`;if(n===void 0&&e.sections.length===1)return`${t}[${e.sections[0]??``}]`;let a=e.sections.map(e=>`[${e}]`);return i!==``&&a.push(i),`${t}[${a.join(`,`)}]`}function br(e){switch(e.kind){case`number`:return e.raw;case`string`:return`"${e.value.replaceAll(`"`,`""`)}"`;case`boolean`:return e.value?`TRUE`:`FALSE`;case`error`:return`${e.sheet===void 0?``:hr(e.sheet)}${e.code}`;case`missing`:return``;case`ref`:return gr(e);case`structured`:return yr(e);case`name`:return`${e.sheet===void 0?``:hr(e.sheet)}${e.name}`;case`unary`:return`${e.op}${br(e.arg)}`;case`postfix`:return`${br(e.arg)}${e.op}`;case`binary`:return`${br(e.left)}${e.op}${br(e.right)}`;case`call`:return`${e.written}(${e.args.map(br).join(`,`)})`;case`invoke`:return`${br(e.callee)}(${e.args.map(br).join(`,`)})`;case`array`:return`{${e.rows.map(e=>e.map(br).join(`,`)).join(`;`)}}`;case`paren`:return`(${br(e.arg)})`}}var xr=e=>`=${br(e)}`,Sr=class{node;error;analysis;text;row;col;source;constructor(e,t,n,r){this.text=e,this.row=t,this.col=n,this.source=r;let i=fr(e);i.ok?this.node=i.node:this.error=i.error}},Cr=class{value=null;array;spill;blocked;state=1;mark=0;shared;sheet;row;col;constructor(e,t,n,r){this.shared=e,this.sheet=t,this.row=n,this.col=r}get moved(){let{node:e,row:t,col:n}=this.shared;if(!e)throw Error(`${this.shared.text} does not parse.`);return Yn(e,this.row-t,this.col-n)}get text(){let{node:e,text:t,row:n,col:r}=this.shared;return!e||n===this.row&&r===this.col?t:xr(this.moved)}},wr=class{columns=[];firsts=[];lasts=[];formulas=[];get(e,t){return this.columns[t]?.[e]}set(e,t,n){let r=this.columns[t];r||(r=[],this.columns[t]=r,this.firsts[t]=e,this.lasts[t]=e),r[e]instanceof Cr&&(this.formulas[t]=(this.formulas[t]??1)-1),n instanceof Cr&&(this.formulas[t]=(this.formulas[t]??0)+1),r[e]=n,e<(this.firsts[t]??e)&&(this.firsts[t]=e),e>(this.lasts[t]??e)&&(this.lasts[t]=e)}get width(){return this.columns.length}holds(e,t,n){let r=Math.min(e.right,this.columns.length-1);for(let i=e.left;i<=r;i++){let r=this.columns[i];if(!r)continue;let a=Math.min(e.bottom,this.last(i));for(let o=Math.max(e.top,this.first(i));o<=a;o++)if(r[o]!==void 0&&(o!==t||i!==n))return!0}return!1}first(e){return this.firsts[e]??1/0}last(e){return this.lasts[e]??-1}hasFormulas(e){return(this.formulas[e]??0)>0}},Tr=class{columns=[];rows=0;lines=[];places=[];records=[];name;sheet;at;file;spec;constructor(e,t,n,r,i){this.name=e,this.sheet=t,this.at=n,this.file=r,this.spec=i}get area(){return{top:this.at.row,left:this.at.col,bottom:this.at.row+this.rows,right:this.at.col+Math.max(this.columns.length,1)-1}}get data(){let e=this.area;return{...e,top:e.top+1}}column(e){let t=e.toLowerCase();return this.columns.find(e=>e.name.toLowerCase()===t)}},Er=(e,t)=>e*16384+t;function Dr(e,t){e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right);for(let n=t.left;n<=t.right;n++){let r=e.columns.get(n);e.columns.set(n,[Math.min(r?.[0]??t.top,t.top),Math.max(r?.[1]??t.bottom,t.bottom)])}}var Or=class{tables=[];blocks=[];merges=[];formulas=new Set;implied=new Map;keys=new Map;fills=[];blanks=new Set;conditions=[];validations=[];filters=[];charts=[];freeze;generated=!1;grid=new wr;expanded=!1;lowest=-1;ghosts=new Map;spills=new Set;stopped=new Set;reach;lookAreas;name;index;spec;constructor(e,t,n){this.name=e,this.index=t,this.spec=n}respec(e){let t=e.charts!==this.spec.charts;this.spec=e,this.lookAreas=void 0,t&&(this.charts.length=0,e.charts?.forEach((e,t)=>{let n=Rr(e,t,[],()=>void 0);n&&this.charts.push(n)}))}put(e,t,n){n instanceof Cr&&this.formulas.add(n),this.grid.set(e,t,n),e>this.lowest&&(this.lowest=e)}replace(e,t,n){this.expand();let r=this.grid.get(e,t);r instanceof Cr&&this.formulas.delete(r),n instanceof Cr&&this.formulas.add(n),this.grid.set(e,t,n),e>this.lowest&&(this.lowest=e)}expand(){if(!this.expanded){this.expanded=!0;for(let e=this.fills.length-1;e>=0;e--){let t=this.fills[e];if(!t)continue;let{area:n,shared:r,value:i,format:a}=t;for(let e=n.top;e<=n.bottom;e++)for(let t=n.left;t<=n.right;t++)this.grid.get(e,t)===void 0&&(this.blanks.has(Er(e,t))||(r?this.put(e,t,new Cr(r,this,e,t)):i!=null&&(this.put(e,t,i),a!==void 0&&this.implied.set(Er(e,t),a))))}}}at(e,t){return this.expand(),this.grid.get(e,t)}spillAt(e,t){return this.ghosts.size===0?void 0:this.ghosts.get(Er(e,t))}holds(e,t){return this.expand(),this.grid.holds(e,t.row,t.col)}spillsIn(e){if(this.spills.size===0)return[];if((e.bottom-e.top+1)*(e.right-e.left+1)>=this.spills.size)return[...this.spills].filter(t=>t.spill!==void 0&&an(t.spill,e));let t=new Set;for(let n=e.top;n<=e.bottom;n++)for(let r=e.left;r<=e.right;r++){let e=this.ghosts.get(Er(n,r));e&&t.add(e)}return[...t]}blockedBy(e){if(this.stopped.size===0)return[];let t=[];for(let n of this.stopped)n.blocked&&an(n.blocked,e)&&t.push(n);return t}placeSpill(e,t){e.spill=t,this.spills.add(e);for(let n=t.top;n<=t.bottom;n++)for(let r=t.left;r<=t.right;r++)(n!==e.row||r!==e.col)&&this.ghosts.set(Er(n,r),e);this.reach&&Dr(this.reach,t)}blockSpill(e,t){e.blocked=t,this.stopped.add(e)}clearSpill(e){let t=e.spill;if(t)for(let n=t.top;n<=t.bottom;n++)for(let r=t.left;r<=t.right;r++)this.ghosts.get(Er(n,r))===e&&this.ghosts.delete(Er(n,r));e.spill=void 0,e.blocked=void 0,this.spills.delete(e),this.stopped.delete(e)}clearSpills(){for(let e of[...this.spills,...this.stopped])e.spill=void 0,e.blocked=void 0;this.spills.clear(),this.stopped.clear(),this.ghosts.clear(),this.reach=void 0}tighten(){this.reach=void 0}spillReach(){if(this.reach)return this.reach;let e={columns:new Map,bottom:-1,right:-1};for(let{spill:t}of this.spills)t&&Dr(e,t);return this.reach=e,e}hasFormulas(e){return this.expand(),this.grid.hasFormulas(e)}span(e,t,n){this.expand();let r=this.grid.first(e),i=this.grid.last(e);if(this.spills.size===0)return[Math.max(t,r),Math.min(n,i)];let[a,o]=this.spillReach().columns.get(e)??[1/0,-1];return[Math.max(t,Math.min(r,a)),Math.min(n,Math.max(i,o))]}get columnsUsed(){return this.expand(),this.spills.size===0?this.grid.width:Math.max(this.grid.width,this.spillReach().right+1)}get lastRow(){return this.expand(),this.spills.size===0?this.lowest:Math.max(this.lowest,this.spillReach().bottom)}get used(){let e=this.lastRow,t=this.columnsUsed-1;return e<0||t<0?void 0:{top:0,left:0,bottom:e,right:t}}tableAt(e,t){return this.tables.find(n=>rn(n.area,e,t))}blockAt(e,t){return this.blocks.find(n=>rn(n.area,e,t))}looks(){if(this.lookAreas)return this.lookAreas;let e=[];for(let t of this.spec.format??[]){let n=tn(t.range);n&&e.push({area:n,entry:t})}let t=[];for(let[e,n]of Object.entries(this.spec.cells??{})){if(!e.includes(`:`)||typeof n!=`object`||!n)continue;let r=tn(e);r&&t.push({area:r,entry:n})}return this.lookAreas={formats:e,ranges:t},this.lookAreas}styledAreas(){let{formats:e,ranges:t}=this.looks();return[...e,...t.filter(e=>Object.keys(e.entry).some(e=>jr.has(e)))]}lookAt(e,t){let n={},r=e=>{if(e)for(let[t,r]of Object.entries(e))jr.has(t)&&r!==void 0&&(n[t]=t===`border`?{...n.border,...r}:r)},i=this.implied.get(Er(e,t));i!==void 0&&(n.format=i);let a=this.ghosts.size===0?void 0:this.spillAt(e,t),o=a&&this.lookAt(a.row,a.col).format;o!==void 0&&(n.format=o),this.spec.columns&&r(this.spec.columns[Xt(t)]),this.spec.rows&&r(this.spec.rows[String(e+1)]);let s=this.tableAt(e,t);s&&e>s.at.row&&r(s.columns[t-s.at.col]?.spec);let{formats:c,ranges:l}=this.looks();for(let n of c)rn(n.area,e,t)&&r(n.entry);for(let n of l)rn(n.area,e,t)&&r(n.entry);let u=this.keys.get(Er(e,t)),d=u===void 0?void 0:this.spec.cells?.[u];if(typeof d==`object`&&d&&r(d),n.border){let e=Object.entries(n.border).filter(([,e])=>e?.style!==`none`);e.length===0?delete n.border:n.border=Object.fromEntries(e)}return n}mergeAt(e,t){return this.merges.find(n=>rn(n,e,t))}validationAt(e,t){return this.validations.find(n=>n.areas.some(n=>rn(n,e,t)))}filterHeadAt(e,t){return this.filters.find(n=>e===n.area.top&&t>=n.area.left&&t<=n.area.right)}filterAt(e,t){return this.filters.find(n=>rn(n.area,e,t))}filesAt(e,t){let n=this.tableAt(e,t);if(n&&e>n.at.row){let e=n.columns[t-n.at.col]?.spec?.files;if(e!==void 0)return e}return n?.at.row===e?void 0:this.spec.columns?.[Xt(t)]?.files}},kr=e=>(typeof e==`object`?e.separator:void 0)??`, `;function Ar(e,t){let n=kr(t);return e.split(n.trim()===``?n:n.trim()).map(e=>e.trim()).filter(e=>e!==``)}var jr=new Set([`bold`,`italic`,`underline`,`strike`,`font`,`size`,`color`,`fill`,`align`,`valign`,`wrap`,`shrink`,`indent`,`rotation`,`border`,`format`]),Mr=class{title;sheets=[];names=new Map;checks=[];bySheet=new Map;byTable=new Map;file;generated;ordinary=[];constructor(e,t){this.file=e,this.title=e.title,this.generated=t}respec(e){this.file=Bn(e,this.generated).file,this.title=e.title,this.sheets.forEach(t=>{let n=e.sheets.find(e=>e.name===t.name);n&&t.respec(n)})}sheet(e){return this.bySheet.get(e.toLowerCase())}table(e){return this.byTable.get(e.toLowerCase())}name(e){return this.names.get(e.toLowerCase())}get tables(){return[...this.byTable.values()]}addSheet(e){this.sheets.push(e),this.bySheet.set(e.name.toLowerCase(),e)}addTable(e){e.sheet.tables.push(e),this.byTable.set(e.name.toLowerCase(),e)}sourceOf(e,t,n){if(e.generated)return{file:_};let r=this.sheets.indexOf(e),i=e.tableAt(t,n);if(i){let e=i.columns[n-i.at.col],r=t-i.at.row-1,a=e?.csv!==void 0&&(i.records[r]?.[e.csv]??``)!==``;return r>=0&&e?.formula&&!a?e.formula.source:{file:i.file,line:r<0?1:i.lines[r]??1}}let a=e.blockAt(t,n);if(a)return{file:a.file,line:a.lines[t-a.area.top]??1};let o=e.keys.get(Er(t,n));if(o!==void 0)return{file:In,path:[`sheets`,r,`cells`,o]};for(let i of Object.keys(e.spec.cells??{})){if(!i.includes(`:`))continue;let e=tn(i);if(e&&rn(e,t,n))return{file:In,path:[`sheets`,r,`cells`,i]}}}},Nr=/^[\p{L}_\\][\p{L}\p{N}_.\\?]*$/u;function Pr(e){return Nr.test(e)&&en(e)===void 0&&!/^(?:TRUE|FALSE)$/iu.test(e)&&!/^[Rr](?:\d+)?(?:[Cc]\d*)?$/u.test(e)&&!/^[Cc]\d*$/u.test(e)}var Fr=`made`,Ir=e=>e[0]===Fr?_:In,Lr=class{problems=[];wb;read_;lineOf;own;madeNames;constructor(e,t,n,r,i){this.wb=e,this.read_=t,this.lineOf=n,this.own=r,this.madeNames=i}yaml(e,t){let n=this.lineOf(e);this.problems.push({file:Ir(e),...n===void 0?{}:{line:n},message:t})}sheetPath(e){return e<this.own?[`sheets`,e]:[Fr,`sheets`,e-this.own]}read(){let{file:e}=this.wb;e.sheets.forEach((e,t)=>{let n=this.sheetPath(t);if(this.wb.sheet(e.name)){this.yaml([...n,`name`],`two sheets are named ${e.name}`);return}(/[\\/?*[\]:]/u.test(e.name)||e.name.length>31)&&this.yaml([...n,`name`],`${e.name} cannot be a sheet's name: at most 31 characters, none of \\ / ? * [ ] :`);let r=new Or(e.name,this.wb.sheets.length,e);r.generated=t>=this.own,this.wb.addSheet(r)}),this.names();for(let[t,n]of e.sheets.entries()){let e=this.wb.sheets[t];e?.spec===n&&this.sheet(e,this.sheetPath(t))}e.checks?.forEach((e,t)=>{let n={file:In,path:[`checks`,t,`formula`]};this.wb.checks.push({name:e.name,formula:new Sr(e.formula,0,0,n),source:n})})}names(){for(let[e,t]of Object.entries(this.wb.file.names??{})){let n=this.madeNames.has(e)?[Fr,`names`,e]:[`names`,e];if(!Pr(e)){this.yaml(n,`${e} cannot be a name`);continue}let r={file:Ir(n),path:n},i=typeof t==`string`&&t.startsWith(`=`)?{name:e,formula:new Sr(t,0,0,r),source:r}:{name:e,value:typeof t==`string`?Pn(t).value:t,source:r};this.wb.names.set(e.toLowerCase(),i)}}sheet(e,t){let{spec:n}=e;if(n.freeze!==void 0){let r=en(n.freeze);r?e.freeze=r:this.yaml([...t,`freeze`],`${n.freeze} is not a cell`)}n.tables?.forEach((n,r)=>{this.table(e,n,[...t,`tables`,r])});for(let[t,n]of e.tables.entries())for(let r of e.tables.slice(t+1))an(n.area,r.area)&&this.problems.push({file:In,message:`tables ${n.name} and ${r.name} overlap on ${e.name}`});n.blocks?.forEach((n,r)=>{this.block(e,n.at,n.rows,[...t,`blocks`,r])}),this.cells(e,n.cells??{},[...t,`cells`]),n.merges?.forEach((n,r)=>{let i=tn(n);i?e.merges.push(i):this.yaml([...t,`merges`,r],`${n} is not a range`)}),n.format?.forEach((e,n)=>{tn(e.range)||this.yaml([...t,`format`,n,`range`],`${e.range} is not a range`)}),n.conditional?.forEach((n,r)=>{this.condition(e,n,[...t,`conditional`,r])}),n.validations?.forEach((n,r)=>{this.validation(e,n,[...t,`validations`,r])}),this.filters(e,t),n.charts?.forEach((n,r)=>{this.chart(e,n,r,[...t,`charts`,r])});for(let e of Object.keys(n.columns??{}))Zt(e)===void 0&&this.yaml([...t,`columns`,e],`${e} is not a column`);for(let e of Object.keys(n.rows??{}))(!/^[1-9]\d*$/u.test(e)||Number(e)>1048576)&&this.yaml([...t,`rows`,e],`${e} is not a row`)}chart(e,t,n,r){let i=Rr(t,n,r,(e,t)=>{this.yaml(e,t)});i&&e.charts.push(i)}bound(e,t,n){if(!(typeof e!=`string`||!e.startsWith(`=`)||e.length<2))return new Sr(e,t?.top??0,t?.left??0,{file:Ir(n),path:n})}condition(e,t,n){let r=nn(t.range);if(!r){this.yaml([...n,`range`],`${t.range} is not a range`);return}let[i]=r,a=[],o=(e,t)=>{let n=this.bound(e,i,t);n&&a.push(n)};if(t.type===`expression`&&o(t.formula.startsWith(`=`)?t.formula:`=${t.formula}`,[...n,`formula`]),t.type===`cellIs`&&t.formula.forEach((e,t)=>{o(e,[...n,`formula`,t])}),t.type===`dataBar`)for(let e of[`min`,`max`])o(t[e]?.value,[...n,e,`value`]);(t.type===`colorScale`||t.type===`iconSet`)&&t.stops?.forEach((e,t)=>{o(e.value,[...n,`stops`,t,`value`])}),e.conditions.push({spec:t,areas:r,formulas:a})}validation(e,t,n){let r=nn(t.range);if(!r){this.yaml([...n,`range`],`${t.range} is not a range`);return}let i=(t.formula??[]).map((e,t)=>this.bound(e,r[0],[...n,`formula`,t])),a=t.formula?.length??0,o=t.type!==`list`&&t.type!==`custom`&&(t.operator===void 0||t.operator===`between`||t.operator===`notBetween`);(t.type!==`list`||t.values===void 0)&&a<(o?2:1)&&this.yaml(n,`a ${t.type} validation needs its bounds`),e.validations.push({spec:t,areas:r,formulas:i})}filters(e,t){let{spec:n}=e;if(n.filter){let r=[...t,`filter`],i=tn(n.filter.range);if(!i)this.yaml([...r,`range`],`${n.filter.range} is not a range`);else{let t=new Map;for(let[e,a]of Object.entries(n.filter.columns??{})){let o=Zt(e);o===void 0||o<i.left||o>i.right?this.yaml([...r,`columns`,e],`${e} is not a column of ${n.filter.range}`):t.set(o,a)}let a=e.tables.find(e=>an(e.area,i));a&&this.yaml(r,`a filter over table ${a.name}: a table has its own`),e.filters.push({area:i,columns:t})}}e.tables.forEach((n,r)=>{let{filter:i}=n.spec;if(i===!1)return;let a=new Map;for(let[e,o]of Object.entries(i?.columns??{})){let i=n.column(e);i?a.set(n.at.col+i.index,o):this.yaml([...t,`tables`,r,`filter`,`columns`,e],`table ${n.name} has no column ${e}`)}e.filters.push({area:n.area,table:n,columns:a})})}csv(e,t,n){let r=this.read_(e);return r||this.yaml(t,`${n}: ${e} is not there`),r}overlapping(e,t){let n=e.tables.find(e=>an(e.area,t));if(n)return`table ${n.name}`;let r=e.blocks.find(e=>an(e.area,t));return r?`the block of ${r.file}`:void 0}typed(e,t,n,r,i){if(r.formula!==void 0){let a=new Sr(r.formula,t,n,i);e.put(t,n,new Cr(a,e,t,n))}else r.value!==null&&(e.put(t,n,r.value),r.format!==void 0&&e.implied.set(Er(t,n),r.format))}table(e,t,n){let r=en(t.at);if(!r){this.yaml([...n,`at`],`${t.at} is not a cell`);return}if(!Pr(t.name)){this.yaml([...n,`name`],`${t.name} cannot be a table's name`);return}if(this.wb.table(t.name)){this.yaml([...n,`name`],`two tables are named ${t.name}`);return}this.wb.name(t.name)&&this.yaml([...n,`name`],`${t.name} is a defined name and a table's`);let i=new Tr(t.name,e,r,t.rows,t),a=this.csv(t.rows,[...n,`rows`],`table ${t.name}`),o=a?.rows??[],s=a?.lines??[],c=o[0],l=s[0]??1,u=new Set,d=c?.length===0?[``]:c??[];d.forEach((e,n)=>{let r=e.trim();r===``&&this.problems.push({file:t.rows,line:l,message:`column ${String(n+1)} has no name`}),u.has(r.toLowerCase())&&this.problems.push({file:t.rows,line:l,message:`two columns are named ${r}`}),u.add(r.toLowerCase()),i.columns.push({name:r,index:i.columns.length,csv:n})});for(let[e,r]of Object.entries(t.columns??{})){let a=i.column(e),o=a??{name:e,index:i.columns.length};a||(r.formula===void 0&&this.yaml([...n,`columns`,e],`table ${t.name} has no column ${e}`),i.columns.push(o)),o.spec=r}let f=d.length;for(let e=1;e<o.length;e++){let n=o[e];if(!n||n.length===0)continue;let r=s[e]??e+1;i.places.push(e),i.records.push(n),i.lines.push(r),n.length>f&&this.problems.push({file:t.rows,line:r,message:`this row has ${String(n.length)} fields and the header ${String(f)}`})}i.rows=i.records.length;let p=this.overlapping(e,i.area);p&&this.yaml(n,`table ${t.name} overlaps ${p} on ${e.name}`),this.wb.addTable(i),this.tableKey(i,n);let m=r.row+1;i.columns.forEach(a=>{let o=r.col+a.index;e.put(r.row,o,a.name);let s=a.spec?.formula;s!==void 0&&(a.formula=new Sr(s,m,o,{file:Ir(n),path:[...n,`columns`,a.name,`formula`]}),i.rows>0&&e.fills.push({area:{top:m,left:o,bottom:m+i.rows-1,right:o},shared:a.formula})),a.csv!==void 0&&i.records.forEach((n,r)=>{this.typed(e,m+r,o,Pn(n[a.csv??0]??``),{file:t.rows,line:i.lines[r]??1})})})}tableKey(e,t){let{key:n}=e.spec;if(n===void 0)return;let r=e.column(n);if(r?.csv===void 0){this.yaml([...t,`key`],`table ${e.name} has no column ${n} in ${e.file}`);return}let i=new Set;e.records.forEach((t,a)=>{let o=t[r.csv??0]??``,s=e.lines[a]??1;o===``?this.problems.push({file:e.file,line:s,message:`this row has no ${n}, table ${e.name}'s key`}):i.has(o)&&this.problems.push({file:e.file,line:s,message:`two rows have the key ${o}`}),i.add(o)})}block(e,t,n,r){let i=en(t);if(!i){this.yaml([...r,`at`],`${t} is not a cell`);return}let a=this.csv(n,[...r,`rows`],`a block`);if(!a)return;let o=a.rows,s=o.map((e,t)=>a.lines[t]??t+1),c=o.reduce((e,t)=>Math.max(e,t.length),1),l={top:i.row,left:i.col,bottom:i.row+Math.max(o.length,1)-1,right:i.col+c-1},u=this.overlapping(e,l);u&&this.yaml(r,`the block of ${n} overlaps ${u} on ${e.name}`),e.blocks.push({area:l,file:n,lines:s}),o.forEach((t,r)=>{t.forEach((t,a)=>{this.typed(e,i.row+r,i.col+a,Pn(t),{file:n,line:s[r]??r+1})})})}cells(e,t,n){let r=[];for(let[i,a]of Object.entries(t)){let t=[...n,i],o=tn(i);if(!o){this.yaml(t,`${i} is not a cell or a range`);continue}let s=this.overlapping(e,o);if(s&&this.yaml(t,`${i} overlaps ${s}`),i.includes(`:`)){let n=(o.bottom-o.top+1)*(o.right-o.left+1);n>5e6?this.yaml(t,`${i} is ${String(n)} cells`):this.fill(e,o,a,t)}else r.push([i,a,{row:o.top,col:o.left}])}for(let[t,i,a]of r){let r=[...n,t],o=Vr(i),s=Er(a.row,a.col);e.keys.set(s,t),o.value===null&&o.formula===void 0&&e.blanks.add(s),this.typed(e,a.row,a.col,o,{file:Ir(r),path:r});let c=typeof i==`object`&&i?i.name:void 0;c!==void 0&&this.cellName(e,a,c,r)}}cellName(e,t,n,r){if(!Pr(n)){this.yaml(r,`${n} cannot be a name`);return}if(this.wb.name(n)){this.yaml(r,`two places are named ${n}`);return}let i={file:Ir(r),path:r},a=Qt(t).replace(/^([A-Z]+)(\d+)$/u,`$$$1$$$2`),o=`='${e.name.replaceAll(`'`,`''`)}'!${a}`;this.wb.names.set(n.toLowerCase(),{name:n,formula:new Sr(o,0,0,i),source:i})}fill(e,t,n,r){let i=Vr(n),a={file:Ir(r),path:r};e.fills.push(i.formula===void 0?{area:t,value:i.value,...i.format===void 0?{}:{format:i.format}}:{area:t,shared:new Sr(i.formula,t.top,t.left,a)})}};function Rr(e,t,n,r){let i=en(e.at);if(!i){r([...n,`at`],`${e.at} is not a cell`);return}let a=(e,t)=>{let n=new Sr(zr(e),0,0,{file:Ir(t),path:t});return n.node&&!Br(n.node)&&r(t,`${e} is not a range or a table's column`),n},o=(e,t)=>e?.startsWith(`=`)===!0?a(e,t):void 0,s=o(e.title,[...n,`title`]);return{spec:e,at:i,index:t,...e.categories===void 0?{}:{categories:a(e.categories,[...n,`categories`])},...s?{title:s}:{},series:e.series.map((e,t)=>{let r=[...n,`series`,t],i=o(e.name,[...r,`name`]);return{values:a(e.values,[...r,`values`]),...e.x===void 0?{}:{x:a(e.x,[...r,`x`])},...i?{name:i}:{}}})}}var zr=e=>e.startsWith(`=`)?e:`=${e}`;function Br(e){switch(e.kind){case`error`:case`ref`:case`structured`:case`name`:return!0;case`paren`:case`postfix`:return Br(e.arg);case`binary`:return e.op===`:`||e.op===`,`;default:return!1}}function Vr(e){if(e===null)return{value:null};if(typeof e==`string`)return Pn(e);if(typeof e!=`object`)return{value:e};if(e.formula!==void 0)return{value:null,formula:e.formula.startsWith(`=`)?e.formula:`=${e.formula}`};let{value:t}=e;return typeof t==`string`?Pn(t):{value:t??null}}function Hr(e){let t=Bn(e.file,e.generated),n=new Mr(t.file,e.generated);return n.ordinary=t.ordinary,new Lr(n,t=>{let n=e.generated?.csv[t];if(n!==void 0)return{rows:sn(n).records.map(e=>e.end===e.start?[]:e.fields),lines:[]};let r=e.rows(t);return r&&{rows:r,lines:[]}},()=>void 0,t.own,t.names).read(),n}function Ur(e,t){let n=t.formula?.text;if(n===void 0)return;let r=fr(n);if(!r.ok||r.node.kind!==`ref`)return;let i=r.node;if(i.range||!i.col||!i.row||i.lastSheet!==void 0)return;let a=i.sheet===void 0?e.sheets[0]:e.sheet(i.sheet);return a&&{sheet:a,row:i.row.index,col:i.col.index}}var Wr=e=>typeof e==`string`?Pn(e):{value:e??null};function Gr(e,t){let n=e.file.scenarios?.[t];if(!n)return!1;for(let[t,r]of Object.entries(n)){let n=e.name(t);if(!n)continue;let i=Wr(r),a=Ur(e,n);i.formula===void 0?a?a.sheet.replace(a.row,a.col,i.value??void 0):(n.value=i.value,delete n.formula):(n.formula=new Sr(i.formula,0,0,n.source),delete n.value)}return!0}var Kr=/\.(?:png|jpe?g|gif|webp|bmp|svg)$/iu,qr=e=>Kr.test(e),Jr=e=>(typeof e==`object`?e.height:void 0)??60;function Yr(e){return Object.values(e.spec.columns??{}).some(e=>e.files!==void 0)||e.tables.some(e=>e.columns.some(e=>e.spec?.files))}function Xr(e,t){if(!Yr(e))return[];let n=[],r=(r,i,a)=>{let o=t.value(e,r,i);if(typeof o!=`string`)return;let s=Ar(o,a);s.length>0&&n.push({row:r,col:i,paths:s,column:a})},i=(t,n)=>e.tableAt(t,n)!==void 0;for(let[t,n]of Object.entries(e.spec.columns??{})){let a=Zt(t);if(a===void 0||n.files===void 0)continue;let[o,s]=e.span(a,0,e.lastRow);for(let e=o;e<=s;e++)i(e,a)||r(e,a,n.files)}for(let t of e.tables)for(let n of t.columns){let i=t.at.col+n.index,a=n.spec?.files??e.spec.columns?.[Xt(i)]?.files;if(a!==void 0)for(let e=t.data.top;e<=t.data.bottom;e++)r(e,i,a)}return n}var Zr=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),Qr=(e,t,n)=>e.index>=t?{...e,index:e.index+n}:e;function $r(e,t,n){if(e.index<t)return e;if(e.index>=t+n)return{...e,index:e.index-n}}function ei(e,t,n,r){let i=e.index<=t.index?e:t,a=i===e?t:e,o=Qr(i,n,r),s=a.index>=n?{...a,index:a.index+r}:a;return i===e?[o,s]:[s,o]}function ti(e,t,n,r){let i=e.index<=t.index?e:t,a=i===e?t:e,o=n+r-1;if(i.index>=n&&a.index<=o)return;let s=i.index<n?i:i.index>o?{...i,index:i.index-r}:{...i,index:n},c=a.index<n?a:a.index>o?{...a,index:a.index-r}:{...a,index:n-1};return i===e?[s,c]:[c,s]}function ni(e){return{kind:`error`,code:`#REF!`,...e.sheet===void 0?{}:{sheet:e.sheet}}}var ri={kind:`error`,code:`#REF!`};function ii(e,t,n){if(!Zr(e.sheet??n,t.sheet)||e.lastSheet!==void 0)return e;let{col:r,row:i}=e;if(r===void 0||i===void 0)return e;let a=e.col2??r,o=e.row2??i,{area:s,rows:c,columns:l,to:u}=t;if(!(Math.min(r.index,a.index)>=s.left&&Math.max(r.index,a.index)<=s.right&&Math.min(i.index,o.index)>=s.top&&Math.max(i.index,o.index)<=s.bottom))return e;let d=(e,t)=>({...e,index:e.index+t}),f={...e,col:d(r,l),row:d(i,c),...e.col2?{col2:d(e.col2,l)}:{},...e.row2?{row2:d(e.row2,c)}:{}};return u===void 0?f:Zr(u,n)?Object.fromEntries(Object.entries(f).filter(([e])=>e!==`sheet`)):{...f,sheet:u}}function ai(e,t,n){if(!Zr(e.sheet??n,t.sheet)||e.lastSheet!==void 0)return e;let r=t.op===`insert-rows`||t.op===`delete-rows`,i=r?e.row:e.col,a=r?e.row2:e.col2;if(i===void 0)return e;let o=r?[`row`,`row2`]:[`col`,`col2`],s=t.op===`insert-rows`||t.op===`insert-columns`,c=r?Jt:Yt;if(a===void 0){let n=s?Qr(i,t.at,t.count):$r(i,t.at,t.count);return!n||n.index>=c?ni(e):n===i?e:{...e,[o[0]]:n}}let l=s?ei(i,a,t.at,t.count):ti(i,a,t.at,t.count);return!l||l[0].index>=c||l[1].index>=c?ni(e):l[0]===i&&l[1]===a?e:{...e,[o[0]]:l[0],[o[1]]:l[1]}}function oi(e,t,n,r){let i=(e,t)=>e===void 0?r===void 0||Zr(r,t):Zr(e,t);return Wn(e,e=>{switch(t.op){case`rename-sheet`:return(e.kind===`ref`||e.kind===`name`||e.kind===`error`)&&Zr(e.sheet,t.from)?{...e,sheet:t.to}:e.kind===`ref`&&Zr(e.lastSheet,t.from)?{...e,lastSheet:t.to}:e;case`rename-table`:return e.kind===`structured`&&Zr(e.table,t.from)?{...e,table:t.to}:e;case`delete-sheet`:return e.kind===`ref`&&Zr(e.sheet,t.name)||e.kind===`ref`&&Zr(e.lastSheet,t.name)?ni(e):e.kind===`name`&&Zr(e.sheet,t.name)?ri:e;case`delete-table`:return e.kind===`structured`&&Zr(e.table,t.name)||e.kind===`name`&&Zr(e.name,t.name)?ri:e;case`delete-column`:return e.kind===`structured`&&i(e.table,t.table)&&e.columns.some(e=>Zr(e,t.name))?ri:e;case`rename-column`:return e.kind===`structured`&&i(e.table,t.table)&&e.columns.some(e=>Zr(e,t.from))?{...e,columns:e.columns.map(e=>Zr(e,t.from)?t.to:e)}:e;case`rename-name`:return e.kind===`name`&&Zr(e.name,t.from)?{...e,name:t.to}:e.kind===`call`&&Zr(e.name,t.from)?{...e,name:t.to.toUpperCase(),written:t.to}:e;case`move-cells`:return e.kind===`ref`?ii(e,t,n):e;default:return e.kind===`ref`?ai(e,t,n):e}})}var si=Object.freeze({1078:`af`,1052:`sq`,1118:`am`,5121:`ar-DZ`,15361:`ar-BH`,3073:`ar-EG`,2049:`ar-IQ`,11265:`ar-JO`,13313:`ar-KW`,12289:`ar-LB`,4097:`ar-LY`,6145:`ar-MA`,8193:`ar-OM`,16385:`ar-QA`,1025:`ar-SA`,10241:`ar-SY`,7169:`ar-TN`,14337:`ar-AE`,9217:`ar-YE`,1067:`hy`,1101:`as`,2092:`az-AZ`,1068:`az-AZ`,1069:`eu`,1059:`be`,2117:`bn`,1093:`bn-IN`,5146:`bs`,1026:`bg`,1109:`my`,1027:`ca`,2052:`zh-CN`,3076:`zh-HK`,5124:`zh-MO`,4100:`zh-SG`,1028:`zh-TW`,1050:`hr`,1029:`cs`,1030:`da`,1125:`dv`,2067:`nl-BE`,1043:`nl-NL`,1126:`bin`,3081:`en-AU`,10249:`en-BZ`,4105:`en-CA`,9225:`en-CB`,2057:`en-GB`,16393:`en-IN`,6153:`en-IE`,8201:`en-JM`,5129:`en-NZ`,13321:`en-PH`,7177:`en-ZA`,11273:`en-TT`,1033:`en-US`,12297:`en-ZW`,1061:`et`,1071:`mk`,1080:`fo`,1065:`fa`,1124:`fil`,1035:`fi`,2060:`fr-BE`,11276:`fr-CM`,3084:`fr-CA`,9228:`fr-CG`,12300:`fr-CI`,1036:`fr-FR`,5132:`fr-LU`,13324:`fr-ML`,6156:`fr-MC`,14348:`fr-MA`,10252:`fr-SN`,4108:`fr-CH`,7180:`fr`,1122:`fy-NL`,2108:`gd-IE`,1084:`gd`,1110:`gl`,1079:`ka`,3079:`de-AT`,1031:`de-DE`,5127:`de-LI`,4103:`de-LU`,2055:`de-CH`,1032:`el`,1140:`gn`,1095:`gu`,1279:`en`,1037:`he`,1081:`hi`,1038:`hu`,1039:`is`,1136:`ig-NG`,1057:`id`,1040:`it-IT`,2064:`it-CH`,1041:`ja`,1099:`kn`,1120:`ks`,1087:`kk`,1107:`km`,1111:`kok`,1042:`ko`,1088:`ky`,1108:`lo`,1142:`la`,1062:`lv`,1063:`lt`,2110:`ms-BN`,1086:`ms-MY`,1100:`ml`,1082:`mt`,1112:`mni`,1153:`mi`,1102:`mr`,1104:`mn`,2128:`mn`,1121:`ne`,1044:`no-NO`,2068:`no-NO`,1096:`or`,1045:`pl`,1046:`pt-BR`,2070:`pt-PT`,1094:`pa`,1047:`rm`,2072:`ro-MO`,1048:`ro-RO`,1049:`ru`,2073:`ru-MO`,1083:`se`,1103:`sa`,3098:`sr-SP`,2074:`sr-SP`,1072:`st`,1074:`tn`,1113:`sd`,1115:`si`,1051:`sk`,1060:`sl`,1143:`so`,1070:`sb`,11274:`es-AR`,16394:`es-BO`,13322:`es-CL`,9226:`es-CO`,5130:`es-CR`,7178:`es-DO`,12298:`es-EC`,17418:`es-SV`,4106:`es-GT`,18442:`es-HN`,2058:`es-MX`,19466:`es-NI`,6154:`es-PA`,15370:`es-PY`,10250:`es-PE`,20490:`es-PR`,1034:`es-ES`,14346:`es-UY`,8202:`es-VE`,1089:`sw`,2077:`sv-FI`,1053:`sv-SE`,1114:`syc`,1064:`tg`,1097:`ta`,1092:`tt`,1098:`te`,1054:`th`,1105:`bo`,1073:`ts`,1055:`tr`,1090:`tk`,1058:`uk`,1056:`ur`,2115:`uz-UZ`,1091:`uz-UZ`,1075:`ve`,1066:`vi`,1106:`cy`,1076:`xh`,1085:`yi`,1077:`zu`}),ci=`GENERAL`,li=`HASH`,ui=`ZERO`,di=`QMARK`,fi=`SLASH`,pi=`GROUP`,mi=`SCALE`,hi=`COMMA`,gi=`BREAK`,_i=`TEXT`,vi=`PLUS`,yi=`MINUS`,bi=`POINT`,xi=`SPACE`,Si=`PERCENT`,Ci=`DIGIT`,wi=`CALENDAR`,Ti=`ERROR`,Ei=`DATETIME`,Di=`DURATION`,Oi=`CONDITION`,ki=`DBNUM`,Ai=`NATNUM`,ji=`LOCALE`,Mi=`COLOR`,Ni=`MODIFIER`,Pi=`AMPM`,Fi=`ESCAPED`,Ii=`STRING`,Li=`SKIP`,Ri=`FILL`,zi=`PAREN`,Bi=`CHAR`,Vi=`CURRENCY`,Hi=`FRAC`,Ui=`YEAR`,Wi=`YEAR-SHORT`,Gi=`MONTH`,Ki=`MONTHNAME-SINGLE`,qi=`MONTHNAME-SHORT`,Ji=`MONTHNAME`,Yi=`WEEKDAY-SHORT`,Xi=`WEEKDAY`,Zi=`HOUR`,Qi=`SUBSEC`,$i=`HOUR-ELAP`,ea=`MIN-ELAP`,ta=`SEC-ELAP`,na=`B-YEAR`,ra=`B-YEAR-SHORT`,ia=1e3,aa=`#000000.#FFFFFF.#FF0000.#00FF00.#0000FF.#FFFF00.#FF00FF.#00FFFF.#800000.#008000.#000080.#808000.#800080.#008080.#C0C0C0.#808080.#9999FF.#993366.#FFFFCC.#CCFFFF.#660066.#FF8080.#0066CC.#CCCCFF.#000080.#FF00FF.#FFFF00.#00FFFF.#800080.#800000.#008080.#0000FF.#00CCFF.#CCFFFF.#CCFFCC.#FFFF99.#99CCFF.#FF99CC.#CC99FF.#FFCC99.#3366FF.#33CCCC.#99CC00.#FFCC00.#FF9900.#FF6600.#666699.#969696.#003366.#339966.#003300.#333300.#993300.#993366.#333399.#333333`.split(`.`),oa=`¤.$.£.¥.֏.؋.৳.฿.៛.₡.₦.₩.₪.₫.€.₭.₮.₱.₲.₴.₸.₹.₺.₼.₽.₾.₿`.split(`.`),sa=(e,t=``)=>e.replaceAll(`~`,t).split(`;`),I=(e,t=``)=>sa(e,t),L=(e,t=``)=>sa(e,t),ca=(e,t=0,n=0)=>(e.mmm||=t<1?e.mmmm.concat():e.mmmm.map(e=>{let n=e.slice(0,t%10);return n+(t<10||e===n?``:`.`)}),e.ddd||=n<1?e.dddd.concat():e.dddd.map(e=>{let t=e.slice(0,n%10);return t+(n<10||e===t?``:`.`)}),!e.mmm6&&e.mmmm6&&(e.mmm6=e.mmmm6),e),R=e=>({minus:!e.p,sign:!!e.s,dateOrder:e.o??1,currencyPos:e.f??3,padMm:e.m==null||!!e.m,padDd:e.d==null||!!e.d,padHh:e.h==null||!!e.h,padHhAlt:!!e.i,dateSep:e.k??`/`,shortDateSep:e.l??`-`,timeSep:e.b??`:`,shortYear:!!e.y,spacePercent:!!e.c}),la=`Black`,ua=`White`,da=`Red`,fa=`Green`,pa=`Blue`,ma=`Yellow`,ha=`Magenta`,ga=`Cyan`,_a={k:`.`,l:`.`},va={d:0,h:0,m:0,k:`.`,l:`.`},ya={d:1,y:1,f:0,o:1,k:`-`,b:`:`,s:1},ba={...ya,y:0},xa={h:0,d:0,f:0,m:0,s:1};function Sa(){let e=L(`一月;二月;三月;四月;五月;六月;七月;八月;九月;十月;十一月;十二月`),t={黑色:la,白色:ua,紅色:da,綠色:fa,藍色:pa,黃色:ma,洋紅:ha,青色:ga};z({group:`,`,ampm:sa(`上午;下午`),mmmm:e,mmm:L(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),dddd:I(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:I(`周日;周一;周二;周三;周四;周五;周六`),color:`颜色`,colors:{黑色:la,白色:ua,红色:da,绿色:fa,蓝色:pa,黄色:ma,洋红:ha,蓝绿色:ga},general:`G/通用格式`,currency:`¥`,format:R({h:0,d:0,f:0,m:0,o:2,s:1}),sysdate:`yyyy年m月d日`,systime:`h:mm:ss`},`zh-CN`),z({group:`,`,ampm:sa(`上午;下午`),mmmm:e,mmm:e,dddd:I(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:I(`週日;週一;週二;週三;週四;週五;週六`),nan:`非數值`,color:`色彩`,colors:t,general:`G/通用格式`,currency:`NT$`,format:R({d:0,f:0,o:2,m:0,i:1}),sysdate:`yyyy年m月d日`,systime:`AM/PM hh:mm:ss`},`zh-TW`),z({group:`,`,ampm:sa(`上午;下午`),mmmm:e,mmm:e,dddd:I(`~日;~一;~二;~三;~四;~五;~六`,`星期`),ddd:I(`週日;週一;週二;週三;週四;週五;週六`),color:`色彩`,colors:t,currency:`HK$`,format:R({h:0,d:0,f:0,m:0,p:1}),sysdate:`yyyy年m月d日`,systime:`h:mm:ss`},`zh-HK`),z({group:`,`,mmmm:L(`1月;2月;3月;4月;5月;6月;7月;8月;9月;10月;11月;12月`),mmm:L(`1;2;3;4;5;6;7;8;9;10;11;12`),dddd:I(`日曜日;月曜日;火曜日;水曜日;木曜日;金曜日;土曜日`),ddd:I(`日;月;火;水;木;金;土`),ampm:sa(`午前;午後`),general:`G/標準`,currency:`¥`,color:`色`,colors:{黒:la,白:ua,赤:da,緑:fa,青:pa,黄:ma,紫:ha,水:ga},format:R({h:0,f:0,o:2,d:1}),sysdate:`yyyy年m月d日`,systime:`h:mm:ss`},`ja`),z({group:`,`,ampm:sa(`오전;오후`),mmmm:L(`1월;2월;3월;4월;5월;6월;7월;8월;9월;10월;11월;12월`),mmm:L(`1;2;3;4;5;6;7;8;9;10;11;12`),dddd:I(`일요일;월요일;화요일;수요일;목요일;금요일;토요일`),ddd:I(`일;월;화;수;목;금;토`),color:`색`,colors:{검정:la,흰색:ua,빨강:da,녹색:fa,파랑:pa,노랑:ma,자홍:ha,녹청:ga},general:`G/표준`,currency:`₩`,format:R({h:0,f:0,o:2,k:`-`}),sysdate:`yyyy년 mmmm d일 dddd`,systime:`AM/PM h:mm:ss`},`ko`),z({group:`,`,mmmm:L(`มกร~;กุมภาพันธ์;มีน~;เมษายน;พฤษภ~;มิถุนายน;กรกฎ~;สิงห~;กันยายน;ตุล~;พฤศจิกายน;ธันว~`,`าคม`),mmm:L(`ม.ค.;ก.พ.;มี.ค.;เม.ย.;พ.ค.;มิ.ย.;ก.ค.;ส.ค.;ก.ย.;ต.ค.;พ.ย.;ธ.ค.`),dddd:I(`อาทิตย์;จันทร์;อังคาร;พุธ;พฤหัสบดี;ศุกร์;เสาร์`),ddd:I(`อา.;จ.;อ.;พ.;พฤ.;ศ.;ส.`),color:`สี`,colors:{ดำ:la,ขาว:ua,แดง:da,เขียว:fa,น้ำเงิน:pa,เหลือง:ma,ม่วงมาเจนต้า:ha,ฟ้า:ga},currency:`฿`,format:R({h:0,d:0,f:0,m:0,o:1}),sysdate:`d mmmm yyyy`,systime:`h:mm:ss`},`th`),z(ca({decimal:`,`,ampm:sa(`dop.;odp.`),mmmm:L(`leden;únor;březen;duben;květen;červen;červenec;srpen;září;říjen;listopad;prosinec`),mmm:L(`I;II;III;IV;V;VI;VII;VIII;IX;X;XI;XII`),dddd:I(`neděle;pondělí;úterý;středa;čtvrtek;pátek;sobota`),bool:sa(`PRAVDA;NEPRAVDA`),color:`Barva`,colors:{černá:la,bílá:ua,červená:da,zelená:fa,modrá:pa,žlutá:ma,purpurová:ha,azurová:ga},general:`Všeobecný`,opcodes:{dy:`r`},currency:`Kč`,format:R({h:0,k:`.`,l:`.`}),sysdate:`dddd d. mmmm yyyy`,systime:`h:mm:ss`},-1,2),`cs`),z(ca({group:`.`,decimal:`,`,mmmm:L(`januar;februar;marts;april;maj;juni;juli;august;september;oktober;november;december`),dddd:I(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:sa(`SAND;FALSK`),color:`Farve`,colors:{sort:la,hvid:ua,rød:da,lysegrøn:fa,blå:pa,gul:ma,lyslilla:ha,akvamarin:ga},general:`Standard`,opcodes:{dy:`å`,th:`t`},currency:`kr.`,format:R({k:`-`}),sysdate:`d. mmmm yyyy`,systime:`hh:mm:ss`},3,2),`da`),z(ca({group:`.`,decimal:`,`,mmmm:L(`januari;februari;maart;april;mei;juni;juli;augustus;september;oktober;november;december`),mmm:L(`jan;feb;mrt;apr;mei;jun;jul;aug;sep;okt;nov;dec`),dddd:I(`zondag;maandag;dinsdag;woensdag;donderdag;vrijdag;zaterdag`),bool:sa(`WAAR;ONWAAR`),color:`Kleur`,colors:{zwart:la,wit:ua,rood:da,root:da,groen:fa,blauw:pa,geel:ma,magenta:ha,cyaan:ga},general:`Standaard`,opcodes:{dy:`j`,th:`u`},currency:`€`,format:R({d:0,f:2,m:0,k:`-`,s:1}),sysdate:`dddd d mmmm yyyy`,systime:`hh:mm:ss`},-1,2),`nl`),z({group:`,`,format:R({h:0,d:0,f:0,m:0,o:0,p:1}),sysdate:`dddd, mmmm d, yyyy`,systime:`h:mm:ss AM/PM`},`en`),z({group:`,`,format:R({h:0,d:0,f:0,m:0,o:0,p:1}),sysdate:`dddd, mmmm d, yyyy`,systime:`h:mm:ss AM/PM`},`en-US`),z({group:`,`,format:R({h:0,f:0,o:2,p:0,k:`-`}),sysdate:`mmmm d, yyyy`,systime:`h:mm:ss AM/PM`},`en-CA`),z({group:`,`,color:`Colour`,ampm:[`AM`,`PM`],format:R({h:0,d:0,f:0,p:0}),sysdate:`dddd, d mmmm yyyy`,systime:`h:mm:ss AM/PM`},`en-AU`),z({group:`,`,color:`Colour`,ampm:[`AM`,`PM`],currency:`£`,format:R({f:0,p:0}),sysdate:`dd mmmm yyyy`,systime:`hh:mm:ss`},`en-GB`),z({group:`,`,mmm:L(`Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sept;Oct;Nov;Dec`),color:`Colour`,ampm:[`am`,`pm`],currency:`€`,format:R({f:0,p:0}),sysdate:`dddd d mmmm yyyy`,systime:`hh:mm:ss`},`en-IE`),z(ca({decimal:`,`,nan:`epäluku`,ampm:sa(`ap.;ip.`),mmmm:L(`tammi~;helmi~;maalis~;huhti~;touko~;kesä~;heinä~;elo~;syys~;loka~;marras~;joulu~`,`kuu`),mmm:L(`tammi;helmi;maalis;huhti;touko;kesä;heinä;elo;syys;loka;marras;joulu`),dddd:I(`sunnun~;maanan~;tiis~;keskiviikko;tors~;perjan~;lauan~`,`tai`),bool:sa(`TOSI;EPÄTOSI`),color:`Väri`,colors:{musta:la,valkoinen:ua,punainen:da,vihreä:fa,sininen:pa,keltainen:ma,magenta:ha,syaani:ga},general:`Yleinen`,currency:`€`,opcodes:{dy:`v`,dm:`k`,dd:`p`,th:`t`},format:R({h:0,d:0,p:0,k:`.`,l:`.`,m:0,c:1}),sysdate:`dddd d. mmmm yyyy`,systime:`h.mm.ss`},-1,2),`fi`);let n=ca({group:` `,decimal:`,`,mmmm:L(`janvier;février;mars;avril;mai;juin;juillet;août;septembre;octobre;novembre;décembre`),mmm:L(`janv;févr;mars;avr;mai;juin;juil;août;sept;oct;nov;déc`),dddd:I(`~manche;lun~;mar~;mercre~;jeu~;vendre~;same~`,`di`),ddd:[`dim`,`lun`,`mar`,`mer`,`jeu`,`ven`,`sam`],bool:sa(`VRAI;FAUX`),color:`Couleur`,colors:{noir:la,blanc:ua,rouge:da,vert:fa,bleu:pa,jaune:ma,magenta:ha,cyan:ga},opcodes:{dy:`a`,dd:`j`,wd:`o`},general:`Standard`,systime:`hh:mm:ss`},-1,-13);z({...n,currency:`€`,format:R({}),sysdate:`dddd d mmmm yyyy`},`fr`),z({...n,ampm:sa(`AM;PM`),format:R({p:1,o:2,d:1,k:`-`,l:`-`,s:1}),sysdate:`d mmmm yyyy`},`fr-CA`),z({group:`'`,decimal:`.`,...n,currency:`CHF`,format:R({o:1,d:1,k:`.`,l:`.`}),sysdate:`dddd, d mmmm yyyy`},`fr-CH`);let r=ca({mmmm:L(`Januar;Februar;März;April;Mai;Juni;Juli;August;September;Oktober;November;Dezember`),mmm:L(`Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez`),dddd:I(`Sonn~;Mon~;Diens~;Mittwoch;Donners~;Frei~;Sams~`,`tag`),bool:sa(`WAHR;FALSCH`),color:`Farbe`,colors:{schwarz:la,weiß:ua,rot:da,grün:fa,blau:pa,gelb:ma,magenta:ha,zyan:ga},opcodes:{dy:`j`,dd:`t`},general:`Standard`,sysdate:`dddd, d. mmmm yyyy`,systime:`hh:mm:ss`},-1,2);z({group:`.`,decimal:`,`,...r,currency:`€`,format:R({k:`.`,l:`. `})},`de`),z({group:`’`,decimal:`.`,...r,currency:`CHF`,mmm:L(`Jan;Feb;Mär;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez`),format:R({o:1,d:1,k:`.`,f:2,s:1,l:`. `})},`de-CH`),z(ca({group:`.`,decimal:`,`,ampm:sa(`πμ;μμ`),mmmm:L(`Ιανουαρ~;Φεβρουαρ~;Μαρτ~;Απριλ~;Μαΐου;Ιουν~;Ιουλ~;Αυγούστου;Σεπτεμβρ~;Οκτωβρ~;Νοεμβρ~;Δεκεμβρ~`,`ίου`),mmm:L(`Ιαν;Φεβ;Μαρ;Απρ;Μαϊ;Ιουν;Ιουλ;Αυγ;Σεπ;Οκτ;Νοε;Δεκ`),dddd:I(`Κυριακή;Δευτέρα;Τρίτη;Τετάρτη;Πέμπτη;Παρασκευή;Σάββατο`),ddd:[`Κυρ`,`Δευ`,`Τρι`,`Τετ`,`Πεμ`,`Παρ`,`Σαβ`],colors:{μαύρο:la,λευκό:ua,κόκκινο:da,πράσινο:fa,μπλε:pa,κίτρινο:ma,ματζέντα:ha,γαλάζιο:ga},general:`Γενικός τύπος`,color:`Χρώμα`,opcodes:{dy:`ε`,dm:`μ`,dd:`η`,th:`ω`,tm:`λ`,ts:`δ`},currency:`€`,format:R({h:0,d:0,m:0}),sysdate:`dddd, d mmmm yyyy`,systime:`h:mm:ss AM/PM`},-1,3),`el`),z({decimal:`,`,ampm:sa(`de.;du.`),mmmm:L(`január;február;március;április;május;június;július;augusztus;szeptember;október;november;december`),mmm:L(`jan;febr;márc;ápr;máj;jún;júl;aug;szept;okt;nov;dec`),dddd:I(`vasárnap;hétfő;kedd;szerda;csütörtök;péntek;szombat`),ddd:I(`V;H;K;Sze;Cs;P;Szo`),bool:sa(`IGAZ;HAMIS`),currency:`Ft`,general:`Normál`,opcodes:{dy:`é`,dm:`h`,dd:`n`,th:`ó`,tm:`p`,ts:`m`},colors:{fekete:la,fehér:ua,piros:da,zöld:fa,kék:pa,sárga:ma,bíbor:ha,ciánkék:ga},color:`Szín`,format:R({h:0,o:2,k:`.`,l:`.`,d:1}),sysdate:`yyyy. mmmm d".", dddd`,systime:`h:mm:ss`},`hu`),z(ca({group:`.`,decimal:`,`,ampm:sa(`f.h.;e.h.`),mmmm:L(`janúar;febrúar;mars;apríl;maí;júní;júlí;ágúst;september;október;nóvember;desember`),dddd:I(`sunnu~;mánu~;þriðju~;miðviku~;fimmtu~;föstu~;laugar~`,`dagur`),currency:`kr.`,format:R({d:0,m:0,k:`.`,l:`.`}),sysdate:`dddd, d. mmmm yyyy`,systime:`hh:mm:ss`},3,3),`is`),z(ca({group:`.`,decimal:`,`,ampm:sa(`AM;PM`),mmmm:L(`Januari;Februari;Maret;April;Mei;Juni;Juli;Agustus;September;Oktober;November;Desember`),dddd:I(`Minggu;Senin;Selasa;Rabu;Kamis;Jumat;Sabtu`),ddd:I(`Mgg;Sen;Sel;Rab;Kam;Jum;Sab`),color:`Warna`,colors:{hitam:la,putih:ua,merah:da,hijau:fa,biru:pa,kuning:ma,magenta:ha,sian:ga},currency:`Rp`,format:R({f:0,b:`.`}),sysdate:`dddd, dd mmmm yyyy`,systime:`hh.mm.ss`},3,3),`id`);let i=ca({mmmm:L(`gennaio;febbraio;marzo;aprile;maggio;giugno;luglio;agosto;settembre;ottobre;novembre;dicembre`),dddd:I(`domenica;lunedì;martedì;mercoledì;giovedì;venerdì;sabato`),bool:sa(`VERO;FALSO`),general:`Standard`,color:`Colore`,colors:{nero:la,bianco:ua,rosso:da,verde:fa,blu:pa,giallo:ma,fucsia:ha,celeste:ga,ciano:ga},opcodes:{dy:`a`,dd:`g`,wd:`o`,en:`x`},systime:`hh:mm:ss`},3,3);z({group:`.`,decimal:`,`,...i,currency:`€`,format:R({}),sysdate:`dddd d mmmm yyyy`},`it`),z({group:`’`,decimal:`.`,...i,currency:`CHF`,format:R({o:1,d:1,k:`.`,l:`.`,f:2,s:1}),sysdate:`dddd, d mmmm yyyy`},`it-CH`);let a={decimal:`,`,ampm:sa(`a.m.;p.m.`),mmmm:L(`januar;februar;mars;april;mai;juni;juli;august;september;oktober;november;desember`),mmm:L(`jan;feb;mar;apr;mai;jun;jul;aug;sep;okt;nov;des`),dddd:I(`søn~;man~;tirs~;ons~;tors~;fre~;lør~`,`dag`),bool:sa(`SANN;USANN`),color:`Farge`,colors:{svart:la,hvit:ua,rød:da,grønn:fa,blå:pa,gul:ma,magenta:ha,cyan:ga},general:`Standard`,opcodes:{dy:`å`,th:`t`},currency:`kr`,sysdate:`dddd d. mmmm yyyy`,systime:`hh:mm:ss`};z(ca({...a,format:R({f:2,c:1,k:`.`,l:`.`,s:1})},-1,3),`nb`),z(ca({...a,format:R({f:2,c:1,k:`.`,l:`.`,s:1})},-1,3),`no`),z(ca({decimal:`,`,mmmm:L(`styczeń;luty;marzec;kwiecień;maj;czerwiec;lipiec;sierpień;wrzesień;październik;listopad;grudzień`),dddd:I(`niedziela;poniedziałek;wtorek;środa;czwartek;piątek;sobota`),ddd:I(`niedz;pon;wt;śr;czw;pt;sob`),bool:sa(`PRAWDA;FAŁSZ`),color:`Kolor`,colors:{czarny:la,biały:ua,czerwony:da,zielony:fa,niebieski:pa,żółty:ma,amarantowy:ha,błękitny:ga},general:`Standardowy`,opcodes:{dy:`r`,th:`g`},currency:`zł`,format:R({d:0,k:`.`,l:`.`}),sysdate:`dddd, d mmmm yyyy`,systime:`hh:mm:ss`},3,-1),`pl`);let o={decimal:`,`,mmmm:L(`janeiro;fevereiro;março;abril;maio;junho;julho;agosto;setembro;outubro;novembro;dezembro`),dddd:I(`domingo;segunda-feira;terça-feira;quarta-feira;quinta-feira;sexta-feira;sábado`),bool:sa(`VERDADEIRO;FALSO`),opcodes:{dy:`a`,wd:`o`},color:`Cor`};z({...ca(o,3,3),group:` `,general:`Estandar`,colors:{preto:la,branco:ua,vermelho:da,verde:fa,azul:pa,amarelo:ma,magenta:ha,turquesa:ga,ciano:ga},currency:`€`,format:R({l:`/`}),sysdate:`d "de" mmmm "de" yyyy`,systime:`hh:mm:ss`},`pt`),z({...ca(o,3,3),group:`.`,general:`Geral`,colors:{preto:la,branco:ua,vermelho:da,verde:fa,azul:pa,amarelo:ma,magenta:ha,ciano:ga},currency:`R$`,format:R({f:2,l:`/`}),sysdate:`dddd, d "de" mmmm "de" yyyy`,systime:`hh:mm:ss`},`pt-BR`),z({decimal:`,`,nan:`не\xA0число`,mmmm:L(`Январь;Февраль;Март;Апрель;Май;Июнь;Июль;Август;Сентябрь;Октябрь;Ноябрь;Декабрь`),mmm:L(`янв;фев;мар;апр;май;июн;июл;авг;сен;окт;ноя;дек`),dddd:I(`воскресенье;понедельник;вторник;среда;четверг;пятница;суббота`),ddd:I(`Вс;Пн;Вт;Ср;Чт;Пт;Сб`),mmmm6:L(`рамадан;шавваль;зуль-каада;зуль-хиджжа;мухаррам;раби-уль-авваль;раби-уль-ахир;джумад-уль-авваль;джумад-уль-ахир;раджаб;шаабан;рамадан`),mmm6:L(`рам.;шав.;зуль-к.;зуль-х.;мух.;раб. I;раб. II;джум. I;джум. II;радж.;шааб.;рам.`),bool:sa(`ИСТИНА;ЛОЖЬ`),general:`Основной`,opcodes:{dy:`г`,dm:`м`,dd:`д`,th:`ч`,tm:`м`,ts:`с`},color:`Цвет`,colors:{черный:la,белый:ua,красный:da,зеленый:fa,синий:pa,желтый:ma,фиолетовый:ha,пурпурный:ha,голубой:ga},currency:`₽`,format:R({h:0,k:`.`,l:`.`}),sysdate:`d mmmm yyyy "г."`,systime:`h:mm:ss`},`ru`),z(ca({decimal:`,`,mmmm:L(`január;február;marec;apríl;máj;jún;júl;august;september;október;november;december`),mmm:L(`1;2;3;4;5;6;7;8;9;10;11;12`),dddd:I(`nedeľa;pondelok;utorok;streda;štvrtok;piatok;sobota`),color:`Farba`,colors:{čierna:la,biela:ua,červená:da,zelená:fa,modrá:pa,žltá:ma,purpurová:ha,azúrová:ga},currency:`€`,format:R(va),sysdate:`dddd d. mmmm yyyy`,systime:`h:mm:ss`},3,2),`sk`);let s={group:`.`,decimal:`,`,ampm:sa(`a.\xA0m.;p.\xA0m.`),mmmm:L(`enero;febrero;marzo;abril;mayo;junio;julio;agosto;septiem~;octu~;noviem~;diciem~`,`bre`),mmm:L(`ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic`),dddd:I(`domingo;lunes;martes;miércoles;jueves;viernes;sábado`),ddd:I(`dom;lun;mar;mié;jue;vie;sáb`),bool:sa(`VERDADERO;FALSO`),colors:{negro:la,blanco:ua,rojo:da,verde:fa,azul:pa,amarillo:ma,magenta:ha,cian:ga,ciano:ga},systime:`h:mm:ss`,sysdate:`dddd, d "de" mmmm "de" yyyy`},c=L(`ene;feb;mar;abr;may;jun;jul;ago;sep;oct;nov;dic`),l=L(`ene;feb;mar;abr;may;jun;jul;ago;sept;oct;nov;dic`);z({...s,ampm:sa(`AM;PM`),ddd:I(`do;lu;ma;mi;ju;vi;sá`),general:`Estándar`,opcodes:{dy:`a`,wd:`o`},currency:`€`,format:R({h:0,d:1})},`es`),z({...s,mmm:l,format:R({d:0,f:2,m:0}),systime:`hh:mm:ss`},`es-AR`),z({...s,mmm:l,currency:`Bs`,format:R({d:0,f:0,m:0}),systime:`hh:mm:ss`},`es-BO`),z({...s,mmm:l,format:R({h:0,f:0,s:1,k:`-`})},`es-CL`),z({...s,mmm:c,format:R({h:0,d:0,f:2}),systime:`h:mm:ss AM/PM`},`es-CO`),z({...s,mmm:l,format:R(xa)},`es-EC`),z({...s,mmm:l,currency:`₲`,format:R({d:0,f:2,s:1,m:0}),systime:`hh:mm:ss`},`es-PY`),z({...s,group:`,`,decimal:`.`,mmm:c,ampm:sa(`a. m.;p. m.`),opcodes:{dy:`a`,wd:`o`},general:`Estándar`,format:R({f:0,i:1}),systime:`hh:mm:ss AM/PM`},`es-MX`),z({...s,mmmm:L(`Enero;Febrero;Marzo;Abril;Mayo;Junio;Julio;Agosto;Setiembre;Octubre;Noviembre;Diciembre`),mmm:L(`Ene;Feb;Mar;Abr;May;Jun;Jul;Ago;set;Oct;Nov;Dic`),format:R({d:0,f:2,h:0,m:0})},`es-UY`),z({...s,mmm:l,currency:`Bs.S`,format:R(xa),systime:`h:mm:ss AM/PM`},`es-VE`),z(ca({decimal:`,`,ampm:sa(`fm;em`),mmmm:L(`januari;februari;mars;april;maj;juni;juli;augusti;september;oktober;november;december`),dddd:I(`sön~;mån~;tis~;ons~;tors~;fre~;lör~`,`dag`),opcodes:{dy:`å`,th:`t`},bool:[`SANT`,`FALSKT`],general:`Standard`,color:`Färg`,colors:{svart:la,vit:ua,röd:da,grön:fa,blå:pa,gul:ma,magenta:ha,cyanblå:ga},currency:`kr`,format:R({o:2,k:`-`}),sysdate:`"den" d mmmm yyyy`,systime:`hh:mm:ss`},3,3),`sv`),z(ca({group:`.`,decimal:`,`,ampm:sa(`ÖÖ;ÖS`),mmmm:L(`Ocak;Şubat;Mart;Nisan;Mayıs;Haziran;Temmuz;Ağustos;Eylül;Ekim;Kasım;Aralık`),mmm:L(`Oca;Şub;Mar;Nis;May;Haz;Tem;Ağu;Eyl;Eki;Kas;Ara`),dddd:I(`Pazar;Pazartesi;Salı;Çarşamba;Perşembe;Cuma;Cumartesi`),ddd:I(`Paz;Pzt;Sal;Çar;Per;Cum;Cmt`),bool:sa(`DOĞRU;YANLIŞ`),color:`Renk`,colors:{siyah:la,beyaz:ua,kırmızı:da,yeşil:fa,mavi:pa,sarı:ma,pembe:ha,camgöbeği:ga},opcodes:{dm:`a`,dd:`g`,th:`s`,tm:`d`,ts:`n`},general:`Genel`,currency:`₺`,format:R({d:0,f:0,k:`.`,l:`.`}),sysdate:`d mmmm yyyy dddd`,systime:`hh:mm:ss`},3,-1),`tr`),z({group:`,`,ampm:sa(`AM;PM`),mmmm:L(`Ionawr;Chwefror;Mawrth;Ebrill;Mai;Mehefin;Gorffennaf;Awst;Medi;Hydref;Tachwedd;Rhagfyr`),mmm:L(`Ion;Chwef;Maw;Ebr;Mai;Meh;Gorff;Awst;Medi;Hyd;Tach;Rhag`),dddd:I(`Dydd Sul;Dydd Llun;Dydd Mawrth;Dydd Mercher;Dydd Iau;Dydd Gwener;Dydd Sadwrn`),ddd:I(`Sul;Llun;Maw;Mer;Iau;Gwe;Sad`),currency:`£`,format:R({f:0,p:0}),sysdate:`dddd, d mmmm yyyy`,systime:`hh:mm:ss`},`cy`),z({group:`.`,decimal:`,`,mmmm:L(`yanvar;fevral;mart;aprel;may;iyun;iyul;avqust;sentyabr;oktyabr;noyabr;dekabr`),mmm:L(`yan;fev;mar;apr;may;iyn;iyl;avq;sen;okt;noy;dek`),dddd:I(`bazar;bazar ertəsi;çərşənbə axşamı;çərşənbə;cümə axşamı;cümə;şənbə`),ddd:I(`B;B.E;Ç.A;Ç;C.A;C;Ş`),currency:`₼`,format:R(_a),sysdate:`d mmmm yyyy, dddd`,systime:`hh:mm:ss`},`az`),z(ca({decimal:`,`,mmmm:L(`студзень;люты;сакавік;красавік;май;чэрвень;ліпень;жнівень;верасень;кастрычнік;лістапад;снежань`),mmm:L(`студз;лют;сак;крас;май;чэрв;ліп;жн;вер;кастр;ліст;снеж`),dddd:I(`нядзеля;панядзелак;аўторак;серада;чацвер;пятніца;субота`),ddd:I(`нд;пн;аўт;ср;чц;пт;сб`),currency:`Br`,format:R({y:1,k:`.`,l:`.`}),sysdate:`d mmmm yyyy`,systime:`hh:mm:ss`},3,-1),`be`),z({decimal:`,`,mmmm:L(`януари;февруари;март;април;май;юни;юли;август;септември;октомври;ноември;декември`),mmm:L(`яну;фев;мар;апр;май;юни;юли;авг;сеп;окт;ное;дек`),dddd:I(`неделя;понеделник;вторник;сряда;четвъртък;петък;събота`),ddd:I(`нед;пон;вт;ср;четв;пет;съб`),currency:`лв.`,format:R(va),sysdate:`dd mmmm yyyy "г."`,systime:`h:mm:ss`},`bg`),z({group:`.`,decimal:`,`,mmmm:L(`gener;febrer;març;abril;maig;juny;juliol;agost;setembre;octubre;novembre;desembre`),mmm:L(`gen;febr;març;abr;maig;juny;jul;ag;set;oct;nov;des`),dddd:I(`diumenge;dilluns;dimarts;dimecres;dijous;divendres;dissabte`),ddd:I(`dg;dl;dt;dc;dj;dv;ds`),general:`Estándar`,opcodes:{dy:`a`,wd:`o`},ampm:sa(`a.\xA0m.;p.\xA0m.`),currency:`€`,format:R({d:0,o:1,h:0,m:0}),sysdate:`dddd, d mmmm "de" yyyy`,systime:`h:mm:ss`},`ca`),z(ca({group:`,`,decimal:`.`,mmmm:L(`Enero;Pebrero;Marso;Abril;Mayo;Hunyo;Hulyo;Agosto;Setyembre;Oktubre;Nobyembre;Disyembre`),dddd:I(`Linggo;Lunes;Martes;Miyerkules;Huwebes;Biyernes;Sabado`),currency:`₱`,format:R({h:0,d:0,f:0,m:0,o:0}),sysdate:`dddd, mmmm d, yyyy`,systime:`h:mm:ss AM/PM`},3,3),`fil`),z({group:`,`,decimal:`.`,ampm:[`પૂર્વ\xA0મધ્યાહ્ન`,`ઉત્તર\xA0મધ્યાહ્ન`],mmmm:L(`જાન્યુઆરી;ફેબ્રુઆરી;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગસ્ટ;સપ્ટેમ્બર;ઑક્ટોબર;નવેમ્બર;ડિસેમ્બર`),mmm:L(`જાન્યુ;ફેબ્રુ;માર્ચ;એપ્રિલ;મે;જૂન;જુલાઈ;ઑગ;સપ્ટે;ઑક્ટો;નવે;ડિસે`),dddd:I(`રવિ~;સોમ~;મંગળ~;બુધ~;ગુરુ~;શુક્ર~;શનિ~`,`વાર`),ddd:I(`રવિ;સોમ;મંગળ;બુધ;ગુરુ;શુક્ર;શનિ`),currency:`₹`,format:R(ya),sysdate:`dd mmmm yyyy`,systime:`hh:mm:ss`},`gu`),z({group:`,`,decimal:`.`,ampm:sa(`לפ׳;אח׳`),dddd:[`יום\xA0ראשון`,`יום\xA0שני`,`יום\xA0שלישי`,`יום\xA0רביעי`,`יום\xA0חמישי`,`יום\xA0שישי`,`שבת`],ddd:[`יום\xA0א`,`יום\xA0ב`,`יום\xA0ג`,`יום\xA0ד`,`יום\xA0ה`,`יום\xA0ו`,`שבת`],mmmm:L(`ינואר;פברואר;מרץ;אפריל;מאי;יוני;יולי;אוגוסט;ספטמבר;אוקטובר;נובמבר;דצמבר`),mmm:L(`ינו;פבר;מרץ;אפר;מאי;יונ;יול;אוג;ספט;אוק;נוב;דצמ`),mmmm6:L(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע אל־אוול;רביע א־ת׳אני;ג׳ומאדא אל־אולא;ג׳ומאדא א־ת׳אניה;רג׳ב;שעבאן;רמדאן`),mmm6:L(`רמדאן;שוואל;ד׳ו אל־קעדה;ד׳ו אל־חיג׳ה;מוחרם;רביע א׳;רביע ב׳;ג׳ומאדא א׳;ג׳ומאדא ב׳;רג׳ב;שעבאן;רמדאן`),color:`צבע`,colors:{שחור:la,לבן:ua,אדום:da,ירוק:fa,כחול:pa,צהוב:ma,"אדום ארגמן":ha,תכלת:ga},currency:`₪`,format:R({f:2,s:1}),sysdate:`dddd dd mmmm yyyy`,systime:`hh:mm:ss`},`he`),z(ca({group:`.`,decimal:`,`,mmmm:L(`siječanj;veljača;ožujak;travanj;svibanj;lipanj;srpanj;kolovoz;rujan;listopad;studeni;prosinac`),mmm:L(`sij;vlj;ožu;tra;svi;lip;srp;kol;ruj;lis;stu;pro`),dddd:I(`nedjelja;ponedjeljak;utorak;srijeda;četvrtak;petak;subota`),currency:`€`,format:R(va),sysdate:`d. mmmm yyyy.`,systime:`h:mm:ss`},-1,3),`hr`),z({decimal:`,`,mmmm:L(`Հունվար;Փետրվար;Մարտ;Ապրիլ;Մայիս;Հունիս;Հուլիս;Օգոստոս;Սեպտեմբեր;Հոկտեմբեր;Նոյեմբեր;Դեկտեմբեր`),mmm:L(`Հնվ;Փտվ;Մրտ;Ապր;Մյս;Հնս;Հլս;Օգս;Սպտ;Հկտ;Նյմ;Դկտ`),dddd:I(`Կիրակի;Երկուշաբթի;Երեքշաբթի;Չորեքշաբթի;Հինգշաբթի;Ուրբաթ;Շաբաթ`),ddd:I(`Կիր;Երկ;Երք;Չրք;Հնգ;Ուր;Շբթ`),currency:`֏`,format:R(_a),sysdate:`d mmmm, yyyy`,systime:`hh:mm:ss`},`hy`),z(ca({decimal:`,`,mmmm:L(`იანვარი;თებერვალი;მარტი;აპრილი;მაისი;ივნისი;ივლისი;აგვისტო;სექტემბერი;ოქტომბერი;ნოემბერი;დეკემბერი`),dddd:I(`კვირა;ორშაბათი;სამშაბათი;ოთხშაბათი;ხუთშაბათი;პარასკევი;შაბათი`),ddd:I(`კვ;ორშ;სამშ;ოთხშ;ხუთშ;პარ;შაბ`),currency:`₾`,format:R(_a),sysdate:`dddd, dd mmmm, yyyy`,systime:`hh:mm:ss`},3,-1),`ka`),z(ca({decimal:`,`,mmmm:L(`Қаңтар;Ақпан;Наурыз;Сәуір;Мамыр;Маусым;Шілде;Тамыз;Қыркүйек;Қазан;Қараша;Желтоқсан`),mmm:L(`қаң;ақп;нау;сәу;мам;мау;шіл;там;қыр;қаз;қар;жел`),dddd:I(`жексенбі;дүйсенбі;сейсенбі;сәрсенбі;бейсенбі;жұма;сенбі`),ddd:I(`жек;дүй;сей;сәр;бей;жұм;сен`),opcodes:{dy:`г`,dm:`м`,dd:`д`,th:`ч`,tm:`м`,ts:`с`},currency:`₸`,general:`Основной`,format:R(_a),sysdate:`yyyy ж. d mmmm, dddd`,systime:`hh:mm:ss`},-1,-1),`kk`),z({group:`,`,mmmm:L(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಏಏಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್`),mmm:L(`ಜನವರಿ;ಫೆಬ್ರವರಿ;ಮಾರ್ಚ್;ಎಪ್ರಿಲ್;ಮೇ;ಜೂನ್;ಜುಲೈ;ಆಗಸ್ಟ್;ಸೆಪ್ಟಂಬರ್;ಅಕ್ಟೋಬರ್;ನವೆಂಬರ್;ಡಿಸೆಂಬರ್`),dddd:I(`ಭಾನು~;ಸೋಮ~;ಮಂಗಳ~;ಬುಧ~;ಗುರು~;ಶುಕ್ರ~;ಶನಿ~`,`ವಾರ`),ddd:I(`ಭಾನು;ಸೋಮ;ಮಂಗಳ;ಬುಧ;ಗುರು;ಶುಕ್ರ;ಶನಿ`),ampm:sa(`ಪೂರ್ವಾಹ್ನ;ಅಪರಾಹ್ನ`),currency:`₹`,format:R(ya),sysdate:`dd mmmm yyyy`,systime:`hh:mm:ss`},`kn`),z({decimal:`,`,mmmm:L(`sausis;vasaris;kovas;balandis;gegužė;birželis;liepa;rugpjūtis;rugsėjis;spalis;lapkritis;gruodis`),mmm:L(`saus;vas;kov;bal;geg;birž;liep;rugp;rugs;spal;lapkr;gruod`),dddd:I(`sekmadienis;pirmadienis;antradienis;trečiadienis;ketvirtadienis;penktadienis;šeštadienis`),ddd:I(`sk;pr;an;tr;kt;pn;št`),ampm:sa(`priešpiet;popiet`),currency:`€`,format:R({o:2,k:`-`}),sysdate:`yyyy "m." mmmm d "d.," dddd`,systime:`hh:mm:ss`},`lt`),z({decimal:`,`,mmmm:L(`janvāris;februāris;marts;aprīlis;maijs;jūnijs;jūlijs;augusts;septembris;oktobris;novembris;decembris`),mmm:L(`janv;febr;marts;apr;maijs;jūn;jūl;aug;sept;okt;nov;dec`),dddd:I(`svētdiena;pirmdiena;otrdiena;trešdiena;ceturtdiena;piektdiena;sestdiena`),ddd:I(`Svētd;Pirmd;Otrd;Trešd;Ceturtd;Piektd;Sestd`),ampm:sa(`priekšp.;pēcp.`),currency:`€`,format:R(_a),sysdate:`dddd, yyyy. "gada" d. mmmm`,systime:`hh:mm:ss`},`lv`),z({group:`,`,decimal:`.`,mmmm:L(`ജനുവരി;ഫെബ്രുവരി;മാര്‍‌ച്ച്;ഏപ്രില്‍;മേയ്;ജൂൺ;ജൂലൈ;ആഗസ്റ്റ്;സെപ്‌റ്റംബര്‍;ഒക്‌ടോബര്‍;നവംബര്‍;ഡിസംബര്‍`),mmm:L(`ജനു;ഫെബ്രു;മാർ;ഏപ്രി;മേയ്;ജൂൺ;ജൂലൈ;ഓഗ;സെപ്റ്റം;ഒക്ടോ;നവം;ഡിസം`),dddd:I(`ഞായറാഴ്‌ച;തിങ്കളാഴ്‌ച;ചൊവ്വാഴ്ച;ബുധനാഴ്‌ച;വ്യാഴാഴ്‌ച;വെള്ളിയാഴ്‌ച;ശനിയാഴ്‌ച`),ddd:I(`ഞായർ;തിങ്കൾ;ചൊവ്വ;ബുധൻ;വ്യാഴം;വെള്ളി;ശനി`),currency:`₹`,format:R({d:0,m:0,h:0,y:0,f:0,o:1,k:`/`,b:`:`,s:0}),sysdate:`yyyy, mmmm d, dddd`,systime:`h:mm:ss AM/PM`},`ml`),z({group:`,`,decimal:`.`,mmmm:L(`Нэгдүгээ~;Хоёрдугаа~;Гуравдугаа~;Дөрөвдүгээ~;Тавдугаа~;Зургаадугаа~;Долоодугаа~;Наймдугаа~;Есдүгээ~;Аравдугаа~;Арван нэгдүгээ~;Арван хоёрдугаар са`,`р сар`),mmm:L(`1~;2~;3~;4~;5~;6~;7~;8~;9~;10~;11~;12~`,`-р сар`),dddd:I(`ням;даваа;мягмар;лхагва;пүрэв;баасан;бямба`),ddd:I(`Ня;Да;Мя;Лха;Пү;Ба;Бя`),ampm:sa(`ү.ө.;ү.х.`),currency:`₮`,format:R({o:2,f:2,k:`.`,l:`.`}),sysdate:`yyyy оны mmmmын d, dddd гараг`,systime:`hh:mm:ss`},`mn`),z({group:`,`,decimal:`.`,ampm:[`म.पू.`,`म.नं.`],mmmm:L(`जानेवारी;फेब्रुवारी;मार्च;एप्रिल;मे;जून;जुलै;ऑगस्ट;सप्टेंबर;ऑक्टोबर;नोव्हेंबर;डिसेंबर`),mmm:L(`जाने;फेब्रु;मार्च;एप्रि;मे;जून;जुलै;ऑग;सप्टें;ऑक्टो;नोव्हें;डिसें`),dddd:I(`रविवार;सोमवार;मंगळवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:I(`रवि;सोम;मंगळ;बुध;गुरु;शुक्र;शनि`),currency:`₹`,format:R(ba),sysdate:`dd mmmm yyyy`,systime:`hh:mm:ss`},`mr`),z(ca({group:`,`,decimal:`.`,mmmm:L(`ဇန်နဝါရီ;ဖေဖော်ဝါရီ;မတ်;ဧပြီ;မေ;ဇွန်;ဇူလိုင်;ဩဂုတ်;စက်တင်ဘာ;အောက်တိုဘာ;နိုဝင်ဘာ;ဒီဇင်ဘာ`),mmm:L(`ဇန်;ဖေ;မတ်;ဧ;မေ;ဇွန်;ဇူ;ဩ;စက်;အောက်;နို;ဒီ`),dddd:I(`တနင်္ဂနွေ;တနင်္လာ;အင်္ဂါ;ဗုဒ္ဓဟူး;ကြာသပတေး;သောကြာ;စနေ`),ampm:sa(`နံနက်;ညနေ`),currency:`K`,format:R({h:0,d:0,m:0}),sysdate:`yyyy၊ mmmm d၊ dddd`,systime:`h:mm:ss`},-1,0),`my`),z(ca({group:`,`,decimal:`.`,mmmm:L(`ਜਨਵਰੀ;ਫ਼ਰਵਰੀ;ਮਾਰਚ;ਅਪ੍ਰੈਲ;ਮਈ;ਜੂਨ;ਜੁਲਾਈ;ਅਗਸਤ;ਸਤੰਬਰ;ਅਕਤੂਬਰ;ਨਵੰਬਰ;ਦਸੰਬਰ`),dddd:I(`ਐਤਵਾਰ;ਸੋਮਵਾਰ;ਮੰਗਲਵਾਰ;ਬੁੱਧਵਾਰ;ਵੀਰਵਾਰ;ਸ਼ੁੱਕਰਵਾਰ;ਸ਼ਨਿੱਚਰਵਾਰ`),ddd:I(`ਐਤ;ਸੋਮ;ਮੰਗਲ;ਬੁੱਧ;ਵੀਰ;ਸ਼ੁਕਰ;ਸ਼ਨਿੱਚਰ`),ampm:[`ਸਵੇਰ`,`ਸ਼ਾਮ`],currency:`₹`,format:R({d:1,i:1,y:1,f:2,o:1,k:`-`,b:`:`,s:1}),sysdate:`dd mmmm yyyy dddd`,systime:`AM/PM hh:mm:ss`}),`pa`),z({group:`.`,decimal:`,`,mmmm:L(`ianuarie;februarie;martie;aprilie;mai;iunie;iulie;august;septem~;octom~;noiem~;decem~`,`brie`),mmm:L(`ian;feb;mar;apr;mai;iun;iul;aug;sept;oct;nov;dec`),dddd:I(`duminică;luni;marți;miercuri;joi;vineri;sâmbătă`),ddd:I(`dum;lun;mar;mie;joi;vin;sâm`),ampm:sa(`a.m.;p.m.`),currency:`lei`,format:R(_a),sysdate:`dddd, d mmmm yyyy`,systime:`hh:mm:ss`},`ro`),z(ca({group:`.`,decimal:`,`,mmmm:L(`januar;februar;marec;april;maj;junij;julij;avgust;september;oktober;november;december`),dddd:I(`nedelja;ponedeljek;torek;sreda;četrtek;petek;sobota`),ampm:sa(`dop.;pop.`),currency:`€`,format:R({d:0,k:`.`,l:`.`}),sysdate:`dddd, d. mmmm yyyy`,systime:`hh:mm:ss`},3,3),`sl`),z(ca({group:`.`,decimal:`,`,mmmm:L(`januar;februar;mart;april;maj;jun;jul;avgust;septembar;oktobar;novembar;decembar`),dddd:I(`nedelja;ponedeljak;utorak;sreda;četvrtak;petak;subota`),currency:`RSD`,format:R({d:0,m:0,k:`.`,l:`.`}),sysdate:`dddd, d. mmmm yyyy.`,systime:`hh:mm:ss`},3,3),`sr`),z(ca({group:`,`,decimal:`.`,ampm:[`காலை`,`மாலை`],mmmm:L(`ஜனவரி;பிப்ரவரி;மார்ச்;ஏப்ரல்;மே;ஜூன்;ஜூலை;ஆகஸ்ட்;செப்டம்பர்;அக்டோபர்;நவம்பர்;டிசம்பர்`),dddd:I(`ஞாயிறு;திங்கள்;செவ்வாய்;புதன்;வியாழன்;வெள்ளி;சனி`),currency:`₹`,format:R({d:1,y:0,f:2,o:1,k:`-`,b:`:`,s:1}),sysdate:`dd mmmm yyyy`,systime:`hh:mm:ss`}),`ta`),z({group:`,`,decimal:`.`,mmmm:L(`జనవరి;ఫిబ్రవరి;మార్చి;ఏప్రిల్;మే;జూన్;జులై;ఆగస్టు;సెప్టెంబర్;అక్టోబర్;నవంబర్;డిసెంబర్`),mmm:L(`జన;ఫిబ్ర;మార్చి;ఏప్రి;మే;జూన్;జులై;ఆగ;సెప్టెం;అక్టో;నవం;డిసెం`),dddd:I(`ఆదివారం;సోమవారం;మంగళవారం;బుధవారం;గురువారం;శుక్రవారం;శనివారం`),ddd:I(`ఆది;సోమ;మంగళ;బుధ;గురు;శుక్ర;శని`),currency:`₹`,format:R({d:1,h:0,y:0,f:0,o:1,k:`-`,b:`:`,s:0}),sysdate:`d, mmmm yyyy, dddd`,systime:`h:mm:ss AM/PM`},`te`),z({decimal:`,`,mmmm:L(`січень;лютий;березень;квітень;травень;червень;липень;серпень;вересень;жовтень;листопад;грудень`),mmm:L(`Січ;Лют;Бер;Кві;Тра;Чер;Лип;Сер;Вер;Жов;Лис;Гру`),dddd:I(`неділя;понеділок;вівторок;середа;четвер;п'ятниця;субота`),ddd:I(`Нд;Пн;Вт;Ср;Чт;Пт;Сб`),ampm:sa(`дп;пп`),currency:`₴`,format:R({h:0,k:`.`,l:`.`}),sysdate:`d mmmm yyyy "р."`,systime:`h:mm:ss`},`uk`),z({group:`.`,decimal:`,`,mmmm:L(`~Giêng;~Hai;~Ba;~Tư;~Năm;~Sáu;~Bảy;~Tám;~Chín;~Mười;~Mười Một;~Mười Hai`,`Tháng `),mmm:L(`~1;~2;~3;~4;~5;~6;~7;~8;~9;~10;~11;~12`,`Thg`),dddd:I(`Chủ Nhật;~Hai;~Ba;~Tư;~Năm;~Sáu;~Bảy`,`Thứ `),ddd:I(`CN;T2;T3;T4;T5;T6;T7`),ampm:sa(`SA;CH`),currency:`₫`,format:R({h:0,d:1}),sysdate:`dd mmmm yyyy`,systime:`h:mm:ss AM/PM`},`vi`),z(ca({group:`٬`,decimal:`٫`,ampm:sa(`ص;م`),percent:`٪`,mmmm:L(`يناير;فبراير;مارس;أبريل;مايو;يونيو;يوليو;أغسطس;سبتمبر;أكتوبر;نوفمبر;ديسمبر`),dddd:I(`الأحد;الإثنين;الثلاثاء;الأربعاء;الخميس;الجمعة;السبت`),mmmm6:L(`رمضان;شوال;ذو القعدة;ذو الحجة;محرم;ربيع الأول;ربيع الآخرة;جمادى الأولى;جمادى الآخرة;رجب;شعبان;رمضان`),color:`اللون`,colors:{أسود:la,أبيض:ua,أحمر:da,أخضر:fa,أزرق:pa,أصفر:ma,ماجنتا:ha,سماوي:ga},currency:`⃁`,format:R({f:2,i:1,y:1,s:1}),sysdate:`dd/mmmm/yyyy`,systime:`hh:mm:ss AM/PM`},0,0),`ar`),z({group:`,`,decimal:`.`,ampm:[`AM`,`PM`],mmmm:L(`জানুয়ারী;ফেব্রুয়ারী;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগস্ট;সেপ্টেম্বর;অক্টোবর;নভেম্বর;ডিসেম্বর`),mmm:L(`জানু;ফেব্রু;মার্চ;এপ্রিল;মে;জুন;জুলাই;আগ;সেপ্টে;অক্টো;নভে;ডিসে`),dddd:I(`রবিবার;সোমবার;মঙ্গলবার;বুধবার;বৃহস্পতিবার;শুক্রবার;শনিবার`),ddd:I(`রবি.;সোম.;মঙ্গল.;বুধ.;বৃহস্পতি.;শুক্র.;শনি.`),currency:`₹`,format:R({f:2,y:1,k:`-`,b:`.`,s:1}),sysdate:`dd mmmm yyyy`,systime:`hh.mm.ss`},`bn`),z({group:`,`,decimal:`.`,mmmm:L(`जनवरी;फरवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितम्बर;अक्तूबर;नवम्बर;दिसम्बर`),mmm:L(`जनवरी;फरवरी;मार्च;अप्रैल;मई;जून;जुलाई;अगस्त;सितम्बर;अक्तूबर;नवम्बर;दिसम्बर`),dddd:I(`रविवार;सोमवार;मंगलवार;बुधवार;गुरुवार;शुक्रवार;शनिवार`),ddd:I(`रवि.;सोम.;मंगल.;बुध.;गुरु.;शुक्र.;शनि.`),ampm:[`पूर्वाह्न`,`अपराह्न`],currency:`₹`,format:R(ba),sysdate:`dd mmmm yyyy`,systime:`hh:mm:ss`},`hi`)}var Ca=e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),wa=RegExp(`^[`+Ca(oa.join(``))+`]`);function Ta(e){let t=[];t.push([ci,/^General/i,0]),e.general&&e.general!==`General`&&t.push([ci,RegExp(`^${Ca(e.general)}`,`i`),0]),e.colors&&t.push([Mi,RegExp(`^\\[(${Object.keys(e.colors).map(Ca).join(`|`)})\\]`,`i`),1]),e.color&&t.push([Mi,RegExp(`^\\[(${Ca(e.color)}\\s*\\d+)\\]`,`i`),1]);let n,r;if(e.opcodes){let t=Ca(e.opcodes.dy??`y`),i=Ca(e.opcodes.dm??`m`),a=Ca(e.opcodes.dd??`d`),o=Ca(e.opcodes.th??`h`),s=Ca(e.opcodes.tm??`m`),c=Ca(e.opcodes.ts??`s`),l=Ca(e.opcodes.wd??`a`),u=Ca(e.opcodes.en??`g`),d=`[${t+t.toUpperCase()}]+|[${i+i.toUpperCase()}]+|[${a+a.toUpperCase()}]+|[${o+o.toUpperCase()}]+|[${s+s.toUpperCase()}]+|[${c+c.toUpperCase()}]+|[${l+l.toUpperCase()}]{3,}|[${u+u.toUpperCase()}]+|[bB]+|e+`;n=RegExp(`^(?:${d})`),r=RegExp(`^(?:\\[(${Ca(o)}+|${Ca(s)}+|${Ca(c)}+)\\]+)`,`i`)}else n=/^(?:[hH]+|[mM]+|[sS]+|[yY]+|[bB]+|[dD]+|[gG]+|[aA]{3,}|e+)/,r=/^(?:\[(h+|m+|s+)\])/i;return(e.currency.length>1||!oa.includes(e.currency))&&t.push([Vi,RegExp(`^(?:${Ca(e.currency)})`),0]),t.push([li,/^#/,0],[ui,/^0/,0],[di,/^\?/,0],[fi,/^\//,0],[gi,/^;/,0],[_i,/^@/,0],[vi,/^\+/,0],[yi,/^-/,0],[bi,/^\./,0],[xi,/^ /,0],[Si,/^%/,0],[Pi,/^(?:AM\/PM|am\/pm|A\/P)/,0],[Vi,wa,0],[Ci,/^[1-9]/,0],[wi,/^(?:B[12])/i,0],[Ti,/^B$/,0],[Ei,n,0],[Di,r,1],[Oi,/^\[((?:<[=>]?|>=?|=)\s*(?:-?[.\d]+))\]/,1],[ki,/^\[(DBNum[0-4]?\d)\]/i,1],[Ai,/^\[(NatNum[0-4]?\d)\]/i,1],[ji,/^\[\$([^\]]*)\]/,1],[Mi,/^\[(black|blue|cyan|green|magenta|red|white|yellow|color\s*\d+)\]/i,1],[Ni,/^\[([^\]])\]/,1],[Fi,/^\\(.)/,1],[Ii,/^"([^"]*?)"/,1],[Li,/^_(\\.|.)/,1],[`EXP`,/^[Ee]([+-])/,1],[Ri,/^\*(\\.|.)/,1],[zi,/^[()]/,0],[Ti,/^[EÈÉÊËèéêëĒēĔĕĖėĘęĚěȄȅȆȇȨȩNnÑñŃńŅņŇňǸǹ["*/\\_]/,0],[Bi,/^./,0]),t}var Ea=63,Da=35,Oa=48,ka=57,Aa=e=>{let t=(e||`\0`).charCodeAt(0);return t===Ea||t===Da||t>=Oa&&t<=ka};function ja(e,t){let n=0,r=[],i=[];for(;n<e.length;){let a=e.slice(n),o=0,s=/^(,+)(.)?/.exec(a);if(s){let t=s[1];o=t.length;let a=e[n-1]||``,c=!1,l=!1;Aa(a)?(c=!0,l=!0):a===`.`&&(l=!0);let u=s[2]||``;if(c&&(!u||u===`;`)&&(c=!1),l&&Aa(u)&&(l=!1),c&&!l)r.push({type:pi,value:`,`,raw:t});else if(!c&&l)r.push({type:mi,value:`,`,raw:t});else if(c&&l){let e={type:mi,value:`,`,raw:t};r.push(e),i.push(e)}else r.push({type:hi,value:`,`,raw:t})}else{let e;for(let[n,i,s]of t){let t=i.exec(a);if(t){e={type:n,value:t[s||0],raw:t[0]},r.push(e),o=t[0].length;break}}i.length&&e?.raw===`;`&&(i.length=0),e&&i.length&&Aa(e.raw)&&(i.forEach(e=>e.type=pi),i.length=0)}if(!o){let e=a[0];o=1,r.push({type:Bi,value:e,raw:e})}n+=o}return r}function Ma(e){return ja(e,Ta(Va))}var Na=/^([a-z\d]+)(?:[_-]([a-z\d]+))?(?:\.([a-z\d]+))?(?:@([a-z\d]+))?$/i,Pa={},Fa={group:`\xA0`,decimal:`.`,positive:`+`,negative:`-`,percent:`%`,exponent:`E`,nan:`NaN`,infinity:`∞`,ampm:[`AM`,`PM`],mmmm6:[`Muharram`,`Safar`,`Rabiʻ I`,`Rabiʻ II`,`Jumada I`,`Jumada II`,`Rajab`,`Shaʻban`,`Ramadan`,`Shawwal`,`Dhuʻl-Qiʻdah`,`Dhuʻl-Hijjah`],mmm6:[`Muh.`,`Saf.`,`Rab. I`,`Rab. II`,`Jum. I`,`Jum. II`,`Raj.`,`Sha.`,`Ram.`,`Shaw.`,`Dhuʻl-Q.`,`Dhuʻl-H.`],mmmm:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],mmm:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dddd:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],ddd:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],bool:[`TRUE`,`FALSE`],general:`General`,currency:`$`,sysdate:`dddd, mmmm d, yyyy`,systime:`h:mm:ss AM/PM`,color:`Color`,colors:{black:`Black`,white:`White`,red:`Red`,green:`Green`,blue:`Blue`,yellow:`Yellow`,magenta:`Magenta`,cyan:`Cyan`},format:{minus:!0,dateOrder:1,currencyPos:2,monthFirst:!0,padMm:!0,padDd:!0,padHh:!0}};function Ia(e){let t=Na.exec(e);if(!t)throw SyntaxError(`Invalid locale: ${e}`);return{lang:t[1]+(t[2]?`-`+t[2]:``),language:t[1],territory:t[2]||``}}function La(e){if(typeof e==`number`)return si[e&65535]||void 0;let t=parseInt(e,16);if(isFinite(t)&&si[t&65535])return si[t&65535]||void 0;if(Na.test(e))return e}function Ra(e){let t;if(e){let n=La(e);if(n){let e=Ia(n);t=Pa[e.lang]||Pa[e.language]||void 0}}return t}function za(e){let t=ja(e||``,Ta(Fa)),n=t.findIndex(e=>e.type===`DATETIME`&&/^m/i.test(e.value)),r=t.findIndex(e=>e.type===`DATETIME`&&/^dd?$/i.test(e.value));return n>=0&&r>=0&&n<r}function Ba(e){let t=e.sysdate??Fa.sysdate;return{...Fa,...e,opcodes:{...Fa.opcodes,...e.opcodes},format:{...Fa.format,...e.format,monthFirst:e.format?.monthFirst??za(t)}}}function z(e,t){let n=typeof t==`object`?t:Ia(t);return Pa[n.lang]=Ba(e),n.language!==n.lang&&!Pa[n.language]&&(Pa[n.language]=Ba(e)),Pa[n.lang]}Sa();var Va=Ra(`en`);if(!Va)throw Error(`numfmt default locale is missing!`);var Ha={overflow:`######`,dateErrorThrows:!1,dateErrorNumber:!0,bigintErrorNumber:!1,dateSpanLarge:!0,leap1900:!0,nbsp:!1,throws:!0,invalid:`######`,locale:``,ignoreTimezone:!1,grouping:[3,3],indexColors:!0,skipChar:``,fillChar:``},Ua=[];for(let e=0;e<=22;e++)Ua[e]=10**e;var Wa=48,Ga=22250738585072014e-324,Ka=134217729;function qa(e){return e>=0&&e<=22?Ua[e]:10**e}function Ja(e,t){let n=14-t;if(n>=0&&n<=22){let t=Ua[n],r=e*t,i=Ka*e,a=i-(i-e),o=e-a;i=Ka*t;let s=i-(i-t),c=t-s,l=a*s-r+a*c+o*s+o*c,u=Math.floor(r);return r-u-.5>-l?u+1:u}if(n<0&&n>=-22){let t=Ua[-n],r=e%t,i=Math.round((e-r)/t);return r>t/2?i+1:i}return NaN}function Ya(e){let t=e.indexOf(`e`),n=+e.slice(t+1),r=e.charAt(0)+e.slice(2,t);if(r.length<=15)return[+r*Ua[15-r.length],n];let i=+r.slice(0,15),a=r.charCodeAt(15);return(a>53||a===53&&/[1-9]/.test(r.slice(16)))&&i++,i>=0x38d7ea4c68000?[i/10,n+1]:[i,n]}function Xa(e){if(e<Ga)return Ya(e.toExponential());let t=Math.floor(Math.log10(e));e<qa(t)?t--:e>=qa(t+1)&&t++;let n=Ja(e,t);return n>=0x38d7ea4c68000?(t++,n=Ja(e,t)):n<0x5af3107a4000&&(t--,n=Ja(e,t)),n===n?n>=0x38d7ea4c68000?[n/10,t+1]:[n,t]:Ya(e.toExponential(14))}function Za(e,t){return t>=0&&t<=22?e*Ua[t]:t<0&&t>=-22?e/Ua[-t]:+(e+`e`+t)}function Qa(e,t){if(t>=15)return e;let n=qa(15-t),r=Math.floor(e/n);return(e-r*n)*2>=n?r+1:r}function $a(e,t){if(!e)return[0,0];if(t>=0&&e<0x38d7ea4c68000&&Number.isInteger(e))return[e,0];let[n,r]=Xa(e),i=r+1+t;return i>=15?[n,r-14]:[Qa(n,i),-t]}function eo(e,t,n,r){if(!e)return[0,0,0];let[i,a]=Xa(e);for(;;){let e=n>1?Math.floor(a/n)*n:a;r||e++;let o=a-e+1+t;if(o>=15)return[i,a-14-e,e];let s=Qa(i,o);if(o<0||s<qa(o))return[s,-t,e];i=0x5af3107a4000,a++}}function to(e,t){if(!e)return[``,``];let n=String(e);if(t>=0)return[t?n+`0`.repeat(t):n,``];let r=n.length+t,i=n.length;for(;i>0&&n.charCodeAt(i-1)===Wa;)i--;return[r>0?n.slice(0,r):``,i>r?(r>=0?``:`0`.repeat(-r))+n.slice(Math.max(r,0),i):``]}function no(e,t=0){if(e<0)return-no(-e,t);if(t){let n=10**t||1;return Math.round(e*n)/n}return Math.round(e)}function ro(e,t=0){return typeof e==`number`?e<0?-ro(-e,t):!e||!isFinite(e)?e:Za(...$a(e,t)):NaN}var io=1e-13;function ao(e,t=2,n=2){let r=e<0?-1:1,i=10**(t||2),a=10**(n||2),o=Math.abs(e),s=0,c=0,l=0,u=1,d,f;if(e=o,e%1==0)f=[e*r,1];else if(e<1e-19)f=[r,0x8ac7230489e80000];else if(e>0x8ac7230489e80000)f=[0x8ac7230489e80000*r,1];else{do if(o=1/(o-Math.floor(o)),d=u,u=u*Math.floor(o)+s,s=d,c=l,l=Math.floor(e*u+.5),l>=i||u>=a)return[r*c,s];while(Math.abs(e-l/u)>=io&&o!==Math.floor(o));f=[r*l,u]}return f}var oo=Math.floor;function so(e,t=!0){if(t&&e>=0){if(e===0)return[1900,1,0];if(e===60)return[1900,2,29];if(e<60)return[1900,e<32?1:2,(e-1)%31+1]}let n=e+68569+2415019,r=oo(4*n/146097);n-=oo((146097*r+3)/4);let i=oo(4e3*(n+1)/1461001);n=n-oo(1461*i/4)+31;let a=oo(80*n/2447),o=n-oo(2447*a/80);n=oo(a/11);let s=a+2-12*n;return[100*(r-49)+i+n|0,s|0,o|0]}function co(e){return so(e+1462)}function lo(e){if(e===60)throw Error(`#VALUE!`);if(e<=1)return[1317,8,29];if(e<60)return[1317,e<32?9:10,1+(e-2)%30];let t=10631/30,n=8.01/60,r=e+466935,i=oo(r/10631);r-=10631*i;let a=oo((r-n)/t);r-=oo(a*t+n);let o=oo((r+28.5001)/29.5);return o===13?[30*i+a,12,30]:[30*i+a,o,r-oo(29.5001*o-29)]}function uo(e,t=0,n=!0){let r=oo(e);return t===6?lo(r):t===-1?co(r):so(r,n)}var fo=Math.floor;function po(e,t){let n;if(Array.isArray(e)){let[t,r,i,a,o,s]=e;n=Date.UTC(t,r==null?0:r-1,i??1,a||0,o||0,s||0)}else if(e instanceof Date&&(n=e.valueOf(),!t?.ignoreTimezone)){let t=new Date;t.setUTCFullYear(e.getFullYear(),e.getMonth(),e.getDate()),t.setUTCHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n=t.valueOf()}if(n!=null&&isFinite(n)){let e=fo(n/864e5),t=n-e*864e5;return e-(e<=-25509?-25568:-25569)+t/864e5}}var mo=`.`,ho=`,`,go=` `,_o=`\xA0`,vo=` `,yo=`'`,bo=`٬`,xo={".":[ho,_o,vo,yo,bo],",":[mo,_o,vo,yo,bo],"٫":[mo,_o,vo,yo,bo]},So=e=>e?.length===1&&e>=`0`&&e<=`9`;function Co(e,t){let n=t.decimal,r=[...xo[n]||[yo,bo]];!r.includes(t.group)&&t.group!==go&&t.group!==n&&r.push(t.group);let i=``,a=``,o=1,s=0,c=!1,l=!1,u=!1,d=!1,f=!1,p=0,m=[go,_o,vo,`+`,`%`,`(`,`-`].concat(oa);for(;m.includes(e[p]);){let t=e[p];if(t===`-`){if(c||l)return;c=!0,o=-1}else if(wa.test(t)){if(f)return;f=!0}else if(t===`(`){if(l||c)return;l=!0,o=-1}else if(t===`%`){if(d)return;d=!0}p++}let h=!1,g;if(e[p]===n||So(e[p]))for(;p<e.length;){let t=e[p];if(!g&&r.includes(t))g=t;else if(!(g&&g===t)){if(t===n){if(h)break;i+=`.`,h=!0}else if(So(t))i+=t;else break}p++}if(e[p]===`e`||e[p]===`E`){a+=e[p],p++,(e[p]===`+`||e[p]===`-`)&&(a+=e[p],p++);let t=p;for(;So(e[p]);)a+=e[p],p++;if(t===p)return}let _=[go,_o,vo,`%`,`$`,`)`].concat(oa);for(;_.includes(e[p]);){let t=e[p];if(wa.test(t)){if(f)return;f=!0}else if(t===`)`){if(u||!l)return;u=!0}else if(t===`%`){if(d)return;d=!0}p++}if(p!==e.length)return;let v=parseFloat(i+a);if(!isFinite(v))return;if(a){if(d||f)return;s=11}else if(d){if(f)return;s=i.includes(`.`)?10:9,v*=.01}else f?s=i.includes(`.`)?7:5:g&&(s=i.includes(`.`)?4:3);let y={value:v*o};return s&&(y.formatId=s),y}function wo(e){let t=``,n=0,r=``,i=!1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a);o>=48&&o<=57?(t+=n>=15?`0`:e[a],n++):o===46?t+=`.`:o===45?i?t+=`-`:r=`-`:(o===101||o===69)&&(t+=`e`,i=!0,n=0)}return t?Number(r+t):NaN}var To=` `,Eo=`\xA0`,Do=` `,Oo=e=>e?.length===1&&e>=`0`&&e<=`9`,ko=e=>e===Eo||e===Do;function Ao(e,t){let n=t.decimal,r=t.group!==To&&t.group!==n?t.group:``,i=t.format?.currencyPos??0,a=``,o=``,s=1,c=!1,l=!1,u=!1,d=!1,f=!1,p=!1,m=null,h=0;if(ko(e[h]))return;let g=t.currency??`$`,_=``;do{if(_=e[h],_===`-`){if(c||u||l)return;c=!0,s=-1}else if(_===`+`){if(c||l)return;l=!0}else if((i===0||i===2)&&e.slice(h).startsWith(g)){if(p)return;h+=Math.max(0,g.length-1),p=!0,m=_}else if(_===`€`){if(p)return;p=!0,m=_}else if(_===`(`){if(u||c)return;u=!0,s=-1}else if(_===`%`){if(f)return;f=!0}else if(_!==To&&_!==Do)break;h++}while(h<e.length);let v=!1,y=0,b=0;if(e[h]===n||Oo(e[h]))for(;h<e.length;){let t=e[h];if(t===r){if(v||!b&&(!a||!+a)||b&&y<3)return;y=0,b++}else if(t===n){if(v||b&&y<3)return;y=0,a+=`.`,v=!0}else if(Oo(t))y++,a+=t;else break;h++}if(!v&&b&&y<3)return;let x=!1,S=0,C=``,w=!v&&/^ +(\d+)\/(\d+)/.exec(e.slice(h));if(w&&(S=+w[1]/w[2],x=!0,C=w[2],h+=w[0].length),e[h]===`e`||e[h]===`E`){o+=e[h],h++,(e[h]===`+`||e[h]===`-`)&&(o+=e[h],h++);let t=h;for(;Oo(e[h]);)o+=e[h],h++;if(t===h)return}let T=``;for(;h<e.length;){if(_=e[h],T=_,(i===1||i===3)&&e.slice(h).startsWith(g)){if(p)return;h+=Math.max(0,g.length-1),p=!0,m=_}else if(_===`€`){if(p)return;p=!0,m=_}else if(_===`)`){if(d||!u)return;d=!0}else if(_===`%`){if(f)return;f=!0}else if(_!==To&&_!==Do)break;h++}if(ko(T)||h!==e.length||p&&f||d!==u||d&&l)return;let ee=wo(a+o);if(x&&(ee+=S),f&&(ee=+(ee*.01).toPrecision(15)),!isFinite(ee))return;let E;o?E=11:x?E=C.length>1?13:12:f?E=v?10:9:p&&m!==`€`?E=v?8:6:b&&m!==`€`&&(E=v?4:3);let D={value:ee?ee*s:0};return E&&(D.formatId=E),D}var jo=(e,t)=>t===2?e%4==0&&e%100!=0||e%400==0||e===1900?29:28:t===4||t===6||t===9||t===11?30:31;function Mo(e,t,n){return n<1||t<1||t>12?!1:n<=jo(e,t)}var No=e=>e.replace(/\s+/g,``).trim().replace(/\./g,``).toLowerCase();function Po(e,t){let n=/^\s*([10]?\d|2[0-4])(?::([0-5]\d|\d))?(?::([0-5]\d|\d))?(\.\d{1,10})?(?=\s*[^\s\d]|$)/.exec(e),r=``;if(n){let i=No(e.slice(n[0].length));if(i===No(t.ampm[0])||i===`a`||i===`am`)r=`a`;else if(i===No(t.ampm[1])||i===`p`||i===`pm`)r=`p`;else if(i===`:`)n[3]||=`0`,n[2]||=`0`;else if(i)return}if(n){let[,e,t,i,a]=n;if(a&&!i||!r&&!t&&!i)return;let o=(e||0)*1;if(r){if(o>=13)return;r===`a`?o===12&&(o=0):r===`p`&&o!==12&&(o+=12)}let s=(t||0)*1,c=(i||0)*1,l=(a||0)*1,u=r?18:20;return i&&u++,{value:(o*60*60+s*60+c+l)/86400,formatId:u}}}var Fo=class{maxSize;entries=new Map;constructor(e){this.maxSize=e}get(e){let t=this.entries.get(e);return t!==void 0&&(this.entries.delete(e),this.entries.set(e,t)),t}set(e,t){this.entries.delete(e),this.entries.set(e,t),this.entries.size>this.maxSize&&this.entries.delete(this.entries.keys().next().value)}getOrSet(e,t){let n=this.entries.has(e)?this.entries.get(e):t(e);return this.set(e,n),n}},Io=`!d-m-y.!d-m-Y.!j-m-y.!j-m-Y.!d-n-y.!d-n-Y.!j-n-y.!j-n-Y.?m-d-y.?m-d-Y.?m-j-y.?m-j-Y.?n-d-y.?n-d-Y.?n-j-y.?n-j-Y.d-M-y.d-M-Y.j-M-y.j-M-Y.M-d-y.M-d-Y.M-j-y.M-j-Y.d-F-y.d-F-Y.F-d-y.F-d-Y.F-j-y.F-j-Y.j-F-y.j-F-Y.y-F-d.y-F-j.y-M-d.y-M-j.Y-F-d.Y-F-j.Y-M-d.Y-m-d.Y-M-j.Y-m-j.Y-n-d.Y-n-j.j-F.j-M.d-F.d-M.n-d.n-j.n-Y.m-d.m-j.m-Y.M-Y.M-y.F-y.F-Y.Y-M.Y-n.Y-m.Y-F.Y-M`.split(`.`),Lo={},Ro={};function zo(e,t,n=1){if(e){let r=e[0],i=e.slice(1);r===`!`?zo(i,t,4):r===`?`?zo(i,t,2):(t[r]=t[r]||{},zo(i,t[r],n))}else t.$=n}function Bo(e,t){zo(e,t),zo(e+` x`,t),zo(e+` l`,t),zo(e+` l x`,t),zo(`l `+e,t),zo(`l `+e+` x`,t),zo(e+` D`,t),zo(e+` D x`,t),zo(`D `+e,t),zo(`D `+e+` x`,t)}Io.forEach(e=>{e.startsWith(`?`)||Bo(e,Lo),e.startsWith(`!`)||Bo(e,Ro)});var Vo=new Date().getUTCFullYear(),Ho=(e,t,n=!1)=>{for(let r of t)if(e.startsWith(r[0])){let t=r[0].length;return n&&(r[2]===`D`||r[2]===`M`)&&e[t]===`.`&&t++,[e.slice(0,t),r]}return[``,null]},Uo=(e,t,n,r)=>{let i=n.path||``,a=Object.keys(t);for(let o of a){let a;if(t[o]){if(o===`$`||o===`€`)e||(a=n);else if(o===`-`){let s=/^(\s*([./-]|,\s)\s*|\s+)/.exec(e);if(s){let c=s[1]===`-`||s[1]===`/`||s[1]===`.`?s[1]:` `;if(!n.sep||n.sep===c){let l=s[0].replace(/\s+/g,` `);a=Uo(e.slice(s[0].length),t[o],{...n,sep:c,path:i+l},r)}}}else if(o===` `){let s=/^[,.]?\s+/.exec(e);if(s){let c=s[0].replace(/\s+/g,` `);a=Uo(e.slice(s[0].length),t[o],{...n,path:i+c},r)}}else if(o===`j`||o===`d`){let s=/^(0?[1-9]|1\d|2\d|3[01])\b/.exec(e);s&&(a=Uo(e.slice(s[0].length),t[o],{...n,day:s[0],path:i+o},r))}else if(o===`n`||o===`m`){let s=/^(0?[1-9]|1[012])\b/.exec(e);s&&(a=Uo(e.slice(s[0].length),t[o],{...n,month:+s[0],_mon:s[0],path:i+o},r))}else if(o===`F`||o===`M`){let[s,c]=Ho(e,r.mon,r.mp);c?.[2]===o&&(a=Uo(e.slice(s.length),t[o],{...n,month:c[1],_mon:s,path:i+o},r))}else if(o===`l`||o===`D`){let[s,c]=Ho(e,r.day,r.dp);c?.[2]===o&&(a=Uo(e.slice(s.length),t[o],{...n,path:i+o},r))}else if(o===`y`){let s=/^\d\d\b/.exec(e);if(s){let c=+s[0]>=30?+s[0]+1900:+s[0]+2e3;a=Uo(e.slice(s[0].length),t[o],{...n,year:c,path:i+o},r)}}else if(o===`Y`){let s=/^\d\d\d\d\b/.exec(e);s&&(a=Uo(e.slice(s[0].length),t[o],{...n,year:+s[0],path:i+o},r))}else if(o===`x`){let s=Po(e,r.l10n);s&&(a=Uo(``,t[o],{...n,time:s.value,tf:s.formatId,path:i+o},r))}else throw Error(`Unknown date token "${o}"`);if(a&&Mo(n.year||1916,n.month||1,n.day?+n.day:1))return a}}},Wo=e=>e.replace(/\s+/g,` `).trim().replace(/’/,`'`).replace(/\.$/,``).toLowerCase(),Go=(e,t)=>{let n=e.map((e,n)=>[Wo(e),n+1,t]);return n.sort((e,t)=>t[0].length-e[0].length),n},Ko=e=>({mon:[...Go(e.mmmm,`F`),...Go(e.mmm,`M`)],mp:e.mmm[0].at(-1)===`.`,day:[...Go(e.dddd,`l`),...Go(e.ddd,`D`)],dp:e.ddd[0].at(-1)===`.`,l10n:e}),qo=new Fo(10);function Jo(e,t){let n=qo.getOrSet(t,Ko),r=Uo(Wo(e),t.format?.dateOrder?Lo:Ro,{path:``},n);if(r){if(r.sep===`.`&&r.path?.length===3)return;let e=+(r.year??Vo);r.day||=`1`;let t=-1/0;if(e<1900)return;e<=1900&&(r.month??0)<=2?t=25568:e<1e4&&(t=25569);let n=Date.UTC(e,(r.month??1)-1,+r.day)/864e5+t+(r.time||0);if(n>=0&&n<=2958465){let e=0,t=0;if(r.path){for(let e of r.path)e===`j`||e===`d`?t|=1:e===`n`||e===`m`||e===`M`||e===`F`?t|=2:(e===`y`||e===`Y`)&&(t|=4);t===3&&(e=16),t===6&&(e=17),t===7&&(e=14)}return r.tf&&(e=22),{value:n,formatId:e}}}}var Yo=48,Xo=57,Zo=32,Qo=44,$o=46,es=58,ts=65;function ns(e,t){return e>=Yo&&e<=Xo?`0`:e===es?`:`:e===$o&&t<ts?`.`:e===Zo?`_`:e===160||e===8239?`~`:`?`}function rs(e,t){return e>=Yo&&e<=Xo?`0`:e===es?`:`:e===Qo&&t<ts?`.`:e===$o&&t<ts?`!`:e===Zo?`_`:e===160||e===8239?`~`:`?`}function is(e,t){let n=[],r={type:``,value:``},i=-1;for(let a=0;a<e.length;a++){let o=e.charCodeAt(a),s=t(o,i);r.type!==s&&(r.value&&n.push(r),r={type:s,value:``}),r.value+=e[a],i=o}return r.value&&n.push(r),n}function as(e,t,n,r,i){let a=+(t||0),o=+(n||0),s=r?Number(`.`+(r.slice(0,3)||`0`)):0,c=(e||0)*1;if(i){if(c>=13||o>=60||a>=60)return NaN;i===`a`?c===12&&(c=0):i===`p`&&c!==12&&(c+=12)}let l=0;return a>=60&&l++,o>=60&&l++,c>=24&&l++,l>1?NaN:(c*60*60+a*60+o+s)/86400}var os=e=>e.replace(/\s+/g,``).toLowerCase(),ss={a:`a`,"a.":`a`,"a:":`a`,am:`a`,p:`p`,"p.":`p`,"p:":`p`,pm:`p`};function cs(e){return/^\d\d?$/.test(e)}function ls(e){return/^\d{0,10}$/.test(e)}var us=(e,t)=>{let n=os(t);return e===n||e===n.charAt(0)};function ds(e){return e[1]?.value===`:`?{h:e[0].value,m:e[2]?.value??`0`,s:e[4]?.value??`0`,f:`0`,ap:``,z:+e[0].value>23?46:e[4]?21:20}:null}function fs(e){return{h:e[0].value,m:`0`,s:`0`,f:`0`,ap:os(e[2].value),z:18}}function ps(e){return{h:e[0].value,m:e[2].value,s:`0`,f:`0`,ap:os(e[4].value),z:18}}var ms={"0:":ds,"0:0":ds,"0:0.":ds,"0:0!":ds,"0:0:":ds,"0:0:0":ds,"0:0.0":e=>({h:`0`,m:e[0].value,s:e[2].value,f:e[4].value,ap:``,z:47}),"0:0:0.0":e=>({h:e[0].value,m:e[2].value,s:e[4].value,f:e[6].value,ap:``,z:47}),"0:0:0!0":(e,t)=>t?{h:e[0].value,m:e[2].value,s:e[4].value,f:`0`,ap:``,z:21}:null,"0_?":fs,"0_?:":fs,"0:0_?":ps,"0:0_?:":ps,"0:0:0_?":e=>({h:e[0].value,m:e[2].value,s:e[4].value,f:`0`,ap:os(e[6].value),z:+e[0].value>23?46:19})};function hs(e,t,n=!1){let r=is(e,t.decimal===`,`?rs:ns),i=ms[r.reduce((e,t)=>e+t.type,``)]?.(r,n);if(!i)return;let{h:a,m:o,s,f:c,ap:l,z:u}=i;if(cs(a)&&cs(o)&&cs(s)&&ls(c)){let e=ss[l];e||l!==`a,`&&l!==`p,`||t.decimal!==`,`||(e=ss[l[0]]);let n=``;if(us(l,t.ampm[0])||e===`a`)n=`a`;else if(us(l,t.ampm[1])||e===`p`)n=`p`;else if(l)return;let r=as(a,o,s,c,n);if(isFinite(r)){let e={value:r,formatId:u};return(+o>59||+s>59)&&delete e.formatId,e}}}var gs=new Date().getUTCFullYear(),_s=e=>e.trim().replace(/\s+/g,` `).replace(/’/,`'`).replace(/\.$/,``).toLowerCase(),vs=e=>/^\d+$/.test(e),ys=e=>{let t={};e.dddd.forEach(e=>{if(!vs(e)){let n=_s(e);for(let e=3;e<=n.length;e++)t[n.slice(0,e)]=[`dddd`,0]}});for(let n of e.ddd)if(!vs(n)){let e=_s(n);t[e]=[`ddd`,0]}return e.mmmm.forEach((e,n)=>{if(!vs(e)){let r=_s(e);for(let e=3;e<=r.length;e++)t[r.slice(0,e)]=[`mmmm`,n+1]}}),e.mmm.forEach((e,n)=>{if(!vs(e)){let r=_s(e);t[r]=[`mmm`,n+1]}}),t},bs=new Fo(10);function xs(e,t,n){if(Mo(e,t,n)){let r=-1/0;if(e<1900)return null;e<=1900&&t<=2?r=25568:e<1e4&&(r=25569);let i=Date.UTC(e,t-1,n)/864e5+r;if(i>=0&&i<=2958465)return i}return null}var Ss=48,Cs=57,ws=32,Ts=44,Es=47,Ds=1,Os=2,ks=3;function As(e){return e>=Ss&&e<=Cs?Ds:e===ws||e>=Ts&&e<=Es?Os:ks}function js(e){let t=[],n=-1,r=``;for(let i=0;i<e.length;i++){let a=e.charCodeAt(i);As(n)!==As(a)&&(r&&t.push(r),r=``),r+=e[i],n=a}return r&&t.push(r),t}var Ms=e=>{let t=Number(e);return e.length<=2&&isFinite(t)&&t>0&&t<=12},Ns=(e,t,n)=>{let r=Number(e);return e.length<=2&&isFinite(r)&&r>0&&r<=jo(n??gs,t??1)},Ps=e=>e.length>3&&isFinite(Number(e)),Fs=e=>e.length<=2&&isFinite(Number(e)),Is=e=>{let t=+e;return t+=t>=30?1900:2e3,t},Ls=14,Rs=15,zs=16,Bs=17,Vs=0,Hs=2;function Us(e,t){let n=bs.getOrSet(t,ys),r=e=>!!n[e]&&n[e][0]===`mmm`,i=e=>!!n[e]&&n[e][0]===`mmmm`,a=e=>n[e]?n[e][1]:0,o=js(e.toLowerCase()),s=null,c,l=gs,u=``;o.length>5&&/^ +$/.test(o[5])&&(u=o.slice(6).join(``),o.length=5);let d=t.format?.dateOrder??Vs,f=d===Vs,p=d===Hs,m=!f&&!p,h=!!t.format?.monthFirst,g=t.format?.dateSep===`.`,_=e=>{let t=e.trim();return t===`/`||t===`-`||g&&t===`.`},v=e=>e===` `||_(e),y=e=>h&&/^, +$/.test(e),b=e=>h&&/^,? +$/.test(e),x=e=>v(e)||!h&&/^, +$/.test(e);if(o.length===5){let[e,t,n,l,u]=o,[d,m]=f?[e,n]:[n,e];(i(e)||r(e))&&b(t)&&Ns(n)&&y(l)&&Ps(u)?(s=xs(+u,a(e),+n),c=Rs):(i(e)||r(e))&&y(t)&&Ns(n)&&y(l)&&Fs(u)?(s=xs(Is(u),a(e),+n),c=Rs):Ns(e,a(n),Is(u))&&x(t)&&(i(n)||r(n))&&x(l)&&Fs(u)?(s=xs(Is(u),a(n),+e),c=Rs):Ns(e,a(n),+u)&&x(t)&&(i(n)||r(n))&&x(l)&&Ps(u)?(s=xs(+u,a(n),+e),c=Rs):Ps(e)&&_(t)&&Ms(n)&&_(l)&&Ns(u,+n,+e)?(s=xs(+e,+n,+u),c=Ls):p?Fs(e)&&_(t)&&Ms(n)&&_(l)&&Ns(u,+n,Is(e))&&(s=xs(Is(e),+n,+u),c=Ls):Ms(d)&&_(t)&&Ns(m,+d,+u)&&_(l)&&Ps(u)?(s=xs(+u,+d,+m),c=Ls):Ms(d)&&_(t)&&Ns(m,+d,Is(u))&&_(l)&&Fs(u)&&(s=xs(Is(u),+d,+m),c=Ls)}else if(o.length===3){let[e,t,n]=o;if(r(n)&&Ns(e,a(n))&&v(t))s=xs(l,a(n),+e),c=zs;else if(i(n)&&Ns(e,a(n))&&v(t))s=xs(l,a(n),+e),c=zs;else if(_(t)&&vs(e)&&vs(n)){if(p)Ms(e)&&Ns(n,+e)?(s=xs(l,+e,+n),c=zs):Ms(n)&&Ns(e,+n)?(s=xs(l,+n,+e),c=zs):(Fs(e)&&+e>0||Ps(e))&&Ms(n)&&(s=xs(Fs(e)?Is(e):+e,+n,1),c=Bs);else{let[t,r]=f?[e,n]:[n,e];Ms(t)&&Ns(r,+t)?(s=xs(l,+t,+r),c=zs):Ms(e)&&Fs(n)&&(f||+n>0)?(s=xs(Is(n),+e,1),c=Bs):Ms(e)&&Ps(n)&&(s=xs(+n,+e,1),c=Bs)}}else!m&&(r(e)||i(e))&&v(t)&&Ns(n,a(e))?(s=xs(l,a(e),+n),c=zs):(r(e)||i(e))&&v(t)&&Ps(n)?(s=xs(+n,a(e),1),c=Bs):(r(e)||i(e))&&v(t)&&Fs(n)?(s=xs(Is(n),a(e),1),c=Bs):Ns(e,a(t),Is(n))&&(i(t)||r(t))&&Fs(n)?(s=xs(Is(n),a(t),+e),c=Rs):Ns(e,a(t),+n)&&(i(t)||r(t))&&Ps(n)&&(s=xs(+n,a(t),+e),c=Rs)}else if(o.length===2){let[e,t]=o;!m&&(r(e)||i(e))&&Ns(t,a(e))?(s=xs(l,a(e),+t),c=zs):Ns(e,a(t))&&(r(t)||i(t))?(s=xs(l,a(t),+e),c=zs):(r(e)||i(e))&&Ps(t)?(s=xs(+t,a(e),1),c=Bs):(r(e)||i(e))&&Fs(t)&&(s=xs(Is(t),a(e),1),c=Bs)}if(s!=null&&u){let e=hs(u,t,!0);e?(s+=e.value,e.formatId&&(c=e.formatId===46?void 0:c===Ls&&e.formatId>=18&&e.formatId<=21?22:e.formatId)):s=null}if(s!=null)return{value:s,formatId:c}}function Ws(e,t){let n=Ra(t?.locale)||Va;return t?.mode===1?Jo(e,n):Us(e,n)}function Gs(e,t){let n=Ra(t?.locale)||Va;return t?.mode===1?Po(e,n):hs(e,n)}function Ks(e,t){let n=e.trim().toLowerCase(),r=t.bool[0].toLowerCase();if(n===`true`||n===r)return{value:!0};let i=t.bool[1].toLowerCase();if(n===`false`||n===i)return{value:!1}}function qs(e,t){let n=e.toLowerCase(),r=t.bool[0].toLowerCase();if(n===`true`||n===r)return{value:!0};let i=t.bool[1].toLowerCase();if(n===`false`||n===i)return{value:!1}}function Js(e,t){let n=Ra(t?.locale)||Va;return t?.mode===1?Co(e,n)??Jo(e,n)??Po(e,n)??Ks(e,n):Ao(e,n)??Us(e,n)??hs(e,n)??qs(e,n)}function Ys(e){return{scale:1,percent:!1,text:!1,parens:!1,fractions:!1,grouping:!1,exponential:!1,integer:!1,locale:``,pattern:``,int_max:0,frac_max:0,frac_min:0,man_p:``,num_p:``,num_min:0,den_min:0,den_max:0,date:0,tokensUsed:0,date_eval:!1,date_system:1,sec_decimals:0,general:!1,clock:24,int_min:0,int_pattern:[],frac_pattern:[],man_pattern:[],den_pattern:[],num_pattern:[],tokens:e??[],den_p:``,int_p:``,denominator:0,sysdate:!1,systime:!1}}function Xs(e){let t,n=0,r,i=``,a=/^([^-]*)-([0-9a-fA-F]{3,8})$/.exec(e);if(a){a[1]&&(i=a[1]);let e=parseInt(a[2],16),o=e>>24&255;o&&(n=o);let s=e>>16&255;s&&(t=s);let c=e&65535;if(c===63488)return{sysdate:!0};if(c===62464)return{systime:!0};c&&si[c]&&(r=si[c])}else{let a=/^([^-]*)-([a-z\d][a-z\d_.@-]*)?(?:,([a-f\d]{1,4}))?$/i.exec(e);if(a){let e=a[2];if(/^x-sysdate$/.test(e))return{sysdate:!0};if(/^x-systime$/.test(e))return{systime:!0};if(a[1]&&(i=a[1]),e&&(/-x-gannen$/i.test(e)&&(e=e.slice(0,-9)),r=La(e)),a[3]){let e=parseInt(a[3],16),r=e>>8&255;r&&(n=r);let i=e&255;i&&(t=i)}}else if(e.includes(`-`))return{currency:e};else return{currency:e}}let o={};return t&&(o.calendar=t),n&&(o.numberStyle=n),r&&(o.locale=r),i&&(o.currency=i),o}function Zs(e,t){typeof e==`string`?t.push({type:Ii,value:e}):t.push(e)}var Qs=e=>{let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)!==35&&t++;return t};function $s(e,t){let n=e?.type;return n===`HASH`||n===`ZERO`||n===`QMARK`||n===`DIGIT`&&t===`DEN`}function ec(e){let t=[],n=Ys(t),r=`INT`,i,a=[],o,s=!1,c=-1,l=!1,u=``,d=!1,f=e=>e===`DEN`?n.den_pattern:e===`INT`?n.int_pattern:e===`FRAC`?n.frac_pattern:e===`MAN`?n.man_pattern:[];for(;++c<e.length&&!l;){let p=e[c],m=p.type||`ERROR`;if(u+=p.raw,m===`GENERAL`)n.general=!0,Zs({type:m},t);else if($s(p,r)){let e=f(r);o&&($s(o,r)||o.type===`GROUP`)?(e.push((e.pop()||``)+p.value),i&&`num`in i&&(i.num+=p.value)):(e.push(p.value),i={type:r,num:p.value},Zs(i,t))}else if(m===`PAREN`)p.value===`(`&&(n.parens=!0),Zs(p.value,t);else if(m===`DIGIT`)Zs(p.value,t);else if(m===`SLASH`){d=!0;let e=f(r);if(e.length){if(!i)throw SyntaxError(`Format pattern is missing a numerator`);n.fractions=!0;let a=e.pop();n.num_pattern.push(a),i.type=`NUM`,r=`DEN`,Zs({type:`DIV`},t)}else Zs(p.value,t)}else if(m===`COMMA`)Zs(`,`,t);else if(m===`SCALE`)n.scale=.001**p.raw.length;else if(m===`GROUP`){if(r===`INT`&&(n.grouping=!0),r===`DEN`)throw SyntaxError(`Cannot group denominator digits`)}else if(m===`SPACE`)Zs({type:m},t);else if(m===`BREAK`){l=!0;break}else if(m===`TEXT`)n.text=!0,Zs({type:m,value:p.value},t);else if(m===`PLUS`||m===`MINUS`)Zs({type:m},t);else if(m===`DURATION`){let e=p.value.toLowerCase(),r=e[0],i;i=r===`h`?{type:$i,size:16,pad:e.length}:r===`m`?{type:ea,size:32,pad:e.length}:{type:ta,size:64,pad:e.length},n.date|=i.size,a.push(i),Zs(i,t)}else if(n.date&&m===`POINT`&&e[c+1]?.type===`ZERO`){let r=1;c++;let i=`0`;e[c+1]?.type===`ZERO`&&(i+=`0`,r=2,c++),e[c+1]?.type===`ZERO`&&(i+=`0`,r=3,c++),u+=i;let a=[64,128,256,512][r];n.date|=a,n.date_eval=!0,n.sec_decimals=Math.max(n.sec_decimals,r),Zs({type:Qi,size:a,decimals:r},t)}else if(m===`CALENDAR`)s||(n.date_system=p.value===`B2`||p.value===`b2`?6:1);else if(m===`DATETIME`){let e,r=p.value.toLowerCase(),i=r[0];if(r===`y`||r===`yy`)e={type:Wi,size:2};else if(i===`y`||i===`e`)e={type:Ui,size:2};else if(r===`b`||r===`bb`)e={type:ra,size:2};else if(i===`b`)e={type:na,size:2};else if(r===`d`||r===`dd`)e={type:`DAY`,size:8,pad:r===`dd`};else if(r===`ddd`||r===`aaa`)e={type:Yi,size:8};else if(i===`d`||i===`a`)e={type:Xi,size:8};else if(i===`h`)e={type:Zi,size:16,pad:r.length>1};else if(i===`m`){r.length===3?e={type:qi,size:4}:r.length===5?e={type:Ki,size:4}:r.length>=4&&(e={type:Ji,size:4});let t=a[a.length-1];!e&&t&&!t.used&&t.size&80&&(t.used=!0,e={type:`MIN`,size:32,pad:r.length>1}),e||={type:Gi,size:4,pad:r.length>1,indeterminate:!0}}else if(i===`s`){e={type:`SEC`,size:64,pad:r.length>1};let t=a[a.length-1];t&&t.size&32?e.used=!0:t&&`indeterminate`in t&&(delete t.indeterminate,t.size=32,t.type=`MIN`,e.used=!0)}e&&(n.date|=e.size,n.date_eval=!0,a.push(e),Zs(e,t))}else if(m===`AMPM`)n.clock=12,n.date|=16,n.date_eval=!0,Zs({type:m,short:p.value===`A/P`},t);else if(m===`ESCAPED`)Zs({type:Ii,value:p.value,escaped:!0},t);else if(m===`STRING`||m===`CHAR`)Zs(p.value,t);else if(m===`CONDITION`){let e=/^(<[=>]?|>=?|=)\s*(-?[.\d]+)$/.exec(p.value);if(e)n.condition=[e[1],parseFloat(e[2])];else throw Error(`Invalid condition: `+p.value)}else if(m===`LOCALE`){let e=Xs(p.value);e.currency&&Zs({type:Ii,value:e.currency,escaped:!0},t),e.sysdate&&(n.sysdate=!0),e.systime&&(n.systime=!0),e.locale&&(n.locale=e.locale),(e.calendar===1||e.calendar===6)&&(n.date_system=e.calendar),s=!0}else if(m===`COLOR`){let e,t=p.value.toLowerCase();n.color=(e=/^color\s*(\d+)$/i.exec(t))?parseInt(e[1],10):t}else if(m===`PERCENT`)n.scale=100,n.percent=!0,Zs(`%`,t);else if(m===`POINT`)Zs({type:m,value:p.value},t),n.date||(n.dec_fractions=!0,r=Hi);else if(m===`EXP`){n.exponential=!0;let e=p.value.includes(`+`);n.exp_plus=e,r=`MAN`,Zs({type:`EXP`,plus:e},t)}else if(m===`SKIP`)Zs({type:m,value:p.value},t);else if(m===`FILL`)Zs({type:m,value:p.value},t);else if(m===`CURRENCY`)Zs({type:m,value:p.value},t);else if(m===`DBNUM`){let e=parseInt(p.value.slice(5));if(e<1||e>4)throw SyntaxError(`Unknown modifier: `+p.value)}else if(m===`NATNUM`)throw SyntaxError(`Unknown modifier: `+p.value);else if(m===`MODIFIER`)throw SyntaxError(`Unknown modifier: `+p.value);else if(m===`ERROR`)throw SyntaxError(`Illegal character: ${u}`);else throw SyntaxError(`Unknown token ${m} in ${u}`);o=p}if(n.tokensUsed=c,n.pattern=u,n.fractions&&n.dec_fractions||n.grouping&&!n.int_pattern.length||n.fractions&&n.exponential||n.fractions&&n.den_pattern.length*n.num_pattern.length===0||d&&!n.fractions&&!n.date||n.exponential&&(n.int_pattern.length||n.frac_pattern.length)*n.man_pattern.length===0)throw SyntaxError(`Invalid pattern: ${u}`);let p=n.int_pattern.join(``),m=n.man_pattern.join(``),h=n.frac_pattern.join(``);n.int_max=p.length,n.int_min=Qs(p);let g=0;for(let e=0;e<p.length;e++){let t=p[p.length-1-e];/^[0-9?]/.test(t)&&(g=e+1)}n.int_min=g,n.frac_max=h.length,n.frac_min=Qs(h);let _=n.num_pattern.join(``),v=n.den_pattern[0]||``;if(v.includes(`?`)||_.includes(`?`)?(v=v.replace(/\d/g,`?`),v=v.replace(/#$/g,`?`),n.num_min=Qs(_),n.den_max=v.length,n.den_min=Qs(v),_=_.replace(/#$/g,`?`)):(n.num_min=Qs(_),n.den_max=v.length,n.den_min=Qs(v)),n.int_p=p,n.man_p=m,n.num_p=_,n.den_p=v,n.den_pattern.length&&(n.denominator=parseInt(n.den_pattern.join(``).replace(/\D/g,``),10)),n.integer=!!p.length,!n.integer&&!n.exponential&&h.length){let e=n.tokens.findIndex(e=>e.type===bi);n.tokens.splice(e,0,{type:`INT`,num:`#`}),n.integer=!0,n.int_pattern=[`#`],n.int_p=`#`}if(!n.tokens.length&&/^\[(?!\$)/.test(n.pattern)&&(n.general=!0,Zs({type:ci},t)),n.fractions)for(let e=0;e<t.length-1;e++){let n=t[e];if(n.type!==`STRING`&&n.type!==`SPACE`)continue;let r=t[e+1].type;r===`NUM`?n.rule=`num+int`:r===`DIV`?n.rule=`num`:r===`DEN`&&(n.rule=`den`)}return n.grouping&&n.int_pattern.length>1&&(n.grouping=!1),n}var tc=e=>{let[t,n]=e.condition??[``,0];n<0&&(t===`<`||t===`<=`||t===`=`)||n===0&&t===`<`||e.tokens.unshift({type:yi,volatile:!0})},nc=(e,t)=>{let n={};for(let t in e){let r=e[t];n[t]=Array.isArray(r)?[...r]:r}return t&&n.tokens&&n.tokens.unshift(t),n.generated=!0,n};function rc(e){let t=[],n=!1,r,i=null,a=0,o,s=0,c=0,l=Ma(e);do{if(o=ec(l),(o.date||o.general)&&(o.int_pattern.length||o.frac_pattern.length||o.scale!==1||o.text))throw Error(`Illegal format`);if(o.condition&&(c++,n=!0),o.text){if(i)throw Error(`Unexpected partition`);i=o}o.locale&&(r=La(o.locale)),t.push(o),a=+(l[o.tokensUsed]?.type===`BREAK`),l=l.slice(o.tokensUsed+a),s++}while(a&&s<4&&c<3);if(a)throw Error(`Unexpected partition`);if(c>2)throw Error(`Unexpected condition`);let u=t[3];if(u&&(u.int_pattern.length||u.frac_pattern.length||u.date))throw Error(`Unexpected partition`);if(n){t[0].condition||(t[0].condition=[`>`,0]);let e=t.length;if(e===1&&(t[1]=ec(Ma(`General`)),t[1].generated=!0),e<3){let e=t[0],n=t[1];if(tc(e),n.condition)tc(n);else{let t=e.condition;t&&(t[0]===`=`||t[1]>=0&&(t[0]===`>`||t[0]===`>=`))&&n.tokens.unshift({type:yi,volatile:!0})}}else t.forEach(tc)}else{if(t.length<4&&i)for(let e=0,n=t.length;e<n;e++)t[e]===i&&t.splice(e,1);if(t.length<1&&i&&(t[0]=ec(Ma(`General`)),t[0].generated=!0),t.length<2){let e={type:yi,volatile:!0};t.push(nc(t[0],e))}if(t.length<3&&t.push(nc(t[0])),t.length<4){if(i)t.push(i);else{let e=ec(Ma(`@`));e.generated=!0,t.push(e)}}t[0].condition=[`>`,0],t[1].condition=[`<`,0],t[2].condition=void 0}return{pattern:e,partitions:t,locale:r}}var ic=new Fo(ia);function ac(e,t=!1){e||=`General`;let n=ic.get(e);if(!n)try{n=rc(e),ic.set(e,n)}catch(r){if(t)throw r;let i=r&&typeof r==`object`&&`message`in r?String(r.message):`Unknown error`,a=Ys([{type:Ti}]);a.error=!0,n={pattern:e,partitions:[a,a,a,a],error:i,locale:void 0}}return n}function oc(e){if(e===0)return e;let t=Math.ceil(Math.log10(e<0?-e:e)),n=10**(16-Math.floor(t));return isFinite(n)?Math.round(e*n)/n:0}function sc(e,t=0){let n=Math.floor(Math.log10(e));return t>1?Math.floor(n/t)*t:n}function cc(e,t=1){return t<-300?parseFloat(e.toExponential().split(`e`)[0]):e*10**-t}var lc={total:1,sign:0,digits:1,period:0,int:1,frac:0};function uc(e,t=!0){let n=Math.abs(e);if(!n)return lc;let r=t&&e<0?1:0,i=Math.floor(n),a=Math.floor(Math.log10(n)+1),o=0,s=0;if(i!==n){o=1;let e=String(ro(n*10**-a,15)),t=e.length,r=!0,i=0;for(;i<=e.length;){if(e[i]===`.`){t--;break}e[i]===`0`&&r?t--:r=!1,i++}s=t-a,s<0&&(s=0,o=0)}return{total:r+Math.max(a,1)+o+s,digits:Math.max(a,0)+s,sign:r,period:o,int:Math.max(a,1),frac:s}}var dc=(e,t)=>e.replace(/\./,t.decimal),fc=(e,t,n)=>{let r=Math.abs(t),i;return i=e===1?e:ro(e,5),[dc(i+``,n),n.exponent,t<0?n.negative:n.positive,r<10?`0`:``,r]};function pc(e,t,n){if(typeof t==`string`)e.push(t);else{let r=t|0;if(t===r)e.push(Math.abs(r));else{let r=Math.abs(t),i=sc(r),a=cc(r,i);a===10&&(a=1,i++);let o=uc(r);if(i>=-4&&i<=-1){let t=r.toPrecision(10+i).replace(/\.?0+$/,``);e.push(dc(t,n))}else if(i===10){let t=Math.round(r);t<1e11?e.push(t):e.push(...fc(1,11,n))}else if(Math.abs(i)<=9){if(o.total<=11){let t=ro(r,9).toFixed(o.frac);e.push(dc(t,n))}else i===9?e.push(Math.round(r)):i>=0&&i<9?e.push(dc(String(ro(r,9-i)),n)):e.push(...fc(a,i,n))}else o.total>=12?e.push(...fc(a,i,n)):e.push(dc(ro(r,9).toFixed(o.frac),n))}}return e}function mc(e,t=!1){return e===`0`?`0`:e===`?`?t?`\xA0`:` `:``}var hc=86400,gc=48,_c=57,vc=(e,t,n)=>n?e<-694324||t>=35830291:e<0||t>=2958466;function yc(e,t,n,r){let i=``,a=``,o=``,s=``,c=``,l=``,u=0,d=0;if(typeof e==`bigint`){if(e<=2**53-1&&e>=-(2**53-1))e=Number(e);else return n.bigintErrorNumber?String(e):n.overflow;d=e}else typeof e==`number`&&(d=Math.trunc(e));let f=0,p=0,m=1,h=0,g=0,_=0,v=0,y=0,b=0,x=r||Va;if(!t.text&&isFinite(t.scale)&&t.scale!==1&&typeof e==`number`&&(e=oc(e*t.scale)),typeof e==`number`&&t.fractions){if(t.integer){let t=Math.abs(no(e,1));l+=t<1?``:Math.floor(t)}}else if(typeof e==`number`&&isFinite(e)&&(t.exponential||t.integer||t.dec_fractions)){let n,r;t.exponential?([n,r,u]=eo(Math.abs(e),t.frac_max,t.int_max,!!t.integer),i+=Math.abs(u),e=(e<0?-n:n)*qa(r)):[n,r]=$a(Math.abs(e),t.frac_max);let[a,o]=to(n,r);t.integer&&(l=a),t.dec_fractions&&(c=o)}let S=n.grouping[0]??3,C=n.grouping[1]??S,w=!t.error&&(t.num_p.includes(`0`)||t.den_p.includes(`0`)),T=w;if(t.fractions&&typeof e==`number`){T=w||!!(e%1);let n=Math.abs(t.integer?e%1:e);if(n){if(T=!0,t.denominator&&isFinite(t.denominator))s+=t.denominator,o+=no(n*t.denominator),o===`0`&&(o=``,s=``,T=w);else{let e=ao(n,1/0,t.den_max);o+=e[0],s+=e[1],t.integer&&o===`0`&&(o=``,s=``,T=w)}}else!e&&!t.integer&&(T=!0,o=`0`,s=`1`);t.integer&&!T&&!Math.trunc(e)&&(l=`0`)}if(t.date&&typeof e==`number`){d=Math.trunc(e);let r=hc*(e-d);if(f=Math.floor(r),b=r-f,Math.abs(b)<1e-6?b=0:b>.9999&&(b=0,f+=1),b){let e=t.date&512||t.date&256||t.date&128;(e===512&&b>.9995||e===256&&b>.995||e===128&&b>.95||!e&&b>=.5)&&(f++,b=0)}if(f===hc&&t.date&1008&&(f=0,d+=1),d||t.date_system){let r=uo(e+d-Math.trunc(e),t.date_system,n.leap1900);p=r[0],m=r[1],h=r[2]}if(f){let e=f<0?hc+f:f;y=Math.floor(e)%60,v=Math.floor(e/60)%60,_=Math.floor(e/60/60)%60}if(g=(6+d)%7,t.date_eval&&vc(e,d+f/hc,n.dateSpanLarge)){if(n.dateErrorThrows)throw Error(`Date out of bounds`);return n.dateErrorNumber?pc(e<0?[x.negative]:[],e,x).join(``):n.overflow}}let ee=mc(`?`,n.nbsp);u<0?a=`-`:t.exp_plus&&(a=`+`);let E=[],D=(e,t,r,i)=>{let a=!i&&e.length>t.length?r.length+e.length-t.length:r.length;e.length<t.length&&(i+=e.length-t.length);for(let t=0;t<a;t++)E.push(e[t+i]||mc(r[t],n.nbsp));return a},te=!1,ne={int:0,frac:0,man:0,num:0,den:0};for(let r=0,u=t.tokens.length;r<u;r++){let u=t.tokens[r],w=u.type,re=`num`in u?u.num.length:0;if(w===`STRING`){let e=u.rule;e?e===`num`&&T||e===`num+int`&&T&&l||e===`den`&&T?E.push(u.value.replaceAll(` `,ee)):(e===`num`&&t.num_min>0||t.den_min>0||e===`num+int`&&t.den_min>0&&(l||t.num_min)||e===`den`&&t.den_min>0||t.den_min>0)&&E.push(ee.repeat(u.value.length)):E.push(u.value.replaceAll(` `,ee))}else if(w===`SPACE`)u.rule===`num+int`?(T||t.num_min||t.den_min)&&(l||t.num_min)&&E.push(ee):E.push(ee);else if(w===`ERROR`)E.push(n.invalid);else if(w===`POINT`)E.push(t.date?u.value:x.decimal);else if(w===`GENERAL`)pc(E,e,x);else if(w===`EXP`)E.push(x.exponent);else if(w===`MINUS`)u.volatile&&t.date||u.volatile&&(typeof e!=`number`||e>=0)||(u.volatile&&!t.fractions&&(t.integer||t.dec_fractions)?(typeof e==`number`&&e<0&&l&&l!==`0`||c)&&E.push(x.negative):E.push(x.negative));else if(w===`PLUS`)E.push(x.positive);else if(w===`TEXT`)E.push(e);else if(w===`FILL`)n.fillChar&&E.push(n.fillChar,u.value);else if(w===`SKIP`)n.skipChar?E.push(n.skipChar,u.value):E.push(n.nbsp?`\xA0`:` `);else if(w===`DIV`)T?E.push(`/`):t.num_min>0||t.den_min>0?E.push(ee):E.push(mc(`#`,n.nbsp));else if(w===`INT`){if(t.int_pattern.length===1){let r=t.int_p,i=t.exponential&&!e,a=i?Math.max(t.int_min,t.int_max,l.length):Math.max(t.int_min,l.length),o=``;for(let e=a;e>0;e--){let a=l.charAt(l.length-e);i&&!a&&(a=`0`);let s=a?``:r.charAt(r.length-e)||r[0],c=``;if(t.grouping){let t=e-1-S;t>=0&&!(t%C)&&(c=a||s===`0`?x.group:mc(`?`,n.nbsp))}o+=(a||mc(s,n.nbsp))+c}E.push(o)}else ne.int+=D(l,t.int_p,u.num,ne.int)}else if(w===`FRAC`){let e=ne.frac;for(let t=0;t<re;t++)E.push(c[t+e]||mc(u.num[t],n.nbsp));ne.frac+=re}else if(w===`MAN`)ne.man||E.push(a),ne.man+=D(i,t.man_p,u.num,ne.man);else if(w===`NUM`)ne.num+=D(o,t.num_p,u.num,ne.num);else if(w===`DEN`){let e=ne.den;for(let t=0;t<re;t++){let r=s[t+e];if(!r){let e=u.num.charCodeAt(t);e>gc&&e<=_c||te&&e===gc?(te=!0,r=n.nbsp?`\xA0`:` `):r=!te&&t===re-1&&e===gc&&!s?`1`:mc(u.num[t],n.nbsp)}E.push(r)}ne.den+=re}else if(w===`YEAR`)p<0&&E.push(x.negative),E.push(String(Math.abs(p)).padStart(4,`0`));else if(w===`YEAR-SHORT`){let e=p%100;E.push(e<10?`0`:``,e)}else if(w===`MONTH`)E.push(u.pad&&m<10?`0`:``,m);else if(w===`MONTHNAME-SINGLE`)t.date_system===6?E.push(x.mmmm6[m-1].charAt(0)):E.push(x.mmmm[m-1].charAt(0));else if(w===`MONTHNAME-SHORT`)t.date_system===6?E.push(x.mmm6[m-1]):E.push(x.mmm[m-1]);else if(w===`MONTHNAME`)t.date_system===6?E.push(x.mmmm6[m-1]):E.push(x.mmmm[m-1]);else if(u.type===`WEEKDAY-SHORT`)E.push(x.ddd[g]);else if(u.type===`CURRENCY`)E.push(u.value);else if(w===`WEEKDAY`)E.push(x.dddd[g]);else if(w===`DAY`)E.push(u.pad&&h<10?`0`:``,h);else if(w===`HOUR`){let e=_%t.clock||(t.clock<24?t.clock:0);E.push(u.pad&&e<10?`0`:``,e)}else if(w===`MIN`)E.push(u.pad&&v<10?`0`:``,v);else if(w===`SEC`)E.push(u.pad&&y<10?`0`:``,y);else if(w===`SUBSEC`){E.push(x.decimal);let e=b.toFixed(t.sec_decimals);E.push(e.slice(2,2+u.decimals))}else if(w===`AMPM`){let e=_<12?0:1;u.short?E.push(`AP`[e]):E.push(x.ampm[e])}else if(w===`HOUR-ELAP`&&typeof e==`number`){e<0&&E.push(x.negative);let t=d*24+Math.floor(Math.abs(f)/3600);E.push(String(Math.abs(t)).padStart(u.pad,`0`))}else if(w===`MIN-ELAP`&&typeof e==`number`){e<0&&E.push(x.negative);let t=d*1440+Math.floor(Math.abs(f)/60);E.push(String(Math.abs(t)).padStart(u.pad,`0`))}else if(w===`SEC-ELAP`&&typeof e==`number`){e<0&&E.push(x.negative);let t=d*hc+Math.abs(f);E.push(String(Math.abs(t)).padStart(u.pad,`0`))}else if(w===`B-YEAR`)E.push(p+543);else if(w===`B-YEAR-SHORT`){let e=(p+543)%100;E.push(e<10?`0`:``,e)}}return E.join(``)}var bc=ec([{type:_i,value:`@`,raw:`@`}]);function xc(e,t){for(let n=0;n<3;n++){let r=t[n];if(r){let t=!1;if(r.condition){let n=r.condition[0],i=r.condition[1];n===`=`?t=e===i:n===`<>`?t=e!==i:typeof e==`string`?t=!1:n===`>`?t=e>i:n===`<`?t=e<i:n===`>=`?t=e>=i:n===`<=`&&(t=e<=i)}else t=!0;if(t)return r}}}function Sc(e,t,n){let r=t.partitions,i=r[3],a;return(typeof e==`number`||typeof e==`bigint`)&&Number.isFinite(e)&&(i=xc(e,r)),i?.color&&(a=i.color),a&&typeof a==`number`&&n.indexColors&&(a=aa[a-1]||`#000`),a}function Cc(e,t,n){let r=t.partitions,i=Ra(t.locale||n.locale)??Va,a=r[3]?r[3]:bc;if(typeof e==`boolean`&&(e=i.bool[+!e]),e==null)return``;let o=typeof e==`bigint`;if(typeof e!=`number`&&!o)return yc(String(e),a,n,i);if(!o&&!Number.isFinite(e))return Number.isNaN(e)?i.nan:(e<0?i.negative:``)+i.infinity;let s=e,c=xc(s,r);return c?.sysdate&&(c=ac(i.sysdate??`dd mmmm yyyy`,!1).partitions[0]),c?.systime&&(c=ac(i.systime??`hh:mm:ss`,!1).partitions[0]),c?yc(s,c,n,i):n.overflow}function wc(e){return!!(e[0]?.date||e[1]?.date||e[2]?.date||e[3]?.date)}function Tc(e,t,n={}){let r=Object.assign({},Ha,n),i=ac(e,r.throws);return Cc(po(t,r)??t,i,r)}function Ec(e,t,n){let r=Object.assign({},Ha,n),i=ac(e,r.throws);return Sc(po(t,r)??t,i,r)}function Dc(e){return wc(ac(e,!1).partitions)}function Oc(e){try{return ac(e,!0),!0}catch{return!1}}var kc={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:`#D9D9D9`,axisLine:`#BFBFBF`,letter:.55,lineWidth:2.25,gridWidth:.75,marker:5},Ac=[`accent1`,`accent2`,`accent3`,`accent4`,`accent5`,`accent6`],jc=e=>Ac[e%Ac.length]??`accent1`,Mc=e=>e.startsWith(`column`)||e.startsWith(`bar`),Nc=e=>e.startsWith(`bar`),Pc=e=>e.startsWith(`line`),Fc=e=>e.startsWith(`area`),Ic=e=>e===`pie`||e===`doughnut`,Lc=e=>e.startsWith(`scatter`),Rc=e=>!Lc(e)||e!==`scatter`,zc=e=>e===`line-markers`||e===`scatter`||e===`scatter-lines`,Bc=e=>e.endsWith(`-100`)?`percentStacked`:e.endsWith(`-stacked`)?`stacked`:Mc(e)?`clustered`:`standard`;function Vc(e){return Fc(e)||e===`doughnut`?[]:e===`pie`?[`bestFit`,`outEnd`,`inEnd`,`ctr`]:Pc(e)||Lc(e)?[`t`,`b`,`l`,`r`,`ctr`]:Bc(e)===`clustered`?[`outEnd`,`inEnd`,`ctr`,`inBase`]:[`inEnd`,`ctr`,`inBase`]}function Hc(e){let t=Vc(e.type),n=e.labels?.position;if(n!==void 0&&t.includes(n))return n;if(t.length!==0)return e.type===`pie`?`ctr`:Pc(e.type)||Lc(e.type)?`t`:Bc(e.type)===`clustered`?`outEnd`:`ctr`}var Uc=e=>e.vary_by_categories??Ic(e.type);function Wc(e,t=`General`){return t===`General`||!Oc(t)?String(Number(e.toPrecision(10))):Tc(t,e)}var Gc=[1,2,5,10];function Kc(e,t,n,r,i={}){let a=e>0&&(t-e)/t<1/6?e:Math.min(e,0),o=t<=0&&e<0?0:t,s=i.minimum_scale??a,c=i.maximum_scale??o,l=c>s?c-s:1,u=l/Math.max(1,Math.floor(n/r)),d=10**Math.floor(Math.log10(u)),f=i.major_unit??(Gc.find(e=>e*d>=u)??10)*d,p=(e,t)=>Number((t(Number((e/f).toFixed(9)))*f).toPrecision(12)),m=o>0?o+l*.05:o===a?l:o,h=i.maximum_scale??p(m,Math.ceil),g=a<0?a-l*.05:a,_=i.minimum_scale??p(g,Math.floor),v=[],y=Math.round((h-_)/f);for(let e=0;e<=y;e++)v.push(Number((_+e*f).toPrecision(12)));return{min:_,max:h,major:f,ticks:v}}var qc=(e,t)=>{let n=0;for(let t of e)n+=(t.codePointAt(0)??0)>11903?1:kc.letter;return n*t},Jc=e=>String(Number(e.toFixed(3)));function Yc(e){let t=t=>e[Math.max(0,Math.min(e.length-1,t))]??[0,0];return e.map(([e,n],r)=>{if(r===0)return`M${Jc(e)} ${Jc(n)}`;let[i,a]=t(r-2),[o,s]=t(r-1),[c,l]=t(r+1);return`C${`${Jc(o+(e-i)/6)} ${Jc(s+(n-a)/6)}`} ${`${Jc(e-(c-o)/6)} ${Jc(n-(l-s)/6)}`} ${Jc(e)} ${Jc(n)}`}).join(` `)}var Xc=e=>e.map(([e,t],n)=>`${n===0?`M`:`L`}${Jc(e)} ${Jc(t)}`).join(` `);function Zc(e,t,n,r,i,a){let o=(n,r)=>`${Jc(e+n*Math.sin(r))} ${Jc(t-n*Math.cos(r))}`,s=a-i>=Math.PI*2?i+Math.PI*2-1e-4:a,c=+(s-i>Math.PI),l=`M${o(n,i)} A${Jc(n)} ${Jc(n)} 0 ${String(c)} 1 ${o(n,s)}`;return r<=0?`${l} L${Jc(e)} ${Jc(t)} Z`:`${l} L${o(r,s)} A${Jc(r)} ${Jc(r)} 0 ${String(c)} 0 ${o(r,i)} Z`}function Qc(e,t,n,r){let i=r*1.5;return t!==void 0&&t!==``&&(e.bottom-=i),n!==void 0&&n!==``&&(e.left+=i),{x:e.left-i/2,y:e.bottom+i/2}}function $c(e,t,n,r,i,a,o){r!==void 0&&r!==``&&e.words.push({x:t.x+t.width/2,y:n.y,text:r,size:a,anchor:`middle`,color:o}),i!==void 0&&i!==``&&e.words.push({x:n.x,y:t.y+t.height/2,text:i,size:a,anchor:`middle`,color:o,rotate:-90})}var el=(e,t,n,r,i)=>{let a=e.labels;if(!a)return``;let o=Ic(e.type),s=[];return a.show_series_name&&s.push(r.name),a.show_category_name&&s.push(i),(a.show_value??!(a.show_percentage??!1))&&s.push(Wc(t,a.number_format??r.number_format)),a.show_percentage&&o&&s.push(Wc(n,a.number_format??`0%`)),s.join(`, `)};function tl(e,t,n,r,i){let a=kc,o=e.category_axis??{},s=e.value_axis??{},c=Qc(n,o.title,s.title,r),l=e.series.map(e=>e.values.flatMap((t,n)=>{let r=e.x?.[n]??(e.x?null:n+1);return r===null||t===null?[]:[[r,t]]})),u=l.flat().map(e=>e[0]),d=l.flat().map(e=>e[1]),f=e=>e.length>0?Math.min(...e):0,p=e=>e.length>0?Math.max(...e):1,m=s.number_format??e.series[0]?.number_format??`General`,h=o.number_format??`General`,g=r*.5,_=Kc(f(d),p(d),n.bottom-n.top,r*2.4,s),v=s.visible===!1?0:Math.max(0,..._.ticks.map(e=>qc(Wc(e,m),r)))+g,y=o.visible===!1?0:r*1.2+g,b={x:n.left+v,y:n.top,width:n.right-n.left-v,height:n.bottom-n.top-y};t.plot=b,$c(t,b,c,o.title,s.title,r,i);let x=Kc(f(u),p(u),b.width,r*5,o),S=Kc(f(d),p(d),b.height,r*2.4,s),C=e=>b.x+(Math.min(x.max,Math.max(x.min,e))-x.min)/(x.max-x.min)*b.width,w=e=>b.y+b.height-(Math.min(S.max,Math.max(S.min,e))-S.min)/(S.max-S.min)*b.height;for(let e of S.ticks){let n=w(e);(s.has_major_gridlines??!0)&&t.grid.push({d:`M${Jc(b.x)} ${Jc(n)} H${Jc(b.x+b.width)}`,color:s.gridline_color??{rgb:a.gridline},width:a.gridWidth}),s.visible!==!1&&t.words.push({x:b.x-g,y:n,text:Wc(e,m),size:r,anchor:`end`,color:i})}for(let e of x.ticks){let n=C(e);o.has_major_gridlines===!0&&t.grid.push({d:`M${Jc(n)} ${Jc(b.y)} V${Jc(b.y+b.height)}`,color:o.gridline_color??{rgb:a.gridline},width:a.gridWidth}),o.visible!==!1&&t.words.push({x:n,y:b.y+b.height+g+r*.6,text:Wc(e,h),size:r,anchor:`middle`,color:i})}t.axes.push({d:`M${Jc(b.x)} ${Jc(w(Math.max(S.min,Math.min(S.max,0))))} H${Jc(b.x+b.width)}`,color:o.line_color??{rgb:a.axisLine},width:a.gridWidth}),e.series.forEach((n,r)=>{let i=n.color??jc(r),o=(l[r]??[]).map(([e,t])=>[C(e),w(t)]);if(o.length!==0&&(Rc(e.type)&&t.lines.push({d:e.type===`scatter-smooth`||n.smooth===!0?Yc(o):Xc(o),color:i,width:n.line_width??a.lineWidth,series:r}),zc(e.type)))for(let[e,r]of o)t.dots.push({x:e,y:r,r:(n.marker_size??a.marker)/2,color:i})})}function nl(e,t,n){let r=kc,i=e.font_size??r.fontSize,a=e.font_color??`dk1`,o={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},s={left:r.margin,top:r.margin,right:t-r.margin,bottom:n-r.margin};if(e.title!==void 0&&e.title!==``){let n=e.title_size??i*r.titleScale;o.words.push({x:t/2,y:s.top+n*.7,text:e.title,size:n,anchor:`middle`,color:a}),s.top+=n*1.6}let c=Ic(e.type),l=Uc(e),u=(t,n)=>l?jc(n):e.series[t]?.color??jc(t);if(e.legend!==void 0){let n=l?e.categories:e.series.map(e=>e.name),r=i*.6,c=i*.4,u=i*1.5,d=n.map(e=>r+c+qc(e,i)),f=(t,s,u)=>{o.keys.push({x:s,y:u-r/2,width:r,height:r,color:l?jc(t):e.series[t]?.color??jc(t),series:l?0:t,category:l?t:0}),o.words.push({x:s+r+c,y:u,text:n[t]??``,size:i,anchor:`start`,color:a})};if(e.legend===`top`||e.legend===`bottom`){let r=d.reduce((e,t)=>e+t,0)+i*(n.length-1),a=e.legend===`top`?s.top+u/2:s.bottom-u/2,o=(t-r)/2;n.forEach((e,t)=>{f(t,o,a),o+=(d[t]??0)+i}),e.legend===`top`?s.top+=u:s.bottom-=u}else{let t=Math.max(0,...d),r=e.legend===`left`?s.left:s.right-t,a=(s.top+s.bottom-u*n.length)/2+u/2;n.forEach((e,t)=>{f(t,r,a+t*u)}),e.legend===`left`?s.left+=t+i:s.right-=t+i}}let d=e.labels,f=d?.size??i,p=d?.color??a,m=(e,t,n,r,i=p)=>{n!==``&&o.words.push({x:e,y:t,text:n,size:f,anchor:r,color:i})};if(c){let t=e.series[0],n=(t?.values??[]).map(e=>Math.max(0,e??0)),i=n.reduce((e,t)=>e+t,0),a=Math.max(0,Math.min(s.right-s.left,s.bottom-s.top)/2),c=(s.left+s.right)/2,l=(s.top+s.bottom)/2,f=e.type===`doughnut`?a*((e.hole_size??r.holeSize)/100):0;o.plot={x:c-a,y:l-a,width:a*2,height:a*2};let p=0;return n.forEach((n,r)=>{let s=i>0?n/i:0,h=p+s*Math.PI*2;if(s>0){o.shapes.push({d:Zc(c,l,a,f,p,h),color:`lt1`,width:1,fill:u(0,r),series:0,category:r});let i=(p+h)/2,g=f>0?(a+f)/2:Hc(e)===`inEnd`?a*.85:a*.6;t&&m(c+g*Math.sin(i),l-g*Math.cos(i),el(e,n,s,t,e.categories[r]??``),`middle`,d?.color??`lt1`)}p=h}),o}if(Lc(e.type))return tl(e,o,s,i,a),o;let h=Math.max(1,e.categories.length),g=Nc(e.type),_=Bc(e.type),v=_!==`clustered`&&_!==`standard`,y=_===`percentStacked`,b=e.series.map(t=>e.categories.map((e,n)=>t.values[n]??null)),x=e.categories.map((e,t)=>b.reduce((e,n)=>e+Math.abs(n[t]??0),0)),S=(e,t)=>{let n=b[e]?.[t];if(n==null)return null;let r=x[t]??0;return y?r>0?n/r:0:n},C=0,w=0;if(e.categories.forEach((t,n)=>{let r=0,i=0;e.series.forEach((e,t)=>{let a=S(t,n)??0;v?a>=0?r+=a:i+=a:(r=Math.max(r,a),i=Math.min(i,a))}),w=Math.max(w,r),C=Math.min(C,i)}),!v){let e=b.flat().filter(e=>e!==null);e.length>0&&Math.min(...e)>0&&(C=Math.min(...e))}y&&(w=1,C=Math.min(C,0));let T=e.value_axis??{},ee=e.category_axis??{},E=T.number_format??(y?`0%`:e.series[0]?.number_format??`General`),D=g?s.right-s.left:s.bottom-s.top,te=g?i*5:i*2.4,ne=Kc(C,w,D,te,{...T,...y?{maximum_scale:T.maximum_scale??1}:{}}),re=T.visible===!1?[]:ne.ticks.map(e=>Wc(e,E)),ie=Math.max(0,...re.map(e=>qc(e,i))),ae=ee.visible!==!1,oe=ae?Math.max(0,...e.categories.map(e=>qc(e,i))):0,se=i*.5,ce=g?T.title:ee.title,le=g?ee.title:T.title,ue=Qc(s,ce,le,i),de=g?{x:s.left+(ae?oe+se:0),y:s.top,width:0,height:s.bottom-s.top-(T.visible===!1?0:i*1.2+se)}:{x:s.left+(T.visible===!1?0:ie+se),y:s.top,width:0,height:s.bottom-s.top-(ae?i*1.2+se:0)};de.width=s.right-de.x,o.plot=de,$c(o,de,ue,ce,le,i,a);let fe=Kc(C,w,g?de.width:de.height,te,{...T,...y?{maximum_scale:T.maximum_scale??1}:{}}),pe=e=>(Math.min(fe.max,Math.max(fe.min,e))-fe.min)/(fe.max-fe.min)*(g?de.width:de.height),me=e=>g?de.x+pe(e):de.y+de.height-pe(e),he=Fc(e.type),ge=ee.reverse_order===!0,_e=g?!ge:ge,ve=(g?de.height:de.width)/h,ye=he?(g?de.height:de.width)/Math.max(1,h-1):ve,be=e=>{let t=he?e*ye:(e+.5)*ve,n=g?de.height:de.width,r=_e?n-t:t;return(g?de.y:de.x)+r},xe=me(Math.max(fe.min,Math.min(fe.max,0)));for(let e of fe.ticks){let t=me(e);(T.has_major_gridlines??!0)&&o.grid.push({d:g?`M${Jc(t)} ${Jc(de.y)} V${Jc(de.y+de.height)}`:`M${Jc(de.x)} ${Jc(t)} H${Jc(de.x+de.width)}`,color:T.gridline_color??{rgb:r.gridline},width:r.gridWidth}),T.visible!==!1&&o.words.push(g?{x:t,y:de.y+de.height+se+i*.6,text:Wc(e,E),size:i,anchor:`middle`,color:a}:{x:de.x-se,y:t,text:Wc(e,E),size:i,anchor:`end`,color:a})}if(o.axes.push({d:g?`M${Jc(xe)} ${Jc(de.y)} V${Jc(de.y+de.height)}`:`M${Jc(de.x)} ${Jc(xe)} H${Jc(de.x+de.width)}`,color:ee.line_color??{rgb:r.axisLine},width:r.gridWidth}),ae){let t=g?i*1.3:oe+i,n=Math.max(1,Math.ceil(t/Math.max(1,ye)));e.categories.forEach((e,t)=>{if(t%n!==0)return;let r=be(t);o.words.push(g?{x:de.x-se,y:r,text:e,size:i,anchor:`end`,color:a}:{x:r,y:de.y+de.height+se+i*.6,text:e,size:i,anchor:`middle`,color:a})})}if(Mc(e.type)){let t=(e.gap_width??r.gapWidth)/100,n=v?1:e.series.length,i=v?1:(e.overlap??0)/100,a=ve/(Math.max(1,n-(n-1)*i)+t),s=a*(1-i),c=a+s*(n-1);e.categories.forEach((t,n)=>{let r=be(n),i=0,l=0;e.series.forEach((t,p)=>{let h=S(p,n);if(h===null)return;let _=v?h>=0?i:l:0,y=_+h;v&&(h>=0?i=y:l=y);let x=me(_),C=me(y),w=(v?r-a/2:r-c/2+p*s)+(g&&_e&&!v?c-a-2*p*s:0),T=g?{x:Math.min(x,C),y:w,width:Math.abs(C-x),height:a}:{x:w,y:Math.min(x,C),width:a,height:Math.abs(C-x)};if(o.boxes.push({...T,color:u(p,n),series:p,category:n}),!d)return;let ee=el(e,b[p]?.[n]??0,0,t,e.categories[n]??``),E=Hc(e),D=f*.8,te=h>=0?1:-1,ne=(e,t)=>E===`ctr`?(e+t)/2:E===`inBase`?e+(t>e?D:-D):E===`inEnd`?t-(t>e?D:-D):t+(t>=e?D:-D);g?m(ne(x,C),w+a/2,ee,E===`outEnd`?te>0?`start`:`end`:`middle`):m(w+a/2,ne(x,C),ee,`middle`)})})}else{let t=e.categories.map(()=>0),n=e.series.map((n,r)=>{let i=[],a=[];return e.categories.forEach((o,s)=>{let c=S(r,s);if(c===null)return;let l=v?t[s]??0:0,u=l+c;v&&(t[s]=u);let p=be(s),h=e=>g?[me(e),p]:[p,me(e)];if(i.push(h(u)),a.push(h(l)),Pc(e.type)&&d){let t=Hc(e),[i,a]=h(u);m(i+(t===`r`?f:t===`l`?-f:0),a+(t===`t`?-f:t===`b`?f:0),el(e,b[r]?.[s]??0,0,n,e.categories[s]??``),t===`r`?`start`:t===`l`?`end`:`middle`)}}),{series:n,s:r,points:i,base:a}});for(let{series:t,s:i,points:a,base:s}of n){let n=t.color??jc(i);if(Fc(e.type)&&a.length>0)o.shapes.push({d:`${Xc([...a,...[...s].reverse()])} Z`,color:n,width:0,fill:n,series:i});else if(a.length>0&&(o.lines.push({d:t.smooth===!0?Yc(a):Xc(a),color:n,width:t.line_width??r.lineWidth,series:i}),zc(e.type)))for(let[e,i]of a)o.dots.push({x:e,y:i,r:(t.marker_size??r.marker)/2,color:n})}o.shapes.reverse()}return o}var B=class{sheet;top;left;bottom;right;constructor(e,t,n,r,i){this.sheet=e,this.top=t,this.left=n,this.bottom=r,this.right=i}get rows(){return this.bottom-this.top+1}get cols(){return this.right-this.left+1}get single(){return this.top===this.bottom&&this.left===this.right}get key(){return`${String(this.sheet.index)}!${String(this.top)},${String(this.left)}:${String(this.bottom)},${String(this.right)}`}},rl=class{parts;constructor(e){this.parts=e}},il=class{params;body;frame;constructor(e,t,n){this.params=e,this.body=t,this.frame=n}},al=class{missing=!0},ol=new al;function sl(e,t){if(e===null)return``;if(e instanceof N)return e.code;if(typeof e==`boolean`)return e?`TRUE`:`FALSE`;let n=t??`General`;if(typeof e==`string`)return t!==void 0&&Oc(t)?Tc(t,e):e;if(n===`General`||!Oc(n))return On(e);try{return Tc(n,e)}catch{return On(e)}}function cl(e,t){if(typeof e!=`number`||t===void 0||!Oc(t))return;let n=Ec(t,e);return typeof n==`string`?n:void 0}var ll=e=>e!==void 0&&Oc(e)&&Dc(e),ul={width:480,height:288,size:9,titleSize:14,ink:`#595959`,pixelsToPoints:.75},dl={dk1:`#000000`,lt1:`#FFFFFF`,dk2:`#44546A`,lt2:`#E7E6E6`,accent1:`#4472C4`,accent2:`#ED7D31`,accent3:`#A5A5A5`,accent4:`#FFC000`,accent5:`#5B9BD5`,accent6:`#70AD47`,hlink:`#0563C1`,folHlink:`#954F72`},fl=e=>typeof e==`string`?dl[e]??`#000000`:e.rgb;function pl(e,t,n){let{node:r}=n;if(!r)return[];let i=e.eval(r,{sheet:t,row:0,col:0,dr:0,dc:0}),a=t=>{let n=t.sheet,r=e.filtered(n),i=[],a=Math.min(t.bottom,n.lastRow),o=Math.min(t.right,n.columnsUsed-1);for(let s=t.top;s<=a;s++)if(!(r.has(s)||n.spec.rows?.[String(s+1)]?.hidden===!0))for(let r=t.left;r<=o;r++)n.spec.columns?.[Xt(r)]?.hidden!==!0&&i.push({value:e.value(n,s,r),sheet:n,row:s,col:r});return i};if(i instanceof B)return a(i);if(i instanceof rl)return i.parts.flatMap(a);if(i instanceof F)return i.data.map(e=>({value:e}));let o=e.flat(i);return o instanceof F?o.data.map(e=>({value:e})):[{value:o}]}var ml=e=>{if(e.value===null)return``;let t=e.sheet&&e.row!==void 0&&e.col!==void 0?e.sheet.lookAt(e.row,e.col).format:void 0;return sl(e.value,t)};function hl(e){return typeof e==`number`?Number.isFinite(e)?e:null:e===null||e instanceof N?null:typeof e==`boolean`?+!!e:0}var gl=e=>e&&{...e.min===void 0?{}:{minimum_scale:e.min},...e.max===void 0?{}:{maximum_scale:e.max},...e.major===void 0?{}:{major_unit:e.major},...e.gridlines===void 0?{}:{has_major_gridlines:e.gridlines},...e.visible===void 0?{}:{visible:e.visible},...e.format===void 0?{}:{number_format:e.format},...e.reverse===void 0?{}:{reverse_order:e.reverse},...e.title===void 0||e.title===``?{}:{title:e.title}},_l=e=>e===void 0?void 0:{rgb:e};function vl(e){if(e===void 0||e===!1)return;if(e===!0)return{show_value:!0};let t=typeof e.color==`string`?_l(e.color):void 0;return{...e.value===void 0?{}:{show_value:e.value},...e.percentage===void 0?{}:{show_percentage:e.percentage},...e.category===void 0?{}:{show_category_name:e.category},...e.series===void 0?{}:{show_series_name:e.series},...e.format===void 0?{}:{number_format:e.format},...e.position===void 0?{}:{position:e.position},...e.size===void 0?{}:{size:e.size},...t?{color:t}:{}}}var yl=e=>{let t=e.find(e=>e.sheet);return t?.sheet&&t.row!==void 0&&t.col!==void 0?t.sheet.lookAt(t.row,t.col).format:void 0};function bl(e,t,n){let{spec:r}=n,i=Lc(r.type),a=n.categories?pl(e,t,n.categories):void 0,o=n.series.map((n,o)=>{let s=r.series[o],c=pl(e,t,n.values),l=n.name?pl(e,t,n.name)[0]:void 0,u=n.x?pl(e,t,n.x):i?a:void 0,d=s.format??yl(c),f=_l(s.color);return{name:(l?ml(l):s.name)??`Series${String(o+1)}`,values:c.map(e=>hl(e.value)),...u?{x:u.map(e=>hl(e.value))}:{},...d===void 0?{}:{number_format:d},...f?{color:f}:{},...s.smooth===void 0?{}:{smooth:s.smooth},...s.line_width===void 0?{}:{line_width:s.line_width},...s.marker_size===void 0?{}:{marker_size:s.marker_size}}}),s=Math.max(0,...o.map(e=>e.values.length)),c=a?a.map(ml):Array.from({length:s},(e,t)=>String(t+1)),l=n.title?pl(e,t,n.title)[0]:void 0,u=l?ml(l):r.title,d=vl(r.labels),f=gl(r.value_axis),p=gl(r.category_axis);return{type:r.type,categories:c,series:o,...u===void 0||u===``?{}:{title:u},...r.legend===void 0?{}:{legend:r.legend},...d?{labels:d}:{},...r.gap_width===void 0?{}:{gap_width:r.gap_width},...r.overlap===void 0?{}:{overlap:r.overlap},...r.vary_by_categories===void 0?{}:{vary_by_categories:r.vary_by_categories},...r.hole_size===void 0?{}:{hole_size:r.hole_size},...f?{value_axis:f}:{},...p?{category_axis:p}:{},font_size:r.size??ul.size,title_size:r.title_size??ul.titleSize,font_color:_l(r.color)??{rgb:ul.ink}}}var xl=e=>({width:e.width??ul.width,height:e.height??ul.height}),Sl={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`},Cl=e=>e.replace(/[&<>"]/gu,e=>Sl[e]??e),wl=e=>String(Number(e.toFixed(3)));function Tl(e){let t=e.fill===void 0?`none`:fl(e.fill),n=e.width>0?fl(e.color):`none`;return`<path d="${Cl(e.d)}" fill="${t}" stroke="${n}" stroke-width="${wl(e.width)}" stroke-linejoin="round"/>`}function El(e){let t=[];for(let n of[...e.grid,...e.shapes])t.push(Tl(n));for(let n of[...e.boxes,...e.keys])t.push(`<rect x="${wl(n.x)}" y="${wl(n.y)}" width="${wl(n.width)}" height="${wl(n.height)}" fill="${fl(n.color)}"/>`);for(let n of[...e.axes,...e.lines])t.push(Tl(n));for(let n of e.dots)t.push(`<circle cx="${wl(n.x)}" cy="${wl(n.y)}" r="${wl(n.r)}" fill="${fl(n.color)}"/>`);for(let n of e.words){let e=n.rotate===void 0?``:` transform="rotate(${wl(n.rotate)} ${wl(n.x)} ${wl(n.y)})"`;t.push(`<text x="${wl(n.x)}" y="${wl(n.y)}" font-size="${wl(n.size)}" text-anchor="${n.anchor}" dominant-baseline="central" fill="${fl(n.color)}"${e}>${Cl(n.text)}</text>`)}return t.join(``)}function Dl(e,t,n,r={}){let i=ul.pixelsToPoints,a=t*i,o=n*i,s=r.font??`Carlito, Calibri, Arial, sans-serif`,c=r.paper??`#FFFFFF`,l=r.edge??`#D9D9D9`;return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${wl(a)} ${wl(o)}" width="${wl(t)}" height="${wl(n)}" font-family="${Cl(s)}"><rect x="0.375" y="0.375" width="${wl(a-.75)}" height="${wl(o-.75)}" fill="${c}" stroke="${l===`none`?`none`:l}" stroke-width="0.75"/>${El(nl(e,a,o))}</svg>`}function Ol(e,t){let n=e=>e?.startsWith(`=`)===!0?t(e):e,r=n(e.title);return{...e,...r===void 0?{}:{title:r},...e.categories===void 0?{}:{categories:t(e.categories)},series:e.series.map(e=>{let r=n(e.name);return{...e,values:t(e.values),...e.x===void 0?{}:{x:t(e.x)},...r===void 0?{}:{name:r}}})}}function kl(e,t,n,r){if(r){let e=r.data;if(n.top===e.top&&n.bottom===e.bottom&&n.left===n.right){let e=r.columns[n.left-r.at.col];if(e)return`${r.name}[${e.name}]`}}return`${t===e?``:hr(t.name)}${$t(n)}`}var Al=(e,t,n,r)=>typeof e.value(t,n,r)==`number`,jl=(e,t,n,r)=>{let i=e.value(t,n,r);if(typeof i==`string`)return!0;let a=t.lookAt(n,r).format;return typeof i==`number`&&a!==void 0&&/[ymd]/iu.test(a)};function Ml(e,t,n,r,i){let a=r.bottom-r.top+1,o=r.right-r.left+1,s=t.tables.find(e=>rn(e.area,r.top,r.left)),c=e=>kl(n,t,e,s),l=Lc(i),u=a>1&&Array.from({length:o},(e,t)=>r.left+t).some(n=>!Al(e,t,r.top,n)),d=o>1&&(l||Array.from({length:a-+!!u},(e,t)=>t).every(n=>jl(e,t,r.top+ +!!u+n,r.left)||e.value(t,r.top+ +!!u+n,r.left)===null)),f=r.top+ +!!u,p=r.left+ +!!d;if(f>r.bottom||p>r.right)return;let m=!l&&!Ic(i)&&r.right-p>r.bottom-f,h=[],g=(r,i)=>e.value(t,r,i)===null?void 0:`=${t===n?``:hr(t.name)}${Qt({row:r,col:i})}`,_=m?{first:f,last:r.bottom}:{first:p,last:r.right};for(let e=_.first;e<=_.last;e++){let t=m?{top:e,left:p,bottom:e,right:r.right}:{top:f,left:e,bottom:r.bottom,right:e},n=m?d?g(e,r.left):void 0:u?g(r.top,e):void 0;h.push({values:c(t),...n===void 0?{}:{name:n}})}let v=m?u?{top:r.top,left:p,bottom:r.top,right:r.right}:void 0:d?{top:f,left:r.left,bottom:r.bottom,right:r.left}:void 0,y=h.length>1&&!Ic(i),b=Ic(i)?h.slice(0,1):h,x=b.length===1?b[0]?.name:void 0;return{type:i,...v?{categories:c(v)}:{},series:b,...y||Ic(i)?{legend:`bottom`}:{},...x===void 0?{}:{title:x}}}function Nl(e,t,n){if(!n?.node)return;let r=e.eval(n.node,{sheet:t,row:0,col:0,dr:0,dc:0});return r instanceof B?{sheet:r.sheet,area:{top:r.top,left:r.left,bottom:Math.min(r.bottom,Math.max(r.top,r.sheet.lastRow)),right:r.right}}:void 0}function Pl(e,t,n){let r=[Nl(e,t,n.categories),...n.series.flatMap(n=>[Nl(e,t,n.values),Nl(e,t,n.name),Nl(e,t,n.x)])].filter(e=>e!==void 0),i=r[0];if(!i||r.some(e=>e.sheet!==i.sheet))return;let a={top:Math.min(...r.map(e=>e.area.top)),left:Math.min(...r.map(e=>e.area.left)),bottom:Math.max(...r.map(e=>e.area.bottom)),right:Math.max(...r.map(e=>e.area.right))};return`${i.sheet===t?``:hr(i.sheet.name)}${$t(a)}`}function Fl(e,t,n){let r=n.lastIndexOf(`!`),i=r<0?void 0:n.slice(0,r).replace(/^'|'$/gu,``),a=i===void 0?t:e.wb.sheet(i.replaceAll(`''`,`'`)),o=tn(n.slice(r+1).replaceAll(`$`,``));return a&&o?{sheet:a,area:o}:void 0}var Il=e=>e.op===`insert-rows`||e.op===`delete-rows`||e.op===`insert-columns`||e.op===`delete-columns`,Ll=e=>e.op===`insert-rows`||e.op===`insert-columns`,Rl=e=>e.op===`insert-rows`||e.op===`delete-rows`;function zl(e,t){return Ll(t)?e>=t.at?e+t.count:e:e<t.at?e:e>=t.at+t.count?e-t.count:void 0}function Bl(e,t){let n=en(e);if(!n)return e;let r=zl(Rl(t)?n.row:n.col,t);if(r!==void 0)return Qt(Rl(t)?{...n,row:r}:{...n,col:r})}function Vl(e,t){return Object.fromEntries(Object.entries(e).flatMap(([e,n])=>{let r=Bl(e,t);return r===void 0?[]:[[r,n]]}))}var Hl=e=>Rl(e)?Jt:Yt;function Ul(e,t,n){let r=Hl(n);if(Ll(n)){let i=e>=n.at?e+n.count:e,a=t>=n.at?t+n.count:t;return i>=r?void 0:[i,Math.min(a,r-1)]}let i=n.at+n.count-1;if(!(e>=n.at&&t<=i))return[e<n.at?e:e>i?e-n.count:n.at,t<n.at?t:t>i?t-n.count:n.at-1]}function Wl(e,t){let n=Rl(t)?Ul(e.top,e.bottom,t):Ul(e.left,e.right,t);if(n)return Rl(t)?{...e,top:n[0],bottom:n[1]}:{...e,left:n[0],right:n[1]}}function Gl(e,t,n,r){let i=0,a=(e,t)=>{e&&!e.abs&&(i=Math.max(i,Math.abs(e.index-t)))};return Kn(e,e=>{e.kind===`ref`&&(t?(a(e.row,n),a(e.row2,n)):(a(e.col,r),a(e.col2,r)))}),i}function Kl(e,t,n,r){let i=new Set,a=n=>{for(let a=n-r-1;a<=n+r+1;a++)a>=e&&a<=t&&i.add(a)};a(n.at),a(n.at+n.count);let o=[...i].sort((e,t)=>e-t),s=[],c=e;for(let e of o)e>c&&s.push([c,e-1]),s.push([e,e]),c=e+1;return c<=t&&s.push([c,t]),s}function ql(e,t,n,r,i){let a=fr(t);if(!a.ok){let n=i?Wl(e,r):e;return n?[{area:n,text:t}]:[]}let o=Rl(r),[s,c]=o?[e.top,e.bottom]:[e.left,e.right],l=Gl(a.node,o,e.top,e.left),u=[],d=!0;for(let[t,f]of Kl(s,c,r,l)){let s=o?t:e.top,c=o?e.left:t,l=i?zl(t,r):t;if(l===void 0)continue;let p=i?zl(f,r):f;if(p===void 0)continue;let m=Yn(a.node,s-e.top,c-e.left),h=oi(m,r,n);h!==m&&(d=!1);let g=Xn(h,o?l:e.top,o?e.left:l),_=u[u.length-1];_?.key===g&&_.to+1===l?_.to=p:u.push({from:l,to:p,key:g,text:xr(h)})}return u.map(n=>({area:o?{...e,top:n.from,bottom:n.to}:{...e,left:n.from,right:n.to},text:d&&u.length===1?t:n.text}))}function Jl(e,t){return typeof e==`object`&&e?{...e,formula:t}:t}var Yl=e=>{if(typeof e==`string`)return e.startsWith(`=`)?e:void 0;if(typeof e==`object`&&e)return e.formula===void 0?typeof e.value==`string`&&e.value.startsWith(`=`)?e.value:void 0:e.formula.startsWith(`=`)?e.formula:`=${e.formula}`};function Xl(e,t,n,r){let i=fr(e);if(!i.ok)return e;let a=oi(i.node,t,n,r);return a===i.node?e:xr(a)}function Zl(e,t,n,r){let i={},a=Il(n)?n:void 0;for(let[o,s]of Object.entries(e)){let e=Yl(s),c=tn(o);if(!c){i[o]=s;continue}let l=r&&a!==void 0;if(o.includes(`:`)){if(!a){i[o]=e===void 0?s:Jl(s,Xl(e,n,t));continue}if(e!==void 0){for(let n of ql(c,e,t,a,l))i[$t(n.area)]=Jl(s,n.text);continue}if(!l){i[o]=s;continue}if(!Ll(a)){let e=Wl(c,a);e&&(i[$t(e)]=s);continue}let r=Rl(a),[u,d]=r?[c.top,c.bottom]:[c.left,c.right];for(let[e,t]of[[u,Math.min(d,a.at-1)],[Math.max(u,a.at),d]]){if(e>t)continue;let n=e>=a.at?a.count:0,o=r?{...c,top:e+n,bottom:t+n}:{...c,left:e+n,right:t+n};i[$t(o)]=s}continue}let u={row:c.top,col:c.left},d=u;if(l){let e=zl(Rl(a)?u.row:u.col,a);d=e===void 0?void 0:Rl(a)?{...u,row:e}:{...u,col:e}}d&&(i[Qt(d)]=e===void 0?s:Jl(s,Xl(e,n,t)))}return i}function Ql(e,t){let n=en(e.at);if(!n)return;let r=t[0]??[],i=r.map(e=>e.trim()),a=new Set(i.map(e=>e.toLowerCase()));for(let t of Object.keys(e.columns??{}))a.has(t.toLowerCase())||i.push(t);let o=[];return t.forEach((e,t)=>{t>0&&e.length>0&&o.push(t)}),{at:n,header:r,names:i,places:o}}var $l=e=>e.reduce((e,t)=>Math.max(e,t.length),0);function eu(e,t,n){let r=Math.max($l(e),1),i=Array.from({length:n},()=>Array(r).fill(``));return[...e.slice(0,t),...i,...e.slice(t)]}function tu(e,t=`Column`){let n=new Set(e.map(e=>e.toLowerCase()));for(let e=1;;e++){let r=`${t}${String(e)}`;if(!n.has(r.toLowerCase()))return r}}function nu(e,t){let n=new Set(e.map(e=>e.toLowerCase()));if(!n.has(t.toLowerCase()))return t;for(let e=2;;e++){let r=`${t}${String(e)}`;if(!n.has(r.toLowerCase()))return r}}function ru(e,t,n){let r=e.map(e=>[...e]),i=r[0]??[];for(r.length===0&&r.push(i);i.length<=n;)i.push(t[i.length]??``);let a=i.length;for(let e=1;e<r.length;e++){let t=r[e];if(t&&t.length>0)for(;t.length<a;)t.push(``)}return r}var iu=class{file;rows;edit;after=[];refused;constructor(e,t){this.file=structuredClone(e.file),this.rows=new Map(e.rows),this.edit=t}sheets(){return this.file.sheets}rewrite(e){let t=this.file.sheets[0]?.name??``;if(this.file.names)for(let[n,r]of Object.entries(this.file.names))typeof r==`string`&&r.startsWith(`=`)&&(this.file.names[n]=Xl(r,e,t));for(let n of this.file.checks??[])n.formula=Xl(n.formula,e,t);for(let t of this.sheets())this.rewriteSheet(t,e)}rewriteSheet(e,t){let n=Il(t)&&au(e.name,t.sheet);e.cells&&=Zl(e.cells,e.name,t,n);for(let n of e.tables??[]){for(let r of Object.values(n.columns??{}))r.formula!==void 0&&(r.formula=Xl(r.formula,t,e.name,n.name));this.rewriteCsv(n.rows,t,e.name,n.name)}for(let n of e.blocks??[])this.rewriteCsv(n.rows,t,e.name);this.rewriteRules(e,t)}freePath(e,t){let n=e.slice(0,e.lastIndexOf(`/`)+1),r=e=>[...this.rows.keys()].some(t=>au(t,e)),i=`${n}${t}.csv`;for(let e=2;r(i);e++)i=`${n}${t}-${String(e)}.csv`;return i}duplicate(e,t){let n=this.sheets(),r=n.findIndex(t=>au(t.name,e)),i=n[r];if(!i){this.refused=`no-sheet`;return}let a=structuredClone(i);a.name=t,delete a.hidden;for(let e of Object.values(a.cells??{}))typeof e==`object`&&e&&delete e.name;let o=new Set(n.flatMap(e=>e.tables??[]).map(e=>e.name.toLowerCase())),s=new Set(Object.keys(this.file.names??{}).map(e=>e.toLowerCase())),c=[];for(let e of a.tables??[]){let t=e.name;for(let n=2;;n++){t=`${e.name}${String(n)}`;let r=t.toLowerCase();if(!o.has(r)&&!s.has(r))break}o.add(t.toLowerCase());let n=this.freePath(e.rows,t);this.rows.set(n,this.rows.get(e.rows)??[]),c.push({op:`rename-table`,from:e.name,to:t}),e.rows=n,e.name=t}for(let e of a.blocks??[]){let t=e.rows.slice(e.rows.lastIndexOf(`/`)+1,-4),n=this.freePath(e.rows,t);this.rows.set(n,this.rows.get(e.rows)??[]),e.rows=n}this.file.sheets=[...n.slice(0,r+1),a,...n.slice(r+1)],this.rewriteSheet(a,{op:`rename-sheet`,from:e,to:t});for(let e of c)this.rewriteSheet(a,e)}rewriteRules(e,t){let n=n=>typeof n==`string`&&n.startsWith(`=`)?Xl(n,t,e.name):n,r=e=>e.value===void 0?e:{...e,value:n(e.value)},i=e.conditional?.map(i=>{switch(i.type){case`cellIs`:return{...i,formula:i.formula.map(n)};case`expression`:return{...i,formula:Xl(i.formula.startsWith(`=`)?i.formula:`=${i.formula}`,t,e.name)};case`dataBar`:return{...i,...i.min?{min:r(i.min)}:{},...i.max?{max:r(i.max)}:{}};case`colorScale`:return{...i,stops:i.stops.map(r)};case`iconSet`:return i.stops?{...i,stops:i.stops.map(r)}:i;default:return i}});i&&(e.conditional=i);let a=e.validations?.map(e=>e.formula?{...e,formula:e.formula.map(n)}:e);a&&(e.validations=a),Il(t)&&t.sheet===e.name&&(e.links&&=Vl(e.links,t),e.notes&&=Vl(e.notes,t),e.pictures&&=e.pictures.flatMap(e=>{let n=Bl(e.at,t);return n===void 0?[]:[{...e,at:n}]})),e.charts&&=e.charts.map(n=>Ol(n,n=>{let r=n.startsWith(`=`),i=Xl(zr(n),t,e.name);return r?i:i.slice(1)}))}rewriteCsv(e,t,n,r){let i=this.rows.get(e);if(!i)return;let a;i.forEach((e,o)=>{if(!e.some(e=>e.charCodeAt(0)===61))return;let s=e.map(e=>Pn(e).formula===void 0?e:Xl(e,t,n,r));s.every((t,n)=>t===e[n])||(a??=[...i],a[o]=s)}),a&&this.rows.set(e,a)}tableOn(e,t){let n=Rl(t),r=[];for(let i of e.tables??[]){let e=this.rows.get(i.rows),a=e&&Ql(i,e);if(!e||!a){r.push(i);continue}let o=a.at.row,s=a.at.col,c=o+a.places.length,l=s+Math.max(a.names.length,1)-1,[u,d]=n?[o,c]:[s,l];if(!Ll(t)&&t.at<=u&&t.at+t.count-1>=d){this.after.push({op:`delete-table`,name:i.name});continue}let f={...a.at};if(n){if(Ll(t)){if(t.at<=o)f.row+=t.count;else if(t.at<=c){let n=a.places[t.at-o-1]??e.length;this.rows.set(i.rows,eu(e,n,t.count))}}else{let n=t.at+t.count-1;if(n<o)f.row-=t.count;else if(t.at<=o){this.refused=`table-header`;return}else if(t.at<=c){let r=new Set(a.places.slice(t.at-o-1,n-o));this.rows.set(i.rows,e.filter((e,t)=>!r.has(t)))}}}else if(Ll(t))t.at<=s?f.col+=t.count:t.at<=l&&this.columnsIn(i,a,t.at-s,t.count);else{let e=t.at+t.count-1;if(e<s)f.col-=t.count;else if(t.at<=l){f.col=Math.min(s,t.at);let n=Math.max(0,t.at-s),r=Math.min(a.names.length-1,e-s);this.columnsOut(i,a,n,r)}}i.at=Qt(f),r.push(i)}e.tables=r,r.length===0&&delete e.tables}columnsIn(e,t,n,r){let i=this.rows.get(e.rows)??[],a=n>0?ru(i,t.names,n-1):i.map(e=>[...e]),o=[...t.names];a.forEach((e,t)=>{if(t>0&&e.length===0)return;let i=[];for(let e=0;e<r;e++)if(t===0){let e=tu(o);o.push(e),i.push(e)}else i.push(``);for(;e.length<n;)e.push(``);e.splice(n,0,...i)}),this.rows.set(e.rows,a)}columnsOut(e,t,n,r){let i=t.names.slice(n,r+1),a=this.rows.get(e.rows)??[],o=t.header.length,s=new Set;for(let e=n;e<=r&&e<o;e++)s.add(e);if(s.size>0&&this.rows.set(e.rows,a.map(e=>e.length===0?e:e.filter((e,t)=>!s.has(t)))),e.columns){let t=new Set(i.map(e=>e.toLowerCase()));e.columns=Object.fromEntries(Object.entries(e.columns).filter(([e])=>!t.has(e.toLowerCase()))),Object.keys(e.columns).length===0&&delete e.columns}if(e.key!==void 0&&i.some(t=>t.toLowerCase()===e.key?.toLowerCase())&&delete e.key,e.filter){let t=new Set(i.map(e=>e.toLowerCase())),n=Object.fromEntries(Object.entries(e.filter.columns).filter(([e])=>!t.has(e.toLowerCase())));Object.keys(n).length>0?e.filter={columns:n}:delete e.filter}for(let t of i)this.after.push({op:`delete-column`,table:e.name,name:t})}blocksOn(e,t){let n=Rl(t),r=(e.blocks??[]).flatMap(e=>{let r=en(e.at),i=this.rows.get(e.rows);if(!r||!i)return[e];let a=n?r.row:r.col,o=a+(n?i.length:Math.max($l(i),1))-1,s=Ul(a,o,t);if(!s)return[];let c=n?{...r,row:s[0]}:{...r,col:s[0]};if(Ll(t)&&t.at>a&&t.at<=o){let r=t.at-a;this.rows.set(e.rows,n?eu(i,r,t.count):i.map(e=>{if(e.length===0)return e;let n=[...e];for(;n.length<r;)n.push(``);return n.splice(r,0,...Array(t.count).fill(``)),n}))}else if(!Ll(t)&&t.at<=o){let r=Math.max(t.at,a)-a,s=Math.min(t.at+t.count-1,o)-a;this.rows.set(e.rows,n?i.filter((e,t)=>t<r||t>s):i.map(e=>e.filter((e,t)=>t<r||t>s)))}return[{...e,at:Qt(c)}]});e.blocks=r,r.length===0&&delete e.blocks}looksOn(e,t){let n=Rl(t);e.format&&=e.format.flatMap(e=>{let n=tn(e.range);if(!n)return[e];let r=Wl(n,t);return r?[{...e,range:$t(r)}]:[]}),e.format?.length===0&&delete e.format,e.merges&&=e.merges.flatMap(e=>{let n=tn(e);if(!n)return[e];let r=Wl(n,t);return r?[$t(r)]:[]}),e.merges?.length===0&&delete e.merges;let r=e=>{let n=nn(e);if(!n)return e;let r=n.flatMap(e=>{let n=Wl(e,t);return n?[$t(n)]:[]});return r.length===0?void 0:r.join(` `)};if(e.conditional&&=e.conditional.flatMap(e=>{let t=r(e.range);return t===void 0?[]:[{...e,range:t}]}),e.conditional?.length===0&&delete e.conditional,e.validations&&=e.validations.flatMap(e=>{let t=r(e.range);return t===void 0?[]:[{...e,range:t}]}),e.validations?.length===0&&delete e.validations,e.charts&&=e.charts.map(e=>{let r=en(e.at);if(!r)return e;let i=zl(n?r.row:r.col,t)??t.at;return{...e,at:Qt(n?{...r,row:i}:{...r,col:i})}}),e.filter){let r=tn(e.filter.range),i=r&&Wl(r,t);if(r&&!i)delete e.filter;else if(i){let r=n?e.filter.columns:Object.fromEntries(Object.entries(e.filter.columns??{}).flatMap(([e,n])=>{let r=Zt(e),i=r===void 0?void 0:zl(r,t);return i===void 0?[]:[[Xt(i),n]]}));e.filter={range:$t(i),...r&&Object.keys(r).length>0?{columns:r}:{}}}}if(e.freeze!==void 0){let r=en(e.freeze);if(r){let i=n?r.row:r.col,a=Ul(0,i-1,t),o=i===0?0:a?a[1]+1:0;e.freeze=Qt(n?{...r,row:o}:{...r,col:o})}}let i=(e,n,r)=>{if(!e)return;let i={};for(let[a,o]of Object.entries(e)){let e=n(a),s=e===void 0?void 0:zl(e,t);e===void 0?i[a]=o:s!==void 0&&(i[r(s)]=o)}return i};if(n){let t=i(e.rows,e=>/^[1-9]\d*$/u.test(e)?Number(e)-1:void 0,e=>String(e+1));t&&(e.rows=t)}else{let t=i(e.columns,Zt,Xt);t&&(e.columns=t)}}run(){let e=this.edit;if(Il(e)){let t=this.sheets().find(t=>au(t.name,e.sheet));if(!t){this.refused=`no-sheet`;return}if(this.rewrite(e),this.tableOn(t,e),this.refused)return;this.blocksOn(t,e),this.looksOn(t,e);for(let e of this.after)this.rewrite(e)}else switch(e.op){case`rename-sheet`:{this.rewrite(e);let t=this.sheets().find(t=>au(t.name,e.from));t&&(t.name=e.to);return}case`rename-column`:this.renameColumn(e.table,e.from,e.to),this.rewrite(e);return;case`delete-sheet`:{let t=this.sheets(),n=t.find(t=>au(t.name,e.name));if(!n){this.refused=`no-sheet`;return}if(t.filter(e=>e.hidden!==!0).length<=1){this.refused=`last-sheet`;return}this.rewrite(e);for(let e of n.tables??[])this.rewrite({op:`delete-table`,name:e.name});this.file.sheets=t.filter(e=>e!==n);return}default:this.rewrite(e)}}renameColumn(e,t,n){let r=this.sheets().flatMap(e=>e.tables??[]).find(t=>au(t.name,e));if(!r)return;let i=t.toLowerCase(),a=this.rows.get(r.rows),o=a?.[0]?.findIndex(e=>e.trim().toLowerCase()===i)??-1;if(a&&o>=0){let e=[...a[0]??[]];e[o]=n,this.rows.set(r.rows,[e,...a.slice(1)])}if(r.columns){let e=Object.keys(r.columns).find(e=>e.toLowerCase()===i);e!==void 0&&(r.columns=Object.fromEntries(Object.entries(r.columns).map(([t,r])=>[t===e?n:t,r])))}r.key?.toLowerCase()===i&&(r.key=n),r.filter&&={columns:Object.fromEntries(Object.entries(r.filter.columns).map(([e,t])=>[e.toLowerCase()===i?n:e,t]))}}},au=(e,t)=>e.toLowerCase()===t.toLowerCase();function ou(e,t){let n=new iu(e,t);return n.run(),n.refused?{file:e.file,rows:new Map(e.rows),refused:n.refused}:{file:n.file,rows:n.rows}}function su(e,t,n){let r=new iu(e,{op:`rename-sheet`,from:t,to:n});return r.duplicate(t,n),r.refused?{file:e.file,rows:new Map(e.rows),refused:r.refused}:{file:r.file,rows:r.rows}}var cu=(e,t)=>e.top<=t.top&&e.left<=t.left&&e.bottom>=t.bottom&&e.right>=t.right,lu=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),uu=e=>lu(e,`formula`),du=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),fu=()=>({rows:new Map,cells:[],whole:!1}),V=e=>({...fu(),refused:e}),pu=e=>Pn(e).formula!==void 0;function mu(e){let t=Pn(e);return t.formula===void 0?t.value===null?null:t.format===void 0&&(typeof t.value==`number`||typeof t.value==`boolean`)?t.value:e:e}var hu=e=>typeof e==`object`&&e?Object.fromEntries(Object.entries(e).filter(([e])=>e!==`value`&&e!==`formula`)):{},gu=class{book;specs=new Map;file;fileChanged=!1;grown=new Map;added=new Map;edit=fu();constructor(e){this.book=e,this.file=e.file}spec(e){let t=this.specs.get(e.index);if(!t){let n=this.file.sheets.findIndex(t=>t.name===e.name);t={...this.file.sheets[n]??{name:e.name}},this.specs.set(e.index,t),this.fileChanged||=(this.file={...this.file,sheets:[...this.file.sheets]},!0),this.file.sheets[n]=t}return t}table(e,t){let n=this.spec(e),r=[...n.tables??[]],i=r.findIndex(e=>e.name===t.name),a={...r[i]??t.spec};return r[i]=a,n.tables=r,a}rows(e){let t=this.edit.rows.get(e);if(t)return t;let n=[...this.book.rows.get(e)??[]];return this.edit.rows.set(e,n),n}setField(e,t,n,r){let i=this.rows(e),a=[...i[t]??[]];for(;a.length<=n;)a.push(``);return a[n]=r,i[t]=a,a}rowsOf(e){return this.grown.get(e)??e.rows}grow(e,t,n){this.grown.set(e,this.rowsOf(e)+1);let r=this.added.get(e)??new Map;r.set(t,n),this.added.set(e,r)}addedAt(e,t,n){for(let[r,i]of this.added){let a=i.get(t);if(a!==void 0&&r.sheet===e&&n>=r.at.col&&n<r.at.col+r.columns.length)return{table:r,record:a}}}finish(){return this.fileChanged&&(this.edit.file=this.file),this.edit}};function _u(e,t,n,r){return t.tables.find(i=>{if(n!==i.at.row+e.rowsOf(i)+1)return!1;let a=i.at.col+i.columns.length-1;if(r<i.at.col||r>a)return!1;for(let e=i.at.col;e<=a;e++)if(t.at(n,e)!==void 0)return!1;return!0})}function vu(e,t,n){return e.tables.find(r=>{let{top:i,bottom:a,right:o}=r.area;if(n!==o+1||t<i||t>a)return!1;for(let t=i;t<=a;t++)if(e.at(t,n)!==void 0)return!1;return!0})}var yu=(e,t,n)=>{let r=fr(e);return r.ok?xr(Yn(r.node,t,n)):e};function bu(e,t,n,r,i,a){let o=n.at.row+1,s=e.table(t,n),c=yu(a,o-i,0);if(s.columns={...s.columns,[r.name]:{...s.columns?.[r.name],formula:c}},r.csv!==void 0){let t=n.places[i-o];t!==void 0&&e.setField(n.file,t,r.csv,``)}e.edit.whole=!0}function xu(e,t,n,r){let{csv:i}=n;if(i===void 0)return!1;let a=e.rows(t.file);return t.places.some((e,t)=>t!==r&&(a[e]?.[i]??``)!==``)}function Su(e,t,n,r,i){let a=i.trim();if(a===``)return V(`column-name`);if(a===r.name)return e.finish();let o=nu(n.columns.filter(e=>e!==r).map(e=>e.name),a),s=ou(t,{op:`rename-column`,table:n.name,from:r.name,to:o});return{...fu(),file:s.file,rows:new Map(s.rows),whole:!0}}function Cu(e,t,n,r,i,a){let o=n.columns[i-n.at.col];if(!o)return;let s=r-n.at.row-1;if(pu(a)){if(o.formula||!xu(e,n,o,s)){bu(e,t,n,o,r,a);return}e.edit.offer={sheet:t.name,row:r,col:i,text:a}}let c=n.places[s];if(c===void 0)return;let l=o.csv;if(l===void 0){if(a===``)return;let t=n.columns.map(e=>e.name);e.edit.rows.set(n.file,ru(e.rows(n.file),t,o.index)),e.edit.whole=!0,l=o.index}let u=e.setField(n.file,c,l,a);e.edit.cells.push({sheet:t,row:r,col:i,...a===``&&o.formula?{column:o.formula}:{input:a},record:{table:n,index:s,fields:u}})}function wu(e,t,n,r,i){let a=e.rows(t.file),o=Math.max(a[0]?.length??1,1),s=Array(o).fill(``),c=t.columns[r-t.at.col];c?.csv!==void 0&&(s[c.csv]=i),a.push(s),e.grow(t,n,a.length-1),e.edit.whole=!0}function Tu(e,t,n,r,i){let a=e.table(t,n),o=n.columns.map(e=>e.name),s=r===n.at.row,c=s?nu(o,i.trim()===``?tu(o):i.trim()):tu(o);if(e.edit.whole=!0,!s&&pu(i)){a.columns={...a.columns,[c]:{formula:yu(i,n.at.row+1-r,0)}};return}let l=o.length,u=ru(e.rows(n.file),o,l-1),d=u[0];if(d&&d.push(c),u.forEach((e,t)=>{t>0&&e.length>0&&e.push(``)}),!s){let e=n.places[r-n.at.row-1],t=e===void 0?void 0:u[e];t&&(t[l]=i)}e.edit.rows.set(n.file,u)}function Eu(e,t,n,r,i,a,o){e.setField(n,i-r.top,a-r.left,o),e.edit.cells.push({sheet:t,row:i,col:a,input:o})}function Du(e,t,n){return Object.keys(e.spec.cells??{}).some(e=>{if(!e.includes(`:`))return!1;let r=tn(e);return r!==void 0&&rn(r,t,n)})}function Ou(e,t,n,r,i){let a=e.spec(t),o=Qt({row:n,col:r}),s={...a.cells},c=s[o],l=c===void 0?{}:hu(c),u=mu(i),d=Object.keys(l).length===0,f;if(u===null){let e=Du(t,n,r);f=!d||e,d&&!e?s=du(s,o):s[o]=d?null:l}else f=!0,s[o]=d?u:{...l,...pu(i)?{formula:i}:{value:u}};a.cells=s,Object.keys(s).length===0&&delete a.cells,e.edit.cells.push({sheet:t,row:n,col:r,input:i,key:f?o:null})}function ku(e,t,n,r,i,a){let o=e.addedAt(n,r,i);if(o){let{csv:t}=o.table.columns[i-o.table.at.col]??{};t!==void 0&&e.setField(o.table.file,o.record,t,a);return}let s=n.tableAt(r,i);if(s){let o=s.columns[i-s.at.col];if(r===s.at.row)return o?Su(e,t,s,o,a):void 0;Cu(e,n,s,r,i,a);return}if(a!==``){let t=_u(e,n,r,i);if(t){wu(e,t,r,i,a);return}let o=vu(n,r,i);if(o){Tu(e,n,o,r,a);return}}let c=n.blockAt(r,i);c?Eu(e,n,c.file,c.area,r,i,a):Ou(e,n,r,i,a)}function Au(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e);for(let{row:t,col:a,text:o}of[...n].sort((e,t)=>e.row-t.row||e.col-t.col)){let n=ku(i,e,r,t,a,o);if(n)return n}return i.finish()}function ju(e,t,n,r,i){let a=e.workbook.sheet(t),o=a?.tableAt(n,r);if(!a||!o)return V(`no-sheet`);let s=o.columns[r-o.at.col];if(!s)return V(`no-sheet`);let c=new gu(e);bu(c,a,o,s,n,i);let{csv:l}=s;if(l!==void 0)for(let e of o.places)c.setField(o.file,e,l,``);return c.finish()}function*Mu(e,t){let n=Math.min(t.right,e.columnsUsed-1);for(let r=t.left;r<=n;r++){let[n,i]=e.span(r,t.top,t.bottom);for(let t=n;t<=i;t++)e.at(t,r)!==void 0&&(yield[t,r])}}function Nu(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e);for(let e of r.tables){let{top:t,bottom:a}=e.data;if(!(a<t||n.top>t||n.bottom<a))for(let t of e.columns){let a=e.at.col+t.index;if(a<n.left||a>n.right||!t.formula)continue;let o=i.table(r,e),s=e.columns.map(e=>e.name);t.csv===void 0&&i.edit.rows.set(e.file,ru(i.rows(e.file),s,t.index));let c=uu(o.columns?.[t.name]??{}),l=du(o.columns??{},t.name);o.columns=Object.keys(c).length>0?{...l,[t.name]:c}:l,Object.keys(o.columns).length===0&&delete o.columns,i.edit.whole=!0}}for(let[t,a]of Mu(r,n)){if(r.tableAt(t,a)?.at.row===t)continue;let n=ku(i,e,r,t,a,``);if(n)return n}return i.finish()}function Pu(e,t){e.cells&&=Object.fromEntries(Object.entries(e.cells).filter(([e])=>{let n=tn(e);return!n||!cu(t,n)}))}function Fu(e,t,n,r,i){let a=e.workbook.sheet(t);if(!a)return V(`no-sheet`);if(!a.tables.some(e=>an(e.area,r))&&!a.blocks.some(e=>an(e.area,r))&&pu(i)){let t=new gu(e),o=t.spec(a);Pu(o,r);let s=yu(i,r.top-n.row,r.left-n.col),c=$t(r);return o.cells={...o.cells,[c]:s},t.edit.whole=!0,t.finish()}let o=[];for(let e=r.top;e<=r.bottom;e++)for(let t=r.left;t<=r.right;t++)(e!==n.row||t!==n.col)&&o.push({row:e,col:t,text:pu(i)?yu(i,e-n.row,t-n.col):i});return Au(e,t,o)}function Iu(e,t,n,r,i){let a=e.workbook.sheet(t);if(!a)return V(`no-sheet`);let o=new gu(e),s=o.spec(a);return s.blocks=[...s.blocks??[],{at:Qt(n),rows:i}],o.edit.rows.set(i,r),o.edit.whole=!0,o.finish()}var Lu=(e,t)=>Object.keys(t).some(t=>t in e),Ru=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!(e in t)));function zu(e){if(typeof e!=`object`||!e)return e;let t=Object.keys(e);return t.length===1&&t[0]===`value`?e.value??null:t.length===1&&t[0]===`formula`?e.formula??null:e}var Bu={bold:!1,italic:!1,underline:!1,strike:!1,wrap:!1,align:`general`,format:`General`,color:`#000000`,fill:`#FFFFFF`,font:`Calibri`,size:11,border:{left:{style:`none`},right:{style:`none`},top:{style:`none`},bottom:{style:`none`}}};function Vu(e,t,n,r){for(let[t,i]of Object.entries(e.columns??{})){let e=en(`${t}1`)?.col;if(e!==void 0&&e>=n.left&&e<=n.right&&r in i)return!0}for(let[t,i]of Object.entries(e.rows??{})){let e=Number(t)-1;if(e>=n.top&&e<=n.bottom&&r in i)return!0}return t.tables.some(e=>an(e.area,n)&&e.columns.some(t=>t.spec!==void 0&&r in t.spec&&e.at.col+t.index>=n.left&&e.at.col+t.index<=n.right))}function Hu(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return V(`no-sheet`);let a=new gu(e);return Uu(a,i,n,r),a.finish()}function Uu(e,t,n,r){let i=e.spec(t);Wu(e,t,i,n,r),Gu(i)}function Wu(e,t,n,r,i){if(n.cells){let e={...n.cells},t=[];for(let[n,a]of Object.entries(e)){if(typeof a!=`object`||!a||!Lu(a,i))continue;let o=tn(n);o&&an(o,r)&&(n.includes(`:`)&&!cu(r,o)&&t.push({range:n,...Object.fromEntries(Object.entries(a).filter(([e])=>e in i))}),e[n]=zu(Ru(a,i)))}n.cells=e,t.length>0&&(n.format=[...n.format??[],...t])}let a=n.format??[],o=e=>{let t=tn(e.range);return t!==void 0&&an(t,r)},s=a.some(e=>o(e)&&Lu(e,i)),c=Object.fromEntries(Object.entries(i).filter(([,e])=>e!==void 0)),l=r.top===0&&r.bottom===1048575,u=r.left===0&&r.right===16383;if(l&&!u&&!s){let e={...n.columns};for(let t=r.left;t<=r.right;t++){let n=Xt(t),r={...Ru(e[n]??{},i),...c};e=Object.keys(r).length===0?du(e,n):{...e,[n]:r}}n.columns=e;return}if(u&&!l&&!s){let e={...n.rows};for(let t=r.top;t<=r.bottom;t++){let n=String(t+1),r={...Ru(e[n]??{},i),...c};e=Object.keys(r).length===0?du(e,n):{...e,[n]:r}}n.rows=e;return}let d=t.tables.find(e=>e.rows>0&&r.top===e.data.top&&r.bottom===e.data.bottom&&r.left>=e.area.left&&r.right<=e.area.right);if(d&&!s){let n=e.table(t,d),a={...n.columns};for(let e=r.left;e<=r.right;e++){let t=d.columns[e-d.at.col]?.name;if(t===void 0)continue;let n={...Ru(a[t]??{},i),...c};a=Object.keys(n).length===0?du(a,t):{...a,[t]:n}}n.columns=a,Object.keys(a).length===0&&delete n.columns,e.edit.whole=!0;return}let f=$t(r),p=a.find(e=>{let t=tn(e.range);return t!==void 0&&$t(t)===f}),m=(p?a.slice(a.indexOf(p)+1):[]).some(e=>o(e)&&Lu(e,i)),h={};for(let[e,s]of Object.entries(i)){let i=a.some(t=>t!==p&&o(t)&&e in t)||Vu(n,t,r,e);s===void 0?i&&(h[e]=Bu[e]):h[e]=s}if(p&&!m){let e={...Ru(p,i),...h};n.format=a.flatMap(t=>t===p?Object.keys(e).length>1?[e]:[]:[t])}else Object.keys(h).length>0&&(n.format=[...a,{range:f,...h}])}function Gu(e){e.format?.length===0&&delete e.format,e.columns&&Object.keys(e.columns).length===0&&delete e.columns,e.rows&&Object.keys(e.rows).length===0&&delete e.rows,e.cells&&Object.keys(e.cells).length===0&&delete e.cells}function Ku(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return V(`no-sheet`);let a=new gu(e),o=a.spec(i),s=Xt(n),c=lu(o.columns?.[s]??{},`width`),l=r===void 0?c:{...c,width:r},u=du(o.columns??{},s);return o.columns=Object.keys(l).length===0?u:{...u,[s]:l},Gu(o),a.finish()}function qu(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return V(`no-sheet`);let a=new gu(e),o=a.spec(i),s=String(n+1),c=lu(o.rows?.[s]??{},`height`),l=r===void 0?c:{...c,height:r},u=du(o.rows??{},s);return o.rows=Object.keys(l).length===0?u:{...u,[s]:l},Gu(o),a.finish()}function Ju(e,t,n){if(t.trim()===``||t.length>31||/[\\/?*[\]:]/u.test(t)||t.startsWith(`'`)||t.endsWith(`'`))return`sheet-name`;let r=e.workbook.sheet(t);if(r&&r.name!==n)return`sheet-taken`}function Yu(e,t,n){let r=Ju(e,n,t);if(r)return V(r);let i=ou(e,{op:`rename-sheet`,from:t,to:n});return{...fu(),file:i.file,rows:new Map(i.rows),whole:!0}}function Xu(e,t,n){let r=Ju(e,t);if(r)return V(r);let i=[...e.file.sheets],a=i.findIndex(e=>e.name===n);return i.splice(a<0?i.length:a+1,0,{name:t}),{...fu(),file:{...e.file,sheets:i},whole:!0}}function Zu(e,t){for(let n=2;;n++){let r=` (${String(n)})`,i=t.slice(0,31-r.length).trimEnd()+r;if(!e.workbook.sheet(i))return i}}function Qu(e,t){let n=su(e,t,Zu(e,t));return n.refused?V(n.refused):{...fu(),file:n.file,rows:new Map(n.rows),whole:!0}}function $u(e,t){let n=ou(e,{op:`delete-sheet`,name:t});if(n.refused)return V(n.refused);let r=ed(e.file,n.file);for(let e of r)n.rows.delete(e);return{...fu(),file:n.file,rows:new Map(n.rows),whole:!0,...r.length===0?{}:{removed:r}}}function ed(e,t){let n=e=>e.sheets.flatMap(e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)]),r=new Set(n(t));return[...new Set(n(e))].filter(e=>!r.has(e))}function td(e,t,n){let r=[...e.file.sheets],i=r.findIndex(e=>e.name===t),[a]=r.splice(i,1);return a?(r.splice(n,0,a),{...fu(),file:{...e.file,sheets:r},whole:!0}):V(`no-sheet`)}function nd(e,t){let n=ou(e,t);return n.refused?V(n.refused):{...fu(),file:n.file,rows:new Map(n.rows),whole:!0}}function rd(e,t,n,r){if(!Pr(t)||e.workbook.name(t)||e.workbook.table(t))return V(`name-invalid`);let i=(e,t)=>`$${Xt(t)}$${String(e+1)}`,a=r.top===r.bottom&&r.left===r.right?i(r.top,r.left):`${i(r.top,r.left)}:${i(r.bottom,r.right)}`,o=/^[\p{L}_][\p{L}\p{N}_.]*$/u.test(n)?n:`'${n.replaceAll(`'`,`''`)}'`;return{...fu(),file:{...e.file,names:{...e.file.names,[t]:`=${o}!${a}`}},whole:!0}}function id(e,t,n,r){let i=t.at(n,r);if(i===void 0)return``;if(i instanceof Cr)return i.text;let a=t.tableAt(n,r);if(a){let e=a.columns[r-a.at.col];if(n===a.at.row)return e?.name??``;let t=e?.csv===void 0?void 0:a.records[n-a.at.row-1]?.[e.csv];if(t!==void 0)return t}let o=t.blockAt(n,r);if(o){let t=e.rows.get(o.file)?.[n-o.area.top]?.[r-o.area.left];if(t!==void 0)return t}let s=t.keys.get(Er(n,r)),c=s===void 0?void 0:t.spec.cells?.[s],l=typeof c==`object`&&c?c.value:c;return l==null?typeof i==`object`?i.code:String(i):String(l)}var ad=e=>typeof e==`number`?0:typeof e==`string`?1:typeof e==`boolean`?2:3;function od(e,t){let n=ad(e),r=ad(t);if(n!==r)return n-r;if(typeof e==`number`&&typeof t==`number`)return e-t;if(typeof e==`string`&&typeof t==`string`){let n=e.toLowerCase(),r=t.toLowerCase();return n<r?-1:+(n>r)}return typeof e==`boolean`&&typeof t==`boolean`?e===t?0:e?1:-1:e instanceof N&&t instanceof N?e.code<t.code?-1:+(e.code>t.code):0}var sd=e=>e===null||e===``;function cd(e,t,n){return e.map((e,t)=>({row:e,index:t})).sort((e,r)=>{for(let{col:i,descending:a}of t){let t=n(e.row,i),o=n(r.row,i);if(sd(t)||sd(o)){if(sd(t)&&sd(o))continue;return sd(t)?1:-1}let s=od(t,o);if(s!==0)return a===!0?-s:s}return e.index-r.index}).map(e=>e.row)}function ld(e,t,n,r,i){let a=e.rows(t.file),o=[...a];r.forEach((e,r)=>{let s=n[r];if(s===void 0)return;let c=t.places[e-i],l=t.places[s-i];if(c===void 0||l===void 0)return;let u=s-e,d=o[c]??[];a[l]=u===0?d:d.map(e=>Pn(e).formula===void 0?e:yu(e,u,0))}),e.edit.whole=!0}var ud=(e,t,n)=>{let r=[];for(let i=e;i<=t;i++)n?.has(i)||r.push(i);return r};function dd(e,t,n,r,i,a){let o=e.workbook.sheet(n);if(!o)return V(`no-sheet`);if(i.length===0)return fu();let s=(e,n)=>t.value(o,e,n),c=o.tables.find(e=>e.rows>0&&rn(e.area,r.top,r.left)),l=new gu(e);if(c){let{top:e,bottom:t}=c.data,n=ud(e,t,a),r=cd(n,i,s);return r.every((e,t)=>e===n[t])?fu():(ld(l,c,n,r,e),l.finish())}let u=ud(r.top,Math.min(r.bottom,o.lastRow),a);return fd(l,e,o,r,u,cd(u,i,s)),l.finish()}function fd(e,t,n,r,i,a){let o=Math.min(r.right,n.columnsUsed-1);a.forEach((a,s)=>{let c=i[s];if(c!==void 0&&a!==c)for(let i=r.left;i<=o;i++){let r=id(t,n,a,i),o=Pn(r).formula===void 0?r:yu(r,c-a,0);o!==id(t,n,c,i)&&ku(e,t,n,c,i,o)}})}function pd(e,t,n){if(n.bottom<=n.top)return!1;let r=(n,r)=>t.value(e,n,r);for(let t=n.left;t<=n.right;t++){let i=r(n.top,t),a=r(n.top+1,t);if(typeof i==`string`&&a!==null&&typeof a!=`string`||e.lookAt(n.top,t).bold===!0&&e.lookAt(n.top+1,t).bold!==!0)return!0}return!1}function md(e){let t=Pn(e.trim());if(typeof t.value==`number`)return t.value;if(e.trim()===``)return;let n=Js(e);return typeof n?.value==`number`?n.value:void 0}function H(e){return typeof e==`number`?e:e==null?0:typeof e==`boolean`?+!!e:e instanceof N?e:md(e)??P.VALUE}function hd(e){return typeof e==`string`?e:e==null?``:typeof e==`number`?On(e):typeof e==`boolean`?e?`TRUE`:`FALSE`:e}function gd(e){if(typeof e==`boolean`)return e;if(e==null)return!1;if(typeof e==`number`)return e!==0;if(e instanceof N)return e;let t=e.trim().toUpperCase();return t===`TRUE`||t!==`FALSE`&&P.VALUE}var _d=e=>typeof e==`number`?0:typeof e==`string`?1:2,vd=(e,t)=>e===t||Number(e.toPrecision(15))===Number(t.toPrecision(15));function yd(e,t){let n=e??(typeof t==`string`?``:typeof t!=`boolean`&&0),r=t??(typeof e==`string`?``:typeof e!=`boolean`&&0),i=_d(n),a=_d(r);if(i!==a)return i<a?-1:1;if(typeof n==`number`&&typeof r==`number`)return vd(n,r)?0:n<r?-1:1;if(typeof n==`string`&&typeof r==`string`){let e=n.toUpperCase(),t=r.toUpperCase();return e===t?0:e<t?-1:1}return n===r?0:n===!1?-1:1}var bd=e=>Number.isFinite(e)?e:P.NUM;function xd(e,t,n){return Math.abs(e)<=Math.max(Math.abs(t),Math.abs(n))*89e-17?0:e}function Sd(e,t,n){let r=H(t);if(r instanceof N)return r;let i=H(n);if(i instanceof N)return i;switch(e){case`+`:return bd(xd(r+i,r,i));case`-`:return bd(xd(r-i,r,i));case`*`:return bd(r*i);case`/`:return i===0?P.DIV0:bd(r/i);default:return r===0&&i===0?P.NUM:r===0&&i<0?P.DIV0:bd(r**i)}}function Cd(e,t,n){if(t instanceof N)return t;if(n instanceof N)return n;switch(e){case`&`:{let e=hd(t);if(e instanceof N)return e;let r=hd(n);return r instanceof N?r:`${e}${r}`}case`=`:return yd(t,n)===0;case`<>`:return yd(t,n)!==0;case`<`:return yd(t,n)<0;case`<=`:return yd(t,n)<=0;case`>`:return yd(t,n)>0;case`>=`:return yd(t,n)>=0;default:return Sd(e,t,n)}}function wd(e,t,n){let r=Math.max(e.rows,t.rows),i=Math.max(e.cols,t.cols),a=Array(r*i),o=(e,t,n)=>{let r=e.rows===1?0:t,i=e.cols===1?0:n;return r<e.rows&&i<e.cols?e.at(r,i):void 0};for(let s=0;s<r;s++)for(let r=0;r<i;r++){let c=o(e,s,r),l=o(t,s,r);a[s*i+r]=c===void 0||l===void 0?P.NA:n(c,l)}return new F(r,i,a)}var Td=.1,Ed={3:[0,33,67],4:[0,25,50,75],5:[0,20,40,60,80]},Dd=e=>{if(e!==null&&e!==``&&!(e instanceof N))return typeof e==`string`?`s${e.toLowerCase()}`:`${typeof e}${String(e)}`},Od=e=>Math.round(e).toString(16).padStart(2,`0`);function kd(e,t,n){let r=(e,t)=>Number.parseInt(e.slice(t,t+2),16),i=i=>Od(r(e,i)+(r(t,i)-r(e,i))*n);return`#${i(1)}${i(3)}${i(5)}`.toUpperCase()}function Ad(e,t){let n=e=>typeof e==`number`||e===null?0:typeof e==`string`?1:typeof e==`boolean`?2:3,r=n(e),i=n(t);if(r!==i)return r-i;if(r===0)return(e??0)-(t??0);if(r===1){let n=e.toLowerCase(),r=t.toLowerCase();return n<r?-1:+(n>r)}return e===t?0:e===!0?1:-1}function jd(e,t,n,r){if(t instanceof N)return!1;let i=()=>Ad(t,n);switch(e){case`equal`:return i()===0;case`notEqual`:return i()!==0;case`greaterThan`:return i()>0;case`lessThan`:return i()<0;case`greaterThanOrEqual`:return i()>=0;case`lessThanOrEqual`:return i()<=0;default:{let n=i()>=0&&Ad(t,r)<=0;return e===`notBetween`?!n:n}}}var Md=e=>e===null||e instanceof N?``:typeof e==`boolean`?e?`TRUE`:`FALSE`:String(e);function Nd(e,t,n){if(t instanceof N)return!1;let r=Md(t).toLowerCase(),i=n.toLowerCase();switch(e){case`notContains`:return!r.includes(i);case`beginsWith`:return r.startsWith(i);case`endsWith`:return r.endsWith(i);default:return r.includes(i)}}function Pd(e){if(e.type===`dataBar`||e.type===`colorScale`||e.type===`iconSet`)return;let t={};return e.bold!==void 0&&(t.bold=e.bold),e.italic!==void 0&&(t.italic=e.italic),e.underline!==void 0&&(t.underline=e.underline),e.strike!==void 0&&(t.strike=e.strike),e.color!==void 0&&(t.color=e.color),e.fill!==void 0&&(t.fill=e.fill),e.border!==void 0&&(t.border=e.border),t}function Fd(e,t){let n=(e.length-1)*t,r=Math.floor(n),i=Math.ceil(n),a=e[r]??0;return a+((e[i]??a)-a)*(n-r)}var Id=class{sheet;calc;measured=new Map;constructor(e,t){this.sheet=e,this.calc=t}measure(e){let t=this.measured.get(e);if(t)return t;let n=[],r=new Map;for(let t of e.areas)this.eachIn(t,e=>{typeof e==`number`&&n.push(e);let t=Dd(e);t!==void 0&&r.set(t,(r.get(t)??0)+1)});let i={numbers:n,sorted:[...n].sort((e,t)=>e-t),counts:r};return this.measured.set(e,i),i}eachIn(e,t){let{sheet:n,calc:r}=this,i=Math.min(e.right,n.columnsUsed-1);for(let a=e.left;a<=i;a++){let[i,o]=n.span(a,e.top,e.bottom);for(let e=i;e<=o;e++){let i=r.value(n,e,a);i!==null&&t(i)}}}boundAt(e,t,n,r){if(t===void 0)return null;if(typeof t==`number`)return t;if(!t.startsWith(`=`)){let e=Pn(t);return e.formula===void 0?e.value:t}let i=e.formulas.find(e=>e.text===t);if(!i)return null;let a=this.calc.evaluateAt(i,this.sheet,n,r);return a instanceof F?a.at(0,0):a}stopAt(e,t,n,r,i){let{sorted:a}=this.measure(e),o=a[0]??0,s=a[a.length-1]??0,c=this.boundAt(e,t.value,n,r),l=typeof c==`number`?c:void 0;switch(t.at){case`min`:return o;case`max`:return s;case`percent`:return o+(s-o)*(l??i)/100;case`percentile`:return Fd(a,(l??i)/100);default:return l??i}}whether(e,t,n,r){let{spec:i}=e;switch(i.type){case`cellIs`:return jd(i.operator,t,this.boundAt(e,i.formula[0],n,r),this.boundAt(e,i.formula[1],n,r));case`containsText`:return Nd(i.operator,t,i.text);case`duplicateValues`:case`uniqueValues`:{let n=Dd(t);if(n===void 0)return!1;let r=this.measure(e).counts.get(n)??0;return i.type===`duplicateValues`?r>1:r===1}case`top10`:{if(typeof t!=`number`)return!1;let{sorted:n}=this.measure(e),r=i.percent===!0?Math.max(1,Math.floor(n.length*i.rank/100)):i.rank,a=i.bottom===!0?n[Math.min(r,n.length)-1]:n[Math.max(n.length-r,0)];return a===void 0?!1:i.bottom===!0?t<=a:t>=a}case`aboveAverage`:{if(typeof t!=`number`)return!1;let{numbers:n}=this.measure(e);if(n.length===0)return!1;let r=n.reduce((e,t)=>e+t,0)/n.length;return i.equal===!0&&t===r?!0:i.below===!0?t<r:t>r}case`expression`:{let[t]=e.formulas;if(!t)return!1;let i=this.calc.evaluateAt(t,this.sheet,n,r);return gd(i instanceof F?i.at(0,0):i)===!0}default:return!1}}scale(e,t,n,r,i){let a=t.stops.map((n,a)=>({at:this.stopAt(e,n,r,i,a*100/(t.stops.length-1)),color:n.color})),[o]=a,s=a[a.length-1];if(o&&s){if(n<=o.at)return o.color;if(n>=s.at)return s.color;for(let e=1;e<a.length;e++){let t=a[e-1],r=a[e];if(t&&r&&n<=r.at)return kd(t.color,r.color,r.at===t.at?1:(n-t.at)/(r.at-t.at))}return s.color}}bar(e,t,n,r,i){let a=this.stopAt(e,t.min??{at:`min`},r,i,0),o=this.stopAt(e,t.max??{at:`max`},r,i,100);return o<=a?Td:Td+.8*Math.min(1,Math.max(0,(n-a)/(o-a)))}icon(e,t,n,r,i){let a=Number.parseInt(t.icons,10),o=t.stops??(Ed[a]??[]).map(e=>({at:`percent`,value:e})),s=0;return o.forEach((t,a)=>{n>=this.stopAt(e,t,r,i,0)&&(s=a)}),t.reverse===!0?a-1-s:s}at(e,t){let{sheet:n,calc:r}=this;if(n.conditions.length===0)return;let i=r.value(n,e,t),a;for(let r of n.conditions){if(!r.areas.some(n=>rn(n,e,t)))continue;let{spec:n}=r;if(n.type===`dataBar`||n.type===`colorScale`||n.type===`iconSet`){if(typeof i!=`number`)continue;if(a??={},n.type===`dataBar`)a.bar??={share:this.bar(r,n,i,e,t),color:n.color},n.show===!1&&(a.bare=!0);else if(n.type===`colorScale`){let o=this.scale(r,n,i,e,t);o!==void 0&&(a.scale??=o)}else a.icon??={set:n.icons,index:this.icon(r,n,i,e,t)},n.show===!1&&(a.bare=!0);if(n.stop===!0)break}else if(this.whether(r,i,e,t)&&(a??={},a.look={...Pd(n),...a.look},n.stop===!0))break}return a}},Ld=`#00A651`,Rd=`#FFC000`,zd=`#E03C32`,Bd=`#7F7F7F`,Vd=`#000000`,Hd=`#2F75B5`,Ud=e=>e===3?[zd,Rd,Ld]:e===4?[Vd,zd,Rd,Ld]:[zd,`#ED7D31`,Rd,`#92D050`,Ld];function Wd(e,t){let n=Number.parseInt(e,10),r=Ud(n)[t]??Bd,i=e.slice(1);return i.startsWith(`Arrows`)?{shape:(n===3?[`down`,`right`,`up`]:n===4?[`down`,`down-right`,`up-right`,`up`]:[`down`,`down-right`,`right`,`up-right`,`up`])[t]??`right`,color:i===`ArrowsGray`?Bd:r}:i===`Flags`?{shape:`flag`,color:r}:i===`Signs`?{shape:t===0?`diamond`:t===1?`triangle`:`circle`,color:r}:i.startsWith(`Symbols`)?{shape:t===0?`cross`:t===1?`bang`:`check`,color:r}:i===`Rating`?{shape:`bars`,color:Hd,level:t+1}:i===`Quarters`?{shape:`quarter`,color:Bd,level:t}:i===`RedToBlack`?{shape:`circle`,color:[`#000000`,`#7F7F7F`,`#F4B6B6`,`#E03C32`][t]??Bd}:{shape:`circle`,color:r}}var Gd=e=>e.separator??`, `;function Kd(e,t){let n=Gd(t);return e.split(n.trim()===``?n:n.trim()).map(e=>e.trim()).filter(e=>e!==``)}var qd=(e,t)=>e.join(Gd(t));function Jd(e,t,n,r,i){let{spec:a}=n;if(a.values)return a.values;let[o]=a.formula??[],[s]=n.formulas;if(!s)return typeof o==`string`?o.split(`,`):[];let c=e.evaluateAt(s,t,r,i),l=e=>sl(e,void 0);return c instanceof F?c.data.map(l).filter(e=>e!==``):c===null?[]:[l(c)]}function Yd(e,t,n,r,i,a){let o=n.spec.formula?.[r];if(o===void 0)return null;let s=n.formulas[r];if(s){let n=e.evaluateAt(s,t,i,a);return n instanceof F?n.at(0,0):n}if(typeof o==`number`)return o;let c=Pn(o);return c.formula===void 0?c.value:null}function Xd(e,t,n,r,i,a){let[o]=n.formulas;if(!o)return!0;let s=t.at(r,i),c=e.value(t,r,i)!==a&&!(s instanceof Cr);c&&e.change([{sheet:t,row:r,col:i,slot:a??void 0}]);let l=e.evaluateAt(o,t,r,i);return c&&e.change([{sheet:t,row:r,col:i,slot:s}]),gd(l instanceof F?l.at(0,0):l)===!0}function Zd(e,t,n,r,i,a){let{spec:o}=n;if(a===null||a===``)return o.blank!==!1;if(a instanceof N)return!1;let s=o.operator??`between`,c=a=>Yd(e,t,n,a,r,i);switch(o.type){case`list`:{let s=sl(a,void 0),c=Jd(e,t,n,r,i).map(e=>e.trim()),l=e=>o.values?c.includes(e.trim()):c.some(t=>t.toLowerCase()===e.trim().toLowerCase());return o.multiple===!0?Kd(s,o).every(l):l(s)}case`custom`:return Xd(e,t,n,r,i,a);case`textLength`:return jd(s,(typeof a==`string`?a:sl(a)).length,c(0),c(1));case`whole`:return typeof a==`number`&&Number.isInteger(a)&&jd(s,a,c(0),c(1));case`time`:return typeof a==`number`&&a>=0&&a<1&&jd(s,a,c(0),c(1));default:return typeof a==`number`&&jd(s,a,c(0),c(1))}}function Qd(e,t,n){let r=Math.min(t.right,e.columnsUsed-1);for(let i=t.left;i<=r;i++){let[r,a]=e.span(i,t.top,t.bottom);for(let t=r;t<=a;t++)e.at(t,i)!==void 0&&n(t,i)}}function $d(e,t){let n=[];for(let r of e.sheets)for(let e of r.validations)for(let i of e.areas)Qd(r,i,(i,a)=>{let o=t.value(r,i,a);Zd(t,r,e,i,a,o)||n.push({sheet:r.name,row:i,col:a,value:o,range:e.spec.range,type:e.spec.type})});return n}var ef=(e,t,n,r)=>sl(t.value(e,n,r),e.lookAt(n,r).format),tf=(e,t)=>{if(t===``)return e.blanks===!0;let n=t.toLowerCase();return e.values?.some(e=>e.toLowerCase()===n)===!0};function nf(e,t,n,r){let i=e.validations.length===0?void 0:e.validationAt(t,n);return i?.spec.multiple===!0?Kd(r,i.spec):[r]}function rf(e,t,n,r,i){for(let[a,o]of n.columns){if(a===i)continue;let n=ef(e,t,r,a);if(n===``){if(o.blanks!==!0)return!1}else if(!nf(e,r,a,n).some(e=>tf(o,e)))return!1}return!0}function af(e,t){let n=new Set;for(let r of e.filters){if(r.columns.size===0)continue;let{top:i,bottom:a}=r.area,o=Math.min(a,e.lastRow);for(let a=i+1;a<=o;a++)rf(e,t,r,a)||n.add(a)}return n}function of(e,t,n,r){let i=n.columns.get(r),a=new Map,o=0,{top:s,bottom:c}=n.area,l=Math.min(c,e.lastRow);for(let c=s+1;c<=l;c++){if(!rf(e,t,n,c,r))continue;let s=ef(e,t,c,r);if(s===``){o+=1;continue}let l=nf(e,c,r,s);for(let n of l){let o=n.toLowerCase(),s=a.get(o);s?s.count+=1:a.set(o,{text:n,count:1,on:i===void 0||tf(i,n),value:l.length>1?n:t.value(e,c,r)})}}return{values:[...a.values()].sort((e,t)=>od(e.value,t.value)),blanks:o===0?void 0:{count:o,on:i===void 0||i.blanks===!0}}}function sf(e,t){let n=(t,n)=>t>=0&&n>=0&&(e.at(t,n)!==void 0||e.spillAt(t,n)!==void 0),r={top:t.row,left:t.col,bottom:t.row,right:t.col};for(let e=!0;e;){e=!1;let t=e=>{for(let t=r.left-1;t<=r.right+1;t++)if(n(e,t))return!0;return!1},i=e=>{for(let t=r.top-1;t<=r.bottom+1;t++)if(n(t,e))return!0;return!1};t(r.top-1)&&(--r.top,e=!0),t(r.bottom+1)&&(r.bottom+=1,e=!0),i(r.left-1)&&(--r.left,e=!0),i(r.right+1)&&(r.right+=1,e=!0)}return r.top===r.bottom&&r.left===r.right&&!n(r.top,r.left)?void 0:r}var cf=new Map;function U(e,t,n,r,i={}){cf.set(e,{name:e,min:t,max:n,kind:`scalar`,call:r,from:i.from??`allyhub`,...i.errors===!0?{errors:!0}:{},...i.volatile===!0?{volatile:!0}:{}})}function W(e,t,n,r,i={}){cf.set(e,{name:e,min:t,max:n,kind:`raw`,call:r,from:i.from??`allyhub`,...i.volatile===!0?{volatile:!0}:{}})}function lf(e,t,n,r){cf.set(e,{name:e,min:t,max:n,kind:`lazy`,call:r,from:`allyhub`})}function uf(e,t){let n=cf.get(t);n&&cf.set(e,{...n,name:e})}function df(e,t){if(e instanceof N)return e;if(e instanceof rl)return P.VALUE;if(e instanceof B){let n=Math.min(e.bottom,e.sheet.lastRow);return{rows:Math.max(0,n-e.top+1),cols:e.cols,at:(n,r)=>t.calc.read(e.sheet,e.top+n,e.left+r),reference:e}}if(e instanceof F)return{rows:e.rows,cols:e.cols,at:(t,n)=>e.at(t,n)};if(e instanceof il)return P.VALUE;let n=e instanceof al?null:e;return{rows:1,cols:1,at:()=>n}}function ff(e,t,n){for(let r of e)if(r instanceof B)t.calc.each(r,e=>{n(e,!1)});else if(r instanceof rl)for(let e of r.parts)t.calc.each(e,e=>{n(e,!1)});else if(r instanceof F)for(let e of r.data)e!==null&&n(e,!1);else r instanceof al?n(null,!0):r instanceof il?n(P.VALUE,!0):n(r,!0)}function pf(e,t,n){let r=e=>{for(let r of t.calc.matrix(e).data)n(r,!1)};for(let t of e)if(t instanceof B)r(t);else if(t instanceof rl)t.parts.forEach(r);else if(t instanceof F)for(let e of t.data)n(e,!1);else t instanceof al?n(null,!0):t instanceof il?n(P.VALUE,!0):n(t,!0)}function mf(e,t){let n=[],r;return ff(e,t,(e,t)=>{if(!r){if(e instanceof N)r=e;else if(typeof e==`number`)n.push(e);else if(t){let t=H(e);t instanceof N?r=t:n.push(t)}}}),r??n}function hf(e,t){let n=[],r;return ff(e,t,(e,t)=>{if(!r){if(e instanceof N)r=e;else if(typeof e==`number`)n.push(e);else if(typeof e==`boolean`)n.push(+!!e);else if(t){let t=H(e);t instanceof N?r=t:n.push(t)}else typeof e==`string`&&n.push(0)}}),r??n}var gf=e=>(...t)=>{let n=[];for(let e of t){let t=H(e);if(t instanceof N)return t;n.push(t)}return e(...n)},_f=(e,t)=>e?t.calc.eval(e,t.frame):!1;function vf(e,t,n){if(!(e instanceof F))return e;let r=e.rows===1?0:t,i=e.cols===1?0:n;return r<e.rows&&i<e.cols?e.at(r,i):P.NA}function yf(e,t,n){let r=[e,...t].filter(e=>e instanceof F),i=Math.max(...r.map(e=>e.rows)),a=Math.max(...r.map(e=>e.cols)),o=Array(i*a);for(let r=0;r<i;r++)for(let i=0;i<a;i++){let s=n(vf(e,r,i));o[r*a+i]=s instanceof N?s:vf(t[s]??P.VALUE,r,i)}return new F(i,a,o)}lf(`IF`,1,3,(e,t)=>{let n=t.calc.flat(_f(e[0],t)),r=n=>{let r=e[n];if(r===void 0)return n===1;let i=t.calc.eval(r,t.frame);return i instanceof al?0:i};if(n instanceof F){let i=n=>n<e.length&&t.calc.flat(r(n));return yf(n,[i(1),i(2)],e=>{let t=gd(e);return t instanceof N?t:+!t})}let i=gd(n);return i instanceof N?i:r(i?1:2)}),lf(`IFS`,2,255,(e,t)=>{for(let n=0;n+1<e.length;n+=2){let r=gd(t.calc.scalar(_f(e[n],t),t.frame));if(r instanceof N)return r;if(r)return _f(e[n+1],t)}return P.NA});var bf=e=>(t,n)=>{let r=n.calc.flat(_f(t[0],n)),i=t=>t instanceof N&&(e===void 0||t===e),a=()=>t[1]?n.calc.flat(n.calc.eval(t[1],n.frame)):``;return r instanceof F?yf(r,[r,a()],e=>+!!i(e)):i(r)?a():r};lf(`IFERROR`,2,2,bf()),lf(`IFNA`,2,2,bf(P.NA)),lf(`CHOOSE`,2,255,(e,t)=>{let n=t.calc.flat(_f(e[0],t));if(n instanceof F){let r=e.slice(1).map(e=>t.calc.flat(t.calc.eval(e,t.frame)));return yf(n,r,e=>{let t=H(e);if(t instanceof N)return t;let n=Math.trunc(t)-1;return n<0||n>=r.length?P.VALUE:n})}let r=H(n);if(r instanceof N)return r;let i=Math.trunc(r),a=e[i];return i<1||a===void 0?P.VALUE:t.calc.eval(a,t.frame)}),lf(`SWITCH`,3,255,(e,t)=>{let n=t.calc.scalar(_f(e[0],t),t.frame);if(n instanceof N)return n;let r=1;for(;r+1<e.length;r+=2){let i=t.calc.scalar(_f(e[r],t),t.frame);if(i instanceof N)return i;if(yd(n,i)===0)return _f(e[r+1],t)}return r<e.length?_f(e[r],t):P.NA});function xf(e,t){let n=[],r;return ff(e,t,(e,t)=>{if(r)return;if(e instanceof N){r=e;return}if(typeof e==`string`&&!t||e===null)return;let i=gd(e);i instanceof N?r=i:n.push(i)}),r||(n.length===0?P.VALUE:n)}W(`AND`,1,255,(e,t)=>{let n=xf(e,t);return n instanceof N?n:n.every(Boolean)}),W(`OR`,1,255,(e,t)=>{let n=xf(e,t);return n instanceof N?n:n.some(Boolean)}),W(`XOR`,1,255,(e,t)=>{let n=xf(e,t);return n instanceof N?n:n.filter(Boolean).length%2==1}),U(`NOT`,1,1,e=>{let t=gd(e);return t instanceof N?t:!t}),W(`TRUE`,0,0,()=>!0),W(`FALSE`,0,0,()=>!1);var Sf=(e,t)=>t?{names:e,parent:t}:{names:e};lf(`LET`,3,255,(e,t)=>{if(e.length%2==0)return P.VALUE;let n=new Map,r={...t.frame,scope:Sf(n,t.frame.scope)};for(let i=0;i+1<e.length;i+=2){let a=e[i];if(a?.kind!==`name`)return P.VALUE;n.set(a.name.toLowerCase(),_f(e[i+1],{...t,frame:r}))}return _f(e[e.length-1],{...t,frame:r})}),lf(`LAMBDA`,1,254,(e,t)=>{let n=[];for(let t of e.slice(0,-1)){if(t.kind!==`name`)return P.VALUE;n.push(t.name.toLowerCase())}let r=e[e.length-1];return r?new il(n,r,t.frame):P.VALUE});function Cf(e){let t=0;for(let n of e)t=xd(t+n,t,n);return t}W(`SUM`,1,255,(e,t)=>{let n=0,r;return ff(e,t,(e,i)=>{if(!r){if(typeof e==`number`)n=xd(n+e,n,e);else if(e instanceof N)r=e;else if(i){let i=mf([e],t);i instanceof N?r=i:n+=i[0]??0}}}),r??bd(n)}),W(`AVERAGE`,1,255,(e,t)=>{let n=mf(e,t);return n instanceof N?n:n.length===0?P.DIV0:Cf(n)/n.length}),W(`AVERAGEA`,1,255,(e,t)=>{let n=hf(e,t);return n instanceof N?n:n.length===0?P.DIV0:Cf(n)/n.length}),W(`COUNT`,1,255,(e,t)=>{let n=0;return ff(e,t,(e,r)=>{typeof e==`number`?n+=1:r&&!(e instanceof N)&&e!==null&&(mf([e],t)instanceof N||(n+=1))}),n}),W(`COUNTA`,1,255,(e,t)=>{let n=0;return ff(e,t,()=>{n+=1}),n}),W(`COUNTBLANK`,1,1,(e,t)=>{let n=e[0];if(n instanceof N)return n;if(n instanceof B){let e=0;return t.calc.each(n,t=>{t!==``&&(e+=1)}),n.rows*n.cols-e}let r=t.calc.flat(n);return r instanceof F?r.data.filter(e=>e===null||e===``).length:+(r===null||r===``)});var wf=e=>t=>{if(t instanceof N)return t;if(t.length===0)return 0;let n=t[0]??0;for(let r of t)n=e(n,r);return n},Tf=wf((e,t)=>t<e?t:e),Ef=wf((e,t)=>t>e?t:e);W(`MIN`,1,255,(e,t)=>Tf(mf(e,t))),W(`MAX`,1,255,(e,t)=>Ef(mf(e,t))),W(`MINA`,1,255,(e,t)=>Tf(hf(e,t))),W(`MAXA`,1,255,(e,t)=>Ef(hf(e,t))),W(`PRODUCT`,1,255,(e,t)=>{let n=mf(e,t);return n instanceof N?n:n.length===0?0:bd(n.reduce((e,t)=>e*t,1))}),W(`SUMSQ`,1,255,(e,t)=>{let n=mf(e,t);return n instanceof N?n:bd(Cf(n.map(e=>e*e)))}),W(`SUMPRODUCT`,1,255,(e,t)=>{let n=e.map(e=>df(e,t)),r=n[0];if(r===void 0||r instanceof N)return r??P.VALUE;let{rows:i}=r,{cols:a}=r,o=e=>e.reference&&e.reference.bottom<1048575?e.reference.rows:e.rows;for(let e of n){if(e instanceof N)return e;if(e.cols!==a||o(e)!==o(r))return P.VALUE;i=Math.min(i,e.rows)}let s=0;for(let e=0;e<i;e++)for(let t=0;t<a;t++){let r=1;for(let i of n){let n=i.at(e,t);if(n instanceof N)return n;r*=typeof n==`number`?n:0}s+=r}return bd(s)});var Df={1:`AVERAGE`,2:`COUNT`,3:`COUNTA`,4:`MAX`,5:`MIN`,6:`PRODUCT`,7:`STDEV.S`,8:`STDEV.P`,9:`SUM`,10:`VAR.S`,11:`VAR.P`};function Of(e){if(!(e instanceof Cr))return!1;let{node:t}=e.shared;return t?.kind===`call`&&t.name===`SUBTOTAL`}W(`SUBTOTAL`,2,255,(e,t)=>{let n=t.calc.scalar(e[0],t.frame);if(n instanceof N)return n;if(typeof n!=`number`)return P.VALUE;let r=n<100,i=Df[r?n:n-100],a=i===void 0?void 0:cf.get(i);if(a?.kind!==`raw`)return P.VALUE;let o=[],s=e=>{let n=t=>e.sheet.spec.rows?.[String(t+1)]?.hidden===!0,i=Math.min(e.bottom,e.sheet.lastRow),a=[],s=t.calc.filtered(e.sheet);for(let o=e.top;o<=i;o++)if(!s.has(o)&&(r||!n(o)))for(let n=e.left;n<=e.right;n++)a.push(Of(e.sheet.at(o,n))?null:t.calc.read(e.sheet,o,n));o.push(new F(a.length,1,a))};for(let t of e.slice(1)){if(t instanceof N)return t;if(t instanceof B)s(t);else if(t instanceof rl)t.parts.forEach(s);else return P.VALUE}return a.call(o,t)});function kf(e){if(typeof e==`number`)return`n${String(Number(e.toPrecision(15)))}`;if(typeof e==`string`)return`t${e.toUpperCase()}`;if(typeof e==`boolean`)return e?`bT`:`bF`}function Af(e){let t=``;for(let n=0;n<e.length;n++){let r=e.charAt(n);r===`~`&&/[*?~]/u.test(e.charAt(n+1))?(n+=1,t+=e.charAt(n).replace(/[*?]/u,`\\$&`)):t+=r===`*`?`[\\s\\S]*`:r===`?`?`[\\s\\S]`:r.replace(/[.+^${}()|[\]\\/-]/gu,`\\$&`)}let n=RegExp(`^${t}$`,`iu`);return e=>n.test(e)}var jf=e=>/[*?~]/u.test(e);function Mf(e){return t=>{if(typeof t==`number`)return vd(t,e);if(typeof t!=`string`)return!1;let n=md(t);return n!==void 0&&vd(n,e)}}function Nf(e,t){let n=t=>e===`>`?t>0:e===`>=`?t>=0:e===`<`?t<0:t<=0;return e=>typeof e==typeof t&&n(yd(e,t))}function Pf(e){if(e===null)return{test:Mf(0),key:`n0`};if(typeof e==`number`)return{test:Mf(e),key:`n${String(Number(e.toPrecision(15)))}`};if(typeof e==`boolean`)return{test:t=>t===e,key:e?`bT`:`bF`};if(e instanceof N)return{test:t=>t===e};let t=/^(<>|>=|<=|=|>|<)/u.exec(e),n=t?.[1]??`=`,r=t?e.slice(n.length):e,i=e=>e===null;if(r===``)return n===`=`?{test:t?i:e=>e===null||e===``}:n===`<>`?{test:e=>e!==null}:{test:()=>!1};let a=md(r),o=/^(?:TRUE|FALSE)$/iu.test(r)?r.toUpperCase()===`TRUE`:void 0,s=a??o;if(n===`=`||n===`<>`){let e,t;if(a!==void 0)e=Mf(a),t=kf(a);else if(o!==void 0)e=e=>e===o,t=kf(o);else if(r.startsWith(`#`))e=e=>e instanceof N&&e.code===r.toUpperCase();else if(jf(r)){let t=Af(r);e=e=>typeof e==`string`&&t(e)}else{let n=r.toUpperCase();e=e=>typeof e==`string`&&e.toUpperCase()===n,t=kf(r)}return n===`=`?t===void 0?{test:e}:{test:e,key:t}:{test:t=>!e(t)}}return{test:Nf(n,s??r)}}function Ff(e,t){let n=e.reference;if(n?.cols!==1||e.rows<64)return;let r=`crit:${n.key}`,i=t.calc.indexes.get(r);if(i)return i;let a=new Map;for(let t=0;t<e.rows;t++){let n=e.at(t,0),r=e=>{if(e===void 0)return;let n=a.get(e);n?n.push(t):a.set(e,[t])};if(r(kf(n)),typeof n==`string`){let e=md(n);e!==void 0&&r(kf(e))}}return t.calc.indexes.set(r,a),a}function If(e,t){return Pf(t.calc.scalar(e,t.frame))}function Lf(e,t){let n=[];for(let r=0;r+1<e.length;r+=2){let i=df(e[r],t);if(i instanceof N)return i;let a=If(e[r+1],t);if(a instanceof N)return a;n.push({cells:i,crit:a})}let r=n[0]?.cells;return r&&n.some(e=>!Rf(e.cells,r))?P.VALUE:n}var Rf=(e,t)=>e.cols===t.cols&&(e.reference?.rows??e.rows)===(t.reference?.rows??t.rows);function zf(e,t,n){let r=e[0];if(!r)return;let i=e.slice(1),a=(e,t)=>i.every(n=>n.crit.test(n.cells.at(e,t))),o=r.crit.key===void 0?void 0:Ff(r.cells,t);if(o&&r.crit.key!==void 0){for(let e of o.get(r.crit.key)??[])a(e,0)&&n(e,0);return}let s=Math.max(...e.map(e=>e.cells.rows));for(let e=0;e<s;e++)for(let t=0;t<r.cells.cols;t++)r.crit.test(r.cells.at(e,t))&&a(e,t)&&n(e,t)}function Bf(e,t){return e instanceof B?(e.rows-t.rows)*e.cols:0}function Vf(e,t,n,r){let i;return zf(t,n,(t,n)=>{if(i)return;let a=e.at(t,n);a instanceof N?i=a:typeof a==`number`&&r(a)}),i}function Hf(e,t){let n=df(e[0],t);if(n instanceof N)return n;let r=e[2];return r===void 0?n:df(r,t)}var Uf=e=>(t,n)=>{let r=df(t[0],n);if(r instanceof N)return r;let i=If(t[1],n);if(i instanceof N)return i;let a=Hf(t,n);if(a instanceof N)return a;let o=[];return Vf(a,[{cells:r,crit:i}],n,e=>{o.push(e)})??e(o)},Wf=e=>(t,n)=>{if(t.length%2==0)return P.VALUE;let r=df(t[0],n);if(r instanceof N)return r;let i=Lf(t.slice(1),n);if(i instanceof N)return i;let a=i[0]?.cells;if(a&&!Rf(r,a))return P.VALUE;let o=[];return Vf(r,i,n,e=>{o.push(e)})??e(o)},Gf=(e,t)=>(n,r)=>{let i=new Map;for(let[t,a]of n.entries()){if(!e(t)||!(a instanceof F||a instanceof B&&!a.single))continue;let n=df(a,r);if(n instanceof N)return n;i.set(t,n)}if(i.size===0)return t(n,r);let a=[...i.values()],o=Math.max(...a.map(e=>e.rows)),s=Math.max(...a.map(e=>e.cols)),c=[];for(let e=0;e<o;e++)for(let a=0;a<s;a++){let o=t(n.map((t,n)=>{let r=i.get(n);if(!r)return t;let o=r.rows===1?0:e,s=r.cols===1?0:a;return o<r.rows&&s<r.cols?r.at(o,s):P.NA}),r);c.push(o instanceof F?o.at(0,0):o)}return new F(o,s,c)},Kf=e=>e===1,qf=e=>e>=2&&e%2==0,Jf=e=>e%2==1,Yf=e=>e.reduce((e,t)=>e+t,0),Xf=e=>e.length===0?P.DIV0:Yf(e)/e.length;W(`SUMIF`,2,3,Gf(Kf,Uf(Yf))),W(`AVERAGEIF`,2,3,Gf(Kf,Uf(Xf))),W(`SUMIFS`,3,255,Gf(qf,Wf(Yf))),W(`AVERAGEIFS`,3,255,Gf(qf,Wf(Xf))),W(`MINIFS`,3,255,Gf(qf,Wf(e=>e.length===0?0:e.reduce((e,t)=>t<e?t:e)))),W(`MAXIFS`,3,255,Gf(qf,Wf(e=>e.length===0?0:e.reduce((e,t)=>t>e?t:e)))),W(`COUNTIF`,2,2,Gf(Kf,(e,t)=>{let n=df(e[0],t);if(n instanceof N)return n;let r=If(e[1],t);if(r instanceof N)return r;let i=0;return zf([{cells:n,crit:r}],t,()=>{i+=1}),i+(r.test(null)?Bf(e[0],n):0)})),W(`COUNTIFS`,2,255,Gf(Jf,(e,t)=>{if(e.length%2==1)return P.VALUE;let n=Lf(e,t);if(n instanceof N)return n;let r=0;return zf(n,t,()=>{r+=1}),r}));var Zf=(e,t)=>typeof e==typeof t&&!(e instanceof N)&&e!==null;function Qf(e){if(e.rows===1)return{length:e.cols,at:t=>e.at(0,t)};if(e.cols===1)return{length:e.rows,at:t=>e.at(t,0)}}function $f(e,t,n,r,i,a=0,o=1){let s=typeof e==`string`?e:void 0;if(i&&s!==void 0&&jf(s)){let e=Af(s);for(let n=a;n>=0&&n<t.length;n+=o){let r=t.at(n);if(typeof r==`string`&&e(r))return n}return-1}let c=kf(e);if(c===void 0)return-1;let l=n.reference;if(l&&t.length>=64&&a===0&&o===1){let e=`find:${l.key}`,n=r.calc.indexes.get(e);if(!n){n=new Map;for(let e=t.length-1;e>=0;e--){let r=kf(t.at(e));r!==void 0&&n.set(r,[e])}r.calc.indexes.set(e,n)}return n.get(c)?.[0]??-1}for(let e=a;e>=0&&e<t.length;e+=o)if(kf(t.at(e))===c)return e;return-1}function ep(e,t,n=!1){let r=0,i=t.length-1,a=-1;for(;r<=i;){let o=r+i>>1,s=o;for(;s>=r&&!Zf(t.at(s),e);)--s;if(s<r){r=o+1;continue}let c=yd(t.at(s),e);(n?c>=0:c<=0)?(a=s,r=o+1):i=s-1}return a}var tp=(e,t)=>t.calc.scalar(e??null,t.frame),np=(e,t,n)=>e===void 0||e instanceof al?n:gd(t.calc.scalar(e,t.frame));function rp(e){return(t,n)=>{let r=tp(t[0],n);if(r instanceof N)return r;let i=df(t[1],n);if(i instanceof N)return i;let a=H(n.calc.scalar(t[2],n.frame));if(a instanceof N)return a;let o=Math.trunc(a);if(o<1)return P.VALUE;if(o>(e?i.cols:i.rows))return P.REF;let s=np(t[3],n,!0);if(s instanceof N)return s;let c={length:e?i.rows:i.cols,at:t=>e?i.at(t,0):i.at(0,t)},l={rows:e?i.rows:1,cols:e?1:i.cols,at:(e,t)=>i.at(e,t),...i.reference?{reference:new B(i.reference.sheet,i.reference.top,i.reference.left,e?i.reference.bottom:i.reference.top,e?i.reference.left:i.reference.right)}:{}},u=s?ep(r,c):$f(r,c,l,n,!0);return u<0?P.NA:e?i.at(u,o-1):i.at(o-1,u)}}W(`VLOOKUP`,3,4,rp(!0)),W(`HLOOKUP`,3,4,rp(!1)),W(`MATCH`,2,3,(e,t)=>{let n=tp(e[0],t);if(n instanceof N)return n;let r=df(e[1],t);if(r instanceof N)return r;let i=Qf(r);if(!i)return P.NA;let a=e[2]===void 0||e[2]instanceof al?1:H(t.calc.scalar(e[2],t.frame));if(a instanceof N)return a;let o=a===0?$f(n,i,r,t,!0):ep(n,i,a<0);return o<0?P.NA:o+1}),W(`LOOKUP`,2,3,(e,t)=>{let n=tp(e[0],t);if(n instanceof N)return n;let r=df(e[1],t);if(r instanceof N)return r;let i=r.rows>=r.cols,a=ep(n,{length:i?r.rows:r.cols,at:e=>i?r.at(e,0):r.at(0,e)});if(a<0)return P.NA;if(e[2]===void 0)return i?r.at(a,r.cols-1):r.at(r.rows-1,a);let o=df(e[2],t);if(o instanceof N)return o;let s=Qf(o);return s?s.at(a):P.NA});function ip(e,t,n,r,i){let a=Qf(t);if(!a)return-1;let o=i===-1;if(Math.abs(i)===2){let t=ep(e,a,i<0);if(t>=0&&yd(a.at(t),e)===0)return t;if(r===0)return-1}let s=$f(e,a,t,n,r===2,o?a.length-1:0,o?-1:1);if(s>=0||r===0||r===2)return s;let c=-1;for(let t=0;t<a.length;t++){let n=a.at(t);if(!Zf(n,e))continue;let i=yd(n,e),o=c<0||(r<0?yd(n,a.at(c))>0:yd(n,a.at(c))<0);(r<0?i<0:i>0)&&o&&(c=t)}return c}var ap=(e,t,n)=>{let r=(e,t)=>e===void 0||e instanceof al?t:H(n.calc.scalar(e,n.frame)),i=r(e,0);if(i instanceof N)return i;let a=r(t,1);return a instanceof N?a:[i,a]};W(`XLOOKUP`,3,6,(e,t)=>{let n=tp(e[0],t);if(n instanceof N)return n;let r=df(e[1],t);if(r instanceof N)return r;let i=df(e[2],t);if(i instanceof N)return i;let a=ap(e[4],e[5],t);if(a instanceof N)return a;let o=ip(n,r,t,a[0],a[1]);if(o<0){let n=e[3];return n===void 0||n instanceof al?P.NA:t.calc.flat(n)}if(r.cols===1){if(i.cols===1)return i.at(o,0);let e=[];for(let t=0;t<i.cols;t++)e.push(i.at(o,t));return new F(1,i.cols,e)}if(i.rows===1)return i.at(0,o);let s=[];for(let e=0;e<i.rows;e++)s.push(i.at(e,o));return new F(i.rows,1,s)}),W(`XMATCH`,2,4,(e,t)=>{let n=tp(e[0],t);if(n instanceof N)return n;let r=df(e[1],t);if(r instanceof N)return r;let i=ap(e[2],e[3],t);if(i instanceof N)return i;let a=ip(n,r,t,i[0],i[1]);return a<0?P.NA:a+1}),W(`INDEX`,2,4,(e,t)=>{let n=e[0],r=e=>{if(e===void 0||e instanceof al)return 0;let n=H(t.calc.scalar(e,t.frame));return n instanceof N?n:Math.trunc(n)};if(n instanceof rl){let t=r(e[3]??1);if(t instanceof N)return t;let i=n.parts[t-1];if(!i)return P.REF;n=i}if(n instanceof N)return n;let i=r(e[1]);if(i instanceof N)return i;let a=r(e[2]);if(a instanceof N)return a;if(i<0||a<0)return P.VALUE;if(n instanceof B){let t=e[2]===void 0&&n.rows===1,r=t?1:i,o=t?i:a;return r>n.rows||o>n.cols?P.REF:new B(n.sheet,r===0?n.top:n.top+r-1,o===0?n.left:n.left+o-1,r===0?n.bottom:n.top+r-1,o===0?n.right:n.left+o-1)}let o=df(n,t);if(o instanceof N)return o;let s=e[2]===void 0&&o.rows===1,c=s?1:i,l=s?i:a===0&&o.cols===1?1:a;if(c>o.rows||l>o.cols)return P.REF;if(c>0&&l>0)return o.at(c-1,l-1);let u=c===0?o.rows:1,d=l===0?o.cols:1,f=[];for(let e=0;e<u;e++)for(let t=0;t<d;t++)f.push(o.at(c===0?e:c-1,l===0?t:l-1));return new F(u,d,f)}),W(`OFFSET`,3,5,(e,t)=>{let n=e[0];if(n instanceof N)return n;if(!(n instanceof B))return P.VALUE;let r=(e,n)=>{if(e===void 0||e instanceof al)return n;let r=H(t.calc.scalar(e,t.frame));return r instanceof N?r:Math.trunc(r)},i=r(e[1],0),a=r(e[2],0),o=r(e[3],n.rows),s=r(e[4],n.cols);for(let e of[i,a,o,s])if(e instanceof N)return e;let[c,l,u,d]=[i,a,o,s];if(u===0||d===0)return P.REF;let f=n.top+(c??0),p=n.left+(l??0),m=f+(u??1)-1,h=p+(d??1)-1;return Math.min(f,m)<0||Math.min(p,h)<0||Math.max(f,m)>=1048576||Math.max(p,h)>=16384?P.REF:new B(n.sheet,Math.min(f,m),Math.min(p,h),Math.max(f,m),Math.max(p,h))},{volatile:!0});var op=/^(?:(.*)!)?R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?(?::R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?)?$/iu,sp=(e,t)=>e===void 0?t:e.startsWith(`[`)?t+Number(e.slice(1,-1)):Number(e)-1;function cp(e,t,n){let r=op.exec(e.trim());if(!r)return;let[,i,a,o,s,c]=r,l={row:sp(a,t),col:sp(o,n)};if(l.row<0||l.col<0)return;let u=Qt(l),d=i===void 0?``:`${i}!`;if(s===void 0&&c===void 0)return`${d}${u}`;let f={row:sp(s,t),col:sp(c,n)};return f.row<0||f.col<0?void 0:`${d}${u}:${Qt(f)}`}W(`INDIRECT`,1,2,(e,t)=>{let n=hd(t.calc.scalar(e[0],t.frame));if(n instanceof N)return n;let r=e[1]===void 0||gd(t.calc.scalar(e[1],t.frame));if(r instanceof N)return r;let i=r?n:cp(n,t.frame.row,t.frame.col);if(i===void 0)return P.REF;let a=fr(i);if(!a.ok)return P.REF;let{node:o}=a;if(o.kind!==`ref`&&o.kind!==`structured`&&o.kind!==`name`&&(o.kind!==`binary`||o.op!==`:`))return P.REF;let s=t.calc.eval(o,{...t.frame,dr:0,dc:0});return s instanceof B||s instanceof rl?s:P.REF},{volatile:!0});var lp=(e,t,n)=>{if(e===void 0||e instanceof al)return t+1;if(e instanceof N)return e;if(!(e instanceof B))return P.VALUE;let[r,i]=n(e);if(i<=1)return r+1;let a=Array.from({length:i},(e,t)=>r+t+1);return n===up?new F(i,1,a):new F(1,i,a)},up=e=>[e.top,Math.min(e.rows,e.sheet.lastRow-e.top+1)],dp=e=>[e.left,e.cols];W(`ROW`,0,1,(e,t)=>lp(e[0],t.frame.row,up)),W(`COLUMN`,0,1,(e,t)=>lp(e[0],t.frame.col,dp)),W(`ROWS`,1,1,(e,t)=>{let n=e[0];if(n instanceof B)return n.rows;let r=df(n,t);return r instanceof N?r:r.rows}),W(`COLUMNS`,1,1,(e,t)=>{let n=e[0];if(n instanceof B)return n.cols;let r=df(n,t);return r instanceof N?r:r.cols}),W(`AREAS`,1,1,e=>{let t=e[0];return t instanceof B?1:t instanceof rl?t.parts.length:P.VALUE}),U(`ADDRESS`,2,5,(e,t,n,r,i)=>{let a=H(e),o=H(t),s=n==null?1:H(n);for(let e of[a,o,s])if(e instanceof N)return e;let[c,l,u]=[a,o,s];if((c??0)<1||(l??0)<1||(c??0)>1048576||(l??0)>16384)return P.VALUE;let d=r==null||gd(r);if(d instanceof N)return d;let f=u===1||u===2,p=u===1||u===3,m=d?`${p?`$`:``}${Xt((l??1)-1)}${f?`$`:``}${String(c)}`:`R${f?String(c):`[${String(c)}]`}C${p?String(l):`[${String(l)}]`}`;if(i==null)return m;let h=hd(i);return h instanceof N?h:`${hr(h)}${m}`}),W(`TRANSPOSE`,1,1,(e,t)=>{let n=df(e[0],t);if(n instanceof N)return n;let r=[];for(let e=0;e<n.cols;e++)for(let t=0;t<n.rows;t++)r.push(n.at(t,e));return new F(n.cols,n.rows,r)}),lf(`SHEET`,0,1,(e,t)=>{let n=e[0];if(n===void 0)return t.frame.sheet.index+1;let r=t.calc.eval(n,t.frame);if(r instanceof B)return r.sheet.index+1;let i=t.calc.scalar(r,t.frame);if(typeof i!=`string`)return P.NA;let a=t.calc.wb.sheet(i);return a?a.index+1:P.NA}),W(`SHEETS`,0,1,(e,t)=>t.calc.wb.sheets.length);var fp=e=>t=>{let n=hd(t);return n instanceof N?n:e(n)},pp=(e,t)=>{if(e===void 0)return t;let n=H(e);return n instanceof N?n:n<0?P.VALUE:Math.trunc(n)},mp=(e,t)=>Array.from(e,e=>{let n=t(e);return n.length===e.length?n:e}).join(``),hp=e=>mp(e,e=>e.toUpperCase()),gp=e=>mp(e,e=>e.toLowerCase());U(`LEFT`,1,2,(e,t)=>{let n=hd(e),r=pp(t,1);return n instanceof N?n:r instanceof N?r:n.slice(0,r)}),U(`RIGHT`,1,2,(e,t)=>{let n=hd(e),r=pp(t,1);return n instanceof N?n:r instanceof N?r:r===0?``:n.slice(-r)}),U(`MID`,3,3,(e,t,n)=>{let r=hd(e),i=H(t),a=pp(n,0);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;if(i<1)return P.VALUE;let o=Math.trunc(i)-1;return r.slice(o,o+a)}),U(`LEN`,1,1,fp(e=>e.length)),U(`LOWER`,1,1,fp(gp)),U(`UPPER`,1,1,fp(hp)),U(`PROPER`,1,1,fp(e=>gp(e).replace(/(^|[^\p{L}])(\p{L})/gu,(e,t,n)=>`${t}${hp(n)}`))),U(`TRIM`,1,1,fp(e=>e.replace(/ +/gu,` `).replace(/^ | $/gu,``))),U(`CLEAN`,1,1,fp(e=>e.replace(/[\u0000-\u001f]/gu,``))),U(`T`,1,1,e=>typeof e==`string`?e:``),U(`EXACT`,2,2,(e,t)=>{let n=hd(e),r=hd(t);return n instanceof N?n:r instanceof N?r:n===r}),U(`REPT`,2,2,(e,t)=>{let n=hd(e),r=pp(t,0);return n instanceof N?n:r instanceof N?r:n.length*r>32767?P.VALUE:n.repeat(r)}),U(`CHAR`,1,1,gf(e=>{let t=Math.trunc(e);return t<1||t>255?P.VALUE:vp(t)})),U(`UNICHAR`,1,1,gf(e=>{let t=Math.trunc(e);return t<1||t>1114111?P.VALUE:String.fromCodePoint(t)})),U(`CODE`,1,1,fp(e=>e===``?P.VALUE:e.charCodeAt(0))),U(`UNICODE`,1,1,fp(e=>e.codePointAt(0)??P.VALUE));var _p=`€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ`;function vp(e){return e>=128&&e<160?_p.charAt(e-128):String.fromCharCode(e)}W(`CONCAT`,1,255,(e,t)=>{let n=``,r;return pf(e,t,e=>{if(r)return;let t=hd(e);t instanceof N?r=t:n+=t}),r??n}),U(`CONCATENATE`,1,255,(...e)=>{let t=``;for(let n of e){let e=hd(n);if(e instanceof N)return e;t+=e}return t}),W(`TEXTJOIN`,3,255,(e,t)=>{let[n,r,...i]=e,a=df(n??``,t);if(a instanceof N)return a;let o=[];for(let e=0;e<a.rows;e++)for(let t=0;t<a.cols;t++){let n=hd(a.at(e,t));if(n instanceof N)return n;o.push(n)}let s=gd(t.calc.scalar(r??!0,t.frame));if(s instanceof N)return s;let c=[],l;if(pf(i,t,e=>{if(l)return;let t=hd(e);t instanceof N?l=t:s&&t===``||c.push(t)}),l)return l;let u=c[0]??``;for(let e=1;e<c.length;e++)u+=`${o.length>0?o[(e-1)%o.length]??``:``}${c[e]??``}`;return u}),U(`SUBSTITUTE`,3,4,(e,t,n,r)=>{let i=hd(e),a=hd(t),o=hd(n);if(i instanceof N)return i;if(a instanceof N)return a;if(o instanceof N)return o;if(a===``)return i;if(r===void 0)return i.split(a).join(o);let s=H(r);if(s instanceof N)return s;if(s<1)return P.VALUE;let c=-1;for(let e=0;e<Math.trunc(s);e++)if(c=i.indexOf(a,c+1),c<0)return i;return`${i.slice(0,c)}${o}${i.slice(c+a.length)}`}),U(`REPLACE`,4,4,(e,t,n,r)=>{let i=hd(e),a=H(t),o=pp(n,0),s=hd(r);if(i instanceof N)return i;if(a instanceof N)return a;if(o instanceof N)return o;if(s instanceof N)return s;if(a<1)return P.VALUE;let c=Math.trunc(a)-1;return`${i.slice(0,c)}${s}${i.slice(c+o)}`}),U(`FIND`,2,3,(e,t,n)=>{let r=hd(e),i=hd(t),a=n===void 0?1:H(n);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;if(a<1||a>i.length+1)return P.VALUE;let o=i.indexOf(r,Math.trunc(a)-1);return o<0?P.VALUE:o+1}),U(`SEARCH`,2,3,(e,t,n)=>{let r=hd(e),i=hd(t),a=n===void 0?1:H(n);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;if(a<1||a>i.length+1)return P.VALUE;let o=Math.trunc(a)-1,s=Af(`${r}*`);for(let e=o;e<=i.length;e++)if(s(i.slice(e)))return e+1;return P.VALUE}),U(`VALUE`,1,1,e=>typeof e==`number`?e:e==null?0:typeof e==`string`?md(e)??P.VALUE:P.VALUE),U(`NUMBERVALUE`,1,3,(e,t,n)=>{let r=hd(e),i=hd(t??`.`),a=hd(n??`,`);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;let o=r.replace(/\s/gu,``).split(a).join(``).replace(i,`.`);if(o===``)return 0;let s=/%*$/u.exec(o)?.[0].length??0,c=Number(o.slice(0,o.length-s));return Number.isNaN(c)?P.VALUE:c/100**s}),U(`TEXT`,2,2,(e,t)=>{let n=hd(t);if(n instanceof N)return n;if(!Oc(n))return P.VALUE;if(typeof e==`boolean`)return e?`TRUE`:`FALSE`;let r=typeof e==`string`?md(e)??e:e??0;if(r instanceof N)return r;try{return Tc(n,r)}catch{return P.VALUE}});function yp(e,t,n){return Tc(`${n?`#,##0`:`0`}${t>0?`.${`0`.repeat(t)}`:``}`,e)}var bp=(e,t)=>{let n=10**t;return Math.sign(e)*Math.round(Math.abs(e)*n+1e-9)/n};U(`FIXED`,1,3,(e,t,n)=>{let r=H(e),i=t==null?2:H(t),a=n!==void 0&&gd(n);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;let o=Math.trunc(i);return yp(bp(r,o),Math.max(0,o),!a)}),U(`DOLLAR`,1,2,(e,t)=>{let n=H(e),r=t==null?2:H(t);if(n instanceof N)return n;if(r instanceof N)return r;let i=Math.trunc(r),a=yp(Math.abs(bp(n,i)),Math.max(0,i),!0);return n<0?`($${a})`:`$${a}`});function xp(e,t,n,r,i){let a=r?gp(e):e,o=r?gp(t):t,s=[];for(let e=a.indexOf(o);e>=0&&o!==``;)s.push({at:e,length:o.length}),e=a.indexOf(o,e+o.length);return n>0?(i&&s.push({at:e.length,length:0}),s[n-1]):(i&&s.unshift({at:0,length:0}),s[s.length+n])}function Sp(e){return(...t)=>{let[n,r,i,a,o,s]=t,c=hd(n),l=hd(r),u=i==null?1:H(i),d=a==null?0:H(a),f=o==null?0:H(o);if(c instanceof N)return c;if(l instanceof N)return l;if(u instanceof N)return u;if(d instanceof N)return d;if(f instanceof N)return f;let p=Math.trunc(u);if(p===0||Math.abs(p)>Math.max(c.length,1))return P.VALUE;if(l===``)return p>0==(e===`before`)?``:c;let m=xp(c,l,p,d===1,f===1);return m?e===`before`?c.slice(0,m.at):c.slice(m.at+m.length):s===void 0?P.NA:s}}U(`TEXTBEFORE`,2,6,Sp(`before`),{errors:!0}),U(`TEXTAFTER`,2,6,Sp(`after`),{errors:!0}),U(`HYPERLINK`,1,2,(e,t)=>t===void 0?e??null:t),U(`ENCODEURL`,1,1,fp(e=>encodeURIComponent(e)));for(let e of[`LEN`,`LEFT`,`RIGHT`,`MID`,`FIND`,`SEARCH`,`REPLACE`])uf(`${e}B`,e);var Cp=e=>{let t=H(e);return t instanceof N?t:t<0?P.NUM:Math.floor(t)},wp=e=>e%4==0&&e%100!=0||e%400==0,Tp=(e,t)=>t===2?wp(e)?29:28:[4,6,9,11].includes(t)?30:31,Ep=e=>e.month===2&&e.day===Tp(e.year,2);U(`DATE`,3,3,gf((e=0,t=1,n=1)=>{let r=Math.trunc(e);if(r<0||r>9999)return P.NUM;let i=Sn(r<1900?r+1900:r,Math.trunc(t),Math.trunc(n));return i<0?P.NUM:i})),U(`TIME`,3,3,gf((e=0,t=0,n=0)=>{let r=Math.trunc(e)*3600+Math.trunc(t)*60+Math.trunc(n);return r<0?P.NUM:r%86400/86400})),U(`YEAR`,1,1,e=>{let t=Cp(e);return t instanceof N?t:Cn(t).year}),U(`MONTH`,1,1,e=>{let t=Cp(e);return t instanceof N?t:Cn(t).month}),U(`DAY`,1,1,e=>{let t=Cp(e);return t instanceof N?t:Cn(t).day});var Dp=e=>{let t=H(e);return t instanceof N?t:t<0?P.NUM:Math.round((t-Math.floor(t))*86400)%86400};U(`HOUR`,1,1,e=>{let t=Dp(e);return t instanceof N?t:Math.floor(t/3600)}),U(`MINUTE`,1,1,e=>{let t=Dp(e);return t instanceof N?t:Math.floor(t/60)%60}),U(`SECOND`,1,1,e=>{let t=Dp(e);return t instanceof N?t:t%60}),U(`DATEVALUE`,1,1,e=>{let t=hd(e);if(t instanceof N)return t;let n=Ws(t)??Js(t);return typeof n?.value==`number`?Math.floor(n.value):P.VALUE}),U(`TIMEVALUE`,1,1,e=>{let t=hd(e);if(t instanceof N)return t;let n=Gs(t)??Js(t);return typeof n?.value==`number`?n.value-Math.floor(n.value):P.VALUE});var Op=e=>(e%7+6)%7;U(`WEEKDAY`,1,2,(e,t)=>{let n=Cp(e);if(n instanceof N)return n;let r=t==null?1:H(t);if(r instanceof N)return r;let i=Op(n);return r===1?i+1:r===2?(i+6)%7+1:r===3?(i+6)%7:r>=11&&r<=17?(i+7-(r-10)%7)%7+1:P.NUM});var kp=e=>{let t=e-(Op(e)+6)%7+3,{year:n}=Cn(t);return Math.floor((t-Sn(n,1,1))/7)+1};U(`ISOWEEKNUM`,1,1,e=>{let t=Cp(e);return t instanceof N?t:kp(t)}),U(`WEEKNUM`,1,2,(e,t)=>{let n=Cp(e);if(n instanceof N)return n;let r=t==null?1:H(t);if(r instanceof N)return r;if(r===21)return kp(n);let i=r===1?0:r===2?1:r>=11&&r<=17?(r-10)%7:-1;if(i<0)return P.NUM;let a=Sn(Cn(n).year,1,1),o=(Op(a)+7-i)%7;return Math.floor((n-a+o)/7)+1});var Ap=(e,t)=>{let{year:n,month:r,day:i}=Cn(e),a=n*12+r-1+t,o=Math.floor(a/12),s=a-o*12+1;return Sn(o,s,Math.min(i,Tp(o,s)))};U(`EDATE`,2,2,(e,t)=>{let n=Cp(e),r=H(t);if(n instanceof N)return n;if(r instanceof N)return r;let i=Ap(n,Math.trunc(r));return i<0?P.NUM:i}),U(`EOMONTH`,2,2,(e,t)=>{let n=Cp(e),r=H(t);if(n instanceof N)return n;if(r instanceof N)return r;let i=Cn(Ap(n,Math.trunc(r))),a=Sn(i.year,i.month,Tp(i.year,i.month));return a<0?P.NUM:a}),U(`DAYS`,2,2,(e,t)=>{let n=Cp(e),r=Cp(t);return n instanceof N?n:r instanceof N?r:n-r}),U(`DATEDIF`,3,3,(e,t,n)=>{let r=Cp(e),i=Cp(t),a=hd(n);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;if(r>i)return P.NUM;let o=Cn(r),s=Cn(i),c=(s.year-o.year)*12+s.month-o.month-+(s.day<o.day);switch(a.toUpperCase()){case`D`:return i-r;case`M`:return c;case`Y`:return Math.floor(c/12);case`YM`:return c%12;case`MD`:{if(s.day>=o.day)return s.day-o.day;let e=s.month===1?12:s.month-1;return Tp(s.month===1?s.year-1:s.year,e)-o.day+s.day}case`YD`:{let e=s.year-o.year-+(c%12<0),t=Ap(r,Math.floor(c/12)*12);return e>=0?i-t:P.NUM}default:return P.NUM}});function jp(e,t,n){let r=Cn(e),i=Cn(t),a=r.day,o=i.day,s=i.month,c=i.year;return n?(a=Math.min(a,30),o=Math.min(o,30)):(a===Tp(r.year,r.month)&&(a=30),o===31&&(a<30?(o=1,s+=1,s>12&&(s=1,c+=1)):o=30)),(c-r.year)*360+(s-r.month)*30+o-a}U(`DAYS360`,2,3,(e,t,n)=>{let r=Cp(e),i=Cp(t),a=n!==void 0&&gd(n);return r instanceof N?r:i instanceof N?i:a instanceof N?a:jp(r,i,a)});function Mp(e,t,n){let[r,i]=e<=t?[e,t]:[t,e],a=Cn(r),o=Cn(i),s=i-r;switch(n){case 0:{let e=a.day,t=o.day;return Ep(a)&&(Ep(o)&&(t=30),e=30),t===31&&e>=30&&(t=30),e===31&&(e=30),((o.year-a.year)*360+(o.month-a.month)*30+t-e)/360}case 2:return s/360;case 3:return s/365;case 4:return jp(r,i,!0)/360;default:{if(a.year===o.year||o.year===a.year+1&&(a.month>o.month||a.month===o.month&&a.day>=o.day)){let e;if(a.year===o.year)e=wp(a.year);else{let t=e=>wp(e)?Sn(e,2,29):1/0;e=t(a.year)>=r&&t(a.year)<=i||t(o.year)>=r&&t(o.year)<=i}return s/(e?366:365)}let e=o.year-a.year+1;return s/((Sn(o.year+1,1,1)-Sn(a.year,1,1))/e)}}}U(`YEARFRAC`,2,3,(e,t,n)=>{let r=Cp(e),i=Cp(t),a=n==null?0:H(n);if(r instanceof N)return r;if(i instanceof N)return i;if(a instanceof N)return a;let o=Math.trunc(a);return o<0||o>4?P.NUM:Mp(r,i,o)});function Np(e){let t=(...e)=>[0,1,2,3,4,5,6].map(t=>e.includes(t));if(e==null)return t(0,6);if(typeof e==`string`){if(!/^[01]{7}$/u.test(e)||e===`1111111`)return P.VALUE;let t=e.split(``).map(e=>e===`1`);return[t[6]??!1,...t.slice(0,6)]}let n=H(e);return n instanceof N?n:n>=1&&n<=7?t((n+5)%7,(n+6)%7):n>=11&&n<=17?t(n-11):P.NUM}function Pp(e,t){if(e===void 0||e instanceof al)return new Set;let n=mf([e],t);return n instanceof N?n:new Set(n.map(e=>Math.floor(e)))}function Fp(e,t,n,r){let i=e<=t?1:-1,a=0;for(let o=e;i>0?o<=t:o>=t;o+=i)n[Op(o)]!==!0&&!r.has(o)&&(a+=i);return a}function Ip(e,t,n,r){if(n.every(Boolean))return P.VALUE;let i=t<0?-1:1,a=e;for(let e=Math.abs(t);e>0;)a+=i,n[Op(a)]!==!0&&!r.has(a)&&--e;return a<0?P.NUM:a}var Lp=e=>(t,n)=>{let r=Cp(n.calc.scalar(t[0],n.frame)),i=Cp(n.calc.scalar(t[1],n.frame));if(r instanceof N)return r;if(i instanceof N)return i;let a=e?t[2]:void 0,o=Np(a===void 0||a instanceof al?void 0:n.calc.scalar(a,n.frame));if(o instanceof N)return o;let s=Pp(t[e?3:2],n);return s instanceof N?s:Fp(r,i,o,s)},Rp=e=>(t,n)=>{let r=Cp(n.calc.scalar(t[0],n.frame)),i=H(n.calc.scalar(t[1],n.frame));if(r instanceof N)return r;if(i instanceof N)return i;let a=e?t[2]:void 0,o=Np(a===void 0||a instanceof al?void 0:n.calc.scalar(a,n.frame));if(o instanceof N)return o;let s=Pp(t[e?3:2],n);return s instanceof N?s:Ip(r,Math.trunc(i),o,s)};W(`NETWORKDAYS`,2,3,Lp(!1)),W(`NETWORKDAYS.INTL`,2,4,Lp(!0)),W(`WORKDAY`,2,3,Rp(!1)),W(`WORKDAY.INTL`,2,4,Rp(!0)),W(`NOW`,0,0,(e,t)=>t.calc.nowSerial(),{volatile:!0}),W(`TODAY`,0,0,(e,t)=>Math.floor(t.calc.nowSerial()),{volatile:!0});function zp(e,t,n){let r=n[0]??0,i=0;return t.forEach((t,a)=>{i+=t/(1+e)**(((n[a]??r)-r)/365)}),i}var Bp=(e,t)=>{let n=mf([e[0]],t);if(n instanceof N)return n;let r=mf([e[1]],t);return r instanceof N?r:n.length!==r.length||n.length===0?P.NUM:{values:n,dates:r.map(Math.floor)}};W(`XNPV`,3,3,(e,t)=>{let n=H(t.calc.scalar(e[0],t.frame));if(n instanceof N)return n;let r=Bp(e.slice(1),t);return r instanceof N?r:n<=0?P.NUM:zp(n,r.values,r.dates)}),W(`XIRR`,2,3,(e,t)=>{let n=Bp(e,t);if(n instanceof N)return n;let{values:r,dates:i}=n;if(!r.some(e=>e>0)||!r.some(e=>e<0))return P.NUM;let a=e[2]===void 0||e[2]instanceof al?.1:H(t.calc.scalar(e[2],t.frame));if(a instanceof N)return a;let o=i[0]??0,s=a;for(let e=0;e<100;e++){let e=0,t=0;r.forEach((n,r)=>{let a=((i[r]??o)-o)/365;e+=n/(1+s)**a,t-=a*n/(1+s)**(a+1)});let n=s-e/t;if(!Number.isFinite(n))return P.NUM;if(Math.abs(n-s)<1e-10)return n;s=n<=-1?(s-1)/2:n}return P.NUM});var Vp=(e,t)=>{U(e,1,1,e=>t(e),{errors:!0})};Vp(`ISBLANK`,e=>e==null),Vp(`ISNUMBER`,e=>typeof e==`number`),Vp(`ISTEXT`,e=>typeof e==`string`),Vp(`ISNONTEXT`,e=>typeof e!=`string`),Vp(`ISLOGICAL`,e=>typeof e==`boolean`),Vp(`ISERROR`,e=>e instanceof N),Vp(`ISERR`,e=>e instanceof N&&e!==P.NA),Vp(`ISNA`,e=>e===P.NA);var Hp=(e,t)=>{let n=H(e);return n instanceof N?n:Math.abs(Math.trunc(n))%2===t};U(`ISEVEN`,1,1,e=>Hp(e,0)),U(`ISODD`,1,1,e=>Hp(e,1)),U(`N`,1,1,e=>typeof e==`number`?e:typeof e==`boolean`?+!!e:e instanceof N?e:0,{errors:!0}),W(`NA`,0,0,()=>P.NA),W(`TYPE`,1,1,(e,t)=>{let n=t.calc.flat(e[0]);return n instanceof F?64:typeof n==`number`||n===null?1:typeof n==`string`?2:typeof n==`boolean`?4:16});var Up=[P.NULL,P.DIV0,P.VALUE,P.REF,P.NAME,P.NUM,P.NA];U(`ERROR.TYPE`,1,1,e=>{let t=e instanceof N?Up.indexOf(e):-1;return t<0?P.NA:t+1},{errors:!0}),lf(`ISREF`,1,1,(e,t)=>{let n=e[0];if(!n)return!1;let r=t.calc.eval(n,t.frame);return r instanceof B||r instanceof rl});var Wp=e=>e instanceof B?e.sheet.at(e.top,e.left):void 0;lf(`ISFORMULA`,1,1,(e,t)=>{let n=e[0];if(!n)return P.VALUE;let r=t.calc.eval(n,t.frame);return r instanceof il?P.VALUE:Wp(r)instanceof Cr}),lf(`FORMULATEXT`,1,1,(e,t)=>{let n=e[0];if(!n)return P.VALUE;let r=Wp(t.calc.eval(n,t.frame));return r instanceof Cr?r.text:P.NA}),W(`CELL`,1,2,(e,t)=>{let n=hd(t.calc.scalar(e[0],t.frame));if(n instanceof N)return n;let r=e[1],i=r instanceof B?r:new B(t.frame.sheet,t.frame.row,t.frame.col,t.frame.row,t.frame.col),a=t.calc.read(i.sheet,i.top,i.left);switch(n.toLowerCase()){case`row`:return i.top+1;case`col`:return i.left+1;case`address`:return Qt({row:i.top,col:i.left}).replace(/^([A-Z]+)(\d+)$/u,`$$$1$$$2`);case`contents`:return a;case`type`:return a===null?`b`:typeof a==`string`?`l`:`v`;default:return P.VALUE}});var Gp=n(((e,t,n)=>{(function(n,r){typeof e==`object`?t.exports=r():typeof define==`function`&&define.amd?define(r):n.jStat=r()})(n,function(){var e=function(e,t){var n=Array.prototype.concat,r=Array.prototype.slice,i=Object.prototype.toString;function a(t,n){var r=t>n?t:n;return e.pow(10,17-~~(e.log(r>0?r:-r)*e.LOG10E))}var o=Array.isArray||function(e){return i.call(e)===`[object Array]`};function s(e){return i.call(e)===`[object Function]`}function c(e){return typeof e==`number`&&e-e===0}function l(e){return n.apply([],e)}function u(){return new u._init(arguments)}u.fn=u.prototype,u._init=function(e){if(o(e[0])){if(o(e[0][0])){s(e[1])&&(e[0]=u.map(e[0],e[1]));for(var t=0;t<e[0].length;t++)this[t]=e[0][t];this.length=e[0].length}else this[0]=s(e[1])?u.map(e[0],e[1]):e[0],this.length=1}else if(c(e[0]))this[0]=u.seq.apply(null,e),this.length=1;else if(e[0]instanceof u)return u(e[0].toArray());else this[0]=[],this.length=1;return this},u._init.prototype=u.prototype,u._init.constructor=u,u.utils={calcRdx:a,isArray:o,isFunction:s,isNumber:c,toVector:l},u._random_fn=e.random,u.setRandom=function(e){if(typeof e!=`function`)throw TypeError(`fn is not a function`);u._random_fn=e},u.extend=function(e){var t,n;if(arguments.length===1){for(n in e)u[n]=e[n];return this}for(t=1;t<arguments.length;t++)for(n in arguments[t])e[n]=arguments[t][n];return e},u.rows=function(e){return e.length||1},u.cols=function(e){return e[0].length||1},u.dimensions=function(e){return{rows:u.rows(e),cols:u.cols(e)}},u.row=function(e,t){return o(t)?t.map(function(t){return u.row(e,t)}):e[t]},u.rowa=function(e,t){return u.row(e,t)},u.col=function(e,t){if(o(t)){var n=u.arange(e.length).map(function(){return Array(t.length)});return t.forEach(function(t,r){u.arange(e.length).forEach(function(i){n[i][r]=e[i][t]})}),n}for(var r=Array(e.length),i=0;i<e.length;i++)r[i]=[e[i][t]];return r},u.cola=function(e,t){return u.col(e,t).map(function(e){return e[0]})},u.diag=function(e){for(var t=u.rows(e),n=Array(t),r=0;r<t;r++)n[r]=[e[r][r]];return n},u.antidiag=function(e){for(var t=u.rows(e)-1,n=Array(t),r=0;t>=0;t--,r++)n[r]=[e[r][t]];return n},u.transpose=function(e){var t=[],n,r,i,a,s;for(o(e[0])||(e=[e]),r=e.length,i=e[0].length,s=0;s<i;s++){for(n=Array(r),a=0;a<r;a++)n[a]=e[a][s];t.push(n)}return t.length===1?t[0]:t},u.map=function(e,t,n){var r,i,a,s,c;for(o(e[0])||(e=[e]),i=e.length,a=e[0].length,s=n?e:Array(i),r=0;r<i;r++)for(s[r]||(s[r]=Array(a)),c=0;c<a;c++)s[r][c]=t(e[r][c],r,c);return s.length===1?s[0]:s},u.cumreduce=function(e,t,n){var r,i,a,s,c;for(o(e[0])||(e=[e]),i=e.length,a=e[0].length,s=n?e:Array(i),r=0;r<i;r++)for(s[r]||(s[r]=Array(a)),a>0&&(s[r][0]=e[r][0]),c=1;c<a;c++)s[r][c]=t(s[r][c-1],e[r][c]);return s.length===1?s[0]:s},u.alter=function(e,t){return u.map(e,t,!0)},u.create=function(e,t,n){var r=Array(e),i,a;for(s(t)&&(n=t,t=e),i=0;i<e;i++)for(r[i]=Array(t),a=0;a<t;a++)r[i][a]=n(i,a);return r};function d(){return 0}u.zeros=function(e,t){return c(t)||(t=e),u.create(e,t,d)};function f(){return 1}u.ones=function(e,t){return c(t)||(t=e),u.create(e,t,f)},u.rand=function(e,t){return c(t)||(t=e),u.create(e,t,u._random_fn)};function p(e,t){return+(e===t)}u.identity=function(e,t){return c(t)||(t=e),u.create(e,t,p)},u.symmetric=function(e){var t=e.length,n,r;if(e.length!==e[0].length)return!1;for(n=0;n<t;n++)for(r=0;r<t;r++)if(e[r][n]!==e[n][r])return!1;return!0},u.clear=function(e){return u.alter(e,d)},u.seq=function(e,t,n,r){s(r)||(r=!1);for(var i=[],o=a(e,t),c=(t*o-e*o)/((n-1)*o),l=e,u=0;l<=t&&u<n;u++,l=(e*o+c*o*u)/o)i.push(r?r(l,u):l);return i},u.arange=function(e,n,r){var i=[],a;if(r||=1,n===t&&(n=e,e=0),e===n||r===0||e<n&&r<0||e>n&&r>0)return[];if(r>0)for(a=e;a<n;a+=r)i.push(a);else for(a=e;a>n;a+=r)i.push(a);return i},u.slice=function(){function e(e,n,r,i){var a,o=[],s=e.length;if(n===t&&r===t&&i===t)return u.copy(e);if(n||=0,r||=e.length,n=n>=0?n:s+n,r=r>=0?r:s+r,i||=1,n===r||i===0||n<r&&i<0||n>r&&i>0)return[];if(i>0)for(a=n;a<r;a+=i)o.push(e[a]);else for(a=n;a>r;a+=i)o.push(e[a]);return o}function n(t,n){var r,i;if(n||={},c(n.row)){if(c(n.col))return t[n.row][n.col];var a=u.rowa(t,n.row);return r=n.col||{},e(a,r.start,r.end,r.step)}if(c(n.col)){var o=u.cola(t,n.col);return i=n.row||{},e(o,i.start,i.end,i.step)}return i=n.row||{},r=n.col||{},e(t,i.start,i.end,i.step).map(function(t){return e(t,r.start,r.end,r.step)})}return n}(),u.sliceAssign=function(n,r,i){var a,o;if(c(r.row)){if(c(r.col))return n[r.row][r.col]=i;r.col=r.col||{},r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,a=u.arange(r.col.start,e.min(n.length,r.col.end),r.col.step);var s=r.row;return a.forEach(function(e,t){n[s][e]=i[t]}),n}if(c(r.col)){r.row=r.row||{},r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,o=u.arange(r.row.start,e.min(n[0].length,r.row.end),r.row.step);var l=r.col;return o.forEach(function(e,t){n[e][l]=i[t]}),n}return i[0].length===t&&(i=[i]),r.row.start=r.row.start||0,r.row.end=r.row.end||n.length,r.row.step=r.row.step||1,r.col.start=r.col.start||0,r.col.end=r.col.end||n[0].length,r.col.step=r.col.step||1,o=u.arange(r.row.start,e.min(n.length,r.row.end),r.row.step),a=u.arange(r.col.start,e.min(n[0].length,r.col.end),r.col.step),o.forEach(function(e,t){a.forEach(function(r,a){n[e][r]=i[t][a]})}),n},u.diagonal=function(e){var t=u.zeros(e.length,e.length);return e.forEach(function(e,n){t[n][n]=e}),t},u.copy=function(e){return e.map(function(e){return c(e)?e:e.map(function(e){return e})})};var m=u.prototype;return m.length=0,m.push=Array.prototype.push,m.sort=Array.prototype.sort,m.splice=Array.prototype.splice,m.slice=Array.prototype.slice,m.toArray=function(){return this.length>1?r.call(this):r.call(this)[0]},m.map=function(e,t){return u(u.map(this,e,t))},m.cumreduce=function(e,t){return u(u.cumreduce(this,e,t))},m.alter=function(e){return u.alter(this,e),this},(function(e){for(var t=0;t<e.length;t++)(function(e){m[e]=function(t){var n=this,r;return t?(setTimeout(function(){t.call(n,m[e].call(n))}),this):(r=u[e](this),o(r)?u(r):r)}})(e[t])})(`transpose clear symmetric rows cols dimensions diag antidiag`.split(` `)),(function(e){for(var t=0;t<e.length;t++)(function(e){m[e]=function(t,n){var r=this;return n?(setTimeout(function(){n.call(r,m[e].call(r,t))}),this):u(u[e](this,t))}})(e[t])})(`row col`.split(` `)),(function(e){for(var t=0;t<e.length;t++)(function(e){m[e]=function(){return u(u[e].apply(null,arguments))}})(e[t])})(`create zeros ones rand identity`.split(` `)),u}(Math);return(function(e,t){var n=e.utils.isFunction;function r(e,t){return e-t}function i(e,n,r){return t.max(n,t.min(e,r))}e.sum=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n];return t},e.sumsqrd=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n]*e[n];return t},e.sumsqerr=function(t){for(var n=e.mean(t),r=0,i=t.length,a;--i>=0;)a=t[i]-n,r+=a*a;return r},e.sumrow=function(e){for(var t=0,n=e.length;--n>=0;)t+=e[n];return t},e.product=function(e){for(var t=1,n=e.length;--n>=0;)t*=e[n];return t},e.min=function(e){for(var t=e[0],n=0;++n<e.length;)e[n]<t&&(t=e[n]);return t},e.max=function(e){for(var t=e[0],n=0;++n<e.length;)e[n]>t&&(t=e[n]);return t},e.unique=function(e){for(var t={},n=[],r=0;r<e.length;r++)t[e[r]]||(t[e[r]]=!0,n.push(e[r]));return n},e.mean=function(t){return e.sum(t)/t.length},e.meansqerr=function(t){return e.sumsqerr(t)/t.length},e.geomean=function(n){var r=n.map(t.log),i=e.mean(r);return t.exp(i)},e.median=function(e){var t=e.length,n=e.slice().sort(r);return t&1?n[t/2|0]:(n[t/2-1]+n[t/2])/2},e.cumsum=function(t){return e.cumreduce(t,function(e,t){return e+t})},e.cumprod=function(t){return e.cumreduce(t,function(e,t){return e*t})},e.diff=function(e){for(var t=[],n=e.length,r=1;r<n;r++)t.push(e[r]-e[r-1]);return t},e.rank=function(e){var t,n=[],i={};for(t=0;t<e.length;t++){var a=e[t];i[a]?i[a]++:(i[a]=1,n.push(a))}var o=n.sort(r),s={},c=1;for(t=0;t<o.length;t++){var a=o[t],l=i[a];s[a]=(c+(c+l-1))/2,c+=l}return e.map(function(e){return s[e]})},e.mode=function(e){for(var t=e.length,n=e.slice().sort(r),i=1,a=0,o=0,s=[],c=0;c<t;c++)n[c]===n[c+1]?i++:(i>a?(s=[n[c]],a=i,o=0):i===a&&(s.push(n[c]),o++),i=1);return o===0?s[0]:s},e.range=function(t){return e.max(t)-e.min(t)},e.variance=function(t,n){return e.sumsqerr(t)/(t.length-+!!n)},e.pooledvariance=function(t){return t.reduce(function(t,n){return t+e.sumsqerr(n)},0)/(t.reduce(function(e,t){return e+t.length},0)-t.length)},e.deviation=function(t){for(var n=e.mean(t),r=t.length,i=Array(r),a=0;a<r;a++)i[a]=t[a]-n;return i},e.stdev=function(n,r){return t.sqrt(e.variance(n,r))},e.pooledstdev=function(n){return t.sqrt(e.pooledvariance(n))},e.meandev=function(n){for(var r=e.mean(n),i=[],a=n.length-1;a>=0;a--)i.push(t.abs(n[a]-r));return e.mean(i)},e.meddev=function(n){for(var r=e.median(n),i=[],a=n.length-1;a>=0;a--)i.push(t.abs(n[a]-r));return e.median(i)},e.coeffvar=function(t){return e.stdev(t)/e.mean(t)},e.quartiles=function(e){var n=e.length,i=e.slice().sort(r);return[i[t.round(n/4)-1],i[t.round(n/2)-1],i[t.round(n*3/4)-1]]},e.quantiles=function(e,n,a,o){var s=e.slice().sort(r),c=[n.length],l=e.length,u,d,f,p,m,h;for(a===void 0&&(a=3/8),o===void 0&&(o=3/8),u=0;u<n.length;u++)d=n[u],f=a+d*(1-a-o),p=l*d+f,m=t.floor(i(p,1,l-1)),h=i(p-m,0,1),c[u]=(1-h)*s[m-1]+h*s[m];return c},e.percentile=function(e,t,n){var i=e.slice().sort(r),a=t*(i.length+(n?1:-1))+ +!n,o=parseInt(a),s=a-o;return o+1<i.length?i[o-1]+s*(i[o]-i[o-1]):i[o-1]},e.percentileOfScore=function(e,t,n){var r=0,i=e.length,a=!1,o,s;for(n===`strict`&&(a=!0),s=0;s<i;s++)o=e[s],(a&&o<t||!a&&o<=t)&&r++;return r/i},e.histogram=function(n,r){r||=4;for(var i=e.min(n),a=(e.max(n)-i)/r,o=n.length,s=[],c=0;c<r;c++)s[c]=0;for(c=0;c<o;c++)s[t.min(t.floor((n[c]-i)/a),r-1)]+=1;return s},e.covariance=function(t,n){for(var r=e.mean(t),i=e.mean(n),a=t.length,o=Array(a),s=0;s<a;s++)o[s]=(t[s]-r)*(n[s]-i);return e.sum(o)/(a-1)},e.corrcoeff=function(t,n){return e.covariance(t,n)/e.stdev(t,1)/e.stdev(n,1)},e.spearmancoeff=function(t,n){return t=e.rank(t),n=e.rank(n),e.corrcoeff(t,n)},e.stanMoment=function(n,r){for(var i=e.mean(n),a=e.stdev(n),o=n.length,s=0,c=0;c<o;c++)s+=t.pow((n[c]-i)/a,r);return s/n.length},e.skewness=function(t){return e.stanMoment(t,3)},e.kurtosis=function(t){return e.stanMoment(t,4)-3};var a=e.prototype;(function(t){for(var r=0;r<t.length;r++)(function(t){a[t]=function(r,i){var o=[],s=0,c=this;if(n(r)&&(i=r,r=!1),i)return setTimeout(function(){i.call(c,a[t].call(c,r))}),this;if(this.length>1){for(c=r===!0?this:this.transpose();s<c.length;s++)o[s]=e[t](c[s]);return o}return e[t](this[0],r)}})(t[r])})(`cumsum cumprod`.split(` `)),(function(t){for(var r=0;r<t.length;r++)(function(t){a[t]=function(r,i){var o=[],s=0,c=this;if(n(r)&&(i=r,r=!1),i)return setTimeout(function(){i.call(c,a[t].call(c,r))}),this;if(this.length>1){for(t!==`sumrow`&&(c=r===!0?this:this.transpose());s<c.length;s++)o[s]=e[t](c[s]);return r===!0?e[t](e.utils.toVector(o)):o}return e[t](this[0],r)}})(t[r])})(`sum sumsqrd sumsqerr sumrow product min max unique mean meansqerr geomean median diff rank mode range variance deviation stdev meandev meddev coeffvar quartiles histogram skewness kurtosis`.split(` `)),(function(t){for(var r=0;r<t.length;r++)(function(t){a[t]=function(){var r=[],i=0,o=this,s=Array.prototype.slice.call(arguments),c;if(n(s[s.length-1])){c=s[s.length-1];var l=s.slice(0,s.length-1);return setTimeout(function(){c.call(o,a[t].apply(o,l))}),this}c=void 0;var u=function(n){return e[t].apply(o,[n].concat(s))};if(this.length>1){for(o=o.transpose();i<o.length;i++)r[i]=u(o[i]);return r}return u(this[0])}})(t[r])})(`quantiles percentileOfScore`.split(` `))})(e,Math),(function(e,t){e.gammaln=function(e){var n=0,r=[76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18],i=1.000000000190015,a,o,s=(o=a=e)+5.5;for(s-=(a+.5)*t.log(s);n<6;n++)i+=r[n]/++o;return t.log(2.5066282746310007*i/a)-s},e.loggam=function(e){var n,r,i,a,o,s,c,l=[.08333333333333333,-.002777777777777778,.0007936507936507937,-.0005952380952380952,.0008417508417508418,-.001917526917526918,.00641025641025641,-.02955065359477124,.1796443723688307,-1.3924322169059];if(n=e,c=0,e==1||e==2)return 0;for(e<=7&&(c=t.floor(7-e),n=e+c),r=1/(n*n),i=2*t.PI,o=l[9],s=8;s>=0;s--)o*=r,o+=l[s];if(a=o/n+.5*t.log(i)+(n-.5)*t.log(n)-n,e<=7)for(s=1;s<=c;s++)a-=t.log(n-1),--n;return a},e.gammafn=function(e){var n=[-1.716185138865495,24.76565080557592,-379.80425647094563,629.3311553128184,866.9662027904133,-31451.272968848367,-36144.413418691176,66456.14382024054],r=[-30.8402300119739,315.35062697960416,-1015.1563674902192,-3107.771671572311,22538.11842098015,4755.846277527881,-134659.9598649693,-115132.2596755535],i=!1,a=0,o=0,s=0,c=e,l,u,d,f;if(e>171.6243769536076)return 1/0;if(c<=0){if(f=c%1+36e-17,f)i=(c&1?-1:1)*t.PI/t.sin(t.PI*f),c=1-c;else return 1/0}for(d=c,u=c<1?c++:(c-=a=(c|0)-1)-1,l=0;l<8;++l)s=(s+n[l])*u,o=o*u+r[l];if(f=s/o+1,d<c)f/=d;else if(d>c)for(l=0;l<a;++l)f*=c,c++;return i&&(f=i/f),f},e.gammap=function(t,n){return e.lowRegGamma(t,n)*e.gammafn(t)},e.lowRegGamma=function(n,r){var i=e.gammaln(n),a=n,o=1/n,s=o,c=r+1-n,l=1/1e-30,u=1/c,d=u,f=1,p=-~(t.log(n>=1?n:1/n)*8.5+n*.4+17),m;if(r<0||n<=0)return NaN;if(r<n+1){for(;f<=p;f++)o+=s*=r/++a;return o*t.exp(-r+n*t.log(r)-i)}for(;f<=p;f++)m=-f*(f-n),c+=2,u=m*u+c,l=c+m/l,u=1/u,d*=u*l;return 1-d*t.exp(-r+n*t.log(r)-i)},e.factorialln=function(t){return t<0?NaN:e.gammaln(t+1)},e.factorial=function(t){return t<0?NaN:e.gammafn(t+1)},e.combination=function(n,r){return n>170||r>170?t.exp(e.combinationln(n,r)):e.factorial(n)/e.factorial(r)/e.factorial(n-r)},e.combinationln=function(t,n){return e.factorialln(t)-e.factorialln(n)-e.factorialln(t-n)},e.permutation=function(t,n){return e.factorial(t)/e.factorial(t-n)},e.betafn=function(n,r){if(!(n<=0||r<=0))return n+r>170?t.exp(e.betaln(n,r)):e.gammafn(n)*e.gammafn(r)/e.gammafn(n+r)},e.betaln=function(t,n){return e.gammaln(t)+e.gammaln(n)-e.gammaln(t+n)},e.betacf=function(e,n,r){var i=1e-30,a=1,o=n+r,s=n+1,c=n-1,l=1,u=1-o*e/s,d,f,p,m;for(t.abs(u)<i&&(u=i),u=1/u,m=u;a<=100&&(d=2*a,f=a*(r-a)*e/((c+d)*(n+d)),u=1+f*u,t.abs(u)<i&&(u=i),l=1+f/l,t.abs(l)<i&&(l=i),u=1/u,m*=u*l,f=-(n+a)*(o+a)*e/((n+d)*(s+d)),u=1+f*u,t.abs(u)<i&&(u=i),l=1+f/l,t.abs(l)<i&&(l=i),u=1/u,p=u*l,m*=p,!(t.abs(p-1)<3e-7));a++);return m},e.gammapinv=function(n,r){var i=0,a=r-1,o=1e-8,s=e.gammaln(r),c,l,u,d,f,p,m;if(n>=1)return t.max(100,r+100*t.sqrt(r));if(n<=0)return 0;for(r>1?(p=t.log(a),m=t.exp(a*(p-1)-s),f=n<.5?n:1-n,u=t.sqrt(-2*t.log(f)),c=(2.30753+u*.27061)/(1+u*(.99229+u*.04481))-u,n<.5&&(c=-c),c=t.max(.001,r*t.pow(1-1/(9*r)-c/(3*t.sqrt(r)),3))):(u=1-r*(.253+r*.12),c=n<u?t.pow(n/u,1/r):1-t.log(1-(n-u)/(1-u)));i<12;i++){if(c<=0)return 0;if(l=e.lowRegGamma(r,c)-n,u=r>1?m*t.exp(-(c-a)+a*(t.log(c)-p)):t.exp(-c+a*t.log(c)-s),d=l/u,c-=u=d/(1-.5*t.min(1,d*((r-1)/c-1))),c<=0&&(c=.5*(c+u)),t.abs(u)<o*c)break}return c},e.erf=function(e){var n=[-1.3026537197817094,.6419697923564902,.019476473204185836,-.00956151478680863,-.000946595344482036,.000366839497852761,42523324806907e-18,-20278578112534e-18,-1624290004647e-18,130365583558e-17,1.5626441722e-8,-8.5238095915e-8,6.529054439e-9,5.059343495e-9,-991364156e-18,-227365122e-18,96467911e-18,2394038e-18,-6886027e-18,894487e-18,313092e-18,-112708e-18,381e-18,7106e-18,-1523e-18,-94e-18,121e-18,-28e-18],r=n.length-1,i=!1,a=0,o=0,s,c,l,u;for(e<0&&(e=-e,i=!0),s=2/(2+e),c=4*s-2;r>0;r--)l=a,a=c*a-o+n[r],o=l;return u=s*t.exp(-e*e+.5*(n[0]+c*a)-o),i?u-1:1-u},e.erfc=function(t){return 1-e.erf(t)},e.erfcinv=function(n){var r=0,i,a,o,s;if(n>=2)return-100;if(n<=0)return 100;for(s=n<1?n:2-n,o=t.sqrt(-2*t.log(s/2)),i=-.70711*((2.30753+o*.27061)/(1+o*(.99229+o*.04481))-o);r<2;r++)a=e.erfc(i)-s,i+=a/(1.1283791670955126*t.exp(-i*i)-i*a);return n<1?i:-i},e.ibetainv=function(n,r,i){var a=1e-8,o=r-1,s=i-1,c=0,l,u,d,f,p,m,h,g,_,v,y;if(n<=0)return 0;if(n>=1)return 1;for(r>=1&&i>=1?(d=n<.5?n:1-n,f=t.sqrt(-2*t.log(d)),h=(2.30753+f*.27061)/(1+f*(.99229+f*.04481))-f,n<.5&&(h=-h),g=(h*h-3)/6,_=2/(1/(2*r-1)+1/(2*i-1)),v=h*t.sqrt(g+_)/_-(1/(2*i-1)-1/(2*r-1))*(g+5/6-2/(3*_)),h=r/(r+i*t.exp(2*v))):(l=t.log(r/(r+i)),u=t.log(i/(r+i)),f=t.exp(r*l)/r,p=t.exp(i*u)/i,v=f+p,h=n<f/v?t.pow(r*v*n,1/r):1-t.pow(i*v*(1-n),1/i)),y=-e.gammaln(r)-e.gammaln(i)+e.gammaln(r+i);c<10;c++){if(h===0||h===1)return h;if(m=e.ibeta(h,r,i)-n,f=t.exp(o*t.log(h)+s*t.log(1-h)+y),p=m/f,h-=f=p/(1-.5*t.min(1,p*(o/h-s/(1-h)))),h<=0&&(h=.5*(h+f)),h>=1&&(h=.5*(h+f+1)),t.abs(f)<a*h&&c>0)break}return h},e.ibeta=function(n,r,i){var a=n===0||n===1?0:t.exp(e.gammaln(r+i)-e.gammaln(r)-e.gammaln(i)+r*t.log(n)+i*t.log(1-n));return n<0||n>1?!1:n<(r+1)/(r+i+2)?a*e.betacf(n,r,i)/r:1-a*e.betacf(1-n,i,r)/i},e.randn=function(n,r){var i,a,o,s,c;if(r||=n,n)return e.create(n,r,function(){return e.randn()});do i=e._random_fn(),a=1.7156*(e._random_fn()-.5),o=i-.449871,s=t.abs(a)+.386595,c=o*o+s*(.196*s-.25472*o);while(c>.27597&&(c>.27846||a*a>-4*t.log(i)*i*i));return a/i},e.randg=function(n,r,i){var a=n,o,s,c,l,u,d;if(i||=r,n||=1,r)return d=e.zeros(r,i),d.alter(function(){return e.randg(n)}),d;n<1&&(n+=1),o=n-1/3,s=1/t.sqrt(9*o);do{do u=e.randn(),l=1+s*u;while(l<=0);l=l*l*l,c=e._random_fn()}while(c>1-.331*t.pow(u,4)&&t.log(c)>.5*u*u+o*(1-l+t.log(l)));if(n==a)return o*l;do c=e._random_fn();while(c===0);return t.pow(c,1/a)*o*l},(function(t){for(var n=0;n<t.length;n++)(function(t){e.fn[t]=function(){return e(e.map(this,function(n){return e[t](n)}))}})(t[n])})(`gammaln gammafn factorial factorialln`.split(` `)),(function(t){for(var n=0;n<t.length;n++)(function(t){e.fn[t]=function(){return e(e[t].apply(null,arguments))}})(t[n])})(`randn`.split(` `))})(e,Math),(function(e,t){(function(t){for(var n=0;n<t.length;n++)(function(t){e[t]=function e(t,n,r){return this instanceof e?(this._a=t,this._b=n,this._c=r,this):new e(t,n,r)},e.fn[t]=function(n,r,i){var a=e[t](n,r,i);return a.data=this,a},e[t].prototype.sample=function(n){var r=this._a,i=this._b,a=this._c;return n?e.alter(n,function(){return e[t].sample(r,i,a)}):e[t].sample(r,i,a)},(function(n){for(var r=0;r<n.length;r++)(function(n){e[t].prototype[n]=function(r){var i=this._a,a=this._b,o=this._c;return!r&&r!==0&&(r=this.data),typeof r==`number`?e[t][n](r,i,a,o):e.fn.map.call(r,function(r){return e[t][n](r,i,a,o)})}})(n[r])})(`pdf cdf inv`.split(` `)),(function(n){for(var r=0;r<n.length;r++)(function(n){e[t].prototype[n]=function(){return e[t][n](this._a,this._b,this._c)}})(n[r])})(`mean median mode variance`.split(` `))})(t[n])})(`beta centralF cauchy chisquare exponential gamma invgamma kumaraswamy laplace lognormal noncentralt normal pareto studentt weibull uniform binomial negbin hypgeom poisson triangular tukey arcsine`.split(` `)),e.extend(e.beta,{pdf:function(n,r,i){return n>1||n<0?0:r==1&&i==1?1:r<512&&i<512?t.pow(n,r-1)*t.pow(1-n,i-1)/e.betafn(r,i):t.exp((r-1)*t.log(n)+(i-1)*t.log(1-n)-e.betaln(r,i))},cdf:function(t,n,r){return t>1||t<0?(t>1)*1:e.ibeta(t,n,r)},inv:function(t,n,r){return e.ibetainv(t,n,r)},mean:function(e,t){return e/(e+t)},median:function(t,n){return e.ibetainv(.5,t,n)},mode:function(e,t){return(e-1)/(e+t-2)},sample:function(t,n){var r=e.randg(t);return r/(r+e.randg(n))},variance:function(e,n){return e*n/(t.pow(e+n,2)*(e+n+1))}}),e.extend(e.centralF,{pdf:function(n,r,i){var a,o,s;return n<0?0:r<=2?n===0&&r<2?1/0:n===0&&r===2?1:1/e.betafn(r/2,i/2)*t.pow(r/i,r/2)*t.pow(n,r/2-1)*t.pow(1+r/i*n,-(r+i)/2):(a=r*n/(i+n*r),o=i/(i+n*r),s=r*o/2,s*e.binomial.pdf((r-2)/2,(r+i-2)/2,a))},cdf:function(t,n,r){return t<0?0:e.ibeta(n*t/(n*t+r),n/2,r/2)},inv:function(t,n,r){return r/(n*(1/e.ibetainv(t,n/2,r/2)-1))},mean:function(e,t){return t>2?t/(t-2):void 0},mode:function(e,t){return e>2?t*(e-2)/(e*(t+2)):void 0},sample:function(t,n){var r=e.randg(t/2)*2,i=e.randg(n/2)*2;return r/t/(i/n)},variance:function(e,t){if(!(t<=4))return 2*t*t*(e+t-2)/(e*(t-2)*(t-2)*(t-4))}}),e.extend(e.cauchy,{pdf:function(e,n,r){return r<0?0:r/(t.pow(e-n,2)+t.pow(r,2))/t.PI},cdf:function(e,n,r){return t.atan((e-n)/r)/t.PI+.5},inv:function(e,n,r){return n+r*t.tan(t.PI*(e-.5))},median:function(e){return e},mode:function(e){return e},sample:function(n,r){return e.randn()*t.sqrt(1/(2*e.randg(.5)))*r+n}}),e.extend(e.chisquare,{pdf:function(n,r){return n<0?0:n===0&&r===2?.5:t.exp((r/2-1)*t.log(n)-n/2-r/2*t.log(2)-e.gammaln(r/2))},cdf:function(t,n){return t<0?0:e.lowRegGamma(n/2,t/2)},inv:function(t,n){return 2*e.gammapinv(t,.5*n)},mean:function(e){return e},median:function(e){return e*t.pow(1-2/(9*e),3)},mode:function(e){return e-2>0?e-2:0},sample:function(t){return e.randg(t/2)*2},variance:function(e){return 2*e}}),e.extend(e.exponential,{pdf:function(e,n){return e<0?0:n*t.exp(-n*e)},cdf:function(e,n){return e<0?0:1-t.exp(-n*e)},inv:function(e,n){return-t.log(1-e)/n},mean:function(e){return 1/e},median:function(e){return 1/e*t.log(2)},mode:function(){return 0},sample:function(n){return-1/n*t.log(e._random_fn())},variance:function(e){return t.pow(e,-2)}}),e.extend(e.gamma,{pdf:function(n,r,i){return n<0?0:n===0&&r===1?1/i:t.exp((r-1)*t.log(n)-n/i-e.gammaln(r)-r*t.log(i))},cdf:function(t,n,r){return t<0?0:e.lowRegGamma(n,t/r)},inv:function(t,n,r){return e.gammapinv(t,n)*r},mean:function(e,t){return e*t},mode:function(e,t){if(e>1)return(e-1)*t},sample:function(t,n){return e.randg(t)*n},variance:function(e,t){return e*t*t}}),e.extend(e.invgamma,{pdf:function(n,r,i){return n<=0?0:t.exp(-(r+1)*t.log(n)-i/n-e.gammaln(r)+r*t.log(i))},cdf:function(t,n,r){return t<=0?0:1-e.lowRegGamma(n,r/t)},inv:function(t,n,r){return r/e.gammapinv(1-t,n)},mean:function(e,t){return e>1?t/(e-1):void 0},mode:function(e,t){return t/(e+1)},sample:function(t,n){return n/e.randg(t)},variance:function(e,t){if(!(e<=2))return t*t/((e-1)*(e-1)*(e-2))}}),e.extend(e.kumaraswamy,{pdf:function(e,n,r){return e===0&&n===1?r:e===1&&r===1?n:t.exp(t.log(n)+t.log(r)+(n-1)*t.log(e)+(r-1)*t.log(1-t.pow(e,n)))},cdf:function(e,n,r){return e<0?0:e>1?1:1-t.pow(1-t.pow(e,n),r)},inv:function(e,n,r){return t.pow(1-t.pow(1-e,1/r),1/n)},mean:function(t,n){return n*e.gammafn(1+1/t)*e.gammafn(n)/e.gammafn(1+1/t+n)},median:function(e,n){return t.pow(1-t.pow(2,-1/n),1/e)},mode:function(e,n){if(e>=1&&n>=1&&e!==1&&n!==1)return t.pow((e-1)/(e*n-1),1/e)},variance:function(){throw Error(`variance not yet implemented`)}}),e.extend(e.lognormal,{pdf:function(e,n,r){return e<=0?0:t.exp(-t.log(e)-.5*t.log(2*t.PI)-t.log(r)-t.pow(t.log(e)-n,2)/(2*r*r))},cdf:function(n,r,i){return n<0?0:.5+.5*e.erf((t.log(n)-r)/t.sqrt(2*i*i))},inv:function(n,r,i){return t.exp(-1.4142135623730951*i*e.erfcinv(2*n)+r)},mean:function(e,n){return t.exp(e+n*n/2)},median:function(e){return t.exp(e)},mode:function(e,n){return t.exp(e-n*n)},sample:function(n,r){return t.exp(e.randn()*r+n)},variance:function(e,n){return(t.exp(n*n)-1)*t.exp(2*e+n*n)}}),e.extend(e.noncentralt,{pdf:function(n,r,i){var a=1e-14;return t.abs(i)<a?e.studentt.pdf(n,r):t.abs(n)<a?t.exp(e.gammaln((r+1)/2)-i*i/2-.5*t.log(t.PI*r)-e.gammaln(r/2)):r/n*(e.noncentralt.cdf(n*t.sqrt(1+2/r),r+2,i)-e.noncentralt.cdf(n,r,i))},cdf:function(n,r,i){var a=1e-14,o=200;if(t.abs(i)<a)return e.studentt.cdf(n,r);var s=!1;n<0&&(s=!0,i=-i);for(var c=e.normal.cdf(-i,0,1),l=a+1,u=l,d=n*n/(n*n+r),f=0,p=t.exp(-i*i/2),m=t.exp(-i*i/2-.5*t.log(2)-e.gammaln(3/2))*i;f<o||u>a||l>a;)u=l,f>0&&(p*=i*i/(2*f),m*=i*i/(2*(f+1/2))),l=p*e.beta.cdf(d,f+.5,r/2)+m*e.beta.cdf(d,f+1,r/2),c+=.5*l,f++;return s?1-c:c}}),e.extend(e.normal,{pdf:function(e,n,r){return t.exp(-.5*t.log(2*t.PI)-t.log(r)-t.pow(e-n,2)/(2*r*r))},cdf:function(n,r,i){return .5*(1+e.erf((n-r)/t.sqrt(2*i*i)))},inv:function(t,n,r){return-1.4142135623730951*r*e.erfcinv(2*t)+n},mean:function(e){return e},median:function(e){return e},mode:function(e){return e},sample:function(t,n){return e.randn()*n+t},variance:function(e,t){return t*t}}),e.extend(e.pareto,{pdf:function(e,n,r){return e<n?0:r*t.pow(n,r)/t.pow(e,r+1)},cdf:function(e,n,r){return e<n?0:1-t.pow(n/e,r)},inv:function(e,n,r){return n/t.pow(1-e,1/r)},mean:function(e,n){if(!(n<=1))return n*t.pow(e,n)/(n-1)},median:function(e,n){return e*(n*t.SQRT2)},mode:function(e){return e},variance:function(e,n){if(!(n<=2))return e*e*n/(t.pow(n-1,2)*(n-2))}}),e.extend(e.studentt,{pdf:function(n,r){return r=r>1e100?1e100:r,1/(t.sqrt(r)*e.betafn(.5,r/2))*t.pow(1+n*n/r,-((r+1)/2))},cdf:function(n,r){var i=r/2;return e.ibeta((n+t.sqrt(n*n+r))/(2*t.sqrt(n*n+r)),i,i)},inv:function(n,r){var i=e.ibetainv(2*t.min(n,1-n),.5*r,.5);return i=t.sqrt(r*(1-i)/i),n>.5?i:-i},mean:function(e){return e>1?0:void 0},median:function(){return 0},mode:function(){return 0},sample:function(n){return e.randn()*t.sqrt(n/(2*e.randg(n/2)))},variance:function(e){return e>2?e/(e-2):e>1?1/0:void 0}}),e.extend(e.weibull,{pdf:function(e,n,r){return e<0||n<0||r<0?0:r/n*t.pow(e/n,r-1)*t.exp(-t.pow(e/n,r))},cdf:function(e,n,r){return e<0?0:1-t.exp(-t.pow(e/n,r))},inv:function(e,n,r){return n*t.pow(-t.log(1-e),1/r)},mean:function(t,n){return t*e.gammafn(1+1/n)},median:function(e,n){return e*t.pow(t.log(2),1/n)},mode:function(e,n){return n<=1?0:e*t.pow((n-1)/n,1/n)},sample:function(n,r){return n*t.pow(-t.log(e._random_fn()),1/r)},variance:function(n,r){return n*n*e.gammafn(1+2/r)-t.pow(e.weibull.mean(n,r),2)}}),e.extend(e.uniform,{pdf:function(e,t,n){return e<t||e>n?0:1/(n-t)},cdf:function(e,t,n){return e<t?0:e<n?(e-t)/(n-t):1},inv:function(e,t,n){return t+e*(n-t)},mean:function(e,t){return .5*(e+t)},median:function(t,n){return e.mean(t,n)},mode:function(){throw Error(`mode is not yet implemented`)},sample:function(t,n){return t/2+n/2+(n/2-t/2)*(2*e._random_fn()-1)},variance:function(e,n){return t.pow(n-e,2)/12}});function n(e,n,r,i){for(var a=0,o=1,s=1,c=1,l=0,u=0,d;t.abs((s-u)/s)>i;)u=s,d=-(n+l)*(n+r+l)*e/(n+2*l)/(n+2*l+1),a=s+d*a,o=c+d*o,l+=1,d=l*(r-l)*e/(n+2*l-1)/(n+2*l),s=a+d*s,c=o+d*c,a/=c,o/=c,s/=c,c=1;return s/n}e.extend(e.binomial,{pdf:function(n,r,i){return i===0||i===1?+(r*i===n):e.combination(r,n)*t.pow(i,n)*t.pow(1-i,r-n)},cdf:function(r,i,a){var o,s=1e-10;if(r<0)return 0;if(r>=i)return 1;if(a<0||a>1||i<=0)return NaN;r=t.floor(r);var c=a,l=r+1,u=i-r,d=l+u,f=t.exp(e.gammaln(d)-e.gammaln(u)-e.gammaln(l)+l*t.log(c)+u*t.log(1-c));return o=c<(l+1)/(d+2)?f*n(c,l,u,s):1-f*n(1-c,u,l,s),t.round((1-o)*(1/s))/(1/s)}}),e.extend(e.negbin,{pdf:function(n,r,i){return n===n>>>0?n<0?0:e.combination(n+r-1,r-1)*t.pow(1-i,n)*t.pow(i,r):!1},cdf:function(t,n,r){var i=0,a=0;if(t<0)return 0;for(;a<=t;a++)i+=e.negbin.pdf(a,n,r);return i}}),e.extend(e.hypgeom,{pdf:function(n,r,i,a){if(n!==n|0)return!1;if(n<0||n<i-(r-a)||n>a||n>i)return 0;if(i*2>r)return a*2>r?e.hypgeom.pdf(r-i-a+n,r,r-i,r-a):e.hypgeom.pdf(a-n,r,r-i,a);if(a*2>r)return e.hypgeom.pdf(i-n,r,i,r-a);if(i<a)return e.hypgeom.pdf(n,r,a,i);for(var o=1,s=0,c=0;c<n;c++){for(;o>1&&s<a;)o*=1-i/(r-s),s++;o*=(a-c)*(i-c)/((c+1)*(r-i-a+c+1))}for(;s<a;s++)o*=1-i/(r-s);return t.min(1,t.max(0,o))},cdf:function(n,r,i,a){if(n<0||n<i-(r-a))return 0;if(n>=a||n>=i)return 1;if(i*2>r)return a*2>r?e.hypgeom.cdf(r-i-a+n,r,r-i,r-a):1-e.hypgeom.cdf(a-n-1,r,r-i,a);if(a*2>r)return 1-e.hypgeom.cdf(i-n-1,r,i,r-a);if(i<a)return e.hypgeom.cdf(n,r,a,i);for(var o=1,s=1,c=0,l=0;l<n;l++){for(;o>1&&c<a;){var u=1-i/(r-c);s*=u,o*=u,c++}s*=(a-l)*(i-l)/((l+1)*(r-i-a+l+1)),o+=s}for(;c<a;c++)o*=1-i/(r-c);return t.min(1,t.max(0,o))}}),e.extend(e.poisson,{pdf:function(n,r){return r<0||n%1!=0||n<0?0:t.pow(r,n)*t.exp(-r)/e.factorial(n)},cdf:function(t,n){var r=[],i=0;if(t<0)return 0;for(;i<=t;i++)r.push(e.poisson.pdf(i,n));return e.sum(r)},mean:function(e){return e},variance:function(e){return e},sampleSmall:function(n){var r=1,i=0,a=t.exp(-n);do i++,r*=e._random_fn();while(r>a);return i-1},sampleLarge:function(n){var r=n,i,a,o,s=t.sqrt(r),c=t.log(r),l,u=.931+2.53*s,d,f,p;for(l=-.059+.02483*u,d=1.1239+1.1328/(u-3.4),f=.9277-3.6224/(u-2);;)if(a=t.random()-.5,o=t.random(),p=.5-t.abs(a),i=t.floor((2*l/p+u)*a+r+.43),p>=.07&&o<=f||!(i<0||p<.013&&o>p)&&t.log(o)+t.log(d)-t.log(l/(p*p)+u)<=-r+i*c-e.loggam(i+1))return i},sample:function(e){return e<10?this.sampleSmall(e):this.sampleLarge(e)}}),e.extend(e.triangular,{pdf:function(e,t,n,r){return n<=t||r<t||r>n?NaN:e<t||e>n?0:e<r?2*(e-t)/((n-t)*(r-t)):e===r?2/(n-t):2*(n-e)/((n-t)*(n-r))},cdf:function(e,n,r,i){return r<=n||i<n||i>r?NaN:e<=n?0:e>=r?1:e<=i?t.pow(e-n,2)/((r-n)*(i-n)):1-t.pow(r-e,2)/((r-n)*(r-i))},inv:function(e,n,r,i){return r<=n||i<n||i>r?NaN:e<=(i-n)/(r-n)?n+(r-n)*t.sqrt(e*((i-n)/(r-n))):n+(r-n)*(1-t.sqrt((1-e)*(1-(i-n)/(r-n))))},mean:function(e,t,n){return(e+t+n)/3},median:function(e,n,r){if(r<=(e+n)/2)return n-t.sqrt((n-e)*(n-r))/t.sqrt(2);if(r>(e+n)/2)return e+t.sqrt((n-e)*(r-e))/t.sqrt(2)},mode:function(e,t,n){return n},sample:function(n,r,i){var a=e._random_fn();return a<(i-n)/(r-n)?n+t.sqrt(a*(r-n)*(i-n)):r-t.sqrt((1-a)*(r-n)*(r-i))},variance:function(e,t,n){return(e*e+t*t+n*n-e*t-e*n-t*n)/18}}),e.extend(e.arcsine,{pdf:function(e,n,r){return r<=n?NaN:e<=n||e>=r?0:2/t.PI*t.pow(t.pow(r-n,2)-t.pow(2*e-n-r,2),-.5)},cdf:function(e,n,r){return e<n?0:e<r?2/t.PI*t.asin(t.sqrt((e-n)/(r-n))):1},inv:function(e,n,r){return n+(.5-.5*t.cos(t.PI*e))*(r-n)},mean:function(e,t){return t<=e?NaN:(e+t)/2},median:function(e,t){return t<=e?NaN:(e+t)/2},mode:function(){throw Error(`mode is not yet implemented`)},sample:function(n,r){return(n+r)/2+(r-n)/2*t.sin(2*t.PI*e.uniform.sample(0,1))},variance:function(e,n){return n<=e?NaN:t.pow(n-e,2)/8}});function r(e){return e/t.abs(e)}e.extend(e.laplace,{pdf:function(e,n,r){return r<=0?0:t.exp(-t.abs(e-n)/r)/(2*r)},cdf:function(e,n,r){return r<=0?0:e<n?.5*t.exp((e-n)/r):1-.5*t.exp(-(e-n)/r)},mean:function(e){return e},median:function(e){return e},mode:function(e){return e},variance:function(e,t){return 2*t*t},sample:function(n,i){var a=e._random_fn()-.5;return n-i*r(a)*t.log(1-2*t.abs(a))}});function i(n,r,i){var a=12,o=6,s=-30,c=-50,l=60,u=8,d=3,f=2,p=3,m=[.9815606342467192,.9041172563704749,.7699026741943047,.5873179542866175,.3678314989981802,.1252334085114689],h=[.04717533638651183,.10693932599531843,.16007832854334622,.20316742672306592,.2334925365383548,.24914704581340277],g=n*.5;if(g>=u)return 1;var _=2*e.normal.cdf(g,0,1,1,0)-1;_=_>=t.exp(c/i)?t.pow(_,i):0;for(var v=n>d?f:p,y=g,b=(u-g)/v,x=y+b,S=0,C=i-1,w=1;w<=v;w++){for(var T=0,ee=.5*(x+y),E=.5*(x-y),D=1;D<=a;D++){var te,ne;o<D?(te=a-D+1,ne=m[te-1]):(te=D,ne=-m[te-1]);var re=ee+E*ne,ie=re*re;if(ie>l)break;var ae=2*e.normal.cdf(re,0,1,1,0),oe=2*e.normal.cdf(re,n,1,1,0),se=ae*.5-oe*.5;se>=t.exp(s/C)&&(se=h[te-1]*t.exp(-(.5*ie))*t.pow(se,C),T+=se)}T*=2*E*i/t.sqrt(2*t.PI),S+=T,y=x,x+=b}return _+=S,_<=t.exp(s/r)?0:(_=t.pow(_,r),_>=1?1:_)}function a(e,n,r){var i=.322232421088,a=.099348462606,o=-1,s=.588581570495,c=-.342242088547,l=.531103462366,u=-.204231210125,d=.10353775285,f=-453642210148e-16,p=.0038560700634,m=.8832,h=.2368,g=1.214,_=1.208,v=1.4142,y=120,b=.5-.5*e,x=t.sqrt(t.log(1/(b*b))),S=x+((((x*f+u)*x+c)*x+o)*x+i)/((((x*p+d)*x+l)*x+s)*x+a);r<y&&(S+=(S*S*S+S)/r/4);var C=m-h*S;return r<y&&(C+=-g/r+_*S/r),S*(C*t.log(n-1)+v)}e.extend(e.tukey,{cdf:function(n,r,a){var o=1,s=r,c=16,l=8,u=-30,d=1e-14,f=100,p=800,m=5e3,h=25e3,g=1,_=.5,v=.25,y=.125,b=[.9894009349916499,.9445750230732326,.8656312023878318,.755404408355003,.6178762444026438,.45801677765722737,.2816035507792589,.09501250983763744],x=[.027152459411754096,.062253523938647894,.09515851168249279,.12462897125553388,.14959598881657674,.16915651939500254,.18260341504492358,.1894506104550685];if(n<=0)return 0;if(a<2||o<1||s<2)return NaN;if(!Number.isFinite(n))return 1;if(a>h)return i(n,o,s);var S=a*.5,C=S*t.log(a)-a*t.log(2)-e.gammaln(S),w=S-1,T=a*.25,ee=a<=f?g:a<=p?_:a<=m?v:y;C+=t.log(ee);for(var E=0,D=1;D<=50;D++){for(var te=0,ne=(2*D-1)*ee,re=1;re<=c;re++){var ie,ae;l<re?(ie=re-l-1,ae=C+w*t.log(ne+b[ie]*ee)-(b[ie]*ee+ne)*T):(ie=re-1,ae=C+w*t.log(ne-b[ie]*ee)+(b[ie]*ee-ne)*T);var oe;if(ae>=u){oe=l<re?n*t.sqrt((b[ie]*ee+ne)*.5):n*t.sqrt((-(b[ie]*ee)+ne)*.5);var se=i(oe,o,s)*x[ie]*t.exp(ae);te+=se}}if(D*ee>=1&&te<=d)break;E+=te}if(te>d)throw Error(`tukey.cdf failed to converge`);return E>1&&(E=1),E},inv:function(n,r,i){var o=1,s=r,c=1e-4,l=50;if(i<2||o<1||s<2||n<0||n>1)return NaN;if(n===0)return 0;if(n===1)return 1/0;for(var u=a(n,s,i),d=e.tukey.cdf(u,r,i)-n,f=d>0?t.max(0,u-1):u+1,p=e.tukey.cdf(f,r,i)-n,m,h=1;h<l;h++)if(m=f-p*(f-u)/(p-d),d=p,u=f,m<0&&(m=0,p=-n),p=e.tukey.cdf(m,r,i)-n,f=m,t.abs(f-u)<c)return m;throw Error(`tukey.inv failed to converge`)}})})(e,Math),(function(e,t){var n=Array.prototype.push,r=e.utils.isArray;function i(t){return r(t)||t instanceof e}e.extend({add:function(t,n){return i(n)?(i(n[0])||(n=[n]),e.map(t,function(e,t,r){return e+n[t][r]})):e.map(t,function(e){return e+n})},subtract:function(t,n){return i(n)?(i(n[0])||(n=[n]),e.map(t,function(e,t,r){return e-n[t][r]||0})):e.map(t,function(e){return e-n})},divide:function(t,n){return i(n)?(i(n[0])||(n=[n]),e.multiply(t,e.inv(n))):e.map(t,function(e){return e/n})},multiply:function(t,n){var r,a,o,s,c,l,u,d;if(t.length===void 0&&n.length===void 0)return t*n;if(c=t.length,l=t[0].length,u=e.zeros(c,o=i(n)?n[0].length:l),d=0,i(n)){for(;d<o;d++)for(r=0;r<c;r++){for(s=0,a=0;a<l;a++)s+=t[r][a]*n[a][d];u[r][d]=s}return c===1&&d===1?u[0][0]:u}return e.map(t,function(e){return e*n})},outer:function(t,n){return e.multiply(t.map(function(e){return[e]}),[n])},dot:function(t,n){i(t[0])||(t=[t]),i(n[0])||(n=[n]);for(var r=t[0].length===1&&t.length!==1?e.transpose(t):t,a=n[0].length===1&&n.length!==1?e.transpose(n):n,o=[],s=0,c=r.length,l=r[0].length,u,d;s<c;s++){for(o[s]=[],u=0,d=0;d<l;d++)u+=r[s][d]*a[s][d];o[s]=u}return o.length===1?o[0]:o},pow:function(n,r){return e.map(n,function(e){return t.pow(e,r)})},exp:function(n){return e.map(n,function(e){return t.exp(e)})},log:function(n){return e.map(n,function(e){return t.log(e)})},abs:function(n){return e.map(n,function(e){return t.abs(e)})},norm:function(e,n){var r=0,a=0;for(isNaN(n)&&(n=2),i(e[0])&&(e=e[0]);a<e.length;a++)r+=t.pow(t.abs(e[a]),n);return t.pow(r,1/n)},angle:function(n,r){return t.acos(e.dot(n,r)/(e.norm(n)*e.norm(r)))},aug:function(e,t){for(var r=[],i=0;i<e.length;i++)r.push(e[i].slice());for(i=0;i<r.length;i++)n.apply(r[i],t[i]);return r},inv:function(t){for(var n=t.length,r=t[0].length,i=e.identity(n,r),a=e.gauss_jordan(t,i),o=[],s=0,c;s<n;s++)for(o[s]=[],c=r;c<a[0].length;c++)o[s][c-r]=a[s][c];return o},det:function e(t){if(t.length===2)return t[0][0]*t[1][1]-t[0][1]*t[1][0];for(var n=0,r=0;r<t.length;r++){for(var i=[],a=1;a<t.length;a++){i[a-1]=[];for(var o=0;o<t.length;o++)o<r?i[a-1][o]=t[a][o]:o>r&&(i[a-1][o-1]=t[a][o])}var s=r%2?-1:1;n+=e(i)*t[0][r]*s}return n},gauss_elimination:function(n,r){var i=0,a=0,o=n.length,s=n[0].length,c=1,l=0,u=[],d,f,p,m;for(n=e.aug(n,r),d=n[0].length,i=0;i<o;i++){for(f=n[i][i],a=i,m=i+1;m<s;m++)f<t.abs(n[m][i])&&(f=n[m][i],a=m);if(a!=i)for(m=0;m<d;m++)p=n[i][m],n[i][m]=n[a][m],n[a][m]=p;for(a=i+1;a<o;a++)for(c=n[a][i]/n[i][i],m=i;m<d;m++)n[a][m]=n[a][m]-c*n[i][m]}for(i=o-1;i>=0;i--){for(l=0,a=i+1;a<=o-1;a++)l+=u[a]*n[i][a];u[i]=(n[i][d-1]-l)/n[i][i]}return u},gauss_jordan:function(n,r){for(var i=e.aug(n,r),a=i.length,o=i[0].length,s=0,c,l=0,u;l<a;l++){var d=l;for(u=l+1;u<a;u++)t.abs(i[u][l])>t.abs(i[d][l])&&(d=u);var f=i[l];for(i[l]=i[d],i[d]=f,u=l+1;u<a;u++)for(s=i[u][l]/i[l][l],c=l;c<o;c++)i[u][c]-=i[l][c]*s}for(l=a-1;l>=0;l--){for(s=i[l][l],u=0;u<l;u++)for(c=o-1;c>l-1;c--)i[u][c]-=i[l][c]*i[u][l]/s;for(i[l][l]/=s,c=a;c<o;c++)i[l][c]/=s}return i},triaUpSolve:function(t,n){var r=t[0].length,i=e.zeros(1,r)[0],a,o=!1;return n[0].length!=null&&(n=n.map(function(e){return e[0]}),o=!0),e.arange(r-1,-1,-1).forEach(function(o){a=e.arange(o+1,r).map(function(e){return i[e]*t[o][e]}),i[o]=(n[o]-e.sum(a))/t[o][o]}),o?i.map(function(e){return[e]}):i},triaLowSolve:function(t,n){var r=t[0].length,i=e.zeros(1,r)[0],a,o=!1;return n[0].length!=null&&(n=n.map(function(e){return e[0]}),o=!0),e.arange(r).forEach(function(r){a=e.arange(r).map(function(e){return t[r][e]*i[e]}),i[r]=(n[r]-e.sum(a))/t[r][r]}),o?i.map(function(e){return[e]}):i},lu:function(t){var n=t.length,r=e.identity(n),i=e.zeros(t.length,t[0].length),a;return e.arange(n).forEach(function(e){i[0][e]=t[0][e]}),e.arange(1,n).forEach(function(o){e.arange(o).forEach(function(n){a=e.arange(n).map(function(e){return r[o][e]*i[e][n]}),r[o][n]=(t[o][n]-e.sum(a))/i[n][n]}),e.arange(o,n).forEach(function(n){a=e.arange(o).map(function(e){return r[o][e]*i[e][n]}),i[o][n]=t[a.length][n]-e.sum(a)})}),[r,i]},cholesky:function(n){var r=n.length,i=e.zeros(n.length,n[0].length),a;return e.arange(r).forEach(function(o){a=e.arange(o).map(function(e){return t.pow(i[o][e],2)}),i[o][o]=t.sqrt(n[o][o]-e.sum(a)),e.arange(o+1,r).forEach(function(t){a=e.arange(o).map(function(e){return i[o][e]*i[t][e]}),i[t][o]=(n[o][t]-e.sum(a))/i[o][o]})}),i},gauss_jacobi:function(n,r,i,a){for(var o=0,s=0,c=n.length,l=[],u=[],d=[],f,p,m,h;o<c;o++)for(l[o]=[],u[o]=[],d[o]=[],s=0;s<c;s++)o>s?(l[o][s]=n[o][s],u[o][s]=d[o][s]=0):o<s?(u[o][s]=n[o][s],l[o][s]=d[o][s]=0):(d[o][s]=n[o][s],l[o][s]=u[o][s]=0);for(m=e.multiply(e.multiply(e.inv(d),e.add(l,u)),-1),p=e.multiply(e.inv(d),r),f=i,h=e.add(e.multiply(m,i),p),o=2;t.abs(e.norm(e.subtract(h,f)))>a;)f=h,h=e.add(e.multiply(m,f),p),o++;return h},gauss_seidel:function(n,r,i,a){for(var o=0,s=n.length,c=[],l=[],u=[],d,f,p,m,h;o<s;o++)for(c[o]=[],l[o]=[],u[o]=[],d=0;d<s;d++)o>d?(c[o][d]=n[o][d],l[o][d]=u[o][d]=0):o<d?(l[o][d]=n[o][d],c[o][d]=u[o][d]=0):(u[o][d]=n[o][d],c[o][d]=l[o][d]=0);for(m=e.multiply(e.multiply(e.inv(e.add(u,c)),l),-1),p=e.multiply(e.inv(e.add(u,c)),r),f=i,h=e.add(e.multiply(m,i),p),o=2;t.abs(e.norm(e.subtract(h,f)))>a;)f=h,h=e.add(e.multiply(m,f),p),o+=1;return h},SOR:function(n,r,i,a,o){for(var s=0,c=n.length,l=[],u=[],d=[],f,p,m,h,g;s<c;s++)for(l[s]=[],u[s]=[],d[s]=[],f=0;f<c;f++)s>f?(l[s][f]=n[s][f],u[s][f]=d[s][f]=0):s<f?(u[s][f]=n[s][f],l[s][f]=d[s][f]=0):(d[s][f]=n[s][f],l[s][f]=u[s][f]=0);for(h=e.multiply(e.inv(e.add(d,e.multiply(l,o))),e.subtract(e.multiply(d,1-o),e.multiply(u,o))),m=e.multiply(e.multiply(e.inv(e.add(d,e.multiply(l,o))),r),o),p=i,g=e.add(e.multiply(h,i),m),s=2;t.abs(e.norm(e.subtract(g,p)))>a;)p=g,g=e.add(e.multiply(h,p),m),s++;return g},householder:function(n){for(var r=n.length,i=n[0].length,a=0,o=[],s=[],c,l,u,d,f;a<r-1;a++){for(c=0,d=a+1;d<i;d++)c+=n[d][a]*n[d][a];for(f=n[a+1][a]>0?-1:1,c=f*t.sqrt(c),l=t.sqrt((c*c-n[a+1][a]*c)/2),o=e.zeros(r,1),o[a+1][0]=(n[a+1][a]-c)/(2*l),u=a+2;u<r;u++)o[u][0]=n[u][a]/(2*l);s=e.subtract(e.identity(r,i),e.multiply(e.multiply(o,e.transpose(o)),2)),n=e.multiply(s,e.multiply(n,s))}return n},QR:function(){var n=e.sum,r=e.arange;function i(i){var a=i.length,o=i[0].length,s=e.zeros(o,o);i=e.copy(i);for(var c,l=0,u;l<o;l++){for(s[l][l]=t.sqrt(n(r(a).map(function(e){return i[e][l]*i[e][l]}))),c=0;c<a;c++)i[c][l]=i[c][l]/s[l][l];for(u=l+1;u<o;u++)for(s[l][u]=n(r(a).map(function(e){return i[e][l]*i[e][u]})),c=0;c<a;c++)i[c][u]=i[c][u]-i[c][l]*s[l][u]}return[i,s]}return i}(),lstsq:function(){function t(t){t=e.copy(t);var n=t.length,r=e.identity(n);return e.arange(n-1,-1,-1).forEach(function(n){e.sliceAssign(r,{row:n},e.divide(e.slice(r,{row:n}),t[n][n])),e.sliceAssign(t,{row:n},e.divide(e.slice(t,{row:n}),t[n][n])),e.arange(n).forEach(function(i){var a=e.multiply(t[i][n],-1),o=e.slice(t,{row:i}),s=e.multiply(e.slice(t,{row:n}),a);e.sliceAssign(t,{row:i},e.add(o,s));var c=e.slice(r,{row:i}),l=e.multiply(e.slice(r,{row:n}),a);e.sliceAssign(r,{row:i},e.add(c,l))})}),r}function n(n,r){var i=!1;r[0].length===void 0&&(r=r.map(function(e){return[e]}),i=!0);var a=e.QR(n),o=a[0],s=a[1],c=n[0].length,l=e.slice(o,{col:{end:c}}),u=t(e.slice(s,{row:{end:c}})),d=e.transpose(l);d[0].length===void 0&&(d=[d]);var f=e.multiply(e.multiply(u,d),r);return f.length===void 0&&(f=[[f]]),i?f.map(function(e){return e[0]}):f}return n}(),jacobi:function(n){for(var r=1,i=n.length,a=e.identity(i,i),o=[],s,c,l,u,d,f,p,m;r===1;){for(f=n[0][1],u=0,d=1,c=0;c<i;c++)for(l=0;l<i;l++)c!=l&&f<t.abs(n[c][l])&&(f=t.abs(n[c][l]),u=c,d=l);for(p=n[u][u]===n[d][d]?n[u][d]>0?t.PI/4:-t.PI/4:t.atan(2*n[u][d]/(n[u][u]-n[d][d]))/2,m=e.identity(i,i),m[u][u]=t.cos(p),m[u][d]=-t.sin(p),m[d][u]=t.sin(p),m[d][d]=t.cos(p),a=e.multiply(a,m),s=e.multiply(e.multiply(e.inv(m),n),m),n=s,r=0,c=1;c<i;c++)for(l=1;l<i;l++)c!=l&&t.abs(n[c][l])>.001&&(r=1)}for(c=0;c<i;c++)o.push(n[c][c]);return[a,o]},rungekutta:function(e,t,n,r,i,a){var o,s,c,l,u;if(a===2)for(;r<=n;)o=t*e(r,i),s=t*e(r+t,i+o),c=i+(o+s)/2,i=c,r+=t;if(a===4)for(;r<=n;)o=t*e(r,i),s=t*e(r+t/2,i+o/2),l=t*e(r+t/2,i+s/2),u=t*e(r+t,i+l),c=i+(o+2*s+2*l+u)/6,i=c,r+=t;return i},romberg:function(e,n,r,i){for(var a=0,o=(r-n)/2,s=[],c=[],l=[],u,d,f,p,m;a<i/2;){for(m=e(n),f=n,p=0;f<=r;f+=o,p++)s[p]=f;for(u=s.length,f=1;f<u-1;f++)m+=(f%2==0?2:4)*e(s[f]);m=o/3*(m+e(r)),l[a]=m,o/=2,a++}for(d=l.length,u=1;d!==1;){for(f=0;f<d-1;f++)c[f]=(t.pow(4,u)*l[f+1]-l[f])/(t.pow(4,u)-1);d=c.length,l=c,c=[],u++}return l},richardson:function(e,n,r,i){function a(e,t){for(var n=0,r=e.length,i;n<r;n++)e[n]===t&&(i=n);return i}for(var o=t.abs(r-e[a(e,r)+1]),s=0,c=[],l=[],u,d,f,p,m;i>=o;)u=a(e,r+i),d=a(e,r),c[s]=(n[u]-2*n[d]+n[2*d-u])/(i*i),i/=2,s++;for(p=c.length,f=1;p!=1;){for(m=0;m<p-1;m++)l[m]=(t.pow(4,f)*c[m+1]-c[m])/(t.pow(4,f)-1);p=l.length,c=l,l=[],f++}return c},simpson:function(e,t,n,r){for(var i=(n-t)/r,a=e(t),o=[],s=t,c=0,l=1,u;s<=n;s+=i,c++)o[c]=s;for(u=o.length;l<u-1;l++)a+=(l%2==0?2:4)*e(o[l]);return i/3*(a+e(n))},hermite:function(e,t,n,r){for(var i=e.length,a=0,o=0,s=[],c=[],l=[],u=[],d;o<i;o++){for(s[o]=1,d=0;d<i;d++)o!=d&&(s[o]*=(r-e[d])/(e[o]-e[d]));for(c[o]=0,d=0;d<i;d++)o!=d&&(c[o]+=1/(e[o]-e[d]));l[o]=(1-2*(r-e[o])*c[o])*(s[o]*s[o]),u[o]=(r-e[o])*(s[o]*s[o]),a+=l[o]*t[o]+u[o]*n[o]}return a},lagrange:function(e,t,n){for(var r=0,i=0,a,o,s=e.length;i<s;i++){for(o=t[i],a=0;a<s;a++)i!=a&&(o*=(n-e[a])/(e[i]-e[a]));r+=o}return r},cubic_spline:function(t,n,r){for(var i=t.length,a=0,o,s=[],c=[],l=[],u=[],d=[],f=[],p=[];a<i-1;a++)d[a]=t[a+1]-t[a];for(l[0]=0,a=1;a<i-1;a++)l[a]=3/d[a]*(n[a+1]-n[a])-3/d[a-1]*(n[a]-n[a-1]);for(a=1;a<i-1;a++)s[a]=[],c[a]=[],s[a][a-1]=d[a-1],s[a][a]=2*(d[a-1]+d[a]),s[a][a+1]=d[a],c[a][0]=l[a];for(u=e.multiply(e.inv(s),c),o=0;o<i-1;o++)f[o]=(n[o+1]-n[o])/d[o]-d[o]*(u[o+1][0]+2*u[o][0])/3,p[o]=(u[o+1][0]-u[o][0])/(3*d[o]);for(o=0;o<i&&!(t[o]>r);o++);return--o,n[o]+(r-t[o])*f[o]+e.sq(r-t[o])*u[o]+(r-t[o])*e.sq(r-t[o])*p[o]},gauss_quadrature:function(){throw Error(`gauss_quadrature not yet implemented`)},PCA:function(t){var n=t.length,r=t[0].length,i=0,a,o,s=[],c=[],l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=[];for(i=0;i<n;i++)s[i]=e.sum(t[i])/r;for(i=0;i<r;i++)for(p[i]=[],a=0;a<n;a++)p[i][a]=t[a][i]-s[a];for(p=e.transpose(p),i=0;i<n;i++)for(m[i]=[],a=0;a<n;a++)m[i][a]=e.dot([p[i]],[p[a]])/(r-1);for(l=e.jacobi(m),h=l[0],c=l[1],g=e.transpose(h),i=0;i<c.length;i++)for(a=i;a<c.length;a++)c[i]<c[a]&&(o=c[i],c[i]=c[a],c[a]=o,u=g[i],g[i]=g[a],g[a]=u);for(f=e.transpose(p),i=0;i<n;i++)for(d[i]=[],a=0;a<f.length;a++)d[i][a]=e.dot([g[i]],[f[a]]);return[t,c,g,d]}}),(function(t){for(var n=0;n<t.length;n++)(function(t){e.fn[t]=function(n,r){var i=this;return r?(setTimeout(function(){r.call(i,e.fn[t].call(i,n))},15),this):typeof e[t](this,n)==`number`?e[t](this,n):e(e[t](this,n))}})(t[n])})(`add divide multiply subtract dot pow exp log abs norm angle`.split(` `))})(e,Math),(function(e,t){var n=[].slice,r=e.utils.isNumber,i=e.utils.isArray;e.extend({zscore:function(){var t=n.call(arguments);return r(t[1])?(t[0]-t[1])/t[2]:(t[0]-e.mean(t[1]))/e.stdev(t[1],t[2])},ztest:function(){var r=n.call(arguments),a;return i(r[1])?(a=e.zscore(r[0],r[1],r[3]),r[2]===1?e.normal.cdf(-t.abs(a),0,1):e.normal.cdf(-t.abs(a),0,1)*2):r.length>2?(a=e.zscore(r[0],r[1],r[2]),r[3]===1?e.normal.cdf(-t.abs(a),0,1):e.normal.cdf(-t.abs(a),0,1)*2):(a=r[0],r[1]===1?e.normal.cdf(-t.abs(a),0,1):e.normal.cdf(-t.abs(a),0,1)*2)}}),e.extend(e.fn,{zscore:function(e,t){return(e-this.mean())/this.stdev(t)},ztest:function(n,r,i){var a=t.abs(this.zscore(n,i));return r===1?e.normal.cdf(-a,0,1):e.normal.cdf(-a,0,1)*2}}),e.extend({tscore:function(){var r=n.call(arguments);return r.length===4?(r[0]-r[1])/(r[2]/t.sqrt(r[3])):(r[0]-e.mean(r[1]))/(e.stdev(r[1],!0)/t.sqrt(r[1].length))},ttest:function(){var i=n.call(arguments),a;return i.length===5?(a=t.abs(e.tscore(i[0],i[1],i[2],i[3])),i[4]===1?e.studentt.cdf(-a,i[3]-1):e.studentt.cdf(-a,i[3]-1)*2):r(i[1])?(a=t.abs(i[0]),i[2]==1?e.studentt.cdf(-a,i[1]-1):e.studentt.cdf(-a,i[1]-1)*2):(a=t.abs(e.tscore(i[0],i[1])),i[2]==1?e.studentt.cdf(-a,i[1].length-1):e.studentt.cdf(-a,i[1].length-1)*2)}}),e.extend(e.fn,{tscore:function(e){return(e-this.mean())/(this.stdev(!0)/t.sqrt(this.cols()))},ttest:function(n,r){return r===1?1-e.studentt.cdf(t.abs(this.tscore(n)),this.cols()-1):e.studentt.cdf(-t.abs(this.tscore(n)),this.cols()-1)*2}}),e.extend({anovafscore:function(){var r=n.call(arguments),i,a,o,s,c,l,u,d;if(r.length===1){for(c=Array(r[0].length),u=0;u<r[0].length;u++)c[u]=r[0][u];r=c}for(a=[],u=0;u<r.length;u++)a=a.concat(r[u]);for(o=e.mean(a),i=0,u=0;u<r.length;u++)i+=r[u].length*t.pow(e.mean(r[u])-o,2);for(i/=r.length-1,l=0,u=0;u<r.length;u++)for(s=e.mean(r[u]),d=0;d<r[u].length;d++)l+=t.pow(r[u][d]-s,2);return l/=a.length-r.length,i/l},anovaftest:function(){var t=n.call(arguments),i,a,o,s;if(r(t[0]))return 1-e.centralF.cdf(t[0],t[1],t[2]);var c=e.anovafscore(t);for(i=t.length-1,o=0,s=0;s<t.length;s++)o+=t[s].length;return a=o-i-1,1-e.centralF.cdf(c,i,a)},ftest:function(t,n,r){return 1-e.centralF.cdf(t,n,r)}}),e.extend(e.fn,{anovafscore:function(){return e.anovafscore(this.toArray())},anovaftes:function(){for(var t=0,n=0;n<this.length;n++)t+=this[n].length;return e.ftest(this.anovafscore(),this.length-1,t-this.length)}}),e.extend({qscore:function(){var i=n.call(arguments),a,o,s,c,l;return r(i[0])?(a=i[0],o=i[1],s=i[2],c=i[3],l=i[4]):(a=e.mean(i[0]),o=e.mean(i[1]),s=i[0].length,c=i[1].length,l=i[2]),t.abs(a-o)/(l*t.sqrt((1/s+1/c)/2))},qtest:function(){var t=n.call(arguments),r;t.length===3?(r=t[0],t=t.slice(1)):t.length===7?(r=e.qscore(t[0],t[1],t[2],t[3],t[4]),t=t.slice(5)):(r=e.qscore(t[0],t[1],t[2]),t=t.slice(3));var i=t[0],a=t[1];return 1-e.tukey.cdf(r,a,i-a)},tukeyhsd:function(t){for(var n=e.pooledstdev(t),r=t.map(function(t){return e.mean(t)}),i=t.reduce(function(e,t){return e+t.length},0),a=[],o=0;o<t.length;++o)for(var s=o+1;s<t.length;++s){var c=e.qtest(r[o],r[s],t[o].length,t[s].length,n,i,t.length);a.push([[o,s],c])}return a}}),e.extend({normalci:function(){var r=n.call(arguments),i=[,,],a=r.length===4?t.abs(e.normal.inv(r[1]/2,0,1)*r[2]/t.sqrt(r[3])):t.abs(e.normal.inv(r[1]/2,0,1)*e.stdev(r[2])/t.sqrt(r[2].length));return i[0]=r[0]-a,i[1]=r[0]+a,i},tci:function(){var r=n.call(arguments),i=[,,],a=r.length===4?t.abs(e.studentt.inv(r[1]/2,r[3]-1)*r[2]/t.sqrt(r[3])):t.abs(e.studentt.inv(r[1]/2,r[2].length-1)*e.stdev(r[2],!0)/t.sqrt(r[2].length));return i[0]=r[0]-a,i[1]=r[0]+a,i},significant:function(e,t){return e<t}}),e.extend(e.fn,{normalci:function(t,n){return e.normalci(t,n,this.toArray())},tci:function(t,n){return e.tci(t,n,this.toArray())}});function a(e,n,r,i){if(e>1||r>1||e<=0||r<=0)throw Error(`Proportions should be greater than 0 and less than 1`);var a=(e*n+r*i)/(n+i),o=t.sqrt(a*(1-a)*(1/n+1/i));return(e-r)/o}e.extend(e.fn,{oneSidedDifferenceOfProportions:function(t,n,r,i){var o=a(t,n,r,i);return e.ztest(o,1)},twoSidedDifferenceOfProportions:function(t,n,r,i){var o=a(t,n,r,i);return e.ztest(o,2)}})})(e,Math),e.models=(function(){function t(t){var r=t[0].length;return e.arange(r).map(function(i){var a=e.arange(r).filter(function(e){return e!==i});return n(e.col(t,i).map(function(e){return e[0]}),e.col(t,a))})}function n(t,n){var r=t.length,i=n[0].length-1,a=r-i-1,o=e.lstsq(n,t),s=e.multiply(n,o.map(function(e){return[e]})).map(function(e){return e[0]}),c=e.subtract(t,s),l=e.mean(t),u=e.sum(s.map(function(e){return(e-l)**2})),d=e.sum(t.map(function(e,t){return(e-s[t])**2})),f=u+d;return{exog:n,endog:t,nobs:r,df_model:i,df_resid:a,coef:o,predict:s,resid:c,ybar:l,SST:f,SSE:u,SSR:d,R2:u/f}}function r(n){var r=t(n.exog),i=Math.sqrt(n.SSR/n.df_resid),a=r.map(function(e){var t=e.SST,n=e.R2;return i/Math.sqrt(t*(1-n))}),o=n.coef.map(function(e,t){return(e-0)/a[t]}),s=o.map(function(t){var r=e.studentt.cdf(t,n.df_resid);return(r>.5?1-r:r)*2}),c=e.studentt.inv(.975,n.df_resid);return{se:a,t:o,p:s,sigmaHat:i,interval95:n.coef.map(function(e,t){var n=c*a[t];return[e-n,e+n]})}}function i(t){var n=t.R2/t.df_model/((1-t.R2)/t.df_resid);return{F_statistic:n,pvalue:1-function(t,n,r){return e.beta.cdf(t/(r/n+t),n/2,r/2)}(n,t.df_model,t.df_resid)}}function a(e,t){var a=n(e,t),o=r(a),s=i(a),c=1-(1-a.R2)*((a.nobs-1)/a.df_resid);return a.t=o,a.f=s,a.adjust_R2=c,a}return{ols:a}})(),e.extend({buildxmatrix:function(){for(var t=Array(arguments.length),n=0;n<arguments.length;n++)t[n]=[1].concat(arguments[n]);return e(t)},builddxmatrix:function(){for(var t=Array(arguments[0].length),n=0;n<arguments[0].length;n++)t[n]=[1].concat(arguments[0][n]);return e(t)},buildjxmatrix:function(t){for(var n=Array(t.length),r=0;r<t.length;r++)n[r]=t[r];return e.builddxmatrix(n)},buildymatrix:function(t){return e(t).transpose()},buildjymatrix:function(e){return e.transpose()},matrixmult:function(t,n){var r,i,a,o,s;if(t.cols()==n.rows()){if(n.rows()>1){for(o=[],r=0;r<t.rows();r++)for(o[r]=[],i=0;i<n.cols();i++){for(s=0,a=0;a<t.cols();a++)s+=t.toArray()[r][a]*n.toArray()[a][i];o[r][i]=s}return e(o)}for(o=[],r=0;r<t.rows();r++)for(o[r]=[],i=0;i<n.cols();i++){for(s=0,a=0;a<t.cols();a++)s+=t.toArray()[r][a]*n.toArray()[i];o[r][i]=s}return e(o)}},regress:function(t,n){var r=e.xtranspxinv(t),i=t.transpose(),a=e.matrixmult(e(r),i);return e.matrixmult(a,n)},regresst:function(t,n,r){var i=e.regress(t,n),a={};a.anova={};var o=e.jMatYBar(t,i);a.yBar=o;var s=n.mean();a.anova.residuals=e.residuals(n,o),a.anova.ssr=e.ssr(o,s),a.anova.msr=a.anova.ssr/(t[0].length-1),a.anova.sse=e.sse(n,o),a.anova.mse=a.anova.sse/(n.length-(t[0].length-1)-1),a.anova.sst=e.sst(n,s),a.anova.mst=a.anova.sst/(n.length-1),a.anova.r2=1-a.anova.sse/a.anova.sst,a.anova.r2<0&&(a.anova.r2=0),a.anova.fratio=a.anova.msr/a.anova.mse,a.anova.pvalue=e.anovaftest(a.anova.fratio,t[0].length-1,n.length-(t[0].length-1)-1),a.anova.rmse=Math.sqrt(a.anova.mse),a.anova.r2adj=1-a.anova.mse/a.anova.mst,a.anova.r2adj<0&&(a.anova.r2adj=0),a.stats=Array(t[0].length);for(var c=e.xtranspxinv(t),l,u,d,f=0;f<i.length;f++)l=Math.sqrt(a.anova.mse*Math.abs(c[f][f])),u=Math.abs(i[f]/l),d=e.ttest(u,n.length-t[0].length-1,r),a.stats[f]=[i[f],l,u,d];return a.regress=i,a},xtranspx:function(t){return e.matrixmult(t.transpose(),t)},xtranspxinv:function(t){var n=e.matrixmult(t.transpose(),t);return e.inv(n)},jMatYBar:function(t,n){return new e(e.matrixmult(t,n))},residuals:function(t,n){return e.matrixsubtract(t,n)},ssr:function(e,t){for(var n=0,r=0;r<e.length;r++)n+=(e[r]-t)**2;return n},sse:function(e,t){for(var n=0,r=0;r<e.length;r++)n+=(e[r]-t[r])**2;return n},sst:function(e,t){for(var n=0,r=0;r<e.length;r++)n+=(e[r]-t)**2;return n},matrixsubtract:function(t,n){for(var r=Array(t.length),i=0;i<t.length;i++){r[i]=Array(t[i].length);for(var a=0;a<t[i].length;a++)r[i][a]=t[i][a]-n[i][a]}return e(r)}}),e.jStat=e,e})})),Kp=n((e=>{(function(t){typeof DO_NOT_EXPORT_BESSEL>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.0.2`;var t=Math;function n(e,t){for(var n=0,r=0;n<e.length;++n)r=t*r+e[n];return r}function r(e,t,n,r,i){if(t===0)return n;if(t===1)return r;for(var a=2/e,o=r,s=1;s<t;++s)o=r*s*a+i*n,n=r,r=o;return o}function i(e,t,n,i,a){return function(n,o){if(i){if(n===0)return i==1?-1/0:1/0;if(n<0)return NaN}if(o===0)return e(n);if(o===1)return t(n);if(o<0)return NaN;o|=0;var s=e(n),c=t(n);return r(n,o,s,c,a)}}var a=(function(){var e=.636619772,i=[57568490574,-13362590354,651619640.7,-11214424.18,77392.33017,-184.9052456].reverse(),a=[57568490411,1029532985,9494680.718,59272.64853,267.8532712,1].reverse(),o=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),s=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34935152e-8].reverse();function c(r){var c=0,l=0,u=0,d=r*r;if(r<8)l=n(i,d),u=n(a,d),c=l/u;else{var f=r-.785398164;d=64/d,l=n(o,d),u=n(s,d),c=t.sqrt(e/r)*(t.cos(f)*l-t.sin(f)*u*8/r)}return c}var l=[72362614232,-7895059235,242396853.1,-2972611.439,15704.4826,-30.16036606].reverse(),u=[144725228442,2300535178,18583304.74,99447.43394,376.9991397,1].reverse(),d=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),f=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function p(r){var i=0,a=0,o=0,s=r*r,c=t.abs(r)-2.356194491;return Math.abs(r)<8?(a=r*n(l,s),o=n(u,s),i=a/o):(s=64/s,a=n(d,s),o=n(f,s),i=t.sqrt(e/t.abs(r))*(t.cos(c)*a-t.sin(c)*o*8/t.abs(r)),r<0&&(i=-i)),i}return function e(n,i){if(i=Math.round(i),!isFinite(n))return isNaN(n)?n:0;if(i<0)return(i%2?-1:1)*e(n,-i);if(n<0)return(i%2?-1:1)*e(-n,i);if(i===0)return c(n);if(i===1)return p(n);if(n===0)return 0;var a=0;if(n>i)a=r(n,i,c(n),p(n),-1);else{for(var o=2*t.floor((i+t.floor(t.sqrt(40*i)))/2),s=!1,l=0,u=0,d=1,f=0,m=2/n,h=o;h>0;h--)f=h*m*d-l,l=d,d=f,t.abs(d)>1e10&&(d*=1e-10,l*=1e-10,a*=1e-10,u*=1e-10),s&&(u+=d),s=!s,h==i&&(a=l);u=2*u-d,a/=u}return a}})(),o=(function(){var e=.636619772,r=[-2957821389,7062834065,-512359803.6,10879881.29,-86327.92757,228.4622733].reverse(),o=[40076544269,745249964.8,7189466.438,47447.2647,226.1030244,1].reverse(),s=[1,-.001098628627,2734510407e-14,-2073370639e-15,2.093887211e-7].reverse(),c=[-.01562499995,.0001430488765,-6911147651e-15,7.621095161e-7,-9.34945152e-8].reverse();function l(i){var l=0,u=0,d=0,f=i*i,p=i-.785398164;return i<8?(u=n(r,f),d=n(o,f),l=u/d+e*a(i,0)*t.log(i)):(f=64/f,u=n(s,f),d=n(c,f),l=t.sqrt(e/i)*(t.sin(p)*u+t.cos(p)*d*8/i)),l}var u=[-4900604943e3,127527439e4,-51534381390,734926455.1,-4237922.726,8511.937935].reverse(),d=[249958057e5,424441966400,3733650367,22459040.02,102042.605,354.9632885,1].reverse(),f=[1,.00183105,-3516396496e-14,2457520174e-15,-2.40337019e-7].reverse(),p=[.04687499995,-.0002002690873,8449199096e-15,-8.8228987e-7,1.05787412e-7].reverse();function m(r){var i=0,o=0,s=0,c=r*r,l=r-2.356194491;return r<8?(o=r*n(u,c),s=n(d,c),i=o/s+e*(a(r,1)*t.log(r)-1/r)):(c=64/c,o=n(f,c),s=n(p,c),i=t.sqrt(e/r)*(t.sin(l)*o+t.cos(l)*s*8/r)),i}return i(l,m,`BESSELY`,1,-1)})(),s=(function(){var e=[1,3.5156229,3.0899424,1.2067492,.2659732,.0360768,.0045813].reverse(),r=[.39894228,.01328592,.00225319,-.00157565,.00916281,-.02057706,.02635537,-.01647633,.00392377].reverse();function i(i){return i<=3.75?n(e,i*i/14.0625):t.exp(t.abs(i))/t.sqrt(t.abs(i))*n(r,3.75/t.abs(i))}var a=[.5,.87890594,.51498869,.15084934,.02658733,.00301532,32411e-8].reverse(),o=[.39894228,-.03988024,-.00362018,.00163801,-.01031555,.02282967,-.02895312,.01787654,-.00420059].reverse();function s(e){return e<3.75?e*n(a,e*e/14.0625):(e<0?-1:1)*t.exp(t.abs(e))/t.sqrt(t.abs(e))*n(o,3.75/t.abs(e))}return function e(n,r){if(r=Math.round(r),r===0)return i(n);if(r===1)return s(n);if(r<0)return NaN;if(t.abs(n)===0)return 0;if(n==1/0)return 1/0;var a=0,o,c=2/t.abs(n),l=0,u=1,d=0;for(o=2*t.round((r+t.round(t.sqrt(40*r)))/2);o>0;o--)d=o*c*u+l,l=u,u=d,t.abs(u)>1e10&&(u*=1e-10,l*=1e-10,a*=1e-10),o==r&&(a=l);return a*=e(n,0)/u,n<0&&r%2?-a:a}})(),c=(function(){var e=[-.57721566,.4227842,.23069756,.0348859,.00262698,1075e-7,74e-7].reverse(),r=[1.25331414,-.07832358,.02189568,-.01062446,.00587872,-.0025154,53208e-8].reverse();function a(i){return i<=2?-t.log(i/2)*s(i,0)+n(e,i*i/4):t.exp(-i)/t.sqrt(i)*n(r,2/i)}var o=[1,.15443144,-.67278579,-.18156897,-.01919402,-.00110404,-4686e-8].reverse(),c=[1.25331414,.23498619,-.0365562,.01504268,-.00780353,.00325614,-68245e-8].reverse();function l(e){return e<=2?t.log(e/2)*s(e,1)+1/e*n(o,e*e/4):t.exp(-e)/t.sqrt(e)*n(c,2/e)}return i(a,l,`BESSELK`,2,1)})();e.besselj=a,e.bessely=o,e.besseli=s,e.besselk=c})})),qp=e({ABS:()=>b_,ACCRINT:()=>Qx,ACOS:()=>x_,ACOSH:()=>S_,ACOT:()=>C_,ACOTH:()=>w_,AGGREGATE:()=>T_,AND:()=>jS,ARABIC:()=>E_,ASIN:()=>D_,ASINH:()=>O_,ATAN:()=>k_,ATAN2:()=>A_,ATANH:()=>j_,AVEDEV:()=>tg,AVERAGE:()=>ng,AVERAGEA:()=>rg,AVERAGEIF:()=>ig,AVERAGEIFS:()=>ag,BASE:()=>M_,BESSELI:()=>ky,BESSELJ:()=>Ay,BESSELK:()=>jy,BESSELY:()=>My,BETA:()=>og,BETADIST:()=>Db,BETAINV:()=>Ob,BIN2DEC:()=>Ny,BIN2HEX:()=>Py,BIN2OCT:()=>Fy,BINOM:()=>sg,BINOMDIST:()=>kb,BITAND:()=>Iy,BITLSHIFT:()=>Ly,BITOR:()=>Ry,BITRSHIFT:()=>zy,BITXOR:()=>By,CEILING:()=>N_,CEILINGMATH:()=>Ab,CEILINGPRECISE:()=>jb,CHAR:()=>Eh,CHIDIST:()=>Mb,CHIDISTRT:()=>Nb,CHIINV:()=>Pb,CHIINVRT:()=>Fb,CHISQ:()=>cg,CHITEST:()=>Ib,CHOOSE:()=>sh,CHOOSECOLS:()=>ch,CHOOSEROWS:()=>lh,CLEAN:()=>Dh,CODE:()=>Oh,COLUMN:()=>uh,COLUMNS:()=>dh,COMBIN:()=>P_,COMBINA:()=>F_,COMPLEX:()=>Vy,CONCAT:()=>Ah,CONCATENATE:()=>kh,CONFIDENCE:()=>lg,CONVERT:()=>Hy,CORREL:()=>ug,COS:()=>I_,COSH:()=>L_,COT:()=>R_,COTH:()=>z_,COUNT:()=>dg,COUNTA:()=>fg,COUNTBLANK:()=>pg,COUNTIF:()=>mg,COUNTIFS:()=>hg,COUPDAYS:()=>$x,COVAR:()=>Lb,COVARIANCE:()=>gg,COVARIANCEP:()=>Rb,COVARIANCES:()=>zb,CRITBINOM:()=>Bb,CSC:()=>B_,CSCH:()=>V_,CUMIPMT:()=>eS,CUMPRINC:()=>tS,DATE:()=>ny,DATEDIF:()=>ry,DATEVALUE:()=>iy,DAVERAGE:()=>Fx,DAY:()=>ay,DAYS:()=>sy,DAYS360:()=>cy,DB:()=>nS,DCOUNT:()=>Ix,DCOUNTA:()=>Lx,DDB:()=>rS,DEC2BIN:()=>Uy,DEC2HEX:()=>Wy,DEC2OCT:()=>Gy,DECIMAL:()=>H_,DEGREES:()=>U_,DELTA:()=>Ky,DEVSQ:()=>_g,DGET:()=>Rx,DISC:()=>iS,DMAX:()=>zx,DMIN:()=>Bx,DOLLAR:()=>jh,DOLLARDE:()=>aS,DOLLARFR:()=>oS,DPRODUCT:()=>Vx,DROP:()=>fh,DSTDEV:()=>Hx,DSTDEVP:()=>Ux,DSUM:()=>Wx,DVAR:()=>Gx,DVARP:()=>Kx,EDATE:()=>ly,EFFECT:()=>sS,EOMONTH:()=>uy,ERF:()=>qy,ERFC:()=>Jy,ERFCPRECISE:()=>Vb,ERFPRECISE:()=>Hb,ERROR:()=>qm,EVEN:()=>W_,EXACT:()=>Mh,EXP:()=>G_,EXPAND:()=>ph,EXPON:()=>vg,EXPONDIST:()=>Ub,F:()=>yg,FACT:()=>q_,FACTDOUBLE:()=>J_,FALSE:()=>MS,FDIST:()=>Wb,FDISTRT:()=>Gb,FIND:()=>Nh,FINV:()=>Kb,FINVRT:()=>qb,FISHER:()=>bg,FISHERINV:()=>xg,FIXED:()=>Ph,FLOOR:()=>Y_,FLOORMATH:()=>Jb,FLOORPRECISE:()=>Yb,FORECAST:()=>Sg,FREQUENCY:()=>Cg,FTEST:()=>Xb,FV:()=>cS,FVSCHEDULE:()=>lS,GAMMA:()=>wg,GAMMADIST:()=>Zb,GAMMAINV:()=>Qb,GAMMALN:()=>Tg,GAMMALNPRECISE:()=>$b,GAUSS:()=>Eg,GCD:()=>X_,GEOMEAN:()=>Dg,GESTEP:()=>Yy,GROWTH:()=>Og,HARMEAN:()=>kg,HEX2BIN:()=>Xy,HEX2DEC:()=>Zy,HEX2OCT:()=>Qy,HLOOKUP:()=>mh,HOUR:()=>dy,HSTACK:()=>wh,HYPGEOM:()=>Ag,HYPGEOMDIST:()=>ex,IF:()=>NS,IFERROR:()=>FS,IFNA:()=>IS,IFS:()=>PS,IMABS:()=>$y,IMAGINARY:()=>eb,IMARGUMENT:()=>tb,IMCONJUGATE:()=>nb,IMCOS:()=>rb,IMCOSH:()=>ib,IMCOT:()=>ab,IMCSC:()=>yb,IMCSCH:()=>bb,IMDIV:()=>ob,IMEXP:()=>sb,IMLN:()=>cb,IMLOG10:()=>lb,IMLOG2:()=>ub,IMPOWER:()=>db,IMPRODUCT:()=>fb,IMREAL:()=>pb,IMSEC:()=>mb,IMSECH:()=>hb,IMSIN:()=>gb,IMSINH:()=>_b,IMSQRT:()=>vb,IMSUB:()=>xb,IMSUM:()=>Sb,IMTAN:()=>Cb,INDEX:()=>hh,INT:()=>Z_,INTERCEPT:()=>jg,IPMT:()=>uS,IRR:()=>dS,ISBLANK:()=>Jm,ISERR:()=>Ym,ISERROR:()=>Xm,ISEVEN:()=>Zm,ISLOGICAL:()=>Qm,ISNA:()=>$m,ISNONTEXT:()=>eh,ISNUMBER:()=>th,ISO:()=>Q_,ISODD:()=>nh,ISOWEEKNUM:()=>fy,ISPMT:()=>fS,ISTEXT:()=>rh,KURT:()=>Mg,LARGE:()=>Ng,LCM:()=>$_,LEFT:()=>Fh,LEN:()=>Ih,LINEST:()=>Pg,LN:()=>ev,LOG:()=>tv,LOG10:()=>nv,LOGEST:()=>Fg,LOGINV:()=>tx,LOGNORM:()=>Ig,LOGNORMDIST:()=>nx,LOGNORMINV:()=>rx,LOOKUP:()=>gh,LOWER:()=>Lh,MATCH:()=>_h,MAX:()=>Lg,MAXA:()=>Rg,MAXIFS:()=>zg,MEDIAN:()=>Bg,MID:()=>Rh,MIN:()=>Vg,MINA:()=>Hg,MINIFS:()=>Ug,MINUTE:()=>py,MIRR:()=>pS,MMULT:()=>rv,MOD:()=>iv,MODE:()=>Wg,MODEMULT:()=>ix,MODESNGL:()=>ax,MONTH:()=>my,MROUND:()=>av,MULTINOMIAL:()=>ov,MUNIT:()=>sv,N:()=>ih,NA:()=>ah,NEGBINOM:()=>Gg,NEGBINOMDIST:()=>ox,NETWORKDAYS:()=>hy,NETWORKDAYSINTL:()=>sx,NOMINAL:()=>mS,NORM:()=>Kg,NORMDIST:()=>cx,NORMINV:()=>lx,NORMSDIST:()=>ux,NORMSINV:()=>dx,NOT:()=>LS,NOW:()=>gy,NPER:()=>hS,NPV:()=>gS,NUMBERVALUE:()=>zh,OCT2BIN:()=>wb,OCT2DEC:()=>Tb,OCT2HEX:()=>Eb,ODD:()=>cv,OR:()=>RS,PDURATION:()=>_S,PEARSON:()=>qg,PERCENTILE:()=>Jg,PERCENTILEEXC:()=>fx,PERCENTILEINC:()=>px,PERCENTRANK:()=>Yg,PERCENTRANKEXC:()=>mx,PERCENTRANKINC:()=>hx,PERMUT:()=>Xg,PERMUTATIONA:()=>Zg,PHI:()=>Qg,PI:()=>lv,PMT:()=>vS,POISSON:()=>$g,POISSONDIST:()=>gx,POWER:()=>uv,PPMT:()=>yS,PRICEDISC:()=>bS,PROB:()=>e_,PRODUCT:()=>dv,PROPER:()=>Bh,PV:()=>xS,QUARTILE:()=>t_,QUARTILEEXC:()=>_x,QUARTILEINC:()=>vx,QUOTIENT:()=>fv,RADIANS:()=>pv,RAND:()=>mv,RANDBETWEEN:()=>hv,RANK:()=>n_,RANKAVG:()=>yx,RANKEQ:()=>bx,RATE:()=>SS,REPLACE:()=>Vh,REPT:()=>Hh,RIGHT:()=>Uh,ROMAN:()=>gv,ROUND:()=>vv,ROUNDDOWN:()=>yv,ROUNDUP:()=>bv,ROW:()=>r_,ROWS:()=>vh,RRI:()=>CS,RSQ:()=>i_,SEARCH:()=>Wh,SEC:()=>xv,SECH:()=>Sv,SECOND:()=>_y,SERIESSUM:()=>Cv,SIGN:()=>wv,SIN:()=>Tv,SINH:()=>Ev,SKEW:()=>a_,SKEWP:()=>xx,SLN:()=>wS,SLOPE:()=>o_,SMALL:()=>s_,SORT:()=>yh,SQRT:()=>Dv,SQRTPI:()=>Ov,STANDARDIZE:()=>c_,STDEV:()=>l_,STDEVA:()=>u_,STDEVP:()=>Sx,STDEVPA:()=>d_,STDEVS:()=>Cx,STEYX:()=>f_,SUBSTITUTE:()=>Gh,SUBTOTAL:()=>kv,SUM:()=>Av,SUMIF:()=>jv,SUMIFS:()=>Mv,SUMPRODUCT:()=>Nv,SUMSQ:()=>Pv,SUMX2MY2:()=>Fv,SUMX2PY2:()=>Iv,SUMXMY2:()=>Lv,SWITCH:()=>VS,SYD:()=>TS,T:()=>Kh,TAKE:()=>bh,TAN:()=>Rv,TANH:()=>zv,TBILLEQ:()=>ES,TBILLPRICE:()=>DS,TBILLYIELD:()=>OS,TDIST:()=>wx,TDISTRT:()=>Tx,TEXT:()=>qh,TEXTJOIN:()=>Jh,TIME:()=>vy,TIMEVALUE:()=>yy,TINV:()=>Ex,TODAY:()=>by,TRANSPOSE:()=>xh,TREND:()=>p_,TRIM:()=>Yh,TRIMMEAN:()=>m_,TRUE:()=>zS,TRUNC:()=>Bv,TTEST:()=>Dx,TYPE:()=>oh,UNICHAR:()=>Xh,UNICODE:()=>Zh,UNIQUE:()=>Sh,UPPER:()=>Qh,VALUE:()=>$h,VAR:()=>h_,VARA:()=>g_,VARP:()=>Ox,VARPA:()=>__,VARS:()=>kx,VLOOKUP:()=>Ch,VSTACK:()=>Th,WEEKDAY:()=>xy,WEEKNUM:()=>Sy,WEIBULL:()=>v_,WEIBULLDIST:()=>Ax,WORKDAY:()=>Cy,WORKDAYINTL:()=>jx,XIRR:()=>kS,XNPV:()=>AS,XOR:()=>BS,YEAR:()=>wy,YEARFRAC:()=>Dy,Z:()=>y_,ZTEST:()=>Mx,utils:()=>HS}),G=t(Gp(),1),Jp=t(Kp(),1),Yp=Error(`#NULL!`),Xp=Error(`#DIV/0!`),K=Error(`#VALUE!`),Zp=Error(`#REF!`),Qp=Error(`#NAME?`),q=Error(`#NUM!`),J=Error(`#N/A`),$p=Error(`#ERROR!`),em=Error(`#GETTING_DATA`),tm=Error(`#CALC!`),nm=Object.freeze({__proto__:null,calc:tm,data:em,div0:Xp,error:$p,na:J,name:Qp,nil:Yp,num:q,ref:Zp,value:K}),rm=!1;function im(){rm=!0}function am(){rm=!1}function om(e){e<60&&(e+=1);let t=Math.floor(e-25569)*86400,n=new Date(t*1e3),r=e-Math.floor(e)+1e-7,i=Math.floor(86400*r),a=i%60;i-=a;let o=Math.floor(i/3600),s=Math.floor(i/60)%60,c=n.getUTCDate(),l=n.getUTCMonth();return e>=60&&e<61&&(c=29,l=1),new Date(n.getUTCFullYear(),l,c,o,s,a)}function sm(e){let t=new Date(1900,0,1),n=e>-22038912e5?2:1;return Math.ceil((e-t)/864e5)+n}var cm=Object.freeze({__proto__:null,dateToSerial:sm,get returnSerial(){return rm},serialToDate:om,useDate:am,useSerial:im}),lm=`=`,um=[`>`,`>=`,`<`,`<=`,`=`,`<>`],dm=`operator`,fm=`literal`,pm=[dm,fm],mm=dm,hm=fm;function gm(e,t){if(pm.indexOf(t)===-1)throw Error(`Unsupported token type: `+t);return{value:e,type:t}}function _m(e){return typeof e==`string`&&/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(`.`)===-1?parseInt(e,10):parseFloat(e)),e}function vm(e){let t=e.length,n=[],r=0,i=``,a=``;for(;r<t;){let t=e.charAt(r);switch(t){case`>`:case`<`:case`=`:a+=t,i.length>0&&(n.push(i),i=``);break;default:a.length>0&&(n.push(a),a=``),i+=t}r++}return i.length>0&&n.push(i),a.length>0&&n.push(a),n}function ym(e){let t=``,n=[];for(let r=0;r<e.length;r++){let i=e[r];r===0&&um.indexOf(i)>=0?n.push(gm(i,mm)):t+=i}return t.length>0&&n.push(gm(_m(t),hm)),n.length>0&&n[0].type!==mm&&n.unshift(gm(lm,mm)),n}function bm(e){let t=[],n;for(let r=0;r<e.length;r++){let i=e[r];switch(i.type){case mm:n=i.value;break;case hm:t.push(i.value)}}return xm(t,n)}function xm(e,t){let n=!1;switch(t){case`>`:n=e[0]>e[1];break;case`>=`:n=e[0]>=e[1];break;case`<`:n=e[0]<e[1];break;case`<=`:n=e[0]<=e[1];break;case`=`:n=e[0]==e[1];break;case`<>`:n=e[0]!=e[1]}return n}function Sm(e){return ym(vm(e))}var Cm=bm;function wm(e){let t=[];return Tm(e,e=>{t.push(e)}),t}function Tm(e,t){let n=-1,r=e.length;for(;++n<r&&t(e[n],n,e)!==!1;);return e}function Em(e){let t=e.length,n;for(;t--;)if(n=e[t],typeof n!=`number`){if(n===!0)e[t]=1;else if(n===!1)e[t]=0;else if(typeof n==`string`){let r=Z(n);e[t]=r instanceof Error?0:r}}return e}function Dm(e){return[e.length,e.reduce((e,t)=>Math.max(e,t.length),0)]}function Om(e,t){let n=[e,t];return n.some(e=>!Km(e))?J:n.some(e=>e<=0)?K:Array.from({length:e},()=>Array.from({length:t},()=>void 0))}function km(e,t){if(!e)return K;e.every(e=>Array.isArray(e))&&e.length!==0||(e=[[...e]]),e.map((t,n)=>{t.map((t,r)=>{t||(e[n][r]=0)})});let n=e.reduce((t,n,r)=>n.length>e[t].length?r:t,0),r=e[n].length;return e.map(e=>[...e,...Array(r-e.length).fill(0)])}function Y(){let e;if(arguments.length===1){let t=arguments[0];e=Mm(t)?wm.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!Nm(e);)e=Am(e);return e}function Am(e){return!e||!e.reduce?[e]:e.reduce((e,t)=>{let n=Array.isArray(e),r=Array.isArray(t);return n&&r?e.concat(t):n?(e.push(t),e):r?[e].concat(t):[e,t]})}function jm(e,t){return t||=1,!e||typeof e.slice!=`function`?e:e.slice(0,e.length-t)}function Mm(e){return e!=null&&typeof e.length==`number`&&typeof e!=`string`}function Nm(e){if(!e)return!1;for(let t=0;t<e.length;++t)if(Array.isArray(e[t]))return!1;return!0}function Pm(e,t){return t||=1,!e||typeof e.slice!=`function`?e:e.slice(t)}function Fm(e){return e?e[0].map((t,n)=>e.map(e=>e[n])):K}function Im(e,t){let n=null;return Tm(e,(e,r)=>{if(e[0]===t)return n=r,!1}),n??K}function Lm(){for(let e=0;e<arguments.length;e++)if(arguments[e]instanceof Error)return arguments[e]}function X(){let e=arguments.length;for(;e--;)if(arguments[e]instanceof Error)return!0;return!1}function Rm(e){let t=0x5af3107a4000;return Math.round(e*t)/t}function zm(){return Y.apply(null,arguments).filter(e=>typeof e==`number`)}function Bm(e){if(typeof e==`boolean`||e instanceof Error)return e;if(typeof e==`number`)return e!==0;if(typeof e==`string`){let t=e.toUpperCase();if(t===`TRUE`)return!0;if(t===`FALSE`)return!1}return e instanceof Date&&!isNaN(e)||K}function Vm(e){if(!isNaN(e)){if(e instanceof Date)return new Date(e);let t=parseFloat(e);return t<0||t>=2958466?q:om(t)}return typeof e==`string`&&(e=/(\d{4})-(\d\d?)-(\d\d?)$/.test(e)?new Date(e+`T00:00:00.000`):new Date(e),!isNaN(e))?e:K}function Hm(e){let t=e.length,n;for(;t--;){if(n=Vm(e[t]),n===K)return n;e[t]=n}return e}function Z(e){return e instanceof Error?e:e==null?0:(typeof e==`boolean`&&(e=+e),!isNaN(e)&&e!==``?parseFloat(e):K)}function Q(e){let t;if(!e||(t=e.length)===0)return K;let n;for(;t--;){if(e[t]instanceof Error)return e[t];if(n=Z(e[t]),n instanceof Error)return n;e[t]=n}return e}function Um(e){return e instanceof Error?e:e==null?``:e.toString()}function Wm(){let e=arguments.length;for(;e--;)if(typeof arguments[e]==`string`)return!0;return!1}function Gm(){let e=wm(arguments),t=Q(Y(e.shift()));if(t instanceof Error)return t;let n=e,r=n.length/2;for(let e=0;e<r;e++)n[e*2]=Y(n[e*2]);let i=[];for(let e=0;e<t.length;e++){let a=!1;for(let t=0;t<r;t++){let r=n[t*2][e],i=n[t*2+1],o=i===void 0||i===`*`,s=!1;if(o)s=!0;else{let e=Sm(i+``);s=Cm([gm(r,hm)].concat(e))}if(!s){a=!1;break}a=!0}a&&i.push(t[e])}return i}function Km(e){return e!=null}var qm={};qm.TYPE=e=>{switch(e){case Yp:return 1;case Xp:return 2;case K:return 3;case Zp:return 4;case Qp:return 5;case q:return 6;case J:return 7;case em:return 8}return J};function Jm(e){return e===null}function Ym(e){return[K,Zp,Xp,q,Qp,Yp].indexOf(e)>=0||typeof e==`number`&&(isNaN(e)||!isFinite(e))}function Xm(e){return Ym(e)||e===J}function Zm(e){return!(Math.floor(Math.abs(e))&1)}function Qm(e){return e===!0||e===!1}function $m(e){return e===J}function eh(e){return typeof e!=`string`}function th(e){return typeof e==`number`&&!isNaN(e)&&isFinite(e)}function nh(e){return!!(Math.floor(Math.abs(e))&1)}function rh(e){return typeof e==`string`}function ih(e){return th(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:Xm(e)?e:0}function ah(){return J}function oh(e){if(th(e))return 1;if(rh(e))return 2;if(Qm(e))return 4;if(Xm(e))return 16;if(Array.isArray(e))return 64}function sh(){if(arguments.length<2)return J;let e=arguments[0];return e<1||e>254||arguments.length<e+1?K:arguments[e]}function ch(e,t,...n){if(!Array.isArray(e))return K;let r=Y([t,...n]),[i,a]=Dm(e);if(r.some(e=>{if(!Km(e))return!0;let t=Math.abs(e);return!(0<t&&t<=a)}))return K;let o=r.map(e=>e<0?e+a+1:e),s=Array(i);for(let t=0;t<i;t++){s[t]=Array(o.length);for(let n=0;n<o.length;n++)s[t][n]=e[t][o[n]-1]??0}return s}function lh(e,t,...n){if(!Array.isArray(e))return K;let r=Y([t,...n]);return r.some(t=>{if(!Km(t))return!0;let n=Math.abs(t);return!(0<n&&n<=e.length)})?K:r.map(t=>t<0?t+e.length+1:t).reduce((t,n)=>{let r=[...e[--n]].map(e=>Km(e)?e:0);return t.push(r),t},[])}function uh(e,t){if(arguments.length!==2)return J;if(t<0)return q;if(!(e instanceof Array)||typeof t!=`number`)return K;if(e.length!==0)return G.default.col(e,t)}function dh(e){return arguments.length===1?e instanceof Array?e.length===0?0:G.default.cols(e):K:J}function fh(e,t,n){if(X(e,t,n))return Lm(e,t,n);if(!(e instanceof Array))return K;let r=[],[i,a]=Dm(e),o=0,s=i;if(typeof t==`number`){if(Math.abs(t)>i)return tm;t>0?o=t:t<0&&(s+=t)}let c=0,l=a;if(typeof n==`number`){if(Math.abs(n)>a)return tm;n>0?c=n:n<0&&(l+=n)}for(let t=o;t<s;t++){let n=[...e[t].slice(c,l).map(e=>e??0)];r.push(n)}return r}function ph(e,t,n,r){let[i,a]=Dm(e);if(Km(t)||(t=i),Km(n)||(n=a),t<i||n<a)return K;let o=Om(t,n);for(let s=0;s<t;s++)for(let t=0;t<n;t++){let n=e[s]?.[t];Km(n)||(n=s<i&&t<a?0:r??J),o[s][t]=n}return o}function mh(e,t,n,r){return Ch(e,Fm(t),n,r)}function hh(e,t,n){let r=Lm(e,t,n);if(r)return r;if(!Array.isArray(e))return K;let i=e.length>0&&!Array.isArray(e[0]);return i&&!n?(n=t,t=1):(n||=1,t||=1),n<0||t<0?K:i&&t===1&&n<=e.length?e[n-1]:t<=e.length&&n<=e[t-1].length?e[t-1][n-1]:Zp}function gh(e,t,n){t=Y(t),n=n?Y(n):t;let r=typeof e==`number`,i=J;for(let a=0;a<t.length;a++)if(t[a]===e)return n[a];else if(r&&t[a]<=e||typeof t[a]==`string`&&t[a].localeCompare(e)<0)i=n[a];else if(r&&t[a]>e)return i;return i}function _h(e,t,n){if(!e&&e!==0||!t||(arguments.length===2&&(n=1),t=Y(t),!(t instanceof Array))||n!==-1&&n!==0&&n!==1)return J;let r,i;for(let a=0;a<t.length;a++)if(n===1){if(t[a]===e)return a+1;t[a]<e&&(i?t[a]>i&&(r=a+1,i=t[a]):(r=a+1,i=t[a]))}else if(n===0){if(typeof e==`string`&&typeof t[a]==`string`){let n=e.toLowerCase().replace(/\?/g,`.`).replace(/\*/g,`.*`).replace(/~/g,`\\`).replace(/\+/g,`\\+`).replace(/\(/g,`\\(`).replace(/\)/g,`\\)`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`);if(RegExp(`^`+n+`$`).test(t[a].toLowerCase()))return a+1}else if(t[a]===e)return a+1}else if(n===-1){if(t[a]===e)return a+1;t[a]>e&&(i?t[a]<i&&(r=a+1,i=t[a]):(r=a+1,i=t[a]))}return r||J}function vh(e){return arguments.length===1?e instanceof Array?e.length===0?0:G.default.rows(e):K:J}function yh(e,t=1,n=1,r=!1){if(!e||!Array.isArray(e))return J;if(e.length===0)return 0;if(t=Z(t),!t||t<1||(n=Z(n),n!==1&&n!==-1))return K;if(r=Bm(r),typeof r!=`boolean`)return Qp;let i=e=>e.sort((e,r)=>(e=Um(e[t-1]),r=Um(r[t-1]),n===1?e<r?n*-1:n:e>r?n:n*-1)),a=km(e),o=r?Fm(a):a;return t>=1&&t<=o[0].length?r?Fm(i(o)):i(o):K}function bh(e,t,n){if(X(e,t,n))return Lm(e,t,n);if(!(e instanceof Array))return K;let[r,i]=Dm(e),a=0,o=r-1;if(typeof t==`number`){if(t===0)return tm;Math.abs(t)<=r&&(t<0?a=r+t:o=t-1)}let s=0,c=i-1;if(typeof n==`number`){if(n===0)return tm;Math.abs(n)<=i&&(n<0?s=i+n:c=n-1)}let l=Om(o-a+1,c-s+1),u=-1,d;for(let t=a;t<=o;t++){u++,d=-1;for(let n=s;n<=c;n++)l[u][++d]=e[t]?.[n]??0}return l}function xh(e){return e?Fm(km(e)):J}function Sh(){let e=[];for(let t=0;t<arguments.length;++t){let n=!1,r=arguments[t];for(let t=0;t<e.length&&(n=e[t]===r,!n);++t);n||e.push(r)}return e}function Ch(e,t,n,r){if(!t||!n)return J;r=r!==0&&r!==!1;let i=J,a=!1,o=typeof e==`number`,s=typeof e==`string`?e.toLowerCase():e;for(let c=0;c<t.length;c++){let l=t[c],u=typeof l[0]==`string`?l[0].toLowerCase():l[0];if(u===s){i=n<l.length+1?l[n-1]:Zp;break}!a&&(o&&r&&u<=e||r&&typeof u==`string`&&u.localeCompare(e)<0)&&(i=n<l.length+1?l[n-1]:Zp),o&&u>e&&(a=!0)}return i}function wh(e,...t){let n=[e,...t],r=0,i=0,a=[];for(let e of n){let[t,n]=Dm(e);r=Math.max(r,t),i+=n,a.push(n)}let o=Array.from({length:r},()=>Array(i)),s=0;for(let e=0;e<n.length;e++){let t=n[e],i=a[e];for(let e=0;e<i;e++){for(let n=0;n<r;n++)o[n][s]=t[n]?.[e]??(n<t.length?0:J);s++}}return o}function Th(e,...t){let n=[e,...t],r=0,i=0;for(let e of n){let[t,n]=Dm(e);r=Math.max(r,n),i+=t}let a=Array(i),o,s=-1;for(;(o=n.shift())!==void 0;)for(let e=0;e<o.length;e++){a[++s]=Array(r);for(let t=0;t<r;t++)a[s][t]=o[e][t]??(t<o[e].length?0:J)}return a}function Eh(e){return e=Z(e),e===0?K:e instanceof Error?e:String.fromCharCode(e)}function Dh(e){return X(e)?e:(e||=``,e.replace(/[\0-\x1F]/g,``))}function Oh(e){if(X(e))return e;e||=``;let t=e.charCodeAt(0);return isNaN(t)&&(t=K),t}function kh(){let e=Y(arguments),t=Lm.apply(void 0,e);if(t)return t;let n=0;for(;(n=e.indexOf(!0))>-1;)e[n]=`TRUE`;let r=0;for(;(r=e.indexOf(!1))>-1;)e[r]=`FALSE`;return e.join(``)}var Ah=kh;function jh(e,t=2){if(e=Z(e),isNaN(e))return K;e=vv(e,t);let n={style:`currency`,currency:`USD`,minimumFractionDigits:t>=0?t:0,maximumFractionDigits:t>=0?t:0},r=e.toLocaleString(`en-US`,n);return e<0?`$(`+r.slice(2)+`)`:r}function Mh(e,t){return arguments.length===2?Lm(e,t)||(e=Um(e),t=Um(t),e===t):J}function Nh(e,t,n){if(arguments.length<2)return J;e=Um(e),t=Um(t),n=n===void 0?0:n;let r=t.indexOf(e,n-1);return r===-1?K:r+1}function Ph(e,t=2,n=!1){if(e=Z(e),isNaN(e)||(t=Z(t),isNaN(t)))return K;if(t<0){let n=10**-t;e=Math.round(e/n)*n}else e=e.toFixed(t);if(n)e=e.toString().replace(/,/g,``);else{let t=e.toString().split(`.`);t[0]=t[0].replace(/\B(?=(\d{3})+$)/g,`,`),e=t.join(`.`)}return e}function Fh(e,t){return Lm(e,t)||(e=Um(e),t=t===void 0?1:t,t=Z(t),t instanceof Error||typeof e!=`string`?K:e.substring(0,t))}function Ih(e){return arguments.length===0?$p:e instanceof Error?e:Array.isArray(e)?K:Um(e).length}function Lh(e){return arguments.length===1?(e=Um(e),X(e)?e:e.toLowerCase()):K}function Rh(e,t,n){if(X(e,t,n))return Lm(e,t,n);let r=[t,n].map(e=>Z(e));if(!r.every(e=>!(e instanceof Error)&&e>0))return K;Km(e)?typeof e!=`string`&&(e=String(e)):e=``,[t,n]=r;let i=t-1,a=i+n;return e.substring(i,a)}function zh(e,t,n){return e=Km(e)?e:``,typeof e==`number`?e:typeof e==`string`?(t=t===void 0?`.`:t,n=n===void 0?`,`:n,Number(e.replace(t,`.`).replace(n,``))):J}function Bh(e){return X(e)?e:isNaN(e)&&typeof e==`number`?K:(e=Um(e),e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()))}function Vh(e,t,n,r){return t=Z(t),n=Z(n),X(t,n)||typeof e!=`string`||typeof r!=`string`?K:e.substr(0,t-1)+r+e.substr(t-1+n)}function Hh(e,t){return Lm(e,t)||(e=Um(e),t=Z(t),t instanceof Error?t:Array(t+1).join(e))}function Uh(e,t){return Lm(e,t)||(e=Um(e),t=t===void 0?1:t,t=Z(t),t instanceof Error?t:e.substring(e.length-t))}function Wh(e,t,n){let r;return typeof e!=`string`||typeof t!=`string`?K:(n=n===void 0?0:n,r=t.toLowerCase().indexOf(e.toLowerCase(),n-1)+1,r===0?K:r)}function Gh(e,t,n,r){if(arguments.length<3)return J;if(!e||!t)return e;if(r===void 0)return e.split(t).join(n);{if(r=Math.floor(Number(r)),Number.isNaN(r)||r<=0)return K;let i=0,a=0;for(;i>-1&&e.indexOf(t,i)>-1;)if(i=e.indexOf(t,i+1),a++,i>-1&&a===r)return e.substring(0,i)+n+e.substring(i+t.length);return e}}function Kh(e){return e instanceof Error||typeof e==`string`?e:``}function qh(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return J;if(e instanceof Date)return e.toISOString().slice(0,10);if(t==null)return``;if(typeof t==`number`)return String(t);if(typeof t!=`string`)return K;let n=t.startsWith(`$`)?`$`:``,r=t.endsWith(`%`);t=t.replace(/%/g,``).replace(/\$/g,``);let i=t.includes(`.`)?t.split(`.`)[1].match(/0/g).length:0,a=!t.includes(`,`);return r&&(e*=100),e=Ph(e,i,a),e.startsWith(`-`)?(e=e.replace(`-`,``),e=`-`+n+e):e=n+e,r&&(e+=`%`),e}function Jh(e,t,...n){if(typeof t!=`boolean`&&(t=Bm(t)),arguments.length<3)return J;e??=``;let r=Y(n),i=t?r.filter(e=>e):r;if(Array.isArray(e)){e=Y(e);let t=i.map(e=>[e]),n=0;for(let r=0;r<t.length-1;r++)t[r].push(e[n]),n++,n===e.length&&(n=0);return i=Y(t),i.join(``)}return i.join(e)}function Yh(e){return e=Um(e),e instanceof Error?e:e.replace(/\s+/g,` `).trim()}var Xh=Eh,Zh=Oh;function Qh(e){return e=Um(e),e instanceof Error?e:e.toUpperCase()}function $h(e){let t=Lm(e);if(t)return t;if(typeof e==`number`)return e;if(Km(e)||(e=``),typeof e!=`string`)return K;let n=/(%)$/.test(e)||/^(%)/.test(e);if(e=e.replace(/^[^0-9-]{0,3}/,``),e=e.replace(/[^0-9]{0,3}$/,``),e=e.replace(/[ ,]/g,``),e===``)return 0;let r=Number(e);return isNaN(r)?K:(r||=0,n&&(r*=.01),r)}var eg=2.5066282746310002;function tg(){let e=Y(arguments).filter(Km);if(e.length===0)return q;let t=Q(e);return t instanceof Error?t:G.default.sum((0,G.default)(t).subtract(G.default.mean(t)).abs()[0])/t.length}function ng(){let e=Y(arguments).filter(Km);if(e.length===0)return Xp;let t=Lm.apply(void 0,e);if(t)return t;let n=zm(e),r=n.length,i=0,a=0,o;for(let e=0;e<r;e++)i+=n[e],a+=1;return o=i/a,isNaN(o)&&(o=q),o}function rg(){let e=Y(arguments).filter(Km);if(e.length===0)return Xp;let t=Lm.apply(void 0,e);if(t)return t;let n=e,r=n.length,i=0,a=0,o;for(let e=0;e<r;e++){let t=n[e];typeof t==`number`&&(i+=t),t===!0&&i++,t!==null&&a++}return o=i/a,isNaN(o)&&(o=q),o}function ig(e,t,n){if(arguments.length<=1)return J;if(n||=e,n=Q(Y(n).filter(Km)),e=Y(e),n instanceof Error)return n;let r=0,i=0,a=t===void 0||t===`*`,o=a?null:Sm(t+``);for(let t=0;t<e.length;t++){let s=e[t];(a||Cm([gm(s,hm)].concat(o)))&&(i+=n[t],r++)}return i/r}function ag(){let e=Gm(...arguments),t=e.reduce((e,t)=>e+t,0)/e.length;return isNaN(t)?0:t}var og={};og.DIST=function(e,t,n,r,i,a){return arguments.length<4||(i=i===void 0?0:i,a=a===void 0?1:a,e=Z(e),t=Z(t),n=Z(n),i=Z(i),a=Z(a),X(e,t,n,i,a))?K:(e=(e-i)/(a-i),r?G.default.beta.cdf(e,t,n):G.default.beta.pdf(e,t,n))},og.INV=(e,t,n,r,i)=>(r=r===void 0?0:r,i=i===void 0?1:i,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i)?K:G.default.beta.inv(e,t,n)*(i-r)+r);var sg={};sg.DIST=(e,t,n,r)=>(e=Z(e),t=Z(t),n=Z(n),r=Z(r),X(e,t,n,r)?K:r?G.default.binomial.cdf(e,t,n):G.default.binomial.pdf(e,t,n)),sg.DIST.RANGE=(e,t,n,r)=>{if(r=r===void 0?n:r,e=Z(e),t=Z(t),n=Z(n),r=Z(r),X(e,t,n,r))return K;let i=0;for(let a=n;a<=r;a++)i+=P_(e,a)*t**+a*(1-t)**(e-a);return i},sg.INV=(e,t,n)=>{if(e=Z(e),t=Z(t),n=Z(n),X(e,t,n))return K;let r=0;for(;r<=e;){if(G.default.binomial.cdf(r,e,t)>=n)return r;r++}};var cg={};cg.DIST=(e,t,n)=>(e=Z(e),t=Z(t),X(e,t)?K:n?G.default.chisquare.cdf(e,t):G.default.chisquare.pdf(e,t)),cg.DIST.RT=(e,t)=>!e|!t?J:e<1||t>10**10?q:typeof e!=`number`||typeof t!=`number`?K:1-G.default.chisquare.cdf(e,t),cg.INV=(e,t)=>(e=Z(e),t=Z(t),X(e,t)?K:G.default.chisquare.inv(e,t)),cg.INV.RT=(e,t)=>!e|!t?J:e<0||e>1||t<1||t>10**10?q:typeof e!=`number`||typeof t!=`number`?K:G.default.chisquare.inv(1-e,t),cg.TEST=function(e,t){if(arguments.length!==2)return J;if(!(e instanceof Array)||!(t instanceof Array)||e.length!==t.length||e[0]&&t[0]&&e[0].length!==t[0].length)return K;let n=e.length,r,i,a;for(i=0;i<n;i++)e[i]instanceof Array||(r=e[i],e[i]=[],e[i].push(r)),t[i]instanceof Array||(r=t[i],t[i]=[],t[i].push(r));let o=e[0].length,s=o===1?n-1:(n-1)*(o-1),c=0,l=Math.PI;for(i=0;i<n;i++)for(a=0;a<o;a++)c+=(e[i][a]-t[i][a])**2/t[i][a];function u(e,t){let n=Math.exp(-.5*e);t%2==1&&(n*=Math.sqrt(2*e/l));let r=t;for(;r>=2;)n=n*e/r,r-=2;let i=n,a=t;for(;i>1e-10*n;)a+=2,i=i*e/a,n+=i;return 1-n}return Math.round(u(c,s)*1e6)/1e6};var lg={};lg.NORM=(e,t,n)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:G.default.normalci(1,e,t,n)[1]-1),lg.T=(e,t,n)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:G.default.tci(1,e,t,n)[1]-1);function ug(e,t){return e=Q(Y(e)),t=Q(Y(t)),X(e,t)?K:G.default.corrcoeff(e,t)}function dg(){return zm(Y(arguments)).length}function fg(){let e=Y(arguments);return e.length-pg(e)}function pg(){let e=Y(arguments),t=0,n;for(let r=0;r<e.length;r++)n=e[r],(n==null||n===``)&&t++;return t}function mg(e,t){if(e=Y(e),t===void 0||t===`*`)return e.length;let n=0,r=Sm(t+``);for(let t=0;t<e.length;t++){let i=e[t];Cm([gm(i,hm)].concat(r))&&n++}return n}function hg(){let e=wm(arguments),t=Array(Y(e[0]).length);for(let e=0;e<t.length;e++)t[e]=!0;for(let n=0;n<e.length;n+=2){let r=Y(e[n]),i=e[n+1];if(i!==void 0&&i!==`*`){let e=Sm(i+``);for(let n=0;n<r.length;n++){let i=r[n],a=[gm(i,hm)].concat(e);t[n]=t[n]&&Cm(a)}}}let n=0;for(let e=0;e<t.length;e++)t[e]&&n++;return n}var gg={};gg.P=(e,t)=>{if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=G.default.mean(e),r=G.default.mean(t),i=0,a=e.length;for(let o=0;o<a;o++)i+=(e[o]-n)*(t[o]-r);return i/a},gg.S=(e,t)=>(e=Q(Y(e)),t=Q(Y(t)),X(e,t)?K:G.default.covariance(e,t));function _g(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=G.default.mean(e),n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t)**2;return n}var vg={};vg.DIST=(e,t,n)=>(e=Z(e),t=Z(t),X(e,t)?K:n?G.default.exponential.cdf(e,t):G.default.exponential.pdf(e,t));var yg={};yg.DIST=(e,t,n,r)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:r?G.default.centralF.cdf(e,t,n):G.default.centralF.pdf(e,t,n)),yg.DIST.RT=function(e,t,n){return arguments.length===3?e<0||t<1||n<1?q:typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?K:1-G.default.centralF.cdf(e,t,n):J},yg.INV=(e,t,n)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:e<=0||e>1?q:G.default.centralF.inv(e,t,n)),yg.INV.RT=function(e,t,n){return arguments.length===3?e<0||e>1||t<1||t>10**10||n<1||n>10**10?q:typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?K:G.default.centralF.inv(1-e,t,n):J},yg.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return J;if(e.length<2||t.length<2)return Xp;let n=(e,t)=>{let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t)**2;return n},r=Av(e)/e.length,i=Av(t)/t.length;return n(e,r)/(e.length-1)/(n(t,i)/(t.length-1))};function bg(e){return e=Z(e),e instanceof Error?e:Math.log((1+e)/(1-e))/2}function xg(e){if(e=Z(e),e instanceof Error)return e;let t=Math.exp(2*e);return(t-1)/(t+1)}function Sg(e,t,n){if(e=Z(e),t=Q(Y(t)),n=Q(Y(n)),X(e,t,n))return K;let r=G.default.mean(n),i=G.default.mean(t),a=n.length,o=0,s=0;for(let e=0;e<a;e++)o+=(n[e]-r)*(t[e]-i),s+=(n[e]-r)**2;let c=o/s;return i-c*r+c*e}function Cg(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=e.length,r=t.length,i=[];for(let a=0;a<=r;a++){i[a]=0;for(let o=0;o<n;o++)a===0?e[o]<=t[0]&&(i[0]+=1):a<r?e[o]>t[a-1]&&e[o]<=t[a]&&(i[a]+=1):a===r&&e[o]>t[r-1]&&(i[r]+=1)}return i}function wg(e){return e=Z(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?q:G.default.gammafn(e)}wg.DIST=function(e,t,n,r){return arguments.length===4?e<0||t<=0||n<=0||typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?K:r?G.default.gamma.cdf(e,t,n,!0):G.default.gamma.pdf(e,t,n,!1):J},wg.INV=function(e,t,n){return arguments.length===3?e<0||e>1||t<=0||n<=0?q:typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?K:G.default.gamma.inv(e,t,n):J};function Tg(e){return e=Z(e),e instanceof Error?e:G.default.gammaln(e)}Tg.PRECISE=function(e){return arguments.length===1?e<=0?q:typeof e==`number`?G.default.gammaln(e):K:J};function Eg(e){return e=Z(e),e instanceof Error?e:G.default.normal.cdf(e,0,1)-.5}function Dg(){let e=Q(Y(arguments));return e instanceof Error?e:G.default.geomean(e)}function Og(e,t,n,r){if(e=Q(Y(e)),e instanceof Error)return e;let i;if(t===void 0)for(t=[],i=1;i<=e.length;i++)t.push(i);if(n===void 0&&(n=t),t=Q(Y(t)),n=Q(Y(n)),X(t,n))return K;r===void 0&&(r=!0);let a=e.length,o=0,s=0,c=0,l=0;for(i=0;i<a;i++){let n=t[i],r=Math.log(e[i]);o+=n,s+=r,c+=n*r,l+=n*n}o/=a,s/=a,c/=a,l/=a;let u,d;r?(u=(c-o*s)/(l-o*o),d=s-u*o):(u=c/l,d=0);let f=[];for(i=0;i<n.length;i++)f.push(Math.exp(d+u*n[i]));return f}function kg(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=e.length,n=0;for(let r=0;r<t;r++)n+=1/e[r];return t/n}var Ag={};Ag.DIST=(e,t,n,r,i)=>{if(e=Z(e),t=Z(t),n=Z(n),r=Z(r),X(e,t,n,r))return K;function a(e,t,n,r){return P_(n,e)*P_(r-n,t-e)/P_(r,t)}function o(e,t,n,r){let i=0;for(let o=0;o<=e;o++)i+=a(o,t,n,r);return i}return i?o(e,t,n,r):a(e,t,n,r)};function jg(e,t){return e=Q(e),t=Q(t),X(e,t)?K:e.length===t.length?Sg(0,e,t):J}function Mg(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=G.default.mean(e),n=e.length,r=0;for(let i=0;i<n;i++)r+=(e[i]-t)**4;return r/=G.default.stdev(e,!0)**4,n*(n+1)/((n-1)*(n-2)*(n-3))*r-3*(n-1)*(n-1)/((n-2)*(n-3))}function Ng(e,t){return Lm.apply(void 0,e)||(X(t)?t:(e=zm(Y(e)),t=Z(t),t<0||e.length<t?K:e.sort((e,t)=>t-e)[t-1]))}function Pg(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=G.default.mean(e),r=G.default.mean(t),i=t.length,a=0,o=0;for(let s=0;s<i;s++)a+=(t[s]-r)*(e[s]-n),o+=(t[s]-r)**2;let s=a/o;return[s,n-s*r]}function Fg(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t)||e.length!==t.length)return K;for(let t=0;t<e.length;t++)e[t]=Math.log(e[t]);let n=Pg(e,t);return n[0]=Math.round(Math.exp(n[0])*1e6)/1e6,n[1]=Math.round(Math.exp(n[1])*1e6)/1e6,n}var Ig={};Ig.DIST=(e,t,n,r)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:r?G.default.lognormal.cdf(e,t,n):G.default.lognormal.pdf(e,t,n)),Ig.INV=(e,t,n)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:G.default.lognormal.inv(e,t,n));function Lg(){let e=Y(arguments),t=Lm.apply(void 0,e);if(t)return t;let n=zm(e);return n.length===0?0:Math.max.apply(Math,n)}function Rg(){let e=Y(arguments),t=Lm.apply(void 0,e);if(t)return t;let n=Em(e);return n=n.map(e=>e??0),n.length===0?0:Math.max.apply(Math,n)}function zg(){let e=Gm(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function Bg(){let e=Y(arguments),t=Lm.apply(void 0,e);if(t)return t;let n=Em(e),r=G.default.median(n);return isNaN(r)&&(r=q),r}function Vg(){let e=Y(arguments),t=Lm.apply(void 0,e);if(t)return t;let n=zm(e);return n.length===0?0:Math.min.apply(Math,n)}function Hg(){let e=Y(arguments),t=Lm.apply(void 0,e);if(t)return t;let n=Em(e);return n=n.map(e=>e??0),n.length===0?0:Math.min.apply(Math,n)}function Ug(){let e=Gm(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var Wg={};Wg.MULT=function(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=e.length,n={},r=[],i=0,a;for(let o=0;o<t;o++)a=e[o],n[a]=n[a]?n[a]+1:1,n[a]>i&&(i=n[a],r=[]),n[a]===i&&(r[r.length]=a);return r},Wg.SNGL=function(){let e=Q(Y(arguments));return e instanceof Error?e:Wg.MULT(e).sort((e,t)=>e-t)[0]};var Gg={};Gg.DIST=(e,t,n,r)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:r?G.default.negbin.cdf(e,t,n):G.default.negbin.pdf(e,t,n));var Kg={};Kg.DIST=(e,t,n,r)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:n<=0?q:r?G.default.normal.cdf(e,t,n):G.default.normal.pdf(e,t,n)),Kg.INV=(e,t,n)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:G.default.normal.inv(e,t,n)),Kg.S={},Kg.S.DIST=(e,t)=>(e=Z(e),e instanceof Error?K:t?G.default.normal.cdf(e,0,1):G.default.normal.pdf(e,0,1)),Kg.S.INV=e=>(e=Z(e),e instanceof Error?K:G.default.normal.inv(e,0,1));function qg(e,t){if(t=Q(Y(t)),e=Q(Y(e)),X(t,e))return K;let n=G.default.mean(e),r=G.default.mean(t),i=e.length,a=0,o=0,s=0;for(let c=0;c<i;c++)a+=(e[c]-n)*(t[c]-r),o+=(e[c]-n)**2,s+=(t[c]-r)**2;return a/Math.sqrt(o*s)}var Jg={};Jg.EXC=(e,t)=>{if(e=Q(Y(e)),t=Z(t),X(e,t))return K;e=e.sort((e,t)=>e-t);let n=e.length;if(t<1/(n+1)||t>1-1/(n+1))return q;let r=t*(n+1)-1,i=Math.floor(r);return Rm(r===i?e[r]:e[i]+(r-i)*(e[i+1]-e[i]))},Jg.INC=(e,t)=>{if(e=Q(Y(e)),t=Z(t),X(e,t))return K;e=e.sort((e,t)=>e-t);let n=e.length,r=t*(n-1),i=Math.floor(r);return Rm(r===i?e[r]:e[i]+(r-i)*(e[i+1]-e[i]))};var Yg={};Yg.EXC=(e,t,n)=>{if(n=n===void 0?3:n,e=Q(Y(e)),t=Z(t),n=Z(n),X(e,t,n))return K;e=e.sort((e,t)=>e-t);let r=Sh.apply(null,e),i=e.length,a=r.length,o=10**n,s=0,c=!1,l=0;for(;!c&&l<a;)t===r[l]?(s=(e.indexOf(r[l])+1)/(i+1),c=!0):t>=r[l]&&(t<r[l+1]||l===a-1)&&(s=(e.indexOf(r[l])+1+(t-r[l])/(r[l+1]-r[l]))/(i+1),c=!0),l++;return Math.floor(s*o)/o},Yg.INC=(e,t,n)=>{if(n=n===void 0?3:n,e=Q(Y(e)),t=Z(t),n=Z(n),X(e,t,n))return K;e=e.sort((e,t)=>e-t);let r=Sh.apply(null,e),i=e.length,a=r.length,o=10**n,s=0,c=!1,l=0;for(;!c&&l<a;)t===r[l]?(s=e.indexOf(r[l])/(i-1),c=!0):t>=r[l]&&(t<r[l+1]||l===a-1)&&(s=(e.indexOf(r[l])+(t-r[l])/(r[l+1]-r[l]))/(i-1),c=!0),l++;return Math.floor(s*o)/o};function Xg(e,t){return e=Z(e),t=Z(t),X(e,t)?K:q_(e)/q_(e-t)}function Zg(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e**+t}function Qg(e){return e=Z(e),e instanceof Error?K:Math.exp(-.5*e*e)/eg}var $g={};$g.DIST=(e,t,n)=>(e=Z(e),t=Z(t),X(e,t)?K:n?G.default.poisson.cdf(e,t):G.default.poisson.pdf(e,t));function e_(e,t,n,r){if(n===void 0)return 0;if(r=r===void 0?n:r,e=Q(Y(e)),t=Q(Y(t)),n=Z(n),r=Z(r),X(e,t,n,r))return K;if(n===r)return e.indexOf(n)>=0?t[e.indexOf(n)]:0;let i=e.sort((e,t)=>e-t),a=i.length,o=0;for(let s=0;s<a;s++)i[s]>=n&&i[s]<=r&&(o+=t[e.indexOf(i[s])]);return o}var t_={};t_.EXC=(e,t)=>{if(e=Q(zm(Y(e))),t=Z(t),X(e,t))return K;switch(t){case 1:return Jg.EXC(e,.25);case 2:return Jg.EXC(e,.5);case 3:return Jg.EXC(e,.75);default:return q}},t_.INC=(e,t)=>{if(e=Q(zm(Y(e))),t=Z(t),X(e,t))return K;switch(t){case 1:return Jg.INC(e,.25);case 2:return Jg.INC(e,.5);case 3:return Jg.INC(e,.75);default:return q}};var n_={};n_.AVG=(e,t,n)=>{if(e=Z(e),t=Q(Y(t)),X(e,t))return K;t=Y(t),n||=!1;let r=n?(e,t)=>e-t:(e,t)=>t-e;t=t.sort(r);let i=t.length,a=0;for(let n=0;n<i;n++)t[n]===e&&a++;return a>1?(2*t.indexOf(e)+a+1)/2:t.indexOf(e)+1},n_.EQ=(e,t,n)=>{if(e=Z(e),t=Q(Y(t)),X(e,t))return K;n||=!1;let r=n?(e,t)=>e-t:(e,t)=>t-e;return t=t.sort(r),t.indexOf(e)+1};function r_(e,t){if(arguments.length!==2)return J;if(t<0)return q;if(!(e instanceof Array)||typeof t!=`number`)return K;if(e.length!==0)return G.default.row(e,t)}function i_(e,t){return e=Q(Y(e)),t=Q(Y(t)),X(e,t)?K:qg(e,t)**2}function a_(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=G.default.mean(e),n=e.length,r=0;for(let i=0;i<n;i++)r+=(e[i]-t)**3;return n*r/((n-1)*(n-2)*G.default.stdev(e,!0)**3)}a_.P=function(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=G.default.mean(e),n=e.length,r=0,i=0;for(let a=0;a<n;a++)i+=(e[a]-t)**3,r+=(e[a]-t)**2;return i/=n,r/=n,i/r**(3/2)};function o_(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=G.default.mean(t),r=G.default.mean(e),i=t.length,a=0,o=0;for(let s=0;s<i;s++)a+=(t[s]-n)*(e[s]-r),o+=(t[s]-n)**2;return a/o}function s_(e,t){return e=Q(Y(e)),t=Z(t),X(e,t)?e:e.sort((e,t)=>e-t)[t-1]}function c_(e,t,n){return e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:(e-t)/n}var l_={};l_.P=function(){let e=h_.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=q),t},l_.S=function(){let e=h_.S.apply(this,arguments);return Math.sqrt(e)};function u_(){let e=g_.apply(this,arguments);return Math.sqrt(e)}function d_(){let e=__.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=q),t}function f_(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=G.default.mean(t),r=G.default.mean(e),i=t.length,a=0,o=0,s=0;for(let c=0;c<i;c++)a+=(e[c]-r)**2,o+=(t[c]-n)*(e[c]-r),s+=(t[c]-n)**2;return Math.sqrt((a-o*o/s)/(i-2))}Kh.DIST=(e,t,n)=>n!==1&&n!==2?q:n===1?Kh.DIST.RT(e,t):Kh.DIST[`2T`](e,t),Kh.DIST[`2T`]=function(e,t){return arguments.length===2?e<0||t<1?q:typeof e!=`number`||typeof t!=`number`?K:(1-G.default.studentt.cdf(e,t))*2:J},Kh.DIST.RT=function(e,t){return arguments.length===2?e<0||t<1?q:typeof e!=`number`||typeof t!=`number`?K:1-G.default.studentt.cdf(e,t):J},Kh.INV=(e,t)=>(e=Z(e),t=Z(t),X(e,t)?K:G.default.studentt.inv(e,t)),Kh.INV[`2T`]=(e,t)=>(e=Z(e),t=Z(t),e<=0||e>1||t<1?q:X(e,t)?K:Math.abs(G.default.studentt.inv(e/2,t))),Kh.TEST=(e,t)=>{if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=G.default.mean(e),r=G.default.mean(t),i=0,a=0,o=0;for(;o<e.length;o++)i+=(e[o]-n)**2;for(o=0;o<t.length;o++)a+=(t[o]-r)**2;i/=e.length-1,a/=t.length-1;let s=Math.abs(n-r)/Math.sqrt(i/e.length+a/t.length);return Kh.DIST[`2T`](s,e.length+t.length-2)};function p_(e,t,n){if(e=Q(Y(e)),t=Q(Y(t)),n=Q(Y(n)),X(e,t,n))return K;let r=Pg(e,t),i=r[0],a=r[1],o=[];return n.forEach(e=>{o.push(i*e+a)}),o}function m_(e,t){if(e=Q(Y(e)),t=Z(t),X(e,t))return K;let n=Y_(e.length*t,2)/2;return G.default.mean(jm(Pm(e.sort((e,t)=>e-t),n),n))}var h_={};h_.P=function(){let e=zm(Y(arguments)),t=e.length,n=0,r=ng(e),i;for(let i=0;i<t;i++)n+=(e[i]-r)**2;return i=n/t,isNaN(i)&&(i=q),i},h_.S=function(){let e=zm(Y(arguments)),t=e.length,n=0,r=ng(e);for(let i=0;i<t;i++)n+=(e[i]-r)**2;return n/(t-1)};function g_(){let e=Y(arguments),t=e.length,n=0,r=0,i=rg(e);for(let a=0;a<t;a++){let t=e[a];n+=typeof t==`number`?(t-i)**2:t===!0?(1-i)**2:(0-i)**2,t!==null&&r++}return n/(r-1)}function __(){let e=Y(arguments),t=e.length,n=0,r=0,i=rg(e),a;for(let a=0;a<t;a++){let t=e[a];n+=typeof t==`number`?(t-i)**2:t===!0?(1-i)**2:(0-i)**2,t!==null&&r++}return a=n/r,isNaN(a)&&(a=q),a}var v_={};v_.DIST=(e,t,n,r)=>(e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:r?1-Math.exp(-((e/n)**+t)):e**(t-1)*Math.exp(-((e/n)**+t))*t/n**+t);var y_={};y_.TEST=(e,t,n)=>{if(e=Q(Y(e)),t=Z(t),X(e,t))return K;n||=l_.S(e);let r=e.length;return 1-Kg.S.DIST((ng(e)-t)/(n/Math.sqrt(r)),!0)};function b_(e){return e=Z(e),e instanceof Error?e:Math.abs(e)}function x_(e){if(e=Z(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=q),t}function S_(e){if(e=Z(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=q),t}function C_(e){return e=Z(e),e instanceof Error?e:Math.atan(1/e)}function w_(e){if(e=Z(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=q),t}function T_(e,t,n,r){if(e=Z(e),t=Z(e),X(e,t))return K;switch(e){case 1:return ng(n);case 2:return dg(n);case 3:return fg(n);case 4:return Lg(n);case 5:return Vg(n);case 6:return dv(n);case 7:return l_.S(n);case 8:return l_.P(n);case 9:return Av(n);case 10:return h_.S(n);case 11:return h_.P(n);case 12:return Bg(n);case 13:return Wg.SNGL(n);case 14:return Ng(n,r);case 15:return s_(n,r);case 16:return Jg.INC(n,r);case 17:return t_.INC(n,r);case 18:return Jg.EXC(n,r);case 19:return t_.EXC(n,r)}}function E_(e){if(e==null)return 0;if(e instanceof Error)return e;if(!/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/.test(e))return K;let t=0;return e.replace(/[MDLV]|C[MD]?|X[CL]?|I[XV]?/g,e=>{t+={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1}[e]}),t}function D_(e){if(e=Z(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=q),t}function O_(e){return e=Z(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function k_(e){return e=Z(e),e instanceof Error?e:Math.atan(e)}function A_(e,t){return e=Z(e),t=Z(t),Lm(e,t)||Math.atan2(e,t)}function j_(e){if(e=Z(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=q),t}function M_(e,t,n){e=Z(e),t=Z(t),n=Z(n);let r=Lm(e,t,n);if(r)return r;if(t===0)return q;let i=e.toString(t);return Array(Math.max(n+1-i.length,0)).join(`0`)+i}function N_(e,t){return e=Z(e),t=Z(t),Lm(e,t)||(t===0?0:e>0&&t<0?q:Math.ceil(e/t)*t)}N_.MATH=(e,t,n=0)=>(t===void 0&&(t=e>0?1:-1),e=Z(e),t=Z(t),n=Z(n),Lm(e,t,n)||(t===0?0:(t=Math.abs(t),n===0||e>0?Math.ceil(e/t)*t:Math.floor(e/t)*t))),N_.PRECISE=(e,t)=>N_.MATH(e,t);function P_(e,t){return e=Z(e),t=Z(t),Lm(e,t)||(e<t?q:q_(e)/(q_(t)*q_(e-t)))}function F_(e,t){return e=Z(e),t=Z(t),Lm(e,t)||(e<t?q:e===0&&t===0?1:P_(e+t-1,e-1))}function I_(e){return e=Z(e),e instanceof Error?e:Math.cos(e)}function L_(e){return e=Z(e),e instanceof Error?e:(Math.exp(e)+Math.exp(-e))/2}function R_(e){return e=Z(e),e instanceof Error?e:e===0?Xp:1/Math.tan(e)}function z_(e){if(e=Z(e),e instanceof Error)return e;if(e===0)return Xp;let t=Math.exp(2*e);return(t+1)/(t-1)}function B_(e){return e=Z(e),e instanceof Error?e:e===0?Xp:1/Math.sin(e)}function V_(e){return e=Z(e),e instanceof Error?e:e===0?Xp:2/(Math.exp(e)-Math.exp(-e))}function H_(e,t){if(arguments.length<2)return J;e||=`0`,t=Z(t);let n=Lm(e,t);if(n)return n;if(t===0)return q;let r=parseInt(e,t);return isNaN(r)?q:r}function U_(e){return e=Z(e),e instanceof Error?e:e*180/Math.PI}function W_(e){return e=Z(e),e instanceof Error?e:N_.MATH(e,-2,-1)}function G_(e){return arguments.length<1?J:arguments.length>1?$p:(e=Z(e),e instanceof Error||(e=Math.exp(e)),e)}var K_=[];function q_(e){if(e=Z(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(K_[t]>0||(K_[t]=q_(t-1)*t),K_[t])}function J_(e){if(e=Z(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*J_(t-2)}function Y_(e,t){return e=Z(e),t=Z(t),Lm(e,t)||(t?e>0&&t<0?q:Math.floor(e/t)*t:Xp)}Y_.MATH=(e,t=1,n=0)=>(e=Z(e),t=Z(t),n=Z(n),Lm(e,t,n)||(t===0?0:(t=Math.abs(t),n===0||e>0?Math.floor(e/t)*t:Math.ceil(e/t)*t))),Y_.PRECISE=(e,t)=>Y_.MATH(e,t);function X_(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=e.length,n=e[0],r=n<0?-n:n;for(let n=1;n<t;n++){let t=e[n],i=t<0?-t:t;for(;r&&i;)r>i?r%=i:i%=r;r+=i}return r}function Z_(e){return e=Z(e),e instanceof Error?e:Math.floor(e)}var Q_={CEILING:N_};function $_(){let e=Q(Y(arguments));if(e instanceof Error)return e;for(var t,n,r,i,a=1;(r=e.pop())!==void 0;){if(r===0)return 0;for(;r>1;){if(r%2){for(t=3,n=Math.floor(Math.sqrt(r));t<=n&&r%t;t+=2);i=t<=n?t:r}else i=2;for(r/=i,a*=i,t=e.length;t;e[--t]%i===0&&(e[t]/=i)===1&&e.splice(t,1));}}return a}function ev(e){return e=Z(e),e instanceof Error?e:e===0?q:Math.log(e)}function tv(e,t){return e=Z(e),t=t?Z(t):10,Lm(e,t)||(e===0||t===0?q:Math.log(e)/Math.log(t))}function nv(e){return e=Z(e),e instanceof Error?e:e===0?q:Math.log(e)/Math.log(10)}function rv(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(e=>!e.length)||t.some(e=>!e.length)||Am(e).some(e=>typeof e!=`number`)||Am(t).some(e=>typeof e!=`number`)||e[0].length!==t.length?K:Array(e.length).fill(0).map(()=>Array(t[0].length).fill(0)).map((n,r)=>n.map((n,i)=>e[r].reduce((e,n,r)=>e+n*t[r][i],0)))}function iv(e,t){e=Z(e),t=Z(t);let n=Lm(e,t);if(n)return n;if(t===0)return Xp;let r=Math.abs(e%t);return r=e<0?t-r:r,t>0?r:-r}function av(e,t){return e=Z(e),t=Z(t),Lm(e,t)||(e*t===0?0:e*t<0?q:Math.round(e/t)*t)}function ov(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=0,n=1;for(let r=0;r<e.length;r++)t+=e[r],n*=q_(e[r]);return q_(t)/n}function sv(e){return arguments.length>1?J:(e=parseInt(e),!e||e<=0?K:Array(e).fill(0).map(()=>Array(e).fill(0)).map((e,t)=>(e[t]=1,e)))}function cv(e){if(e=Z(e),e instanceof Error)return e;let t=Math.ceil(Math.abs(e));return t=t&1?t:t+1,e>=0?t:-t}function lv(){return Math.PI}function uv(e,t){e=Z(e),t=Z(t);let n=Lm(e,t);if(n)return n;if(e===0&&t===0)return q;let r=e**+t;return isNaN(r)?q:r}function dv(){let e=Y(arguments).filter(e=>e!=null);if(e.length===0)return 0;let t=Q(e);if(t instanceof Error)return t;let n=1;for(let e=0;e<t.length;e++)n*=t[e];return n}function fv(e,t){return e=Z(e),t=Z(t),Lm(e,t)||parseInt(e/t,10)}function pv(e){return e=Z(e),e instanceof Error?e:e*Math.PI/180}function mv(){return Math.random()}function hv(e,t){return e=Z(e),t=Z(t),Lm(e,t)||e+Math.ceil((t-e+1)*Math.random())-1}function gv(e){if(e=Z(e),e instanceof Error)return e;let t=String(e).split(``),n=`.C.CC.CCC.CD.D.DC.DCC.DCCC.CM..X.XX.XXX.XL.L.LX.LXX.LXXX.XC..I.II.III.IV.V.VI.VII.VIII.IX`.split(`.`),r=``,i=3;for(;i--;)r=(n[+t.pop()+i*10]||``)+r;return Array(+t.join(``)+1).join(`M`)+r}function _v(e,t,n){e=Z(e),t=Z(t);let r=Lm(e,t);if(r)return r;let i=e>=0?1:-1,a=(Math.abs(e)+`e`+t).split(`e`);return a=(n(a[0]+`e`+a[1])+`e`+-t).split(`e`),Number(a[0]+`e`+a[1])*i}function vv(e,t){return _v(e,t,Math.round)}function yv(e,t){return _v(e,t,Math.floor)}function bv(e,t){return _v(e,t,Math.ceil)}function xv(e){return e=Z(e),e instanceof Error?e:1/Math.cos(e)}function Sv(e){return e=Z(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function Cv(e,t,n,r){if(e=Z(e),t=Z(t),n=Z(n),r=Q(r),X(e,t,n,r))return K;let i=r[0]*e**+t;for(let a=1;a<r.length;a++)i+=r[a]*e**+(t+a*n);return i}function wv(e){return e=Z(e),e instanceof Error?e:e<0?-1:e===0?0:1}function Tv(e){return e=Z(e),e instanceof Error?e:Math.sin(e)}function Ev(e){return e=Z(e),e instanceof Error?e:(Math.exp(e)-Math.exp(-e))/2}function Dv(e){return e=Z(e),e instanceof Error?e:e<0?q:Math.sqrt(e)}function Ov(e){return e=Z(e),e instanceof Error?e:Math.sqrt(e*Math.PI)}function kv(e,t){if(e=Z(e),e instanceof Error)return e;switch(e){case 1:return ng(t);case 2:return dg(t);case 3:return fg(t);case 4:return Lg(t);case 5:return Vg(t);case 6:return dv(t);case 7:return l_.S(t);case 8:return l_.P(t);case 9:return Av(t);case 10:return h_.S(t);case 11:return h_.P(t);case 101:return ng(t);case 102:return dg(t);case 103:return fg(t);case 104:return Lg(t);case 105:return Vg(t);case 106:return dv(t);case 107:return l_.S(t);case 108:return l_.P(t);case 109:return Av(t);case 110:return h_.S(t);case 111:return h_.P(t)}}function Av(){let e=0;return Tm(wm(arguments),t=>{if(e instanceof Error)return!1;if(t instanceof Error)e=t;else if(typeof t==`number`)e+=t;else if(typeof t==`string`){let n=parseFloat(t);!isNaN(n)&&(e+=n)}else if(Array.isArray(t)){let n=Av.apply(null,t);n instanceof Error?e=n:e+=n}}),e}function jv(e,t,n){if(e=Y(e),n=n?Y(n):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let r=0,i=t===`*`,a=i?null:Sm(t+``);for(let t=0;t<e.length;t++){let o=e[t],s=n[t];if(i)r+=o;else{let e=[gm(o,hm)].concat(a);r+=Cm(e)?s:0}}return r}function Mv(){let e=wm(arguments);return e[0]=Em(Y(e[0])),Av(Gm(...e))}function Nv(){if(!arguments||arguments.length===0)return K;let e=arguments.length+1,t=0,n,r,i,a;for(let o=0;o<arguments[0].length;o++)if(arguments[0][o]instanceof Array)for(let i=0;i<arguments[0][o].length;i++){for(n=1,r=1;r<e;r++){let e=arguments[r-1][o][i];if(e instanceof Error)return e;if(a=Z(e),a instanceof Error)return a;n*=a}t+=n}else{for(n=1,r=1;r<e;r++){let e=arguments[r-1][o];if(e instanceof Error)return e;if(i=Z(e),i instanceof Error)return i;n*=i}t+=n}return t}function Pv(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=0,n=e.length;for(let r=0;r<n;r++)t+=th(e[r])?e[r]*e[r]:0;return t}function Fv(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=0;for(let r=0;r<e.length;r++)n+=e[r]*e[r]-t[r]*t[r];return n}function Iv(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=0;e=Q(Y(e)),t=Q(Y(t));for(let r=0;r<e.length;r++)n+=e[r]*e[r]+t[r]*t[r];return n}function Lv(e,t){if(e=Q(Y(e)),t=Q(Y(t)),X(e,t))return K;let n=0;e=Y(e),t=Y(t);for(let r=0;r<e.length;r++)n+=(e[r]-t[r])**2;return n}function Rv(e){return e=Z(e),e instanceof Error?e:Math.tan(e)}function zv(e){if(e=Z(e),e instanceof Error)return e;let t=Math.exp(2*e);return(t-1)/(t+1)}function Bv(e,t){return e=Z(e),t=Z(t),Lm(e,t)||(e>0?1:-1)*Math.floor(Math.abs(e)*10**t)/10**t}function Vv(e,t){return arguments.length===2?(e=Z(e),t=Z(t),Lm(e,t)||e+t):J}function Hv(e,t){return arguments.length===2?(e=Z(e),t=Z(t),Lm(e,t)||(t===0?Xp:e/t)):J}function Uv(e,t){return arguments.length===2?e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e===t):J}function Wv(e,t){return arguments.length===2?e instanceof Error?e:t instanceof Error?t:(Wm(e,t)?(e=Um(e),t=Um(t)):(e=Z(e),t=Z(t)),Lm(e,t)||e>t):J}function Gv(e,t){return arguments.length===2?(Wm(e,t)?(e=Um(e),t=Um(t)):(e=Z(e),t=Z(t)),Lm(e,t)||e>=t):J}function Kv(e,t){return arguments.length===2?(Wm(e,t)?(e=Um(e),t=Um(t)):(e=Z(e),t=Z(t)),Lm(e,t)||e<t):J}function qv(e,t){return arguments.length===2?(Wm(e,t)?(e=Um(e),t=Um(t)):(e=Z(e),t=Z(t)),Lm(e,t)||e<=t):J}function Jv(e,t){return arguments.length===2?(e=Z(e),t=Z(t),Lm(e,t)||e-t):J}function Yv(e,t){return arguments.length===2?(e=Z(e),t=Z(t),Lm(e,t)||e*t):J}function Xv(e,t){return arguments.length===2?e instanceof Error?e:t instanceof Error?t:(e===null&&(e=void 0),t===null&&(t=void 0),e!==t):J}function Zv(e,t){return arguments.length===2?uv(e,t):J}var Qv=Object.freeze({__proto__:null,ADD:Vv,DIVIDE:Hv,EQ:Uv,GT:Wv,GTE:Gv,LT:Kv,LTE:qv,MINUS:Jv,MULTIPLY:Yv,NE:Xv,POW:Zv}),$v=[void 0,0,1,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,1,2,3,4,5,6,0],ey=[[],[1,2,3,4,5,6,7],[7,1,2,3,4,5,6],[6,0,1,2,3,4,5],[],[],[],[],[],[],[],[7,1,2,3,4,5,6],[6,7,1,2,3,4,5],[5,6,7,1,2,3,4],[4,5,6,7,1,2,3],[3,4,5,6,7,1,2],[2,3,4,5,6,7,1],[1,2,3,4,5,6,7]],ty=[[],[6,0],[0,1],[1,2],[2,3],[3,4],[4,5],[5,6],void 0,void 0,void 0,[0,0],[1,1],[2,2],[3,3],[4,4],[5,5],[6,6]];function ny(e,t,n){let r;return e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?r=K:(r=new Date(e,t-1,n),r.getFullYear()<0&&(r=q)),rm?sm(r):r}function ry(e,t,n){n=n.toUpperCase(),e=Vm(e),t=Vm(t);let r=e.getFullYear(),i=e.getMonth(),a=e.getDate(),o=t.getFullYear(),s=t.getMonth(),c=t.getDate(),l;switch(n){case`Y`:l=Math.floor(Dy(e,t));break;case`D`:l=sy(t,e);break;case`M`:l=s-i+12*(o-r),c<a&&l--;break;case`MD`:a<=c?l=c-a:(s===0?(e.setFullYear(o-1),e.setMonth(12)):(e.setFullYear(o),e.setMonth(s-1)),l=sy(t,e));break;case`YM`:l=s-i+12*(o-r),c<a&&l--,l%=12;break;case`YD`:s>i||s===i&&c<a?e.setFullYear(o):e.setFullYear(o-1),l=sy(t,e)}return l}function iy(e){if(typeof e!=`string`||isNaN(Date.parse(e)))return K;let t=new Date(e);return rm?sm(t):t}function ay(e){let t=Vm(e);return t instanceof Error?t:t.getDate()}function oy(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function sy(e,t){return e=Vm(e),t=Vm(t),e instanceof Error?e:t instanceof Error?t:sm(oy(e))-sm(oy(t))}function cy(e,t,n){if(n=Bm(n||`false`),e=Vm(e),t=Vm(t),e instanceof Error)return e;if(t instanceof Error)return t;if(n instanceof Error)return n;let r=e.getMonth(),i=t.getMonth(),a,o;if(n)a=e.getDate()===31?30:e.getDate(),o=t.getDate()===31?30:t.getDate();else{let n=new Date(e.getFullYear(),r+1,0).getDate(),s=new Date(t.getFullYear(),i+1,0).getDate();a=e.getDate()===n?30:e.getDate(),t.getDate()===s?a<30?(i++,o=1):o=30:o=t.getDate()}return 360*(t.getFullYear()-e.getFullYear())+30*(i-r)+(o-a)}function ly(e,t){if(e=Vm(e),e instanceof Error)return e;if(isNaN(t))return K;let n=e.getDate();e.setDate(1),t=parseInt(t,10),e.setMonth(e.getMonth()+t);let r=e.getMonth();if(n>28){let t=[31,28,31,30,31,30,31,31,30,31,30,31][r],i=e.getFullYear();r===1&&(i%4==0&&i%100!=0||i%400==0)&&(t=29),n=Math.min(n,t)}return e.setDate(n),rm?sm(e):e}function uy(e,t){if(e=Vm(e),e instanceof Error)return e;if(isNaN(t))return K;t=parseInt(t,10);let n=new Date(e.getFullYear(),e.getMonth()+t+1,0);return rm?sm(n):n}function dy(e){return e=Vm(e),e instanceof Error?e:e.getHours()}function fy(e){if(e=Vm(e),e instanceof Error)return e;e=oy(e),e.setDate(e.getDate()+4-(e.getDay()||7));let t=new Date(e.getFullYear(),0,1);return Math.ceil(((e-t)/864e5+1)/7)}function py(e){return e=Vm(e),e instanceof Error?e:e.getMinutes()}function my(e){return e=Vm(e),e instanceof Error?e:e.getMonth()+1}function hy(e,t,n){return hy.INTL(e,t,1,n)}hy.INTL=(e,t,n,r)=>{if(e=Vm(e),e instanceof Error)return e;if(t=Vm(t),t instanceof Error)return t;let i=!1,a=[],o=[1,2,3,4,5,6,0],s=RegExp(`^[0|1]{7}$`);if(n===void 0)n=ty[1];else if(typeof n==`string`&&s.test(n)){i=!0,n=n.split(``);for(let e=0;e<n.length;e++)n[e]===`1`&&a.push(o[e])}else n=ty[n];if(!(n instanceof Array))return K;r===void 0?r=[]:r instanceof Array||(r=[r]);for(let e=0;e<r.length;e++){let t=Vm(r[e]);if(t instanceof Error)return t;r[e]=t}let c=Math.round((t-e)/864e5)+1,l=c,u=e;for(let e=0;e<c;e++){let e=new Date().getTimezoneOffset()>0?u.getUTCDay():u.getDay(),t=i?a.includes(e):e===n[0]||e===n[1];for(let e=0;e<r.length;e++){let n=r[e];if(n.getDate()===u.getDate()&&n.getMonth()===u.getMonth()&&n.getFullYear()===u.getFullYear()){t=!0;break}}t&&l--,u.setDate(u.getDate()+1)}return l};function gy(){return rm?sm(new Date):new Date}function _y(e){return e=Vm(e),e instanceof Error?e:e.getSeconds()}function vy(e,t,n){return e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:e<0||t<0||n<0?q:(3600*e+60*t+n)/86400}function yy(e){return e=Vm(e),e instanceof Error?e:(3600*e.getHours()+60*e.getMinutes()+e.getSeconds())/86400}function by(){let e=oy(new Date);return rm?sm(e):e}function xy(e,t){if(e=Vm(e),e instanceof Error)return e;t===void 0&&(t=1);let n=e.getDay();return ey[t][n]}function Sy(e,t){if(e=Vm(e),e instanceof Error)return e;if(t===void 0&&(t=1),t===21)return fy(e);let n=$v[t],r=new Date(e.getFullYear(),0,1),i=+(r.getDay()<n);return r-=Math.abs(r.getDay()-n)*24*60*60*1e3,Math.floor((e-r)/864e5/7+1)+i}function Cy(e,t,n){return Cy.INTL(e,t,1,n)}Cy.INTL=(e,t,n,r)=>{if(e=Vm(e),e instanceof Error)return e;if(t=Z(t),t instanceof Error)return t;if(n=n===void 0?ty[1]:ty[n],!(n instanceof Array))return K;r===void 0?r=[]:r instanceof Array||(r=[r]);for(let e=0;e<r.length;e++){let t=Vm(r[e]);if(t instanceof Error)return t;r[e]=t}let i=0,a=Math.sign(t);for(;i<t*a;){e.setDate(e.getDate()+a);let t=e.getDay();if(t!==n[0]&&t!==n[1]){for(let t=0;t<r.length;t++){let n=r[t];if(n.getDate()===e.getDate()&&n.getMonth()===e.getMonth()&&n.getFullYear()===e.getFullYear()){i--;break}}i++}}return e.getFullYear()<1900?K:e};function wy(e){return e=Vm(e),e instanceof Error?e:e.getFullYear()}function Ty(e){return new Date(e,1,29).getMonth()===1}function Ey(e,t){return Math.ceil((t-e)/1e3/60/60/24)}function Dy(e,t,n){if(e=Vm(e),e instanceof Error)return e;if(t=Vm(t),t instanceof Error)return t;n||=0;let r=e.getDate(),i=e.getMonth()+1,a=e.getFullYear(),o=t.getDate(),s=t.getMonth()+1,c=t.getFullYear();switch(n){case 0:return r===31&&o===31?(r=30,o=30):r===31?r=30:r===30&&o===31&&(o=30),(o+s*30+c*360-(r+i*30+a*360))/360;case 1:{let n=(e,t)=>{let n=e.getFullYear(),r=new Date(n,2,1);if(Ty(n)&&e<r&&t>=r)return!0;let i=t.getFullYear(),a=new Date(i,2,1);return Ty(i)&&t>=a&&e<a},l=365;if(a===c||a+1===c&&(i>s||i===s&&r>=o))return(a===c&&Ty(a)||n(e,t)||s===1&&o===29)&&(l=366),Ey(e,t)/l;let u=c-a+1,d=(new Date(c+1,0,1)-new Date(a,0,1))/1e3/60/60/24/u;return Ey(e,t)/d}case 2:return Ey(e,t)/360;case 3:return Ey(e,t)/365;case 4:return(o+s*30+c*360-(r+i*30+a*360))/360}}function Oy(e){return/^[01]{1,10}$/.test(e)}function ky(e,t){return e=Z(e),t=Z(t),X(e,t)?K:Jp.default.besseli(e,t)}function Ay(e,t){return e=Z(e),t=Z(t),X(e,t)?K:Jp.default.besselj(e,t)}function jy(e,t){return e=Z(e),t=Z(t),X(e,t)?K:Jp.default.besselk(e,t)}function My(e,t){return e=Z(e),t=Z(t),X(e,t)?K:Jp.default.bessely(e,t)}function Ny(e){if(!Oy(e))return q;let t=parseInt(e,2),n=e.toString();return n.length===10&&n.substring(0,1)===`1`?parseInt(n.substring(1),2)-512:t}function Py(e,t){if(!Oy(e))return q;let n=e.toString();if(n.length===10&&n.substring(0,1)===`1`)return(0xfffffffe00+parseInt(n.substring(1),2)).toString(16);let r=parseInt(e,2).toString(16);return t===void 0?r:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=r.length?Hh(`0`,t-r.length)+r:q)}function Fy(e,t){if(!Oy(e))return q;let n=e.toString();if(n.length===10&&n.substring(0,1)===`1`)return(1073741312+parseInt(n.substring(1),2)).toString(8);let r=parseInt(e,2).toString(8);return t===void 0?r:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=r.length?Hh(`0`,t-r.length)+r:q)}function Iy(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?q:e&t}function Ly(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?q:t>=0?e<<t:e>>-t}function Ry(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?q:e|t}function zy(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?q:t>=0?e>>t:e<<-t}function By(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?q:e^t}function Vy(e,t,n){if(e=Z(e),t=Z(t),X(e,t))return e;if(n=n===void 0?`i`:n,n!==`i`&&n!==`j`)return K;if(e===0&&t===0)return 0;if(e===0)return t===1?n:t.toString()+n;if(t===0)return e.toString();{let r=t>0?`+`:``;return e.toString()+r+(t===1?n:t.toString()+n)}}function Hy(e,t,n){if(e=Z(e),e instanceof Error)return e;let r=[[`a.u. of action`,`?`,null,`action`,!1,!1,105457168181818e-48],[`a.u. of charge`,`e`,null,`electric_charge`,!1,!1,160217653141414e-33],[`a.u. of energy`,`Eh`,null,`energy`,!1,!1,435974417757576e-32],[`a.u. of length`,`a?`,null,`length`,!1,!1,529177210818182e-25],[`a.u. of mass`,`m?`,null,`mass`,!1,!1,910938261616162e-45],[`a.u. of time`,`?/Eh`,null,`time`,!1,!1,241888432650516e-31],[`admiralty knot`,`admkn`,null,`speed`,!1,!0,.514773333],[`ampere`,`A`,null,`electric_current`,!0,!1,1],[`ampere per meter`,`A/m`,null,`magnetic_field_intensity`,!0,!1,1],[`ångström`,`Å`,[`ang`],`length`,!1,!0,1e-10],[`are`,`ar`,null,`area`,!1,!0,100],[`astronomical unit`,`ua`,null,`length`,!1,!1,149597870691667e-25],[`bar`,`bar`,null,`pressure`,!1,!1,1e5],[`barn`,`b`,null,`area`,!1,!1,1e-28],[`becquerel`,`Bq`,null,`radioactivity`,!0,!1,1],[`bit`,`bit`,[`b`],`information`,!1,!0,1],[`btu`,`BTU`,[`btu`],`energy`,!1,!0,1055.05585262],[`byte`,`byte`,null,`information`,!1,!0,8],[`candela`,`cd`,null,`luminous_intensity`,!0,!1,1],[`candela per square metre`,`cd/m?`,null,`luminance`,!0,!1,1],[`coulomb`,`C`,null,`electric_charge`,!0,!1,1],[`cubic ångström`,`ang3`,[`ang^3`],`volume`,!1,!0,1e-30],[`cubic foot`,`ft3`,[`ft^3`],`volume`,!1,!0,.028316846592],[`cubic inch`,`in3`,[`in^3`],`volume`,!1,!0,16387064e-12],[`cubic light-year`,`ly3`,[`ly^3`],`volume`,!1,!0,846786664623715e-61],[`cubic metre`,`m3`,[`m^3`],`volume`,!0,!0,1],[`cubic mile`,`mi3`,[`mi^3`],`volume`,!1,!0,4168181825.44058],[`cubic nautical mile`,`Nmi3`,[`Nmi^3`],`volume`,!1,!0,6352182208],[`cubic Pica`,`Pica3`,[`Picapt3`,`Pica^3`,`Picapt^3`],`volume`,!1,!0,7.58660370370369e-8],[`cubic yard`,`yd3`,[`yd^3`],`volume`,!1,!0,.764554857984],[`cup`,`cup`,null,`volume`,!1,!0,.0002365882365],[`dalton`,`Da`,[`u`],`mass`,!1,!1,166053886282828e-41],[`day`,`d`,[`day`],`time`,!1,!0,86400],[`degree`,`°`,null,`angle`,!1,!1,.0174532925199433],[`degrees Rankine`,`Rank`,null,`temperature`,!1,!0,.555555555555556],[`dyne`,`dyn`,[`dy`],`force`,!1,!0,1e-5],[`electronvolt`,`eV`,[`ev`],`energy`,!1,!0,1.60217656514141],[`ell`,`ell`,null,`length`,!1,!0,1.143],[`erg`,`erg`,[`e`],`energy`,!1,!0,1e-7],[`farad`,`F`,null,`electric_capacitance`,!0,!1,1],[`fluid ounce`,`oz`,null,`volume`,!1,!0,295735295625e-16],[`foot`,`ft`,null,`length`,!1,!0,.3048],[`foot-pound`,`flb`,null,`energy`,!1,!0,1.3558179483314],[`gal`,`Gal`,null,`acceleration`,!1,!1,.01],[`gallon`,`gal`,null,`volume`,!1,!0,.003785411784],[`gauss`,`G`,[`ga`],`magnetic_flux_density`,!1,!0,1],[`grain`,`grain`,null,`mass`,!1,!0,647989e-10],[`gram`,`g`,null,`mass`,!1,!0,.001],[`gray`,`Gy`,null,`absorbed_dose`,!0,!1,1],[`gross registered ton`,`GRT`,[`regton`],`volume`,!1,!0,2.8316846592],[`hectare`,`ha`,null,`area`,!1,!0,1e4],[`henry`,`H`,null,`inductance`,!0,!1,1],[`hertz`,`Hz`,null,`frequency`,!0,!1,1],[`horsepower`,`HP`,[`h`],`power`,!1,!0,745.69987158227],[`horsepower-hour`,`HPh`,[`hh`,`hph`],`energy`,!1,!0,2684519.538],[`hour`,`h`,[`hr`],`time`,!1,!0,3600],[`imperial gallon (U.K.)`,`uk_gal`,null,`volume`,!1,!0,.00454609],[`imperial hundredweight`,`lcwt`,[`uk_cwt`,`hweight`],`mass`,!1,!0,50.802345],[`imperial quart (U.K)`,`uk_qt`,null,`volume`,!1,!0,.0011365225],[`imperial ton`,`brton`,[`uk_ton`,`LTON`],`mass`,!1,!0,1016.046909],[`inch`,`in`,null,`length`,!1,!0,.0254],[`international acre`,`uk_acre`,null,`area`,!1,!0,4046.8564224],[`IT calorie`,`cal`,null,`energy`,!1,!0,4.1868],[`joule`,`J`,null,`energy`,!0,!0,1],[`katal`,`kat`,null,`catalytic_activity`,!0,!1,1],[`kelvin`,`K`,[`kel`],`temperature`,!0,!0,1],[`kilogram`,`kg`,null,`mass`,!0,!0,1],[`knot`,`kn`,null,`speed`,!1,!0,.514444444444444],[`light-year`,`ly`,null,`length`,!1,!0,9460730472580800],[`litre`,`L`,[`l`,`lt`],`volume`,!1,!0,.001],[`lumen`,`lm`,null,`luminous_flux`,!0,!1,1],[`lux`,`lx`,null,`illuminance`,!0,!1,1],[`maxwell`,`Mx`,null,`magnetic_flux`,!1,!1,1e-18],[`measurement ton`,`MTON`,null,`volume`,!1,!0,1.13267386368],[`meter per hour`,`m/h`,[`m/hr`],`speed`,!1,!0,.00027777777777778],[`meter per second`,`m/s`,[`m/sec`],`speed`,!0,!0,1],[`meter per second squared`,`m?s??`,null,`acceleration`,!0,!1,1],[`parsec`,`pc`,[`parsec`],`length`,!1,!0,0x6da012f958ee1c],[`meter squared per second`,`m?/s`,null,`kinematic_viscosity`,!0,!1,1],[`metre`,`m`,null,`length`,!0,!0,1],[`miles per hour`,`mph`,null,`speed`,!1,!0,.44704],[`millimetre of mercury`,`mmHg`,null,`pressure`,!1,!1,133.322],[`minute`,`?`,null,`angle`,!1,!1,.000290888208665722],[`minute`,`min`,[`mn`],`time`,!1,!0,60],[`modern teaspoon`,`tspm`,null,`volume`,!1,!0,5e-6],[`mole`,`mol`,null,`amount_of_substance`,!0,!1,1],[`morgen`,`Morgen`,null,`area`,!1,!0,2500],[`n.u. of action`,`?`,null,`action`,!1,!1,105457168181818e-48],[`n.u. of mass`,`m?`,null,`mass`,!1,!1,910938261616162e-45],[`n.u. of speed`,`c?`,null,`speed`,!1,!1,299792458],[`n.u. of time`,`?/(me?c??)`,null,`time`,!1,!1,128808866778687e-35],[`nautical mile`,`M`,[`Nmi`],`length`,!1,!0,1852],[`newton`,`N`,null,`force`,!0,!0,1],[`œrsted`,`Oe `,null,`magnetic_field_intensity`,!1,!1,79.5774715459477],[`ohm`,`Ω`,null,`electric_resistance`,!0,!1,1],[`ounce mass`,`ozm`,null,`mass`,!1,!0,.028349523125],[`pascal`,`Pa`,null,`pressure`,!0,!1,1],[`pascal second`,`Pa?s`,null,`dynamic_viscosity`,!0,!1,1],[`pferdestärke`,`PS`,null,`power`,!1,!0,735.49875],[`phot`,`ph`,null,`illuminance`,!1,!1,1e-4],[`pica (1/6 inch)`,`pica`,null,`length`,!1,!0,.00035277777777778],[`pica (1/72 inch)`,`Pica`,[`Picapt`],`length`,!1,!0,.00423333333333333],[`poise`,`P`,null,`dynamic_viscosity`,!1,!1,.1],[`pond`,`pond`,null,`force`,!1,!0,.00980665],[`pound force`,`lbf`,null,`force`,!1,!0,4.4482216152605],[`pound mass`,`lbm`,null,`mass`,!1,!0,.45359237],[`quart`,`qt`,null,`volume`,!1,!0,.000946352946],[`radian`,`rad`,null,`angle`,!0,!1,1],[`second`,`?`,null,`angle`,!1,!1,484813681109536e-20],[`second`,`s`,[`sec`],`time`,!0,!0,1],[`short hundredweight`,`cwt`,[`shweight`],`mass`,!1,!0,45.359237],[`siemens`,`S`,null,`electrical_conductance`,!0,!1,1],[`sievert`,`Sv`,null,`equivalent_dose`,!0,!1,1],[`slug`,`sg`,null,`mass`,!1,!0,14.59390294],[`square ångström`,`ang2`,[`ang^2`],`area`,!1,!0,1e-20],[`square foot`,`ft2`,[`ft^2`],`area`,!1,!0,.09290304],[`square inch`,`in2`,[`in^2`],`area`,!1,!0,64516e-8],[`square light-year`,`ly2`,[`ly^2`],`area`,!1,!0,895054210748189e17],[`square meter`,`m?`,null,`area`,!0,!0,1],[`square mile`,`mi2`,[`mi^2`],`area`,!1,!0,2589988.110336],[`square nautical mile`,`Nmi2`,[`Nmi^2`],`area`,!1,!0,3429904],[`square Pica`,`Pica2`,[`Picapt2`,`Pica^2`,`Picapt^2`],`area`,!1,!0,1792111111111e-17],[`square yard`,`yd2`,[`yd^2`],`area`,!1,!0,.83612736],[`statute mile`,`mi`,null,`length`,!1,!0,1609.344],[`steradian`,`sr`,null,`solid_angle`,!0,!1,1],[`stilb`,`sb`,null,`luminance`,!1,!1,1e-4],[`stokes`,`St`,null,`kinematic_viscosity`,!1,!1,1e-4],[`stone`,`stone`,null,`mass`,!1,!0,6.35029318],[`tablespoon`,`tbs`,null,`volume`,!1,!0,147868e-10],[`teaspoon`,`tsp`,null,`volume`,!1,!0,492892e-11],[`tesla`,`T`,null,`magnetic_flux_density`,!0,!0,1],[`thermodynamic calorie`,`c`,null,`energy`,!1,!0,4.184],[`ton`,`ton`,null,`mass`,!1,!0,907.18474],[`tonne`,`t`,null,`mass`,!1,!1,1e3],[`U.K. pint`,`uk_pt`,null,`volume`,!1,!0,.00056826125],[`U.S. bushel`,`bushel`,null,`volume`,!1,!0,.03523907],[`U.S. oil barrel`,`barrel`,null,`volume`,!1,!0,.158987295],[`U.S. pint`,`pt`,[`us_pt`],`volume`,!1,!0,.000473176473],[`U.S. survey mile`,`survey_mi`,null,`length`,!1,!0,1609.347219],[`U.S. survey/statute acre`,`us_acre`,null,`area`,!1,!0,4046.87261],[`volt`,`V`,null,`voltage`,!0,!1,1],[`watt`,`W`,null,`power`,!0,!0,1],[`watt-hour`,`Wh`,[`wh`],`energy`,!1,!0,3600],[`weber`,`Wb`,null,`magnetic_flux`,!0,!1,1],[`yard`,`yd`,null,`length`,!1,!0,.9144],[`year`,`yr`,null,`time`,!1,!0,31557600]],i={Yi:[`yobi`,80,12089258196146292e8,`Yi`,`yotta`],Zi:[`zebi`,70,0x400000000000000000,`Zi`,`zetta`],Ei:[`exbi`,60,0x1000000000000000,`Ei`,`exa`],Pi:[`pebi`,50,0x4000000000000,`Pi`,`peta`],Ti:[`tebi`,40,1099511627776,`Ti`,`tera`],Gi:[`gibi`,30,1073741824,`Gi`,`giga`],Mi:[`mebi`,20,1048576,`Mi`,`mega`],ki:[`kibi`,10,1024,`ki`,`kilo`]},a={Y:[`yotta`,1e24,`Y`],Z:[`zetta`,1e21,`Z`],E:[`exa`,0xde0b6b3a7640000,`E`],P:[`peta`,0x38d7ea4c68000,`P`],T:[`tera`,0xe8d4a51000,`T`],G:[`giga`,1e9,`G`],M:[`mega`,1e6,`M`],k:[`kilo`,1e3,`k`],h:[`hecto`,100,`h`],e:[`dekao`,10,`e`],d:[`deci`,.1,`d`],c:[`centi`,.01,`c`],m:[`milli`,.001,`m`],u:[`micro`,1e-6,`u`],n:[`nano`,1e-9,`n`],p:[`pico`,1e-12,`p`],f:[`femto`,1e-15,`f`],a:[`atto`,1e-18,`a`],z:[`zepto`,1e-21,`z`],y:[`yocto`,1e-24,`y`]},o=null,s=null,c=t,l=n,u=1,d=1,f;for(let e=0;e<r.length;e++)f=r[e][2]===null?[]:r[e][2],(r[e][1]===c||f.indexOf(c)>=0)&&(o=r[e]),(r[e][1]===l||f.indexOf(l)>=0)&&(s=r[e]);if(o===null){let e=i[t.substring(0,2)],n=a[t.substring(0,1)];t.substring(0,2)===`da`&&(n=[`dekao`,10,`da`]),e?(u=e[2],c=t.substring(2)):n&&(u=n[1],c=t.substring(n[2].length));for(let e=0;e<r.length;e++)f=r[e][2]===null?[]:r[e][2],(r[e][1]===c||f.indexOf(c)>=0)&&(o=r[e])}if(s===null){let e=i[n.substring(0,2)],t=a[n.substring(0,1)];n.substring(0,2)===`da`&&(t=[`dekao`,10,`da`]),e?(d=e[2],l=n.substring(2)):t&&(d=t[1],l=n.substring(t[2].length));for(let e=0;e<r.length;e++)f=r[e][2]===null?[]:r[e][2],(r[e][1]===l||f.indexOf(l)>=0)&&(s=r[e])}return o===null||s===null||o[3]!==s[3]?J:e*o[6]*u/(s[6]*d)}function Uy(e,t){if(e=Z(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return q;if(e<0)return`1`+Hh(`0`,9-(512+e).toString(2).length)+(512+e).toString(2);let n=parseInt(e,10).toString(2);return t===void 0?n:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=n.length?Hh(`0`,t-n.length)+n:q)}function Wy(e,t){if(e=Z(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return q;if(e<0)return(1099511627776+e).toString(16);let n=parseInt(e,10).toString(16);return t===void 0?n:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=n.length?Hh(`0`,t-n.length)+n:q)}function Gy(e,t){if(e=Z(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return q;if(e<0)return(1073741824+e).toString(8);let n=parseInt(e,10).toString(8);return t===void 0?n:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=n.length?Hh(`0`,t-n.length)+n:q)}function Ky(e,t){return t=t===void 0?0:t,e=Z(e),t=Z(t),X(e,t)?K:+(e===t)}function qy(e,t){return t=t===void 0?0:t,e=Z(e),t=Z(t),X(e,t)?K:G.default.erf(e)}function Jy(e){return isNaN(e)?K:G.default.erfc(e)}function Yy(e,t){return t||=0,e=Z(e),X(t,e)?e:+(e>=t)}function Xy(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return q;let n=e.length===10&&e.substring(0,1).toLowerCase()===`f`,r=n?parseInt(e,16)-1099511627776:parseInt(e,16);if(r<-512||r>511)return q;if(n)return`1`+Hh(`0`,9-(512+r).toString(2).length)+(512+r).toString(2);let i=r.toString(2);return t===void 0?i:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=i.length?Hh(`0`,t-i.length)+i:q)}function Zy(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return q;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function Qy(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return q;let n=parseInt(e,16);if(n>536870911&&n<0xffe0000000)return q;if(n>=0xffe0000000)return(n-0xffc0000000).toString(8);let r=n.toString(8);return t===void 0?r:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=r.length?Hh(`0`,t-r.length)+r:q)}function $y(e){let t=pb(e),n=eb(e);return X(t,n)?K:Math.sqrt(t**2+n**2)}function eb(e){if(e===void 0||e===!0||e===!1)return K;if(e===0||e===`0`)return 0;if([`i`,`j`].indexOf(e)>=0)return 1;e+=``,e=e.replace(`+i`,`+1i`).replace(`-i`,`-1i`).replace(`+j`,`+1j`).replace(`-j`,`-1j`);let t=e.indexOf(`+`),n=e.indexOf(`-`);t===0&&(t=e.indexOf(`+`,1)),n===0&&(n=e.indexOf(`-`,1));let r=e.substring(e.length-1,e.length),i=r===`i`||r===`j`;return t>=0||n>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?q:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,n))||isNaN(e.substring(n+1,e.length-1))?q:-Number(e.substring(n+1,e.length-1)):q:i?isNaN(e.substring(0,e.length-1))?q:e.substring(0,e.length-1):isNaN(e)?q:0}function tb(e){let t=pb(e),n=eb(e);return X(t,n)?K:t===0&&n===0?Xp:t===0&&n>0?Math.PI/2:t===0&&n<0?-Math.PI/2:n===0&&t>0?0:n===0&&t<0?-Math.PI:t>0?Math.atan(n/t):t<0&&n>=0?Math.atan(n/t)+Math.PI:Math.atan(n/t)-Math.PI}function nb(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,n===0?e:Vy(t,-n,r)}function rb(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.cos(t)*(Math.exp(n)+Math.exp(-n))/2,-Math.sin(t)*(Math.exp(n)-Math.exp(-n))/2,r)}function ib(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.cos(n)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(n)*(Math.exp(t)-Math.exp(-t))/2,r)}function ab(e){return X(pb(e),eb(e))?K:ob(rb(e),gb(e))}function ob(e,t){let n=pb(e),r=eb(e),i=pb(t),a=eb(t);if(X(n,r,i,a))return K;let o=e.substring(e.length-1),s=t.substring(t.length-1),c=`i`;if((o===`j`||s===`j`)&&(c=`j`),i===0&&a===0)return q;let l=i*i+a*a;return Vy((n*i+r*a)/l,(r*i-n*a)/l,c)}function sb(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);r=r===`i`||r===`j`?r:`i`;let i=Math.exp(t);return Vy(i*Math.cos(n),i*Math.sin(n),r)}function cb(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.log(Math.sqrt(t*t+n*n)),Math.atan(n/t),r)}function lb(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.log(Math.sqrt(t*t+n*n))/Math.log(10),Math.atan(n/t)/Math.log(10),r)}function ub(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.log(Math.sqrt(t*t+n*n))/Math.log(2),Math.atan(n/t)/Math.log(2),r)}function db(e,t){t=Z(t);let n=pb(e),r=eb(e);if(X(t,n,r))return K;let i=e.substring(e.length-1);i=i===`i`||i===`j`?i:`i`;let a=$y(e)**+t,o=tb(e);return Vy(a*Math.cos(t*o),a*Math.sin(t*o),i)}function fb(){let e=arguments[0];if(!arguments.length)return K;for(let t=1;t<arguments.length;t++){let n=pb(e),r=eb(e),i=pb(arguments[t]),a=eb(arguments[t]);if(X(n,r,i,a))return K;e=Vy(n*i-r*a,n*a+r*i)}return e}function pb(e){if(e===void 0||e===!0||e===!1)return K;if(e===0||e===`0`||[`i`,`+i`,`1i`,`+1i`,`-i`,`-1i`,`j`,`+j`,`1j`,`+1j`,`-j`,`-1j`].indexOf(e)>=0)return 0;e+=``;let t=e.indexOf(`+`),n=e.indexOf(`-`);t===0&&(t=e.indexOf(`+`,1)),n===0&&(n=e.indexOf(`-`,1));let r=e.substring(e.length-1,e.length),i=r===`i`||r===`j`;return t>=0||n>=0?i?t>=0?isNaN(e.substring(0,t))||isNaN(e.substring(t+1,e.length-1))?q:Number(e.substring(0,t)):isNaN(e.substring(0,n))||isNaN(e.substring(n+1,e.length-1))?q:Number(e.substring(0,n)):q:i?isNaN(e.substring(0,e.length-1))?q:0:isNaN(e)?q:e}function mb(e){return e===!0||e===!1||X(pb(e),eb(e))?K:ob(`1`,rb(e))}function hb(e){return X(pb(e),eb(e))?K:ob(`1`,ib(e))}function gb(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.sin(t)*(Math.exp(n)+Math.exp(-n))/2,Math.cos(t)*(Math.exp(n)-Math.exp(-n))/2,r)}function _b(e){let t=pb(e),n=eb(e);if(X(t,n))return K;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Vy(Math.cos(n)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(n)*(Math.exp(t)+Math.exp(-t))/2,r)}function vb(e){if(X(pb(e),eb(e)))return K;let t=e.substring(e.length-1);t=t===`i`||t===`j`?t:`i`;let n=Math.sqrt($y(e)),r=tb(e);return Vy(n*Math.cos(r/2),n*Math.sin(r/2),t)}function yb(e){return e===!0||e===!1?K:X(pb(e),eb(e))?q:ob(`1`,gb(e))}function bb(e){return e===!0||e===!1?K:X(pb(e),eb(e))?q:ob(`1`,_b(e))}function xb(e,t){let n=pb(e),r=eb(e),i=pb(t),a=eb(t);if(X(n,r,i,a))return K;let o=e.substring(e.length-1),s=t.substring(t.length-1),c=`i`;return(o===`j`||s===`j`)&&(c=`j`),Vy(n-i,r-a,c)}function Sb(){if(!arguments.length)return K;let e=Y(arguments),t=0,n=0;for(let r of e){let e=+pb(r),i=+eb(r);if(X(e,i))return K;t+=e,n+=i}return Vy(t,n,`i`)}function Cb(e){return e===!0||e===!1||X(pb(e),eb(e))?K:ob(gb(e),rb(e))}function wb(e,t){if(!/^[0-7]{1,10}$/.test(e))return q;let n=e.length===10&&e.substring(0,1)===`7`,r=n?parseInt(e,8)-1073741824:parseInt(e,8);if(r<-512||r>511)return q;if(n)return`1`+Hh(`0`,9-(512+r).toString(2).length)+(512+r).toString(2);let i=r.toString(2);return t===void 0?i:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=i.length?Hh(`0`,t-i.length)+i:q)}function Tb(e){if(!/^[0-7]{1,10}$/.test(e))return q;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function Eb(e,t){if(!/^[0-7]{1,10}$/.test(e))return q;let n=parseInt(e,8);if(n>=536870912)return`ff`+(n+3221225472).toString(16);let r=n.toString(16);return t===void 0?r:isNaN(t)?K:t<0?q:(t=Math.floor(t),t>=r.length?Hh(`0`,t-r.length)+r:q)}var Db=og.DIST,Ob=og.INV,kb=sg.DIST,Ab=N_.MATH,jb=N_.PRECISE,Mb=cg.DIST,Nb=cg.DIST.RT,Pb=cg.INV,Fb=cg.INV.RT,Ib=cg.TEST,Lb=gg.P,Rb=gg.P,zb=gg.S,Bb=sg.INV,Vb=Jy.PRECISE,Hb=qy.PRECISE,Ub=vg.DIST,Wb=yg.DIST,Gb=yg.DIST.RT,Kb=yg.INV,qb=yg.INV.RT,Jb=Y_.MATH,Yb=Y_.PRECISE,Xb=yg.TEST,Zb=wg.DIST,Qb=wg.INV,$b=Tg.PRECISE,ex=Ag.DIST,tx=Ig.INV,nx=Ig.DIST,rx=Ig.INV,ix=Wg.MULT,ax=Wg.SNGL,ox=Gg.DIST,sx=hy.INTL,cx=Kg.DIST,lx=Kg.INV,ux=Kg.S.DIST,dx=Kg.S.INV,fx=Jg.EXC,px=Jg.INC,mx=Yg.EXC,hx=Yg.INC,gx=$g.DIST,_x=t_.EXC,vx=t_.INC,yx=n_.AVG,bx=n_.EQ,xx=a_.P,Sx=l_.P,Cx=l_.S,wx=Kh.DIST,Tx=Kh.DIST.RT,Ex=Kh.INV,Dx=Kh.TEST,Ox=h_.P,kx=h_.S,Ax=v_.DIST,jx=Cy.INTL,Mx=y_.TEST;function Nx(e){let t=[];return Tm(e,e=>{e&&t.push(e)}),t}function Px(e,t){let n={};for(let t=1;t<e[0].length;++t)n[t]=!0;let r=t[0].length;for(let e=1;e<t.length;++e)t[e].length>r&&(r=t[e].length);for(let i=1;i<e.length;++i)for(let a=1;a<e[i].length;++a){let o=!1,s=!1;for(let n=0;n<t.length;++n){let c=t[n];if(c.length<r)continue;let l=c[0];if(e[i][0]===l){s=!0;for(let t=1;t<c.length;++t)if(!o){if(c[t]===void 0||c[t]===`*`)o=!0;else{let n=Sm(c[t]+``);o=Cm([gm(e[i][a],hm)].concat(n))}}}}s&&(n[a]=n[a]&&o)}let i=[];for(let t=0;t<e[0].length;++t)n[t]&&i.push(t-1);return i}function Fx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=0;return Tm(r,e=>{a+=i[e]}),r.length===0?Xp:a/r.length}function Ix(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),dg(a)}function Lx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),fg(a)}function Rx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];return i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]),r.length===0?K:r.length>1?q:i[r[0]]}function zx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=i[r[0]];return Tm(r,e=>{a<i[e]&&(a=i[e])}),a}function Bx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=i[r[0]];return Tm(r,e=>{a>i[e]&&(a=i[e])}),a}function Vx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];Tm(r,e=>{a.push(i[e])}),a=Nx(a);let o=1;return Tm(a,e=>{o*=e}),o}function Hx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),a=Nx(a),l_.S(a)}function Ux(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),a=Nx(a),l_.P(a)}function Wx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),Av(a)}function Gx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),h_.S(a)}function Kx(e,t,n){if(isNaN(t)&&typeof t!=`string`)return K;let r=Px(e,n),i=[];i=Pm(typeof t==`string`?e[Im(e,t)]:e[t]);let a=[];return Tm(r,e=>{a.push(i[e])}),h_.P(a)}function qx(e){return e&&e.getTime&&!isNaN(e.getTime())}function Jx(e){return e instanceof Date?e:new Date(e)}function Yx(e,t,n){let r=Vm(t);for(r.setFullYear(e.getFullYear()),r<e&&r.setFullYear(r.getFullYear()+1);r>e;)r.setMonth(r.getMonth()+-12/n);return r}function Xx(e){return e=Z(e),[1,2,4].indexOf(e)===-1?q:e}function Zx(e){return e=Z(e),[0,1,2,3,4].indexOf(e)===-1?q:e}function Qx(e,t,n,r,i,a,o){return e=Jx(e),t=Jx(t),n=Jx(n),a=Xx(a),o=Zx(o),Lm(a,o)?q:!qx(e)||!qx(t)||!qx(n)?K:r<=0||i<=0||n<=e?q:(i||=0,o||=0,i*r*Dy(e,n,o))}function $x(e,t,n,r){if(r=Zx(r),n=Xx(n),e=Vm(e),t=Vm(t),Lm(e,t))return K;if(Lm(n,r)||e>=t)return q;if(r===1){let r=Yx(e,t,n),i=Vm(r);return i.setMonth(i.getMonth()+12/n),ry(r,i,`D`)}let i;switch(r){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return q}return i/n}function eS(e,t,n,r,i,a){if(e=Z(e),t=Z(t),n=Z(n),X(e,t,n))return K;if(e<=0||t<=0||n<=0||r<1||i<1||r>i||a!==0&&a!==1)return q;let o=vS(e,t,n,0,a),s=0;r===1&&(a===0&&(s=-n),r++);for(let t=r;t<=i;t++)s+=a===1?cS(e,t-2,o,n,1)-o:cS(e,t-1,o,n,0);return s*=e,s}function tS(e,t,n,r,i,a){if(e=Z(e),t=Z(t),n=Z(n),X(e,t,n))return K;if(e<=0||t<=0||n<=0||r<1||i<1||r>i||a!==0&&a!==1)return q;let o=vS(e,t,n,0,a),s=0;r===1&&(s=a===0?o+n*e:o,r++);for(let t=r;t<=i;t++)s+=a>0?o-(cS(e,t-2,o,n,1)-o)*e:o-cS(e,t-1,o,n,0)*e;return s}function nS(e,t,n,r,i){if(i=i===void 0?12:i,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i))return K;if(e<0||t<0||n<0||r<0||[1,2,3,4,5,6,7,8,9,10,11,12].indexOf(i)===-1||r>n)return q;if(t>=e)return 0;let a=(1-(t/e)**(1/n)).toFixed(3),o=e*a*i/12,s=o,c=0,l=r===n?n-1:r;for(let t=2;t<=l;t++)c=(e-s)*a,s+=c;return r===1?o:r===n?(e-s)*a:c}function rS(e,t,n,r,i){if(i=i===void 0?2:i,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i))return K;if(e<0||t<0||n<0||r<0||i<=0||r>n)return q;if(t>=e)return 0;let a=0,o=0;for(let s=1;s<=r;s++)o=Math.min((e-a)*(i/n),e-t-a),a+=o;return o}function iS(e,t,n,r,i){if(e=Vm(e),t=Vm(t),n=Z(n),r=Z(r),i=Z(i),i||=0,X(e,t,n,r,i))return K;if(n<=0||r<=0)return q;if(e>=t)return K;let a,o;switch(i){case 0:a=360,o=cy(e,t,!1);break;case 1:a=365,o=ry(e,t,`D`);break;case 2:a=360,o=ry(e,t,`D`);break;case 3:a=365,o=ry(e,t,`D`);break;case 4:a=360,o=cy(e,t,!0);break;default:return q}return(r-n)/r*a/o}function aS(e,t){if(e=Z(e),t=Z(t),X(e,t))return K;if(t<0)return q;if(t>=0&&t<1)return Xp;t=parseInt(t,10);let n=parseInt(e,10);n+=e%1*10**Math.ceil(Math.log(t)/Math.LN10)/t;let r=10**(Math.ceil(Math.log(t)/Math.LN2)+1);return n=Math.round(n*r)/r,n}function oS(e,t){if(e=Z(e),t=Z(t),X(e,t))return K;if(t<0)return q;if(t>=0&&t<1)return Xp;t=parseInt(t,10);let n=parseInt(e,10);return n+=e%1*10**-Math.ceil(Math.log(t)/Math.LN10)*t,n}function sS(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<=0||t<1?q:(t=parseInt(t,10),(1+e/t)**+t-1)}function cS(e,t,n,r,i){if(r||=0,i||=0,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i))return K;let a;if(e===0)a=r+n*t;else{let o=(1+e)**+t;a=i===1?r*o+n*(1+e)*(o-1)/e:r*o+n*(o-1)/e}return-a}function lS(e,t){if(e=Z(e),t=Q(Y(t)),X(e,t))return K;let n=t.length,r=e;for(let e=0;e<n;e++)r*=1+t[e];return r}function uS(e,t,n,r,i,a){if(i||=0,a||=0,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),a=Z(a),X(e,t,n,r,i,a))return K;let o=vS(e,n,r,i,a);return(t===1?a===1?0:-r:a===1?cS(e,t-2,o,r,1)-o:cS(e,t-1,o,r,0))*e}function dS(e,t){if(t=typeof t==`number`?t:t===void 0?.1:Z(t),e=Y(e).filter(Km),e=Q(e),X(e,t))return K;let n=new Float64Array(e.length),r=!1,i=!1;for(let t=0;t<e.length;t++)n[t]=e[t],n[t]>0&&(r=!0),n[t]<0&&(i=!0);if(!r||!i)return q;let a=e=>{e<=-1&&(e=-.999999999);let t=n[0],r=1+e,i=1;for(let e=1;e<n.length;e++)i*=r,t+=n[e]/i;return t},o=new Map,s=function(e){let t=Math.round(e*1e10)/1e10;if(o.has(t))return o.get(t);let n=a(t);return o.set(t,n),n};return function(){let e=1e-10,n=1e3,r=t,i=r,a=0;for(;a<n;){let t=s(r);if(Math.abs(t)<e)return r;if(a>0&&Math.abs(r-i)<e*10)break;let n=Math.max(1e-4,Math.abs(r*1e-4)),o=(s(r+n)-t)/n;if(Math.abs(o)<e)break;i=r;let c=t/o,l=Math.max(.1,Math.abs(r)*.5);r-=Math.abs(c)>l?Math.sign(c)*l:c,r<=-1&&(r=-.99999999),r>1e3&&(r=1e3),a++}let o=s(r);if(Math.abs(o)<e)return r;let c,l;if(o>0){for(c=r,l=r+.1;s(l)>0&&l<1e3;)l=l*2+.1;if(l>=1e3)return r}else{for(l=r,c=Math.max(-.99999999,r-.1);s(c)<0&&c>-.99999999;)c=Math.max(-.99999999,c-.1);if(c<=-.99999999)return r}let u;for(let t=0;t<n;t++){u=(c+l)/2;let t=s(u);if(Math.abs(t)<e||Math.abs(l-c)<e)return u;t*s(c)<0?l=u:c=u}return u}()}function fS(e,t,n,r){return e=Z(e),t=Z(t),n=Z(n),r=Z(r),X(e,t,n,r)?K:r*e*(t/n-1)}function pS(e,t,n){if(e=Q(Y(e)),t=Z(t),n=Z(n),X(e,t,n))return K;let r=e.length,i=[],a=[];for(let t=0;t<r;t++)e[t]<0?i.push(e[t]):a.push(e[t]);return(-gS(n,a)*(1+n)**(r-1)/(gS(t,i)*(1+t)))**(1/(r-1))-1}function mS(e,t){return e=Z(e),t=Z(t),X(e,t)?K:e<=0||t<1?q:(t=parseInt(t,10),((e+1)**(1/t)-1)*t)}function hS(e,t,n,r,i){if(i=i===void 0?0:i,r=r===void 0?0:r,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i))return K;if(e===0)return-(n+r)/t;{let a=t*(1+e*i)-r*e,o=n*e+t*(1+e*i);return Math.log(a/o)/Math.log(1+e)}}function gS(){let e=Q(Y(arguments));if(e instanceof Error)return e;let t=e[0],n=0;for(let r=1;r<e.length;r++)n+=e[r]/(1+t)**+r;return n}function _S(e,t,n){return e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:e<=0?q:(Math.log(n)-Math.log(t))/Math.log(1+e)}function vS(e,t,n,r,i){if(r||=0,i||=0,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i))return K;let a;if(e===0)a=(n+r)/t;else{let o=(1+e)**+t;a=i===1?(r*e/(o-1)+n*e/(1-1/o))/(1+e):r*e/(o-1)+n*e/(1-1/o)}return-a}function yS(e,t,n,r,i,a){return i||=0,a||=0,e=Z(e),n=Z(n),r=Z(r),i=Z(i),a=Z(a),X(e,n,r,i,a)?K:vS(e,n,r,i,a)-uS(e,t,n,r,i,a)}function bS(e,t,n,r,i){if(e=Vm(e),t=Vm(t),n=Z(n),r=Z(r),i=Z(i),i||=0,X(e,t,n,r,i))return K;if(n<=0||r<=0)return q;if(e>=t)return K;let a,o;switch(i){case 0:a=360,o=cy(e,t,!1);break;case 1:a=365,o=ry(e,t,`D`);break;case 2:a=360,o=ry(e,t,`D`);break;case 3:a=365,o=ry(e,t,`D`);break;case 4:a=360,o=cy(e,t,!0);break;default:return q}return r-n*r*o/a}function xS(e,t,n,r,i){return r||=0,i||=0,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),X(e,t,n,r,i)?K:e===0?-n*t-r:((1-(1+e)**+t)/e*n*(1+e*i)-r)/(1+e)**+t}function SS(e,t,n,r,i,a){if(a=a===void 0?.1:a,r=r===void 0?0:r,i=i===void 0?0:i,e=Z(e),t=Z(t),n=Z(n),r=Z(r),i=Z(i),a=Z(a),X(e,t,n,r,i,a))return K;let o=1e-10,s=a;i=+!!i;for(let a=0;a<100;a++){if(s<=-1)return q;let a,c;if(Math.abs(s)<o?a=n*(1+e*s)+t*(1+s*i)*e+r:(c=(1+s)**+e,a=n*c+t*(1/s+i)*(c-1)+r),Math.abs(a)<o)return s;let l;if(Math.abs(s)<o)l=n*e+t*i*e;else{c=(1+s)**+e;let r=e*(1+s)**(e-1);l=n*r+t*(1/s+i)*r+t*(-1/(s*s))*(c-1)}s-=a/l}return s}function CS(e,t,n){return e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:e===0||t===0?q:(n/t)**(1/e)-1}function wS(e,t,n){return e=Z(e),t=Z(t),n=Z(n),X(e,t,n)?K:n===0?q:(e-t)/n}function TS(e,t,n,r){return e=Z(e),t=Z(t),n=Z(n),r=Z(r),X(e,t,n,r)?K:n===0||r<1||r>n?q:(r=parseInt(r,10),(e-t)*(n-r+1)*2/(n*(n+1)))}function ES(e,t,n){return e=Vm(e),t=Vm(t),n=Z(n),X(e,t,n)?K:n<=0||e>t||t-e>31536e6?q:365*n/(360-n*cy(e,t,!1))}function DS(e,t,n){return e=Vm(e),t=Vm(t),n=Z(n),X(e,t,n)?K:n<=0||e>t||t-e>31536e6?q:100*(1-n*cy(e,t,!1)/360)}function OS(e,t,n){return e=Vm(e),t=Vm(t),n=Z(n),X(e,t,n)?K:n<=0||e>t||t-e>31536e6?q:(100-n)*360/(n*cy(e,t,!1))}function kS(e,t,n){if(e=Q(Y(e)),t=Hm(Y(t)),n=Z(n),X(e,t,n))return K;let r=(e,t,n)=>{let r=n+1,i=e[0];for(let n=1;n<e.length;n++)i+=e[n]/r**(sy(t[n],t[0])/365);return i},i=(e,t,n)=>{let r=n+1,i=0;for(let n=1;n<e.length;n++){let a=sy(t[n],t[0])/365;i-=a*e[n]/r**+(a+1)}return i},a=!1,o=!1;for(let t=0;t<e.length;t++)e[t]>0&&(a=!0),e[t]<0&&(o=!0);if(!a||!o)return q;n||=.1;let s=n,c=1e-10,l,u,d,f=!0;do d=r(e,t,s),l=s-d/i(e,t,s),u=Math.abs(l-s),s=l,f=u>c&&Math.abs(d)>c;while(f);return s}function AS(e,t,n){if(e=Z(e),t=Q(Y(t)),n=Hm(Y(n)),X(e,t,n))return K;let r=0;for(let i=0;i<t.length;i++)r+=t[i]/(1+e)**(sy(n[i],n[0])/365);return r}function jS(){let e=Y(arguments),t=K;for(let n=0;n<e.length;n++){if(e[n]instanceof Error)return e[n];e[n]!==void 0&&e[n]!==null&&typeof e[n]!=`string`&&(t===K&&(t=!0),e[n]||(t=!1))}return t}function MS(){return!1}function NS(e,t,n){return e instanceof Error?e:(t=arguments.length>=2?t:!0,t??=0,n=arguments.length===3&&n,n??=0,e?t:n)}function PS(){for(let e=0;e<arguments.length/2;e++)if(arguments[e*2])return arguments[e*2+1];return J}function FS(e,t){return Xm(e)?t:e}function IS(e,t){return e===J?t:e}function LS(e){return typeof e==`string`?K:e instanceof Error?e:!e}function RS(){let e=Y(arguments),t=K;for(let n=0;n<e.length;n++){if(e[n]instanceof Error)return e[n];e[n]!==void 0&&e[n]!==null&&typeof e[n]!=`string`&&(t===K&&(t=!1),e[n]&&(t=!0))}return t}function zS(){return!0}function BS(){let e=Y(arguments),t=K;for(let n=0;n<e.length;n++){if(e[n]instanceof Error)return e[n];e[n]!==void 0&&e[n]!==null&&typeof e[n]!=`string`&&(t===K&&(t=0),e[n]&&t++)}return t===K?t:!!(Math.floor(Math.abs(t))&1)}function VS(){let e;if(arguments.length>0){let t=arguments[0],n=arguments.length-1,r=Math.floor(n/2),i=!1,a=n%2!=0,o=n%2==0?null:arguments[arguments.length-1];if(r){for(let n=0;n<r;n++)if(t===arguments[n*2+1]){e=arguments[n*2+2],i=!0;break}}i||(e=a?o:J)}else e=K;return e}var HS={errors:nm,symbols:Qv,date:cm},US=qp;function WS(e){let t=e.split(`.`).reduce((e,t)=>e?.[t],US);if(typeof t!=`function`)throw Error(`@formulajs/formulajs has no ${e}.`);return t}function GS(e){return typeof e==`number`?Number.isFinite(e)?e:P.NUM:e instanceof Error?_n(e.message)??P.VALUE:typeof e==`boolean`||typeof e==`string`?e:P.VALUE}var KS=(e,t)=>{try{return GS(e(...t))}catch{return P.VALUE}};function qS(e,t){return mf([e],t)}function JS(e,t){let n=df(e,t);if(n instanceof N)return n;let r=[];for(let e=0;e<n.rows;e++){let t=[];for(let r=0;r<n.cols;r++){let i=n.at(e,r);if(i instanceof N)return i;t.push(typeof i==`number`?i:0)}r.push(t)}return r}function YS(e,t,n){let r=t.split(`?`)[0]?.length??0,i=t.replace(`?`,``),a=WS(n);U(e,r,i.length,(...e)=>{let t=[];for(let[n,r]of e.entries()){if(r===void 0){t.push(void 0);continue}let e=i.charAt(n),a=e===`n`?H(r):e===`b`?gd(r):hd(r);if(a instanceof N)return a;t.push(a)}return KS(a,t)},{from:`formulajs`})}function XS(e,t,n){let r=t.split(`?`)[0]?.length??0,i=t.replace(`?`,``),a=i.endsWith(`r`),o=WS(n);W(e,r,a?255:i.length,(e,t)=>{let n=[];for(let[r,o]of e.entries()){let s=a&&r>=i.length-1?`r`:i.charAt(r);if(s===`r`){let i=mf(e.slice(r),t);if(i instanceof N)return i;n.push(i);break}if(o instanceof al){n.push(void 0);continue}let c;if(s===`l`)c=qS(o,t);else if(s===`m`)c=JS(o,t);else{let e=t.calc.scalar(o,t.frame);c=s===`n`?H(e):s===`b`?gd(e):hd(e)}if(c instanceof N)return c;n.push(c)}return KS(o,n)},{from:`formulajs`})}function ZS(e,t,n=``,r=1){let i=WS(t),a=n.length;W(e,a+2,a+2,(e,t)=>{let n=[];for(let r of e.slice(0,a)){let e=H(t.calc.scalar(r,t.frame));if(e instanceof N)return e;n.push(e)}let o=df(e[a],t),s=df(e[a+1],t);if(o instanceof N)return o;if(s instanceof N)return s;if(o.rows*o.cols!==s.rows*s.cols)return P.NA;let c=[],l=[];for(let e=0;e<o.rows;e++)for(let t=0;t<o.cols;t++){let n=o.at(e,t),r=s.rows===o.rows?s.at(e,t):s.at(t,e);if(n instanceof N)return n;if(r instanceof N)return r;typeof n==`number`&&typeof r==`number`&&(c.push(n),l.push(r))}if(c.length<r)return P.DIV0;let u=KS(i,[...n,c,l]);return u===P.NUM?P.DIV0:u},{from:`formulajs`})}function QS(e,t,n=!1,r=1,i=P.DIV0){let a=WS(t);W(e,1,255,(e,t)=>{let o=n?hf(e,t):mf(e,t);if(o instanceof N)return o;if(o.length<r)return i;let s=KS(a,[o]);return s===P.NUM&&i===P.DIV0?P.DIV0:s},{from:`formulajs`})}function $S(e){let t=/^([+-]?[\d.]+(?:e[+-]?\d+)?)?(?:([+-]?)([\d.]+(?:e[+-]?\d+)?)?([ij]))?$/iu.exec(e);if(!t)return e;let[,n,r,i,a]=t,o=n===void 0?``:On(Number(n));if(a===void 0)return o;let s=i===void 0?``:On(Number(i));return`${o}${r??``}${s===`1`?``:s}${a}`}function eC(e,t){let n=WS(e);U(e,t.length,t.length,(...e)=>{let r=[];for(let[n,i]of e.entries()){let e=t.charAt(n)===`n`?H(i):hd(i);if(e instanceof N)return e;r.push(e)}let i=KS(n,r);return typeof i==`string`?$S(i):i},{from:`formulajs`})}for(let e of`ABS.ACOS.ACOSH.ACOT.ACOTH.ASIN.ASINH.ATAN.ATANH.COS.COSH.COT.COTH.CSC.CSCH.DEGREES.EVEN.EXP.FACT.FACTDOUBLE.INT.LN.LOG10.ODD.RADIANS.SEC.SECH.SIGN.SIN.SINH.SQRT.SQRTPI.TAN.TANH`.split(`.`))YS(e,`n`,e);for(let e of[`ATAN2`,`COMBIN`,`COMBINA`,`MROUND`,`PERMUT`,`PERMUTATIONA`,`POWER`])YS(e,`nn`,e);YS(`TRUNC`,`n?n`,`TRUNC`),YS(`CEILING`,`nn`,`CEILING`),YS(`FLOOR`,`nn`,`FLOOR`),YS(`CEILING.MATH`,`n?nn`,`CEILINGMATH`),YS(`FLOOR.MATH`,`n?nn`,`FLOORMATH`),YS(`CEILING.PRECISE`,`n?n`,`CEILINGPRECISE`),YS(`FLOOR.PRECISE`,`n?n`,`FLOORPRECISE`),uf(`ISO.CEILING`,`CEILING.PRECISE`),U(`PI`,0,0,()=>Math.PI),W(`RAND`,0,0,(e,t)=>t.calc.random(),{volatile:!0}),W(`RANDBETWEEN`,2,2,(e,t)=>{let n=H(t.calc.scalar(e[0],t.frame)),r=H(t.calc.scalar(e[1],t.frame));if(n instanceof N)return n;if(r instanceof N)return r;let i=Math.ceil(n),a=Math.floor(r);return i>a?P.NUM:i+Math.floor(t.calc.random()*(a-i+1))},{volatile:!0}),QS(`MULTINOMIAL`,`MULTINOMIAL`),QS(`AVEDEV`,`AVEDEV`,!1,1,P.NUM),QS(`DEVSQ`,`DEVSQ`,!1,1,P.NUM),QS(`MEDIAN`,`MEDIAN`,!1,1,P.NUM),QS(`SKEW`,`SKEW`,!1,3),QS(`SKEW.P`,`SKEW.P`,!1,3),QS(`STDEV.S`,`STDEV.S`,!1,2),QS(`STDEV.P`,`STDEV.P`,!1,1),QS(`VAR.S`,`VAR.S`,!1,2),QS(`VAR.P`,`VAR.P`,!1,1),QS(`STDEVA`,`STDEVA`,!0,2),QS(`STDEVPA`,`STDEVPA`,!0,1),QS(`VARA`,`VARA`,!0,2),QS(`VARPA`,`VARPA`,!0,1);for(let[e,t]of[[`STDEV`,`STDEV.S`],[`STDEVP`,`STDEV.P`],[`VAR`,`VAR.S`],[`VARP`,`VAR.P`]])uf(e,t);XS(`LARGE`,`ln`,`LARGE`),XS(`SMALL`,`ln`,`SMALL`),XS(`PERCENTILE.INC`,`ln`,`PERCENTILE.INC`),XS(`PERCENTILE.EXC`,`ln`,`PERCENTILE.EXC`),XS(`PERCENTRANK.INC`,`ln?n`,`PERCENTRANK.INC`),XS(`PERCENTRANK.EXC`,`ln?n`,`PERCENTRANK.EXC`),XS(`QUARTILE.EXC`,`ln`,`QUARTILE.EXC`),XS(`TRIMMEAN`,`ln`,`TRIMMEAN`),uf(`PERCENTILE`,`PERCENTILE.INC`),uf(`PERCENTRANK`,`PERCENTRANK.INC`),ZS(`CORREL`,`CORREL`),ZS(`PEARSON`,`PEARSON`),ZS(`RSQ`,`RSQ`),ZS(`SLOPE`,`SLOPE`),ZS(`INTERCEPT`,`INTERCEPT`),ZS(`STEYX`,`STEYX`,``,3),ZS(`COVARIANCE.P`,`COVARIANCE.P`),ZS(`COVARIANCE.S`,`COVARIANCE.S`,``,2),ZS(`FORECAST`,`FORECAST`,`n`),uf(`FORECAST.LINEAR`,`FORECAST`),uf(`COVAR`,`COVARIANCE.P`),YS(`PMT`,`nnn?nn`,`PMT`),YS(`PPMT`,`nnnn?nn`,`PPMT`),YS(`IPMT`,`nnnn?nn`,`IPMT`),YS(`FV`,`nnn?nn`,`FV`),YS(`PV`,`nnn?nn`,`PV`),YS(`NPER`,`nnn?nn`,`NPER`),YS(`RATE`,`nnn?nnn`,`RATE`),YS(`SYD`,`nnnn`,`SYD`),YS(`DB`,`nnnn?n`,`DB`),YS(`DDB`,`nnnn?n`,`DDB`),YS(`ISPMT`,`nnnn`,`ISPMT`),YS(`EFFECT`,`nn`,`EFFECT`),YS(`NOMINAL`,`nn`,`NOMINAL`),YS(`CUMIPMT`,`nnnnnn`,`CUMIPMT`),YS(`CUMPRINC`,`nnnnnn`,`CUMPRINC`),YS(`DOLLARDE`,`nn`,`DOLLARDE`),YS(`DOLLARFR`,`nn`,`DOLLARFR`),YS(`PDURATION`,`nnn`,`PDURATION`),YS(`RRI`,`nnn`,`RRI`),XS(`IRR`,`l?n`,`IRR`),XS(`MIRR`,`lnn`,`MIRR`),XS(`NPV`,`nr`,`NPV`),XS(`FVSCHEDULE`,`nl`,`FVSCHEDULE`);for(let e of[`BIN2DEC`,`HEX2DEC`,`OCT2DEC`,`IMABS`,`IMAGINARY`,`IMARGUMENT`,`IMREAL`])YS(e,`t`,e);for(let e of[`IMCONJUGATE`,`IMCOS`,`IMCOSH`,`IMCOT`,`IMCSC`,`IMCSCH`,`IMEXP`,`IMLN`,`IMLOG10`,`IMLOG2`,`IMSEC`,`IMSECH`,`IMSIN`,`IMSINH`,`IMSQRT`,`IMTAN`])eC(e,`t`);for(let e of[`BIN2OCT`,`HEX2BIN`,`HEX2OCT`,`OCT2BIN`])YS(e,`t?n`,e);for(let e of[`DEC2BIN`,`DEC2OCT`])YS(e,`n?n`,e);for(let[e,t]of[[`BIN2HEX`,`t`],[`OCT2HEX`,`t`],[`DEC2HEX`,`n`]]){let n=WS(e);U(e,1,2,(e,r)=>{let i=t===`n`?H(e):hd(e);if(i instanceof N)return i;let a=r===void 0?void 0:H(r);if(a instanceof N)return a;let o=KS(n,[i,a]);return typeof o==`string`?o.toUpperCase():o},{from:`formulajs`})}eC(`IMDIV`,`tt`),eC(`IMSUB`,`tt`),eC(`IMPOWER`,`tn`),YS(`COMPLEX`,`nn?t`,`COMPLEX`),YS(`DECIMAL`,`tn`,`DECIMAL`),YS(`ARABIC`,`t`,`ARABIC`);for(let e of[`IMSUM`,`IMPRODUCT`]){let t=WS(e);W(e,1,255,(e,n)=>{let r=[];for(let t of e){let e=hd(n.calc.scalar(t,n.frame));if(e instanceof N)return e;r.push(e)}let i=KS(t,r);return typeof i==`string`?$S(i):i},{from:`formulajs`})}YS(`CONVERT`,`ntt`,`CONVERT`),YS(`DELTA`,`n?n`,`DELTA`),YS(`GESTEP`,`n?n`,`GESTEP`);var tC=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.00016431823292116355,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],nC=607/128,rC=.5*Math.log(2*Math.PI);function iC(e){if(Number.isInteger(e)&&e<=171)return Math.log(aC(e));let t=tC[0]??0;for(let n=1;n<tC.length;n++)t+=(tC[n]??0)/(e+n);let n=e+nC+.5;return rC+Math.log(t/e)+(e+.5)*Math.log(n)-n}function aC(e){if(e<=0&&Number.isInteger(e))return NaN;if(Number.isInteger(e)&&e<=171){let t=1;for(let n=2;n<e;n++)t*=n;return t}return e<.5?Math.PI/(Math.sin(Math.PI*e)*aC(1-e)):Math.exp(iC(e))}var oC=1e-16,sC=1e-300,cC=1e5;function lC(e,t){if(t<=0)return 0;if(t<e+1){let n=1/e,r=n,i=e;for(let e=0;e<cC&&(i+=1,n*=t/i,r+=n,!(Math.abs(n)<Math.abs(r)*oC));e++);return r*Math.exp(-t+e*Math.log(t)-iC(e))}return 1-uC(e,t)}function uC(e,t){if(t<=0)return 1;if(t<e+1)return 1-lC(e,t);let n=t+1-e,r=1/sC,i=1/n,a=i;for(let t=1;t<cC;t++){let o=-t*(t-e);n+=2,i=o*i+n,Math.abs(i)<sC&&(i=sC),r=n+o/r,Math.abs(r)<sC&&(r=sC),i=1/i;let s=i*r;if(a*=s,Math.abs(s-1)<oC)break}return Math.exp(-t+e*Math.log(t)-iC(e))*a}function dC(e,t,n){let r=e+t,i=e+1,a=e-1,o=1,s=1-r*n/i;Math.abs(s)<sC&&(s=sC),s=1/s;let c=s;for(let l=1;l<cC;l++){let u=2*l,d=l*(t-l)*n/((a+u)*(e+u));s=1+d*s,Math.abs(s)<sC&&(s=sC),o=1+d/o,Math.abs(o)<sC&&(o=sC),s=1/s,c*=s*o,d=-(e+l)*(r+l)*n/((e+u)*(i+u)),s=1+d*s,Math.abs(s)<sC&&(s=sC),o=1+d/o,Math.abs(o)<sC&&(o=sC),s=1/s;let f=s*o;if(c*=f,Math.abs(f-1)<oC)break}return c}function fC(e,t,n){if(n<=0)return 0;if(n>=1)return 1;let r=Math.exp(iC(e+t)-iC(e)-iC(t)+e*Math.log(n)+t*Math.log1p(-n));return n<(e+1)/(e+t+2)?r*dC(e,t,n)/e:1-r*dC(t,e,1-n)/t}var pC=e=>e===0?0:(e<0?-1:1)*lC(.5,e*e),mC=e=>e<0?2-mC(-e):uC(.5,e*e),hC=e=>Math.exp(-e*e/2)/Math.sqrt(2*Math.PI),gC=e=>mC(-e/Math.SQRT2)/2,_C=(e,t)=>e.reduce((e,n)=>e*t+n,0),vC={a:[2509.0859296330846,33430.57558358813,67265.7709270087,45921.95393154987,13731.69376550946,1971.5909503065513,133.14166789178438,3.3871328727963665],b:[5226.495278852854,28729.085735721943,39307.89580009271,21213.794301586597,5394.196021424751,687.1870074920579,42.31333070160091,1],c:[.0007745450142783414,.022723844989269184,.2417807251774506,1.2704582524523684,3.6478483247632045,5.769497221460691,4.630337846156546,1.4234371107496837],d:[1.0507500716444169e-9,.0005475938084995344,.015198666563616457,.14810397642748008,.6897673349851,1.6763848301838038,2.053191626637759,1],e:[2.0103343992922881e-7,27115555687434876e-21,.0012426609473880784,.026532189526576124,.29656057182850487,1.7848265399172913,5.463784911164114,6.657904643501104],f:[20442631033899397e-31,1.421511758316446e-7,18463183175100548e-21,.0007868691311456133,.014875361290850615,.1369298809227358,.599832206555888,1]};function yC(e){let t=e-.5;if(t===0)return 0;if(Math.abs(t)<=.425){let e=.180625-t*t;return t*_C(vC.a,e)/_C(vC.b,e)}let n=t<0?e:1-e,r=Math.sqrt(-Math.log(n)),i=r<=5?_C(vC.c,r-1.6)/_C(vC.d,r-1.6):_C(vC.e,r-5)/_C(vC.f,r-5);return t<0?-i:i}function bC(e,t,n,r,i=1/0){let a=n,o=Math.min(r,i);for(;e(o)<t&&o<i;)a=o,o=Math.min(o*2+1,i);for(let n=0;n<400;n++){let n=(a+o)/2;if(n===a||n===o)return n;e(n)<t?a=n:o=n}return(a+o)/2}function xC(e,t,n,r){let i=(n-t)/r,a=e(t)+e(n);for(let n=1;n<r;n++)a+=e(t+n*i)*(n%2==1?4:2);return a*i/3}var SC=4e4;function CC(e,t){let n=Math.max(256,4*Math.ceil(Math.abs(t)+e)+256),r=Math.PI/n,i=.5*(Math.cos(0)+Math.cos(e*Math.PI));for(let a=1;a<n;a++){let n=a*r;i+=Math.cos(e*n-t*Math.sin(n))}return i*r/Math.PI}function wC(e,t){let n=xC(n=>Math.sin(t*Math.sin(n)-e*n),0,Math.PI,SC),r=Math.asinh((760+2*e*e)/t)+2,i=e%2==0?1:-1;return(n-xC(n=>(Math.exp(e*n)+i*Math.exp(-e*n))*Math.exp(-t*Math.sinh(n)),0,r,SC))/Math.PI}function TC(e,t){let n=Math.max(256,4*Math.ceil(Math.abs(t)+e)+256),r=Math.PI/n,i=.5*(Math.exp(t)+Math.exp(-t)*Math.cos(e*Math.PI));for(let a=1;a<n;a++){let n=a*r;i+=Math.exp(t*Math.cos(n))*Math.cos(e*n)}return i*r/Math.PI}function EC(e,t){let n=Math.acosh(760/t+1)+2+e,r=4096,i=n/r,a=.5*Math.exp(-t);for(let n=1;n<=r;n++){let r=n*i;a+=Math.exp(-t*Math.cosh(r))*Math.cosh(e*r)}return a*i}function DC(e,t,n,r){U(e,t,n,(...e)=>{let t=[];for(let n of e){let e=n===void 0?NaN:H(n);if(e instanceof N)return e;t.push(e)}return r(...t)})}function OC(e,t,n,r=0){U(e,t+1,t+1+r,(...e)=>{let r=gd(e[t]);if(r instanceof N)return r;let i=[];for(let[n,r]of e.entries()){if(n===t)continue;let e=r===void 0?NaN:H(r);if(e instanceof N)return e;i.push(e)}return n(r,...i)})}var kC=e=>Number.isFinite(e)?e:P.NUM;OC(`NORM.DIST`,3,(e,t=0,n=0,r=0)=>{if(r<=0)return P.NUM;let i=(t-n)/r;return e?gC(i):hC(i)/r}),DC(`NORM.INV`,3,3,(e=0,t=0,n=0)=>e<=0||e>=1||n<=0?P.NUM:t+n*yC(e)),U(`NORM.S.DIST`,1,2,(e,t)=>{let n=H(e);if(n instanceof N)return n;let r=t===void 0||gd(t);return r instanceof N?r:r?gC(n):hC(n)}),DC(`NORMSDIST`,1,1,(e=0)=>gC(e)),DC(`NORM.S.INV`,1,1,(e=0)=>e<=0||e>=1?P.NUM:yC(e)),OC(`LOGNORM.DIST`,3,(e,t=0,n=0,r=0)=>{if(t<=0||r<=0)return P.NUM;let i=(Math.log(t)-n)/r;return e?gC(i):hC(i)/(t*r)}),DC(`LOGNORMDIST`,3,3,(e=0,t=0,n=0)=>e<=0||n<=0?P.NUM:gC((Math.log(e)-t)/n)),DC(`LOGNORM.INV`,3,3,(e=0,t=0,n=0)=>e<=0||e>=1||n<=0?P.NUM:Math.exp(t+n*yC(e))),DC(`STANDARDIZE`,3,3,(e=0,t=0,n=0)=>n<=0?P.NUM:(e-t)/n),DC(`GAUSS`,1,1,(e=0)=>gC(e)-.5),DC(`PHI`,1,1,(e=0)=>hC(e)),DC(`FISHER`,1,1,(e=0)=>e<=-1||e>=1?P.NUM:.5*Math.log((1+e)/(1-e))),DC(`FISHERINV`,1,1,(e=0)=>{let t=Math.exp(2*e);return(t-1)/(t+1)}),DC(`CONFIDENCE.NORM`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(n);return e<=0||e>=1||t<=0||r<1?P.NUM:yC(1-e/2)*t/Math.sqrt(r)});var AC=(e,t)=>fC(t/2,.5,t/(t+e*e)),jC=(e,t)=>e<0?AC(e,t)/2:1-AC(e,t)/2;OC(`T.DIST`,2,(e,t=0,n=0)=>{let r=Math.trunc(n);return r<1?P.NUM:e?jC(t,r):Math.exp(iC((r+1)/2)-iC(r/2))/Math.sqrt(r*Math.PI)*(1+t*t/r)**(-(r+1)/2)}),DC(`T.DIST.2T`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<0||n<1?P.NUM:AC(e,n)}),DC(`T.DIST.RT`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return n<1?P.NUM:e<0?1-AC(e,n)/2:AC(e,n)/2}),DC(`TDIST`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(t),i=Math.trunc(n);return e<0||r<1||i!==1&&i!==2?P.NUM:AC(e,r)*i/2}),DC(`T.INV`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<=0||e>=1||n<1?P.NUM:e===.5?0:e<.5?-MC(2*e,n):MC(2*(1-e),n)});var MC=(e,t)=>bC(e=>-AC(e,t),-e,0,1);DC(`T.INV.2T`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<=0||e>1||n<1?P.NUM:MC(e,n)}),DC(`CONFIDENCE.T`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(n);return e<=0||e>=1||t<=0||r<1?P.NUM:r===1?P.DIV0:MC(e,r-1)*t/Math.sqrt(r)}),OC(`CHISQ.DIST`,2,(e,t=0,n=0)=>{let r=Math.trunc(n);return t<0||r<1?P.NUM:e?lC(r/2,t/2):t===0?r===2?.5:r<2?P.NUM:0:Math.exp((r/2-1)*Math.log(t)-t/2-r/2*Math.LN2-iC(r/2))}),DC(`CHISQ.DIST.RT`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<0||n<1?P.NUM:uC(n/2,e/2)}),DC(`CHISQ.INV`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<0||e>=1||n<1?P.NUM:e===0?0:bC(e=>lC(n/2,e/2),e,0,n)}),DC(`CHISQ.INV.RT`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<=0||e>1||n<1?P.NUM:e===1?0:bC(e=>-uC(n/2,e/2),-e,0,n)});var NC=(e,t,n)=>fC(t/2,n/2,t*e/(t*e+n)),PC=(e,t,n)=>fC(n/2,t/2,n/(t*e+n));OC(`F.DIST`,3,(e,t=0,n=0,r=0)=>{let i=Math.trunc(n),a=Math.trunc(r);if(t<0||i<1||a<1)return P.NUM;if(e)return NC(t,i,a);if(t===0)return i===2?1:i<2?P.NUM:0;let o=iC((i+a)/2)-iC(i/2)-iC(a/2)+i/2*Math.log(i/a)+(i/2-1)*Math.log(t)-(i+a)/2*Math.log(1+i*t/a);return Math.exp(o)}),DC(`F.DIST.RT`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(t),i=Math.trunc(n);return e<0||r<1||i<1?P.NUM:PC(e,r,i)}),DC(`F.INV`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(t),i=Math.trunc(n);return e<0||e>1||r<1||i<1?P.NUM:e===0?0:e===1?P.NUM:bC(e=>NC(e,r,i),e,0,1)}),DC(`F.INV.RT`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(t),i=Math.trunc(n);return e<=0||e>1||r<1||i<1?P.NUM:e===1?0:bC(e=>-PC(e,r,i),-e,0,1)}),OC(`GAMMA.DIST`,3,(e,t=0,n=0,r=0)=>t<0||n<=0||r<=0?P.NUM:e?lC(n,t/r):t===0?n===1?1/r:n<1?P.NUM:0:Math.exp((n-1)*Math.log(t)-t/r-n*Math.log(r)-iC(n))),DC(`GAMMA.INV`,3,3,(e=0,t=0,n=0)=>e<0||e>=1||t<=0||n<=0?P.NUM:e===0?0:n*bC(e=>lC(t,e),e,0,t));var FC=(e,t,n)=>Math.exp(iC(t+n)-iC(t)-iC(n)+(t-1)*Math.log(e)+(n-1)*Math.log1p(-e));OC(`BETA.DIST`,3,(e,t=0,n=0,r=0,i=0,a=1)=>{let o=Number.isNaN(i)?0:i,s=Number.isNaN(a)?1:a;if(n<=0||r<=0||t<o||t>s||o===s)return P.NUM;let c=(t-o)/(s-o);return e?fC(n,r,c):FC(c,n,r)/(s-o)},2),DC(`BETADIST`,3,5,(e=0,t=0,n=0,r=0,i=1)=>{let a=Number.isNaN(r)?0:r,o=Number.isNaN(i)?1:i;return t<=0||n<=0||e<a||e>o||a===o?P.NUM:fC(t,n,(e-a)/(o-a))}),DC(`BETA.INV`,3,5,(e=0,t=0,n=0,r=0,i=1)=>{let a=Number.isNaN(r)?0:r,o=Number.isNaN(i)?1:i;return e<=0||e>1||t<=0||n<=0||a>=o?P.NUM:a+(o-a)*bC(e=>fC(t,n,e),e,0,.5,1)}),uf(`BETAINV`,`BETA.INV`);var IC=(e,t)=>iC(e+1)-iC(t+1)-iC(e-t+1),LC=(e,t,n)=>n===0?+(e===0):n===1?+(e===t):Math.exp(IC(t,e)+e*Math.log(n)+(t-e)*Math.log1p(-n)),RC=(e,t,n)=>e>=t||n===0?1:n===1?0:1-fC(e+1,t-e,n);OC(`BINOM.DIST`,3,(e,t=0,n=0,r=0)=>{let i=Math.trunc(t),a=Math.trunc(n);return i<0||i>a||r<0||r>1?P.NUM:e?RC(i,a,r):LC(i,a,r)}),DC(`BINOM.INV`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(e);if(r<0||t<=0||t>=1||n<=0||n>=1)return P.NUM;for(let e=0;e<r;e++)if(RC(e,r,t)>=n)return e;return r}),DC(`BINOM.DIST.RANGE`,3,4,(e=0,t=0,n=0,r=NaN)=>{let i=Math.trunc(e),a=Math.trunc(n),o=Number.isNaN(r)?a:Math.trunc(r);if(i<0||t<0||t>1||a<0||a>i||o<a||o>i)return P.NUM;let s=0;for(let e=a;e<=o;e++)s+=LC(e,i,t);return s}),OC(`NEGBINOM.DIST`,3,(e,t=0,n=0,r=0)=>{let i=Math.trunc(t),a=Math.trunc(n);return i<0||a<1||r<0||r>1?P.NUM:e?fC(a,i+1,r):r===0||r===1?+(r===1&&i===0):Math.exp(IC(i+a-1,a-1)+a*Math.log(r)+i*Math.log1p(-r))}),DC(`NEGBINOMDIST`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(e),i=Math.trunc(t);return r<0||i<1||n<0||n>1?P.NUM:n===0||n===1?+(n===1&&r===0):Math.exp(IC(r+i-1,i-1)+i*Math.log(n)+r*Math.log1p(-n))}),OC(`POISSON.DIST`,2,(e,t=0,n=0)=>{let r=Math.trunc(t);return r<0||n<0?P.NUM:n===0?e||r===0?1:0:e?uC(r+1,n):Math.exp(r*Math.log(n)-n-iC(r+1))}),OC(`EXPON.DIST`,2,(e,t=0,n=0)=>t<0||n<=0?P.NUM:e?-Math.expm1(-n*t):n*Math.exp(-n*t)),OC(`WEIBULL.DIST`,3,(e,t=0,n=0,r=0)=>{if(t<0||n<=0||r<=0)return P.NUM;let i=(t/r)**n;return e?-Math.expm1(-i):n/r**n*t**(n-1)*Math.exp(-i)});var zC=(e,t,n,r)=>Math.exp(IC(n,e)+IC(r-n,t-e)-IC(r,t));OC(`HYPGEOM.DIST`,4,(e,t=0,n=0,r=0,i=0)=>{let a=Math.trunc(t),o=Math.trunc(n),s=Math.trunc(r),c=Math.trunc(i);if(a<0||a>o||a>s||o>c||s>c||o<=0||s<=0||c<=0||a<o-c+s)return P.NUM;if(!e)return zC(a,o,s,c);let l=0;for(let e=Math.max(0,o-c+s);e<=a;e++)l+=zC(e,o,s,c);return Math.min(1,l)}),DC(`HYPGEOMDIST`,4,4,(e=0,t=0,n=0,r=0)=>{let i=Math.trunc(e),a=Math.trunc(t),o=Math.trunc(n),s=Math.trunc(r);return i<0||i>a||i>o||a>s||o>s||i<a-s+o?P.NUM:zC(i,a,o,s)}),DC(`GAMMA`,1,1,(e=0)=>kC(aC(e))),DC(`GAMMALN`,1,1,(e=0)=>e<=0?P.NUM:iC(e)),uf(`GAMMALN.PRECISE`,`GAMMALN`),DC(`ERF`,1,2,(e=0,t=NaN)=>Number.isNaN(t)?pC(e):pC(t)-pC(e)),DC(`ERFC`,1,1,(e=0)=>mC(e)),uf(`ERF.PRECISE`,`ERF`),uf(`ERFC.PRECISE`,`ERFC`);for(let[e,t]of[[`NORMDIST`,`NORM.DIST`],[`NORMINV`,`NORM.INV`],[`NORMSINV`,`NORM.S.INV`],[`LOGINV`,`LOGNORM.INV`],[`CHIINV`,`CHISQ.INV.RT`],[`CHIDIST`,`CHISQ.DIST.RT`],[`FDIST`,`F.DIST.RT`],[`FINV`,`F.INV.RT`],[`BINOMDIST`,`BINOM.DIST`],[`CRITBINOM`,`BINOM.INV`],[`POISSON`,`POISSON.DIST`],[`EXPONDIST`,`EXPON.DIST`],[`GAMMADIST`,`GAMMA.DIST`],[`GAMMAINV`,`GAMMA.INV`],[`TINV`,`T.INV.2T`],[`WEIBULL`,`WEIBULL.DIST`],[`CONFIDENCE`,`CONFIDENCE.NORM`]])uf(e,t);var BC=2**48;function VC(e,t){let[n=`0`,r=`0`]=e.toExponential().split(`e`);return Number(`${n}e${String(Number(r)+t)}`)}var HC=e=>Number(e.toPrecision(15));function UC(e,t,n){let r=Math.trunc(t),i=VC(Math.abs(HC(e)),r);if(i>=2**53)return e;let a=VC(n(i),-r);return e<0?-a:a}U(`ROUND`,2,2,gf((e=0,t=0)=>UC(e,t,e=>Math.floor(e+.5)))),U(`ROUNDUP`,2,2,gf((e=0,t=0)=>UC(e,t,Math.ceil))),U(`ROUNDDOWN`,2,2,gf((e=0,t=0)=>UC(e,t,Math.floor))),U(`MOD`,2,2,gf((e=0,t=0)=>{if(t===0)return P.DIV0;let n=e%t;return n!==0&&n<0!=t<0?n+t:n})),U(`QUOTIENT`,2,2,gf((e=0,t=0)=>t===0?P.DIV0:Math.trunc(e/t))),U(`POWER`,2,2,gf((e=0,t=0)=>{if(e===0&&t===0)return P.NUM;if(e===0&&t<0)return P.DIV0;let n=e**t;return Number.isFinite(n)?n:P.NUM})),U(`LOG`,1,2,(e,t)=>{let n=H(e),r=t==null?10:H(t);return n instanceof N?n:r instanceof N?r:n<=0||r<=0?P.NUM:r===1?P.DIV0:r===10?Math.log10(n):r===2?Math.log2(n):Math.log(n)/Math.log(r)});function WC(e,t){let[n,r]=[e,t];for(;r!==0;)[n,r]=[r,n%r];return n}function GC(e,t){let n=mf(e,t);if(n instanceof N)return n;let r=n.map(Math.trunc);return r.some(e=>e<0||e>=2**53)?P.NUM:r}W(`GCD`,1,255,(e,t)=>{let n=GC(e,t);return n instanceof N?n:n.reduce(WC,0)}),W(`LCM`,1,255,(e,t)=>{let n=GC(e,t);if(n instanceof N)return n;if(n.includes(0))return 0;let r=n.reduce((e,t)=>e*t/WC(e,t),1);return Number.isFinite(r)?r:P.NUM}),U(`BASE`,2,3,gf((e=0,t=0,n=NaN)=>{let r=Math.trunc(e),i=Math.trunc(t),a=Number.isNaN(n)?0:Math.trunc(n);return r<0||r>=2**53||i<2||i>36||a<0||a>255?P.NUM:r.toString(i).toUpperCase().padStart(a,`0`)}));var KC=`MDCLXVI`,qC=[1e3,500,100,50,10,5,1];function JC(e,t){let n=e=>qC[e]??1,r=e=>KC.charAt(e),i=qC.length-1,a=e,o=``;for(let e=0;e<=i/2;e++){let s=2*e,c=Math.floor(a/n(s));if(c%5==4){let e=c===4?s-1:s-2,l=s,u=0;for(;u<t&&l<i;)u+=1,n(e)-n(l+1)<=a?l+=1:u=t;o+=r(l)+r(e),a+=n(l)-n(e)}else c>4&&(o+=r(s-1)),o+=r(s).repeat(c%5),a%=n(s)}return o}U(`ROMAN`,1,2,(e,t)=>{let n=H(e);if(n instanceof N)return n;let r=0;if(typeof t==`boolean`)r=t?0:4;else if(t!=null){let e=H(t);if(e instanceof N)return e;r=Math.trunc(e)}let i=Math.trunc(n);return i<0||i>3999||r<0||r>4?P.VALUE:JC(i,r)});function YC(e){return!Number.isInteger(e)||e<0||e>=BC?P.NUM:BigInt(e)}for(let[e,t]of[[`BITAND`,(e,t)=>e&t],[`BITOR`,(e,t)=>e|t],[`BITXOR`,(e,t)=>e^t]])U(e,2,2,gf((e=0,n=0)=>{let r=YC(e),i=YC(n);return r instanceof N?r:i instanceof N?i:Number(t(r,i))}));for(let[e,t]of[[`BITLSHIFT`,1],[`BITRSHIFT`,-1]])U(e,2,2,gf((e=0,n=0)=>{let r=YC(e);if(r instanceof N)return r;let i=Math.trunc(n)*t;if(Math.abs(i)>53)return P.NUM;let a=i>=0?r<<BigInt(i):r>>BigInt(-i);return a>=BigInt(BC)?P.NUM:Number(a)}));for(let[e,t,n]of[[`BESSELJ`,CC,!1],[`BESSELI`,TC,!1],[`BESSELY`,wC,!0],[`BESSELK`,EC,!0]])U(e,2,2,gf((e=0,r=0)=>{let i=Math.trunc(r);if(i<0||n&&e<=0)return P.NUM;let a=t(i,e);return Number.isFinite(a)?a:P.NUM}));U(`SLN`,3,3,gf((e=0,t=0,n=0)=>n===0?P.DIV0:(e-t)/n)),W(`GEOMEAN`,1,255,(e,t)=>{let n=mf(e,t);return n instanceof N?n:n.length===0||n.some(e=>e<=0)?P.NUM:Math.exp(n.reduce((e,t)=>e+Math.log(t),0)/n.length)}),W(`HARMEAN`,1,255,(e,t)=>{let n=mf(e,t);return n instanceof N?n:n.length===0||n.some(e=>e<=0)?P.NUM:n.length/n.reduce((e,t)=>e+1/t,0)}),W(`KURT`,1,255,(e,t)=>{let n=mf(e,t);if(n instanceof N)return n;let r=n.length;if(r<4)return P.DIV0;let i=n.reduce((e,t)=>e+t,0)/r,a=n.reduce((e,t)=>e+(t-i)**2,0)/(r-1);if(a===0)return P.DIV0;let o=n.reduce((e,t)=>e+(t-i)**4,0)/a**2;return r*(r+1)/((r-1)*(r-2)*(r-3))*o-3*(r-1)**2/((r-2)*(r-3))});function XC(e,t){let n=[],r;return pf(e,t,(e,t)=>{if(!r){if(e instanceof N)r=e;else if(typeof e==`number`)n.push(e);else if(t&&e!==null){let t=H(e);t instanceof N?r=t:n.push(t)}}}),r??n}W(`MODE.SNGL`,1,255,(e,t)=>{let n=XC(e,t);if(n instanceof N)return n;let r=new Map;for(let e of n)r.set(e,(r.get(e)??0)+1);let i,a=1;for(let[e,t]of r)t>a&&(i=e,a=t);return i??P.NA}),uf(`MODE`,`MODE.SNGL`),W(`MODE.MULT`,1,255,(e,t)=>{let n=XC(e,t);if(n instanceof N)return n;let r=new Map;for(let e of n)r.set(e,(r.get(e)??0)+1);let i=0;for(let e of r.values())i=Math.max(i,e);if(i<2)return P.NA;let a=[...r].filter(([,e])=>e===i).map(([e])=>e);return new F(a.length,1,a)});function ZC(e,t){let n=t*(e.length-1),r=Math.floor(n),i=e[r]??0,a=e[r+1]??i;return i+(n-r)*(a-i)}W(`QUARTILE.INC`,2,2,(e,t)=>{let n=mf([e[0]],t);if(n instanceof N)return n;let r=H(t.calc.scalar(e[1],t.frame));if(r instanceof N)return r;let i=Math.trunc(r);return n.length===0||i<0||i>4?P.NUM:ZC([...n].sort((e,t)=>e-t),i/4)}),uf(`QUARTILE`,`QUARTILE.INC`);function QC(e,t){let n=H(t.calc.scalar(e[0],t.frame));if(n instanceof N)return n;let r=mf([e[1]],t);if(r instanceof N)return r;let i=e[2]===void 0?0:H(t.calc.scalar(e[2],t.frame));if(i instanceof N)return i;let a=r.filter(e=>e===n).length;return a===0?P.NA:{before:r.filter(e=>i===0?e>n:e<n).length,ties:a}}W(`RANK.EQ`,2,3,(e,t)=>{let n=QC(e,t);return n instanceof N?n:n.before+1}),W(`RANK.AVG`,2,3,(e,t)=>{let n=QC(e,t);return n instanceof N?n:n.before+(n.ties+1)/2}),uf(`RANK`,`RANK.EQ`);function $C(e,t){let n=df(e,t);if(n instanceof N)return n;let r=[];for(let e=0;e<n.rows;e++){let t=[];for(let r=0;r<n.cols;r++){let i=n.at(e,r);if(i instanceof N)return i;if(typeof i!=`number`)return P.VALUE;t.push(i)}r.push(t)}return r}var ew=e=>new F(e.length,e[0]?.length??0,e.flat());function tw(e,t){let n=t[0]?.length??0;return e.map(e=>Array.from({length:n},(n,r)=>e.reduce((e,n,i)=>e+n*(t[i]?.[r]??0),0)))}W(`MMULT`,2,2,(e,t)=>{let n=$C(e[0],t),r=$C(e[1],t);return n instanceof N?n:r instanceof N?r:(n[0]?.length??0)===r.length?ew(tw(n,r)):P.VALUE});function nw(e){let t=e.length,n=e.map((e,n)=>[...e,...Array.from({length:t},(e,t)=>+(n===t))]),r=(e,t)=>n[e]?.[t]??0,i=1;for(let e=0;e<t;e++){let a=e;for(let n=e+1;n<t;n++)Math.abs(r(n,e))>Math.abs(r(a,e))&&(a=n);if(r(a,e)===0)return{determinant:0};if(a!==e){let[t=[],r=[]]=[n[e],n[a]];n[e]=r,n[a]=t,i=-i}let o=r(e,e);i*=o,n[e]=(n[e]??[]).map(e=>e/o);for(let i=0;i<t;i++){if(i===e)continue;let t=r(i,e),a=n[e]??[];n[i]=(n[i]??[]).map((e,n)=>e-t*(a[n]??0))}}return{determinant:i,inverse:n.map(e=>e.slice(t))}}var rw=e=>e.length>0&&e.every(t=>t.length===e.length);W(`MDETERM`,1,1,(e,t)=>{let n=$C(e[0],t);return n instanceof N?n:rw(n)?nw(n).determinant:P.VALUE}),W(`MINVERSE`,1,1,(e,t)=>{let n=$C(e[0],t);if(n instanceof N)return n;if(!rw(n))return P.VALUE;let{inverse:r}=nw(n);return r?ew(r):P.NUM}),U(`MUNIT`,1,1,gf((e=0)=>{let t=Math.trunc(e);return t<1||t>73?P.VALUE:ew(Array.from({length:t},(e,n)=>Array.from({length:t},(e,t)=>+(n===t))))}));function iw(e,t,n){let r=df(e,n),i=df(t,n);if(r instanceof N)return r;if(i instanceof N)return i;if(r.rows*r.cols!==i.rows*i.cols)return P.NA;let a=[],o=[];for(let e=0;e<r.rows;e++)for(let t=0;t<r.cols;t++){let n=r.at(e,t),s=i.rows===r.rows?i.at(e,t):i.at(t,e);if(n instanceof N)return n;if(s instanceof N)return s;typeof n==`number`&&typeof s==`number`&&(a.push(n),o.push(s))}return{xs:a,ys:o}}for(let[e,t]of[[`SUMX2MY2`,(e,t)=>e*e-t*t],[`SUMX2PY2`,(e,t)=>e*e+t*t],[`SUMXMY2`,(e,t)=>(e-t)**2]])W(e,2,2,(e,n)=>{let r=iw(e[0],e[1],n);return r instanceof N?r:r.xs.length===0?P.DIV0:r.xs.reduce((e,n,i)=>e+t(n,r.ys[i]??0),0)});W(`SERIESSUM`,4,4,(e,t)=>{let[n,r,i]=e.slice(0,3).map(e=>H(t.calc.scalar(e,t.frame)));if(n instanceof N)return n;if(r instanceof N)return r;if(i instanceof N)return i;let a=mf([e[3]],t);return a instanceof N?a:a.reduce((e,t,a)=>e+t*(n??0)**((r??0)+a*(i??0)),0)}),W(`FREQUENCY`,2,2,(e,t)=>{let n=mf([e[0]],t),r=mf([e[1]],t);if(n instanceof N)return n;if(r instanceof N)return r;let i=r.map((e,t)=>({b:e,i:t})).sort((e,t)=>e.b-t.b),a=Array(r.length+1).fill(0);for(let e of n){let t=i.find(t=>e<=t.b),n=t?t.i:r.length;a[n]=(a[n]??0)+1}return new F(a.length,1,a)}),W(`PROB`,3,4,(e,t)=>{let n=iw(e[0],e[1],t);if(n instanceof N)return n;let r=H(t.calc.scalar(e[2],t.frame));if(r instanceof N)return r;let i=e[3]===void 0?r:H(t.calc.scalar(e[3],t.frame));if(i instanceof N)return i;let a=n.ys.reduce((e,t)=>e+t,0);return n.ys.some(e=>e<=0||e>1)||Math.abs(a-1)>1e-12?P.NUM:n.xs.reduce((e,t,a)=>t>=r&&t<=i?e+(n.ys[a]??0):e,0)});var aw=e=>e.reduce((e,t)=>e+t,0);function ow(e,t,n){let r=t.map(e=>n?[...e,1]:[...e]),i=r[0]?.length??0,{inverse:a}=nw(Array.from({length:i},(e,t)=>Array.from({length:i},(e,n)=>r.reduce((e,r)=>e+(r[t]??0)*(r[n]??0),0))));if(!a)return;let o=Array.from({length:i},(t,n)=>r.reduce((t,r,i)=>t+(r[n]??0)*(e[i]??0),0)),s=a.map(e=>e.reduce((e,t,n)=>e+t*(o[n]??0),0));return n?s:[...s,0]}function sw(e,t,n){let r=$C(e[0],t);if(r instanceof N)return r;let i=r.length===1,a=r.flat();if(n&&a.some(e=>e<=0))return P.NUM;let o=n?a.map(Math.log):a,s=e[1];if(s===void 0||!cw(s))return{ys:o,xs:a.map((e,t)=>[t+1]),byRow:i};let c=$C(s,t);if(c instanceof N)return c;let l=c[0]?.length??0;return i?l===o.length?{ys:o,xs:Array.from({length:l},(e,t)=>c.map(e=>e[t]??0)),byRow:i}:P.REF:c.length===o.length?{ys:o,xs:c,byRow:i}:P.REF}var cw=e=>e instanceof B||e instanceof F||typeof e==`number`,lw=(e,t)=>e===void 0||!cw(e)&&typeof e!=`boolean`||gd(t.calc.scalar(e,t.frame));function uw(e){return(t,n)=>{let r=sw(t,n,e);if(r instanceof N)return r;let i=lw(t[3],n);if(i instanceof N)return i;let a=ow(r.ys,r.xs,i);if(!a)return P.NUM;let o=t[2],s=r.xs;if(o!==void 0&&cw(o)){let e=$C(o,n);if(e instanceof N)return e;let t=r.xs[0]?.length??1,i=e[0]?.length??0;s=r.byRow||t===1&&e.length===1?Array.from({length:i},(t,n)=>e.map(e=>e[n]??0)):e}let c=s.map(t=>{let n=t.reduce((e,t,n)=>e+t*(a[n]??0),0)+(a[t.length]??0);return e?Math.exp(n):n});return r.byRow?new F(1,c.length,c):new F(c.length,1,c)}}W(`TREND`,1,4,uw(!1)),W(`GROWTH`,1,4,uw(!0));function dw(e,t,n,r){let i=t.map(e=>r?[...e,1]:[...e]),a=i[0]?.length??0,{inverse:o}=nw(Array.from({length:a},(e,t)=>Array.from({length:a},(e,n)=>i.reduce((e,r)=>e+(r[t]??0)*(r[n]??0),0))));if(!o)return;let s=t.map(e=>e.reduce((e,t,r)=>e+t*(n[r]??0),0)+(n[e.length]??0)),c=e.reduce((e,t,n)=>e+(t-(s[n]??0))**2,0),l=r?aw(e)/e.length:0,u=e.reduce((e,t)=>e+(t-l)**2,0),d=u-c,f=e.length-a,p=f>0?c/f:0,m=o.map((e,t)=>Math.sqrt(Math.max(0,(e[t]??0)*p))),h=t[0]?.length??0;return{errors:m,r2:u===0?1:d/u,sey:Math.sqrt(p),f:f>0&&c>0?d/h/(c/f):0,df:f,ssreg:d,ssresid:c}}function fw(e){return(t,n)=>{let r=sw(t,n,e);if(r instanceof N)return r;let i=lw(t[2],n);if(i instanceof N)return i;let a=ow(r.ys,r.xs,i);if(!a)return P.NUM;let o=[...a.slice(0,-1).reverse(),a[a.length-1]??0],s=e?o.map(Math.exp):o,c=t[3],l=c===void 0||!pw(c)?!1:gd(n.calc.scalar(c,n.frame));if(l instanceof N)return l;if(!l)return new F(1,s.length,s);let u=dw(r.ys,r.xs,a,i);if(!u)return P.NUM;let d=s.length,f=e=>[...e,...Array(d-e.length).fill(P.NA)],p=i?[...u.errors.slice(0,-1).reverse(),u.errors[u.errors.length-1]??0]:[...[...u.errors].reverse(),P.NA];return new F(5,d,[...s,...p,...f([u.r2,u.sey]),...f([u.f,u.df]),...f([u.ssreg,u.ssresid])])}}var pw=e=>cw(e)||typeof e==`boolean`;W(`LINEST`,1,4,fw(!1)),W(`LOGEST`,1,4,fw(!0));var mw=e=>aw(e)/e.length,hw=e=>{let t=mw(e);return e.reduce((e,n)=>e+(n-t)**2,0)/(e.length-1)};W(`CHISQ.TEST`,2,2,(e,t)=>{let n=$C(e[0],t),r=$C(e[1],t);if(n instanceof N)return n;if(r instanceof N)return r;let i=n.length,a=n[0]?.length??0;if(r.length!==i||(r[0]?.length??0)!==a||i*a<2)return P.NA;let o=0;for(let e=0;e<i;e++)for(let t=0;t<a;t++){let i=r[e]?.[t]??0;if(i<0)return P.NUM;if(i===0)return P.DIV0;o+=((n[e]?.[t]??0)-i)**2/i}return uC((i>1&&a>1?(i-1)*(a-1):i>1?i-1:a-1)/2,o/2)}),uf(`CHITEST`,`CHISQ.TEST`),W(`T.TEST`,4,4,(e,t)=>{let n=H(t.calc.scalar(e[2],t.frame)),r=H(t.calc.scalar(e[3],t.frame));if(n instanceof N)return n;if(r instanceof N)return r;let i=Math.trunc(n),a=Math.trunc(r);if(i!==1&&i!==2||a<1||a>3)return P.NUM;let o,s;if(a===1){let n=iw(e[0],e[1],t);if(n instanceof N)return n;let r=n.xs.map((e,t)=>e-(n.ys[t]??0));if(r.length<2)return P.DIV0;o=mw(r)/Math.sqrt(hw(r)/r.length),s=r.length-1}else{let n=mf([e[0]],t),r=mf([e[1]],t);if(n instanceof N)return n;if(r instanceof N)return r;if(n.length<2||r.length<2)return P.DIV0;let[i,c,l,u]=[hw(n),hw(r),n.length,r.length],d=Math.abs(mw(n)-mw(r));if(a===2){s=l+u-2;let e=((l-1)*i+(u-1)*c)/s;o=d/Math.sqrt(e*(1/l+1/u))}else{let e=i/l,t=c/u;o=d/Math.sqrt(e+t),s=(e+t)**2/(e**2/(l-1)+t**2/(u-1))}}return Number.isFinite(o)?fC(s/2,.5,s/(s+o*o))*i/2:P.DIV0}),uf(`TTEST`,`T.TEST`),W(`F.TEST`,2,2,(e,t)=>{let n=mf([e[0]],t),r=mf([e[1]],t);if(n instanceof N)return n;if(r instanceof N)return r;if(n.length<2||r.length<2)return P.DIV0;let[i,a]=[hw(n),hw(r)];if(i===0||a===0)return P.DIV0;let o=i/a,[s,c]=[n.length-1,r.length-1],l=fC(c/2,s/2,c/(s*o+c));return 2*Math.min(l,1-l)}),uf(`FTEST`,`F.TEST`),W(`Z.TEST`,2,3,(e,t)=>{let n=mf([e[0]],t);if(n instanceof N)return n;let r=H(t.calc.scalar(e[1],t.frame));if(r instanceof N)return r;if(n.length===0)return P.NA;let i=e[2]===void 0?n.length<2?P.DIV0:Math.sqrt(hw(n)):H(t.calc.scalar(e[2],t.frame));return i instanceof N?i:i===0?P.DIV0:1-gC((mw(n)-r)/(i/Math.sqrt(n.length)))}),uf(`ZTEST`,`Z.TEST`);var gw={1:`AVERAGE`,2:`COUNT`,3:`COUNTA`,4:`MAX`,5:`MIN`,6:`PRODUCT`,7:`STDEV.S`,8:`STDEV.P`,9:`SUM`,10:`VAR.S`,11:`VAR.P`,12:`MEDIAN`,13:`MODE.SNGL`,14:`LARGE`,15:`SMALL`,16:`PERCENTILE.INC`,17:`QUARTILE.INC`,18:`PERCENTILE.EXC`,19:`QUARTILE.EXC`};W(`AGGREGATE`,3,255,(e,t)=>{let n=H(t.calc.scalar(e[0],t.frame)),r=H(t.calc.scalar(e[1],t.frame));if(n instanceof N)return n;if(r instanceof N)return r;let i=gw[Math.trunc(n)],a=i===void 0?void 0:cf.get(i);if(a?.kind!==`raw`)return P.VALUE;let o=![2,3,6,7].includes(Math.trunc(r)),s=[1,3,5,7].includes(Math.trunc(r)),c=e=>{let n=e instanceof rl?e.parts:[e],r=[];for(let e of n)if(e instanceof B){let n=e;for(let e=n.top;e<=Math.min(n.bottom,n.sheet.lastRow);e++)if(!s||n.sheet.spec.rows?.[String(e+1)]?.hidden!==!0&&!t.calc.filtered(n.sheet).has(e))for(let i=n.left;i<=n.right;i++)r.push(t.calc.read(n.sheet,e,i))}else{let n=t.calc.flat(e);n instanceof F?r.push(...n.data):r.push(n)}let i=o?r:r.filter(e=>!(e instanceof N));return new F(i.length,1,i)},l=Math.trunc(n)>=14,u=e.slice(2),d=l?[c(u[0]),...u.slice(1)]:u.map(c);return a.call(d,t)});var _w=(e,t)=>Cn(Sn(e,t+1,0)).day,vw=(e,t,n)=>n===0||n===4?Math.round(Mp(e,t,n)*360):t-e;function yw(e,t,n){let r=Cn(e),i=r.year*12+r.month-1+t,a=Math.floor(i/12),o=i-a*12+1,s=_w(a,o);return Sn(a,o,n?s:Math.min(r.day,s))}var bw=e=>{let t=Cn(e);return t.day===_w(t.year,t.month)};function xw(e,t,n,r){let i=12/n,a=bw(t),o=0,s=t;for(;s>e;)o+=1,s=yw(t,-i*o,a);let c=yw(t,-i*(o-1),a),l=r===1?c-s:r===3?365/n:360/n,u=vw(s,e,r);return{previous:s,next:c,count:o,period:l,since:u,until:r===0||r===4?l-u:c-e}}function Sw(e,t){let n=[];for(let[r,i]of t.entries()){let t=e[r],a=t==null?i??0:H(t);if(a instanceof N)return a;n.push(a)}return n}var Cw=e=>Number.isInteger(e)&&e>=0&&e<=4,ww=e=>e===1||e===2||e===4;function Tw(e,t,n,r){U(e,t,n.length,(...e)=>{let t=Sw(e,n);if(t instanceof N)return t;let[i=0,a=0,...o]=t,s=Math.trunc(i),c=Math.trunc(a),l=Math.trunc(o[o.length-1]??0);return s>=c||!Cw(l)?P.NUM:r(s,c,...o.slice(0,-1),l)})}var $=void 0;for(let[e,t]of[[`COUPDAYBS`,e=>e.since],[`COUPDAYS`,e=>e.period],[`COUPDAYSNC`,e=>e.until],[`COUPNCD`,e=>e.next],[`COUPNUM`,e=>e.count],[`COUPPCD`,e=>e.previous]])Tw(e,3,[$,$,$,0],(e,n,r=0,i=0)=>ww(r)?t(xw(e,n,r,i)):P.NUM);function Ew(e,t,n,r,i,a,o){let s=xw(e,t,a,o),c=100*n/a,l=s.until/s.period;if(s.count===1)return(i+c)/(1+l*r/a)-c*s.since/s.period;let u=i/(1+r/a)**(s.count-1+l);for(let e=1;e<=s.count;e++)u+=c/(1+r/a)**(e-1+l);return u-c*s.since/s.period}Tw(`PRICE`,6,[$,$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0,o=0)=>n<0||r<0||i<=0||!ww(a)?P.NUM:Ew(e,t,n,r,i,a,o)),Tw(`YIELD`,6,[$,$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0,o=0)=>{if(n<0||r<=0||i<=0||!ww(a))return P.NUM;let s=-.99,c=1;for(;Ew(e,t,n,c,i,a,o)>r&&c<1e6;)c*=2;for(let l=0;l<200;l++){let l=(s+c)/2;Ew(e,t,n,l,i,a,o)>r?s=l:c=l}return(s+c)/2});function Dw(e,t,n,r,i,a){let o=xw(e,t,i,a),s=o.until/o.period,c=0,l=0;for(let e=1;e<=o.count;e++){let t=e-1+s,a=(100*n/i+(e===o.count?100:0))/(1+r/i)**t;c+=t*a,l+=a}return c/l/i}Tw(`DURATION`,5,[$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0)=>n<0||r<0||!ww(i)?P.NUM:Dw(e,t,n,r,i,a)),Tw(`MDURATION`,5,[$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0)=>n<0||r<0||!ww(i)?P.NUM:Dw(e,t,n,r,i,a)/(1+r/i)),Tw(`DISC`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?P.NUM:(r-n)/r/Mp(e,t,i)),Tw(`INTRATE`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?P.NUM:(r-n)/n/Mp(e,t,i)),Tw(`RECEIVED`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>{let a=1-r*Mp(e,t,i);return n<=0||r<=0||a<=0?P.NUM:n/a}),Tw(`PRICEDISC`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?P.NUM:r*(1-n*Mp(e,t,i))),Tw(`YIELDDISC`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?P.NUM:(r-n)/n/Mp(e,t,i));function Ow(e,t){U(e,3,3,gf((e=0,n=0,r=0)=>{let i=Math.trunc(e),a=Math.trunc(n);return i>=a||r<=0||a>yw(i,12,!1)?P.NUM:t(a-i,r)}))}Ow(`TBILLPRICE`,(e,t)=>{let n=100*(1-t*e/360);return n<=0?P.NUM:n}),Ow(`TBILLYIELD`,(e,t)=>(100-t)/t*360/e),Ow(`TBILLEQ`,(e,t)=>{if(e<=182)return 365*t/(360-t*e);let n=100*(1-t*e/360),r=e/365,i=r*r-(2*r-1)*(1-100/n);return(-r+Math.sqrt(i))/(r-.5)}),U(`ACCRINTM`,3,5,(...e)=>{let t=Sw(e,[$,$,$,1e3,0]);if(t instanceof N)return t;let[n=0,r=0,i=0,a=0,o=0]=t,s=Math.trunc(n),c=Math.trunc(r);return s>=c||i<=0||a<=0||!Cw(o)?P.NUM:a*i*Mp(s,c,o)}),U(`ACCRINT`,6,8,(...e)=>{let t=Sw(e.slice(0,7),[$,$,$,$,1e3,$,0]);if(t instanceof N)return t;let[n=0,r=0,i=0,a=0,o=0,s=0,c=0]=t,l=e[7]===void 0||gd(e[7]);if(l instanceof N)return l;let u=Math.trunc(n),d=Math.trunc(i),f=Math.trunc(r);if(u>=d||a<=0||o<=0||!ww(s)||!Cw(c))return P.NUM;let p=12/s,m=f,h=f;for(let e=1;m>u;e++)m=yw(f,-p*e,!1);let g=0;for(;m<d;){h=yw(m,p,!1);let e=l?Math.max(u,m):Math.max(m,f<=d?f:u),t=Math.min(d,h),n=c===1?h-m:c===3?365/s:360/s;t>e&&(g+=vw(e,t,c)/n),m=h}return o*a*g/s}),U(`VDB`,5,7,(...e)=>{let t=Sw(e.slice(0,6),[$,$,$,$,$,2]);if(t instanceof N)return t;let[n=0,r=0,i=0,a=0,o=0,s=0]=t,c=e[6]!==void 0&&gd(e[6]);if(c instanceof N)return c;if(n<0||r<0||i<=0||a<0||o>i||a>o||s<=0)return P.NUM;let l=n,u=0,d=Math.ceil(o);for(let e=1;e<=d;e++){let t=Math.min(l*s/i,Math.max(0,l-r)),n=i-e+1,d=(l-r)/n,f=c?t:Math.max(t,d),p=Math.min(o,e)-Math.max(a,e-1);p>0&&(u+=f*p),l-=f}return u});var kw=(e,t,n,r,i)=>({whole:Mp(n,t,i),accrued:Mp(n,e,i),left:Mp(e,t,i),rate:r});Tw(`PRICEMAT`,5,[$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0)=>{let o=Math.trunc(n);if(o>=e||r<0||i<0)return P.NUM;let{whole:s,accrued:c,left:l}=kw(e,t,o,r,a);return(100+s*r*100)/(1+l*i)-c*r*100}),Tw(`YIELDMAT`,5,[$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0)=>{let o=Math.trunc(n);if(o>=e||r<0||i<=0)return P.NUM;let{whole:s,accrued:c,left:l}=kw(e,t,o,r,a);return((1+s*r)/(i/100+c*r)-1)/l});function Aw(e,t,n,r,i){let a=12/r,o=bw(t),s={held:0,accrued:0,left:0,count:0},c=0,l=t;for(;l>e;){c+=1;let u=yw(t,-a*c,o),d=i===1?l-u:i===3?365/r:360/r,f=Math.max(u,e),p=l,m=(e,t)=>t>e?vw(e,t,i)/d:0;s.held+=m(f,p),s.accrued+=m(f,Math.min(n,p)),s.left+=m(Math.max(n,f),p),s.count+=1,l=u}return s}function jw(e,t,n,r,i,a,o,s,c){let l=100*i/s,u=xw(r,t,s,c).count+1,d=Aw(n,r,e,s,c),f=1+a/s,p=d.left,m=o/f**(u-1+p);m+=l*d.held/f**p;for(let e=2;e<=u;e++)m+=l/f**(e-1+p);return m-l*d.accrued}function Mw(e,t,n){let r=n;for(let n=0;n<100;n++){let n=e(r),i=n-t;if(Math.abs(i)<1e-10)return r;let a=(e(r+1e-6)-n)/1e-6;if(a===0||!Number.isFinite(a))return;r-=i/a,r<=-1&&(r=-.99)}}function Nw(e,t){U(e,8,9,(...e)=>{let n=Sw(e,[$,$,$,$,$,$,$,$,0]);if(n instanceof N)return n;let[r=0,i=0,a=0,o=0,s=0,c=0,l=0,u=0]=n,d=Math.trunc(n[8]??0),f=Math.trunc(r),p=Math.trunc(i),m=Math.trunc(a),h=Math.trunc(o);return!Cw(d)||!ww(u)||!(p>h&&h>f&&f>m)||s<0||c<0||l<=0?P.NUM:t(e=>jw(f,p,m,h,s,e,l,u,d),c)})}Nw(`ODDFPRICE`,(e,t)=>e(t)),Nw(`ODDFYIELD`,(e,t)=>Mw(e,t,.1)??P.NUM);function Pw(e,t){U(e,7,8,(...e)=>{let n=Sw(e,[$,$,$,$,$,$,$,0]);if(n instanceof N)return n;let[r=0,i=0,a=0,o=0,s=0,c=0,l=0]=n,u=Math.trunc(n[7]??0),d=Math.trunc(r),f=Math.trunc(i),p=Math.trunc(a);return!Cw(u)||!ww(l)||!(f>d&&d>p)||o<0||s<0||c<=0?P.NUM:t({odd:Aw(p,f,d,l,u),coupon:100*o/l,last:s,red:c,f:l})})}Pw(`ODDLPRICE`,({odd:e,coupon:t,last:n,red:r,f:i})=>(r+e.held*t)/(1+e.left*n/i)-e.accrued*t),Pw(`ODDLYIELD`,({odd:e,coupon:t,last:n,red:r,f:i})=>{let a=n+e.accrued*t;return(r+e.held*t-a)/a*i/e.left}),U(`AMORLINC`,6,7,(...e)=>{let t=Sw(e,[$,$,$,$,$,$,0]);if(t instanceof N)return t;let[n=0,r=0,i=0,a=0,o=0,s=0]=t,c=Math.trunc(t[6]??0),l=Math.trunc(o);if(!Cw(c)||c===2||n<0||a<0||a>n||l<0||s<=0||r>i)return P.NUM;let u=n*s,d=Mp(Math.trunc(r),Math.trunc(i),c)*u,f=Math.trunc((n-a-d)/u);return l===0?d:l<=f?u:l===f+1?n-a-u*f-d:0}),U(`AMORDEGRC`,6,7,(...e)=>{let t=Sw(e,[$,$,$,$,$,$,0]);if(t instanceof N)return t;let[n=0,r=0,i=0,a=0,o=0,s=0]=t,c=Math.trunc(t[6]??0),l=Math.trunc(o);if(!Cw(c)||c===2||n<0||a<0||a>n||l<0||s<=0||r>i)return P.NUM;let u=1/s,d=s*(u<3?1:u<5?1.5:u<=6?2:2.5),f=Math.round(Mp(Math.trunc(r),Math.trunc(i),c)*d*n);if(l===0)return f;let p=n-f,m=p-a;for(let e=0;e<l;e++){if(f=Math.round(d*p),m-=f,m<0)return l-e<=1?Math.round(p*.5):0;p-=f}return f});function Fw(e,t){let n=[];for(let t=0;t<e.cols;t++){let r=hd(e.at(0,t));if(r instanceof N)return r;n.push(r.toLowerCase())}let r=[];for(let i=1;i<e.rows;i++){let a=t.rows<2;for(let r=1;r<t.rows&&!a;r++){let o=!0;for(let a=0;a<t.cols&&o;a++){let s=t.at(r,a);if(s===null||s===``)continue;let c=hd(t.at(0,a));if(c instanceof N)return c;let l=n.indexOf(c.toLowerCase());if(l<0){o=!1;continue}let u=Pf(s);if(u instanceof N)return u;u.test(e.at(i,l))||(o=!1)}o&&(a=!0)}a&&r.push(i)}return r}function Iw(e,t){if(typeof t==`number`){let n=Math.trunc(t)-1;return n<0||n>=e.cols?P.VALUE:n}let n=hd(t);if(n instanceof N)return n;for(let t=0;t<e.cols;t++){let r=e.at(0,t);if(typeof r==`string`&&yd(r,n)===0)return t}return P.VALUE}function Lw(e,t){let n=df(e[0],t);if(n instanceof N)return n;let r=df(e[2],t);if(r instanceof N)return r;let i=Fw(n,r);if(i instanceof N)return i;let a=e[1];if(a===void 0)return{list:i.map(()=>null),db:n};let o=Iw(n,t.calc.scalar(a,t.frame));return o instanceof N?o:{list:i.map(e=>n.at(e,o)),db:n}}function Rw(e,t){W(e,3,3,(e,n)=>{let r=Lw(e,n);if(r instanceof N)return r;let i=cf.get(t);if(i?.kind!==`raw`)return P.VALUE;let a=r.list.filter(e=>typeof e==`number`);return i.call([...a.length>0?a:[0]],n)})}for(let[e,t]of[[`DSUM`,`SUM`],[`DMAX`,`MAX`],[`DMIN`,`MIN`],[`DPRODUCT`,`PRODUCT`]])Rw(e,t);for(let[e,t]of[[`DAVERAGE`,`AVERAGE`],[`DSTDEV`,`STDEV.S`],[`DSTDEVP`,`STDEV.P`],[`DVAR`,`VAR.S`],[`DVARP`,`VAR.P`]])W(e,3,3,(e,n)=>{let r=Lw(e,n);if(r instanceof N)return r;let i=cf.get(t);if(i?.kind!==`raw`)return P.VALUE;let a=r.list.filter(e=>typeof e==`number`);return a.length===0?P.DIV0:i.call(a,n)});W(`DCOUNT`,2,3,(e,t)=>{let n=Lw(e.length===2?[e[0],void 0,e[1]]:e,t);return n instanceof N?n:n.list.filter(e=>typeof e==`number`).length}),W(`DCOUNTA`,2,3,(e,t)=>{let n=Lw(e.length===2?[e[0],void 0,e[1]]:e,t);return n instanceof N?n:n.list.filter(e=>e!==null).length}),W(`DGET`,3,3,(e,t)=>{let n=Lw(e,t);return n instanceof N?n:n.list.length===0?P.VALUE:n.list.length>1?P.NUM:n.list[0]??null});var zw=5e6,Bw=e=>Array.from({length:e.rows},(t,n)=>Array.from({length:e.cols},(t,r)=>e.at(n,r))),Vw=e=>{let t=e[0]?.length??0;return new F(e.length,t,e.flat())},Hw=e=>{let t=e[0]?.length??0;return Array.from({length:t},(t,n)=>e.map(e=>e[n]??null))};function Uw(e,t){if(!(e===void 0||e instanceof al))return t.calc.scalar(e,t.frame)}function Ww(e,t,n){let r=Uw(e,t);return r==null?n:H(r)}function Gw(e,t,n){let r=Uw(e,t);return r==null?n:gd(r)}function Kw(e,t,n){if(e===void 0||e instanceof al)return[n];let r=df(e,t);if(r instanceof N)return r;let i=[];for(let e=0;e<r.rows;e++)for(let t=0;t<r.cols;t++){let n=H(r.at(e,t));if(n instanceof N)return n;i.push(Math.trunc(n))}return i}var qw=e=>e===null||e===``;function Jw(e,t,n){if(qw(e)||qw(t))return qw(e)&&qw(t)?0:qw(e)?1:-1;let r=od(e,t);return n?-r:r}function Yw(e){return e instanceof N?e:e===null?!1:typeof e==`boolean`?e:typeof e==`number`?e!==0:P.VALUE}W(`FILTER`,2,3,(e,t)=>{let n=df(e[0],t),r=df(e[1],t);if(n instanceof N)return n;if(r instanceof N)return r;if(r.rows>1&&r.cols>1)return P.VALUE;let i=r.cols===1&&r.rows===n.rows?!0:r.rows===1&&r.cols===n.cols?!1:void 0;if(i===void 0)return P.VALUE;let a=Bw(n),o=i?a:Hw(a),s=[];for(let e=0;e<o.length;e++){let t=Yw(i?r.at(e,0):r.at(0,e));if(t instanceof N)return t;t&&s.push(o[e]??[])}return s.length===0?e[2]===void 0||e[2]instanceof al?P.CALC:e[2]:Vw(i?s:Hw(s))}),W(`SORT`,1,4,(e,t)=>{let n=df(e[0],t);if(n instanceof N)return n;let r=Kw(e[1],t,1);if(r instanceof N)return r;let i=Kw(e[2],t,1);if(i instanceof N)return i;let a=Gw(e[3],t,!1);if(a instanceof N)return a;let o=Bw(n),s=a?Hw(o):o,c=s[0]?.length??0;if(i.length!==1&&i.length!==r.length||r.some(e=>e<1||e>c)||i.some(e=>e!==1&&e!==-1))return P.VALUE;let l=s.map((e,t)=>({line:e,index:t})).sort((e,t)=>{for(let[n,a]of r.entries()){let r=i[i.length===1?0:n]??1,o=Jw(e.line[a-1]??null,t.line[a-1]??null,r<0);if(o!==0)return o}return e.index-t.index}).map(e=>e.line);return Vw(a?Hw(l):l)}),W(`SORTBY`,2,255,(e,t)=>{let n=df(e[0],t);if(n instanceof N)return n;let r=[],i;for(let a=1;a<e.length;a+=2){let o=df(e[a],t);if(o instanceof N)return o;if(o.rows>1&&o.cols>1)return P.VALUE;let s=o.cols===1&&o.rows===n.rows,c=o.rows===1&&o.cols===n.cols;if(!s&&!c)return P.VALUE;let l=i??s;if(l?!s:!c)return P.VALUE;i=l;let u=Ww(e[a+1],t,1);if(u instanceof N)return u;if(u!==1&&u!==-1)return P.VALUE;r.push({values:Bw(o).flat(),descending:u<0})}let a=Bw(n),o=(i===!1?Hw(a):a).map((e,t)=>({line:e,index:t})).sort((e,t)=>{for(let{values:n,descending:i}of r){let r=Jw(n[e.index]??null,n[t.index]??null,i);if(r!==0)return r}return e.index-t.index}).map(e=>e.line);return Vw(i===!1?Hw(o):o)});var Xw=e=>e instanceof N?`e${e.code}`:typeof e==`string`?`s${e.toLowerCase()}`:`${typeof e}${String(e)}`;W(`UNIQUE`,1,3,(e,t)=>{let n=df(e[0],t);if(n instanceof N)return n;let r=Gw(e[1],t,!1);if(r instanceof N)return r;let i=Gw(e[2],t,!1);if(i instanceof N)return i;let a=Bw(n),o=r?Hw(a):a,s=new Map;for(let e of o){let t=e.map(Xw).join(`\0`),n=s.get(t);n?n.count+=1:s.set(t,{line:e,count:1})}let c=[...s.values()].filter(e=>!i||e.count===1).map(e=>e.line);return c.length===0?P.CALC:Vw(r?Hw(c):c)});function Zw(e,t){if(e instanceof N)return e;if(t instanceof N)return t;let n=Math.trunc(e),r=Math.trunc(t);return n<0||r<0?P.VALUE:n===0||r===0?P.CALC:n>1048576||r>16384||n*r>zw?P.VALUE:{rows:n,cols:r}}W(`SEQUENCE`,1,4,(e,t)=>{let n=Zw(Ww(e[0],t,1),Ww(e[1],t,1));if(n instanceof N)return n;let r=Ww(e[2],t,1);if(r instanceof N)return r;let i=Ww(e[3],t,1);if(i instanceof N)return i;let a=Array(n.rows*n.cols);for(let e=0;e<a.length;e++)a[e]=r+e*i;return new F(n.rows,n.cols,a)}),W(`RANDARRAY`,0,5,(e,t)=>{let n=Zw(Ww(e[0],t,1),Ww(e[1],t,1));if(n instanceof N)return n;let r=Ww(e[2],t,0);if(r instanceof N)return r;let i=Ww(e[3],t,1);if(i instanceof N)return i;let a=Gw(e[4],t,!1);if(a instanceof N)return a;if(r>i||a&&(!Number.isInteger(r)||!Number.isInteger(i)))return P.VALUE;let o=Array(n.rows*n.cols);for(let e=0;e<o.length;e++){let n=t.calc.random();o[e]=a?r+Math.floor(n*(i-r+1)):r+n*(i-r)}return new F(n.rows,n.cols,o)},{volatile:!0});function Qw(e,t){if(e===void 0||e instanceof al)return[];let n=df(e,t);if(n instanceof N)return n;let r=[];for(let e of Bw(n).flat()){if(e===null)continue;let t=hd(e);if(t instanceof N)return t;r.push(t)}return r}function $w(e,t,n){let r=n?e.toLowerCase():e,i=(n?t.map(e=>e.toLowerCase()):[...t]).sort((e,t)=>t.length-e.length),a=[],o=0,s=0;for(;s<e.length;){let t=i.find(e=>e!==``&&r.startsWith(e,s));t===void 0?s+=1:(a.push(e.slice(o,s)),s+=t.length,o=s)}return a.push(e.slice(o)),a}W(`TEXTSPLIT`,2,6,(e,t)=>{let n=Uw(e[0],t);if(n instanceof N)return n;let r=hd(n??``);if(r instanceof N)return r;let i=Qw(e[1],t);if(i instanceof N)return i;let a=Qw(e[2],t);if(a instanceof N)return a;if(i.length===0&&a.length===0||i.includes(``)||a.includes(``))return P.VALUE;let o=Gw(e[3],t,!1);if(o instanceof N)return o;let s=Ww(e[4],t,0);if(s instanceof N)return s;let c=Uw(e[5],t)??P.NA,l=s===1,u=(a.length===0?[r]:$w(r,a,l)).filter(e=>!(o&&e===``)).map(e=>{let t=i.length===0?[e]:$w(e,i,l);return o?t.filter(e=>e!==``):t}),d=Math.max(0,...u.map(e=>e.length));return u.length===0||d===0?P.CALC:Vw(u.map(e=>Array.from({length:d},(t,n)=>e[n]??c)))});var eT=(e,t)=>{let n=t.calc.flat(e);return n instanceof F?n.at(0,0):n};W(`MAP`,2,255,(e,t)=>{let n=e[e.length-1];if(!(n instanceof il))return P.VALUE;let r=[];for(let n of e.slice(0,-1)){let e=df(n,t);if(e instanceof N)return e;r.push(e)}let i=r[0];if(!i)return P.VALUE;let{rows:a,cols:o}=i;if(r.some(e=>e.rows!==a||e.cols!==o))return P.VALUE;let s=Array(a*o);for(let e=0;e<a;e++)for(let i=0;i<o;i++)s[e*o+i]=eT(t.calc.apply(n,r.map(t=>t.at(e,i))),t);return new F(a,o,s)});function tT(e,t){let n=e.length===3,r=e[e.length-1];if(!(r instanceof il))return P.VALUE;let i=df(e[+!!n],t);return i instanceof N?i:{start:n?Uw(e[0],t)??null:i.at(0,0),cells:i,fn:r}}W(`REDUCE`,2,3,(e,t)=>{let n=tT(e,t);if(n instanceof N)return n;let{cells:r,fn:i}=n,a=e.length===3?0:1,o=n.start;for(let e=a;e<r.rows*r.cols;e++)o=eT(t.calc.apply(i,[o,r.at(Math.floor(e/r.cols),e%r.cols)]),t);return o}),W(`SCAN`,2,3,(e,t)=>{let n=tT(e,t);if(n instanceof N)return n;let{cells:r,fn:i}=n,a=r.rows*r.cols,o=e.length===3?0:1,s=Array(a),c=n.start;o===1&&(s[0]=c);for(let e=o;e<a;e++)c=eT(t.calc.apply(i,[c,r.at(Math.floor(e/r.cols),e%r.cols)]),t),s[e]=c;return new F(r.rows,r.cols,s)});var nT=e=>(t,n)=>{let r=df(t[0],n);if(r instanceof N)return r;let i=t[1];if(!(i instanceof il))return P.VALUE;let a=Bw(r),o=(e?a:Hw(a)).map(t=>eT(n.calc.apply(i,[e?new F(1,t.length,t):new F(t.length,1,t)]),n));return e?new F(o.length,1,o):new F(1,o.length,o)};W(`BYROW`,2,2,nT(!0)),W(`BYCOL`,2,2,nT(!1)),W(`MAKEARRAY`,3,3,(e,t)=>{let n=Zw(Ww(e[0],t,1),Ww(e[1],t,1));if(n instanceof N)return n;let r=e[2];if(!(r instanceof il))return P.VALUE;let i=Array(n.rows*n.cols);for(let e=0;e<n.rows;e++)for(let a=0;a<n.cols;a++)i[e*n.cols+a]=eT(t.calc.apply(r,[e+1,a+1]),t);return new F(n.rows,n.cols,i)});function rT(e){return(t,n)=>{let r=[];for(let i of t){let t=df(i,n);if(t instanceof N)return t;let a=Bw(t);r.push(e?a:Hw(a))}let i=Math.max(0,...r.map(e=>e[0]?.length??0)),a=r.flatMap(e=>e.map(e=>Array.from({length:i},(t,n)=>n<e.length?e[n]??null:P.NA)));return a.length===0?P.CALC:Vw(e?a:Hw(a))}}W(`VSTACK`,1,255,rT(!0)),W(`HSTACK`,1,255,rT(!1));function iT(e,t,n){let r=Math.min(e,Math.abs(t));return n?t>=0?[0,r]:[e-r,e]:t>=0?[r,e]:[0,e-r]}function aT(e){return(t,n)=>{let r=df(t[0],n);if(r instanceof N)return r;let i=e=>e===void 0||e instanceof al,a=Ww(t[1],n,e?r.rows:0);if(a instanceof N)return a;let o=Ww(t[2],n,e?r.cols:0);if(o instanceof N)return o;if(e&&!i(t[1])&&Math.trunc(a)===0||e&&!i(t[2])&&Math.trunc(o)===0)return P.CALC;let[s,c]=iT(r.rows,Math.trunc(a),e),[l,u]=iT(r.cols,Math.trunc(o),e);return c<=s||u<=l?P.CALC:Vw(Bw(r).slice(s,c).map(e=>e.slice(l,u)))}}W(`TAKE`,2,3,aT(!0)),W(`DROP`,2,3,aT(!1));function oT(e){return(t,n)=>{let r=df(t[0],n);if(r instanceof N)return r;let i=Ww(t[1],n,0);if(i instanceof N)return i;let a=Gw(t[2],n,!1);if(a instanceof N)return a;if(![0,1,2,3].includes(i))return P.VALUE;let o=Bw(r),s=(a?Hw(o):o).flat().filter(e=>!((i===1||i===3)&&e===null||(i===2||i===3)&&e instanceof N));return s.length===0?P.CALC:e?new F(s.length,1,s):new F(1,s.length,s)}}W(`TOCOL`,1,3,oT(!0)),W(`TOROW`,1,3,oT(!1));function sT(e){return(t,n)=>{let r=df(t[0],n);if(r instanceof N)return r;let i=Bw(r),a=e?i:Hw(i),o=[];for(let e of t.slice(1)){let t=Kw(e,n,1);if(t instanceof N)return t;for(let e of t){let t=a[e>0?e-1:a.length+e];if(e===0||!t)return P.VALUE;o.push(t)}}return Vw(e?o:Hw(o))}}W(`CHOOSEROWS`,2,255,sT(!0)),W(`CHOOSECOLS`,2,255,sT(!1)),W(`EXPAND`,2,4,(e,t)=>{let n=df(e[0],t);if(n instanceof N)return n;let r=Zw(Ww(e[1],t,n.rows),Ww(e[2],t,n.cols));if(r instanceof N)return r;if(r.rows<n.rows||r.cols<n.cols)return P.VALUE;let i=Uw(e[3],t)??P.NA,a=Array(r.rows*r.cols);for(let e=0;e<r.rows;e++)for(let t=0;t<r.cols;t++)a[e*r.cols+t]=e<n.rows&&t<n.cols?n.at(e,t):i;return new F(r.rows,r.cols,a)});function cT(e){return(t,n)=>{let r=df(t[0],n);if(r instanceof N)return r;if(r.rows>1&&r.cols>1)return P.VALUE;let i=Ww(t[1],n,1);if(i instanceof N)return i;let a=Math.trunc(i);if(a<1)return P.NUM;let o=Uw(t[2],n)??P.NA,s=Bw(r).flat(),c=[];for(let e=0;e<s.length;e+=a)c.push(Array.from({length:a},(t,n)=>e+n<s.length?s[e+n]??null:o));return Vw(e?c:Hw(c))}}W(`WRAPROWS`,2,3,cT(!0)),W(`WRAPCOLS`,2,3,cT(!1));function lT(e,t){let n={reads:[],names:new Set,volatile:!1,unknownNames:[],unknownFunctions:[],arguments:[]},r=new Set,i=(t,i)=>{let o=t.toLowerCase();if(i.has(o))return!0;let s=e.name(o);if(s)return n.names.add(o),r.has(o)||(r.add(o),s.formula?.node&&a(s.formula.node,new Set)),!0;let c=e.table(o);return c?(n.reads.push({kind:`structured`,table:c.name,sections:[],columns:[],thisRow:!1}),!0):!1},a=(e,t)=>{switch(e.kind){case`ref`:case`structured`:n.reads.push(e);return;case`name`:i(e.name,t)||n.unknownNames.push(e.name);return;case`unary`:case`postfix`:case`paren`:a(e.arg,t);return;case`binary`:a(e.left,t),a(e.right,t);return;case`array`:return;case`invoke`:a(e.callee,t);for(let n of e.args)a(n,t);return;case`call`:{let r=cf.get(e.name);if(e.name===`LET`||e.name===`LAMBDA`){let n=new Set(t),r=e.args[e.args.length-1];e.args.forEach((t,i)=>{t!==r&&(e.name===`LET`&&i%2==1?a(t,n):t.kind===`name`&&n.add(t.name.toLowerCase()))}),r&&a(r,n);return}r?(r.volatile===!0&&(n.volatile=!0),(e.args.length<r.min||e.args.length>r.max)&&n.arguments.push({name:e.name,given:e.args.length,min:r.min,max:r.max})):i(e.written,t)||n.unknownFunctions.push(e.name);for(let n of e.args)a(n,t);return}default:return}};return t.node&&a(t.node,new Set),n}function uT(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return()=>{t=t+1831565813|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296}}var dT=new Set,fT=/\b(?:SUBTOTAL|AGGREGATE)\(/iu,pT=2e3,mT=32,hT=12,gT=(e,t)=>!e||!t?e===t:e.rows!==t.rows||e.cols!==t.cols?!1:e.data.every((e,n)=>e===t.data[n]),_T=(e,t)=>e.row<t.row||e.row===t.row&&e.col<t.col,vT=class{cells=new Set;reference;constructor(e){this.reference=e}},yT=class{cycles=[];computed=0;nowSerial;random;pass=0;stack=[];inCycle=new Set;namesAt=new Set;dependents=new Map;watches=new Map;watchesAt=new Map;wideWatches=[];graph=!1;moved=[];unsettled=new Set;hiddenBy=new Map;volatiles=new Set;indexes=new Map;wb;constructor(e,t={}){this.wb=e;let{now:n,random:r}=t;this.nowSerial=()=>wn(n??new Date),this.random=r??Math.random;for(let t of e.sheets)t.expand()}allCells(){return this.wb.sheets.flatMap(e=>[...e.formulas])}filtered(e){return this.hiddenBy.get(e)??dT}calculate(){this.hiddenBy.clear();for(let e of this.wb.sheets)e.clearSpills();this.moved=[],this.unsettled.clear();let e=this.allCells();for(let t of e)t.state=1;return this.cycles=[],this.inCycle.clear(),this.run(e),this.applyFilters(e),this}applyFilters(e){for(let e of this.wb.sheets){if(e.filters.every(e=>e.columns.size===0))continue;let t=af(e,this);t.size>0&&this.hiddenBy.set(e,t)}if(this.hiddenBy.size!==0&&e.some(e=>fT.test(e.shared.text))){for(let t of e)t.state=1;this.cycles=[],this.inCycle.clear(),this.run([...e])}}value(e,t,n){return this.read(e,t,n)}read(e,t,n){let r=e.at(t,n);return r===void 0?this.ghost(e,t,n):typeof r!=`object`||r instanceof N?r:(r.state===1?this.compute(r):r.state===2&&this.circular(r),r.value)}ghost(e,t,n){let r=e.spillAt(t,n);if(!r)return null;if(r.state===1)this.compute(r);else if(r.state===2)return this.circular(r),null;let{array:i}=r;return i&&e.spillAt(t,n)===r?i.at(t-r.row,n-r.col):null}circular(e){let t=this.stack.indexOf(e),n=t<0?[e]:this.stack.slice(t);n.some(e=>this.inCycle.has(e))||this.cycles.push(n);for(let e of n)this.inCycle.add(e)}run(e){this.indexes.clear(),this.computed=0;for(let t of this.order(e))t.state===1&&this.compute(t);this.spread()}spread(){for(let e=0;this.moved.length>0;e++){let t=this.moved;if(this.moved=[],e>=24)break;if(e>=hT)for(let{sheet:e,area:n}of t)for(let t of e.spillsIn(n))this.unsettled.add(t);this.build();let n=new Set,r=[...this.unsettled];for(let{sheet:e,area:n}of t)r.push(...this.readersIn(e,n),...e.blockedBy(n));for(;;){let e=r.pop();if(!e)break;n.has(e)||(n.add(e),r.push(...this.readers(e.sheet,e.row,e.col)))}if(n.size!==0){for(let e of n)e.state=1,this.inCycle.delete(e);this.cycles=this.cycles.filter(e=>!e.some(e=>n.has(e))),this.indexes.clear();for(let e of this.order([...n]))e.state===1&&this.compute(e)}}for(let e of this.wb.sheets)e.tighten()}spillOut(e,t){let{sheet:n,row:r,col:i}=e,a={top:r,left:i,bottom:r+t.rows-1,right:i+t.cols-1},o=n.spillsIn(a).filter(t=>t!==e);if(a.bottom>=1048576||a.right>=16384||n.holds(a,e)||n.tables.some(e=>an(e.area,a))||n.merges.some(e=>an(e,a))||o.some(t=>_T(t,e)))return n.blockSpill(e,a),!1;for(let e of o)this.evict(e,a);return n.placeSpill(e,a),!0}evict(e,t){let{sheet:n,spill:r}=e;r&&(n.clearSpill(e),n.blockSpill(e,t),e.array=void 0,e.value=P.SPILL,this.moved.push({sheet:n,area:r}))}analysisOf(e){return e.analysis??=lT(this.wb,e)}readsOf(e){let t=[],n=ST(e);for(let r of this.analysisOf(e.shared).reads){let e=r.kind===`ref`?this.resolveRef(r,n):this.structured(r,n);e instanceof B?t.push(e):e instanceof rl&&t.push(...e.parts)}return t}readsOfFormula(e,t){let n=[],r={sheet:t,row:e.row,col:e.col,dr:0,dc:0};for(let t of this.analysisOf(e).reads){let e=t.kind===`ref`?this.resolveRef(t,r):this.structured(t,r);e instanceof B?n.push(e):e instanceof rl&&n.push(...e.parts)}return n}order(e){this.pass+=1;let{pass:t}=this,n=[],r=new Set,i=[],a=e=>{e.mark=t,i.push({cell:e,reads:this.pending(e,r),next:0})};for(let r of e)if(r.mark!==t)for(a(r);;){let e=i[i.length-1];if(!e)break;let r=e.reads[e.next];e.next+=1,r===void 0?(n.push(e.cell),i.pop()):r.mark!==t&&r.state===1&&a(r)}return n}pending(e,t){let n=[];for(let r of this.readsOf(e)){let{sheet:e}=r;if(r.single){let t=e.at(r.top,r.left);t instanceof Cr&&n.push(t);continue}if(t.has(r.key))continue;t.add(r.key);let i=Math.min(r.right,e.columnsUsed-1);for(let t=r.left;t<=i;t++){if(!e.hasFormulas(t))continue;let[i,a]=e.span(t,r.top,r.bottom);for(let r=i;r<=a;r++){let i=e.at(r,t);i instanceof Cr&&n.push(i)}}}return n}compute(e){if(this.stack.length>=pT){e.value=P.CALC,e.state=0;return}e.state=2,this.stack.push(e),this.computed+=1;let{node:t}=e.shared,n=t?this.top(this.eval(t,ST(e))):P.NAME;this.stack.pop(),this.unsettled.has(e)&&!this.inCycle.has(e)&&(this.inCycle.add(e),this.cycles.push([e])),this.settleResult(e,n),e.state=0}settleResult(e,t){let{sheet:n}=e,r=e.spill,i=e.array;if(n.clearSpill(e),e.array=void 0,t instanceof F){let n=xT(t);n.rows*n.cols<=1||this.spillOut(e,n)?(e.array=n,e.value=n.at(0,0)??0):e.value=P.SPILL}else e.value=t;this.inCycle.has(e)&&(n.clearSpill(e),e.value=P.CYCLE,e.array=void 0);let a=e.spill;gT(i,e.array)&&bT(r,a)||(r&&this.moved.push({sheet:n,area:r}),a&&this.moved.push({sheet:n,area:a}))}top(e){let t=this.flat(e);return t===null?0:t}flat(e){return e instanceof B?e.single?this.read(e.sheet,e.top,e.left):this.matrix(e):e instanceof rl?P.VALUE:e instanceof il?P.CALC:e instanceof al?null:e}matrix(e){let t=e.bottom===1048575?Math.min(e.bottom,e.sheet.lastRow):e.bottom,n=e.right===16383?Math.min(e.right,e.sheet.columnsUsed-1):e.right,r=Math.max(0,t-e.top+1),i=Math.max(0,n-e.left+1),a=Array(r*i);for(let t=0;t<r;t++)for(let n=0;n<i;n++)a[t*i+n]=this.read(e.sheet,e.top+t,e.left+n);return new F(r,i,a)}each(e,t){let{sheet:n}=e,r=Math.min(e.right,n.columnsUsed-1);for(let i=e.left;i<=r;i++){let[r,a]=n.span(i,e.top,e.bottom);for(let e=r;e<=a;e++){let r=n.at(e,i);r===void 0?n.spillAt(e,i)&&t(this.read(n,e,i),e,i):t(typeof r==`object`&&!(r instanceof N)?this.read(n,e,i):r,e,i)}}}evaluate(e,t){let{node:n}=e;return n?this.top(this.eval(n,{sheet:t,row:e.row,col:e.col,dr:0,dc:0})):P.NAME}evaluateAt(e,t,n,r){let{node:i}=e;return i?this.top(this.eval(i,{sheet:t,row:n,col:r,dr:n-e.row,dc:r-e.col})):P.NAME}bound(e,t,n){let r=e.abs?e.index:e.index+t;return r<0||r>=n?void 0:r}resolveRef(e,t){let n=e.sheet===void 0?t.sheet:this.wb.sheet(e.sheet);if(!n)return P.REF;let r=0,i=Yt-1,a=0,o=Jt-1;if(e.col){let n=this.bound(e.col,t.dc,Yt),a=this.bound(e.col2??e.col,t.dc,Yt);if(n===void 0||a===void 0)return P.REF;r=Math.min(n,a),i=Math.max(n,a)}if(e.row){let n=this.bound(e.row,t.dr,Jt),r=this.bound(e.row2??e.row,t.dr,Jt);if(n===void 0||r===void 0)return P.REF;a=Math.min(n,r),o=Math.max(n,r)}if(e.lastSheet!==void 0){let t=this.wb.sheet(e.lastSheet);if(!t)return P.REF;let[s,c]=[Math.min(n.index,t.index),Math.max(n.index,t.index)];return new rl(this.wb.sheets.slice(s,c+1).map(e=>new B(e,a,r,o,i)))}return new B(n,a,r,o,i)}structured(e,t){let n=e.table===void 0?t.sheet.tableAt(t.row,t.col):this.wb.table(e.table);return n?CT(n,e,t):e.table===void 0?P.REF:P.NAME}nameValue(e,t){let n=e.toLowerCase();for(let e=t.scope;e;e=e.parent){let t=e.names.get(n);if(t!==void 0)return t}let r=this.wb.name(e);if(r){if(!r.formula)return r.value??null;let{node:e}=r.formula;if(!e)return P.NAME;if(this.namesAt.has(n))return P.CYCLE;this.namesAt.add(n);try{return this.eval(e,{sheet:t.sheet,row:0,col:0,dr:0,dc:0})}finally{this.namesAt.delete(n)}}let i=this.wb.table(e);if(i){let{top:e,left:t,bottom:n,right:r}=i.data;return new B(i.sheet,e,t,n,r)}return P.NAME}intersect(e,t){return!(e instanceof B)||e.single?e:e.cols===1&&t.row>=e.top&&t.row<=e.bottom?new B(e.sheet,t.row,e.left,t.row,e.left):e.rows===1&&t.col>=e.left&&t.col<=e.right?new B(e.sheet,e.top,t.col,e.top,t.col):P.VALUE}unary(e,t){let n=this.flat(e);return n instanceof F?new F(n.rows,n.cols,n.data.map(t)):t(n)}operate(e,t,n){let r=this.flat(t),i=this.flat(n);return r instanceof F||i instanceof F?wd(r instanceof F?r:new F(1,1,[r]),i instanceof F?i:new F(1,1,[i]),(t,n)=>Cd(e,t,n)):Cd(e,r,i)}rangeOf(e,t){return e instanceof N?e:t instanceof N?t:!(e instanceof B)||!(t instanceof B)||e.sheet!==t.sheet?P.REF:new B(e.sheet,Math.min(e.top,t.top),Math.min(e.left,t.left),Math.max(e.bottom,t.bottom),Math.max(e.right,t.right))}intersection(e,t){if(e instanceof N)return e;if(t instanceof N)return t;if(!(e instanceof B)||!(t instanceof B))return P.REF;let n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.bottom,t.bottom),a=Math.min(e.right,t.right);return e.sheet!==t.sheet||n>i||r>a?P.NULL:new B(e.sheet,n,r,i,a)}union(e,t){if(e instanceof N)return e;if(t instanceof N)return t;let n=e=>e instanceof B?[e]:e instanceof rl?e.parts:[],r=[...n(e),...n(t)];return r.length===0?P.VALUE:new rl(r)}eval(e,t){switch(e.kind){case`number`:case`string`:case`boolean`:return e.value;case`error`:return N.of(e.code);case`missing`:return ol;case`ref`:return this.resolveRef(e,t);case`structured`:return this.structured(e,t);case`name`:return this.nameValue(e.name,t);case`paren`:return this.eval(e.arg,t);case`unary`:{let n=this.eval(e.arg,t);return e.op===`@`?this.intersect(n,t):e.op===`+`?n:this.unary(n,e=>Cd(`*`,e,-1))}case`postfix`:{let n=this.eval(e.arg,t);if(e.op===`%`)return this.unary(n,e=>Cd(`/`,e,100));if(n instanceof B&&n.single){let e=n.sheet.at(n.top,n.left);if(e instanceof Cr){this.read(n.sheet,n.top,n.left);let{spill:t}=e;if(t)return new B(n.sheet,t.top,t.left,t.bottom,t.right);if(e.array)return n}}return P.REF}case`binary`:{let n=this.eval(e.left,t),r=this.eval(e.right,t);return e.op===`:`?this.rangeOf(n,r):e.op===` `?this.intersection(n,r):e.op===`,`?this.union(n,r):this.operate(e.op,n,r)}case`array`:return new F(e.rows.length,e.rows[0]?.length??0,e.rows.flatMap(e=>e.map(e=>{let n=this.eval(e,t);return n instanceof F||n instanceof B||n instanceof rl||n instanceof il||n instanceof al?P.VALUE:n})));case`invoke`:{let n=this.eval(e.callee,t);return n instanceof il?this.invoke(n,e.args,t):n instanceof N?n:P.VALUE}case`call`:return this.call(e.name,e.args,t)}}invoke(e,t,n){return this.apply(e,t.map(e=>this.eval(e,n)))}apply(e,t){if(t.length>e.params.length)return P.VALUE;let n=new Map;return e.params.forEach((e,r)=>{n.set(e,t[r]??ol)}),this.eval(e.body,{...e.frame,scope:{names:n,...e.frame.scope?{parent:e.frame.scope}:{}}})}call(e,t,n){let r=cf.get(e);if(!r){let r=this.nameValue(e,n);return r instanceof il?this.invoke(r,t,n):P.NAME}let i={calc:this,frame:n};if(t.length<r.min||t.length>r.max)return P.VALUE;if(r.kind===`lazy`)return r.call(t,i);let a=t.map(e=>this.eval(e,n));return r.kind===`raw`?r.call(a,i):this.lifted(r.call,r.errors===!0,a)}lifted(e,t,n){let r=n.map(e=>e instanceof al?void 0:this.flat(e)),i=n=>{if(!t){for(let e of n)if(e instanceof N)return e}return e(...n)};if(!r.some(e=>e instanceof F))return i(r);let a=r.filter(e=>e instanceof F),o=Math.max(...a.map(e=>e.rows)),s=Math.max(...a.map(e=>e.cols)),c=Array(o*s);for(let e=0;e<o;e++)for(let t=0;t<s;t++)c[e*s+t]=i(r.map(n=>{if(!(n instanceof F))return n;let r=n.rows===1?0:e,i=n.cols===1?0:t;return r<n.rows&&i<n.cols?n.at(r,i):P.NA}));return new F(o,s,c)}scalar(e,t){if(e instanceof al)return null;if(e instanceof B){let n=this.intersect(e,t);return n instanceof B?this.read(n.sheet,n.top,n.left):P.VALUE}return e instanceof F?e.at(0,0):e instanceof rl||e instanceof il?P.VALUE:e}recalculate(){let e=this.allCells().filter(e=>this.analysisOf(e.shared).volatile);return this.mark(e),this}key(e,t,n){return`${String(e.index)}:${String(Er(t,n))}`}addEdges(e){this.analysisOf(e.shared).volatile&&this.volatiles.add(e);for(let t of this.readsOf(e))if(t.single){let n=this.key(t.sheet,t.top,t.left),r=this.dependents.get(n);r||(r=new Set,this.dependents.set(n,r)),r.add(e)}else{let n=this.watches.get(t.key);if(!n){if(n=new vT(t),this.watches.set(t.key,n),t.cols>mT)this.wideWatches.push(n);else for(let e=t.left;e<=t.right;e++){let r=`${String(t.sheet.index)}:${String(e)}`,i=this.watchesAt.get(r);i?i.push(n):this.watchesAt.set(r,[n])}}n.cells.add(e)}}removeEdges(e){this.volatiles.delete(e);for(let t of this.readsOf(e))t.single?this.dependents.get(this.key(t.sheet,t.top,t.left))?.delete(e):this.watches.get(t.key)?.cells.delete(e)}build(){if(!this.graph){this.graph=!0;for(let e of this.allCells())this.addEdges(e)}}readersIn(e,t){let n=new Set,r=t.right;for(let i=t.top;i<=t.bottom;i++)for(let a=t.left;a<=r;a++)for(let t of this.dependents.get(this.key(e,i,a))??[])n.add(t);let i=new Set,a=r=>{if(i.has(r))return;i.add(r);let{reference:a,cells:o}=r;if(a.sheet===e&&an(a,t))for(let e of o)n.add(e)};this.wideWatches.forEach(a);for(let n=t.left;n<=r;n++)this.watchesAt.get(`${String(e.index)}:${String(n)}`)?.forEach(a);return[...n]}readers(e,t,n){this.build();let r=new Set(this.dependents.get(this.key(e,t,n))),i=`${String(e.index)}:${String(n)}`,a=this.watchesAt.get(i)??[];for(let i of[a,this.wideWatches])for(let{reference:a,cells:o}of i)if(a.sheet===e&&t>=a.top&&t<=a.bottom&&n>=a.left&&n<=a.right)for(let e of o)r.add(e);return[...r]}precedents(e){return this.readsOf(e)}mark(e){this.build();let t=new Set(e),n=[...e];for(;;){let e=n.pop();if(!e)break;for(let r of this.readers(e.sheet,e.row,e.col))t.has(r)||(t.add(r),n.push(r))}this.settle(t)}settle(e){for(let t of e)t.state=1,this.inCycle.delete(t);this.cycles=this.cycles.filter(t=>!t.some(t=>e.has(t))),this.run([...e])}set(e,t,n,r){let i=typeof r==`string`&&r.length>1&&r.startsWith(`=`)?new Cr(new Sr(r,t,n,{file:``}),e,t,n):void 0;this.change([{sheet:e,row:t,col:n,slot:i??r??void 0}])}prepare(){this.build()}change(e){this.build();let t=new Set,n=[...this.unsettled];this.unsettled.clear();for(let{sheet:r,row:i,col:a,slot:o}of e){let e=r.at(i,a);e instanceof Cr&&(this.removeEdges(e),t.delete(e),e.spill&&this.moved.push({sheet:r,area:e.spill}),r.clearSpill(e));let s=r.spillAt(i,a);s&&n.push(s),n.push(...r.blockedBy({top:i,left:a,bottom:i,right:a})),r.replace(i,a,o),o instanceof Cr&&(this.addEdges(o),t.add(o))}for(let{sheet:t,row:r,col:i}of e)n.push(...this.readers(t,r,i));for(n.push(...this.volatiles);;){let e=n.pop();if(!e)break;t.has(e)||(t.add(e),n.push(...this.readers(e.sheet,e.row,e.col)))}this.settle(t)}setName(e,t){let n=this.wb.name(e);if(!n)throw Error(`There is no name ${e}.`);n.value=t,delete n.formula;let r=e.toLowerCase();this.mark(this.allCells().filter(e=>this.analysisOf(e.shared).names.has(r)))}numberOf(e){return H(e)}},bT=(e,t)=>e?.top===t?.top&&e?.left===t?.left&&e?.bottom===t?.bottom&&e?.right===t?.right;function xT(e){return e.data.some(e=>e===null)?new F(e.rows,e.cols,e.data.map(e=>e??0)):e}function ST(e){return{sheet:e.sheet,row:e.row,col:e.col,dr:e.row-e.shared.row,dc:e.col-e.shared.col}}function CT(e,t,n){let{sheet:r}=e,i=e.area,a=i.left,o=i.right,[s,c]=t.columns;if(s!==void 0){let t=e.column(s),n=c===void 0?t:e.column(c);if(!t||!n)return P.REF;a=i.left+Math.min(t.index,n.index),o=i.left+Math.max(t.index,n.index)}if(t.thisRow)return n.sheet!==r||n.row<=i.top||n.row>i.bottom?P.VALUE:new B(r,n.row,a,n.row,o);let l=t.sections;if(l.includes(`#Totals`))return P.REF;let u=l.includes(`#All`)||l.includes(`#Headers`),d=l.length===0||l.includes(`#All`)||l.includes(`#Data`),f=u?i.top:i.top+1,p=d?i.bottom:i.top;return new B(r,f,a,p,o)}var wT=e=>Be(e.key)?String(e.key.value):void 0,TT=96,ET=e=>Be(e)||He(e)&&e.items.every(Be),DT=new Set([``,`sheets[]`,`tables[]`,`cells`,`columns`,`rows`,`names`,`scenarios`]);function OT(e,t){if(He(e)){for(let n of e.items)OT(n,`${t}[]`);e.flow=e.items.every(Be)}else if(Ne(e)){for(let t of e.items)OT(t.value,wT(t)??``);e.flow=!DT.has(t)&&e.items.length>0&&e.items.every(e=>ET(e.value)||Ne(e.value)&&e.value.flow===!0),e.flow&&new Le(e).toString({lineWidth:0,flowCollectionPadding:!0}).length>TT&&(e.flow=!1)}}var kT={lineWidth:0,flowCollectionPadding:!0};function AT(e){let t=new Le(e,{aliasDuplicateObjects:!1});OT(t.contents,``);let n=t.toString(kT);return n===`{}
13
- `?``:jT(n)}var jT=e=>e.replace(/\[ ([^[\]{}"'\n]*) \]/g,`[$1]`).replace(/\[ \{/g,`[{`).replace(/\} \]/g,`}]`),MT=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function NT(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>NT(e,t[n]));if(!MT(e)||!MT(t))return!1;let n=e=>Object.keys(e).filter(t=>e[t]!==void 0),r=n(e);return r.length===n(t).length&&r.every(n=>n in t&&NT(e[n],t[n]))}function PT(e,t,n,r,i){if(!NT(t,n)){if(Ne(e)&&!e.flow&&MT(t)&&MT(n))for(let a of new Set([...Object.keys(t),...Object.keys(n)])){let o=e.items.find(e=>wT(e)===a)?.value;NT(t[a],n[a])||PT(o,t[a],n[a],[...r,a],i)}else if(He(e)&&!e.flow&&Array.isArray(t)&&Array.isArray(n)&&n.length>0){let a=Math.min(t.length,n.length),o=0;for(;o<a&&NT(t[o],n[o]);)o++;let s=0;for(;s<a-o&&NT(t[t.length-1-s],n[n.length-1-s]);)s++;let c=t.length-o-s,l=n.length-o-s,u=Math.min(c,l);for(let a=o;a<o+u;a++)PT(e.items[a],t[a],n[a],[...r,a],i);for(let e=o+c-1;e>=o+u;e--)i.push({path:[...r,e],value:void 0});for(let e=o+u;e<o+l;e++)i.push({path:[...r,e],value:n[e],...s>0?{insert:!0}:{}})}else i.push({path:r,value:n})}}var FT=(e,t)=>e.lastIndexOf(`
14
- `,t-1)+1,IT=(e,t)=>{let n=e.indexOf(`
15
- `,t);return n<0?e.length:n+1},LT=(e,t)=>e.split(`
16
- `).map((e,n)=>n===0||e===``?e:` `.repeat(t)+e).join(`
17
- `);function RT(e,t,n,r){let i=new Le({[e]:t},{aliasDuplicateObjects:!1}),a=i.contents;OT(a,``);let o=a.items[0];return(Ne(r)||He(r))&&(Ne(o?.value)||He(o?.value))&&(o.value.flow=r.flow??!1),LT(jT(i.toString(kT).replace(/\n$/,``)),n)}function zT(e,t,n){let r=new Le([e],{aliasDuplicateObjects:!1}),i=r.contents;return OT(i,n),i.flow=!1,LT(jT(r.toString(kT).replace(/\n$/,``)),t)}function BT(e,t){let n=e.contents;for(let e of t.slice(0,-1))if(Ne(n)){if(n.flow)return;n=n.items.find(t=>wT(t)===String(e))?.value}else if(He(n)){if(n.flow)return;n=n.items[Number(e)]}else return;return Ne(n)||He(n)?n:void 0}function VT(e,t){let n=t.items[0]?.range?.[0];if(n===void 0)return;let r=FT(e,n),i=e.indexOf(`-`,r);return i>=0&&i<n?i-r:void 0}function HT(e,t){let n=ze(e);if(n.errors.length>0)return;let{path:r,value:i}=t,a=r[r.length-1],o=BT(n,r);if(a===void 0||!o||o.flow)return;if(He(o)){let n=Number(a),s=VT(e,o);if(s===void 0)return;let c=o.items[n];if(i===void 0){let t=c?.range?.[0],n=c?.range?.[1];return t===void 0||n===void 0?void 0:e.slice(0,FT(e,t))+e.slice(IT(e,n-1))}if(t.insert===!0){let t=c?.range?.[0];if(t===void 0)return;let n=FT(e,t);return`${e.slice(0,n)}${` `.repeat(s)}${zT(i,s,String(r[r.length-2]))}\n${e.slice(n)}`}if(c)return;let l=o.items[o.items.length-1]?.range?.[1];if(l===void 0)return;let u=e.charAt(l-1)===`
18
- `?l:IT(e,l),d=u>0&&e.charAt(u-1)!==`
19
- `?`
20
- `:``;return`${e.slice(0,u)}${d}${` `.repeat(s)}${zT(i,s,String(r[r.length-2]??``))}\n${e.slice(u)}`}let s=String(a),c=o.items.find(e=>wT(e)===s),l=c?.key,u=c?.value??void 0,d=(o.items[0]?.key)?.range?.[0],f=d===void 0?2*(r.length-1):d-FT(e,d);if(c&&l?.range){let t=l.range[0],n=u?.range?u.range[1]:l.range[1];if(i===void 0)return e.slice(0,FT(e,t))+e.slice(IT(e,n-1));let r=e.charAt(n-1)===`
21
- `?`
22
- `:``;return e.slice(0,t)+RT(s,i,f,u)+r+e.slice(n)}if(i===void 0)return e;let p=RT(s,i,f,void 0),m=o.items[o.items.length-1],h=(m?.value??m?.key)?.range?.[1];if(h===void 0)return`${e}${e===``||e.endsWith(`
23
- `)?``:`
24
- `}${` `.repeat(f)}${p}\n`;let g=e.charAt(h-1)===`
25
- `?h:IT(e,h),_=g>0&&e.charAt(g-1)!==`
26
- `?`
27
- `:``;return`${e.slice(0,g)}${_}${` `.repeat(f)}${p}\n${e.slice(g)}`}var UT=400;function WT(e,t){let n=ze(e);if(n.errors.length>0||e.trim()!==``&&!Ne(n.contents)||e.trim()===``)return AT(t);let r=[];if(PT(n.contents,n.toJS(),t,[],r),r.length===0)return e;if(r.length>UT)return AT(t);let i=e;for(let e of r){let n=HT(i,e);if(n===void 0)return AT(t);i=n}let a=ze(i);return a.errors.length===0&&NT(a.toJS(),GT(t))?i:AT(t)}var GT=e=>JSON.parse(JSON.stringify(e)),KT=[`bottom`,`top`,`left`,`right`,`none`,`all`,`outside`,`thickOutside`,`bottomDouble`,`thickBottom`,`topBottom`,`topThickBottom`,`topDoubleBottom`],qT=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),JT={top:e=>({...e,bottom:e.top}),bottom:e=>({...e,top:e.bottom}),left:e=>({...e,right:e.left}),right:e=>({...e,left:e.right})};function YT(e,t,n){let r=e=>({...n,style:e});switch(e){case`bottom`:return[{area:JT.bottom(t),sides:{bottom:n}}];case`top`:return[{area:JT.top(t),sides:{top:n}}];case`left`:return[{area:JT.left(t),sides:{left:n}}];case`right`:return[{area:JT.right(t),sides:{right:n}}];case`all`:return[{area:t,sides:{left:n,right:n,top:n,bottom:n}}];case`outside`:case`thickOutside`:{let i=e===`outside`?n:r(`thick`);return[{area:JT.top(t),sides:{top:i}},{area:JT.bottom(t),sides:{bottom:i}},{area:JT.left(t),sides:{left:i}},{area:JT.right(t),sides:{right:i}}]}case`bottomDouble`:return[{area:JT.bottom(t),sides:{bottom:r(`double`)}}];case`thickBottom`:return[{area:JT.bottom(t),sides:{bottom:r(`thick`)}}];case`topBottom`:return[{area:JT.top(t),sides:{top:n}},{area:JT.bottom(t),sides:{bottom:n}}];case`topThickBottom`:return[{area:JT.top(t),sides:{top:n}},{area:JT.bottom(t),sides:{bottom:r(`thick`)}}];case`topDoubleBottom`:return[{area:JT.top(t),sides:{top:n}},{area:JT.bottom(t),sides:{bottom:r(`double`)}}];case`none`:return[]}}function XT(e,t,n,r){let i=e.spec(t),a=$t(n),o=i.format?.find(e=>e.range===a)?.border;Uu(e,t,n,{border:{...o,...r}})}function ZT(e,t,n,r,i={}){let a=e.workbook.sheet(t);if(!a)return V(`no-sheet`);let o=new gu(e);if(r===`none`)return Uu(o,a,n,{border:void 0}),o.finish();let s={style:i.style??`thin`,...i.color===void 0?{}:{color:i.color}};for(let e of YT(r,n,s))XT(o,a,e.area,e.sides);return o.finish()}function QT(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return V(`no-sheet`);let a=new gu(e),o=e=>e??{style:`none`},{top:s,bottom:c,left:l,right:u,horizontal:d,vertical:f}=r;return s!==void 0&&XT(a,i,JT.top(n),{top:o(s)}),c!==void 0&&XT(a,i,JT.bottom(n),{bottom:o(c)}),l!==void 0&&XT(a,i,JT.left(n),{left:o(l)}),u!==void 0&&XT(a,i,JT.right(n),{right:o(u)}),d!==void 0&&n.bottom>n.top&&XT(a,i,{...n,bottom:n.bottom-1},{bottom:o(d)}),f!==void 0&&n.right>n.left&&XT(a,i,{...n,right:n.right-1},{right:o(f)}),a.finish()}function $T(e,t,n){let r=Math.min(t.right,e.columnsUsed-1),i=Math.min(t.bottom,e.lastRow);for(let a=t.top;a<=i;a++){let o=!0;for(let i=t.left;i<=r;i++)if(e.at(a,i)!==void 0){if(o&&(n===`across`||a===t.top))o=!1;else return!0}if(n!==`across`&&!o&&a>=t.top){for(let n=a+1;n<=i;n++)for(let i=t.left;i<=r;i++)if(e.at(n,i)!==void 0)return!0;return!1}}return!1}function eE(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return V(`no-sheet`);if(i.tables.some(e=>an(e.area,n)))return V(`merge-table`);let a=new gu(e),o=a.spec(i),s=(o.merges??[]).filter(e=>{let t=tn(e);return!t||!an(t,n)}),c=r===`across`?Array.from({length:n.bottom-n.top+1},(e,t)=>({...n,top:n.top+t,bottom:n.top+t})):[n],l=[];for(let t of c)(t.top!==t.bottom||t.left!==t.right)&&(l.push($t(t)),tE(a,e,i,t));return l.length===0?fu():(o.merges=[...s,...l],r===`center`&&Uu(a,i,n,{align:`center`}),a.edit.whole=!0,a.finish())}function tE(e,t,n,r){let i=``,a=Math.min(r.right,n.columnsUsed-1),o=Math.min(r.bottom,n.lastRow);for(let s=r.top;s<=o;s++)for(let o=r.left;o<=a;o++)n.at(s,o)!==void 0&&(i===``&&(i=id(t,n,s,o)),(s!==r.top||o!==r.left)&&ku(e,t,n,s,o,``));i!==id(t,n,r.top,r.left)&&ku(e,t,n,r.top,r.left,i)}function nE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r),o=(a.merges??[]).filter(e=>{let t=tn(e);return!t||!an(t,n)});return o.length===0?delete a.merges:a.merges=o,i.edit.whole=!0,i.finish()}function rE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r);return n&&(n.row>0||n.col>0)?a.freeze=Qt(n):delete a.freeze,i.edit.whole=!0,i.finish()}function iE(e,t,n,r,i,a){let o=e.workbook.sheet(t);if(!o)return V(`no-sheet`);let s=new gu(e),c=s.spec(o),l=(e,t)=>{let n=qT(e[t]??{},`hidden`);return a?{...e,[t]:{...n,hidden:!0}}:Object.keys(n).length===0?qT(e,t):{...e,[t]:n}};if(n===`columns`){let e={...c.columns},t=a?Array.from({length:i-r+1},(e,t)=>Xt(r+t)):Object.keys(e).filter(e=>{let t=Zt(e);return t!==void 0&&t>=r&&t<=i});for(let n of t)e=l(e,n);c.columns=e}else{let e={...c.rows},t=a?Array.from({length:i-r+1},(e,t)=>String(r+t+1)):Object.keys(e).filter(e=>{let t=Number(e)-1;return t>=r&&t<=i});for(let n of t)e=l(e,n);c.rows=e}return Gu(c),s.edit.whole=!0,s.finish()}function aE(e,t,n){let r=e.file.sheets,i=r.filter(e=>e.hidden!==!0),a=r.findIndex(e=>e.name===t),o=r[a];if(!o)return V(`no-sheet`);if(n&&i.length<=1)return V(`last-sheet`);let s=qT(o,`hidden`),c=n?{...s,hidden:!0}:s;return{...fu(),file:{...e.file,sheets:r.map((e,t)=>t===a?c:e)},whole:!0}}function oE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r);return n===void 0?delete a.tab:a.tab=n,i.finish()}function sE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a={row:n.top,col:n.left},o=r.tableAt(a.row,a.col);if(o){let e=i.table(r,o);return e.filter===!1?delete e.filter:e.filter=!1,i.edit.whole=!0,i.finish()}let s=i.spec(r);if(s.filter)return delete s.filter,i.edit.whole=!0,i.finish();let c=n.top===n.bottom&&n.left===n.right?sf(r,a):n;if(!c)return V(`no-data`);let l=r.used;return s.filter={range:$t({...c,bottom:Math.min(c.bottom,l?.bottom??c.bottom),right:Math.min(c.right,l?.right??c.right)})},i.edit.whole=!0,i.finish()}function cE(e,t,n,r,i){let a=e.workbook.sheet(t);if(!a)return V(`no-sheet`);let o=new gu(e),{table:s}=n;if(s){let e=o.table(a,s),t=s.columns[r-s.at.col]?.name??``,n=qT(e.filter===!1||!e.filter?{}:e.filter.columns,t),c=i?{...n,[t]:i}:n;Object.keys(c).length===0?delete e.filter:e.filter={columns:c}}else{let e=o.spec(a);if(!e.filter)return V(`no-sheet`);let t=Xt(r),n=qT(e.filter.columns??{},t),s=i?{...n,[t]:i}:n;e.filter={range:e.filter.range,...Object.keys(s).length===0?{}:{columns:s}}}return o.edit.whole=!0,o.finish()}function lE(e,t){let n=e.workbook.sheet(t);if(!n)return V(`no-sheet`);let r=new gu(e),i=r.spec(n);i.filter&&={range:i.filter.range};for(let e of n.tables)e.spec.filter&&delete r.table(n,e).filter;return r.edit.whole=!0,r.finish()}function uE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r);return a.conditional=[n,...a.conditional??[]],i.edit.whole=!0,i.finish()}function dE(e,t){if(!an(e,t))return[e];let n=[];t.top>e.top&&n.push({...e,bottom:t.top-1}),t.bottom<e.bottom&&n.push({...e,top:t.bottom+1});let r=Math.max(e.top,t.top),i=Math.min(e.bottom,t.bottom);return t.left>e.left&&n.push({...e,top:r,bottom:i,right:t.left-1}),t.right<e.right&&n.push({...e,top:r,bottom:i,left:t.right+1}),n}function fE(e,t){let n=nn(e);if(!n)return e;let r=n.flatMap(e=>dE(e,t));return r.length===0?void 0:r.map($t).join(` `)}function pE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r),o=n?(a.conditional??[]).flatMap(e=>{let t=fE(e.range,n);return t===void 0?[]:[{...e,range:t}]}):[];return o.length===0?delete a.conditional:a.conditional=o,i.edit.whole=!0,i.finish()}function mE(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return V(`no-sheet`);let a=new gu(e),o=a.spec(i),s=(o.validations??[]).flatMap(e=>{let t=fE(e.range,n);return t===void 0?[]:[{...e,range:t}]}),c=r?[...s,{...r,range:$t(n)}]:s;return c.length===0?delete o.validations:o.validations=c,a.edit.whole=!0,a.finish()}function hE(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r);return a.charts=[...a.charts??[],n],i.finish()}function gE(e,t,n,r){let i=e.workbook.sheet(t),a=i?.spec.charts?.[n];if(!i||!a)return V(`no-sheet`);let o=new gu(e),s=o.spec(i),c=Object.fromEntries(Object.entries({...a,...r}).filter(([,e])=>e!==void 0));return s.charts=(s.charts??[]).map((e,t)=>t===n?c:e),o.finish()}function _E(e,t,n){let r=e.workbook.sheet(t);if(!r)return V(`no-sheet`);let i=new gu(e),a=i.spec(r),o=(a.charts??[]).filter((e,t)=>t!==n);return o.length>0?a.charts=o:delete a.charts,i.finish()}function vE(e){let t=[...e].sort((e,t)=>e.row-t.row||e.col-t.col),n=[];for(let e of t){let t=n[n.length-1];t?.top===e.row&&t.right===e.col-1?t.right=e.col:n.push({top:e.row,bottom:e.row,left:e.col,right:e.col})}let r=[],i=[];for(let e of n){let t=r.find(t=>t.bottom===e.top-1&&t.left===e.left&&t.right===e.right);t?t.bottom=e.bottom:r.push({...e});for(let t=r.length-1;t>=0;t--){let n=r[t];n&&n.bottom<e.top-1&&(i.push(n),r.splice(t,1))}}return[...i,...r].sort((e,t)=>e.top-t.top||e.left-t.left)}var yE=[[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],[`周一`,`周二`,`周三`,`周四`,`周五`,`周六`,`周日`],[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`]],bE=[[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`]],xE=[...yE,...bE];function SE(e){let t=e.trim().toLowerCase();for(let e of xE){let n=e.findIndex(e=>e.toLowerCase()===t);if(n>=0)return{list:e,at:n}}}function CE(e,t){return t===t.toUpperCase()&&t!==t.toLowerCase()?e.toUpperCase():t===t.toLowerCase()&&t!==t.toUpperCase()?e.toLowerCase():e}var wE=/^\d{4}-\d{2}-\d{2}/u;function TE(e,t,n){let r=e.length,i=(r-1)/2,a=e.reduce((e,t)=>e+t,0)/r,o=0,s=0;e.forEach((e,t)=>{o+=(t-i)*(e-a),s+=(t-i)**2});let c=s===0?1:o/s,l=[];for(let e=0;e<t;e++){let t=a+c*((n?-1-e:r+e)-i);l.push(Number(t.toPrecision(15)))}return l}function EE(e,t,n){let r=e.map(e=>Tn(e)),i=r.flatMap(e=>e?[e]:[]),[a,o]=i;if(a&&o&&i.length===r.length){let e=e=>e.getUTCFullYear()*12+e.getUTCMonth(),r=e(o)-e(a);if(r!==0&&i.every((t,n)=>t.getUTCDate()===a.getUTCDate()&&e(t)===e(a)+r*n)){let e=[];for(let o=0;o<t;o++){let t=n?-1-o:i.length+o;e.push(wn(new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth()+r*t,a.getUTCDate()))))}return e}}if(e.length===1){let[r=0]=e;return Array.from({length:t},(e,t)=>n?r-t-1:r+t+1)}return TE(e,t,n)}var DE=(e,t)=>t.length>10?Dn(e):Dn(Math.round(e)),OE=(e,t,n)=>`${e}${String(Math.max(n,0)).padStart(t.length,`0`)}`,kE=/^(.*?)(\d+)$/su;function AE(e,t,n){let r=e.map(e=>kE.exec(e)),[i]=r;if(!i||r.some(e=>!e||e[1]!==i[1]))return;let a=i[1]??``,o=i[2]??``,s=TE(r.map(e=>Number(e?.[2])),t,n),c=/^q$/iu.test(a);return s.map(e=>OE(a,o,c?(Math.round(e)+399)%4+1:Math.round(e)))}function jE(e,t,n){let r=e.map(SE),[i]=r;if(!i||r.some(e=>e?.list!==i.list))return;let a=i.list.length,o=r[r.length-1],s=r.length>1&&o&&(o.at-i.at)/(r.length-1)||1,c=e[0]??``,l=[],u=n?i.at:o?.at??i.at;for(let e=0;e<t;e++){let t=u+(n?-s:s)*(e+1),r=i.list[(Math.round(t)%a+a)%a]??``;l.push(CE(r,c))}return l}var ME=(e,t,n)=>{let r=e.length;return Array.from({length:t},(t,i)=>n?e[((r-1-i)%r+r)%r]??``:e[i%r]??``)};function NE(e,t,n={}){let r=n.mode??`auto`,i=n.back===!0;if(r===`copy`||e.length===0)return ME(e,t,i);let a=e.map(e=>Pn(e).value),o=e.length===1,s=a.flatMap(e=>typeof e==`number`?[e]:[]);if(s.length===a.length){if(e.every(e=>wE.test(e)))return EE(s,t,i).map(t=>DE(t,e[0]??``));if(o&&r===`auto`)return ME(e,t,i);let n=s;return(o&&n[0]!==void 0?Array.from({length:t},(e,t)=>i?(n[0]??0)-t-1:(n[0]??0)+t+1):TE(n,t,i)).map(String)}return a.every(e=>typeof e==`string`)?jE(e,t,i)??AE(e,t,i)??ME(e,t,i):ME(e,t,i)}var PE=e=>Pn(e).formula!==void 0;function FE(e,t,n){let r=fr(e);return r.ok?Xn(r.node,t,n):void 0}var IE=(e,t)=>!e.tables.some(e=>an(e.area,t))&&!e.blocks.some(e=>an(e.area,t));function LE(e,t,n,r){if(e.some(e=>PE(e.text))){let r=e.length;return t.map((t,i)=>{let a=n?e[((r-1-i)%r+r)%r]:e[i%r],o=a?.text??``;return{...t,text:a?yu(o,t.row-a.row,t.col-a.col):o}})}let i=NE(e.map(e=>e.text),t.length,{mode:r,back:n});return t.map((e,t)=>({...e,text:i[t]??``}))}var RE=[`bold`,`italic`,`underline`,`strike`,`font`,`size`,`color`,`fill`,`align`,`valign`,`wrap`,`shrink`,`indent`,`rotation`,`border`,`format`],zE=Object.fromEntries(RE.map(e=>[e,void 0]));function BE(e,t,n,r){let i=new Map;for(let e of r){let r=t.lookAt(e.from.row,e.from.col),a=n.lookAt(e.to.row,e.to.col);if(JSON.stringify(r)===JSON.stringify(a))continue;let o=JSON.stringify(r),s=i.get(o);s?s.places.push(e.to):i.set(o,{look:r,places:[e.to]})}for(let{look:t,places:r}of i.values()){let i={};for(let e of RE)i[e]=t[e];for(let t of vE(r))Uu(e,n,t,i)}}function VE(e,t,n,r,i=`auto`){let a=e.workbook.sheet(t);if(!a)return V(`no-sheet`);let o=r.bottom>n.bottom||r.top<n.top,s=r.top<n.top||r.left<n.left,c=new gu(e),l=o?{first:n.left,last:n.right}:{first:n.top,last:n.bottom},u=new Map,d=(t,n)=>{let r=`${String(t)}:${String(n)}`,i=u.get(r);return i===void 0&&(i=id(e,a,t,n),u.set(r,i)),i},f=(n.bottom-n.top+1)*(n.right-n.left+1),p=new Set;for(let e=n.top;e<=n.bottom;e++)for(let t=n.left;t<=n.right;t++){let n=d(e,t);PE(n)&&p.add(FE(n,e,t)??``)}if(p.size===1&&f>0&&IE(a,r)&&HE(d,n)){let e=c.spec(a);return Pu(e,r),e.cells={...e.cells,[$t(r)]:yu(d(n.top,n.left),r.top-n.top,r.left-n.left)},c.edit.whole=!0,UE(c,a,n,r,o),c.finish()}for(let t=l.first;t<=l.last;t++){let l=[];if(o)for(let e=n.top;e<=n.bottom;e++)l.push({row:e,col:t,text:d(e,t)});else for(let e=n.left;e<=n.right;e++)l.push({row:t,col:e,text:d(t,e)});let u=[],f=s?o?n.top-1:n.left-1:o?n.bottom+1:n.right+1,p=o?s?r.top:r.bottom:s?r.left:r.right,m=s?-1:1;for(let e=f;s?e>=p:e<=p;e+=m)u.push(o?{row:e,col:t}:{row:t,col:e});for(let t of LE(l,u,s,i))ku(c,e,a,t.row,t.col,t.text)}return UE(c,a,n,r,o),c.finish()}function HE(e,t){for(let n=t.top;n<=t.bottom;n++)for(let r=t.left;r<=t.right;r++)if(!PE(e(n,r)))return!1;return!0}function UE(e,t,n,r,i){let a=[],o=n.bottom-n.top+1,s=n.right-n.left+1;for(let e=r.top;e<=r.bottom;e++)for(let t=r.left;t<=r.right;t++){if(rn(n,e,t))continue;let r=i?n.top+((e-n.top)%o+o)%o:e,c=i?t:n.left+((t-n.left)%s+s)%s;a.push({from:{row:r,col:c},to:{row:e,col:t}})}BE(e,t,t,a)}function WE(e,t,n,r){let i=e.workbook.sheet(t),a=e.workbook.sheet(n);if(!i||!a)return V(`no-sheet`);let o=new gu(e);return BE(o,i,a,r),o.finish()}function GE(e,t){let n=(t,n)=>n>=0&&e.at(t,n)!==void 0;for(let e of[t.left-1,t.right+1]){if(!n(t.bottom,e)&&!n(t.bottom+1,e))continue;let r=t.bottom;for(;n(r+1,e);)r+=1;if(r>t.bottom)return r}}function KE(e,t,n){if(!PE(e))return e;let r=fr(e);return r.ok?xr(Wn(r.node,e=>e.kind===`ref`?e.sheet===void 0?{...e,sheet:t}:e.sheet.toLowerCase()!==n.toLowerCase()||e.lastSheet!==void 0?e:Object.fromEntries(Object.entries(e).filter(([e])=>e!==`sheet`)):e)):e}function qE(e){let t=fu();t.whole=!0;for(let n of e){n.file&&(t.file=n.file);for(let[e,r]of n.rows)t.rows.set(e,r)}return t}function JE(e,t){let n=t.file??e.file,r=new Map(e.rows);for(let[e,n]of t.rows)r.set(e,n);return{file:n,rows:r,workbook:Hr({file:n,rows:e=>r.get(e)})}}function YE(e,t,n,r,i){let a=e.workbook.sheet(t),o=e.workbook.sheet(r);if(!a||!o)return V(`no-sheet`);let s=i.row-n.top,c=i.col-n.left;if(s===0&&c===0&&a===o)return fu();let l={top:i.row,left:i.col,bottom:n.bottom+s,right:n.right+c},u=a.tables.filter(e=>rn(n,e.area.top,e.area.left)&&rn(n,e.area.bottom,e.area.right));for(let e of a.tables)if(!u.includes(e)&&an(e.area,n)&&n.top<=e.at.row)return V(`table-move`);if(u.length>0&&a!==o)return V(`table-move`);for(let e of o.tables)if(!u.includes(e)&&an(e.area,l)&&l.top<=e.at.row)return V(`table-move`);let d=ou(e,{op:`move-cells`,sheet:t,area:n,rows:s,columns:c,...a===o?{}:{to:r}}),f={...fu(),file:d.file,rows:new Map(d.rows)},p=JE(e,f),m=p.workbook.sheet(t),h=p.workbook.sheet(r);if(!m||!h)return V(`no-sheet`);let g=[],_=[],v=Math.min(n.right,m.columnsUsed-1),y=Math.min(n.bottom,m.lastRow),b=(e,t)=>u.some(n=>rn(n.area,e,t));for(let e=n.top;e<=y;e++)for(let i=n.left;i<=v;i++)if(!b(e,i)){if(m.at(e,i)!==void 0){let n=id(p,m,e,i);g.push({row:e+s,col:i+c,text:a===o?n:KE(n,t,r)})}_.push({from:{row:e,col:i},to:{row:e+s,col:i+c}})}let x=Nu(p,t,n);if(x.refused!==void 0)return x;let S=JE(p,x),C=[f,x],w=S;if(u.length>0){let e=new gu(S),n=S.workbook.sheet(t);if(!n)return V(`no-sheet`);for(let t of u){let r=n.tables.find(e=>e.name===t.name);if(!r)continue;let i=e.table(n,r);i.at=Qt({row:t.at.row+s,col:t.at.col+c})}let r=e.finish();C.push(r),w=JE(S,r)}let T=Au(w,r,g);if(T.refused!==void 0)return T;C.push(T);let ee=JE(w,T),E=ee.workbook.sheet(t),D=ee.workbook.sheet(r);if(E&&D){let e=new gu(ee);BE(e,m,D,_);let t=_.map(e=>e.from).filter(e=>!(a===o&&rn(l,e.row,e.col))&&Object.keys(m.lookAt(e.row,e.col)).length>0);for(let n of vE(t))Uu(e,E,n,zE);C.push(e.finish())}return qE(C)}var XE=f({en:{loading:`Opening…`,unreadable:`This sheet cannot be shown: its sheet.yaml cannot be read. Here is what is wrong.`,generated:{line:`sheet.ts makes this sheet`,title:`This sheet is protected`,refused:`The cell or chart you're trying to change is on a protected sheet: sheet.ts makes it.`,ask:e=>e===void 0?`Ask the agent`:`Ask ${e}`,ordinary:`Make Ordinary Sheet`,copied:`Copied: paste it to your agent.`,failed:`sheet.ts does not run: the sheets it makes stay as they last were.`},scenario:{manager:`Scenario Manager`,scenarios:`Scenarios:`,changing:`Changing cells:`,show:`Show`,close:`Close`,base:`Base case`,showing:`showing`,on:e=>`Scenario: ${e}`},files:{insert:`Insert File…`,open:`Open`,remove:`Remove from Cell`,notColumn:`This column does not hold files.`},undo:`Undo`,redo:`Redo`,font:`Font`,fontSize:`Font Size`,bold:`Bold`,italic:`Italic`,underline:`Underline`,fillColor:`Fill Color`,fontColor:`Font Color`,noFill:`No Fill`,automatic:`Automatic`,alignLeft:`Align Left`,center:`Center`,alignRight:`Align Right`,wrapText:`Wrap Text`,numberFormat:`Number Format`,custom:`Custom`,formats:{general:`General`,number:`Number`,currency:`Currency`,accounting:`Accounting`,shortDate:`Short Date`,longDate:`Long Date`,time:`Time`,percentage:`Percentage`,fraction:`Fraction`,scientific:`Scientific`,text:`Text`},insert:`Insert`,delete:`Delete`,insertRows:`Insert Sheet Rows`,insertColumns:`Insert Sheet Columns`,insertSheet:`Insert Sheet`,deleteRows:`Delete Sheet Rows`,deleteColumns:`Delete Sheet Columns`,deleteSheet:`Delete Sheet`,nameBox:`Name Box`,formulaBar:`Formula Bar`,cancel:`Cancel`,enter:`Enter`,insertFunction:`Insert Function`,sheetTabs:`Sheets`,newSheet:`New sheet`,allSheets:`All sheets`,sheetMenu:`Sheet menu`,zoom:`Zoom`,zoomIn:`Zoom In`,zoomOut:`Zoom Out`,duplicate:`Duplicate`,namesList:`Names`,rename:`Rename`,sheetName:e=>`Sheet${String(e)}`,average:`Average`,count:`Count`,sum:`Sum`,changed:(e,t)=>`${e} changed ${String(t)} ${t===1?`thing`:`things`}`,changedElsewhere:e=>`${String(e)} ${e===1?`change`:`changes`} from elsewhere`,previous:`Previous`,next:`Next`,keep:`Keep`,keepAll:`Keep all`,undoAll:`Undo all`,was:e=>`was ${e}`,rowAdded:`row added`,rowRemoved:`row removed`,fileChanged:`rows rewritten`,bothChanged:e=>`You and ${e} changed the same thing. Yours stands.`,formulaProblem:`There's a problem with this formula.`,columnName:`A table's column needs a name.`,badSheetName:`A sheet's name has at most 31 characters and none of \\ / ? * [ ] :`,sheetTaken:`A sheet already has that name.`,lastSheet:`A workbook must keep at least one visible sheet.`,tableHeader:`A table's header row can't be deleted.`,badName:`That name can't be used.`,badReference:`Reference isn't valid.`,overwrite:`Overwrite all cells in this column with this formula`,dialog:{ok:`OK`,cancel:`Cancel`},number:{more:`More Number Formats…`,accounting:`Accounting Number Format`,percent:`Percent Style`,comma:`Comma Style`,increaseDecimal:`Increase Decimal`,decreaseDecimal:`Decrease Decimal`},borders:{title:`Borders`,bottom:`Bottom Border`,top:`Top Border`,left:`Left Border`,right:`Right Border`,none:`No Border`,all:`All Borders`,outside:`Outside Borders`,thickOutside:`Thick Outside Borders`,bottomDouble:`Bottom Double Border`,thickBottom:`Thick Bottom Border`,topBottom:`Top and Bottom Border`,topThickBottom:`Top and Thick Bottom Border`,topDoubleBottom:`Top and Double Bottom Border`,more:`More Borders…`},arrange:{cells:`Cells`,mergeCenter:`Merge & Center`,mergeMenu:`Merge options`,mergeAcross:`Merge Across`,mergeCells:`Merge Cells`,unmerge:`Unmerge Cells`,mergeTable:`Cells in a table can't be merged.`,mergeLoses:`Merging cells only keeps the upper-left value and discards other values.`,format:`Format`,fitRows:`AutoFit Row Height`,fitColumns:`AutoFit Column Width`,hideUnhide:`Hide & Unhide`,hideRows:`Hide Rows`,hideColumns:`Hide Columns`,hideSheet:`Hide Sheet`,unhideRows:`Unhide Rows`,unhideColumns:`Unhide Columns`,unhideSheet:`Unhide Sheet`,unhideEllipsis:`Unhide…`,freezePanes:`Freeze Panes`,unfreeze:`Unfreeze Panes`,freezeTopRow:`Freeze Top Row`,freezeFirstColumn:`Freeze First Column`,tabColor:`Tab Color`,noColor:`No Color`},sortFilter:{title:`Sort & Filter`,customSort:`Custom Sort…`,filter:`Filter`,clear:`Clear`,reapply:`Reapply`,noData:`Select a cell in a range that holds data, and try again.`},filter:{aToZ:`Sort A to Z`,zToA:`Sort Z to A`,aToZShort:`A to Z`,zToAShort:`Z to A`,smallest:`Sort Smallest to Largest`,largest:`Sort Largest to Smallest`,oldest:`Sort Oldest to Newest`,newest:`Sort Newest to Oldest`,clearFrom:e=>`Clear Filter From "${e}"`,search:`Search`,selectAll:`(Select All)`,blanks:`(Blanks)`,found:(e,t)=>`${String(e)} of ${String(t)} records found`},sort:{title:`Sort`,addLevel:`Add Level`,deleteLevel:`Delete Level`,hasHeaders:`My data has headers`,sortBy:`Sort by`,thenBy:`Then by`,column:e=>`Column ${e}`},rules:{title:`Conditional Formatting`,highlight:`Highlight Cells Rules`,topBottom:`Top/Bottom Rules`,greaterThan:`Greater Than…`,lessThan:`Less Than…`,between:`Between…`,equalTo:`Equal To…`,textContains:`Text that Contains…`,duplicateValues:`Duplicate Values…`,top10:`Top 10 Items…`,top10Percent:`Top 10%…`,bottom10:`Bottom 10 Items…`,bottom10Percent:`Bottom 10%…`,aboveAverage:`Above Average…`,belowAverage:`Below Average…`,dataBars:`Data Bars`,colorScales:`Color Scales`,iconSets:`Icon Sets`,clearRules:`Clear Rules`,clearSelected:`Clear Rules from Selected Cells`,clearSheet:`Clear Rules from Entire Sheet`,greaterPrompt:`Format cells that are GREATER THAN:`,lessPrompt:`Format cells that are LESS THAN:`,betweenPrompt:`Format cells that are BETWEEN:`,equalPrompt:`Format cells that are EQUAL TO:`,textPrompt:`Format cells that contain the text:`,duplicatePrompt:`Format cells that contain:`,topPrompt:`Format cells that rank in the TOP:`,topPercentPrompt:`Format cells that rank in the TOP (percent):`,bottomPrompt:`Format cells that rank in the BOTTOM:`,bottomPercentPrompt:`Format cells that rank in the BOTTOM (percent):`,abovePrompt:`Format cells that are ABOVE AVERAGE:`,belowPrompt:`Format cells that are BELOW AVERAGE:`,and:`and`,with:`with`,duplicate:`Duplicate`,unique:`Unique`,looks:{lightRed:`Light Red Fill with Dark Red Text`,yellow:`Yellow Fill with Dark Yellow Text`,green:`Green Fill with Dark Green Text`,lightRedFill:`Light Red Fill`,redText:`Red Text`,redBorder:`Red Border`},scales:{greenYellowRed:`Green - Yellow - Red`,redYellowGreen:`Red - Yellow - Green`,blueWhiteRed:`Blue - White - Red`,whiteRed:`White - Red`,whiteGreen:`White - Green`},icons:{"3Arrows":`3 Arrows`,"5Arrows":`5 Arrows`,"3TrafficLights1":`3 Traffic Lights`,"4TrafficLights":`4 Traffic Lights`,"3Symbols":`3 Symbols`,"3Flags":`3 Flags`,"5Rating":`5 Ratings`}},validation:{title:`Data Validation`,clearAll:`Clear All`,settings:`Settings`,inputMessage:`Input Message`,errorAlert:`Error Alert`,allow:`Allow`,kinds:{any:`Any value`,whole:`Whole number`,decimal:`Decimal`,list:`List`,date:`Date`,time:`Time`,textLength:`Text length`,custom:`Custom`},ignoreBlank:`Ignore blank`,dropdown:`In-cell dropdown`,data:`Data`,operators:{between:`between`,notBetween:`not between`,equal:`equal to`,notEqual:`not equal to`,greaterThan:`greater than`,lessThan:`less than`,greaterThanOrEqual:`greater than or equal to`,lessThanOrEqual:`less than or equal to`},source:`Source`,formula:`Formula`,minimum:`Minimum`,maximum:`Maximum`,value:`Value`,showPrompt:`Show input message when cell is selected`,titleWord:`Title`,showError:`Show error alert after invalid data is entered`,style:`Style`,styles:{stop:`Stop`,warning:`Warning`,information:`Information`},errorMessage:`Error message`,refusedTitle:`Value not allowed`,refused:`This value doesn't match the data validation restrictions defined for this cell.`,retry:`Retry`,no:`No`,yes:`Yes`,continue:`Continue?`},menu:{cut:`Cut`,copy:`Copy`,paste:`Paste`,pasteSpecial:`Paste Special`,values:`Values`,formulas:`Formulas`,formats:`Formats`,entireRow:`Entire Row`,entireColumn:`Entire Column`,clearContents:`Clear Contents`,filter:`Filter`,sort:`Sort`,filterByValue:`Filter by Selected Cell's Value`,formatCells:`Format Cells…`,pickFromList:`Pick From Drop-down List…`,rowHeight:`Row Height…`,columnWidth:`Column Width…`,rowHeightWord:`Row Height`,columnWidthWord:`Column Width`,hide:`Hide`,unhide:`Unhide`,multiple:`That command can't be used on multiple selections.`,tableMove:`Part of a table's header can't be moved.`},fill:{options:`Auto Fill Options`,copy:`Copy Cells`,series:`Fill Series`},formatCells:{title:`Format Cells`,tabs:{number:`Number`,alignment:`Alignment`,font:`Font`,border:`Border`,fill:`Fill`},category:`Category`,categories:{general:`General`,number:`Number`,currency:`Currency`,accounting:`Accounting`,date:`Date`,time:`Time`,percentage:`Percentage`,fraction:`Fraction`,scientific:`Scientific`,text:`Text`,custom:`Custom`},sample:`Sample`,decimals:`Decimal places`,thousands:`Use 1000 Separator (,)`,symbol:`Symbol`,none:`None`,negative:`Negative numbers`,type:`Type`,horizontal:`Horizontal`,vertical:`Vertical`,aligns:{general:`General`,left:`Left (Indent)`,center:`Center`,right:`Right (Indent)`,fill:`Fill`,justify:`Justify`,centerContinuous:`Center Across Selection`,distributed:`Distributed (Indent)`},valigns:{top:`Top`,center:`Center`,bottom:`Bottom`,justify:`Justify`,distributed:`Distributed`},indent:`Indent`,orientation:`Degrees`,shrink:`Shrink to fit`,strikethrough:`Strikethrough`,borderNone:`None`,borderOutline:`Outline`,borderInside:`Inside`,lineStyle:`Style`,lineColor:`Color`,lines:{thin:`Thin`,hair:`Hair`,dotted:`Dotted`,dashed:`Dashed`,dashDot:`Dash Dot`,dashDotDot:`Dash Dot Dot`,medium:`Medium`,mediumDashed:`Medium Dashed`,mediumDashDot:`Medium Dash Dot`,thick:`Thick`,double:`Double`},edges:{top:`Top`,horizontal:`Inside Horizontal`,bottom:`Bottom`,left:`Left`,vertical:`Inside Vertical`,right:`Right`}},chart:{insert:`Insert Chart`,design:`Chart Design`,changeType:`Change Chart Type`,selectData:`Select Data`,dataRange:`Chart data range`,title:`Chart Title`,legend:`Legend`,legendNone:`None`,legendAt:{right:`Right`,top:`Top`,left:`Left`,bottom:`Bottom`},noData:`That range holds no numbers to chart.`,buttons:{columnBar:`Insert Column or Bar Chart`,lineArea:`Insert Line or Area Chart`,pieDoughnut:`Insert Pie or Doughnut Chart`,scatter:`Insert Scatter (X, Y) Chart`},groups:{column2d:`2-D Column`,bar2d:`2-D Bar`,line2d:`2-D Line`,area2d:`2-D Area`,pie2d:`2-D Pie`,doughnut:`Doughnut`,scatter:`Scatter`},types:{"column-clustered":`Clustered Column`,"column-stacked":`Stacked Column`,"column-stacked-100":`100% Stacked Column`,"bar-clustered":`Clustered Bar`,"bar-stacked":`Stacked Bar`,"bar-stacked-100":`100% Stacked Bar`,line:`Line`,"line-markers":`Line with Markers`,area:`Area`,"area-stacked":`Stacked Area`,"area-stacked-100":`100% Stacked Area`,pie:`Pie`,doughnut:`Doughnut`,scatter:`Scatter`,"scatter-lines":`Scatter with Straight Lines and Markers`,"scatter-smooth":`Scatter with Smooth Lines`},name:e=>`Chart ${String(e)}`},spillBlocked:`Spill range isn't blank`},"zh-cn":{loading:`正在打开…`,unreadable:`无法显示此工作表:无法读取它的 sheet.yaml。问题如下。`,generated:{line:`此工作表由 sheet.ts 生成`,title:`此工作表受保护`,refused:`您尝试更改的单元格或图表位于受保护的工作表上:它由 sheet.ts 生成。`,ask:e=>e===void 0?`询问智能体`:`询问 ${e}`,ordinary:`转为普通工作表`,copied:`已复制:粘贴给你的智能体。`,failed:`sheet.ts 无法运行:它生成的工作表保持上次的样子。`},scenario:{manager:`方案管理器`,scenarios:`方案:`,changing:`可变单元格:`,show:`显示`,close:`关闭`,base:`基准方案`,showing:`显示中`,on:e=>`方案:${e}`},files:{insert:`插入文件…`,open:`打开`,remove:`从单元格移除`,notColumn:`此列不存放文件。`},undo:`撤消`,redo:`恢复`,font:`字体`,fontSize:`字号`,bold:`加粗`,italic:`倾斜`,underline:`下划线`,fillColor:`填充颜色`,fontColor:`字体颜色`,noFill:`无填充`,automatic:`自动`,alignLeft:`左对齐`,center:`居中`,alignRight:`右对齐`,wrapText:`自动换行`,numberFormat:`数字格式`,custom:`自定义`,formats:{general:`常规`,number:`数字`,currency:`货币`,accounting:`会计专用`,shortDate:`短日期`,longDate:`长日期`,time:`时间`,percentage:`百分比`,fraction:`分数`,scientific:`科学记数`,text:`文本`},insert:`插入`,delete:`删除`,insertRows:`插入工作表行`,insertColumns:`插入工作表列`,insertSheet:`插入工作表`,deleteRows:`删除工作表行`,deleteColumns:`删除工作表列`,deleteSheet:`删除工作表`,nameBox:`名称框`,formulaBar:`编辑栏`,cancel:`取消`,enter:`输入`,insertFunction:`插入函数`,sheetTabs:`工作表`,newSheet:`新工作表`,allSheets:`所有工作表`,sheetMenu:`工作表菜单`,zoom:`缩放`,zoomIn:`放大`,zoomOut:`缩小`,duplicate:`复制工作表`,namesList:`名称`,rename:`重命名`,sheetName:e=>`工作表${String(e)}`,average:`平均值`,count:`计数`,sum:`求和`,changed:(e,t)=>`${e}更改了 ${String(t)} 处`,changedElsewhere:e=>`来自其他位置的 ${String(e)} 处更改`,previous:`上一处`,next:`下一处`,keep:`保留`,keepAll:`全部保留`,undoAll:`全部撤消`,was:e=>`原为 ${e}`,rowAdded:`已添加行`,rowRemoved:`已删除行`,fileChanged:`行已重写`,bothChanged:e=>`你和${e}更改了同一处,以你的为准。`,formulaProblem:`此公式有问题。`,columnName:`表的列需要名称。`,badSheetName:`工作表名称最多 31 个字符,且不能包含 \\ / ? * [ ] :`,sheetTaken:`已有工作表使用此名称。`,lastSheet:`工作簿必须至少保留一个可见的工作表。`,tableHeader:`不能删除表的标题行。`,badName:`无法使用此名称。`,badReference:`引用无效。`,overwrite:`使用此公式覆盖此列中的所有单元格`,dialog:{ok:`确定`,cancel:`取消`},number:{more:`其他数字格式…`,accounting:`会计数字格式`,percent:`百分比样式`,comma:`千位分隔样式`,increaseDecimal:`增加小数位数`,decreaseDecimal:`减少小数位数`},borders:{title:`边框`,bottom:`下框线`,top:`上框线`,left:`左框线`,right:`右框线`,none:`无框线`,all:`所有框线`,outside:`外侧框线`,thickOutside:`粗外侧框线`,bottomDouble:`双底框线`,thickBottom:`粗下框线`,topBottom:`上下框线`,topThickBottom:`上框线和粗下框线`,topDoubleBottom:`上框线和双下框线`,more:`其他边框…`},arrange:{cells:`单元格`,mergeCenter:`合并后居中`,mergeMenu:`合并选项`,mergeAcross:`跨越合并`,mergeCells:`合并单元格`,unmerge:`取消单元格合并`,mergeTable:`表格中的单元格无法合并。`,mergeLoses:`合并单元格时,仅保留左上角的值,而放弃其他值。`,format:`格式`,fitRows:`自动调整行高`,fitColumns:`自动调整列宽`,hideUnhide:`隐藏和取消隐藏`,hideRows:`隐藏行`,hideColumns:`隐藏列`,hideSheet:`隐藏工作表`,unhideRows:`取消隐藏行`,unhideColumns:`取消隐藏列`,unhideSheet:`取消隐藏工作表`,unhideEllipsis:`取消隐藏…`,freezePanes:`冻结窗格`,unfreeze:`取消冻结窗格`,freezeTopRow:`冻结首行`,freezeFirstColumn:`冻结首列`,tabColor:`工作表标签颜色`,noColor:`无颜色`},sortFilter:{title:`排序和筛选`,customSort:`自定义排序…`,filter:`筛选`,clear:`清除`,reapply:`重新应用`,noData:`请选择包含数据的区域中的一个单元格,然后重试。`},filter:{aToZ:`升序`,zToA:`降序`,aToZShort:`升序`,zToAShort:`降序`,smallest:`升序`,largest:`降序`,oldest:`升序`,newest:`降序`,clearFrom:e=>`从“${e}”中清除筛选`,search:`搜索`,selectAll:`(全选)`,blanks:`(空白)`,found:(e,t)=>`在 ${String(t)} 条记录中找到 ${String(e)} 条`},sort:{title:`排序`,addLevel:`添加条件`,deleteLevel:`删除条件`,hasHeaders:`数据包含标题`,sortBy:`主要关键字`,thenBy:`次要关键字`,column:e=>`列 ${e}`},rules:{title:`条件格式`,highlight:`突出显示单元格规则`,topBottom:`最前/最后规则`,greaterThan:`大于…`,lessThan:`小于…`,between:`介于…`,equalTo:`等于…`,textContains:`文本包含…`,duplicateValues:`重复值…`,top10:`前 10 项…`,top10Percent:`前 10%…`,bottom10:`最后 10 项…`,bottom10Percent:`最后 10%…`,aboveAverage:`高于平均值…`,belowAverage:`低于平均值…`,dataBars:`数据条`,colorScales:`色阶`,iconSets:`图标集`,clearRules:`清除规则`,clearSelected:`清除所选单元格的规则`,clearSheet:`清除整个工作表的规则`,greaterPrompt:`为大于以下值的单元格设置格式:`,lessPrompt:`为小于以下值的单元格设置格式:`,betweenPrompt:`为介于以下值之间的单元格设置格式:`,equalPrompt:`为等于以下值的单元格设置格式:`,textPrompt:`为包含以下文本的单元格设置格式:`,duplicatePrompt:`为包含以下类型值的单元格设置格式:`,topPrompt:`为值最大的那些单元格设置格式:`,topPercentPrompt:`为值最大的那些单元格设置格式(百分比):`,bottomPrompt:`为值最小的那些单元格设置格式:`,bottomPercentPrompt:`为值最小的那些单元格设置格式(百分比):`,abovePrompt:`为高于平均值的单元格设置格式:`,belowPrompt:`为低于平均值的单元格设置格式:`,and:`到`,with:`设置为`,duplicate:`重复`,unique:`唯一`,looks:{lightRed:`浅红填充色深红色文本`,yellow:`黄填充色深黄色文本`,green:`绿填充色深绿色文本`,lightRedFill:`浅红色填充`,redText:`红色文本`,redBorder:`红色边框`},scales:{greenYellowRed:`绿-黄-红色阶`,redYellowGreen:`红-黄-绿色阶`,blueWhiteRed:`蓝-白-红色阶`,whiteRed:`白-红色阶`,whiteGreen:`白-绿色阶`},icons:{"3Arrows":`三向箭头`,"5Arrows":`五向箭头`,"3TrafficLights1":`三色交通灯`,"4TrafficLights":`四色交通灯`,"3Symbols":`三个符号`,"3Flags":`三色旗`,"5Rating":`五等级`}},validation:{title:`数据验证`,clearAll:`全部清除`,settings:`设置`,inputMessage:`输入信息`,errorAlert:`出错警告`,allow:`允许`,kinds:{any:`任何值`,whole:`整数`,decimal:`小数`,list:`序列`,date:`日期`,time:`时间`,textLength:`文本长度`,custom:`自定义`},ignoreBlank:`忽略空值`,dropdown:`提供下拉箭头`,data:`数据`,operators:{between:`介于`,notBetween:`未介于`,equal:`等于`,notEqual:`不等于`,greaterThan:`大于`,lessThan:`小于`,greaterThanOrEqual:`大于或等于`,lessThanOrEqual:`小于或等于`},source:`来源`,formula:`公式`,minimum:`最小值`,maximum:`最大值`,value:`数值`,showPrompt:`选定单元格时显示输入信息`,titleWord:`标题`,showError:`输入无效数据时显示出错警告`,style:`样式`,styles:{stop:`停止`,warning:`警告`,information:`信息`},errorMessage:`错误信息`,refusedTitle:`不允许此值`,refused:`此值与此单元格定义的数据验证限制不匹配。`,retry:`重试`,no:`否`,yes:`是`,continue:`是否继续?`},menu:{cut:`剪切`,copy:`复制`,paste:`粘贴`,pasteSpecial:`选择性粘贴`,values:`值`,formulas:`公式`,formats:`格式`,entireRow:`整行`,entireColumn:`整列`,clearContents:`清除内容`,filter:`筛选`,sort:`排序`,filterByValue:`按所选单元格的值筛选`,formatCells:`设置单元格格式…`,pickFromList:`从下拉列表中选择…`,rowHeight:`行高…`,columnWidth:`列宽…`,rowHeightWord:`行高`,columnWidthWord:`列宽`,hide:`隐藏`,unhide:`取消隐藏`,multiple:`无法对多重选定区域使用此命令。`,tableMove:`无法移动表格标题的一部分。`},fill:{options:`自动填充选项`,copy:`复制单元格`,series:`填充序列`},formatCells:{title:`设置单元格格式`,tabs:{number:`数字`,alignment:`对齐`,font:`字体`,border:`边框`,fill:`填充`},category:`分类`,categories:{general:`常规`,number:`数值`,currency:`货币`,accounting:`会计专用`,date:`日期`,time:`时间`,percentage:`百分比`,fraction:`分数`,scientific:`科学记数`,text:`文本`,custom:`自定义`},sample:`示例`,decimals:`小数位数`,thousands:`使用千位分隔符(,)`,symbol:`货币符号`,none:`无`,negative:`负数`,type:`类型`,horizontal:`水平对齐`,vertical:`垂直对齐`,aligns:{general:`常规`,left:`靠左(缩进)`,center:`居中`,right:`靠右(缩进)`,fill:`填充`,justify:`两端对齐`,centerContinuous:`跨列居中`,distributed:`分散对齐(缩进)`},valigns:{top:`靠上`,center:`居中`,bottom:`靠下`,justify:`两端对齐`,distributed:`分散对齐`},indent:`缩进`,orientation:`度`,shrink:`缩小字体填充`,strikethrough:`删除线`,borderNone:`无`,borderOutline:`外边框`,borderInside:`内部`,lineStyle:`样式`,lineColor:`颜色`,lines:{thin:`细实线`,hair:`极细线`,dotted:`点线`,dashed:`虚线`,dashDot:`点划线`,dashDotDot:`双点划线`,medium:`中粗实线`,mediumDashed:`中粗虚线`,mediumDashDot:`中粗点划线`,thick:`粗实线`,double:`双线`},edges:{top:`上框线`,horizontal:`内部横框线`,bottom:`下框线`,left:`左框线`,vertical:`内部竖框线`,right:`右框线`}},chart:{insert:`插入图表`,design:`图表设计`,changeType:`更改图表类型`,selectData:`选择数据`,dataRange:`图表数据区域`,title:`图表标题`,legend:`图例`,legendNone:`无`,legendAt:{right:`右侧`,top:`顶部`,left:`左侧`,bottom:`底部`},noData:`这个区域里没有可以绘制的数字。`,buttons:{columnBar:`插入柱形图或条形图`,lineArea:`插入折线图或面积图`,pieDoughnut:`插入饼图或圆环图`,scatter:`插入散点图(X、Y)`},groups:{column2d:`二维柱形图`,bar2d:`二维条形图`,line2d:`二维折线图`,area2d:`二维面积图`,pie2d:`二维饼图`,doughnut:`圆环图`,scatter:`散点图`},types:{"column-clustered":`簇状柱形图`,"column-stacked":`堆积柱形图`,"column-stacked-100":`百分比堆积柱形图`,"bar-clustered":`簇状条形图`,"bar-stacked":`堆积条形图`,"bar-stacked-100":`百分比堆积条形图`,line:`折线图`,"line-markers":`带数据标记的折线图`,area:`面积图`,"area-stacked":`堆积面积图`,"area-stacked-100":`百分比堆积面积图`,pie:`饼图`,doughnut:`圆环图`,scatter:`散点图`,"scatter-lines":`带直线和数据标记的散点图`,"scatter-smooth":`带平滑线的散点图`},name:e=>`图表 ${String(e)}`},spillBlocked:`溢出区域不为空`},"zh-tw":{loading:`正在打開…`,unreadable:`無法顯示此工作表:無法讀取它的 sheet.yaml。問題如下。`,generated:{line:`此工作表由 sheet.ts 產生`,title:`此工作表受保護`,refused:`您嘗試變更的儲存格或圖表位於受保護的工作表上:它由 sheet.ts 產生。`,ask:e=>e===void 0?`詢問代理程式`:`詢問 ${e}`,ordinary:`轉為一般工作表`,copied:`已複製:貼給您的代理程式。`,failed:`sheet.ts 無法執行:它產生的工作表維持上次的樣子。`},scenario:{manager:`分析藍本管理員`,scenarios:`分析藍本:`,changing:`變數儲存格:`,show:`顯示`,close:`關閉`,base:`基準案例`,showing:`顯示中`,on:e=>`分析藍本:${e}`},files:{insert:`插入檔案…`,open:`開啟`,remove:`從儲存格移除`,notColumn:`此欄不存放檔案。`},undo:`復原`,redo:`取消復原`,font:`字型`,fontSize:`字型大小`,bold:`粗體`,italic:`斜體`,underline:`底線`,fillColor:`填滿色彩`,fontColor:`字型色彩`,noFill:`無填滿`,automatic:`自動`,alignLeft:`靠左對齊`,center:`置中`,alignRight:`靠右對齊`,wrapText:`自動換行`,numberFormat:`數字格式`,custom:`自訂`,formats:{general:`通用格式`,number:`數值`,currency:`貨幣`,accounting:`會計`,shortDate:`簡短日期`,longDate:`完整日期`,time:`時間`,percentage:`百分比`,fraction:`分數`,scientific:`科學記號`,text:`文字`},insert:`插入`,delete:`刪除`,insertRows:`插入工作表列`,insertColumns:`插入工作表欄`,insertSheet:`插入工作表`,deleteRows:`刪除工作表列`,deleteColumns:`刪除工作表欄`,deleteSheet:`刪除工作表`,nameBox:`名稱方塊`,formulaBar:`資料編輯列`,cancel:`取消`,enter:`輸入`,insertFunction:`插入函數`,sheetTabs:`工作表`,newSheet:`新增工作表`,allSheets:`所有工作表`,sheetMenu:`工作表選單`,zoom:`縮放`,zoomIn:`放大`,zoomOut:`縮小`,duplicate:`複製工作表`,namesList:`名稱`,rename:`重新命名`,sheetName:e=>`工作表${String(e)}`,average:`平均`,count:`項目個數`,sum:`加總`,changed:(e,t)=>`${e}變更了 ${String(t)} 處`,changedElsewhere:e=>`來自其他位置的 ${String(e)} 處變更`,previous:`上一處`,next:`下一處`,keep:`保留`,keepAll:`全部保留`,undoAll:`全部復原`,was:e=>`原為 ${e}`,rowAdded:`已新增列`,rowRemoved:`已移除列`,fileChanged:`列已重寫`,bothChanged:e=>`你和${e}變更了同一處,以你的為準。`,formulaProblem:`這個公式有問題。`,columnName:`表格的欄需要名稱。`,badSheetName:`工作表名稱最多 31 個字元,且不能包含 \\ / ? * [ ] :`,sheetTaken:`已有工作表使用此名稱。`,lastSheet:`活頁簿必須至少保留一張可見的工作表。`,tableHeader:`無法刪除表格的標題列。`,badName:`無法使用此名稱。`,badReference:`參照無效。`,overwrite:`以此公式覆寫此欄中的所有儲存格`,dialog:{ok:`確定`,cancel:`取消`},number:{more:`其他數值格式…`,accounting:`會計數字格式`,percent:`百分比樣式`,comma:`千分位樣式`,increaseDecimal:`增加小數位數`,decreaseDecimal:`減少小數位數`},borders:{title:`框線`,bottom:`下框線`,top:`上框線`,left:`左框線`,right:`右框線`,none:`無框線`,all:`所有框線`,outside:`外框線`,thickOutside:`粗外框線`,bottomDouble:`雙底框線`,thickBottom:`粗底框線`,topBottom:`上及下框線`,topThickBottom:`上框線及粗下框線`,topDoubleBottom:`上框線及雙下框線`,more:`其他框線…`},arrange:{cells:`儲存格`,mergeCenter:`跨欄置中`,mergeMenu:`合併選項`,mergeAcross:`合併同列儲存格`,mergeCells:`合併儲存格`,unmerge:`取消合併儲存格`,mergeTable:`無法合併表格中的儲存格。`,mergeLoses:`合併儲存格時,只會保留左上角的值,並捨棄其他值。`,format:`格式`,fitRows:`自動調整列高`,fitColumns:`自動調整欄寬`,hideUnhide:`隱藏及取消隱藏`,hideRows:`隱藏列`,hideColumns:`隱藏欄`,hideSheet:`隱藏工作表`,unhideRows:`取消隱藏列`,unhideColumns:`取消隱藏欄`,unhideSheet:`取消隱藏工作表`,unhideEllipsis:`取消隱藏…`,freezePanes:`凍結窗格`,unfreeze:`取消凍結窗格`,freezeTopRow:`凍結頂端列`,freezeFirstColumn:`凍結首欄`,tabColor:`索引標籤色彩`,noColor:`無色彩`},sortFilter:{title:`排序與篩選`,customSort:`自訂排序…`,filter:`篩選`,clear:`清除`,reapply:`重新套用`,noData:`請選取含有資料之範圍中的儲存格,然後再試一次。`},filter:{aToZ:`從 A 到 Z 排序`,zToA:`從 Z 到 A 排序`,aToZShort:`A 到 Z`,zToAShort:`Z 到 A`,smallest:`從最小到最大排序`,largest:`從最大到最小排序`,oldest:`從最舊到最新排序`,newest:`從最新到最舊排序`,clearFrom:e=>`清除 "${e}" 的篩選`,search:`搜尋`,selectAll:`(全選)`,blanks:`(空格)`,found:(e,t)=>`在 ${String(t)} 筆記錄中找到 ${String(e)} 筆`},sort:{title:`排序`,addLevel:`新增層級`,deleteLevel:`刪除層級`,hasHeaders:`我的資料有標題`,sortBy:`排序方式`,thenBy:`次要排序方式`,column:e=>`欄 ${e}`},rules:{title:`條件式格式設定`,highlight:`醒目提示儲存格規則`,topBottom:`前段/後段項目規則`,greaterThan:`大於…`,lessThan:`小於…`,between:`介於…`,equalTo:`等於…`,textContains:`包含下列的文字…`,duplicateValues:`重複的值…`,top10:`前 10 個項目…`,top10Percent:`前 10%…`,bottom10:`最後 10 個項目…`,bottom10Percent:`最後 10%…`,aboveAverage:`高於平均…`,belowAverage:`低於平均…`,dataBars:`資料橫條`,colorScales:`色階`,iconSets:`圖示集`,clearRules:`清除規則`,clearSelected:`清除選取儲存格的規則`,clearSheet:`清除整張工作表的規則`,greaterPrompt:`格式化大於下列的儲存格:`,lessPrompt:`格式化小於下列的儲存格:`,betweenPrompt:`格式化介於下列的儲存格:`,equalPrompt:`格式化等於下列的儲存格:`,textPrompt:`格式化包含下列文字的儲存格:`,duplicatePrompt:`格式化包含下列的儲存格:`,topPrompt:`格式化排在最前面的儲存格:`,topPercentPrompt:`格式化排在最前面的儲存格 (百分比):`,bottomPrompt:`格式化排在最後面的儲存格:`,bottomPercentPrompt:`格式化排在最後面的儲存格 (百分比):`,abovePrompt:`格式化高於平均的儲存格:`,belowPrompt:`格式化低於平均的儲存格:`,and:`到`,with:`顯示為`,duplicate:`重複`,unique:`唯一`,looks:{lightRed:`淺紅色填滿與深紅色文字`,yellow:`黃色填滿與深黃色文字`,green:`綠色填滿與深綠色文字`,lightRedFill:`淺紅色填滿`,redText:`紅色文字`,redBorder:`紅色框線`},scales:{greenYellowRed:`綠 - 黃 - 紅色階`,redYellowGreen:`紅 - 黃 - 綠色階`,blueWhiteRed:`藍 - 白 - 紅色階`,whiteRed:`白 - 紅色階`,whiteGreen:`白 - 綠色階`},icons:{"3Arrows":`3 箭號`,"5Arrows":`5 箭號`,"3TrafficLights1":`3 交通號誌`,"4TrafficLights":`4 交通號誌`,"3Symbols":`3 符號`,"3Flags":`3 旗標`,"5Rating":`5 評等`}},validation:{title:`資料驗證`,clearAll:`全部清除`,settings:`設定`,inputMessage:`提示訊息`,errorAlert:`錯誤提醒`,allow:`儲存格內允許`,kinds:{any:`任何值`,whole:`整數`,decimal:`實數`,list:`清單`,date:`日期`,time:`時間`,textLength:`文字長度`,custom:`自訂`},ignoreBlank:`忽略空白`,dropdown:`儲存格內下拉式清單`,data:`資料`,operators:{between:`介於`,notBetween:`不介於`,equal:`等於`,notEqual:`不等於`,greaterThan:`大於`,lessThan:`小於`,greaterThanOrEqual:`大於或等於`,lessThanOrEqual:`小於或等於`},source:`來源`,formula:`公式`,minimum:`最小值`,maximum:`最大值`,value:`值`,showPrompt:`當儲存格被選取時,顯示提示訊息`,titleWord:`標題`,showError:`輸入的資料不正確時顯示警訊`,style:`樣式`,styles:{stop:`停止`,warning:`警告`,information:`資訊`},errorMessage:`錯誤訊息`,refusedTitle:`不允許此值`,refused:`此值不符合為此儲存格定義的資料驗證限制。`,retry:`重試`,no:`否`,yes:`是`,continue:`要繼續嗎?`},menu:{cut:`剪下`,copy:`複製`,paste:`貼上`,pasteSpecial:`選擇性貼上`,values:`值`,formulas:`公式`,formats:`格式`,entireRow:`整列`,entireColumn:`整欄`,clearContents:`清除內容`,filter:`篩選`,sort:`排序`,filterByValue:`依選取儲存格的值篩選`,formatCells:`儲存格格式…`,pickFromList:`從下拉式清單中挑選…`,rowHeight:`列高…`,columnWidth:`欄寬…`,rowHeightWord:`列高`,columnWidthWord:`欄寬`,hide:`隱藏`,unhide:`取消隱藏`,multiple:`無法在多重選取範圍上執行此命令。`,tableMove:`無法移動表格標題的一部分。`},fill:{options:`自動填滿選項`,copy:`複製儲存格`,series:`以數列填滿`},formatCells:{title:`儲存格格式`,tabs:{number:`數值`,alignment:`對齊方式`,font:`字型`,border:`外框`,fill:`填滿`},category:`類別`,categories:{general:`通用格式`,number:`數值`,currency:`貨幣`,accounting:`會計專用`,date:`日期`,time:`時間`,percentage:`百分比`,fraction:`分數`,scientific:`科學記號`,text:`文字`,custom:`自訂`},sample:`範例`,decimals:`小數位數`,thousands:`使用千分位符號 (,)`,symbol:`符號`,none:`無`,negative:`負數表示方式`,type:`類型`,horizontal:`水平`,vertical:`垂直`,aligns:{general:`通用格式`,left:`靠左 (縮排)`,center:`置中`,right:`靠右 (縮排)`,fill:`填滿`,justify:`左右對齊`,centerContinuous:`跨欄置中`,distributed:`分散對齊 (縮排)`},valigns:{top:`靠上`,center:`置中`,bottom:`靠下`,justify:`左右對齊`,distributed:`分散對齊`},indent:`縮排`,orientation:`度`,shrink:`縮小字型以適合欄寬`,strikethrough:`刪除線`,borderNone:`無`,borderOutline:`外框`,borderInside:`內線`,lineStyle:`樣式`,lineColor:`色彩`,lines:{thin:`細`,hair:`極細`,dotted:`點線`,dashed:`虛線`,dashDot:`虛點線`,dashDotDot:`虛點點線`,medium:`中等`,mediumDashed:`中等虛線`,mediumDashDot:`中等虛點線`,thick:`粗`,double:`雙線`},edges:{top:`上`,horizontal:`內部水平`,bottom:`下`,left:`左`,vertical:`內部垂直`,right:`右`}},chart:{insert:`插入圖表`,design:`圖表設計`,changeType:`變更圖表類型`,selectData:`選取資料`,dataRange:`圖表資料範圍`,title:`圖表標題`,legend:`圖例`,legendNone:`無`,legendAt:{right:`右`,top:`上`,left:`左`,bottom:`下`},noData:`這個範圍沒有可繪製的數字。`,buttons:{columnBar:`插入直條圖或橫條圖`,lineArea:`插入折線圖或區域圖`,pieDoughnut:`插入圓形圖或環圈圖`,scatter:`插入散佈圖 (X, Y)`},groups:{column2d:`平面直條圖`,bar2d:`平面橫條圖`,line2d:`平面折線圖`,area2d:`平面區域圖`,pie2d:`平面圓形圖`,doughnut:`環圈圖`,scatter:`散佈圖`},types:{"column-clustered":`群組直條圖`,"column-stacked":`堆疊直條圖`,"column-stacked-100":`百分比堆疊直條圖`,"bar-clustered":`群組橫條圖`,"bar-stacked":`堆疊橫條圖`,"bar-stacked-100":`百分比堆疊橫條圖`,line:`折線圖`,"line-markers":`含有資料標記的折線圖`,area:`區域圖`,"area-stacked":`堆疊區域圖`,"area-stacked-100":`百分比堆疊區域圖`,pie:`圓形圖`,doughnut:`環圈圖`,scatter:`散佈圖`,"scatter-lines":`帶有直線及資料標記的散佈圖`,"scatter-smooth":`帶有平滑線的散佈圖`},name:e=>`圖表 ${String(e)}`},spillBlocked:`溢位範圍不是空白的`},ja:{loading:`開いています…`,unreadable:`このシートは表示できません:sheet.yaml を読み込めません。問題点は次のとおりです。`,generated:{line:`このシートは sheet.ts が作成します`,title:`このシートは保護されています`,refused:`変更しようとしているセルやグラフは保護されたシートにあります: sheet.ts が作成します。`,ask:e=>e===void 0?`エージェントに質問`:`${e} に質問`,ordinary:`通常のシートにする`,copied:`コピーしました: エージェントに貼り付けてください。`,failed:`sheet.ts を実行できません: 作成されたシートは前回のままです。`},scenario:{manager:`シナリオの登録と管理`,scenarios:`シナリオ:`,changing:`変化させるセル:`,show:`表示`,close:`閉じる`,base:`基本ケース`,showing:`表示中`,on:e=>`シナリオ: ${e}`},files:{insert:`ファイルの挿入…`,open:`開く`,remove:`セルから削除`,notColumn:`この列はファイルを保持しません。`},undo:`元に戻す`,redo:`やり直し`,font:`フォント`,fontSize:`フォント サイズ`,bold:`太字`,italic:`斜体`,underline:`下線`,fillColor:`塗りつぶしの色`,fontColor:`フォントの色`,noFill:`塗りつぶしなし`,automatic:`自動`,alignLeft:`左揃え`,center:`中央揃え`,alignRight:`右揃え`,wrapText:`折り返して全体を表示する`,numberFormat:`表示形式`,custom:`ユーザー設定`,formats:{general:`標準`,number:`数値`,currency:`通貨`,accounting:`会計`,shortDate:`短い日付形式`,longDate:`長い日付形式`,time:`時刻`,percentage:`パーセンテージ`,fraction:`分数`,scientific:`指数`,text:`文字列`},insert:`挿入`,delete:`削除`,insertRows:`シートの行を挿入`,insertColumns:`シートの列を挿入`,insertSheet:`シートの挿入`,deleteRows:`シートの行を削除`,deleteColumns:`シートの列を削除`,deleteSheet:`シートの削除`,nameBox:`名前ボックス`,formulaBar:`数式バー`,cancel:`キャンセル`,enter:`入力`,insertFunction:`関数の挿入`,sheetTabs:`シート`,newSheet:`新しいシート`,allSheets:`すべてのシート`,sheetMenu:`シートのメニュー`,zoom:`ズーム`,zoomIn:`拡大`,zoomOut:`縮小`,duplicate:`複製`,namesList:`名前`,rename:`名前の変更`,sheetName:e=>`Sheet${String(e)}`,average:`平均`,count:`データの個数`,sum:`合計`,changed:(e,t)=>`${e}が ${String(t)} 件を変更しました`,changedElsewhere:e=>`ほかの場所からの変更 ${String(e)} 件`,previous:`前へ`,next:`次へ`,keep:`保持`,keepAll:`すべて保持`,undoAll:`すべて元に戻す`,was:e=>`変更前: ${e}`,rowAdded:`行を追加`,rowRemoved:`行を削除`,fileChanged:`行を書き換え`,bothChanged:e=>`あなたと${e}が同じ箇所を変更しました。あなたの変更が優先されます。`,formulaProblem:`この数式には問題があります。`,columnName:`テーブルの列には名前が必要です。`,badSheetName:`シート名は 31 文字以内で、\\ / ? * [ ] : は使用できません。`,sheetTaken:`その名前のシートは既にあります。`,lastSheet:`ブックには表示されているシートが 1 つ以上必要です。`,tableHeader:`テーブルの見出し行は削除できません。`,badName:`その名前は使用できません。`,badReference:`参照が正しくありません。`,overwrite:`この列のすべてのセルをこの数式で上書きする`,dialog:{ok:`OK`,cancel:`キャンセル`},number:{more:`その他の表示形式…`,accounting:`通貨表示形式`,percent:`パーセント スタイル`,comma:`桁区切りスタイル`,increaseDecimal:`小数点以下の表示桁数を増やす`,decreaseDecimal:`小数点以下の表示桁数を減らす`},borders:{title:`罫線`,bottom:`下罫線`,top:`上罫線`,left:`左罫線`,right:`右罫線`,none:`枠なし`,all:`格子`,outside:`外枠`,thickOutside:`太い外枠`,bottomDouble:`下二重罫線`,thickBottom:`下太罫線`,topBottom:`上下罫線`,topThickBottom:`上罫線 + 下太罫線`,topDoubleBottom:`上罫線 + 下二重罫線`,more:`その他の罫線…`},arrange:{cells:`セル`,mergeCenter:`セルを結合して中央揃え`,mergeMenu:`結合のオプション`,mergeAcross:`横方向に結合`,mergeCells:`セルの結合`,unmerge:`セル結合の解除`,mergeTable:`テーブル内のセルは結合できません。`,mergeLoses:`セルを結合すると、左上の端にあるセルの値のみが保持され、他のセルの値は破棄されます。`,format:`書式`,fitRows:`行の高さの自動調整`,fitColumns:`列の幅の自動調整`,hideUnhide:`非表示/再表示`,hideRows:`行を表示しない`,hideColumns:`列を表示しない`,hideSheet:`シートを表示しない`,unhideRows:`行の再表示`,unhideColumns:`列の再表示`,unhideSheet:`シートの再表示`,unhideEllipsis:`再表示…`,freezePanes:`ウィンドウ枠の固定`,unfreeze:`ウィンドウ枠固定の解除`,freezeTopRow:`先頭行の固定`,freezeFirstColumn:`先頭列の固定`,tabColor:`シート見出しの色`,noColor:`色なし`},sortFilter:{title:`並べ替えとフィルター`,customSort:`ユーザー設定の並べ替え…`,filter:`フィルター`,clear:`クリア`,reapply:`再適用`,noData:`データを含む範囲内のセルを選択して、もう一度お試しください。`},filter:{aToZ:`昇順`,zToA:`降順`,aToZShort:`昇順`,zToAShort:`降順`,smallest:`小さい順`,largest:`大きい順`,oldest:`古い順`,newest:`新しい順`,clearFrom:e=>`"${e}" からフィルターをクリア`,search:`検索`,selectAll:`(すべて選択)`,blanks:`(空白)`,found:(e,t)=>`${String(t)} レコード中 ${String(e)} 個が見つかりました`},sort:{title:`並べ替え`,addLevel:`レベルの追加`,deleteLevel:`レベルの削除`,hasHeaders:`先頭行をデータの見出しとして使用する`,sortBy:`最優先されるキー`,thenBy:`次に優先されるキー`,column:e=>`列 ${e}`},rules:{title:`条件付き書式`,highlight:`セルの強調表示ルール`,topBottom:`上位/下位ルール`,greaterThan:`指定の値より大きい…`,lessThan:`指定の値より小さい…`,between:`指定の範囲内…`,equalTo:`指定の値に等しい…`,textContains:`文字列…`,duplicateValues:`重複する値…`,top10:`上位 10 項目…`,top10Percent:`上位 10%…`,bottom10:`下位 10 項目…`,bottom10Percent:`下位 10%…`,aboveAverage:`平均より上…`,belowAverage:`平均より下…`,dataBars:`データ バー`,colorScales:`カラー スケール`,iconSets:`アイコン セット`,clearRules:`ルールのクリア`,clearSelected:`選択したセルからルールをクリア`,clearSheet:`シート全体からルールをクリア`,greaterPrompt:`次の値より大きいセルを書式設定:`,lessPrompt:`次の値より小さいセルを書式設定:`,betweenPrompt:`次の範囲内の値を持つセルを書式設定:`,equalPrompt:`次の値に等しいセルを書式設定:`,textPrompt:`次の文字列を含むセルを書式設定:`,duplicatePrompt:`次の値を含むセルを書式設定:`,topPrompt:`上位に入るセルを書式設定:`,topPercentPrompt:`上位に入るセルを書式設定 (パーセント):`,bottomPrompt:`下位に入るセルを書式設定:`,bottomPercentPrompt:`下位に入るセルを書式設定 (パーセント):`,abovePrompt:`平均より上のセルを書式設定:`,belowPrompt:`平均より下のセルを書式設定:`,and:`から`,with:`書式:`,duplicate:`重複`,unique:`一意`,looks:{lightRed:`濃い赤の文字、明るい赤の背景`,yellow:`濃い黄色の文字、黄色の背景`,green:`濃い緑の文字、緑の背景`,lightRedFill:`明るい赤の背景`,redText:`赤の文字`,redBorder:`赤の罫線`},scales:{greenYellowRed:`緑、黄、赤のカラー スケール`,redYellowGreen:`赤、黄、緑のカラー スケール`,blueWhiteRed:`青、白、赤のカラー スケール`,whiteRed:`白、赤のカラー スケール`,whiteGreen:`白、緑のカラー スケール`},icons:{"3Arrows":`3 つの矢印`,"5Arrows":`5 つの矢印`,"3TrafficLights1":`3 つの信号`,"4TrafficLights":`4 つの信号`,"3Symbols":`3 つの記号`,"3Flags":`3 つのフラグ`,"5Rating":`5 つの評価`}},validation:{title:`データの入力規則`,clearAll:`すべてクリア`,settings:`設定`,inputMessage:`入力時メッセージ`,errorAlert:`エラー メッセージ`,allow:`入力値の種類`,kinds:{any:`すべての値`,whole:`整数`,decimal:`小数点数`,list:`リスト`,date:`日付`,time:`時刻`,textLength:`文字列 (長さ指定)`,custom:`ユーザー設定`},ignoreBlank:`空白を無視する`,dropdown:`ドロップダウン リストから選択する`,data:`データ`,operators:{between:`次の値の間`,notBetween:`次の値の間以外`,equal:`次の値に等しい`,notEqual:`次の値に等しくない`,greaterThan:`次の値より大きい`,lessThan:`次の値より小さい`,greaterThanOrEqual:`次の値以上`,lessThanOrEqual:`次の値以下`},source:`元の値`,formula:`数式`,minimum:`最小値`,maximum:`最大値`,value:`値`,showPrompt:`セルを選択したときに入力時メッセージを表示する`,titleWord:`タイトル`,showError:`無効なデータが入力されたらエラー メッセージを表示する`,style:`スタイル`,styles:{stop:`停止`,warning:`注意`,information:`情報`},errorMessage:`エラー メッセージ`,refusedTitle:`入力できない値です`,refused:`この値は、このセルに定義されているデータの入力規則の制限を満たしていません。`,retry:`再試行`,no:`いいえ`,yes:`はい`,continue:`続行しますか?`},menu:{cut:`切り取り`,copy:`コピー`,paste:`貼り付け`,pasteSpecial:`形式を選択して貼り付け`,values:`値`,formulas:`数式`,formats:`書式`,entireRow:`行全体`,entireColumn:`列全体`,clearContents:`数式と値のクリア`,filter:`フィルター`,sort:`並べ替え`,filterByValue:`選択したセルの値でフィルター`,formatCells:`セルの書式設定…`,pickFromList:`ドロップダウン リストから選択…`,rowHeight:`行の高さ…`,columnWidth:`列の幅…`,rowHeightWord:`行の高さ`,columnWidthWord:`列の幅`,hide:`非表示`,unhide:`再表示`,multiple:`このコマンドは複数の選択範囲に対して実行できません。`,tableMove:`テーブルの見出しの一部は移動できません。`},fill:{options:`オートフィル オプション`,copy:`セルのコピー`,series:`連続データ`},formatCells:{title:`セルの書式設定`,tabs:{number:`表示形式`,alignment:`配置`,font:`フォント`,border:`罫線`,fill:`塗りつぶし`},category:`分類`,categories:{general:`標準`,number:`数値`,currency:`通貨`,accounting:`会計`,date:`日付`,time:`時刻`,percentage:`パーセンテージ`,fraction:`分数`,scientific:`指数`,text:`文字列`,custom:`ユーザー定義`},sample:`サンプル`,decimals:`小数点以下の桁数`,thousands:`桁区切り (,) を使用する`,symbol:`記号`,none:`なし`,negative:`負の数の表示形式`,type:`種類`,horizontal:`横位置`,vertical:`縦位置`,aligns:{general:`標準`,left:`左詰め (インデント)`,center:`中央揃え`,right:`右詰め (インデント)`,fill:`繰り返し`,justify:`両端揃え`,centerContinuous:`選択範囲内で中央`,distributed:`均等割り付け (インデント)`},valigns:{top:`上詰め`,center:`中央揃え`,bottom:`下詰め`,justify:`両端揃え`,distributed:`均等割り付け`},indent:`インデント`,orientation:`度`,shrink:`縮小して全体を表示する`,strikethrough:`取り消し線`,borderNone:`なし`,borderOutline:`外枠`,borderInside:`内側`,lineStyle:`スタイル`,lineColor:`色`,lines:{thin:`細線`,hair:`極細線`,dotted:`点線`,dashed:`破線`,dashDot:`一点鎖線`,dashDotDot:`二点鎖線`,medium:`中線`,mediumDashed:`中破線`,mediumDashDot:`中一点鎖線`,thick:`太線`,double:`二重線`},edges:{top:`上`,horizontal:`内側横`,bottom:`下`,left:`左`,vertical:`内側縦`,right:`右`}},chart:{insert:`グラフの挿入`,design:`グラフのデザイン`,changeType:`グラフの種類の変更`,selectData:`データの選択`,dataRange:`グラフ データの範囲`,title:`グラフ タイトル`,legend:`凡例`,legendNone:`なし`,legendAt:{right:`右`,top:`上`,left:`左`,bottom:`下`},noData:`その範囲にはグラフにする数値がありません。`,buttons:{columnBar:`縦棒/横棒グラフの挿入`,lineArea:`折れ線/面グラフの挿入`,pieDoughnut:`円またはドーナツ グラフの挿入`,scatter:`散布図 (X, Y) の挿入`},groups:{column2d:`2-D 縦棒`,bar2d:`2-D 横棒`,line2d:`2-D 折れ線`,area2d:`2-D 面`,pie2d:`2-D 円`,doughnut:`ドーナツ`,scatter:`散布図`},types:{"column-clustered":`集合縦棒`,"column-stacked":`積み上げ縦棒`,"column-stacked-100":`100% 積み上げ縦棒`,"bar-clustered":`集合横棒`,"bar-stacked":`積み上げ横棒`,"bar-stacked-100":`100% 積み上げ横棒`,line:`折れ線`,"line-markers":`マーカー付き折れ線`,area:`面`,"area-stacked":`積み上げ面`,"area-stacked-100":`100% 積み上げ面`,pie:`円`,doughnut:`ドーナツ`,scatter:`散布図`,"scatter-lines":`散布図 (直線とマーカー)`,"scatter-smooth":`散布図 (平滑線)`},name:e=>`グラフ ${String(e)}`},spillBlocked:`スピル範囲が空白ではありません`},ko:{loading:`여는 중…`,unreadable:`이 시트를 표시할 수 없습니다. sheet.yaml을 읽을 수 없습니다. 문제는 다음과 같습니다.`,generated:{line:`이 시트는 sheet.ts가 만듭니다`,title:`이 시트는 보호되어 있습니다`,refused:`변경하려는 셀이나 차트가 보호된 시트에 있습니다: sheet.ts가 만듭니다.`,ask:e=>e===void 0?`에이전트에게 묻기`:`${e}에게 묻기`,ordinary:`일반 시트로 만들기`,copied:`복사했습니다: 에이전트에 붙여넣으세요.`,failed:`sheet.ts를 실행할 수 없습니다: 만든 시트는 마지막 상태로 유지됩니다.`},scenario:{manager:`시나리오 관리자`,scenarios:`시나리오:`,changing:`변경 셀:`,show:`표시`,close:`닫기`,base:`기본 사례`,showing:`표시 중`,on:e=>`시나리오: ${e}`},files:{insert:`파일 삽입…`,open:`열기`,remove:`셀에서 제거`,notColumn:`이 열에는 파일이 없습니다.`},undo:`실행 취소`,redo:`다시 실행`,font:`글꼴`,fontSize:`글꼴 크기`,bold:`굵게`,italic:`기울임꼴`,underline:`밑줄`,fillColor:`채우기 색`,fontColor:`글꼴 색`,noFill:`채우기 없음`,automatic:`자동`,alignLeft:`왼쪽 맞춤`,center:`가운데 맞춤`,alignRight:`오른쪽 맞춤`,wrapText:`텍스트 줄 바꿈`,numberFormat:`표시 형식`,custom:`사용자 지정`,formats:{general:`일반`,number:`숫자`,currency:`통화`,accounting:`회계`,shortDate:`간단한 날짜`,longDate:`자세한 날짜`,time:`시간`,percentage:`백분율`,fraction:`분수`,scientific:`지수`,text:`텍스트`},insert:`삽입`,delete:`삭제`,insertRows:`시트 행 삽입`,insertColumns:`시트 열 삽입`,insertSheet:`시트 삽입`,deleteRows:`시트 행 삭제`,deleteColumns:`시트 열 삭제`,deleteSheet:`시트 삭제`,nameBox:`이름 상자`,formulaBar:`수식 입력줄`,cancel:`취소`,enter:`입력`,insertFunction:`함수 삽입`,sheetTabs:`시트`,newSheet:`새 시트`,allSheets:`모든 시트`,sheetMenu:`시트 메뉴`,zoom:`확대/축소`,zoomIn:`확대`,zoomOut:`축소`,duplicate:`복제`,namesList:`이름`,rename:`이름 바꾸기`,sheetName:e=>`Sheet${String(e)}`,average:`평균`,count:`개수`,sum:`합계`,changed:(e,t)=>`${e}이(가) ${String(t)}개 항목을 변경했습니다`,changedElsewhere:e=>`다른 곳에서 ${String(e)}개 변경됨`,previous:`이전`,next:`다음`,keep:`유지`,keepAll:`모두 유지`,undoAll:`모두 실행 취소`,was:e=>`이전: ${e}`,rowAdded:`행 추가됨`,rowRemoved:`행 제거됨`,fileChanged:`행 다시 작성됨`,bothChanged:e=>`내가 ${e}와(과) 같은 항목을 변경했습니다. 내 변경이 유지됩니다.`,formulaProblem:`수식에 문제가 있습니다.`,columnName:`표의 열에는 이름이 필요합니다.`,badSheetName:`시트 이름은 31자 이하여야 하며 \\ / ? * [ ] : 를 쓸 수 없습니다.`,sheetTaken:`이미 같은 이름의 시트가 있습니다.`,lastSheet:`통합 문서에는 표시된 시트가 하나 이상 있어야 합니다.`,tableHeader:`표의 머리글 행은 삭제할 수 없습니다.`,badName:`이 이름은 사용할 수 없습니다.`,badReference:`참조가 유효하지 않습니다.`,overwrite:`이 열의 모든 셀을 이 수식으로 덮어쓰기`,dialog:{ok:`확인`,cancel:`취소`},number:{more:`기타 표시 형식…`,accounting:`회계 표시 형식`,percent:`백분율 스타일`,comma:`쉼표 스타일`,increaseDecimal:`자릿수 늘림`,decreaseDecimal:`자릿수 줄임`},borders:{title:`테두리`,bottom:`아래쪽 테두리`,top:`위쪽 테두리`,left:`왼쪽 테두리`,right:`오른쪽 테두리`,none:`테두리 없음`,all:`모든 테두리`,outside:`바깥쪽 테두리`,thickOutside:`굵은 바깥쪽 테두리`,bottomDouble:`아래쪽 이중 테두리`,thickBottom:`굵은 아래쪽 테두리`,topBottom:`위쪽/아래쪽 테두리`,topThickBottom:`위쪽/굵은 아래쪽 테두리`,topDoubleBottom:`위쪽/아래쪽 이중 테두리`,more:`다른 테두리…`},arrange:{cells:`셀`,mergeCenter:`병합하고 가운데 맞춤`,mergeMenu:`병합 옵션`,mergeAcross:`전체 병합`,mergeCells:`셀 병합`,unmerge:`셀 분할`,mergeTable:`표 안의 셀은 병합할 수 없습니다.`,mergeLoses:`셀을 병합하면 왼쪽 위의 값만 유지되고 다른 값은 삭제됩니다.`,format:`서식`,fitRows:`행 높이 자동 맞춤`,fitColumns:`열 너비 자동 맞춤`,hideUnhide:`숨기기 및 숨기기 취소`,hideRows:`행 숨기기`,hideColumns:`열 숨기기`,hideSheet:`시트 숨기기`,unhideRows:`행 숨기기 취소`,unhideColumns:`열 숨기기 취소`,unhideSheet:`시트 숨기기 취소`,unhideEllipsis:`숨기기 취소…`,freezePanes:`틀 고정`,unfreeze:`틀 고정 취소`,freezeTopRow:`첫 행 고정`,freezeFirstColumn:`첫 열 고정`,tabColor:`탭 색`,noColor:`색 없음`},sortFilter:{title:`정렬 및 필터`,customSort:`사용자 지정 정렬…`,filter:`필터`,clear:`지우기`,reapply:`다시 적용`,noData:`데이터가 있는 범위의 셀을 선택한 다음 다시 시도하세요.`},filter:{aToZ:`텍스트 오름차순 정렬`,zToA:`텍스트 내림차순 정렬`,aToZShort:`오름차순`,zToAShort:`내림차순`,smallest:`숫자 오름차순 정렬`,largest:`숫자 내림차순 정렬`,oldest:`날짜/시간 오름차순 정렬`,newest:`날짜/시간 내림차순 정렬`,clearFrom:e=>`"${e}"에서 필터 해제`,search:`검색`,selectAll:`(모두 선택)`,blanks:`(필드 값 없음)`,found:(e,t)=>`${String(t)}개 레코드 중 ${String(e)}개 찾음`},sort:{title:`정렬`,addLevel:`기준 추가`,deleteLevel:`기준 삭제`,hasHeaders:`내 데이터에 머리글 표시`,sortBy:`정렬 기준`,thenBy:`다음 기준`,column:e=>`열 ${e}`},rules:{title:`조건부 서식`,highlight:`셀 강조 규칙`,topBottom:`상위/하위 규칙`,greaterThan:`보다 큼…`,lessThan:`보다 작음…`,between:`다음 값의 사이에 있음…`,equalTo:`같음…`,textContains:`텍스트 포함…`,duplicateValues:`중복 값…`,top10:`상위 10개 항목…`,top10Percent:`상위 10%…`,bottom10:`하위 10개 항목…`,bottom10Percent:`하위 10%…`,aboveAverage:`평균 초과…`,belowAverage:`평균 미만…`,dataBars:`데이터 막대`,colorScales:`색조`,iconSets:`아이콘 집합`,clearRules:`규칙 지우기`,clearSelected:`선택한 셀의 규칙 지우기`,clearSheet:`시트 전체에서 규칙 지우기`,greaterPrompt:`다음 값보다 큰 셀의 서식 지정:`,lessPrompt:`다음 값보다 작은 셀의 서식 지정:`,betweenPrompt:`다음 값 사이에 있는 셀의 서식 지정:`,equalPrompt:`다음 값과 같은 셀의 서식 지정:`,textPrompt:`다음 텍스트를 포함하는 셀의 서식 지정:`,duplicatePrompt:`다음 값을 포함하는 셀의 서식 지정:`,topPrompt:`상위 순위에 속하는 셀의 서식 지정:`,topPercentPrompt:`상위 순위에 속하는 셀의 서식 지정(백분율):`,bottomPrompt:`하위 순위에 속하는 셀의 서식 지정:`,bottomPercentPrompt:`하위 순위에 속하는 셀의 서식 지정(백분율):`,abovePrompt:`평균보다 큰 셀의 서식 지정:`,belowPrompt:`평균보다 작은 셀의 서식 지정:`,and:`에서`,with:`적용할 서식:`,duplicate:`중복`,unique:`고유`,looks:{lightRed:`진한 빨강 텍스트가 있는 연한 빨강 채우기`,yellow:`진한 노랑 텍스트가 있는 노랑 채우기`,green:`진한 녹색 텍스트가 있는 녹색 채우기`,lightRedFill:`연한 빨강 채우기`,redText:`빨강 텍스트`,redBorder:`빨강 테두리`},scales:{greenYellowRed:`녹색 - 노랑 - 빨강 색조`,redYellowGreen:`빨강 - 노랑 - 녹색 색조`,blueWhiteRed:`파랑 - 흰색 - 빨강 색조`,whiteRed:`흰색 - 빨강 색조`,whiteGreen:`흰색 - 녹색 색조`},icons:{"3Arrows":`3방향 화살표`,"5Arrows":`5방향 화살표`,"3TrafficLights1":`3색 신호등`,"4TrafficLights":`4색 신호등`,"3Symbols":`기호 3개`,"3Flags":`깃발 3개`,"5Rating":`5가지 등급`}},validation:{title:`데이터 유효성 검사`,clearAll:`모두 지우기`,settings:`설정`,inputMessage:`설명 메시지`,errorAlert:`오류 메시지`,allow:`제한 대상`,kinds:{any:`모든 값`,whole:`정수`,decimal:`소수점`,list:`목록`,date:`날짜`,time:`시간`,textLength:`텍스트 길이`,custom:`사용자 지정`},ignoreBlank:`공백 무시`,dropdown:`드롭다운 표시`,data:`제한 방법`,operators:{between:`해당 범위`,notBetween:`제외 범위`,equal:`=`,notEqual:`<>`,greaterThan:`>`,lessThan:`<`,greaterThanOrEqual:`>=`,lessThanOrEqual:`<=`},source:`원본`,formula:`수식`,minimum:`최소값`,maximum:`최대값`,value:`값`,showPrompt:`셀을 선택하면 설명 메시지 표시`,titleWord:`제목`,showError:`유효하지 않은 데이터를 입력하면 오류 메시지 표시`,style:`스타일`,styles:{stop:`중지`,warning:`경고`,information:`정보`},errorMessage:`오류 메시지`,refusedTitle:`허용되지 않는 값`,refused:`이 값은 이 셀에 정의된 데이터 유효성 검사 제한과 일치하지 않습니다.`,retry:`다시 시도`,no:`아니요`,yes:`예`,continue:`계속하시겠습니까?`},menu:{cut:`잘라내기`,copy:`복사`,paste:`붙여넣기`,pasteSpecial:`선택하여 붙여넣기`,values:`값`,formulas:`수식`,formats:`서식`,entireRow:`행 전체`,entireColumn:`열 전체`,clearContents:`내용 지우기`,filter:`필터`,sort:`정렬`,filterByValue:`선택한 셀 값으로 필터링`,formatCells:`셀 서식…`,pickFromList:`드롭다운 목록에서 선택…`,rowHeight:`행 높이…`,columnWidth:`열 너비…`,rowHeightWord:`행 높이`,columnWidthWord:`열 너비`,hide:`숨기기`,unhide:`숨기기 취소`,multiple:`여러 부분을 선택한 경우에는 이 명령을 사용할 수 없습니다.`,tableMove:`표 머리글의 일부는 이동할 수 없습니다.`},fill:{options:`자동 채우기 옵션`,copy:`셀 복사`,series:`연속 데이터 채우기`},formatCells:{title:`셀 서식`,tabs:{number:`표시 형식`,alignment:`맞춤`,font:`글꼴`,border:`테두리`,fill:`채우기`},category:`범주`,categories:{general:`일반`,number:`숫자`,currency:`통화`,accounting:`회계`,date:`날짜`,time:`시간`,percentage:`백분율`,fraction:`분수`,scientific:`지수`,text:`텍스트`,custom:`사용자 지정`},sample:`보기`,decimals:`소수 자릿수`,thousands:`1000 단위 구분 기호(,) 사용`,symbol:`기호`,none:`없음`,negative:`음수`,type:`형식`,horizontal:`가로`,vertical:`세로`,aligns:{general:`일반`,left:`왼쪽(들여쓰기)`,center:`가운데`,right:`오른쪽(들여쓰기)`,fill:`채우기`,justify:`양쪽 맞춤`,centerContinuous:`선택 영역의 가운데로`,distributed:`균등 분할(들여쓰기)`},valigns:{top:`위쪽`,center:`가운데`,bottom:`아래쪽`,justify:`양쪽 맞춤`,distributed:`균등 분할`},indent:`들여쓰기`,orientation:`도`,shrink:`셀에 맞춤`,strikethrough:`취소선`,borderNone:`없음`,borderOutline:`윤곽선`,borderInside:`안쪽`,lineStyle:`스타일`,lineColor:`색`,lines:{thin:`가는 선`,hair:`극세선`,dotted:`점선`,dashed:`파선`,dashDot:`일점쇄선`,dashDotDot:`이점쇄선`,medium:`중간 실선`,mediumDashed:`중간 파선`,mediumDashDot:`중간 일점쇄선`,thick:`굵은 선`,double:`이중선`},edges:{top:`위쪽`,horizontal:`안쪽 가로`,bottom:`아래쪽`,left:`왼쪽`,vertical:`안쪽 세로`,right:`오른쪽`}},chart:{insert:`차트 삽입`,design:`차트 디자인`,changeType:`차트 종류 변경`,selectData:`데이터 선택`,dataRange:`차트 데이터 범위`,title:`차트 제목`,legend:`범례`,legendNone:`없음`,legendAt:{right:`오른쪽`,top:`위쪽`,left:`왼쪽`,bottom:`아래쪽`},noData:`이 범위에는 차트로 만들 숫자가 없습니다.`,buttons:{columnBar:`세로 또는 가로 막대형 차트 삽입`,lineArea:`꺾은선형 또는 영역형 차트 삽입`,pieDoughnut:`원형 또는 도넛형 차트 삽입`,scatter:`분산형(X, Y) 차트 삽입`},groups:{column2d:`2차원 세로 막대형`,bar2d:`2차원 가로 막대형`,line2d:`2차원 꺾은선형`,area2d:`2차원 영역형`,pie2d:`2차원 원형`,doughnut:`도넛형`,scatter:`분산형`},types:{"column-clustered":`묶은 세로 막대형`,"column-stacked":`누적 세로 막대형`,"column-stacked-100":`100% 기준 누적 세로 막대형`,"bar-clustered":`묶은 가로 막대형`,"bar-stacked":`누적 가로 막대형`,"bar-stacked-100":`100% 기준 누적 가로 막대형`,line:`꺾은선형`,"line-markers":`표식이 있는 꺾은선형`,area:`영역형`,"area-stacked":`누적 영역형`,"area-stacked-100":`100% 기준 누적 영역형`,pie:`원형`,doughnut:`도넛형`,scatter:`분산형`,"scatter-lines":`직선 및 표식이 있는 분산형`,"scatter-smooth":`곡선이 있는 분산형`},name:e=>`차트 ${String(e)}`},spillBlocked:`분산 범위가 비어 있지 않습니다`},es:{loading:`Abriendo…`,unreadable:`No se puede mostrar esta hoja: no se puede leer su sheet.yaml. Esto es lo que falla.`,generated:{line:`sheet.ts crea esta hoja`,title:`Esta hoja está protegida`,refused:`La celda o el gráfico que intenta cambiar está en una hoja protegida: sheet.ts la crea.`,ask:e=>e===void 0?`Preguntar al agente`:`Preguntar a ${e}`,ordinary:`Convertir en hoja normal`,copied:`Copiado: péguelo en su agente.`,failed:`sheet.ts no se ejecuta: las hojas que crea siguen como estaban.`},scenario:{manager:`Administrador de escenarios`,scenarios:`Escenarios:`,changing:`Celdas cambiantes:`,show:`Mostrar`,close:`Cerrar`,base:`Caso base`,showing:`en pantalla`,on:e=>`Escenario: ${e}`},files:{insert:`Insertar archivo…`,open:`Abrir`,remove:`Quitar de la celda`,notColumn:`Esta columna no contiene archivos.`},undo:`Deshacer`,redo:`Rehacer`,font:`Fuente`,fontSize:`Tamaño de fuente`,bold:`Negrita`,italic:`Cursiva`,underline:`Subrayado`,fillColor:`Color de relleno`,fontColor:`Color de fuente`,noFill:`Sin relleno`,automatic:`Automático`,alignLeft:`Alinear a la izquierda`,center:`Centrar`,alignRight:`Alinear a la derecha`,wrapText:`Ajustar texto`,numberFormat:`Formato de número`,custom:`Personalizada`,formats:{general:`General`,number:`Número`,currency:`Moneda`,accounting:`Contabilidad`,shortDate:`Fecha corta`,longDate:`Fecha larga`,time:`Hora`,percentage:`Porcentaje`,fraction:`Fracción`,scientific:`Científica`,text:`Texto`},insert:`Insertar`,delete:`Eliminar`,insertRows:`Insertar filas de hoja`,insertColumns:`Insertar columnas de hoja`,insertSheet:`Insertar hoja`,deleteRows:`Eliminar filas de hoja`,deleteColumns:`Eliminar columnas de hoja`,deleteSheet:`Eliminar hoja`,nameBox:`Cuadro de nombres`,formulaBar:`Barra de fórmulas`,cancel:`Cancelar`,enter:`Introducir`,insertFunction:`Insertar función`,sheetTabs:`Hojas`,newSheet:`Hoja nueva`,allSheets:`Todas las hojas`,sheetMenu:`Menú de la hoja`,zoom:`Zoom`,zoomIn:`Acercar`,zoomOut:`Alejar`,duplicate:`Duplicar`,namesList:`Nombres`,rename:`Cambiar nombre`,sheetName:e=>`Hoja${String(e)}`,average:`Promedio`,count:`Recuento`,sum:`Suma`,changed:(e,t)=>`${e} cambió ${String(t)} ${t===1?`elemento`:`elementos`}`,changedElsewhere:e=>`${String(e)} ${e===1?`cambio`:`cambios`} desde otro lugar`,previous:`Anterior`,next:`Siguiente`,keep:`Conservar`,keepAll:`Conservar todo`,undoAll:`Deshacer todo`,was:e=>`antes: ${e}`,rowAdded:`fila añadida`,rowRemoved:`fila eliminada`,fileChanged:`filas reescritas`,bothChanged:e=>`Tú y ${e} cambiasteis lo mismo. Prevalece lo tuyo.`,formulaProblem:`Hay un problema con esta fórmula.`,columnName:`La columna de una tabla necesita un nombre.`,badSheetName:`El nombre de una hoja tiene como máximo 31 caracteres y no puede incluir \\ / ? * [ ] :`,sheetTaken:`Ya hay una hoja con ese nombre.`,lastSheet:`Un libro debe conservar al menos una hoja visible.`,tableHeader:`No se puede eliminar la fila de encabezado de una tabla.`,badName:`No se puede usar ese nombre.`,badReference:`La referencia no es válida.`,overwrite:`Sobrescribir todas las celdas de esta columna con esta fórmula`,dialog:{ok:`Aceptar`,cancel:`Cancelar`},number:{more:`Más formatos de número…`,accounting:`Formato de número de contabilidad`,percent:`Estilo porcentual`,comma:`Estilo de millares`,increaseDecimal:`Aumentar decimales`,decreaseDecimal:`Disminuir decimales`},borders:{title:`Bordes`,bottom:`Borde inferior`,top:`Borde superior`,left:`Borde izquierdo`,right:`Borde derecho`,none:`Sin borde`,all:`Todos los bordes`,outside:`Bordes externos`,thickOutside:`Borde exterior grueso`,bottomDouble:`Borde doble inferior`,thickBottom:`Borde inferior grueso`,topBottom:`Borde superior e inferior`,topThickBottom:`Borde superior e inferior grueso`,topDoubleBottom:`Borde superior e inferior doble`,more:`Más bordes…`},arrange:{cells:`Celdas`,mergeCenter:`Combinar y centrar`,mergeMenu:`Opciones de combinación`,mergeAcross:`Combinar horizontalmente`,mergeCells:`Combinar celdas`,unmerge:`Separar celdas`,mergeTable:`Las celdas de una tabla no se pueden combinar.`,mergeLoses:`Al combinar las celdas solo se conserva el valor de la celda superior izquierda y se descartan los demás.`,format:`Formato`,fitRows:`Autoajustar alto de fila`,fitColumns:`Autoajustar ancho de columna`,hideUnhide:`Ocultar y mostrar`,hideRows:`Ocultar filas`,hideColumns:`Ocultar columnas`,hideSheet:`Ocultar hoja`,unhideRows:`Mostrar filas`,unhideColumns:`Mostrar columnas`,unhideSheet:`Mostrar hoja`,unhideEllipsis:`Mostrar…`,freezePanes:`Inmovilizar paneles`,unfreeze:`Movilizar paneles`,freezeTopRow:`Inmovilizar fila superior`,freezeFirstColumn:`Inmovilizar primera columna`,tabColor:`Color de pestaña`,noColor:`Sin color`},sortFilter:{title:`Ordenar y filtrar`,customSort:`Orden personalizado…`,filter:`Filtro`,clear:`Borrar`,reapply:`Volver a aplicar`,noData:`Seleccione una celda de un rango con datos e inténtelo de nuevo.`},filter:{aToZ:`Ordenar de A a Z`,zToA:`Ordenar de Z a A`,aToZShort:`A a Z`,zToAShort:`Z a A`,smallest:`Ordenar de menor a mayor`,largest:`Ordenar de mayor a menor`,oldest:`Ordenar de más antiguos a más recientes`,newest:`Ordenar de más recientes a más antiguos`,clearFrom:e=>`Borrar filtro de "${e}"`,search:`Buscar`,selectAll:`(Seleccionar todo)`,blanks:`(Vacías)`,found:(e,t)=>`${String(e)} de ${String(t)} registros encontrados`},sort:{title:`Ordenar`,addLevel:`Agregar nivel`,deleteLevel:`Eliminar nivel`,hasHeaders:`Mis datos tienen encabezados`,sortBy:`Ordenar por`,thenBy:`Luego por`,column:e=>`Columna ${e}`},rules:{title:`Formato condicional`,highlight:`Reglas para resaltar celdas`,topBottom:`Reglas superiores e inferiores`,greaterThan:`Mayor que…`,lessThan:`Menor que…`,between:`Entre…`,equalTo:`Igual a…`,textContains:`Texto que contiene…`,duplicateValues:`Valores duplicados…`,top10:`10 superiores…`,top10Percent:`10% superiores…`,bottom10:`10 inferiores…`,bottom10Percent:`10% inferiores…`,aboveAverage:`Por encima del promedio…`,belowAverage:`Por debajo del promedio…`,dataBars:`Barras de datos`,colorScales:`Escalas de color`,iconSets:`Conjuntos de iconos`,clearRules:`Borrar reglas`,clearSelected:`Borrar reglas de las celdas seleccionadas`,clearSheet:`Borrar reglas de toda la hoja`,greaterPrompt:`Aplicar formato a las celdas que son MAYORES QUE:`,lessPrompt:`Aplicar formato a las celdas que son MENORES QUE:`,betweenPrompt:`Aplicar formato a las celdas que se encuentran ENTRE:`,equalPrompt:`Aplicar formato a las celdas que son IGUALES A:`,textPrompt:`Aplicar formato a las celdas que contienen el texto:`,duplicatePrompt:`Aplicar formato a las celdas que contienen:`,topPrompt:`Aplicar formato a las celdas que se encuentran en el rango SUPERIOR:`,topPercentPrompt:`Aplicar formato a las celdas que se encuentran en el rango SUPERIOR (porcentaje):`,bottomPrompt:`Aplicar formato a las celdas que se encuentran en el rango INFERIOR:`,bottomPercentPrompt:`Aplicar formato a las celdas que se encuentran en el rango INFERIOR (porcentaje):`,abovePrompt:`Aplicar formato a las celdas que están POR ENCIMA DEL PROMEDIO:`,belowPrompt:`Aplicar formato a las celdas que están POR DEBAJO DEL PROMEDIO:`,and:`y`,with:`con`,duplicate:`Duplicados`,unique:`Únicos`,looks:{lightRed:`Relleno rojo claro con texto rojo oscuro`,yellow:`Relleno amarillo con texto amarillo oscuro`,green:`Relleno verde con texto verde oscuro`,lightRedFill:`Relleno rojo claro`,redText:`Texto rojo`,redBorder:`Borde rojo`},scales:{greenYellowRed:`Verde - Amarillo - Rojo`,redYellowGreen:`Rojo - Amarillo - Verde`,blueWhiteRed:`Azul - Blanco - Rojo`,whiteRed:`Blanco - Rojo`,whiteGreen:`Blanco - Verde`},icons:{"3Arrows":`3 flechas`,"5Arrows":`5 flechas`,"3TrafficLights1":`3 semáforos`,"4TrafficLights":`4 semáforos`,"3Symbols":`3 símbolos`,"3Flags":`3 banderas`,"5Rating":`5 clasificaciones`}},validation:{title:`Validación de datos`,clearAll:`Borrar todo`,settings:`Configuración`,inputMessage:`Mensaje de entrada`,errorAlert:`Mensaje de error`,allow:`Permitir`,kinds:{any:`Cualquier valor`,whole:`Número entero`,decimal:`Decimal`,list:`Lista`,date:`Fecha`,time:`Hora`,textLength:`Longitud del texto`,custom:`Personalizada`},ignoreBlank:`Omitir blancos`,dropdown:`Celda con lista desplegable`,data:`Datos`,operators:{between:`entre`,notBetween:`no está entre`,equal:`igual a`,notEqual:`no es igual a`,greaterThan:`mayor que`,lessThan:`menor que`,greaterThanOrEqual:`mayor o igual que`,lessThanOrEqual:`menor o igual que`},source:`Origen`,formula:`Fórmula`,minimum:`Mínimo`,maximum:`Máximo`,value:`Valor`,showPrompt:`Mostrar mensaje de entrada al seleccionar la celda`,titleWord:`Título`,showError:`Mostrar mensaje de error si se introducen datos no válidos`,style:`Estilo`,styles:{stop:`Grave`,warning:`Advertencia`,information:`Información`},errorMessage:`Mensaje de error`,refusedTitle:`Valor no permitido`,refused:`Este valor no coincide con las restricciones de validación de datos definidas para esta celda.`,retry:`Reintentar`,no:`No`,yes:`Sí`,continue:`¿Desea continuar?`},menu:{cut:`Cortar`,copy:`Copiar`,paste:`Pegar`,pasteSpecial:`Pegado especial`,values:`Valores`,formulas:`Fórmulas`,formats:`Formatos`,entireRow:`Toda la fila`,entireColumn:`Toda la columna`,clearContents:`Borrar contenido`,filter:`Filtrar`,sort:`Ordenar`,filterByValue:`Filtrar por valor de la celda seleccionada`,formatCells:`Formato de celdas…`,pickFromList:`Elegir de la lista desplegable…`,rowHeight:`Alto de fila…`,columnWidth:`Ancho de columna…`,rowHeightWord:`Alto de fila`,columnWidthWord:`Ancho de columna`,hide:`Ocultar`,unhide:`Mostrar`,multiple:`Ese comando no se puede usar en selecciones múltiples.`,tableMove:`No se puede mover parte del encabezado de una tabla.`},fill:{options:`Opciones de autorrelleno`,copy:`Copiar celdas`,series:`Serie de relleno`},formatCells:{title:`Formato de celdas`,tabs:{number:`Número`,alignment:`Alineación`,font:`Fuente`,border:`Borde`,fill:`Relleno`},category:`Categoría`,categories:{general:`General`,number:`Número`,currency:`Moneda`,accounting:`Contabilidad`,date:`Fecha`,time:`Hora`,percentage:`Porcentaje`,fraction:`Fracción`,scientific:`Científica`,text:`Texto`,custom:`Personalizada`},sample:`Muestra`,decimals:`Posiciones decimales`,thousands:`Usar separador de miles (,)`,symbol:`Símbolo`,none:`Ninguno`,negative:`Números negativos`,type:`Tipo`,horizontal:`Horizontal`,vertical:`Vertical`,aligns:{general:`General`,left:`Izquierda (sangría)`,center:`Centrar`,right:`Derecha (sangría)`,fill:`Rellenar`,justify:`Justificar`,centerContinuous:`Centrar en la selección`,distributed:`Distribuido (sangría)`},valigns:{top:`Superior`,center:`Centrar`,bottom:`Inferior`,justify:`Justificar`,distributed:`Distribuido`},indent:`Sangría`,orientation:`Grados`,shrink:`Reducir hasta ajustar`,strikethrough:`Tachado`,borderNone:`Ninguno`,borderOutline:`Contorno`,borderInside:`Interior`,lineStyle:`Estilo`,lineColor:`Color`,lines:{thin:`Fino`,hair:`Muy fino`,dotted:`Punteado`,dashed:`Discontinuo`,dashDot:`Guion y punto`,dashDotDot:`Guion y dos puntos`,medium:`Mediano`,mediumDashed:`Mediano discontinuo`,mediumDashDot:`Mediano guion y punto`,thick:`Grueso`,double:`Doble`},edges:{top:`Superior`,horizontal:`Horizontal interior`,bottom:`Inferior`,left:`Izquierdo`,vertical:`Vertical interior`,right:`Derecho`}},chart:{insert:`Insertar gráfico`,design:`Diseño de gráfico`,changeType:`Cambiar tipo de gráfico`,selectData:`Seleccionar datos`,dataRange:`Rango de datos del gráfico`,title:`Título del gráfico`,legend:`Leyenda`,legendNone:`Ninguna`,legendAt:{right:`Derecha`,top:`Arriba`,left:`Izquierda`,bottom:`Abajo`},noData:`Ese rango no tiene números para representar.`,buttons:{columnBar:`Insertar gráfico de columnas o de barras`,lineArea:`Insertar gráfico de líneas o áreas`,pieDoughnut:`Insertar gráfico circular o de anillos`,scatter:`Insertar gráfico de dispersión (X, Y)`},groups:{column2d:`Columna 2D`,bar2d:`Barra 2D`,line2d:`Línea 2D`,area2d:`Área 2D`,pie2d:`Circular 2D`,doughnut:`Anillos`,scatter:`Dispersión`},types:{"column-clustered":`Columnas agrupadas`,"column-stacked":`Columnas apiladas`,"column-stacked-100":`Columnas 100% apiladas`,"bar-clustered":`Barras agrupadas`,"bar-stacked":`Barras apiladas`,"bar-stacked-100":`Barras 100% apiladas`,line:`Línea`,"line-markers":`Línea con marcadores`,area:`Área`,"area-stacked":`Área apilada`,"area-stacked-100":`Área 100% apilada`,pie:`Circular`,doughnut:`Anillos`,scatter:`Dispersión`,"scatter-lines":`Dispersión con líneas rectas y marcadores`,"scatter-smooth":`Dispersión con líneas suavizadas`},name:e=>`Gráfico ${String(e)}`},spillBlocked:`El rango de desbordamiento no está en blanco`},fr:{loading:`Ouverture…`,unreadable:`Impossible d’afficher cette feuille : son sheet.yaml est illisible. Voici ce qui ne va pas.`,generated:{line:`sheet.ts crée cette feuille`,title:`Cette feuille est protégée`,refused:`La cellule ou le graphique que vous essayez de modifier se trouve sur une feuille protégée : sheet.ts la crée.`,ask:e=>e===void 0?`Demander à l’agent`:`Demander à ${e}`,ordinary:`Convertir en feuille normale`,copied:`Copié : collez-le dans votre agent.`,failed:`sheet.ts ne s’exécute pas : les feuilles qu’il crée restent telles quelles.`},scenario:{manager:`Gestionnaire de scénarios`,scenarios:`Scénarios :`,changing:`Cellules variables :`,show:`Afficher`,close:`Fermer`,base:`Cas de base`,showing:`affiché`,on:e=>`Scénario : ${e}`},files:{insert:`Insérer un fichier…`,open:`Ouvrir`,remove:`Retirer de la cellule`,notColumn:`Cette colonne ne contient pas de fichiers.`},undo:`Annuler`,redo:`Rétablir`,font:`Police`,fontSize:`Taille de police`,bold:`Gras`,italic:`Italique`,underline:`Souligné`,fillColor:`Couleur de remplissage`,fontColor:`Couleur de police`,noFill:`Pas de remplissage`,automatic:`Automatique`,alignLeft:`Aligner à gauche`,center:`Centrer`,alignRight:`Aligner à droite`,wrapText:`Renvoyer à la ligne automatiquement`,numberFormat:`Format de nombre`,custom:`Personnalisée`,formats:{general:`Standard`,number:`Nombre`,currency:`Monétaire`,accounting:`Comptabilité`,shortDate:`Date courte`,longDate:`Date longue`,time:`Heure`,percentage:`Pourcentage`,fraction:`Fraction`,scientific:`Scientifique`,text:`Texte`},insert:`Insérer`,delete:`Supprimer`,insertRows:`Insérer des lignes dans la feuille`,insertColumns:`Insérer des colonnes dans la feuille`,insertSheet:`Insérer une feuille`,deleteRows:`Supprimer des lignes de la feuille`,deleteColumns:`Supprimer des colonnes de la feuille`,deleteSheet:`Supprimer la feuille`,nameBox:`Zone Nom`,formulaBar:`Barre de formule`,cancel:`Annuler`,enter:`Entrer`,insertFunction:`Insérer une fonction`,sheetTabs:`Feuilles`,newSheet:`Nouvelle feuille`,allSheets:`Toutes les feuilles`,sheetMenu:`Menu de la feuille`,zoom:`Zoom`,zoomIn:`Zoom avant`,zoomOut:`Zoom arrière`,duplicate:`Dupliquer`,namesList:`Noms`,rename:`Renommer`,sheetName:e=>`Feuil${String(e)}`,average:`Moyenne`,count:`Nb`,sum:`Somme`,changed:(e,t)=>`${e} a modifié ${String(t)} ${t===1?`élément`:`éléments`}`,changedElsewhere:e=>`${String(e)} ${e===1?`modification`:`modifications`} venant d’ailleurs`,previous:`Précédent`,next:`Suivant`,keep:`Garder`,keepAll:`Tout garder`,undoAll:`Tout annuler`,was:e=>`avant : ${e}`,rowAdded:`ligne ajoutée`,rowRemoved:`ligne supprimée`,fileChanged:`lignes réécrites`,bothChanged:e=>`Vous et ${e} avez modifié la même chose. Votre version est conservée.`,formulaProblem:`Un problème est survenu avec cette formule.`,columnName:`La colonne d’un tableau doit avoir un nom.`,badSheetName:`Le nom d’une feuille compte au plus 31 caractères et ne contient aucun de \\ / ? * [ ] :`,sheetTaken:`Une feuille porte déjà ce nom.`,lastSheet:`Un classeur doit garder au moins une feuille visible.`,tableHeader:`La ligne d’en-tête d’un tableau ne peut pas être supprimée.`,badName:`Ce nom ne peut pas être utilisé.`,badReference:`La référence n’est pas valide.`,overwrite:`Remplacer toutes les cellules de cette colonne par cette formule`,dialog:{ok:`OK`,cancel:`Annuler`},number:{more:`Autres formats numériques…`,accounting:`Format Nombre Comptabilité`,percent:`Style de pourcentage`,comma:`Séparateur de milliers`,increaseDecimal:`Ajouter une décimale`,decreaseDecimal:`Réduire les décimales`},borders:{title:`Bordures`,bottom:`Bordure inférieure`,top:`Bordure supérieure`,left:`Bordure gauche`,right:`Bordure droite`,none:`Aucune bordure`,all:`Toutes les bordures`,outside:`Bordures extérieures`,thickOutside:`Bordure épaisse en encadré`,bottomDouble:`Bordure double en bas`,thickBottom:`Bordure épaisse en bas`,topBottom:`Bordure en haut et en bas`,topThickBottom:`Bordure simple en haut et épaisse en bas`,topDoubleBottom:`Bordure simple en haut et double en bas`,more:`Autres bordures…`},arrange:{cells:`Cellules`,mergeCenter:`Fusionner et centrer`,mergeMenu:`Options de fusion`,mergeAcross:`Fusionner horizontalement`,mergeCells:`Fusionner les cellules`,unmerge:`Annuler la fusion des cellules`,mergeTable:`Les cellules d’un tableau ne peuvent pas être fusionnées.`,mergeLoses:`La fusion des cellules conserve uniquement la valeur de la cellule supérieure gauche et ignore les autres valeurs.`,format:`Format`,fitRows:`Ajuster la hauteur de ligne`,fitColumns:`Ajuster la largeur de colonne`,hideUnhide:`Masquer et afficher`,hideRows:`Masquer les lignes`,hideColumns:`Masquer les colonnes`,hideSheet:`Masquer la feuille`,unhideRows:`Afficher les lignes`,unhideColumns:`Afficher les colonnes`,unhideSheet:`Afficher la feuille`,unhideEllipsis:`Afficher…`,freezePanes:`Figer les volets`,unfreeze:`Libérer les volets`,freezeTopRow:`Figer la ligne supérieure`,freezeFirstColumn:`Figer la première colonne`,tabColor:`Couleur d’onglet`,noColor:`Aucune couleur`},sortFilter:{title:`Trier et filtrer`,customSort:`Tri personnalisé…`,filter:`Filtrer`,clear:`Effacer`,reapply:`Réappliquer`,noData:`Sélectionnez une cellule d’une plage contenant des données, puis réessayez.`},filter:{aToZ:`Trier de A à Z`,zToA:`Trier de Z à A`,aToZShort:`De A à Z`,zToAShort:`De Z à A`,smallest:`Trier du plus petit au plus grand`,largest:`Trier du plus grand au plus petit`,oldest:`Trier du plus ancien au plus récent`,newest:`Trier du plus récent au plus ancien`,clearFrom:e=>`Effacer le filtre de « ${e} »`,search:`Rechercher`,selectAll:`(Sélectionner tout)`,blanks:`(Vides)`,found:(e,t)=>`${String(e)} enregistrements sur ${String(t)} trouvés`},sort:{title:`Trier`,addLevel:`Ajouter un niveau`,deleteLevel:`Supprimer un niveau`,hasHeaders:`Mes données ont des en-têtes`,sortBy:`Trier par`,thenBy:`Puis par`,column:e=>`Colonne ${e}`},rules:{title:`Mise en forme conditionnelle`,highlight:`Règles de mise en surbrillance des cellules`,topBottom:`Règles des valeurs de plage haute/basse`,greaterThan:`Supérieur à…`,lessThan:`Inférieur à…`,between:`Entre…`,equalTo:`Égal à…`,textContains:`Texte qui contient…`,duplicateValues:`Valeurs en double…`,top10:`10 valeurs les plus élevées…`,top10Percent:`10 % les plus élevées…`,bottom10:`10 valeurs les moins élevées…`,bottom10Percent:`10 % les moins élevées…`,aboveAverage:`Au-dessus de la moyenne…`,belowAverage:`En dessous de la moyenne…`,dataBars:`Barres de données`,colorScales:`Nuances de couleurs`,iconSets:`Jeux d’icônes`,clearRules:`Effacer les règles`,clearSelected:`Effacer les règles des cellules sélectionnées`,clearSheet:`Effacer les règles de la feuille entière`,greaterPrompt:`Appliquer une mise en forme aux cellules qui sont SUPÉRIEURES À :`,lessPrompt:`Appliquer une mise en forme aux cellules qui sont INFÉRIEURES À :`,betweenPrompt:`Appliquer une mise en forme aux cellules qui sont COMPRISES ENTRE :`,equalPrompt:`Appliquer une mise en forme aux cellules qui sont ÉGALES À :`,textPrompt:`Appliquer une mise en forme aux cellules qui contiennent le texte :`,duplicatePrompt:`Appliquer une mise en forme aux cellules qui contiennent :`,topPrompt:`Appliquer une mise en forme aux cellules classées parmi les PLUS ÉLEVÉES :`,topPercentPrompt:`Appliquer une mise en forme aux cellules classées parmi les PLUS ÉLEVÉES (pourcentage) :`,bottomPrompt:`Appliquer une mise en forme aux cellules classées parmi les MOINS ÉLEVÉES :`,bottomPercentPrompt:`Appliquer une mise en forme aux cellules classées parmi les MOINS ÉLEVÉES (pourcentage) :`,abovePrompt:`Appliquer une mise en forme aux cellules AU-DESSUS DE LA MOYENNE :`,belowPrompt:`Appliquer une mise en forme aux cellules EN DESSOUS DE LA MOYENNE :`,and:`et`,with:`avec`,duplicate:`En double`,unique:`Uniques`,looks:{lightRed:`Remplissage rouge clair avec texte rouge foncé`,yellow:`Remplissage jaune avec texte jaune foncé`,green:`Remplissage vert avec texte vert foncé`,lightRedFill:`Remplissage rouge clair`,redText:`Texte rouge`,redBorder:`Bordure rouge`},scales:{greenYellowRed:`Vert - Jaune - Rouge`,redYellowGreen:`Rouge - Jaune - Vert`,blueWhiteRed:`Bleu - Blanc - Rouge`,whiteRed:`Blanc - Rouge`,whiteGreen:`Blanc - Vert`},icons:{"3Arrows":`3 flèches`,"5Arrows":`5 flèches`,"3TrafficLights1":`3 feux de signalisation`,"4TrafficLights":`4 feux de signalisation`,"3Symbols":`3 symboles`,"3Flags":`3 drapeaux`,"5Rating":`5 évaluations`}},validation:{title:`Validation des données`,clearAll:`Effacer tout`,settings:`Options`,inputMessage:`Message de saisie`,errorAlert:`Alerte d’erreur`,allow:`Autoriser`,kinds:{any:`Tout`,whole:`Nombre entier`,decimal:`Décimal`,list:`Liste`,date:`Date`,time:`Heure`,textLength:`Longueur du texte`,custom:`Personnalisé`},ignoreBlank:`Ignorer si vide`,dropdown:`Liste déroulante dans la cellule`,data:`Données`,operators:{between:`comprise entre`,notBetween:`non comprise entre`,equal:`égale à`,notEqual:`différente de`,greaterThan:`supérieure à`,lessThan:`inférieure à`,greaterThanOrEqual:`supérieure ou égale à`,lessThanOrEqual:`inférieure ou égale à`},source:`Source`,formula:`Formule`,minimum:`Minimum`,maximum:`Maximum`,value:`Valeur`,showPrompt:`Afficher le message de saisie lorsque la cellule est sélectionnée`,titleWord:`Titre`,showError:`Afficher l’alerte d’erreur après la saisie de données non valides`,style:`Style`,styles:{stop:`Arrêt`,warning:`Avertissement`,information:`Informations`},errorMessage:`Message d’erreur`,refusedTitle:`Valeur non autorisée`,refused:`Cette valeur ne correspond pas aux restrictions de validation des données définies pour cette cellule.`,retry:`Réessayer`,no:`Non`,yes:`Oui`,continue:`Continuer ?`},menu:{cut:`Couper`,copy:`Copier`,paste:`Coller`,pasteSpecial:`Collage spécial`,values:`Valeurs`,formulas:`Formules`,formats:`Formats`,entireRow:`Ligne entière`,entireColumn:`Colonne entière`,clearContents:`Effacer le contenu`,filter:`Filtrer`,sort:`Trier`,filterByValue:`Filtrer par la valeur de la cellule sélectionnée`,formatCells:`Format de cellule…`,pickFromList:`Liste déroulante de choix…`,rowHeight:`Hauteur de ligne…`,columnWidth:`Largeur de colonne…`,rowHeightWord:`Hauteur de ligne`,columnWidthWord:`Largeur de colonne`,hide:`Masquer`,unhide:`Afficher`,multiple:`Cette commande ne peut pas être utilisée sur des sélections multiples.`,tableMove:`Une partie de l’en-tête d’un tableau ne peut pas être déplacée.`},fill:{options:`Options de recopie incrémentée`,copy:`Copier les cellules`,series:`Incrémenter une série`},formatCells:{title:`Format de cellule`,tabs:{number:`Nombre`,alignment:`Alignement`,font:`Police`,border:`Bordure`,fill:`Remplissage`},category:`Catégorie`,categories:{general:`Standard`,number:`Nombre`,currency:`Monétaire`,accounting:`Comptabilité`,date:`Date`,time:`Heure`,percentage:`Pourcentage`,fraction:`Fraction`,scientific:`Scientifique`,text:`Texte`,custom:`Personnalisée`},sample:`Exemple`,decimals:`Nombre de décimales`,thousands:`Utiliser le séparateur de milliers (,)`,symbol:`Symbole`,none:`Aucun`,negative:`Nombres négatifs`,type:`Type`,horizontal:`Horizontal`,vertical:`Vertical`,aligns:{general:`Standard`,left:`Gauche (Retrait)`,center:`Centré`,right:`Droite (Retrait)`,fill:`Recopié`,justify:`Justifié`,centerContinuous:`Centré sur plusieurs colonnes`,distributed:`Distribué (Retrait)`},valigns:{top:`Haut`,center:`Centré`,bottom:`Bas`,justify:`Justifié`,distributed:`Distribué`},indent:`Retrait`,orientation:`Degrés`,shrink:`Ajuster`,strikethrough:`Barré`,borderNone:`Aucune`,borderOutline:`Contour`,borderInside:`Intérieur`,lineStyle:`Style`,lineColor:`Couleur`,lines:{thin:`Fin`,hair:`Très fin`,dotted:`Pointillé`,dashed:`Tirets`,dashDot:`Tiret point`,dashDotDot:`Tiret point point`,medium:`Moyen`,mediumDashed:`Tirets moyens`,mediumDashDot:`Tiret point moyen`,thick:`Épais`,double:`Double`},edges:{top:`Haut`,horizontal:`Intérieur horizontal`,bottom:`Bas`,left:`Gauche`,vertical:`Intérieur vertical`,right:`Droite`}},chart:{insert:`Insérer un graphique`,design:`Création de graphique`,changeType:`Modifier le type de graphique`,selectData:`Sélectionner des données`,dataRange:`Plage de données du graphique`,title:`Titre du graphique`,legend:`Légende`,legendNone:`Aucune`,legendAt:{right:`Droite`,top:`Haut`,left:`Gauche`,bottom:`Bas`},noData:`Cette plage ne contient aucun nombre à représenter.`,buttons:{columnBar:`Insérer un histogramme ou un graphique à barres`,lineArea:`Insérer un graphique en courbes ou en aires`,pieDoughnut:`Insérer un graphique en secteurs ou en anneau`,scatter:`Insérer un nuage de points (X, Y)`},groups:{column2d:`Histogramme 2D`,bar2d:`Barres 2D`,line2d:`Courbes 2D`,area2d:`Aires 2D`,pie2d:`Secteurs 2D`,doughnut:`Anneau`,scatter:`Nuage de points`},types:{"column-clustered":`Histogramme groupé`,"column-stacked":`Histogramme empilé`,"column-stacked-100":`Histogramme empilé 100 %`,"bar-clustered":`Barres groupées`,"bar-stacked":`Barres empilées`,"bar-stacked-100":`Barres empilées 100 %`,line:`Courbes`,"line-markers":`Courbes avec marques`,area:`Aires`,"area-stacked":`Aires empilées`,"area-stacked-100":`Aires empilées 100 %`,pie:`Secteurs`,doughnut:`Anneau`,scatter:`Nuage de points`,"scatter-lines":`Nuage de points avec courbes droites et marqueurs`,"scatter-smooth":`Nuage de points avec courbes lissées`},name:e=>`Graphique ${String(e)}`},spillBlocked:`La plage de débordement n’est pas vide`},de:{loading:`Wird geöffnet …`,unreadable:`Dieses Blatt kann nicht angezeigt werden: Seine sheet.yaml lässt sich nicht lesen. Das ist das Problem.`,generated:{line:`sheet.ts erstellt dieses Blatt`,title:`Dieses Blatt ist geschützt`,refused:`Die Zelle oder das Diagramm, die Sie ändern möchten, befindet sich auf einem geschützten Blatt: sheet.ts erstellt es.`,ask:e=>e===void 0?`Agent fragen`:`${e} fragen`,ordinary:`In normales Blatt umwandeln`,copied:`Kopiert: Fügen Sie es bei Ihrem Agenten ein.`,failed:`sheet.ts läuft nicht: Die erstellten Blätter bleiben, wie sie zuletzt waren.`},scenario:{manager:`Szenario-Manager`,scenarios:`Szenarien:`,changing:`Veränderbare Zellen:`,show:`Anzeigen`,close:`Schließen`,base:`Basisfall`,showing:`angezeigt`,on:e=>`Szenario: ${e}`},files:{insert:`Datei einfügen…`,open:`Öffnen`,remove:`Aus Zelle entfernen`,notColumn:`Diese Spalte enthält keine Dateien.`},undo:`Rückgängig`,redo:`Wiederholen`,font:`Schriftart`,fontSize:`Schriftgrad`,bold:`Fett`,italic:`Kursiv`,underline:`Unterstrichen`,fillColor:`Füllfarbe`,fontColor:`Schriftfarbe`,noFill:`Keine Füllung`,automatic:`Automatisch`,alignLeft:`Linksbündig`,center:`Zentriert`,alignRight:`Rechtsbündig`,wrapText:`Textumbruch`,numberFormat:`Zahlenformat`,custom:`Benutzerdefiniert`,formats:{general:`Standard`,number:`Zahl`,currency:`Währung`,accounting:`Buchhaltung`,shortDate:`Kurzes Datum`,longDate:`Langes Datum`,time:`Uhrzeit`,percentage:`Prozent`,fraction:`Bruch`,scientific:`Wissenschaft`,text:`Text`},insert:`Einfügen`,delete:`Löschen`,insertRows:`Blattzeilen einfügen`,insertColumns:`Blattspalten einfügen`,insertSheet:`Blatt einfügen`,deleteRows:`Blattzeilen löschen`,deleteColumns:`Blattspalten löschen`,deleteSheet:`Blatt löschen`,nameBox:`Namenfeld`,formulaBar:`Bearbeitungsleiste`,cancel:`Abbrechen`,enter:`Eingabe`,insertFunction:`Funktion einfügen`,sheetTabs:`Blätter`,newSheet:`Neues Blatt`,allSheets:`Alle Blätter`,sheetMenu:`Blattmenü`,zoom:`Zoom`,zoomIn:`Vergrößern`,zoomOut:`Verkleinern`,duplicate:`Duplizieren`,namesList:`Namen`,rename:`Umbenennen`,sheetName:e=>`Tabelle${String(e)}`,average:`Mittelwert`,count:`Anzahl`,sum:`Summe`,changed:(e,t)=>`${e} hat ${String(t)} ${t===1?`Element`:`Elemente`} geändert`,changedElsewhere:e=>`${String(e)} ${e===1?`Änderung`:`Änderungen`} von anderswo`,previous:`Zurück`,next:`Weiter`,keep:`Behalten`,keepAll:`Alle behalten`,undoAll:`Alle rückgängig`,was:e=>`vorher: ${e}`,rowAdded:`Zeile hinzugefügt`,rowRemoved:`Zeile entfernt`,fileChanged:`Zeilen neu geschrieben`,bothChanged:e=>`Sie und ${e} haben dasselbe geändert. Ihre Änderung gilt.`,formulaProblem:`Es liegt ein Problem mit dieser Formel vor.`,columnName:`Die Spalte einer Tabelle braucht einen Namen.`,badSheetName:`Der Name eines Blatts hat höchstens 31 Zeichen und enthält keines von \\ / ? * [ ] :`,sheetTaken:`Ein Blatt hat bereits diesen Namen.`,lastSheet:`Eine Arbeitsmappe muss mindestens ein sichtbares Blatt behalten.`,tableHeader:`Die Kopfzeile einer Tabelle kann nicht gelöscht werden.`,badName:`Dieser Name kann nicht verwendet werden.`,badReference:`Der Bezug ist ungültig.`,overwrite:`Alle Zellen in dieser Spalte mit dieser Formel überschreiben`,dialog:{ok:`OK`,cancel:`Abbrechen`},number:{more:`Weitere Zahlenformate…`,accounting:`Buchhaltungszahlenformat`,percent:`Prozentformat`,comma:`Dezimaltrennzeichenformat`,increaseDecimal:`Dezimalstelle hinzufügen`,decreaseDecimal:`Dezimalstelle löschen`},borders:{title:`Rahmen`,bottom:`Rahmenlinie unten`,top:`Rahmenlinie oben`,left:`Rahmenlinie links`,right:`Rahmenlinie rechts`,none:`Kein Rahmen`,all:`Alle Rahmenlinien`,outside:`Rahmenlinien außen`,thickOutside:`Dicke Rahmenlinien außen`,bottomDouble:`Doppelte Rahmenlinie unten`,thickBottom:`Dicke Rahmenlinie unten`,topBottom:`Rahmenlinie oben und unten`,topThickBottom:`Rahmenlinie oben und dicke Rahmenlinie unten`,topDoubleBottom:`Rahmenlinie oben und doppelte Rahmenlinie unten`,more:`Weitere Rahmenlinien…`},arrange:{cells:`Zellen`,mergeCenter:`Verbinden und zentrieren`,mergeMenu:`Verbindungsoptionen`,mergeAcross:`Verbinden über`,mergeCells:`Zellen verbinden`,unmerge:`Zellverbund aufheben`,mergeTable:`Zellen in einer Tabelle können nicht verbunden werden.`,mergeLoses:`Beim Verbinden von Zellen bleibt nur der Wert oben links erhalten, alle anderen Werte werden verworfen.`,format:`Format`,fitRows:`Zeilenhöhe automatisch anpassen`,fitColumns:`Spaltenbreite automatisch anpassen`,hideUnhide:`Ausblenden & Einblenden`,hideRows:`Zeilen ausblenden`,hideColumns:`Spalten ausblenden`,hideSheet:`Blatt ausblenden`,unhideRows:`Zeilen einblenden`,unhideColumns:`Spalten einblenden`,unhideSheet:`Blatt einblenden`,unhideEllipsis:`Einblenden…`,freezePanes:`Fenster fixieren`,unfreeze:`Fixierung aufheben`,freezeTopRow:`Oberste Zeile fixieren`,freezeFirstColumn:`Erste Spalte fixieren`,tabColor:`Registerfarbe`,noColor:`Keine Farbe`},sortFilter:{title:`Sortieren und Filtern`,customSort:`Benutzerdefiniertes Sortieren…`,filter:`Filtern`,clear:`Löschen`,reapply:`Erneut anwenden`,noData:`Wählen Sie eine Zelle in einem Bereich mit Daten aus, und versuchen Sie es erneut.`},filter:{aToZ:`Von A bis Z sortieren`,zToA:`Von Z bis A sortieren`,aToZShort:`A bis Z`,zToAShort:`Z bis A`,smallest:`Nach Größe sortieren (aufsteigend)`,largest:`Nach Größe sortieren (absteigend)`,oldest:`Vom Ältesten zum Neuesten sortieren`,newest:`Vom Neuesten zum Ältesten sortieren`,clearFrom:e=>`Filter löschen aus "${e}"`,search:`Suchen`,selectAll:`(Alles auswählen)`,blanks:`(Leere)`,found:(e,t)=>`${String(e)} von ${String(t)} Datensätzen gefunden`},sort:{title:`Sortieren`,addLevel:`Ebene hinzufügen`,deleteLevel:`Ebene löschen`,hasHeaders:`Daten haben Überschriften`,sortBy:`Sortieren nach`,thenBy:`Dann nach`,column:e=>`Spalte ${e}`},rules:{title:`Bedingte Formatierung`,highlight:`Regeln zum Hervorheben von Zellen`,topBottom:`Obere/untere Regeln`,greaterThan:`Größer als…`,lessThan:`Kleiner als…`,between:`Zwischen…`,equalTo:`Gleich…`,textContains:`Textinhalt…`,duplicateValues:`Doppelte Werte…`,top10:`Obere 10 Elemente…`,top10Percent:`Obere 10 %…`,bottom10:`Untere 10 Elemente…`,bottom10Percent:`Untere 10 %…`,aboveAverage:`Über dem Durchschnitt…`,belowAverage:`Unter dem Durchschnitt…`,dataBars:`Datenbalken`,colorScales:`Farbskalen`,iconSets:`Symbolsätze`,clearRules:`Regeln löschen`,clearSelected:`Regeln in ausgewählten Zellen löschen`,clearSheet:`Regeln im gesamten Blatt löschen`,greaterPrompt:`Zellen formatieren, die GRÖSSER SIND ALS:`,lessPrompt:`Zellen formatieren, die KLEINER SIND ALS:`,betweenPrompt:`Zellen formatieren, die ZWISCHEN diesen Werten liegen:`,equalPrompt:`Zellen formatieren, die GLEICH SIND:`,textPrompt:`Zellen formatieren, die den folgenden Text enthalten:`,duplicatePrompt:`Zellen formatieren, die Folgendes enthalten:`,topPrompt:`Zellen formatieren, die zu den OBEREN gehören:`,topPercentPrompt:`Zellen formatieren, die zu den OBEREN gehören (Prozent):`,bottomPrompt:`Zellen formatieren, die zu den UNTEREN gehören:`,bottomPercentPrompt:`Zellen formatieren, die zu den UNTEREN gehören (Prozent):`,abovePrompt:`Zellen formatieren, die ÜBER DEM DURCHSCHNITT liegen:`,belowPrompt:`Zellen formatieren, die UNTER DEM DURCHSCHNITT liegen:`,and:`und`,with:`mit`,duplicate:`Doppelte`,unique:`Eindeutige`,looks:{lightRed:`Hellrote Füllung mit dunkelrotem Text`,yellow:`Gelbe Füllung mit dunkelgelbem Text`,green:`Grüne Füllung mit dunkelgrünem Text`,lightRedFill:`Hellrote Füllung`,redText:`Roter Text`,redBorder:`Roter Rahmen`},scales:{greenYellowRed:`Grün - Gelb - Rot`,redYellowGreen:`Rot - Gelb - Grün`,blueWhiteRed:`Blau - Weiß - Rot`,whiteRed:`Weiß - Rot`,whiteGreen:`Weiß - Grün`},icons:{"3Arrows":`3 Pfeile`,"5Arrows":`5 Pfeile`,"3TrafficLights1":`3 Ampeln`,"4TrafficLights":`4 Ampeln`,"3Symbols":`3 Symbole`,"3Flags":`3 Flaggen`,"5Rating":`5 Bewertungen`}},validation:{title:`Datenüberprüfung`,clearAll:`Alle löschen`,settings:`Einstellungen`,inputMessage:`Eingabemeldung`,errorAlert:`Fehlermeldung`,allow:`Zulassen`,kinds:{any:`Jeden Wert`,whole:`Ganze Zahl`,decimal:`Dezimal`,list:`Liste`,date:`Datum`,time:`Zeit`,textLength:`Textlänge`,custom:`Benutzerdefiniert`},ignoreBlank:`Leere Zellen ignorieren`,dropdown:`Zellendropdown`,data:`Daten`,operators:{between:`zwischen`,notBetween:`nicht zwischen`,equal:`gleich`,notEqual:`ungleich`,greaterThan:`größer als`,lessThan:`kleiner als`,greaterThanOrEqual:`größer oder gleich`,lessThanOrEqual:`kleiner oder gleich`},source:`Quelle`,formula:`Formel`,minimum:`Minimum`,maximum:`Maximum`,value:`Wert`,showPrompt:`Eingabemeldung anzeigen, wenn Zelle ausgewählt wird`,titleWord:`Titel`,showError:`Fehlermeldung anzeigen, wenn ungültige Daten eingegeben wurden`,style:`Typ`,styles:{stop:`Stopp`,warning:`Warnung`,information:`Informationen`},errorMessage:`Fehlermeldung`,refusedTitle:`Wert nicht zulässig`,refused:`Dieser Wert entspricht nicht den für diese Zelle definierten Einschränkungen der Datenüberprüfung.`,retry:`Wiederholen`,no:`Nein`,yes:`Ja`,continue:`Fortsetzen?`},menu:{cut:`Ausschneiden`,copy:`Kopieren`,paste:`Einfügen`,pasteSpecial:`Inhalte einfügen`,values:`Werte`,formulas:`Formeln`,formats:`Formate`,entireRow:`Ganze Zeile`,entireColumn:`Ganze Spalte`,clearContents:`Inhalte löschen`,filter:`Filtern`,sort:`Sortieren`,filterByValue:`Nach dem Wert der ausgewählten Zelle filtern`,formatCells:`Zellen formatieren…`,pickFromList:`Dropdown-Auswahlliste…`,rowHeight:`Zeilenhöhe…`,columnWidth:`Spaltenbreite…`,rowHeightWord:`Zeilenhöhe`,columnWidthWord:`Spaltenbreite`,hide:`Ausblenden`,unhide:`Einblenden`,multiple:`Dieser Befehl kann nicht für Mehrfachauswahlen verwendet werden.`,tableMove:`Ein Teil der Kopfzeile einer Tabelle kann nicht verschoben werden.`},fill:{options:`AutoAusfüllen-Optionen`,copy:`Zellen kopieren`,series:`Datenreihe ausfüllen`},formatCells:{title:`Zellen formatieren`,tabs:{number:`Zahlen`,alignment:`Ausrichtung`,font:`Schrift`,border:`Rahmen`,fill:`Ausfüllen`},category:`Kategorie`,categories:{general:`Standard`,number:`Zahl`,currency:`Währung`,accounting:`Buchhaltung`,date:`Datum`,time:`Uhrzeit`,percentage:`Prozent`,fraction:`Bruch`,scientific:`Wissenschaft`,text:`Text`,custom:`Benutzerdefiniert`},sample:`Beispiel`,decimals:`Dezimalstellen`,thousands:`1000er-Trennzeichen verwenden (,)`,symbol:`Symbol`,none:`Keine`,negative:`Negative Zahlen`,type:`Typ`,horizontal:`Horizontal`,vertical:`Vertikal`,aligns:{general:`Standard`,left:`Links (Einzug)`,center:`Zentriert`,right:`Rechts (Einzug)`,fill:`Ausfüllen`,justify:`Blocksatz`,centerContinuous:`Über Auswahl zentrieren`,distributed:`Verteilt (Einzug)`},valigns:{top:`Oben`,center:`Zentriert`,bottom:`Unten`,justify:`Blocksatz`,distributed:`Verteilt`},indent:`Einzug`,orientation:`Grad`,shrink:`An Zellgröße anpassen`,strikethrough:`Durchgestrichen`,borderNone:`Keine`,borderOutline:`Außen`,borderInside:`Innen`,lineStyle:`Art`,lineColor:`Farbe`,lines:{thin:`Dünn`,hair:`Haarlinie`,dotted:`Gepunktet`,dashed:`Gestrichelt`,dashDot:`Strich-Punkt`,dashDotDot:`Strich-Punkt-Punkt`,medium:`Mittel`,mediumDashed:`Mittel gestrichelt`,mediumDashDot:`Mittel Strich-Punkt`,thick:`Dick`,double:`Doppelt`},edges:{top:`Oben`,horizontal:`Innen horizontal`,bottom:`Unten`,left:`Links`,vertical:`Innen vertikal`,right:`Rechts`}},chart:{insert:`Diagramm einfügen`,design:`Diagrammentwurf`,changeType:`Diagrammtyp ändern`,selectData:`Daten auswählen`,dataRange:`Diagrammdatenbereich`,title:`Diagrammtitel`,legend:`Legende`,legendNone:`Keine`,legendAt:{right:`Rechts`,top:`Oben`,left:`Links`,bottom:`Unten`},noData:`Dieser Bereich enthält keine Zahlen für ein Diagramm.`,buttons:{columnBar:`Säulen- oder Balkendiagramm einfügen`,lineArea:`Linien- oder Flächendiagramm einfügen`,pieDoughnut:`Kreis- oder Ringdiagramm einfügen`,scatter:`Punktdiagramm (X, Y) einfügen`},groups:{column2d:`2D-Säule`,bar2d:`2D-Balken`,line2d:`2D-Linie`,area2d:`2D-Fläche`,pie2d:`2D-Kreis`,doughnut:`Ring`,scatter:`Punkt (X, Y)`},types:{"column-clustered":`Gruppierte Säulen`,"column-stacked":`Gestapelte Säulen`,"column-stacked-100":`100 % gestapelte Säulen`,"bar-clustered":`Gruppierte Balken`,"bar-stacked":`Gestapelte Balken`,"bar-stacked-100":`100 % gestapelte Balken`,line:`Linie`,"line-markers":`Linie mit Datenpunkten`,area:`Fläche`,"area-stacked":`Gestapelte Fläche`,"area-stacked-100":`100 % gestapelte Fläche`,pie:`Kreis`,doughnut:`Ring`,scatter:`Punkte`,"scatter-lines":`Punkte mit geraden Linien und Datenpunkten`,"scatter-smooth":`Punkte mit interpolierten Linien`},name:e=>`Diagramm ${String(e)}`},spillBlocked:`Überlaufbereich ist nicht leer`},it:{loading:`Apertura…`,unreadable:`Impossibile mostrare questo foglio: il suo sheet.yaml non è leggibile. Ecco cosa non va.`,generated:{line:`sheet.ts crea questo foglio`,title:`Questo foglio è protetto`,refused:`La cella o il grafico che si sta tentando di modificare si trova in un foglio protetto: lo crea sheet.ts.`,ask:e=>e===void 0?`Chiedi all'agente`:`Chiedi a ${e}`,ordinary:`Rendi foglio normale`,copied:`Copiato: incollalo nel tuo agente.`,failed:`sheet.ts non viene eseguito: i fogli che crea restano com’erano.`},scenario:{manager:`Gestione scenari`,scenarios:`Scenari:`,changing:`Celle da modificare:`,show:`Mostra`,close:`Chiudi`,base:`Caso base`,showing:`visualizzato`,on:e=>`Scenario: ${e}`},files:{insert:`Inserisci file…`,open:`Apri`,remove:`Rimuovi dalla cella`,notColumn:`Questa colonna non contiene file.`},undo:`Annulla`,redo:`Ripeti`,font:`Tipo di carattere`,fontSize:`Dimensione carattere`,bold:`Grassetto`,italic:`Corsivo`,underline:`Sottolineato`,fillColor:`Colore riempimento`,fontColor:`Colore carattere`,noFill:`Nessun riempimento`,automatic:`Automatico`,alignLeft:`Allinea a sinistra`,center:`Centra`,alignRight:`Allinea a destra`,wrapText:`Testo a capo`,numberFormat:`Formato numero`,custom:`Personalizzato`,formats:{general:`Generale`,number:`Numero`,currency:`Valuta`,accounting:`Contabilità`,shortDate:`Data in formato breve`,longDate:`Data in formato esteso`,time:`Ora`,percentage:`Percentuale`,fraction:`Frazione`,scientific:`Scientifico`,text:`Testo`},insert:`Inserisci`,delete:`Elimina`,insertRows:`Inserisci righe foglio`,insertColumns:`Inserisci colonne foglio`,insertSheet:`Inserisci foglio`,deleteRows:`Elimina righe foglio`,deleteColumns:`Elimina colonne foglio`,deleteSheet:`Elimina foglio`,nameBox:`Casella nome`,formulaBar:`Barra della formula`,cancel:`Annulla`,enter:`Invio`,insertFunction:`Inserisci funzione`,sheetTabs:`Fogli`,newSheet:`Nuovo foglio`,allSheets:`Tutti i fogli`,sheetMenu:`Menu del foglio`,zoom:`Zoom`,zoomIn:`Ingrandisci`,zoomOut:`Riduci`,duplicate:`Duplica`,namesList:`Nomi`,rename:`Rinomina`,sheetName:e=>`Foglio${String(e)}`,average:`Media`,count:`Conteggio`,sum:`Somma`,changed:(e,t)=>`${e} ha modificato ${String(t)} ${t===1?`elemento`:`elementi`}`,changedElsewhere:e=>`${String(e)} ${e===1?`modifica`:`modifiche`} da altrove`,previous:`Precedente`,next:`Successivo`,keep:`Mantieni`,keepAll:`Mantieni tutto`,undoAll:`Annulla tutto`,was:e=>`era ${e}`,rowAdded:`riga aggiunta`,rowRemoved:`riga rimossa`,fileChanged:`righe riscritte`,bothChanged:e=>`Tu e ${e} avete modificato la stessa cosa. Vale la tua modifica.`,formulaProblem:`Si è verificato un problema con questa formula.`,columnName:`La colonna di una tabella ha bisogno di un nome.`,badSheetName:`Il nome di un foglio ha al massimo 31 caratteri e non contiene \\ / ? * [ ] :`,sheetTaken:`Esiste già un foglio con questo nome.`,lastSheet:`Una cartella di lavoro deve avere almeno un foglio visibile.`,tableHeader:`La riga di intestazione di una tabella non può essere eliminata.`,badName:`Questo nome non può essere usato.`,badReference:`Il riferimento non è valido.`,overwrite:`Sovrascrivi tutte le celle di questa colonna con questa formula`,dialog:{ok:`OK`,cancel:`Annulla`},number:{more:`Altri formati numeri…`,accounting:`Formato numero contabilità`,percent:`Stile percentuale`,comma:`Stile separatore`,increaseDecimal:`Aumenta decimali`,decreaseDecimal:`Diminuisci decimali`},borders:{title:`Bordi`,bottom:`Bordo inferiore`,top:`Bordo superiore`,left:`Bordo sinistro`,right:`Bordo destro`,none:`Nessun bordo`,all:`Tutti i bordi`,outside:`Bordi esterni`,thickOutside:`Bordi esterni spessi`,bottomDouble:`Doppio bordo inferiore`,thickBottom:`Bordo inferiore spesso`,topBottom:`Bordo superiore e inferiore`,topThickBottom:`Bordo superiore e inferiore spesso`,topDoubleBottom:`Bordo superiore e inferiore doppio`,more:`Altri bordi…`},arrange:{cells:`Celle`,mergeCenter:`Unisci e allinea al centro`,mergeMenu:`Opzioni di unione`,mergeAcross:`Unisci orizzontalmente`,mergeCells:`Unisci celle`,unmerge:`Separa celle`,mergeTable:`Le celle di una tabella non possono essere unite.`,mergeLoses:`L’unione delle celle mantiene solo il valore superiore sinistro ed elimina gli altri valori.`,format:`Formato`,fitRows:`Adatta altezza righe`,fitColumns:`Adatta larghezza colonne`,hideUnhide:`Nascondi e scopri`,hideRows:`Nascondi righe`,hideColumns:`Nascondi colonne`,hideSheet:`Nascondi foglio`,unhideRows:`Scopri righe`,unhideColumns:`Scopri colonne`,unhideSheet:`Scopri foglio`,unhideEllipsis:`Scopri…`,freezePanes:`Blocca riquadri`,unfreeze:`Sblocca riquadri`,freezeTopRow:`Blocca riga superiore`,freezeFirstColumn:`Blocca prima colonna`,tabColor:`Colore scheda`,noColor:`Nessun colore`},sortFilter:{title:`Ordina e filtra`,customSort:`Ordinamento personalizzato…`,filter:`Filtro`,clear:`Cancella`,reapply:`Riapplica`,noData:`Seleziona una cella in un intervallo che contiene dati e riprova.`},filter:{aToZ:`Ordina dalla A alla Z`,zToA:`Ordina dalla Z alla A`,aToZShort:`Dalla A alla Z`,zToAShort:`Dalla Z alla A`,smallest:`Ordina dal più piccolo al più grande`,largest:`Ordina dal più grande al più piccolo`,oldest:`Ordina dal meno recente al più recente`,newest:`Ordina dal più recente al meno recente`,clearFrom:e=>`Cancella filtro da "${e}"`,search:`Cerca`,selectAll:`(Seleziona tutto)`,blanks:`(Vuote)`,found:(e,t)=>`${String(e)} di ${String(t)} record trovati`},sort:{title:`Ordina`,addLevel:`Aggiungi livello`,deleteLevel:`Elimina livello`,hasHeaders:`Dati con intestazioni`,sortBy:`Ordina per`,thenBy:`Quindi per`,column:e=>`Colonna ${e}`},rules:{title:`Formattazione condizionale`,highlight:`Regole evidenziazione celle`,topBottom:`Regole primi/ultimi`,greaterThan:`Maggiore di…`,lessThan:`Minore di…`,between:`Tra…`,equalTo:`Uguale a…`,textContains:`Testo contenente…`,duplicateValues:`Valori duplicati…`,top10:`Primi 10 elementi…`,top10Percent:`Primo 10%…`,bottom10:`Ultimi 10 elementi…`,bottom10Percent:`Ultimo 10%…`,aboveAverage:`Sopra la media…`,belowAverage:`Sotto la media…`,dataBars:`Barre dei dati`,colorScales:`Scale di colori`,iconSets:`Set di icone`,clearRules:`Cancella regole`,clearSelected:`Cancella regole dalle celle selezionate`,clearSheet:`Cancella regole dall’intero foglio`,greaterPrompt:`Formatta celle con valore MAGGIORE DI:`,lessPrompt:`Formatta celle con valore MINORE DI:`,betweenPrompt:`Formatta celle con valore TRA:`,equalPrompt:`Formatta celle con valore UGUALE A:`,textPrompt:`Formatta celle che contengono il testo:`,duplicatePrompt:`Formatta celle che contengono:`,topPrompt:`Formatta celle nelle PRIME posizioni:`,topPercentPrompt:`Formatta celle nelle PRIME posizioni (percentuale):`,bottomPrompt:`Formatta celle nelle ULTIME posizioni:`,bottomPercentPrompt:`Formatta celle nelle ULTIME posizioni (percentuale):`,abovePrompt:`Formatta celle SOPRA LA MEDIA:`,belowPrompt:`Formatta celle SOTTO LA MEDIA:`,and:`e`,with:`con`,duplicate:`Duplicati`,unique:`Univoci`,looks:{lightRed:`Riempimento rosso chiaro con testo rosso scuro`,yellow:`Riempimento giallo con testo giallo scuro`,green:`Riempimento verde con testo verde scuro`,lightRedFill:`Riempimento rosso chiaro`,redText:`Testo rosso`,redBorder:`Bordo rosso`},scales:{greenYellowRed:`Verde - Giallo - Rosso`,redYellowGreen:`Rosso - Giallo - Verde`,blueWhiteRed:`Blu - Bianco - Rosso`,whiteRed:`Bianco - Rosso`,whiteGreen:`Bianco - Verde`},icons:{"3Arrows":`3 frecce`,"5Arrows":`5 frecce`,"3TrafficLights1":`3 semafori`,"4TrafficLights":`4 semafori`,"3Symbols":`3 simboli`,"3Flags":`3 bandiere`,"5Rating":`5 valutazioni`}},validation:{title:`Convalida dati`,clearAll:`Cancella tutto`,settings:`Impostazioni`,inputMessage:`Messaggio di input`,errorAlert:`Messaggio di errore`,allow:`Consenti`,kinds:{any:`Qualsiasi valore`,whole:`Numero intero`,decimal:`Decimale`,list:`Elenco`,date:`Data`,time:`Ora`,textLength:`Lunghezza testo`,custom:`Personalizzato`},ignoreBlank:`Ignora celle vuote`,dropdown:`Elenco nella cella`,data:`Dati`,operators:{between:`tra`,notBetween:`non compreso tra`,equal:`uguale a`,notEqual:`diverso da`,greaterThan:`maggiore di`,lessThan:`minore di`,greaterThanOrEqual:`maggiore o uguale a`,lessThanOrEqual:`minore o uguale a`},source:`Origine`,formula:`Formula`,minimum:`Minimo`,maximum:`Massimo`,value:`Valore`,showPrompt:`Mostra messaggio di input quando viene selezionata la cella`,titleWord:`Titolo`,showError:`Mostra messaggio di errore dopo l’immissione di dati non validi`,style:`Stile`,styles:{stop:`Interruzione`,warning:`Avviso`,information:`Informazioni`},errorMessage:`Messaggio di errore`,refusedTitle:`Valore non consentito`,refused:`Questo valore non corrisponde alle restrizioni di convalida dati definite per questa cella.`,retry:`Riprova`,no:`No`,yes:`Sì`,continue:`Continuare?`},menu:{cut:`Taglia`,copy:`Copia`,paste:`Incolla`,pasteSpecial:`Incolla speciale`,values:`Valori`,formulas:`Formule`,formats:`Formati`,entireRow:`Riga intera`,entireColumn:`Colonna intera`,clearContents:`Cancella contenuto`,filter:`Filtro`,sort:`Ordina`,filterByValue:`Filtra per valore della cella selezionata`,formatCells:`Formato celle…`,pickFromList:`Seleziona da elenco a discesa…`,rowHeight:`Altezza righe…`,columnWidth:`Larghezza colonne…`,rowHeightWord:`Altezza righe`,columnWidthWord:`Larghezza colonne`,hide:`Nascondi`,unhide:`Scopri`,multiple:`Questo comando non può essere usato su selezioni multiple.`,tableMove:`Non è possibile spostare parte dell’intestazione di una tabella.`},fill:{options:`Opzioni di riempimento automatico`,copy:`Copia celle`,series:`Serie di riempimento`},formatCells:{title:`Formato celle`,tabs:{number:`Numero`,alignment:`Allineamento`,font:`Carattere`,border:`Bordo`,fill:`Riempimento`},category:`Categoria`,categories:{general:`Generale`,number:`Numero`,currency:`Valuta`,accounting:`Contabilità`,date:`Data`,time:`Ora`,percentage:`Percentuale`,fraction:`Frazione`,scientific:`Scientifico`,text:`Testo`,custom:`Personalizzato`},sample:`Esempio`,decimals:`Posizioni decimali`,thousands:`Usa separatore delle migliaia (,)`,symbol:`Simbolo`,none:`Nessuno`,negative:`Numeri negativi`,type:`Tipo`,horizontal:`Orizzontale`,vertical:`Verticale`,aligns:{general:`Generale`,left:`Sinistra (Rientro)`,center:`Al centro`,right:`Destra (Rientro)`,fill:`Riempi`,justify:`Giustifica`,centerContinuous:`Allinea al centro della selezione`,distributed:`Distribuito (Rientro)`},valigns:{top:`In alto`,center:`Al centro`,bottom:`In basso`,justify:`Giustifica`,distributed:`Distribuito`},indent:`Rientro`,orientation:`Gradi`,shrink:`Riduci e adatta`,strikethrough:`Barrato`,borderNone:`Nessuno`,borderOutline:`Bordato`,borderInside:`Interno`,lineStyle:`Stile`,lineColor:`Colore`,lines:{thin:`Sottile`,hair:`Molto sottile`,dotted:`Punteggiato`,dashed:`Tratteggiato`,dashDot:`Tratto punto`,dashDotDot:`Tratto punto punto`,medium:`Medio`,mediumDashed:`Medio tratteggiato`,mediumDashDot:`Medio tratto punto`,thick:`Spesso`,double:`Doppio`},edges:{top:`In alto`,horizontal:`Interno orizzontale`,bottom:`In basso`,left:`A sinistra`,vertical:`Interno verticale`,right:`A destra`}},chart:{insert:`Inserisci grafico`,design:`Progettazione grafico`,changeType:`Cambia tipo di grafico`,selectData:`Seleziona dati`,dataRange:`Intervallo dati del grafico`,title:`Titolo del grafico`,legend:`Legenda`,legendNone:`Nessuna`,legendAt:{right:`Destra`,top:`In alto`,left:`Sinistra`,bottom:`In basso`},noData:`L'intervallo non contiene numeri da rappresentare.`,buttons:{columnBar:`Inserisci istogramma o grafico a barre`,lineArea:`Inserisci grafico a linee o ad area`,pieDoughnut:`Inserisci grafico a torta o ad anello`,scatter:`Inserisci grafico a dispersione (X, Y)`},groups:{column2d:`Istogramma 2D`,bar2d:`Barre 2D`,line2d:`Linee 2D`,area2d:`Aree 2D`,pie2d:`Torta 2D`,doughnut:`Anello`,scatter:`Dispersione`},types:{"column-clustered":`Colonne raggruppate`,"column-stacked":`Colonne in pila`,"column-stacked-100":`Colonne in pila 100%`,"bar-clustered":`Barre raggruppate`,"bar-stacked":`Barre in pila`,"bar-stacked-100":`Barre in pila 100%`,line:`Linee`,"line-markers":`Linee con indicatori`,area:`Aree`,"area-stacked":`Aree in pila`,"area-stacked-100":`Aree in pila 100%`,pie:`Torta`,doughnut:`Anello`,scatter:`Dispersione`,"scatter-lines":`Dispersione con linee rette e indicatori`,"scatter-smooth":`Dispersione con linee smussate`},name:e=>`Grafico ${String(e)}`},spillBlocked:`L'intervallo di espansione non è vuoto`},pt:{loading:`Abrindo…`,unreadable:`Não é possível mostrar esta planilha: o sheet.yaml dela não pode ser lido. Veja o que está errado.`,generated:{line:`sheet.ts cria esta planilha`,title:`Esta planilha está protegida`,refused:`A célula ou o gráfico que você está tentando alterar está em uma planilha protegida: sheet.ts a cria.`,ask:e=>e===void 0?`Perguntar ao agente`:`Perguntar a ${e}`,ordinary:`Tornar planilha comum`,copied:`Copiado: cole no seu agente.`,failed:`sheet.ts não executa: as planilhas que ele cria ficam como estavam.`},scenario:{manager:`Gerenciador de Cenários`,scenarios:`Cenários:`,changing:`Células variáveis:`,show:`Mostrar`,close:`Fechar`,base:`Caso base`,showing:`em exibição`,on:e=>`Cenário: ${e}`},files:{insert:`Inserir Arquivo…`,open:`Abrir`,remove:`Remover da Célula`,notColumn:`Esta coluna não contém arquivos.`},undo:`Desfazer`,redo:`Refazer`,font:`Fonte`,fontSize:`Tamanho da Fonte`,bold:`Negrito`,italic:`Itálico`,underline:`Sublinhado`,fillColor:`Cor de Preenchimento`,fontColor:`Cor da Fonte`,noFill:`Sem Preenchimento`,automatic:`Automático`,alignLeft:`Alinhar à Esquerda`,center:`Centralizar`,alignRight:`Alinhar à Direita`,wrapText:`Quebrar Texto Automaticamente`,numberFormat:`Formato de Número`,custom:`Personalizado`,formats:{general:`Geral`,number:`Número`,currency:`Moeda`,accounting:`Contábil`,shortDate:`Data Abreviada`,longDate:`Data Completa`,time:`Hora`,percentage:`Porcentagem`,fraction:`Fração`,scientific:`Científico`,text:`Texto`},insert:`Inserir`,delete:`Excluir`,insertRows:`Inserir Linhas na Planilha`,insertColumns:`Inserir Colunas na Planilha`,insertSheet:`Inserir Planilha`,deleteRows:`Excluir Linhas da Planilha`,deleteColumns:`Excluir Colunas da Planilha`,deleteSheet:`Excluir Planilha`,nameBox:`Caixa de Nome`,formulaBar:`Barra de Fórmulas`,cancel:`Cancelar`,enter:`Enter`,insertFunction:`Inserir Função`,sheetTabs:`Planilhas`,newSheet:`Nova planilha`,allSheets:`Todas as planilhas`,sheetMenu:`Menu da planilha`,zoom:`Zoom`,zoomIn:`Ampliar`,zoomOut:`Reduzir`,duplicate:`Duplicar`,namesList:`Nomes`,rename:`Renomear`,sheetName:e=>`Planilha${String(e)}`,average:`Média`,count:`Contagem`,sum:`Soma`,changed:(e,t)=>`${e} alterou ${String(t)} ${t===1?`item`:`itens`}`,changedElsewhere:e=>`${String(e)} ${e===1?`alteração`:`alterações`} de outro lugar`,previous:`Anterior`,next:`Próxima`,keep:`Manter`,keepAll:`Manter tudo`,undoAll:`Desfazer tudo`,was:e=>`era ${e}`,rowAdded:`linha adicionada`,rowRemoved:`linha removida`,fileChanged:`linhas reescritas`,bothChanged:e=>`Você e ${e} alteraram a mesma coisa. A sua alteração prevalece.`,formulaProblem:`Há um problema com esta fórmula.`,columnName:`A coluna de uma tabela precisa de um nome.`,badSheetName:`O nome de uma planilha tem no máximo 31 caracteres e não pode conter \\ / ? * [ ] :`,sheetTaken:`Já existe uma planilha com esse nome.`,lastSheet:`Uma pasta de trabalho deve manter pelo menos uma planilha visível.`,tableHeader:`A linha de cabeçalho de uma tabela não pode ser excluída.`,badName:`Esse nome não pode ser usado.`,badReference:`A referência não é válida.`,overwrite:`Substituir todas as células desta coluna por esta fórmula`,dialog:{ok:`OK`,cancel:`Cancelar`},number:{more:`Mais Formatos de Número…`,accounting:`Formato de Número de Contabilização`,percent:`Estilo de Porcentagem`,comma:`Separador de Milhares`,increaseDecimal:`Aumentar Casas Decimais`,decreaseDecimal:`Diminuir Casas Decimais`},borders:{title:`Bordas`,bottom:`Borda Inferior`,top:`Borda Superior`,left:`Borda Esquerda`,right:`Borda Direita`,none:`Sem Borda`,all:`Todas as Bordas`,outside:`Bordas Externas`,thickOutside:`Borda Externa Espessa`,bottomDouble:`Borda Inferior Dupla`,thickBottom:`Borda Inferior Espessa`,topBottom:`Borda Superior e Inferior`,topThickBottom:`Borda Superior e Inferior Espessa`,topDoubleBottom:`Borda Superior e Inferior Dupla`,more:`Mais Bordas…`},arrange:{cells:`Células`,mergeCenter:`Mesclar e Centralizar`,mergeMenu:`Opções de mesclagem`,mergeAcross:`Mesclar Através`,mergeCells:`Mesclar Células`,unmerge:`Desfazer Mesclagem de Células`,mergeTable:`Células em uma tabela não podem ser mescladas.`,mergeLoses:`A mesclagem de células mantém apenas o valor superior esquerdo e descarta os outros valores.`,format:`Formatar`,fitRows:`AutoAjuste da Altura da Linha`,fitColumns:`AutoAjuste da Largura da Coluna`,hideUnhide:`Ocultar e Reexibir`,hideRows:`Ocultar Linhas`,hideColumns:`Ocultar Colunas`,hideSheet:`Ocultar Planilha`,unhideRows:`Reexibir Linhas`,unhideColumns:`Reexibir Colunas`,unhideSheet:`Reexibir Planilha`,unhideEllipsis:`Reexibir…`,freezePanes:`Congelar Painéis`,unfreeze:`Descongelar Painéis`,freezeTopRow:`Congelar Linha Superior`,freezeFirstColumn:`Congelar Primeira Coluna`,tabColor:`Cor da Guia`,noColor:`Sem Cor`},sortFilter:{title:`Classificar e Filtrar`,customSort:`Classificação Personalizada…`,filter:`Filtro`,clear:`Limpar`,reapply:`Reaplicar`,noData:`Selecione uma célula em um intervalo com dados e tente novamente.`},filter:{aToZ:`Classificar de A a Z`,zToA:`Classificar de Z a A`,aToZShort:`De A a Z`,zToAShort:`De Z a A`,smallest:`Classificar do Menor para o Maior`,largest:`Classificar do Maior para o Menor`,oldest:`Classificar do Mais Antigo para o Mais Novo`,newest:`Classificar do Mais Novo para o Mais Antigo`,clearFrom:e=>`Limpar Filtro de "${e}"`,search:`Pesquisar`,selectAll:`(Selecionar Tudo)`,blanks:`(Vazias)`,found:(e,t)=>`${String(e)} de ${String(t)} registros encontrados`},sort:{title:`Classificar`,addLevel:`Adicionar Nível`,deleteLevel:`Excluir Nível`,hasHeaders:`Meus dados contêm cabeçalhos`,sortBy:`Classificar por`,thenBy:`E depois por`,column:e=>`Coluna ${e}`},rules:{title:`Formatação Condicional`,highlight:`Regras de Realce das Células`,topBottom:`Regras de Primeiros/Últimos`,greaterThan:`É Maior do que…`,lessThan:`É Menor do que…`,between:`Está Entre…`,equalTo:`É Igual a…`,textContains:`Texto que Contém…`,duplicateValues:`Valores Duplicados…`,top10:`10 Primeiros Itens…`,top10Percent:`Primeiros 10%…`,bottom10:`10 Últimos Itens…`,bottom10Percent:`Últimos 10%…`,aboveAverage:`Acima da Média…`,belowAverage:`Abaixo da Média…`,dataBars:`Barras de Dados`,colorScales:`Escalas de Cor`,iconSets:`Conjuntos de Ícones`,clearRules:`Limpar Regras`,clearSelected:`Limpar Regras das Células Selecionadas`,clearSheet:`Limpar Regras da Planilha Inteira`,greaterPrompt:`Formatar células que são MAIORES DO QUE:`,lessPrompt:`Formatar células que são MENORES DO QUE:`,betweenPrompt:`Formatar células que estão ENTRE:`,equalPrompt:`Formatar células que são IGUAIS A:`,textPrompt:`Formatar células que contêm o texto:`,duplicatePrompt:`Formatar células que contêm:`,topPrompt:`Formatar células classificadas entre as PRIMEIRAS:`,topPercentPrompt:`Formatar células classificadas entre as PRIMEIRAS (percentual):`,bottomPrompt:`Formatar células classificadas entre as ÚLTIMAS:`,bottomPercentPrompt:`Formatar células classificadas entre as ÚLTIMAS (percentual):`,abovePrompt:`Formatar células que estão ACIMA DA MÉDIA:`,belowPrompt:`Formatar células que estão ABAIXO DA MÉDIA:`,and:`e`,with:`com`,duplicate:`Duplicados`,unique:`Exclusivos`,looks:{lightRed:`Preenchimento Vermelho Claro e Texto Vermelho Escuro`,yellow:`Preenchimento Amarelo e Texto Amarelo Escuro`,green:`Preenchimento Verde e Texto Verde Escuro`,lightRedFill:`Preenchimento Vermelho Claro`,redText:`Texto Vermelho`,redBorder:`Borda Vermelha`},scales:{greenYellowRed:`Verde - Amarelo - Vermelho`,redYellowGreen:`Vermelho - Amarelo - Verde`,blueWhiteRed:`Azul - Branco - Vermelho`,whiteRed:`Branco - Vermelho`,whiteGreen:`Branco - Verde`},icons:{"3Arrows":`3 Setas`,"5Arrows":`5 Setas`,"3TrafficLights1":`3 Semáforos`,"4TrafficLights":`4 Semáforos`,"3Symbols":`3 Símbolos`,"3Flags":`3 Bandeiras`,"5Rating":`5 Classificações`}},validation:{title:`Validação de Dados`,clearAll:`Limpar Tudo`,settings:`Configurações`,inputMessage:`Mensagem de Entrada`,errorAlert:`Alerta de Erro`,allow:`Permitir`,kinds:{any:`Qualquer valor`,whole:`Número inteiro`,decimal:`Decimal`,list:`Lista`,date:`Data`,time:`Hora`,textLength:`Comprimento do texto`,custom:`Personalizado`},ignoreBlank:`Ignorar em branco`,dropdown:`Menu suspenso na célula`,data:`Dados`,operators:{between:`entre`,notBetween:`não está entre`,equal:`igual a`,notEqual:`diferente de`,greaterThan:`maior do que`,lessThan:`menor do que`,greaterThanOrEqual:`maior ou igual a`,lessThanOrEqual:`menor ou igual a`},source:`Fonte`,formula:`Fórmula`,minimum:`Mínimo`,maximum:`Máximo`,value:`Valor`,showPrompt:`Mostrar mensagem de entrada ao selecionar célula`,titleWord:`Título`,showError:`Mostrar alerta de erro após a inserção de dados inválidos`,style:`Estilo`,styles:{stop:`Parar`,warning:`Aviso`,information:`Informações`},errorMessage:`Mensagem de erro`,refusedTitle:`Valor não permitido`,refused:`Este valor não corresponde às restrições de validação de dados definidas para esta célula.`,retry:`Repetir`,no:`Não`,yes:`Sim`,continue:`Continuar?`},menu:{cut:`Recortar`,copy:`Copiar`,paste:`Colar`,pasteSpecial:`Colar Especial`,values:`Valores`,formulas:`Fórmulas`,formats:`Formatos`,entireRow:`Linha Inteira`,entireColumn:`Coluna Inteira`,clearContents:`Limpar Conteúdo`,filter:`Filtrar`,sort:`Classificar`,filterByValue:`Filtrar pelo Valor da Célula Selecionada`,formatCells:`Formatar Células…`,pickFromList:`Selecionar na Lista Suspensa…`,rowHeight:`Altura da Linha…`,columnWidth:`Largura da Coluna…`,rowHeightWord:`Altura da Linha`,columnWidthWord:`Largura da Coluna`,hide:`Ocultar`,unhide:`Reexibir`,multiple:`Esse comando não pode ser usado em seleções múltiplas.`,tableMove:`Parte do cabeçalho de uma tabela não pode ser movida.`},fill:{options:`Opções de AutoPreenchimento`,copy:`Copiar Células`,series:`Preencher Série`},formatCells:{title:`Formatar Células`,tabs:{number:`Número`,alignment:`Alinhamento`,font:`Fonte`,border:`Borda`,fill:`Preenchimento`},category:`Categoria`,categories:{general:`Geral`,number:`Número`,currency:`Moeda`,accounting:`Contábil`,date:`Data`,time:`Hora`,percentage:`Porcentagem`,fraction:`Fração`,scientific:`Científico`,text:`Texto`,custom:`Personalizado`},sample:`Exemplo`,decimals:`Casas decimais`,thousands:`Usar Separador de 1000 (,)`,symbol:`Símbolo`,none:`Nenhum`,negative:`Números negativos`,type:`Tipo`,horizontal:`Horizontal`,vertical:`Vertical`,aligns:{general:`Geral`,left:`Esquerda (Recuo)`,center:`Centro`,right:`Direita (Recuo)`,fill:`Preencher`,justify:`Justificar`,centerContinuous:`Centralizar Seleção`,distributed:`Distribuído (Recuo)`},valigns:{top:`Superior`,center:`Centro`,bottom:`Inferior`,justify:`Justificar`,distributed:`Distribuído`},indent:`Recuo`,orientation:`Graus`,shrink:`Reduzir para caber`,strikethrough:`Tachado`,borderNone:`Nenhuma`,borderOutline:`Contorno`,borderInside:`Interna`,lineStyle:`Estilo`,lineColor:`Cor`,lines:{thin:`Fina`,hair:`Muito Fina`,dotted:`Pontilhada`,dashed:`Tracejada`,dashDot:`Traço Ponto`,dashDotDot:`Traço Ponto Ponto`,medium:`Média`,mediumDashed:`Média Tracejada`,mediumDashDot:`Média Traço Ponto`,thick:`Espessa`,double:`Dupla`},edges:{top:`Superior`,horizontal:`Interna Horizontal`,bottom:`Inferior`,left:`Esquerda`,vertical:`Interna Vertical`,right:`Direita`}},chart:{insert:`Inserir Gráfico`,design:`Design do Gráfico`,changeType:`Alterar Tipo de Gráfico`,selectData:`Selecionar Dados`,dataRange:`Intervalo de dados do gráfico`,title:`Título do Gráfico`,legend:`Legenda`,legendNone:`Nenhuma`,legendAt:{right:`À Direita`,top:`Superior`,left:`À Esquerda`,bottom:`Inferior`},noData:`Esse intervalo não tem números para o gráfico.`,buttons:{columnBar:`Inserir Gráfico de Colunas ou de Barras`,lineArea:`Inserir Gráfico de Linhas ou de Áreas`,pieDoughnut:`Inserir Gráfico de Pizza ou de Rosca`,scatter:`Inserir Gráfico de Dispersão (X, Y)`},groups:{column2d:`Coluna 2D`,bar2d:`Barra 2D`,line2d:`Linha 2D`,area2d:`Área 2D`,pie2d:`Pizza 2D`,doughnut:`Rosca`,scatter:`Dispersão`},types:{"column-clustered":`Colunas Agrupadas`,"column-stacked":`Colunas Empilhadas`,"column-stacked-100":`Colunas 100% Empilhadas`,"bar-clustered":`Barras Agrupadas`,"bar-stacked":`Barras Empilhadas`,"bar-stacked-100":`Barras 100% Empilhadas`,line:`Linhas`,"line-markers":`Linhas com Marcadores`,area:`Área`,"area-stacked":`Área Empilhada`,"area-stacked-100":`Área 100% Empilhada`,pie:`Pizza`,doughnut:`Rosca`,scatter:`Dispersão`,"scatter-lines":`Dispersão com Linhas Retas e Marcadores`,"scatter-smooth":`Dispersão com Linhas Suaves`},name:e=>`Gráfico ${String(e)}`},spillBlocked:`O intervalo de despejo não está em branco`},ru:{loading:`Открытие…`,unreadable:`Этот лист нельзя показать: не удаётся прочитать его sheet.yaml. Вот в чём ошибка.`,generated:{line:`Этот лист создаёт sheet.ts`,title:`Этот лист защищён`,refused:`Ячейка или диаграмма, которую вы пытаетесь изменить, находится на защищённом листе: его создаёт sheet.ts.`,ask:e=>e===void 0?`Спросить агента`:`Спросить ${e}`,ordinary:`Сделать обычным листом`,copied:`Скопировано: вставьте это своему агенту.`,failed:`sheet.ts не запускается: созданные им листы остаются прежними.`},scenario:{manager:`Диспетчер сценариев`,scenarios:`Сценарии:`,changing:`Изменяемые ячейки:`,show:`Вывести`,close:`Закрыть`,base:`Базовый вариант`,showing:`показан`,on:e=>`Сценарий: ${e}`},files:{insert:`Вставить файл…`,open:`Открыть`,remove:`Убрать из ячейки`,notColumn:`В этом столбце нет файлов.`},undo:`Отменить`,redo:`Вернуть`,font:`Шрифт`,fontSize:`Размер шрифта`,bold:`Полужирный`,italic:`Курсив`,underline:`Подчёркнутый`,fillColor:`Цвет заливки`,fontColor:`Цвет шрифта`,noFill:`Нет заливки`,automatic:`Авто`,alignLeft:`По левому краю`,center:`По центру`,alignRight:`По правому краю`,wrapText:`Переносить текст`,numberFormat:`Числовой формат`,custom:`(все форматы)`,formats:{general:`Общий`,number:`Числовой`,currency:`Денежный`,accounting:`Финансовый`,shortDate:`Краткий формат даты`,longDate:`Длинный формат даты`,time:`Время`,percentage:`Процентный`,fraction:`Дробный`,scientific:`Экспоненциальный`,text:`Текстовый`},insert:`Вставить`,delete:`Удалить`,insertRows:`Вставить строки на лист`,insertColumns:`Вставить столбцы на лист`,insertSheet:`Вставить лист`,deleteRows:`Удалить строки с листа`,deleteColumns:`Удалить столбцы с листа`,deleteSheet:`Удалить лист`,nameBox:`Поле имени`,formulaBar:`Строка формул`,cancel:`Отмена`,enter:`Ввод`,insertFunction:`Вставить функцию`,sheetTabs:`Листы`,newSheet:`Новый лист`,allSheets:`Все листы`,sheetMenu:`Меню листа`,zoom:`Масштаб`,zoomIn:`Увеличить`,zoomOut:`Уменьшить`,duplicate:`Дублировать`,namesList:`Имена`,rename:`Переименовать`,sheetName:e=>`Лист${String(e)}`,average:`Среднее`,count:`Количество`,sum:`Сумма`,changed:(e,t)=>`${e}: изменений — ${String(t)}`,changedElsewhere:e=>`Изменений из других мест: ${String(e)}`,previous:`Назад`,next:`Далее`,keep:`Оставить`,keepAll:`Оставить все`,undoAll:`Отменить все`,was:e=>`было: ${e}`,rowAdded:`строка добавлена`,rowRemoved:`строка удалена`,fileChanged:`строки переписаны`,bothChanged:e=>`Вы и ${e} изменили одно и то же. Остаётся ваш вариант.`,formulaProblem:`Проблема с этой формулой.`,columnName:`Столбцу таблицы нужно имя.`,badSheetName:`Имя листа содержит не более 31 символа и не может включать \\ / ? * [ ] :`,sheetTaken:`Лист с таким именем уже есть.`,lastSheet:`В книге должен остаться хотя бы один видимый лист.`,tableHeader:`Строку заголовков таблицы нельзя удалить.`,badName:`Это имя использовать нельзя.`,badReference:`Недопустимая ссылка.`,overwrite:`Заменить все ячейки в этом столбце этой формулой`,dialog:{ok:`ОК`,cancel:`Отмена`},number:{more:`Другие числовые форматы…`,accounting:`Финансовый числовой формат`,percent:`Процентный формат`,comma:`Формат с разделителями`,increaseDecimal:`Увеличить разрядность`,decreaseDecimal:`Уменьшить разрядность`},borders:{title:`Границы`,bottom:`Нижняя граница`,top:`Верхняя граница`,left:`Левая граница`,right:`Правая граница`,none:`Нет границы`,all:`Все границы`,outside:`Внешние границы`,thickOutside:`Толстые внешние границы`,bottomDouble:`Двойная нижняя граница`,thickBottom:`Толстая нижняя граница`,topBottom:`Верхняя и нижняя границы`,topThickBottom:`Верхняя и толстая нижняя границы`,topDoubleBottom:`Верхняя и двойная нижняя границы`,more:`Другие границы…`},arrange:{cells:`Ячейки`,mergeCenter:`Объединить и поместить в центре`,mergeMenu:`Параметры объединения`,mergeAcross:`Объединить по строкам`,mergeCells:`Объединить ячейки`,unmerge:`Отменить объединение ячеек`,mergeTable:`Ячейки таблицы нельзя объединить.`,mergeLoses:`При объединении ячеек сохраняется только значение из левой верхней ячейки, остальные значения отбрасываются.`,format:`Формат`,fitRows:`Автоподбор высоты строки`,fitColumns:`Автоподбор ширины столбца`,hideUnhide:`Скрыть или отобразить`,hideRows:`Скрыть строки`,hideColumns:`Скрыть столбцы`,hideSheet:`Скрыть лист`,unhideRows:`Отобразить строки`,unhideColumns:`Отобразить столбцы`,unhideSheet:`Отобразить лист`,unhideEllipsis:`Показать…`,freezePanes:`Закрепить области`,unfreeze:`Снять закрепление областей`,freezeTopRow:`Закрепить верхнюю строку`,freezeFirstColumn:`Закрепить первый столбец`,tabColor:`Цвет ярлычка`,noColor:`Нет цвета`},sortFilter:{title:`Сортировка и фильтр`,customSort:`Настраиваемая сортировка…`,filter:`Фильтр`,clear:`Очистить`,reapply:`Применить повторно`,noData:`Выделите ячейку в диапазоне с данными и повторите попытку.`},filter:{aToZ:`Сортировка от А до Я`,zToA:`Сортировка от Я до А`,aToZShort:`От А до Я`,zToAShort:`От Я до А`,smallest:`Сортировка от минимального к максимальному`,largest:`Сортировка от максимального к минимальному`,oldest:`Сортировка от старых к новым`,newest:`Сортировка от новых к старым`,clearFrom:e=>`Удалить фильтр из столбца "${e}"`,search:`Поиск`,selectAll:`(Выделить все)`,blanks:`(Пустые)`,found:(e,t)=>`Найдено записей: ${String(e)} из ${String(t)}`},sort:{title:`Сортировка`,addLevel:`Добавить уровень`,deleteLevel:`Удалить уровень`,hasHeaders:`Мои данные содержат заголовки`,sortBy:`Сортировать по`,thenBy:`Затем по`,column:e=>`Столбец ${e}`},rules:{title:`Условное форматирование`,highlight:`Правила выделения ячеек`,topBottom:`Правила отбора первых и последних значений`,greaterThan:`Больше…`,lessThan:`Меньше…`,between:`Между…`,equalTo:`Равно…`,textContains:`Текст содержит…`,duplicateValues:`Повторяющиеся значения…`,top10:`Первые 10 элементов…`,top10Percent:`Первые 10%…`,bottom10:`Последние 10 элементов…`,bottom10Percent:`Последние 10%…`,aboveAverage:`Выше среднего…`,belowAverage:`Ниже среднего…`,dataBars:`Гистограммы`,colorScales:`Цветовые шкалы`,iconSets:`Наборы значков`,clearRules:`Удалить правила`,clearSelected:`Удалить правила из выделенных ячеек`,clearSheet:`Удалить правила со всего листа`,greaterPrompt:`Форматировать ячейки, которые БОЛЬШЕ:`,lessPrompt:`Форматировать ячейки, которые МЕНЬШЕ:`,betweenPrompt:`Форматировать ячейки, которые находятся МЕЖДУ:`,equalPrompt:`Форматировать ячейки, которые РАВНЫ:`,textPrompt:`Форматировать ячейки, содержащие текст:`,duplicatePrompt:`Форматировать ячейки, которые содержат:`,topPrompt:`Форматировать ПЕРВЫЕ ячейки:`,topPercentPrompt:`Форматировать ПЕРВЫЕ ячейки (в процентах):`,bottomPrompt:`Форматировать ПОСЛЕДНИЕ ячейки:`,bottomPercentPrompt:`Форматировать ПОСЛЕДНИЕ ячейки (в процентах):`,abovePrompt:`Форматировать ячейки, которые ВЫШЕ СРЕДНЕГО:`,belowPrompt:`Форматировать ячейки, которые НИЖЕ СРЕДНЕГО:`,and:`и`,with:`с`,duplicate:`Повторяющиеся`,unique:`Уникальные`,looks:{lightRed:`Светло-красная заливка и темно-красный текст`,yellow:`Желтая заливка и темно-желтый текст`,green:`Зеленая заливка и темно-зеленый текст`,lightRedFill:`Светло-красная заливка`,redText:`Красный текст`,redBorder:`Красная граница`},scales:{greenYellowRed:`Зеленый - желтый - красный`,redYellowGreen:`Красный - желтый - зеленый`,blueWhiteRed:`Синий - белый - красный`,whiteRed:`Белый - красный`,whiteGreen:`Белый - зеленый`},icons:{"3Arrows":`3 стрелки`,"5Arrows":`5 стрелок`,"3TrafficLights1":`3 светофора`,"4TrafficLights":`4 светофора`,"3Symbols":`3 символа`,"3Flags":`3 флажка`,"5Rating":`5 оценок`}},validation:{title:`Проверка данных`,clearAll:`Очистить все`,settings:`Параметры`,inputMessage:`Сообщение для ввода`,errorAlert:`Сообщение об ошибке`,allow:`Тип данных`,kinds:{any:`Любое значение`,whole:`Целое число`,decimal:`Действительное`,list:`Список`,date:`Дата`,time:`Время`,textLength:`Длина текста`,custom:`Другой`},ignoreBlank:`Игнорировать пустые ячейки`,dropdown:`Список допустимых значений`,data:`Значение`,operators:{between:`между`,notBetween:`вне`,equal:`равно`,notEqual:`не равно`,greaterThan:`больше`,lessThan:`меньше`,greaterThanOrEqual:`больше или равно`,lessThanOrEqual:`меньше или равно`},source:`Источник`,formula:`Формула`,minimum:`Минимум`,maximum:`Максимум`,value:`Значение`,showPrompt:`Отображать подсказку, если ячейка является текущей`,titleWord:`Заголовок`,showError:`Выводить сообщение об ошибке после ввода неверных данных`,style:`Вид`,styles:{stop:`Останов`,warning:`Предупреждение`,information:`Сообщение`},errorMessage:`Сообщение об ошибке`,refusedTitle:`Недопустимое значение`,refused:`Это значение не соответствует ограничениям проверки данных, заданным для этой ячейки.`,retry:`Повторить`,no:`Нет`,yes:`Да`,continue:`Продолжить?`},menu:{cut:`Вырезать`,copy:`Копировать`,paste:`Вставить`,pasteSpecial:`Специальная вставка`,values:`Значения`,formulas:`Формулы`,formats:`Форматы`,entireRow:`Всю строку`,entireColumn:`Весь столбец`,clearContents:`Очистить содержимое`,filter:`Фильтр`,sort:`Сортировка`,filterByValue:`Фильтр по значению выделенной ячейки`,formatCells:`Формат ячеек…`,pickFromList:`Выбрать из раскрывающегося списка…`,rowHeight:`Высота строки…`,columnWidth:`Ширина столбца…`,rowHeightWord:`Высота строки`,columnWidthWord:`Ширина столбца`,hide:`Скрыть`,unhide:`Показать`,multiple:`Команда неприменима для несвязанных диапазонов.`,tableMove:`Часть заголовка таблицы нельзя переместить.`},fill:{options:`Параметры автозаполнения`,copy:`Копировать ячейки`,series:`Заполнить`},formatCells:{title:`Формат ячеек`,tabs:{number:`Число`,alignment:`Выравнивание`,font:`Шрифт`,border:`Граница`,fill:`Заливка`},category:`Числовые форматы`,categories:{general:`Общий`,number:`Числовой`,currency:`Денежный`,accounting:`Финансовый`,date:`Дата`,time:`Время`,percentage:`Процентный`,fraction:`Дробный`,scientific:`Экспоненциальный`,text:`Текстовый`,custom:`(все форматы)`},sample:`Образец`,decimals:`Число десятичных знаков`,thousands:`Разделитель групп разрядов (,)`,symbol:`Обозначение`,none:`Нет`,negative:`Отрицательные числа`,type:`Тип`,horizontal:`По горизонтали`,vertical:`По вертикали`,aligns:{general:`По значению`,left:`По левому краю (отступ)`,center:`По центру`,right:`По правому краю (отступ)`,fill:`С заполнением`,justify:`По ширине`,centerContinuous:`По центру выделения`,distributed:`Распределенное (отступ)`},valigns:{top:`По верхнему краю`,center:`По центру`,bottom:`По нижнему краю`,justify:`По высоте`,distributed:`Распределенное`},indent:`Отступ`,orientation:`Градусов`,shrink:`Автоподбор ширины`,strikethrough:`Зачеркнутый`,borderNone:`Нет`,borderOutline:`Внешние`,borderInside:`Внутренние`,lineStyle:`Тип линии`,lineColor:`Цвет`,lines:{thin:`Тонкая`,hair:`Волосяная`,dotted:`Точечная`,dashed:`Пунктирная`,dashDot:`Штрихпунктирная`,dashDotDot:`С двумя точками`,medium:`Средняя`,mediumDashed:`Средняя пунктирная`,mediumDashDot:`Средняя штрихпунктирная`,thick:`Толстая`,double:`Двойная`},edges:{top:`Верхняя`,horizontal:`Внутренняя горизонтальная`,bottom:`Нижняя`,left:`Левая`,vertical:`Внутренняя вертикальная`,right:`Правая`}},chart:{insert:`Вставить диаграмму`,design:`Конструктор диаграмм`,changeType:`Изменить тип диаграммы`,selectData:`Выбрать данные`,dataRange:`Диапазон данных для диаграммы`,title:`Название диаграммы`,legend:`Легенда`,legendNone:`Нет`,legendAt:{right:`Справа`,top:`Сверху`,left:`Слева`,bottom:`Снизу`},noData:`В этом диапазоне нет чисел для диаграммы.`,buttons:{columnBar:`Вставить гистограмму или линейчатую диаграмму`,lineArea:`Вставить график или диаграмму с областями`,pieDoughnut:`Вставить круговую или кольцевую диаграмму`,scatter:`Вставить точечную диаграмму (X, Y)`},groups:{column2d:`Гистограмма`,bar2d:`Линейчатая`,line2d:`График`,area2d:`С областями`,pie2d:`Круговая`,doughnut:`Кольцевая`,scatter:`Точечная`},types:{"column-clustered":`Гистограмма с группировкой`,"column-stacked":`Гистограмма с накоплением`,"column-stacked-100":`Нормированная гистограмма с накоплением`,"bar-clustered":`Линейчатая с группировкой`,"bar-stacked":`Линейчатая с накоплением`,"bar-stacked-100":`Нормированная линейчатая с накоплением`,line:`График`,"line-markers":`График с маркерами`,area:`С областями`,"area-stacked":`С областями и накоплением`,"area-stacked-100":`Нормированная с областями и накоплением`,pie:`Круговая`,doughnut:`Кольцевая`,scatter:`Точечная`,"scatter-lines":`Точечная с прямыми отрезками и маркерами`,"scatter-smooth":`Точечная с гладкими кривыми`},name:e=>`Диаграмма ${String(e)}`},spillBlocked:`Диапазон переноса не пуст`},tr:{loading:`Açılıyor…`,unreadable:`Bu sayfa gösterilemiyor: sheet.yaml dosyası okunamıyor. Sorun şu.`,generated:{line:`Bu sayfayı sheet.ts oluşturur`,title:`Bu sayfa korumalı`,refused:`Değiştirmeye çalıştığınız hücre veya grafik korumalı bir sayfada: onu sheet.ts oluşturur.`,ask:e=>e===void 0?`Aracıya sor`:`${e} ile sor`,ordinary:`Normal Sayfa Yap`,copied:`Kopyalandı: aracınıza yapıştırın.`,failed:`sheet.ts çalışmıyor: oluşturduğu sayfalar son hâlinde kalır.`},scenario:{manager:`Senaryo Yöneticisi`,scenarios:`Senaryolar:`,changing:`Değişen hücreler:`,show:`Göster`,close:`Kapat`,base:`Temel durum`,showing:`gösteriliyor`,on:e=>`Senaryo: ${e}`},files:{insert:`Dosya Ekle…`,open:`Aç`,remove:`Hücreden Kaldır`,notColumn:`Bu sütun dosya tutmaz.`},undo:`Geri Al`,redo:`Yinele`,font:`Yazı Tipi`,fontSize:`Yazı Tipi Boyutu`,bold:`Kalın`,italic:`İtalik`,underline:`Altı Çizili`,fillColor:`Dolgu Rengi`,fontColor:`Yazı Tipi Rengi`,noFill:`Dolgu Yok`,automatic:`Otomatik`,alignLeft:`Sola Hizala`,center:`Ortala`,alignRight:`Sağa Hizala`,wrapText:`Metni Kaydır`,numberFormat:`Sayı Biçimi`,custom:`Özel`,formats:{general:`Genel`,number:`Sayı`,currency:`Para Birimi`,accounting:`Muhasebe`,shortDate:`Kısa Tarih`,longDate:`Uzun Tarih`,time:`Saat`,percentage:`Yüzde`,fraction:`Kesir`,scientific:`Bilimsel`,text:`Metin`},insert:`Ekle`,delete:`Sil`,insertRows:`Sayfa Satırlarını Ekle`,insertColumns:`Sayfa Sütunlarını Ekle`,insertSheet:`Sayfa Ekle`,deleteRows:`Sayfa Satırlarını Sil`,deleteColumns:`Sayfa Sütunlarını Sil`,deleteSheet:`Sayfayı Sil`,nameBox:`Ad Kutusu`,formulaBar:`Formül Çubuğu`,cancel:`İptal`,enter:`Gir`,insertFunction:`İşlev Ekle`,sheetTabs:`Sayfalar`,newSheet:`Yeni sayfa`,allSheets:`Tüm sayfalar`,sheetMenu:`Sayfa menüsü`,zoom:`Yakınlaştırma`,zoomIn:`Yakınlaştır`,zoomOut:`Uzaklaştır`,duplicate:`Çoğalt`,namesList:`Adlar`,rename:`Yeniden Adlandır`,sheetName:e=>`Sayfa${String(e)}`,average:`Ortalama`,count:`Sayı`,sum:`Toplam`,changed:(e,t)=>`${e} ${String(t)} öğeyi değiştirdi`,changedElsewhere:e=>`Başka yerden ${String(e)} değişiklik`,previous:`Önceki`,next:`Sonraki`,keep:`Koru`,keepAll:`Tümünü koru`,undoAll:`Tümünü geri al`,was:e=>`önceki: ${e}`,rowAdded:`satır eklendi`,rowRemoved:`satır kaldırıldı`,fileChanged:`satırlar yeniden yazıldı`,bothChanged:e=>`Siz ve ${e} aynı şeyi değiştirdiniz. Sizin değişikliğiniz geçerli.`,formulaProblem:`Bu formülde bir sorun var.`,columnName:`Tablonun sütununa bir ad gerekir.`,badSheetName:`Sayfa adı en çok 31 karakter olabilir ve \\ / ? * [ ] : içeremez`,sheetTaken:`Bu adda bir sayfa zaten var.`,lastSheet:`Bir çalışma kitabında en az bir görünür sayfa kalmalıdır.`,tableHeader:`Tablonun üst bilgi satırı silinemez.`,badName:`Bu ad kullanılamaz.`,badReference:`Başvuru geçerli değil.`,overwrite:`Bu sütundaki tüm hücrelerin üzerine bu formülü yaz`,dialog:{ok:`Tamam`,cancel:`İptal`},number:{more:`Diğer Sayı Biçimleri…`,accounting:`Muhasebe Sayı Biçimi`,percent:`Yüzde Stili`,comma:`Binlik Ayracı Stili`,increaseDecimal:`Ondalık Artır`,decreaseDecimal:`Ondalık Azalt`},borders:{title:`Kenarlıklar`,bottom:`Alt Kenarlık`,top:`Üst Kenarlık`,left:`Sol Kenarlık`,right:`Sağ Kenarlık`,none:`Kenarlık Yok`,all:`Tüm Kenarlıklar`,outside:`Dış Kenarlıklar`,thickOutside:`Kalın Dış Kenarlıklar`,bottomDouble:`Alt Çift Kenarlık`,thickBottom:`Kalın Alt Kenarlık`,topBottom:`Üst ve Alt Kenarlık`,topThickBottom:`Üst ve Kalın Alt Kenarlık`,topDoubleBottom:`Üst ve Çift Alt Kenarlık`,more:`Diğer Kenarlıklar…`},arrange:{cells:`Hücreler`,mergeCenter:`Birleştir ve Ortala`,mergeMenu:`Birleştirme seçenekleri`,mergeAcross:`Yatay Birleştir`,mergeCells:`Hücreleri Birleştir`,unmerge:`Hücreleri Çöz`,mergeTable:`Tablodaki hücreler birleştirilemez.`,mergeLoses:`Hücreleri birleştirme yalnızca sol üstteki değeri korur, diğer değerleri atar.`,format:`Biçim`,fitRows:`Satır Yüksekliğini Otomatik Sığdır`,fitColumns:`Sütun Genişliğini Otomatik Sığdır`,hideUnhide:`Gizle ve Göster`,hideRows:`Satırları Gizle`,hideColumns:`Sütunları Gizle`,hideSheet:`Sayfayı Gizle`,unhideRows:`Satırları Göster`,unhideColumns:`Sütunları Göster`,unhideSheet:`Sayfayı Göster`,unhideEllipsis:`Göster…`,freezePanes:`Bölmeleri Dondur`,unfreeze:`Bölmeleri Çöz`,freezeTopRow:`Üst Satırı Dondur`,freezeFirstColumn:`İlk Sütunu Dondur`,tabColor:`Sekme Rengi`,noColor:`Renk Yok`},sortFilter:{title:`Sırala ve Filtre Uygula`,customSort:`Özel Sıralama…`,filter:`Filtre`,clear:`Temizle`,reapply:`Yeniden Uygula`,noData:`Veri içeren bir aralıkta hücre seçin ve yeniden deneyin.`},filter:{aToZ:`A'dan Z'ye Sırala`,zToA:`Z'den A'ya Sırala`,aToZShort:`A'dan Z'ye`,zToAShort:`Z'den A'ya`,smallest:`En Küçükten En Büyüğe Sırala`,largest:`En Büyükten En Küçüğe Sırala`,oldest:`Eskiden Yeniye Sırala`,newest:`Yeniden Eskiye Sırala`,clearFrom:e=>`"${e}" Öğesinden Filtreyi Temizle`,search:`Ara`,selectAll:`(Tümünü Seç)`,blanks:`(Boş)`,found:(e,t)=>`${String(t)} kayıttan ${String(e)} tanesi bulundu`},sort:{title:`Sırala`,addLevel:`Düzey Ekle`,deleteLevel:`Düzeyi Sil`,hasHeaders:`Verilerimde üst bilgi var`,sortBy:`Sıralama ölçütü`,thenBy:`Sonra buna göre`,column:e=>`${e} Sütunu`},rules:{title:`Koşullu Biçimlendirme`,highlight:`Hücre Kurallarını Vurgula`,topBottom:`İlk/Son Kuralları`,greaterThan:`Büyüktür…`,lessThan:`Küçüktür…`,between:`Arasında…`,equalTo:`Eşittir…`,textContains:`İçeren Metin…`,duplicateValues:`Yinelenen Değerler…`,top10:`İlk 10 Öğe…`,top10Percent:`İlk %10…`,bottom10:`Son 10 Öğe…`,bottom10Percent:`Son %10…`,aboveAverage:`Ortalamanın Üstünde…`,belowAverage:`Ortalamanın Altında…`,dataBars:`Veri Çubukları`,colorScales:`Renk Ölçekleri`,iconSets:`Simge Kümeleri`,clearRules:`Kuralları Temizle`,clearSelected:`Seçili Hücrelerden Kuralları Temizle`,clearSheet:`Tüm Sayfadan Kuralları Temizle`,greaterPrompt:`ŞUNDAN BÜYÜK hücreleri biçimlendir:`,lessPrompt:`ŞUNDAN KÜÇÜK hücreleri biçimlendir:`,betweenPrompt:`ŞUNLAR ARASINDAKİ hücreleri biçimlendir:`,equalPrompt:`ŞUNA EŞİT hücreleri biçimlendir:`,textPrompt:`Şu metni içeren hücreleri biçimlendir:`,duplicatePrompt:`Şunu içeren hücreleri biçimlendir:`,topPrompt:`İLK sıralarda yer alan hücreleri biçimlendir:`,topPercentPrompt:`İLK sıralarda yer alan hücreleri biçimlendir (yüzde):`,bottomPrompt:`SON sıralarda yer alan hücreleri biçimlendir:`,bottomPercentPrompt:`SON sıralarda yer alan hücreleri biçimlendir (yüzde):`,abovePrompt:`ORTALAMANIN ÜSTÜNDEKİ hücreleri biçimlendir:`,belowPrompt:`ORTALAMANIN ALTINDAKİ hücreleri biçimlendir:`,and:`ve`,with:`ile`,duplicate:`Yinelenen`,unique:`Benzersiz`,looks:{lightRed:`Açık Kırmızı Dolgu ve Koyu Kırmızı Metin`,yellow:`Sarı Dolgu ve Koyu Sarı Metin`,green:`Yeşil Dolgu ve Koyu Yeşil Metin`,lightRedFill:`Açık Kırmızı Dolgu`,redText:`Kırmızı Metin`,redBorder:`Kırmızı Kenarlık`},scales:{greenYellowRed:`Yeşil - Sarı - Kırmızı`,redYellowGreen:`Kırmızı - Sarı - Yeşil`,blueWhiteRed:`Mavi - Beyaz - Kırmızı`,whiteRed:`Beyaz - Kırmızı`,whiteGreen:`Beyaz - Yeşil`},icons:{"3Arrows":`3 Ok`,"5Arrows":`5 Ok`,"3TrafficLights1":`3 Trafik Işığı`,"4TrafficLights":`4 Trafik Işığı`,"3Symbols":`3 Simge`,"3Flags":`3 Bayrak`,"5Rating":`5 Derecelendirme`}},validation:{title:`Veri Doğrulama`,clearAll:`Tümünü Temizle`,settings:`Ayarlar`,inputMessage:`Giriş İletisi`,errorAlert:`Hata Uyarısı`,allow:`İzin Verilen`,kinds:{any:`Herhangi bir değer`,whole:`Tam sayı`,decimal:`Ondalık`,list:`Liste`,date:`Tarih`,time:`Saat`,textLength:`Metin uzunluğu`,custom:`Özel`},ignoreBlank:`Boş olanı yoksay`,dropdown:`Hücre içi açılır liste`,data:`Veri`,operators:{between:`arasında`,notBetween:`arasında değil`,equal:`eşit`,notEqual:`eşit değil`,greaterThan:`büyük`,lessThan:`küçük`,greaterThanOrEqual:`büyük veya eşit`,lessThanOrEqual:`küçük veya eşit`},source:`Kaynak`,formula:`Formül`,minimum:`En Az`,maximum:`En Çok`,value:`Değer`,showPrompt:`Hücre seçildiğinde giriş iletisini göster`,titleWord:`Başlık`,showError:`Geçersiz veri girildiğinde hata uyarısı göster`,style:`Stil`,styles:{stop:`Durdur`,warning:`Uyarı`,information:`Bilgi`},errorMessage:`Hata iletisi`,refusedTitle:`Değere izin verilmiyor`,refused:`Bu değer, bu hücre için tanımlanan veri doğrulama kısıtlamalarıyla eşleşmiyor.`,retry:`Yeniden Dene`,no:`Hayır`,yes:`Evet`,continue:`Devam edilsin mi?`},menu:{cut:`Kes`,copy:`Kopyala`,paste:`Yapıştır`,pasteSpecial:`Özel Yapıştır`,values:`Değerler`,formulas:`Formüller`,formats:`Biçimler`,entireRow:`Tüm Satır`,entireColumn:`Tüm Sütun`,clearContents:`İçeriği Temizle`,filter:`Filtre`,sort:`Sırala`,filterByValue:`Seçili Hücrenin Değerine Göre Filtre Uygula`,formatCells:`Hücreleri Biçimlendir…`,pickFromList:`Açılır Listeden Seç…`,rowHeight:`Satır Yüksekliği…`,columnWidth:`Sütun Genişliği…`,rowHeightWord:`Satır Yüksekliği`,columnWidthWord:`Sütun Genişliği`,hide:`Gizle`,unhide:`Göster`,multiple:`Bu komut çoklu seçimlerde kullanılamaz.`,tableMove:`Tablo üst bilgisinin bir bölümü taşınamaz.`},fill:{options:`Otomatik Doldurma Seçenekleri`,copy:`Hücreleri Kopyala`,series:`Seriyi Doldur`},formatCells:{title:`Hücreleri Biçimlendir`,tabs:{number:`Sayı`,alignment:`Hizalama`,font:`Yazı Tipi`,border:`Kenarlık`,fill:`Dolgu`},category:`Kategori`,categories:{general:`Genel`,number:`Sayı`,currency:`Para Birimi`,accounting:`Muhasebe`,date:`Tarih`,time:`Saat`,percentage:`Yüzde`,fraction:`Kesir`,scientific:`Bilimsel`,text:`Metin`,custom:`İsteğe Uyarlanmış`},sample:`Örnek`,decimals:`Ondalık basamak sayısı`,thousands:`1000 Ayracı Kullan (,)`,symbol:`Simge`,none:`Yok`,negative:`Negatif sayılar`,type:`Tür`,horizontal:`Yatay`,vertical:`Dikey`,aligns:{general:`Genel`,left:`Sol (Girinti)`,center:`Orta`,right:`Sağ (Girinti)`,fill:`Doldur`,justify:`Yasla`,centerContinuous:`Seçim Ortasına`,distributed:`Dağıtılmış (Girinti)`},valigns:{top:`Üst`,center:`Orta`,bottom:`Alt`,justify:`Yasla`,distributed:`Dağıtılmış`},indent:`Girinti`,orientation:`Derece`,shrink:`Uyacak şekilde daralt`,strikethrough:`Üstü Çizili`,borderNone:`Yok`,borderOutline:`Anahat`,borderInside:`İç`,lineStyle:`Stil`,lineColor:`Renk`,lines:{thin:`İnce`,hair:`Çok İnce`,dotted:`Noktalı`,dashed:`Kesikli`,dashDot:`Çizgi Nokta`,dashDotDot:`Çizgi Nokta Nokta`,medium:`Orta`,mediumDashed:`Orta Kesikli`,mediumDashDot:`Orta Çizgi Nokta`,thick:`Kalın`,double:`Çift`},edges:{top:`Üst`,horizontal:`İç Yatay`,bottom:`Alt`,left:`Sol`,vertical:`İç Dikey`,right:`Sağ`}},chart:{insert:`Grafik Ekle`,design:`Grafik Tasarımı`,changeType:`Grafik Türünü Değiştir`,selectData:`Veri Seç`,dataRange:`Grafik veri aralığı`,title:`Grafik Başlığı`,legend:`Gösterge`,legendNone:`Yok`,legendAt:{right:`Sağ`,top:`Üst`,left:`Sol`,bottom:`Alt`},noData:`Bu aralıkta grafiğe dökülecek sayı yok.`,buttons:{columnBar:`Sütun veya Çubuk Grafik Ekle`,lineArea:`Çizgi veya Alan Grafiği Ekle`,pieDoughnut:`Pasta veya Halka Grafik Ekle`,scatter:`Dağılım (X, Y) Grafiği Ekle`},groups:{column2d:`2B Sütun`,bar2d:`2B Çubuk`,line2d:`2B Çizgi`,area2d:`2B Alan`,pie2d:`2B Pasta`,doughnut:`Halka`,scatter:`Dağılım`},types:{"column-clustered":`Kümelenmiş Sütun`,"column-stacked":`Yığılmış Sütun`,"column-stacked-100":`%100 Yığılmış Sütun`,"bar-clustered":`Kümelenmiş Çubuk`,"bar-stacked":`Yığılmış Çubuk`,"bar-stacked-100":`%100 Yığılmış Çubuk`,line:`Çizgi`,"line-markers":`İşaretçili Çizgi`,area:`Alan`,"area-stacked":`Yığılmış Alan`,"area-stacked-100":`%100 Yığılmış Alan`,pie:`Pasta`,doughnut:`Halka`,scatter:`Dağılım`,"scatter-lines":`Düz Çizgili ve İşaretçili Dağılım`,"scatter-smooth":`Yumuşak Çizgili Dağılım`},name:e=>`Grafik ${String(e)}`},spillBlocked:`Taşma aralığı boş değil`},vi:{loading:`Đang mở…`,unreadable:`Không thể hiển thị trang tính này: không đọc được sheet.yaml của nó. Lỗi như sau.`,generated:{line:`sheet.ts tạo trang tính này`,title:`Trang tính này được bảo vệ`,refused:`Ô hoặc biểu đồ bạn đang cố thay đổi nằm trên trang tính được bảo vệ: sheet.ts tạo ra nó.`,ask:e=>e===void 0?`Hỏi tác nhân`:`Hỏi ${e}`,ordinary:`Chuyển thành trang tính thường`,copied:`Đã sao chép: hãy dán cho tác nhân của bạn.`,failed:`sheet.ts không chạy được: các trang tính nó tạo giữ nguyên như lần cuối.`},scenario:{manager:`Trình quản lý Kịch bản`,scenarios:`Kịch bản:`,changing:`Ô thay đổi:`,show:`Hiện`,close:`Đóng`,base:`Trường hợp cơ sở`,showing:`đang hiện`,on:e=>`Kịch bản: ${e}`},files:{insert:`Chèn Tệp…`,open:`Mở`,remove:`Xóa khỏi Ô`,notColumn:`Cột này không chứa tệp.`},undo:`Hoàn tác`,redo:`Làm lại`,font:`Phông chữ`,fontSize:`Cỡ chữ`,bold:`Đậm`,italic:`Nghiêng`,underline:`Gạch chân`,fillColor:`Màu tô`,fontColor:`Màu chữ`,noFill:`Không tô`,automatic:`Tự động`,alignLeft:`Căn trái`,center:`Căn giữa`,alignRight:`Căn phải`,wrapText:`Ngắt dòng văn bản`,numberFormat:`Định dạng số`,custom:`Tùy chỉnh`,formats:{general:`Chung`,number:`Số`,currency:`Tiền tệ`,accounting:`Kế toán`,shortDate:`Ngày ngắn`,longDate:`Ngày dài`,time:`Thời gian`,percentage:`Phần trăm`,fraction:`Phân số`,scientific:`Khoa học`,text:`Văn bản`},insert:`Chèn`,delete:`Xóa`,insertRows:`Chèn hàng trang tính`,insertColumns:`Chèn cột trang tính`,insertSheet:`Chèn trang tính`,deleteRows:`Xóa hàng trang tính`,deleteColumns:`Xóa cột trang tính`,deleteSheet:`Xóa trang tính`,nameBox:`Hộp tên`,formulaBar:`Thanh công thức`,cancel:`Hủy`,enter:`Nhập`,insertFunction:`Chèn hàm`,sheetTabs:`Trang tính`,newSheet:`Trang tính mới`,allSheets:`Tất cả trang tính`,sheetMenu:`Menu trang tính`,zoom:`Thu phóng`,zoomIn:`Phóng to`,zoomOut:`Thu nhỏ`,duplicate:`Nhân bản`,namesList:`Tên`,rename:`Đổi tên`,sheetName:e=>`Sheet${String(e)}`,average:`Trung bình`,count:`Đếm`,sum:`Tổng`,changed:(e,t)=>`${e} đã thay đổi ${String(t)} mục`,changedElsewhere:e=>`${String(e)} thay đổi từ nơi khác`,previous:`Trước`,next:`Tiếp`,keep:`Giữ`,keepAll:`Giữ tất cả`,undoAll:`Hoàn tác tất cả`,was:e=>`trước đó: ${e}`,rowAdded:`đã thêm hàng`,rowRemoved:`đã xóa hàng`,fileChanged:`hàng đã được ghi lại`,bothChanged:e=>`Bạn và ${e} đã thay đổi cùng một mục. Thay đổi của bạn được giữ.`,formulaProblem:`Có sự cố với công thức này.`,columnName:`Cột của bảng cần có tên.`,badSheetName:`Tên trang tính tối đa 31 ký tự và không chứa \\ / ? * [ ] :`,sheetTaken:`Đã có trang tính với tên này.`,lastSheet:`Sổ làm việc phải giữ ít nhất một trang tính hiển thị.`,tableHeader:`Không thể xóa hàng tiêu đề của bảng.`,badName:`Không thể dùng tên này.`,badReference:`Tham chiếu không hợp lệ.`,overwrite:`Ghi đè tất cả các ô trong cột này bằng công thức này`,dialog:{ok:`OK`,cancel:`Hủy`},number:{more:`Các định dạng số khác…`,accounting:`Định dạng số kế toán`,percent:`Kiểu phần trăm`,comma:`Kiểu dấu phẩy`,increaseDecimal:`Tăng số thập phân`,decreaseDecimal:`Giảm số thập phân`},borders:{title:`Viền`,bottom:`Viền dưới`,top:`Viền trên`,left:`Viền trái`,right:`Viền phải`,none:`Không viền`,all:`Tất cả viền`,outside:`Viền ngoài`,thickOutside:`Viền ngoài dày`,bottomDouble:`Viền kép dưới`,thickBottom:`Viền dưới dày`,topBottom:`Viền trên và dưới`,topThickBottom:`Viền trên và dưới dày`,topDoubleBottom:`Viền trên và dưới kép`,more:`Viền khác…`},arrange:{cells:`Ô`,mergeCenter:`Phối và căn giữa`,mergeMenu:`Tùy chọn phối`,mergeAcross:`Phối ngang`,mergeCells:`Phối ô`,unmerge:`Bỏ phối ô`,mergeTable:`Không thể phối các ô trong bảng.`,mergeLoses:`Phối ô chỉ giữ giá trị ở ô trên cùng bên trái và bỏ các giá trị khác.`,format:`Định dạng`,fitRows:`Tự động khớp chiều cao hàng`,fitColumns:`Tự động khớp độ rộng cột`,hideUnhide:`Ẩn và bỏ ẩn`,hideRows:`Ẩn hàng`,hideColumns:`Ẩn cột`,hideSheet:`Ẩn trang tính`,unhideRows:`Bỏ ẩn hàng`,unhideColumns:`Bỏ ẩn cột`,unhideSheet:`Bỏ ẩn trang tính`,unhideEllipsis:`Bỏ ẩn…`,freezePanes:`Cố định ngăn`,unfreeze:`Bỏ cố định ngăn`,freezeTopRow:`Cố định hàng trên cùng`,freezeFirstColumn:`Cố định cột đầu tiên`,tabColor:`Màu tab`,noColor:`Không màu`},sortFilter:{title:`Sắp xếp và lọc`,customSort:`Sắp xếp tùy chỉnh…`,filter:`Bộ lọc`,clear:`Xóa`,reapply:`Áp dụng lại`,noData:`Hãy chọn một ô trong phạm vi có dữ liệu rồi thử lại.`},filter:{aToZ:`Sắp xếp từ A đến Z`,zToA:`Sắp xếp từ Z đến A`,aToZShort:`A đến Z`,zToAShort:`Z đến A`,smallest:`Sắp xếp từ nhỏ nhất đến lớn nhất`,largest:`Sắp xếp từ lớn nhất đến nhỏ nhất`,oldest:`Sắp xếp từ cũ nhất đến mới nhất`,newest:`Sắp xếp từ mới nhất đến cũ nhất`,clearFrom:e=>`Xóa bộ lọc khỏi "${e}"`,search:`Tìm kiếm`,selectAll:`(Chọn tất cả)`,blanks:`(Trống)`,found:(e,t)=>`Tìm thấy ${String(e)} trong số ${String(t)} bản ghi`},sort:{title:`Sắp xếp`,addLevel:`Thêm mức`,deleteLevel:`Xóa mức`,hasHeaders:`Dữ liệu của tôi có tiêu đề`,sortBy:`Sắp xếp theo`,thenBy:`Sau đó theo`,column:e=>`Cột ${e}`},rules:{title:`Định dạng có điều kiện`,highlight:`Quy tắc tô sáng ô`,topBottom:`Quy tắc trên/dưới`,greaterThan:`Lớn hơn…`,lessThan:`Nhỏ hơn…`,between:`Giữa…`,equalTo:`Bằng…`,textContains:`Văn bản có chứa…`,duplicateValues:`Giá trị trùng lặp…`,top10:`10 mục hàng đầu…`,top10Percent:`10% hàng đầu…`,bottom10:`10 mục cuối cùng…`,bottom10Percent:`10% cuối cùng…`,aboveAverage:`Trên trung bình…`,belowAverage:`Dưới trung bình…`,dataBars:`Thanh dữ liệu`,colorScales:`Thang màu`,iconSets:`Bộ biểu tượng`,clearRules:`Xóa quy tắc`,clearSelected:`Xóa quy tắc khỏi các ô được chọn`,clearSheet:`Xóa quy tắc khỏi toàn bộ trang tính`,greaterPrompt:`Định dạng các ô LỚN HƠN:`,lessPrompt:`Định dạng các ô NHỎ HƠN:`,betweenPrompt:`Định dạng các ô nằm GIỮA:`,equalPrompt:`Định dạng các ô BẰNG:`,textPrompt:`Định dạng các ô chứa văn bản:`,duplicatePrompt:`Định dạng các ô chứa:`,topPrompt:`Định dạng các ô xếp hạng TRÊN CÙNG:`,topPercentPrompt:`Định dạng các ô xếp hạng TRÊN CÙNG (phần trăm):`,bottomPrompt:`Định dạng các ô xếp hạng DƯỚI CÙNG:`,bottomPercentPrompt:`Định dạng các ô xếp hạng DƯỚI CÙNG (phần trăm):`,abovePrompt:`Định dạng các ô TRÊN TRUNG BÌNH:`,belowPrompt:`Định dạng các ô DƯỚI TRUNG BÌNH:`,and:`và`,with:`với`,duplicate:`Trùng lặp`,unique:`Duy nhất`,looks:{lightRed:`Tô đỏ nhạt với văn bản đỏ đậm`,yellow:`Tô vàng với văn bản vàng đậm`,green:`Tô xanh lá với văn bản xanh lá đậm`,lightRedFill:`Tô đỏ nhạt`,redText:`Văn bản đỏ`,redBorder:`Viền đỏ`},scales:{greenYellowRed:`Xanh lá - Vàng - Đỏ`,redYellowGreen:`Đỏ - Vàng - Xanh lá`,blueWhiteRed:`Xanh dương - Trắng - Đỏ`,whiteRed:`Trắng - Đỏ`,whiteGreen:`Trắng - Xanh lá`},icons:{"3Arrows":`3 mũi tên`,"5Arrows":`5 mũi tên`,"3TrafficLights1":`3 đèn giao thông`,"4TrafficLights":`4 đèn giao thông`,"3Symbols":`3 ký hiệu`,"3Flags":`3 lá cờ`,"5Rating":`5 xếp hạng`}},validation:{title:`Xác thực dữ liệu`,clearAll:`Xóa tất cả`,settings:`Cài đặt`,inputMessage:`Thông báo nhập`,errorAlert:`Cảnh báo lỗi`,allow:`Cho phép`,kinds:{any:`Giá trị bất kỳ`,whole:`Số nguyên`,decimal:`Số thập phân`,list:`Danh sách`,date:`Ngày`,time:`Giờ`,textLength:`Độ dài văn bản`,custom:`Tùy chỉnh`},ignoreBlank:`Bỏ qua ô trống`,dropdown:`Danh sách thả xuống trong ô`,data:`Dữ liệu`,operators:{between:`nằm giữa`,notBetween:`không nằm giữa`,equal:`bằng`,notEqual:`không bằng`,greaterThan:`lớn hơn`,lessThan:`nhỏ hơn`,greaterThanOrEqual:`lớn hơn hoặc bằng`,lessThanOrEqual:`nhỏ hơn hoặc bằng`},source:`Nguồn`,formula:`Công thức`,minimum:`Tối thiểu`,maximum:`Tối đa`,value:`Giá trị`,showPrompt:`Hiển thị thông báo nhập khi chọn ô`,titleWord:`Tiêu đề`,showError:`Hiển thị cảnh báo lỗi sau khi nhập dữ liệu không hợp lệ`,style:`Kiểu`,styles:{stop:`Dừng`,warning:`Cảnh báo`,information:`Thông tin`},errorMessage:`Thông báo lỗi`,refusedTitle:`Giá trị không được phép`,refused:`Giá trị này không khớp với các hạn chế xác thực dữ liệu đã đặt cho ô này.`,retry:`Thử lại`,no:`Không`,yes:`Có`,continue:`Tiếp tục?`},menu:{cut:`Cắt`,copy:`Sao chép`,paste:`Dán`,pasteSpecial:`Dán đặc biệt`,values:`Giá trị`,formulas:`Công thức`,formats:`Định dạng`,entireRow:`Toàn bộ hàng`,entireColumn:`Toàn bộ cột`,clearContents:`Xóa nội dung`,filter:`Lọc`,sort:`Sắp xếp`,filterByValue:`Lọc theo giá trị của ô đã chọn`,formatCells:`Định dạng ô…`,pickFromList:`Chọn từ danh sách thả xuống…`,rowHeight:`Chiều cao hàng…`,columnWidth:`Độ rộng cột…`,rowHeightWord:`Chiều cao hàng`,columnWidthWord:`Độ rộng cột`,hide:`Ẩn`,unhide:`Bỏ ẩn`,multiple:`Không thể dùng lệnh đó trên nhiều vùng chọn.`,tableMove:`Không thể di chuyển một phần tiêu đề của bảng.`},fill:{options:`Tùy chọn tự động điền`,copy:`Sao chép ô`,series:`Điền chuỗi`},formatCells:{title:`Định dạng ô`,tabs:{number:`Số`,alignment:`Căn chỉnh`,font:`Phông chữ`,border:`Viền`,fill:`Tô`},category:`Thể loại`,categories:{general:`Chung`,number:`Số`,currency:`Tiền tệ`,accounting:`Kế toán`,date:`Ngày`,time:`Giờ`,percentage:`Phần trăm`,fraction:`Phân số`,scientific:`Khoa học`,text:`Văn bản`,custom:`Tùy chỉnh`},sample:`Mẫu`,decimals:`Số chữ số thập phân`,thousands:`Dùng dấu phân tách hàng nghìn (,)`,symbol:`Ký hiệu`,none:`Không có`,negative:`Số âm`,type:`Loại`,horizontal:`Ngang`,vertical:`Dọc`,aligns:{general:`Chung`,left:`Trái (thụt lề)`,center:`Giữa`,right:`Phải (thụt lề)`,fill:`Điền`,justify:`Căn đều`,centerContinuous:`Căn giữa vùng chọn`,distributed:`Phân phối (thụt lề)`},valigns:{top:`Trên`,center:`Giữa`,bottom:`Dưới`,justify:`Căn đều`,distributed:`Phân phối`},indent:`Thụt lề`,orientation:`Độ`,shrink:`Thu nhỏ cho vừa`,strikethrough:`Gạch ngang`,borderNone:`Không có`,borderOutline:`Viền ngoài`,borderInside:`Bên trong`,lineStyle:`Kiểu`,lineColor:`Màu`,lines:{thin:`Mảnh`,hair:`Rất mảnh`,dotted:`Chấm`,dashed:`Nét đứt`,dashDot:`Gạch chấm`,dashDotDot:`Gạch chấm chấm`,medium:`Trung bình`,mediumDashed:`Nét đứt trung bình`,mediumDashDot:`Gạch chấm trung bình`,thick:`Dày`,double:`Kép`},edges:{top:`Trên`,horizontal:`Ngang bên trong`,bottom:`Dưới`,left:`Trái`,vertical:`Dọc bên trong`,right:`Phải`}},chart:{insert:`Chèn Biểu đồ`,design:`Thiết kế Biểu đồ`,changeType:`Thay đổi Loại Biểu đồ`,selectData:`Chọn Dữ liệu`,dataRange:`Phạm vi dữ liệu biểu đồ`,title:`Tiêu đề Biểu đồ`,legend:`Chú giải`,legendNone:`Không có`,legendAt:{right:`Phải`,top:`Trên`,left:`Trái`,bottom:`Dưới`},noData:`Phạm vi này không có số nào để vẽ biểu đồ.`,buttons:{columnBar:`Chèn Biểu đồ Cột hoặc Thanh`,lineArea:`Chèn Biểu đồ Đường hoặc Vùng`,pieDoughnut:`Chèn Biểu đồ Hình tròn hoặc Vành khuyên`,scatter:`Chèn Biểu đồ Phân tán (X, Y)`},groups:{column2d:`Cột 2-D`,bar2d:`Thanh 2-D`,line2d:`Đường 2-D`,area2d:`Vùng 2-D`,pie2d:`Tròn 2-D`,doughnut:`Vành khuyên`,scatter:`Phân tán`},types:{"column-clustered":`Cột Nhóm`,"column-stacked":`Cột Xếp chồng`,"column-stacked-100":`Cột Xếp chồng 100%`,"bar-clustered":`Thanh Nhóm`,"bar-stacked":`Thanh Xếp chồng`,"bar-stacked-100":`Thanh Xếp chồng 100%`,line:`Đường`,"line-markers":`Đường có Đánh dấu`,area:`Vùng`,"area-stacked":`Vùng Xếp chồng`,"area-stacked-100":`Vùng Xếp chồng 100%`,pie:`Hình tròn`,doughnut:`Vành khuyên`,scatter:`Phân tán`,"scatter-lines":`Phân tán có Đường thẳng và Đánh dấu`,"scatter-smooth":`Phân tán có Đường trơn`},name:e=>`Biểu đồ ${String(e)}`},spillBlocked:`Phạm vi tràn không trống`},th:{loading:`กำลังเปิด…`,unreadable:`แสดงชีตนี้ไม่ได้: อ่าน sheet.yaml ของชีตไม่ได้ ปัญหาคือ`,generated:{line:`sheet.ts สร้างแผ่นงานนี้`,title:`แผ่นงานนี้ถูกป้องกัน`,refused:`เซลล์หรือแผนภูมิที่คุณพยายามเปลี่ยนอยู่บนแผ่นงานที่ป้องกันไว้: sheet.ts เป็นผู้สร้าง`,ask:e=>e===void 0?`ถามเอเจนต์`:`ถาม ${e}`,ordinary:`เปลี่ยนเป็นแผ่นงานปกติ`,copied:`คัดลอกแล้ว: วางให้เอเจนต์ของคุณ`,failed:`sheet.ts ทำงานไม่ได้: แผ่นงานที่สร้างยังคงเหมือนครั้งล่าสุด`},scenario:{manager:`ตัวจัดการสถานการณ์สมมติ`,scenarios:`สถานการณ์สมมติ:`,changing:`เซลล์ที่เปลี่ยนแปลง:`,show:`แสดง`,close:`ปิด`,base:`กรณีฐาน`,showing:`กำลังแสดง`,on:e=>`สถานการณ์สมมติ: ${e}`},files:{insert:`แทรกไฟล์…`,open:`เปิด`,remove:`เอาออกจากเซลล์`,notColumn:`คอลัมน์นี้ไม่เก็บไฟล์`},undo:`เลิกทำ`,redo:`ทำซ้ำ`,font:`แบบอักษร`,fontSize:`ขนาดแบบอักษร`,bold:`ตัวหนา`,italic:`ตัวเอียง`,underline:`ขีดเส้นใต้`,fillColor:`สีเติม`,fontColor:`สีแบบอักษร`,noFill:`ไม่มีการเติม`,automatic:`อัตโนมัติ`,alignLeft:`จัดชิดซ้าย`,center:`จัดกึ่งกลาง`,alignRight:`จัดชิดขวา`,wrapText:`ตัดข้อความ`,numberFormat:`รูปแบบตัวเลข`,custom:`กำหนดเอง`,formats:{general:`ทั่วไป`,number:`ตัวเลข`,currency:`สกุลเงิน`,accounting:`บัญชี`,shortDate:`วันที่แบบสั้น`,longDate:`วันที่แบบยาว`,time:`เวลา`,percentage:`เปอร์เซ็นต์`,fraction:`เศษส่วน`,scientific:`วิทยาศาสตร์`,text:`ข้อความ`},insert:`แทรก`,delete:`ลบ`,insertRows:`แทรกแถวของแผ่นงาน`,insertColumns:`แทรกคอลัมน์ของแผ่นงาน`,insertSheet:`แทรกแผ่นงาน`,deleteRows:`ลบแถวของแผ่นงาน`,deleteColumns:`ลบคอลัมน์ของแผ่นงาน`,deleteSheet:`ลบแผ่นงาน`,nameBox:`กล่องชื่อ`,formulaBar:`แถบสูตร`,cancel:`ยกเลิก`,enter:`ป้อน`,insertFunction:`แทรกฟังก์ชัน`,sheetTabs:`แผ่นงาน`,newSheet:`แผ่นงานใหม่`,allSheets:`แผ่นงานทั้งหมด`,sheetMenu:`เมนูแผ่นงาน`,zoom:`ซูม`,zoomIn:`ซูมเข้า`,zoomOut:`ซูมออก`,duplicate:`ทำสำเนา`,namesList:`ชื่อ`,rename:`เปลี่ยนชื่อ`,sheetName:e=>`แผ่น${String(e)}`,average:`ค่าเฉลี่ย`,count:`จำนวน`,sum:`ผลรวม`,changed:(e,t)=>`${e} เปลี่ยนแปลง ${String(t)} รายการ`,changedElsewhere:e=>`มีการเปลี่ยนแปลงจากที่อื่น ${String(e)} รายการ`,previous:`ก่อนหน้า`,next:`ถัดไป`,keep:`เก็บไว้`,keepAll:`เก็บทั้งหมด`,undoAll:`เลิกทำทั้งหมด`,was:e=>`เดิมคือ ${e}`,rowAdded:`เพิ่มแถวแล้ว`,rowRemoved:`ลบแถวแล้ว`,fileChanged:`เขียนแถวใหม่`,bothChanged:e=>`คุณและ ${e} เปลี่ยนสิ่งเดียวกัน ใช้ของคุณ`,formulaProblem:`มีปัญหากับสูตรนี้`,columnName:`คอลัมน์ของตารางต้องมีชื่อ`,badSheetName:`ชื่อแผ่นงานยาวได้ไม่เกิน 31 อักขระ และห้ามมี \\ / ? * [ ] :`,sheetTaken:`มีแผ่นงานที่ใช้ชื่อนี้อยู่แล้ว`,lastSheet:`สมุดงานต้องมีแผ่นงานที่มองเห็นได้อย่างน้อยหนึ่งแผ่น`,tableHeader:`ลบแถวส่วนหัวของตารางไม่ได้`,badName:`ใช้ชื่อนี้ไม่ได้`,badReference:`การอ้างอิงไม่ถูกต้อง`,overwrite:`เขียนทับเซลล์ทั้งหมดในคอลัมน์นี้ด้วยสูตรนี้`,dialog:{ok:`ตกลง`,cancel:`ยกเลิก`},number:{more:`รูปแบบตัวเลขเพิ่มเติม…`,accounting:`รูปแบบตัวเลขทางบัญชี`,percent:`ลักษณะเปอร์เซ็นต์`,comma:`ลักษณะจุลภาค`,increaseDecimal:`เพิ่มตำแหน่งทศนิยม`,decreaseDecimal:`ลดตำแหน่งทศนิยม`},borders:{title:`เส้นขอบ`,bottom:`เส้นขอบล่าง`,top:`เส้นขอบบน`,left:`เส้นขอบซ้าย`,right:`เส้นขอบขวา`,none:`ไม่มีเส้นขอบ`,all:`เส้นขอบทั้งหมด`,outside:`เส้นขอบนอก`,thickOutside:`เส้นขอบนอกหนา`,bottomDouble:`เส้นขอบล่างคู่`,thickBottom:`เส้นขอบล่างหนา`,topBottom:`เส้นขอบบนและล่าง`,topThickBottom:`เส้นขอบบนและล่างแบบหนา`,topDoubleBottom:`เส้นขอบบนและล่างแบบคู่`,more:`เส้นขอบเพิ่มเติม…`},arrange:{cells:`เซลล์`,mergeCenter:`ผสานและจัดกึ่งกลาง`,mergeMenu:`ตัวเลือกการผสาน`,mergeAcross:`ผสานแนวขวาง`,mergeCells:`ผสานเซลล์`,unmerge:`ยกเลิกการผสานเซลล์`,mergeTable:`ผสานเซลล์ในตารางไม่ได้`,mergeLoses:`การผสานเซลล์จะเก็บเฉพาะค่าบนซ้ายและทิ้งค่าอื่น`,format:`รูปแบบ`,fitRows:`ปรับความสูงแถวอัตโนมัติ`,fitColumns:`ปรับความกว้างคอลัมน์อัตโนมัติ`,hideUnhide:`ซ่อนและยกเลิกการซ่อน`,hideRows:`ซ่อนแถว`,hideColumns:`ซ่อนคอลัมน์`,hideSheet:`ซ่อนแผ่นงาน`,unhideRows:`ยกเลิกการซ่อนแถว`,unhideColumns:`ยกเลิกการซ่อนคอลัมน์`,unhideSheet:`ยกเลิกการซ่อนแผ่นงาน`,unhideEllipsis:`ยกเลิกการซ่อน…`,freezePanes:`ตรึงแนว`,unfreeze:`ยกเลิกการตรึงแนว`,freezeTopRow:`ตรึงแถวบนสุด`,freezeFirstColumn:`ตรึงคอลัมน์แรก`,tabColor:`สีแท็บ`,noColor:`ไม่มีสี`},sortFilter:{title:`เรียงลำดับและกรอง`,customSort:`การเรียงลำดับแบบกำหนดเอง…`,filter:`ตัวกรอง`,clear:`ล้าง`,reapply:`นำไปใช้ใหม่`,noData:`เลือกเซลล์ในช่วงที่มีข้อมูลแล้วลองอีกครั้ง`},filter:{aToZ:`เรียงลำดับจาก A ถึง Z`,zToA:`เรียงลำดับจาก Z ถึง A`,aToZShort:`A ถึง Z`,zToAShort:`Z ถึง A`,smallest:`เรียงลำดับจากน้อยไปหามาก`,largest:`เรียงลำดับจากมากไปหาน้อย`,oldest:`เรียงลำดับจากเก่าที่สุดไปหาใหม่ที่สุด`,newest:`เรียงลำดับจากใหม่ที่สุดไปหาเก่าที่สุด`,clearFrom:e=>`ล้างตัวกรองจาก "${e}"`,search:`ค้นหา`,selectAll:`(เลือกทั้งหมด)`,blanks:`(ว่าง)`,found:(e,t)=>`พบ ${String(e)} จาก ${String(t)} ระเบียน`},sort:{title:`เรียงลำดับ`,addLevel:`เพิ่มระดับ`,deleteLevel:`ลบระดับ`,hasHeaders:`ข้อมูลของฉันมีส่วนหัว`,sortBy:`เรียงลำดับตาม`,thenBy:`จากนั้นตาม`,column:e=>`คอลัมน์ ${e}`},rules:{title:`การจัดรูปแบบตามเงื่อนไข`,highlight:`กฎการเน้นเซลล์`,topBottom:`กฎด้านบน/ด้านล่าง`,greaterThan:`มากกว่า…`,lessThan:`น้อยกว่า…`,between:`ระหว่าง…`,equalTo:`เท่ากับ…`,textContains:`ข้อความที่มี…`,duplicateValues:`ค่าที่ซ้ำกัน…`,top10:`10 รายการแรก…`,top10Percent:`10% แรก…`,bottom10:`10 รายการสุดท้าย…`,bottom10Percent:`10% สุดท้าย…`,aboveAverage:`สูงกว่าค่าเฉลี่ย…`,belowAverage:`ต่ำกว่าค่าเฉลี่ย…`,dataBars:`แถบข้อมูล`,colorScales:`ระดับสี`,iconSets:`ชุดไอคอน`,clearRules:`ล้างกฎ`,clearSelected:`ล้างกฎจากเซลล์ที่เลือก`,clearSheet:`ล้างกฎจากทั้งแผ่นงาน`,greaterPrompt:`จัดรูปแบบเซลล์ที่มากกว่า:`,lessPrompt:`จัดรูปแบบเซลล์ที่น้อยกว่า:`,betweenPrompt:`จัดรูปแบบเซลล์ที่อยู่ระหว่าง:`,equalPrompt:`จัดรูปแบบเซลล์ที่เท่ากับ:`,textPrompt:`จัดรูปแบบเซลล์ที่มีข้อความ:`,duplicatePrompt:`จัดรูปแบบเซลล์ที่มี:`,topPrompt:`จัดรูปแบบเซลล์ที่อยู่ในอันดับต้น:`,topPercentPrompt:`จัดรูปแบบเซลล์ที่อยู่ในอันดับต้น (เปอร์เซ็นต์):`,bottomPrompt:`จัดรูปแบบเซลล์ที่อยู่ในอันดับท้าย:`,bottomPercentPrompt:`จัดรูปแบบเซลล์ที่อยู่ในอันดับท้าย (เปอร์เซ็นต์):`,abovePrompt:`จัดรูปแบบเซลล์ที่สูงกว่าค่าเฉลี่ย:`,belowPrompt:`จัดรูปแบบเซลล์ที่ต่ำกว่าค่าเฉลี่ย:`,and:`และ`,with:`ด้วย`,duplicate:`ซ้ำกัน`,unique:`ไม่ซ้ำกัน`,looks:{lightRed:`สีแดงอ่อนเติมด้วยข้อความสีแดงเข้ม`,yellow:`สีเหลืองเติมด้วยข้อความสีเหลืองเข้ม`,green:`สีเขียวเติมด้วยข้อความสีเขียวเข้ม`,lightRedFill:`เติมสีแดงอ่อน`,redText:`ข้อความสีแดง`,redBorder:`เส้นขอบสีแดง`},scales:{greenYellowRed:`เขียว - เหลือง - แดง`,redYellowGreen:`แดง - เหลือง - เขียว`,blueWhiteRed:`น้ำเงิน - ขาว - แดง`,whiteRed:`ขาว - แดง`,whiteGreen:`ขาว - เขียว`},icons:{"3Arrows":`ลูกศร 3 อัน`,"5Arrows":`ลูกศร 5 อัน`,"3TrafficLights1":`สัญญาณไฟจราจร 3 ดวง`,"4TrafficLights":`สัญญาณไฟจราจร 4 ดวง`,"3Symbols":`สัญลักษณ์ 3 แบบ`,"3Flags":`ธง 3 ผืน`,"5Rating":`การจัดอันดับ 5 ระดับ`}},validation:{title:`การตรวจสอบความถูกต้องของข้อมูล`,clearAll:`ล้างทั้งหมด`,settings:`การตั้งค่า`,inputMessage:`ข้อความเตือนให้ป้อน`,errorAlert:`การแจ้งเตือนข้อผิดพลาด`,allow:`อนุญาต`,kinds:{any:`ค่าใดๆ`,whole:`จำนวนเต็ม`,decimal:`ทศนิยม`,list:`รายการ`,date:`วันที่`,time:`เวลา`,textLength:`ความยาวข้อความ`,custom:`กำหนดเอง`},ignoreBlank:`ละเว้นที่ว่าง`,dropdown:`ดรอปดาวน์ในเซลล์`,data:`ข้อมูล`,operators:{between:`ระหว่าง`,notBetween:`ไม่อยู่ระหว่าง`,equal:`เท่ากับ`,notEqual:`ไม่เท่ากับ`,greaterThan:`มากกว่า`,lessThan:`น้อยกว่า`,greaterThanOrEqual:`มากกว่าหรือเท่ากับ`,lessThanOrEqual:`น้อยกว่าหรือเท่ากับ`},source:`แหล่งข้อมูล`,formula:`สูตร`,minimum:`ค่าต่ำสุด`,maximum:`ค่าสูงสุด`,value:`ค่า`,showPrompt:`แสดงข้อความเตือนให้ป้อนเมื่อเลือกเซลล์`,titleWord:`ชื่อเรื่อง`,showError:`แสดงการแจ้งเตือนข้อผิดพลาดหลังจากป้อนข้อมูลที่ไม่ถูกต้อง`,style:`ลักษณะ`,styles:{stop:`หยุด`,warning:`คำเตือน`,information:`ข้อมูล`},errorMessage:`ข้อความแสดงข้อผิดพลาด`,refusedTitle:`ไม่อนุญาตค่านี้`,refused:`ค่านี้ไม่ตรงกับข้อจำกัดการตรวจสอบความถูกต้องของข้อมูลที่กำหนดไว้สำหรับเซลล์นี้`,retry:`ลองใหม่`,no:`ไม่ใช่`,yes:`ใช่`,continue:`ดำเนินการต่อหรือไม่`},menu:{cut:`ตัด`,copy:`คัดลอก`,paste:`วาง`,pasteSpecial:`วางแบบพิเศษ`,values:`ค่า`,formulas:`สูตร`,formats:`รูปแบบ`,entireRow:`ทั้งแถว`,entireColumn:`ทั้งคอลัมน์`,clearContents:`ล้างเนื้อหา`,filter:`กรอง`,sort:`เรียงลำดับ`,filterByValue:`กรองตามค่าของเซลล์ที่เลือก`,formatCells:`จัดรูปแบบเซลล์…`,pickFromList:`เลือกจากรายการดรอปดาวน์…`,rowHeight:`ความสูงของแถว…`,columnWidth:`ความกว้างของคอลัมน์…`,rowHeightWord:`ความสูงของแถว`,columnWidthWord:`ความกว้างของคอลัมน์`,hide:`ซ่อน`,unhide:`ยกเลิกการซ่อน`,multiple:`ใช้คำสั่งนี้กับส่วนที่เลือกหลายส่วนไม่ได้`,tableMove:`ย้ายส่วนหนึ่งของส่วนหัวตารางไม่ได้`},fill:{options:`ตัวเลือกการเติมอัตโนมัติ`,copy:`คัดลอกเซลล์`,series:`เติมชุดข้อมูล`},formatCells:{title:`จัดรูปแบบเซลล์`,tabs:{number:`ตัวเลข`,alignment:`การจัดแนว`,font:`แบบอักษร`,border:`เส้นขอบ`,fill:`เติม`},category:`ประเภท`,categories:{general:`ทั่วไป`,number:`ตัวเลข`,currency:`สกุลเงิน`,accounting:`บัญชี`,date:`วันที่`,time:`เวลา`,percentage:`เปอร์เซ็นต์`,fraction:`เศษส่วน`,scientific:`วิทยาศาสตร์`,text:`ข้อความ`,custom:`กำหนดเอง`},sample:`ตัวอย่าง`,decimals:`ตำแหน่งทศนิยม`,thousands:`ใช้ตัวคั่นหลักพัน (,)`,symbol:`สัญลักษณ์`,none:`ไม่มี`,negative:`จำนวนลบ`,type:`ชนิด`,horizontal:`แนวนอน`,vertical:`แนวตั้ง`,aligns:{general:`ทั่วไป`,left:`ซ้าย (เยื้อง)`,center:`กึ่งกลาง`,right:`ขวา (เยื้อง)`,fill:`เติม`,justify:`จัดชิดขอบ`,centerContinuous:`กึ่งกลางส่วนที่เลือก`,distributed:`กระจาย (เยื้อง)`},valigns:{top:`บน`,center:`กึ่งกลาง`,bottom:`ล่าง`,justify:`จัดชิดขอบ`,distributed:`กระจาย`},indent:`เยื้อง`,orientation:`องศา`,shrink:`ย่อให้พอดี`,strikethrough:`ขีดทับ`,borderNone:`ไม่มี`,borderOutline:`เส้นกรอบนอก`,borderInside:`ภายใน`,lineStyle:`ลักษณะ`,lineColor:`สี`,lines:{thin:`บาง`,hair:`บางมาก`,dotted:`จุด`,dashed:`เส้นประ`,dashDot:`เส้นประจุด`,dashDotDot:`เส้นประสองจุด`,medium:`ปานกลาง`,mediumDashed:`เส้นประปานกลาง`,mediumDashDot:`เส้นประจุดปานกลาง`,thick:`หนา`,double:`คู่`},edges:{top:`บน`,horizontal:`แนวนอนด้านใน`,bottom:`ล่าง`,left:`ซ้าย`,vertical:`แนวตั้งด้านใน`,right:`ขวา`}},chart:{insert:`แทรกแผนภูมิ`,design:`ออกแบบแผนภูมิ`,changeType:`เปลี่ยนชนิดแผนภูมิ`,selectData:`เลือกข้อมูล`,dataRange:`ช่วงข้อมูลแผนภูมิ`,title:`ชื่อแผนภูมิ`,legend:`คำอธิบายแผนภูมิ`,legendNone:`ไม่มี`,legendAt:{right:`ขวา`,top:`บน`,left:`ซ้าย`,bottom:`ล่าง`},noData:`ช่วงนี้ไม่มีตัวเลขให้สร้างแผนภูมิ`,buttons:{columnBar:`แทรกแผนภูมิคอลัมน์หรือแผนภูมิแท่ง`,lineArea:`แทรกแผนภูมิเส้นหรือแผนภูมิพื้นที่`,pieDoughnut:`แทรกแผนภูมิวงกลมหรือแผนภูมิโดนัท`,scatter:`แทรกแผนภูมิกระจาย (X, Y)`},groups:{column2d:`คอลัมน์ 2 มิติ`,bar2d:`แท่ง 2 มิติ`,line2d:`เส้น 2 มิติ`,area2d:`พื้นที่ 2 มิติ`,pie2d:`วงกลม 2 มิติ`,doughnut:`โดนัท`,scatter:`กระจาย`},types:{"column-clustered":`คอลัมน์แบบกลุ่ม`,"column-stacked":`คอลัมน์แบบเรียงซ้อน`,"column-stacked-100":`คอลัมน์แบบเรียงซ้อน 100%`,"bar-clustered":`แท่งแบบกลุ่ม`,"bar-stacked":`แท่งแบบเรียงซ้อน`,"bar-stacked-100":`แท่งแบบเรียงซ้อน 100%`,line:`เส้น`,"line-markers":`เส้นพร้อมเครื่องหมาย`,area:`พื้นที่`,"area-stacked":`พื้นที่แบบเรียงซ้อน`,"area-stacked-100":`พื้นที่แบบเรียงซ้อน 100%`,pie:`วงกลม`,doughnut:`โดนัท`,scatter:`กระจาย`,"scatter-lines":`กระจายพร้อมเส้นตรงและเครื่องหมาย`,"scatter-smooth":`กระจายพร้อมเส้นเรียบ`},name:e=>`แผนภูมิ ${String(e)}`},spillBlocked:`ช่วงที่ล้นไม่ว่าง`},hi:{loading:`खुल रहा है…`,unreadable:`यह शीट नहीं दिखाई जा सकती: इसकी sheet.yaml पढ़ी नहीं जा सकती। समस्या यह है।`,generated:{line:`यह शीट sheet.ts बनाता है`,title:`यह शीट सुरक्षित है`,refused:`आप जिस सेल या चार्ट को बदलना चाहते हैं वह सुरक्षित शीट पर है: इसे sheet.ts बनाता है।`,ask:e=>e===void 0?`एजेंट से पूछें`:`${e} से पूछें`,ordinary:`सामान्य शीट बनाएँ`,copied:`कॉपी हो गया: इसे अपने एजेंट में चिपकाएँ।`,failed:`sheet.ts नहीं चल रहा: इसकी बनाई शीटें पिछली स्थिति में रहती हैं।`},scenario:{manager:`परिदृश्य प्रबंधक`,scenarios:`परिदृश्य:`,changing:`बदलने वाले सेल:`,show:`दिखाएँ`,close:`बंद करें`,base:`आधार स्थिति`,showing:`दिख रहा है`,on:e=>`परिदृश्य: ${e}`},files:{insert:`फ़ाइल डालें…`,open:`खोलें`,remove:`सेल से हटाएँ`,notColumn:`इस कॉलम में फ़ाइलें नहीं हैं।`},undo:`पूर्ववत करें`,redo:`फिर से करें`,font:`फ़ॉन्ट`,fontSize:`फ़ॉन्ट आकार`,bold:`बोल्ड`,italic:`इटैलिक`,underline:`रेखांकित`,fillColor:`भरण रंग`,fontColor:`फ़ॉन्ट रंग`,noFill:`कोई भरण नहीं`,automatic:`स्वचालित`,alignLeft:`बाएँ संरेखित करें`,center:`केंद्र`,alignRight:`दाएँ संरेखित करें`,wrapText:`टेक्स्ट रैप करें`,numberFormat:`संख्या स्वरूप`,custom:`कस्टम`,formats:{general:`सामान्य`,number:`संख्या`,currency:`मुद्रा`,accounting:`लेखांकन`,shortDate:`संक्षिप्त तिथि`,longDate:`दीर्घ तिथि`,time:`समय`,percentage:`प्रतिशत`,fraction:`भिन्न`,scientific:`वैज्ञानिक`,text:`टेक्स्ट`},insert:`सम्मिलित करें`,delete:`हटाएँ`,insertRows:`शीट पंक्तियाँ सम्मिलित करें`,insertColumns:`शीट स्तंभ सम्मिलित करें`,insertSheet:`शीट सम्मिलित करें`,deleteRows:`शीट पंक्तियाँ हटाएँ`,deleteColumns:`शीट स्तंभ हटाएँ`,deleteSheet:`शीट हटाएँ`,nameBox:`नाम बॉक्स`,formulaBar:`सूत्र पट्टी`,cancel:`रद्द करें`,enter:`दर्ज करें`,insertFunction:`फ़ंक्शन सम्मिलित करें`,sheetTabs:`शीट`,newSheet:`नई शीट`,allSheets:`सभी शीट`,sheetMenu:`शीट मेन्यू`,zoom:`ज़ूम`,zoomIn:`ज़ूम इन करें`,zoomOut:`ज़ूम आउट करें`,duplicate:`डुप्लिकेट करें`,namesList:`नाम`,rename:`नाम बदलें`,sheetName:e=>`पत्रक${String(e)}`,average:`औसत`,count:`गणना`,sum:`योग`,changed:(e,t)=>`${e} ने ${String(t)} चीज़ें बदलीं`,changedElsewhere:e=>`अन्य जगह से ${String(e)} बदलाव`,previous:`पिछला`,next:`अगला`,keep:`रखें`,keepAll:`सब रखें`,undoAll:`सब पूर्ववत करें`,was:e=>`पहले: ${e}`,rowAdded:`पंक्ति जोड़ी गई`,rowRemoved:`पंक्ति हटाई गई`,fileChanged:`पंक्तियाँ फिर से लिखी गईं`,bothChanged:e=>`आपने और ${e} ने एक ही चीज़ बदली। आपका बदलाव रहेगा।`,formulaProblem:`इस सूत्र में समस्या है।`,columnName:`तालिका के स्तंभ को नाम चाहिए।`,badSheetName:`शीट के नाम में अधिकतम 31 वर्ण हो सकते हैं और \\ / ? * [ ] : नहीं हो सकते।`,sheetTaken:`इस नाम की शीट पहले से है।`,lastSheet:`कार्यपुस्तिका में कम से कम एक दिखने वाली शीट रहनी चाहिए।`,tableHeader:`तालिका की शीर्ष पंक्ति हटाई नहीं जा सकती।`,badName:`यह नाम उपयोग नहीं किया जा सकता।`,badReference:`संदर्भ मान्य नहीं है।`,overwrite:`इस स्तंभ के सभी कक्षों को इस सूत्र से अधिलेखित करें`,dialog:{ok:`ठीक`,cancel:`रद्द करें`},number:{more:`अधिक संख्या स्वरूप…`,accounting:`लेखांकन संख्या स्वरूप`,percent:`प्रतिशत शैली`,comma:`अल्पविराम शैली`,increaseDecimal:`दशमलव बढ़ाएँ`,decreaseDecimal:`दशमलव घटाएँ`},borders:{title:`बॉर्डर`,bottom:`निचला बॉर्डर`,top:`ऊपरी बॉर्डर`,left:`बायाँ बॉर्डर`,right:`दायाँ बॉर्डर`,none:`कोई बॉर्डर नहीं`,all:`सभी बॉर्डर`,outside:`बाहरी बॉर्डर`,thickOutside:`मोटे बाहरी बॉर्डर`,bottomDouble:`निचला दोहरा बॉर्डर`,thickBottom:`मोटा निचला बॉर्डर`,topBottom:`ऊपरी और निचला बॉर्डर`,topThickBottom:`ऊपरी और मोटा निचला बॉर्डर`,topDoubleBottom:`ऊपरी और दोहरा निचला बॉर्डर`,more:`अधिक बॉर्डर…`},arrange:{cells:`सेल`,mergeCenter:`मर्ज करें और केंद्र में रखें`,mergeMenu:`मर्ज विकल्प`,mergeAcross:`आर-पार मर्ज करें`,mergeCells:`कक्ष मर्ज करें`,unmerge:`कक्षों को अनमर्ज करें`,mergeTable:`तालिका के कक्ष मर्ज नहीं किए जा सकते।`,mergeLoses:`कक्ष मर्ज करने पर केवल ऊपरी-बाएँ कक्ष का मान रहता है और बाकी मान हट जाते हैं।`,format:`स्वरूप`,fitRows:`पंक्ति की ऊँचाई स्वतः फ़िट करें`,fitColumns:`स्तंभ की चौड़ाई स्वतः फ़िट करें`,hideUnhide:`छिपाएँ और दिखाएँ`,hideRows:`पंक्तियाँ छिपाएँ`,hideColumns:`स्तंभ छिपाएँ`,hideSheet:`शीट छिपाएँ`,unhideRows:`पंक्तियाँ दिखाएँ`,unhideColumns:`स्तंभ दिखाएँ`,unhideSheet:`शीट दिखाएँ`,unhideEllipsis:`दिखाएँ…`,freezePanes:`फलक फ़्रीज़ करें`,unfreeze:`फलक अनफ़्रीज़ करें`,freezeTopRow:`शीर्ष पंक्ति फ़्रीज़ करें`,freezeFirstColumn:`पहला स्तंभ फ़्रीज़ करें`,tabColor:`टैब का रंग`,noColor:`कोई रंग नहीं`},sortFilter:{title:`सॉर्ट और फ़िल्टर`,customSort:`कस्टम सॉर्ट…`,filter:`फ़िल्टर`,clear:`साफ़ करें`,reapply:`पुनः लागू करें`,noData:`डेटा वाली श्रेणी का कोई कक्ष चुनें और फिर से प्रयास करें।`},filter:{aToZ:`A से Z तक सॉर्ट करें`,zToA:`Z से A तक सॉर्ट करें`,aToZShort:`A से Z`,zToAShort:`Z से A`,smallest:`सबसे छोटे से सबसे बड़े तक सॉर्ट करें`,largest:`सबसे बड़े से सबसे छोटे तक सॉर्ट करें`,oldest:`सबसे पुराने से सबसे नए तक सॉर्ट करें`,newest:`सबसे नए से सबसे पुराने तक सॉर्ट करें`,clearFrom:e=>`"${e}" से फ़िल्टर साफ़ करें`,search:`खोजें`,selectAll:`(सभी चुनें)`,blanks:`(रिक्त)`,found:(e,t)=>`${String(t)} में से ${String(e)} रिकॉर्ड मिले`},sort:{title:`सॉर्ट करें`,addLevel:`स्तर जोड़ें`,deleteLevel:`स्तर हटाएँ`,hasHeaders:`मेरे डेटा में शीर्षक हैं`,sortBy:`इसके अनुसार सॉर्ट करें`,thenBy:`फिर इसके अनुसार`,column:e=>`स्तंभ ${e}`},rules:{title:`सशर्त स्वरूपण`,highlight:`कक्ष हाइलाइट नियम`,topBottom:`शीर्ष/निचले नियम`,greaterThan:`इससे बड़ा…`,lessThan:`इससे छोटा…`,between:`इनके बीच…`,equalTo:`इसके बराबर…`,textContains:`इसे शामिल करने वाला टेक्स्ट…`,duplicateValues:`डुप्लिकेट मान…`,top10:`शीर्ष 10 आइटम…`,top10Percent:`शीर्ष 10%…`,bottom10:`निचले 10 आइटम…`,bottom10Percent:`निचले 10%…`,aboveAverage:`औसत से ऊपर…`,belowAverage:`औसत से नीचे…`,dataBars:`डेटा बार`,colorScales:`रंग स्केल`,iconSets:`आइकन सेट`,clearRules:`नियम साफ़ करें`,clearSelected:`चयनित कक्षों से नियम साफ़ करें`,clearSheet:`पूरी शीट से नियम साफ़ करें`,greaterPrompt:`इससे बड़े कक्षों को स्वरूपित करें:`,lessPrompt:`इससे छोटे कक्षों को स्वरूपित करें:`,betweenPrompt:`इनके बीच के कक्षों को स्वरूपित करें:`,equalPrompt:`इसके बराबर कक्षों को स्वरूपित करें:`,textPrompt:`यह टेक्स्ट वाले कक्षों को स्वरूपित करें:`,duplicatePrompt:`इन मानों वाले कक्षों को स्वरूपित करें:`,topPrompt:`शीर्ष क्रम वाले कक्षों को स्वरूपित करें:`,topPercentPrompt:`शीर्ष क्रम वाले कक्षों को स्वरूपित करें (प्रतिशत):`,bottomPrompt:`निचले क्रम वाले कक्षों को स्वरूपित करें:`,bottomPercentPrompt:`निचले क्रम वाले कक्षों को स्वरूपित करें (प्रतिशत):`,abovePrompt:`औसत से ऊपर वाले कक्षों को स्वरूपित करें:`,belowPrompt:`औसत से नीचे वाले कक्षों को स्वरूपित करें:`,and:`और`,with:`के साथ`,duplicate:`डुप्लिकेट`,unique:`अद्वितीय`,looks:{lightRed:`गहरे लाल टेक्स्ट के साथ हल्का लाल भरण`,yellow:`गहरे पीले टेक्स्ट के साथ पीला भरण`,green:`गहरे हरे टेक्स्ट के साथ हरा भरण`,lightRedFill:`हल्का लाल भरण`,redText:`लाल टेक्स्ट`,redBorder:`लाल बॉर्डर`},scales:{greenYellowRed:`हरा - पीला - लाल`,redYellowGreen:`लाल - पीला - हरा`,blueWhiteRed:`नीला - सफ़ेद - लाल`,whiteRed:`सफ़ेद - लाल`,whiteGreen:`सफ़ेद - हरा`},icons:{"3Arrows":`3 तीर`,"5Arrows":`5 तीर`,"3TrafficLights1":`3 ट्रैफ़िक लाइट`,"4TrafficLights":`4 ट्रैफ़िक लाइट`,"3Symbols":`3 प्रतीक`,"3Flags":`3 झंडे`,"5Rating":`5 रेटिंग`}},validation:{title:`डेटा सत्यापन`,clearAll:`सभी साफ़ करें`,settings:`सेटिंग्स`,inputMessage:`इनपुट संदेश`,errorAlert:`त्रुटि चेतावनी`,allow:`अनुमति दें`,kinds:{any:`कोई भी मान`,whole:`पूर्ण संख्या`,decimal:`दशमलव`,list:`सूची`,date:`तिथि`,time:`समय`,textLength:`टेक्स्ट की लंबाई`,custom:`कस्टम`},ignoreBlank:`रिक्त को अनदेखा करें`,dropdown:`कक्ष में ड्रॉपडाउन`,data:`डेटा`,operators:{between:`के बीच`,notBetween:`के बीच नहीं`,equal:`के बराबर`,notEqual:`के बराबर नहीं`,greaterThan:`से बड़ा`,lessThan:`से छोटा`,greaterThanOrEqual:`से बड़ा या बराबर`,lessThanOrEqual:`से छोटा या बराबर`},source:`स्रोत`,formula:`सूत्र`,minimum:`न्यूनतम`,maximum:`अधिकतम`,value:`मान`,showPrompt:`कक्ष चुनने पर इनपुट संदेश दिखाएँ`,titleWord:`शीर्षक`,showError:`अमान्य डेटा दर्ज होने पर त्रुटि चेतावनी दिखाएँ`,style:`शैली`,styles:{stop:`रोकें`,warning:`चेतावनी`,information:`जानकारी`},errorMessage:`त्रुटि संदेश`,refusedTitle:`मान की अनुमति नहीं है`,refused:`यह मान इस कक्ष के लिए तय डेटा सत्यापन प्रतिबंधों से मेल नहीं खाता।`,retry:`पुनः प्रयास करें`,no:`नहीं`,yes:`हाँ`,continue:`जारी रखें?`},menu:{cut:`काटें`,copy:`कॉपी करें`,paste:`चिपकाएँ`,pasteSpecial:`विशेष चिपकाएँ`,values:`मान`,formulas:`सूत्र`,formats:`स्वरूप`,entireRow:`पूरी पंक्ति`,entireColumn:`पूरा स्तंभ`,clearContents:`सामग्री साफ़ करें`,filter:`फ़िल्टर`,sort:`सॉर्ट करें`,filterByValue:`चयनित कक्ष के मान से फ़िल्टर करें`,formatCells:`कक्षों को स्वरूपित करें…`,pickFromList:`ड्रॉप-डाउन सूची से चुनें…`,rowHeight:`पंक्ति की ऊँचाई…`,columnWidth:`स्तंभ की चौड़ाई…`,rowHeightWord:`पंक्ति की ऊँचाई`,columnWidthWord:`स्तंभ की चौड़ाई`,hide:`छिपाएँ`,unhide:`दिखाएँ`,multiple:`यह आदेश एकाधिक चयनों पर उपयोग नहीं किया जा सकता।`,tableMove:`तालिका के शीर्षक का कोई भाग ले जाया नहीं जा सकता।`},fill:{options:`स्वतः भरण विकल्प`,copy:`कक्ष कॉपी करें`,series:`शृंखला भरें`},formatCells:{title:`कक्षों को स्वरूपित करें`,tabs:{number:`संख्या`,alignment:`संरेखण`,font:`फ़ॉन्ट`,border:`बॉर्डर`,fill:`भरण`},category:`श्रेणी`,categories:{general:`सामान्य`,number:`संख्या`,currency:`मुद्रा`,accounting:`लेखांकन`,date:`तिथि`,time:`समय`,percentage:`प्रतिशत`,fraction:`भिन्न`,scientific:`वैज्ञानिक`,text:`टेक्स्ट`,custom:`कस्टम`},sample:`नमूना`,decimals:`दशमलव स्थान`,thousands:`1000 विभाजक (,) का उपयोग करें`,symbol:`प्रतीक`,none:`कोई नहीं`,negative:`ऋणात्मक संख्याएँ`,type:`प्रकार`,horizontal:`क्षैतिज`,vertical:`लंबवत`,aligns:{general:`सामान्य`,left:`बाएँ (इंडेंट)`,center:`केंद्र`,right:`दाएँ (इंडेंट)`,fill:`भरण`,justify:`औचित्य`,centerContinuous:`चयन के बीच केंद्र`,distributed:`वितरित (इंडेंट)`},valigns:{top:`ऊपर`,center:`केंद्र`,bottom:`नीचे`,justify:`औचित्य`,distributed:`वितरित`},indent:`इंडेंट`,orientation:`डिग्री`,shrink:`फ़िट होने के लिए सिकोड़ें`,strikethrough:`स्ट्राइकथ्रू`,borderNone:`कोई नहीं`,borderOutline:`बाहरी रेखा`,borderInside:`भीतरी`,lineStyle:`शैली`,lineColor:`रंग`,lines:{thin:`पतली`,hair:`बहुत पतली`,dotted:`बिंदीदार`,dashed:`डैश वाली`,dashDot:`डैश बिंदु`,dashDotDot:`डैश बिंदु बिंदु`,medium:`मध्यम`,mediumDashed:`मध्यम डैश वाली`,mediumDashDot:`मध्यम डैश बिंदु`,thick:`मोटी`,double:`दोहरी`},edges:{top:`ऊपर`,horizontal:`भीतरी क्षैतिज`,bottom:`नीचे`,left:`बाएँ`,vertical:`भीतरी लंबवत`,right:`दाएँ`}},chart:{insert:`चार्ट डालें`,design:`चार्ट डिज़ाइन`,changeType:`चार्ट प्रकार बदलें`,selectData:`डेटा चुनें`,dataRange:`चार्ट डेटा श्रेणी`,title:`चार्ट शीर्षक`,legend:`लेजेंड`,legendNone:`कोई नहीं`,legendAt:{right:`दाएँ`,top:`ऊपर`,left:`बाएँ`,bottom:`नीचे`},noData:`इस श्रेणी में चार्ट बनाने के लिए कोई संख्या नहीं है।`,buttons:{columnBar:`कॉलम या बार चार्ट डालें`,lineArea:`लाइन या एरिया चार्ट डालें`,pieDoughnut:`पाई या डोनट चार्ट डालें`,scatter:`स्कैटर (X, Y) चार्ट डालें`},groups:{column2d:`2-D कॉलम`,bar2d:`2-D बार`,line2d:`2-D लाइन`,area2d:`2-D एरिया`,pie2d:`2-D पाई`,doughnut:`डोनट`,scatter:`स्कैटर`},types:{"column-clustered":`क्लस्टर्ड कॉलम`,"column-stacked":`स्टैक्ड कॉलम`,"column-stacked-100":`100% स्टैक्ड कॉलम`,"bar-clustered":`क्लस्टर्ड बार`,"bar-stacked":`स्टैक्ड बार`,"bar-stacked-100":`100% स्टैक्ड बार`,line:`लाइन`,"line-markers":`मार्कर वाली लाइन`,area:`एरिया`,"area-stacked":`स्टैक्ड एरिया`,"area-stacked-100":`100% स्टैक्ड एरिया`,pie:`पाई`,doughnut:`डोनट`,scatter:`स्कैटर`,"scatter-lines":`सीधी रेखाओं और मार्कर वाला स्कैटर`,"scatter-smooth":`चिकनी रेखाओं वाला स्कैटर`},name:e=>`चार्ट ${String(e)}`},spillBlocked:`स्पिल श्रेणी खाली नहीं है`}});function ZE(){return XE.of(ae()?.locale)}function QE(e,t,n){let r=e.columns.at(t,e.columnCount),i=e.rows.at(n,e.rowCount);return{col:r,row:i,x:Math.max(0,Math.round(t-e.columns.offset(r))),y:Math.max(0,Math.round(n-e.rows.offset(i)))}}function $E(e,t){return{left:e.columns.offset(t.at.col)+(t.spec.x??0),top:e.rows.offset(t.at.row)+(t.spec.y??0),...xl(t.spec)}}var eD=[{id:`nw`,x:-1,y:-1},{id:`n`,x:0,y:-1},{id:`ne`,x:1,y:-1},{id:`e`,x:1,y:0},{id:`se`,x:1,y:1},{id:`s`,x:0,y:1},{id:`sw`,x:-1,y:1},{id:`w`,x:-1,y:0}],tD=40;function nD(e,t,n,r){if(!t)return{...e,left:Math.max(0,e.left+n),top:Math.max(0,e.top+r)};let i=Math.max(tD,e.width+t.x*n),a=Math.max(tD,e.height+t.y*r);return{left:t.x<0?e.left+e.width-i:e.left,top:t.y<0?e.top+e.height-a:e.top,width:i,height:a}}function rD(e){let{calc:t,sheet:n,chart:r,revision:i,width:a,height:o}=e,s=(0,k.useRef)(null),c=(0,k.useMemo)(()=>bl(t,n,r),[t,n,r,i]);return(0,k.useLayoutEffect)(()=>{s.current&&(s.current.innerHTML=Dl({...c,...r.spec.color===void 0?{font_color:{rgb:`var(--allyhub-lead)`}}:{},value_axis:{gridline_color:{rgb:`var(--allyhub-rule)`},...c.value_axis}},a,o,{paper:`var(--allyhub-sheet)`,edge:`var(--allyhub-rule-strong)`}))},[c,r.spec.color,a,o]),(0,A.jsx)(`div`,{ref:s,className:`sheet-chart-picture`})}function iD(e){let{chart:t,selected:n}=e,[r,i]=(0,k.useState)(),a=(0,k.useRef)(void 0),[,o]=(0,k.useState)(!1);(0,k.useEffect)(()=>{let e=requestAnimationFrame(()=>{o(!0)});return()=>{cancelAnimationFrame(e)}},[]);let s=e.view(),c=r??(s?$E(s,t):void 0);if(!c)return null;let l=xl(t.spec),u=(n,r)=>{if(n.button!==0||(n.preventDefault(),n.stopPropagation(),e.onSelect(),e.disabled))return;let i=e.view();i&&(n.currentTarget.setPointerCapture(n.pointerId),a.current={from:$E(i,t),x:n.clientX,y:n.clientY,handle:r,moved:!1})},d=t=>{let n=a.current;if(!n)return;let r=(t.clientX-n.x)/e.zoom,o=(t.clientY-n.y)/e.zoom;!n.moved&&Math.abs(r)+Math.abs(o)<2||(n.moved=!0,i(nD(n.from,n.handle,r,o)))},f=t=>{let n=a.current;if(a.current=void 0,!n?.moved)return;let r=(t.clientX-n.x)/e.zoom,o=(t.clientY-n.y)/e.zoom;e.onPlaced(nD(n.from,n.handle,r,o),n.handle!==void 0),i(void 0)};return(0,A.jsxs)(`div`,{className:`sheet-chart`,"data-testid":`sheet-chart`,"data-index":t.index,"data-selected":n?``:void 0,"data-box":`${String(c.left)},${String(c.top)}`,style:{left:c.left-(s?.scrollX??0),top:c.top-(s?.scrollY??0),width:c.width,height:c.height},onPointerDown:e=>{u(e,void 0)},onPointerMove:d,onPointerUp:f,onPointerCancel:f,onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),e.onMenu(t.clientX,t.clientY)},children:[(0,A.jsx)(rD,{calc:e.calc,sheet:e.sheet,chart:t,revision:e.revision,width:r?.width??l.width,height:r?.height??l.height}),n?eD.map(e=>(0,A.jsx)(`span`,{className:`sheet-chart-handle`,"data-handle":e.id,"data-testid":`sheet-chart-handle-${e.id}`,onPointerDown:t=>{u(t,e)},onPointerMove:d,onPointerUp:f,onPointerCancel:f},e.id)):null]})}var aD=[{id:`columnBar`,icon:ot,groups:[{head:`column2d`,types:[`column-clustered`,`column-stacked`,`column-stacked-100`]},{head:`bar2d`,types:[`bar-clustered`,`bar-stacked`,`bar-stacked-100`]}]},{id:`lineArea`,icon:st,groups:[{head:`line2d`,types:[`line`,`line-markers`]},{head:`area2d`,types:[`area`,`area-stacked`,`area-stacked-100`]}]},{id:`pieDoughnut`,icon:ct,groups:[{head:`pie2d`,types:[`pie`]},{head:`doughnut`,types:[`doughnut`]}]},{id:`scatter`,icon:lt,groups:[{head:`scatter`,types:[`scatter`,`scatter-lines`,`scatter-smooth`]}]}];function oD(e){let t=ZE();return e.groups.map((n,r)=>(0,A.jsxs)(`div`,{children:[r>0?(0,A.jsx)(x,{}):null,(0,A.jsx)(ce,{className:`text-xs`,children:t.chart.groups[n.head]}),n.types.map(n=>(0,A.jsx)(E,{"data-testid":`sheet-chart-type-${n}`,"data-on":e.on===n?``:void 0,onSelect:()=>{e.onPick(n)},children:t.chart.types[n]},n))]},n.head))}function sD(e){let t=ZE(),n=t=>{t.preventDefault(),e.onDone()};return(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{className:`sheet-chart-buttons`,children:aD.map(({id:r,icon:i,groups:a})=>(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(ke,{icon:!0,"aria-label":t.chart.buttons[r],title:t.chart.buttons[r],disabled:e.disabled,"data-testid":`sheet-chart-insert-${r}`,children:(0,A.jsx)(i,{})})}),(0,A.jsx)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:n,children:(0,A.jsx)(oD,{groups:a,onPick:e.onInsert})})]},r))}),(0,A.jsx)(`span`,{className:`sheet-chart-button`,children:(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{icon:!0,className:`w-auto px-1`,"aria-label":t.chart.insert,title:t.chart.insert,disabled:e.disabled,"data-testid":`sheet-chart-insert`,children:[(0,A.jsx)(ot,{}),(0,A.jsx)(me,{})]})}),(0,A.jsx)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:n,children:aD.map(({id:n,icon:r,groups:i})=>(0,A.jsxs)(S,{children:[(0,A.jsxs)(D,{"data-testid":`sheet-chart-insert-one-${n}`,children:[(0,A.jsx)(r,{}),t.chart.buttons[n]]}),(0,A.jsx)(re,{className:`text-xs`,children:(0,A.jsx)(oD,{groups:i,onPick:e.onInsert})})]},n))})]})})]})}var cD=[`right`,`top`,`left`,`bottom`];function lD(e){let t=ZE(),{spec:n}=e.chart,r=Pl(e.calc,e.sheet,e.chart)??``,[i,a]=(0,k.useState)(!1),[o,s]=(0,k.useState)(r),[c,l]=(0,k.useState)(!1),[u,d]=(0,k.useState)(n.title??``),[f,p]=(0,k.useState)(n.title);return f!==n.title&&(p(n.title),d(n.title??``)),(0,A.jsxs)(`div`,{className:`sheet-chart-design`,"data-testid":`sheet-chart-design`,children:[(0,A.jsx)(`span`,{className:`sheet-chart-design-tab`,children:t.chart.design}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:e.disabled,"data-testid":`sheet-chart-change-type`,children:[(0,A.jsx)(Et,{}),t.chart.changeType]})}),(0,A.jsx)(y,{align:`start`,className:`max-h-96 overflow-y-auto text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:aD.map((t,r)=>(0,A.jsxs)(`div`,{children:[r>0?(0,A.jsx)(x,{}):null,(0,A.jsx)(oD,{groups:t.groups,on:n.type,onPick:e.onType})]},t.id))})]}),(0,A.jsxs)(pe,{open:i,onOpenChange:e=>{a(e),e&&(s(r),l(!1))},children:[(0,A.jsx)(he,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:e.disabled,"data-testid":`sheet-chart-select-data`,children:[(0,A.jsx)(ut,{}),t.chart.selectData]})}),(0,A.jsx)(De,{align:`start`,className:`sheet-chart-data`,children:(0,A.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e.onData(o)?(a(!1),e.onDone()):l(!0)},children:[(0,A.jsxs)(`label`,{children:[(0,A.jsx)(`span`,{children:t.chart.dataRange}),(0,A.jsx)(tt,{value:o,"aria-invalid":c,"data-testid":`sheet-chart-data-range`,spellCheck:!1,onChange:e=>{s(e.target.value),l(!1)}})]}),c?(0,A.jsx)(`p`,{role:`alert`,children:t.chart.noData}):null,(0,A.jsx)(C,{type:`submit`,size:`sm`,"data-testid":`sheet-chart-data-ok`,children:t.dialog.ok})]})})]}),(0,A.jsxs)(`label`,{className:`sheet-chart-title`,children:[(0,A.jsx)(vt,{"aria-hidden":!0}),(0,A.jsx)(`input`,{"aria-label":t.chart.title,placeholder:t.chart.title,value:u,disabled:e.disabled,"data-testid":`sheet-chart-title`,onChange:e=>{d(e.target.value)},onKeyDown:t=>{t.stopPropagation(),t.key===`Enter`?(t.preventDefault(),t.currentTarget.blur(),e.onDone()):t.key===`Escape`&&(d(n.title??``),e.onDone())},onBlur:()=>{let t=u.trim();t!==(n.title??``)&&e.onTitle(t===``?void 0:t)}})]}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:e.disabled,"data-testid":`sheet-chart-legend`,children:[(0,A.jsx)(bt,{}),t.chart.legend]})}),(0,A.jsxs)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[(0,A.jsx)(E,{"data-testid":`sheet-chart-legend-none`,"data-on":n.legend===void 0?``:void 0,onSelect:()=>{e.onLegend(void 0)},children:t.chart.legendNone}),cD.map(r=>(0,A.jsx)(E,{"data-testid":`sheet-chart-legend-${r}`,"data-on":n.legend===r?``:void 0,onSelect:()=>{e.onLegend(r)},children:t.chart.legendAt[r]},r))]})]})]})}function uD(e,t,n){let r=t=>!e.charts.some(e=>e.at.col===t&&e.at.row===n),i=t+2;for(;!r(i);)i+=8;return{row:n,col:i}}var dD=`Carlito, Arial, sans-serif`,fD=[`Calibri`,`Arial`,`Courier New`,`Georgia`,`Tahoma`,`Times New Roman`,`Verdana`],pD=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];function mD(e,t=1){let n=e.font??`Calibri`,r=(e.size??11)*4*t/3,i=`"${n.replace(/["\\]/gu,``)}"`;return`${e.italic===!0?`italic `:``}${e.bold===!0?`bold `:``}${String(r)}px ${i}, ${dD}`}var hD=[`#000000`,`#4472C4`,`#ED7D31`,`#A5A5A5`,`#FFC000`,`#5B9BD5`,`#70AD47`],gD=(e,t)=>{let n=Number.parseInt(e.slice(1),16),r=e=>Math.round(e+(255-e)*t).toString(16).padStart(2,`0`);return`#${r(n>>16)}${r(n>>8&255)}${r(n&255)}`};function _D(e){if(e===`none`)return;let t=/^TableStyle(Light|Medium|Dark)(\d+)$/u.exec(e??`TableStyleMedium2`),n=hD[(Number(t?.[2]??2)-1)%hD.length]??`#4472C4`;return t?.[1]===`Light`?{band:gD(n,.8),rule:n}:{headFill:n,headColor:`#FFFFFF`,band:gD(n,.8),rule:gD(n,.4)}}function vD(e,t,n){let r=e.tableAt(t,n);if(!r)return;let i=_D(r.spec.style);if(i)return t===r.at.row?{bold:!0,...i.headFill===void 0?{}:{fill:i.headFill},...i.headColor===void 0?{}:{color:i.headColor}}:(t-r.at.row)%2==1?{fill:i.band}:{}}var yD=[{id:`general`,code:void 0},{id:`number`,code:`0.00`},{id:`currency`,code:`$#,##0.00`},{id:`accounting`,code:`_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)`},{id:`shortDate`,code:`m/d/yyyy`},{id:`longDate`,code:`dddd, mmmm d, yyyy`},{id:`time`,code:`h:mm:ss AM/PM`},{id:`percentage`,code:`0.00%`},{id:`fraction`,code:`# ?/?`},{id:`scientific`,code:`0.00E+00`},{id:`text`,code:`@`}];function bD(e){if(e===void 0||e===`General`)return`general`;let t=yD.find(t=>t.code===e);if(t)return t.id;if(ll(e))return/[dy]/iu.test(e.replace(/\[[^\]]*\]/gu,``))?`shortDate`:`time`;let n=e.replace(/"[^"]*"|\\.|\[[^\]]*\]/gu,``);return n.includes(`%`)?`percentage`:/E[+-]/u.test(n)?`scientific`:n.includes(`?/`)?`fraction`:n.startsWith(`_(`)&&n.includes(`$*`)?`accounting`:n.startsWith(`_(`)&&n.includes(`*`)?`number`:/[$€£¥₹]/u.test(n)?`currency`:/^[#,0.]+(?:_\)|;|$)/u.test(n)?`number`:void 0}var xD=[`#FFFFFF`,`#000000`,`#E7E6E6`,`#44546A`,`#4472C4`,`#ED7D31`,`#A5A5A5`,`#FFC000`,`#5B9BD5`,`#70AD47`],SD=[`#C00000`,`#FF0000`,`#FFC000`,`#FFFF00`,`#92D050`,`#00B050`,`#00B0F0`,`#0070C0`,`#002060`,`#7030A0`],CD=e=>e.startsWith(`'`)||e.startsWith(`=`)?e:`'${e}`,wD=`_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)`,TD=`_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)`,ED=/"[^"]*"|\\.|_.|\*.|\[[^\]]*\]/gu;function DD(e){let t=e.replace(ED,e=>` `.repeat(e.length)),n=t.search(/[Ee][+-]/u),r=[...(n<0?t:t.slice(0,n)).matchAll(/[0#?][0#?,]*(?:\.[0#?]*)?|\.[0#?]+/gu)],i=r[r.length-1];if(i)return{start:i.index,end:i.index+i[0].length}}function OD(e,t){let n=DD(e);if(!n)return e;let r=e.slice(n.start,n.end),i=r.indexOf(`.`),a;return a=t>0?i<0?`${r}.0`:`${r}0`:i<0?r:r.length-i-1<=1?r.slice(0,i):r.slice(0,-1),e.slice(0,n.start)+a+e.slice(n.end)}function kD(e){let t=[],n=0,r=0;for(;n<e.length;){let i=e.charAt(n);if(i===`"`){if(n=e.indexOf(`"`,n+1),n<0)break}else i===`\\`||i===`_`||i===`*`?n+=1:i===`;`&&(t.push(e.slice(r,n)),r=n+1);n+=1}return t.push(e.slice(r)),t}function AD(e){if(typeof e!=`number`)return 0;let t=On(e),n=t.indexOf(`.`);return n<0?0:t.length-n-1}function jD(e,t,n){if(e===void 0||e===`General`){let e=Math.max(0,AD(n)+t);return e===0?`0`:`0.${`0`.repeat(e)}`}return ll(e)||e===`@`?e:kD(e).map(e=>OD(e,t)).join(`;`)}var MD=[`m/d/yyyy`,`dddd, mmmm d, yyyy`,`yyyy-mm-dd`,`m/d/yy`,`d-mmm`,`d-mmm-yy`,`mmm-yy`,`mmmm d, yyyy`],ND=[`h:mm:ss AM/PM`,`h:mm AM/PM`,`h:mm:ss`,`h:mm`,`mm:ss`,`[h]:mm:ss`],PD=[`# ?/?`,`# ??/??`,`# ?/2`,`# ?/4`,`# ?/8`,`# ?/10`,`# ?/100`],FD=[`General`,`0`,`0.00`,`#,##0`,`#,##0.00`,`#,##0_);(#,##0)`,`#,##0.00_);[Red](#,##0.00)`,`$#,##0_);($#,##0)`,`$#,##0.00_);[Red]($#,##0.00)`,`0%`,`0.00%`,`0.00E+00`,`# ?/?`,`m/d/yyyy`,`d-mmm-yy`,`h:mm AM/PM`,`@`],ID=[`$`,`€`,`£`,`¥`,`₹`,``],LD=[`general`,`number`,`currency`,`accounting`,`date`,`time`,`percentage`,`fraction`,`scientific`,`text`,`custom`],RD=e=>e===0?``:`.${`0`.repeat(e)}`,zD=e=>e===``?``:/^[$€£¥]$/u.test(e)?e:`"${e}"`;function BD(e,t){switch(t){case`minus`:return e;case`red`:return`${e};[Red]${e}`;case`brackets`:return`${e}_);(${e})`;case`redBrackets`:return`${e}_);[Red](${e})`}}function VD(e){let t=RD(e.decimals);switch(e.category){case`general`:return;case`number`:return BD(`${e.thousands?`#,##0`:`0`}${t}`,e.negative);case`currency`:return BD(`${zD(e.symbol)}#,##0${t}`,e.negative);case`accounting`:{let n=zD(e.symbol);return`_(${n}* #,##0${t}_);_(${n}* (#,##0${t});_(${n}* "-"??_);_(@_)`}case`percentage`:return`0${t}%`;case`scientific`:return`0${t}E+00`;case`text`:return`@`;default:return e.code}}var HD=e=>{let[t=``]=kD(e),n=DD(t);if(!n)return 0;let r=t.slice(n.start,n.end),i=r.indexOf(`.`);return i<0?0:r.length-i-1};function UD(e){let t={category:`general`,decimals:2,thousands:!1,symbol:`$`,negative:`minus`,code:e??`General`};if(e===void 0||e===`General`)return t;if(e===`@`)return{...t,category:`text`};if(ND.includes(e))return{...t,category:`time`};if(MD.includes(e)||ll(e))return{...t,category:/[hs]/iu.test(e)&&!/[dy]/iu.test(e)?`time`:`date`};if(PD.includes(e))return{...t,category:`fraction`};let n=HD(e),[r=``]=kD(e),i=/[$€£¥₹]/u.exec(r)?.[0]??``;if(r.startsWith(`_(`)&&e.includes(`*`))return{...t,category:`accounting`,decimals:n,symbol:i};if(/^0(?:\.0+)?%$/u.test(e))return{...t,category:`percentage`,decimals:n};if(/^0(?:\.0+)?E\+00$/u.test(e))return{...t,category:`scientific`,decimals:n};let a=e.includes(`[Red](`)?`redBrackets`:e.includes(`[Red]`)?`red`:e.includes(`_);(`)?`brackets`:`minus`,o={...t,decimals:n,symbol:i,negative:a},s=(t,n)=>VD({...o,category:t,thousands:n})===e?{...o,category:t,thousands:n}:void 0;return s(`number`,!1)??s(`number`,!0)??s(`currency`,!0)??{...t,category:`custom`}}var WD=[`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`],GD=[{id:`greenYellowRed`,colors:[`#63BE7B`,`#FFEB84`,`#F8696B`]},{id:`redYellowGreen`,colors:[`#F8696B`,`#FFEB84`,`#63BE7B`]},{id:`blueWhiteRed`,colors:[`#5A8AC6`,`#FCFCFF`,`#F8696B`]},{id:`whiteRed`,colors:[`#FFFFFF`,`#F8696B`]},{id:`whiteGreen`,colors:[`#FFFFFF`,`#63BE7B`]}],KD=[`3Arrows`,`5Arrows`,`3TrafficLights1`,`4TrafficLights`,`3Symbols`,`3Flags`,`5Rating`];function qD(e){let t=e.icon;return(0,A.jsx)(ke,{icon:!0,"aria-label":e.label,"aria-pressed":e.on,title:e.label,disabled:e.disabled,"data-testid":e.testid,onClick:e.onClick,children:(0,A.jsx)(t,{})})}function JD(e){let t=e.icon,n=t=>(0,A.jsx)(`button`,{type:`button`,"aria-label":t,"data-color":t,className:l(`border-rule size-5 rounded-sm border transition-transform motion-safe:hover:scale-110`,e.value?.toUpperCase()===t&&`ring-pencil ring-2 ring-offset-1`),style:{background:t},onClick:()=>{e.onPick(t)}},t);return(0,A.jsxs)(pe,{children:[(0,A.jsx)(he,{asChild:!0,children:(0,A.jsxs)(ke,{icon:!0,className:`relative`,"aria-label":e.label,title:e.label,disabled:e.disabled,"data-testid":e.testid,children:[(0,A.jsx)(t,{}),(0,A.jsx)(`span`,{className:`absolute inset-x-1.5 bottom-0.5 h-0.5 rounded-full`,style:{background:e.value??`currentColor`}})]})}),(0,A.jsxs)(De,{align:`start`,className:`w-auto p-2`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[(0,A.jsxs)(`div`,{className:`grid grid-cols-10 gap-1`,"data-testid":`${e.testid}-colors`,children:[xD.map(n),SD.map(n)]}),(0,A.jsx)(`button`,{type:`button`,className:`hover:bg-stone-2 mt-1 w-full rounded-sm px-1 py-0.5 text-left text-xs`,"data-testid":`${e.testid}-none`,onClick:()=>{e.onPick(void 0)},children:e.none})]})]})}function YD(e){let t=e.icon;return(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{icon:e.words!==!0,"aria-label":e.label,title:e.label,disabled:e.disabled,"data-testid":e.testid,children:[(0,A.jsx)(t,{}),e.words===!0?(0,A.jsx)(`span`,{className:`@max-[72rem]:hidden`,children:e.label}):null]})}),(0,A.jsx)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:e.children})]})}var XD=new Set([`right`,`thickOutside`]);function ZD(e){let t=ZE(),{look:n,disabled:r,onLook:i}=e,a=e=>n[e]===!0,o=n.underline!==void 0&&n.underline!==!1,s=bD(n.format),c=n.align,l=e=>{i({align:c===e?void 0:e})},u=t=>{t.preventDefault(),e.onDone()},d=typeof n.fill==`string`?n.fill:void 0,f=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{"data-testid":`sheet-insert-rows`,onSelect:()=>{e.onInsert(`rows`)},children:t.insertRows}),(0,A.jsx)(E,{"data-testid":`sheet-insert-columns`,onSelect:()=>{e.onInsert(`columns`)},children:t.insertColumns}),(0,A.jsx)(E,{"data-testid":`sheet-insert-sheet`,onSelect:()=>{e.onInsert(`sheet`)},children:t.insertSheet})]}),p=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{"data-testid":`sheet-delete-rows`,onSelect:()=>{e.onDelete(`rows`)},children:t.deleteRows}),(0,A.jsx)(E,{"data-testid":`sheet-delete-columns`,onSelect:()=>{e.onDelete(`columns`)},children:t.deleteColumns}),(0,A.jsx)(E,{"data-testid":`sheet-delete-sheet`,onSelect:()=>{e.onDelete(`sheet`)},children:t.deleteSheet})]}),m=(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{"data-testid":`sheet-row-height`,onSelect:e.onRowHeight,children:t.menu.rowHeight}),(0,A.jsx)(E,{onSelect:e.onFitRows,children:t.arrange.fitRows}),(0,A.jsx)(E,{"data-testid":`sheet-column-width`,onSelect:e.onColumnWidth,children:t.menu.columnWidth}),(0,A.jsx)(E,{onSelect:e.onFitColumns,children:t.arrange.fitColumns}),(0,A.jsx)(x,{}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-hide-menu`,children:t.arrange.hideUnhide}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-hide-rows`,onSelect:()=>{e.onHide(`rows`)},children:t.arrange.hideRows}),(0,A.jsx)(E,{"data-testid":`sheet-hide-columns`,onSelect:()=>{e.onHide(`columns`)},children:t.arrange.hideColumns}),(0,A.jsx)(E,{"data-testid":`sheet-hide-sheet`,onSelect:()=>{e.onHide(`sheet`)},children:t.arrange.hideSheet}),(0,A.jsx)(x,{}),(0,A.jsx)(E,{"data-testid":`sheet-unhide-rows`,onSelect:()=>{e.onUnhide(`rows`)},children:t.arrange.unhideRows}),(0,A.jsx)(E,{"data-testid":`sheet-unhide-columns`,onSelect:()=>{e.onUnhide(`columns`)},children:t.arrange.unhideColumns}),(0,A.jsx)(E,{"data-testid":`sheet-unhide-sheet`,onSelect:()=>{e.onUnhide(`sheet`)},children:t.arrange.unhideSheet})]})]}),(0,A.jsx)(x,{}),(0,A.jsx)(E,{"data-testid":`sheet-format-cells-item`,onSelect:()=>{e.onFormatCells(`number`)},children:t.menu.formatCells})]});return(0,A.jsxs)(Ce,{testid:`sheet-bar`,onMouseDown:e=>{e.preventDefault()},children:[(0,A.jsxs)(Oe,{children:[(0,A.jsx)(ke,{icon:!0,"aria-label":t.undo,title:t.undo,disabled:!e.canUndo,"data-testid":`sheet-undo`,onClick:e.onUndo,children:(0,A.jsx)(Ye,{})}),(0,A.jsx)(ke,{icon:!0,"aria-label":t.redo,title:t.redo,disabled:!e.canRedo,"data-testid":`sheet-redo`,onClick:e.onRedo,children:(0,A.jsx)(Pe,{})})]}),(0,A.jsxs)(Oe,{children:[(0,A.jsxs)(_e,{value:n.font??`Calibri`,disabled:r,onValueChange:e=>{i({font:e===`Calibri`?void 0:e})},children:[(0,A.jsx)(ge,{"aria-label":t.font,title:t.font,className:`w-24 shrink-0`,"data-testid":`sheet-font`,children:(0,A.jsx)(ve,{children:(0,A.jsx)(`span`,{className:`truncate`,children:n.font??`Calibri`})})}),(0,A.jsx)(Te,{position:`popper`,align:`start`,onCloseAutoFocus:u,children:[...new Set([...fD,n.font??`Calibri`])].map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:e},e))})]}),(0,A.jsxs)(_e,{value:String(n.size??11),disabled:r,onValueChange:e=>{let t=Number(e);i({size:t===11?void 0:t})},children:[(0,A.jsx)(ge,{"aria-label":t.fontSize,title:t.fontSize,className:`w-14 shrink-0`,"data-testid":`sheet-size`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{position:`popper`,align:`start`,onCloseAutoFocus:u,children:[...new Set([...pD,n.size??11])].map(e=>(0,A.jsx)(Se,{value:String(e),className:`text-xs`,children:e},e))})]})]}),(0,A.jsxs)(Oe,{children:[(0,A.jsx)(qD,{label:t.bold,icon:Fe,on:a(`bold`),disabled:r,testid:`sheet-bold`,onClick:()=>{i({bold:!a(`bold`)||void 0})}}),(0,A.jsx)(qD,{label:t.italic,icon:We,on:a(`italic`),disabled:r,testid:`sheet-italic`,onClick:()=>{i({italic:!a(`italic`)||void 0})}}),(0,A.jsx)(qD,{label:t.underline,icon:jt,on:o,disabled:r,testid:`sheet-underline`,onClick:()=>{i({underline:!o||void 0})}}),(0,A.jsxs)(YD,{label:t.borders.title,icon:_t,disabled:r,testid:`sheet-borders`,onDone:e.onDone,children:[KT.map(n=>(0,A.jsxs)(`span`,{children:[(0,A.jsx)(E,{"data-testid":`sheet-border-${n}`,onSelect:()=>{e.onBorders(n)},children:t.borders[n]}),XD.has(n)?(0,A.jsx)(x,{}):null]},n)),(0,A.jsx)(x,{}),(0,A.jsx)(E,{"data-testid":`sheet-border-more`,onSelect:()=>{e.onFormatCells(`border`)},children:t.borders.more})]}),(0,A.jsx)(JD,{label:t.fillColor,icon:Re,none:t.noFill,value:d,disabled:r,testid:`sheet-fill`,onPick:e=>{i({fill:e})},onDone:e.onDone}),(0,A.jsx)(JD,{label:t.fontColor,icon:Ie,none:t.automatic,value:n.color,disabled:r,testid:`sheet-color`,onPick:e=>{i({color:e})},onDone:e.onDone})]}),(0,A.jsxs)(Oe,{children:[(0,A.jsxs)(`span`,{className:`sheet-align-three`,children:[(0,A.jsx)(qD,{label:t.alignLeft,icon:qe,on:c===`left`,disabled:r,testid:`sheet-align-left`,onClick:()=>{l(`left`)}}),(0,A.jsx)(qD,{label:t.center,icon:Ke,on:c===`center`,disabled:r,testid:`sheet-align-center`,onClick:()=>{l(`center`)}}),(0,A.jsx)(qD,{label:t.alignRight,icon:Je,on:c===`right`,disabled:r,testid:`sheet-align-right`,onClick:()=>{l(`right`)}})]}),(0,A.jsx)(`span`,{className:`sheet-align-one`,children:(0,A.jsx)(YD,{label:t.formatCells.tabs.alignment,icon:c===`right`?Je:c===`center`?Ke:qe,disabled:r,testid:`sheet-align-menu`,onDone:e.onDone,children:[[`left`,qe,t.alignLeft],[`center`,Ke,t.center],[`right`,Je,t.alignRight]].map(([e,t,n])=>(0,A.jsxs)(E,{"data-testid":`sheet-align-menu-${e}`,onSelect:()=>{l(e)},children:[(0,A.jsx)(t,{}),n]},e))})}),(0,A.jsx)(YD,{label:t.formatCells.vertical,icon:n.valign===`top`?at:n.valign===`center`?ht:rt,disabled:r,testid:`sheet-valign`,onDone:e.onDone,children:[[`top`,at],[`center`,ht],[`bottom`,rt]].map(([e,n])=>(0,A.jsxs)(E,{"data-testid":`sheet-valign-${e}`,onSelect:()=>{i({valign:e===`bottom`?void 0:e})},children:[(0,A.jsx)(n,{}),t.formatCells.valigns[e]]},e))}),(0,A.jsx)(qD,{label:t.wrapText,icon:At,on:n.wrap===!0,disabled:r,testid:`sheet-wrap`,onClick:()=>{i({wrap:n.wrap!==!0||void 0})}}),(0,A.jsx)(qD,{label:t.arrange.mergeCenter,icon:kt,on:e.merged,disabled:r,testid:`sheet-merge`,onClick:()=>{e.merged?e.onUnmerge():e.onMerge(`center`)}}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(ke,{icon:!0,className:`w-4`,"aria-label":t.arrange.mergeMenu,title:t.arrange.mergeMenu,disabled:r,"data-testid":`sheet-merge-menu`,children:(0,A.jsx)(me,{})})}),(0,A.jsxs)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:u,children:[(0,A.jsx)(E,{"data-testid":`sheet-merge-center`,onSelect:()=>{e.onMerge(`center`)},children:t.arrange.mergeCenter}),(0,A.jsx)(E,{"data-testid":`sheet-merge-across`,onSelect:()=>{e.onMerge(`across`)},children:t.arrange.mergeAcross}),(0,A.jsx)(E,{"data-testid":`sheet-merge-cells`,onSelect:()=>{e.onMerge(`cells`)},children:t.arrange.mergeCells}),(0,A.jsx)(E,{"data-testid":`sheet-unmerge`,onSelect:e.onUnmerge,children:t.arrange.unmerge})]})]})]}),(0,A.jsx)(Oe,{children:(0,A.jsxs)(_e,{value:s??`custom`,disabled:r,onValueChange:t=>{if(t===`more`){e.onFormatCells(`number`);return}let n=yD.find(e=>e.id===t);n&&i({format:n.code})},children:[(0,A.jsx)(ge,{"aria-label":t.numberFormat,title:t.numberFormat,className:`w-32 shrink-0`,"data-testid":`sheet-format`,children:(0,A.jsx)(ve,{children:(0,A.jsx)(`span`,{className:`truncate`,children:s===void 0?t.custom:t.formats[s]})})}),(0,A.jsxs)(Te,{position:`popper`,align:`start`,onCloseAutoFocus:u,children:[s===void 0?(0,A.jsx)(Se,{value:`custom`,className:`text-xs`,children:t.custom}):null,yD.map(n=>(0,A.jsx)(Se,{value:n.id,className:`text-xs`,"data-testid":`sheet-format-${n.id}`,children:(0,A.jsxs)(`span`,{className:`flex w-52 justify-between gap-4`,children:[(0,A.jsx)(`span`,{children:t.formats[n.id]}),(0,A.jsx)(`span`,{className:`text-lead truncate`,children:QD(e.value,n.code)})]})},n.id)),(0,A.jsx)(Se,{value:`more`,className:`text-xs`,"data-testid":`sheet-format-more`,children:t.number.more})]})]})}),(0,A.jsxs)(Oe,{children:[(0,A.jsx)(qD,{label:t.number.accounting,icon:pt,on:s===`accounting`,disabled:r,testid:`sheet-accounting`,onClick:()=>{i({format:TD})}}),(0,A.jsx)(qD,{label:t.number.percent,icon:wt,on:n.format===`0%`,disabled:r,testid:`sheet-percent`,onClick:()=>{i({format:`0%`})}}),(0,A.jsx)(ke,{icon:!0,"aria-label":t.number.comma,title:t.number.comma,"aria-pressed":n.format===wD,disabled:r,"data-testid":`sheet-comma`,className:`font-semibold`,onClick:()=>{i({format:wD})},children:`,`}),(0,A.jsx)(ke,{icon:!0,"aria-label":t.number.increaseDecimal,title:t.number.increaseDecimal,disabled:r,"data-testid":`sheet-more-decimals`,onClick:()=>{e.onDecimals(1)},children:(0,A.jsx)(ft,{})}),(0,A.jsx)(ke,{icon:!0,"aria-label":t.number.decreaseDecimal,title:t.number.decreaseDecimal,disabled:r,"data-testid":`sheet-less-decimals`,onClick:()=>{e.onDecimals(-1)},children:(0,A.jsx)(dt,{})})]}),(0,A.jsx)(Oe,{children:(0,A.jsxs)(YD,{label:t.rules.title,icon:Ot,disabled:r,testid:`sheet-rules`,onDone:e.onDone,children:[(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-rules-highlight`,children:t.rules.highlight}),(0,A.jsx)(re,{className:`text-xs`,children:[[`greaterThan`,t.rules.greaterThan],[`lessThan`,t.rules.lessThan],[`between`,t.rules.between],[`equal`,t.rules.equalTo],[`containsText`,t.rules.textContains],[`duplicateValues`,t.rules.duplicateValues]].map(([t,n])=>(0,A.jsx)(E,{"data-testid":`sheet-rule-${t}`,onSelect:()=>{e.onRule(t)},children:n},t))})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-rules-top`,children:t.rules.topBottom}),(0,A.jsx)(re,{className:`text-xs`,children:[[`top`,t.rules.top10],[`topPercent`,t.rules.top10Percent],[`bottom`,t.rules.bottom10],[`bottomPercent`,t.rules.bottom10Percent],[`above`,t.rules.aboveAverage],[`below`,t.rules.belowAverage]].map(([t,n])=>(0,A.jsx)(E,{"data-testid":`sheet-rule-${t}`,onSelect:()=>{e.onRule(t)},children:n},t))})]}),(0,A.jsx)(x,{}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-rules-bars`,children:t.rules.dataBars}),(0,A.jsx)(re,{className:`text-xs`,children:WD.map((t,n)=>(0,A.jsx)(E,{"data-testid":`sheet-bar-${String(n)}`,onSelect:()=>{e.onDataBar(t)},children:(0,A.jsx)(`span`,{className:`h-3 w-16 rounded-sm`,style:{background:`linear-gradient(90deg, ${t}, ${t}40)`}})},t))})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-rules-scales`,children:t.rules.colorScales}),(0,A.jsx)(re,{className:`text-xs`,children:GD.map(({id:n,colors:r})=>(0,A.jsxs)(E,{"data-testid":`sheet-scale-${n}`,onSelect:()=>{e.onColorScale(r)},children:[(0,A.jsx)(`span`,{className:`h-3 w-16 rounded-sm`,style:{background:`linear-gradient(90deg, ${r.join(`, `)})`}}),t.rules.scales[n]]},n))})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-rules-icons`,children:t.rules.iconSets}),(0,A.jsx)(re,{className:`text-xs`,children:KD.map(n=>(0,A.jsx)(E,{"data-testid":`sheet-icons-${n}`,onSelect:()=>{e.onIcons(n)},children:t.rules.icons[n]},n))})]}),(0,A.jsx)(x,{}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-rules-clear`,children:t.rules.clearRules}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-rules-clear-selected`,onSelect:()=>{e.onClearRules(!1)},children:t.rules.clearSelected}),(0,A.jsx)(E,{"data-testid":`sheet-rules-clear-sheet`,onSelect:()=>{e.onClearRules(!0)},children:t.rules.clearSheet})]})]})]})}),(0,A.jsxs)(Oe,{children:[(0,A.jsxs)(`span`,{className:`sheet-cells`,children:[(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:r,"data-testid":`sheet-insert`,children:[t.insert,(0,A.jsx)(me,{})]})}),(0,A.jsx)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:u,children:f})]}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:r,"data-testid":`sheet-delete`,children:[t.delete,(0,A.jsx)(me,{})]})}),(0,A.jsx)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:u,children:p})]}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:r,"data-testid":`sheet-format-menu`,children:[t.arrange.format,(0,A.jsx)(me,{})]})}),(0,A.jsx)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:u,children:m})]})]}),(0,A.jsx)(`span`,{className:`sheet-cells-one`,children:(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsxs)(ke,{disabled:r,"data-testid":`sheet-cells`,children:[t.arrange.cells,(0,A.jsx)(me,{})]})}),(0,A.jsxs)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:u,children:[(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-cells-insert`,children:t.insert}),(0,A.jsx)(re,{className:`text-xs`,children:f})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-cells-delete`,children:t.delete}),(0,A.jsx)(re,{className:`text-xs`,children:p})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{"data-testid":`sheet-cells-format`,children:t.arrange.format}),(0,A.jsx)(re,{className:`text-xs`,children:m})]})]})]})})]}),(0,A.jsxs)(Oe,{children:[(0,A.jsxs)(YD,{label:t.sortFilter.title,icon:gt,disabled:r,testid:`sheet-sort-filter`,onDone:e.onDone,children:[(0,A.jsxs)(E,{"data-testid":`sheet-sort-up`,onSelect:()=>{e.onSort(!1)},children:[(0,A.jsx)(nt,{}),t.filter.aToZ]}),(0,A.jsxs)(E,{"data-testid":`sheet-sort-down`,onSelect:()=>{e.onSort(!0)},children:[(0,A.jsx)(it,{}),t.filter.zToA]}),(0,A.jsx)(E,{"data-testid":`sheet-sort-custom`,onSelect:e.onCustomSort,children:t.sortFilter.customSort}),(0,A.jsx)(x,{}),(0,A.jsx)(E,{"data-testid":`sheet-filter`,onSelect:e.onFilter,children:t.sortFilter.filter}),(0,A.jsx)(E,{disabled:!e.filtering,"data-testid":`sheet-filter-clear-all`,onSelect:e.onClearFilter,children:t.sortFilter.clear}),(0,A.jsx)(E,{disabled:!e.filtered,"data-testid":`sheet-filter-reapply`,onSelect:e.onReapply,children:t.sortFilter.reapply})]}),(0,A.jsxs)(YD,{label:t.arrange.freezePanes,icon:Tt,disabled:r,testid:`sheet-freeze`,onDone:e.onDone,children:[(0,A.jsx)(E,{"data-testid":`sheet-freeze-panes`,onSelect:()=>{e.onFreeze(e.frozen?`none`:`panes`)},children:e.frozen?t.arrange.unfreeze:t.arrange.freezePanes}),(0,A.jsx)(E,{"data-testid":`sheet-freeze-top`,onSelect:()=>{e.onFreeze(`topRow`)},children:t.arrange.freezeTopRow}),(0,A.jsx)(E,{"data-testid":`sheet-freeze-first`,onSelect:()=>{e.onFreeze(`firstColumn`)},children:t.arrange.freezeFirstColumn})]}),(0,A.jsx)(ke,{icon:!0,"aria-label":t.validation.title,title:t.validation.title,disabled:r,"data-testid":`sheet-validation-button`,onClick:e.onValidation,children:(0,A.jsx)(xt,{})})]}),(0,A.jsxs)(Oe,{children:[(0,A.jsx)(sD,{disabled:r,onInsert:e.onChart,onDone:e.onDone}),e.onScenarios?(0,A.jsx)(ke,{icon:!0,"aria-label":t.scenario.manager,title:t.scenario.manager,"data-testid":`sheet-scenarios-button`,onClick:e.onScenarios,children:(0,A.jsx)(yt,{})}):null]})]})}var QD=(e,t)=>e===null?``:sl(e,t),$D=`\0`,eO=e=>e.join($D),tO=(e,t)=>{if(e===t)return!0;if(!e||!t)return!1;let n=Math.max(e.length,t.length);for(let r=0;r<n;r++)if((e[r]??``)!==(t[r]??``))return!1;return!0},nO=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>tO(e,t[n]));function rO(e,t,n,r,i){if(tO(t,n)||e&&tO(e,t))return n;if(e&&tO(e,n))return t;let a=Math.max(t.length,n.length),o=[],s=!1;for(let r=0;r<a;r++){let i=t[r]??``,a=n[r]??``,c=e?.[r]??``;i===a||a===c?o.push(i):i===c?o.push(a):(o.push(i),s=!0)}return s&&r.push({where:i}),o}function iO(e,t){let n=new Map;for(let r of e.slice(1)){if(r.length===0)continue;let e=r[t]??``;if(e===``||n.has(e))return;n.set(e,r)}return n}function aO(e,t,n,r,i,a,o){let s=[r];for(let[r,i]of n){let n=t.get(r),a=e.get(r);n?s.push(rO(a,n,i,o,r)):a&&!tO(a,i)?(o.push({where:r}),s.push(i)):a||s.push(i)}return i.slice(1).forEach((t,r)=>{let o=t[a]??``;if(t.length===0||n.has(o)||e.has(o))return;let c=i[r]?.[a],l=c===void 0?-1:s.findIndex((e,t)=>t>0&&e[a]===c);l>=0?s.splice(l+1,0,t):s.push(t)}),s}function oO(e,t){let n=ie(e.map(eO),t.map(eO)),r=[],i=0,a=0;for(let[o,s]of[...n,[e.length,t.length]])(o>i||s>a)&&r.push({at:i,end:o,rows:t.slice(a,s)}),i=o+1,a=s+1;return r}function sO(e,t,n,r){let i=oO(e,t),a=oO(e,n),o=[],s=0,c=0,l=0;for(;c<i.length||l<a.length;){let t=i[c],n=a[l],u=Math.min(t?.at??1/0,n?.at??1/0);o.push(...e.slice(s,u)),s=u;let d=t!==void 0&&n!==void 0&&t.at<=n.end&&n.at<=t.end;if(d&&t.at===u&&n.at===u){let i=Math.max(t.end,n.end);nO(t.rows,n.rows)?o.push(...t.rows):t.rows.length===n.rows.length&&t.end===n.end?t.rows.forEach((i,a)=>{let s=n.rows[a];o.push(s?rO(e[t.at+a],i,s,r,String(t.at+a)):i)}):(r.push({where:String(t.at)}),o.push(...n.rows,...t.rows)),s=i,c+=1,l+=1}else if(t?.at===u&&!d)o.push(...t.rows),s=t.end,c+=1;else if(n?.at===u&&!d)o.push(...n.rows),s=n.end,l+=1;else{let e=t?.at===u?t:n,i=e===t?n:t;if(!e||!i)break;r.push({where:String(e.at)}),o.push(...e.rows,...i.rows),s=Math.max(e.end,i.end),c+=1,l+=1}}return o.push(...e.slice(s)),o}function cO(e,t,n){let r=n.map(e=>t.findIndex(t=>t===e));return e.map((e,t)=>t===0||e.length===0?t===0?n:e:r.map(t=>t<0?``:e[t]??``))}function lO(e,t,n,r){if(nO(e,t))return{rows:n,conflicts:[]};if(nO(e,n))return{rows:t,conflicts:[]};let i=[],a=e[0]??[],o=t[0]??[],s=n[0]??[],c=e,l=t;if(!tO(a,s)&&tO(a,o))c=cO(e,a,s),l=cO(t,o,s);else if(!tO(o,s)&&!tO(a,o)){if(!tO(a,s))return{rows:n,conflicts:[{where:`header`}]};let i=cO(n,s,o);return lO(cO(e,a,o),t,i,r)}if(r!==void 0){let e=iO(c,r),t=iO(l,r),a=iO(n,r);if(e&&t&&a)return{rows:aO(e,t,a,n[0]??[],l,r,i),conflicts:i}}return{rows:sO(c,l,n,i),conflicts:i}}var uO=e=>typeof e==`object`&&!!e&&!Array.isArray(e),dO=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t),fO=e=>{let t=uO(e)?e.name:void 0;return typeof t==`string`?t:void 0};function pO(e,t,n,r,i){let a=(e,t)=>e.find(e=>fO(e)===t),o=[];for(let s of n){let n=fO(s)??``,c=a(t,n),l=a(e,n);c===void 0?l!==void 0&&dO(l,s)||o.push(s):o.push(mO(l,c,s,`${r}/${n}`,i))}return t.forEach((r,i)=>{let s=fO(r)??``;if(a(n,s)!==void 0||a(e,s)!==void 0)return;let c=i>0?fO(t[i-1]):void 0,l=o.findIndex(e=>fO(e)===c);o.splice(l<0?o.length:l+1,0,r)}),o}function mO(e,t,n,r,i){if(t===n||e===n)return t;if(e===t||dO(t,n))return n;if(dO(e,n))return t;if(dO(e,t))return n;if(uO(t)&&uO(n)){let a=uO(e)?e:{},o={};for(let e of new Set([...Object.keys(n),...Object.keys(t)])){let s=mO(a[e],t[e],n[e],`${r}/${e}`,i);s!==void 0&&(o[e]=s)}return o}return Array.isArray(t)&&Array.isArray(n)&&[...t,...n].every(e=>fO(e)!==void 0)?pO(Array.isArray(e)?e:[],t,n,r,i):(i.push({where:r}),t)}function hO(e,t,n){let r=[];return{value:mO(e,t,n,``,r),conflicts:r}}var gO=5e3,_O=(e,t)=>t===void 0?void 0:e[t];function vO(e,t,n){let r=e.at(t,n);return r===void 0?``:r instanceof Cr?r.text:sl(r,void 0)}function yO(e,t){let n=[],r=e=>e.sheets.filter(e=>e.generated);for(let i of r(e))t.sheet(i.name)?.generated!==!0&&n.push({kind:`generated`,sheet:i.name});for(let i of r(t)){let t=e.sheet(i.name);if(t?.generated!==!0){n.push({kind:`generated`,sheet:i.name});continue}let r=Math.max(t.lastRow,i.lastRow),a=Math.max(t.columnsUsed,i.columnsUsed)-1;for(let e=0;e<=r;e++)for(let r=0;r<=a;r++){let a=vO(t,e,r),o=vO(i,e,r);if(a!==o){if(n.length>=gO)return n;n.push({kind:`generated`,sheet:i.name,row:e,col:r,before:a,after:o})}}}return n}function bO(e,t,n,r){if(!tO(t[0],n[0]))return[{kind:`file`,file:e,before:t}];let i=[],a=(t,n,a)=>{let o=Math.max(t.length,n.length);for(let s=0;s<o;s++){let o=t[s]??``,c=n[s]??``;o!==c&&i.push({kind:`cell`,file:e,row:n,index:a,column:s,before:o,after:c,...r===void 0?{}:{key:r}})}},o=e=>{if(r===void 0)return;let t=new Map;for(let n of e.slice(1)){if(n.length===0)continue;let e=n[r]??``;if(e===``||t.has(e))return;t.set(e,n)}return t},s=o(t),c=o(n);if(s&&c&&r!==void 0)n.forEach((t,n)=>{if(n===0||t.length===0)return;let o=s.get(t[r]??``);o?a(o,t,n):i.push({kind:`row-added`,file:e,row:t,key:r})}),t.slice(1).forEach((n,a)=>{n.length>0&&!c.has(n[r]??``)&&i.push({kind:`row-removed`,file:e,row:n,previous:a>0?t[a]:void 0})});else{let r=ie(t.map(e=>e.join(`\0`)),n.map(e=>e.join(`\0`))),o=0,s=0;for(let[c,l]of[...r,[t.length,n.length]]){let r=t.slice(o,c),u=n.slice(s,l),d=Math.min(r.length,u.length);for(let e=0;e<d;e++){let t=r[e],n=u[e];t&&n&&a(t,n,s+e)}r.slice(d).forEach((n,r)=>{i.push({kind:`row-removed`,file:e,row:n,previous:t[o+d+r-1]})});for(let t of u.slice(d))i.push({kind:`row-added`,file:e,row:t});o=c+1,s=l+1}}return i.length>gO?[{kind:`file`,file:e,before:t}]:i}var xO=e=>typeof e==`object`&&!!e&&!Array.isArray(e),SO=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t),CO=e=>xO(e)&&typeof e.name==`string`?e.name:void 0;function wO(e,t,n,r){if(SO(e,t))return;let i=TO(n);if(i&&xO(e)&&xO(t))for(let i of new Set([...Object.keys(e),...Object.keys(t)]))wO(e[i],t[i],[...n,i],r);else{if(i&&Array.isArray(e)&&Array.isArray(t)){let i=e,a=t,o=[...i,...a];if(o.every(e=>CO(e)!==void 0)){let e=(e,t)=>e.find(e=>CO(e)===t);for(let t of new Set(o.map(e=>CO(e)??``)))wO(e(i,t),e(a,t),[...n,t],r);return}}r.push({kind:`yaml`,path:n,before:e,after:t})}}function TO(e){let[t,,n,,r]=e;return e.length===0?!0:t===`names`?e.length===1:t===`sheets`?e.length<=2?!0:n===`cells`||n===`columns`||n===`rows`?e.length===3:n===`tables`?e.length<=4||r===`columns`&&e.length===5:!1:!1}function EO(e,t){let n=[];return wO(e,t,[],n),n}function DO(e,t,n){let[r,...i]=t;if(r===void 0)return n;if(Array.isArray(e)){let t=e.findIndex(e=>CO(e)===r),a=[...e],o=DO(a[t],i,n);return t<0?o!==void 0&&a.push(o):o===void 0?a.splice(t,1):a[t]=o,a}let a=xO(e)?e:{},o=DO(a[r],i,n);return Object.fromEntries(Object.entries({...a,[r]:o}).filter(([,e])=>e!==void 0))}function OO(e,t,n){return DO(e,t,n)}function kO(e,t,n){let r=e.indexOf(t);if(r>=0)return r;let i=_O(t,n);return n!==void 0&&i!==void 0&&i!==``?e.findIndex((e,t)=>t>0&&e[n]===i):e.findIndex((e,n)=>n>0&&tO(e,t))}function AO(e,t){switch(t.kind){case`file`:return t.before;case`cell`:{let n=kO(e,t.row,t.key),r=e[n];if(n<0||!r)return e;let i=[...r];for(;i.length<=t.column;)i.push(``);i[t.column]=t.before;let a=[...e];return a[n]=i,a}case`row-added`:{let n=kO(e,t.row,t.key);return n<0?e:e.filter((e,t)=>t!==n)}case`row-removed`:{let n=t.previous?kO(e,t.previous):0,r=[...e];return r.splice(n<0?e.length:n+1,0,t.row),r}default:return e}}var jO=e=>{switch(e.kind){case`yaml`:return`yaml:${e.path.join(`\0`)}`;case`cell`:return`cell:${e.file}:${_O(e.row,e.key)??String(e.index)}:${String(e.column)}`;case`file`:return`file:${e.file}`;case`generated`:return`generated:${e.sheet}:${String(e.row)}:${String(e.col)}`;default:return`${e.kind}:${e.file}:${e.row.join(`\0`)}`}};function MO(e){let t=new Map;for(let n of e.sheets){for(let e of n.tables){let r=new Map;e.places.forEach((t,n)=>{r.set(t,e.at.row+1+n)}),r.set(0,e.at.row),t.set(e.file,{sheet:n,rowOf:e=>r.get(e),left:e.area.left,right:e.area.right,columnOf:t=>{let n=e.columns.find(e=>e.csv===t);return e.at.col+(n?.index??t)}})}for(let e of n.blocks)t.set(e.file,{sheet:n,rowOf:t=>e.area.top+t,left:e.area.left,right:e.area.right,columnOf:t=>e.area.left+t})}return t}function NO(e,t,n){let r=MO(t),i=new Map,a=(e,t,r)=>{let a=i.get(e);return a||(a=new Map((n(e)??[]).map((e,t)=>[e,t])),i.set(e,a)),a.get(t)??kO(n(e)??[],t,r)};return e.map(e=>{if(e.kind===`yaml`)return PO(e.path,t);if(e.kind===`generated`)return{sheet:e.sheet,...e.row===void 0||e.col===void 0?{}:{area:{top:e.row,bottom:e.row,left:e.col,right:e.col}}};let n=r.get(e.file);if(!n)return;if(e.kind===`file`||e.kind===`row-removed`)return{sheet:n.sheet.name};let i=n.rowOf(a(e.file,e.row,e.key));if(i===void 0)return{sheet:n.sheet.name};let o=e.kind===`cell`?n.columnOf(e.column):void 0;return{sheet:n.sheet.name,area:{top:i,bottom:i,left:o??n.left,right:o??n.right}}})}function PO(e,t){let[n,r,i,a,,o]=e;if(n!==`sheets`||r===void 0)return;let s=t.sheet(r);if(!s)return;let c=e=>({sheet:s.name,...e?{area:e}:{}});if(i===`cells`&&a!==void 0)return c(tn(a));if(i===`columns`&&a!==void 0){let e=Zt(a),t=s.used?.top??0,n=s.used?.bottom??0;return c(e===void 0?void 0:{top:t,bottom:n,left:e,right:e})}if(i===`tables`&&a!==void 0){let e=t.table(a);if(!e)return c(void 0);let n=o===void 0?void 0:e.column(o);if(!n)return c(e.area);let r=e.at.col+n.index;return c({...e.data,left:r,right:r})}return c(void 0)}function FO(e){return e?.area?`${e.sheet}!${$t(e.area)}`:e?.sheet}function IO(e){let t=ZE(),[n,r]=(0,k.useState)(0),i=e.changes.length,a=Math.min(n,i-1),o=e.changes[a];if(!o)return null;let s=e.places[a],c=t=>{let n=(a+t+i)%i;r(n),e.onShow(e.places[n])},l=(()=>{switch(o.kind){case`cell`:return o.before===``?void 0:t.was(o.before);case`row-added`:return t.rowAdded;case`row-removed`:return t.rowRemoved;case`file`:return t.fileChanged;case`generated`:return o.before===void 0||o.before===``?void 0:t.was(o.before);default:{let{before:e}=o;return typeof e==`string`||typeof e==`number`||typeof e==`boolean`?t.was(String(e)):void 0}}})(),u=FO(s);return(0,A.jsxs)(`div`,{className:`sheet-changes`,"data-testid":`sheet-changes`,children:[(0,A.jsx)(`span`,{className:`bg-agent size-1.5 shrink-0 rounded-full`}),(0,A.jsx)(`span`,{className:`text-agent-text mr-1`,"data-testid":`sheet-changes-count`,children:e.agent===void 0?t.changedElsewhere(i):t.changed(e.agent,i)}),u===void 0?null:(0,A.jsx)(`button`,{type:`button`,className:`hover:text-ink text-lead`,"data-testid":`sheet-change-place`,onClick:()=>{e.onShow(s)},children:u}),l===void 0?null:(0,A.jsx)(`span`,{className:`text-lead`,"data-testid":`sheet-change-was`,children:l}),i>1?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{size:`icon`,variant:`ghost`,className:`size-6`,"aria-label":t.previous,onClick:()=>{c(-1)},children:(0,A.jsx)(Me,{className:`size-3.5`})}),(0,A.jsx)(C,{size:`icon`,variant:`ghost`,className:`size-6`,"aria-label":t.next,"data-testid":`sheet-change-next`,onClick:()=>{c(1)},children:(0,A.jsx)(fe,{className:`size-3.5`})})]}):null,o.kind===`generated`?null:(0,A.jsx)(C,{size:`sm`,variant:`ghost`,className:`h-6`,"data-testid":`sheet-change-undo`,onClick:()=>{e.onUndo(o)},children:t.undo}),(0,A.jsx)(C,{size:`sm`,variant:`ghost`,className:`h-6`,"data-testid":`sheet-change-keep`,onClick:()=>{e.onKeep(o)},children:t.keep}),i>1?(0,A.jsxs)(A.Fragment,{children:[e.changes.some(e=>e.kind!==`generated`)?(0,A.jsx)(C,{size:`sm`,variant:`ghost`,className:`h-6`,"data-testid":`sheet-changes-undo`,onClick:()=>{e.onAll(`undo`)},children:t.undoAll}):null,(0,A.jsx)(C,{size:`sm`,variant:`ghost`,className:`h-6`,"data-testid":`sheet-changes-keep`,onClick:()=>{e.onAll(`keep`)},children:t.keepAll})]}):null]})}function LO(e){let t=ZE(),{on:n,disabled:r}=e;return(0,A.jsxs)(oe,{open:!0,modal:!1,onOpenChange:t=>{t||e.onClose()},children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(`span`,{"aria-hidden":!0,style:{position:`fixed`,left:e.x,top:e.y,width:0,height:0}})}),(0,A.jsxs)(y,{align:`start`,className:`sheet-menu text-xs`,"data-testid":`sheet-menu`,onCloseAutoFocus:e=>{e.preventDefault()},children:[(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-cut`,onSelect:n.cut,children:t.menu.cut}),(0,A.jsx)(E,{"data-testid":`sheet-menu-copy`,onSelect:n.copy,children:t.menu.copy}),(0,A.jsx)(E,{disabled:r||!n.canPaste,"data-testid":`sheet-menu-paste`,onSelect:()=>{n.paste(`all`)},children:t.menu.paste}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{disabled:r||!n.canPaste,"data-testid":`sheet-menu-paste-special`,children:t.menu.pasteSpecial}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-paste-values`,onSelect:()=>{n.paste(`values`)},children:t.menu.values}),(0,A.jsx)(E,{"data-testid":`sheet-paste-formulas`,onSelect:()=>{n.paste(`formulas`)},children:t.menu.formulas}),(0,A.jsx)(E,{"data-testid":`sheet-paste-formats`,onSelect:()=>{n.paste(`formats`)},children:t.menu.formats})]})]}),(0,A.jsx)(x,{}),e.kind===`cell`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{disabled:r,"data-testid":`sheet-menu-insert`,children:t.insert}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-menu-insert-rows`,onSelect:n.insertRows,children:t.menu.entireRow}),(0,A.jsx)(E,{"data-testid":`sheet-menu-insert-columns`,onSelect:n.insertColumns,children:t.menu.entireColumn})]})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{disabled:r,"data-testid":`sheet-menu-delete`,children:t.delete}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-menu-delete-rows`,onSelect:n.deleteRows,children:t.menu.entireRow}),(0,A.jsx)(E,{"data-testid":`sheet-menu-delete-columns`,onSelect:n.deleteColumns,children:t.menu.entireColumn})]})]})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-insert`,onSelect:e.kind===`row`?n.insertRows:n.insertColumns,children:t.insert}),(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-delete`,onSelect:e.kind===`row`?n.deleteRows:n.deleteColumns,children:t.delete})]}),(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-clear`,onSelect:n.clear,children:t.menu.clearContents}),(0,A.jsx)(x,{}),e.kind===`cell`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{disabled:r,"data-testid":`sheet-menu-filter`,children:t.menu.filter}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-menu-filter-clear`,onSelect:n.filterClear,children:t.sortFilter.clear}),(0,A.jsx)(E,{"data-testid":`sheet-menu-filter-toggle`,onSelect:n.filterToggle,children:t.sortFilter.filter}),(0,A.jsx)(E,{"data-testid":`sheet-menu-filter-value`,onSelect:n.filterByValue,children:t.menu.filterByValue})]})]}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{disabled:r,"data-testid":`sheet-menu-sort`,children:t.menu.sort}),(0,A.jsxs)(re,{className:`text-xs`,children:[(0,A.jsx)(E,{"data-testid":`sheet-menu-sort-up`,onSelect:()=>{n.sort(!1)},children:t.filter.aToZ}),(0,A.jsx)(E,{"data-testid":`sheet-menu-sort-down`,onSelect:()=>{n.sort(!0)},children:t.filter.zToA}),(0,A.jsx)(E,{"data-testid":`sheet-menu-sort-custom`,onSelect:n.customSort,children:t.sortFilter.customSort})]})]}),(0,A.jsx)(x,{})]}):null,(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-format`,onSelect:n.formatCells,children:t.menu.formatCells}),n.insertFile?(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-insert-file`,onSelect:n.insertFile,children:t.files.insert}):null,n.openFile?(0,A.jsx)(E,{"data-testid":`sheet-menu-open-file`,onSelect:n.openFile,children:t.files.open}):null,n.pickFromList?(0,A.jsx)(E,{"data-testid":`sheet-menu-list`,onSelect:n.pickFromList,children:t.menu.pickFromList}):null,e.kind===`row`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-height`,onSelect:n.rowHeight,children:t.menu.rowHeight}),(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-hide`,onSelect:()=>{n.hide(`rows`)},children:t.menu.hide}),(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-unhide`,onSelect:()=>{n.unhide(`rows`)},children:t.menu.unhide})]}):null,e.kind===`column`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-width`,onSelect:n.columnWidth,children:t.menu.columnWidth}),(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-hide`,onSelect:()=>{n.hide(`columns`)},children:t.menu.hide}),(0,A.jsx)(E,{disabled:r,"data-testid":`sheet-menu-unhide`,onSelect:()=>{n.unhide(`columns`)},children:t.menu.unhide})]}):null,(0,A.jsx)(be,{})]})]})}function RO(e){let t=ZE();return(0,A.jsxs)(oe,{open:!0,onOpenChange:t=>{t||e.onClose()},children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(`span`,{"aria-hidden":!0,style:{position:`fixed`,left:e.x,top:e.y,width:0,height:0}})}),(0,A.jsxs)(y,{align:`start`,className:`sheet-menu text-xs`,"data-testid":`sheet-chart-menu`,onCloseAutoFocus:e=>{e.preventDefault()},children:[(0,A.jsx)(E,{disabled:e.disabled,"data-testid":`sheet-chart-cut`,onSelect:e.onCut,children:t.menu.cut}),(0,A.jsx)(E,{"data-testid":`sheet-chart-copy`,onSelect:e.onCopy,children:t.menu.copy}),(0,A.jsx)(E,{disabled:e.disabled||!e.canPaste,"data-testid":`sheet-chart-paste`,onSelect:e.onPaste,children:t.menu.paste}),(0,A.jsx)(x,{}),(0,A.jsx)(E,{disabled:e.disabled,"data-testid":`sheet-chart-delete`,onSelect:e.onDelete,children:t.delete}),(0,A.jsx)(be,{})]})]})}var zO=/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/u,BO=/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/u,VO=e=>e.padStart(2,`0`);function HO(e){let t=e.trim(),n=zO.exec(t);if(n){let e=`${n[3]??``}-${VO(n[1]??``)}-${VO(n[2]??``)}`;if(Pn(e).format!==void 0)return e}let r=BO.exec(t);if(r){let e=`${r[1]??``}-${VO(r[2]??``)}-${VO(r[3]??``)}`;if(Pn(e).format!==void 0)return e}return e}function UO(e){return`${String(e.getFullYear())}-${VO(String(e.getMonth()+1))}-${VO(String(e.getDate()))}`}var WO=class{file;rows;workbook;calc;revision=0;generated;scenario;seed;constructor(e,t,n=``,r){this.file=e,this.rows=t,this.seed=n,this.generated=r,this.read()}read(){this.workbook=Hr({file:this.file,rows:e=>this.rows.get(e),generated:this.generated}),this.scenario!==void 0&&Gr(this.workbook,this.scenario),this.calc=new yT(this.workbook,{random:uT(this.seed)}).calculate(),this.revision+=1}take(e){e.file&&(this.file=e.file);for(let[t,n]of e.rows)this.rows.set(t,n);for(let t of e.removed??[])this.rows.delete(t);e.whole?this.read():(e.file&&this.workbook.respec(e.file),this.calc.change(e.cells.map(e=>this.slotOf(e))),this.revision+=1)}slotOf(e){let{sheet:t,row:n,col:r}=e,i=Er(n,r);if(e.key===null?t.keys.delete(i):e.key!==void 0&&t.keys.set(i,e.key),e.record&&(e.record.table.records[e.record.index]=e.record.fields),t.implied.delete(i),e.column)return{sheet:t,row:n,col:r,slot:new Cr(e.column,t,n,r)};let a=Pn(e.input??``);return a.format!==void 0&&t.implied.set(i,a.format),{sheet:t,row:n,col:r,slot:a.formula===void 0?a.value??void 0:new Cr(new Sr(a.formula,n,r,{file:``}),t,n,r)}}},GO=1500,KO=`sheet-editor.seen:`,qO=300,JO=1e6;function YO(e,t,n){let r=0,i=Math.min(t.length,n.length);for(;r<i&&t[r]===n[r];)r+=1;if(r===t.length&&r===n.length)return;let a=0;for(;a<i-r&&t[t.length-1-a]===n[n.length-1-a];)a+=1;return{path:e,at:r,before:t.slice(r,t.length-a),after:n.slice(r,n.length-a)}}function XO(e,t,n){let r=t=>n.every((n,r)=>tO(e[t+r],n));if(n.length===0)return Math.min(t,e.length);if(r(t))return t;for(let t=0;t<=e.length-n.length;t++)if(r(t))return t;return-1}function ZO(e,t,n,r){let i=XO(e,t,n);if(i>=0)return[...e.slice(0,i),...r,...e.slice(i+n.length)];if(n.length!==r.length)return e;let a=[...e];return n.forEach((e,t)=>{let n=r[t],i=a.findIndex(t=>tO(t,e));i>=0&&n&&(a[i]=n)}),a}var QO=e=>e.records.map(e=>e.end===e.start?[]:e.fields),$O=[`error`,`saving`,`unsaved`,`saved`],ek=200,tk=class e{book;host;dir;entry;sessions=new Map;opening=new Map;parsed=new Map;problems;changes=[];conflicts=[];done=[];undone=[];snapshot;listeners=new Set;stops=[];reading;remembering;remembered=new Map;closed=!1;code;codeFailed=!1;asking;constructor(e,t){this.host=e,this.dir=t}static async open(t,n){let r=new e(t,n);return r.entry=await m.open(t,`${n}/${se}`),r.stops.push(r.entry.onState(()=>{r.update()})),r.entry.attach({save:()=>r.saveEntry(),take:(e,t)=>{r.takeEntry(e,t)}}),await r.first(),r}path(e){return`${this.dir}/${e}`}async askCode(){try{let{result:e}=await this.host[`tools/call`]({name:`sheet/generated`,arguments:{item:this.dir}});return e}catch{return{failed:!1}}}async followCode(){let{generated:e,failed:t}=await this.askCode();if(this.closed)return;let{book:n}=this;if(t!==this.codeFailed&&(this.codeFailed=t,this.update()),t||!n)return;let r=e&&JSON.stringify(e);if(r===this.code)return;this.code=r;let i=n.workbook;n.generated=e,n.read(),this.noted(yO(i,n.workbook)),this.update()}async first(){let e=Rn(this.entry.text);if(!e.file){this.problems=rk(e.problems),this.update();return}let t=new Map,n=Ln(this.entry.text);await Promise.all(n.map(async e=>{let n=await this.follow(e),r=this.parsedText(e,n.text);n.version!==null&&t.set(e,QO(r))}));let{generated:r,failed:i}=await this.askCode();this.code=r&&JSON.stringify(r),this.codeFailed=i,this.book=new WO(e.file,t,this.seed(),r),await this.seenBefore(),this.stops.push(this.host.on(`project/changed`,()=>{clearTimeout(this.asking),this.asking=setTimeout(()=>{this.followCode()},ek)})),this.update()}seed(){return[this.entry.text,...[...this.sessions.values()].map(e=>e.text)].join(`
28
- `)}async seenBefore(){let e=async e=>{let{value:t}=await this.host[`storage/get`]({key:KO+e}).catch(()=>({value:null}));return typeof t==`string`?t:void 0},{book:t}=this;if(!t)return;let n=await e(this.entry.path),r=n===void 0?void 0:Rn(n).file;n!==void 0&&this.remembered.set(this.entry.path,n),r&&this.noted(EO(r,t.file));for(let[n,r]of this.sessions){let i=await e(r.path);if(i===void 0)continue;this.remembered.set(r.path,i);let a=t.rows.get(n);a&&this.noted(bO(n,QO(sn(i)),a,this.keyOf(n)))}let i=await e(this.codePath());if(i!==void 0&&i!==this.code){this.remembered.set(this.codePath(),i);let e=Hr({file:t.file,rows:e=>t.rows.get(e),generated:JSON.parse(i)});this.noted(yO(e,t.workbook))}}codePath(){return`${this.dir}/${_}`}keyOf(e){let t=(this.book?.file.sheets.flatMap(e=>e.tables??[]).find(t=>t.rows===e))?.key?.toLowerCase();if(t===void 0)return;let n=this.book?.rows.get(e)?.[0]?.findIndex(e=>e.trim().toLowerCase()===t);return n===void 0||n<0?void 0:n}parsedText(e,t){let n=this.parsed.get(e);if(n?.source===t)return n;let r=sn(t);return this.parsed.set(e,r),r}async follow(e){let t=this.sessions.get(e);if(t)return t;let n=await m.open(this.host,this.path(e));return this.sessions.set(e,n),this.stops.push(n.onState(()=>{this.update()})),n.attach({save:()=>this.saveCsv(e,n),take:(t,n)=>{this.takeCsv(e,t,n)}}),n}touch(e){let t=this.sessions.get(e);if(t){t.edited();return}if(this.opening.has(e))return;let n=this.follow(e).then(t=>{this.opening.delete(e),t.edited()},()=>{this.opening.delete(e)});this.opening.set(e,n)}saveEntry(){let{book:e}=this;if(!e||this.problems)return;let t=WT(this.entry.text,e.file);return t===this.entry.text?void 0:t}saveCsv(e,t){let n=this.book?.rows.get(e);if(!n)return;let r=this.parsedText(e,t.text),i=t.version===null?un(n):hn(r,n);if(i===t.text)return;let a=sn(i);this.parsed.set(e,a);let o=n;return a.records.length===o.length&&a.records.forEach((e,t)=>{o[t]?.length===e.fields.length&&(o[t]=e.fields)}),i}takeEntry(e,t){let n=Rn(e);if(!n.file){this.problems=rk(n.problems),this.update();return}this.problems=void 0;let{book:r}=this;if(!r){this.first();return}let i=Rn(t).file,a=i?hO(i,r.file,n.file):{value:n.file,conflicts:[]};a.conflicts.length>0&&(this.conflicts=a.conflicts),r.file=a.value,i&&this.noted(EO(i,n.file)),this.openFiles(),this.readSoon()}async openFiles(){let{book:e}=this;if(!e)return;let t=e.file.sheets.flatMap(e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)]);for(let n of t){if(this.sessions.has(n))continue;let t=await this.follow(n);t.version!==null&&!e.rows.has(n)&&e.rows.set(n,QO(this.parsedText(n,t.text)))}this.readSoon()}takeCsv(e,t,n){let{book:r}=this;if(!r)return;let i=QO(this.parsedText(e,t)),a=QO(sn(n)),o=this.keyOf(e),s=lO(a,r.rows.get(e)??a,i,o);s.conflicts.length>0&&(this.conflicts=s.conflicts),r.rows.set(e,[...s.rows]),this.noted(bO(e,a,i,o)),this.readSoon()}readSoon(){clearTimeout(this.reading),this.reading=setTimeout(()=>{this.book?.read(),this.update()},0)}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));get=()=>{let e=[this.entry,...this.sessions.values()];return this.snapshot??={book:this.book,revision:this.book?.revision??0,state:$O.find(t=>e.some(e=>e.state===t))??`saved`,problems:this.problems,changes:this.changes,conflicts:this.conflicts,canUndo:this.done.length>0,canRedo:this.undone.length>0,codeFailed:this.codeFailed},this.snapshot};update(){this.snapshot=void 0;for(let e of this.listeners)e();clearTimeout(this.remembering),this.remembering=setTimeout(()=>{this.remember()},qO)}remember(){let{book:e}=this;if(!e||this.closed)return;let t=e.file,n=new Map(e.rows);for(let e of[...this.changes].reverse())e.kind===`yaml`?t=OO(t,e.path,e.before):e.kind!==`generated`&&n.set(e.file,AO(n.get(e.file)??[],e));let r=(e,t)=>{this.remembered.get(e)!==t&&(t===void 0?this.remembered.delete(e):this.remembered.set(e,t),this.host[`storage/set`]({key:KO+e,value:t??null}).catch(()=>void 0))};r(this.entry.path,WT(this.entry.text,t)),this.changes.some(e=>e.kind===`generated`)||r(this.codePath(),this.code);for(let[e,t]of this.sessions){let i=n.get(e);if(!i)continue;let a=i.length*(i[0]?.length??1)*8>JO?void 0:hn(this.parsedText(e,t.text),i);r(t.path,a!==void 0&&a.length<=JO?a:void 0)}}noted(e){let t=[...this.changes];for(let n of e){let e=t.findIndex(e=>jO(e)===jO(n)),r=t[e];r?r.kind===`cell`&&n.kind===`cell`?r.before===n.after?t.splice(e,1):t[e]={...n,before:r.before}:r.kind===`yaml`&&n.kind===`yaml`&&(JSON.stringify(r.before)===JSON.stringify(n.after)?t.splice(e,1):t[e]={...n,before:r.before}):t.push(n)}this.changes=t}edit(e,t={}){let{book:n}=this;if(e.refused!==void 0)return e.refused;if(!n||this.problems)return;let r=[],i=[...e.rows.keys()].filter(e=>!n.rows.has(e));for(let[t,i]of e.rows){let e=YO(t,n.rows.get(t)??[],i);e&&r.push(e)}let a=n.file;this.leaveReview(e);let o=(e.removed??[]).map(e=>({path:e,rows:n.rows.get(e)??[]}));n.take(e),e.file&&e.file!==a&&this.entry.edited();for(let e of r)this.touch(e.path);for(let{path:e}of o)this.takeOut(e);if(r.length>0||e.file){let n=Date.now(),s=this.done.at(-1),c={...e.file?{file:{before:a,after:e.file}}:{},rows:r,removed:o,added:i,group:t.group,at:n,where:t.where};t.group!==void 0&&s?.group===t.group&&n-s.at<GO?(s.file&&c.file?s.file.after=c.file.after:c.file&&(s.file=c.file),s.rows.push(...r),s.at=n):this.done=[...this.done,c].slice(-100),this.undone=[]}this.update()}async makeOrdinary(e){let{book:t}=this;if(!t?.generated)return;let n=await this.host[`files/list`]({dir:`${this.dir}/${ne}`}).then(e=>new Set(e.files.map(e=>e.path)),()=>new Set);return this.edit(Un(t,t.generated,e,e=>n.has(this.path(e))))}showScenario(e){let{book:t}=this;t&&(t.scenario=e,t.read(),this.update())}takeOut(e){let t=this.sessions.get(e);this.sessions.delete(e),this.parsed.delete(e);let n=this.path(e);(async()=>{await t?.close(),await this.entry.flush(),!this.book?.rows.has(e)&&await this.host[`files/remove`]({path:n}).catch(()=>void 0)})()}leaveReview(e){if(this.changes.length===0)return;let t=new Set,{book:n}=this;for(let[r,i]of e.rows)(n?.rows.get(r)??[]).forEach((e,n)=>{i[n]!==e&&t.add(e)});let r=new Set(e.cells.flatMap(e=>e.key===void 0||e.key===null?[]:[e.key]));this.changes=this.changes.filter(e=>e.kind===`cell`?!t.has(e.row):e.kind!==`yaml`||!r.has(e.path[e.path.length-1]??``))}replay(e,t){let{book:n}=this;if(!n)return;e&&(n.file=n.file===e.from?e.to:hO(e.from,e.to,n.file).value),e&&this.entry.edited();let r=new Set(nk(n.file));for(let e of t){let t=ZO(n.rows.get(e.path)??[],e.at,e.from,e.to);t.length===0&&!r.has(e.path)?(n.rows.delete(e.path),this.takeOut(e.path)):(n.rows.set(e.path,t),this.touch(e.path))}n.read(),this.update()}undoStep(){let e=this.done.at(-1);if(e){this.done=this.done.slice(0,-1),this.undone.push(e);for(let{path:t,rows:n}of e.removed)this.book?.rows.set(t,n),this.touch(t);this.replay(e.file&&{from:e.file.after,to:e.file.before},[...e.rows].reverse().map(e=>({path:e.path,at:e.at,from:e.after,to:e.before})));for(let t of e.added)this.book?.rows.delete(t),this.takeOut(t);return e.where}}redoStep(){let e=this.undone.pop();if(e){this.done=[...this.done,e];for(let{path:t}of e.removed)this.book?.rows.delete(t),this.takeOut(t);return this.replay(e.file&&{from:e.file.before,to:e.file.after},e.rows.map(e=>({path:e.path,at:e.at,from:e.before,to:e.after}))),e.where}}keep(e){this.changes=this.changes.filter(t=>t!==e),this.update()}undo(e){let{book:t}=this;t&&(this.changes=this.changes.filter(t=>t!==e),e.kind!==`generated`&&(e.kind===`yaml`?this.edit({file:OO(t.file,e.path,e.before),rows:new Map,cells:[],whole:!0}):this.edit({rows:new Map([[e.file,AO(t.rows.get(e.file)??[],e)]]),cells:[],whole:!0}),this.update()))}all(e){for(let t of[...this.changes].reverse())e===`undo`?this.undo(t):this.keep(t)}reapply=()=>{this.book?.read(),this.update()};async flush(){await Promise.all([this.entry,...this.sessions.values()].map(e=>e.flush()))}async close(){for(let e of this.stops.splice(0))e();clearTimeout(this.remembering),clearTimeout(this.reading),clearTimeout(this.asking),this.remember(),this.closed=!0,await Promise.all([this.entry,...this.sessions.values()].map(e=>e.close()))}},nk=e=>e.sheets.flatMap(e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)]),rk=e=>e.map(e=>e.line===void 0?e.message:`${String(e.line)}: ${e.message}`),ik=1e4;function ak(e){let t=ZE(),n=(0,k.useRef)({getBoundingClientRect:()=>e.rect}),r=(0,k.useRef)(null),i=(0,k.useMemo)(()=>of(e.sheet,e.calc,e.filter,e.col),[e.sheet,e.calc,e.filter,e.col]),[a,o]=(0,k.useState)(``),[s,c]=(0,k.useState)(()=>new Set(i.values.filter(e=>!e.on).map(e=>e.text.toLowerCase()))),[l,u]=(0,k.useState)(i.blanks?.on??!1),d=a.trim().toLowerCase(),f=(0,k.useMemo)(()=>i.values.filter(e=>d===``||e.text.toLowerCase().includes(d)).slice(0,ik),[i,d]),p=e=>!s.has(e.toLowerCase()),m=f.every(e=>p(e.text))&&(i.blanks===void 0||d!==``||l),h=!f.some(e=>p(e.text))&&(i.blanks===void 0||d!==``||!l),g=e=>{c(t=>{let n=new Set(t);for(let t of f)e?n.delete(t.text.toLowerCase()):n.add(t.text.toLowerCase());return n}),d===``&&u(e)},_=()=>{let t=(d===``?i.values:f).filter(e=>p(e.text));d===``&&t.length===i.values.length&&(i.blanks===void 0||l)?e.onKeep(void 0):e.onKeep({...t.length===0?{}:{values:t.map(e=>e.text)},...d===``&&l?{blanks:!0}:{}})},v=i.values[0]?.value,y=e.sheet.lookAt(e.filter.area.top+1,e.col).format,b=typeof v==`number`?ll(y)?[t.filter.oldest,t.filter.newest]:[t.filter.smallest,t.filter.largest]:[t.filter.aToZ,t.filter.zToA];return(0,A.jsxs)(pe,{open:!0,onOpenChange:t=>{t||e.onClose()},children:[(0,A.jsx)(we,{virtualRef:n}),(0,A.jsxs)(De,{align:`start`,className:`sheet-filter-menu`,"data-testid":`sheet-filter-menu`,onOpenAutoFocus:e=>{e.preventDefault(),r.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault()},children:[(0,A.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,"data-testid":`sheet-filter-sort-up`,onClick:()=>{e.onSort(!1)},children:b[0]}),(0,A.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,"data-testid":`sheet-filter-sort-down`,onClick:()=>{e.onSort(!0)},children:b[1]}),(0,A.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,disabled:!e.filter.columns.has(e.col),"data-testid":`sheet-filter-clear`,onClick:()=>{e.onKeep(void 0)},children:t.filter.clearFrom(e.name)}),(0,A.jsx)(tt,{ref:r,className:`sheet-filter-search`,placeholder:t.filter.search,"aria-label":t.filter.search,"data-testid":`sheet-filter-search`,value:a,onChange:e=>{o(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`&&_()}}),(0,A.jsxs)(`div`,{className:`sheet-filter-list`,"data-testid":`sheet-filter-list`,children:[(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:m?!0:!h&&`indeterminate`,"data-testid":`sheet-filter-all`,onCheckedChange:e=>{g(e===!0)}}),(0,A.jsx)(`span`,{children:t.filter.selectAll})]}),f.map(e=>(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:p(e.text),"data-value":e.text,onCheckedChange:t=>{c(n=>{let r=new Set(n);return t===!0?r.delete(e.text.toLowerCase()):r.add(e.text.toLowerCase()),r})}}),(0,A.jsx)(`span`,{children:e.text})]},e.text)),i.blanks===void 0||d!==``?null:(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:l,"data-value":``,onCheckedChange:e=>{u(e===!0)}}),(0,A.jsx)(`span`,{children:t.filter.blanks})]})]}),(0,A.jsxs)(`div`,{className:`sheet-filter-foot`,children:[(0,A.jsx)(C,{size:`sm`,disabled:h,"data-testid":`sheet-filter-ok`,onClick:_,children:t.dialog.ok}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-filter-cancel`,onClick:e.onClose,children:t.dialog.cancel})]})]})]})}function ok(e){let t=(0,k.useRef)({getBoundingClientRect:()=>e.rect}),{ticked:n}=e;return(0,A.jsxs)(pe,{open:!0,onOpenChange:t=>{t||e.onClose()},children:[(0,A.jsx)(we,{virtualRef:t}),(0,A.jsxs)(De,{align:`start`,className:`sheet-value-list`,"data-testid":`sheet-value-list`,onCloseAutoFocus:e=>{e.preventDefault()},children:[n&&n.length>0?(0,A.jsx)(`div`,{className:`sheet-chips`,"data-testid":`sheet-chips`,children:n.map(e=>(0,A.jsx)(`span`,{className:`sheet-chip`,children:e},e))}):null,e.values.map(t=>(0,A.jsxs)(`button`,{type:`button`,className:`sheet-menu-row`,"data-value":t,role:n?`menuitemcheckbox`:void 0,"aria-checked":n?n.includes(t):void 0,onClick:()=>{e.onPick(t)},children:[n?(0,A.jsx)(je,{className:`mr-1 inline size-3`,style:{opacity:+!!n.includes(t)}}):null,t]},t))]})]})}function sk({className:e,orientation:t=`horizontal`,...n}){return(0,A.jsx)(zt,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:l(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var ck=s(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function lk({className:e,variant:t=`default`,...n}){return(0,A.jsx)(Vt,{"data-slot":`tabs-list`,"data-variant":t,className:l(ck({variant:t}),e),...n})}function uk({className:e,...t}){return(0,A.jsx)(Ut,{"data-slot":`tabs-trigger`,className:l(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent`,`data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100`,e),...t})}function dk({className:e,...t}){return(0,A.jsx)(Gt,{"data-slot":`tabs-content`,className:l(`flex-1 outline-none`,e),...t})}function fk(e){let t=ZE();return(0,A.jsx)(Qe,{open:!0,onOpenChange:t=>{t||e.onClose()},children:(0,A.jsxs)(et,{className:e.wide===!0?`sm:max-w-xl`:`sm:max-w-sm`,"data-testid":e.testid,onCloseAutoFocus:e=>{e.preventDefault()},onKeyDown:t=>{t.key===`Enter`&&!(t.target instanceof HTMLTextAreaElement)&&!(t.target instanceof HTMLButtonElement)&&e.onOk&&(t.preventDefault(),e.onOk())},children:[(0,A.jsx)(O,{children:(0,A.jsx)($e,{className:`text-sm font-semibold`,children:e.title})}),(0,A.jsx)(`div`,{className:`sheet-dialog`,children:e.children}),(0,A.jsxs)(Xe,{className:`items-center`,children:[e.left===void 0?null:(0,A.jsx)(`div`,{className:`mr-auto`,children:e.left}),e.buttons??(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-dialog-cancel`,onClick:e.onClose,children:t.dialog.cancel}),(0,A.jsx)(C,{size:`sm`,"data-testid":`sheet-dialog-ok`,onClick:()=>e.onOk?.(),children:t.dialog.ok})]})]})]})})}function pk(e){return(0,A.jsxs)(`label`,{className:`sheet-field`,children:[(0,A.jsx)(`span`,{children:e.label}),e.children]})}var mk=[`thin`,`hair`,`dotted`,`dashed`,`dashDot`,`dashDotDot`,`medium`,`mediumDashed`,`mediumDashDot`,`thick`,`double`],hk=[`minus`,`red`,`brackets`,`redBrackets`],gk=[`general`,`left`,`center`,`right`,`fill`,`justify`,`centerContinuous`,`distributed`],_k=[`top`,`center`,`bottom`,`justify`,`distributed`],vk=[`top`,`horizontal`,`bottom`,`left`,`vertical`,`right`];function yk(e){return(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`div`,{className:`grid grid-cols-10 gap-1`,"data-testid":e.testid,children:[...xD,...SD].map(t=>(0,A.jsx)(`button`,{type:`button`,"aria-label":t,"data-color":t,className:l(`border-rule size-5 rounded-sm border`,e.value?.toUpperCase()===t&&`ring-pencil ring-2 ring-offset-1`),style:{background:t},onClick:()=>{e.onPick(t)}},t))}),(0,A.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,"data-testid":`${e.testid}-none`,onClick:()=>{e.onPick(void 0)},children:e.none})]})}function bk(e){let t=ZE(),[n,r]=(0,k.useState)(()=>UD(e.code)),i=t=>{let i={...n,...t};r(i),e.onCode(VD(i))},a={date:MD,time:ND,fraction:PD,custom:FD},o=a[n.category],s=sl(e.value??1234.5,VD(n)),c=n.category===`number`||n.category===`currency`||n.category===`accounting`||n.category===`percentage`||n.category===`scientific`,l=n.category===`currency`||n.category===`accounting`,u=n.category===`number`||n.category===`currency`;return(0,A.jsxs)(`div`,{className:`sheet-number-tab`,children:[(0,A.jsx)(`div`,{className:`sheet-list`,role:`listbox`,"aria-label":t.formatCells.category,children:LD.map(e=>(0,A.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":e===n.category,"data-testid":`sheet-category-${e}`,"data-on":e===n.category?``:void 0,onClick:()=>{let t=a[e]?.[0];i({category:e,code:t??n.code})},children:t.formatCells.categories[e]},e))}),(0,A.jsxs)(`div`,{className:`sheet-number-side`,children:[(0,A.jsx)(pk,{label:t.formatCells.sample,children:(0,A.jsx)(`output`,{"data-testid":`sheet-format-sample`,children:s})}),c?(0,A.jsx)(pk,{label:t.formatCells.decimals,children:(0,A.jsx)(tt,{type:`number`,min:0,max:30,"data-testid":`sheet-format-decimals`,value:n.decimals,onChange:e=>{i({decimals:Math.max(0,Number(e.target.value)||0)})}})}):null,n.category===`number`?(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:n.thousands,"data-testid":`sheet-format-thousands`,onCheckedChange:e=>{i({thousands:e===!0})}}),(0,A.jsx)(`span`,{children:t.formatCells.thousands})]}):null,l?(0,A.jsx)(pk,{label:t.formatCells.symbol,children:(0,A.jsxs)(_e,{value:n.symbol===``?`none`:n.symbol,onValueChange:e=>{i({symbol:e===`none`?``:e})},children:[(0,A.jsx)(ye,{size:`sm`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:ID.map(e=>(0,A.jsx)(Se,{value:e===``?`none`:e,className:`text-xs`,children:e===``?t.formatCells.none:e},e===``?`none`:e))})]})}):null,u?(0,A.jsx)(pk,{label:t.formatCells.negative,children:(0,A.jsxs)(_e,{value:n.negative,onValueChange:e=>{i({negative:e})},children:[(0,A.jsx)(ye,{size:`sm`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:hk.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:sl(-1234.1,VD({...n,negative:e}))},e))})]})}):null,n.category===`custom`?(0,A.jsx)(pk,{label:t.formatCells.type,children:(0,A.jsx)(tt,{"data-testid":`sheet-format-code`,spellCheck:!1,value:n.code,onChange:e=>{i({code:e.target.value})}})}):null,o?(0,A.jsx)(`div`,{className:`sheet-list`,role:`listbox`,"aria-label":t.formatCells.type,children:o.map(t=>(0,A.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":t===n.code,"data-on":t===n.code?``:void 0,"data-code":t,onClick:()=>{i({code:t})},children:n.category===`custom`?t:sl(e.value??46000.5,t)},t))}):null]})]})}function xk(e){let t=ZE(),n=e.look,[r,i]=(0,k.useState)(n.format),[a,o]=(0,k.useState)(n.align??`general`),[s,c]=(0,k.useState)(n.valign??`bottom`),[l,u]=(0,k.useState)(n.indent??0),[d,f]=(0,k.useState)(n.wrap===!0),[p,m]=(0,k.useState)(n.shrink===!0),[h,g]=(0,k.useState)(e.merged),[_,v]=(0,k.useState)(n.rotation??0),[y,b]=(0,k.useState)(n.font??`Calibri`),[x,S]=(0,k.useState)(n.size??11),[w,T]=(0,k.useState)(n.bold===!0),[ee,E]=(0,k.useState)(n.italic===!0),[D,te]=(0,k.useState)(n.underline!==void 0&&n.underline!==!1),[ne,re]=(0,k.useState)(n.strike===!0),[ie,ae]=(0,k.useState)(n.color),[oe,se]=(0,k.useState)(typeof n.fill==`string`?n.fill:void 0),[ce,le]=(0,k.useState)(`thin`),[ue,de]=(0,k.useState)(),[fe,pe]=(0,k.useState)({}),me=(0,k.useMemo)(()=>({style:ce,...ue===void 0?{}:{color:ue}}),[ce,ue]),he=e=>{let t=fe[e];return t===void 0?(e===`top`||e===`bottom`||e===`left`||e===`right`)&&n.border?.[e]!==void 0:t!==null},ge=()=>{let t={},i=(e,n,r)=>{JSON.stringify(n)!==JSON.stringify(r)&&(t[e]=n)};i(`format`,r===`General`?void 0:r,n.format),i(`align`,a===`general`?void 0:a,n.align),i(`valign`,s===`bottom`?void 0:s,n.valign),i(`indent`,l===0?void 0:l,n.indent),i(`wrap`,d?!0:void 0,n.wrap===!0||void 0),i(`shrink`,p?!0:void 0,n.shrink===!0||void 0),i(`rotation`,_===0?void 0:_,n.rotation),i(`font`,y===`Calibri`?void 0:y,n.font),i(`size`,x===11?void 0:x,n.size),i(`bold`,w?!0:void 0,n.bold===!0||void 0),i(`italic`,ee?!0:void 0,n.italic===!0||void 0),i(`underline`,D?!0:void 0,n.underline!==void 0&&n.underline!==!1||void 0),i(`strike`,ne?!0:void 0,n.strike===!0||void 0),i(`color`,ie,n.color),i(`fill`,oe,typeof n.fill==`string`?n.fill:void 0),e.onDone({look:t,borders:fe,merge:h===e.merged?void 0:h})},be=e=>{pe(t=>({...t,[e]:he(e)?null:me}))};return(0,A.jsx)(fk,{title:t.formatCells.title,testid:`sheet-format-cells`,wide:!0,onClose:e.onClose,onOk:ge,children:(0,A.jsxs)(sk,{defaultValue:e.tab,children:[(0,A.jsx)(lk,{children:[`number`,`alignment`,`font`,`border`,`fill`].map(e=>(0,A.jsx)(uk,{value:e,"data-testid":`sheet-tab-${e}`,children:t.formatCells.tabs[e]},e))}),(0,A.jsx)(dk,{value:`number`,className:`sheet-dialog-tab`,children:(0,A.jsx)(bk,{code:r,value:e.value,onCode:i})}),(0,A.jsxs)(dk,{value:`alignment`,className:`sheet-dialog-tab`,children:[(0,A.jsx)(pk,{label:t.formatCells.horizontal,children:(0,A.jsxs)(_e,{value:a,onValueChange:e=>{o(e)},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-format-align`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:gk.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:t.formatCells.aligns[e]},e))})]})}),(0,A.jsx)(pk,{label:t.formatCells.vertical,children:(0,A.jsxs)(_e,{value:s,onValueChange:e=>{c(e)},children:[(0,A.jsx)(ye,{size:`sm`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:_k.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:t.formatCells.valigns[e]},e))})]})}),(0,A.jsx)(pk,{label:t.formatCells.indent,children:(0,A.jsx)(tt,{type:`number`,min:0,value:l,onChange:e=>{u(Math.max(0,Number(e.target.value)||0))}})}),(0,A.jsx)(pk,{label:t.formatCells.orientation,children:(0,A.jsx)(tt,{type:`number`,min:-90,max:90,value:_,onChange:e=>{v(Number(e.target.value)||0)}})}),(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:d,onCheckedChange:e=>{f(e===!0)}}),(0,A.jsx)(`span`,{children:t.wrapText})]}),(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:p,onCheckedChange:e=>{m(e===!0)}}),(0,A.jsx)(`span`,{children:t.formatCells.shrink})]}),(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:h,"data-testid":`sheet-format-merge`,onCheckedChange:e=>{g(e===!0)}}),(0,A.jsx)(`span`,{children:t.arrange.mergeCells})]})]}),(0,A.jsxs)(dk,{value:`font`,className:`sheet-dialog-tab`,children:[(0,A.jsx)(pk,{label:t.font,children:(0,A.jsxs)(_e,{value:y,onValueChange:b,children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-format-font`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:[...new Set([...fD,y])].map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:e},e))})]})}),(0,A.jsx)(pk,{label:t.fontSize,children:(0,A.jsxs)(_e,{value:String(x),onValueChange:e=>{S(Number(e))},children:[(0,A.jsx)(ye,{size:`sm`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:[...new Set([...pD,x])].map(e=>(0,A.jsx)(Se,{value:String(e),className:`text-xs`,children:e},e))})]})}),(0,A.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:w,"data-testid":`sheet-format-bold`,onCheckedChange:e=>{T(e===!0)}}),(0,A.jsx)(`span`,{children:t.bold})]}),(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:ee,onCheckedChange:e=>{E(e===!0)}}),(0,A.jsx)(`span`,{children:t.italic})]}),(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:D,onCheckedChange:e=>{te(e===!0)}}),(0,A.jsx)(`span`,{children:t.underline})]}),(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:ne,onCheckedChange:e=>{re(e===!0)}}),(0,A.jsx)(`span`,{children:t.formatCells.strikethrough})]})]}),(0,A.jsx)(pk,{label:t.fontColor,children:(0,A.jsx)(yk,{value:ie,testid:`sheet-format-color`,none:t.automatic,onPick:ae})})]}),(0,A.jsxs)(dk,{value:`border`,className:`sheet-dialog-tab`,children:[(0,A.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-border-none`,onClick:()=>{pe({top:null,bottom:null,left:null,right:null,horizontal:null,vertical:null})},children:t.formatCells.borderNone}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-border-outline`,onClick:()=>{pe(e=>({...e,top:me,bottom:me,left:me,right:me}))},children:t.formatCells.borderOutline}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-border-inside`,onClick:()=>{pe(e=>({...e,horizontal:me,vertical:me}))},children:t.formatCells.borderInside})]}),(0,A.jsx)(pk,{label:t.formatCells.lineStyle,children:(0,A.jsxs)(_e,{value:ce,onValueChange:e=>{le(e)},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-border-style`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:mk.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:t.formatCells.lines[e]},e))})]})}),(0,A.jsx)(pk,{label:t.formatCells.lineColor,children:(0,A.jsx)(yk,{value:ue,testid:`sheet-border-color`,none:t.automatic,onPick:de})}),(0,A.jsx)(`div`,{className:`sheet-dialog-row`,"data-testid":`sheet-border-edges`,children:vk.map(e=>(0,A.jsx)(ke,{"aria-pressed":he(e),"data-testid":`sheet-edge-${e}`,onClick:()=>{be(e)},children:t.formatCells.edges[e]},e))})]}),(0,A.jsx)(dk,{value:`fill`,className:`sheet-dialog-tab`,children:(0,A.jsx)(pk,{label:t.fillColor,children:(0,A.jsx)(yk,{value:oe,testid:`sheet-format-fill`,none:t.noFill,onPick:se})})})]})})}function Sk({field:e,...t}){let n=ZE(),[r,i]=(0,k.useState)(),[a,s]=(0,k.useState)(t.name);return a!==t.name&&(s(t.name),i(void 0)),(0,A.jsxs)(`div`,{className:`sheet-formula-row`,"data-testid":`sheet-formula-row`,children:[(0,A.jsxs)(`span`,{className:`sheet-name-place`,children:[(0,A.jsx)(`input`,{className:`sheet-name-box`,"aria-label":n.nameBox,title:n.nameBox,"data-testid":`sheet-name-box`,spellCheck:!1,value:r??t.name,onFocus:e=>{e.currentTarget.select()},onChange:e=>{i(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),t.onGo(e.currentTarget.value.trim()),i(void 0)):e.key===`Escape`&&(i(void 0),t.onDone())},onBlur:()=>{i(void 0)}}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`sheet-name-list`,"aria-label":n.namesList,title:n.namesList,disabled:t.names.length===0,"data-testid":`sheet-name-list`,onMouseDown:e=>{e.preventDefault()},children:(0,A.jsx)(me,{})})}),(0,A.jsx)(y,{align:`start`,className:`max-h-80 text-xs`,onCloseAutoFocus:e=>{e.preventDefault(),t.onDone()},children:t.names.map(e=>(0,A.jsx)(E,{"data-testid":`sheet-name-item`,"data-name":e,onSelect:()=>{t.onGo(e)},children:e},e))})]})]}),(0,A.jsxs)(`div`,{className:`sheet-formula-tools`,onMouseDown:e=>{e.preventDefault()},children:[(0,A.jsx)(ke,{icon:!0,"aria-label":n.cancel,title:n.cancel,disabled:!t.editing,"data-testid":`sheet-cancel`,onClick:t.onCancel,children:(0,A.jsx)(o,{})}),(0,A.jsx)(ke,{icon:!0,"aria-label":n.enter,title:n.enter,disabled:!t.editing,"data-testid":`sheet-enter`,onClick:t.onEnter,children:(0,A.jsx)(je,{})}),(0,A.jsx)(ke,{icon:!0,"aria-label":n.insertFunction,title:n.insertFunction,disabled:t.disabled,"data-testid":`sheet-function`,onClick:t.onFunction,children:(0,A.jsx)(Dt,{})})]}),(0,A.jsx)(`textarea`,{ref:e,className:`sheet-formula`,"aria-label":n.formulaBar,"data-testid":`sheet-formula`,"data-ghost":t.ghost===!0?``:void 0,rows:1,spellCheck:!1,disabled:t.disabled,value:t.text,onFocus:t.onBegin,onChange:e=>{t.onText(e.target.value,e.target.selectionStart)},onSelect:e=>{t.onCaret(e.currentTarget.selectionStart)}})]})}var Ck=String.raw`(?:'(?:[^']|'')+'|[\p{L}_][\p{L}\p{N}_.]*)!`,wk=String.raw`\$?[A-Za-z]{1,3}\$?[1-9]\d*`,Tk=String.raw`\$?[A-Za-z]{1,3}:\$?[A-Za-z]{1,3}`,Ek=String.raw`\$?[1-9]\d*:\$?[1-9]\d*`,Dk=new RegExp(String.raw`^(${Ck})?(${wk}(?::${wk})?|${Tk}|${Ek})(?![\p{L}\p{N}_.(])`,`u`),Ok=/^[\p{L}_\\][\p{L}\p{N}\p{M}_.?\\]*/u,kk=/^(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/u;function Ak(e){let t=[],n=0,r=(r,i)=>{t.push({kind:r,start:n,end:i,text:e.slice(n,i)}),n=i};for(;n<e.length;){let t=e.charAt(n),i=e.slice(n);if(t===`"`){let t=n+1;for(;t<e.length;){if(e.charAt(t)===`"`){if(e.charAt(t+1)!==`"`)break;t+=1}t+=1}r(`string`,Math.min(t+1,e.length))}else if(/\s/u.test(t)){let e=/^\s+/u.exec(i);r(`space`,n+(e?.[0].length??1))}else if(t===`[`){let t=0,i=n;for(;i<e.length&&(e.charAt(i)===`[`&&(t+=1),e.charAt(i)===`]`&&--t,t!==0);i++);r(`other`,Math.min(i+1,e.length))}else{let e=Dk.exec(i),a=kk.exec(i),o=Ok.exec(i);e?r(`ref`,n+e[0].length):a?r(`number`,n+a[0].length):o?r(`name`,n+o[0].length):t===`(`?r(`open`,n+1):t===`)`?r(`close`,n+1):t===`,`||t===`;`?r(`comma`,n+1):`=<>+-*/^&%:`.includes(t)?r(`op`,n+1):r(`other`,n+1)}}return t}var jk=e=>e.startsWith(`=`)&&e.length>0;function Mk(e){let t=/^\$?([A-Za-z]{1,3})?\$?(\d+)?(?::\$?([A-Za-z]{1,3})?\$?(\d+)?)?$/u.exec(e);if(!t)return;let n=t[1]===void 0?void 0:Zt(t[1]),r=t[3]===void 0?n:Zt(t[3]),i=t[2]===void 0?void 0:Number(t[2])-1,a=t[4]===void 0?i:Number(t[4])-1;return{top:Math.min(i??0,a??0),bottom:i===void 0?1048575:Math.max(i,a??i),left:Math.min(n??0,r??0),right:n===void 0?16383:Math.max(n,r??n)}}var Nk=e=>e.startsWith(`'`)?e.slice(1,-2).replaceAll(`''`,`'`):e.slice(0,-1);function Pk(e){if(!jk(e))return[];let t=[];for(let n of Ak(e)){if(n.kind!==`ref`)continue;let e=n.text.lastIndexOf(`!`),r=Mk(n.text.slice(e+1));r&&t.push({start:n.start,end:n.end,text:n.text,...e<0?{}:{sheet:Nk(n.text.slice(0,e+1))},area:r})}return t}function Fk(e,t){if(!jk(e))return;let n=Ak(e),r=n.find(e=>e.kind===`ref`&&e.start<t&&e.end>=t);if(r)return{start:r.start,end:r.end};let i;for(let e of n){if(e.end>t)break;e.kind!==`space`&&(i=e)}let a=n.find(e=>e.start<t&&e.end>t);if(a&&a.kind!==`space`||!i)return;let o=n.find(e=>e.start>=t&&e.kind!==`space`);if(!(i.kind!==`op`&&i.kind!==`open`&&i.kind!==`comma`||i.text===`%`)&&!(o&&o.kind!==`close`&&o.kind!==`comma`&&o.kind!==`op`))return{start:t,end:t}}function Ik(e,t,n){let r=e=>`${Xt(e.col)}${String(e.row+1)}`,i=r({row:e.top,col:e.left}),a=r({row:e.bottom,col:e.right}),o=i===a?i:`${i}:${a}`;return t===n?o:`${hr(t)}${o}`}var Lk=[[!1,!1],[!0,!0],[!1,!0],[!0,!1]];function Rk(e,t){let n=Ak(e).find(e=>e.kind===`ref`&&e.start<=t&&e.end>=t);if(!n)return;let r=n.text.lastIndexOf(`!`),i=n.text.slice(0,r+1),a=n.text.slice(r+1),o=/^(\$?)([A-Za-z]{1,3})(\$?)(\d+)(?::(\$?)([A-Za-z]{1,3})(\$?)(\d+))?$/u.exec(a);if(!o)return;let s=Lk[(Lk.findIndex(([e,t])=>o[1]===`$`===e&&o[3]===`$`===t)+1)%Lk.length]??[!1,!1],c=(e,t)=>`${s[0]?`$`:``}${e}${s[1]?`$`:``}${t}`,l=`${i}${c(o[2]??``,o[4]??``)}${o[6]===void 0?``:`:${c(o[6],o[8]??``)}`}`;return{text:e.slice(0,n.start)+l+e.slice(n.end),caret:n.start+l.length}}function zk(e,t){if(!jk(e))return;let n=Ak(e).find(e=>(e.kind===`name`||e.kind===`ref`)&&e.start<t&&e.end>=t);if(n&&!(n.text.includes(`!`)||n.text.includes(`$`)))return{start:n.start,end:n.end,prefix:e.slice(n.start,t).toUpperCase()}}function Bk(e,t=8){let n=[];for(let t of cf.keys())t.startsWith(e)&&n.push(t);return n.sort((e,t)=>e.length-t.length||e.localeCompare(t)),n.slice(0,t)}function Vk(e,t){if(!jk(e))return;let n=[],r;for(let i of Ak(e)){if(i.start>=t)break;if(i.kind===`open`)n.push({name:r?.kind===`name`?r.text:void 0,argument:0});else if(i.kind===`close`)n.pop();else if(i.kind===`comma`){let e=n[n.length-1];e&&(e.argument+=1)}i.kind!==`space`&&(r=i)}for(let e=n.length-1;e>=0;e--){let t=n[e];if(t?.name!==void 0)return{name:t.name.toUpperCase(),argument:t.argument}}}function Hk(e){if(!jk(e))return e;let t=0,n=``,r=Ak(e);return r.forEach((e,i)=>{let a=r[i+1];if(e.kind===`open`&&(t+=1),e.kind===`close`&&(t=Math.max(0,t-1)),e.kind===`name`&&a?.kind===`open`){let t=e.text.toUpperCase();n+=cf.has(t)?t:e.text}else if(e.kind===`ref`&&!e.text.includes(`!`))n+=e.text.toUpperCase();else if(e.kind===`ref`){let t=e.text.lastIndexOf(`!`);n+=e.text.slice(0,t+1)+e.text.slice(t+1).toUpperCase()}else n+=e.text;e.kind===`string`&&(e.text.length<2||!e.text.endsWith(`"`))&&(n+=`"`)}),n+`)`.repeat(t)}var Uk=[.5,.75,.9,1,1.25,1.5,2];function Wk(e,t){return(t>0?Uk.find(t=>t>e):Uk.findLast(t=>t<e))??e}function Gk(e){let t=typeof e==`string`?Number(e):void 0;return t!==void 0&&Uk.includes(t)?t:void 0}var Kk=class{indexes;sizes;extra;size;constructor(e,t){this.size=e,this.indexes=[...t.keys()].sort((e,t)=>e-t),this.sizes=this.indexes.map(n=>t.get(n)??e),this.extra=[];let n=0;this.sizes.forEach((t,r)=>{n+=t-e,this.extra[r]=n})}before(e){let t=0,n=this.indexes.length;for(;t<n;){let r=t+n>>1;(this.indexes[r]??0)<e?t=r+1:n=r}return t}offset(e){let t=this.before(e);return e*this.size+(t>0?this.extra[t-1]??0:0)}sizeOf(e){let t=this.before(e);return this.indexes[t]===e?this.sizes[t]??this.size:this.size}at(e,t){if(e<=0)return this.firstShown(0,t);let n=0,r=t-1;for(;n<r;){let t=n+r+1>>1;this.offset(t)<=e?n=t:r=t-1}return n}nextShown(e,t,n){let r=e;for(;r>=0&&r<n;){if(this.sizeOf(r)>0)return r;r+=t}return Math.min(Math.max(e,0),n-1)}firstShown(e,t){let n=e;for(;n<t-1&&this.sizeOf(n)===0;)n+=1;return n}};function qk(e){let t=new Map;for(let n of e.tables)for(let e of n.columns){let{width:r}=e.spec??{};r!==void 0&&t.set(n.at.col+e.index,r)}for(let[n,r]of Object.entries(e.spec.columns??{})){let e=Zt(n);e!==void 0&&(r.hidden===!0?t.set(e,0):r.width!==void 0&&t.set(e,r.width))}return t}function Jk(e,t,n){let r=new Map(t);for(let[t,n]of Object.entries(e.spec.rows??{})){let e=Number(t)-1;n.hidden===!0?r.set(e,0):n.height!==void 0&&r.set(e,n.height)}for(let e of n)r.set(e,0);return r}var Yk=4,Xk=class{rows;columns;rowCount;columnCount;freezeRow;freezeCol;width=0;height=0;scrollX=0;scrollY=0;constructor(e,t,n=new Set){this.rows=new Kk(20,Jk(e,t,n)),this.columns=new Kk(64,qk(e)),this.freezeRow=e.freeze?.row??0,this.freezeCol=e.freeze?.col??0,this.rowCount=Math.min(Jt,e.lastRow+1+100),this.columnCount=Math.min(Yt,e.columnsUsed+26)}get contentWidth(){return 46+this.columns.offset(this.columnCount)}get contentHeight(){return 22+this.rows.offset(this.rowCount)}get frozenWidth(){return this.columns.offset(this.freezeCol)}get frozenHeight(){return this.rows.offset(this.freezeRow)}xOf(e){let t=46+this.columns.offset(e);return e<this.freezeCol?t:t-this.scrollX}yOf(e){let t=22+this.rows.offset(e);return e<this.freezeRow?t:t-this.scrollY}shownColumns(){let e=this.scrollX+this.frozenWidth;return{first:Math.max(this.freezeCol,this.columns.at(e,this.columnCount)),last:this.columns.at(this.scrollX+this.width-46,this.columnCount)}}shownRows(){let e=this.scrollY+this.frozenHeight;return{first:Math.max(this.freezeRow,this.rows.at(e,this.rowCount)),last:this.rows.at(this.scrollY+this.height-22,this.rowCount)}}hit(e,t){let n=e<46,r=t<22;if(n&&r)return{part:`corner`};let i=this.columnAt(e),a=this.rowAt(t);if(r){let t=this.columns.sizeOf(i),n=this.xOf(i)+t-e<=Yk;return e-this.xOf(i)<=Yk&&i>0?{part:`column`,col:i-1,edge:!0}:{part:`column`,col:i,edge:n}}if(n){let e=this.rows.sizeOf(a),n=this.yOf(a)+e-t<=Yk;return t-this.yOf(a)<=Yk&&a>0?{part:`row`,row:a-1,edge:!0}:{part:`row`,row:a,edge:n}}return{part:`cell`,row:a,col:i}}columnAt(e){let t=e-46,n=t<this.frozenWidth&&this.freezeCol>0;return this.columns.at(n?t:t+this.scrollX,Yt)}rowAt(e){let t=e-22,n=t<this.frozenHeight&&this.freezeRow>0;return this.rows.at(n?t:t+this.scrollY,Jt)}rectOf(e){let t=this.xOf(e.left),n=this.yOf(e.top),r=this.xOf(Math.min(e.right,Yt-1)),i=this.yOf(Math.min(e.bottom,Jt-1));return{x:t,y:n,width:r+this.columns.sizeOf(e.right)-t,height:i+this.rows.sizeOf(e.bottom)-n}}scrollFor(e){let{scrollX:t,scrollY:n}=this;if(e.col>=this.freezeCol){let n=this.columns.offset(e.col)-this.frozenWidth,r=this.columns.offset(e.col)+this.columns.sizeOf(e.col)-(this.width-46);n<t?t=n:r>t&&(t=Math.min(n,r))}if(e.row>=this.freezeRow){let t=this.rows.offset(e.row)-this.frozenHeight,r=this.rows.offset(e.row)+this.rows.sizeOf(e.row)-(this.height-22);t<n?n=t:r>n&&(n=Math.min(t,r))}return{x:Math.max(0,t),y:Math.max(0,n)}}},Zk=3,Qk=15,$k=6,eA=20,tA={left:`left`,center:`center`,right:`right`,justify:`left`,distributed:`center`,centerContinuous:`center`,fill:`left`};function nA(e,t){return(e.align===void 0?void 0:tA[e.align])||(typeof t==`number`?`right`:typeof t==`boolean`||t instanceof N?`center`:`left`)}var rA=e=>{let{fill:t}=e;return typeof t==`string`?t:t?.color??t?.background};function iA(e){let t=Number.parseInt(e.slice(1),16);return .2126*(t>>16)+.7152*(t>>8&255)+.0722*(t&255)>140?`#000000`:`#FFFFFF`}function aA(e,t){let n=e.color??cl(t,e.format);if(n!==void 0)return n;let r=rA(e);return r===void 0?void 0:iA(r)}function oA(e,t,n){let r=e.lookAt(t,n),i=e.tables.length>0?vD(e,t,n):void 0;return i?{...i,...r}:r}function sA(e,t,n){let r=[];for(let i of e.split(`
29
- `)){let e=i;for(;n(e)>t&&e.length>1;){let i=1,a=e.length;for(;i<a;){let r=i+a+1>>1;n(e.slice(0,r))<=t?i=r:a=r-1}let o=e.lastIndexOf(` `,i),s=o>0?o:i;r.push(e.slice(0,s)),e=e.slice(o>0?s+1:s)}r.push(e)}return r}function cA(e,t,n){let r=On(e);if(n(r)<=t)return r;for(let i=10;i>=1;i--){let a=On(Number(e.toPrecision(i)));if(a.length<r.length&&n(a)<=t)return a}let i=e.toExponential(2).replace(/e([+-])(\d)$/u,`E$10$2`).replace(/e/u,`E`);return n(i)<=t?i:void 0}var lA=class e{withFiles=!1;canvas;g;cells=new Map;sheet;revision=-1;rules;font=``;static MOST=6e4;constructor(e){this.canvas=e;let t=e.getContext(`2d`,{alpha:!1});if(!t)throw Error(`This browser cannot draw on a canvas.`);this.g=t}size(e,t,n){let r=Math.round(e*n),i=Math.round(t*n);this.canvas.width!==r&&(this.canvas.width=r),this.canvas.height!==i&&(this.canvas.height=i),this.g.setTransform(n,0,0,n,0,0),this.font=``}setFont(e){e!==this.font&&(this.g.font=e,this.font=e)}showOf(t,n,r,i,a=this.rules){let o=Er(r,i),s=this.cells.get(o);if(s)return s;let c=a?.at(r,i),l=oA(t,r,i),u=c?{...l,...c.look,...c.scale===void 0?{}:{fill:c.scale}}:l,d=n.value(t,r,i),f=t.at(r,i),p=t.tables.length>0?t.tableAt(r,i):void 0,m=p!==void 0&&r>p.at.row&&p.columns[i-p.at.col]?.formula!==void 0&&!(f instanceof Cr),h=this.withFiles?t.filesAt(r,i):void 0,g=h!==void 0&&typeof d==`string`?Ar(d,h):void 0,_=t.validations.length===0?void 0:t.validationAt(r,i),v=_?.spec.multiple===!0&&typeof d==`string`?Kd(d,_.spec):void 0,y={text:c?.bare===!0||g!==void 0||v!==void 0?``:sl(d,u.format),font:mD(u),color:aA(u,d),fill:rA(u),align:nA(u,d),valign:u.valign===`top`?`top`:u.valign===`center`?`center`:`bottom`,wrap:u.wrap===!0,underline:u.underline!==void 0&&u.underline!==!1,strike:u.strike===!0,numeric:typeof d==`number`,indent:u.indent??0,border:u.border,exception:m,bar:c?.bar,icon:c?.icon,chips:v,files:g,width:void 0,lines:void 0};return this.cells.size>=e.MOST&&this.cells.clear(),this.cells.set(o,y),y}widthOf(e){return e.width===void 0&&(this.setFont(e.font),e.width=this.g.measureText(e.text).width),e.width}stops(e,t,n,r){return(e.at(n,r)!==void 0||e.spillAt(n,r)!==void 0)&&this.showOf(e,t,n,r).text!==``}paint(e){let{sheet:t,view:n,inks:r}=e;(t!==this.sheet||e.revision!==this.revision)&&(this.cells=new Map,this.sheet=t,this.revision=e.revision,this.withFiles=Yr(t)),this.rules=e.rules;let i=this.g;i.fillStyle=r.sheet,i.save(),i.setTransform(1,0,0,1,0,0),i.fillRect(0,0,this.canvas.width,this.canvas.height),i.restore();let a=n.shownRows(),o=n.shownColumns(),s=n.freezeRow>0?{first:0,last:n.freezeRow-1}:void 0,c=n.freezeCol>0?{first:0,last:n.freezeCol-1}:void 0,l=46+n.frozenWidth,u=22+n.frozenHeight,d=(t,n,r,a,o,s)=>{i.save(),i.beginPath(),i.rect(r,a,o,s),i.clip(),this.cellsIn(e,t,n),i.restore()};d(a,o,l,u,n.width-l,n.height-u),s&&d(s,o,l,22,n.width-l,n.frozenHeight),c&&d(a,c,46,u,n.frozenWidth,n.height-u),s&&c&&d(s,c,46,22,n.frozenWidth,n.frozenHeight),s&&this.line(46,u-.5,n.width,u-.5,r.headRule),c&&this.line(l-.5,22,l-.5,n.height,r.headRule),this.heads(e,a,o,s,c)}line(e,t,n,r,i){let a=this.g;a.strokeStyle=i,a.lineWidth=1,a.beginPath(),a.moveTo(e,t),a.lineTo(n,r),a.stroke()}cellsIn(e,t,n){let{sheet:r,calc:i,view:a,inks:o}=e,s=this.g,c=a.yOf(t.first),l=a.yOf(t.last)+a.rows.sizeOf(t.last),u=a.xOf(n.first),d=a.xOf(n.last)+a.columns.sizeOf(n.last);if(r.spec.gridlines!==!1){s.strokeStyle=o.grid,s.lineWidth=1,s.beginPath();for(let e=n.first;e<=n.last;e++){let t=a.columns.sizeOf(e);if(t===0)continue;let n=Math.round(a.xOf(e)+t)-.5;s.moveTo(n,c),s.lineTo(n,l)}for(let e=t.first;e<=t.last;e++){let t=a.rows.sizeOf(e);if(t===0)continue;let n=Math.round(a.yOf(e)+t)-.5;s.moveTo(u,n),s.lineTo(d,n)}s.stroke()}let f=r.merges,p=(e,t)=>f.some(n=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right);for(let c=t.first;c<=t.last;c++){let t=a.rows.sizeOf(c);if(t===0)continue;let l=a.yOf(c);for(let u=n.first;u<=n.last;u++){let n=a.columns.sizeOf(u);if(n===0)continue;let d=this.showOf(r,i,c,u),f=e.marks.has(Er(c,u));d.fill!==void 0&&(s.fillStyle=d.fill,s.fillRect(a.xOf(u),l,n,t)),d.bar&&this.bar(d.bar,a.xOf(u),l,n,t),f&&(s.fillStyle=o.agentWash,s.fillRect(a.xOf(u),l,n,t),s.strokeStyle=o.agent,s.lineWidth=1,s.strokeRect(a.xOf(u)+.5,l+.5,n-2,t-2))}}for(let r of e.markAreas){if(r.bottom<t.first||r.top>t.last||r.right<n.first||r.left>n.last)continue;let e=a.rectOf(r);s.fillStyle=o.agentWash,s.fillRect(e.x,e.y,e.width,e.height),s.strokeStyle=o.agent,s.lineWidth=1,s.strokeRect(e.x+.5,e.y+.5,e.width-2,e.height-2)}let m=Math.max(0,n.first-eA);for(let o=t.first;o<=t.last;o++)if(a.rows.sizeOf(o)!==0)for(let t=m;t<=n.last;t++){if(f.length>0&&p(o,t)||a.columns.sizeOf(t)===0)continue;let s=this.showOf(r,i,o,t);s.text!==``&&(t<n.first&&s.align!==`left`||this.text(e,s,o,t,n))}for(let e of f){if(e.bottom<t.first||e.top>t.last||e.right<n.first||e.left>n.last)continue;let c=a.rectOf(e),l=this.showOf(r,i,e.top,e.left);s.fillStyle=l.fill??o.sheet,s.fillRect(c.x,c.y,c.width-1,c.height-1),l.text!==``&&this.inBox(l,c.x,c.y,c.width,c.height,o)}for(let c=t.first;c<=t.last;c++){let t=a.rows.sizeOf(c);if(t===0)continue;let l=a.yOf(c);for(let u=n.first;u<=n.last;u++){let n=a.columns.sizeOf(u);if(n===0)continue;let d=this.showOf(r,i,c,u),f=a.xOf(u);(d.exception||e.invalid.has(Er(c,u)))&&(s.fillStyle=o.caution,s.beginPath(),s.moveTo(f,l),s.lineTo(f+6,l),s.lineTo(f,l+6),s.fill()),d.icon&&this.icon(d.icon,f,l,t,d.valign),d.chips&&this.chips(d,f,l,n,t,o),d.files&&this.files(d,f,l,n,t,e.pictures,o),d.border&&this.borders(d.border,f,l,n,t)}}for(let e of r.filters){if(e.area.top<t.first||e.area.top>t.last)continue;let r=a.yOf(e.area.top),i=a.rows.sizeOf(e.area.top),s=Math.max(e.area.left,n.first),c=Math.min(e.area.right,n.last);for(let t=s;t<=c;t++){let n=a.columns.sizeOf(t);n!==0&&this.filterButton(a.xOf(t)+n-17-1,r+i-17-1,e.columns.has(t),o)}}for(let e of r.tables){let r=_D(e.spec.style);if(!r)continue;let i=e.area;if(i.bottom<t.first||i.top>t.last||i.right<n.first||i.left>n.last)continue;let o=a.rectOf({...i,bottom:i.top}),s=Math.round(o.y+o.height)-.5;this.line(o.x,s,o.x+o.width,s,r.rule)}}chips(e,t,n,r,i,a){let o=this.g;this.setFont(e.font),o.save(),o.beginPath(),o.rect(t+1,n,r-2,i),o.clip();let s=n+(i-Qk)/2,c=t+Zk;o.textAlign=`left`,o.textBaseline=`middle`;for(let n of e.chips??[]){let i=o.measureText(n).width+12;if(o.fillStyle=a.here,o.beginPath(),o.roundRect(c,s,i,Qk,Qk/2),o.fill(),o.fillStyle=e.color??a.hereInk,o.fillText(n,c+$k,s+Qk/2),c+=i+3,c>t+r)break}o.restore()}files(e,t,n,r,i,a,o){let s=this.g;this.setFont(e.font),s.save(),s.beginPath(),s.rect(t+1,n,r-2,i),s.clip();let c=t+Zk,l=Math.max(4,i-4);s.textAlign=`left`,s.textBaseline=`middle`;for(let t of e.files??[]){let e=a?.picture(t);if(e){let t=e,r=t.width/Math.max(1,t.height)*l;s.drawImage(e,c,n+2,r,l),c+=r+4;continue}let r=t.split(`/`).pop()??t;s.fillStyle=a?.missing(t)===!0?o.caution:o.ink,s.fillText(r,c,n+i/2),c+=s.measureText(r).width+8}s.restore()}filterButton(e,t,n,r){let i=this.g;i.fillStyle=r.sheet,i.fillRect(e,t,17,17),i.strokeStyle=n?r.pencil:r.headRule,i.lineWidth=1,i.strokeRect(e+.5,t+.5,16,16),i.fillStyle=n?r.pencil:r.headInk,i.beginPath();let a=e+17/2;n?(i.moveTo(a-5,t+4),i.lineTo(a+5,t+4),i.lineTo(a+1,t+9),i.lineTo(a+1,t+13),i.lineTo(a-1,t+12),i.lineTo(a-1,t+9)):(i.moveTo(a-4,t+6),i.lineTo(a+4,t+6),i.lineTo(a,t+11)),i.closePath(),i.fill()}bar(e,t,n,r,i){let a=this.g,o=Math.max(1,(r-2)*e.share),s=a.createLinearGradient(t,0,t+o,0);s.addColorStop(0,e.color),s.addColorStop(1,`${e.color}40`),a.fillStyle=s,a.fillRect(t+1,n+2,o,Math.max(0,i-5)),a.strokeStyle=e.color,a.lineWidth=1,a.strokeRect(t+1.5,n+2.5,o-1,Math.max(0,i-6))}icon(e,t,n,r,i){let a=this.g,{shape:o,color:s,level:c}=Wd(e.set,e.index),l=t+3,u=i===`top`?n+4:i===`center`?n+(r-12)/2:n+r-12-4,d=l+6,f=u+6;a.save(),a.fillStyle=s,a.strokeStyle=s,a.lineWidth=2,a.lineCap=`round`;let p=e=>{a.translate(d,f),a.rotate(e),a.beginPath(),a.moveTo(-5,0),a.lineTo(5,0),a.moveTo(1,-4),a.lineTo(5,0),a.lineTo(1,4),a.stroke()},m=e=>{a.beginPath(),e.forEach(([e,t],n)=>{n===0?a.moveTo(l+e,u+t):a.lineTo(l+e,u+t)}),a.closePath(),a.fill()};switch(o){case`up`:p(-Math.PI/2);break;case`up-right`:p(-Math.PI/4);break;case`right`:p(0);break;case`down-right`:p(Math.PI/4);break;case`down`:p(Math.PI/2);break;case`flag`:a.lineWidth=1.5,a.beginPath(),a.moveTo(l+2,u+12),a.lineTo(l+2,u),a.stroke(),m([[3,1],[11,4],[3,7]]);break;case`check`:a.beginPath(),a.moveTo(l+1,f),a.lineTo(l+4,u+10),a.lineTo(l+11,u+2),a.stroke();break;case`bang`:a.fillRect(d-1,u,2.5,8),a.fillRect(d-1,u+9.5,2.5,2.5);break;case`cross`:a.beginPath(),a.moveTo(l+2,u+2),a.lineTo(l+10,u+10),a.moveTo(l+10,u+2),a.lineTo(l+2,u+10),a.stroke();break;case`triangle`:m([[6,1],[12,11],[0,11]]);break;case`diamond`:m([[6,0],[12,6],[6,12],[0,6]]);break;case`bars`:for(let e=0;e<4;e++)a.globalAlpha=e<(c??0)?1:.25,a.fillRect(l+e*3,u+9-e*3,2,3+e*3);break;case`quarter`:a.lineWidth=1,a.beginPath(),a.arc(d,f,5.5,0,Math.PI*2),a.stroke(),a.beginPath(),a.moveTo(d,f),a.arc(d,f,5.5,-Math.PI/2,-Math.PI/2+Math.PI/2*(c??0)),a.closePath(),a.fill();break;case`circle`:a.beginPath(),a.arc(d,f,5.5,0,Math.PI*2),a.fill()}a.restore()}borders(e,t,n,r,i){let a=(e,t,n,r,i)=>{if(!e)return;let a=this.g;a.save(),a.lineWidth=e.style===`thick`?3:e.style===`medium`?2:1,a.setLineDash(/dash|dot|hair/iu.test(e.style)?[3,2]:[]),this.line(t,n,r,i,e.color??`#000000`),a.restore()},o=Math.round(t+r)-.5,s=Math.round(n+i)-.5,c=Math.round(t)-.5,l=Math.round(n)-.5;a(e.left,c,n,c,n+i),a(e.right,o,n,o,n+i),a(e.top,t,l,t+r,l),a(e.bottom,t,s,t+r,s)}runs(e,t,n,r){let{sheet:i,calc:a,view:o}=e,s=o.xOf(r),c=s+o.columns.sizeOf(r);if(t.numeric||t.wrap)return{x:s,right:c};let l=this.widthOf(t)+6,u=c-s;if(l<=u)return{x:s,right:c};let d=c,f=s;if(t.align!==`right`){let e=t.align===`center`?s+(u+l)/2:s+l,c=r+1;for(;d<e&&!this.stops(i,a,n,c);)d+=o.columns.sizeOf(c),c+=1}if(t.align!==`left`){let e=t.align===`center`?s-(l-u)/2:c-l,d=r-1;for(;f>e&&d>=0&&!this.stops(i,a,n,d);)f-=o.columns.sizeOf(d),--d}return{x:f,right:d}}text(e,t,n,r,i){let{view:a,inks:o,sheet:s,calc:c}=e,l=this.g,u=a.yOf(n),d=a.rows.sizeOf(n),f=this.runs(e,t,n,r);if((f.right>a.xOf(r)+a.columns.sizeOf(r)||f.x<a.xOf(r))&&s.spec.gridlines!==!1)for(let e=r;;e++){let t=a.xOf(e)+a.columns.sizeOf(e);if(t>=f.right)break;l.fillStyle=this.showOf(s,c,n,e+1).fill??o.sheet,l.fillRect(Math.round(t)-1,u,1,d-1)}r<i.first&&f.right<=a.xOf(i.first)||this.inBox(t,f.x,u,f.right-f.x,d,o,n,r,e)}inBox(e,t,n,r,i,a,o,s,c){let l=this.g;this.setFont(e.font);let u=r-6,d=e.text,f=this.widthOf(e);if(e.numeric&&!e.wrap&&f>u){let e=o===void 0||s===void 0||!c?void 0:c.calc.value(c.sheet,o,s),t=o===void 0||s===void 0||!c?void 0:c.sheet.lookAt(o,s).format;d=(typeof e==`number`&&t===void 0?cA(e,u,e=>l.measureText(e).width):void 0)??`#`.repeat(Math.max(1,Math.floor(u/l.measureText(`#`).width))),f=l.measureText(d).width}l.fillStyle=e.color??a.ink;let p=Number.parseFloat(/([\d.]+)px/u.exec(e.font)?.[1]??`15`),m=Math.round(p*1.25);if(e.wrap){e.lines??=sA(d,u,e=>l.measureText(e).width);let a=e.lines,o=a.length*m,s=e.valign===`top`?n+2:e.valign===`center`?n+(i-o)/2:n+i-o-2;l.save(),l.beginPath(),l.rect(t,n,r,i),l.clip(),l.textBaseline=`alphabetic`,a.forEach((n,i)=>{let a=l.measureText(n).width,o=e.align===`right`?t+r-Zk-a:e.align===`center`?t+(r-a)/2:t+Zk+e.indent*9;l.fillText(n,o,s+(i+1)*m-m*.25)}),l.restore();return}let h=f>u,g=e.align===`right`?t+r-Zk-f:e.align===`center`?t+(r-f)/2:t+Zk+e.indent*9,_=e.valign===`top`?n+p+1:e.valign===`center`?n+(i+p*.7)/2:n+i-5;if(l.textBaseline=`alphabetic`,h&&(l.save(),l.beginPath(),l.rect(t,n,r-1,i),l.clip()),l.fillText(d.includes(`
30
- `)?d.replaceAll(`
31
- `,` `):d,g,_),e.underline||e.strike){let t=t=>{l.strokeStyle=e.color??a.ink,l.lineWidth=1,l.beginPath(),l.moveTo(g,t),l.lineTo(g+f,t),l.stroke()};e.underline&&t(Math.round(_)+1.5),e.strike&&t(Math.round(_-p*.3)+.5)}h&&l.restore()}heads(e,t,n,r,i){let{view:a,inks:o,selected:s}=e,c=this.g;c.fillStyle=o.head,c.fillRect(0,0,a.width,22),c.fillRect(0,0,46,a.height),this.setFont(`12px "Commissioner Variable", Commissioner, system-ui, sans-serif`),c.textBaseline=`middle`,c.textAlign=`center`;let l=e=>{let t=a.columns.sizeOf(e);if(t===0){if(e>0){let t=Math.round(a.xOf(e))-.5;this.line(t-1,0,t-1,22,o.headInk)}return}let n=Math.max(a.xOf(e),46),r=e>=s.left&&e<=s.right;r&&(c.fillStyle=o.here,c.fillRect(a.xOf(e),0,t,22)),c.fillStyle=r?o.hereInk:o.headInk,c.fillText(Xt(e),a.xOf(e)+t/2,11);let i=Math.round(a.xOf(e)+t)-.5;i>n&&this.line(i,0,i,22,o.headRule)},u=e=>{let t=a.rows.sizeOf(e);if(t===0){if(e>0){let t=Math.round(a.yOf(e))-.5;this.line(0,t-1,46,t-1,o.headInk)}return}let n=a.yOf(e),r=e>=s.top&&e<=s.bottom;r&&(c.fillStyle=o.here,c.fillRect(0,n,46,t)),c.fillStyle=r?o.hereInk:o.headInk,c.fillText(String(e+1),23,n+t/2);let i=Math.round(n+t)-.5;this.line(0,i,46,i,o.headRule)};c.save(),c.beginPath(),c.rect(46+a.frozenWidth,0,a.width,22),c.clip();for(let e=n.first;e<=n.last;e++)l(e);if(c.restore(),i)for(let e=i.first;e<=i.last;e++)l(e);c.save(),c.beginPath(),c.rect(0,22+a.frozenHeight,46,a.height),c.clip();for(let e=t.first;e<=t.last;e++)u(e);if(c.restore(),r)for(let e=r.first;e<=r.last;e++)u(e);c.textAlign=`left`,c.fillStyle=o.head,c.fillRect(0,0,46,22),c.fillStyle=o.headRule,c.beginPath(),c.moveTo(42,18),c.lineTo(32,18),c.lineTo(42,8),c.fill(),this.line(0,21.5,a.width,21.5,o.headRule),this.line(45.5,0,45.5,a.height,o.headRule)}},uA=2e4,dA=20;function fA(e){let t=[],n=e=>`wrap`in e||`size`in e,r=e.used;if(!r)return t;for(let{area:r,entry:i}of e.styledAreas())n(i)&&t.push(r);for(let[r,i]of Object.entries(e.spec.cells??{})){if(typeof i!=`object`||!i||!n(i))continue;let e=tn(r);e&&t.push(e)}for(let[i,a]of Object.entries(e.spec.columns??{})){if(!n(a))continue;let e=tn(`${i}1:${i}${String(r.bottom+1)}`);e&&t.push(e)}for(let[i,a]of Object.entries(e.spec.rows??{})){if(!n(a))continue;let e=Number(i)-1;t.push({top:e,bottom:e,left:0,right:r.right})}for(let r of e.tables)for(let e of r.columns)if(e.spec&&n(e.spec)){let n=r.at.col+e.index;t.push({...r.data,left:n,right:n})}return t.map(e=>({top:e.top,left:e.left,bottom:Math.min(e.bottom,r.bottom),right:Math.min(e.right,r.right)}))}function pA(e,t,n,r){let i=new Map,a=uA;for(let{row:n,paths:r,column:a}of Xr(e,t))r.some(qr)&&i.set(n,Math.max(i.get(n)??0,Jr(a)+4));for(let o of fA(e))for(let s=o.top;s<=o.bottom;s++)for(let c=o.left;c<=o.right;c++){if(a===0)return i;let o=t.value(e,s,c);if(o===null)continue;--a;let l=oA(e,s,c),u=(l.size??11)*4/3,d=Math.round(u*1.25),f=1;l.wrap===!0&&(r.font=mD(l),f=sA(sl(o,l.format),n(c)-6,e=>r.measureText(e).width).length);let p=Math.max(dA,f*d+4);p>(i.get(s)??dA)&&i.set(s,p)}return i}var mA=e=>({active:e,anchor:e,focus:e}),hA=mA({row:0,col:0}),gA=e=>({top:Math.min(e.anchor.row,e.focus.row),left:Math.min(e.anchor.col,e.focus.col),bottom:Math.max(e.anchor.row,e.focus.row),right:Math.max(e.anchor.col,e.focus.col)}),_A=e=>[...e.more??[],gA(e)],vA=e=>{let t=gA(e);return(e.more?.length??0)===0&&t.top===t.bottom&&t.left===t.right},yA=(e,t)=>({active:t,anchor:t,focus:t,more:_A(e)});function bA(e,t){if(t.length===0)return e;let n={...e};for(let e=!0;e;){e=!1;for(let r of t)r.top<=n.bottom&&n.top<=r.bottom&&r.left<=n.right&&n.left<=r.right&&(r.top<n.top||r.left<n.left||r.bottom>n.bottom||r.right>n.right)&&(n.top=Math.min(n.top,r.top),n.left=Math.min(n.left,r.left),n.bottom=Math.max(n.bottom,r.bottom),n.right=Math.max(n.right,r.right),e=!0)}return n}function xA(e,t){let n=t.row>e.bottom?t.row-e.bottom:t.row<e.top?e.top-t.row:0,r=t.col>e.right?t.col-e.right:t.col<e.left?e.left-t.col:0;if(n!==0||r!==0)return n>=r?t.row>e.bottom?{...e,bottom:t.row}:{...e,top:t.row}:t.col>e.right?{...e,right:t.col}:{...e,left:t.col}}function SA(e,t,n){if(t.size===0)return[e];let r=[],i,a=Math.min(e.bottom,n);for(let n=e.top;n<=a;n++)t.has(n)?(i!==void 0&&r.push({...e,top:i,bottom:n-1}),i=void 0):i??=n;return i===void 0?e.bottom>a&&r.push({...e,top:a+1}):r.push({...e,top:i}),r}var CA=e=>Math.min(Jt-1,Math.max(0,e)),wA=e=>Math.min(Yt-1,Math.max(0,e)),TA=e=>({row:CA(e.row),col:wA(e.col)}),EA=(e,t)=>mA(TA({row:e.active.row+t.row,col:e.active.col+t.col})),DA=(e,t)=>({...e,focus:TA(t)}),OA=(e,t)=>({active:{row:0,col:e},anchor:{row:0,col:e},focus:{row:Jt-1,col:t}}),kA=(e,t)=>({active:{row:e,col:0},anchor:{row:e,col:0},focus:{row:t,col:Yt-1}}),AA={active:{row:0,col:0},anchor:{row:0,col:0},focus:{row:Jt-1,col:Yt-1}},jA=e=>e.top===0&&e.bottom===1048575,MA=e=>e.left===0&&e.right===16383;function NA(e,t,n){let r=gA(e),{row:i,col:a}=e.active,o=n?-1:1,s=()=>{let e=a+o;if(e>=r.left&&e<=r.right)return{row:i,col:e};let t=i+o;return{row:t<r.top?r.bottom:t>r.bottom?r.top:t,col:n?r.right:r.left}},c=()=>{let e=i+o;if(e>=r.top&&e<=r.bottom)return{row:e,col:a};let t=a+o,s=t<r.left?r.right:t>r.right?r.left:t;return{row:n?r.bottom:r.top,col:s}};return{...e,active:t===`col`?s():c()}}function PA(e,t,n,r){let i=e=>e.row<0||e.col<0||e.row>=1048576||e.col>=16384,a=e=>({row:e.row+n.row,col:e.col+n.col}),o={row:n.row===0?t.row:n.row>0?Jt-1:0,col:n.col===0?t.col:n.col>0?Yt-1:0},s=a(t);if(i(s))return t;let c=e=>n.row>0&&e.row>r.row||n.col>0&&e.col>r.col;if(e(t)&&e(s)){let t=s;for(;;){let n=a(t);if(i(n)||!e(n))return t;t=n}}let l=s;for(;;){if(e(l))return l;if(c(l))return o;let t=a(l);if(i(t))return l;l=t}}var FA={sheet:`--allyhub-sheet`,ink:`--allyhub-ink`,grid:`--allyhub-rule`,head:`--allyhub-stone`,headInk:`--allyhub-lead`,headRule:`--allyhub-rule-strong`,here:`--allyhub-stone-2`,hereInk:`--allyhub-pencil-text`,agentWash:`--allyhub-agent-wash`,agent:`--allyhub-agent`,caution:`--allyhub-caution`,pencil:`--allyhub-pencil`};function IA(e){let t={};for(let[n,r]of Object.entries(FA))e.style.color=`var(${r})`,t[n]=getComputedStyle(e).color;return t}var LA=40;function RA({ref:e,children:t,...n}){let r=(0,k.useRef)(null),i=(0,k.useRef)(null),a=(0,k.useRef)(null),o=(0,k.useRef)(null),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(void 0),u=(0,k.useRef)(void 0),d=(0,k.useRef)(0),[f]=(0,k.useState)(()=>document.createElement(`canvas`).getContext(`2d`)),p=(0,k.useMemo)(()=>{if(!f)return new Map;let e=new Xk(n.sheet,new Map,n.filtered);return pA(n.sheet,n.calc,t=>e.columns.sizeOf(t),f)},[n.sheet,n.calc,n.revision,f]),m=(0,k.useRef)(void 0),h=(0,k.useMemo)(()=>new Xk(n.sheet,p,n.filtered),[n.sheet,p,n.filtered]),g=(0,k.useMemo)(()=>n.sheet.conditions.length===0?void 0:new Id(n.sheet,n.calc),[n.sheet,n.calc,n.revision]),_=(0,k.useRef)({p:n,view:h,rules:g}),v=(0,k.useCallback)(()=>{d.current=0;let{p:e,view:t,rules:n}=_.current,r=a.current,o=i.current;if(!r||!o||!l.current)return;t.width=r.clientWidth,t.height=r.clientHeight,t.scrollX=r.scrollLeft,t.scrollY=r.scrollTop;let f=(window.devicePixelRatio||1)*e.zoom,p=r.offsetWidth,m=r.offsetHeight;if(l.current.size(p,m,f),o.style.width=`${String(p)}px`,o.style.height=`${String(m)}px`,c.current&&(u.current??=IA(c.current)),!u.current)return;l.current.paint({sheet:e.sheet,calc:e.calc,revision:e.revision,view:t,inks:u.current,selected:gA(e.selection),marks:e.marks,markAreas:e.markAreas,invalid:e.invalid,pictures:e.pictures,rules:n});let h=s.current;if(h){for(let e of h.querySelectorAll(`[data-box]`)){let[n=0,r=0]=(e.dataset.box??``).split(`,`).map(Number);e.style.left=`${String(n-t.scrollX)}px`,e.style.top=`${String(r-t.scrollY)}px`}for(let e of h.querySelectorAll(`[data-area]`)){let[n=0,r=0,i=0,a=0]=(e.dataset.area??``).split(`,`).map(Number),o=t.rectOf({top:n,left:r,bottom:i,right:a}),s=e.dataset.corner,c=s===`foot`?{...o,x:o.x+o.width,y:o.y+o.height}:s===`side`?{...o,x:o.x+o.width}:o,l=e.dataset.sink!==void 0,u=l?Math.min(Math.max(c.x,46),Math.max(46,t.width-24)):Math.max(c.x,38),d=l?Math.min(Math.max(c.y,22),Math.max(22,t.height-24)):Math.max(c.y,14),f=Math.min(c.x+c.width,t.width+8)-u,p=Math.min(c.y+c.height,t.height+8)-d;e.style.left=`${String(u-46)}px`,e.style.top=`${String(d-22)}px`,e.dataset.size!==`free`&&(e.style.width=`${String(Math.max(0,f))}px`,e.style.height=`${String(Math.max(0,p))}px`),e.dataset.minw=String(c.width),e.dataset.minh=String(c.height),l||(e.style.visibility=c.x+c.width<46||c.y+c.height<22?`hidden`:``)}}},[]),y=(0,k.useCallback)(()=>{d.current||=requestAnimationFrame(v)},[v]);(0,k.useLayoutEffect)(()=>{i.current&&(l.current??=new lA(i.current))},[]),(0,k.useLayoutEffect)(()=>{_.current={p:n,view:h,rules:g};let e=_.current.view,t=m.current;t?.sheet===n.sheet.name&&(e.rowCount=Math.max(e.rowCount,t.rows),e.columnCount=Math.max(e.columnCount,t.columns)),m.current={sheet:n.sheet.name,rows:e.rowCount,columns:e.columnCount};let r=o.current;r&&(r.style.width=`${String(e.contentWidth)}px`,r.style.height=`${String(e.contentHeight)}px`),v()}),(0,k.useEffect)(()=>{u.current=void 0,y()},[n.theme,y]),(0,k.useEffect)(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(()=>{y()});return t.observe(e),()=>{t.disconnect()}},[y]);let b=(0,k.useCallback)(()=>{let e=a.current,t=o.current;if(!e||!t)return;let{view:n}=_.current,r=!1;e.scrollTop+e.clientHeight>n.contentHeight-400&&(n.rowCount=Math.min(Jt,n.rowCount+100),r=!0),e.scrollLeft+e.clientWidth>n.contentWidth-400&&(n.columnCount=Math.min(Yt,n.columnCount+26),r=!0),r&&(t.style.width=`${String(n.contentWidth)}px`,t.style.height=`${String(n.contentHeight)}px`,m.current={sheet:_.current.p.sheet.name,rows:n.rowCount,columns:n.columnCount})},[]);(0,k.useImperativeHandle)(e,()=>({view:()=>_.current.view,show:e=>{let t=a.current,n=o.current;if(!t||!n)return;let{view:r}=_.current;e.row+100>r.rowCount&&(r.rowCount=Math.min(Jt,e.row+100)),e.col+26>r.columnCount&&(r.columnCount=Math.min(Yt,e.col+26)),n.style.width=`${String(r.contentWidth)}px`,n.style.height=`${String(r.contentHeight)}px`,m.current={sheet:_.current.p.sheet.name,rows:r.rowCount,columns:r.columnCount},r.width=t.clientWidth,r.height=t.clientHeight,r.scrollX=t.scrollLeft,r.scrollY=t.scrollTop;let{x:i,y:s}=r.scrollFor(e);t.scrollLeft=i,t.scrollTop=s,y()},pageRows:()=>{let{view:e}=_.current,{first:t,last:n}=e.shownRows();return Math.max(1,n-t)},canvas:()=>i.current,draw:()=>{let e=performance.now();return v(),performance.now()-e},pageRect:e=>{let t=i.current?.getBoundingClientRect();if(!t)return;let{p:n,view:r}=_.current,a=r.rectOf(e),o=n.zoom;return new DOMRect(t.x+a.x*o,t.y+a.y*o,a.width*o,a.height*o)},under:(e,t)=>{let n=i.current?.getBoundingClientRect(),r=a.current,o=_.current.p.zoom,s=(e-(n?.x??0))/o,c=(t-(n?.y??0))/o;return r&&(s>r.clientWidth?r.scrollLeft+=LA:s<46&&(r.scrollLeft-=LA),c>r.clientHeight?r.scrollTop+=LA:c<22&&(r.scrollTop-=LA)),_.current.view.hit(Math.max(s,46),Math.max(c,22))}}),[y,v]);let x=e=>{let t=i.current?.getBoundingClientRect();return{x:(e.clientX-(t?.x??0))/n.zoom,y:(e.clientY-(t?.y??0))/n.zoom}},S=(0,k.useRef)(void 0),C=e=>{if(e.button!==0)return;let t=a.current;if(!t)return;let{x:r,y:o}=x(e);if(r>t.clientWidth||o>t.clientHeight)return;let s=h.hit(r,o);if((s.part===`column`||s.part===`row`)&&s.edge){e.preventDefault(),t.setPointerCapture(e.pointerId);let n=s.part===`column`?s.col:s.row;S.current={kind:`resize`,what:s.part,index:n,from:s.part===`column`?r:o,size:s.part===`column`?h.columns.sizeOf(n):h.rows.sizeOf(n)}}else{if(s.part===`cell`&&n.sheet.filterHeadAt(s.row,s.col)){let t=h.xOf(s.col)+h.columns.sizeOf(s.col),a=h.yOf(s.row)+h.rows.sizeOf(s.row);if(t-r<=18&&a-o<=18){e.preventDefault();let r=i.current?.getBoundingClientRect();n.onFilterButton(s,new DOMRect((r?.x??0)+(t-17)*n.zoom,(r?.y??0)+(a-17)*n.zoom,17*n.zoom,17*n.zoom));return}}e.preventDefault(),t.setPointerCapture(e.pointerId),S.current={kind:`select`,x:r,y:o},n.onPress({hit:s,shift:e.shiftKey,meta:e.metaKey||e.ctrlKey})}},w=e=>{let t=a.current,r=S.current;if(!t)return;let{x:i,y:o}=x(e);if(!r){let e=h.hit(i,o);t.style.cursor=e.part===`column`&&e.edge?`col-resize`:e.part===`row`&&e.edge?`row-resize`:e.part===`cell`?`cell`:`default`}else if(r.kind===`resize`){let e=(r.what===`column`?i:o)-r.from;n.onResize(r.what,r.index,Math.max(4,r.size+e))}else r.x=i,r.y=o,n.onDrag(h.hit(Math.max(i,46),Math.max(o,22))),i>t.clientWidth?t.scrollLeft+=LA:i<46&&(t.scrollLeft-=LA),o>t.clientHeight?t.scrollTop+=LA:o<22&&(t.scrollTop-=LA)},T=(0,k.useRef)(n.onZoomStep);(0,k.useEffect)(()=>{T.current=n.onZoomStep}),(0,k.useEffect)(()=>{let e=r.current;if(!e)return;let t=0,n=e=>{(e.metaKey||e.ctrlKey)&&(e.preventDefault(),t+=e.deltaY,!(Math.abs(t)<60)&&(T.current(t>0?-1:1),t=0))};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{e.removeEventListener(`wheel`,n)}},[]),(0,k.useEffect)(()=>{y()},[n.zoom,y]);let ee=()=>{let e=S.current;S.current=void 0,e?.kind===`select`&&n.onRelease()};return(0,A.jsxs)(`div`,{ref:r,className:`sheet-grid`,"data-testid":`sheet-grid`,style:{zoom:n.zoom},children:[(0,A.jsx)(`canvas`,{ref:i,className:`sheet-canvas`,"aria-hidden":!0}),(0,A.jsx)(`div`,{ref:a,className:`sheet-scroller`,"data-testid":`sheet-scroller`,onScroll:()=>{b(),y()},onPointerDown:C,onPointerMove:w,onPointerUp:ee,onPointerCancel:ee,onContextMenu:e=>{e.preventDefault();let{x:t,y:r}=x(e);n.onMenu(h.hit(t,r),e.clientX,e.clientY)},onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&e.preventDefault()},onDrop:e=>{let t=[...e.dataTransfer.files];if(t.length===0)return;e.preventDefault();let{x:r,y:i}=x(e),a=h.hit(r,i);a.part===`cell`&&n.onDropFiles(a,t)},onDoubleClick:e=>{let{x:t,y:r}=x(e),i=h.hit(t,r);i.part===`cell`?n.onOpen(i):i.part===`column`&&i.edge?n.onFit(`column`,i.col):i.part===`row`&&i.edge&&n.onFit(`row`,i.row)},children:(0,A.jsx)(`div`,{ref:o,className:`sheet-sizer`})}),(0,A.jsxs)(`div`,{ref:s,className:`sheet-overlay`,onWheel:e=>{a.current?.scrollBy(e.deltaX,e.deltaY)},children:[(0,A.jsx)(`span`,{ref:c,hidden:!0}),t]})]})}var zA=e=>`${String(e.bottom-e.top+1)}R x ${String(e.right-e.left+1)}C`,BA=e=>e.top===0&&e.bottom===1048575?`${Xt(e.left)}:${Xt(e.right)}`:e.left===0&&e.right===16383?`${String(e.top+1)}:${String(e.bottom+1)}`:$t(e),VA=8,HA=(e,t,n,r)=>n===r?`${e} ${n}`:`${t} ${n} to ${r}`;function UA(e,t){let n=`${e.name}!${$t(t)}`,r=e.tables.find(e=>t.top>=e.area.top&&t.bottom<=e.area.bottom&&t.left>=e.area.left&&t.right<=e.area.right);if(!r)return`cells ${n}`;let i=e=>r.columns[e-r.at.col]?.name??String(e),a=HA(`column`,`columns`,i(t.left),i(t.right));if(t.bottom===r.at.row)return`table ${r.name}, ${a}, its header (${n})`;let o=r.spec.key===void 0?void 0:r.column(r.spec.key),s=e=>{let t=e-r.at.row-1,n=o?.csv===void 0?void 0:r.records[t]?.[o.csv];return n===void 0||n===``?String(t+1):`${r.spec.key??``} ${n}`},c=Math.max(t.top,r.at.row+1);return`table ${r.name}, ${a}, ${HA(`row`,`rows`,s(c),s(t.bottom))} (${n})`}function WA(e,t,n,r,i){let a=e.sourceOf(n,r.top,r.left),o=[];outer:for(let e=r.top;e<=r.bottom;e++)for(let i=r.left;i<=r.right;i++){if(o.length>=VA)break outer;let r=sl(t.value(n,e,i),n.lookAt(e,i).format);r!==``&&o.push(r)}return{name:UA(n,r),source:{path:`${i}/${a?.file===``||a===void 0?`sheet.yaml`:a.file}`,...a?.line===void 0?{}:{line:a.line}},...o.length===0?{}:{text:o.join(` | `)}}}var GA=class{host;dir;changed;held=new Map;constructor(e,t,n){this.host=e,this.dir=t,this.changed=n}load(e){let t={};this.held.set(e,t),this.host[`files/url`]({path:`${this.dir}/${e}`}).then(({url:n})=>{if(t.url=n,!qr(e)){this.changed();return}let r=new Image;r.onload=()=>{t.image=r,this.changed()},r.onerror=()=>{t.missing=!0,this.changed()},r.src=n},()=>{t.missing=!0,this.changed()})}picture(e){return this.held.has(e)||this.load(e),this.held.get(e)?.image}missing(e){return this.held.has(e)||this.load(e),this.held.get(e)?.missing===!0}async urlOf(e){let{url:t}=await this.host[`files/url`]({path:`${this.dir}/${e}`});return t}};function KA(e){let t=ZE(),[n,r]=(0,k.useState)(0),i=e.paths[Math.min(n,e.paths.length-1)]??``,[a,o]=(0,k.useState)();(0,k.useEffect)(()=>{let t=!0;return e.urlOf(i).then(e=>{t&&o(e)},()=>{t&&o(void 0)}),()=>{t=!1}},[i,e]);let s=t=>{r(n=>(n+t+e.paths.length)%e.paths.length)};return(0,A.jsx)(fk,{title:i.split(`/`).pop()??i,testid:`sheet-file-viewer`,wide:!0,onClose:e.onClose,buttons:(0,A.jsxs)(A.Fragment,{children:[e.paths.length>1?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-file-previous`,onClick:()=>{s(-1)},children:t.previous}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-file-next`,onClick:()=>{s(1)},children:t.next})]}):null,e.onRemove?(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-file-remove`,onClick:()=>{e.onRemove?.(i)},children:t.files.remove}):null,a===void 0?null:(0,A.jsx)(C,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,A.jsx)(`a`,{href:a,target:`_blank`,rel:`noreferrer`,"data-testid":`sheet-file-open`,children:t.files.open})}),(0,A.jsx)(C,{size:`sm`,"data-testid":`sheet-file-close`,onClick:e.onClose,children:t.scenario.close})]}),children:(0,A.jsx)(`div`,{className:`sheet-file-view`,children:a!==void 0&&qr(i)?(0,A.jsx)(`img`,{src:a,alt:i,"data-testid":`sheet-file-picture`}):(0,A.jsxs)(`p`,{className:`sheet-dialog-line`,children:[(0,A.jsx)(mt,{className:`mr-1 inline size-4`}),i]})})})}async function qA(e){let t=new Uint8Array(await e.arrayBuffer()),n=``;for(let e=0;e<t.length;e+=32768)n+=String.fromCharCode(...t.subarray(e,e+32768));return btoa(n)}function JA(e){let t=ZE();return(0,A.jsxs)(`div`,{className:`sheet-locked`,"data-testid":`sheet-locked`,role:`status`,children:[(0,A.jsx)(St,{className:`size-3 shrink-0`}),(0,A.jsx)(`span`,{className:`sheet-locked-line`,children:t.generated.line}),(0,A.jsx)(ke,{"data-testid":`sheet-locked-ask`,onClick:e.onAsk,children:t.generated.ask(e.agent)}),(0,A.jsx)(ke,{"data-testid":`sheet-locked-ordinary`,onClick:e.onOrdinary,children:t.generated.ordinary})]})}function YA(e){let t=ZE();return(0,A.jsx)(fk,{title:t.generated.title,testid:`sheet-locked-refused`,onClose:e.onClose,buttons:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-locked-refused-ordinary`,onClick:e.onOrdinary,children:t.generated.ordinary}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-locked-refused-ask`,onClick:e.onAsk,children:t.generated.ask(e.agent)}),(0,A.jsx)(C,{size:`sm`,autoFocus:!0,"data-testid":`sheet-locked-refused-ok`,onClick:e.onClose,children:t.dialog.ok})]}),children:(0,A.jsx)(`p`,{className:`sheet-dialog-line`,children:t.generated.refused})})}function XA(e){let t=ZE(),[n,r]=(0,k.useState)(e.shown),i=e.rows.find(e=>e.name===n);return(0,A.jsxs)(fk,{title:t.scenario.manager,testid:`sheet-scenarios`,onClose:e.onClose,buttons:(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-scenario-close`,onClick:e.onClose,children:t.scenario.close}),(0,A.jsx)(C,{size:`sm`,"data-testid":`sheet-scenario-show`,onClick:()=>{e.onShow(n)},children:t.scenario.show})]}),children:[(0,A.jsx)(`p`,{className:`sheet-dialog-label`,children:t.scenario.scenarios}),(0,A.jsx)(`div`,{className:`sheet-scenario-list`,role:`listbox`,children:e.rows.map(i=>(0,A.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":i.name===n,className:`sheet-menu-row`,"data-testid":`sheet-scenario-${i.name??`base`}`,onClick:()=>{r(i.name)},onDoubleClick:()=>{e.onShow(i.name)},children:[i.name??t.scenario.base,i.name===e.shown?` (${t.scenario.showing})`:``]},i.name??``))}),(0,A.jsx)(`p`,{className:`sheet-dialog-label`,children:t.scenario.changing}),(0,A.jsx)(`p`,{className:`sheet-scenario-sets`,"data-testid":`sheet-scenario-sets`,children:i?.sets.join(`, `)})]})}var ZA=[{id:`lightRed`,fill:`#FFC7CE`,color:`#9C0006`},{id:`yellow`,fill:`#FFEB9C`,color:`#9C5700`},{id:`green`,fill:`#C6EFCE`,color:`#006100`},{id:`lightRedFill`,fill:`#FFC7CE`},{id:`redText`,color:`#9C0006`},{id:`redBorder`,border:`#9C0006`}],QA=e=>{let t=ZA.find(t=>t.id===e)??ZA[0];if(`border`in t){let e={style:`thin`,color:t.border};return{border:{left:e,right:e,top:e,bottom:e}}}return{...`fill`in t?{fill:t.fill}:{},...`color`in t?{color:t.color}:{}}},$A=e=>{let t=e.trim(),n=Number(t);return t!==``&&!Number.isNaN(n)?n:t};function ej(e,t){switch(t){case`greaterThan`:return e.rules.greaterPrompt;case`lessThan`:return e.rules.lessPrompt;case`between`:return e.rules.betweenPrompt;case`equal`:return e.rules.equalPrompt;case`containsText`:return e.rules.textPrompt;case`duplicateValues`:return e.rules.duplicatePrompt;case`top`:return e.rules.topPrompt;case`topPercent`:return e.rules.topPercentPrompt;case`bottom`:return e.rules.bottomPrompt;case`bottomPercent`:return e.rules.bottomPercentPrompt;case`above`:return e.rules.abovePrompt;case`below`:return e.rules.belowPrompt}}function tj(e,t){switch(t){case`greaterThan`:return e.rules.greaterThan;case`lessThan`:return e.rules.lessThan;case`between`:return e.rules.between;case`equal`:return e.rules.equalTo;case`containsText`:return e.rules.textContains;case`duplicateValues`:return e.rules.duplicateValues;case`top`:return e.rules.top10;case`topPercent`:return e.rules.top10Percent;case`bottom`:return e.rules.bottom10;case`bottomPercent`:return e.rules.bottom10Percent;case`above`:return e.rules.aboveAverage;case`below`:return e.rules.belowAverage}}function nj(e,t,n,r,i,a){let o={range:t,...n};switch(e){case`greaterThan`:case`lessThan`:case`equal`:return{...o,type:`cellIs`,operator:e,formula:[$A(r)]};case`between`:return{...o,type:`cellIs`,operator:`between`,formula:[$A(r),$A(i)]};case`containsText`:return{...o,type:`containsText`,text:r};case`duplicateValues`:return{...o,type:a?`uniqueValues`:`duplicateValues`};case`top`:case`topPercent`:case`bottom`:case`bottomPercent`:return{...o,type:`top10`,rank:Math.max(1,Math.round(Number(r))||10),...e===`topPercent`||e===`bottomPercent`?{percent:!0}:{},...e===`bottom`||e===`bottomPercent`?{bottom:!0}:{}};case`above`:return{...o,type:`aboveAverage`};case`below`:return{...o,type:`aboveAverage`,below:!0}}}function rj(e){let t=ZE(),n=e.kind===`top`||e.kind===`topPercent`||e.kind===`bottom`||e.kind===`bottomPercent`,[r,i]=(0,k.useState)(n?`10`:e.start),[a,o]=(0,k.useState)(``),[s,c]=(0,k.useState)(`lightRed`),[l,u]=(0,k.useState)(!1),d=e.kind===`duplicateValues`||e.kind===`above`||e.kind===`below`;return(0,A.jsxs)(fk,{title:tj(t,e.kind),testid:`sheet-rule-dialog`,onClose:e.onClose,onOk:()=>{e.onDone(nj(e.kind,e.range,QA(s),r,a,l))},children:[(0,A.jsx)(`p`,{className:`sheet-dialog-line`,children:ej(t,e.kind)}),e.kind===`duplicateValues`?(0,A.jsxs)(_e,{value:l?`unique`:`duplicate`,onValueChange:e=>{u(e===`unique`)},children:[(0,A.jsx)(ye,{size:`sm`,"aria-label":t.rules.duplicateValues,children:(0,A.jsx)(ve,{})}),(0,A.jsxs)(Te,{children:[(0,A.jsx)(Se,{value:`duplicate`,className:`text-xs`,children:t.rules.duplicate}),(0,A.jsx)(Se,{value:`unique`,className:`text-xs`,children:t.rules.unique})]})]}):null,d?null:(0,A.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,A.jsx)(tt,{autoFocus:!0,"aria-label":tj(t,e.kind),"data-testid":`sheet-rule-value`,value:r,onChange:e=>{i(e.target.value)}}),e.kind===`between`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(`span`,{children:t.rules.and}),(0,A.jsx)(tt,{"aria-label":t.rules.and,"data-testid":`sheet-rule-second`,value:a,onChange:e=>{o(e.target.value)}})]}):null]}),(0,A.jsx)(pk,{label:t.rules.with,children:(0,A.jsxs)(_e,{value:s,onValueChange:e=>{c(e)},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-rule-look`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:ZA.map(e=>(0,A.jsx)(Se,{value:e.id,className:`text-xs`,children:t.rules.looks[e.id]},e.id))})]})})]})}var ij=[`any`,`whole`,`decimal`,`list`,`date`,`time`,`textLength`,`custom`],aj=[`between`,`notBetween`,`equal`,`notEqual`,`greaterThan`,`lessThan`,`greaterThanOrEqual`,`lessThanOrEqual`],oj=e=>e===void 0?``:String(e),sj=e=>$A(e);function cj(e){let t=ZE(),{rule:n}=e,[r,i]=(0,k.useState)(n?.type??`any`),[a,o]=(0,k.useState)(n?.operator??`between`),[s,c]=(0,k.useState)(()=>n?.values?n.values.join(`,`):oj(n?.formula?.[0])),[l,u]=(0,k.useState)(oj(n?.formula?.[1])),[d,f]=(0,k.useState)(n?.blank!==!1),[p,m]=(0,k.useState)(n?.dropdown!==!1),[h,g]=(0,k.useState)(n?.prompt?.show!==!1),[_,v]=(0,k.useState)(n?.prompt?.title??``),[y,b]=(0,k.useState)(n?.prompt?.message??``),[x,S]=(0,k.useState)(n?.error?.show!==!1),[w,T]=(0,k.useState)(n?.error?.style??`stop`),[ee,E]=(0,k.useState)(n?.error?.title??``),[D,te]=(0,k.useState)(n?.error?.message??``),ne=r!==`any`&&r!==`list`&&r!==`custom`,re=ne&&(a===`between`||a===`notBetween`);return(0,A.jsx)(fk,{title:t.validation.title,testid:`sheet-validation`,wide:!0,onClose:e.onClose,onOk:()=>{if(r===`any`){e.onDone(void 0);return}let t=e=>Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0&&e!==``)),n=t({title:_,message:y,show:h?void 0:!1}),i=t({style:w===`stop`?void 0:w,title:ee,message:D,show:x?void 0:!1}),o=r===`list`&&!s.trim().startsWith(`=`);e.onDone({type:r,...ne&&a!==`between`?{operator:a}:{},...o?{values:s.split(`,`).map(e=>e.trim())}:{formula:re?[sj(s),sj(l)]:[sj(s)]},...d?{}:{blank:!1},...r===`list`&&!p?{dropdown:!1}:{},...Object.keys(n).length>0?{prompt:n}:{},...Object.keys(i).length>0?{error:i}:{}})},left:(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-validation-clear`,onClick:()=>{e.onDone(void 0)},children:t.validation.clearAll}),children:(0,A.jsxs)(sk,{defaultValue:`settings`,children:[(0,A.jsxs)(lk,{children:[(0,A.jsx)(uk,{value:`settings`,children:t.validation.settings}),(0,A.jsx)(uk,{value:`input`,"data-testid":`sheet-validation-input`,children:t.validation.inputMessage}),(0,A.jsx)(uk,{value:`error`,"data-testid":`sheet-validation-error`,children:t.validation.errorAlert})]}),(0,A.jsxs)(dk,{value:`settings`,className:`sheet-dialog-tab`,children:[(0,A.jsx)(pk,{label:t.validation.allow,children:(0,A.jsxs)(_e,{value:r,onValueChange:e=>{i(e)},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-validation-allow`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:ij.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,"data-testid":`sheet-allow-${e}`,children:t.validation.kinds[e]},e))})]})}),r===`any`?null:(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:d,onCheckedChange:e=>{f(e===!0)}}),(0,A.jsx)(`span`,{children:t.validation.ignoreBlank})]}),r===`list`?(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:p,onCheckedChange:e=>{m(e===!0)}}),(0,A.jsx)(`span`,{children:t.validation.dropdown})]}):null,ne?(0,A.jsx)(pk,{label:t.validation.data,children:(0,A.jsxs)(_e,{value:a,onValueChange:e=>{o(e)},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-validation-data`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:aj.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:t.validation.operators[e]},e))})]})}):null,r===`any`?null:(0,A.jsx)(pk,{label:r===`list`?t.validation.source:r===`custom`?t.validation.formula:re?t.validation.minimum:t.validation.value,children:(0,A.jsx)(tt,{"data-testid":`sheet-validation-first`,value:s,onChange:e=>{c(e.target.value)}})}),re?(0,A.jsx)(pk,{label:t.validation.maximum,children:(0,A.jsx)(tt,{"data-testid":`sheet-validation-second`,value:l,onChange:e=>{u(e.target.value)}})}):null]}),(0,A.jsxs)(dk,{value:`input`,className:`sheet-dialog-tab`,children:[(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:h,onCheckedChange:e=>{g(e===!0)}}),(0,A.jsx)(`span`,{children:t.validation.showPrompt})]}),(0,A.jsx)(pk,{label:t.validation.titleWord,children:(0,A.jsx)(tt,{"data-testid":`sheet-validation-prompt-title`,value:_,onChange:e=>{v(e.target.value)}})}),(0,A.jsx)(pk,{label:t.validation.inputMessage,children:(0,A.jsx)(Ue,{"data-testid":`sheet-validation-prompt`,value:y,onChange:e=>{b(e.target.value)}})})]}),(0,A.jsxs)(dk,{value:`error`,className:`sheet-dialog-tab`,children:[(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:x,onCheckedChange:e=>{S(e===!0)}}),(0,A.jsx)(`span`,{children:t.validation.showError})]}),(0,A.jsx)(pk,{label:t.validation.style,children:(0,A.jsxs)(_e,{value:w,onValueChange:e=>{T(e)},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-validation-style`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:[`stop`,`warning`,`information`].map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:t.validation.styles[e]},e))})]})}),(0,A.jsx)(pk,{label:t.validation.titleWord,children:(0,A.jsx)(tt,{"data-testid":`sheet-validation-error-title`,value:ee,onChange:e=>{E(e.target.value)}})}),(0,A.jsx)(pk,{label:t.validation.errorMessage,children:(0,A.jsx)(Ue,{"data-testid":`sheet-validation-error-message`,value:D,onChange:e=>{te(e.target.value)}})})]})]})})}function lj(e){let t=ZE(),n=e.rule.error?.style??`stop`,r=e.rule.error?.title??t.validation.refusedTitle,i=e.rule.error?.message??t.validation.refused;return(0,A.jsxs)(fk,{title:r,testid:`sheet-refused`,onClose:e.onCancel,buttons:n===`stop`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-refused-cancel`,onClick:e.onCancel,children:t.dialog.cancel}),(0,A.jsx)(C,{size:`sm`,"data-testid":`sheet-refused-retry`,onClick:e.onRetry,children:t.validation.retry})]}):n===`warning`?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-refused-cancel`,onClick:e.onCancel,children:t.dialog.cancel}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-refused-no`,onClick:e.onRetry,children:t.validation.no}),(0,A.jsx)(C,{size:`sm`,"data-testid":`sheet-refused-yes`,onClick:e.onAccept,children:t.validation.yes})]}):(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-refused-cancel`,onClick:e.onCancel,children:t.dialog.cancel}),(0,A.jsx)(C,{size:`sm`,"data-testid":`sheet-refused-yes`,onClick:e.onAccept,children:t.dialog.ok})]}),children:[(0,A.jsx)(`p`,{className:`sheet-dialog-line`,children:i}),n===`warning`?(0,A.jsx)(`p`,{className:`sheet-dialog-line`,children:t.validation.continue}):null]})}function uj(e){let t=ZE(),[n,r]=(0,k.useState)([e.start]),[i,a]=(0,k.useState)(e.header),o=(e,t)=>{r(n=>n.map((n,r)=>r===e?{...n,...t}:n))};return(0,A.jsxs)(fk,{title:t.sort.title,testid:`sheet-sort-dialog`,wide:!0,onClose:e.onClose,onOk:()=>{e.onDone(n,i)},left:(0,A.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,A.jsx)(C,{variant:`ghost`,size:`sm`,"data-testid":`sheet-sort-add`,onClick:()=>{r(t=>[...t,{col:e.columns[0]?.col??0,descending:!1}])},children:t.sort.addLevel}),(0,A.jsx)(C,{variant:`ghost`,size:`sm`,disabled:n.length<2,"data-testid":`sheet-sort-remove`,onClick:()=>{r(e=>e.slice(0,-1))},children:t.sort.deleteLevel})]}),children:[(0,A.jsxs)(`label`,{className:`sheet-tick`,children:[(0,A.jsx)(xe,{checked:i,"data-testid":`sheet-sort-header`,onCheckedChange:e=>{a(e===!0)}}),(0,A.jsx)(`span`,{children:t.sort.hasHeaders})]}),n.map((n,r)=>(0,A.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,A.jsx)(`span`,{children:r===0?t.sort.sortBy:t.sort.thenBy}),(0,A.jsxs)(_e,{value:String(n.col),onValueChange:e=>{o(r,{col:Number(e)})},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-sort-column-${String(r)}`,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:e.columns.map(e=>(0,A.jsx)(Se,{value:String(e.col),className:`text-xs`,children:e.name},e.col))})]}),(0,A.jsxs)(_e,{value:n.descending?`down`:`up`,onValueChange:e=>{o(r,{descending:e===`down`})},children:[(0,A.jsx)(ye,{size:`sm`,"data-testid":`sheet-sort-order-${String(r)}`,children:(0,A.jsx)(ve,{})}),(0,A.jsxs)(Te,{children:[(0,A.jsx)(Se,{value:`up`,className:`text-xs`,children:t.filter.aToZShort}),(0,A.jsx)(Se,{value:`down`,className:`text-xs`,children:t.filter.zToAShort})]})]})]},String(r)))]})}function dj(e){let[t,n]=(0,k.useState)(String(e.start)),r=Number(t);return(0,A.jsx)(fk,{title:e.title,testid:`sheet-size-dialog`,onClose:e.onClose,onOk:()=>{Number.isFinite(r)&&r>=0&&e.onDone(r)},children:(0,A.jsx)(tt,{autoFocus:!0,"aria-label":e.title,"data-testid":`sheet-size-value`,value:t,onChange:e=>{n(e.target.value)}})})}function fj(e){let t=ZE(),[n,r]=(0,k.useState)(e.sheets[0]??``);return(0,A.jsx)(fk,{title:t.arrange.unhideSheet,testid:`sheet-unhide-dialog`,onClose:e.onClose,onOk:()=>{e.onDone(n)},children:(0,A.jsxs)(_e,{value:n,onValueChange:r,children:[(0,A.jsx)(ye,{size:`sm`,"aria-label":t.arrange.unhideSheet,children:(0,A.jsx)(ve,{})}),(0,A.jsx)(Te,{children:e.sheets.map(e=>(0,A.jsx)(Se,{value:e,className:`text-xs`,children:e},e))})]})})}function pj(e){return(0,A.jsx)(fk,{title:e.title,testid:`sheet-ask`,onClose:e.onClose,onOk:e.onDone,children:(0,A.jsx)(`p`,{className:`sheet-dialog-line`,children:e.message})})}var mj={ABS:`number`,AND:`logical1, [logical2], …`,AVERAGE:`number1, [number2], …`,AVERAGEIF:`range, criteria, [average_range]`,AVERAGEIFS:`average_range, criteria_range1, criteria1, …`,BYCOL:`array, lambda`,BYROW:`array, lambda`,CEILING:`number, significance`,CHOOSE:`index_num, value1, [value2], …`,CONCAT:`text1, [text2], …`,CONCATENATE:`text1, [text2], …`,COUNT:`value1, [value2], …`,COUNTA:`value1, [value2], …`,COUNTBLANK:`range`,COUNTIF:`range, criteria`,COUNTIFS:`criteria_range1, criteria1, …`,DATE:`year, month, day`,DATEDIF:`start_date, end_date, unit`,DAY:`serial_number`,EDATE:`start_date, months`,EOMONTH:`start_date, months`,EXACT:`text1, text2`,FILTER:`array, include, [if_empty]`,FIND:`find_text, within_text, [start_num]`,FLOOR:`number, significance`,FV:`rate, nper, pmt, [pv], [type]`,HLOOKUP:`lookup_value, table_array, row_index_num, [range_lookup]`,HOUR:`serial_number`,IF:`logical_test, [value_if_true], [value_if_false]`,IFERROR:`value, value_if_error`,IFNA:`value, value_if_na`,IFS:`logical_test1, value_if_true1, …`,INDEX:`array, row_num, [column_num]`,INDIRECT:`ref_text, [a1]`,INT:`number`,IRR:`values, [guess]`,ISBLANK:`value`,ISERROR:`value`,ISNUMBER:`value`,ISTEXT:`value`,LAMBDA:`[parameter1], …, calculation`,LARGE:`array, k`,LEFT:`text, [num_chars]`,LEN:`text`,LET:`name1, value1, …, calculation`,LOOKUP:`lookup_value, lookup_vector, [result_vector]`,LOWER:`text`,MAKEARRAY:`rows, columns, lambda`,MAP:`array1, [array2], …, lambda`,MATCH:`lookup_value, lookup_array, [match_type]`,MAX:`number1, [number2], …`,MAXIFS:`max_range, criteria_range1, criteria1, …`,MEDIAN:`number1, [number2], …`,MID:`text, start_num, num_chars`,MIN:`number1, [number2], …`,MINIFS:`min_range, criteria_range1, criteria1, …`,MINUTE:`serial_number`,MOD:`number, divisor`,MONTH:`serial_number`,NETWORKDAYS:`start_date, end_date, [holidays]`,NOT:`logical`,NOW:``,NPER:`rate, pmt, pv, [fv], [type]`,NPV:`rate, value1, [value2], …`,OFFSET:`reference, rows, cols, [height], [width]`,OR:`logical1, [logical2], …`,PMT:`rate, nper, pv, [fv], [type]`,POWER:`number, power`,PRODUCT:`number1, [number2], …`,PROPER:`text`,PV:`rate, nper, pmt, [fv], [type]`,RAND:``,RANDARRAY:`[rows], [columns], [min], [max], [integer]`,RANDBETWEEN:`bottom, top`,RANK:`number, ref, [order]`,RATE:`nper, pmt, pv, [fv], [type], [guess]`,REDUCE:`[initial_value], array, lambda`,REPLACE:`old_text, start_num, num_chars, new_text`,REPT:`text, number_times`,RIGHT:`text, [num_chars]`,ROUND:`number, num_digits`,ROUNDDOWN:`number, num_digits`,ROUNDUP:`number, num_digits`,ROW:`[reference]`,ROWS:`array`,SCAN:`[initial_value], array, lambda`,SEARCH:`find_text, within_text, [start_num]`,SEQUENCE:`rows, [columns], [start], [step]`,SMALL:`array, k`,SORT:`array, [sort_index], [sort_order], [by_col]`,SORTBY:`array, by_array1, [sort_order1], …`,SQRT:`number`,STDEV:`number1, [number2], …`,SUBSTITUTE:`text, old_text, new_text, [instance_num]`,SUBTOTAL:`function_num, ref1, [ref2], …`,SUM:`number1, [number2], …`,SUMIF:`range, criteria, [sum_range]`,SUMIFS:`sum_range, criteria_range1, criteria1, …`,SUMPRODUCT:`array1, [array2], …`,TEXT:`value, format_text`,TEXTJOIN:`delimiter, ignore_empty, text1, [text2], …`,TEXTSPLIT:`text, col_delimiter, [row_delimiter], [ignore_empty], [match_mode], [pad_with]`,TIME:`hour, minute, second`,TODAY:``,TRIM:`text`,TRUNC:`number, [num_digits]`,UNIQUE:`array, [by_col], [exactly_once]`,UPPER:`text`,VALUE:`text`,VLOOKUP:`lookup_value, table_array, col_index_num, [range_lookup]`,WEEKDAY:`serial_number, [return_type]`,WORKDAY:`start_date, days, [holidays]`,XLOOKUP:`lookup_value, lookup_array, return_array, [if_not_found], [match_mode], [search_mode]`,XMATCH:`lookup_value, lookup_array, [match_mode], [search_mode]`,YEAR:`serial_number`},hj=4;function gj(e){let t=mj[e];if(t!==void 0)return t===``?[]:t.split(`, `);let n=cf.get(e);if(!n)return;let r=[],i=Math.min(n.max,Math.max(n.min,hj));for(let e=0;e<i;e++){let t=`value${String(e+1)}`;r.push(e<n.min?t:`[${t}]`)}return n.max>i&&r.push(`…`),r}function _j(e,t){let n=e.length-1;return e[n]===`…`?Math.min(t,Math.max(0,n-1)):Math.min(t,n)}var vj=5;function yj(e){let t=ZE(),[n,r]=(0,k.useState)(!1);return e.renaming?(0,A.jsx)(`input`,{className:`sheet-tab-name`,"aria-label":t.rename,"data-testid":`sheet-tab-name`,defaultValue:e.name,size:Math.max(e.name.length,4),autoFocus:!0,onFocus:e=>{e.currentTarget.select()},onKeyDown:t=>{t.stopPropagation(),t.key===`Enter`&&e.onRename(t.currentTarget.value),t.key===`Escape`&&e.onRenaming(!1)},onBlur:t=>{e.onRename(t.currentTarget.value)}}):(0,A.jsxs)(`span`,{className:`sheet-tab`,"data-active":e.active?``:void 0,"data-drop":e.dropBefore?`before`:e.dropAfter?`after`:void 0,style:e.color===void 0?void 0:{boxShadow:`inset 0 -3px 0 ${e.color}`},children:[(0,A.jsxs)(`button`,{type:`button`,className:`sheet-tab-button`,"data-testid":`sheet-tab`,"data-name":e.name,"data-active":e.active?``:void 0,"data-drop":e.dropBefore?`before`:e.dropAfter?`after`:void 0,onPointerDown:t=>{t.preventDefault(),t.button===0&&e.onPress(t)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.onShow())},onDoubleClick:()=>{!e.disabled&&!e.locked&&e.onRenaming(!0)},onContextMenu:t=>{t.preventDefault(),e.disabled||r(!0)},children:[e.locked?(0,A.jsx)(St,{className:`mr-1 inline size-3`,"data-testid":`sheet-tab-lock`}):null,e.name]}),(0,A.jsxs)(oe,{open:n,onOpenChange:r,children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`sheet-tab-menu`,"aria-label":t.sheetMenu,title:t.sheetMenu,disabled:e.disabled,"data-testid":`sheet-tab-menu`,children:(0,A.jsx)(me,{})})}),(0,A.jsxs)(y,{align:`start`,side:`top`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[(0,A.jsx)(E,{"data-testid":`sheet-tab-insert`,onSelect:e.onInsert,children:t.insert}),(0,A.jsx)(E,{disabled:e.locked,"data-testid":`sheet-tab-delete`,onSelect:e.onDelete,children:t.delete}),(0,A.jsx)(E,{disabled:e.locked,"data-testid":`sheet-tab-rename`,onSelect:()=>{e.onRenaming(!0)},children:t.rename}),(0,A.jsx)(E,{disabled:e.locked,"data-testid":`sheet-tab-duplicate`,onSelect:e.onDuplicate,children:t.duplicate}),(0,A.jsxs)(S,{children:[(0,A.jsx)(D,{disabled:e.locked,"data-testid":`sheet-tab-color`,children:t.arrange.tabColor}),(0,A.jsxs)(re,{className:`p-2`,children:[(0,A.jsx)(`div`,{className:`grid grid-cols-10 gap-1`,children:[...xD,...SD].map(t=>(0,A.jsx)(E,{"aria-label":t,"data-color":t,className:`border-rule size-5 rounded-sm border p-0`,style:{background:t},onSelect:()=>{e.onColor(t)}},t))}),(0,A.jsx)(E,{className:`text-xs`,"data-testid":`sheet-tab-no-color`,onSelect:()=>{e.onColor(void 0)},children:t.arrange.noColor})]})]}),(0,A.jsx)(x,{}),(0,A.jsx)(E,{disabled:e.locked,"data-testid":`sheet-tab-hide`,onSelect:e.onHide,children:t.menu.hide}),(0,A.jsx)(E,{disabled:!e.onUnhide,"data-testid":`sheet-tab-unhide`,onSelect:()=>e.onUnhide?.(),children:t.arrange.unhideEllipsis}),(0,A.jsx)(be,{})]})]})]})}function bj(e){let t=ZE();return(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(ke,{icon:!0,"aria-label":t.allSheets,title:t.allSheets,"data-testid":`sheet-all`,children:(0,A.jsx)(Ct,{})})}),(0,A.jsxs)(y,{align:`start`,side:`top`,className:`max-h-80 text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[e.sheets.map(t=>(0,A.jsxs)(E,{"data-testid":`sheet-all-item`,"data-name":t.name,onSelect:()=>{e.onShow(t.name)},children:[(0,A.jsx)(je,{className:t.name===e.shown?``:`invisible`}),t.name,t.locked?(0,A.jsx)(St,{className:`ml-auto size-3`}):null]},t.name)),e.onUnhide?(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(x,{}),(0,A.jsx)(E,{"data-testid":`sheet-all-unhide`,onSelect:()=>e.onUnhide?.(),children:t.arrange.unhideEllipsis})]}):null]})]})}function xj(e){let t=ZE(),[n,r]=(0,k.useState)(),[i,a]=(0,k.useState)(),o=(0,k.useRef)(null);(0,k.useEffect)(()=>{o.current?.querySelector(`[data-testid="sheet-tab"][data-active]`)?.scrollIntoView({block:`nearest`,inline:`nearest`})},[e.shown]);let s=e=>{let t=[...o.current?.querySelectorAll(`[data-testid="sheet-tab"]`)??[]],n=t.findIndex(t=>{let n=t.getBoundingClientRect();return e<n.x+n.width/2});return n<0?t.length:n},c=(t,n)=>{let r=n.clientX,i=n.currentTarget;i.setPointerCapture(n.pointerId);let o=!1,c=e=>{!o&&Math.abs(e.clientX-r)<vj||(o=!0,a(s(e.clientX)))},l=n=>{if(i.removeEventListener(`pointermove`,c),i.removeEventListener(`pointerup`,l),a(void 0),!o){e.onShow(t);return}let r=e.sheets.findIndex(e=>e.name===t),u=s(n.clientX),d=u>r?u-1:u,f=t=>e.sheets[t]?.locked===!0;e.disabled||d===r||f(r)||f(d)||e.onMove(t,d)};i.addEventListener(`pointermove`,c),i.addEventListener(`pointerup`,l)};return(0,A.jsxs)(`nav`,{className:`sheet-tabs-place`,"aria-label":t.sheetTabs,children:[(0,A.jsx)(ke,{icon:!0,"aria-label":t.newSheet,title:t.newSheet,disabled:e.disabled,"data-testid":`sheet-add`,onClick:()=>{e.onAdd()},children:(0,A.jsx)(Ze,{})}),(0,A.jsx)(bj,{sheets:e.sheets,shown:e.shown,onShow:e.onShow,onUnhide:e.onUnhide,onDone:e.onDone}),(0,A.jsx)(`div`,{ref:o,className:`sheet-tabs`,"data-testid":`sheet-tabs`,children:e.sheets.map((t,a)=>(0,A.jsx)(yj,{name:t.name,color:t.color,active:t.name===e.shown,disabled:e.disabled,locked:t.locked,renaming:n===t.name,dropBefore:i===a,dropAfter:i===e.sheets.length&&a===e.sheets.length-1,onShow:()=>{e.onShow(t.name)},onRenaming:n=>{r(n?t.name:void 0),n||e.onDone()},onRename:n=>{r(void 0),n!==t.name&&e.onRename(t.name,n),e.onDone()},onInsert:e.onAdd,onDelete:()=>{e.onDelete(t.name)},onDuplicate:()=>{e.onDuplicate(t.name)},onHide:()=>{e.onHide(t.name)},onUnhide:e.onUnhide,onColor:n=>{e.onColor(t.name,n)},onPress:e=>{c(t.name,e)},onDone:e.onDone},t.name))})]})}function Sj(e){let{stats:t,records:n,scenario:r}=e,i=ZE();return(0,A.jsxs)(`div`,{className:`sheet-status`,"data-testid":`sheet-status`,children:[r===void 0?null:(0,A.jsx)(`button`,{type:`button`,className:`sheet-scenario-on`,"data-testid":`sheet-scenario-on`,onClick:e.onScenario,children:i.scenario.on(r)}),n?(0,A.jsx)(`span`,{"data-testid":`sheet-records`,children:i.filter.found(n.shown,n.total)}):null,t?(0,A.jsx)(wj,{...t}):null,(0,A.jsx)(Cj,{zoom:e.zoom,onZoom:e.onZoom,onDone:e.onDone})]})}function Cj(e){let t=ZE(),n=e=>`${String(Math.round(e*100))}%`;return(0,A.jsxs)(`span`,{className:`sheet-zoom`,children:[(0,A.jsx)(ke,{icon:!0,"aria-label":t.zoomOut,title:t.zoomOut,disabled:e.zoom<=(Uk[0]??1),"data-testid":`sheet-zoom-out`,onClick:()=>{e.onZoom(Wk(e.zoom,-1))},children:(0,A.jsx)(Ge,{})}),(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`sheet-zoom-size`,"aria-label":t.zoom,title:t.zoom,"data-testid":`sheet-zoom`,children:n(e.zoom)})}),(0,A.jsx)(y,{align:`end`,side:`top`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:Uk.map(t=>(0,A.jsxs)(E,{"data-testid":`sheet-zoom-to`,"data-zoom":t,onSelect:()=>{e.onZoom(t)},children:[(0,A.jsx)(je,{className:t===e.zoom?``:`invisible`}),n(t)]},t))})]}),(0,A.jsx)(ke,{icon:!0,"aria-label":t.zoomIn,title:t.zoomIn,disabled:e.zoom>=(Uk[Uk.length-1]??1),"data-testid":`sheet-zoom-in`,onClick:()=>{e.onZoom(Wk(e.zoom,1))},children:(0,A.jsx)(Ze,{})})]})}function wj(e){let t=ZE();return(0,A.jsxs)(A.Fragment,{children:[e.average===void 0?null:(0,A.jsxs)(`span`,{"data-testid":`sheet-average`,children:[t.average,`: `,e.average]}),(0,A.jsxs)(`span`,{"data-testid":`sheet-count`,children:[t.count,`: `,e.count]}),e.sum===void 0?null:(0,A.jsxs)(`span`,{"data-testid":`sheet-sum`,children:[t.sum,`: `,e.sum]})]})}function Tj(e,t,n,r){let i=Math.min(n.right,t.used?.right??0);return dn(r.map(r=>{let a=[];for(let o=n.left;o<=i;o++)a.push(sl(e.calc.value(t,r,o),t.lookAt(r,o).format));return a}))}function Ej(e,t,n){let r=[],i=Math.min(t.bottom,e.used?.bottom??0);for(let e=t.top;e<=i;e++)n.has(e)||r.push(e);return r}function Dj(e,t){for(let n=e.file.sheets.length+1;;n++){let r=t.sheetName(n);if(!e.workbook.sheet(r))return r}}function Oj(e,t,n){let r=e.workbook.table(t);if(r)return{sheet:r.sheet.name,area:r.rows>0?r.data:r.area};let i=e.workbook.name(t)?.formula?.text,a=i===void 0?void 0:Pk(i)[0];return a?{sheet:a.sheet??n,area:a.area}:void 0}function kj(e,t,n){let r=Pk(`=${t}`)[0];if(!r||r.end-r.start!==t.length)return;let i=r.sheet??n;return e.workbook.sheet(i)?{sheet:i,area:r.area}:void 0}var Aj=e=>({active:{row:e.top,col:e.left},anchor:{row:e.top,col:e.left},focus:{row:e.bottom,col:e.right}}),jj=(e,t)=>{switch(e){case`table-header`:return t.tableHeader;case`last-sheet`:return t.lastSheet;case`column-name`:return t.columnName;case`sheet-name`:return t.badSheetName;case`sheet-taken`:return t.sheetTaken;case`name-invalid`:return t.badName;case`no-sheet`:return t.badReference;case`merge-table`:return t.arrange.mergeTable;case`no-data`:return t.sortFilter.noData;case`table-move`:return t.menu.tableMove}},Mj=e=>{e.target instanceof HTMLInputElement||e.preventDefault()},Nj={b:`bold`,i:`italic`,u:`underline`},Pj=e=>({...e,pick:void 0}),Fj=()=>()=>void 0,Ij=()=>void 0,Lj=new Set,Rj={"~":`General`,$:`$#,##0.00`,"%":`0%`,"^":`0.00E+00`,"#":`d-mmm-yy`,"@":`h:mm AM/PM`,"!":`#,##0.00`},zj=e=>Math.round(e*3/4*100)/100,Bj=e=>e*4/3,Vj=e=>Math.round((e-5)/7*100)/100,Hj=e=>Math.round(e*7+5);function Uj({dir:e,files:t,state:n,book:r,onProbe:i}){let a=ZE(),o=ae(),s=(0,k.useRef)(null),c=(0,k.useRef)(null),l=(0,k.useRef)(null),u=(0,k.useRef)(null),d=te(),[f,p]=(0,k.useState)(1),m=r.workbook.file.sheets.filter(e=>e.hidden!==!0),[h,v]=(0,k.useState)(m[0]?.name??``),x=r.workbook.sheet(h)??r.workbook.sheets.find(e=>e.spec.hidden!==!0)??r.workbook.sheets[0],S=x?.name??``,C=(0,k.useRef)(new Map),[w,ee]=(0,k.useState)(hA),[D,ne]=(0,k.useState)(),[re,ie]=(0,k.useState)(),[se,ce]=(0,k.useState)(),[le,ue]=(0,k.useState)(),[de,fe]=(0,k.useState)(!1),[pe,me]=(0,k.useState)(0),[he,ge]=(0,k.useState)(),[_e,ve]=(0,k.useState)(),[ye,be]=(0,k.useState)(),[xe,Se]=(0,k.useState)(),[Ce,we]=(0,k.useState)(),[Te,De]=(0,k.useState)(),[Oe,ke]=(0,k.useState)(),[je,Me]=(0,k.useState)(),Ne=(0,k.useRef)(void 0),Pe=(0,k.useRef)(0),Fe=n.problems===void 0,Ie=x?.generated===!0,[,Le]=(0,k.useState)(0),[Re]=(0,k.useState)(()=>new GA(d,e,()=>{Le(e=>e+1)})),ze=(0,k.useRef)(void 0),[Be,Ve]=(0,k.useState)(!1),[He,Ue]=(0,k.useState)(),We=(0,k.useRef)(null),Ge=(0,k.useCallback)((e,t=S)=>{C.current.set(t,e),ee(e)},[S]),Ke=e=>e?.surface===`bar`?l.current:c.current,qe=(0,k.useCallback)(()=>{c.current?.focus({preventScroll:!0})},[]);(0,k.useEffect)(()=>{qe()},[qe]),(0,k.useEffect)(()=>{let e=e=>{e.target===document.body&&qe()};return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[qe]);let Je=e=>{ce(e)},Ye=e=>r.workbook.sheet(e)?.generated===!0&&(ge({kind:`locked`}),!0),O=(e,t,n=w)=>!Ye(S)&&Xe(e,t,n),Xe=(e,n,r=w)=>{let i=t.edit(e,{...n===void 0?{}:{group:n},where:{sheet:S,selection:r}});return i===void 0?(Je(void 0),!0):(Je(jj(i,a)),!1)},Ze=e=>{v(e),be(void 0),ee(C.current.get(e)??hA)},Qe=(e,t)=>{e!==S&&Ze(e),C.current.set(e,t),ee(t),s.current?.show(t.active)},$e=e=>typeof e==`object`&&e&&`sheet`in e?e:void 0,et=()=>{let e=$e(t.undoStep());e&&Qe(e.sheet,e.selection)},tt=()=>{let e=$e(t.redoStep());e&&Qe(e.sheet,e.selection)},nt=e=>{if(!x||!Fe)return;if(Ye(S)){c.current&&(c.current.value=``);return}let t=e.surface===`bar`?l.current:c.current,n={sheet:S,at:w.active,area:gA(w),text:e.text,caret:e.text.length,surface:e.surface??`cell`,mode:e.mode};ne(n),me(0),ue(void 0),c.current&&c.current.value!==e.text&&(c.current.value=e.text),e.surface!==`bar`&&(t?.focus({preventScroll:!0}),t?.setSelectionRange(e.text.length,e.text.length)),s.current?.show(w.active)},rt=(0,k.useCallback)(e=>x?id(r,x,e.row,e.col):``,[r,x]),it=(0,k.useMemo)(()=>x?r.calc.filtered(x):Lj,[x]),at=e=>{let t=x?.mergeAt(e.row,e.col);return t?{row:t.top,col:t.left}:e},ot=(e,t)=>{let n=x?.mergeAt(e.row,e.col),r=t.row>0?(n?.bottom??e.row)+t.row:t.row<0?(n?.top??e.row)+t.row:e.row,i=t.col>0?(n?.right??e.col)+t.col:t.col<0?(n?.left??e.col)+t.col:e.col,a=s.current?.view(),o=Math.min(Jt-1,Math.max(0,r)),c=Math.min(Yt-1,Math.max(0,i));return at({row:a?.rows.nextShown(o,t.row<0?-1:1,1048576)??o,col:a?.columns.nextShown(c,t.col<0?-1:1,16384)??c})},st=()=>{ge(void 0),requestAnimationFrame(()=>{qe()})},ct=()=>{ne(void 0),fe(!1),c.current&&(c.current.value=``),qe()},lt=()=>{let e=D?.sheet;ct(),e!==void 0&&e!==S&&Ze(e)},ut=(e={})=>{let n=D;if(!n)return!0;let i=r.workbook.sheet(n.sheet);if(!i)return!0;let o=n.text;if(jk(o)&&o.length>1){o=Hk(o);let e=fr(o);if(!e.ok){let t=e.error.at;ne({...n,text:o,problem:!0,caret:t}),Je(a.formulaProblem);let r=Ke(n);return r&&(r.value=o,r.setSelectionRange(t,t),r.focus()),!1}}else o=HO(o);let s=i.lookAt(n.at.row,n.at.col);s.format===`@`&&o!==``&&(o=CD(o));let c=!e.all&&o===id(r,i,n.at.row,n.at.col),l=i.validationAt(n.at.row,n.at.col);if(!c&&e.accepted!==!0&&l&&l.spec.error?.show!==!1&&o!==``&&!jk(o)&&!Zd(r.calc,i,l,n.at.row,n.at.col,Pn(o).value))return ge({kind:`refused`,rule:l.spec,all:e.all===!0}),!1;if(!c){let i=[];if(e.all)for(let e=n.area.top;e<=n.area.bottom;e++)for(let t=n.area.left;t<=n.area.right;t++)i.push({row:e,col:t,text:Kj(o,e-n.at.row,t-n.at.col)});else i.push({row:n.at.row,col:n.at.col,text:o});let c=`entry:${String(Pe.current+=1)}`,l=Au(r,n.sheet,i),u=mA(n.at);if(l.refused!==void 0)return Je(jj(l.refused,a)),!1;t.edit(l,{group:c,where:{sheet:n.sheet,selection:u}}),Je(void 0),ue(l.offer),o.includes(`
32
- `)&&!jk(o)&&s.wrap!==!0&&t.edit(Hu({file:r.file,rows:r.rows,workbook:r.workbook},n.sheet,{top:n.at.row,bottom:n.at.row,left:n.at.col,right:n.at.col},{wrap:!0}),{group:c,where:{sheet:n.sheet,selection:u}})}return ct(),n.sheet!==S&&Ze(n.sheet),!0},dt=e=>{let t=D?C.current.get(D.sheet)??w:w;if(!ut())return;let n=e(t);Ge(n,D?.sheet??S),s.current?.show(n.active)},ft=()=>{ke(void 0),ve(void 0)},pt=(e,t)=>{if(!vA(e))return NA(e,`row`,t);if(Ne.current!==void 0&&!t){let t=Ne.current;return Ne.current=void 0,mA({row:e.active.row+1,col:t})}return mA(ot(e.active,{row:t?-1:1,col:0}))},mt=(e,t)=>vA(e)?(Ne.current??=e.active.col,mA(ot(e.active,{row:0,col:t?-1:1}))):NA(e,`col`,t),ht=(e,t,n)=>{let r=Ke(e);c.current&&(c.current.value=t),r&&(r.value!==t&&(r.value=t),r.focus({preventScroll:!0}),r.setSelectionRange(n,n))},gt=(e,t,n)=>{let r=e.pick??Fk(e.text,Ke(e)?.selectionStart??e.caret);if(!r)return!1;let i=Ik({top:Math.min(t.row,n.row),bottom:Math.max(t.row,n.row),left:Math.min(t.col,n.col),right:Math.max(t.col,n.col)},S,e.sheet),a=e.text.slice(0,r.start)+i+e.text.slice(r.end),o=r.start+i.length;return ne({...e,text:a,caret:o,pick:{start:r.start,end:o,from:t,to:n,sheet:S}}),ht(e,a,o),!0},_t=(e,t,n)=>{if(e.part!==`cell`)return;let r={row:e.row,col:e.col};return[t?r:n.pick?.from??r,r]},vt=(e,t,n)=>{let r=s.current?.view();if(!r)return;let{row:i,col:a,x:o,y:c}=QE(r,t.left,t.top);O(gE(M(),S,e,{at:Qt({row:i,col:a}),x:o>0?o:void 0,y:c>0?c:void 0,...n?{width:Math.round(t.width),height:Math.round(t.height)}:{}}))},yt=e=>{if(!x)return;let t=vA(w)?sf(x,w.active):j,n=t&&Ml(r.calc,x,x,t,e);if(!t||!n){Je(a.chart.noData);return}let i=uD(x,t.right,t.top),o=x.charts.length;O(hE(M(),S,{...n,at:Qt(i),title:n.title??a.chart.title}))&&be(o)},bt=(e,t)=>{if(!x)return!1;let n=Fl(r.calc,x,t.trim()),i=n&&Ml(r.calc,n.sheet,x,n.area,e.spec.type);return i?O(gE(M(),S,e.index,{categories:i.categories,series:i.series})):!1},xt=e=>{let t=x?.filesAt(e.row,e.col),n=x&&r.calc.value(x,e.row,e.col);return t!==void 0&&typeof n==`string`?Ar(n,t):[]},St=(e,t)=>{let n=x?.filesAt(e.row,e.col);n!==void 0&&O(Au(M(),S,[{...e,text:t.join(kr(n))}]))},Ct=async(t,n)=>{if(!x||!Fe||Ye(S))return;if(x.filesAt(t.row,t.col)===void 0){Je(a.files.notColumn);return}let r=[];for(let t of n){let{path:n}=await d[`files/upload`]({dir:`${e}/${b}`,name:t.name,data:await qA(t)});r.push(n.slice(e.length+1))}St(t,[...xt(t),...r])},wt=()=>{let t=`${`${S}!${$t(j)}`} is on a sheet ${e}/${_} makes. `;st(),d[`agent/ask`]({text:t}).then(({delivered:e})=>{if(!e)throw Error(`no agent`)},()=>{navigator.clipboard.writeText(t).catch(()=>void 0),Je(a.generated.copied)})},Tt=()=>{ge(void 0),t.makeOrdinary(S).then(e=>{e!==void 0&&Je(jj(e,a)),qe()})},Et=(e,t)=>{let n=e.spec.title??a.chart.name(e.index+1);return ze.current={spec:e.spec,text:n,cut:t},Ve(!0),t&&(be(void 0),O(_E(M(),S,e.index))),n},Dt=()=>{let e=ze.current;if(!e)return;let t=nr?.at,n=t?{row:t.row+2,col:t.col+2}:{...w.active},r=x?.charts.length??0,i={...e.spec,at:Qt(n)};delete i.x,delete i.y,O(hE(M(),S,i))&&be(r)},Ot=e=>{let{hit:t}=e;if(D){let e=t.part===`cell`;if(e&&Fk(D.text,Ke(D)?.selectionStart??D.caret)||D.pick&&e){let e=_t(t,!0,{...D});if(e){fe(!0),gt(D,e[0],e[1]);return}}if(!ut())return}if(Ne.current=void 0,ue(void 0),ft(),be(void 0),qe(),t.part===`corner`){Ge(AA);return}fe(!0);let n=t=>e.meta?{...t,more:_A(w)}:t;if(t.part===`column`){let r=e.shift?w.anchor.col:t.col;Ge(n(OA(r,t.col)))}else if(t.part===`row`){let r=e.shift?w.anchor.row:t.row;Ge(n(kA(r,t.row)))}else{let n=at({row:t.row,col:t.col});Ge(e.shift?DA(w,n):e.meta?yA(w,n):mA(n))}},kt=e=>{if(!x||!Fe||D)return;if(xt(e).length>0){ge({kind:`file`,at:e});return}if(Ye(S))return;let t=id(r,x,e.row,e.col),n={sheet:S,at:e,area:{top:e.row,bottom:e.row,left:e.col,right:e.col},text:t,caret:t.length,surface:`cell`,mode:`edit`};ne(n),c.current&&(c.current.value=t),c.current?.focus({preventScroll:!0}),c.current?.setSelectionRange(t.length,t.length)},At=e=>{if(D?.pick){let t=_t(e,!1,D);t&&gt(D,t[0],t[1]);return}if(D)return;let t=w.more?{more:w.more}:{};e.part===`cell`?Ge(DA(w,e)):e.part===`column`&&jA(gA(w))?Ge({...OA(w.anchor.col,e.col),...t}):e.part===`row`&&MA(gA(w))&&Ge({...kA(w.anchor.row,e.row),...t})},jt=()=>{fe(!1),D?Ke(D)?.focus({preventScroll:!0}):qe()},Mt=x?.merges??[],j=bA(gA(w),Mt),Nt=_A(w).map(e=>bA(e,Mt)),Pt=()=>Nt.flatMap(e=>SA(e,it,x?.lastRow??0)),M=()=>({file:r.file,rows:r.rows,workbook:r.workbook}),Ft=e=>`${e}:${String(Pe.current+=1)}`,It=e=>{if(!x)return;let t=Ft(`look`);for(let n of Pt())if(!O(Hu(M(),S,n,e),t))return},Lt=x?oA(x,w.active.row,w.active.col):{},Rt=e=>{if(!x)return;let t=x.used,n={...j,bottom:jA(j)?Math.min(j.bottom,t?.bottom??j.top):j.bottom,right:MA(j)?Math.min(j.right,t?.right??j.left):j.right},i=vA(w),a=e?Math.max(0,i?n.top-1:n.top):Math.max(0,i?n.left-1:n.left),o=`fill:${String(Pe.current+=1)}`,[s,c]=e?[n.left,n.right]:[n.top,n.bottom];for(let t=s;t<=c;t++){let i=e?{row:a,col:t}:{row:t,col:a},s=e?{top:a,bottom:n.bottom,left:t,right:t}:{top:t,bottom:t,left:a,right:n.right};O(Fu({file:r.file,rows:r.rows,workbook:r.workbook},S,i,s,id(r,x,i.row,i.col)),o)}},zt=()=>{let e=Ft(`clear`);for(let t of Pt())if(!O(Nu(M(),S,t),e))return},Bt=(e,t,n)=>{O(VE(M(),S,e,t,n),Ft(`drag`))&&(Ge(Aj(t)),ke({sheet:S,from:e,to:t,mode:n}))},Vt=e=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let t=j,n=e.currentTarget;n.setPointerCapture(e.pointerId);let r,i=e=>{let n=s.current?.under(e.clientX,e.clientY);n?.part===`cell`&&(r=xA(t,n),De(r))},a=()=>{n.removeEventListener(`pointermove`,i),n.removeEventListener(`pointerup`,a),n.removeEventListener(`pointercancel`,a),De(void 0),r&&Bt(t,r,`auto`),qe()};n.addEventListener(`pointermove`,i),n.addEventListener(`pointerup`,a),n.addEventListener(`pointercancel`,a)},Ht=()=>{if(!x)return;let e=GE(x,j);e!==void 0&&Bt(j,{...j,bottom:e},`auto`),qe()},Ut=e=>{Oe&&(t.undoStep(),Bt(Oe.from,Oe.to,e),qe())},Wt=(e,t)=>{x&&(!D||ut())&&Se({at:e,rect:t})},Gt=e=>{let t=s.current?.pageRect({top:e.row,left:e.col,bottom:e.row,right:e.col});t&&we({at:e,rect:new DOMRect(t.x,t.bottom,t.width,0)})},Kt=()=>{if(!x)return;let e=w.active;if(x.filterHeadAt(e.row,e.col)){let t=s.current?.pageRect({top:e.row,left:e.col,bottom:e.row,right:e.col});t&&Wt(e,t)}else x.validationAt(e.row,e.col)?.spec.type===`list`&&Gt(e)},qt=(e,t=!1)=>{x&&(!t&&$T(x,j,e)?ge({kind:`merge`,how:e}):O(eE(M(),S,j,e)))},Zt=e=>{let t=Ft(`border`);for(let n of Nt)if(!O(ZT(M(),S,n,e),t))return},tn=e=>{let t=Ft(`format`);if(Object.keys(e.look).length>0){for(let n of Pt())if(!O(Hu(M(),S,n,e.look),t))return}if(Object.keys(e.borders).length>0){for(let n of Nt)if(!O(QT(M(),S,n,e.borders),t))return}e.merge===!0&&O(eE(M(),S,j,`cells`),t),e.merge===!1&&O(nE(M(),S,j),t)},nn=e=>{if(!x)return;let{row:t,col:n}=w.active;It({format:jD(x.lookAt(t,n).format,e,r.calc.value(x,t,n))})},rn=()=>{if(!x)return;let e=w.active,t=x.filterAt(e.row,e.col);if(t)return{area:t.area,header:!0};if(!vA(w))return{area:j,header:!1};let n=sf(x,e);return n?{area:n,header:pd(x,r.calc,n)}:void 0},an=(e,t)=>{let n=e.header?{...e.area,top:e.area.top+1}:e.area;O(dd(M(),r.calc,S,n,t,it))},on=e=>{let t=rn();t?an(t,[{col:w.active.col,descending:e}]):Je(a.sortFilter.noData)},sn=()=>{let e=rn();e?ge({kind:`sort`,target:e}):Je(a.sortFilter.noData)},cn=()=>{if(!x)return;let{row:e,col:t}=w.active,n=sl(r.calc.value(x,e,t),x.lookAt(e,t).format),i=Ft(`filter`);if(!x.filterAt(e,t)&&!O(sE(M(),S,j),i))return;let a=r.workbook.sheet(S)?.filterAt(e,t);a&&O(cE(M(),S,a,t,n===``?{blanks:!0}:{values:[n]}),i)},ln=()=>{O(sE(M(),S,j))},un=()=>{O(lE(M(),S))},dn=e=>{let t=e===`panes`?w.active:e===`topRow`?{row:1,col:0}:e===`firstColumn`?{row:0,col:1}:void 0;O(rE(M(),S,t))},pn=e=>{O(uE(M(),S,e))},mn=()=>Nt.map($t).join(` `),hn=e=>{if(e){O(pE(M(),S,void 0));return}let t=Ft(`rules`);for(let e of Nt)if(!O(pE(M(),S,e),t))return},N=()=>({from:j.top,to:Math.min(j.bottom,Math.max(x?.lastRow??0,j.top))}),P=()=>({from:j.left,to:Math.min(j.right,Math.max((x?.columnsUsed??1)-1,j.left))}),gn=e=>{let{from:t,to:n}=e===`rows`?N():P();O(iE(M(),S,e,t,n,!0))},_n=e=>{let{from:t,to:n}=e===`rows`?N():P();O(iE(M(),S,e,Math.max(0,t-1),n+1,!1))},F=r.file.sheets.filter(e=>e.hidden===!0).map(e=>e.name),vn=e=>{if(!Ye(e)&&Xe(aE(M(),e,!0))&&e===S){let e=r.file.sheets.find(e=>e.hidden!==!0)?.name;e!==void 0&&Ze(e)}},yn=()=>{F.length>0&&ge({kind:`unhide`})},bn=(e,t)=>{if(!x)return;let n=document.createElement(`canvas`).getContext(`2d`);if(!n)return;let i=0,[a,o]=x.span(e,0,Math.min(x.lastRow,5e3));for(let t=a;t<=o;t++){let a=oA(x,t,e);n.font=mD(a),i=Math.max(i,n.measureText(sl(r.calc.value(x,t,e),a.format)).width)}O(Ku(M(),S,e,i===0?void 0:Math.ceil(i)+10),t)},xn=e=>{let t=s.current?.view(),{row:n,col:r}=w.active;ge({kind:`size`,what:e,start:e===`row`?zj(t?.rows.sizeOf(n)??20):Vj(t?.columns.sizeOf(r)??64)})},Sn=(e,t)=>{let n=Ft(`size`);if(e===`row`){let{from:e,to:r}=N();for(let i=e;i<=r;i++)O(qu(M(),S,i,Bj(t)),n)}else{let{from:e,to:r}=P();for(let i=e;i<=r;i++)O(Ku(M(),S,i,Hj(t)),n)}},Cn=()=>{let e=Ft(`size`),{from:t,to:n}=N();for(let r=t;r<=n;r++)O(qu(M(),S,r,void 0),e)},wn=()=>{let e=Ft(`size`),{from:t,to:n}=P();for(let r=t;r<=n;r++)bn(r,e)},Tn=e=>{if(!x)return;if(Nt.length>1){Je(a.menu.multiple);return}let t=Ej(x,j,it),n=Tj(r,x,j,t);return ie({sheet:S,area:j,rows:t,text:n,cut:e}),n},En=e=>{if(e===`sheet`){kn();return}let t=e===`rows`,n=t?j.top:j.left,i=t?j.bottom-j.top+1:j.right-j.left+1;t&&jA(j)||!t&&MA(j)||O(nd({file:r.file,rows:r.rows,workbook:r.workbook},{op:t?`insert-rows`:`insert-columns`,sheet:S,at:n,count:i}))},Dn=e=>{if(e===`sheet`){O($u({file:r.file,rows:r.rows,workbook:r.workbook},S));return}let t=e===`rows`,n=t?j.top:j.left,i=t?j.bottom-j.top+1:j.right-j.left+1;t&&jA(j)||!t&&MA(j)||O(nd({file:r.file,rows:r.rows,workbook:r.workbook},{op:t?`delete-rows`:`delete-columns`,sheet:S,at:n,count:i}))},On=e=>{if(Ye(e))return;let t={file:r.file,rows:r.rows,workbook:r.workbook},n=Zu(t,e);Xe(Qu(t,e))&&Ze(n)},kn=()=>{let e=Dj(r,a);Xe(Xu({file:r.file,rows:r.rows,workbook:r.workbook},e,S))&&Ze(e)},An=e=>{if(e===``){qe();return}let t=Oj(r,e,S)??kj(r,e,S);t?(Qe(t.sheet,Aj(t.area)),qe()):(O(rd({file:r.file,rows:r.rows,workbook:r.workbook},e,S,j)),qe())},jn=(e,t)=>{let n=zk(e.text,Ke(e)?.selectionStart??e.caret);if(!n)return;let r=`${t}(`,i=e.text.slice(0,n.start)+r+e.text.slice(n.end),a=n.start+r.length;ne({...e,text:i,caret:a}),me(0),ht(e,i,a)},Mn=(e,t)=>{if(e.key===`Delete`||e.key===`Backspace`){be(void 0),O(_E(M(),S,t.index)),e.preventDefault();return}if(e.key===`Escape`){be(void 0),e.preventDefault();return}let n=Wj[e.key],r=s.current?.view();if(n&&r){let i=$E(r,t);vt(t.index,{...i,left:Math.max(0,i.left+n[1]),top:Math.max(0,i.top+n[0])},!1),e.preventDefault()}else e.key.length===1&&!e.metaKey&&!e.ctrlKey&&e.preventDefault()},Nn=e=>{if(e.nativeEvent.isComposing||!u.current?.contains(e.target))return;let t=e.metaKey||e.ctrlKey;if(D){In(e,D,t);return}if(!x)return;if(t&&(e.key===`z`||e.key===`Z`||e.key===`y`)){e.key===`y`||e.shiftKey?tt():et(),e.preventDefault();return}if(nr){Mn(e,nr);return}let n=t=>{let n=Lt[t];It({[t]:n!==void 0&&n!==!1?void 0:!0}),e.preventDefault()};if(e.altKey&&e.key===`ArrowDown`){Kt(),e.preventDefault();return}if(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`){let t=s.current?.pageRect(j);t&&ve({kind:`cell`,x:t.x,y:t.bottom}),e.preventDefault();return}if(t&&e.shiftKey&&Fe){let t=Rj[e.key];if(t!==void 0){It({format:t===`General`?void 0:t}),e.preventDefault();return}if(e.key===`l`||e.key===`L`){ln(),e.preventDefault();return}if(e.key===`&`){Zt(`outside`),e.preventDefault();return}if(e.key===`_`){Zt(`none`),e.preventDefault();return}if(e.key===`(`){_n(`rows`),e.preventDefault();return}if(e.key===`)`){_n(`columns`),e.preventDefault();return}if(e.key===`+`&&(MA(j)||jA(j))){En(MA(j)?`rows`:`columns`),e.preventDefault();return}}if(t&&!e.shiftKey){if(e.key===`1`&&Fe){ge({kind:`format`,tab:`number`}),e.preventDefault();return}if(e.key===`9`&&e.ctrlKey&&Fe){gn(`rows`),e.preventDefault();return}if(e.key===`0`&&e.ctrlKey&&Fe){gn(`columns`),e.preventDefault();return}if(e.key===`-`&&Fe&&(MA(j)||jA(j))){Dn(MA(j)?`rows`:`columns`),e.preventDefault();return}let t=Nj[e.key];if(t){n(t);return}if(e.key===`d`||e.key===`r`){Fe&&Rt(e.key===`d`),e.preventDefault();return}if(e.key===`;`){nt({text:UO(new Date),mode:`enter`}),e.preventDefault();return}if(e.key===`a`){Ge(AA),e.preventDefault();return}}let r=e=>x.at(e.row,e.col)!==void 0,i={row:x.lastRow,col:x.columnsUsed-1},a=n=>{Ne.current=void 0,ue(void 0),ft();let a=e.shiftKey?w.focus:w.active,o=t?PA(r,a,n,i):ot(a,n),c=e.shiftKey?DA(w,o):EA(mA(o),{row:0,col:0});Ge(c),s.current?.show(c.focus),e.preventDefault()};switch(e.key){case`ArrowDown`:a({row:1,col:0});return;case`ArrowUp`:a({row:-1,col:0});return;case`ArrowRight`:a({row:0,col:1});return;case`ArrowLeft`:a({row:0,col:-1});return;case`PageDown`:a({row:s.current?.pageRows()??20,col:0});return;case`PageUp`:a({row:-(s.current?.pageRows()??20),col:0});return;case`Home`:{let n=t?{row:0,col:0}:{row:w.active.row,col:0},r=e.shiftKey?DA(w,n):mA(n);Ge(r),s.current?.show(r.focus),e.preventDefault();return}case`End`:if(t){let t={row:Math.max(i.row,0),col:Math.max(i.col,0)},n=e.shiftKey?DA(w,t):mA(t);Ge(n),s.current?.show(n.focus),e.preventDefault()}return;case`Enter`:{let t=pt(w,e.shiftKey);Ge(t),s.current?.show(t.active),e.preventDefault();return}case`Tab`:{let t=mt(w,e.shiftKey);Ge(t),s.current?.show(t.active),e.preventDefault();return}case`Escape`:ie(void 0),ue(void 0),ft(),Je(void 0);return;case`F2`:nt({text:rt(w.active),mode:`edit`}),e.preventDefault();return;case` `:e.shiftKey?(Ge(kA(j.top,j.bottom)),e.preventDefault()):e.ctrlKey&&(Ge(OA(j.left,j.right)),e.preventDefault());return;case`Delete`:case`Backspace`:Fe&&zt(),e.preventDefault();return;default:return}},In=(e,t,n)=>{let r=Un;if(r.length>0){if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=e.key===`ArrowDown`?1:r.length-1;me(e=>(e+t)%r.length),e.preventDefault();return}if(e.key===`Tab`){let n=r[pe%r.length];n!==void 0&&jn(t,n),e.preventDefault();return}}if(e.key===`Escape`){lt(),e.preventDefault();return}if(e.key===`Enter`){if(e.preventDefault(),e.altKey){let e=Ke(t),n=e?.selectionStart??t.caret,r=e?.selectionEnd??t.caret,i=`${t.text.slice(0,n)}\n${t.text.slice(r)}`;ne({...Pj(t),text:i,caret:n+1}),ht(t,i,n+1);return}if(n){ut({all:!0});return}dt(t=>pt(t,e.shiftKey));return}if(e.key===`Tab`){e.preventDefault(),dt(t=>mt(t,e.shiftKey));return}if(e.key===`F4`){let n=Ke(t),r=Rk(t.text,n?.selectionStart??t.caret);r&&(ne({...t,text:r.text,caret:r.caret}),ht(t,r.text,r.caret)),e.preventDefault();return}if(e.key===`F2`){ne({...t,mode:t.mode===`edit`?`enter`:`edit`}),e.preventDefault();return}let i=e.key===`ArrowDown`?{row:1,col:0}:e.key===`ArrowUp`?{row:-1,col:0}:e.key===`ArrowRight`?{row:0,col:1}:e.key===`ArrowLeft`?{row:0,col:-1}:void 0;if(!i||t.mode===`edit`||n)return;e.preventDefault();let a=Ke(t)?.selectionStart??t.caret,o=t.pick??Fk(t.text,a);if(o&&S){let n=t.pick?.from??t.at,r=t.pick?.to??t.at,a={row:Math.max(0,r.row+i.row),col:Math.max(0,r.col+i.col)};gt({...t,pick:{...o,from:n,to:a,sheet:S}},e.shiftKey?n:a,a),s.current?.show(a)}else dt(e=>EA(mA(e.active),i))},Ln=(e,t)=>{if(D||!x||e.target!==c.current)return;if(e.preventDefault(),nr){e.clipboardData.setData(`text/plain`,Et(nr,t));return}let n=Tn(t);n!==void 0&&e.clipboardData.setData(`text/plain`,n)},Rn=e=>{if(D||!x||!Fe||e.target!==c.current)return;e.preventDefault();let t=[...e.clipboardData.files];if(t.length>0&&x.filesAt(hr,gr)!==void 0){Ct(w.active,t);return}let n=e.clipboardData.getData(`text/plain`);n!==``&&(ze.current?.text===n?Dt():zn(n))},zn=(e,t=`all`)=>{if(!x)return;let n=re?.text===e?re:void 0,i=n&&r.workbook.sheet(n.sheet),a=Ft(`paste`),o=w.active;if(n?.cut&&i&&t===`all`){O(YE(M(),n.sheet,n.area,S,o),a)&&(ie(void 0),Ge(Aj({top:o.row,left:o.col,bottom:o.row+n.area.bottom-n.area.top,right:o.col+n.area.right-n.area.left})));return}let s,c,l;if(n&&i){let e=n.area,a=Math.min(e.right,i.used?.right??e.left);s=n.rows.length,c=a-e.left+1,l=(a,o)=>{let s=n.rows[a]??e.top;return t===`values`?Fn(r.calc.value(i,s,e.left+o)):id(r,i,s,e.left+o)}}else{let t=fn(e);s=t.length,c=t.reduce((e,t)=>Math.max(e,t.length),0),l=(e,n)=>t[e]?.[n]??``}let u=vA(w)?1:Math.max(1,Math.floor((j.right-j.left+1)/c)),d=vA(w)?1:Math.max(1,Math.floor((j.bottom-j.top+1)/s)),f=[],p=[];for(let e=0;e<d;e++)for(let r=0;r<u;r++)for(let i=0;i<s;i++)for(let a=0;a<c;a++){let u=o.row+e*s+i,d=o.col+r*c+a,m=n?.rows[i];if(n&&m!==void 0&&p.push({from:{row:m,col:n.area.left+a},to:{row:u,col:d}}),t===`formats`)continue;let h=l(i,a);f.push({row:u,col:d,text:n&&m!==void 0?t===`values`?h:Kj(h,u-m,d-n.area.left-a):HO(h)})}let m=f.every(e=>x.at(e.row,e.col)===void 0&&!x.tableAt(e.row,e.col)&&!x.blockAt(e.row,e.col)),h=f.every(e=>Pn(e.text).formula===void 0);if(f.length>=100&&m&&h&&!n){let e=[];for(let t=0;t<s;t++){let n=[];for(let e=0;e<c;e++)n.push(HO(l(t,e)));e.push(n)}let t=S.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`),n=`data/${t}-${Qt(o).toLowerCase()}.csv`;for(let e=2;r.rows.has(n);e++)n=`data/${t}-${Qt(o).toLowerCase()}-${String(e)}.csv`;O(Iu(M(),S,o,e,n),a)}else f.length>0&&O(Au(M(),S,f),a);n&&(t===`all`||t===`formats`)&&O(WE(M(),n.sheet,S,p),a),Ge({active:o,anchor:o,focus:{row:o.row+d*s-1,col:o.col+u*c-1}})},Bn=e=>{re?(zn(re.text,e),qe()):navigator.clipboard.readText().then(t=>{t!==``&&zn(t,e),qe()},()=>{qe()})},Vn=(e,t,n)=>{(!D||ut())&&(ke(void 0),e.part===`corner`?(Ge(AA),ve({kind:`cell`,x:t,y:n})):e.part===`cell`?(((e,t)=>Nt.some(n=>e>=n.top&&e<=n.bottom&&t>=n.left&&t<=n.right))(e.row,e.col)||Ge(mA(at(e))),ve({kind:`cell`,x:t,y:n})):e.part===`column`?(Nt.some(t=>jA(t)&&e.col>=t.left&&e.col<=t.right)||Ge(OA(e.col,e.col)),ve({kind:`column`,x:t,y:n})):(Nt.some(t=>MA(t)&&e.row>=t.top&&e.row<=t.bottom)||Ge(kA(e.row,e.row)),ve({kind:`row`,x:t,y:n})))},Hn=D?zk(D.text,D.caret)?.prefix:void 0,Un=Hn===void 0||Hn===``?[]:Bk(Hn),Wn=D?Vk(D.text,D.caret):void 0,Gn=Wn?gj(Wn.name):void 0,Kn=(0,k.useMemo)(()=>D?Pk(D.text).map((e,t)=>({sheet:e.sheet??D.sheet,area:e.area,color:t%6})).filter(e=>e.sheet.toLowerCase()===S.toLowerCase()):[],[D,S]),qn=(0,k.useMemo)(()=>NO(n.changes,r.workbook,e=>r.rows.get(e)),[n.changes,r,n.revision]),{marks:Jn,markAreas:Yn}=(0,k.useMemo)(()=>{let e=new Set,t=[];for(let n of qn)n?.sheet===S&&n.area&&(n.area.top===n.area.bottom&&n.area.left===n.area.right?e.add(Er(n.area.top,n.area.left)):t.push(n.area));return{marks:e,markAreas:t}},[qn,S]),Xn=e=>{e&&r.workbook.sheet(e.sheet)&&(e.area?Qe(e.sheet,Aj(e.area)):e.sheet!==S&&Ze(e.sheet),qe())},Zn=n.conflicts,Qn=Zn.length>0&&Zn!==je?a.bothChanged(o?.agent?.name??``):void 0,$n=(0,k.useMemo)(()=>{if(!x||vA(w))return;let e=0,t=0,n=0,{rows:i,columns:a}=x.spec,o=new Set;for(let s of Nt){let c=Math.min(s.right,x.columnsUsed-1);for(let l=s.left;l<=c;l++){if(a?.[Xt(l)]?.hidden===!0)continue;let[c,u]=x.span(l,s.top,s.bottom);for(let a=c;a<=u;a++){if(it.has(a)||i?.[String(a+1)]?.hidden===!0)continue;let s=Er(a,l);if(o.has(s))continue;o.add(s);let c=r.calc.value(x,a,l);c!==null&&c!==``&&(e+=1,typeof c==`number`&&(t+=1,n+=c))}}}if(e===0)return;let s=x.lookAt(w.active.row,w.active.col).format,c=e=>sl(e,s);return{count:e,...t===0?{average:void 0,sum:void 0}:{average:c(n/t),sum:c(n)}}},[w,x,n.revision,it]),er=(0,k.useMemo)(()=>{if(!x||it.size===0)return;let e=0;for(let t of x.filters)t.columns.size>0&&(e+=Math.min(t.area.bottom,x.lastRow)-t.area.top);return{shown:e-it.size,total:e}},[x,it]),tr=(0,k.useMemo)(()=>{let e=new Set;if(!x||x.validations.length===0)return e;for(let t of $d(r.workbook,r.calc))t.sheet===S&&e.add(Er(t.row,t.col));return e},[r,x,S,n.revision]),nr=ye===void 0?void 0:x?.charts.find(e=>e.index===ye),rr=(()=>{if(nr)return a.chart.name(nr.index+1);if(de&&!vA(w)&&!D)return zA(j);for(let e of r.workbook.names.values()){let t=e.formula?Pk(e.formula.text)[0]:void 0;if(t&&(t.sheet===void 0||t.sheet===S)&&$t(t.area)===$t(j))return e.name}return vA(w)?Qt(w.active):BA(j)})(),ir=(0,k.useMemo)(()=>[...[...r.workbook.names.values()].map(e=>e.name),...r.workbook.tables.map(e=>e.name)],[r,n.revision]);(0,k.useEffect)(()=>{let e=setTimeout(()=>{r.calc.prepare()},50);return()=>{clearTimeout(e)}},[r,n.revision]),(0,k.useEffect)(()=>{i?.({shown:e=>{let t=e.lastIndexOf(`!`),n=t<0?x:r.workbook.sheet(e.slice(0,t)),i=en(e.slice(t+1));return!n||!i?``:sl(r.calc.value(n,i.row,i.col),n.lookAt(i.row,i.col).format)},input:e=>{let t=e.lastIndexOf(`!`),n=t<0?x:r.workbook.sheet(e.slice(0,t)),i=en(e.slice(t+1));return n&&i?id(r,n,i.row,i.col):``},view:()=>{let e=s.current?.view()?.shownRows();return{firstRow:e?.first??0,lastRow:e?.last??0}},scroll:e=>{let t=document.querySelector(`[data-testid="sheet-scroller"]`);t&&(t.scrollTop=e)},rect:(e,t)=>s.current?.pageRect({top:e,left:t,bottom:e,right:t}),draw:()=>s.current?.draw()??0,look:e=>{let t=en(e);if(!x||!t)return`{}`;let n=new Id(x,r.calc).at(t.row,t.col);return JSON.stringify({...oA(x,t.row,t.col),...n?.look,...n?.scale===void 0?{}:{fill:n.scale},...n?.bar?{bar:n.bar}:{},...n?.icon?{icon:n.icon}:{},...tr.has(Er(t.row,t.col))?{invalid:!0}:{}})},hiddenRows:()=>{let e=s.current?.view(),t=[];for(let n=0;n<=(x?.lastRow??0);n++)e?.rows.sizeOf(n)===0&&t.push(n);return t}})});let ar=`sheet-zoom:${e}`;(0,k.useEffect)(()=>{d[`storage/get`]({key:ar}).then(({value:e})=>{let t=Gk(e);t!==void 0&&p(t)}).catch(()=>void 0)},[d,ar]);let or=e=>{p(e),d[`storage/set`]({key:ar,value:String(e)}).catch(()=>void 0),requestAnimationFrame(()=>{s.current?.show(w.active)})};g({freeze:()=>Promise.resolve({key:`${e}@${String(n.revision)}@${S}`,what:`The sheet ${e}, ${S}`,source:{path:`${e}/sheet.yaml`}}),pictures:()=>{let e=s.current?.canvas();if(!e)return Promise.resolve([]);let t=e.getBoundingClientRect();return Promise.resolve([{rect:{x:t.x,y:t.y,width:t.width,height:t.height},mime:`image/png`,data:e.toDataURL(`image/png`).replace(/^data:[^,]*,/u,``)}])},locate:t=>{let n=s.current?.view(),i=s.current?.canvas()?.getBoundingClientRect();if(!n||!i||!x)return Promise.resolve([]);let a=n.shownRows(),o=n.shownColumns(),c;for(let e=a.first;e<=a.last;e++)for(let r=o.first;r<=o.last;r++){let a=n.rectOf({top:e,left:r,bottom:e,right:r});Ae(t,{x:i.x+a.x*f,y:i.y+a.y*f,width:a.width*f,height:a.height*f})&&(c=c?{top:Math.min(c.top,e),left:Math.min(c.left,r),bottom:Math.max(c.bottom,e),right:Math.max(c.right,r)}:{top:e,left:r,bottom:e,right:r})}return Promise.resolve(c?[WA(r.workbook,r.calc,x,c,e)]:[])}});let sr=D&&x?oA(r.workbook.sheet(D.sheet)??x,D.at.row,D.at.col):void 0;if((0,k.useLayoutEffect)(()=>{let e=c.current;if(!e)return;if(!D||!sr){e.style.width=`2px`,e.style.height=`2px`;return}let t=document.createElement(`canvas`).getContext(`2d`),n=mD(sr);e.style.font=n;let r=typeof sr.fill==`string`?sr.fill:``;e.style.background=r;let i=0;if(t){t.font=n;for(let e of D.text.split(`
33
- `))i=Math.max(i,t.measureText(e).width)}let a=s.current?.view(),o=a?.columns.sizeOf(D.at.col)??64,l=a?.rows.sizeOf(D.at.row)??20,u=Math.max(o,(a?.width??800)-(a?.xOf(D.at.col)??0)-12);e.style.width=`${String(Math.min(Math.max(o,i+14),u))}px`,e.style.height=`auto`,e.style.height=`${String(Math.max(l,e.scrollHeight))}px`}),(0,k.useEffect)(()=>{D?.surface!==`bar`&&D&&c.current&&c.current.value!==D.text&&(c.current.value=D.text)},[D]),!x)return null;let cr=x.spillAt(w.active.row,w.active.col),lr=x.at(w.active.row,w.active.col),ur=cr??(lr instanceof Cr?lr:void 0),dr=nr?``:D?D.text:cr?cr.text:rt(w.active),pr=D?.sheet===S||!D,mr=D&&pr?D.at:w.active,{row:hr,col:gr}=w.active,_r=vA(w)&&(!Mt.length||!x.mergeAt(hr,gr)),vr=x.mergeAt(hr,gr)??{top:hr,left:gr,bottom:hr,right:gr},yr=_r?[]:[...Nt.slice(0,-1),{...j,bottom:vr.top-1},{...j,top:vr.bottom+1},{top:vr.top,bottom:vr.bottom,left:j.left,right:vr.left-1},{top:vr.top,bottom:vr.bottom,left:vr.right+1,right:j.right}].filter(e=>e.top<=e.bottom&&e.left<=e.right),br=D?.at??w.active,xr=Gj(x.mergeAt(mr.row,mr.col)??{top:mr.row,left:mr.col,bottom:mr.row,right:mr.col}),Sr=Gj({top:br.row+1,left:br.col,bottom:br.row+1,right:br.col}),wr=e=>Re.urlOf(e),Tr=[{name:void 0,sets:[]},...Object.entries(r.workbook.file.scenarios??{}).map(([e,t])=>({name:e,sets:Object.entries(t).map(([e,t])=>`${e} = ${String(t)}`)}))],Dr=x.validationAt(hr,gr),Or=Ce&&Dr?.spec.multiple===!0?Kd(sl(r.calc.value(x,Ce.at.row,Ce.at.col),void 0),Dr.spec):[],jr=!D&&Dr&&Dr.spec.prompt?.show!==!1?Dr.spec.prompt:void 0,Mr=!D&&Fe&&!Ie&&Dr?.spec.type===`list`&&Dr.spec.dropdown!==!1,Nr=xe?x.filterHeadAt(xe.at.row,xe.at.col):void 0,Pr=Mt.some(e=>e.top<=j.bottom&&j.top<=e.bottom&&e.left<=j.right&&j.left<=e.right),Fr=!D&&Fe&&Nt.length===1&&!jA(j)&&!MA(j),Ir=(()=>{if(!he)return null;let e=r.calc.value(x,hr,gr);switch(he.kind){case`format`:return(0,A.jsx)(xk,{tab:he.tab,look:Lt,value:e,merged:Pr,onClose:st,onDone:e=>{tn(e),st()}});case`rule`:return(0,A.jsx)(rj,{kind:he.rule,range:mn(),start:rt(w.active),onClose:st,onDone:e=>{pn(e),st()}});case`validation`:return(0,A.jsx)(cj,{rule:x.validationAt(hr,gr)?.spec,onClose:st,onDone:e=>{let t=Ft(`validation`);for(let n of Nt)O(mE(M(),S,n,e),t);st()}});case`refused`:return(0,A.jsx)(lj,{rule:he.rule,onCancel:()=>{ge(void 0),lt()},onRetry:()=>{ge(void 0),requestAnimationFrame(()=>{let e=Ke(D);e?.focus(),e?.select()})},onAccept:()=>{let{all:e}=he;ge(void 0),ut({all:e,accepted:!0})}});case`sort`:{let{target:e}=he,t=[];for(let n=e.area.left;n<=e.area.right;n++)t.push({col:n,name:e.header&&sl(r.calc.value(x,e.area.top,n),x.lookAt(e.area.top,n).format)||a.sort.column(Xt(n))});let n={col:Math.min(Math.max(gr,e.area.left),e.area.right),descending:!1};return(0,A.jsx)(uj,{columns:t,start:n,header:e.header,onClose:st,onDone:(t,n)=>{an({area:e.area,header:n},t),st()}})}case`size`:return(0,A.jsx)(dj,{title:he.what===`row`?a.menu.rowHeightWord:a.menu.columnWidthWord,start:he.start,onClose:st,onDone:e=>{Sn(he.what,e),st()}});case`unhide`:return(0,A.jsx)(fj,{sheets:F,onClose:st,onDone:e=>{Xe(aE(M(),e,!1)),Ze(e),st()}});case`locked`:return(0,A.jsx)(YA,{agent:o?.agent?.name,onAsk:wt,onOrdinary:Tt,onClose:st});case`scenarios`:return(0,A.jsx)(XA,{rows:Tr,shown:r.scenario,onShow:e=>{t.showScenario(e),st()},onClose:st});case`file`:{let{at:e}=he,t=xt(e);return t.length===0?null:(0,A.jsx)(KA,{paths:t,urlOf:wr,onRemove:Ie?void 0:n=>{St(e,t.filter(e=>e!==n)),t.length===1&&st()},onClose:st})}case`merge`:return(0,A.jsx)(pj,{title:a.arrange.mergeCells,message:a.arrange.mergeLoses,onClose:st,onDone:()=>{qt(he.how,!0),st()}})}})();return(0,A.jsxs)(`div`,{ref:u,className:`sheet-root flex min-h-0 flex-1 flex-col`,"data-testid":`sheet-root`,"data-editing":D?``:void 0,onKeyDown:Nn,onCopy:e=>{Ln(e,!1)},onCut:e=>{Ln(e,!0)},onPaste:Rn,children:[(0,A.jsx)(Ee,{tight:!0,start:(0,A.jsxs)(`div`,{className:`@container relative flex min-w-0 flex-1 items-center`,children:[nr?(0,A.jsx)(`div`,{className:`sheet-chart-over`,children:(0,A.jsx)(lD,{chart:nr,calc:r.calc,sheet:x,disabled:!Fe||Ie,onType:e=>{O(gE(M(),S,nr.index,{type:e}))},onTitle:e=>{O(gE(M(),S,nr.index,{title:e}))},onLegend:e=>{O(gE(M(),S,nr.index,{legend:e}))},onData:e=>bt(nr,e),onDone:qe},nr.index)}):null,(0,A.jsx)(`div`,{className:`flex min-w-0 flex-1`,style:nr?{visibility:`hidden`}:void 0,children:(0,A.jsx)(ZD,{look:Lt,value:r.calc.value(x,hr,gr),disabled:!Fe||D!==void 0||Ie,canUndo:n.canUndo&&!D,canRedo:n.canRedo&&!D,frozen:x.freeze!==void 0,filtered:x.filters.length>0,filtering:x.filters.some(e=>e.columns.size>0),merged:Pr,onUndo:et,onRedo:tt,onLook:It,onInsert:En,onDelete:Dn,onBorders:Zt,onMerge:qt,onUnmerge:()=>{O(nE(M(),S,j))},onDecimals:nn,onSort:on,onCustomSort:sn,onFilter:ln,onClearFilter:un,onReapply:t.reapply,onFreeze:dn,onRule:e=>{ge({kind:`rule`,rule:e})},onDataBar:e=>{pn({range:mn(),type:`dataBar`,color:e})},onColorScale:e=>{let t=e.length-1;pn({range:mn(),type:`colorScale`,stops:e.map((e,n)=>n===0?{at:`min`,color:e}:n===t?{at:`max`,color:e}:{at:`percentile`,value:50,color:e})})},onIcons:e=>{pn({range:mn(),type:`iconSet`,icons:e})},onClearRules:hn,onValidation:()=>{ge({kind:`validation`})},onFormatCells:e=>{ge({kind:`format`,tab:e})},onRowHeight:()=>{xn(`row`)},onColumnWidth:()=>{xn(`column`)},onFitRows:Cn,onFitColumns:wn,onHide:e=>{e===`sheet`?vn(S):gn(e)},onUnhide:e=>{e===`sheet`?yn():_n(e)},onTabColor:e=>{O(oE(M(),S,e))},onChart:yt,onScenarios:Tr.length>1?()=>{ge({kind:`scenarios`})}:void 0,onDone:qe})})]}),saved:{state:n.state}}),n.problems===void 0?null:(0,A.jsxs)(`div`,{className:`sheet-notice`,role:`alert`,"data-testid":`sheet-notice`,children:[(0,A.jsx)(`p`,{children:a.unreadable}),n.problems.map(e=>(0,A.jsx)(`p`,{children:e},e))]}),(0,A.jsx)(Sk,{field:l,name:rr,names:ir,text:dr,ghost:cr!==void 0&&!D&&!nr,editing:D!==void 0,disabled:!Fe||Ie,onGo:An,onBegin:()=>{D?D.surface!==`bar`&&ne({...D,surface:`bar`}):nt({text:rt(w.active),surface:`bar`,mode:`edit`})},onText:(e,t)=>{D&&(ne({...Pj(D),text:e,caret:t,problem:!1}),me(0),c.current&&(c.current.value=e))},onCaret:e=>{ne(t=>t&&t.caret!==e?{...t,caret:e}:t)},onCancel:lt,onEnter:()=>{ut()},onFunction:()=>{D||nt({text:`=`,surface:`bar`,mode:`edit`})},onDone:qe}),Ie?(0,A.jsx)(JA,{agent:o?.agent?.name,onAsk:wt,onOrdinary:Tt}):null,(0,A.jsxs)(RA,{ref:s,zoom:f,onZoomStep:e=>{or(Wk(f,e))},sheet:x,calc:r.calc,revision:n.revision,theme:o?.theme,selection:w,marks:Jn,markAreas:Yn,onPress:Ot,onOpen:kt,onDrag:At,onRelease:jt,filtered:it,invalid:tr,pictures:Re,onDropFiles:(e,t)=>{Ct(e,t)},onFilterButton:Wt,onMenu:Vn,onResize:(e,t,n)=>{let r=M();O(e===`column`?Ku(r,S,t,Math.round(n)):qu(r,S,t,Math.round(n)),`size:${e}:${String(t)}`)},onFit:(e,t)=>{e===`row`?O(qu(M(),S,t,void 0)):bn(t)},children:[re?.sheet===S?(0,A.jsx)(`div`,{className:`sheet-copied`,"data-testid":`sheet-copied`,"data-area":Gj(re.area)}):null,Kn.map((e,t)=>(0,A.jsx)(`div`,{className:`sheet-ref`,"data-testid":`sheet-ref`,"data-color":e.color,"data-area":Gj(e.area)},`${String(t)}:${$t(e.area)}`)),ur?.spill&&!D?(0,A.jsx)(`div`,{className:`sheet-spill`,"data-testid":`sheet-spill`,"data-area":Gj(ur.spill)}):null,ur?.blocked&&!D?(0,A.jsx)(`div`,{className:`sheet-spill`,"data-blocked":``,"data-testid":`sheet-spill-blocked`,title:a.spillBlocked,"data-area":Gj(ur.blocked)}):null,yr.map(e=>(0,A.jsx)(`div`,{className:`sheet-selection-fill`,"data-testid":`sheet-selection-fill`,"data-area":Gj(e)},Gj(e))),(0,A.jsx)(`div`,{className:`sheet-selection`,"data-testid":`sheet-selection`,"data-address":$t(j),"data-areas":Nt.map($t).join(` `),"data-area":Gj(j)}),Te?(0,A.jsx)(`div`,{className:`sheet-fill-to`,"data-testid":`sheet-fill-to`,"data-area":Gj(Te)}):null,Fr?(0,A.jsx)(`div`,{className:`sheet-handle`,"data-testid":`sheet-handle`,"data-corner":`foot`,"data-size":`free`,"data-area":Gj(j),onPointerDown:Vt,onDoubleClick:Ht}):null,x.charts.map(e=>(0,A.jsx)(iD,{zoom:f,calc:r.calc,sheet:x,chart:e,revision:n.revision,view:()=>s.current?.view(),selected:ye===e.index,disabled:!Fe||Ie,onSelect:()=>{(!D||ut())&&(be(e.index),qe())},onMenu:(t,n)=>{(!D||ut())&&(be(e.index),Ue({x:t,y:n}))},onPlaced:(t,n)=>{vt(e.index,t,n)}},e.index)),Oe?.sheet===S&&!D?(0,A.jsxs)(oe,{children:[(0,A.jsx)(T,{asChild:!0,children:(0,A.jsx)(`button`,{type:`button`,className:`sheet-fill-options`,"aria-label":a.fill.options,title:a.fill.options,"data-testid":`sheet-fill-options`,"data-corner":`foot`,"data-size":`free`,"data-area":Gj(Oe.to)})}),(0,A.jsxs)(y,{align:`start`,className:`text-xs`,onCloseAutoFocus:e=>{e.preventDefault(),qe()},children:[(0,A.jsx)(E,{"data-testid":`sheet-fill-copy`,onSelect:()=>{Ut(`copy`)},children:a.fill.copy}),(0,A.jsx)(E,{"data-testid":`sheet-fill-series`,onSelect:()=>{Ut(`series`)},children:a.fill.series})]})]}):null,Mr?(0,A.jsx)(`button`,{type:`button`,className:`sheet-list-arrow`,"aria-label":a.menu.pickFromList,title:a.menu.pickFromList,"data-testid":`sheet-list-arrow`,"data-corner":`side`,"data-size":`free`,"data-area":Gj({top:hr,left:gr,bottom:hr,right:gr}),onPointerDown:e=>{e.preventDefault(),Gt(w.active)}}):null,jr&&(jr.title!==void 0||jr.message!==void 0)?(0,A.jsxs)(`div`,{className:`sheet-hint sheet-prompt`,"data-testid":`sheet-prompt`,"data-area":Sr,"data-size":`free`,children:[jr.title===void 0?null:(0,A.jsx)(`b`,{children:jr.title}),jr.message===void 0?null:(0,A.jsx)(`p`,{children:jr.message})]}):null,(0,A.jsx)(`textarea`,{ref:c,className:`sheet-sink`,"data-testid":`sheet-sink`,"data-sink":``,"data-area":xr,"data-size":`free`,"data-editing":D&&pr?``:void 0,rows:1,spellCheck:!1,"aria-label":Qt(mr),onInput:e=>{let t=e.currentTarget;D?(ne({...Pj(D),text:t.value,caret:t.selectionStart,problem:!1}),me(0)):t.value!==``&&Fe?nt({text:t.value,mode:`enter`}):t.value=``},onSelect:e=>{let t=e.currentTarget.selectionStart;ne(e=>e&&e.caret!==t?{...e,caret:t}:e)},onCompositionStart:()=>{!D&&Fe&&nt({text:``,mode:`enter`})},onCompositionEnd:e=>{D?.text===``&&e.data===``&&ct()}}),D&&pr&&Un.length>0?(0,A.jsx)(`div`,{className:`sheet-hint sheet-functions`,"data-testid":`sheet-functions`,"data-area":Sr,"data-size":`free`,children:Un.map((e,t)=>(0,A.jsx)(`button`,{type:`button`,"data-on":t===pe%Un.length?``:void 0,onPointerDown:t=>{t.preventDefault(),jn(D,e)},children:e},e))}):D&&pr&&Wn&&Gn?(0,A.jsxs)(`div`,{className:`sheet-hint`,"data-testid":`sheet-arguments`,"data-area":Sr,"data-size":`free`,children:[Wn.name,`(`,Gn.map((e,t)=>(0,A.jsxs)(`span`,{children:[t>0?`, `:``,t===_j(Gn,Wn.argument)?(0,A.jsx)(`b`,{children:e}):e]},e)),`)`]}):null,le?.sheet===S?(0,A.jsx)(`button`,{type:`button`,className:`sheet-offer`,"data-testid":`sheet-overwrite`,"data-area":Gj({top:le.row+1,left:le.col,bottom:le.row+1,right:le.col}),"data-size":`free`,onClick:()=>{O(ju({file:r.file,rows:r.rows,workbook:r.workbook},le.sheet,le.row,le.col,le.text)),ue(void 0),qe()},children:a.overwrite}):null]}),se===void 0?null:(0,A.jsx)(`div`,{className:`sheet-say`,role:`alert`,"data-testid":`sheet-say`,children:se}),n.codeFailed?(0,A.jsx)(`div`,{className:`sheet-say`,role:`alert`,"data-testid":`sheet-code-failed`,children:a.generated.failed}):null,Qn===void 0?null:(0,A.jsx)(`button`,{type:`button`,className:`sheet-say`,"data-testid":`sheet-conflict`,onClick:()=>{Me(Zn)},children:Qn}),(0,A.jsx)(IO,{changes:n.changes,places:qn,agent:o?.agent?.name,onShow:Xn,onKeep:e=>{t.keep(e),qe()},onUndo:e=>{t.undo(e),qe()},onAll:e=>{t.all(e),qe()}}),Ir,_e?(0,A.jsx)(LO,{kind:_e.kind,x:_e.x,y:_e.y,disabled:!Fe||Ie,onClose:()=>{ve(void 0),qe()},on:{cut:()=>{Tn(!0)!==void 0&&navigator.clipboard.writeText(re?.text??``).catch(()=>void 0)},copy:()=>{let e=Tn(!1);e!==void 0&&navigator.clipboard.writeText(e).catch(()=>void 0)},canPaste:!0,paste:Bn,insertRows:()=>{En(`rows`)},insertColumns:()=>{En(`columns`)},deleteRows:()=>{Dn(`rows`)},deleteColumns:()=>{Dn(`columns`)},clear:zt,sort:on,customSort:sn,filterToggle:ln,filterByValue:()=>{cn()},filterClear:un,formatCells:()=>{ge({kind:`format`,tab:`number`})},rowHeight:()=>{xn(`row`)},columnWidth:()=>{xn(`column`)},hide:gn,unhide:_n,pickFromList:Dr?.spec.type===`list`?()=>{Gt(w.active)}:void 0,insertFile:x.filesAt(hr,gr)===void 0?void 0:()=>{We.current?.click()},openFile:xt(w.active).length===0?void 0:()=>{ge({kind:`file`,at:w.active})}}}):null,He&&nr?(0,A.jsx)(RO,{x:He.x,y:He.y,disabled:!Fe||Ie,canPaste:Be,onClose:()=>{Ue(void 0),qe()},onCut:()=>{navigator.clipboard.writeText(Et(nr,!0)).catch(()=>void 0)},onCopy:()=>{navigator.clipboard.writeText(Et(nr,!1)).catch(()=>void 0)},onPaste:Dt,onDelete:()=>{be(void 0),O(_E(M(),S,nr.index))}}):null,(0,A.jsx)(`input`,{ref:We,type:`file`,multiple:!0,hidden:!0,"data-testid":`sheet-file-input`,onChange:e=>{let t=[...e.currentTarget.files??[]];e.currentTarget.value=``,t.length>0&&Ct(w.active,t)}}),xe&&Nr?(0,A.jsx)(ak,{sheet:x,calc:r.calc,filter:Nr,col:xe.at.col,rect:xe.rect,name:sl(r.calc.value(x,xe.at.row,xe.at.col),void 0),onClose:()=>{Se(void 0),qe()},onSort:e=>{an({area:Nr.area,header:!0},[{col:xe.at.col,descending:e}]),Se(void 0),qe()},onKeep:e=>{O(cE(M(),S,Nr,xe.at.col,e)),Se(void 0),qe()}},`${String(xe.at.row)}:${String(xe.at.col)}`):null,Ce&&Dr?(0,A.jsx)(ok,{values:Jd(r.calc,x,Dr,Ce.at.row,Ce.at.col),rect:Ce.rect,ticked:Dr.spec.multiple===!0?Or:void 0,onClose:()=>{we(void 0),qe()},onPick:e=>{let t=Dr.spec.multiple===!0,n=Jd(r.calc,x,Dr,Ce.at.row,Ce.at.col),i=Or.includes(e)?Or.filter(t=>t!==e):n.filter(t=>Or.includes(t)||t===e);O(Au(M(),S,[{row:Ce.at.row,col:Ce.at.col,text:t?qd(i,Dr.spec):e}]),t?`choices:${String(Ce.at.row)}`:void 0),!t&&(we(void 0),qe())}}):null,(0,A.jsxs)(`div`,{className:`sheet-foot`,onMouseDown:Mj,children:[(0,A.jsx)(xj,{sheets:r.workbook.sheets.filter(e=>e.spec.hidden!==!0).map(e=>({name:e.name,color:e.spec.tab,locked:e.generated})),shown:S,disabled:!Fe,onShow:e=>{(!D||Fk(D.text,D.caret)||D.pick||ut())&&(Ze(e),D?Ke(D)?.focus({preventScroll:!0}):qe())},onAdd:kn,onRename:(e,t)=>{if(!Ye(e)&&Xe(Yu({file:r.file,rows:r.rows,workbook:r.workbook},e,t))){let n=C.current.get(e);n&&C.current.set(t,n),e===S&&v(t)}},onDuplicate:On,onDelete:e=>{Ye(e)||Xe($u({file:r.file,rows:r.rows,workbook:r.workbook},e))},onMove:(e,t)=>{Ye(e)||Xe(td({file:r.file,rows:r.rows,workbook:r.workbook},e,t))},onHide:vn,onUnhide:F.length>0?yn:void 0,onColor:(e,t)=>{Ye(e)||Xe(oE(M(),e,t))},onDone:qe}),(0,A.jsx)(Sj,{stats:$n,records:er,scenario:r.scenario,onScenario:()=>{ge({kind:`scenarios`})},zoom:f,onZoom:or,onDone:qe})]})]})}var Wj={ArrowUp:[-1,0],ArrowDown:[1,0],ArrowLeft:[0,-1],ArrowRight:[0,1]},Gj=e=>`${String(e.top)},${String(e.left)},${String(e.bottom)},${String(e.right)}`;function Kj(e,t,n){if(Pn(e).formula===void 0||t===0&&n===0)return e;let r=fr(e);return r.ok?xr(Yn(r.node,t,n)):e}function qj(e){let t=te(),[n,r]=(0,k.useState)(),[i,a]=(0,k.useState)();return(0,k.useEffect)(()=>{if(e===void 0)return;let n=!0,i;return tk.open(t,e).then(e=>{i=e,n?r(e):e.close()},e=>{n&&a(e instanceof Error?e.message:String(e))}),()=>{n=!1,r(void 0),i?.close()}},[t,e]),{...n?{files:n}:{},...i===void 0?{}:{failed:i}}}function Jj({className:e,bare:t,onProbe:n}){let r=ae(),i=r?.item.dir,{files:a,failed:o}=qj(i),s=(0,k.useSyncExternalStore)(a?.subscribe??Fj,a?.get??Ij),c=ZE(),l=`sheet-page ${t===!0?`sheet-bare `:``}${e??``}`,u=s?.book;return(0,A.jsx)(`div`,{className:l,"data-testid":`sheet-editor`,lang:r?.locale,"data-state":s?`ready`:`loading`,children:(0,A.jsx)(`div`,{className:`sheet-sheet`,children:o===void 0?s&&a&&u&&i!==void 0?(0,A.jsx)(Uj,{dir:i,files:a,state:s,book:u,onProbe:n}):s?.problems?(0,A.jsxs)(`div`,{className:`sheet-notice`,role:`alert`,"data-testid":`sheet-notice`,children:[(0,A.jsx)(`p`,{children:c.unreadable}),s.problems.map(e=>(0,A.jsx)(`p`,{children:e},e))]}):(0,A.jsx)(`p`,{className:`sheet-message`,children:c.loading}):(0,A.jsx)(`p`,{className:`sheet-message`,role:`alert`,children:o})})})}export{Jj as SheetEditor};