allyhub 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio-text.js +1 -1
- package/dist/commands/add.js +2 -2
- package/dist/commands/cloud-tools.js +5 -5
- package/dist/commands/dev.js +1 -1
- package/dist/commands/frames/piece.js +1 -1
- package/dist/commands/frames/sheet.js +1 -1
- package/dist/commands/frames.js +8 -8
- package/dist/commands/index.js +1 -1
- package/dist/commands/inspect/common.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/render.js +1 -1
- package/dist/commands/sheet.js +5 -5
- package/dist/commands/site.js +3 -2
- package/dist/commands/skills.js +3 -3
- package/dist/commands/slides.js +2 -2
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
- package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
- package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
- package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
- package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
- package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
- package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
- package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
- package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
- package/dist/node_modules/@allyhub-next/build/package.json +1 -1
- package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
- package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
- package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
- package/dist/node_modules/@allyhub-next/check/package.json +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
- package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
- package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/package.json +1 -1
- package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
- package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
- package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
- package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/export/package.json +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +69 -18
- package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +847 -116
- package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
- package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +501 -38
- package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
- package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
- package/dist/node_modules/@allyhub-next/media/package.json +1 -1
- package/dist/node_modules/@allyhub-next/model/package.json +1 -1
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
- package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
- package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
- package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
- package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
- package/dist/node_modules/@allyhub-next/project/package.json +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
- package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
- package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +79 -5
- package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +21 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
- package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
- package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
- package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
- package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
- package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
- package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
- package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
- package/dist/node_modules/@allyhub-next/render/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
- package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
- package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
- package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
- package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
- package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
- package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
- package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
- package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +10 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +3 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +42 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
- package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
- package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +59 -39
- package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +27 -13
- package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +179 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
- package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +2 -4
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +17 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +21 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
- package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
- package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
- package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
- package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
- package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
- package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
- package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
- package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
- package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
- package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
- package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
- package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
- package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
- package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
- package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
- package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
- package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
- package/dist/node_modules/@allyhub-next/website/package.json +13 -0
- package/dist/text/facts-text.js +4 -4
- package/dist/works.js +1 -1
- package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
- package/editor-web/assets/dist-0emakyZE.js +36 -0
- package/editor-web/assets/dist-B3UoDUa5.js +37 -0
- package/editor-web/assets/dist-B6KzR3pN.js +10 -0
- package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
- package/editor-web/assets/dist-CTQIm8Im.js +10 -0
- package/editor-web/assets/dist-CiHNHwyq.js +2 -0
- package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
- package/editor-web/assets/index-CFt3ovRY.js +69 -0
- package/editor-web/assets/index-ujKjdu_s.css +2 -0
- package/editor-web/assets/minus-BhoPZC5P.js +1 -0
- package/editor-web/assets/react-C_-rEEBU.js +101 -0
- package/editor-web/assets/tabs-Den4gHrU.js +105 -0
- package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
- package/editor-web/index.html +5 -5
- package/package.json +8 -14
- package/dist/astro.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
- package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
- package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
- package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
- package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
- package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
- package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
- package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
- package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
- package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
- package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
- package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
- package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
- package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
- package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
- package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
- package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
- package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
- package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
- package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
- package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
- package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
- package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
- package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
- package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
- package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
- package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
- package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
- package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
- package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
- package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
- package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
- package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
- package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
- package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
- package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
- package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
- package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
- package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -67
- package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
- package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
- package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
- package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
- package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -178
- package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
- package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
- package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
- package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
- package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
- package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
- package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
- package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
- package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
- package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
- package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
- package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
- package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
- package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
- package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
- package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
- package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
- package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
- package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
- package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
- package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
- package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
- package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
- package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
- package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
- package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
- package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
- package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
- package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
- package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
- package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
- package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
- package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
- package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
- package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
- package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
- package/dist/node_modules/@allyhub-next/site/package.json +0 -25
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-core/dist/preset.js +0 -2
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -56
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -72
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -32
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -43
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
- package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
- package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
- package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
- package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
- package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
- package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
- package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
- package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
- package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
- package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
- package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
- package/dist/site.d.ts +0 -2
- package/editor-web/assets/dist-BW2s9FMO.js +0 -4
- package/editor-web/assets/dist-C-6JmebI.js +0 -233
- package/editor-web/assets/dist-CCYMLMKN.js +0 -6
- package/editor-web/assets/dist-CHzurjMx.js +0 -33
- package/editor-web/assets/dist-DF7H1dxw.js +0 -1
- package/editor-web/assets/dist-Da5AUSKX.js +0 -2
- package/editor-web/assets/index-B7S9RZhL.css +0 -2
- package/editor-web/assets/index-CovQYWvD.js +0 -69
- package/editor-web/assets/minus-BrvjaJyO.js +0 -1
- package/editor-web/assets/react-DV5fPdiH.js +0 -101
- package/editor-web/assets/textarea-B0vCGdZI.js +0 -105
- package/editor-web/assets/trash-2-B0dvc1cZ.js +0 -1
- package/editor-web/assets/undo-2-A1EPubPO.js +0 -1
- /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{$n as r,Qt as i,Yt as a,_ as o,a as s,an as c,b as l,c as u,d,g as f,h as p,l as m,ln as h,m as g,n as _,nn as v,o as y,p as b,r as x,rn as S,tn as ee,v as C,x as te,y as w}from"./react-C_-rEEBU.js";import{C as ne,D as T,E,F as D,M as re,O,S as k,T as ie,_ as ae,a as oe,b as se,i as ce,n as le,s as ue,t as de,v as fe,w as pe,x as me,y as he}from"./dist-CTQIm8Im.js";import{A as ge,B as _e,C as ve,D as ye,E as be,F as xe,G as Se,H as Ce,I as we,J as Te,L as Ee,M as De,N as Oe,O as ke,P as Ae,R as je,T as Me,V as Ne,_ as Pe,a as Fe,b as Ie,c as Le,d as Re,f as ze,g as Be,h as Ve,i as He,j as Ue,k as We,m as Ge,n as Ke,o as qe,p as Je,r as Ye,s as Xe,t as Ze,v as Qe,w as $e,x as et,y as tt,z as nt}from"./tabs-Den4gHrU.js";import{a as rt,i as it,n as at,r as ot,t as st}from"./text-align-start-CsW4nqqL.js";import{t as ct}from"./minus-BhoPZC5P.js";import{a as lt,i as ut,l as dt,n as ft,o as pt,r as mt,t as ht}from"./index-CFt3ovRY.js";var gt=v(`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`}]]),_t=v(`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`}]]),vt=v(`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`}]]),yt=v(`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`}]]),bt=v(`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`}]]),xt=v(`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`}]]),St=v(`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`}]]),Ct=v(`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`}]]),wt=v(`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`}]]),Tt=v(`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`}]]),Et=v(`heading`,[[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M6 20V4`,key:`1w1bmo`}],[`path`,{d:`M18 20V4`,key:`o2hl4u`}]]),Dt=v(`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`}]]),Ot=v(`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`}]]),kt=v(`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`}]]),At=v(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),jt=v(`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`}]]),Mt=v(`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`}]]),Nt=v(`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`}]]),Pt=v(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ft=v(`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`}]]),It=v(`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`}]]),Lt=v(`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`}]]),Rt=v(`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`}]]),A=t(r(),1),j=S(),zt=1048576,Bt=16384;function Vt(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 Ht(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 Ut=e=>`${Vt(e.col)}${String(e.row+1)}`;function Wt(e){let t=Ut({row:e.top,col:e.left});return e.top===e.bottom&&e.left===e.right?t:`${t}:${Ut({row:e.bottom,col:e.right})}`}function Gt(e){let t=/^\$?([A-Za-z]{1,3})\$?([1-9]\d*)$/u.exec(e.trim());if(!t)return;let n=Ht(t[1]??``),r=Number(t[2])-1;return n===void 0||r>=1048576?void 0:{row:r,col:n}}function Kt(e){let[t=``,n,r]=e.split(`:`);if(r!==void 0)return;let i=Gt(t),a=n===void 0?i:Gt(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 qt(e){let t=[];for(let n of e.trim().split(/\s+/u)){let e=Kt(n);if(!e)return;t.push(e)}return t}var Jt=(e,t,n)=>t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right,Yt=(e,t)=>e.top<=t.bottom&&t.top<=e.bottom&&e.left<=t.right&&t.left<=e.right,Xt={delimiter:`,`,newline:`
|
|
2
|
+
`,bom:!1,finalNewline:!0};function Zt(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 Qt(e,t=`,`){return e.includes(t)||e.includes(`"`)||e.includes(`
|
|
10
|
+
`)||e.includes(`\r`)?`"${e.replace(/"/g,`""`)}"`:e}function $t(e,t=`,`){return e.length===1&&e[0]===``?`""`:e.map(e=>Qt(e,t)).join(t)}function en(e,t=Xt){let n=e.map(e=>$t(e,t.delimiter)).join(t.newline);return`${t.bom?``:``}${n}${t.finalNewline&&e.length>0?t.newline:``}`}function tn(e){return e.map(e=>$t(e,` `)).join(`
|
|
11
|
+
`)}function nn(e){return Zt(e,` `).records.map(e=>e.fields)}var rn=(e,t)=>{if(e.length===0)return``;let n=[];for(let r=0;r<t;r++)n.push(e[r]??``);return n.join(`\0`)},an=(e,t)=>rn(e.end===e.start?[]:e.fields,t);function on(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=an(e,a),n=l.get(t);n?n.push(e):l.set(t,[e])}}let o=l.get(rn(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?``:$t(u,n.delimiter)});let u=n.finalNewline||c[c.length-1]===``;return`${n.bom?``:``}${c.join(n.newline)}${u?n.newline:``}`}var M=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}},N={NULL:M.of(`#NULL!`),DIV0:M.of(`#DIV/0!`),VALUE:M.of(`#VALUE!`),REF:M.of(`#REF!`),NAME:M.of(`#NAME?`),NUM:M.of(`#NUM!`),NA:M.of(`#N/A`),SPILL:M.of(`#SPILL!`),CALC:M.of(`#CALC!`),CYCLE:M.of(`#CYCLE!`)},sn=[`#NULL!`,`#DIV/0!`,`#VALUE!`,`#REF!`,`#NAME?`,`#NUM!`,`#N/A`,`#GETTING_DATA`,`#SPILL!`,`#CALC!`,`#CYCLE!`];function cn(e){let t=e.toUpperCase(),n=sn.find(e=>e===t);return n===void 0?void 0:M.of(n)}var P=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}},ln=864e5,un=25569;function dn(e){let t=e+un;return t<61?t-1:t}function fn(e){let t=Math.floor(e);if(t!==60)return(t<60?t+1:t)-un}function pn(e,t,n){let r=new Date(Date.UTC(2e3,t-1,1));return r.setUTCFullYear(r.getUTCFullYear()-2e3+e),dn(Math.floor(r.getTime()/ln))+n-1}function mn(e){let t=fn(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*ln);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate()}}function hn(e){let t=e.getTime(),n=Math.floor(t/ln);return dn(n)+(t-n*ln)/ln}function gn(e){let t=fn(e);if(t===void 0)return;let n=e-Math.floor(e);return new Date(t*ln+Math.round(n*ln))}var _n=(e,t=2)=>String(e).padStart(t,`0`);function vn(e){let{year:t,month:n,day:r}=mn(e),i=`${_n(t,4)}-${_n(n)}-${_n(r)}`,a=Math.round((e-Math.floor(e))*86400);if(a===0)return i;let o=a%60;return`${i}T${_n(Math.floor(a/3600))}:${_n(Math.floor(a/60)%60)}${o===0?``:`:${_n(o)}`}`}function yn(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?`-`:`+`}${_n(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 bn=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/u,xn=/^[+-]?\d{1,3}(?:,\d{3})+(?:\.\d+)?$/u,Sn=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/u,Cn=e=>/^[+-]?\d+$/u.test(e)&&e.replace(/^[+-]?0*/u,``).length>15;function wn(e){let t=Sn.exec(e);if(!t)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],a=pn(n,r,i),o=mn(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 Tn(e){let t=/^(\d{1,4}):([0-5]?\d)(?::([0-5]?\d))?(?:\s*([AaPp])[Mm]?)?$/u.exec(e)??/^(\d{1,2})()()\s*([AaPp])[Mm]?$/u.exec(e);if(!t)return;let n=Number(t[1]),r=t[2]===void 0||t[2]===``?0:Number(t[2]),i=t[3]===void 0||t[3]===``?0:Number(t[3]),a=t[4]?.toUpperCase();if(a!==void 0)return n<1||n>12?void 0:{value:((n%12+(a===`P`?12:0))*3600+r*60+i)/86400,format:t[3]?`h:mm:ss AM/PM`:`h:mm AM/PM`};let o=(n*3600+r*60+i)/86400;return n>=24?{value:o,format:`[h]:mm:ss`}:{value:o,format:t[3]?`h:mm:ss`:`h:mm`}}function En(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(bn.test(t))return Cn(t)?{value:e}:{value:Number(t)};if(t.endsWith(`%`)){let e=t.slice(0,-1).trim();if(bn.test(e))return{value:Number(e)/100,format:e.includes(`.`)?`0.00%`:`0%`}}if(xn.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=wn(t);if(a)return a;let o=Tn(t);if(o)return o;let s=cn(t);return s?{value:s}:{value:e}}function Dn(e){if(e===null)return``;if(typeof e==`number`){let t=String(e);return Cn(t)?e.toExponential():t}if(typeof e==`boolean`)return e?`TRUE`:`FALSE`;if(e instanceof M)return e.code;let t=En(e);return t.value===e&&t.formula===void 0?e:`'${e}`}var On=`sheet.yaml`;function kn(e){let{file:t}=jn(e);return[...new Set(t?.sheets.flatMap(e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)])??[])]}function An(e){let t=[];return et(e,{Map(e,n){if(!ve(n))return;let r=new Set;for(let e of n.items){let n=$e(e.key)?String(e.key.value):void 0;if(n!==void 0){if(r.has(n)){let r=$e(e.key)?e.key.range?.[0]??0:0;t.push({at:r,key:n})}else r.add(n)}}}}),t}function jn(e){let t=new tt,n=Qe(e,{lineCounter:t,uniqueKeys:!1}),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}},i=An(n);if(n.errors.length>0||i.length>0)return{problems:[...n.errors.map(e=>({file:On,line:t.linePos(e.pos[0]).line,message:`not YAML: ${e.message.split(`
|
|
12
|
+
`)[0]??``}`})),...i.map(e=>({file:On,line:t.linePos(e.at).line,message:`not YAML: Map keys must be unique (${e.key})`}))],lineOf:r};let a=je(`sheet`,n.toJS()??{});return a.ok?{file:a.value,problems:[],lineOf:r}:{problems:a.problems.map(e=>{let t=r(e.path===``?[]:e.path.split(`.`).map(e=>/^\d+$/u.test(e)?Number(e):e));return{file:On,...t===void 0?{}:{line:t},message:`${e.path===``?``:`${e.path}: `}${e.message}`}}),lineOf:r}}var Mn=e=>e.toLowerCase();function Nn(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=>Mn(e.name))),i=t.sheets.filter(e=>!r.has(Mn(e.name))),a=t.sheets.filter(e=>r.has(Mn(e.name))).map(e=>e.name),o=new Set(Object.keys(e.names??{}).map(Mn)),s=Object.entries(t.names??{}).filter(([e])=>!o.has(Mn(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 Pn=e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)],Fn=e=>e.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`).replace(/^-|-$/gu,``);function In(e,t,n,r=()=>!1){let i=t.sheets.find(e=>Mn(e.name)===Mn(n));if(!i)return{rows:new Map,cells:[],whole:!1,refused:`no-sheet`};let a=new Map,o=new Map;for(let e of Pn(i)){let n=t.csv[e];if(n===void 0)continue;let s=Fn(`${i.name} ${e.split(`/`).pop()??``}`).replace(/-csv$/u,``),c=`${_e}/${s}.csv`;for(let e=2;r(c)||a.has(c);e++)c=`${_e}/${s}-${String(e)}.csv`;o.set(e,c),a.set(c,Zt(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 Ln(e,t){return t(Rn(e,t))}function Rn(e,t){switch(e.kind){case`unary`:case`postfix`:case`paren`:{let n=Ln(e.arg,t);return n===e.arg?e:{...e,arg:n}}case`binary`:{let n=Ln(e.left,t),r=Ln(e.right,t);return n===e.left&&r===e.right?e:{...e,left:n,right:r}}case`call`:{let n=e.args.map(e=>Ln(e,t));return n.every((t,n)=>t===e.args[n])?e:{...e,args:n}}case`invoke`:{let n=Ln(e.callee,t),r=e.args.map(e=>Ln(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=>Ln(e,t)));return n.every((t,n)=>t.every((t,r)=>t===e.rows[n]?.[r]))?e:{...e,rows:n}}default:return e}}function zn(e,t){switch(t(e),e.kind){case`unary`:case`postfix`:case`paren`:zn(e.arg,t);break;case`binary`:zn(e.left,t),zn(e.right,t);break;case`call`:for(let n of e.args)zn(n,t);break;case`invoke`:zn(e.callee,t);for(let n of e.args)zn(n,t);break;case`array`:for(let n of e.rows)for(let e of n)zn(e,t)}}function Bn(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 Vn(e,t,n){let r=e.col&&Bn(e.col,n,16384),i=e.col2&&Bn(e.col2,n,16384),a=e.row&&Bn(e.row,t,1048576),o=e.row2&&Bn(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 Hn(e,t,n){return t===0&&n===0?e:Ln(e,e=>e.kind===`ref`?Vn(e,t,n):e)}function Un(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 Wn=[`#All`,`#Data`,`#Headers`,`#Totals`,`#This Row`],Gn=class extends Error{at;constructor(e,t){super(e),this.at=t}},Kn=new Set([`=`,`<>`,`<`,`<=`,`>`,`>=`]),qn={"=":1,"<>":1,"<":1,"<=":1,">":1,">=":1,"&":2,"+":3,"-":3,"*":4,"/":4,"^":5},Jn=e=>e>=`0`&&e<=`9`,Yn=e=>/[\p{L}_\\]/u.test(e)||e>=`\ud800`&&e<=`\udfff`,Xn=e=>/[\p{L}\p{N}\p{M}_.?\\]/u.test(e)||e>=`\ud800`&&e<=`\udfff`,Zn=(e,t)=>({index:e,abs:t}),Qn=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 Gn(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(Kn.has(e))return e;let t=this.s.charAt(this.at);return qn[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=qn[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(`#`)&&!er(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($n(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===`[`||Yn(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(Jn(e)||e===`.`){let e=ir(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===`'`||Yn(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=er(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(Jn(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&&Xn(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=ir(this.s,this.at);if(t)return this.at=t.end,{kind:`ref`,...t.ref};let n=nr(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=ir(this.s,this.at);if(r)return this.at=r.end,{kind:`ref`,...n,...r.ref};let i=nr(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&&Yn(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=Wn.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)}},$n=e=>e.kind===`ref`||e.kind===`name`||e.kind===`structured`||e.kind===`call`||e.kind===`paren`||e.kind===`binary`&&(e.op===`:`||e.op===` `);function er(e,t){let n=/^#[A-Za-z0-9_/]+[!?]?/u.exec(e.slice(t));return n?cn(n[0])?.code:void 0}var tr=(e,t)=>{let n=e.charAt(t);return n!==``&&(Xn(n)||n===`(`||n===`!`||n===`[`)};function nr(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=Ht(r[2]??``),a=Ht(r[4]??``);if(i!==void 0&&a!==void 0&&!tr(e,n))return{ref:{col:Zn(i,r[1]===`$`),col2:Zn(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=rr(i),o=t+i[0].length;if(a&&!tr(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=rr(t),r=o+1+t[0].length;if(n&&!tr(e,r))return{ref:{...a,col2:n.col,row2:n.row,range:!0},end:r}}}return{ref:{...a,range:!1},end:o}}}function rr(e){let t=Ht(e[2]??``),n=Number(e[4])-1;if(!(t===void 0||t>=16384||n>=1048576))return{col:Zn(t,e[1]===`$`),row:Zn(n,e[3]===`$`)}}function ir(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||tr(e,r)))return{ref:{row:Zn(i,n[1]===`$`),row2:Zn(a,n[3]===`$`),range:!0},end:r}}function ar(e){try{return{ok:!0,node:new Qn(e).parse()}}catch(e){if(e instanceof Gn)return{ok:!1,error:{message:e.message,at:e.at}};throw e}}var or=e=>`${e.abs?`$`:``}${Vt(e.index)}`,sr=e=>`${e.abs?`$`:``}${String(e.index+1)}`;function cr(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 lr(e){let t=e.sheet===void 0?``:cr(e.sheet,e.lastSheet);if(e.row===void 0&&e.col&&e.col2)return`${t}${or(e.col)}:${or(e.col2)}`;if(e.col===void 0&&e.row&&e.row2)return`${t}${sr(e.row)}:${sr(e.row2)}`;if(!e.col||!e.row)return`${t}#REF!`;let n=`${or(e.col)}${sr(e.row)}`;return e.col2&&e.row2?`${t}${n}:${or(e.col2)}${sr(e.row2)}`:`${t}${n}`}var ur=e=>e.replace(/([[\]#'@])/gu,`'$1`),dr=e=>/^[\p{L}\p{N}_]+$/u.test(e);function fr(e){let t=e.table??``,[n,r]=e.columns,i=e.columns.map(e=>`[${ur(e)}]`).join(`:`);if(e.sections.length===0)return e.thisRow?n===void 0?`${t}[@]`:r===void 0?`${t}[@${dr(n)?ur(n):i}]`:`${t}[@${i}]`:n===void 0?t===``?`[]`:t:r===void 0?`${t}[${ur(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 pr(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?``:cr(e.sheet)}${e.code}`;case`missing`:return``;case`ref`:return lr(e);case`structured`:return fr(e);case`name`:return`${e.sheet===void 0?``:cr(e.sheet)}${e.name}`;case`unary`:return`${e.op}${pr(e.arg)}`;case`postfix`:return`${pr(e.arg)}${e.op}`;case`binary`:return`${pr(e.left)}${e.op}${pr(e.right)}`;case`call`:return`${e.written}(${e.args.map(pr).join(`,`)})`;case`invoke`:return`${pr(e.callee)}(${e.args.map(pr).join(`,`)})`;case`array`:return`{${e.rows.map(e=>e.map(pr).join(`,`)).join(`;`)}}`;case`paren`:return`(${pr(e.arg)})`}}var mr=e=>`=${pr(e)}`,hr=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=ar(e);i.ok?this.node=i.node:this.error=i.error}},gr=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 Hn(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:mr(this.moved)}},_r=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 gr&&(this.formulas[t]=(this.formulas[t]??1)-1),n instanceof gr&&(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}},vr=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)}},yr=(e,t)=>e*16384+t;function br(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 xr=class{tables=[];blocks=[];merges=[];formulas=new Set;implied=new Map;keys=new Map;fills=[];blanks=new Set;conditions=[];validations=[];filters=[];charts=[];names=new Map;freeze;generated=!1;grid=new _r;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=jr(e,t,[],()=>void 0);n&&this.charts.push(n)}))}put(e,t,n){n instanceof gr&&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 gr&&this.formulas.delete(r),n instanceof gr&&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(yr(e,t))||(r?this.put(e,t,new gr(r,this,e,t)):i!=null&&(this.put(e,t,i),a!==void 0&&this.implied.set(yr(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(yr(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&&Yt(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(yr(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&&Yt(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(yr(n,r),e);this.reach&&br(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(yr(n,r))===e&&this.ghosts.delete(yr(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&&br(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=>Jt(n.area,e,t))}blockAt(e,t){return this.blocks.find(n=>Jt(n.area,e,t))}looks(){if(this.lookAreas)return this.lookAreas;let e=[];for(let t of this.spec.format??[]){let n=Kt(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=Kt(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=>wr.has(e)))]}lookAt(e,t){let n={},r=e=>{if(e)for(let[t,r]of Object.entries(e))wr.has(t)&&r!==void 0&&(n[t]=t===`border`?{...n.border,...r}:r)},i=this.implied.get(yr(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[Vt(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)Jt(n.area,e,t)&&r(n.entry);for(let n of l)Jt(n.area,e,t)&&r(n.entry);let u=this.keys.get(yr(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=>Jt(n,e,t))}validationAt(e,t){return this.validations.find(n=>n.areas.some(n=>Jt(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=>Jt(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?.[Vt(t)]?.files}},Sr=e=>(typeof e==`object`?e.separator:void 0)??`, `;function Cr(e,t){let n=Sr(t);return e.split(n.trim()===``?n:n.trim()).map(e=>e.trim()).filter(e=>e!==``)}var wr=new Set([`bold`,`italic`,`underline`,`strike`,`font`,`size`,`color`,`fill`,`align`,`valign`,`wrap`,`shrink`,`indent`,`rotation`,`border`,`format`]),Tr=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=Nn(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,t){let n=e.toLowerCase();return(t?.names.size?t.names.get(n):void 0)??this.names.get(n)}definitions(e){let t=e.toLowerCase(),n=[],r=this.names.get(t);r&&n.push(r);for(let e of this.sheets){let r=e.names.get(t);r&&n.push(r)}return n}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:nt};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(yr(t,n));if(o!==void 0)return{file:On,path:[`sheets`,r,`cells`,o]};for(let i of Object.keys(e.spec.cells??{})){if(!i.includes(`:`))continue;let e=Kt(i);if(e&&Jt(e,t,n))return{file:On,path:[`sheets`,r,`cells`,i]}}}},Er=/^[\p{L}_\\][\p{L}\p{N}_.\\?]*$/u;function Dr(e){return Er.test(e)&&Gt(e)===void 0&&!/^(?:TRUE|FALSE)$/iu.test(e)&&!/^[Rr](?:\d+)?(?:[Cc]\d*)?$/u.test(e)&&!/^[Cc]\d*$/u.test(e)}var Or=`made`,kr=e=>e[0]===Or?nt:On,Ar=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:kr(e),...n===void 0?{}:{line:n},message:t})}sheetPath(e){return e<this.own?[`sheets`,e]:[Or,`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 xr(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:On,path:[`checks`,t,`formula`]};this.wb.checks.push({name:e.name,formula:new hr(e.formula,0,0,n),source:n})})}names(){let{file:e}=this.wb;this.namesOf(e.names,e.hidden_names,e=>this.madeNames.has(e)?[Or,`names`,e]:[`names`,e],this.wb.names,void 0),e.sheets.forEach((e,t)=>{let n=this.wb.sheets[t];n?.spec===e&&this.namesOf(e.names,e.hidden_names,e=>[...this.sheetPath(t),`names`,e],n.names,n)})}namesOf(e,t,n,r,i){let a=new Set(t?.map(e=>e.toLowerCase()));for(let[t,o]of Object.entries(e??{})){let e=n(t);if(!Dr(t)){this.yaml(e,`${t} cannot be a name`);continue}let s={file:kr(e),path:e},c=typeof o==`string`&&o.startsWith(`=`)?{name:t,formula:new hr(o,0,0,s),source:s}:{name:t,value:typeof o==`string`?En(o).value:o,source:s};i&&(c.sheet=i),a.has(t.toLowerCase())&&(c.hidden=!0),r.set(t.toLowerCase(),c)}}sheet(e,t){let{spec:n}=e;if(n.freeze!==void 0){let r=Gt(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))Yt(n.area,r.area)&&this.problems.push({file:On,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=Kt(n);i?e.merges.push(i):this.yaml([...t,`merges`,r],`${n} is not a range`)}),n.format?.forEach((e,n)=>{Kt(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??{}))Ht(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=jr(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 hr(e,t?.top??0,t?.left??0,{file:kr(n),path:n})}condition(e,t,n){let r=qt(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=qt(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=Kt(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=Ht(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=>Yt(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=>Yt(e.area,t));if(n)return`table ${n.name}`;let r=e.blocks.find(e=>Yt(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 hr(r.formula,t,n,i);e.put(t,n,new gr(a,e,t,n))}else r.value!==null&&(e.put(t,n,r.value),r.format!==void 0&&e.implied.set(yr(t,n),r.format))}table(e,t,n){let r=Gt(t.at);if(!r){this.yaml([...n,`at`],`${t.at} is not a cell`);return}if(!Dr(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 vr(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 hr(s,m,o,{file:kr(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,En(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=Gt(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,En(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=Kt(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=Pr(i),s=yr(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:kr(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(!Dr(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:kr(r),path:r},a=Ut(t).replace(/^([A-Z]+)(\d+)$/u,`$$$1$$$2`),o=`='${e.name.replaceAll(`'`,`''`)}'!${a}`;this.wb.names.set(n.toLowerCase(),{name:n,formula:new hr(o,0,0,i),source:i})}fill(e,t,n,r){let i=Pr(n),a={file:kr(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 hr(i.formula,t.top,t.left,a)})}};function jr(e,t,n,r){let i=Gt(e.at);if(!i){r([...n,`at`],`${e.at} is not a cell`);return}let a=(e,t)=>{let n=new hr(Mr(e),0,0,{file:kr(t),path:t});return n.node&&!Nr(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 Mr=e=>e.startsWith(`=`)?e:`=${e}`;function Nr(e){switch(e.kind){case`error`:case`ref`:case`structured`:case`name`:return!0;case`paren`:case`postfix`:return Nr(e.arg);case`binary`:return e.op===`:`||e.op===`,`;default:return!1}}function Pr(e){if(e===null)return{value:null};if(typeof e==`string`)return En(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`?En(t):{value:t??null}}function Fr(e){let t=Nn(e.file,e.generated),n=new Tr(t.file,e.generated);return n.ordinary=t.ordinary,new Ar(n,t=>{let n=e.generated?.csv[t];if(n!==void 0)return{rows:Zt(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}var Ir=e=>e instanceof M?{error:e.code}:e;function Lr(e){return typeof e!=`object`||!e?e:cn(e.error)??N.VALUE}var Rr=e=>({rows:e.rows,cols:e.cols,data:e.data.map(Ir)}),zr=e=>new P(e.rows,e.cols,e.data.map(Lr));function Br(e,t){let n=t.formula?.text;if(n===void 0)return;let r=ar(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 Vr=e=>typeof e==`string`?En(e):{value:e??null};function Hr(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=Vr(r),a=Br(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 hr(i.formula,0,0,n.source),delete n.value)}return!0}var F=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)}`}},Ur=class{parts;constructor(e){this.parts=e}},Wr=class{params;body;frame;named;constructor(e,t,n,r){this.params=e,this.body=t,this.frame=n,this.named=r}},Gr=class{missing=!0},Kr=new Gr;function qr(e){let t=Re(`General`,e),n=[t];for(let r=10;r>=1;r--){let i=Re(`General`,Number(e.toPrecision(r)));i.length<(n[n.length-1]??t).length&&n.push(i)}for(let r=5;r>=0;r--){let i=e.toExponential(r).replace(/e([+-])(\d)$/u,`E$10$2`).replace(/e/u,`E`);i.length<(n[n.length-1]??t).length&&n.push(i)}return n}function Jr(e,t){let n=qr(e);return t?n.find(t):n[0]}function Yr(e,t){if(e===null)return``;if(e instanceof M)return e.code;if(typeof e==`boolean`)return e?`TRUE`:`FALSE`;let n=t??`General`;if(typeof e==`string`)return t!==void 0&&Ge(t)?Re(t,e):e;if(n===`General`||!Ge(n))return Jr(e)??yn(e);try{return Re(n,e)}catch{return Jr(e)??yn(e)}}function Xr(e,t){if(typeof e!=`number`||t===void 0||!Ge(t))return;let n=ze(t,e);return typeof n==`string`?n:void 0}var Zr=e=>e!==void 0&&Ge(e)&&Je(e),Qr={width:480,height:288,size:9,titleSize:14,ink:`#595959`,pixelsToPoints:.75},$r={dk1:`#000000`,lt1:`#FFFFFF`,dk2:`#44546A`,lt2:`#E7E6E6`,accent1:`#4472C4`,accent2:`#ED7D31`,accent3:`#A5A5A5`,accent4:`#FFC000`,accent5:`#5B9BD5`,accent6:`#70AD47`,hlink:`#0563C1`,folHlink:`#954F72`},ei=e=>qe(e,$r);function ti(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?.[Vt(r)]?.hidden!==!0&&i.push({value:e.value(n,s,r),sheet:n,row:s,col:r});return i};if(i instanceof F)return a(i);if(i instanceof Ur)return i.parts.flatMap(a);if(i instanceof P)return i.data.map(e=>({value:e}));let o=e.flat(i);return o instanceof P?o.data.map(e=>({value:e})):[{value:o}]}var ni=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 Yr(e.value,t)};function ri(e){return typeof e==`number`?Number.isFinite(e)?e:null:e===null||e instanceof M?null:typeof e==`boolean`?+!!e:0}var ii=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}},ai=e=>e===void 0?void 0:{rgb:e};function oi(e){if(e===void 0||e===!1)return;if(e===!0)return{show_value:!0};let t=typeof e.color==`string`?ai(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 si=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 ci(e,t,n){let{spec:r}=n,i=Le(r.type),a=n.categories?ti(e,t,n.categories):void 0,o=n.series.map((n,o)=>{let s=r.series[o],c=ti(e,t,n.values),l=n.name?ti(e,t,n.name)[0]:void 0,u=n.x?ti(e,t,n.x):i?a:void 0,d=s.format??si(c),f=ai(s.color);return{name:(l?ni(l):s.name)??`Series${String(o+1)}`,values:c.map(e=>ri(e.value)),...u?{x:u.map(e=>ri(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(ni):Array.from({length:s},(e,t)=>String(t+1)),l=n.title?ti(e,t,n.title)[0]:void 0,u=l?ni(l):r.title,d=oi(r.labels),f=ii(r.value_axis),p=ii(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??Qr.size,title_size:r.title_size??Qr.titleSize,font_color:ai(r.color)??{rgb:Qr.ink}}}var li=e=>({width:e.width??Qr.width,height:e.height??Qr.height}),ui={"&":`&`,"<":`<`,">":`>`,'"':`"`},di=e=>e.replace(/[&<>"]/gu,e=>ui[e]??e),fi=e=>String(Number(e.toFixed(3)));function pi(e){let t=e.fill===void 0?`none`:ei(e.fill),n=e.width>0?ei(e.color):`none`;return`<path d="${di(e.d)}" fill="${t}" stroke="${n}" stroke-width="${fi(e.width)}" stroke-linejoin="round"/>`}function mi(e){let t=[];for(let n of[...e.grid,...e.shapes])t.push(pi(n));for(let n of[...e.boxes,...e.keys])t.push(`<rect x="${fi(n.x)}" y="${fi(n.y)}" width="${fi(n.width)}" height="${fi(n.height)}" fill="${ei(n.color)}"/>`);for(let n of[...e.axes,...e.lines])t.push(pi(n));for(let n of e.dots)t.push(`<circle cx="${fi(n.x)}" cy="${fi(n.y)}" r="${fi(n.r)}" fill="${ei(n.color)}"/>`);for(let n of e.words){let e=n.rotate===void 0?``:` transform="rotate(${fi(n.rotate)} ${fi(n.x)} ${fi(n.y)})"`;t.push(`<text x="${fi(n.x)}" y="${fi(n.y)}" font-size="${fi(n.size)}" text-anchor="${n.anchor}" dominant-baseline="central" fill="${ei(n.color)}"${e}>${di(n.text)}</text>`)}return t.join(``)}function hi(e,t,n,r={}){let i=Qr.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 ${fi(a)} ${fi(o)}" width="${fi(t)}" height="${fi(n)}" font-family="${di(s)}"><rect x="0.375" y="0.375" width="${fi(a-.75)}" height="${fi(o-.75)}" fill="${c}" stroke="${l===`none`?`none`:l}" stroke-width="0.75"/>${mi(Fe(e,a,o))}</svg>`}function gi(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 _i(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?``:cr(t.name)}${Wt(n)}`}var vi=(e,t,n,r)=>typeof e.value(t,n,r)==`number`,yi=(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 bi(e,t,n,r,i){let a=r.bottom-r.top+1,o=r.right-r.left+1,s=t.tables.find(e=>Jt(e.area,r.top,r.left)),c=e=>_i(n,t,e,s),l=Le(i),u=a>1&&Array.from({length:o},(e,t)=>r.left+t).some(n=>!vi(e,t,r.top,n)),d=o>1&&(l||Array.from({length:a-+!!u},(e,t)=>t).every(n=>yi(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&&!Xe(i)&&r.right-p>r.bottom-f,h=[],g=(r,i)=>e.value(t,r,i)===null?void 0:`=${t===n?``:cr(t.name)}${Ut({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&&!Xe(i),b=Xe(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||Xe(i)?{legend:`bottom`}:{},...x===void 0?{}:{title:x}}}function xi(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 F?{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 Si(e,t,n){let r=[xi(e,t,n.categories),...n.series.flatMap(n=>[xi(e,t,n.values),xi(e,t,n.name),xi(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?``:cr(i.sheet.name)}${Wt(a)}`}function Ci(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=Kt(n.slice(r+1).replaceAll(`$`,``));return a&&o?{sheet:a,area:o}:void 0}var wi=(e,t)=>e?.toLowerCase()===t?.toLowerCase(),Ti=(e,t,n)=>e.index>=t?{...e,index:e.index+n}:e;function Ei(e,t,n){if(e.index<t)return e;if(e.index>=t+n)return{...e,index:e.index-n}}function Di(e,t,n,r){let i=e.index<=t.index?e:t,a=i===e?t:e,o=Ti(i,n,r),s=a.index>=n?{...a,index:a.index+r}:a;return i===e?[o,s]:[s,o]}function Oi(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 ki(e){return{kind:`error`,code:`#REF!`,...e.sheet===void 0?{}:{sheet:e.sheet}}}var Ai={kind:`error`,code:`#REF!`};function ji(e,t,n){if(!wi(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:wi(u,n)?Object.fromEntries(Object.entries(f).filter(([e])=>e!==`sheet`)):{...f,sheet:u}}function Mi(e,t,n){if(!wi(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?zt:Bt;if(a===void 0){let n=s?Ti(i,t.at,t.count):Ei(i,t.at,t.count);return!n||n.index>=c?ki(e):n===i?e:{...e,[o[0]]:n}}let l=s?Di(i,a,t.at,t.count):Oi(i,a,t.at,t.count);return!l||l[0].index>=c||l[1].index>=c?ki(e):l[0]===i&&l[1]===a?e:{...e,[o[0]]:l[0],[o[1]]:l[1]}}function Ni(e,t,n,r){let i=(e,t)=>e===void 0?r===void 0||wi(r,t):wi(e,t);return Ln(e,e=>{switch(t.op){case`rename-sheet`:return(e.kind===`ref`||e.kind===`name`||e.kind===`error`)&&wi(e.sheet,t.from)?{...e,sheet:t.to}:e.kind===`ref`&&wi(e.lastSheet,t.from)?{...e,lastSheet:t.to}:e;case`rename-table`:return e.kind===`structured`&&wi(e.table,t.from)?{...e,table:t.to}:e;case`delete-sheet`:return e.kind===`ref`&&wi(e.sheet,t.name)||e.kind===`ref`&&wi(e.lastSheet,t.name)?ki(e):e.kind===`name`&&wi(e.sheet,t.name)?Ai:e;case`delete-table`:return e.kind===`structured`&&wi(e.table,t.name)||e.kind===`name`&&wi(e.name,t.name)?Ai:e;case`delete-column`:return e.kind===`structured`&&i(e.table,t.table)&&e.columns.some(e=>wi(e,t.name))?Ai:e;case`rename-column`:return e.kind===`structured`&&i(e.table,t.table)&&e.columns.some(e=>wi(e,t.from))?{...e,columns:e.columns.map(e=>wi(e,t.from)?t.to:e)}:e;case`rename-name`:return e.kind===`name`&&wi(e.name,t.from)?{...e,name:t.to}:e.kind===`call`&&wi(e.name,t.from)?{...e,name:t.to.toUpperCase(),written:t.to}:e;case`move-cells`:return e.kind===`ref`?ji(e,t,n):e;default:return e.kind===`ref`?Mi(e,t,n):e}})}var Pi=e=>e.op===`insert-rows`||e.op===`delete-rows`||e.op===`insert-columns`||e.op===`delete-columns`,Fi=e=>e.op===`insert-rows`||e.op===`insert-columns`,Ii=e=>e.op===`insert-rows`||e.op===`delete-rows`;function Li(e,t){return Fi(t)?e>=t.at?e+t.count:e:e<t.at?e:e>=t.at+t.count?e-t.count:void 0}function Ri(e,t){let n=Gt(e);if(!n)return e;let r=Li(Ii(t)?n.row:n.col,t);if(r!==void 0)return Ut(Ii(t)?{...n,row:r}:{...n,col:r})}function zi(e,t){return Object.fromEntries(Object.entries(e).flatMap(([e,n])=>{let r=Ri(e,t);return r===void 0?[]:[[r,n]]}))}var Bi=e=>Ii(e)?zt:Bt;function Vi(e,t,n){let r=Bi(n);if(Fi(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 Hi(e,t){let n=Ii(t)?Vi(e.top,e.bottom,t):Vi(e.left,e.right,t);if(n)return Ii(t)?{...e,top:n[0],bottom:n[1]}:{...e,left:n[0],right:n[1]}}function Ui(e,t,n,r){let i=0,a=(e,t)=>{e&&!e.abs&&(i=Math.max(i,Math.abs(e.index-t)))};return zn(e,e=>{e.kind===`ref`&&(t?(a(e.row,n),a(e.row2,n)):(a(e.col,r),a(e.col2,r)))}),i}function Wi(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 Gi(e,t,n,r,i){let a=ar(t);if(!a.ok){let n=i?Hi(e,r):e;return n?[{area:n,text:t}]:[]}let o=Ii(r),[s,c]=o?[e.top,e.bottom]:[e.left,e.right],l=Ui(a.node,o,e.top,e.left),u=[],d=!0;for(let[t,f]of Wi(s,c,r,l)){let s=o?t:e.top,c=o?e.left:t,l=i?Li(t,r):t;if(l===void 0)continue;let p=i?Li(f,r):f;if(p===void 0)continue;let m=Hn(a.node,s-e.top,c-e.left),h=Ni(m,r,n);h!==m&&(d=!1);let g=Un(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:mr(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 Ki(e,t){return typeof e==`object`&&e?{...e,formula:t}:t}var qi=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 Ji(e,t,n,r){let i=ar(e);if(!i.ok)return e;let a=Ni(i.node,t,n,r);return a===i.node?e:mr(a)}function Yi(e,t,n,r){let i={},a=Pi(n)?n:void 0;for(let[o,s]of Object.entries(e)){let e=qi(s),c=Kt(o);if(!c){i[o]=s;continue}let l=r&&a!==void 0;if(o.includes(`:`)){if(!a){i[o]=e===void 0?s:Ki(s,Ji(e,n,t));continue}if(e!==void 0){for(let n of Gi(c,e,t,a,l))i[Wt(n.area)]=Ki(s,n.text);continue}if(!l){i[o]=s;continue}if(!Fi(a)){let e=Hi(c,a);e&&(i[Wt(e)]=s);continue}let r=Ii(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[Wt(o)]=s}continue}let u={row:c.top,col:c.left},d=u;if(l){let e=Li(Ii(a)?u.row:u.col,a);d=e===void 0?void 0:Ii(a)?{...u,row:e}:{...u,col:e}}d&&(i[Ut(d)]=e===void 0?s:Ki(s,Ji(e,n,t)))}return i}function Xi(e,t){let n=Gt(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 Zi=e=>e.reduce((e,t)=>Math.max(e,t.length),0);function Qi(e,t,n){let r=Math.max(Zi(e),1),i=Array.from({length:n},()=>Array(r).fill(``));return[...e.slice(0,t),...i,...e.slice(t)]}function $i(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 ea(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 ta(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 na=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]=Ji(r,e,t));for(let n of this.file.checks??[])n.formula=Ji(n.formula,e,t);for(let t of this.sheets())this.rewriteSheet(t,e)}rewriteSheet(e,t){let n=Pi(t)&&ra(e.name,t.sheet);if(e.names)for(let[n,r]of Object.entries(e.names))typeof r==`string`&&r.startsWith(`=`)&&(e.names[n]=Ji(r,t,e.name));e.cells&&=Yi(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=Ji(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=>ra(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=>ra(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(`=`)?Ji(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:Ji(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),Pi(t)&&t.sheet===e.name&&(e.links&&=zi(e.links,t),e.notes&&=zi(e.notes,t),e.pictures&&=e.pictures.flatMap(e=>{let n=Ri(e.at,t);return n===void 0?[]:[{...e,at:n}]})),e.charts&&=e.charts.map(n=>gi(n,n=>{let r=n.startsWith(`=`),i=Ji(Mr(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=>En(e).formula===void 0?e:Ji(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=Ii(t),r=[];for(let i of e.tables??[]){let e=this.rows.get(i.rows),a=e&&Xi(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(!Fi(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(Fi(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,Qi(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(Fi(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=Ut(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?ta(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=$i(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=Ii(t),r=(e.blocks??[]).flatMap(e=>{let r=Gt(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(Zi(i),1))-1,s=Vi(a,o,t);if(!s)return[];let c=n?{...r,row:s[0]}:{...r,col:s[0]};if(Fi(t)&&t.at>a&&t.at<=o){let r=t.at-a;this.rows.set(e.rows,n?Qi(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(!Fi(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:Ut(c)}]});e.blocks=r,r.length===0&&delete e.blocks}looksOn(e,t){let n=Ii(t);e.format&&=e.format.flatMap(e=>{let n=Kt(e.range);if(!n)return[e];let r=Hi(n,t);return r?[{...e,range:Wt(r)}]:[]}),e.format?.length===0&&delete e.format,e.merges&&=e.merges.flatMap(e=>{let n=Kt(e);if(!n)return[e];let r=Hi(n,t);return r?[Wt(r)]:[]}),e.merges?.length===0&&delete e.merges;let r=e=>{let n=qt(e);if(!n)return e;let r=n.flatMap(e=>{let n=Hi(e,t);return n?[Wt(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=Gt(e.at);if(!r)return e;let i=Li(n?r.row:r.col,t)??t.at;return{...e,at:Ut(n?{...r,row:i}:{...r,col:i})}}),e.filter){let r=Kt(e.filter.range),i=r&&Hi(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=Ht(e),i=r===void 0?void 0:Li(r,t);return i===void 0?[]:[[Vt(i),n]]}));e.filter={range:Wt(i),...r&&Object.keys(r).length>0?{columns:r}:{}}}}if(e.freeze!==void 0){let r=Gt(e.freeze);if(r){let i=n?r.row:r.col,a=Vi(0,i-1,t),o=i===0?0:a?a[1]+1:0;e.freeze=Ut(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:Li(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,Ht,Vt);t&&(e.columns=t)}}run(){let e=this.edit;if(Pi(e)){let t=this.sheets().find(t=>ra(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=>ra(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=>ra(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=>ra(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]))}}},ra=(e,t)=>e.toLowerCase()===t.toLowerCase();function ia(e,t){let n=new na(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 aa(e,t,n){let r=new na(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 oa=(e,t)=>e.top<=t.top&&e.left<=t.left&&e.bottom>=t.bottom&&e.right>=t.right,sa=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),ca=e=>sa(e,`formula`),la=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),ua=()=>({rows:new Map,cells:[],whole:!1}),I=e=>({...ua(),refused:e}),da=e=>En(e).formula!==void 0;function fa(e){let t=En(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 pa=e=>typeof e==`object`&&e?Object.fromEntries(Object.entries(e).filter(([e])=>e!==`value`&&e!==`formula`)):{},ma=class{book;specs=new Map;file;fileChanged=!1;grown=new Map;added=new Map;edit=ua();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 ha(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 ga(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 _a=(e,t,n)=>{let r=ar(e);return r.ok?mr(Hn(r.node,t,n)):e};function va(e,t,n,r,i,a){let o=n.at.row+1,s=e.table(t,n),c=_a(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 ya(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 ba(e,t,n,r,i){let a=i.trim();if(a===``)return I(`column-name`);if(a===r.name)return e.finish();let o=ea(n.columns.filter(e=>e!==r).map(e=>e.name),a),s=ia(t,{op:`rename-column`,table:n.name,from:r.name,to:o});return{...ua(),file:s.file,rows:new Map(s.rows),whole:!0}}function xa(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(da(a)){if(o.formula||!ya(e,n,o,s)){va(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,ta(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 Sa(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 Ca(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?ea(o,i.trim()===``?$i(o):i.trim()):$i(o);if(e.edit.whole=!0,!s&&da(i)){a.columns={...a.columns,[c]:{formula:_a(i,n.at.row+1-r,0)}};return}let l=o.length,u=ta(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 wa(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 Ta(e,t,n){return Object.keys(e.spec.cells??{}).some(e=>{if(!e.includes(`:`))return!1;let r=Kt(e);return r!==void 0&&Jt(r,t,n)})}function Ea(e,t,n,r,i){let a=e.spec(t),o=Ut({row:n,col:r}),s={...a.cells},c=s[o],l=c===void 0?{}:pa(c),u=fa(i),d=Object.keys(l).length===0,f;if(u===null){let e=Ta(t,n,r);f=!d||e,d&&!e?s=la(s,o):s[o]=d?null:l}else f=!0,s[o]=d?u:{...l,...da(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 Da(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?ba(e,t,s,o,a):void 0;xa(e,n,s,r,i,a);return}if(a!==``){let t=ha(e,n,r,i);if(t){Sa(e,t,r,i,a);return}let o=ga(n,r,i);if(o){Ca(e,n,o,r,a);return}}let c=n.blockAt(r,i);c?wa(e,n,c.file,c.area,r,i,a):Ea(e,n,r,i,a)}function Oa(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e);for(let{row:t,col:a,text:o}of[...n].sort((e,t)=>e.row-t.row||e.col-t.col)){let n=Da(i,e,r,t,a,o);if(n)return n}return i.finish()}function ka(e,t,n,r,i){let a=e.workbook.sheet(t),o=a?.tableAt(n,r);if(!a||!o)return I(`no-sheet`);let s=o.columns[r-o.at.col];if(!s)return I(`no-sheet`);let c=new ma(e);va(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*Aa(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 ja(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(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,ta(i.rows(e.file),s,t.index));let c=ca(o.columns?.[t.name]??{}),l=la(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 Aa(r,n)){if(r.tableAt(t,a)?.at.row===t)continue;let n=Da(i,e,r,t,a,``);if(n)return n}return i.finish()}function Ma(e,t){e.cells&&=Object.fromEntries(Object.entries(e.cells).filter(([e])=>{let n=Kt(e);return!n||!oa(t,n)}))}function Na(e,t,n,r,i){let a=e.workbook.sheet(t);if(!a)return I(`no-sheet`);if(!a.tables.some(e=>Yt(e.area,r))&&!a.blocks.some(e=>Yt(e.area,r))&&da(i)){let t=new ma(e),o=t.spec(a);Ma(o,r);let s=_a(i,r.top-n.row,r.left-n.col),c=Wt(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:da(i)?_a(i,e-n.row,t-n.col):i});return Oa(e,t,o)}function Pa(e,t,n,r,i){let a=e.workbook.sheet(t);if(!a)return I(`no-sheet`);let o=new ma(e),s=o.spec(a);return s.blocks=[...s.blocks??[],{at:Ut(n),rows:i}],o.edit.rows.set(i,r),o.edit.whole=!0,o.finish()}var Fa=(e,t)=>Object.keys(t).some(t=>t in e),Ia=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>!(e in t)));function La(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 Ra={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 za(e,t,n,r){for(let[t,i]of Object.entries(e.columns??{})){let e=Gt(`${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=>Yt(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 Ba(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return I(`no-sheet`);let a=new ma(e);return Va(a,i,n,r),a.finish()}function Va(e,t,n,r){let i=e.spec(t);Ha(e,t,i,n,r),Ua(i)}function Ha(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||!Fa(a,i))continue;let o=Kt(n);o&&Yt(o,r)&&(n.includes(`:`)&&!oa(r,o)&&t.push({range:n,...Object.fromEntries(Object.entries(a).filter(([e])=>e in i))}),e[n]=La(Ia(a,i)))}n.cells=e,t.length>0&&(n.format=[...n.format??[],...t])}let a=n.format??[],o=e=>{let t=Kt(e.range);return t!==void 0&&Yt(t,r)},s=a.some(e=>o(e)&&Fa(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=Vt(t),r={...Ia(e[n]??{},i),...c};e=Object.keys(r).length===0?la(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={...Ia(e[n]??{},i),...c};e=Object.keys(r).length===0?la(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={...Ia(a[t]??{},i),...c};a=Object.keys(n).length===0?la(a,t):{...a,[t]:n}}n.columns=a,Object.keys(a).length===0&&delete n.columns,e.edit.whole=!0;return}let f=Wt(r),p=a.find(e=>{let t=Kt(e.range);return t!==void 0&&Wt(t)===f}),m=(p?a.slice(a.indexOf(p)+1):[]).some(e=>o(e)&&Fa(e,i)),h={};for(let[e,s]of Object.entries(i)){let i=a.some(t=>t!==p&&o(t)&&e in t)||za(n,t,r,e);s===void 0?i&&(h[e]=Ra[e]):h[e]=s}if(p&&!m){let e={...Ia(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 Ua(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 Wa(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return I(`no-sheet`);let a=new ma(e),o=a.spec(i),s=Vt(n),c=sa(o.columns?.[s]??{},`width`),l=r===void 0?c:{...c,width:r},u=la(o.columns??{},s);return o.columns=Object.keys(l).length===0?u:{...u,[s]:l},Ua(o),a.finish()}function Ga(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return I(`no-sheet`);let a=new ma(e),o=a.spec(i),s=String(n+1),c=sa(o.rows?.[s]??{},`height`),l=r===void 0?c:{...c,height:r},u=la(o.rows??{},s);return o.rows=Object.keys(l).length===0?u:{...u,[s]:l},Ua(o),a.finish()}function Ka(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 qa(e,t,n){let r=Ka(e,n,t);if(r)return I(r);let i=ia(e,{op:`rename-sheet`,from:t,to:n});return{...ua(),file:i.file,rows:new Map(i.rows),whole:!0}}function Ja(e,t,n){let r=Ka(e,t);if(r)return I(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}),{...ua(),file:{...e.file,sheets:i},whole:!0}}function Ya(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 Xa(e,t){let n=aa(e,t,Ya(e,t));return n.refused?I(n.refused):{...ua(),file:n.file,rows:new Map(n.rows),whole:!0}}function Za(e,t){let n=ia(e,{op:`delete-sheet`,name:t});if(n.refused)return I(n.refused);let r=Qa(e.file,n.file);for(let e of r)n.rows.delete(e);return{...ua(),file:n.file,rows:new Map(n.rows),whole:!0,...r.length===0?{}:{removed:r}}}function Qa(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 $a(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),{...ua(),file:{...e.file,sheets:r},whole:!0}):I(`no-sheet`)}function eo(e,t){let n=ia(e,t);return n.refused?I(n.refused):{...ua(),file:n.file,rows:new Map(n.rows),whole:!0}}function to(e,t,n,r){if(!Dr(t)||e.workbook.name(t)||e.workbook.table(t))return I(`name-invalid`);let i=(e,t)=>`$${Vt(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{...ua(),file:{...e.file,names:{...e.file.names,[t]:`=${o}!${a}`}},whole:!0}}function no(e,t,n,r){let i=t.at(n,r);if(i===void 0)return``;if(i instanceof gr)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(yr(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 ro=e=>typeof e==`number`?0:typeof e==`string`?1:typeof e==`boolean`?2:3;function io(e,t){let n=ro(e),r=ro(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 M&&t instanceof M?e.code<t.code?-1:+(e.code>t.code):0}var ao=e=>e===null||e===``;function oo(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(ao(t)||ao(o)){if(ao(t)&&ao(o))continue;return ao(t)?1:-1}let s=io(t,o);if(s!==0)return a===!0?-s:s}return e.index-r.index}).map(e=>e.row)}function so(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=>En(e).formula===void 0?e:_a(e,u,0))}),e.edit.whole=!0}var co=(e,t,n)=>{let r=[];for(let i=e;i<=t;i++)n?.has(i)||r.push(i);return r};function lo(e,t,n,r,i,a){let o=e.workbook.sheet(n);if(!o)return I(`no-sheet`);if(i.length===0)return ua();let s=(e,n)=>t.value(o,e,n),c=o.tables.find(e=>e.rows>0&&Jt(e.area,r.top,r.left)),l=new ma(e);if(c){let{top:e,bottom:t}=c.data,n=co(e,t,a),r=oo(n,i,s);return r.every((e,t)=>e===n[t])?ua():(so(l,c,n,r,e),l.finish())}let u=co(r.top,Math.min(r.bottom,o.lastRow),a);return uo(l,e,o,r,u,oo(u,i,s)),l.finish()}function uo(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=no(t,n,a,i),o=En(r).formula===void 0?r:_a(r,c-a,0);o!==no(t,n,c,i)&&Da(e,t,n,c,i,o)}})}function fo(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 po(e){if(!/\d/u.test(e))return;let t=En(e.trim());if(typeof t.value==`number`)return t.value;if(e.trim()===``)return;let n=Pe(e);return typeof n?.value==`number`?n.value:void 0}function L(e){return typeof e==`number`?e:e==null?0:typeof e==`boolean`?+!!e:e instanceof M?e:po(e)??N.VALUE}function R(e){return typeof e==`string`?e:e==null?``:typeof e==`number`?yn(e):typeof e==`boolean`?e?`TRUE`:`FALSE`:e}function mo(e){if(typeof e==`boolean`)return e;if(e==null)return!1;if(typeof e==`number`)return e!==0;if(e instanceof M)return e;let t=e.trim().toUpperCase();return t===`TRUE`||t!==`FALSE`&&N.VALUE}var ho=e=>typeof e==`number`?0:typeof e==`string`?1:2,go=(e,t)=>e===t?!0:Math.abs(e-t)>1e-13*Math.max(Math.abs(e),Math.abs(t))?!1:Number(e.toPrecision(15))===Number(t.toPrecision(15));function _o(e,t){let n=e??(typeof t==`string`?``:typeof t!=`boolean`&&0),r=t??(typeof e==`string`?``:typeof e!=`boolean`&&0),i=ho(n),a=ho(r);if(i!==a)return i<a?-1:1;if(typeof n==`number`&&typeof r==`number`)return go(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 vo=e=>Number.isFinite(e)?e:N.NUM;function yo(e,t,n){return Math.abs(e)<=Math.max(Math.abs(t),Math.abs(n))*89e-17?0:e}function bo(e,t,n){let r=L(t);if(r instanceof M)return r;let i=L(n);if(i instanceof M)return i;switch(e){case`+`:return vo(yo(r+i,r,i));case`-`:return vo(yo(r-i,r,i));case`*`:return vo(r*i);case`/`:return i===0?N.DIV0:vo(r/i);default:return r===0&&i===0?N.NUM:r===0&&i<0?N.DIV0:vo(r**i)}}function xo(e,t,n){if(t instanceof M)return t;if(n instanceof M)return n;switch(e){case`&`:{let e=R(t);if(e instanceof M)return e;let r=R(n);return r instanceof M?r:`${e}${r}`}case`=`:return _o(t,n)===0;case`<>`:return _o(t,n)!==0;case`<`:return _o(t,n)<0;case`<=`:return _o(t,n)<=0;case`>`:return _o(t,n)>0;case`>=`:return _o(t,n)>=0;default:return bo(e,t,n)}}function So(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?N.NA:n(c,l)}return new P(r,i,a)}var Co=.1,wo={3:[0,33,67],4:[0,25,50,75],5:[0,20,40,60,80]},To=e=>{if(e!==null&&e!==``&&!(e instanceof M))return typeof e==`string`?`s${e.toLowerCase()}`:`${typeof e}${String(e)}`},Eo=e=>Math.round(e).toString(16).padStart(2,`0`);function Do(e,t,n){let r=(e,t)=>Number.parseInt(e.slice(t,t+2),16),i=i=>Eo(r(e,i)+(r(t,i)-r(e,i))*n);return`#${i(1)}${i(3)}${i(5)}`.toUpperCase()}function Oo(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 ko(e,t,n,r){if(t instanceof M)return!1;let i=()=>Oo(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&&Oo(t,r)<=0;return e===`notBetween`?!n:n}}}var Ao=e=>e===null||e instanceof M?``:typeof e==`boolean`?e?`TRUE`:`FALSE`:String(e);function jo(e,t,n){if(t instanceof M)return!1;let r=Ao(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 Mo(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 No(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 Po=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=To(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=En(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 P?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 No(a,(l??i)/100);default:return l??i}}whether(e,t,n,r){let{spec:i}=e;switch(i.type){case`cellIs`:return ko(i.operator,t,this.boundAt(e,i.formula[0],n,r),this.boundAt(e,i.formula[1],n,r));case`containsText`:return jo(i.operator,t,i.text);case`duplicateValues`:case`uniqueValues`:{let n=To(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 mo(i instanceof P?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 Do(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?Co:Co+.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??(wo[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=>Jt(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={...Mo(n),...a.look},n.stop===!0))break}return a}},Fo=`#00A651`,Io=`#FFC000`,Lo=`#E03C32`,Ro=`#7F7F7F`,zo=`#000000`,Bo=`#2F75B5`,Vo=e=>e===3?[Lo,Io,Fo]:e===4?[zo,Lo,Io,Fo]:[Lo,`#ED7D31`,Io,`#92D050`,Fo];function Ho(e,t){let n=Number.parseInt(e,10),r=Vo(n)[t]??Ro,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`?Ro: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:Bo,level:t+1}:i===`Quarters`?{shape:`quarter`,color:Ro,level:t}:i===`RedToBlack`?{shape:`circle`,color:[`#000000`,`#7F7F7F`,`#F4B6B6`,`#E03C32`][t]??Ro}:{shape:`circle`,color:r}}var Uo=e=>e.separator??`, `;function Wo(e,t){let n=Uo(t);return e.split(n.trim()===``?n:n.trim()).map(e=>e.trim()).filter(e=>e!==``)}var Go=(e,t)=>e.join(Uo(t));function Ko(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=>Yr(e,void 0);return c instanceof P?c.data.map(l).filter(e=>e!==``):c===null?[]:[l(c)]}function qo(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 P?n.at(0,0):n}if(typeof o==`number`)return o;let c=En(o);return c.formula===void 0?c.value:null}function Jo(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 gr);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}]),mo(l instanceof P?l.at(0,0):l)===!0}function Yo(e,t,n,r,i,a){let{spec:o}=n;if(a===null||a===``)return o.blank!==!1;if(a instanceof M)return!1;let s=o.operator??`between`,c=a=>qo(e,t,n,a,r,i);switch(o.type){case`list`:{let s=Yr(a,void 0),c=Ko(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?Wo(s,o).every(l):l(s)}case`custom`:return Jo(e,t,n,r,i,a);case`textLength`:return ko(s,(typeof a==`string`?a:Yr(a)).length,c(0),c(1));case`whole`:return typeof a==`number`&&Number.isInteger(a)&&ko(s,a,c(0),c(1));case`time`:return typeof a==`number`&&a>=0&&a<1&&ko(s,a,c(0),c(1));default:return typeof a==`number`&&ko(s,a,c(0),c(1))}}function Xo(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 Zo(e,t){let n=[];for(let r of e.sheets)for(let e of r.validations)for(let i of e.areas)Xo(r,i,(i,a)=>{let o=t.value(r,i,a);Yo(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 Qo=(e,t,n,r)=>Yr(t.value(e,n,r),e.lookAt(n,r).format),$o=(e,t)=>{if(t===``)return e.blanks===!0;let n=t.toLowerCase();return e.values?.some(e=>e.toLowerCase()===n)===!0};function es(e,t,n,r){let i=e.validations.length===0?void 0:e.validationAt(t,n);return i?.spec.multiple===!0?Wo(r,i.spec):[r]}function ts(e,t,n,r,i){for(let[a,o]of n.columns){if(a===i)continue;let n=Qo(e,t,r,a);if(n===``){if(o.blanks!==!0)return!1}else if(!es(e,r,a,n).some(e=>$o(o,e)))return!1}return!0}function ns(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++)ts(e,t,r,a)||n.add(a)}return n}function rs(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(!ts(e,t,n,c,r))continue;let s=Qo(e,t,c,r);if(s===``){o+=1;continue}let l=es(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||$o(i,n),value:l.length>1?n:t.value(e,c,r)})}}return{values:[...a.values()].sort((e,t)=>io(e.value,t.value)),blanks:o===0?void 0:{count:o,on:i===void 0||i.blanks===!0}}}function is(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 as=new Map,os=255;function ss(e){let t=/^([vr?]*)(?:\(([vr]+)\))?$/u.exec(e),n=t?.[1];if(n===void 0||(n.match(/\?/gu)??[]).length>1)throw Error(`"${e}" is not a signature.`);let r=e=>Array.from({length:e.length},(t,n)=>e.charAt(n)===`v`?`value`:`whole`),i=r(n.replace(`?`,``)),a=r(t?.[2]??``),o=n.indexOf(`?`);return{fixed:i,group:a,min:o>=0?o:i.length+a.length,max:a.length>0?os:i.length}}function cs(e,t){return t<e.fixed.length?e.fixed[t]??`whole`:e.group.length===0?`whole`:e.group[(t-e.fixed.length)%e.group.length]??`whole`}function ls(e,t){return e.group.length===0||t<=e.fixed.length||(t-e.fixed.length)%e.group.length===0}function z(e,t,n,r,i={}){as.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 B(e,t,n,r={}){let{min:i,max:a,fixed:o,group:s}=ss(t);as.set(e,{name:e,min:i,max:a,kind:`raw`,params:{fixed:o,group:s},call:n,from:r.from??`allyhub`,...r.volatile===!0?{volatile:!0}:{}})}function us(e,t,n,r){as.set(e,{name:e,min:t,max:n,kind:`lazy`,call:r,from:`allyhub`})}function ds(e,t){let n=as.get(t);n&&as.set(e,{...n,name:e})}function V(e,t){if(e instanceof M)return e;if(e instanceof Ur)return N.VALUE;if(e instanceof F){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 P)return{rows:e.rows,cols:e.cols,at:(t,n)=>e.at(t,n)};if(e instanceof Wr)return N.VALUE;let n=e instanceof Gr?null:e;return{rows:1,cols:1,at:()=>n}}function fs(e,t,n){for(let r of e)if(r instanceof F)t.calc.each(r,e=>{n(e,!1)});else if(r instanceof Ur)for(let e of r.parts)t.calc.each(e,e=>{n(e,!1)});else if(r instanceof P)for(let e of r.data)e!==null&&n(e,!1);else r instanceof Gr?n(null,!0):r instanceof Wr?n(N.VALUE,!0):n(r,!0)}function ps(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 F)r(t);else if(t instanceof Ur)t.parts.forEach(r);else if(t instanceof P)for(let e of t.data)n(e,!1);else t instanceof Gr?n(null,!0):t instanceof Wr?n(N.VALUE,!0):n(t,!0)}function ms(e,t){let n=[],r;return fs(e,t,(e,t)=>{if(!r){if(e instanceof M)r=e;else if(typeof e==`number`)n.push(e);else if(t){let t=L(e);t instanceof M?r=t:n.push(t)}}}),r??n}function hs(e,t){let n=[],r;return fs(e,t,(e,t)=>{if(!r){if(e instanceof M)r=e;else if(typeof e==`number`)n.push(e);else if(typeof e==`boolean`)n.push(+!!e);else if(t){let t=L(e);t instanceof M?r=t:n.push(t)}else typeof e==`string`&&n.push(0)}}),r??n}var gs=e=>(...t)=>{let n=[];for(let e of t){let t=L(e);if(t instanceof M)return t;n.push(t)}return e(...n)};function _s(e,t){return e===void 0?t:L(e)}var vs=(e,t)=>e?t.calc.eval(e,t.frame):!1;function ys(e,t,n){if(!(e instanceof P))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):N.NA}function bs(e,t,n){let r=[e,...t].filter(e=>e instanceof P),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(ys(e,r,i));o[r*a+i]=s instanceof M?s:ys(t[s]??N.VALUE,r,i)}return new P(i,a,o)}us(`IF`,1,3,(e,t)=>{let n=t.calc.flat(vs(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 Gr?0:i};if(n instanceof P){let i=n=>n<e.length&&t.calc.flat(r(n));return bs(n,[i(1),i(2)],e=>{let t=mo(e);return t instanceof M?t:+!t})}let i=mo(n);return i instanceof M?i:r(i?1:2)}),us(`IFS`,2,255,(e,t)=>{for(let n=0;n+1<e.length;n+=2){let r=mo(t.calc.scalar(vs(e[n],t),t.frame));if(r instanceof M)return r;if(r)return vs(e[n+1],t)}return N.NA});var xs=e=>(t,n)=>{let r=n.calc.flat(vs(t[0],n)),i=t=>t instanceof M&&(e===void 0||t===e),a=()=>t[1]?n.calc.flat(n.calc.eval(t[1],n.frame)):``;return r instanceof P?bs(r,[r,a()],e=>+!!i(e)):i(r)?a():r};us(`IFERROR`,2,2,xs()),us(`IFNA`,2,2,xs(N.NA)),us(`CHOOSE`,2,255,(e,t)=>{let n=t.calc.flat(vs(e[0],t));if(n instanceof P){let r=e.slice(1).map(e=>t.calc.flat(t.calc.eval(e,t.frame)));return bs(n,r,e=>{let t=L(e);if(t instanceof M)return t;let n=Math.trunc(t)-1;return n<0||n>=r.length?N.VALUE:n})}let r=L(n);if(r instanceof M)return r;let i=Math.trunc(r),a=e[i];return i<1||a===void 0?N.VALUE:t.calc.eval(a,t.frame)}),us(`SWITCH`,3,255,(e,t)=>{let n=t.calc.scalar(vs(e[0],t),t.frame);if(n instanceof M)return n;let r=1;for(;r+1<e.length;r+=2){let i=t.calc.scalar(vs(e[r],t),t.frame);if(i instanceof M)return i;if(_o(n,i)===0)return vs(e[r+1],t)}return r<e.length?vs(e[r],t):N.NA});function Ss(e,t){let n=[],r;return fs(e,t,(e,t)=>{if(r)return;if(e instanceof M){r=e;return}if(typeof e==`string`&&!t||e===null)return;let i=mo(e);i instanceof M?r=i:n.push(i)}),r||(n.length===0?N.VALUE:n)}B(`AND`,`(r)`,(e,t)=>{let n=Ss(e,t);return n instanceof M?n:n.every(Boolean)}),B(`OR`,`(r)`,(e,t)=>{let n=Ss(e,t);return n instanceof M?n:n.some(Boolean)}),B(`XOR`,`(r)`,(e,t)=>{let n=Ss(e,t);return n instanceof M?n:n.filter(Boolean).length%2==1}),z(`NOT`,1,1,e=>{let t=mo(e);return t instanceof M?t:!t}),B(`TRUE`,``,()=>!0),B(`FALSE`,``,()=>!1);var Cs=(e,t)=>t?{names:e,parent:t}:{names:e};us(`LET`,3,255,(e,t)=>{if(e.length%2==0)return N.VALUE;let n=new Map,r={...t.frame,scope:Cs(n,t.frame.scope)};for(let i=0;i+1<e.length;i+=2){let a=e[i];if(a?.kind!==`name`)return N.VALUE;n.set(a.name.toLowerCase(),vs(e[i+1],{...t,frame:r}))}return vs(e[e.length-1],{...t,frame:r})}),us(`LAMBDA`,1,254,(e,t)=>{let n=[];for(let t of e.slice(0,-1)){if(t.kind!==`name`)return N.VALUE;n.push(t.name.toLowerCase())}let r=e[e.length-1];return r?new Wr(n,r,t.frame):N.VALUE});function ws(e){let t=0;for(let n of e)t=yo(t+n,t,n);return t}B(`SUM`,`(r)`,(e,t)=>{let n=0,r;return fs(e,t,(e,i)=>{if(!r){if(typeof e==`number`)n=yo(n+e,n,e);else if(e instanceof M)r=e;else if(i){let i=ms([e],t);i instanceof M?r=i:n+=i[0]??0}}}),r??vo(n)}),B(`AVERAGE`,`(r)`,(e,t)=>{let n=ms(e,t);return n instanceof M?n:n.length===0?N.DIV0:ws(n)/n.length}),B(`AVERAGEA`,`(r)`,(e,t)=>{let n=hs(e,t);return n instanceof M?n:n.length===0?N.DIV0:ws(n)/n.length}),B(`COUNT`,`(r)`,(e,t)=>{let n=0;return fs(e,t,(e,r)=>{typeof e==`number`?n+=1:r&&!(e instanceof M)&&e!==null&&(ms([e],t)instanceof M||(n+=1))}),n}),B(`COUNTA`,`(r)`,(e,t)=>{let n=0;return fs(e,t,()=>{n+=1}),n}),B(`COUNTBLANK`,`r`,(e,t)=>{let n=e[0];if(n instanceof M)return n;if(n instanceof F){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 P?r.data.filter(e=>e===null||e===``).length:+(r===null||r===``)});var Ts=e=>t=>{if(t instanceof M)return t;if(t.length===0)return 0;let n=t[0]??0;for(let r of t)n=e(n,r);return n},Es=Ts((e,t)=>t<e?t:e),Ds=Ts((e,t)=>t>e?t:e);B(`MIN`,`(r)`,(e,t)=>Es(ms(e,t))),B(`MAX`,`(r)`,(e,t)=>Ds(ms(e,t))),B(`MINA`,`(r)`,(e,t)=>Es(hs(e,t))),B(`MAXA`,`(r)`,(e,t)=>Ds(hs(e,t))),B(`PRODUCT`,`(r)`,(e,t)=>{let n=ms(e,t);return n instanceof M?n:n.length===0?0:vo(n.reduce((e,t)=>e*t,1))}),B(`SUMSQ`,`(r)`,(e,t)=>{let n=ms(e,t);return n instanceof M?n:vo(ws(n.map(e=>e*e)))}),B(`SUMPRODUCT`,`(r)`,(e,t)=>{let n=e.map(e=>V(e,t)),r=n[0];if(r===void 0||r instanceof M)return r??N.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 M)return e;if(e.cols!==a||o(e)!==o(r))return N.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 M)return n;r*=typeof n==`number`?n:0}s+=r}return vo(s)});var Os={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 ks(e){if(!(e instanceof gr))return!1;let{node:t}=e.shared;return t?.kind===`call`&&t.name===`SUBTOTAL`}B(`SUBTOTAL`,`v(r)`,(e,t)=>{let n=t.calc.scalar(e[0],t.frame);if(n instanceof M)return n;if(typeof n!=`number`)return N.VALUE;let r=n<100,i=Os[r?n:n-100],a=i===void 0?void 0:as.get(i);if(a?.kind!==`raw`)return N.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(ks(e.sheet.at(o,n))?null:t.calc.read(e.sheet,o,n));o.push(new P(a.length,1,a))};for(let t of e.slice(1)){if(t instanceof M)return t;if(t instanceof F)s(t);else if(t instanceof Ur)t.parts.forEach(s);else return N.VALUE}return a.call(o,t)});var As=e=>({top:e.top,left:e.left,bottom:e.bottom,right:e.right}),js=class{kept=new Map;of(e,t,n){let r=this.kept.get(e);if(r)return r.value;let i=n();return this.kept.set(e,{over:t.map(e=>({sheet:e.sheet,area:As(e)})),value:i}),i}get(e){return this.kept.get(e)?.value}set(e,t,n){this.kept.set(e,{over:t.map(e=>({sheet:e.sheet,area:As(e)})),value:n})}changed(e,t){if(this.kept.size!==0)for(let[n,r]of this.kept)r.over.some(n=>n.sheet===e&&Yt(n.area,t))&&this.kept.delete(n)}clear(){this.kept.clear()}},Ms=(e,t)=>`${e}:${t.key}`;function Ns(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 Ps(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 Fs=e=>/[*?~]/u.test(e);function Is(e){return t=>{if(typeof t==`number`)return go(t,e);if(typeof t!=`string`)return!1;let n=po(t);return n!==void 0&&go(n,e)}}function Ls(e,t){let n=t=>e===`>`?t>0:e===`>=`?t>=0:e===`<`?t<0:t<=0;return e=>typeof e==typeof t&&n(_o(e,t))}function Rs(e){if(e===null)return{test:Is(0),key:`n0`};if(typeof e==`number`)return{test:Is(e),key:`n${String(Number(e.toPrecision(15)))}`};if(typeof e==`boolean`)return{test:t=>t===e,key:e?`bT`:`bF`};if(e instanceof M)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=po(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=Is(a),t=Ns(a);else if(o!==void 0)e=e=>e===o,t=Ns(o);else if(r.startsWith(`#`))e=e=>e instanceof M&&e.code===r.toUpperCase();else if(Fs(r)){let t=Ps(r);e=e=>typeof e==`string`&&t(e)}else{let n=r.toUpperCase();e=e=>typeof e==`string`&&e.toUpperCase()===n,t=Ns(r)}return n===`=`?t===void 0?{test:e}:{test:e,key:t}:{test:t=>!e(t)}}return{test:Ls(n,s??r)}}function zs(e,t){let n=e.reference;if(!(n?.cols!==1||e.rows<64))return t.calc.indexes.of(Ms(`crit`,n),[n],()=>{let t=new Map,n=(e,n)=>{if(e===void 0)return;let r=t.get(e);r?r.push(n):t.set(e,[n])};for(let t=0;t<e.rows;t++){let r=e.at(t,0);if(n(Ns(r),t),typeof r==`string`){let e=po(r);e!==void 0&&n(Ns(e),t)}}return t})}function Bs(e,t){return Rs(t.calc.scalar(e,t.frame))}function Vs(e,t){let n=[];for(let r=0;r+1<e.length;r+=2){let i=V(e[r],t);if(i instanceof M)return i;let a=Bs(e[r+1],t);if(a instanceof M)return a;n.push({cells:i,crit:a})}let r=n[0]?.cells;return r&&n.some(e=>!Hs(e.cells,r))?N.VALUE:n}var Hs=(e,t)=>e.cols===t.cols&&(e.reference?.rows??e.rows)===(t.reference?.rows??t.rows);function Us(e,t,n){let r=e[0];if(!r)return;let i,a;for(let n of e){if(n.crit.key===void 0)continue;let e=zs(n.cells,t);if(!e)continue;let r=e.get(n.crit.key)??[];(i===void 0||r.length<i.length)&&(i=r,a=n)}if(i!==void 0){let t=e.filter(e=>e!==a);for(let e of i)t.every(t=>t.crit.test(t.cells.at(e,0)))&&n(e,0);return}let o=Math.max(...e.map(e=>e.cells.rows));for(let t=0;t<o;t++)for(let i=0;i<r.cells.cols;i++)e.every(e=>e.crit.test(e.cells.at(t,i)))&&n(t,i)}function Ws(e,t){return e instanceof F?(e.rows-t.rows)*e.cols:0}function Gs(e,t,n,r){let i;return Us(t,n,(t,n)=>{if(i)return;let a=e.at(t,n);a instanceof M?i=a:typeof a==`number`&&r(a)}),i}function Ks(e,t){let n=V(e[0],t);if(n instanceof M)return n;let r=e[2];return r===void 0?n:V(r,t)}var qs=e=>(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;let i=Bs(t[1],n);if(i instanceof M)return i;let a=Ks(t,n);if(a instanceof M)return a;let o=[];return Gs(a,[{cells:r,crit:i}],n,e=>{o.push(e)})??e(o)},Js=e=>(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;let i=Vs(t.slice(1),n);if(i instanceof M)return i;let a=i[0]?.cells;if(a&&!Hs(r,a))return N.VALUE;let o=[];return Gs(r,i,n,e=>{o.push(e)})??e(o)},Ys=(e,t)=>(n,r)=>{let i=[],a=[e];for(let e of n)if(e instanceof F)i.push(e),a.push(`r${e.key}`);else if(e instanceof Gr)a.push(`-`);else if(e instanceof M)a.push(`e${e.code}`);else if(typeof e!=`object`||!e)a.push(`${typeof e}:${String(e)}`);else return t(n,r);if(i.length===0)return t(n,r);let o=a.join(`\0`),s=r.calc.results.get(o);if(s!==void 0)return s;let c=t(n,r);return(typeof c!=`object`||!c||c instanceof M)&&r.calc.results.set(o,i,c),c},Xs=e=>e.reduce((e,t)=>e+t,0),Zs=e=>e.length===0?N.DIV0:Xs(e)/e.length;B(`SUMIF`,`rv?r`,Ys(`SUMIF`,qs(Xs))),B(`AVERAGEIF`,`rv?r`,Ys(`AVERAGEIF`,qs(Zs))),B(`SUMIFS`,`r(rv)`,Ys(`SUMIFS`,Js(Xs))),B(`AVERAGEIFS`,`r(rv)`,Ys(`AVERAGEIFS`,Js(Zs))),B(`MINIFS`,`r(rv)`,Ys(`MINIFS`,Js(e=>e.length===0?0:e.reduce((e,t)=>t<e?t:e)))),B(`MAXIFS`,`r(rv)`,Ys(`MAXIFS`,Js(e=>e.length===0?0:e.reduce((e,t)=>t>e?t:e)))),B(`COUNTIF`,`rv`,Ys(`COUNTIF`,(e,t)=>{let n=V(e[0],t);if(n instanceof M)return n;let r=Bs(e[1],t);if(r instanceof M)return r;let i=0;return Us([{cells:n,crit:r}],t,()=>{i+=1}),i+(r.test(null)?Ws(e[0],n):0)})),B(`COUNTIFS`,`(rv)`,Ys(`COUNTIFS`,(e,t)=>{let n=Vs(e,t);if(n instanceof M)return n;let r=0;return Us(n,t,()=>{r+=1}),r}));var Qs=(e,t)=>typeof e==typeof t&&!(e instanceof M)&&e!==null;function $s(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 ec(e,t,n,r,i,a=0,o=1){let s=typeof e==`string`?e:void 0;if(i&&s!==void 0&&Fs(s)){let e=Ps(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=Ns(e);if(c===void 0)return-1;let l=n.reference;if(l&&t.length>=64&&a===0&&o===1)return r.calc.indexes.of(Ms(`find`,l),[l],()=>{let e=new Map;for(let n=t.length-1;n>=0;n--){let r=Ns(t.at(n));r!==void 0&&e.set(r,[n])}return e}).get(c)?.[0]??-1;for(let e=a;e>=0&&e<t.length;e+=o)if(Ns(t.at(e))===c)return e;return-1}function tc(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&&!Qs(t.at(s),e);)--s;if(s<r){r=o+1;continue}let c=_o(t.at(s),e);(n?c>=0:c<=0)?(a=s,r=o+1):i=s-1}return a}var nc=(e,t)=>t.calc.scalar(e??null,t.frame),rc=(e,t,n)=>e===void 0||e instanceof Gr?n:mo(t.calc.scalar(e,t.frame));function ic(e){return(t,n)=>{let r=nc(t[0],n);if(r instanceof M)return r;let i=V(t[1],n);if(i instanceof M)return i;let a=L(n.calc.scalar(t[2],n.frame));if(a instanceof M)return a;let o=Math.trunc(a);if(o<1)return N.VALUE;if(o>(e?i.cols:i.rows))return N.REF;let s=rc(t[3],n,!0);if(s instanceof M)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 F(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?tc(r,c):ec(r,c,l,n,!0);return u<0?N.NA:e?i.at(u,o-1):i.at(o-1,u)}}B(`VLOOKUP`,`vrv?v`,ic(!0)),B(`HLOOKUP`,`vrv?v`,ic(!1)),B(`MATCH`,`vr?v`,(e,t)=>{let n=nc(e[0],t);if(n instanceof M)return n;let r=V(e[1],t);if(r instanceof M)return r;let i=$s(r);if(!i)return N.NA;let a=e[2]===void 0||e[2]instanceof Gr?1:L(t.calc.scalar(e[2],t.frame));if(a instanceof M)return a;let o=a===0?ec(n,i,r,t,!0):tc(n,i,a<0);return o<0?N.NA:o+1}),B(`LOOKUP`,`vr?r`,(e,t)=>{let n=nc(e[0],t);if(n instanceof M)return n;let r=V(e[1],t);if(r instanceof M)return r;let i=r.rows>=r.cols,a=tc(n,{length:i?r.rows:r.cols,at:e=>i?r.at(e,0):r.at(0,e)});if(a<0)return N.NA;if(e[2]===void 0)return i?r.at(a,r.cols-1):r.at(r.rows-1,a);let o=V(e[2],t);if(o instanceof M)return o;let s=$s(o);return s?s.at(a):N.NA});function ac(e,t,n,r,i){let a=$s(t);if(!a)return-1;let o=i===-1;if(Math.abs(i)===2){let t=tc(e,a,i<0);if(t>=0&&_o(a.at(t),e)===0)return t;if(r===0)return-1}let s=ec(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(!Qs(n,e))continue;let i=_o(n,e),o=c<0||(r<0?_o(n,a.at(c))>0:_o(n,a.at(c))<0);(r<0?i<0:i>0)&&o&&(c=t)}return c}var oc=(e,t,n)=>{let r=(e,t)=>e===void 0||e instanceof Gr?t:L(n.calc.scalar(e,n.frame)),i=r(e,0);if(i instanceof M)return i;let a=r(t,1);return a instanceof M?a:[i,a]};B(`XLOOKUP`,`vrr?rvv`,(e,t)=>{let n=nc(e[0],t);if(n instanceof M)return n;let r=V(e[1],t);if(r instanceof M)return r;let i=V(e[2],t);if(i instanceof M)return i;let a=oc(e[4],e[5],t);if(a instanceof M)return a;let o=ac(n,r,t,a[0],a[1]);if(o<0){let n=e[3];return n===void 0||n instanceof Gr?N.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 P(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 P(i.rows,1,s)}),B(`XMATCH`,`vr?vv`,(e,t)=>{let n=nc(e[0],t);if(n instanceof M)return n;let r=V(e[1],t);if(r instanceof M)return r;let i=oc(e[2],e[3],t);if(i instanceof M)return i;let a=ac(n,r,t,i[0],i[1]);return a<0?N.NA:a+1}),B(`INDEX`,`rv?vv`,(e,t)=>{let n=e[0],r=e=>{if(e===void 0||e instanceof Gr)return 0;let n=L(t.calc.scalar(e,t.frame));return n instanceof M?n:Math.trunc(n)};if(n instanceof Ur){let t=r(e[3]??1);if(t instanceof M)return t;let i=n.parts[t-1];if(!i)return N.REF;n=i}if(n instanceof M)return n;let i=r(e[1]);if(i instanceof M)return i;let a=r(e[2]);if(a instanceof M)return a;if(i<0||a<0)return N.VALUE;if(n instanceof F){let t=e[2]===void 0&&n.rows===1,r=t?1:i,o=t?i:a;return r>n.rows||o>n.cols?N.REF:new F(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=V(n,t);if(o instanceof M)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 N.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 P(u,d,f)}),B(`OFFSET`,`rvv?vv`,(e,t)=>{let n=e[0];if(n instanceof M)return n;if(!(n instanceof F))return N.VALUE;let r=(e,n)=>{if(e===void 0||e instanceof Gr)return n;let r=L(t.calc.scalar(e,t.frame));return r instanceof M?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 M)return e;let[c,l,u,d]=[i,a,o,s];if(u===0||d===0)return N.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?N.REF:new F(n.sheet,Math.min(f,m),Math.min(p,h),Math.max(f,m),Math.max(p,h))},{volatile:!0});var sc=/^(?:(.*)!)?R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?(?::R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?)?$/iu,cc=(e,t)=>e===void 0?t:e.startsWith(`[`)?t+Number(e.slice(1,-1)):Number(e)-1;function lc(e,t,n){let r=sc.exec(e.trim());if(!r)return;let[,i,a,o,s,c]=r,l={row:cc(a,t),col:cc(o,n)};if(l.row<0||l.col<0)return;let u=Ut(l),d=i===void 0?``:`${i}!`;if(s===void 0&&c===void 0)return`${d}${u}`;let f={row:cc(s,t),col:cc(c,n)};return f.row<0||f.col<0?void 0:`${d}${u}:${Ut(f)}`}B(`INDIRECT`,`v?v`,(e,t)=>{let n=R(t.calc.scalar(e[0],t.frame));if(n instanceof M)return n;let r=e[1]===void 0||mo(t.calc.scalar(e[1],t.frame));if(r instanceof M)return r;let i=r?n:lc(n,t.frame.row,t.frame.col);if(i===void 0)return N.REF;let a=ar(i);if(!a.ok)return N.REF;let{node:o}=a;if(o.kind!==`ref`&&o.kind!==`structured`&&o.kind!==`name`&&(o.kind!==`binary`||o.op!==`:`))return N.REF;let s=t.calc.eval(o,{...t.frame,dr:0,dc:0});return s instanceof F||s instanceof Ur?s:N.REF},{volatile:!0});var uc=(e,t,n)=>{if(e===void 0||e instanceof Gr)return t+1;if(e instanceof M)return e;if(!(e instanceof F))return N.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===dc?new P(i,1,a):new P(1,i,a)},dc=e=>[e.top,Math.min(e.rows,e.sheet.lastRow-e.top+1)],fc=e=>[e.left,e.cols];B(`ROW`,`?r`,(e,t)=>uc(e[0],t.frame.row,dc)),B(`COLUMN`,`?r`,(e,t)=>uc(e[0],t.frame.col,fc)),B(`ROWS`,`r`,(e,t)=>{let n=e[0];if(n instanceof F)return n.rows;let r=V(n,t);return r instanceof M?r:r.rows}),B(`COLUMNS`,`r`,(e,t)=>{let n=e[0];if(n instanceof F)return n.cols;let r=V(n,t);return r instanceof M?r:r.cols}),B(`AREAS`,`r`,e=>{let t=e[0];return t instanceof F?1:t instanceof Ur?t.parts.length:N.VALUE}),z(`ADDRESS`,2,5,(e,t,n,r,i)=>{let a=L(e),o=L(t),s=n==null?1:L(n);for(let e of[a,o,s])if(e instanceof M)return e;let[c,l,u]=[a,o,s];if((c??0)<1||(l??0)<1||(c??0)>1048576||(l??0)>16384)return N.VALUE;let d=r==null||mo(r);if(d instanceof M)return d;let f=u===1||u===2,p=u===1||u===3,m=d?`${p?`$`:``}${Vt((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=R(i);return h instanceof M?h:`${cr(h)}${m}`}),B(`TRANSPOSE`,`r`,(e,t)=>{let n=V(e[0],t);if(n instanceof M)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 P(n.cols,n.rows,r)}),us(`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 F)return r.sheet.index+1;let i=t.calc.scalar(r,t.frame);if(typeof i!=`string`)return N.NA;let a=t.calc.wb.sheet(i);return a?a.index+1:N.NA}),B(`SHEETS`,`?r`,(e,t)=>t.calc.wb.sheets.length);var pc=(e,t)=>Array.from(e,e=>{let n=t(e);return n.length===e.length?n:e}).join(``),mc=e=>pc(e,e=>e.toLowerCase());function hc(e,t){if(e===void 0||e instanceof Gr)return[];let n=V(e,t);if(n instanceof M)return n;let r=[];for(let e=0;e<n.rows;e++)for(let t=0;t<n.cols;t++){let i=n.at(e,t);if(i===null)continue;let a=R(i);if(a instanceof M)return a;r.push(a)}return r}function gc(e,t,n){let r=n?mc(e):e,i=(n?t.map(mc):[...t]).filter(e=>e!==``).sort((e,t)=>t.length-e.length),a=[];if(i.length===0)return a;let o=0;for(;o<e.length;){let e=i.find(e=>r.startsWith(e,o));e===void 0?o+=1:(a.push({at:o,length:e.length}),o+=e.length)}return a}function _c(e,t,n){let r=[],i=0;for(let a of gc(e,t,n))r.push(e.slice(i,a.at)),i=a.at+a.length;return r.push(e.slice(i)),r}var vc=e=>t=>{let n=R(t);return n instanceof M?n:e(n)},yc=(e,t)=>{if(e===void 0)return t;let n=L(e);return n instanceof M?n:n<0?N.VALUE:Math.trunc(n)},bc=e=>pc(e,e=>e.toUpperCase()),xc=mc;z(`LEFT`,1,2,(e,t)=>{let n=R(e),r=yc(t,1);return n instanceof M?n:r instanceof M?r:n.slice(0,r)}),z(`RIGHT`,1,2,(e,t)=>{let n=R(e),r=yc(t,1);return n instanceof M?n:r instanceof M?r:r===0?``:n.slice(-r)}),z(`MID`,3,3,(e,t,n)=>{let r=R(e),i=L(t),a=yc(n,0);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)return a;if(i<1)return N.VALUE;let o=Math.trunc(i)-1;return r.slice(o,o+a)}),z(`LEN`,1,1,vc(e=>e.length)),z(`LOWER`,1,1,vc(xc)),z(`UPPER`,1,1,vc(bc)),z(`PROPER`,1,1,vc(e=>xc(e).replace(/(^|[^\p{L}])(\p{L})/gu,(e,t,n)=>`${t}${bc(n)}`))),z(`TRIM`,1,1,vc(e=>e.replace(/ +/gu,` `).replace(/^ | $/gu,``))),z(`CLEAN`,1,1,vc(e=>e.replace(/[\u0000-\u001f]/gu,``))),z(`T`,1,1,e=>typeof e==`string`?e:``),z(`EXACT`,2,2,(e,t)=>{let n=R(e),r=R(t);return n instanceof M?n:r instanceof M?r:n===r}),z(`REPT`,2,2,(e,t)=>{let n=R(e),r=yc(t,0);return n instanceof M?n:r instanceof M?r:n.length*r>32767?N.VALUE:n.repeat(r)}),z(`CHAR`,1,1,gs(e=>{let t=Math.trunc(e);return t<1||t>255?N.VALUE:Cc(t)})),z(`UNICHAR`,1,1,gs(e=>{let t=Math.trunc(e);return t<1||t>1114111?N.VALUE:String.fromCodePoint(t)})),z(`CODE`,1,1,vc(e=>e===``?N.VALUE:e.charCodeAt(0))),z(`UNICODE`,1,1,vc(e=>e.codePointAt(0)??N.VALUE));var Sc=`€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ`;function Cc(e){return e>=128&&e<160?Sc.charAt(e-128):String.fromCharCode(e)}B(`CONCAT`,`(r)`,(e,t)=>{let n=``,r;return ps(e,t,e=>{if(r)return;let t=R(e);t instanceof M?r=t:n+=t}),r??n}),z(`CONCATENATE`,1,255,(...e)=>{let t=``;for(let n of e){let e=R(n);if(e instanceof M)return e;t+=e}return t}),B(`TEXTJOIN`,`rv(r)`,(e,t)=>{let[n,r,...i]=e,a=V(n??``,t);if(a instanceof M)return a;let o=[];for(let e=0;e<a.rows;e++)for(let t=0;t<a.cols;t++){let n=R(a.at(e,t));if(n instanceof M)return n;o.push(n)}let s=mo(t.calc.scalar(r??!0,t.frame));if(s instanceof M)return s;let c=[],l;if(ps(i,t,e=>{if(l)return;let t=R(e);t instanceof M?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}),z(`SUBSTITUTE`,3,4,(e,t,n,r)=>{let i=R(e),a=R(t),o=R(n);if(i instanceof M)return i;if(a instanceof M)return a;if(o instanceof M)return o;if(a===``)return i;if(r===void 0)return i.split(a).join(o);let s=L(r);if(s instanceof M)return s;if(s<1)return N.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)}`}),z(`REPLACE`,4,4,(e,t,n,r)=>{let i=R(e),a=L(t),o=yc(n,0),s=R(r);if(i instanceof M)return i;if(a instanceof M)return a;if(o instanceof M)return o;if(s instanceof M)return s;if(a<1)return N.VALUE;let c=Math.trunc(a)-1;return`${i.slice(0,c)}${s}${i.slice(c+o)}`}),z(`FIND`,2,3,(e,t,n)=>{let r=R(e),i=R(t),a=n===void 0?1:L(n);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)return a;if(a<1||a>i.length+1)return N.VALUE;let o=i.indexOf(r,Math.trunc(a)-1);return o<0?N.VALUE:o+1}),z(`SEARCH`,2,3,(e,t,n)=>{let r=R(e),i=R(t),a=n===void 0?1:L(n);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)return a;if(a<1||a>i.length+1)return N.VALUE;let o=Math.trunc(a)-1,s=Ps(`${r}*`);for(let e=o;e<=i.length;e++)if(s(i.slice(e)))return e+1;return N.VALUE}),z(`VALUE`,1,1,e=>typeof e==`number`?e:e==null?0:typeof e==`string`?po(e)??N.VALUE:N.VALUE),z(`NUMBERVALUE`,1,3,(e,t,n)=>{let r=R(e),i=R(t??`.`),a=R(n??`,`);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)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)?N.VALUE:c/100**s}),z(`TEXT`,2,2,(e,t)=>{let n=R(t);if(n instanceof M)return n;if(!Ge(n))return N.VALUE;if(typeof e==`boolean`)return e?`TRUE`:`FALSE`;let r=typeof e==`string`?po(e)??e:e??0;if(r instanceof M)return r;try{return Re(n,r)}catch{return N.VALUE}});function wc(e,t,n){let r=n?`#,##0`:`0`,i=t>0?`.${`0`.repeat(t)}`:``;return Re(`${r}${i}`,e)}var Tc=(e,t)=>{let n=10**t;return Math.sign(e)*Math.round(Math.abs(e)*n+1e-9)/n};z(`FIXED`,1,3,(e,t,n)=>{let r=L(e),i=t==null?2:L(t),a=n!==void 0&&mo(n);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)return a;let o=Math.trunc(i);return wc(Tc(r,o),Math.max(0,o),!a)}),z(`DOLLAR`,1,2,(e,t)=>{let n=L(e),r=t==null?2:L(t);if(n instanceof M)return n;if(r instanceof M)return r;let i=Math.trunc(r),a=wc(Math.abs(Tc(n,i)),Math.max(0,i),!0);return n<0?`($${a})`:`$${a}`});function Ec(e,t,n,r,i){let a=gc(e,t,r);return n>0?(i&&a.push({at:e.length,length:0}),a[n-1]):(i&&a.unshift({at:0,length:0}),a[a.length+n])}function Dc(e){return(t,n)=>{let[r,i,a,o,s,c]=t.map(e=>e instanceof Gr?void 0:e),l=R(r??null),u=hc(i,n),d=_s(a,1),f=_s(o,0),p=_s(s,0);if(l instanceof M)return l;if(u instanceof M)return u;if(d instanceof M)return d;if(f instanceof M)return f;if(p instanceof M)return p;let m=Math.trunc(d);if(m===0||Math.abs(m)>Math.max(l.length,1))return N.VALUE;if(u.length>0&&u.every(e=>e===``))return m>0==(e===`before`)?``:l;let h=Ec(l,u,m,f===1,p===1);return h?e===`before`?l.slice(0,h.at):l.slice(h.at+h.length):c===void 0?N.NA:c}}B(`TEXTBEFORE`,`vr?vvvv`,Dc(`before`)),B(`TEXTAFTER`,`vr?vvvv`,Dc(`after`)),z(`HYPERLINK`,1,2,(e,t)=>t===void 0?e??null:t),z(`ENCODEURL`,1,1,vc(e=>encodeURIComponent(e)));for(let e of[`LEN`,`LEFT`,`RIGHT`,`MID`,`FIND`,`SEARCH`,`REPLACE`])ds(`${e}B`,e);var Oc=e=>{let t=L(e);return t instanceof M?t:t<0||t>=2958466?N.NUM:Math.floor(t)},kc=e=>e%4==0&&e%100!=0||e%400==0,Ac=(e,t)=>t===2?kc(e)?29:28:[4,6,9,11].includes(t)?30:31,jc=e=>e.month===2&&e.day===Ac(e.year,2);z(`DATE`,3,3,gs((e=0,t=1,n=1)=>{let r=Math.trunc(e);if(r<0||r>9999)return N.NUM;let i=pn(r<1900?r+1900:r,Math.trunc(t),Math.trunc(n));return i<0?N.NUM:i})),z(`TIME`,3,3,gs((e=0,t=0,n=0)=>{let r=Math.trunc(e)*3600+Math.trunc(t)*60+Math.trunc(n);return r<0?N.NUM:r%86400/86400})),z(`YEAR`,1,1,e=>{let t=Oc(e);return t instanceof M?t:mn(t).year}),z(`MONTH`,1,1,e=>{let t=Oc(e);return t instanceof M?t:mn(t).month}),z(`DAY`,1,1,e=>{let t=Oc(e);return t instanceof M?t:mn(t).day});var Mc=e=>{let t=L(e);return t instanceof M?t:t<0?N.NUM:Math.round((t-Math.floor(t))*86400)%86400};z(`HOUR`,1,1,e=>{let t=Mc(e);return t instanceof M?t:Math.floor(t/3600)}),z(`MINUTE`,1,1,e=>{let t=Mc(e);return t instanceof M?t:Math.floor(t/60)%60}),z(`SECOND`,1,1,e=>{let t=Mc(e);return t instanceof M?t:t%60}),z(`DATEVALUE`,1,1,e=>{let t=R(e);if(t instanceof M)return t;let n=Ve(t)??Pe(t);return typeof n?.value==`number`?Math.floor(n.value):N.VALUE}),z(`TIMEVALUE`,1,1,e=>{let t=R(e);if(t instanceof M)return t;let n=Be(t)??Pe(t);return typeof n?.value==`number`?n.value-Math.floor(n.value):N.VALUE});var Nc=e=>(e%7+6)%7;z(`WEEKDAY`,1,2,(e,t)=>{let n=Oc(e);if(n instanceof M)return n;let r=t==null?1:L(t);if(r instanceof M)return r;let i=Nc(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:N.NUM});var Pc=e=>{let t=e-(Nc(e)+6)%7+3,{year:n}=mn(t);return Math.floor((t-pn(n,1,1))/7)+1};z(`ISOWEEKNUM`,1,1,e=>{let t=Oc(e);return t instanceof M?t:Pc(t)}),z(`WEEKNUM`,1,2,(e,t)=>{let n=Oc(e);if(n instanceof M)return n;let r=t==null?1:L(t);if(r instanceof M)return r;if(r===21)return Pc(n);let i=r===1?0:r===2?1:r>=11&&r<=17?(r-10)%7:-1;if(i<0)return N.NUM;let a=pn(mn(n).year,1,1),o=(Nc(a)+7-i)%7;return Math.floor((n-a+o)/7)+1});var Fc=(e,t)=>{let{year:n,month:r,day:i}=mn(e),a=n*12+r-1+t,o=Math.floor(a/12),s=a-o*12+1;return pn(o,s,Math.min(i,Ac(o,s)))};z(`EDATE`,2,2,(e,t)=>{let n=Oc(e),r=L(t);if(n instanceof M)return n;if(r instanceof M)return r;let i=Fc(n,Math.trunc(r));return i<0?N.NUM:i}),z(`EOMONTH`,2,2,(e,t)=>{let n=Oc(e),r=L(t);if(n instanceof M)return n;if(r instanceof M)return r;let i=mn(Fc(n,Math.trunc(r))),a=pn(i.year,i.month,Ac(i.year,i.month));return a<0?N.NUM:a}),z(`DAYS`,2,2,(e,t)=>{let n=Oc(e),r=Oc(t);return n instanceof M?n:r instanceof M?r:n-r}),z(`DATEDIF`,3,3,(e,t,n)=>{let r=Oc(e),i=Oc(t),a=R(n);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)return a;if(r>i)return N.NUM;let o=mn(r),s=mn(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 Ac(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=Fc(r,Math.floor(c/12)*12);return e>=0?i-t:N.NUM}default:return N.NUM}});function Ic(e,t,n){let r=mn(e),i=mn(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===Ac(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}z(`DAYS360`,2,3,(e,t,n)=>{let r=Oc(e),i=Oc(t),a=n!==void 0&&mo(n);return r instanceof M?r:i instanceof M?i:a instanceof M?a:Ic(r,i,a)});function Lc(e,t,n){let[r,i]=e<=t?[e,t]:[t,e],a=mn(r),o=mn(i),s=i-r;switch(n){case 0:{let e=a.day,t=o.day;return jc(a)&&(jc(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 Ic(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=kc(a.year);else{let t=e=>kc(e)?pn(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/((pn(o.year+1,1,1)-pn(a.year,1,1))/e)}}}z(`YEARFRAC`,2,3,(e,t,n)=>{let r=Oc(e),i=Oc(t),a=n==null?0:L(n);if(r instanceof M)return r;if(i instanceof M)return i;if(a instanceof M)return a;let o=Math.trunc(a);return o<0||o>4?N.NUM:Lc(r,i,o)});function Rc(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 N.VALUE;let t=e.split(``).map(e=>e===`1`);return[t[6]??!1,...t.slice(0,6)]}let n=L(e);return n instanceof M?n:n>=1&&n<=7?t((n+5)%7,(n+6)%7):n>=11&&n<=17?t(n-11):N.NUM}function zc(e,t){if(e===void 0||e instanceof Gr)return new Set;let n=ms([e],t);return n instanceof M?n:new Set(n.map(e=>Math.floor(e)))}function Bc(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[Nc(o)]!==!0&&!r.has(o)&&(a+=i);return a}function Vc(e,t,n,r){if(n.every(Boolean))return N.VALUE;let i=t<0?-1:1,a=e;for(let e=Math.abs(t);e>0;)a+=i,n[Nc(a)]!==!0&&!r.has(a)&&--e;return a<0?N.NUM:a}var Hc=e=>(t,n)=>{let r=Oc(n.calc.scalar(t[0],n.frame)),i=Oc(n.calc.scalar(t[1],n.frame));if(r instanceof M)return r;if(i instanceof M)return i;let a=e?t[2]:void 0,o=Rc(a===void 0||a instanceof Gr?void 0:n.calc.scalar(a,n.frame));if(o instanceof M)return o;let s=zc(t[e?3:2],n);return s instanceof M?s:Bc(r,i,o,s)},Uc=e=>(t,n)=>{let r=Oc(n.calc.scalar(t[0],n.frame)),i=L(n.calc.scalar(t[1],n.frame));if(r instanceof M)return r;if(i instanceof M)return i;let a=e?t[2]:void 0,o=Rc(a===void 0||a instanceof Gr?void 0:n.calc.scalar(a,n.frame));if(o instanceof M)return o;let s=zc(t[e?3:2],n);return s instanceof M?s:Vc(r,Math.trunc(i),o,s)};B(`NETWORKDAYS`,`vv?r`,Hc(!1)),B(`NETWORKDAYS.INTL`,`vv?vr`,Hc(!0)),B(`WORKDAY`,`vv?r`,Uc(!1)),B(`WORKDAY.INTL`,`vv?vr`,Uc(!0)),B(`NOW`,``,(e,t)=>t.calc.nowSerial(),{volatile:!0}),B(`TODAY`,``,(e,t)=>Math.floor(t.calc.nowSerial()),{volatile:!0});function Wc(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 Gc=(e,t)=>{let n=ms([e[0]],t);if(n instanceof M)return n;let r=ms([e[1]],t);return r instanceof M?r:n.length!==r.length||n.length===0?N.NUM:{values:n,dates:r.map(Math.floor)}};B(`XNPV`,`vrr`,(e,t)=>{let n=L(t.calc.scalar(e[0],t.frame));if(n instanceof M)return n;let r=Gc(e.slice(1),t);return r instanceof M?r:n<=0?N.NUM:Wc(n,r.values,r.dates)}),B(`XIRR`,`rr?v`,(e,t)=>{let n=Gc(e,t);if(n instanceof M)return n;let{values:r,dates:i}=n;if(!r.some(e=>e>0)||!r.some(e=>e<0))return N.NUM;let a=e[2]===void 0||e[2]instanceof Gr?.1:L(t.calc.scalar(e[2],t.frame));if(a instanceof M)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 N.NUM;if(Math.abs(n-s)<1e-10)return n;s=n<=-1?(s-1)/2:n}return N.NUM});var Kc=(e,t)=>{z(e,1,1,e=>t(e),{errors:!0})};Kc(`ISBLANK`,e=>e==null),Kc(`ISNUMBER`,e=>typeof e==`number`),Kc(`ISTEXT`,e=>typeof e==`string`),Kc(`ISNONTEXT`,e=>typeof e!=`string`),Kc(`ISLOGICAL`,e=>typeof e==`boolean`),Kc(`ISERROR`,e=>e instanceof M),Kc(`ISERR`,e=>e instanceof M&&e!==N.NA),Kc(`ISNA`,e=>e===N.NA);var qc=(e,t)=>{let n=L(e);return n instanceof M?n:Math.abs(Math.trunc(n))%2===t};z(`ISEVEN`,1,1,e=>qc(e,0)),z(`ISODD`,1,1,e=>qc(e,1)),z(`N`,1,1,e=>typeof e==`number`?e:typeof e==`boolean`?+!!e:e instanceof M?e:0,{errors:!0}),B(`NA`,``,()=>N.NA),B(`TYPE`,`r`,(e,t)=>{let n=t.calc.flat(e[0]);return n instanceof P?64:typeof n==`number`||n===null?1:typeof n==`string`?2:typeof n==`boolean`?4:16});var Jc=[N.NULL,N.DIV0,N.VALUE,N.REF,N.NAME,N.NUM,N.NA];z(`ERROR.TYPE`,1,1,e=>{let t=e instanceof M?Jc.indexOf(e):-1;return t<0?N.NA:t+1},{errors:!0}),us(`ISREF`,1,1,(e,t)=>{let n=e[0];if(!n)return!1;let r=t.calc.eval(n,t.frame);return r instanceof F||r instanceof Ur});var Yc=e=>e instanceof F?e.sheet.at(e.top,e.left):void 0;us(`ISFORMULA`,1,1,(e,t)=>{let n=e[0];if(!n)return N.VALUE;let r=t.calc.eval(n,t.frame);return r instanceof Wr?N.VALUE:Yc(r)instanceof gr}),us(`FORMULATEXT`,1,1,(e,t)=>{let n=e[0];if(!n)return N.VALUE;let r=Yc(t.calc.eval(n,t.frame));return r instanceof gr?r.text:N.NA}),B(`CELL`,`v?r`,(e,t)=>{let n=R(t.calc.scalar(e[0],t.frame));if(n instanceof M)return n;let r=e[1],i=r instanceof F?r:new F(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 Ut({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 N.VALUE}});var Xc=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,ee=i-1,C=1;C<=v;C++){for(var te=0,w=.5*(x+y),ne=.5*(x-y),T=1;T<=a;T++){var E,D;o<T?(E=a-T+1,D=m[E-1]):(E=T,D=-m[E-1]);var re=w+ne*D,O=re*re;if(O>l)break;var k=2*e.normal.cdf(re,0,1,1,0),ie=2*e.normal.cdf(re,n,1,1,0),ae=k*.5-ie*.5;ae>=t.exp(s/ee)&&(ae=h[E-1]*t.exp(-(.5*O))*t.pow(ae,ee),te+=ae)}te*=2*ne*i/t.sqrt(2*t.PI),S+=te,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 ee=m-h*S;return r<y&&(ee+=-g/r+_*S/r),S*(ee*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,ee=S*t.log(a)-a*t.log(2)-e.gammaln(S),C=S-1,te=a*.25,w=a<=f?g:a<=p?_:a<=m?v:y;ee+=t.log(w);for(var ne=0,T=1;T<=50;T++){for(var E=0,D=(2*T-1)*w,re=1;re<=c;re++){var O,k;l<re?(O=re-l-1,k=ee+C*t.log(D+b[O]*w)-(b[O]*w+D)*te):(O=re-1,k=ee+C*t.log(D-b[O]*w)+(b[O]*w-D)*te);var ie;if(k>=u){ie=l<re?n*t.sqrt((b[O]*w+D)*.5):n*t.sqrt((-(b[O]*w)+D)*.5);var ae=i(ie,o,s)*x[O]*t.exp(k);E+=ae}}if(T*w>=1&&E<=d)break;ne+=E}if(E>d)throw Error(`tukey.cdf failed to converge`);return ne>1&&(ne=1),ne},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})})),Zc=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})})),Qc=e({ABS:()=>wf,ACCRINT:()=>n_,ACOS:()=>Tf,ACOSH:()=>Ef,ACOT:()=>Df,ACOTH:()=>Of,AGGREGATE:()=>kf,AND:()=>F_,ARABIC:()=>Af,ASIN:()=>jf,ASINH:()=>Mf,ATAN:()=>Nf,ATAN2:()=>Pf,ATANH:()=>Ff,AVEDEV:()=>id,AVERAGE:()=>ad,AVERAGEA:()=>od,AVERAGEIF:()=>sd,AVERAGEIFS:()=>cd,BASE:()=>If,BESSELI:()=>Nm,BESSELJ:()=>Pm,BESSELK:()=>Fm,BESSELY:()=>Im,BETA:()=>ld,BETADIST:()=>jh,BETAINV:()=>Mh,BIN2DEC:()=>Lm,BIN2HEX:()=>Rm,BIN2OCT:()=>zm,BINOM:()=>ud,BINOMDIST:()=>Nh,BITAND:()=>Bm,BITLSHIFT:()=>Vm,BITOR:()=>Hm,BITRSHIFT:()=>Um,BITXOR:()=>Wm,CEILING:()=>Lf,CEILINGMATH:()=>Ph,CEILINGPRECISE:()=>Fh,CHAR:()=>ku,CHIDIST:()=>Ih,CHIDISTRT:()=>Lh,CHIINV:()=>Rh,CHIINVRT:()=>zh,CHISQ:()=>dd,CHITEST:()=>Bh,CHOOSE:()=>uu,CHOOSECOLS:()=>du,CHOOSEROWS:()=>fu,CLEAN:()=>Au,CODE:()=>ju,COLUMN:()=>pu,COLUMNS:()=>mu,COMBIN:()=>Rf,COMBINA:()=>zf,COMPLEX:()=>Gm,CONCAT:()=>Nu,CONCATENATE:()=>Mu,CONFIDENCE:()=>fd,CONVERT:()=>Km,CORREL:()=>pd,COS:()=>Bf,COSH:()=>Vf,COT:()=>Hf,COTH:()=>Uf,COUNT:()=>md,COUNTA:()=>hd,COUNTBLANK:()=>gd,COUNTIF:()=>_d,COUNTIFS:()=>vd,COUPDAYS:()=>r_,COVAR:()=>Vh,COVARIANCE:()=>yd,COVARIANCEP:()=>Hh,COVARIANCES:()=>Uh,CRITBINOM:()=>Wh,CSC:()=>Wf,CSCH:()=>Gf,CUMIPMT:()=>i_,CUMPRINC:()=>a_,DATE:()=>om,DATEDIF:()=>sm,DATEVALUE:()=>cm,DAVERAGE:()=>zg,DAY:()=>lm,DAYS:()=>dm,DAYS360:()=>fm,DB:()=>o_,DCOUNT:()=>Bg,DCOUNTA:()=>Vg,DDB:()=>s_,DEC2BIN:()=>qm,DEC2HEX:()=>Jm,DEC2OCT:()=>Ym,DECIMAL:()=>Kf,DEGREES:()=>qf,DELTA:()=>Xm,DEVSQ:()=>bd,DGET:()=>Hg,DISC:()=>c_,DMAX:()=>Ug,DMIN:()=>Wg,DOLLAR:()=>Pu,DOLLARDE:()=>l_,DOLLARFR:()=>u_,DPRODUCT:()=>Gg,DROP:()=>hu,DSTDEV:()=>Kg,DSTDEVP:()=>qg,DSUM:()=>Jg,DVAR:()=>Yg,DVARP:()=>Xg,EDATE:()=>pm,EFFECT:()=>d_,EOMONTH:()=>mm,ERF:()=>Zm,ERFC:()=>Qm,ERFCPRECISE:()=>Gh,ERFPRECISE:()=>Kh,ERROR:()=>Xl,EVEN:()=>Jf,EXACT:()=>Fu,EXP:()=>Yf,EXPAND:()=>gu,EXPON:()=>xd,EXPONDIST:()=>qh,F:()=>Sd,FACT:()=>Zf,FACTDOUBLE:()=>Qf,FALSE:()=>I_,FDIST:()=>Jh,FDISTRT:()=>Yh,FIND:()=>Iu,FINV:()=>Xh,FINVRT:()=>Zh,FISHER:()=>Cd,FISHERINV:()=>wd,FIXED:()=>Lu,FLOOR:()=>$f,FLOORMATH:()=>Qh,FLOORPRECISE:()=>$h,FORECAST:()=>Td,FREQUENCY:()=>Ed,FTEST:()=>eg,FV:()=>f_,FVSCHEDULE:()=>p_,GAMMA:()=>Dd,GAMMADIST:()=>tg,GAMMAINV:()=>ng,GAMMALN:()=>Od,GAMMALNPRECISE:()=>rg,GAUSS:()=>kd,GCD:()=>ep,GEOMEAN:()=>Ad,GESTEP:()=>$m,GROWTH:()=>jd,HARMEAN:()=>Md,HEX2BIN:()=>eh,HEX2DEC:()=>th,HEX2OCT:()=>nh,HLOOKUP:()=>_u,HOUR:()=>hm,HSTACK:()=>Du,HYPGEOM:()=>Nd,HYPGEOMDIST:()=>ig,IF:()=>L_,IFERROR:()=>z_,IFNA:()=>B_,IFS:()=>R_,IMABS:()=>rh,IMAGINARY:()=>ih,IMARGUMENT:()=>ah,IMCONJUGATE:()=>oh,IMCOS:()=>sh,IMCOSH:()=>ch,IMCOT:()=>lh,IMCSC:()=>Ch,IMCSCH:()=>wh,IMDIV:()=>uh,IMEXP:()=>dh,IMLN:()=>fh,IMLOG10:()=>ph,IMLOG2:()=>mh,IMPOWER:()=>hh,IMPRODUCT:()=>gh,IMREAL:()=>_h,IMSEC:()=>vh,IMSECH:()=>yh,IMSIN:()=>bh,IMSINH:()=>xh,IMSQRT:()=>Sh,IMSUB:()=>Th,IMSUM:()=>Eh,IMTAN:()=>Dh,INDEX:()=>vu,INT:()=>tp,INTERCEPT:()=>Pd,IPMT:()=>m_,IRR:()=>h_,ISBLANK:()=>Zl,ISERR:()=>Ql,ISERROR:()=>$l,ISEVEN:()=>eu,ISLOGICAL:()=>tu,ISNA:()=>nu,ISNONTEXT:()=>ru,ISNUMBER:()=>iu,ISO:()=>np,ISODD:()=>au,ISOWEEKNUM:()=>gm,ISPMT:()=>g_,ISTEXT:()=>ou,KURT:()=>Fd,LARGE:()=>Id,LCM:()=>rp,LEFT:()=>Ru,LEN:()=>zu,LINEST:()=>Ld,LN:()=>ip,LOG:()=>ap,LOG10:()=>op,LOGEST:()=>Rd,LOGINV:()=>ag,LOGNORM:()=>zd,LOGNORMDIST:()=>og,LOGNORMINV:()=>sg,LOOKUP:()=>yu,LOWER:()=>Bu,MATCH:()=>bu,MAX:()=>Bd,MAXA:()=>Vd,MAXIFS:()=>Hd,MEDIAN:()=>Ud,MID:()=>Vu,MIN:()=>Wd,MINA:()=>Gd,MINIFS:()=>Kd,MINUTE:()=>_m,MIRR:()=>__,MMULT:()=>sp,MOD:()=>cp,MODE:()=>qd,MODEMULT:()=>cg,MODESNGL:()=>lg,MONTH:()=>vm,MROUND:()=>lp,MULTINOMIAL:()=>up,MUNIT:()=>dp,N:()=>su,NA:()=>cu,NEGBINOM:()=>Jd,NEGBINOMDIST:()=>ug,NETWORKDAYS:()=>ym,NETWORKDAYSINTL:()=>dg,NOMINAL:()=>v_,NORM:()=>Yd,NORMDIST:()=>fg,NORMINV:()=>pg,NORMSDIST:()=>mg,NORMSINV:()=>hg,NOT:()=>V_,NOW:()=>bm,NPER:()=>y_,NPV:()=>b_,NUMBERVALUE:()=>Hu,OCT2BIN:()=>Oh,OCT2DEC:()=>kh,OCT2HEX:()=>Ah,ODD:()=>fp,OR:()=>H_,PDURATION:()=>x_,PEARSON:()=>Xd,PERCENTILE:()=>Zd,PERCENTILEEXC:()=>gg,PERCENTILEINC:()=>_g,PERCENTRANK:()=>Qd,PERCENTRANKEXC:()=>vg,PERCENTRANKINC:()=>yg,PERMUT:()=>$d,PERMUTATIONA:()=>ef,PHI:()=>tf,PI:()=>pp,PMT:()=>S_,POISSON:()=>nf,POISSONDIST:()=>bg,POWER:()=>mp,PPMT:()=>C_,PRICEDISC:()=>w_,PROB:()=>rf,PRODUCT:()=>hp,PROPER:()=>Uu,PV:()=>T_,QUARTILE:()=>af,QUARTILEEXC:()=>xg,QUARTILEINC:()=>Sg,QUOTIENT:()=>gp,RADIANS:()=>_p,RAND:()=>vp,RANDBETWEEN:()=>yp,RANK:()=>of,RANKAVG:()=>Cg,RANKEQ:()=>wg,RATE:()=>E_,REPLACE:()=>Wu,REPT:()=>Gu,RIGHT:()=>Ku,ROMAN:()=>bp,ROUND:()=>Sp,ROUNDDOWN:()=>Cp,ROUNDUP:()=>wp,ROW:()=>sf,ROWS:()=>xu,RRI:()=>D_,RSQ:()=>cf,SEARCH:()=>qu,SEC:()=>Tp,SECH:()=>Ep,SECOND:()=>xm,SERIESSUM:()=>Dp,SIGN:()=>Op,SIN:()=>kp,SINH:()=>Ap,SKEW:()=>lf,SKEWP:()=>Tg,SLN:()=>O_,SLOPE:()=>uf,SMALL:()=>df,SORT:()=>Su,SQRT:()=>jp,SQRTPI:()=>Mp,STANDARDIZE:()=>ff,STDEV:()=>pf,STDEVA:()=>mf,STDEVP:()=>Eg,STDEVPA:()=>hf,STDEVS:()=>Dg,STEYX:()=>gf,SUBSTITUTE:()=>Ju,SUBTOTAL:()=>Np,SUM:()=>Pp,SUMIF:()=>Fp,SUMIFS:()=>Ip,SUMPRODUCT:()=>Lp,SUMSQ:()=>Rp,SUMX2MY2:()=>zp,SUMX2PY2:()=>Bp,SUMXMY2:()=>Vp,SWITCH:()=>G_,SYD:()=>k_,T:()=>Yu,TAKE:()=>Cu,TAN:()=>Hp,TANH:()=>Up,TBILLEQ:()=>A_,TBILLPRICE:()=>j_,TBILLYIELD:()=>M_,TDIST:()=>Og,TDISTRT:()=>kg,TEXT:()=>Xu,TEXTJOIN:()=>Zu,TIME:()=>Sm,TIMEVALUE:()=>Cm,TINV:()=>Ag,TODAY:()=>wm,TRANSPOSE:()=>wu,TREND:()=>_f,TRIM:()=>Qu,TRIMMEAN:()=>vf,TRUE:()=>U_,TRUNC:()=>Wp,TTEST:()=>jg,TYPE:()=>lu,UNICHAR:()=>$u,UNICODE:()=>ed,UNIQUE:()=>Tu,UPPER:()=>td,VALUE:()=>nd,VAR:()=>yf,VARA:()=>bf,VARP:()=>Mg,VARPA:()=>xf,VARS:()=>Ng,VLOOKUP:()=>Eu,VSTACK:()=>Ou,WEEKDAY:()=>Tm,WEEKNUM:()=>Em,WEIBULL:()=>Sf,WEIBULLDIST:()=>Pg,WORKDAY:()=>Dm,WORKDAYINTL:()=>Fg,XIRR:()=>N_,XNPV:()=>P_,XOR:()=>W_,YEAR:()=>Om,YEARFRAC:()=>jm,Z:()=>Cf,ZTEST:()=>Ig,utils:()=>K_}),H=t(Xc(),1),$c=t(Zc(),1),el=Error(`#NULL!`),tl=Error(`#DIV/0!`),U=Error(`#VALUE!`),nl=Error(`#REF!`),rl=Error(`#NAME?`),W=Error(`#NUM!`),G=Error(`#N/A`),il=Error(`#ERROR!`),al=Error(`#GETTING_DATA`),ol=Error(`#CALC!`),sl=Object.freeze({__proto__:null,calc:ol,data:al,div0:tl,error:il,na:G,name:rl,nil:el,num:W,ref:nl,value:U}),cl=!1;function ll(){cl=!0}function ul(){cl=!1}function dl(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 fl(e){let t=new Date(1900,0,1),n=e>-22038912e5?2:1;return Math.ceil((e-t)/864e5)+n}var pl=Object.freeze({__proto__:null,dateToSerial:fl,get returnSerial(){return cl},serialToDate:dl,useDate:ul,useSerial:ll}),ml=`=`,hl=[`>`,`>=`,`<`,`<=`,`=`,`<>`],gl=`operator`,_l=`literal`,vl=[gl,_l],yl=gl,bl=_l;function xl(e,t){if(vl.indexOf(t)===-1)throw Error(`Unsupported token type: `+t);return{value:e,type:t}}function Sl(e){return typeof e==`string`&&/^\d+(\.\d+)?$/.test(e)&&(e=e.indexOf(`.`)===-1?parseInt(e,10):parseFloat(e)),e}function Cl(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 wl(e){let t=``,n=[];for(let r=0;r<e.length;r++){let i=e[r];r===0&&hl.indexOf(i)>=0?n.push(xl(i,yl)):t+=i}return t.length>0&&n.push(xl(Sl(t),bl)),n.length>0&&n[0].type!==yl&&n.unshift(xl(ml,yl)),n}function Tl(e){let t=[],n;for(let r=0;r<e.length;r++){let i=e[r];switch(i.type){case yl:n=i.value;break;case bl:t.push(i.value)}}return El(t,n)}function El(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 Dl(e){return wl(Cl(e))}var Ol=Tl;function kl(e){let t=[];return Al(e,e=>{t.push(e)}),t}function Al(e,t){let n=-1,r=e.length;for(;++n<r&&t(e[n],n,e)!==!1;);return e}function jl(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=X(n);e[t]=r instanceof Error?0:r}}return e}function Ml(e){return[e.length,e.reduce((e,t)=>Math.max(e,t.length),0)]}function Nl(e,t){let n=[e,t];return n.some(e=>!Yl(e))?G:n.some(e=>e<=0)?U:Array.from({length:e},()=>Array.from({length:t},()=>void 0))}function Pl(e,t){if(!e)return U;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 K(){let e;if(arguments.length===1){let t=arguments[0];e=Ll(t)?kl.apply(null,arguments):[t]}else e=Array.from(arguments);for(;!Rl(e);)e=Fl(e);return e}function Fl(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 Il(e,t){return t||=1,!e||typeof e.slice!=`function`?e:e.slice(0,e.length-t)}function Ll(e){return e!=null&&typeof e.length==`number`&&typeof e!=`string`}function Rl(e){if(!e)return!1;for(let t=0;t<e.length;++t)if(Array.isArray(e[t]))return!1;return!0}function zl(e,t){return t||=1,!e||typeof e.slice!=`function`?e:e.slice(t)}function Bl(e){return e?e[0].map((t,n)=>e.map(e=>e[n])):U}function Vl(e,t){let n=null;return Al(e,(e,r)=>{if(e[0]===t)return n=r,!1}),n??U}function q(){for(let e=0;e<arguments.length;e++)if(arguments[e]instanceof Error)return arguments[e]}function J(){let e=arguments.length;for(;e--;)if(arguments[e]instanceof Error)return!0;return!1}function Hl(e){let t=0x5af3107a4000;return Math.round(e*t)/t}function Ul(){return K.apply(null,arguments).filter(e=>typeof e==`number`)}function Wl(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)||U}function Y(e){if(!isNaN(e)){if(e instanceof Date)return new Date(e);let t=parseFloat(e);return t<0||t>=2958466?W:dl(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:U}function Gl(e){let t=e.length,n;for(;t--;){if(n=Y(e[t]),n===U)return n;e[t]=n}return e}function X(e){return e instanceof Error?e:e==null?0:(typeof e==`boolean`&&(e=+e),!isNaN(e)&&e!==``?parseFloat(e):U)}function Z(e){let t;if(!e||(t=e.length)===0)return U;let n;for(;t--;){if(e[t]instanceof Error)return e[t];if(n=X(e[t]),n instanceof Error)return n;e[t]=n}return e}function Kl(e){return e instanceof Error?e:e==null?``:e.toString()}function ql(){let e=arguments.length;for(;e--;)if(typeof arguments[e]==`string`)return!0;return!1}function Jl(){let e=kl(arguments),t=Z(K(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]=K(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=Dl(i+``);s=Ol([xl(r,bl)].concat(e))}if(!s){a=!1;break}a=!0}a&&i.push(t[e])}return i}function Yl(e){return e!=null}var Xl={};Xl.TYPE=e=>{switch(e){case el:return 1;case tl:return 2;case U:return 3;case nl:return 4;case rl:return 5;case W:return 6;case G:return 7;case al:return 8}return G};function Zl(e){return e===null}function Ql(e){return[U,nl,tl,W,rl,el].indexOf(e)>=0||typeof e==`number`&&(isNaN(e)||!isFinite(e))}function $l(e){return Ql(e)||e===G}function eu(e){return!(Math.floor(Math.abs(e))&1)}function tu(e){return e===!0||e===!1}function nu(e){return e===G}function ru(e){return typeof e!=`string`}function iu(e){return typeof e==`number`&&!isNaN(e)&&isFinite(e)}function au(e){return!!(Math.floor(Math.abs(e))&1)}function ou(e){return typeof e==`string`}function su(e){return iu(e)?e:e instanceof Date?e.getTime():e===!0?1:e===!1?0:$l(e)?e:0}function cu(){return G}function lu(e){if(iu(e))return 1;if(ou(e))return 2;if(tu(e))return 4;if($l(e))return 16;if(Array.isArray(e))return 64}function uu(){if(arguments.length<2)return G;let e=arguments[0];return e<1||e>254||arguments.length<e+1?U:arguments[e]}function du(e,t,...n){if(!Array.isArray(e))return U;let r=K([t,...n]),[i,a]=Ml(e);if(r.some(e=>{if(!Yl(e))return!0;let t=Math.abs(e);return!(0<t&&t<=a)}))return U;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 fu(e,t,...n){if(!Array.isArray(e))return U;let r=K([t,...n]);return r.some(t=>{if(!Yl(t))return!0;let n=Math.abs(t);return!(0<n&&n<=e.length)})?U:r.map(t=>t<0?t+e.length+1:t).reduce((t,n)=>{let r=[...e[--n]].map(e=>Yl(e)?e:0);return t.push(r),t},[])}function pu(e,t){if(arguments.length!==2)return G;if(t<0)return W;if(!(e instanceof Array)||typeof t!=`number`)return U;if(e.length!==0)return H.default.col(e,t)}function mu(e){return arguments.length===1?e instanceof Array?e.length===0?0:H.default.cols(e):U:G}function hu(e,t,n){if(J(e,t,n))return q(e,t,n);if(!(e instanceof Array))return U;let r=[],[i,a]=Ml(e),o=0,s=i;if(typeof t==`number`){if(Math.abs(t)>i)return ol;t>0?o=t:t<0&&(s+=t)}let c=0,l=a;if(typeof n==`number`){if(Math.abs(n)>a)return ol;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 gu(e,t,n,r){let[i,a]=Ml(e);if(Yl(t)||(t=i),Yl(n)||(n=a),t<i||n<a)return U;let o=Nl(t,n);for(let s=0;s<t;s++)for(let t=0;t<n;t++){let n=e[s]?.[t];Yl(n)||(n=s<i&&t<a?0:r??G),o[s][t]=n}return o}function _u(e,t,n,r){return Eu(e,Bl(t),n,r)}function vu(e,t,n){let r=q(e,t,n);if(r)return r;if(!Array.isArray(e))return U;let i=e.length>0&&!Array.isArray(e[0]);return i&&!n?(n=t,t=1):(n||=1,t||=1),n<0||t<0?U:i&&t===1&&n<=e.length?e[n-1]:t<=e.length&&n<=e[t-1].length?e[t-1][n-1]:nl}function yu(e,t,n){t=K(t),n=n?K(n):t;let r=typeof e==`number`,i=G;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 bu(e,t,n){if(!e&&e!==0||!t||(arguments.length===2&&(n=1),t=K(t),!(t instanceof Array))||n!==-1&&n!==0&&n!==1)return G;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||G}function xu(e){return arguments.length===1?e instanceof Array?e.length===0?0:H.default.rows(e):U:G}function Su(e,t=1,n=1,r=!1){if(!e||!Array.isArray(e))return G;if(e.length===0)return 0;if(t=X(t),!t||t<1||(n=X(n),n!==1&&n!==-1))return U;if(r=Wl(r),typeof r!=`boolean`)return rl;let i=e=>e.sort((e,r)=>(e=Kl(e[t-1]),r=Kl(r[t-1]),n===1?e<r?n*-1:n:e>r?n:n*-1)),a=Pl(e),o=r?Bl(a):a;return t>=1&&t<=o[0].length?r?Bl(i(o)):i(o):U}function Cu(e,t,n){if(J(e,t,n))return q(e,t,n);if(!(e instanceof Array))return U;let[r,i]=Ml(e),a=0,o=r-1;if(typeof t==`number`){if(t===0)return ol;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 ol;Math.abs(n)<=i&&(n<0?s=i+n:c=n-1)}let l=Nl(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 wu(e){return e?Bl(Pl(e)):G}function Tu(){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 Eu(e,t,n,r){if(!t||!n)return G;r=r!==0&&r!==!1;let i=G,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]:nl;break}!a&&(o&&r&&u<=e||r&&typeof u==`string`&&u.localeCompare(e)<0)&&(i=n<l.length+1?l[n-1]:nl),o&&u>e&&(a=!0)}return i}function Du(e,...t){let n=[e,...t],r=0,i=0,a=[];for(let e of n){let[t,n]=Ml(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:G);s++}}return o}function Ou(e,...t){let n=[e,...t],r=0,i=0;for(let e of n){let[t,n]=Ml(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:G)}return a}function ku(e){return e=X(e),e===0?U:e instanceof Error?e:String.fromCharCode(e)}function Au(e){return J(e)?e:(e||=``,e.replace(/[\0-\x1F]/g,``))}function ju(e){if(J(e))return e;e||=``;let t=e.charCodeAt(0);return isNaN(t)&&(t=U),t}function Mu(){let e=K(arguments),t=q.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 Nu=Mu;function Pu(e,t=2){if(e=X(e),isNaN(e))return U;e=Sp(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 Fu(e,t){return arguments.length===2?q(e,t)||(e=Kl(e),t=Kl(t),e===t):G}function Iu(e,t,n){if(arguments.length<2)return G;e=Kl(e),t=Kl(t),n=n===void 0?0:n;let r=t.indexOf(e,n-1);return r===-1?U:r+1}function Lu(e,t=2,n=!1){if(e=X(e),isNaN(e)||(t=X(t),isNaN(t)))return U;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 Ru(e,t){return q(e,t)||(e=Kl(e),t=t===void 0?1:t,t=X(t),t instanceof Error||typeof e!=`string`?U:e.substring(0,t))}function zu(e){return arguments.length===0?il:e instanceof Error?e:Array.isArray(e)?U:Kl(e).length}function Bu(e){return arguments.length===1?(e=Kl(e),J(e)?e:e.toLowerCase()):U}function Vu(e,t,n){if(J(e,t,n))return q(e,t,n);let r=[t,n].map(e=>X(e));if(!r.every(e=>!(e instanceof Error)&&e>0))return U;Yl(e)?typeof e!=`string`&&(e=String(e)):e=``,[t,n]=r;let i=t-1,a=i+n;return e.substring(i,a)}function Hu(e,t,n){return e=Yl(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,``))):G}function Uu(e){return J(e)?e:isNaN(e)&&typeof e==`number`?U:(e=Kl(e),e.replace(/\w\S*/g,e=>e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()))}function Wu(e,t,n,r){return t=X(t),n=X(n),J(t,n)||typeof e!=`string`||typeof r!=`string`?U:e.substr(0,t-1)+r+e.substr(t-1+n)}function Gu(e,t){return q(e,t)||(e=Kl(e),t=X(t),t instanceof Error?t:Array(t+1).join(e))}function Ku(e,t){return q(e,t)||(e=Kl(e),t=t===void 0?1:t,t=X(t),t instanceof Error?t:e.substring(e.length-t))}function qu(e,t,n){let r;return typeof e!=`string`||typeof t!=`string`?U:(n=n===void 0?0:n,r=t.toLowerCase().indexOf(e.toLowerCase(),n-1)+1,r===0?U:r)}function Ju(e,t,n,r){if(arguments.length<3)return G;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 U;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 Yu(e){return e instanceof Error||typeof e==`string`?e:``}function Xu(e,t){if(e===void 0||e instanceof Error||t instanceof Error)return G;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 U;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=Lu(e,i,a),e.startsWith(`-`)?(e=e.replace(`-`,``),e=`-`+n+e):e=n+e,r&&(e+=`%`),e}function Zu(e,t,...n){if(typeof t!=`boolean`&&(t=Wl(t)),arguments.length<3)return G;e??=``;let r=K(n),i=t?r.filter(e=>e):r;if(Array.isArray(e)){e=K(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=K(t),i.join(``)}return i.join(e)}function Qu(e){return e=Kl(e),e instanceof Error?e:e.replace(/\s+/g,` `).trim()}var $u=ku,ed=ju;function td(e){return e=Kl(e),e instanceof Error?e:e.toUpperCase()}function nd(e){let t=q(e);if(t)return t;if(typeof e==`number`)return e;if(Yl(e)||(e=``),typeof e!=`string`)return U;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)?U:(r||=0,n&&(r*=.01),r)}var rd=2.5066282746310002;function id(){let e=K(arguments).filter(Yl);if(e.length===0)return W;let t=Z(e);return t instanceof Error?t:H.default.sum((0,H.default)(t).subtract(H.default.mean(t)).abs()[0])/t.length}function ad(){let e=K(arguments).filter(Yl);if(e.length===0)return tl;let t=q.apply(void 0,e);if(t)return t;let n=Ul(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=W),o}function od(){let e=K(arguments).filter(Yl);if(e.length===0)return tl;let t=q.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=W),o}function sd(e,t,n){if(arguments.length<=1)return G;if(n||=e,n=Z(K(n).filter(Yl)),e=K(e),n instanceof Error)return n;let r=0,i=0,a=t===void 0||t===`*`,o=a?null:Dl(t+``);for(let t=0;t<e.length;t++){let s=e[t];(a||Ol([xl(s,bl)].concat(o)))&&(i+=n[t],r++)}return i/r}function cd(){let e=Jl(...arguments),t=e.reduce((e,t)=>e+t,0)/e.length;return isNaN(t)?0:t}var ld={};ld.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=X(e),t=X(t),n=X(n),i=X(i),a=X(a),J(e,t,n,i,a))?U:(e=(e-i)/(a-i),r?H.default.beta.cdf(e,t,n):H.default.beta.pdf(e,t,n))},ld.INV=(e,t,n,r,i)=>(r=r===void 0?0:r,i=i===void 0?1:i,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i)?U:H.default.beta.inv(e,t,n)*(i-r)+r);var ud={};ud.DIST=(e,t,n,r)=>(e=X(e),t=X(t),n=X(n),r=X(r),J(e,t,n,r)?U:r?H.default.binomial.cdf(e,t,n):H.default.binomial.pdf(e,t,n)),ud.DIST.RANGE=(e,t,n,r)=>{if(r=r===void 0?n:r,e=X(e),t=X(t),n=X(n),r=X(r),J(e,t,n,r))return U;let i=0;for(let a=n;a<=r;a++)i+=Rf(e,a)*t**+a*(1-t)**(e-a);return i},ud.INV=(e,t,n)=>{if(e=X(e),t=X(t),n=X(n),J(e,t,n))return U;let r=0;for(;r<=e;){if(H.default.binomial.cdf(r,e,t)>=n)return r;r++}};var dd={};dd.DIST=(e,t,n)=>(e=X(e),t=X(t),J(e,t)?U:n?H.default.chisquare.cdf(e,t):H.default.chisquare.pdf(e,t)),dd.DIST.RT=(e,t)=>!e|!t?G:e<1||t>10**10?W:typeof e!=`number`||typeof t!=`number`?U:1-H.default.chisquare.cdf(e,t),dd.INV=(e,t)=>(e=X(e),t=X(t),J(e,t)?U:H.default.chisquare.inv(e,t)),dd.INV.RT=(e,t)=>!e|!t?G:e<0||e>1||t<1||t>10**10?W:typeof e!=`number`||typeof t!=`number`?U:H.default.chisquare.inv(1-e,t),dd.TEST=function(e,t){if(arguments.length!==2)return G;if(!(e instanceof Array)||!(t instanceof Array)||e.length!==t.length||e[0]&&t[0]&&e[0].length!==t[0].length)return U;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 fd={};fd.NORM=(e,t,n)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:H.default.normalci(1,e,t,n)[1]-1),fd.T=(e,t,n)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:H.default.tci(1,e,t,n)[1]-1);function pd(e,t){return e=Z(K(e)),t=Z(K(t)),J(e,t)?U:H.default.corrcoeff(e,t)}function md(){return Ul(K(arguments)).length}function hd(){let e=K(arguments);return e.length-gd(e)}function gd(){let e=K(arguments),t=0,n;for(let r=0;r<e.length;r++)n=e[r],(n==null||n===``)&&t++;return t}function _d(e,t){if(e=K(e),t===void 0||t===`*`)return e.length;let n=0,r=Dl(t+``);for(let t=0;t<e.length;t++){let i=e[t];Ol([xl(i,bl)].concat(r))&&n++}return n}function vd(){let e=kl(arguments),t=Array(K(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=K(e[n]),i=e[n+1];if(i!==void 0&&i!==`*`){let e=Dl(i+``);for(let n=0;n<r.length;n++){let i=r[n],a=[xl(i,bl)].concat(e);t[n]=t[n]&&Ol(a)}}}let n=0;for(let e=0;e<t.length;e++)t[e]&&n++;return n}var yd={};yd.P=(e,t)=>{if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=H.default.mean(e),r=H.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},yd.S=(e,t)=>(e=Z(K(e)),t=Z(K(t)),J(e,t)?U:H.default.covariance(e,t));function bd(){let e=Z(K(arguments));if(e instanceof Error)return e;let t=H.default.mean(e),n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t)**2;return n}var xd={};xd.DIST=(e,t,n)=>(e=X(e),t=X(t),J(e,t)?U:n?H.default.exponential.cdf(e,t):H.default.exponential.pdf(e,t));var Sd={};Sd.DIST=(e,t,n,r)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:r?H.default.centralF.cdf(e,t,n):H.default.centralF.pdf(e,t,n)),Sd.DIST.RT=function(e,t,n){return arguments.length===3?e<0||t<1||n<1?W:typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?U:1-H.default.centralF.cdf(e,t,n):G},Sd.INV=(e,t,n)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:e<=0||e>1?W:H.default.centralF.inv(e,t,n)),Sd.INV.RT=function(e,t,n){return arguments.length===3?e<0||e>1||t<1||t>10**10||n<1||n>10**10?W:typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?U:H.default.centralF.inv(1-e,t,n):G},Sd.TEST=(e,t)=>{if(!e||!t||!(e instanceof Array)||!(t instanceof Array))return G;if(e.length<2||t.length<2)return tl;let n=(e,t)=>{let n=0;for(let r=0;r<e.length;r++)n+=(e[r]-t)**2;return n},r=Pp(e)/e.length,i=Pp(t)/t.length;return n(e,r)/(e.length-1)/(n(t,i)/(t.length-1))};function Cd(e){return e=X(e),e instanceof Error?e:Math.log((1+e)/(1-e))/2}function wd(e){if(e=X(e),e instanceof Error)return e;let t=Math.exp(2*e);return(t-1)/(t+1)}function Td(e,t,n){if(e=X(e),t=Z(K(t)),n=Z(K(n)),J(e,t,n))return U;let r=H.default.mean(n),i=H.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 Ed(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;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 Dd(e){return e=X(e),e instanceof Error?e:e===0||parseInt(e,10)===e&&e<0?W:H.default.gammafn(e)}Dd.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`?U:r?H.default.gamma.cdf(e,t,n,!0):H.default.gamma.pdf(e,t,n,!1):G},Dd.INV=function(e,t,n){return arguments.length===3?e<0||e>1||t<=0||n<=0?W:typeof e!=`number`||typeof t!=`number`||typeof n!=`number`?U:H.default.gamma.inv(e,t,n):G};function Od(e){return e=X(e),e instanceof Error?e:H.default.gammaln(e)}Od.PRECISE=function(e){return arguments.length===1?e<=0?W:typeof e==`number`?H.default.gammaln(e):U:G};function kd(e){return e=X(e),e instanceof Error?e:H.default.normal.cdf(e,0,1)-.5}function Ad(){let e=Z(K(arguments));return e instanceof Error?e:H.default.geomean(e)}function jd(e,t,n,r){if(e=Z(K(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=Z(K(t)),n=Z(K(n)),J(t,n))return U;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 Md(){let e=Z(K(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 Nd={};Nd.DIST=(e,t,n,r,i)=>{if(e=X(e),t=X(t),n=X(n),r=X(r),J(e,t,n,r))return U;function a(e,t,n,r){return Rf(n,e)*Rf(r-n,t-e)/Rf(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 Pd(e,t){return e=Z(e),t=Z(t),J(e,t)?U:e.length===t.length?Td(0,e,t):G}function Fd(){let e=Z(K(arguments));if(e instanceof Error)return e;let t=H.default.mean(e),n=e.length,r=0;for(let i=0;i<n;i++)r+=(e[i]-t)**4;return r/=H.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 Id(e,t){return q.apply(void 0,e)||(J(t)?t:(e=Ul(K(e)),t=X(t),t<0||e.length<t?U:e.sort((e,t)=>t-e)[t-1]))}function Ld(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=H.default.mean(e),r=H.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 Rd(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t)||e.length!==t.length)return U;for(let t=0;t<e.length;t++)e[t]=Math.log(e[t]);let n=Ld(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 zd={};zd.DIST=(e,t,n,r)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:r?H.default.lognormal.cdf(e,t,n):H.default.lognormal.pdf(e,t,n)),zd.INV=(e,t,n)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:H.default.lognormal.inv(e,t,n));function Bd(){let e=K(arguments),t=q.apply(void 0,e);if(t)return t;let n=Ul(e);return n.length===0?0:Math.max.apply(Math,n)}function Vd(){let e=K(arguments),t=q.apply(void 0,e);if(t)return t;let n=jl(e);return n=n.map(e=>e??0),n.length===0?0:Math.max.apply(Math,n)}function Hd(){let e=Jl(...arguments);return e.length===0?0:Math.max.apply(Math,e)}function Ud(){let e=K(arguments),t=q.apply(void 0,e);if(t)return t;let n=jl(e),r=H.default.median(n);return isNaN(r)&&(r=W),r}function Wd(){let e=K(arguments),t=q.apply(void 0,e);if(t)return t;let n=Ul(e);return n.length===0?0:Math.min.apply(Math,n)}function Gd(){let e=K(arguments),t=q.apply(void 0,e);if(t)return t;let n=jl(e);return n=n.map(e=>e??0),n.length===0?0:Math.min.apply(Math,n)}function Kd(){let e=Jl(...arguments);return e.length===0?0:Math.min.apply(Math,e)}var qd={};qd.MULT=function(){let e=Z(K(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},qd.SNGL=function(){let e=Z(K(arguments));return e instanceof Error?e:qd.MULT(e).sort((e,t)=>e-t)[0]};var Jd={};Jd.DIST=(e,t,n,r)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:r?H.default.negbin.cdf(e,t,n):H.default.negbin.pdf(e,t,n));var Yd={};Yd.DIST=(e,t,n,r)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:n<=0?W:r?H.default.normal.cdf(e,t,n):H.default.normal.pdf(e,t,n)),Yd.INV=(e,t,n)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:H.default.normal.inv(e,t,n)),Yd.S={},Yd.S.DIST=(e,t)=>(e=X(e),e instanceof Error?U:t?H.default.normal.cdf(e,0,1):H.default.normal.pdf(e,0,1)),Yd.S.INV=e=>(e=X(e),e instanceof Error?U:H.default.normal.inv(e,0,1));function Xd(e,t){if(t=Z(K(t)),e=Z(K(e)),J(t,e))return U;let n=H.default.mean(e),r=H.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 Zd={};Zd.EXC=(e,t)=>{if(e=Z(K(e)),t=X(t),J(e,t))return U;e=e.sort((e,t)=>e-t);let n=e.length;if(t<1/(n+1)||t>1-1/(n+1))return W;let r=t*(n+1)-1,i=Math.floor(r);return Hl(r===i?e[r]:e[i]+(r-i)*(e[i+1]-e[i]))},Zd.INC=(e,t)=>{if(e=Z(K(e)),t=X(t),J(e,t))return U;e=e.sort((e,t)=>e-t);let n=e.length,r=t*(n-1),i=Math.floor(r);return Hl(r===i?e[r]:e[i]+(r-i)*(e[i+1]-e[i]))};var Qd={};Qd.EXC=(e,t,n)=>{if(n=n===void 0?3:n,e=Z(K(e)),t=X(t),n=X(n),J(e,t,n))return U;e=e.sort((e,t)=>e-t);let r=Tu.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},Qd.INC=(e,t,n)=>{if(n=n===void 0?3:n,e=Z(K(e)),t=X(t),n=X(n),J(e,t,n))return U;e=e.sort((e,t)=>e-t);let r=Tu.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 $d(e,t){return e=X(e),t=X(t),J(e,t)?U:Zf(e)/Zf(e-t)}function ef(e,t){return e=X(e),t=X(t),J(e,t)?U:e**+t}function tf(e){return e=X(e),e instanceof Error?U:Math.exp(-.5*e*e)/rd}var nf={};nf.DIST=(e,t,n)=>(e=X(e),t=X(t),J(e,t)?U:n?H.default.poisson.cdf(e,t):H.default.poisson.pdf(e,t));function rf(e,t,n,r){if(n===void 0)return 0;if(r=r===void 0?n:r,e=Z(K(e)),t=Z(K(t)),n=X(n),r=X(r),J(e,t,n,r))return U;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 af={};af.EXC=(e,t)=>{if(e=Z(Ul(K(e))),t=X(t),J(e,t))return U;switch(t){case 1:return Zd.EXC(e,.25);case 2:return Zd.EXC(e,.5);case 3:return Zd.EXC(e,.75);default:return W}},af.INC=(e,t)=>{if(e=Z(Ul(K(e))),t=X(t),J(e,t))return U;switch(t){case 1:return Zd.INC(e,.25);case 2:return Zd.INC(e,.5);case 3:return Zd.INC(e,.75);default:return W}};var of={};of.AVG=(e,t,n)=>{if(e=X(e),t=Z(K(t)),J(e,t))return U;t=K(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},of.EQ=(e,t,n)=>{if(e=X(e),t=Z(K(t)),J(e,t))return U;n||=!1;let r=n?(e,t)=>e-t:(e,t)=>t-e;return t=t.sort(r),t.indexOf(e)+1};function sf(e,t){if(arguments.length!==2)return G;if(t<0)return W;if(!(e instanceof Array)||typeof t!=`number`)return U;if(e.length!==0)return H.default.row(e,t)}function cf(e,t){return e=Z(K(e)),t=Z(K(t)),J(e,t)?U:Xd(e,t)**2}function lf(){let e=Z(K(arguments));if(e instanceof Error)return e;let t=H.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)*H.default.stdev(e,!0)**3)}lf.P=function(){let e=Z(K(arguments));if(e instanceof Error)return e;let t=H.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 uf(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=H.default.mean(t),r=H.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 df(e,t){return e=Z(K(e)),t=X(t),J(e,t)?e:e.sort((e,t)=>e-t)[t-1]}function ff(e,t,n){return e=X(e),t=X(t),n=X(n),J(e,t,n)?U:(e-t)/n}var pf={};pf.P=function(){let e=yf.P.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=W),t},pf.S=function(){let e=yf.S.apply(this,arguments);return Math.sqrt(e)};function mf(){let e=bf.apply(this,arguments);return Math.sqrt(e)}function hf(){let e=xf.apply(this,arguments),t=Math.sqrt(e);return isNaN(t)&&(t=W),t}function gf(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=H.default.mean(t),r=H.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))}Yu.DIST=(e,t,n)=>n!==1&&n!==2?W:n===1?Yu.DIST.RT(e,t):Yu.DIST[`2T`](e,t),Yu.DIST[`2T`]=function(e,t){return arguments.length===2?e<0||t<1?W:typeof e!=`number`||typeof t!=`number`?U:(1-H.default.studentt.cdf(e,t))*2:G},Yu.DIST.RT=function(e,t){return arguments.length===2?e<0||t<1?W:typeof e!=`number`||typeof t!=`number`?U:1-H.default.studentt.cdf(e,t):G},Yu.INV=(e,t)=>(e=X(e),t=X(t),J(e,t)?U:H.default.studentt.inv(e,t)),Yu.INV[`2T`]=(e,t)=>(e=X(e),t=X(t),e<=0||e>1||t<1?W:J(e,t)?U:Math.abs(H.default.studentt.inv(e/2,t))),Yu.TEST=(e,t)=>{if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=H.default.mean(e),r=H.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 Yu.DIST[`2T`](s,e.length+t.length-2)};function _f(e,t,n){if(e=Z(K(e)),t=Z(K(t)),n=Z(K(n)),J(e,t,n))return U;let r=Ld(e,t),i=r[0],a=r[1],o=[];return n.forEach(e=>{o.push(i*e+a)}),o}function vf(e,t){if(e=Z(K(e)),t=X(t),J(e,t))return U;let n=$f(e.length*t,2)/2;return H.default.mean(Il(zl(e.sort((e,t)=>e-t),n),n))}var yf={};yf.P=function(){let e=Ul(K(arguments)),t=e.length,n=0,r=ad(e),i;for(let i=0;i<t;i++)n+=(e[i]-r)**2;return i=n/t,isNaN(i)&&(i=W),i},yf.S=function(){let e=Ul(K(arguments)),t=e.length,n=0,r=ad(e);for(let i=0;i<t;i++)n+=(e[i]-r)**2;return n/(t-1)};function bf(){let e=K(arguments),t=e.length,n=0,r=0,i=od(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 xf(){let e=K(arguments),t=e.length,n=0,r=0,i=od(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=W),a}var Sf={};Sf.DIST=(e,t,n,r)=>(e=X(e),t=X(t),n=X(n),J(e,t,n)?U:r?1-Math.exp(-((e/n)**+t)):e**(t-1)*Math.exp(-((e/n)**+t))*t/n**+t);var Cf={};Cf.TEST=(e,t,n)=>{if(e=Z(K(e)),t=X(t),J(e,t))return U;n||=pf.S(e);let r=e.length;return 1-Yd.S.DIST((ad(e)-t)/(n/Math.sqrt(r)),!0)};function wf(e){return e=X(e),e instanceof Error?e:Math.abs(e)}function Tf(e){if(e=X(e),e instanceof Error)return e;let t=Math.acos(e);return isNaN(t)&&(t=W),t}function Ef(e){if(e=X(e),e instanceof Error)return e;let t=Math.log(e+Math.sqrt(e*e-1));return isNaN(t)&&(t=W),t}function Df(e){return e=X(e),e instanceof Error?e:Math.atan(1/e)}function Of(e){if(e=X(e),e instanceof Error)return e;let t=.5*Math.log((e+1)/(e-1));return isNaN(t)&&(t=W),t}function kf(e,t,n,r){if(e=X(e),t=X(e),J(e,t))return U;switch(e){case 1:return ad(n);case 2:return md(n);case 3:return hd(n);case 4:return Bd(n);case 5:return Wd(n);case 6:return hp(n);case 7:return pf.S(n);case 8:return pf.P(n);case 9:return Pp(n);case 10:return yf.S(n);case 11:return yf.P(n);case 12:return Ud(n);case 13:return qd.SNGL(n);case 14:return Id(n,r);case 15:return df(n,r);case 16:return Zd.INC(n,r);case 17:return af.INC(n,r);case 18:return Zd.EXC(n,r);case 19:return af.EXC(n,r)}}function Af(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 U;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 jf(e){if(e=X(e),e instanceof Error)return e;let t=Math.asin(e);return isNaN(t)&&(t=W),t}function Mf(e){return e=X(e),e instanceof Error?e:Math.log(e+Math.sqrt(e*e+1))}function Nf(e){return e=X(e),e instanceof Error?e:Math.atan(e)}function Pf(e,t){return e=X(e),t=X(t),q(e,t)||Math.atan2(e,t)}function Ff(e){if(e=X(e),e instanceof Error)return e;let t=Math.log((1+e)/(1-e))/2;return isNaN(t)&&(t=W),t}function If(e,t,n){e=X(e),t=X(t),n=X(n);let r=q(e,t,n);if(r)return r;if(t===0)return W;let i=e.toString(t);return Array(Math.max(n+1-i.length,0)).join(`0`)+i}function Lf(e,t){return e=X(e),t=X(t),q(e,t)||(t===0?0:e>0&&t<0?W:Math.ceil(e/t)*t)}Lf.MATH=(e,t,n=0)=>(t===void 0&&(t=e>0?1:-1),e=X(e),t=X(t),n=X(n),q(e,t,n)||(t===0?0:(t=Math.abs(t),n===0||e>0?Math.ceil(e/t)*t:Math.floor(e/t)*t))),Lf.PRECISE=(e,t)=>Lf.MATH(e,t);function Rf(e,t){return e=X(e),t=X(t),q(e,t)||(e<t?W:Zf(e)/(Zf(t)*Zf(e-t)))}function zf(e,t){return e=X(e),t=X(t),q(e,t)||(e<t?W:e===0&&t===0?1:Rf(e+t-1,e-1))}function Bf(e){return e=X(e),e instanceof Error?e:Math.cos(e)}function Vf(e){return e=X(e),e instanceof Error?e:(Math.exp(e)+Math.exp(-e))/2}function Hf(e){return e=X(e),e instanceof Error?e:e===0?tl:1/Math.tan(e)}function Uf(e){if(e=X(e),e instanceof Error)return e;if(e===0)return tl;let t=Math.exp(2*e);return(t+1)/(t-1)}function Wf(e){return e=X(e),e instanceof Error?e:e===0?tl:1/Math.sin(e)}function Gf(e){return e=X(e),e instanceof Error?e:e===0?tl:2/(Math.exp(e)-Math.exp(-e))}function Kf(e,t){if(arguments.length<2)return G;e||=`0`,t=X(t);let n=q(e,t);if(n)return n;if(t===0)return W;let r=parseInt(e,t);return isNaN(r)?W:r}function qf(e){return e=X(e),e instanceof Error?e:e*180/Math.PI}function Jf(e){return e=X(e),e instanceof Error?e:Lf.MATH(e,-2,-1)}function Yf(e){return arguments.length<1?G:arguments.length>1?il:(e=X(e),e instanceof Error||(e=Math.exp(e)),e)}var Xf=[];function Zf(e){if(e=X(e),e instanceof Error)return e;let t=Math.floor(e);return t===0||t===1?1:(Xf[t]>0||(Xf[t]=Zf(t-1)*t),Xf[t])}function Qf(e){if(e=X(e),e instanceof Error)return e;let t=Math.floor(e);return t<=0?1:t*Qf(t-2)}function $f(e,t){return e=X(e),t=X(t),q(e,t)||(t?e>0&&t<0?W:Math.floor(e/t)*t:tl)}$f.MATH=(e,t=1,n=0)=>(e=X(e),t=X(t),n=X(n),q(e,t,n)||(t===0?0:(t=Math.abs(t),n===0||e>0?Math.floor(e/t)*t:Math.ceil(e/t)*t))),$f.PRECISE=(e,t)=>$f.MATH(e,t);function ep(){let e=Z(K(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 tp(e){return e=X(e),e instanceof Error?e:Math.floor(e)}var np={CEILING:Lf};function rp(){let e=Z(K(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 ip(e){return e=X(e),e instanceof Error?e:e===0?W:Math.log(e)}function ap(e,t){return e=X(e),t=t?X(t):10,q(e,t)||(e===0||t===0?W:Math.log(e)/Math.log(t))}function op(e){return e=X(e),e instanceof Error?e:e===0?W:Math.log(e)/Math.log(10)}function sp(e,t){return!Array.isArray(e)||!Array.isArray(t)||e.some(e=>!e.length)||t.some(e=>!e.length)||Fl(e).some(e=>typeof e!=`number`)||Fl(t).some(e=>typeof e!=`number`)||e[0].length!==t.length?U: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 cp(e,t){e=X(e),t=X(t);let n=q(e,t);if(n)return n;if(t===0)return tl;let r=Math.abs(e%t);return r=e<0?t-r:r,t>0?r:-r}function lp(e,t){return e=X(e),t=X(t),q(e,t)||(e*t===0?0:e*t<0?W:Math.round(e/t)*t)}function up(){let e=Z(K(arguments));if(e instanceof Error)return e;let t=0,n=1;for(let r=0;r<e.length;r++)t+=e[r],n*=Zf(e[r]);return Zf(t)/n}function dp(e){return arguments.length>1?G:(e=parseInt(e),!e||e<=0?U:Array(e).fill(0).map(()=>Array(e).fill(0)).map((e,t)=>(e[t]=1,e)))}function fp(e){if(e=X(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 pp(){return Math.PI}function mp(e,t){e=X(e),t=X(t);let n=q(e,t);if(n)return n;if(e===0&&t===0)return W;let r=e**+t;return isNaN(r)?W:r}function hp(){let e=K(arguments).filter(e=>e!=null);if(e.length===0)return 0;let t=Z(e);if(t instanceof Error)return t;let n=1;for(let e=0;e<t.length;e++)n*=t[e];return n}function gp(e,t){return e=X(e),t=X(t),q(e,t)||parseInt(e/t,10)}function _p(e){return e=X(e),e instanceof Error?e:e*Math.PI/180}function vp(){return Math.random()}function yp(e,t){return e=X(e),t=X(t),q(e,t)||e+Math.ceil((t-e+1)*Math.random())-1}function bp(e){if(e=X(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 xp(e,t,n){e=X(e),t=X(t);let r=q(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 Sp(e,t){return xp(e,t,Math.round)}function Cp(e,t){return xp(e,t,Math.floor)}function wp(e,t){return xp(e,t,Math.ceil)}function Tp(e){return e=X(e),e instanceof Error?e:1/Math.cos(e)}function Ep(e){return e=X(e),e instanceof Error?e:2/(Math.exp(e)+Math.exp(-e))}function Dp(e,t,n,r){if(e=X(e),t=X(t),n=X(n),r=Z(r),J(e,t,n,r))return U;let i=r[0]*e**+t;for(let a=1;a<r.length;a++)i+=r[a]*e**+(t+a*n);return i}function Op(e){return e=X(e),e instanceof Error?e:e<0?-1:e===0?0:1}function kp(e){return e=X(e),e instanceof Error?e:Math.sin(e)}function Ap(e){return e=X(e),e instanceof Error?e:(Math.exp(e)-Math.exp(-e))/2}function jp(e){return e=X(e),e instanceof Error?e:e<0?W:Math.sqrt(e)}function Mp(e){return e=X(e),e instanceof Error?e:Math.sqrt(e*Math.PI)}function Np(e,t){if(e=X(e),e instanceof Error)return e;switch(e){case 1:return ad(t);case 2:return md(t);case 3:return hd(t);case 4:return Bd(t);case 5:return Wd(t);case 6:return hp(t);case 7:return pf.S(t);case 8:return pf.P(t);case 9:return Pp(t);case 10:return yf.S(t);case 11:return yf.P(t);case 101:return ad(t);case 102:return md(t);case 103:return hd(t);case 104:return Bd(t);case 105:return Wd(t);case 106:return hp(t);case 107:return pf.S(t);case 108:return pf.P(t);case 109:return Pp(t);case 110:return yf.S(t);case 111:return yf.P(t)}}function Pp(){let e=0;return Al(kl(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=Pp.apply(null,t);n instanceof Error?e=n:e+=n}}),e}function Fp(e,t,n){if(e=K(e),n=n?K(n):e,e instanceof Error)return e;if(t==null||t instanceof Error)return 0;let r=0,i=t===`*`,a=i?null:Dl(t+``);for(let t=0;t<e.length;t++){let o=e[t],s=n[t];if(i)r+=o;else{let e=[xl(o,bl)].concat(a);r+=Ol(e)?s:0}}return r}function Ip(){let e=kl(arguments);return e[0]=jl(K(e[0])),Pp(Jl(...e))}function Lp(){if(!arguments||arguments.length===0)return U;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=X(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=X(e),i instanceof Error)return i;n*=i}t+=n}return t}function Rp(){let e=Z(K(arguments));if(e instanceof Error)return e;let t=0,n=e.length;for(let r=0;r<n;r++)t+=iu(e[r])?e[r]*e[r]:0;return t}function zp(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=0;for(let r=0;r<e.length;r++)n+=e[r]*e[r]-t[r]*t[r];return n}function Bp(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=0;e=Z(K(e)),t=Z(K(t));for(let r=0;r<e.length;r++)n+=e[r]*e[r]+t[r]*t[r];return n}function Vp(e,t){if(e=Z(K(e)),t=Z(K(t)),J(e,t))return U;let n=0;e=K(e),t=K(t);for(let r=0;r<e.length;r++)n+=(e[r]-t[r])**2;return n}function Hp(e){return e=X(e),e instanceof Error?e:Math.tan(e)}function Up(e){if(e=X(e),e instanceof Error)return e;let t=Math.exp(2*e);return(t-1)/(t+1)}function Wp(e,t){return e=X(e),t=X(t),q(e,t)||(e>0?1:-1)*Math.floor(Math.abs(e)*10**t)/10**t}function Gp(e,t){return arguments.length===2?(e=X(e),t=X(t),q(e,t)||e+t):G}function Kp(e,t){return arguments.length===2?(e=X(e),t=X(t),q(e,t)||(t===0?tl:e/t)):G}function qp(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):G}function Jp(e,t){return arguments.length===2?e instanceof Error?e:t instanceof Error?t:(ql(e,t)?(e=Kl(e),t=Kl(t)):(e=X(e),t=X(t)),q(e,t)||e>t):G}function Yp(e,t){return arguments.length===2?(ql(e,t)?(e=Kl(e),t=Kl(t)):(e=X(e),t=X(t)),q(e,t)||e>=t):G}function Xp(e,t){return arguments.length===2?(ql(e,t)?(e=Kl(e),t=Kl(t)):(e=X(e),t=X(t)),q(e,t)||e<t):G}function Zp(e,t){return arguments.length===2?(ql(e,t)?(e=Kl(e),t=Kl(t)):(e=X(e),t=X(t)),q(e,t)||e<=t):G}function Qp(e,t){return arguments.length===2?(e=X(e),t=X(t),q(e,t)||e-t):G}function $p(e,t){return arguments.length===2?(e=X(e),t=X(t),q(e,t)||e*t):G}function em(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):G}function tm(e,t){return arguments.length===2?mp(e,t):G}var nm=Object.freeze({__proto__:null,ADD:Gp,DIVIDE:Kp,EQ:qp,GT:Jp,GTE:Yp,LT:Xp,LTE:Zp,MINUS:Qp,MULTIPLY:$p,NE:em,POW:tm}),rm=[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],im=[[],[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]],am=[[],[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 om(e,t,n){let r;return e=X(e),t=X(t),n=X(n),J(e,t,n)?r=U:(r=new Date(e,t-1,n),r.getFullYear()<0&&(r=W)),cl?fl(r):r}function sm(e,t,n){n=n.toUpperCase(),e=Y(e),t=Y(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(jm(e,t));break;case`D`:l=dm(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=dm(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=dm(t,e)}return l}function cm(e){if(typeof e!=`string`||isNaN(Date.parse(e)))return U;let t=new Date(e);return cl?fl(t):t}function lm(e){let t=Y(e);return t instanceof Error?t:t.getDate()}function um(e){let t=new Date(e);return t.setHours(0,0,0,0),t}function dm(e,t){return e=Y(e),t=Y(t),e instanceof Error?e:t instanceof Error?t:fl(um(e))-fl(um(t))}function fm(e,t,n){if(n=Wl(n||`false`),e=Y(e),t=Y(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 pm(e,t){if(e=Y(e),e instanceof Error)return e;if(isNaN(t))return U;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),cl?fl(e):e}function mm(e,t){if(e=Y(e),e instanceof Error)return e;if(isNaN(t))return U;t=parseInt(t,10);let n=new Date(e.getFullYear(),e.getMonth()+t+1,0);return cl?fl(n):n}function hm(e){return e=Y(e),e instanceof Error?e:e.getHours()}function gm(e){if(e=Y(e),e instanceof Error)return e;e=um(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 _m(e){return e=Y(e),e instanceof Error?e:e.getMinutes()}function vm(e){return e=Y(e),e instanceof Error?e:e.getMonth()+1}function ym(e,t,n){return ym.INTL(e,t,1,n)}ym.INTL=(e,t,n,r)=>{if(e=Y(e),e instanceof Error)return e;if(t=Y(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=am[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=am[n];if(!(n instanceof Array))return U;r===void 0?r=[]:r instanceof Array||(r=[r]);for(let e=0;e<r.length;e++){let t=Y(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 bm(){return cl?fl(new Date):new Date}function xm(e){return e=Y(e),e instanceof Error?e:e.getSeconds()}function Sm(e,t,n){return e=X(e),t=X(t),n=X(n),J(e,t,n)?U:e<0||t<0||n<0?W:(3600*e+60*t+n)/86400}function Cm(e){return e=Y(e),e instanceof Error?e:(3600*e.getHours()+60*e.getMinutes()+e.getSeconds())/86400}function wm(){let e=um(new Date);return cl?fl(e):e}function Tm(e,t){if(e=Y(e),e instanceof Error)return e;t===void 0&&(t=1);let n=e.getDay();return im[t][n]}function Em(e,t){if(e=Y(e),e instanceof Error)return e;if(t===void 0&&(t=1),t===21)return gm(e);let n=rm[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 Dm(e,t,n){return Dm.INTL(e,t,1,n)}Dm.INTL=(e,t,n,r)=>{if(e=Y(e),e instanceof Error)return e;if(t=X(t),t instanceof Error)return t;if(n=n===void 0?am[1]:am[n],!(n instanceof Array))return U;r===void 0?r=[]:r instanceof Array||(r=[r]);for(let e=0;e<r.length;e++){let t=Y(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?U:e};function Om(e){return e=Y(e),e instanceof Error?e:e.getFullYear()}function km(e){return new Date(e,1,29).getMonth()===1}function Am(e,t){return Math.ceil((t-e)/1e3/60/60/24)}function jm(e,t,n){if(e=Y(e),e instanceof Error)return e;if(t=Y(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(km(n)&&e<r&&t>=r)return!0;let i=t.getFullYear(),a=new Date(i,2,1);return km(i)&&t>=a&&e<a},l=365;if(a===c||a+1===c&&(i>s||i===s&&r>=o))return(a===c&&km(a)||n(e,t)||s===1&&o===29)&&(l=366),Am(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 Am(e,t)/d}case 2:return Am(e,t)/360;case 3:return Am(e,t)/365;case 4:return(o+s*30+c*360-(r+i*30+a*360))/360}}function Mm(e){return/^[01]{1,10}$/.test(e)}function Nm(e,t){return e=X(e),t=X(t),J(e,t)?U:$c.default.besseli(e,t)}function Pm(e,t){return e=X(e),t=X(t),J(e,t)?U:$c.default.besselj(e,t)}function Fm(e,t){return e=X(e),t=X(t),J(e,t)?U:$c.default.besselk(e,t)}function Im(e,t){return e=X(e),t=X(t),J(e,t)?U:$c.default.bessely(e,t)}function Lm(e){if(!Mm(e))return W;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 Rm(e,t){if(!Mm(e))return W;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)?U:t<0?W:(t=Math.floor(t),t>=r.length?Gu(`0`,t-r.length)+r:W)}function zm(e,t){if(!Mm(e))return W;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)?U:t<0?W:(t=Math.floor(t),t>=r.length?Gu(`0`,t-r.length)+r:W)}function Bm(e,t){return e=X(e),t=X(t),J(e,t)?U:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?W:e&t}function Vm(e,t){return e=X(e),t=X(t),J(e,t)?U:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?W:t>=0?e<<t:e>>-t}function Hm(e,t){return e=X(e),t=X(t),J(e,t)?U:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?W:e|t}function Um(e,t){return e=X(e),t=X(t),J(e,t)?U:e<0||Math.floor(e)!==e||e>0xffffffffffff||Math.abs(t)>53?W:t>=0?e>>t:e<<-t}function Wm(e,t){return e=X(e),t=X(t),J(e,t)?U:e<0||t<0||Math.floor(e)!==e||Math.floor(t)!==t||e>0xffffffffffff||t>0xffffffffffff?W:e^t}function Gm(e,t,n){if(e=X(e),t=X(t),J(e,t))return e;if(n=n===void 0?`i`:n,n!==`i`&&n!==`j`)return U;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 Km(e,t,n){if(e=X(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]?G:e*o[6]*u/(s[6]*d)}function qm(e,t){if(e=X(e),e instanceof Error)return e;if(!/^-?[0-9]{1,3}$/.test(e)||e<-512||e>511)return W;if(e<0)return`1`+Gu(`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)?U:t<0?W:(t=Math.floor(t),t>=n.length?Gu(`0`,t-n.length)+n:W)}function Jm(e,t){if(e=X(e),e instanceof Error)return e;if(!/^-?[0-9]{1,12}$/.test(e)||e<-549755813888||e>549755813887)return W;if(e<0)return(1099511627776+e).toString(16);let n=parseInt(e,10).toString(16);return t===void 0?n:isNaN(t)?U:t<0?W:(t=Math.floor(t),t>=n.length?Gu(`0`,t-n.length)+n:W)}function Ym(e,t){if(e=X(e),e instanceof Error)return e;if(!/^-?[0-9]{1,9}$/.test(e)||e<-536870912||e>536870911)return W;if(e<0)return(1073741824+e).toString(8);let n=parseInt(e,10).toString(8);return t===void 0?n:isNaN(t)?U:t<0?W:(t=Math.floor(t),t>=n.length?Gu(`0`,t-n.length)+n:W)}function Xm(e,t){return t=t===void 0?0:t,e=X(e),t=X(t),J(e,t)?U:+(e===t)}function Zm(e,t){return t=t===void 0?0:t,e=X(e),t=X(t),J(e,t)?U:H.default.erf(e)}function Qm(e){return isNaN(e)?U:H.default.erfc(e)}function $m(e,t){return t||=0,e=X(e),J(t,e)?e:+(e>=t)}function eh(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return W;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 W;if(n)return`1`+Gu(`0`,9-(512+r).toString(2).length)+(512+r).toString(2);let i=r.toString(2);return t===void 0?i:isNaN(t)?U:t<0?W:(t=Math.floor(t),t>=i.length?Gu(`0`,t-i.length)+i:W)}function th(e){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return W;let t=parseInt(e,16);return t>=549755813888?t-1099511627776:t}function nh(e,t){if(!/^[0-9A-Fa-f]{1,10}$/.test(e))return W;let n=parseInt(e,16);if(n>536870911&&n<0xffe0000000)return W;if(n>=0xffe0000000)return(n-0xffc0000000).toString(8);let r=n.toString(8);return t===void 0?r:isNaN(t)?U:t<0?W:(t=Math.floor(t),t>=r.length?Gu(`0`,t-r.length)+r:W)}function rh(e){let t=_h(e),n=ih(e);return J(t,n)?U:Math.sqrt(t**2+n**2)}function ih(e){if(e===void 0||e===!0||e===!1)return U;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))?W:Number(e.substring(t+1,e.length-1)):isNaN(e.substring(0,n))||isNaN(e.substring(n+1,e.length-1))?W:-Number(e.substring(n+1,e.length-1)):W:i?isNaN(e.substring(0,e.length-1))?W:e.substring(0,e.length-1):isNaN(e)?W:0}function ah(e){let t=_h(e),n=ih(e);return J(t,n)?U:t===0&&n===0?tl: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 oh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,n===0?e:Gm(t,-n,r)}function sh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.cos(t)*(Math.exp(n)+Math.exp(-n))/2,-Math.sin(t)*(Math.exp(n)-Math.exp(-n))/2,r)}function ch(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.cos(n)*(Math.exp(t)+Math.exp(-t))/2,Math.sin(n)*(Math.exp(t)-Math.exp(-t))/2,r)}function lh(e){return J(_h(e),ih(e))?U:uh(sh(e),bh(e))}function uh(e,t){let n=_h(e),r=ih(e),i=_h(t),a=ih(t);if(J(n,r,i,a))return U;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 W;let l=i*i+a*a;return Gm((n*i+r*a)/l,(r*i-n*a)/l,c)}function dh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);r=r===`i`||r===`j`?r:`i`;let i=Math.exp(t);return Gm(i*Math.cos(n),i*Math.sin(n),r)}function fh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.log(Math.sqrt(t*t+n*n)),Math.atan(n/t),r)}function ph(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.log(Math.sqrt(t*t+n*n))/Math.log(10),Math.atan(n/t)/Math.log(10),r)}function mh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.log(Math.sqrt(t*t+n*n))/Math.log(2),Math.atan(n/t)/Math.log(2),r)}function hh(e,t){t=X(t);let n=_h(e),r=ih(e);if(J(t,n,r))return U;let i=e.substring(e.length-1);i=i===`i`||i===`j`?i:`i`;let a=rh(e)**+t,o=ah(e);return Gm(a*Math.cos(t*o),a*Math.sin(t*o),i)}function gh(){let e=arguments[0];if(!arguments.length)return U;for(let t=1;t<arguments.length;t++){let n=_h(e),r=ih(e),i=_h(arguments[t]),a=ih(arguments[t]);if(J(n,r,i,a))return U;e=Gm(n*i-r*a,n*a+r*i)}return e}function _h(e){if(e===void 0||e===!0||e===!1)return U;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))?W:Number(e.substring(0,t)):isNaN(e.substring(0,n))||isNaN(e.substring(n+1,e.length-1))?W:Number(e.substring(0,n)):W:i?isNaN(e.substring(0,e.length-1))?W:0:isNaN(e)?W:e}function vh(e){return e===!0||e===!1||J(_h(e),ih(e))?U:uh(`1`,sh(e))}function yh(e){return J(_h(e),ih(e))?U:uh(`1`,ch(e))}function bh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.sin(t)*(Math.exp(n)+Math.exp(-n))/2,Math.cos(t)*(Math.exp(n)-Math.exp(-n))/2,r)}function xh(e){let t=_h(e),n=ih(e);if(J(t,n))return U;let r=e.substring(e.length-1);return r=r===`i`||r===`j`?r:`i`,Gm(Math.cos(n)*(Math.exp(t)-Math.exp(-t))/2,Math.sin(n)*(Math.exp(t)+Math.exp(-t))/2,r)}function Sh(e){if(J(_h(e),ih(e)))return U;let t=e.substring(e.length-1);t=t===`i`||t===`j`?t:`i`;let n=Math.sqrt(rh(e)),r=ah(e);return Gm(n*Math.cos(r/2),n*Math.sin(r/2),t)}function Ch(e){return e===!0||e===!1?U:J(_h(e),ih(e))?W:uh(`1`,bh(e))}function wh(e){return e===!0||e===!1?U:J(_h(e),ih(e))?W:uh(`1`,xh(e))}function Th(e,t){let n=_h(e),r=ih(e),i=_h(t),a=ih(t);if(J(n,r,i,a))return U;let o=e.substring(e.length-1),s=t.substring(t.length-1),c=`i`;return(o===`j`||s===`j`)&&(c=`j`),Gm(n-i,r-a,c)}function Eh(){if(!arguments.length)return U;let e=K(arguments),t=0,n=0;for(let r of e){let e=+_h(r),i=+ih(r);if(J(e,i))return U;t+=e,n+=i}return Gm(t,n,`i`)}function Dh(e){return e===!0||e===!1||J(_h(e),ih(e))?U:uh(bh(e),sh(e))}function Oh(e,t){if(!/^[0-7]{1,10}$/.test(e))return W;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 W;if(n)return`1`+Gu(`0`,9-(512+r).toString(2).length)+(512+r).toString(2);let i=r.toString(2);return t===void 0?i:isNaN(t)?U:t<0?W:(t=Math.floor(t),t>=i.length?Gu(`0`,t-i.length)+i:W)}function kh(e){if(!/^[0-7]{1,10}$/.test(e))return W;let t=parseInt(e,8);return t>=536870912?t-1073741824:t}function Ah(e,t){if(!/^[0-7]{1,10}$/.test(e))return W;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)?U:t<0?W:(t=Math.floor(t),t>=r.length?Gu(`0`,t-r.length)+r:W)}var jh=ld.DIST,Mh=ld.INV,Nh=ud.DIST,Ph=Lf.MATH,Fh=Lf.PRECISE,Ih=dd.DIST,Lh=dd.DIST.RT,Rh=dd.INV,zh=dd.INV.RT,Bh=dd.TEST,Vh=yd.P,Hh=yd.P,Uh=yd.S,Wh=ud.INV,Gh=Qm.PRECISE,Kh=Zm.PRECISE,qh=xd.DIST,Jh=Sd.DIST,Yh=Sd.DIST.RT,Xh=Sd.INV,Zh=Sd.INV.RT,Qh=$f.MATH,$h=$f.PRECISE,eg=Sd.TEST,tg=Dd.DIST,ng=Dd.INV,rg=Od.PRECISE,ig=Nd.DIST,ag=zd.INV,og=zd.DIST,sg=zd.INV,cg=qd.MULT,lg=qd.SNGL,ug=Jd.DIST,dg=ym.INTL,fg=Yd.DIST,pg=Yd.INV,mg=Yd.S.DIST,hg=Yd.S.INV,gg=Zd.EXC,_g=Zd.INC,vg=Qd.EXC,yg=Qd.INC,bg=nf.DIST,xg=af.EXC,Sg=af.INC,Cg=of.AVG,wg=of.EQ,Tg=lf.P,Eg=pf.P,Dg=pf.S,Og=Yu.DIST,kg=Yu.DIST.RT,Ag=Yu.INV,jg=Yu.TEST,Mg=yf.P,Ng=yf.S,Pg=Sf.DIST,Fg=Dm.INTL,Ig=Cf.TEST;function Lg(e){let t=[];return Al(e,e=>{e&&t.push(e)}),t}function Rg(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=Dl(c[t]+``);o=Ol([xl(e[i][a],bl)].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 zg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=0;return Al(r,e=>{a+=i[e]}),r.length===0?tl:a/r.length}function Bg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),md(a)}function Vg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),hd(a)}function Hg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];return i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]),r.length===0?U:r.length>1?W:i[r[0]]}function Ug(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=i[r[0]];return Al(r,e=>{a<i[e]&&(a=i[e])}),a}function Wg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=i[r[0]];return Al(r,e=>{a>i[e]&&(a=i[e])}),a}function Gg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];Al(r,e=>{a.push(i[e])}),a=Lg(a);let o=1;return Al(a,e=>{o*=e}),o}function Kg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),a=Lg(a),pf.S(a)}function qg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),a=Lg(a),pf.P(a)}function Jg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),Pp(a)}function Yg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),yf.S(a)}function Xg(e,t,n){if(isNaN(t)&&typeof t!=`string`)return U;let r=Rg(e,n),i=[];i=zl(typeof t==`string`?e[Vl(e,t)]:e[t]);let a=[];return Al(r,e=>{a.push(i[e])}),yf.P(a)}function Zg(e){return e&&e.getTime&&!isNaN(e.getTime())}function Qg(e){return e instanceof Date?e:new Date(e)}function $g(e,t,n){let r=Y(t);for(r.setFullYear(e.getFullYear()),r<e&&r.setFullYear(r.getFullYear()+1);r>e;)r.setMonth(r.getMonth()+-12/n);return r}function e_(e){return e=X(e),[1,2,4].indexOf(e)===-1?W:e}function t_(e){return e=X(e),[0,1,2,3,4].indexOf(e)===-1?W:e}function n_(e,t,n,r,i,a,o){return e=Qg(e),t=Qg(t),n=Qg(n),a=e_(a),o=t_(o),q(a,o)?W:!Zg(e)||!Zg(t)||!Zg(n)?U:r<=0||i<=0||n<=e?W:(i||=0,o||=0,i*r*jm(e,n,o))}function r_(e,t,n,r){if(r=t_(r),n=e_(n),e=Y(e),t=Y(t),q(e,t))return U;if(q(n,r)||e>=t)return W;if(r===1){let r=$g(e,t,n),i=Y(r);return i.setMonth(i.getMonth()+12/n),sm(r,i,`D`)}let i;switch(r){case 0:case 2:case 4:i=360;break;case 3:i=365;break;default:return W}return i/n}function i_(e,t,n,r,i,a){if(e=X(e),t=X(t),n=X(n),J(e,t,n))return U;if(e<=0||t<=0||n<=0||r<1||i<1||r>i||a!==0&&a!==1)return W;let o=S_(e,t,n,0,a),s=0;r===1&&(a===0&&(s=-n),r++);for(let t=r;t<=i;t++)s+=a===1?f_(e,t-2,o,n,1)-o:f_(e,t-1,o,n,0);return s*=e,s}function a_(e,t,n,r,i,a){if(e=X(e),t=X(t),n=X(n),J(e,t,n))return U;if(e<=0||t<=0||n<=0||r<1||i<1||r>i||a!==0&&a!==1)return W;let o=S_(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-(f_(e,t-2,o,n,1)-o)*e:o-f_(e,t-1,o,n,0)*e;return s}function o_(e,t,n,r,i){if(i=i===void 0?12:i,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i))return U;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 W;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 s_(e,t,n,r,i){if(i=i===void 0?2:i,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i))return U;if(e<0||t<0||n<0||r<0||i<=0||r>n)return W;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 c_(e,t,n,r,i){if(e=Y(e),t=Y(t),n=X(n),r=X(r),i=X(i),i||=0,J(e,t,n,r,i))return U;if(n<=0||r<=0)return W;if(e>=t)return U;let a,o;switch(i){case 0:a=360,o=fm(e,t,!1);break;case 1:a=365,o=sm(e,t,`D`);break;case 2:a=360,o=sm(e,t,`D`);break;case 3:a=365,o=sm(e,t,`D`);break;case 4:a=360,o=fm(e,t,!0);break;default:return W}return(r-n)/r*a/o}function l_(e,t){if(e=X(e),t=X(t),J(e,t))return U;if(t<0)return W;if(t>=0&&t<1)return tl;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 u_(e,t){if(e=X(e),t=X(t),J(e,t))return U;if(t<0)return W;if(t>=0&&t<1)return tl;t=parseInt(t,10);let n=parseInt(e,10);return n+=e%1*10**-Math.ceil(Math.log(t)/Math.LN10)*t,n}function d_(e,t){return e=X(e),t=X(t),J(e,t)?U:e<=0||t<1?W:(t=parseInt(t,10),(1+e/t)**+t-1)}function f_(e,t,n,r,i){if(r||=0,i||=0,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i))return U;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 p_(e,t){if(e=X(e),t=Z(K(t)),J(e,t))return U;let n=t.length,r=e;for(let e=0;e<n;e++)r*=1+t[e];return r}function m_(e,t,n,r,i,a){if(i||=0,a||=0,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),a=X(a),J(e,t,n,r,i,a))return U;let o=S_(e,n,r,i,a);return(t===1?a===1?0:-r:a===1?f_(e,t-2,o,r,1)-o:f_(e,t-1,o,r,0))*e}function h_(e,t){if(t=typeof t==`number`?t:t===void 0?.1:X(t),e=K(e).filter(Yl),e=Z(e),J(e,t))return U;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 W;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 g_(e,t,n,r){return e=X(e),t=X(t),n=X(n),r=X(r),J(e,t,n,r)?U:r*e*(t/n-1)}function __(e,t,n){if(e=Z(K(e)),t=X(t),n=X(n),J(e,t,n))return U;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(-b_(n,a)*(1+n)**(r-1)/(b_(t,i)*(1+t)))**(1/(r-1))-1}function v_(e,t){return e=X(e),t=X(t),J(e,t)?U:e<=0||t<1?W:(t=parseInt(t,10),((e+1)**(1/t)-1)*t)}function y_(e,t,n,r,i){if(i=i===void 0?0:i,r=r===void 0?0:r,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i))return U;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 b_(){let e=Z(K(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 x_(e,t,n){return e=X(e),t=X(t),n=X(n),J(e,t,n)?U:e<=0?W:(Math.log(n)-Math.log(t))/Math.log(1+e)}function S_(e,t,n,r,i){if(r||=0,i||=0,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i))return U;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 C_(e,t,n,r,i,a){return i||=0,a||=0,e=X(e),n=X(n),r=X(r),i=X(i),a=X(a),J(e,n,r,i,a)?U:S_(e,n,r,i,a)-m_(e,t,n,r,i,a)}function w_(e,t,n,r,i){if(e=Y(e),t=Y(t),n=X(n),r=X(r),i=X(i),i||=0,J(e,t,n,r,i))return U;if(n<=0||r<=0)return W;if(e>=t)return U;let a,o;switch(i){case 0:a=360,o=fm(e,t,!1);break;case 1:a=365,o=sm(e,t,`D`);break;case 2:a=360,o=sm(e,t,`D`);break;case 3:a=365,o=sm(e,t,`D`);break;case 4:a=360,o=fm(e,t,!0);break;default:return W}return r-n*r*o/a}function T_(e,t,n,r,i){return r||=0,i||=0,e=X(e),t=X(t),n=X(n),r=X(r),i=X(i),J(e,t,n,r,i)?U:e===0?-n*t-r:((1-(1+e)**+t)/e*n*(1+e*i)-r)/(1+e)**+t}function E_(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=X(e),t=X(t),n=X(n),r=X(r),i=X(i),a=X(a),J(e,t,n,r,i,a))return U;let o=1e-10,s=a;i=+!!i;for(let a=0;a<100;a++){if(s<=-1)return W;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 D_(e,t,n){return e=X(e),t=X(t),n=X(n),J(e,t,n)?U:e===0||t===0?W:(n/t)**(1/e)-1}function O_(e,t,n){return e=X(e),t=X(t),n=X(n),J(e,t,n)?U:n===0?W:(e-t)/n}function k_(e,t,n,r){return e=X(e),t=X(t),n=X(n),r=X(r),J(e,t,n,r)?U:n===0||r<1||r>n?W:(r=parseInt(r,10),(e-t)*(n-r+1)*2/(n*(n+1)))}function A_(e,t,n){return e=Y(e),t=Y(t),n=X(n),J(e,t,n)?U:n<=0||e>t||t-e>31536e6?W:365*n/(360-n*fm(e,t,!1))}function j_(e,t,n){return e=Y(e),t=Y(t),n=X(n),J(e,t,n)?U:n<=0||e>t||t-e>31536e6?W:100*(1-n*fm(e,t,!1)/360)}function M_(e,t,n){return e=Y(e),t=Y(t),n=X(n),J(e,t,n)?U:n<=0||e>t||t-e>31536e6?W:(100-n)*360/(n*fm(e,t,!1))}function N_(e,t,n){if(e=Z(K(e)),t=Gl(K(t)),n=X(n),J(e,t,n))return U;let r=(e,t,n)=>{let r=n+1,i=e[0];for(let n=1;n<e.length;n++)i+=e[n]/r**(dm(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=dm(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 W;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 P_(e,t,n){if(e=X(e),t=Z(K(t)),n=Gl(K(n)),J(e,t,n))return U;let r=0;for(let i=0;i<t.length;i++)r+=t[i]/(1+e)**(dm(n[i],n[0])/365);return r}function F_(){let e=K(arguments),t=U;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===U&&(t=!0),e[n]||(t=!1))}return t}function I_(){return!1}function L_(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 R_(){for(let e=0;e<arguments.length/2;e++)if(arguments[e*2])return arguments[e*2+1];return G}function z_(e,t){return $l(e)?t:e}function B_(e,t){return e===G?t:e}function V_(e){return typeof e==`string`?U:e instanceof Error?e:!e}function H_(){let e=K(arguments),t=U;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===U&&(t=!1),e[n]&&(t=!0))}return t}function U_(){return!0}function W_(){let e=K(arguments),t=U;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===U&&(t=0),e[n]&&t++)}return t===U?t:!!(Math.floor(Math.abs(t))&1)}function G_(){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:G)}else e=U;return e}var K_={errors:sl,symbols:nm,date:pl},q_=Qc;function J_(e){let t=e.split(`.`).reduce((e,t)=>e?.[t],q_);if(typeof t!=`function`)throw Error(`@formulajs/formulajs has no ${e}.`);return t}function Y_(e){return typeof e==`number`?Number.isFinite(e)?e:N.NUM:e instanceof Error?cn(e.message)??N.VALUE:typeof e==`boolean`||typeof e==`string`?e:N.VALUE}var X_=(e,t)=>{try{return Y_(e(...t))}catch{return N.VALUE}};function Z_(e,t){return ms([e],t)}function Q_(e,t){let n=V(e,t);if(n instanceof M)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 M)return i;t.push(typeof i==`number`?i:0)}r.push(t)}return r}function $_(e,t,n){let r=t.split(`?`)[0]?.length??0,i=t.replace(`?`,``),a=J_(n);z(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`?L(r):e===`b`?mo(r):R(r);if(a instanceof M)return a;t.push(a)}return X_(a,t)},{from:`formulajs`})}function ev(e,t,n){let r=t.replace(`?`,``),i=r.endsWith(`r`),a=J_(n);B(e,Array.from({length:t.length},(e,n)=>{let r=t.charAt(n);return r===`?`?`?`:i&&n===t.length-1?`(r)`:`lm`.includes(r)?`r`:`v`}).join(``),(e,t)=>{let n=[];for(let[a,o]of e.entries()){let s=i&&a>=r.length-1?`r`:r.charAt(a);if(s===`r`){let r=ms(e.slice(a),t);if(r instanceof M)return r;n.push(r);break}if(o instanceof Gr){n.push(void 0);continue}let c;if(s===`l`)c=Z_(o,t);else if(s===`m`)c=Q_(o,t);else{let e=t.calc.scalar(o,t.frame);c=s===`n`?L(e):s===`b`?mo(e):R(e)}if(c instanceof M)return c;n.push(c)}return X_(a,n)},{from:`formulajs`})}function tv(e,t,n=``,r=1){let i=J_(t),a=n.length;B(e,`${`v`.repeat(a)}rr`,(e,t)=>{let n=[];for(let r of e.slice(0,a)){let e=L(t.calc.scalar(r,t.frame));if(e instanceof M)return e;n.push(e)}let o=V(e[a],t),s=V(e[a+1],t);if(o instanceof M)return o;if(s instanceof M)return s;if(o.rows*o.cols!==s.rows*s.cols)return N.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 M)return n;if(r instanceof M)return r;typeof n==`number`&&typeof r==`number`&&(c.push(n),l.push(r))}if(c.length<r)return N.DIV0;let u=X_(i,[...n,c,l]);return u===N.NUM?N.DIV0:u},{from:`formulajs`})}function nv(e,t,n=!1,r=1,i=N.DIV0){let a=J_(t);B(e,`(r)`,(e,t)=>{let o=n?hs(e,t):ms(e,t);if(o instanceof M)return o;if(o.length<r)return i;let s=X_(a,[o]);return s===N.NUM&&i===N.DIV0?N.DIV0:s},{from:`formulajs`})}function rv(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?``:yn(Number(n));if(a===void 0)return o;let s=i===void 0?``:yn(Number(i));return`${o}${r??``}${s===`1`?``:s}${a}`}function iv(e,t){let n=J_(e);z(e,t.length,t.length,(...e)=>{let r=[];for(let[n,i]of e.entries()){let e=t.charAt(n)===`n`?L(i):R(i);if(e instanceof M)return e;r.push(e)}let i=X_(n,r);return typeof i==`string`?rv(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.INT.LN.LOG10.ODD.RADIANS.SEC.SECH.SIGN.SIN.SINH.SQRT.SQRTPI.TAN.TANH`.split(`.`))$_(e,`n`,e);for(let e of[`COMBIN`,`COMBINA`,`MROUND`,`PERMUT`,`PERMUTATIONA`,`POWER`])$_(e,`nn`,e);$_(`TRUNC`,`n?n`,`TRUNC`),$_(`CEILING`,`nn`,`CEILING`),$_(`FLOOR`,`nn`,`FLOOR`),$_(`CEILING.MATH`,`n?nn`,`CEILINGMATH`),$_(`FLOOR.MATH`,`n?nn`,`FLOORMATH`),$_(`CEILING.PRECISE`,`n?n`,`CEILINGPRECISE`),$_(`FLOOR.PRECISE`,`n?n`,`FLOORPRECISE`),ds(`ISO.CEILING`,`CEILING.PRECISE`),z(`PI`,0,0,()=>Math.PI),B(`RAND`,``,(e,t)=>t.calc.random(),{volatile:!0}),B(`RANDBETWEEN`,`vv`,(e,t)=>{let n=L(t.calc.scalar(e[0],t.frame)),r=L(t.calc.scalar(e[1],t.frame));if(n instanceof M)return n;if(r instanceof M)return r;let i=Math.ceil(n),a=Math.floor(r);return i>a?N.NUM:i+Math.floor(t.calc.random()*(a-i+1))},{volatile:!0}),nv(`MULTINOMIAL`,`MULTINOMIAL`),nv(`AVEDEV`,`AVEDEV`,!1,1,N.NUM),nv(`DEVSQ`,`DEVSQ`,!1,1,N.NUM),nv(`MEDIAN`,`MEDIAN`,!1,1,N.NUM),nv(`SKEW`,`SKEW`,!1,3),nv(`SKEW.P`,`SKEW.P`,!1,3),nv(`STDEV.S`,`STDEV.S`,!1,2),nv(`STDEV.P`,`STDEV.P`,!1,1),nv(`VAR.S`,`VAR.S`,!1,2),nv(`VAR.P`,`VAR.P`,!1,1),nv(`STDEVA`,`STDEVA`,!0,2),nv(`STDEVPA`,`STDEVPA`,!0,1),nv(`VARA`,`VARA`,!0,2),nv(`VARPA`,`VARPA`,!0,1);for(let[e,t]of[[`STDEV`,`STDEV.S`],[`STDEVP`,`STDEV.P`],[`VAR`,`VAR.S`],[`VARP`,`VAR.P`]])ds(e,t);ev(`PERCENTILE.INC`,`ln`,`PERCENTILE.INC`),ev(`PERCENTILE.EXC`,`ln`,`PERCENTILE.EXC`),ev(`PERCENTRANK.INC`,`ln?n`,`PERCENTRANK.INC`),ev(`PERCENTRANK.EXC`,`ln?n`,`PERCENTRANK.EXC`),ev(`QUARTILE.EXC`,`ln`,`QUARTILE.EXC`),ev(`TRIMMEAN`,`ln`,`TRIMMEAN`),ds(`PERCENTILE`,`PERCENTILE.INC`),ds(`PERCENTRANK`,`PERCENTRANK.INC`),tv(`CORREL`,`CORREL`),tv(`PEARSON`,`PEARSON`),tv(`RSQ`,`RSQ`),tv(`SLOPE`,`SLOPE`),tv(`INTERCEPT`,`INTERCEPT`),tv(`STEYX`,`STEYX`,``,3),tv(`COVARIANCE.P`,`COVARIANCE.P`),tv(`COVARIANCE.S`,`COVARIANCE.S`,``,2),tv(`FORECAST`,`FORECAST`,`n`),ds(`FORECAST.LINEAR`,`FORECAST`),ds(`COVAR`,`COVARIANCE.P`),$_(`PV`,`nnn?nn`,`PV`),$_(`NPER`,`nnn?nn`,`NPER`),$_(`RATE`,`nnn?nnn`,`RATE`),$_(`SYD`,`nnnn`,`SYD`),$_(`DDB`,`nnnn?n`,`DDB`),$_(`ISPMT`,`nnnn`,`ISPMT`),$_(`EFFECT`,`nn`,`EFFECT`),$_(`NOMINAL`,`nn`,`NOMINAL`),$_(`CUMIPMT`,`nnnnnn`,`CUMIPMT`),$_(`CUMPRINC`,`nnnnnn`,`CUMPRINC`),$_(`DOLLARDE`,`nn`,`DOLLARDE`),$_(`DOLLARFR`,`nn`,`DOLLARFR`),$_(`PDURATION`,`nnn`,`PDURATION`),$_(`RRI`,`nnn`,`RRI`),ev(`IRR`,`l?n`,`IRR`),ev(`MIRR`,`lnn`,`MIRR`),ev(`NPV`,`nr`,`NPV`),ev(`FVSCHEDULE`,`nl`,`FVSCHEDULE`);for(let e of[`BIN2DEC`,`HEX2DEC`,`OCT2DEC`,`IMABS`,`IMAGINARY`,`IMARGUMENT`,`IMREAL`])$_(e,`t`,e);for(let e of[`IMCONJUGATE`,`IMCOS`,`IMCOSH`,`IMCOT`,`IMCSC`,`IMCSCH`,`IMEXP`,`IMLN`,`IMLOG10`,`IMLOG2`,`IMSEC`,`IMSECH`,`IMSIN`,`IMSINH`,`IMSQRT`,`IMTAN`])iv(e,`t`);for(let e of[`BIN2OCT`,`HEX2BIN`,`HEX2OCT`,`OCT2BIN`])$_(e,`t?n`,e);for(let e of[`DEC2BIN`,`DEC2OCT`])$_(e,`n?n`,e);for(let[e,t]of[[`BIN2HEX`,`t`],[`OCT2HEX`,`t`],[`DEC2HEX`,`n`]]){let n=J_(e);z(e,1,2,(e,r)=>{let i=t===`n`?L(e):R(e);if(i instanceof M)return i;let a=r===void 0?void 0:L(r);if(a instanceof M)return a;let o=X_(n,[i,a]);return typeof o==`string`?o.toUpperCase():o},{from:`formulajs`})}iv(`IMDIV`,`tt`),iv(`IMSUB`,`tt`),iv(`IMPOWER`,`tn`),$_(`COMPLEX`,`nn?t`,`COMPLEX`),$_(`DECIMAL`,`tn`,`DECIMAL`),$_(`ARABIC`,`t`,`ARABIC`);for(let e of[`IMSUM`,`IMPRODUCT`]){let t=J_(e);B(e,`(r)`,(e,n)=>{let r=[],i;if(fs(e,n,e=>{if(i||e===null)return;let t=R(e);t instanceof M?i=t:r.push(t)}),i)return i;let a=X_(t,r);return typeof a==`string`?rv(a):a},{from:`formulajs`})}$_(`DELTA`,`n?n`,`DELTA`),$_(`GESTEP`,`n?n`,`GESTEP`);var av=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.00016431823292116355,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],ov=607/128,sv=.5*Math.log(2*Math.PI);function cv(e){if(Number.isInteger(e)&&e<=171)return Math.log(lv(e));let t=av[0]??0;for(let n=1;n<av.length;n++)t+=(av[n]??0)/(e+n);let n=e+ov+.5;return sv+Math.log(t/e)+(e+.5)*Math.log(n)-n}function lv(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)*lv(1-e)):Math.exp(cv(e))}var uv=1e-16,dv=1e-300,fv=1e5;function pv(e,t){if(t<=0)return 0;if(t<e+1){let n=1/e,r=n,i=e;for(let e=0;e<fv&&(i+=1,n*=t/i,r+=n,!(Math.abs(n)<Math.abs(r)*uv));e++);return r*Math.exp(-t+e*Math.log(t)-cv(e))}return 1-mv(e,t)}function mv(e,t){if(t<=0)return 1;if(t<e+1)return 1-pv(e,t);let n=t+1-e,r=1/dv,i=1/n,a=i;for(let t=1;t<fv;t++){let o=-t*(t-e);n+=2,i=o*i+n,Math.abs(i)<dv&&(i=dv),r=n+o/r,Math.abs(r)<dv&&(r=dv),i=1/i;let s=i*r;if(a*=s,Math.abs(s-1)<uv)break}return Math.exp(-t+e*Math.log(t)-cv(e))*a}function hv(e,t,n){let r=e+t,i=e+1,a=e-1,o=1,s=1-r*n/i;Math.abs(s)<dv&&(s=dv),s=1/s;let c=s;for(let l=1;l<fv;l++){let u=2*l,d=l*(t-l)*n/((a+u)*(e+u));s=1+d*s,Math.abs(s)<dv&&(s=dv),o=1+d/o,Math.abs(o)<dv&&(o=dv),s=1/s,c*=s*o,d=-(e+l)*(r+l)*n/((e+u)*(i+u)),s=1+d*s,Math.abs(s)<dv&&(s=dv),o=1+d/o,Math.abs(o)<dv&&(o=dv),s=1/s;let f=s*o;if(c*=f,Math.abs(f-1)<uv)break}return c}function gv(e,t,n){if(n<=0)return 0;if(n>=1)return 1;let r=Math.exp(cv(e+t)-cv(e)-cv(t)+e*Math.log(n)+t*Math.log1p(-n));return n<(e+1)/(e+t+2)?r*hv(e,t,n)/e:1-r*hv(t,e,1-n)/t}var _v=e=>e===0?0:(e<0?-1:1)*pv(.5,e*e),vv=e=>e<0?2-vv(-e):mv(.5,e*e),yv=e=>Math.exp(-e*e/2)/Math.sqrt(2*Math.PI),bv=e=>vv(-e/Math.SQRT2)/2,xv=(e,t)=>e.reduce((e,n)=>e*t+n,0),Sv={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 Cv(e){let t=e-.5;if(t===0)return 0;if(Math.abs(t)<=.425){let e=.180625-t*t;return t*xv(Sv.a,e)/xv(Sv.b,e)}let n=t<0?e:1-e,r=Math.sqrt(-Math.log(n)),i=r<=5?xv(Sv.c,r-1.6)/xv(Sv.d,r-1.6):xv(Sv.e,r-5)/xv(Sv.f,r-5);return t<0?-i:i}function wv(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 Tv(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 Ev=4e4;function Dv(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 Ov(e,t){let n=Tv(n=>Math.sin(t*Math.sin(n)-e*n),0,Math.PI,Ev),r=Math.asinh((760+2*e*e)/t)+2,i=e%2==0?1:-1;return(n-Tv(n=>(Math.exp(e*n)+i*Math.exp(-e*n))*Math.exp(-t*Math.sinh(n)),0,r,Ev))/Math.PI}function kv(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 Av(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 jv(e,t,n,r){z(e,t,n,(...e)=>{let t=[];for(let n of e){let e=n===void 0?NaN:L(n);if(e instanceof M)return e;t.push(e)}return r(...t)})}function Mv(e,t,n,r=0){z(e,t+1,t+1+r,(...e)=>{let r=mo(e[t]);if(r instanceof M)return r;let i=[];for(let[n,r]of e.entries()){if(n===t)continue;let e=r===void 0?NaN:L(r);if(e instanceof M)return e;i.push(e)}return n(r,...i)})}var Nv=e=>Number.isFinite(e)?e:N.NUM;Mv(`NORM.DIST`,3,(e,t=0,n=0,r=0)=>{if(r<=0)return N.NUM;let i=(t-n)/r;return e?bv(i):yv(i)/r}),jv(`NORM.INV`,3,3,(e=0,t=0,n=0)=>e<=0||e>=1||n<=0?N.NUM:t+n*Cv(e)),z(`NORM.S.DIST`,1,2,(e,t)=>{let n=L(e);if(n instanceof M)return n;let r=t===void 0||mo(t);return r instanceof M?r:r?bv(n):yv(n)}),jv(`NORMSDIST`,1,1,(e=0)=>bv(e)),jv(`NORM.S.INV`,1,1,(e=0)=>e<=0||e>=1?N.NUM:Cv(e)),Mv(`LOGNORM.DIST`,3,(e,t=0,n=0,r=0)=>{if(t<=0||r<=0)return N.NUM;let i=(Math.log(t)-n)/r;return e?bv(i):yv(i)/(t*r)}),jv(`LOGNORMDIST`,3,3,(e=0,t=0,n=0)=>e<=0||n<=0?N.NUM:bv((Math.log(e)-t)/n)),jv(`LOGNORM.INV`,3,3,(e=0,t=0,n=0)=>e<=0||e>=1||n<=0?N.NUM:Math.exp(t+n*Cv(e))),jv(`STANDARDIZE`,3,3,(e=0,t=0,n=0)=>n<=0?N.NUM:(e-t)/n),jv(`GAUSS`,1,1,(e=0)=>bv(e)-.5),jv(`PHI`,1,1,(e=0)=>yv(e)),jv(`FISHER`,1,1,(e=0)=>e<=-1||e>=1?N.NUM:.5*Math.log((1+e)/(1-e))),jv(`FISHERINV`,1,1,(e=0)=>{let t=Math.exp(2*e);return(t-1)/(t+1)}),jv(`CONFIDENCE.NORM`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(n);return e<=0||e>=1||t<=0||r<1?N.NUM:Cv(1-e/2)*t/Math.sqrt(r)});var Pv=(e,t)=>gv(t/2,.5,t/(t+e*e)),Fv=(e,t)=>e<0?Pv(e,t)/2:1-Pv(e,t)/2;Mv(`T.DIST`,2,(e,t=0,n=0)=>{let r=Math.trunc(n);return r<1?N.NUM:e?Fv(t,r):Math.exp(cv((r+1)/2)-cv(r/2))/Math.sqrt(r*Math.PI)*(1+t*t/r)**(-(r+1)/2)}),jv(`T.DIST.2T`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<0||n<1?N.NUM:Pv(e,n)}),jv(`T.DIST.RT`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return n<1?N.NUM:e<0?1-Pv(e,n)/2:Pv(e,n)/2}),jv(`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?N.NUM:Pv(e,r)*i/2}),jv(`T.INV`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<=0||e>=1||n<1?N.NUM:e===.5?0:e<.5?-Iv(2*e,n):Iv(2*(1-e),n)});var Iv=(e,t)=>wv(e=>-Pv(e,t),-e,0,1);jv(`T.INV.2T`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<=0||e>1||n<1?N.NUM:Iv(e,n)}),jv(`CONFIDENCE.T`,3,3,(e=0,t=0,n=0)=>{let r=Math.trunc(n);return e<=0||e>=1||t<=0||r<1?N.NUM:r===1?N.DIV0:Iv(e,r-1)*t/Math.sqrt(r)}),Mv(`CHISQ.DIST`,2,(e,t=0,n=0)=>{let r=Math.trunc(n);return t<0||r<1?N.NUM:e?pv(r/2,t/2):t===0?r===2?.5:r<2?N.NUM:0:Math.exp((r/2-1)*Math.log(t)-t/2-r/2*Math.LN2-cv(r/2))}),jv(`CHISQ.DIST.RT`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<0||n<1?N.NUM:mv(n/2,e/2)}),jv(`CHISQ.INV`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<0||e>=1||n<1?N.NUM:e===0?0:wv(e=>pv(n/2,e/2),e,0,n)}),jv(`CHISQ.INV.RT`,2,2,(e=0,t=0)=>{let n=Math.trunc(t);return e<=0||e>1||n<1?N.NUM:e===1?0:wv(e=>-mv(n/2,e/2),-e,0,n)});var Lv=(e,t,n)=>gv(t/2,n/2,t*e/(t*e+n)),Rv=(e,t,n)=>gv(n/2,t/2,n/(t*e+n));Mv(`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 N.NUM;if(e)return Lv(t,i,a);if(t===0)return i===2?1:i<2?N.NUM:0;let o=cv((i+a)/2)-cv(i/2)-cv(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)}),jv(`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?N.NUM:Rv(e,r,i)}),jv(`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?N.NUM:e===0?0:e===1?N.NUM:wv(e=>Lv(e,r,i),e,0,1)}),jv(`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?N.NUM:e===1?0:wv(e=>-Rv(e,r,i),-e,0,1)}),Mv(`GAMMA.DIST`,3,(e,t=0,n=0,r=0)=>t<0||n<=0||r<=0?N.NUM:e?pv(n,t/r):t===0?n===1?1/r:n<1?N.NUM:0:Math.exp((n-1)*Math.log(t)-t/r-n*Math.log(r)-cv(n))),jv(`GAMMA.INV`,3,3,(e=0,t=0,n=0)=>e<0||e>=1||t<=0||n<=0?N.NUM:e===0?0:n*wv(e=>pv(t,e),e,0,t));var zv=(e,t,n)=>Math.exp(cv(t+n)-cv(t)-cv(n)+(t-1)*Math.log(e)+(n-1)*Math.log1p(-e));Mv(`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 N.NUM;let c=(t-o)/(s-o);return e?gv(n,r,c):zv(c,n,r)/(s-o)},2),jv(`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?N.NUM:gv(t,n,(e-a)/(o-a))}),jv(`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?N.NUM:a+(o-a)*wv(e=>gv(t,n,e),e,0,.5,1)}),ds(`BETAINV`,`BETA.INV`);var Bv=(e,t)=>cv(e+1)-cv(t+1)-cv(e-t+1),Vv=(e,t,n)=>n===0?+(e===0):n===1?+(e===t):Math.exp(Bv(t,e)+e*Math.log(n)+(t-e)*Math.log1p(-n)),Hv=(e,t,n)=>e>=t||n===0?1:n===1?0:1-gv(e+1,t-e,n);Mv(`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?N.NUM:e?Hv(i,a,r):Vv(i,a,r)}),jv(`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 N.NUM;for(let e=0;e<r;e++)if(Hv(e,r,t)>=n)return e;return r}),jv(`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 N.NUM;let s=0;for(let e=a;e<=o;e++)s+=Vv(e,i,t);return s}),Mv(`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?N.NUM:e?gv(a,i+1,r):r===0||r===1?+(r===1&&i===0):Math.exp(Bv(i+a-1,a-1)+a*Math.log(r)+i*Math.log1p(-r))}),jv(`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?N.NUM:n===0||n===1?+(n===1&&r===0):Math.exp(Bv(r+i-1,i-1)+i*Math.log(n)+r*Math.log1p(-n))}),Mv(`POISSON.DIST`,2,(e,t=0,n=0)=>{let r=Math.trunc(t);return r<0||n<0?N.NUM:n===0?e||r===0?1:0:e?mv(r+1,n):Math.exp(r*Math.log(n)-n-cv(r+1))}),Mv(`EXPON.DIST`,2,(e,t=0,n=0)=>t<0||n<=0?N.NUM:e?-Math.expm1(-n*t):n*Math.exp(-n*t)),Mv(`WEIBULL.DIST`,3,(e,t=0,n=0,r=0)=>{if(t<0||n<=0||r<=0)return N.NUM;let i=(t/r)**n;return e?-Math.expm1(-i):n/r**n*t**(n-1)*Math.exp(-i)});var Uv=(e,t,n,r)=>Math.exp(Bv(n,e)+Bv(r-n,t-e)-Bv(r,t));Mv(`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 N.NUM;if(!e)return Uv(a,o,s,c);let l=0;for(let e=Math.max(0,o-c+s);e<=a;e++)l+=Uv(e,o,s,c);return Math.min(1,l)}),jv(`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?N.NUM:Uv(i,a,o,s)}),jv(`GAMMA`,1,1,(e=0)=>Nv(lv(e))),jv(`GAMMALN`,1,1,(e=0)=>e<=0?N.NUM:cv(e)),ds(`GAMMALN.PRECISE`,`GAMMALN`),jv(`ERF`,1,2,(e=0,t=NaN)=>Number.isNaN(t)?_v(e):_v(t)-_v(e)),jv(`ERFC`,1,1,(e=0)=>vv(e)),ds(`ERF.PRECISE`,`ERF`),ds(`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`]])ds(e,t);var Wv=2**48;function Gv(e,t){let[n=`0`,r=`0`]=e.toExponential().split(`e`);return Number(`${n}e${String(Number(r)+t)}`)}var Kv=e=>Number(e.toPrecision(15));function qv(e,t,n){let r=Math.trunc(t),i=Gv(Math.abs(Kv(e)),r);if(i>=2**53)return e;let a=Gv(n(i),-r);return e<0?-a:a}z(`ROUND`,2,2,gs((e=0,t=0)=>qv(e,t,e=>Math.floor(e+.5)))),z(`ROUNDUP`,2,2,gs((e=0,t=0)=>qv(e,t,Math.ceil))),z(`ROUNDDOWN`,2,2,gs((e=0,t=0)=>qv(e,t,Math.floor))),z(`MOD`,2,2,gs((e=0,t=0)=>{if(t===0)return N.DIV0;let n=e%t;return n!==0&&n<0!=t<0?n+t:n})),z(`QUOTIENT`,2,2,gs((e=0,t=0)=>t===0?N.DIV0:Math.trunc(e/t))),z(`POWER`,2,2,gs((e=0,t=0)=>{if(e===0&&t===0)return N.NUM;if(e===0&&t<0)return N.DIV0;let n=e**t;return Number.isFinite(n)?n:N.NUM})),z(`LOG`,1,2,(e,t)=>{let n=L(e),r=t==null?10:L(t);return n instanceof M?n:r instanceof M?r:n<=0||r<=0?N.NUM:r===1?N.DIV0:r===10?Math.log10(n):r===2?Math.log2(n):Math.log(n)/Math.log(r)});function Jv(e,t){let[n,r]=[e,t];for(;r!==0;)[n,r]=[r,n%r];return n}function Yv(e,t){let n=ms(e,t);if(n instanceof M)return n;let r=n.map(Math.trunc);return r.some(e=>e<0||e>=2**53)?N.NUM:r}B(`GCD`,`(r)`,(e,t)=>{let n=Yv(e,t);return n instanceof M?n:n.reduce(Jv,0)}),B(`LCM`,`(r)`,(e,t)=>{let n=Yv(e,t);if(n instanceof M)return n;if(n.includes(0))return 0;let r=n.reduce((e,t)=>e*t/Jv(e,t),1);return Number.isFinite(r)?r:N.NUM}),z(`BASE`,2,3,gs((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?N.NUM:r.toString(i).toUpperCase().padStart(a,`0`)}));var Xv=`MDCLXVI`,Zv=[1e3,500,100,50,10,5,1];function Qv(e,t){let n=e=>Zv[e]??1,r=e=>Xv.charAt(e),i=Zv.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}z(`ROMAN`,1,2,(e,t)=>{let n=L(e);if(n instanceof M)return n;let r=0;if(typeof t==`boolean`)r=t?0:4;else if(t!=null){let e=L(t);if(e instanceof M)return e;r=Math.trunc(e)}let i=Math.trunc(n);return i<0||i>3999||r<0||r>4?N.VALUE:Qv(i,r)});function $v(e){return!Number.isInteger(e)||e<0||e>=Wv?N.NUM:BigInt(e)}for(let[e,t]of[[`BITAND`,(e,t)=>e&t],[`BITOR`,(e,t)=>e|t],[`BITXOR`,(e,t)=>e^t]])z(e,2,2,gs((e=0,n=0)=>{let r=$v(e),i=$v(n);return r instanceof M?r:i instanceof M?i:Number(t(r,i))}));for(let[e,t]of[[`BITLSHIFT`,1],[`BITRSHIFT`,-1]])z(e,2,2,gs((e=0,n=0)=>{let r=$v(e);if(r instanceof M)return r;let i=Math.trunc(n)*t;if(Math.abs(i)>53)return N.NUM;let a=i>=0?r<<BigInt(i):r>>BigInt(-i);return a>=BigInt(Wv)?N.NUM:Number(a)}));for(let[e,t,n]of[[`BESSELJ`,Dv,!1],[`BESSELI`,kv,!1],[`BESSELY`,Ov,!0],[`BESSELK`,Av,!0]])z(e,2,2,gs((e=0,r=0)=>{let i=Math.trunc(r);if(i<0||n&&e<=0)return N.NUM;let a=t(i,e);return Number.isFinite(a)?a:N.NUM}));z(`SLN`,3,3,gs((e=0,t=0,n=0)=>n===0?N.DIV0:(e-t)/n)),B(`GEOMEAN`,`(r)`,(e,t)=>{let n=ms(e,t);return n instanceof M?n:n.length===0||n.some(e=>e<=0)?N.NUM:Math.exp(n.reduce((e,t)=>e+Math.log(t),0)/n.length)}),B(`HARMEAN`,`(r)`,(e,t)=>{let n=ms(e,t);return n instanceof M?n:n.length===0||n.some(e=>e<=0)?N.NUM:n.length/n.reduce((e,t)=>e+1/t,0)}),B(`KURT`,`(r)`,(e,t)=>{let n=ms(e,t);if(n instanceof M)return n;let r=n.length;if(r<4)return N.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 N.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 ey(e,t){let n=[],r;return ps(e,t,(e,t)=>{if(!r){if(e instanceof M)r=e;else if(typeof e==`number`)n.push(e);else if(t&&e!==null){let t=L(e);t instanceof M?r=t:n.push(t)}}}),r??n}B(`MODE.SNGL`,`(r)`,(e,t)=>{let n=ey(e,t);if(n instanceof M)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??N.NA}),ds(`MODE`,`MODE.SNGL`),B(`MODE.MULT`,`(r)`,(e,t)=>{let n=ey(e,t);if(n instanceof M)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 N.NA;let a=[...r].filter(([,e])=>e===i).map(([e])=>e);return new P(a.length,1,a)});function ty(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)}B(`QUARTILE.INC`,`rv`,(e,t)=>{let n=ms([e[0]],t);if(n instanceof M)return n;let r=L(t.calc.scalar(e[1],t.frame));if(r instanceof M)return r;let i=Math.trunc(r);return n.length===0||i<0||i>4?N.NUM:ty([...n].sort((e,t)=>e-t),i/4)}),ds(`QUARTILE`,`QUARTILE.INC`);function ny(e,t){let n=L(t.calc.scalar(e[0],t.frame));if(n instanceof M)return n;let r=ms([e[1]],t);if(r instanceof M)return r;let i=e[2]===void 0?0:L(t.calc.scalar(e[2],t.frame));if(i instanceof M)return i;let a=r.filter(e=>e===n).length;return a===0?N.NA:{before:r.filter(e=>i===0?e>n:e<n).length,ties:a}}B(`RANK.EQ`,`vr?v`,(e,t)=>{let n=ny(e,t);return n instanceof M?n:n.before+1}),B(`RANK.AVG`,`vr?v`,(e,t)=>{let n=ny(e,t);return n instanceof M?n:n.before+(n.ties+1)/2}),ds(`RANK`,`RANK.EQ`);function ry(e,t){let n=V(e,t);if(n instanceof M)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 M)return i;if(typeof i!=`number`)return N.VALUE;t.push(i)}r.push(t)}return r}var iy=e=>new P(e.length,e[0]?.length??0,e.flat());function ay(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)))}B(`MMULT`,`rr`,(e,t)=>{let n=ry(e[0],t),r=ry(e[1],t);return n instanceof M?n:r instanceof M?r:(n[0]?.length??0)===r.length?iy(ay(n,r)):N.VALUE});function oy(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 sy=e=>e.length>0&&e.every(t=>t.length===e.length);B(`MDETERM`,`r`,(e,t)=>{let n=ry(e[0],t);return n instanceof M?n:sy(n)?oy(n).determinant:N.VALUE}),B(`MINVERSE`,`r`,(e,t)=>{let n=ry(e[0],t);if(n instanceof M)return n;if(!sy(n))return N.VALUE;let{inverse:r}=oy(n);return r?iy(r):N.NUM}),z(`MUNIT`,1,1,gs((e=0)=>{let t=Math.trunc(e);return t<1||t>73?N.VALUE:iy(Array.from({length:t},(e,n)=>Array.from({length:t},(e,t)=>+(n===t))))}));function cy(e,t,n){let r=V(e,n),i=V(t,n);if(r instanceof M)return r;if(i instanceof M)return i;if(r.rows*r.cols!==i.rows*i.cols)return N.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 M)return n;if(s instanceof M)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]])B(e,`rr`,(e,n)=>{let r=cy(e[0],e[1],n);return r instanceof M?r:r.xs.length===0?N.DIV0:r.xs.reduce((e,n,i)=>e+t(n,r.ys[i]??0),0)});B(`SERIESSUM`,`vvvr`,(e,t)=>{let[n,r,i]=e.slice(0,3).map(e=>L(t.calc.scalar(e,t.frame)));if(n instanceof M)return n;if(r instanceof M)return r;if(i instanceof M)return i;let a=ms([e[3]],t);return a instanceof M?a:a.reduce((e,t,a)=>e+t*(n??0)**((r??0)+a*(i??0)),0)}),B(`FREQUENCY`,`rr`,(e,t)=>{let n=ms([e[0]],t),r=ms([e[1]],t);if(n instanceof M)return n;if(r instanceof M)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 P(a.length,1,a)}),B(`PROB`,`rrv?v`,(e,t)=>{let n=cy(e[0],e[1],t);if(n instanceof M)return n;let r=L(t.calc.scalar(e[2],t.frame));if(r instanceof M)return r;let i=e[3]===void 0?r:L(t.calc.scalar(e[3],t.frame));if(i instanceof M)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?N.NUM:n.xs.reduce((e,t,a)=>t>=r&&t<=i?e+(n.ys[a]??0):e,0)});var ly=e=>e.reduce((e,t)=>e+t,0);function uy(e,t,n){let r=t.map(e=>n?[...e,1]:[...e]),i=r[0]?.length??0,{inverse:a}=oy(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 dy(e,t,n){let r=ry(e[0],t);if(r instanceof M)return r;let i=r.length===1,a=r.flat();if(n&&a.some(e=>e<=0))return N.NUM;let o=n?a.map(Math.log):a,s=e[1];if(s===void 0||!fy(s))return{ys:o,xs:a.map((e,t)=>[t+1]),byRow:i};let c=ry(s,t);if(c instanceof M)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}:N.REF:c.length===o.length?{ys:o,xs:c,byRow:i}:N.REF}var fy=e=>e instanceof F||e instanceof P||typeof e==`number`,py=(e,t)=>e===void 0||!fy(e)&&typeof e!=`boolean`||mo(t.calc.scalar(e,t.frame));function my(e){return(t,n)=>{let r=dy(t,n,e);if(r instanceof M)return r;let i=py(t[3],n);if(i instanceof M)return i;let a=uy(r.ys,r.xs,i);if(!a)return N.NUM;let o=t[2],s=r.xs;if(o!==void 0&&fy(o)){let e=ry(o,n);if(e instanceof M)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 P(1,c.length,c):new P(c.length,1,c)}}B(`TREND`,`r?rrv`,my(!1)),B(`GROWTH`,`r?rrv`,my(!0));function hy(e,t,n,r){let i=t.map(e=>r?[...e,1]:[...e]),a=i[0]?.length??0,{inverse:o}=oy(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?ly(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 gy(e){return(t,n)=>{let r=dy(t,n,e);if(r instanceof M)return r;let i=py(t[2],n);if(i instanceof M)return i;let a=uy(r.ys,r.xs,i);if(!a)return N.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||!_y(c)?!1:mo(n.calc.scalar(c,n.frame));if(l instanceof M)return l;if(!l)return new P(1,s.length,s);let u=hy(r.ys,r.xs,a,i);if(!u)return N.NUM;let d=s.length,f=e=>[...e,...Array(d-e.length).fill(N.NA)],p=i?[...u.errors.slice(0,-1).reverse(),u.errors[u.errors.length-1]??0]:[...[...u.errors].reverse(),N.NA];return new P(5,d,[...s,...p,...f([u.r2,u.sey]),...f([u.f,u.df]),...f([u.ssreg,u.ssresid])])}}var _y=e=>fy(e)||typeof e==`boolean`;B(`LINEST`,`r?rvv`,gy(!1)),B(`LOGEST`,`r?rvv`,gy(!0));var vy=e=>ly(e)/e.length,yy=e=>{let t=vy(e);return e.reduce((e,n)=>e+(n-t)**2,0)/(e.length-1)};B(`CHISQ.TEST`,`rr`,(e,t)=>{let n=ry(e[0],t),r=ry(e[1],t);if(n instanceof M)return n;if(r instanceof M)return r;let i=n.length,a=n[0]?.length??0;if(r.length!==i||(r[0]?.length??0)!==a||i*a<2)return N.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 N.NUM;if(i===0)return N.DIV0;o+=((n[e]?.[t]??0)-i)**2/i}return mv((i>1&&a>1?(i-1)*(a-1):i>1?i-1:a-1)/2,o/2)}),ds(`CHITEST`,`CHISQ.TEST`),B(`T.TEST`,`rrvv`,(e,t)=>{let n=L(t.calc.scalar(e[2],t.frame)),r=L(t.calc.scalar(e[3],t.frame));if(n instanceof M)return n;if(r instanceof M)return r;let i=Math.trunc(n),a=Math.trunc(r);if(i!==1&&i!==2||a<1||a>3)return N.NUM;let o,s;if(a===1){let n=cy(e[0],e[1],t);if(n instanceof M)return n;let r=n.xs.map((e,t)=>e-(n.ys[t]??0));if(r.length<2)return N.DIV0;o=vy(r)/Math.sqrt(yy(r)/r.length),s=r.length-1}else{let n=ms([e[0]],t),r=ms([e[1]],t);if(n instanceof M)return n;if(r instanceof M)return r;if(n.length<2||r.length<2)return N.DIV0;let[i,c,l,u]=[yy(n),yy(r),n.length,r.length],d=Math.abs(vy(n)-vy(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)?gv(s/2,.5,s/(s+o*o))*i/2:N.DIV0}),ds(`TTEST`,`T.TEST`),B(`F.TEST`,`rr`,(e,t)=>{let n=ms([e[0]],t),r=ms([e[1]],t);if(n instanceof M)return n;if(r instanceof M)return r;if(n.length<2||r.length<2)return N.DIV0;let[i,a]=[yy(n),yy(r)];if(i===0||a===0)return N.DIV0;let o=i/a,[s,c]=[n.length-1,r.length-1],l=gv(c/2,s/2,c/(s*o+c));return 2*Math.min(l,1-l)}),ds(`FTEST`,`F.TEST`),B(`Z.TEST`,`rv?v`,(e,t)=>{let n=ms([e[0]],t);if(n instanceof M)return n;let r=L(t.calc.scalar(e[1],t.frame));if(r instanceof M)return r;if(n.length===0)return N.NA;let i=e[2]===void 0?n.length<2?N.DIV0:Math.sqrt(yy(n)):L(t.calc.scalar(e[2],t.frame));return i instanceof M?i:i===0?N.DIV0:1-bv((vy(n)-r)/(i/Math.sqrt(n.length)))}),ds(`ZTEST`,`Z.TEST`);var by={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`};B(`AGGREGATE`,`vv(r)`,(e,t)=>{let n=L(t.calc.scalar(e[0],t.frame)),r=L(t.calc.scalar(e[1],t.frame));if(n instanceof M)return n;if(r instanceof M)return r;let i=by[Math.trunc(n)],a=i===void 0?void 0:as.get(i);if(a===void 0)return N.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 Ur?e.parts:[e],r=[];for(let e of n)if(e instanceof F){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 P?r.push(...n.data):r.push(n)}let i=o?r:r.filter(e=>!(e instanceof M));return new P(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 t.calc.applyFunction(a,d,t.frame)}),z(`FACT`,1,1,gs(e=>{if(e<0)return N.NUM;let t=1;for(let n=2;n<=Math.trunc(e);n++)t*=n;return Number.isFinite(t)?t:N.NUM})),z(`FACTDOUBLE`,1,1,gs(e=>{if(e<0)return N.NUM;let t=1;for(let n=Math.trunc(e);n>1;n-=2)t*=n;return Number.isFinite(t)?t:N.NUM})),z(`ATAN2`,2,2,gs((e,t)=>e===0&&t===0?N.DIV0:Math.atan2(t,e)));for(let[e,t]of[[`LARGE`,!0],[`SMALL`,!1]])B(e,`rv`,(e,n)=>{let r=ms([e[0]],n);if(r instanceof M)return r;let i=L(e[1]);if(i instanceof M)return i;let a=Math.ceil(i);return a<1||a>r.length?N.NUM:(r.sort((e,n)=>t?n-e:e-n),r[a-1]??N.NUM)});var xy=.0254,Sy=12*xy,Cy=3*Sy,wy=5280*Sy,Ty=1852,Ey=9460730472580800,Dy=xy/72,Oy=453.59237,ky=9.80665,Ay=Oy/1e3*ky,jy=Sy*Ay,My=231*xy**3/128,Ny=.00454609,Py=101325,Fy=550*jy,Iy=new Map;function Q(e,t){for(let n of e)Iy.set(n,t)}var Ly=(e,t)=>({quantity:e,factor:t,prefix:1});Q([`g`],Ly(`mass`,1)),Q([`sg`],{quantity:`mass`,factor:Ay*1e3/Sy}),Q([`lbm`],{quantity:`mass`,factor:Oy}),Q([`u`],Ly(`mass`,1660538782e-33)),Q([`ozm`],{quantity:`mass`,factor:Oy/16}),Q([`grain`],{quantity:`mass`,factor:Oy/7e3}),Q([`cwt`,`shweight`],{quantity:`mass`,factor:100*Oy}),Q([`uk_cwt`,`lcwt`,`hweight`],{quantity:`mass`,factor:112*Oy}),Q([`stone`],{quantity:`mass`,factor:14*Oy}),Q([`ton`],{quantity:`mass`,factor:2e3*Oy}),Q([`uk_ton`,`LTON`,`brton`],{quantity:`mass`,factor:2240*Oy}),Q([`m`],Ly(`distance`,1)),Q([`mi`],{quantity:`distance`,factor:wy}),Q([`Nmi`],{quantity:`distance`,factor:Ty}),Q([`in`],{quantity:`distance`,factor:xy}),Q([`ft`],{quantity:`distance`,factor:Sy}),Q([`yd`],{quantity:`distance`,factor:Cy}),Q([`ang`],Ly(`distance`,1e-10)),Q([`ell`],{quantity:`distance`,factor:45*xy}),Q([`ly`],Ly(`distance`,Ey)),Q([`parsec`,`pc`],Ly(`distance`,648e3/Math.PI*149597870700)),Q([`Picapt`,`Pica`],{quantity:`distance`,factor:Dy}),Q([`pica`],{quantity:`distance`,factor:xy/6}),Q([`survey_mi`],{quantity:`distance`,factor:6336e3/3937}),Q([`yr`],{quantity:`time`,factor:31557600}),Q([`day`,`d`],{quantity:`time`,factor:86400}),Q([`hr`],{quantity:`time`,factor:3600}),Q([`mn`,`min`],{quantity:`time`,factor:60}),Q([`sec`,`s`],Ly(`time`,1)),Q([`Pa`,`p`],Ly(`pressure`,1)),Q([`atm`,`at`],Ly(`pressure`,Py)),Q([`mmHg`],Ly(`pressure`,Py/760)),Q([`psi`],{quantity:`pressure`,factor:Ay/xy**2}),Q([`Torr`],{quantity:`pressure`,factor:Py/760}),Q([`N`],Ly(`force`,1)),Q([`dyn`,`dy`],Ly(`force`,1e-5)),Q([`lbf`],{quantity:`force`,factor:Ay}),Q([`pond`],Ly(`force`,ky/1e3)),Q([`J`],Ly(`energy`,1)),Q([`e`],Ly(`energy`,1e-7)),Q([`c`],Ly(`energy`,4.184)),Q([`cal`],Ly(`energy`,4.1868)),Q([`eV`,`ev`],Ly(`energy`,1602176487e-28)),Q([`HPh`,`hh`],{quantity:`energy`,factor:Fy*3600}),Q([`Wh`,`wh`],Ly(`energy`,3600)),Q([`flb`],{quantity:`energy`,factor:jy}),Q([`BTU`,`btu`],{quantity:`energy`,factor:1055.05585262}),Q([`HP`,`h`],{quantity:`power`,factor:Fy}),Q([`PS`],{quantity:`power`,factor:75*ky}),Q([`W`,`w`],Ly(`power`,1)),Q([`T`],Ly(`magnetism`,1)),Q([`ga`],Ly(`magnetism`,1e-4));var Ry=(e,t,n=!1)=>{Q(e,{quantity:`volume`,factor:t**3,...n?{prefix:3}:{}})};Q([`tsp`],{quantity:`volume`,factor:My/6}),Q([`tspm`],{quantity:`volume`,factor:5e-6}),Q([`tbs`],{quantity:`volume`,factor:My/2}),Q([`oz`],{quantity:`volume`,factor:My}),Q([`cup`],{quantity:`volume`,factor:8*My}),Q([`pt`,`us_pt`],{quantity:`volume`,factor:16*My}),Q([`uk_pt`],{quantity:`volume`,factor:Ny/8}),Q([`qt`],{quantity:`volume`,factor:32*My}),Q([`uk_qt`],{quantity:`volume`,factor:Ny/4}),Q([`gal`],{quantity:`volume`,factor:128*My}),Q([`uk_gal`],{quantity:`volume`,factor:Ny}),Q([`l`,`L`,`lt`],Ly(`volume`,.001)),Q([`barrel`],{quantity:`volume`,factor:5376*My}),Q([`bushel`],{quantity:`volume`,factor:2150.42*xy**3}),Q([`GRT`,`regton`],{quantity:`volume`,factor:100*Sy**3}),Q([`MTON`],{quantity:`volume`,factor:40*Sy**3}),Ry([`m3`,`m^3`],1,!0),Ry([`ang3`,`ang^3`],1e-10,!0),Ry([`ft3`,`ft^3`],Sy),Ry([`in3`,`in^3`],xy),Ry([`ly3`,`ly^3`],Ey),Ry([`mi3`,`mi^3`],wy),Ry([`yd3`,`yd^3`],Cy),Ry([`Nmi3`,`Nmi^3`],Ty),Ry([`Pica3`,`Picapt3`,`Pica^3`,`Picapt^3`],Dy);var zy=(e,t,n=!1)=>{Q(e,{quantity:`area`,factor:t**2,...n?{prefix:2}:{}})};Q([`uk_acre`],{quantity:`area`,factor:4840*Cy**2}),Q([`us_acre`],{quantity:`area`,factor:43560*(1200/3937)**2}),Q([`ar`],Ly(`area`,100)),Q([`ha`],{quantity:`area`,factor:1e4}),Q([`Morgen`],{quantity:`area`,factor:2500}),zy([`m2`,`m^2`],1,!0),zy([`ang2`,`ang^2`],1e-10,!0),zy([`ft2`,`ft^2`],Sy),zy([`in2`,`in^2`],xy),zy([`ly2`,`ly^2`],Ey),zy([`mi2`,`mi^2`],wy),zy([`yd2`,`yd^2`],Cy),zy([`Nmi2`,`Nmi^2`],Ty),zy([`Pica2`,`Picapt2`,`Pica^2`,`Picapt^2`],Dy),Q([`bit`],{quantity:`information`,factor:1,prefix:1,binary:!0}),Q([`byte`],{quantity:`information`,factor:8,prefix:1,binary:!0}),Q([`admkn`],{quantity:`speed`,factor:6080*Sy/3600}),Q([`kn`],{quantity:`speed`,factor:Ty/3600}),Q([`m/h`,`m/hr`],Ly(`speed`,1/3600)),Q([`m/s`,`m/sec`],Ly(`speed`,1)),Q([`mph`],{quantity:`speed`,factor:wy/3600});var By={Y:1e24,Z:1e21,E:0xde0b6b3a7640000,P:0x38d7ea4c68000,T:0xe8d4a51000,G:1e9,M:1e6,k:1e3,h:100,da:10,e:10,d:.1,c:.01,m:.001,u:1e-6,n:1e-9,p:1e-12,f:1e-15,a:1e-18,z:1e-21,y:1e-24},Vy={Yi:2**80,Zi:2**70,Ei:2**60,Pi:2**50,Ti:2**40,Gi:2**30,Mi:2**20,ki:1024},Hy={C:{toK:e=>e+273.15,fromK:e=>e-273.15},F:{toK:e=>(e-32)*5/9+273.15,fromK:e=>(e-273.15)*9/5+32},K:{toK:e=>e,fromK:e=>e},Rank:{toK:e=>e*5/9,fromK:e=>e*9/5},Reau:{toK:e=>e*5/4+273.15,fromK:e=>(e-273.15)*4/5}},Uy={C:`C`,cel:`C`,F:`F`,fah:`F`,K:`K`,kel:`K`,Rank:`Rank`,Reau:`Reau`};function Wy(e){let t=Uy[e];if(t!==void 0)return{kind:`temperature`,scale:t,times:1};let n=Iy.get(e);if(n)return{kind:`unit`,quantity:n.quantity,factor:n.factor};for(let[t,n]of Object.entries(By)){if(!e.startsWith(t))continue;let r=e.slice(t.length);if(Uy[r]===`K`)return{kind:`temperature`,scale:`K`,times:n};let i=Iy.get(r);if(i?.prefix!==void 0)return{kind:`unit`,quantity:i.quantity,factor:i.factor*n**i.prefix}}for(let[t,n]of Object.entries(Vy)){if(!e.startsWith(t))continue;let r=Iy.get(e.slice(t.length));if(r?.binary===!0)return{kind:`unit`,quantity:r.quantity,factor:r.factor*n}}}function Gy(e,t,n){let r=Wy(t),i=Wy(n);if(!r||!i)return N.NA;if(r.kind===`temperature`||i.kind===`temperature`){if(r.kind!==`temperature`||i.kind!==`temperature`)return N.NA;let t=Hy[r.scale],n=Hy[i.scale];return!t||!n?N.NA:n.fromK(t.toK(e*r.times))/i.times}return r.quantity===i.quantity?e*r.factor/i.factor:N.NA}z(`CONVERT`,3,3,(e,t,n)=>{let r=L(e),i=R(t),a=R(n);return r instanceof M?r:i instanceof M?i:a instanceof M?a:Gy(r,i,a)});var Ky=5e6,qy=e=>Array.from({length:e.rows},(t,n)=>Array.from({length:e.cols},(t,r)=>e.at(n,r))),Jy=e=>{let t=e[0]?.length??0;return new P(e.length,t,e.flat())},Yy=e=>{let t=e[0]?.length??0;return Array.from({length:t},(t,n)=>e.map(e=>e[n]??null))};function Xy(e,t){if(!(e===void 0||e instanceof Gr))return t.calc.scalar(e,t.frame)}function Zy(e,t,n){let r=Xy(e,t);return r==null?n:L(r)}function Qy(e,t,n){let r=Xy(e,t);return r==null?n:mo(r)}function $y(e,t,n){if(e===void 0||e instanceof Gr)return[n];let r=V(e,t);if(r instanceof M)return r;let i=[];for(let e=0;e<r.rows;e++)for(let t=0;t<r.cols;t++){let n=L(r.at(e,t));if(n instanceof M)return n;i.push(Math.trunc(n))}return i}var eb=e=>e===null||e===``;function tb(e,t,n){if(eb(e)||eb(t))return eb(e)&&eb(t)?0:eb(e)?1:-1;let r=io(e,t);return n?-r:r}function nb(e){return e instanceof M?e:e===null?!1:typeof e==`boolean`?e:typeof e==`number`?e!==0:N.VALUE}B(`FILTER`,`rr?r`,(e,t)=>{let n=V(e[0],t),r=V(e[1],t);if(n instanceof M)return n;if(r instanceof M)return r;if(r.rows>1&&r.cols>1)return N.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 N.VALUE;let a=qy(n),o=i?a:Yy(a),s=[];for(let e=0;e<o.length;e++){let t=nb(i?r.at(e,0):r.at(0,e));if(t instanceof M)return t;t&&s.push(o[e]??[])}return s.length===0?e[2]===void 0||e[2]instanceof Gr?N.CALC:e[2]:Jy(i?s:Yy(s))}),B(`SORT`,`r?rrr`,(e,t)=>{let n=V(e[0],t);if(n instanceof M)return n;let r=$y(e[1],t,1);if(r instanceof M)return r;let i=$y(e[2],t,1);if(i instanceof M)return i;let a=Qy(e[3],t,!1);if(a instanceof M)return a;let o=qy(n),s=a?Yy(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 N.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=tb(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 Jy(a?Yy(l):l)}),B(`SORTBY`,`r(r)`,(e,t)=>{let n=V(e[0],t);if(n instanceof M)return n;let r=[],i;for(let a=1;a<e.length;a+=2){let o=V(e[a],t);if(o instanceof M)return o;if(o.rows>1&&o.cols>1)return N.VALUE;let s=o.cols===1&&o.rows===n.rows,c=o.rows===1&&o.cols===n.cols;if(!s&&!c)return N.VALUE;let l=i??s;if(l?!s:!c)return N.VALUE;i=l;let u=Zy(e[a+1],t,1);if(u instanceof M)return u;if(u!==1&&u!==-1)return N.VALUE;r.push({values:qy(o).flat(),descending:u<0})}let a=qy(n),o=(i===!1?Yy(a):a).map((e,t)=>({line:e,index:t})).sort((e,t)=>{for(let{values:n,descending:i}of r){let r=tb(n[e.index]??null,n[t.index]??null,i);if(r!==0)return r}return e.index-t.index}).map(e=>e.line);return Jy(i===!1?Yy(o):o)});var rb=e=>e instanceof M?`e${e.code}`:typeof e==`string`?`s${e.toLowerCase()}`:`${typeof e}${String(e)}`;B(`UNIQUE`,`r?rr`,(e,t)=>{let n=V(e[0],t);if(n instanceof M)return n;let r=Qy(e[1],t,!1);if(r instanceof M)return r;let i=Qy(e[2],t,!1);if(i instanceof M)return i;let a=qy(n),o=r?Yy(a):a,s=new Map;for(let e of o){let t=e.map(rb).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?N.CALC:Jy(r?Yy(c):c)});function ib(e,t){if(e instanceof M)return e;if(t instanceof M)return t;let n=Math.trunc(e),r=Math.trunc(t);return n<0||r<0?N.VALUE:n===0||r===0?N.CALC:n>1048576||r>16384||n*r>Ky?N.VALUE:{rows:n,cols:r}}B(`SEQUENCE`,`r?rrr`,(e,t)=>{let n=ib(Zy(e[0],t,1),Zy(e[1],t,1));if(n instanceof M)return n;let r=Zy(e[2],t,1);if(r instanceof M)return r;let i=Zy(e[3],t,1);if(i instanceof M)return i;let a=Array(n.rows*n.cols);for(let e=0;e<a.length;e++)a[e]=r+e*i;return new P(n.rows,n.cols,a)}),B(`RANDARRAY`,`?rrrrr`,(e,t)=>{let n=ib(Zy(e[0],t,1),Zy(e[1],t,1));if(n instanceof M)return n;let r=Zy(e[2],t,0);if(r instanceof M)return r;let i=Zy(e[3],t,1);if(i instanceof M)return i;let a=Qy(e[4],t,!1);if(a instanceof M)return a;if(r>i||a&&(!Number.isInteger(r)||!Number.isInteger(i)))return N.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 P(n.rows,n.cols,o)},{volatile:!0}),B(`TEXTSPLIT`,`vr?rvvv`,(e,t)=>{let n=Xy(e[0],t);if(n instanceof M)return n;let r=R(n??``);if(r instanceof M)return r;let i=hc(e[1],t);if(i instanceof M)return i;let a=hc(e[2],t);if(a instanceof M)return a;if(i.length===0&&a.length===0||i.includes(``)||a.includes(``))return N.VALUE;let o=Qy(e[3],t,!1);if(o instanceof M)return o;let s=Zy(e[4],t,0);if(s instanceof M)return s;let c=Xy(e[5],t)??N.NA,l=s===1,u=(a.length===0?[r]:_c(r,a,l)).filter(e=>!(o&&e===``)).map(e=>{let t=i.length===0?[e]:_c(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?N.CALC:Jy(u.map(e=>Array.from({length:d},(t,n)=>e[n]??c)))});var ab=(e,t)=>{let n=t.calc.flat(e);return n instanceof P?n.at(0,0):n};B(`MAP`,`r(r)`,(e,t)=>{let n=e[e.length-1];if(!(n instanceof Wr))return N.VALUE;let r=[];for(let n of e.slice(0,-1)){let e=V(n,t);if(e instanceof M)return e;r.push(e)}let i=r[0];if(!i)return N.VALUE;let{rows:a,cols:o}=i;if(r.some(e=>e.rows!==a||e.cols!==o))return N.VALUE;let s=Array(a*o);for(let e=0;e<a;e++)for(let i=0;i<o;i++)s[e*o+i]=ab(t.calc.apply(n,r.map(t=>t.at(e,i))),t);return new P(a,o,s)});function ob(e,t){let n=e.length===3,r=e[e.length-1];if(!(r instanceof Wr))return N.VALUE;let i=V(e[+!!n],t);return i instanceof M?i:{start:n?Xy(e[0],t)??null:i.at(0,0),cells:i,fn:r}}B(`REDUCE`,`rr?r`,(e,t)=>{let n=ob(e,t);if(n instanceof M)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=ab(t.calc.apply(i,[o,r.at(Math.floor(e/r.cols),e%r.cols)]),t);return o}),B(`SCAN`,`rr?r`,(e,t)=>{let n=ob(e,t);if(n instanceof M)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=ab(t.calc.apply(i,[c,r.at(Math.floor(e/r.cols),e%r.cols)]),t),s[e]=c;return new P(r.rows,r.cols,s)});var sb=e=>(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;let i=t[1];if(!(i instanceof Wr))return N.VALUE;let a=qy(r),o=(e?a:Yy(a)).map(t=>ab(n.calc.apply(i,[e?new P(1,t.length,t):new P(t.length,1,t)]),n));return e?new P(o.length,1,o):new P(1,o.length,o)};B(`BYROW`,`rr`,sb(!0)),B(`BYCOL`,`rr`,sb(!1)),B(`MAKEARRAY`,`rrr`,(e,t)=>{let n=ib(Zy(e[0],t,1),Zy(e[1],t,1));if(n instanceof M)return n;let r=e[2];if(!(r instanceof Wr))return N.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]=ab(t.calc.apply(r,[e+1,a+1]),t);return new P(n.rows,n.cols,i)});function cb(e){return(t,n)=>{let r=[];for(let i of t){let t=V(i,n);if(t instanceof M)return t;let a=qy(t);r.push(e?a:Yy(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:N.NA)));return a.length===0?N.CALC:Jy(e?a:Yy(a))}}B(`VSTACK`,`(r)`,cb(!0)),B(`HSTACK`,`(r)`,cb(!1));function lb(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 ub(e){return(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;let i=e=>e===void 0||e instanceof Gr,a=Zy(t[1],n,e?r.rows:0);if(a instanceof M)return a;let o=Zy(t[2],n,e?r.cols:0);if(o instanceof M)return o;if(e&&!i(t[1])&&Math.trunc(a)===0||e&&!i(t[2])&&Math.trunc(o)===0)return N.CALC;let[s,c]=lb(r.rows,Math.trunc(a),e),[l,u]=lb(r.cols,Math.trunc(o),e);return c<=s||u<=l?N.CALC:Jy(qy(r).slice(s,c).map(e=>e.slice(l,u)))}}B(`TAKE`,`rr?r`,ub(!0)),B(`DROP`,`rr?r`,ub(!1));function db(e){return(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;let i=Zy(t[1],n,0);if(i instanceof M)return i;let a=Qy(t[2],n,!1);if(a instanceof M)return a;if(![0,1,2,3].includes(i))return N.VALUE;let o=qy(r),s=(a?Yy(o):o).flat().filter(e=>!((i===1||i===3)&&e===null||(i===2||i===3)&&e instanceof M));return s.length===0?N.CALC:e?new P(s.length,1,s):new P(1,s.length,s)}}B(`TOCOL`,`r?rr`,db(!0)),B(`TOROW`,`r?rr`,db(!1));function fb(e){return(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;let i=qy(r),a=e?i:Yy(i),o=[];for(let e of t.slice(1)){let t=$y(e,n,1);if(t instanceof M)return t;for(let e of t){let t=a[e>0?e-1:a.length+e];if(e===0||!t)return N.VALUE;o.push(t)}}return Jy(e?o:Yy(o))}}B(`CHOOSEROWS`,`r(r)`,fb(!0)),B(`CHOOSECOLS`,`r(r)`,fb(!1)),B(`EXPAND`,`rr?rr`,(e,t)=>{let n=V(e[0],t);if(n instanceof M)return n;let r=ib(Zy(e[1],t,n.rows),Zy(e[2],t,n.cols));if(r instanceof M)return r;if(r.rows<n.rows||r.cols<n.cols)return N.VALUE;let i=Xy(e[3],t)??N.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 P(r.rows,r.cols,a)});function pb(e){return(t,n)=>{let r=V(t[0],n);if(r instanceof M)return r;if(r.rows>1&&r.cols>1)return N.VALUE;let i=Zy(t[1],n,1);if(i instanceof M)return i;let a=Math.trunc(i);if(a<1)return N.NUM;let o=Xy(t[2],n)??N.NA,s=qy(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 Jy(e?c:Yy(c))}}B(`WRAPROWS`,`rr?r`,pb(!0)),B(`WRAPCOLS`,`rr?r`,pb(!1));function mb(e,t,n){let r=R(e);if(r instanceof M)return r;let i=t==null?0:L(t);if(i instanceof M)return i;if(i!==0&&i!==1)return N.VALUE;try{return new RegExp(r,`${i===1?`i`:``}${n?`g`:``}`)}catch{return N.VALUE}}z(`REGEXTEST`,2,3,(e,t,n)=>{let r=R(e);if(r instanceof M)return r;let i=mb(t,n,!1);return i instanceof M?i:i.test(r)}),B(`REGEXEXTRACT`,`vv?vv`,(e,t)=>{let n=R(e[0]instanceof Gr?null:e[0]);if(n instanceof M)return n;let r=Zy(e[2],t,0);if(r instanceof M)return r;let i=e[3]instanceof Gr?void 0:e[3],a=mb(e[1],i,r===1);if(a instanceof M)return a;if(r===0)return a.exec(n)?.[0]??N.NA;if(r===1){let e=[...n.matchAll(a)].map(e=>e[0]);return e.length===0?N.NA:new P(e.length,1,e)}if(r===2){let e=a.exec(n);if(!e)return N.NA;let t=e.slice(1).map(e=>e??``);return t.length===0?N.NA:new P(1,t.length,t)}return N.VALUE}),z(`REGEXREPLACE`,3,5,(e,t,n,r,i)=>{let a=R(e),o=R(n);if(a instanceof M)return a;if(o instanceof M)return o;let s=r==null?0:L(r);if(s instanceof M)return s;let c=mb(t,i,!0);if(c instanceof M)return c;let l=Math.trunc(s);if(l===0)return a.replace(c,o);let u=[...a.matchAll(c)],d=l>0?u[l-1]:u[u.length+l];if(!d)return a;let f=new RegExp(c.source,c.flags.replace(`g`,``)),p=d.index;return a.slice(0,p)+d[0].replace(f,o)+a.slice(p+d[0].length)}),B(`PERCENTOF`,`rr`,(e,t)=>{let n=as.get(`SUM`);if(!n)return N.NAME;let r=L(ab(t.calc.applyFunction(n,[e[0]],t.frame),t)),i=L(ab(t.calc.applyFunction(n,[e[1]],t.frame),t));return r instanceof M?r:i instanceof M?i:i===0?N.DIV0:r/i}),B(`TRIMRANGE`,`r?vv`,(e,t)=>{let n=e[0];if(!(n instanceof F))return n instanceof M?n:N.VALUE;let r=Zy(e[1],t,3),i=Zy(e[2],t,3);if(r instanceof M)return r;if(i instanceof M)return i;let a=t.calc.matrix(n),o=e=>Array.from({length:a.cols},(t,n)=>a.at(e,n)).every(e=>e===null),s=e=>Array.from({length:a.rows},(t,n)=>a.at(n,e)).every(e=>e===null),c=0,l=a.rows-1,u=0,d=a.cols-1;if(r===1||r===3)for(;c<=l&&o(c);)c++;if(r===2||r===3)for(;l>=c&&o(l);)l--;if(i===1||i===3)for(;u<=d&&s(u);)u++;if(i===2||i===3)for(;d>=u&&s(d);)d--;return c>l||u>d?N.REF:new F(n.sheet,n.top+c,n.left+u,n.top+l,n.left+d)});function hb(e,t,n){let r=new Map;for(let i of n){let n=e[i]?.[t]??null,a=rb(n),o=r.get(a);o?o.records.push(i):r.set(a,{key:n,records:[i],children:[]})}return[...r.values()]}function gb(e,t,n,r,i,a){let o=(e,t)=>e.sort((e,n)=>{for(let r of i){let i=`field`in r?r.field===t?tb(e.key,n.key,r.down):0:tb(r.value(e.records),r.value(n.records),r.down);if(i!==0)return i}return 0}),s=[],c=r<0,l=Math.abs(r);if(a){let r=new Map;for(let i of n){let n=(e[i]??[]).slice(0,t).map(rb).join(`\0`),a=r.get(n);a?a.records.push(i):r.set(n,{key:null,records:[i],children:[]})}let a=[...r.values()].sort((t,n)=>{for(let r of i){let i=`field`in r?tb(e[t.records[0]??0]?.[r.field]??null,e[n.records[0]??0]?.[r.field]??null,r.down):tb(r.value(t.records),r.value(n.records),r.down);if(i!==0)return i}return 0});for(let n of a)s.push({kind:`leaf`,keys:(e[n.records[0]??0]??[]).slice(0,t),records:n.records})}else{let r=(n,i,a)=>{for(let u of o(n,i)){let n=[...a,u.key];if(i===t-1){s.push({kind:`leaf`,keys:n,records:u.records});continue}let o={kind:`subtotal`,keys:[...n,...Array(t-n.length).fill(null)],records:u.records},d=i<l-1;d&&c&&s.push(o),r(hb(e,i+1,u.records),i+1,n),d&&!c&&s.push(o)}};r(hb(e,0,n),0,[])}if(l>=1){let e={kind:`total`,keys:[`Total`,...Array(t-1).fill(null)],records:[...n]};c?s.unshift(e):s.push(e)}return s}function _b(e,t,n,r){let i=e=>new P(e.length,1,[...e]),a=e.named===void 0?void 0:as.get(e.named),o=(a?a.min>=2:e.params.length>=2)?[i(t),i(n)]:[i(t)];return ab(r.calc.apply(e,o),r)}function vb(e,t,n){if(e===void 0||e instanceof Gr){let e=t[0]??[],n=t[1]??[];return{has:e.length>0&&e.every(e=>typeof e==`string`)&&n.some(e=>typeof e==`number`),show:!1,named:!1}}let r=Zy(e,n,0);return r instanceof M?r:[0,1,2,3].includes(r)?{has:r===1||r===3,show:r===2||r===3,named:r===2}:N.VALUE}function yb(e,t,n,r){let i=Array.from({length:t},(e,t)=>t);if(e===void 0||e instanceof Gr)return i;let a=V(e,r);if(a instanceof M)return a;if(a.rows*a.cols!==t+n)return N.VALUE;let o=[];for(let e of i){let t=e+n,r=nb(a.cols===1?a.at(t,0):a.at(0,t));if(r instanceof M)return r;r&&o.push(e)}return o}function bb(e,t,n,r){let i=e===void 0||e instanceof Gr?[]:$y(e,r,1);if(i instanceof M)return i;let a=[];for(let e of i){let r=Math.abs(e)-1,i=e<0;if(r<0)return N.VALUE;if(r<t)a.push({field:r,down:i});else{let e=n(r-t);if(!e)return N.VALUE;a.push({value:e,down:i})}}for(let e=0;e<t;e++)a.some(t=>`field`in t&&t.field===e)||a.push({field:e,down:!1});return a}var xb=(e,t,n)=>Zy(e,t,n);B(`GROUPBY`,`rrr?vvrrv`,(e,t)=>{let n=V(e[0],t),r=V(e[1],t),i=e[2];if(n instanceof M)return n;if(r instanceof M)return r;if(!(i instanceof Wr)||n.rows!==r.rows)return N.VALUE;let a=n.cols===0?[]:qy(n),o=qy(r),s=vb(e[3],o,t);if(s instanceof M)return s;let c=+!!s.has,l=a.slice(c),u=o.slice(c),d=xb(e[4],t,1);if(d instanceof M)return d;let f=Zy(e[7],t,0);if(f instanceof M)return f;let p=yb(e[6],l.length,c,t);if(p instanceof M)return p;if(p.length===0)return N.CALC;let m=n.cols,h=r.cols,g=e=>u.map(t=>t[e]??null),_=Array.from({length:h},(e,t)=>g(t)),v=e=>p.map(t=>_[e]?.[t]??null),y=(e,n)=>_b(i,n.map(t=>_[e]?.[t]??null),v(e),t),b=bb(e[5],m,e=>e<h?t=>y(e,t):void 0,t);if(b instanceof M)return b;let x=gb(l,m,p,d,b,f===1),S=[];s.show&&S.push([...Array.from({length:m},(e,t)=>s.named?`Row Field ${String(t+1)}`:a[0]?.[t]??null),...Array.from({length:h},(e,t)=>s.named?`Value ${String(t+1)}`:o[0]?.[t]??null)]);for(let e of x)S.push([...e.keys,...Array.from({length:h},(t,n)=>y(n,e.records))]);return Jy(S)}),B(`PIVOTBY`,`rrrr?vvrvrrv`,(e,t)=>{let n=V(e[0],t),r=V(e[1],t),i=V(e[2],t),a=e[3];if(n instanceof M)return n;if(r instanceof M)return r;if(i instanceof M)return i;if(!(a instanceof Wr)||n.rows!==i.rows||r.rows!==i.rows)return N.VALUE;let o=qy(n),s=qy(r),c=qy(i),l=vb(e[4],c,t);if(l instanceof M)return l;let u=+!!l.has,d=o.slice(u),f=s.slice(u),p=c.slice(u),m=xb(e[5],t,1),h=xb(e[7],t,1),g=Zy(e[10],t,0);if(m instanceof M)return m;if(h instanceof M)return h;if(g instanceof M)return g;let _=yb(e[9],p.length,u,t);if(_ instanceof M)return _;if(_.length===0)return N.CALC;let v=i.cols,y=bb(e[6],n.cols,()=>void 0,t),b=bb(e[8],r.cols,()=>void 0,t);if(y instanceof M)return y;if(b instanceof M)return b;let x=gb(d,n.cols,_,m,y,!1),S=gb(f,r.cols,_,h,b,!1),ee=(e,t)=>{let n=new Set(t);return e.filter(e=>n.has(e))},C=(e,t)=>p[t]?.[e]??null,te=(e,n,r)=>{let i=ee(n.records,r.records);if(i.length===0)return null;let o=g===1?n.records:g===2?_:r.records;return _b(a,i.map(t=>C(e,t)),o.map(t=>C(e,t)),t)},w=n.cols,ne=[];for(let e=0;e<r.cols;e++)ne.push([...Array(w).fill(null),...S.flatMap(t=>Array.from({length:v},(n,r)=>r===0?t.keys[e]??null:null))]);(v>1||l.show)&&ne.push([...Array.from({length:w},(e,t)=>l.show?o[0]?.[t]??null:null),...S.flatMap(()=>Array.from({length:v},(e,t)=>l.has?c[0]?.[t]??null:`Value ${String(t+1)}`))]);for(let e of x)ne.push([...e.keys,...S.flatMap(t=>Array.from({length:v},(n,r)=>te(r,e,t)))]);return Jy(ne)});var Sb=(e,t)=>mn(pn(e,t+1,0)).day,Cb=(e,t,n)=>n===0||n===4?Math.round(Lc(e,t,n)*360):t-e;function wb(e,t,n){let r=mn(e),i=r.year*12+r.month-1+t,a=Math.floor(i/12),o=i-a*12+1,s=Sb(a,o);return pn(a,o,n?s:Math.min(r.day,s))}var Tb=e=>{let t=mn(e);return t.day===Sb(t.year,t.month)};function Eb(e,t,n,r){let i=12/n,a=Tb(t),o=0,s=t;for(;s>e;)o+=1,s=wb(t,-i*o,a);let c=wb(t,-i*(o-1),a),l=r===1?c-s:r===3?365/n:360/n,u=Cb(s,e,r);return{previous:s,next:c,count:o,period:l,since:u,until:r===0||r===4?l-u:c-e}}function Db(e,t){let n=[];for(let[r,i]of t.entries()){let t=e[r],a=t==null?i??0:L(t);if(a instanceof M)return a;n.push(a)}return n}var Ob=e=>Number.isInteger(e)&&e>=0&&e<=4,kb=e=>e===1||e===2||e===4;function Ab(e,t,n,r){z(e,t,n.length,(...e)=>{let t=Db(e,n);if(t instanceof M)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||!Ob(l)?N.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]])Ab(e,3,[$,$,$,0],(e,n,r=0,i=0)=>kb(r)?t(Eb(e,n,r,i)):N.NUM);function jb(e,t,n,r,i,a,o){let s=Eb(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}Ab(`PRICE`,6,[$,$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0,o=0)=>n<0||r<0||i<=0||!kb(a)?N.NUM:jb(e,t,n,r,i,a,o)),Ab(`YIELD`,6,[$,$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0,o=0)=>{if(n<0||r<=0||i<=0||!kb(a))return N.NUM;let s=-.99,c=1;for(;jb(e,t,n,c,i,a,o)>r&&c<1e6;)c*=2;for(let l=0;l<200;l++){let l=(s+c)/2;jb(e,t,n,l,i,a,o)>r?s=l:c=l}return(s+c)/2});function Mb(e,t,n,r,i,a){let o=Eb(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}Ab(`DURATION`,5,[$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0)=>n<0||r<0||!kb(i)?N.NUM:Mb(e,t,n,r,i,a)),Ab(`MDURATION`,5,[$,$,$,$,$,0],(e,t,n=0,r=0,i=0,a=0)=>n<0||r<0||!kb(i)?N.NUM:Mb(e,t,n,r,i,a)/(1+r/i)),Ab(`DISC`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?N.NUM:(r-n)/r/Lc(e,t,i)),Ab(`INTRATE`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?N.NUM:(r-n)/n/Lc(e,t,i)),Ab(`RECEIVED`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>{let a=1-r*Lc(e,t,i);return n<=0||r<=0||a<=0?N.NUM:n/a}),Ab(`PRICEDISC`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?N.NUM:r*(1-n*Lc(e,t,i))),Ab(`YIELDDISC`,4,[$,$,$,$,0],(e,t,n=0,r=0,i=0)=>n<=0||r<=0?N.NUM:(r-n)/n/Lc(e,t,i));function Nb(e,t){z(e,3,3,gs((e=0,n=0,r=0)=>{let i=Math.trunc(e),a=Math.trunc(n);return i>=a||r<=0||a>wb(i,12,!1)?N.NUM:t(a-i,r)}))}Nb(`TBILLPRICE`,(e,t)=>{let n=100*(1-t*e/360);return n<=0?N.NUM:n}),Nb(`TBILLYIELD`,(e,t)=>(100-t)/t*360/e),Nb(`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)}),z(`ACCRINTM`,3,5,(...e)=>{let t=Db(e,[$,$,$,1e3,0]);if(t instanceof M)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||!Ob(o)?N.NUM:a*i*Lc(s,c,o)}),z(`ACCRINT`,6,8,(...e)=>{let t=Db(e.slice(0,7),[$,$,$,$,1e3,$,0]);if(t instanceof M)return t;let[n=0,r=0,i=0,a=0,o=0,s=0,c=0]=t,l=e[7]===void 0||mo(e[7]);if(l instanceof M)return l;let u=Math.trunc(n),d=Math.trunc(i),f=Math.trunc(r);if(u>=d||a<=0||o<=0||!kb(s)||!Ob(c))return N.NUM;let p=12/s,m=f,h=f;for(let e=1;m>u;e++)m=wb(f,-p*e,!1);let g=0;for(;m<d;){h=wb(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+=Cb(e,t,c)/n),m=h}return o*a*g/s});var Pb=(e,t)=>(1+e)**t,Fb=e=>e===0?0:1,Ib=e=>Number.isFinite(e)?e:N.NUM;function Lb(e,t,n,r,i){if(e===0)return-(n+r)/t;let a=Pb(e,t);return-(n*a+r)*e/((1+e*i)*(a-1))}function Rb(e,t,n,r,i){if(e===0)return-(r+n*t);let a=Pb(e,t);return-(r*a+n*(1+e*i)*(a-1)/e)}function zb(e,t,n,r,i,a){if(t<1||t>n)return N.NUM;if(a===1&&t===1)return 0;let o=Lb(e,n,r,i,a);return Ib((a===1?Rb(e,t-2,o,r,1)-o:Rb(e,t-1,o,r,0))*e)}z(`PMT`,3,5,gs((e,t,n,r=0,i=0)=>t===0?N.NUM:Ib(Lb(e,t,n,r,Fb(i))))),z(`FV`,3,5,gs((e,t,n,r=0,i=0)=>Ib(Rb(e,t,n,r,Fb(i))))),z(`IPMT`,4,6,gs((e,t,n,r,i=0,a=0)=>zb(e,t,n,r,i,Fb(a)))),z(`PPMT`,4,6,gs((e,t,n,r,i=0,a=0)=>{let o=Fb(a),s=zb(e,t,n,r,i,o);return s instanceof M?s:Ib(Lb(e,n,r,i,o)-s)})),z(`DB`,4,5,gs((e,t,n,r,i=12)=>{let a=Math.trunc(r);if(e<0||t<0||n<=0||a<=0||i<=0||i>12||a>n+1)return N.NUM;let o=e===0?0:Math.round((1-(t/e)**(1/n))*1e3)/1e3,s=0,c=0;for(let t=1;t<=a;t++)c=t===1?e*o*i/12:t===n+1?(e-s)*o*(12-i)/12:(e-s)*o,s+=c;return Ib(c)})),z(`VDB`,5,7,(...e)=>{let t=Db(e.slice(0,6),[$,$,$,$,$,2]);if(t instanceof M)return t;let[n=0,r=0,i=0,a=0,o=0,s=0]=t,c=e[6]!==void 0&&mo(e[6]);if(c instanceof M)return c;if(n<0||r<0||i<=0||a<0||o>i||a>o||s<=0)return N.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 Bb=(e,t,n,r,i)=>({whole:Lc(n,t,i),accrued:Lc(n,e,i),left:Lc(e,t,i),rate:r});Ab(`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 N.NUM;let{whole:s,accrued:c,left:l}=Bb(e,t,o,r,a);return(100+s*r*100)/(1+l*i)-c*r*100}),Ab(`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 N.NUM;let{whole:s,accrued:c,left:l}=Bb(e,t,o,r,a);return((1+s*r)/(i/100+c*r)-1)/l});function Vb(e,t,n,r,i){let a=12/r,o=Tb(t),s={held:0,accrued:0,left:0,count:0},c=0,l=t;for(;l>e;){c+=1;let u=wb(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?Cb(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 Hb(e,t,n,r,i,a,o,s,c){let l=100*i/s,u=Eb(r,t,s,c).count+1,d=Vb(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 Ub(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 Wb(e,t){z(e,8,9,(...e)=>{let n=Db(e,[$,$,$,$,$,$,$,$,0]);if(n instanceof M)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!Ob(d)||!kb(u)||!(p>h&&h>f&&f>m)||s<0||c<0||l<=0?N.NUM:t(e=>Hb(f,p,m,h,s,e,l,u,d),c)})}Wb(`ODDFPRICE`,(e,t)=>e(t)),Wb(`ODDFYIELD`,(e,t)=>Ub(e,t,.1)??N.NUM);function Gb(e,t){z(e,7,8,(...e)=>{let n=Db(e,[$,$,$,$,$,$,$,0]);if(n instanceof M)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!Ob(u)||!kb(l)||!(f>d&&d>p)||o<0||s<0||c<=0?N.NUM:t({odd:Vb(p,f,d,l,u),coupon:100*o/l,last:s,red:c,f:l})})}Gb(`ODDLPRICE`,({odd:e,coupon:t,last:n,red:r,f:i})=>(r+e.held*t)/(1+e.left*n/i)-e.accrued*t),Gb(`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}),z(`AMORLINC`,6,7,(...e)=>{let t=Db(e,[$,$,$,$,$,$,0]);if(t instanceof M)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(!Ob(c)||c===2||n<0||a<0||a>n||l<0||s<=0||r>i)return N.NUM;let u=n*s,d=Lc(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}),z(`AMORDEGRC`,6,7,(...e)=>{let t=Db(e,[$,$,$,$,$,$,0]);if(t instanceof M)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(!Ob(c)||c===2||n<0||a<0||a>n||l<0||s<=0||r>i)return N.NUM;let u=1/s,d=s*(u<3?1:u<5?1.5:u<=6?2:2.5),f=Math.round(Lc(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 Kb(e,t){let n=[];for(let t=0;t<e.cols;t++){let r=R(e.at(0,t));if(r instanceof M)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=R(t.at(0,a));if(c instanceof M)return c;let l=n.indexOf(c.toLowerCase());if(l<0){o=!1;continue}let u=Rs(s);if(u instanceof M)return u;u.test(e.at(i,l))||(o=!1)}o&&(a=!0)}a&&r.push(i)}return r}function qb(e,t){if(typeof t==`number`){let n=Math.trunc(t)-1;return n<0||n>=e.cols?N.VALUE:n}let n=R(t);if(n instanceof M)return n;for(let t=0;t<e.cols;t++){let r=e.at(0,t);if(typeof r==`string`&&_o(r,n)===0)return t}return N.VALUE}function Jb(e,t){let n=V(e[0],t);if(n instanceof M)return n;let r=V(e[2],t);if(r instanceof M)return r;let i=Kb(n,r);if(i instanceof M)return i;let a=e[1];if(a===void 0)return{list:i.map(()=>null),db:n};let o=qb(n,t.calc.scalar(a,t.frame));return o instanceof M?o:{list:i.map(e=>n.at(e,o)),db:n}}function Yb(e,t){B(e,`rvr`,(e,n)=>{let r=Jb(e,n);if(r instanceof M)return r;let i=as.get(t);if(i?.kind!==`raw`)return N.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`]])Yb(e,t);for(let[e,t]of[[`DAVERAGE`,`AVERAGE`],[`DSTDEV`,`STDEV.S`],[`DSTDEVP`,`STDEV.P`],[`DVAR`,`VAR.S`],[`DVARP`,`VAR.P`]])B(e,`rvr`,(e,n)=>{let r=Jb(e,n);if(r instanceof M)return r;let i=as.get(t);if(i?.kind!==`raw`)return N.VALUE;let a=r.list.filter(e=>typeof e==`number`);return a.length===0?N.DIV0:i.call(a,n)});B(`DCOUNT`,`rv?r`,(e,t)=>{let n=Jb(e.length===2?[e[0],void 0,e[1]]:e,t);return n instanceof M?n:n.list.filter(e=>typeof e==`number`).length}),B(`DCOUNTA`,`rv?r`,(e,t)=>{let n=Jb(e.length===2?[e[0],void 0,e[1]]:e,t);return n instanceof M?n:n.list.filter(e=>e!==null).length}),B(`DGET`,`rvr`,(e,t)=>{let n=Jb(e,t);return n instanceof M?n:n.list.length===0?N.VALUE:n.list.length>1?N.NUM:n.list[0]??null});function Xb(e,t,n){let r={reads:[],names:new Set,volatile:!1,unknownNames:[],unknownFunctions:[],arguments:[]},i=new Set,a=(t,a,s)=>{let c=t.toLowerCase();if(s===void 0&&a.has(c))return!0;let l=s===void 0?n:e.sheet(s),u=l?[e.name(c,l)]:e.definitions(c);if(u.some(e=>e!==void 0)){r.names.add(c);let e=`${s??``}!${c}`;if(!i.has(e)){i.add(e);for(let e of u)e?.formula?.node&&o(e.formula.node,new Set)}return!0}if(as.has(t.toUpperCase()))return!0;let d=e.table(c);return d?(r.reads.push({kind:`structured`,table:d.name,sections:[],columns:[],thisRow:!1}),!0):!1},o=(e,t)=>{switch(e.kind){case`ref`:case`structured`:r.reads.push(e);return;case`name`:a(e.name,t,e.sheet)||r.unknownNames.push(e.name);return;case`unary`:case`postfix`:case`paren`:o(e.arg,t);return;case`binary`:o(e.left,t),o(e.right,t);return;case`array`:return;case`invoke`:o(e.callee,t);for(let n of e.args)o(n,t);return;case`call`:{let n=as.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?o(t,n):t.kind===`name`&&n.add(t.name.toLowerCase()))}),r&&o(r,n);return}if(!n)a(e.written,t)||r.unknownFunctions.push(e.name);else{n.volatile===!0&&(r.volatile=!0);let t=n.kind===`raw`&&!ls(n.params,e.args.length);(e.args.length<n.min||e.args.length>n.max||t)&&r.arguments.push({name:e.name,given:e.args.length,min:n.min,max:n.max,...t?{group:n.params.group.length}:{}})}for(let n of e.args)o(n,t);return}default:return}};return t.node&&o(t.node,new Set),r}var Zb=32,Qb=class{cells=new Set;reference;constructor(e){this.reference=e}footprint(){return{sheet:this.reference.sheet,area:this.reference}}visit(e,t,n){if(this.reference.sheet===e&&Yt(this.reference,t))for(let e of this.cells)n(e)}},$b=class{s;constructor(e){this.s=e}footprint(){let{s:e}=this;return{sheet:e.reads,area:{top:e.t+e.kt*e.group.top,bottom:e.b+e.kb*e.group.bottom,left:e.l+e.kl*e.group.left,right:e.r+e.kr*e.group.right}}}visit(e,t,n){let{s:r}=this;if(e!==r.reads)return;let i=ex(r.group.top,r.group.bottom,r.t,r.kt,r.b,r.kb,t.top,t.bottom);if(!i)return;let a=ex(r.group.left,r.group.right,r.l,r.kl,r.r,r.kr,t.left,t.right);if(a)for(let e=i[0];e<=i[1];e++)for(let t=a[0];t<=a[1];t++){let i=r.on.at(e,t);i instanceof gr&&i.shared===r.shared&&n(i)}}};function ex(e,t,n,r,i,a,o,s){let c=e,l=t;if(r===1)l=Math.min(l,s-n);else if(n>s)return;if(a===1)c=Math.max(c,o-i);else if(i<o)return;return c<=l?[c,l]:void 0}var tx=class{single=new Map;ranges=new Map;byColumn=new Map;wide=[];source;constructor(e){this.source=e}build(e){let t=new Map;for(let n of e){let e=t.get(n.shared);e?e.push(n):t.set(n.shared,[n])}for(let[e,n]of t)if(n.length<2||!this.addGroup(e,n))for(let e of n)this.add(e)}add(e){for(let t of this.source.readsOf(e))if(t.single){let n=this.single.get(t.sheet);n||(n=new Map,this.single.set(t.sheet,n));let r=yr(t.top,t.left),i=n.get(r);i||(i=new Set,n.set(r,i)),i.add(e)}else{let n=this.ranges.get(t.key);n||(n=new Qb(t),this.ranges.set(t.key,n),this.list(n)),n.cells.add(e)}}remove(e){for(let t of this.source.readsOf(e))t.single?this.single.get(t.sheet)?.get(yr(t.top,t.left))?.delete(e):this.ranges.get(t.key)?.cells.delete(e)}readersIn(e,t){let n=new Set,r=e=>{n.add(e)},i=this.single.get(e);if(i)for(let e=t.top;e<=t.bottom;e++)for(let r=t.left;r<=t.right;r++)for(let t of i.get(yr(e,r))??[])n.add(t);let a=new Set,o=n=>{a.has(n)||(a.add(n),n.visit(e,t,r))};for(let e of this.wide)o(e);let s=this.byColumn.get(e);if(s)for(let e=t.left;e<=t.right;e++)s.get(e)?.forEach(o);return[...n]}readers(e,t,n){return this.readersIn(e,{top:t,left:n,bottom:t,right:n})}list(e){let{sheet:t,area:n}=e.footprint();if(n.right-n.left+1>Zb){this.wide.push(e);return}let r=this.byColumn.get(t);r||(r=new Map,this.byColumn.set(t,r));for(let t=n.left;t<=n.right;t++){let n=r.get(t);n?n.push(e):r.set(t,[e])}}addGroup(e,t){let n=t[0]?.sheet;if(!n||t.some(e=>e.sheet!==n))return!1;let r={top:1/0,bottom:-1/0,left:1/0,right:-1/0};for(let e of t)r.top=Math.min(r.top,e.row),r.bottom=Math.max(r.bottom,e.row),r.left=Math.min(r.left,e.col),r.right=Math.max(r.right,e.col);let i=(t,r)=>this.source.readsAt(e,n,t,r),a=i(r.top,r.left),o=r.bottom>r.top?i(r.top+1,r.left):a,s=r.right>r.left?i(r.top,r.left+1):a,c=i(r.bottom,r.right);if(o.length!==a.length||s.length!==a.length||c.length!==a.length)return!1;let l=[];for(let t=0;t<a.length;t++){let i=a[t],u=o[t],d=s[t],f=c[t];if(!i||!u||!d||!f||u.sheet!==i.sheet||d.sheet!==i.sheet||f.sheet!==i.sheet)return!1;let p=(e,t)=>{let n=e-t;return n===0||n===1?n:void 0},m=r.bottom>r.top,h=r.right>r.left,g=m?p(u.top,i.top):0,_=m?p(u.bottom,i.bottom):0,v=h?p(d.left,i.left):0,y=h?p(d.right,i.right):0;if(g===void 0||_===void 0||v===void 0||y===void 0)return!1;let b=i.top-g*r.top,x=i.bottom-_*r.top,S=i.left-v*r.left,ee=i.right-y*r.left;if(f.top!==b+g*r.bottom||f.bottom!==x+_*r.bottom||f.left!==S+v*r.right||f.right!==ee+y*r.right)return!1;l.push(new $b({shared:e,on:n,group:r,reads:i.sheet,t:b,kt:g,b:x,kb:_,l:S,kl:v,r:ee,kr:y}))}for(let e of l)this.list(e);return!0}};function nx(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 rx=new Set,ix=/\b(?:SUBTOTAL|AGGREGATE)\(/iu,ax=2e3,ox=12,sx=(e,t)=>!e||!t?e===t:e.rows!==t.rows||e.cols!==t.cols?!1:e.data.every((e,n)=>e===t.data[n]),cx=(e,t)=>e.row<t.row||e.row===t.row&&e.col<t.col,lx=class{cycles=[];computed=0;nowSerial;random;pass=0;stack=[];inCycle=new Set;namesAt=new Set;graph=new tx({readsOf:e=>this.readsOf(e),readsAt:(e,t,n,r)=>this.readsAt(e,t,n,r)});graphMade=!1;reports;replica;settled=new Set;moved=[];unsettled=new Set;hiddenBy=new Map;volatiles=new Set;indexes=new js;results=new js;wb;constructor(e,t={}){this.wb=e;let{now:n,random:r}=t;this.reports=t.report===!0,this.replica=t.replica===!0,this.nowSerial=()=>hn(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)??rx}calculate(){if(this.replica){for(let e of this.wb.sheets)e.clearSpills();for(let e of this.allCells())e.state=0;return this}this.hiddenBy.clear(),this.indexes.clear(),this.results.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=ns(e,this);t.size>0&&this.hiddenBy.set(e,t)}if(this.hiddenBy.size!==0&&e.some(e=>ix.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 M?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)}forget(e,t){this.indexes.changed(e,t),this.results.changed(e,t)}run(e){for(let t of e){let{sheet:e,row:n,col:r}=t;this.forget(e,{top:n,left:r,bottom:n,right:r}),t.spill&&this.forget(e,t.spill)}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>=ox)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(),this.results.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=>Yt(e.area,a))||n.merges.some(e=>Yt(e,a))||o.some(t=>cx(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=N.SPILL,this.moved.push({sheet:n,area:r}),this.reports&&this.settled.add(e))}analysisOf(e){return e.analysis??=Xb(this.wb,e)}readsOf(e){let t=[],n=fx(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 F?t.push(e):e instanceof Ur&&t.push(...e.parts)}return t}readsAt(e,t,n,r){let i={sheet:t,row:n,col:r,dr:n-e.row,dc:r-e.col},a=[];for(let t of this.analysisOf(e).reads){let e=t.kind===`ref`?this.resolveRef(t,i):this.structured(t,i);e instanceof F?a.push(e):e instanceof Ur?a.push(...e.parts):a.push(void 0)}return a}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 F?n.push(e):e instanceof Ur&&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 gr&&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 gr&&n.push(i)}}}return n}compute(e){if(this.stack.length>=ax){e.value=N.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,fx(e))):N.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,this.reports&&this.settled.add(e)}settleResult(e,t){let{sheet:n}=e,r=e.spill,i=e.array;if(n.clearSpill(e),e.array=void 0,t instanceof P){let n=dx(t);n.rows*n.cols<=1||this.spillOut(e,n)?(e.array=n,e.value=n.at(0,0)??0):e.value=N.SPILL}else e.value=t;this.inCycle.has(e)&&(n.clearSpill(e),e.value=N.CYCLE,e.array=void 0);let a=e.spill;sx(i,e.array)&&ux(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 F?e.single?this.read(e.sheet,e.top,e.left):this.matrix(e):e instanceof Ur?N.VALUE:e instanceof Wr?N.CALC:e instanceof Gr?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 P(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 M)?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})):N.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})):N.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 N.REF;let r=0,i=Bt-1,a=0,o=zt-1;if(e.col){let n=this.bound(e.col,t.dc,Bt),a=this.bound(e.col2??e.col,t.dc,Bt);if(n===void 0||a===void 0)return N.REF;r=Math.min(n,a),i=Math.max(n,a)}if(e.row){let n=this.bound(e.row,t.dr,zt),r=this.bound(e.row2??e.row,t.dr,zt);if(n===void 0||r===void 0)return N.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 N.REF;let[s,c]=[Math.min(n.index,t.index),Math.max(n.index,t.index)];return new Ur(this.wb.sheets.slice(s,c+1).map(e=>new F(e,a,r,o,i)))}return new F(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?px(n,e,t):e.table===void 0?N.REF:N.NAME}nameValue(e,t,n){let r=e.toLowerCase();if(n===void 0)for(let e=t.scope;e;e=e.parent){let t=e.names.get(r);if(t!==void 0)return t}let i=n===void 0?t.sheet:this.wb.sheet(n);if(!i)return N.REF;let a=this.wb.name(e,i);if(a){if(!a.formula)return a.value??null;let{node:e}=a.formula;if(!e)return N.NAME;if(this.namesAt.has(r))return N.CYCLE;this.namesAt.add(r);try{return this.eval(e,{sheet:t.sheet,row:0,col:0,dr:0,dc:0})}finally{this.namesAt.delete(r)}}let o=this.wb.table(e);if(o){let{top:e,left:t,bottom:n,right:r}=o.data;return new F(o.sheet,e,t,n,r)}let s=as.get(e.toUpperCase());return s&&s.kind!==`lazy`?mx(s,e,t):N.NAME}intersect(e,t){return!(e instanceof F)||e.single?e:e.cols===1&&t.row>=e.top&&t.row<=e.bottom?new F(e.sheet,t.row,e.left,t.row,e.left):e.rows===1&&t.col>=e.left&&t.col<=e.right?new F(e.sheet,e.top,t.col,e.top,t.col):N.VALUE}unary(e,t){let n=this.flat(e);return n instanceof P?new P(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 P||i instanceof P?So(r instanceof P?r:new P(1,1,[r]),i instanceof P?i:new P(1,1,[i]),(t,n)=>xo(e,t,n)):xo(e,r,i)}rangeOf(e,t){return e instanceof M?e:t instanceof M?t:!(e instanceof F)||!(t instanceof F)||e.sheet!==t.sheet?N.REF:new F(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 M)return e;if(t instanceof M)return t;if(!(e instanceof F)||!(t instanceof F))return N.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?N.NULL:new F(e.sheet,n,r,i,a)}union(e,t){if(e instanceof M)return e;if(t instanceof M)return t;let n=e=>e instanceof F?[e]:e instanceof Ur?e.parts:[],r=[...n(e),...n(t)];return r.length===0?N.VALUE:new Ur(r)}eval(e,t){switch(e.kind){case`number`:case`string`:case`boolean`:return e.value;case`error`:return M.of(e.code);case`missing`:return Kr;case`ref`:return this.resolveRef(e,t);case`structured`:return this.structured(e,t);case`name`:return this.nameValue(e.name,t,e.sheet);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=>xo(`*`,e,-1))}case`postfix`:{let n=this.eval(e.arg,t);if(e.op===`%`)return this.unary(n,e=>xo(`/`,e,100));if(n instanceof F&&n.single){let e=n.sheet.at(n.top,n.left);if(e instanceof gr){this.read(n.sheet,n.top,n.left);let{spill:t}=e;if(t)return new F(n.sheet,t.top,t.left,t.bottom,t.right);if(e.array)return n}}return N.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 P(e.rows.length,e.rows[0]?.length??0,e.rows.flatMap(e=>e.map(e=>{let n=this.eval(e,t);return n instanceof P||n instanceof F||n instanceof Ur||n instanceof Wr||n instanceof Gr?N.VALUE:n})));case`invoke`:{let n=this.eval(e.callee,t);return n instanceof Wr?this.invoke(n,e.args,t):n instanceof M?n:N.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(e.named!==void 0){let n=as.get(e.named);return!n||n.kind===`lazy`?N.NAME:t.length<n.min||t.length>n.max?N.VALUE:this.applyFunction(n,t,e.frame)}if(t.length>e.params.length)return N.VALUE;let n=new Map;return e.params.forEach((e,r)=>{n.set(e,t[r]??Kr)}),this.eval(e.body,{...e.frame,scope:{names:n,...e.frame.scope?{parent:e.frame.scope}:{}}})}call(e,t,n){let r=as.get(e);if(!r){let r=this.nameValue(e,n);return r instanceof Wr?this.invoke(r,t,n):N.NAME}return t.length<r.min||t.length>r.max?N.VALUE:r.kind===`lazy`?r.call(t,{calc:this,frame:n}):this.applyFunction(r,t.map(e=>this.eval(e,n)),n)}applyFunction(e,t,n){let r={calc:this,frame:n};if(e.kind===`lazy`)return N.VALUE;if(e.kind===`raw`)return ls(e.params,t.length)?this.over(t,t=>cs(e.params,t)===`value`,t=>e.call(t,r)):N.VALUE;let i=e.errors===!0;return this.over(t,()=>!0,t=>{let n=t.map(e=>e instanceof Gr?void 0:e);if(!i){for(let e of n)if(e instanceof M)return e}return e.call(...n)})}over(e,t,n){let r=[],i=new Map;for(let[n,a]of e.entries()){if(!t(n)||a instanceof Gr){r.push(a);continue}let e=this.flat(a);e instanceof P&&i.set(n,e),r.push(e)}if(i.size===0)return n(r);let a=[...i.values()],o=Math.max(...a.map(e=>e.rows)),s=Math.max(...a.map(e=>e.cols));if(o===0||s===0)return N.CALC;let c=Array(o*s);for(let e=0;e<o;e++)for(let t=0;t<s;t++){let a=r.map((n,r)=>{let a=i.get(r);if(!a)return n;let o=a.rows===1?0:e,s=a.cols===1?0:t;return o<a.rows&&s<a.cols?a.at(o,s):N.NA});c[e*s+t]=this.element(n(a))}return new P(o,s,c)}element(e){let t=this.flat(e);return t instanceof P?t.rows>0&&t.cols>0?t.at(0,0):N.CALC:t}scalar(e,t){if(e instanceof Gr)return null;if(e instanceof F){let n=this.intersect(e,t);return n instanceof F?this.read(n.sheet,n.top,n.left):N.VALUE}return e instanceof P?e.at(0,0):e instanceof Ur||e instanceof Wr?N.VALUE:e}recalculate(){if(this.replica)return this;let e=this.allCells().filter(e=>this.analysisOf(e.shared).volatile);return this.mark(e),this}build(){if(this.graphMade)return;this.graphMade=!0;let e=this.allCells();for(let t of e)this.analysisOf(t.shared).volatile&&this.volatiles.add(t);this.graph.build(e)}addEdges(e){this.analysisOf(e.shared).volatile&&this.volatiles.add(e),this.graph.add(e)}removeEdges(e){this.volatiles.delete(e),this.graph.remove(e)}readersIn(e,t){return this.graph.readersIn(e,t)}readers(e,t,n){return this.build(),this.graph.readers(e,t,n)}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 gr(new hr(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){if(this.replica){for(let{sheet:t,row:n,col:r,slot:i}of e){let e=t.at(n,r);e instanceof gr&&t.clearSpill(e),t.replace(n,r,i),i instanceof gr&&(i.state=0)}return}this.build();let t=new Set,n=[...this.unsettled];this.unsettled.clear();let r=new Set;for(let{sheet:i,row:a,col:o,slot:s}of e){let e=i.at(a,o);e instanceof gr&&(r.add(e),this.inCycle.delete(e),this.removeEdges(e),t.delete(e),e.spill&&this.moved.push({sheet:i,area:e.spill}),i.clearSpill(e));let c=i.spillAt(a,o);c&&n.push(c),n.push(...i.blockedBy({top:a,left:o,bottom:a,right:o})),i.replace(a,o,s),this.forget(i,{top:a,left:o,bottom:a,right:o}),s instanceof gr&&(this.addEdges(s),t.add(s))}r.size>0&&(this.cycles=this.cycles.filter(e=>!e.some(e=>r.has(e))));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)))}takeComputed(){let e=[];for(let t of this.settled)e.push({sheet:t.sheet.index,row:t.row,col:t.col,value:Ir(t.value),...t.array?{array:Rr(t.array)}:{},...t.spill?{spill:t.spill}:{},...t.blocked?{blocked:t.blocked}:{}});return this.settled.clear(),{cells:e,cycles:this.cycles.map(e=>e.map(e=>({sheet:e.sheet.index,row:e.row,col:e.col}))),hidden:[...this.hiddenBy].map(([e,t])=>({sheet:e.index,rows:[...t]}))}}receive(e){for(let t of e.cells){let e=this.wb.sheets[t.sheet],n=e?.at(t.row,t.col);e&&n instanceof gr&&(e.clearSpill(n),n.value=Lr(t.value),n.array=t.array?zr(t.array):void 0,t.spill&&e.placeSpill(n,t.spill),t.blocked&&e.blockSpill(n,t.blocked),n.state=0)}this.cycles=e.cycles.flatMap(e=>{let t=e.flatMap(e=>{let t=this.wb.sheets[e.sheet]?.at(e.row,e.col);return t instanceof gr?[t]:[]});return t.length>0?[t]:[]});let t=new Map(this.hiddenBy);this.hiddenBy.clear();for(let{sheet:n,rows:r}of e.hidden){let e=this.wb.sheets[n];if(!e)continue;let i=t.get(e),a=i?.size===r.length&&r.every(e=>i.has(e));this.hiddenBy.set(e,a?i:new Set(r))}for(let e of this.wb.sheets)e.tighten()}numberOf(e){return L(e)}},ux=(e,t)=>e?.top===t?.top&&e?.left===t?.left&&e?.bottom===t?.bottom&&e?.right===t?.right;function dx(e){return e.data.some(e=>e===null)?new P(e.rows,e.cols,e.data.map(e=>e??0)):e}function fx(e){return{sheet:e.sheet,row:e.row,col:e.col,dr:e.row-e.shared.row,dc:e.col-e.shared.col}}function px(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 N.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?N.VALUE:new F(r,n.row,a,n.row,o);let l=t.sections;if(l.includes(`#Totals`))return N.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 F(r,f,a,p,o)}function mx(e,t,n){return new Wr([],{kind:`call`,name:e.name,written:t,args:[]},n,e.name)}function hx(e){return e.cells.map(e=>{let t=e.column?e.sheet.tables.flatMap(e=>e.columns.map(t=>({table:e.name,col:t}))).find(t=>t.col.formula===e.column):void 0;return{sheet:e.sheet.index,row:e.row,col:e.col,...e.input===void 0?{}:{input:e.input},...t?{column:{table:t.table,name:t.col.name}}:{},...e.key===void 0?{}:{key:e.key},...e.record?{record:{table:e.record.table.name,index:e.record.index,fields:e.record.fields}}:{}}})}function gx(e,t,n,r){r&&e.respec(r);let i=[];for(let t of n){let n=e.sheets[t.sheet];if(!n)continue;let{row:r,col:a}=t,o=yr(r,a);if(t.key===null?n.keys.delete(o):t.key!==void 0&&n.keys.set(o,t.key),t.record){let n=e.table(t.record.table);n&&(n.records[t.record.index]=t.record.fields)}n.implied.delete(o);let s=t.column?e.table(t.column.table)?.columns.find(e=>e.name===t.column?.name)?.formula:void 0;if(s){i.push({sheet:n,row:r,col:a,slot:new gr(s,n,r,a)});continue}let c=En(t.input??``);c.format!==void 0&&n.implied.set(o,c.format),i.push({sheet:n,row:r,col:a,slot:c.formula===void 0?c.value??void 0:new gr(new hr(c.formula,r,a,{file:``}),n,r,a)})}t.change(i)}function _x(e,t={}){let n=new Map(e.rows),r=Fr({file:e.file,rows:e=>n.get(e),generated:e.generated});return e.scenario!==void 0&&Hr(r,e.scenario),{workbook:r,calc:new lx(r,{random:nx(e.seed),...t}).calculate()}}var vx=class{model;generation=-1;handle(e){if(e.kind===`open`)this.model=_x(e,{report:!0}),this.generation=e.generation;else{if(e.generation!==this.generation||!this.model)return;e.kind===`cells`?gx(this.model.workbook,this.model.calc,e.cells,e.file):this.model.calc.recalculate()}return{generation:this.generation,computed:this.model.calc.takeComputed()}}},yx=/\.(?:png|jpe?g|gif|webp|bmp|svg)$/iu,bx=e=>yx.test(e),xx=e=>(typeof e==`object`?e.height:void 0)??60;function Sx(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 Cx(e,t){if(!Sx(e))return[];let n=[],r=(r,i,a)=>{let o=t.value(e,r,i);if(typeof o!=`string`)return;let s=Cr(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=Ht(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?.[Vt(i)]?.files;if(a!==void 0)for(let e=t.data.top;e<=t.data.bottom;e++)r(e,i,a)}return n}var wx={TableStyleDark1:{whole:{color:`#FFFFFF`,fill:`#737373`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#404040`}},TableStyleDark2:{whole:{color:`#FFFFFF`,fill:`#4472C4`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#2F5597`}},TableStyleDark3:{whole:{color:`#FFFFFF`,fill:`#ED7D31`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#C55A11`}},TableStyleDark4:{whole:{color:`#FFFFFF`,fill:`#A5A5A5`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#7C7C7C`}},TableStyleDark5:{whole:{color:`#FFFFFF`,fill:`#FFC000`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#BF9000`}},TableStyleDark6:{whole:{color:`#FFFFFF`,fill:`#5B9BD5`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#2E75B6`}},TableStyleDark7:{whole:{color:`#FFFFFF`,fill:`#70AD47`},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#FFFFFF`}}},stripe:{fill:`#548235`}},TableStyleDark8:{whole:{fill:`#D9D9D9`},header:{color:`#FFFFFF`,fill:`#000000`},stripe:{fill:`#A6A6A6`}},TableStyleDark9:{whole:{fill:`#DAE3F3`},header:{color:`#FFFFFF`,fill:`#ED7D31`},stripe:{fill:`#B4C7E7`}},TableStyleDark10:{whole:{fill:`#EDEDED`},header:{color:`#FFFFFF`,fill:`#FFC000`},stripe:{fill:`#DBDBDB`}},TableStyleDark11:{whole:{fill:`#DEEBF7`},header:{color:`#FFFFFF`,fill:`#70AD47`},stripe:{fill:`#BDD7EE`}},TableStyleLight1:{whole:{color:`#000000`,border:{top:{style:`thin`,color:`#000000`},bottom:{style:`thin`,color:`#000000`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`thin`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleLight2:{whole:{color:`#2F5597`,border:{top:{style:`thin`,color:`#4472C4`},bottom:{style:`thin`,color:`#4472C4`}}},header:{bold:!0,color:`#2F5597`,border:{bottom:{style:`thin`,color:`#4472C4`}}},stripe:{fill:`#DAE3F3`}},TableStyleLight3:{whole:{color:`#C55A11`,border:{top:{style:`thin`,color:`#ED7D31`},bottom:{style:`thin`,color:`#ED7D31`}}},header:{bold:!0,color:`#C55A11`,border:{bottom:{style:`thin`,color:`#ED7D31`}}},stripe:{fill:`#FBE5D6`}},TableStyleLight4:{whole:{color:`#7C7C7C`,border:{top:{style:`thin`,color:`#A5A5A5`},bottom:{style:`thin`,color:`#A5A5A5`}}},header:{bold:!0,color:`#7C7C7C`,border:{bottom:{style:`thin`,color:`#A5A5A5`}}},stripe:{fill:`#EDEDED`}},TableStyleLight5:{whole:{color:`#BF9000`,border:{top:{style:`thin`,color:`#FFC000`},bottom:{style:`thin`,color:`#FFC000`}}},header:{bold:!0,color:`#BF9000`,border:{bottom:{style:`thin`,color:`#FFC000`}}},stripe:{fill:`#FFF2CC`}},TableStyleLight6:{whole:{color:`#2E75B6`,border:{top:{style:`thin`,color:`#5B9BD5`},bottom:{style:`thin`,color:`#5B9BD5`}}},header:{bold:!0,color:`#2E75B6`,border:{bottom:{style:`thin`,color:`#5B9BD5`}}},stripe:{fill:`#DEEBF7`}},TableStyleLight7:{whole:{color:`#548235`,border:{top:{style:`thin`,color:`#70AD47`},bottom:{style:`thin`,color:`#70AD47`}}},header:{bold:!0,color:`#548235`,border:{bottom:{style:`thin`,color:`#70AD47`}}},stripe:{fill:`#E2F0D9`}},TableStyleLight8:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#000000`},right:{style:`thin`,color:`#000000`},top:{style:`thin`,color:`#000000`},bottom:{style:`thin`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`},stripe:{border:{top:{style:`thin`,color:`#000000`}}},stripe2:{border:{top:{style:`thin`,color:`#000000`}}}},TableStyleLight9:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#4472C4`},right:{style:`thin`,color:`#4472C4`},top:{style:`thin`,color:`#4472C4`},bottom:{style:`thin`,color:`#4472C4`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#4472C4`},stripe:{border:{top:{style:`thin`,color:`#4472C4`}}},stripe2:{border:{top:{style:`thin`,color:`#4472C4`}}}},TableStyleLight10:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#ED7D31`},right:{style:`thin`,color:`#ED7D31`},top:{style:`thin`,color:`#ED7D31`},bottom:{style:`thin`,color:`#ED7D31`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#ED7D31`},stripe:{border:{top:{style:`thin`,color:`#ED7D31`}}},stripe2:{border:{top:{style:`thin`,color:`#ED7D31`}}}},TableStyleLight11:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#A5A5A5`},right:{style:`thin`,color:`#A5A5A5`},top:{style:`thin`,color:`#A5A5A5`},bottom:{style:`thin`,color:`#A5A5A5`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#A5A5A5`},stripe:{border:{top:{style:`thin`,color:`#A5A5A5`}}},stripe2:{border:{top:{style:`thin`,color:`#A5A5A5`}}}},TableStyleLight12:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#FFC000`},right:{style:`thin`,color:`#FFC000`},top:{style:`thin`,color:`#FFC000`},bottom:{style:`thin`,color:`#FFC000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#FFC000`},stripe:{border:{top:{style:`thin`,color:`#FFC000`}}},stripe2:{border:{top:{style:`thin`,color:`#FFC000`}}}},TableStyleLight13:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#5B9BD5`},right:{style:`thin`,color:`#5B9BD5`},top:{style:`thin`,color:`#5B9BD5`},bottom:{style:`thin`,color:`#5B9BD5`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#5B9BD5`},stripe:{border:{top:{style:`thin`,color:`#5B9BD5`}}},stripe2:{border:{top:{style:`thin`,color:`#5B9BD5`}}}},TableStyleLight14:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#70AD47`},right:{style:`thin`,color:`#70AD47`},top:{style:`thin`,color:`#70AD47`},bottom:{style:`thin`,color:`#70AD47`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#70AD47`},stripe:{border:{top:{style:`thin`,color:`#70AD47`}}},stripe2:{border:{top:{style:`thin`,color:`#70AD47`}}}},TableStyleLight15:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#000000`},right:{style:`thin`,color:`#000000`},top:{style:`thin`,color:`#000000`},bottom:{style:`thin`,color:`#000000`},horizontal:{style:`thin`,color:`#000000`},vertical:{style:`thin`,color:`#000000`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleLight16:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#4472C4`},right:{style:`thin`,color:`#4472C4`},top:{style:`thin`,color:`#4472C4`},bottom:{style:`thin`,color:`#4472C4`},horizontal:{style:`thin`,color:`#4472C4`},vertical:{style:`thin`,color:`#4472C4`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#4472C4`}}},stripe:{fill:`#DAE3F3`}},TableStyleLight17:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#ED7D31`},right:{style:`thin`,color:`#ED7D31`},top:{style:`thin`,color:`#ED7D31`},bottom:{style:`thin`,color:`#ED7D31`},horizontal:{style:`thin`,color:`#ED7D31`},vertical:{style:`thin`,color:`#ED7D31`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#ED7D31`}}},stripe:{fill:`#FBE5D6`}},TableStyleLight18:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#A5A5A5`},right:{style:`thin`,color:`#A5A5A5`},top:{style:`thin`,color:`#A5A5A5`},bottom:{style:`thin`,color:`#A5A5A5`},horizontal:{style:`thin`,color:`#A5A5A5`},vertical:{style:`thin`,color:`#A5A5A5`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#A5A5A5`}}},stripe:{fill:`#EDEDED`}},TableStyleLight19:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#FFC000`},right:{style:`thin`,color:`#FFC000`},top:{style:`thin`,color:`#FFC000`},bottom:{style:`thin`,color:`#FFC000`},horizontal:{style:`thin`,color:`#FFC000`},vertical:{style:`thin`,color:`#FFC000`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#FFC000`}}},stripe:{fill:`#FFF2CC`}},TableStyleLight20:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#5B9BD5`},right:{style:`thin`,color:`#5B9BD5`},top:{style:`thin`,color:`#5B9BD5`},bottom:{style:`thin`,color:`#5B9BD5`},horizontal:{style:`thin`,color:`#5B9BD5`},vertical:{style:`thin`,color:`#5B9BD5`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#5B9BD5`}}},stripe:{fill:`#DEEBF7`}},TableStyleLight21:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#70AD47`},right:{style:`thin`,color:`#70AD47`},top:{style:`thin`,color:`#70AD47`},bottom:{style:`thin`,color:`#70AD47`},horizontal:{style:`thin`,color:`#70AD47`},vertical:{style:`thin`,color:`#70AD47`}}},header:{bold:!0,color:`#000000`,border:{bottom:{style:`medium`,color:`#70AD47`}}},stripe:{fill:`#E2F0D9`}},TableStyleMedium1:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#000000`},right:{style:`thin`,color:`#000000`},top:{style:`thin`,color:`#000000`},bottom:{style:`thin`,color:`#000000`},horizontal:{style:`thin`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`},stripe:{fill:`#D9D9D9`}},TableStyleMedium2:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#8FAADC`},right:{style:`thin`,color:`#8FAADC`},top:{style:`thin`,color:`#8FAADC`},bottom:{style:`thin`,color:`#8FAADC`},horizontal:{style:`thin`,color:`#8FAADC`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#4472C4`},stripe:{fill:`#DAE3F3`}},TableStyleMedium3:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#F4B183`},right:{style:`thin`,color:`#F4B183`},top:{style:`thin`,color:`#F4B183`},bottom:{style:`thin`,color:`#F4B183`},horizontal:{style:`thin`,color:`#F4B183`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#ED7D31`},stripe:{fill:`#FBE5D6`}},TableStyleMedium4:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#C9C9C9`},right:{style:`thin`,color:`#C9C9C9`},top:{style:`thin`,color:`#C9C9C9`},bottom:{style:`thin`,color:`#C9C9C9`},horizontal:{style:`thin`,color:`#C9C9C9`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#A5A5A5`},stripe:{fill:`#EDEDED`}},TableStyleMedium5:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#FFD966`},right:{style:`thin`,color:`#FFD966`},top:{style:`thin`,color:`#FFD966`},bottom:{style:`thin`,color:`#FFD966`},horizontal:{style:`thin`,color:`#FFD966`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#FFC000`},stripe:{fill:`#FFF2CC`}},TableStyleMedium6:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#9DC3E6`},right:{style:`thin`,color:`#9DC3E6`},top:{style:`thin`,color:`#9DC3E6`},bottom:{style:`thin`,color:`#9DC3E6`},horizontal:{style:`thin`,color:`#9DC3E6`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#5B9BD5`},stripe:{fill:`#DEEBF7`}},TableStyleMedium7:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#A9D18E`},right:{style:`thin`,color:`#A9D18E`},top:{style:`thin`,color:`#A9D18E`},bottom:{style:`thin`,color:`#A9D18E`},horizontal:{style:`thin`,color:`#A9D18E`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#70AD47`},stripe:{fill:`#E2F0D9`}},TableStyleMedium8:{whole:{color:`#000000`,fill:`#D9D9D9`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#A6A6A6`}},TableStyleMedium9:{whole:{color:`#000000`,fill:`#DAE3F3`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#4472C4`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#B4C7E7`}},TableStyleMedium10:{whole:{color:`#000000`,fill:`#FBE5D6`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#ED7D31`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#F8CBAD`}},TableStyleMedium11:{whole:{color:`#000000`,fill:`#EDEDED`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#A5A5A5`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#DBDBDB`}},TableStyleMedium12:{whole:{color:`#000000`,fill:`#FFF2CC`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#FFC000`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#FFE699`}},TableStyleMedium13:{whole:{color:`#000000`,fill:`#DEEBF7`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#5B9BD5`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#BDD7EE`}},TableStyleMedium14:{whole:{color:`#000000`,fill:`#E2F0D9`,border:{horizontal:{style:`thin`,color:`#FFFFFF`},vertical:{style:`thin`,color:`#FFFFFF`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#70AD47`,border:{bottom:{style:`thick`,color:`#FFFFFF`}}},stripe:{fill:`#C5E0B4`}},TableStyleMedium15:{whole:{color:`#000000`,border:{left:{style:`thin`,color:`#000000`},right:{style:`thin`,color:`#000000`},top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`},horizontal:{style:`thin`,color:`#000000`},vertical:{style:`thin`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#000000`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium16:{whole:{color:`#000000`,border:{top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#4472C4`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium17:{whole:{color:`#000000`,border:{top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#ED7D31`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium18:{whole:{color:`#000000`,border:{top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#A5A5A5`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium19:{whole:{color:`#000000`,border:{top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#FFC000`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium20:{whole:{color:`#000000`,border:{top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#5B9BD5`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium21:{whole:{color:`#000000`,border:{top:{style:`medium`,color:`#000000`},bottom:{style:`medium`,color:`#000000`}}},header:{bold:!0,color:`#FFFFFF`,fill:`#70AD47`,border:{bottom:{style:`medium`,color:`#000000`}}},stripe:{fill:`#D9D9D9`}},TableStyleMedium22:{whole:{color:`#000000`,fill:`#D9D9D9`,border:{left:{style:`thin`,color:`#000000`},right:{style:`thin`,color:`#000000`},top:{style:`thin`,color:`#000000`},bottom:{style:`thin`,color:`#000000`},horizontal:{style:`thin`,color:`#000000`},vertical:{style:`thin`,color:`#000000`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#A6A6A6`}},TableStyleMedium23:{whole:{color:`#000000`,fill:`#DAE3F3`,border:{left:{style:`thin`,color:`#8FAADC`},right:{style:`thin`,color:`#8FAADC`},top:{style:`thin`,color:`#8FAADC`},bottom:{style:`thin`,color:`#8FAADC`},horizontal:{style:`thin`,color:`#8FAADC`},vertical:{style:`thin`,color:`#8FAADC`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#B4C7E7`}},TableStyleMedium24:{whole:{color:`#000000`,fill:`#FBE5D6`,border:{left:{style:`thin`,color:`#F4B183`},right:{style:`thin`,color:`#F4B183`},top:{style:`thin`,color:`#F4B183`},bottom:{style:`thin`,color:`#F4B183`},horizontal:{style:`thin`,color:`#F4B183`},vertical:{style:`thin`,color:`#F4B183`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#F8CBAD`}},TableStyleMedium25:{whole:{color:`#000000`,fill:`#EDEDED`,border:{left:{style:`thin`,color:`#C9C9C9`},right:{style:`thin`,color:`#C9C9C9`},top:{style:`thin`,color:`#C9C9C9`},bottom:{style:`thin`,color:`#C9C9C9`},horizontal:{style:`thin`,color:`#C9C9C9`},vertical:{style:`thin`,color:`#C9C9C9`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#DBDBDB`}},TableStyleMedium26:{whole:{color:`#000000`,fill:`#FFF2CC`,border:{left:{style:`thin`,color:`#FFD966`},right:{style:`thin`,color:`#FFD966`},top:{style:`thin`,color:`#FFD966`},bottom:{style:`thin`,color:`#FFD966`},horizontal:{style:`thin`,color:`#FFD966`},vertical:{style:`thin`,color:`#FFD966`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#FFE699`}},TableStyleMedium27:{whole:{color:`#000000`,fill:`#DEEBF7`,border:{left:{style:`thin`,color:`#9DC3E6`},right:{style:`thin`,color:`#9DC3E6`},top:{style:`thin`,color:`#9DC3E6`},bottom:{style:`thin`,color:`#9DC3E6`},horizontal:{style:`thin`,color:`#9DC3E6`},vertical:{style:`thin`,color:`#9DC3E6`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#BDD7EE`}},TableStyleMedium28:{whole:{color:`#000000`,fill:`#E2F0D9`,border:{left:{style:`thin`,color:`#A9D18E`},right:{style:`thin`,color:`#A9D18E`},top:{style:`thin`,color:`#A9D18E`},bottom:{style:`thin`,color:`#A9D18E`},horizontal:{style:`thin`,color:`#A9D18E`},vertical:{style:`thin`,color:`#A9D18E`}}},header:{bold:!0,color:`#000000`},stripe:{fill:`#C5E0B4`}}},Tx=e=>e.spec.style===`none`?void 0:wx[e.spec.style??`TableStyleMedium2`];function Ex(e,t,n,r,i){let{area:a}=t,o={},s={},c=(e,t)=>{if(!e)return;e.bold!==void 0&&(o.bold=e.bold),e.color!==void 0&&(o.color=e.color),e.fill!==void 0&&(o.fill=e.fill);let n=e.border;if(!n)return;let r=(e,r)=>{let i=t[e]?n[e]:n[r];i&&(s[e]=i)};r(`left`,`vertical`),r(`right`,`vertical`),r(`top`,`horizontal`),r(`bottom`,`horizontal`)},l={left:r===a.left,right:r===a.right};return c(e.whole,{...l,top:n===a.top,bottom:n===a.bottom}),c(i===void 0?e.header:i%2==0?e.stripe:e.stripe2,{...l,top:!0,bottom:!0}),Object.keys(s).length>0&&(o.border=s),o}var Dx=e=>$e(e.key)?String(e.key.value):void 0,Ox=96,kx=e=>$e(e)||Me(e)&&e.items.every($e),Ax=new Set([``,`sheets[]`,`tables[]`,`cells`,`columns`,`rows`,`names`,`scenarios`]);function jx(e,t){if(Me(e)){for(let n of e.items)jx(n,`${t}[]`);e.flow=e.items.every($e)}else if(ve(e)){for(let t of e.items)jx(t.value,Dx(t)??``);e.flow=!Ax.has(t)&&e.items.length>0&&e.items.every(e=>kx(e.value)||ve(e.value)&&e.value.flow===!0),e.flow&&new Ie(e).toString({lineWidth:0,flowCollectionPadding:!0}).length>Ox&&(e.flow=!1)}}var Mx={lineWidth:0,flowCollectionPadding:!0};function Nx(e){let t=new Ie(e,{aliasDuplicateObjects:!1});jx(t.contents,``);let n=t.toString(Mx);return n===`{}
|
|
13
|
+
`?``:Px(n)}var Px=e=>e.replace(/\[ ([^[\]{}"'\n]*) \]/g,`[$1]`).replace(/\[ \{/g,`[{`).replace(/\} \]/g,`}]`),Fx=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function Ix(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>Ix(e,t[n]));if(!Fx(e)||!Fx(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&&Ix(e[n],t[n]))}function Lx(e,t,n,r,i){if(!Ix(t,n)){if(ve(e)&&!e.flow&&Fx(t)&&Fx(n))for(let a of new Set([...Object.keys(t),...Object.keys(n)])){let o=e.items.find(e=>Dx(e)===a)?.value;Ix(t[a],n[a])||Lx(o,t[a],n[a],[...r,a],i)}else if(Me(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&&Ix(t[o],n[o]);)o++;let s=0;for(;s<a-o&&Ix(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++)Lx(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 Rx=(e,t)=>e.lastIndexOf(`
|
|
14
|
+
`,t-1)+1,zx=(e,t)=>{let n=e.indexOf(`
|
|
15
|
+
`,t);return n<0?e.length:n+1},Bx=(e,t)=>e.split(`
|
|
16
|
+
`).map((e,n)=>n===0||e===``?e:` `.repeat(t)+e).join(`
|
|
17
|
+
`);function Vx(e,t,n,r){let i=new Ie({[e]:t},{aliasDuplicateObjects:!1}),a=i.contents;jx(a,``);let o=a.items[0];return(ve(r)||Me(r))&&(ve(o?.value)||Me(o?.value))&&(o.value.flow=r.flow??!1),Bx(Px(i.toString(Mx).replace(/\n$/,``)),n)}function Hx(e,t,n){let r=new Ie([e],{aliasDuplicateObjects:!1}),i=r.contents;return jx(i,n),i.flow=!1,Bx(Px(r.toString(Mx).replace(/\n$/,``)),t)}function Ux(e,t){let n=e.contents;for(let e of t.slice(0,-1))if(ve(n)){if(n.flow)return;n=n.items.find(t=>Dx(t)===String(e))?.value}else if(Me(n)){if(n.flow)return;n=n.items[Number(e)]}else return;return ve(n)||Me(n)?n:void 0}function Wx(e,t){let n=t.items[0]?.range?.[0];if(n===void 0)return;let r=Rx(e,n),i=e.indexOf(`-`,r);return i>=0&&i<n?i-r:void 0}function Gx(e,t){let n=Qe(e);if(n.errors.length>0)return;let{path:r,value:i}=t,a=r[r.length-1],o=Ux(n,r);if(a===void 0||!o||o.flow)return;if(Me(o)){let n=Number(a),s=Wx(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,Rx(e,t))+e.slice(zx(e,n-1))}if(t.insert===!0){let t=c?.range?.[0];if(t===void 0)return;let n=Rx(e,t);return`${e.slice(0,n)}${` `.repeat(s)}${Hx(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:zx(e,l),d=u>0&&e.charAt(u-1)!==`
|
|
19
|
+
`?`
|
|
20
|
+
`:``;return`${e.slice(0,u)}${d}${` `.repeat(s)}${Hx(i,s,String(r[r.length-2]??``))}\n${e.slice(u)}`}let s=String(a),c=o.items.find(e=>Dx(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-Rx(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,Rx(e,t))+e.slice(zx(e,n-1));let r=e.charAt(n-1)===`
|
|
21
|
+
`?`
|
|
22
|
+
`:``;return e.slice(0,t)+Vx(s,i,f,u)+r+e.slice(n)}if(i===void 0)return e;let p=Vx(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:zx(e,h),_=g>0&&e.charAt(g-1)!==`
|
|
26
|
+
`?`
|
|
27
|
+
`:``;return`${e.slice(0,g)}${_}${` `.repeat(f)}${p}\n${e.slice(g)}`}var Kx=400;function qx(e,t){let n=Qe(e);if(n.errors.length>0||e.trim()!==``&&!ve(n.contents)||e.trim()===``)return Nx(t);let r=[];if(Lx(n.contents,n.toJS(),t,[],r),r.length===0)return e;if(r.length>Kx)return Nx(t);let i=e;for(let e of r){let n=Gx(i,e);if(n===void 0)return Nx(t);i=n}let a=Qe(i);return a.errors.length===0&&Ix(a.toJS(),Jx(t))?i:Nx(t)}var Jx=e=>JSON.parse(JSON.stringify(e)),Yx=[`bottom`,`top`,`left`,`right`,`none`,`all`,`outside`,`thickOutside`,`bottomDouble`,`thickBottom`,`topBottom`,`topThickBottom`,`topDoubleBottom`],Xx=(e,t)=>Object.fromEntries(Object.entries(e).filter(([e])=>e!==t)),Zx={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 Qx(e,t,n){let r=e=>({...n,style:e});switch(e){case`bottom`:return[{area:Zx.bottom(t),sides:{bottom:n}}];case`top`:return[{area:Zx.top(t),sides:{top:n}}];case`left`:return[{area:Zx.left(t),sides:{left:n}}];case`right`:return[{area:Zx.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:Zx.top(t),sides:{top:i}},{area:Zx.bottom(t),sides:{bottom:i}},{area:Zx.left(t),sides:{left:i}},{area:Zx.right(t),sides:{right:i}}]}case`bottomDouble`:return[{area:Zx.bottom(t),sides:{bottom:r(`double`)}}];case`thickBottom`:return[{area:Zx.bottom(t),sides:{bottom:r(`thick`)}}];case`topBottom`:return[{area:Zx.top(t),sides:{top:n}},{area:Zx.bottom(t),sides:{bottom:n}}];case`topThickBottom`:return[{area:Zx.top(t),sides:{top:n}},{area:Zx.bottom(t),sides:{bottom:r(`thick`)}}];case`topDoubleBottom`:return[{area:Zx.top(t),sides:{top:n}},{area:Zx.bottom(t),sides:{bottom:r(`double`)}}];case`none`:return[]}}function $x(e,t,n,r){let i=e.spec(t),a=Wt(n),o=i.format?.find(e=>e.range===a)?.border;Va(e,t,n,{border:{...o,...r}})}function eS(e,t,n,r,i={}){let a=e.workbook.sheet(t);if(!a)return I(`no-sheet`);let o=new ma(e);if(r===`none`)return Va(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 Qx(r,n,s))$x(o,a,e.area,e.sides);return o.finish()}function tS(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return I(`no-sheet`);let a=new ma(e),o=e=>e??{style:`none`},{top:s,bottom:c,left:l,right:u,horizontal:d,vertical:f}=r;return s!==void 0&&$x(a,i,Zx.top(n),{top:o(s)}),c!==void 0&&$x(a,i,Zx.bottom(n),{bottom:o(c)}),l!==void 0&&$x(a,i,Zx.left(n),{left:o(l)}),u!==void 0&&$x(a,i,Zx.right(n),{right:o(u)}),d!==void 0&&n.bottom>n.top&&$x(a,i,{...n,bottom:n.bottom-1},{bottom:o(d)}),f!==void 0&&n.right>n.left&&$x(a,i,{...n,right:n.right-1},{right:o(f)}),a.finish()}function nS(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 rS(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return I(`no-sheet`);if(i.tables.some(e=>Yt(e.area,n)))return I(`merge-table`);let a=new ma(e),o=a.spec(i),s=(o.merges??[]).filter(e=>{let t=Kt(e);return!t||!Yt(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(Wt(t)),iS(a,e,i,t));return l.length===0?ua():(o.merges=[...s,...l],r===`center`&&Va(a,i,n,{align:`center`}),a.edit.whole=!0,a.finish())}function iS(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=no(t,n,s,o)),(s!==r.top||o!==r.left)&&Da(e,t,n,s,o,``));i!==no(t,n,r.top,r.left)&&Da(e,t,n,r.top,r.left,i)}function aS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e),a=i.spec(r),o=(a.merges??[]).filter(e=>{let t=Kt(e);return!t||!Yt(t,n)});return o.length===0?delete a.merges:a.merges=o,i.edit.whole=!0,i.finish()}function oS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e),a=i.spec(r);return n&&(n.row>0||n.col>0)?a.freeze=Ut(n):delete a.freeze,i.edit.whole=!0,i.finish()}function sS(e,t,n,r,i,a){let o=e.workbook.sheet(t);if(!o)return I(`no-sheet`);let s=new ma(e),c=s.spec(o),l=(e,t)=>{let n=Xx(e[t]??{},`hidden`);return a?{...e,[t]:{...n,hidden:!0}}:Object.keys(n).length===0?Xx(e,t):{...e,[t]:n}};if(n===`columns`){let e={...c.columns},t=a?Array.from({length:i-r+1},(e,t)=>Vt(r+t)):Object.keys(e).filter(e=>{let t=Ht(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 Ua(c),s.edit.whole=!0,s.finish()}function cS(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 I(`no-sheet`);if(n&&i.length<=1)return I(`last-sheet`);let s=Xx(o,`hidden`),c=n?{...s,hidden:!0}:s;return{...ua(),file:{...e.file,sheets:r.map((e,t)=>t===a?c:e)},whole:!0}}function lS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e),a=i.spec(r);return n===void 0?delete a.tab:a.tab=n,i.finish()}function uS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(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?is(r,a):n;if(!c)return I(`no-data`);let l=r.used;return s.filter={range:Wt({...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 dS(e,t,n,r,i){let a=e.workbook.sheet(t);if(!a)return I(`no-sheet`);let o=new ma(e),{table:s}=n;if(s){let e=o.table(a,s),t=s.columns[r-s.at.col]?.name??``,n=Xx(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 I(`no-sheet`);let t=Vt(r),n=Xx(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 fS(e,t){let n=e.workbook.sheet(t);if(!n)return I(`no-sheet`);let r=new ma(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 pS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e),a=i.spec(r);return a.conditional=[n,...a.conditional??[]],i.edit.whole=!0,i.finish()}function mS(e,t){if(!Yt(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 hS(e,t){let n=qt(e);if(!n)return e;let r=n.flatMap(e=>mS(e,t));return r.length===0?void 0:r.map(Wt).join(` `)}function gS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e),a=i.spec(r),o=n?(a.conditional??[]).flatMap(e=>{let t=hS(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 _S(e,t,n,r){let i=e.workbook.sheet(t);if(!i)return I(`no-sheet`);let a=new ma(e),o=a.spec(i),s=(o.validations??[]).flatMap(e=>{let t=hS(e.range,n);return t===void 0?[]:[{...e,range:t}]}),c=r?[...s,{...r,range:Wt(n)}]:s;return c.length===0?delete o.validations:o.validations=c,a.edit.whole=!0,a.finish()}function vS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(e),a=i.spec(r);return a.charts=[...a.charts??[],n],i.finish()}function yS(e,t,n,r){let i=e.workbook.sheet(t),a=i?.spec.charts?.[n];if(!i||!a)return I(`no-sheet`);let o=new ma(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 bS(e,t,n){let r=e.workbook.sheet(t);if(!r)return I(`no-sheet`);let i=new ma(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 xS(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 SS=[[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],[`周一`,`周二`,`周三`,`周四`,`周五`,`周六`,`周日`],[`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`,`星期日`]],CS=[[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`]],wS=[...SS,...CS];function TS(e){let t=e.trim().toLowerCase();for(let e of wS){let n=e.findIndex(e=>e.toLowerCase()===t);if(n>=0)return{list:e,at:n}}}function ES(e,t){return t===t.toUpperCase()&&t!==t.toLowerCase()?e.toUpperCase():t===t.toLowerCase()&&t!==t.toUpperCase()?e.toLowerCase():e}var DS=/^\d{4}-\d{2}-\d{2}/u;function OS(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 kS(e,t,n){let r=e.map(e=>gn(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(hn(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 OS(e,t,n)}var AS=(e,t)=>t.length>10?vn(e):vn(Math.round(e)),jS=(e,t,n)=>`${e}${String(Math.max(n,0)).padStart(t.length,`0`)}`,MS=/^(.*?)(\d+)$/su;function NS(e,t,n){let r=e.map(e=>MS.exec(e)),[i]=r;if(!i||r.some(e=>!e||e[1]!==i[1]))return;let a=i[1]??``,o=i[2]??``,s=OS(r.map(e=>Number(e?.[2])),t,n),c=/^q$/iu.test(a);return s.map(e=>jS(a,o,c?(Math.round(e)+399)%4+1:Math.round(e)))}function PS(e,t,n){let r=e.map(TS),[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(ES(r,c))}return l}var FS=(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 IS(e,t,n={}){let r=n.mode??`auto`,i=n.back===!0;if(r===`copy`||e.length===0)return FS(e,t,i);let a=e.map(e=>En(e).value),o=e.length===1,s=a.flatMap(e=>typeof e==`number`?[e]:[]);if(s.length===a.length){if(e.every(e=>DS.test(e)))return kS(s,t,i).map(t=>AS(t,e[0]??``));if(o&&r===`auto`)return FS(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):OS(n,t,i)).map(String)}return a.every(e=>typeof e==`string`)?PS(e,t,i)??NS(e,t,i)??FS(e,t,i):FS(e,t,i)}var LS=e=>En(e).formula!==void 0;function RS(e,t,n){let r=ar(e);return r.ok?Un(r.node,t,n):void 0}var zS=(e,t)=>!e.tables.some(e=>Yt(e.area,t))&&!e.blocks.some(e=>Yt(e.area,t));function BS(e,t,n,r){if(e.some(e=>LS(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?_a(o,t.row-a.row,t.col-a.col):o}})}let i=IS(e.map(e=>e.text),t.length,{mode:r,back:n});return t.map((e,t)=>({...e,text:i[t]??``}))}var VS=[`bold`,`italic`,`underline`,`strike`,`font`,`size`,`color`,`fill`,`align`,`valign`,`wrap`,`shrink`,`indent`,`rotation`,`border`,`format`],HS=Object.fromEntries(VS.map(e=>[e,void 0]));function US(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 VS)i[e]=t[e];for(let t of xS(r))Va(e,n,t,i)}}function WS(e,t,n,r,i=`auto`){let a=e.workbook.sheet(t);if(!a)return I(`no-sheet`);let o=r.bottom>n.bottom||r.top<n.top,s=r.top<n.top||r.left<n.left,c=new ma(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=no(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);LS(n)&&p.add(RS(n,e,t)??``)}if(p.size===1&&f>0&&zS(a,r)&&GS(d,n)){let e=c.spec(a);return Ma(e,r),e.cells={...e.cells,[Wt(r)]:_a(d(n.top,n.left),r.top-n.top,r.left-n.left)},c.edit.whole=!0,KS(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 BS(l,u,s,i))Da(c,e,a,t.row,t.col,t.text)}return KS(c,a,n,r,o),c.finish()}function GS(e,t){for(let n=t.top;n<=t.bottom;n++)for(let r=t.left;r<=t.right;r++)if(!LS(e(n,r)))return!1;return!0}function KS(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(Jt(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}})}US(e,t,t,a)}function qS(e,t,n,r){let i=e.workbook.sheet(t),a=e.workbook.sheet(n);if(!i||!a)return I(`no-sheet`);let o=new ma(e);return US(o,i,a,r),o.finish()}function JS(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 YS(e,t,n){if(!LS(e))return e;let r=ar(e);return r.ok?mr(Ln(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 XS(e){let t=ua();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 ZS(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:Fr({file:n,rows:e=>r.get(e)})}}function QS(e,t,n,r,i){let a=e.workbook.sheet(t),o=e.workbook.sheet(r);if(!a||!o)return I(`no-sheet`);let s=i.row-n.top,c=i.col-n.left;if(s===0&&c===0&&a===o)return ua();let l={top:i.row,left:i.col,bottom:n.bottom+s,right:n.right+c},u=a.tables.filter(e=>Jt(n,e.area.top,e.area.left)&&Jt(n,e.area.bottom,e.area.right));for(let e of a.tables)if(!u.includes(e)&&Yt(e.area,n)&&n.top<=e.at.row)return I(`table-move`);if(u.length>0&&a!==o)return I(`table-move`);for(let e of o.tables)if(!u.includes(e)&&Yt(e.area,l)&&l.top<=e.at.row)return I(`table-move`);let d=ia(e,{op:`move-cells`,sheet:t,area:n,rows:s,columns:c,...a===o?{}:{to:r}}),f={...ua(),file:d.file,rows:new Map(d.rows)},p=ZS(e,f),m=p.workbook.sheet(t),h=p.workbook.sheet(r);if(!m||!h)return I(`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=>Jt(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=no(p,m,e,i);g.push({row:e+s,col:i+c,text:a===o?n:YS(n,t,r)})}_.push({from:{row:e,col:i},to:{row:e+s,col:i+c}})}let x=ja(p,t,n);if(x.refused!==void 0)return x;let S=ZS(p,x),ee=[f,x],C=S;if(u.length>0){let e=new ma(S),n=S.workbook.sheet(t);if(!n)return I(`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=Ut({row:t.at.row+s,col:t.at.col+c})}let r=e.finish();ee.push(r),C=ZS(S,r)}let te=Oa(C,r,g);if(te.refused!==void 0)return te;ee.push(te);let w=ZS(C,te),ne=w.workbook.sheet(t),T=w.workbook.sheet(r);if(ne&&T){let e=new ma(w);US(e,m,T,_);let t=_.map(e=>e.from).filter(e=>!(a===o&&Jt(l,e.row,e.col))&&Object.keys(m.lookAt(e.row,e.col)).length>0);for(let n of xS(t))Va(e,ne,n,HS);ee.push(e.finish())}return XS(ee)}var $S=class{file;rows;workbook;calc;revision=0;generated;scenario;values={value:(e,t,n)=>this.calc.value(e,t,n),filtered:e=>this.calc.filtered(e)};pending=0;seed;channel;generation=0;stop;computed;constructor(e,t,n=``,r,i={}){this.file=e,this.rows=t,this.seed=n,this.generated=r,this.channel=i.channel,this.computed=i.computed??(()=>void 0),this.stop=this.channel?.onReply(e=>{this.receive(e)}),this.read()}read(){let e={file:this.file,rows:[...this.rows],seed:this.seed,...this.generated?{generated:this.generated}:{},...this.scenario===void 0?{}:{scenario:this.scenario}},t=_x(e,this.channel?{replica:!0}:{});this.workbook=t.workbook,this.calc=t.calc,this.revision+=1,this.channel&&(this.generation+=1,this.pending=1,this.channel.send({kind:`open`,generation:this.generation,...e}))}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);if(e.whole){this.read();return}let t=hx(e);gx(this.workbook,this.calc,t,e.file),this.revision+=1,this.channel&&(this.pending+=1,this.channel.send({kind:`cells`,generation:this.generation,cells:t,...e.file?{file:e.file}:{}}))}receive(e){e.generation===this.generation&&(this.pending=Math.max(0,this.pending-1),this.calc.receive(e.computed),this.revision+=1,this.computed())}close(){this.stop?.(),this.channel?.close()}};function eC(){let e=new Set,t=t=>{for(let n of e)n(t)},n=[],r,i=new Worker(new URL(new URL(`calc-worker-Bz9r26p1.js`,import.meta.url).href,``+import.meta.url),{type:`module`});return i.addEventListener(`message`,e=>{t(e.data)}),i.addEventListener(`error`,e=>{if(e.preventDefault(),!r){i.terminate(),r=tC(),r.onReply(t);for(let e of n)r.send(e)}}),{send:e=>{e.kind===`open`&&(n=[]),n.push(e),r?r.send(e):i.postMessage(e)},onReply:t=>(e.add(t),()=>e.delete(t)),close:()=>{i.terminate(),r?.close()}}}function tC(){let e=new vx,t=new Set,n=!1;return{send:r=>{let i=JSON.parse(JSON.stringify(r));setTimeout(()=>{if(n)return;let r=e.handle(i);if(!r)return;let a=JSON.parse(JSON.stringify(r));for(let e of t)e(a)},0)},onReply:e=>(t.add(e),()=>t.delete(e)),close:()=>{n=!0}}}function nC(){return typeof Worker==`function`?eC():tC()}var rC=`\0`,iC=e=>e.join(rC),aC=(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},oC=(e,t)=>e===t||e.length===t.length&&e.every((e,n)=>aC(e,t[n]));function sC(e,t,n,r,i){if(aC(t,n)||e&&aC(e,t))return n;if(e&&aC(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 cC(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 lC(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(sC(a,n,i,o,r)):a&&!aC(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 uC(e,t){let n=h(e.map(iC),t.map(iC)),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 dC(e,t,n,r){let i=uC(e,t),a=uC(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);oC(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?sC(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 fC(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 pC(e,t,n,r){if(oC(e,t))return{rows:n,conflicts:[]};if(oC(e,n))return{rows:t,conflicts:[]};let i=[],a=e[0]??[],o=t[0]??[],s=n[0]??[],c=e,l=t;if(!aC(a,s)&&aC(a,o))c=fC(e,a,s),l=fC(t,o,s);else if(!aC(o,s)&&!aC(a,o)){if(!aC(a,s))return{rows:n,conflicts:[{where:`header`}]};let i=fC(n,s,o);return pC(fC(e,a,o),t,i,r)}if(r!==void 0){let e=cC(c,r),t=cC(l,r),a=cC(n,r);if(e&&t&&a)return{rows:lC(e,t,a,n[0]??[],l,r,i),conflicts:i}}return{rows:dC(c,l,n,i),conflicts:i}}var mC=e=>typeof e==`object`&&!!e&&!Array.isArray(e),hC=(e,t)=>e===t||JSON.stringify(e)===JSON.stringify(t),gC=e=>{let t=mC(e)?e.name:void 0;return typeof t==`string`?t:void 0};function _C(e,t,n,r,i){let a=(e,t)=>e.find(e=>gC(e)===t),o=[];for(let s of n){let n=gC(s)??``,c=a(t,n),l=a(e,n);c===void 0?l!==void 0&&hC(l,s)||o.push(s):o.push(vC(l,c,s,`${r}/${n}`,i))}return t.forEach((r,i)=>{let s=gC(r)??``;if(a(n,s)!==void 0||a(e,s)!==void 0)return;let c=i>0?gC(t[i-1]):void 0,l=o.findIndex(e=>gC(e)===c);o.splice(l<0?o.length:l+1,0,r)}),o}function vC(e,t,n,r,i){if(t===n||e===n)return t;if(e===t||hC(t,n))return n;if(hC(e,n))return t;if(hC(e,t))return n;if(mC(t)&&mC(n)){let a=mC(e)?e:{},o={};for(let e of new Set([...Object.keys(n),...Object.keys(t)])){let s=vC(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=>gC(e)!==void 0)?_C(Array.isArray(e)?e:[],t,n,r,i):(i.push({where:r}),t)}function yC(e,t,n){let r=[];return{value:vC(e,t,n,``,r),conflicts:r}}var bC=1500;function xC(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 SC(e,t,n){let r=t=>n.every((n,r)=>aC(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 CC(e,t,n,r){let i=SC(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=>aC(t,e));i>=0&&n&&(a[i]=n)}),a}var wC=e=>e.records.map(e=>e.end===e.start?[]:e.fields),TC=[`error`,`saving`,`unsaved`,`saved`],EC=200,DC=class e{book;host;dir;entry;sessions=new Map;opening=new Map;parsed=new Map;problems;conflicts=[];done=[];undone=[];snapshot;listeners=new Set;stops=[];reading;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 it.open(t,`${n}/${Ne}`),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);r!==this.code&&(this.code=r,n.generated=e,n.read(),this.update())}async first(){let e=jn(this.entry.text);if(!e.file){this.problems=kC(e.problems),this.update();return}let t=new Map,n=kn(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,wC(r))}));let{generated:r,failed:i}=await this.askCode();this.code=r&&JSON.stringify(r),this.codeFailed=i,this.book=new $S(e.file,t,this.seed(),r,{channel:nC(),computed:()=>{this.update()}}),this.stops.push(this.host.on(`project/changed`,()=>{clearTimeout(this.asking),this.asking=setTimeout(()=>{this.followCode()},EC)})),this.update()}seed(){return[this.entry.text,...[...this.sessions.values()].map(e=>e.text)].join(`
|
|
28
|
+
`)}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=Zt(t);return this.parsed.set(e,r),r}async follow(e){let t=this.sessions.get(e);if(t)return t;let n=await it.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=qx(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?en(n):on(r,n);if(i===t.text)return;let a=Zt(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=jn(e);if(!n.file){this.problems=kC(n.problems),this.update();return}this.problems=void 0;let{book:r}=this;if(!r){this.first();return}let i=jn(t).file,a=i?yC(i,r.file,n.file):{value:n.file,conflicts:[]};a.conflicts.length>0&&(this.conflicts=a.conflicts),r.file=a.value,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,wC(this.parsedText(n,t.text)))}this.readSoon()}takeCsv(e,t,n){let{book:r}=this;if(!r)return;let i=wC(this.parsedText(e,t)),a=wC(Zt(n)),o=this.keyOf(e),s=pC(a,r.rows.get(e)??a,i,o);s.conflicts.length>0&&(this.conflicts=s.conflicts),r.rows.set(e,[...s.rows]),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:TC.find(t=>e.some(e=>e.state===t))??`saved`,problems:this.problems,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()}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=xC(t,n.rows.get(t)??[],i);e&&r.push(e)}let a=n.file,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<bC?(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}/${_e}`}).then(e=>new Set(e.files.map(e=>e.path)),()=>new Set);return this.edit(In(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)})()}replay(e,t){let{book:n}=this;if(!n)return;e&&(n.file=n.file===e.from?e.to:yC(e.from,e.to,n.file).value),e&&this.entry.edited();let r=new Set(OC(n.file));for(let e of t){let t=CC(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}}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.reading),clearTimeout(this.asking),this.closed=!0,this.book?.close(),await Promise.all([this.entry,...this.sessions.values()].map(e=>e.close()))}},OC=e=>e.sheets.flatMap(e=>[...(e.tables??[]).map(e=>e.rows),...(e.blocks??[]).map(e=>e.rows)]),kC=e=>e.map(e=>e.line===void 0?e.message:`${String(e.line)}: ${e.message}`),AC=c({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`,previous:`Previous`,next:`Next`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Fill Down`,fillRight:`Fill Right`,selectAll:`Select All`,today:`Today's Date`},find:{findSelect:`Find & Select`,findMenu:`Find…`,replaceMenu:`Replace…`,title:`Find and Replace`,find:`Find`,replace:`Replace`,findWhat:`Find what`,replaceWith:`Replace with`,within:`Within`,sheet:`Sheet`,workbook:`Workbook`,lookIn:`Look in`,formulas:`Formulas`,values:`Values`,matchCase:`Match case`,wholeCell:`Match entire cell contents`,findNext:`Find Next`,findAll:`Find All`,replaceOne:`Replace`,replaceAll:`Replace All`,close:`Close`,notFound:`We couldn't find what you were looking for.`,replaced:e=>e===1?`All done. We made 1 replacement.`:`All done. We made ${String(e)} replacements.`,found:e=>e===1?`1 cell found`:`${String(e)} cells found`},progress:{sorting:`Sorting…`,pasting:`Pasting…`,replacing:`Replacing…`},drop:{title:`Move or Copy Cells`,replace:`There's already data here. Do you want to replace it?`},a11y:{grid:e=>`Sheet ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} selected. ${t}`,editing:e=>`Editing ${e}`,blank:`blank`,cellRole:`cell`},pane:{title:`Format Chart`,close:`Close`,chartType:`Chart Type`,horizontal:`Horizontal (Category) Axis`,vertical:`Vertical (Value) Axis`,showAxis:`Show axis`,axisTitle:`Axis Title`,minimum:`Minimum`,maximum:`Maximum`,major:`Major`,auto:`Auto`,gridlines:`Major Gridlines`,reverseValues:`Values in reverse order`,reverseCategories:`Categories in reverse order`,numberFormat:`Number Format`,series:`Series`,seriesN:e=>`Series ${String(e)}`,seriesColor:e=>`Color of ${e}`},functions:{SUM:`Adds all the numbers in a range of cells.`,AVERAGE:`Returns the average (arithmetic mean) of its arguments.`,COUNT:`Counts the cells in a range that contain numbers.`,COUNTA:`Counts the cells in a range that are not empty.`,COUNTIF:`Counts the cells in a range that meet a condition.`,COUNTIFS:`Counts the cells that meet several conditions.`,SUMIF:`Adds the cells that meet a condition.`,SUMIFS:`Adds the cells that meet several conditions.`,MIN:`Returns the smallest number in a set of values.`,MAX:`Returns the largest number in a set of values.`,IF:`Returns one value if a condition is TRUE and another if it is FALSE.`,IFS:`Returns the value of the first condition that is TRUE.`,IFERROR:`Returns a value you give if a formula is an error.`,AND:`Returns TRUE if all of its arguments are TRUE.`,OR:`Returns TRUE if any of its arguments is TRUE.`,NOT:`Turns TRUE into FALSE and FALSE into TRUE.`,VLOOKUP:`Looks for a value in the first column of a table and returns a value in the same row.`,XLOOKUP:`Looks for a value in a range and returns what is beside it.`,INDEX:`Returns the value at a row and column of a range.`,MATCH:`Returns the position of a value in a range.`,ROUND:`Rounds a number to a number of digits.`,LEFT:`Returns the first characters of a text.`,RIGHT:`Returns the last characters of a text.`,MID:`Returns characters from the middle of a text.`,LEN:`Returns the number of characters in a text.`,TRIM:`Removes extra spaces from a text.`,CONCAT:`Joins several texts into one.`,TEXT:`Turns a value into text in a number format.`,TODAY:`Returns today's date.`,DATE:`Returns the date of a year, month and day.`,FILTER:`Filters a range by conditions you set.`,SORT:`Sorts the contents of a range.`,UNIQUE:`Returns the unique values of a range.`}},"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:`求和`,previous:`上一处`,next:`下一处`,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:`溢出区域不为空`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`向下填充`,fillRight:`向右填充`,selectAll:`全选`,today:`今天的日期`},find:{findSelect:`查找和选择`,findMenu:`查找…`,replaceMenu:`替换…`,title:`查找和替换`,find:`查找`,replace:`替换`,findWhat:`查找内容`,replaceWith:`替换为`,within:`范围`,sheet:`工作表`,workbook:`工作簿`,lookIn:`查找范围`,formulas:`公式`,values:`值`,matchCase:`区分大小写`,wholeCell:`单元格匹配`,findNext:`查找下一个`,findAll:`查找全部`,replaceOne:`替换`,replaceAll:`全部替换`,close:`关闭`,notFound:`找不到正在搜索的内容。`,replaced:e=>`全部完成。完成 ${String(e)} 处替换。`,found:e=>`找到 ${String(e)} 个单元格`},progress:{sorting:`正在排序…`,pasting:`正在粘贴…`,replacing:`正在替换…`},drop:{title:`移动或复制单元格`,replace:`此处已有数据。是否替换它?`},a11y:{grid:e=>`工作表 ${e}`,cell:(e,t,n)=>n===void 0?`${e},${t}`:`${n},${e},${t}`,range:(e,t)=>`已选择 ${e}。${t}`,editing:e=>`正在编辑 ${e}`,blank:`空白`,cellRole:`单元格`},pane:{title:`设置图表格式`,close:`关闭`,chartType:`图表类型`,horizontal:`水平(类别)轴`,vertical:`垂直(值)轴`,showAxis:`显示坐标轴`,axisTitle:`坐标轴标题`,minimum:`最小值`,maximum:`最大值`,major:`主要单位`,auto:`自动`,gridlines:`主要网格线`,reverseValues:`逆序刻度值`,reverseCategories:`逆序类别`,numberFormat:`数字格式`,series:`系列`,seriesN:e=>`系列 ${String(e)}`,seriesColor:e=>`${e} 的颜色`},functions:{SUM:`计算单元格区域中所有数值的和。`,AVERAGE:`返回其参数的平均值(算术平均值)。`,COUNT:`计算区域中包含数字的单元格个数。`,COUNTA:`计算区域中非空单元格的个数。`,COUNTIF:`计算区域中满足条件的单元格个数。`,COUNTIFS:`计算满足多个条件的单元格个数。`,SUMIF:`对满足条件的单元格求和。`,SUMIFS:`对满足多个条件的单元格求和。`,MIN:`返回一组值中的最小值。`,MAX:`返回一组值中的最大值。`,IF:`条件为 TRUE 时返回一个值,为 FALSE 时返回另一个值。`,IFS:`返回第一个为 TRUE 的条件所对应的值。`,IFERROR:`公式出错时返回指定的值。`,AND:`所有参数都为 TRUE 时返回 TRUE。`,OR:`任一参数为 TRUE 时返回 TRUE。`,NOT:`把 TRUE 变为 FALSE,把 FALSE 变为 TRUE。`,VLOOKUP:`在表格的首列查找值,并返回同一行中的值。`,XLOOKUP:`在区域中查找值,并返回其旁边的内容。`,INDEX:`返回区域中某行某列的值。`,MATCH:`返回值在区域中的位置。`,ROUND:`将数字四舍五入到指定位数。`,LEFT:`返回文本开头的字符。`,RIGHT:`返回文本末尾的字符。`,MID:`返回文本中间的字符。`,LEN:`返回文本中的字符个数。`,TRIM:`删除文本中多余的空格。`,CONCAT:`将多个文本合并为一个。`,TEXT:`按数字格式把值转换为文本。`,TODAY:`返回今天的日期。`,DATE:`返回某年某月某日的日期。`,FILTER:`按设定的条件筛选区域。`,SORT:`对区域的内容排序。`,UNIQUE:`返回区域中的唯一值。`}},"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:`加總`,previous:`上一處`,next:`下一處`,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:`溢位範圍不是空白的`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`向下填滿`,fillRight:`向右填滿`,selectAll:`全選`,today:`今天的日期`},find:{findSelect:`尋找與選取`,findMenu:`尋找…`,replaceMenu:`取代…`,title:`尋找及取代`,find:`尋找`,replace:`取代`,findWhat:`尋找目標`,replaceWith:`取代成`,within:`搜尋範圍`,sheet:`工作表`,workbook:`活頁簿`,lookIn:`搜尋`,formulas:`公式`,values:`值`,matchCase:`大小寫須相符`,wholeCell:`儲存格內容須完全相符`,findNext:`找下一個`,findAll:`全部尋找`,replaceOne:`取代`,replaceAll:`全部取代`,close:`關閉`,notFound:`找不到您要搜尋的資料。`,replaced:e=>`全部完成。已取代 ${String(e)} 筆。`,found:e=>`找到 ${String(e)} 個儲存格`},progress:{sorting:`正在排序…`,pasting:`正在貼上…`,replacing:`正在取代…`},drop:{title:`移動或複製儲存格`,replace:`這裡已經有資料。要取代嗎?`},a11y:{grid:e=>`工作表 ${e}`,cell:(e,t,n)=>n===void 0?`${e},${t}`:`${n},${e},${t}`,range:(e,t)=>`已選取 ${e}。${t}`,editing:e=>`正在編輯 ${e}`,blank:`空白`,cellRole:`儲存格`},pane:{title:`圖表格式`,close:`關閉`,chartType:`圖表類型`,horizontal:`水平 (類別) 座標軸`,vertical:`垂直 (數值) 座標軸`,showAxis:`顯示座標軸`,axisTitle:`座標軸標題`,minimum:`最小值`,maximum:`最大值`,major:`主要`,auto:`自動`,gridlines:`主要格線`,reverseValues:`數值次序反轉`,reverseCategories:`類別次序反轉`,numberFormat:`數值格式`,series:`數列`,seriesN:e=>`數列 ${String(e)}`,seriesColor:e=>`${e} 的色彩`},functions:{SUM:`加總儲存格範圍中的所有數字。`,AVERAGE:`傳回引數的平均值 (算術平均數)。`,COUNT:`計算範圍中含有數字的儲存格數目。`,COUNTA:`計算範圍中非空白儲存格的數目。`,COUNTIF:`計算範圍中符合條件的儲存格數目。`,COUNTIFS:`計算符合多個條件的儲存格數目。`,SUMIF:`加總符合條件的儲存格。`,SUMIFS:`加總符合多個條件的儲存格。`,MIN:`傳回一組值中的最小值。`,MAX:`傳回一組值中的最大值。`,IF:`條件為 TRUE 時傳回一個值,為 FALSE 時傳回另一個值。`,IFS:`傳回第一個為 TRUE 的條件所對應的值。`,IFERROR:`公式為錯誤時傳回您指定的值。`,AND:`所有引數皆為 TRUE 時傳回 TRUE。`,OR:`任一引數為 TRUE 時傳回 TRUE。`,NOT:`把 TRUE 變成 FALSE,把 FALSE 變成 TRUE。`,VLOOKUP:`在表格的第一欄尋找值,並傳回同一列中的值。`,XLOOKUP:`在範圍中尋找值,並傳回其旁邊的內容。`,INDEX:`傳回範圍中某列某欄的值。`,MATCH:`傳回值在範圍中的位置。`,ROUND:`將數字四捨五入至指定位數。`,LEFT:`傳回文字開頭的字元。`,RIGHT:`傳回文字結尾的字元。`,MID:`傳回文字中間的字元。`,LEN:`傳回文字中的字元數。`,TRIM:`移除文字中多餘的空格。`,CONCAT:`將多個文字合併成一個。`,TEXT:`依數值格式將值轉換為文字。`,TODAY:`傳回今天的日期。`,DATE:`傳回某年某月某日的日期。`,FILTER:`依您設定的條件篩選範圍。`,SORT:`排序範圍的內容。`,UNIQUE:`傳回範圍中的唯一值。`}},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:`合計`,previous:`前へ`,next:`次へ`,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:`スピル範囲が空白ではありません`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`下方向へコピー`,fillRight:`右方向へコピー`,selectAll:`すべて選択`,today:`今日の日付`},find:{findSelect:`検索と選択`,findMenu:`検索…`,replaceMenu:`置換…`,title:`検索と置換`,find:`検索`,replace:`置換`,findWhat:`検索する文字列`,replaceWith:`置換後の文字列`,within:`検索場所`,sheet:`シート`,workbook:`ブック`,lookIn:`検索対象`,formulas:`数式`,values:`値`,matchCase:`大文字と小文字を区別する`,wholeCell:`セル内容が完全に同一であるものを検索する`,findNext:`次を検索`,findAll:`すべて検索`,replaceOne:`置換`,replaceAll:`すべて置換`,close:`閉じる`,notFound:`検索対象が見つかりません。`,replaced:e=>`完了しました。${String(e)} 件を置換しました。`,found:e=>`${String(e)} 個のセルが見つかりました`},progress:{sorting:`並べ替えています…`,pasting:`貼り付けています…`,replacing:`置換しています…`},drop:{title:`セルの移動またはコピー`,replace:`ここには既にデータがあります。置き換えますか?`},a11y:{grid:e=>`シート ${e}`,cell:(e,t,n)=>n===void 0?`${e}、${t}`:`${n}、${e}、${t}`,range:(e,t)=>`${e} を選択。${t}`,editing:e=>`${e} を編集中`,blank:`空白`,cellRole:`セル`},pane:{title:`グラフの書式設定`,close:`閉じる`,chartType:`グラフの種類`,horizontal:`横 (項目) 軸`,vertical:`縦 (値) 軸`,showAxis:`軸を表示`,axisTitle:`軸ラベル`,minimum:`最小値`,maximum:`最大値`,major:`主`,auto:`自動`,gridlines:`主軸目盛線`,reverseValues:`軸を反転する`,reverseCategories:`軸を反転する (項目)`,numberFormat:`表示形式`,series:`系列`,seriesN:e=>`系列 ${String(e)}`,seriesColor:e=>`${e} の色`},functions:{SUM:`セル範囲に含まれる数値をすべて合計します。`,AVERAGE:`引数の平均値 (算術平均) を返します。`,COUNT:`範囲内の数値を含むセルの個数を数えます。`,COUNTA:`範囲内の空白でないセルの個数を数えます。`,COUNTIF:`範囲内で条件に一致するセルの個数を数えます。`,COUNTIFS:`複数の条件に一致するセルの個数を数えます。`,SUMIF:`条件に一致するセルを合計します。`,SUMIFS:`複数の条件に一致するセルを合計します。`,MIN:`値の中の最小値を返します。`,MAX:`値の中の最大値を返します。`,IF:`条件が TRUE のときと FALSE のときで別の値を返します。`,IFS:`最初に TRUE となる条件に対応する値を返します。`,IFERROR:`数式がエラーのとき、指定した値を返します。`,AND:`すべての引数が TRUE のとき TRUE を返します。`,OR:`いずれかの引数が TRUE のとき TRUE を返します。`,NOT:`TRUE を FALSE に、FALSE を TRUE にします。`,VLOOKUP:`表の左端の列で値を探し、同じ行の値を返します。`,XLOOKUP:`範囲内で値を探し、その隣の内容を返します。`,INDEX:`範囲内の指定した行と列の値を返します。`,MATCH:`範囲内での値の位置を返します。`,ROUND:`数値を指定した桁数に四捨五入します。`,LEFT:`文字列の先頭の文字を返します。`,RIGHT:`文字列の末尾の文字を返します。`,MID:`文字列の途中の文字を返します。`,LEN:`文字列の文字数を返します。`,TRIM:`文字列の余分なスペースを削除します。`,CONCAT:`複数の文字列を 1 つに結合します。`,TEXT:`値を表示形式に従って文字列に変換します。`,TODAY:`今日の日付を返します。`,DATE:`年、月、日から日付を返します。`,FILTER:`条件に従って範囲をフィルターします。`,SORT:`範囲の内容を並べ替えます。`,UNIQUE:`範囲内の一意の値を返します。`}},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:`합계`,previous:`이전`,next:`다음`,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:`분산 범위가 비어 있지 않습니다`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`아래로 채우기`,fillRight:`오른쪽으로 채우기`,selectAll:`모두 선택`,today:`오늘 날짜`},find:{findSelect:`찾기 및 선택`,findMenu:`찾기…`,replaceMenu:`바꾸기…`,title:`찾기 및 바꾸기`,find:`찾기`,replace:`바꾸기`,findWhat:`찾을 내용`,replaceWith:`바꿀 내용`,within:`범위`,sheet:`시트`,workbook:`통합 문서`,lookIn:`찾는 위치`,formulas:`수식`,values:`값`,matchCase:`대/소문자 구분`,wholeCell:`전체 셀 내용 일치`,findNext:`다음 찾기`,findAll:`모두 찾기`,replaceOne:`바꾸기`,replaceAll:`모두 바꾸기`,close:`닫기`,notFound:`찾는 내용을 찾을 수 없습니다.`,replaced:e=>`모두 완료되었습니다. ${String(e)}개 항목을 바꾸었습니다.`,found:e=>`셀 ${String(e)}개를 찾았습니다`},progress:{sorting:`정렬하는 중…`,pasting:`붙여넣는 중…`,replacing:`바꾸는 중…`},drop:{title:`셀 이동 또는 복사`,replace:`이미 여기에 데이터가 있습니다. 바꾸시겠습니까?`},a11y:{grid:e=>`시트 ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} 선택됨. ${t}`,editing:e=>`${e} 편집 중`,blank:`빈 셀`,cellRole:`셀`},pane:{title:`차트 서식`,close:`닫기`,chartType:`차트 종류`,horizontal:`가로 (항목) 축`,vertical:`세로 (값) 축`,showAxis:`축 표시`,axisTitle:`축 제목`,minimum:`최소값`,maximum:`최대값`,major:`주 단위`,auto:`자동`,gridlines:`주 눈금선`,reverseValues:`값을 거꾸로`,reverseCategories:`항목을 거꾸로`,numberFormat:`표시 형식`,series:`계열`,seriesN:e=>`계열 ${String(e)}`,seriesColor:e=>`${e} 색`},functions:{SUM:`셀 범위에 있는 모든 숫자를 더합니다.`,AVERAGE:`인수의 평균(산술 평균)을 반환합니다.`,COUNT:`범위에서 숫자가 들어 있는 셀의 개수를 셉니다.`,COUNTA:`범위에서 비어 있지 않은 셀의 개수를 셉니다.`,COUNTIF:`범위에서 조건에 맞는 셀의 개수를 셉니다.`,COUNTIFS:`여러 조건에 맞는 셀의 개수를 셉니다.`,SUMIF:`조건에 맞는 셀을 더합니다.`,SUMIFS:`여러 조건에 맞는 셀을 더합니다.`,MIN:`값 집합에서 가장 작은 수를 반환합니다.`,MAX:`값 집합에서 가장 큰 수를 반환합니다.`,IF:`조건이 TRUE이면 한 값을, FALSE이면 다른 값을 반환합니다.`,IFS:`처음으로 TRUE인 조건의 값을 반환합니다.`,IFERROR:`수식이 오류이면 지정한 값을 반환합니다.`,AND:`모든 인수가 TRUE이면 TRUE를 반환합니다.`,OR:`인수 중 하나라도 TRUE이면 TRUE를 반환합니다.`,NOT:`TRUE를 FALSE로, FALSE를 TRUE로 바꿉니다.`,VLOOKUP:`표의 첫 열에서 값을 찾아 같은 행의 값을 반환합니다.`,XLOOKUP:`범위에서 값을 찾아 그 옆의 내용을 반환합니다.`,INDEX:`범위에서 지정한 행과 열의 값을 반환합니다.`,MATCH:`범위에서 값의 위치를 반환합니다.`,ROUND:`숫자를 지정한 자릿수로 반올림합니다.`,LEFT:`텍스트의 처음 문자를 반환합니다.`,RIGHT:`텍스트의 마지막 문자를 반환합니다.`,MID:`텍스트 중간의 문자를 반환합니다.`,LEN:`텍스트의 문자 수를 반환합니다.`,TRIM:`텍스트에서 불필요한 공백을 없앱니다.`,CONCAT:`여러 텍스트를 하나로 합칩니다.`,TEXT:`값을 표시 형식에 따라 텍스트로 바꿉니다.`,TODAY:`오늘 날짜를 반환합니다.`,DATE:`연, 월, 일로 날짜를 반환합니다.`,FILTER:`설정한 조건으로 범위를 필터링합니다.`,SORT:`범위의 내용을 정렬합니다.`,UNIQUE:`범위의 고유 값을 반환합니다.`}},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`,previous:`Anterior`,next:`Siguiente`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Rellenar hacia abajo`,fillRight:`Rellenar hacia la derecha`,selectAll:`Seleccionar todo`,today:`Fecha de hoy`},find:{findSelect:`Buscar y seleccionar`,findMenu:`Buscar…`,replaceMenu:`Reemplazar…`,title:`Buscar y reemplazar`,find:`Buscar`,replace:`Reemplazar`,findWhat:`Buscar`,replaceWith:`Reemplazar con`,within:`Dentro de`,sheet:`Hoja`,workbook:`Libro`,lookIn:`Buscar dentro de`,formulas:`Fórmulas`,values:`Valores`,matchCase:`Coincidir mayúsculas y minúsculas`,wholeCell:`Coincidir con el contenido de toda la celda`,findNext:`Buscar siguiente`,findAll:`Buscar todos`,replaceOne:`Reemplazar`,replaceAll:`Reemplazar todos`,close:`Cerrar`,notFound:`No encontramos lo que buscaba.`,replaced:e=>e===1?`Listo. Hicimos 1 reemplazo.`:`Listo. Hicimos ${String(e)} reemplazos.`,found:e=>e===1?`1 celda encontrada`:`${String(e)} celdas encontradas`},progress:{sorting:`Ordenando…`,pasting:`Pegando…`,replacing:`Reemplazando…`},drop:{title:`Mover o copiar celdas`,replace:`Ya hay datos aquí. ¿Quiere reemplazarlos?`},a11y:{grid:e=>`Hoja ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} seleccionado. ${t}`,editing:e=>`Editando ${e}`,blank:`vacía`,cellRole:`celda`},pane:{title:`Formato del gráfico`,close:`Cerrar`,chartType:`Tipo de gráfico`,horizontal:`Eje horizontal (categorías)`,vertical:`Eje vertical (valores)`,showAxis:`Mostrar eje`,axisTitle:`Título del eje`,minimum:`Mínimo`,maximum:`Máximo`,major:`Mayor`,auto:`Automático`,gridlines:`Líneas de división principales`,reverseValues:`Valores en orden inverso`,reverseCategories:`Categorías en orden inverso`,numberFormat:`Formato de número`,series:`Series`,seriesN:e=>`Serie ${String(e)}`,seriesColor:e=>`Color de ${e}`},functions:{SUM:`Suma todos los números de un rango de celdas.`,AVERAGE:`Devuelve el promedio (media aritmética) de los argumentos.`,COUNT:`Cuenta las celdas de un rango que contienen números.`,COUNTA:`Cuenta las celdas de un rango que no están vacías.`,COUNTIF:`Cuenta las celdas de un rango que cumplen una condición.`,COUNTIFS:`Cuenta las celdas que cumplen varias condiciones.`,SUMIF:`Suma las celdas que cumplen una condición.`,SUMIFS:`Suma las celdas que cumplen varias condiciones.`,MIN:`Devuelve el número más pequeño de un conjunto de valores.`,MAX:`Devuelve el número más grande de un conjunto de valores.`,IF:`Devuelve un valor si una condición es VERDADERO y otro si es FALSO.`,IFS:`Devuelve el valor de la primera condición que es VERDADERO.`,IFERROR:`Devuelve el valor que indique si una fórmula da error.`,AND:`Devuelve VERDADERO si todos los argumentos son VERDADERO.`,OR:`Devuelve VERDADERO si algún argumento es VERDADERO.`,NOT:`Convierte VERDADERO en FALSO y FALSO en VERDADERO.`,VLOOKUP:`Busca un valor en la primera columna de una tabla y devuelve un valor de la misma fila.`,XLOOKUP:`Busca un valor en un rango y devuelve lo que tiene al lado.`,INDEX:`Devuelve el valor de una fila y una columna de un rango.`,MATCH:`Devuelve la posición de un valor en un rango.`,ROUND:`Redondea un número a un número de decimales.`,LEFT:`Devuelve los primeros caracteres de un texto.`,RIGHT:`Devuelve los últimos caracteres de un texto.`,MID:`Devuelve caracteres del centro de un texto.`,LEN:`Devuelve el número de caracteres de un texto.`,TRIM:`Quita los espacios de más de un texto.`,CONCAT:`Une varios textos en uno.`,TEXT:`Convierte un valor en texto con un formato de número.`,TODAY:`Devuelve la fecha de hoy.`,DATE:`Devuelve la fecha de un año, un mes y un día.`,FILTER:`Filtra un rango según las condiciones que indique.`,SORT:`Ordena el contenido de un rango.`,UNIQUE:`Devuelve los valores únicos de un rango.`}},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`,previous:`Précédent`,next:`Suivant`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Recopier vers le bas`,fillRight:`Recopier à droite`,selectAll:`Tout sélectionner`,today:`Date du jour`},find:{findSelect:`Rechercher et sélectionner`,findMenu:`Rechercher…`,replaceMenu:`Remplacer…`,title:`Rechercher et remplacer`,find:`Rechercher`,replace:`Remplacer`,findWhat:`Rechercher`,replaceWith:`Remplacer par`,within:`Dans`,sheet:`Feuille`,workbook:`Classeur`,lookIn:`Regarder dans`,formulas:`Formules`,values:`Valeurs`,matchCase:`Respecter la casse`,wholeCell:`Totalité du contenu de la cellule`,findNext:`Suivant`,findAll:`Rechercher tout`,replaceOne:`Remplacer`,replaceAll:`Remplacer tout`,close:`Fermer`,notFound:`Nous n’avons pas trouvé ce que vous cherchiez.`,replaced:e=>e===1?`Terminé. Nous avons effectué 1 remplacement.`:`Terminé. Nous avons effectué ${String(e)} remplacements.`,found:e=>e===1?`1 cellule trouvée`:`${String(e)} cellules trouvées`},progress:{sorting:`Tri en cours…`,pasting:`Collage en cours…`,replacing:`Remplacement en cours…`},drop:{title:`Déplacer ou copier des cellules`,replace:`Il y a déjà des données à cet endroit. Voulez-vous les remplacer ?`},a11y:{grid:e=>`Feuille ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} sélectionné. ${t}`,editing:e=>`Modification de ${e}`,blank:`vide`,cellRole:`cellule`},pane:{title:`Mise en forme du graphique`,close:`Fermer`,chartType:`Type de graphique`,horizontal:`Axe horizontal (abscisses)`,vertical:`Axe vertical (valeurs)`,showAxis:`Afficher l’axe`,axisTitle:`Titre de l’axe`,minimum:`Minimum`,maximum:`Maximum`,major:`Principale`,auto:`Automatique`,gridlines:`Quadrillage principal`,reverseValues:`Valeurs en ordre inverse`,reverseCategories:`Abscisses en ordre inverse`,numberFormat:`Format de nombre`,series:`Séries`,seriesN:e=>`Série ${String(e)}`,seriesColor:e=>`Couleur de ${e}`},functions:{SUM:`Additionne tous les nombres d’une plage de cellules.`,AVERAGE:`Renvoie la moyenne (arithmétique) de ses arguments.`,COUNT:`Compte les cellules d’une plage qui contiennent des nombres.`,COUNTA:`Compte les cellules d’une plage qui ne sont pas vides.`,COUNTIF:`Compte les cellules d’une plage qui remplissent une condition.`,COUNTIFS:`Compte les cellules qui remplissent plusieurs conditions.`,SUMIF:`Additionne les cellules qui remplissent une condition.`,SUMIFS:`Additionne les cellules qui remplissent plusieurs conditions.`,MIN:`Renvoie le plus petit nombre d’un ensemble de valeurs.`,MAX:`Renvoie le plus grand nombre d’un ensemble de valeurs.`,IF:`Renvoie une valeur si une condition est VRAI et une autre si elle est FAUX.`,IFS:`Renvoie la valeur de la première condition qui est VRAI.`,IFERROR:`Renvoie la valeur que vous donnez si une formule est une erreur.`,AND:`Renvoie VRAI si tous ses arguments sont VRAI.`,OR:`Renvoie VRAI si l’un de ses arguments est VRAI.`,NOT:`Change VRAI en FAUX et FAUX en VRAI.`,VLOOKUP:`Cherche une valeur dans la première colonne d’un tableau et renvoie une valeur de la même ligne.`,XLOOKUP:`Cherche une valeur dans une plage et renvoie ce qui est à côté.`,INDEX:`Renvoie la valeur à une ligne et une colonne d’une plage.`,MATCH:`Renvoie la position d’une valeur dans une plage.`,ROUND:`Arrondit un nombre à un nombre de chiffres.`,LEFT:`Renvoie les premiers caractères d’un texte.`,RIGHT:`Renvoie les derniers caractères d’un texte.`,MID:`Renvoie des caractères du milieu d’un texte.`,LEN:`Renvoie le nombre de caractères d’un texte.`,TRIM:`Supprime les espaces en trop d’un texte.`,CONCAT:`Assemble plusieurs textes en un seul.`,TEXT:`Convertit une valeur en texte selon un format de nombre.`,TODAY:`Renvoie la date du jour.`,DATE:`Renvoie la date d’une année, d’un mois et d’un jour.`,FILTER:`Filtre une plage selon les conditions que vous fixez.`,SORT:`Trie le contenu d’une plage.`,UNIQUE:`Renvoie les valeurs uniques d’une plage.`}},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`,previous:`Zurück`,next:`Weiter`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Unten ausfüllen`,fillRight:`Rechts ausfüllen`,selectAll:`Alles auswählen`,today:`Heutiges Datum`},find:{findSelect:`Suchen und Auswählen`,findMenu:`Suchen…`,replaceMenu:`Ersetzen…`,title:`Suchen und Ersetzen`,find:`Suchen`,replace:`Ersetzen`,findWhat:`Suchen nach`,replaceWith:`Ersetzen durch`,within:`Durchsuchen`,sheet:`Blatt`,workbook:`Arbeitsmappe`,lookIn:`Suchen in`,formulas:`Formeln`,values:`Werte`,matchCase:`Groß-/Kleinschreibung beachten`,wholeCell:`Gesamten Zellinhalt vergleichen`,findNext:`Weitersuchen`,findAll:`Alle suchen`,replaceOne:`Ersetzen`,replaceAll:`Alle ersetzen`,close:`Schließen`,notFound:`Der gesuchte Inhalt wurde nicht gefunden.`,replaced:e=>e===1?`Fertig. Es wurde 1 Ersetzung vorgenommen.`:`Fertig. Es wurden ${String(e)} Ersetzungen vorgenommen.`,found:e=>e===1?`1 Zelle gefunden`:`${String(e)} Zellen gefunden`},progress:{sorting:`Wird sortiert…`,pasting:`Wird eingefügt…`,replacing:`Wird ersetzt…`},drop:{title:`Zellen verschieben oder kopieren`,replace:`Hier sind bereits Daten vorhanden. Möchten Sie sie ersetzen?`},a11y:{grid:e=>`Blatt ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} ausgewählt. ${t}`,editing:e=>`${e} wird bearbeitet`,blank:`leer`,cellRole:`Zelle`},pane:{title:`Diagramm formatieren`,close:`Schließen`,chartType:`Diagrammtyp`,horizontal:`Horizontale Achse (Rubriken)`,vertical:`Vertikale Achse (Werte)`,showAxis:`Achse anzeigen`,axisTitle:`Achsentitel`,minimum:`Minimum`,maximum:`Maximum`,major:`Hauptintervall`,auto:`Automatisch`,gridlines:`Hauptgitternetzlinien`,reverseValues:`Werte in umgekehrter Reihenfolge`,reverseCategories:`Rubriken in umgekehrter Reihenfolge`,numberFormat:`Zahlenformat`,series:`Datenreihen`,seriesN:e=>`Datenreihe ${String(e)}`,seriesColor:e=>`Farbe von ${e}`},functions:{SUM:`Addiert alle Zahlen eines Zellbereichs.`,AVERAGE:`Gibt den Mittelwert (arithmetisches Mittel) der Argumente zurück.`,COUNT:`Zählt die Zellen eines Bereichs, die Zahlen enthalten.`,COUNTA:`Zählt die Zellen eines Bereichs, die nicht leer sind.`,COUNTIF:`Zählt die Zellen eines Bereichs, die eine Bedingung erfüllen.`,COUNTIFS:`Zählt die Zellen, die mehrere Bedingungen erfüllen.`,SUMIF:`Addiert die Zellen, die eine Bedingung erfüllen.`,SUMIFS:`Addiert die Zellen, die mehrere Bedingungen erfüllen.`,MIN:`Gibt die kleinste Zahl einer Wertemenge zurück.`,MAX:`Gibt die größte Zahl einer Wertemenge zurück.`,IF:`Gibt einen Wert zurück, wenn eine Bedingung WAHR ist, und einen anderen, wenn sie FALSCH ist.`,IFS:`Gibt den Wert der ersten Bedingung zurück, die WAHR ist.`,IFERROR:`Gibt einen angegebenen Wert zurück, wenn eine Formel einen Fehler ergibt.`,AND:`Gibt WAHR zurück, wenn alle Argumente WAHR sind.`,OR:`Gibt WAHR zurück, wenn ein Argument WAHR ist.`,NOT:`Macht WAHR zu FALSCH und FALSCH zu WAHR.`,VLOOKUP:`Sucht einen Wert in der ersten Spalte einer Tabelle und gibt einen Wert derselben Zeile zurück.`,XLOOKUP:`Sucht einen Wert in einem Bereich und gibt zurück, was daneben steht.`,INDEX:`Gibt den Wert in einer Zeile und Spalte eines Bereichs zurück.`,MATCH:`Gibt die Position eines Werts in einem Bereich zurück.`,ROUND:`Rundet eine Zahl auf eine Anzahl Stellen.`,LEFT:`Gibt die ersten Zeichen eines Texts zurück.`,RIGHT:`Gibt die letzten Zeichen eines Texts zurück.`,MID:`Gibt Zeichen aus der Mitte eines Texts zurück.`,LEN:`Gibt die Anzahl der Zeichen eines Texts zurück.`,TRIM:`Entfernt überzählige Leerzeichen aus einem Text.`,CONCAT:`Verbindet mehrere Texte zu einem.`,TEXT:`Wandelt einen Wert in einem Zahlenformat in Text um.`,TODAY:`Gibt das heutige Datum zurück.`,DATE:`Gibt das Datum zu Jahr, Monat und Tag zurück.`,FILTER:`Filtert einen Bereich nach festgelegten Bedingungen.`,SORT:`Sortiert den Inhalt eines Bereichs.`,UNIQUE:`Gibt die eindeutigen Werte eines Bereichs zurück.`}},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`,previous:`Precedente`,next:`Successivo`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Riempi in basso`,fillRight:`Riempi a destra`,selectAll:`Seleziona tutto`,today:`Data di oggi`},find:{findSelect:`Trova e seleziona`,findMenu:`Trova…`,replaceMenu:`Sostituisci…`,title:`Trova e sostituisci`,find:`Trova`,replace:`Sostituisci`,findWhat:`Trova`,replaceWith:`Sostituisci con`,within:`In`,sheet:`Foglio`,workbook:`Cartella di lavoro`,lookIn:`Cerca in`,formulas:`Formule`,values:`Valori`,matchCase:`Maiuscole/minuscole`,wholeCell:`Confronta intero contenuto della cella`,findNext:`Trova successivo`,findAll:`Trova tutti`,replaceOne:`Sostituisci`,replaceAll:`Sostituisci tutto`,close:`Chiudi`,notFound:`Impossibile trovare il contenuto cercato.`,replaced:e=>e===1?`Operazione completata. È stata effettuata 1 sostituzione.`:`Operazione completata. Sono state effettuate ${String(e)} sostituzioni.`,found:e=>e===1?`1 cella trovata`:`${String(e)} celle trovate`},progress:{sorting:`Ordinamento…`,pasting:`Incollamento…`,replacing:`Sostituzione…`},drop:{title:`Sposta o copia celle`,replace:`Qui sono già presenti dei dati. Sostituirli?`},a11y:{grid:e=>`Foglio ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} selezionato. ${t}`,editing:e=>`Modifica di ${e}`,blank:`vuota`,cellRole:`cella`},pane:{title:`Formato grafico`,close:`Chiudi`,chartType:`Tipo di grafico`,horizontal:`Asse orizzontale (categorie)`,vertical:`Asse verticale (valori)`,showAxis:`Mostra asse`,axisTitle:`Titolo asse`,minimum:`Minimo`,maximum:`Massimo`,major:`Principale`,auto:`Automatico`,gridlines:`Griglia principale`,reverseValues:`Valori in ordine inverso`,reverseCategories:`Categorie in ordine inverso`,numberFormat:`Formato numero`,series:`Serie`,seriesN:e=>`Serie ${String(e)}`,seriesColor:e=>`Colore di ${e}`},functions:{SUM:`Somma tutti i numeri di un intervallo di celle.`,AVERAGE:`Restituisce la media (aritmetica) degli argomenti.`,COUNT:`Conta le celle di un intervallo che contengono numeri.`,COUNTA:`Conta le celle di un intervallo che non sono vuote.`,COUNTIF:`Conta le celle di un intervallo che soddisfano una condizione.`,COUNTIFS:`Conta le celle che soddisfano più condizioni.`,SUMIF:`Somma le celle che soddisfano una condizione.`,SUMIFS:`Somma le celle che soddisfano più condizioni.`,MIN:`Restituisce il numero più piccolo di un insieme di valori.`,MAX:`Restituisce il numero più grande di un insieme di valori.`,IF:`Restituisce un valore se una condizione è VERO e un altro se è FALSO.`,IFS:`Restituisce il valore della prima condizione che è VERO.`,IFERROR:`Restituisce un valore indicato se una formula dà errore.`,AND:`Restituisce VERO se tutti gli argomenti sono VERO.`,OR:`Restituisce VERO se uno degli argomenti è VERO.`,NOT:`Trasforma VERO in FALSO e FALSO in VERO.`,VLOOKUP:`Cerca un valore nella prima colonna di una tabella e restituisce un valore della stessa riga.`,XLOOKUP:`Cerca un valore in un intervallo e restituisce ciò che gli sta accanto.`,INDEX:`Restituisce il valore di una riga e una colonna di un intervallo.`,MATCH:`Restituisce la posizione di un valore in un intervallo.`,ROUND:`Arrotonda un numero a un numero di cifre.`,LEFT:`Restituisce i primi caratteri di un testo.`,RIGHT:`Restituisce gli ultimi caratteri di un testo.`,MID:`Restituisce caratteri dal centro di un testo.`,LEN:`Restituisce il numero di caratteri di un testo.`,TRIM:`Rimuove gli spazi in eccesso da un testo.`,CONCAT:`Unisce più testi in uno.`,TEXT:`Converte un valore in testo con un formato numero.`,TODAY:`Restituisce la data di oggi.`,DATE:`Restituisce la data di un anno, un mese e un giorno.`,FILTER:`Filtra un intervallo in base alle condizioni indicate.`,SORT:`Ordina il contenuto di un intervallo.`,UNIQUE:`Restituisce i valori univoci di un intervallo.`}},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`,previous:`Anterior`,next:`Próxima`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Preencher para baixo`,fillRight:`Preencher à direita`,selectAll:`Selecionar tudo`,today:`Data de hoje`},find:{findSelect:`Localizar e selecionar`,findMenu:`Localizar…`,replaceMenu:`Substituir…`,title:`Localizar e substituir`,find:`Localizar`,replace:`Substituir`,findWhat:`Localizar`,replaceWith:`Substituir por`,within:`Em`,sheet:`Planilha`,workbook:`Pasta de trabalho`,lookIn:`Examinar`,formulas:`Fórmulas`,values:`Valores`,matchCase:`Diferenciar maiúsculas de minúsculas`,wholeCell:`Coincidir conteúdo da célula inteira`,findNext:`Localizar próxima`,findAll:`Localizar tudo`,replaceOne:`Substituir`,replaceAll:`Substituir tudo`,close:`Fechar`,notFound:`Não encontramos o que você procurava.`,replaced:e=>e===1?`Tudo pronto. Fizemos 1 substituição.`:`Tudo pronto. Fizemos ${String(e)} substituições.`,found:e=>e===1?`1 célula encontrada`:`${String(e)} células encontradas`},progress:{sorting:`Classificando…`,pasting:`Colando…`,replacing:`Substituindo…`},drop:{title:`Mover ou copiar células`,replace:`Já existem dados aqui. Deseja substituí-los?`},a11y:{grid:e=>`Planilha ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} selecionado. ${t}`,editing:e=>`Editando ${e}`,blank:`em branco`,cellRole:`célula`},pane:{title:`Formatar gráfico`,close:`Fechar`,chartType:`Tipo de gráfico`,horizontal:`Eixo horizontal (categorias)`,vertical:`Eixo vertical (valores)`,showAxis:`Mostrar eixo`,axisTitle:`Título do eixo`,minimum:`Mínimo`,maximum:`Máximo`,major:`Principal`,auto:`Automático`,gridlines:`Linhas de grade principais`,reverseValues:`Valores em ordem inversa`,reverseCategories:`Categorias em ordem inversa`,numberFormat:`Formato de número`,series:`Séries`,seriesN:e=>`Série ${String(e)}`,seriesColor:e=>`Cor de ${e}`},functions:{SUM:`Soma todos os números de um intervalo de células.`,AVERAGE:`Retorna a média (aritmética) dos argumentos.`,COUNT:`Conta as células de um intervalo que contêm números.`,COUNTA:`Conta as células de um intervalo que não estão vazias.`,COUNTIF:`Conta as células de um intervalo que atendem a uma condição.`,COUNTIFS:`Conta as células que atendem a várias condições.`,SUMIF:`Soma as células que atendem a uma condição.`,SUMIFS:`Soma as células que atendem a várias condições.`,MIN:`Retorna o menor número de um conjunto de valores.`,MAX:`Retorna o maior número de um conjunto de valores.`,IF:`Retorna um valor se uma condição for VERDADEIRO e outro se for FALSO.`,IFS:`Retorna o valor da primeira condição que for VERDADEIRO.`,IFERROR:`Retorna o valor indicado se uma fórmula der erro.`,AND:`Retorna VERDADEIRO se todos os argumentos forem VERDADEIRO.`,OR:`Retorna VERDADEIRO se algum argumento for VERDADEIRO.`,NOT:`Transforma VERDADEIRO em FALSO e FALSO em VERDADEIRO.`,VLOOKUP:`Procura um valor na primeira coluna de uma tabela e retorna um valor da mesma linha.`,XLOOKUP:`Procura um valor em um intervalo e retorna o que está ao lado.`,INDEX:`Retorna o valor de uma linha e uma coluna de um intervalo.`,MATCH:`Retorna a posição de um valor em um intervalo.`,ROUND:`Arredonda um número para um número de dígitos.`,LEFT:`Retorna os primeiros caracteres de um texto.`,RIGHT:`Retorna os últimos caracteres de um texto.`,MID:`Retorna caracteres do meio de um texto.`,LEN:`Retorna o número de caracteres de um texto.`,TRIM:`Remove os espaços extras de um texto.`,CONCAT:`Junta vários textos em um.`,TEXT:`Converte um valor em texto com um formato de número.`,TODAY:`Retorna a data de hoje.`,DATE:`Retorna a data de um ano, um mês e um dia.`,FILTER:`Filtra um intervalo pelas condições definidas.`,SORT:`Classifica o conteúdo de um intervalo.`,UNIQUE:`Retorna os valores exclusivos de um intervalo.`}},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:`Сумма`,previous:`Назад`,next:`Далее`,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:`Диапазон переноса не пуст`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Заполнить вниз`,fillRight:`Заполнить вправо`,selectAll:`Выделить все`,today:`Сегодняшняя дата`},find:{findSelect:`Найти и выделить`,findMenu:`Найти…`,replaceMenu:`Заменить…`,title:`Найти и заменить`,find:`Найти`,replace:`Заменить`,findWhat:`Найти`,replaceWith:`Заменить на`,within:`Искать`,sheet:`на листе`,workbook:`в книге`,lookIn:`Область поиска`,formulas:`формулы`,values:`значения`,matchCase:`Учитывать регистр`,wholeCell:`Ячейка целиком`,findNext:`Найти далее`,findAll:`Найти все`,replaceOne:`Заменить`,replaceAll:`Заменить все`,close:`Закрыть`,notFound:`Не удалось найти искомые данные.`,replaced:e=>`Готово. Выполнено замен: ${String(e)}.`,found:e=>`Найдено ячеек: ${String(e)}`},progress:{sorting:`Сортировка…`,pasting:`Вставка…`,replacing:`Замена…`},drop:{title:`Перемещение или копирование ячеек`,replace:`Здесь уже есть данные. Заменить их?`},a11y:{grid:e=>`Лист ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`Выделено: ${e}. ${t}`,editing:e=>`Изменение ${e}`,blank:`пусто`,cellRole:`ячейка`},pane:{title:`Формат диаграммы`,close:`Закрыть`,chartType:`Тип диаграммы`,horizontal:`Горизонтальная ось (категорий)`,vertical:`Вертикальная ось (значений)`,showAxis:`Показывать ось`,axisTitle:`Название оси`,minimum:`Минимум`,maximum:`Максимум`,major:`Основные`,auto:`Авто`,gridlines:`Основные линии сетки`,reverseValues:`Обратный порядок значений`,reverseCategories:`Обратный порядок категорий`,numberFormat:`Числовой формат`,series:`Ряды`,seriesN:e=>`Ряд ${String(e)}`,seriesColor:e=>`Цвет: ${e}`},functions:{SUM:`Суммирует все числа в диапазоне ячеек.`,AVERAGE:`Возвращает среднее (арифметическое) аргументов.`,COUNT:`Подсчитывает ячейки диапазона, содержащие числа.`,COUNTA:`Подсчитывает непустые ячейки диапазона.`,COUNTIF:`Подсчитывает ячейки диапазона, отвечающие условию.`,COUNTIFS:`Подсчитывает ячейки, отвечающие нескольким условиям.`,SUMIF:`Суммирует ячейки, отвечающие условию.`,SUMIFS:`Суммирует ячейки, отвечающие нескольким условиям.`,MIN:`Возвращает наименьшее число из набора значений.`,MAX:`Возвращает наибольшее число из набора значений.`,IF:`Возвращает одно значение, если условие ИСТИНА, и другое, если ЛОЖЬ.`,IFS:`Возвращает значение первого условия, равного ИСТИНА.`,IFERROR:`Возвращает заданное значение, если формула дает ошибку.`,AND:`Возвращает ИСТИНА, если все аргументы равны ИСТИНА.`,OR:`Возвращает ИСТИНА, если хотя бы один аргумент равен ИСТИНА.`,NOT:`Меняет ИСТИНА на ЛОЖЬ, а ЛОЖЬ на ИСТИНА.`,VLOOKUP:`Ищет значение в первом столбце таблицы и возвращает значение из той же строки.`,XLOOKUP:`Ищет значение в диапазоне и возвращает то, что рядом с ним.`,INDEX:`Возвращает значение из строки и столбца диапазона.`,MATCH:`Возвращает позицию значения в диапазоне.`,ROUND:`Округляет число до заданного количества разрядов.`,LEFT:`Возвращает первые символы текста.`,RIGHT:`Возвращает последние символы текста.`,MID:`Возвращает символы из середины текста.`,LEN:`Возвращает количество символов в тексте.`,TRIM:`Удаляет лишние пробелы из текста.`,CONCAT:`Объединяет несколько текстов в один.`,TEXT:`Преобразует значение в текст в заданном числовом формате.`,TODAY:`Возвращает сегодняшнюю дату.`,DATE:`Возвращает дату по году, месяцу и дню.`,FILTER:`Фильтрует диапазон по заданным условиям.`,SORT:`Сортирует содержимое диапазона.`,UNIQUE:`Возвращает уникальные значения диапазона.`}},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`,previous:`Önceki`,next:`Sonraki`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Aşağı Doldur`,fillRight:`Sağa Doldur`,selectAll:`Tümünü Seç`,today:`Bugünün Tarihi`},find:{findSelect:`Bul ve Seç`,findMenu:`Bul…`,replaceMenu:`Değiştir…`,title:`Bul ve Değiştir`,find:`Bul`,replace:`Değiştir`,findWhat:`Aranan`,replaceWith:`Yeni değer`,within:`İçinde`,sheet:`Sayfa`,workbook:`Çalışma Kitabı`,lookIn:`Bakılacak yer`,formulas:`Formüller`,values:`Değerler`,matchCase:`Büyük/küçük harf eşleştir`,wholeCell:`Tüm hücre içeriğini eşleştir`,findNext:`Sonrakini Bul`,findAll:`Tümünü Bul`,replaceOne:`Değiştir`,replaceAll:`Tümünü Değiştir`,close:`Kapat`,notFound:`Aradığınızı bulamadık.`,replaced:e=>`Tamamlandı. ${String(e)} değiştirme yapıldı.`,found:e=>`${String(e)} hücre bulundu`},progress:{sorting:`Sıralanıyor…`,pasting:`Yapıştırılıyor…`,replacing:`Değiştiriliyor…`},drop:{title:`Hücreleri Taşı veya Kopyala`,replace:`Burada zaten veri var. Değiştirmek istiyor musunuz?`},a11y:{grid:e=>`${e} sayfası`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} seçili. ${t}`,editing:e=>`${e} düzenleniyor`,blank:`boş`,cellRole:`hücre`},pane:{title:`Grafiği Biçimlendir`,close:`Kapat`,chartType:`Grafik Türü`,horizontal:`Yatay (Kategori) Eksen`,vertical:`Dikey (Değer) Eksen`,showAxis:`Ekseni göster`,axisTitle:`Eksen Başlığı`,minimum:`En Küçük`,maximum:`En Büyük`,major:`Ana`,auto:`Otomatik`,gridlines:`Ana Kılavuz Çizgileri`,reverseValues:`Değerler ters sırada`,reverseCategories:`Kategoriler ters sırada`,numberFormat:`Sayı Biçimi`,series:`Seriler`,seriesN:e=>`Seri ${String(e)}`,seriesColor:e=>`${e} rengi`},functions:{SUM:`Bir hücre aralığındaki tüm sayıları toplar.`,AVERAGE:`Bağımsız değişkenlerin ortalamasını (aritmetik) döndürür.`,COUNT:`Aralıkta sayı içeren hücreleri sayar.`,COUNTA:`Aralıkta boş olmayan hücreleri sayar.`,COUNTIF:`Aralıkta bir koşulu karşılayan hücreleri sayar.`,COUNTIFS:`Birden çok koşulu karşılayan hücreleri sayar.`,SUMIF:`Bir koşulu karşılayan hücreleri toplar.`,SUMIFS:`Birden çok koşulu karşılayan hücreleri toplar.`,MIN:`Bir değer kümesindeki en küçük sayıyı döndürür.`,MAX:`Bir değer kümesindeki en büyük sayıyı döndürür.`,IF:`Koşul DOĞRU ise bir değer, YANLIŞ ise başka bir değer döndürür.`,IFS:`DOĞRU olan ilk koşulun değerini döndürür.`,IFERROR:`Formül hata verirse belirttiğiniz değeri döndürür.`,AND:`Tüm bağımsız değişkenler DOĞRU ise DOĞRU döndürür.`,OR:`Bağımsız değişkenlerden biri DOĞRU ise DOĞRU döndürür.`,NOT:`DOĞRU'yu YANLIŞ'a, YANLIŞ'ı DOĞRU'ya çevirir.`,VLOOKUP:`Bir tablonun ilk sütununda değer arar ve aynı satırdaki bir değeri döndürür.`,XLOOKUP:`Bir aralıkta değer arar ve yanındakini döndürür.`,INDEX:`Bir aralığın satır ve sütunundaki değeri döndürür.`,MATCH:`Bir değerin aralıktaki konumunu döndürür.`,ROUND:`Bir sayıyı belirli basamağa yuvarlar.`,LEFT:`Bir metnin ilk karakterlerini döndürür.`,RIGHT:`Bir metnin son karakterlerini döndürür.`,MID:`Bir metnin ortasındaki karakterleri döndürür.`,LEN:`Bir metindeki karakter sayısını döndürür.`,TRIM:`Metindeki fazla boşlukları kaldırır.`,CONCAT:`Birden çok metni birleştirir.`,TEXT:`Bir değeri sayı biçimine göre metne dönüştürür.`,TODAY:`Bugünün tarihini döndürür.`,DATE:`Yıl, ay ve günden tarihi döndürür.`,FILTER:`Bir aralığı belirlediğiniz koşullara göre filtreler.`,SORT:`Bir aralığın içeriğini sıralar.`,UNIQUE:`Bir aralıktaki benzersiz değerleri döndürür.`}},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`,previous:`Trước`,next:`Tiếp`,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`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`Điền xuống`,fillRight:`Điền sang phải`,selectAll:`Chọn tất cả`,today:`Ngày hôm nay`},find:{findSelect:`Tìm & Chọn`,findMenu:`Tìm…`,replaceMenu:`Thay thế…`,title:`Tìm và Thay thế`,find:`Tìm`,replace:`Thay thế`,findWhat:`Tìm gì`,replaceWith:`Thay thế bằng`,within:`Trong`,sheet:`Trang tính`,workbook:`Sổ làm việc`,lookIn:`Tìm trong`,formulas:`Công thức`,values:`Giá trị`,matchCase:`Khớp chữ hoa/thường`,wholeCell:`Khớp toàn bộ nội dung ô`,findNext:`Tìm Tiếp`,findAll:`Tìm Tất cả`,replaceOne:`Thay thế`,replaceAll:`Thay thế Tất cả`,close:`Đóng`,notFound:`Chúng tôi không tìm thấy nội dung bạn đang tìm.`,replaced:e=>`Đã xong. Chúng tôi đã thay thế ${String(e)} lần.`,found:e=>`Tìm thấy ${String(e)} ô`},progress:{sorting:`Đang sắp xếp…`,pasting:`Đang dán…`,replacing:`Đang thay thế…`},drop:{title:`Di chuyển hoặc Sao chép Ô`,replace:`Ở đây đã có dữ liệu. Bạn có muốn thay thế không?`},a11y:{grid:e=>`Trang tính ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`Đã chọn ${e}. ${t}`,editing:e=>`Đang sửa ${e}`,blank:`trống`,cellRole:`ô`},pane:{title:`Định dạng Biểu đồ`,close:`Đóng`,chartType:`Loại Biểu đồ`,horizontal:`Trục Ngang (Thể loại)`,vertical:`Trục Dọc (Giá trị)`,showAxis:`Hiện trục`,axisTitle:`Tiêu đề Trục`,minimum:`Tối thiểu`,maximum:`Tối đa`,major:`Chính`,auto:`Tự động`,gridlines:`Đường lưới Chính`,reverseValues:`Giá trị theo thứ tự ngược`,reverseCategories:`Thể loại theo thứ tự ngược`,numberFormat:`Định dạng Số`,series:`Chuỗi`,seriesN:e=>`Chuỗi ${String(e)}`,seriesColor:e=>`Màu của ${e}`},functions:{SUM:`Cộng tất cả các số trong một phạm vi ô.`,AVERAGE:`Trả về giá trị trung bình (cộng) của các đối số.`,COUNT:`Đếm các ô trong phạm vi có chứa số.`,COUNTA:`Đếm các ô trong phạm vi không trống.`,COUNTIF:`Đếm các ô trong phạm vi đáp ứng một điều kiện.`,COUNTIFS:`Đếm các ô đáp ứng nhiều điều kiện.`,SUMIF:`Cộng các ô đáp ứng một điều kiện.`,SUMIFS:`Cộng các ô đáp ứng nhiều điều kiện.`,MIN:`Trả về số nhỏ nhất trong một tập giá trị.`,MAX:`Trả về số lớn nhất trong một tập giá trị.`,IF:`Trả về một giá trị nếu điều kiện là TRUE và giá trị khác nếu là FALSE.`,IFS:`Trả về giá trị của điều kiện TRUE đầu tiên.`,IFERROR:`Trả về giá trị bạn chỉ định nếu công thức bị lỗi.`,AND:`Trả về TRUE nếu tất cả đối số đều là TRUE.`,OR:`Trả về TRUE nếu có đối số là TRUE.`,NOT:`Đổi TRUE thành FALSE và FALSE thành TRUE.`,VLOOKUP:`Tìm một giá trị trong cột đầu tiên của bảng và trả về giá trị trong cùng hàng.`,XLOOKUP:`Tìm một giá trị trong phạm vi và trả về nội dung bên cạnh.`,INDEX:`Trả về giá trị tại một hàng và cột của phạm vi.`,MATCH:`Trả về vị trí của một giá trị trong phạm vi.`,ROUND:`Làm tròn một số đến số chữ số chỉ định.`,LEFT:`Trả về các ký tự đầu của văn bản.`,RIGHT:`Trả về các ký tự cuối của văn bản.`,MID:`Trả về các ký tự ở giữa văn bản.`,LEN:`Trả về số ký tự trong văn bản.`,TRIM:`Bỏ các khoảng trắng thừa trong văn bản.`,CONCAT:`Nối nhiều văn bản thành một.`,TEXT:`Chuyển giá trị thành văn bản theo định dạng số.`,TODAY:`Trả về ngày hôm nay.`,DATE:`Trả về ngày từ năm, tháng và ngày.`,FILTER:`Lọc một phạm vi theo điều kiện bạn đặt.`,SORT:`Sắp xếp nội dung của một phạm vi.`,UNIQUE:`Trả về các giá trị duy nhất của một phạm vi.`}},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:`ผลรวม`,previous:`ก่อนหน้า`,next:`ถัดไป`,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:`ช่วงที่ล้นไม่ว่าง`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`เติมลง`,fillRight:`เติมไปทางขวา`,selectAll:`เลือกทั้งหมด`,today:`วันที่วันนี้`},find:{findSelect:`ค้นหาและเลือก`,findMenu:`ค้นหา…`,replaceMenu:`แทนที่…`,title:`ค้นหาและแทนที่`,find:`ค้นหา`,replace:`แทนที่`,findWhat:`สิ่งที่ค้นหา`,replaceWith:`แทนที่ด้วย`,within:`ภายใน`,sheet:`แผ่นงาน`,workbook:`เวิร์กบุ๊ก`,lookIn:`ค้นหาใน`,formulas:`สูตร`,values:`ค่า`,matchCase:`ตรงตามตัวพิมพ์ใหญ่-เล็ก`,wholeCell:`ตรงกับเนื้อหาทั้งเซลล์`,findNext:`ค้นหาถัดไป`,findAll:`ค้นหาทั้งหมด`,replaceOne:`แทนที่`,replaceAll:`แทนที่ทั้งหมด`,close:`ปิด`,notFound:`เราไม่พบสิ่งที่คุณค้นหา`,replaced:e=>`เสร็จแล้ว แทนที่ ${String(e)} รายการ`,found:e=>`พบ ${String(e)} เซลล์`},progress:{sorting:`กำลังเรียงลำดับ…`,pasting:`กำลังวาง…`,replacing:`กำลังแทนที่…`},drop:{title:`ย้ายหรือคัดลอกเซลล์`,replace:`มีข้อมูลอยู่ที่นี่แล้ว คุณต้องการแทนที่หรือไม่`},a11y:{grid:e=>`แผ่นงาน ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`เลือก ${e} แล้ว ${t}`,editing:e=>`กำลังแก้ไข ${e}`,blank:`ว่าง`,cellRole:`เซลล์`},pane:{title:`จัดรูปแบบแผนภูมิ`,close:`ปิด`,chartType:`ชนิดแผนภูมิ`,horizontal:`แกนนอน (ประเภท)`,vertical:`แกนตั้ง (ค่า)`,showAxis:`แสดงแกน`,axisTitle:`ชื่อแกน`,minimum:`ค่าต่ำสุด`,maximum:`ค่าสูงสุด`,major:`หลัก`,auto:`อัตโนมัติ`,gridlines:`เส้นตารางหลัก`,reverseValues:`ค่าในลำดับย้อนกลับ`,reverseCategories:`ประเภทในลำดับย้อนกลับ`,numberFormat:`รูปแบบตัวเลข`,series:`ชุดข้อมูล`,seriesN:e=>`ชุดข้อมูล ${String(e)}`,seriesColor:e=>`สีของ ${e}`},functions:{SUM:`บวกตัวเลขทั้งหมดในช่วงเซลล์`,AVERAGE:`ส่งกลับค่าเฉลี่ย (เลขคณิต) ของอาร์กิวเมนต์`,COUNT:`นับเซลล์ในช่วงที่มีตัวเลข`,COUNTA:`นับเซลล์ในช่วงที่ไม่ว่าง`,COUNTIF:`นับเซลล์ในช่วงที่ตรงตามเงื่อนไข`,COUNTIFS:`นับเซลล์ที่ตรงตามหลายเงื่อนไข`,SUMIF:`บวกเซลล์ที่ตรงตามเงื่อนไข`,SUMIFS:`บวกเซลล์ที่ตรงตามหลายเงื่อนไข`,MIN:`ส่งกลับตัวเลขที่น้อยที่สุดในชุดค่า`,MAX:`ส่งกลับตัวเลขที่มากที่สุดในชุดค่า`,IF:`ส่งกลับค่าหนึ่งถ้าเงื่อนไขเป็น TRUE และอีกค่าถ้าเป็น FALSE`,IFS:`ส่งกลับค่าของเงื่อนไขแรกที่เป็น TRUE`,IFERROR:`ส่งกลับค่าที่คุณกำหนดถ้าสูตรเกิดข้อผิดพลาด`,AND:`ส่งกลับ TRUE ถ้าอาร์กิวเมนต์ทั้งหมดเป็น TRUE`,OR:`ส่งกลับ TRUE ถ้ามีอาร์กิวเมนต์ใดเป็น TRUE`,NOT:`เปลี่ยน TRUE เป็น FALSE และ FALSE เป็น TRUE`,VLOOKUP:`ค้นหาค่าในคอลัมน์แรกของตารางและส่งกลับค่าในแถวเดียวกัน`,XLOOKUP:`ค้นหาค่าในช่วงและส่งกลับสิ่งที่อยู่ข้างกัน`,INDEX:`ส่งกลับค่าที่แถวและคอลัมน์ของช่วง`,MATCH:`ส่งกลับตำแหน่งของค่าในช่วง`,ROUND:`ปัดเศษตัวเลขตามจำนวนหลักที่กำหนด`,LEFT:`ส่งกลับอักขระแรกๆ ของข้อความ`,RIGHT:`ส่งกลับอักขระท้ายๆ ของข้อความ`,MID:`ส่งกลับอักขระจากตรงกลางของข้อความ`,LEN:`ส่งกลับจำนวนอักขระในข้อความ`,TRIM:`เอาช่องว่างส่วนเกินออกจากข้อความ`,CONCAT:`รวมข้อความหลายข้อความเป็นข้อความเดียว`,TEXT:`แปลงค่าเป็นข้อความตามรูปแบบตัวเลข`,TODAY:`ส่งกลับวันที่ของวันนี้`,DATE:`ส่งกลับวันที่จากปี เดือน และวัน`,FILTER:`กรองช่วงตามเงื่อนไขที่คุณกำหนด`,SORT:`เรียงลำดับเนื้อหาของช่วง`,UNIQUE:`ส่งกลับค่าที่ไม่ซ้ำกันของช่วง`}},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:`योग`,previous:`पिछला`,next:`अगला`,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:`स्पिल श्रेणी खाली नहीं है`,keysTitle:(e,t)=>`${e} (${t})`,commands:{fillDown:`नीचे भरें`,fillRight:`दाएँ भरें`,selectAll:`सभी चुनें`,today:`आज की तारीख`},find:{findSelect:`ढूँढें और चुनें`,findMenu:`ढूँढें…`,replaceMenu:`बदलें…`,title:`ढूँढें और बदलें`,find:`ढूँढें`,replace:`बदलें`,findWhat:`क्या ढूँढें`,replaceWith:`इससे बदलें`,within:`इसमें`,sheet:`शीट`,workbook:`वर्कबुक`,lookIn:`इसमें देखें`,formulas:`सूत्र`,values:`मान`,matchCase:`केस का मिलान करें`,wholeCell:`पूरे कक्ष की सामग्री का मिलान करें`,findNext:`अगला ढूँढें`,findAll:`सभी ढूँढें`,replaceOne:`बदलें`,replaceAll:`सभी बदलें`,close:`बंद करें`,notFound:`आप जो ढूँढ रहे थे, वह हमें नहीं मिला।`,replaced:e=>`सब हो गया। हमने ${String(e)} बदलाव किए।`,found:e=>`${String(e)} कक्ष मिले`},progress:{sorting:`सॉर्ट हो रहा है…`,pasting:`चिपकाया जा रहा है…`,replacing:`बदला जा रहा है…`},drop:{title:`कक्ष ले जाएँ या कॉपी करें`,replace:`यहाँ पहले से डेटा है। क्या आप इसे बदलना चाहते हैं?`},a11y:{grid:e=>`शीट ${e}`,cell:(e,t,n)=>n===void 0?`${e}, ${t}`:`${n}, ${e}, ${t}`,range:(e,t)=>`${e} चयनित। ${t}`,editing:e=>`${e} संपादित हो रहा है`,blank:`रिक्त`,cellRole:`कक्ष`},pane:{title:`चार्ट स्वरूपित करें`,close:`बंद करें`,chartType:`चार्ट प्रकार`,horizontal:`क्षैतिज (श्रेणी) अक्ष`,vertical:`लंबवत (मान) अक्ष`,showAxis:`अक्ष दिखाएँ`,axisTitle:`अक्ष शीर्षक`,minimum:`न्यूनतम`,maximum:`अधिकतम`,major:`मुख्य`,auto:`स्वचालित`,gridlines:`मुख्य ग्रिडलाइन`,reverseValues:`मान उलटे क्रम में`,reverseCategories:`श्रेणियाँ उलटे क्रम में`,numberFormat:`संख्या स्वरूप`,series:`शृंखला`,seriesN:e=>`शृंखला ${String(e)}`,seriesColor:e=>`${e} का रंग`},functions:{SUM:`कक्षों की श्रेणी की सभी संख्याएँ जोड़ता है।`,AVERAGE:`तर्कों का औसत (अंकगणितीय माध्य) लौटाता है।`,COUNT:`श्रेणी में संख्या वाले कक्षों को गिनता है।`,COUNTA:`श्रेणी में खाली न रहे कक्षों को गिनता है।`,COUNTIF:`श्रेणी में शर्त पूरी करने वाले कक्षों को गिनता है।`,COUNTIFS:`कई शर्तें पूरी करने वाले कक्षों को गिनता है।`,SUMIF:`शर्त पूरी करने वाले कक्षों को जोड़ता है।`,SUMIFS:`कई शर्तें पूरी करने वाले कक्षों को जोड़ता है।`,MIN:`मानों के समूह की सबसे छोटी संख्या लौटाता है।`,MAX:`मानों के समूह की सबसे बड़ी संख्या लौटाता है।`,IF:`शर्त TRUE होने पर एक मान और FALSE होने पर दूसरा मान लौटाता है।`,IFS:`पहली TRUE शर्त का मान लौटाता है।`,IFERROR:`सूत्र में त्रुटि होने पर आपका दिया मान लौटाता है।`,AND:`सभी तर्क TRUE हों तो TRUE लौटाता है।`,OR:`कोई भी तर्क TRUE हो तो TRUE लौटाता है।`,NOT:`TRUE को FALSE और FALSE को TRUE में बदलता है।`,VLOOKUP:`तालिका के पहले स्तंभ में मान ढूँढकर उसी पंक्ति का मान लौटाता है।`,XLOOKUP:`श्रेणी में मान ढूँढकर उसके बगल का मान लौटाता है।`,INDEX:`श्रेणी की किसी पंक्ति और स्तंभ का मान लौटाता है।`,MATCH:`श्रेणी में किसी मान का स्थान लौटाता है।`,ROUND:`संख्या को दिए गए अंकों तक पूर्णांकित करता है।`,LEFT:`टेक्स्ट के पहले वर्ण लौटाता है।`,RIGHT:`टेक्स्ट के अंतिम वर्ण लौटाता है।`,MID:`टेक्स्ट के बीच के वर्ण लौटाता है।`,LEN:`टेक्स्ट में वर्णों की संख्या लौटाता है।`,TRIM:`टेक्स्ट से अतिरिक्त रिक्त स्थान हटाता है।`,CONCAT:`कई टेक्स्ट को एक में जोड़ता है।`,TEXT:`मान को संख्या स्वरूप में टेक्स्ट में बदलता है।`,TODAY:`आज की तारीख लौटाता है।`,DATE:`वर्ष, माह और दिन से तारीख लौटाता है।`,FILTER:`आपकी शर्तों के अनुसार श्रेणी को फ़िल्टर करता है।`,SORT:`श्रेणी की सामग्री को सॉर्ट करता है।`,UNIQUE:`श्रेणी के अद्वितीय मान लौटाता है।`}}});function jC(){return AC.of(x()?.locale)}function MC(e){let t=(e,t)=>e.href===void 0?(0,j.jsx)(te,{type:`button`,variant:t?`default`:`ghost`,size:`sm`,disabled:e.disabled,autoFocus:e.autoFocus,"data-testid":e.testid,"data-default":t?``:void 0,onClick:e.onClick,children:e.label},e.testid):(0,j.jsx)(te,{variant:`ghost`,size:`sm`,asChild:!0,children:(0,j.jsx)(`a`,{href:e.href,target:`_blank`,rel:`noreferrer`,"data-testid":e.testid,children:e.label})},e.testid);return(0,j.jsxs)(`div`,{className:`sheet-dialog-buttons`,"data-testid":`sheet-dialog-buttons`,children:[e.leading===void 0?null:(0,j.jsx)(`div`,{className:`mr-auto`,children:e.leading}),(e.others??[]).map(e=>t(e,!1)),e.cancel?t(e.cancel,!1):null,e.main?t(e.main,!0):null]})}function NC(e){let t=jC(),n=e.buttons??{cancel:{label:t.dialog.cancel,testid:`sheet-dialog-cancel`,onClick:e.onClose},main:{label:t.dialog.ok,testid:`sheet-dialog-ok`,onClick:()=>e.onOk?.()}};return(0,j.jsx)(ft,{open:!0,onOpenChange:t=>{t||e.onClose()},children:(0,j.jsxs)(mt,{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,j.jsx)(lt,{children:(0,j.jsx)(pt,{className:`text-sm font-semibold`,children:e.title})}),(0,j.jsx)(`div`,{className:`sheet-dialog`,children:e.children}),(0,j.jsx)(ut,{className:`items-center`,children:(0,j.jsx)(MC,{leading:e.left,main:n.main,cancel:n.cancel,...n.others?{others:n.others}:{}})})]})})}function PC(e){return(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:e.label}),e.children]})}var FC=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,!bx(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 IC(e){let t=jC(),[n,r]=(0,A.useState)(0),i=e.paths[Math.min(n,e.paths.length-1)]??``,[a,o]=(0,A.useState)();(0,A.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,j.jsx)(NC,{title:i.split(`/`).pop()??i,testid:`sheet-file-viewer`,wide:!0,onClose:e.onClose,left:e.paths.length>1?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(te,{variant:`ghost`,size:`sm`,"data-testid":`sheet-file-previous`,onClick:()=>{s(-1)},children:t.previous}),(0,j.jsx)(te,{variant:`ghost`,size:`sm`,"data-testid":`sheet-file-next`,onClick:()=>{s(1)},children:t.next})]}):void 0,buttons:{others:[...e.onRemove?[{label:t.files.remove,testid:`sheet-file-remove`,onClick:()=>{e.onRemove?.(i)}}]:[],...a===void 0?[]:[{label:t.files.open,testid:`sheet-file-open`,href:a}]],main:{label:t.scenario.close,testid:`sheet-file-close`,onClick:e.onClose}},children:(0,j.jsx)(`div`,{className:`sheet-file-view`,children:a!==void 0&&bx(i)?(0,j.jsx)(`img`,{src:a,alt:i,"data-testid":`sheet-file-picture`}):(0,j.jsxs)(`p`,{className:`sheet-dialog-line`,children:[(0,j.jsx)(Ct,{className:`mr-1 inline size-4`}),i]})})})}async function LC(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)}var RC=(0,A.createContext)(null),zC=RC.Provider;function BC(e){let t=(0,A.useContext)(RC);if(!t)throw Error(`A command is asked for inside the sheet editor.`);return t(e)}function VC(e){let t=BC(e.id);return(0,j.jsxs)(b,{disabled:e.disabled===!0||!t.enabled,"data-testid":e.testid,onSelect:t.run,children:[e.label??t.label,t.shortcut===void 0?null:(0,j.jsx)(f,{children:t.shortcut})]})}function HC(e){let t=BC(e),n=jC();return t.shortcut===void 0?t.label:n.keysTitle(t.label,t.shortcut)}function UC(e,t){let n=t.meta||t.ctrl;if(e.ctrl===!0){if(!t.ctrl)return!1}else if(e.mod===!0!==n)return!1;return e.shift===!0!==t.shift||e.alt===!0!==t.alt?!1:e.key.length===1?e.key.toLowerCase()===t.key.toLowerCase():e.key===t.key}var WC={ArrowDown:`↓`,ArrowUp:`↑`,ArrowLeft:`←`,ArrowRight:`→`,Backspace:`⌫`,Delete:`⌦`,Enter:`↩`,Escape:`⎋`,Tab:`⇥`," ":`Space`,ContextMenu:`Menu`};function GC(e,t){let n=WC[e.key]??(e.key.length===1?e.key.toUpperCase():e.key);if(t)return`${e.ctrl===!0?`⌃`:``}${e.alt===!0?`⌥`:``}${e.shift===!0?`⇧`:``}${e.mod===!0?`⌘`:``}${n}`;let r=[];return(e.mod===!0||e.ctrl===!0)&&r.push(`Ctrl`),e.alt===!0&&r.push(`Alt`),e.shift===!0&&r.push(`Shift`),r.push(n),r.join(`+`)}function KC(e,t){let n=[];return(e.ctrl===!0||e.mod===!0&&!t)&&n.push(`Control`),e.alt===!0&&n.push(`Alt`),e.shift===!0&&n.push(`Shift`),e.mod===!0&&t&&n.push(`Meta`),n.push(e.key===` `?`Space`:e.key.length===1?e.key.toUpperCase():e.key),n.join(`+`)}function qC(){let e=globalThis.navigator;return/Mac|iPhone|iPad/u.test(e?.userAgent??``)}var JC=class{byId=new Map;list;anywhere;constructor(e,t=new Set){this.list=e,this.anywhere=t;for(let t of e){if(this.byId.has(t.id))throw Error(`Two commands are ${t.id}.`);this.byId.set(t.id,t)}}get(e){return this.byId.get(e)}forKey(e,t=`cells`){return this.list.find(n=>n.native!==!0&&((n.scope??`cells`)===t||this.anywhere.has(n.id))&&(n.keys??[]).some(t=>UC(t,e)))}bind(e,t,n){return r=>{let i=this.byId.get(r);if(!i)throw Error(`No command ${r}.`);let a=i.keys?.[0];return{id:r,label:i.label(t),shortcut:a?GC(a,n):void 0,aria:a?KC(a,n):void 0,enabled:i.enabled?.(e)??!0,run:()=>{(i.enabled?.(e)??!0)&&i.run(e)}}}}},YC=e=>({active:e,anchor:e,focus:e}),XC=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)}),ZC=e=>[...e.more??[],XC(e)],QC=e=>{let t=XC(e);return(e.more?.length??0)===0&&t.top===t.bottom&&t.left===t.right},$C=(e,t)=>({active:t,anchor:t,focus:t,more:ZC(e)});function ew(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 tw(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 nw(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 rw=e=>Math.min(zt-1,Math.max(0,e)),iw=e=>Math.min(Bt-1,Math.max(0,e)),aw=e=>({row:rw(e.row),col:iw(e.col)}),ow=(e,t)=>YC(aw({row:e.active.row+t.row,col:e.active.col+t.col})),sw=(e,t)=>({...e,focus:aw(t)}),cw=(e,t)=>({active:{row:0,col:e},anchor:{row:0,col:e},focus:{row:zt-1,col:t}}),lw=(e,t)=>({active:{row:e,col:0},anchor:{row:e,col:0},focus:{row:t,col:Bt-1}}),uw={active:{row:0,col:0},anchor:{row:0,col:0},focus:{row:zt-1,col:Bt-1}},dw=e=>e.top===0&&e.bottom===1048575,fw=e=>e.left===0&&e.right===16383;function pw(e,t,n){let r=XC(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 mw(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?zt-1:0,col:n.col===0?t.col:n.col>0?Bt-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 hw=({c:e})=>e.editable,gw=({c:e})=>hw({c:e})&&(fw(e.area)||dw(e.area)),_w=new JC([{id:`edit.undo`,label:e=>e.undo,keys:[{key:`z`,mod:!0}],enabled:({c:e})=>e.state.canUndo&&!e.ui.editing,run:({a:e})=>{e.undo()}},{id:`edit.redo`,label:e=>e.redo,keys:[{key:`y`,mod:!0},{key:`z`,mod:!0,shift:!0}],enabled:({c:e})=>e.state.canRedo&&!e.ui.editing,run:({a:e})=>{e.redo()}},{id:`edit.cut`,label:e=>e.menu.cut,keys:[{key:`x`,mod:!0}],native:!0,enabled:hw,run:({a:e})=>{e.clipCut()}},{id:`edit.copy`,label:e=>e.menu.copy,keys:[{key:`c`,mod:!0}],native:!0,run:({a:e})=>{e.clipCopy()}},{id:`edit.paste`,label:e=>e.menu.paste,keys:[{key:`v`,mod:!0}],native:!0,enabled:hw,run:({a:e})=>{e.menuPaste(`all`)}},{id:`edit.pasteValues`,label:e=>e.menu.values,enabled:hw,run:({a:e})=>{e.menuPaste(`values`)}},{id:`edit.pasteFormulas`,label:e=>e.menu.formulas,enabled:hw,run:({a:e})=>{e.menuPaste(`formulas`)}},{id:`edit.pasteFormats`,label:e=>e.menu.formats,enabled:hw,run:({a:e})=>{e.menuPaste(`formats`)}},{id:`edit.clear`,label:e=>e.menu.clearContents,keys:[{key:`Delete`},{key:`Backspace`}],enabled:hw,run:({a:e})=>{e.clear()}},{id:`edit.find`,label:e=>e.find.findMenu,keys:[{key:`f`,mod:!0}],run:({a:e})=>{e.openFind(!1)}},{id:`edit.replace`,label:e=>e.find.replaceMenu,keys:[{key:`h`,mod:!0,shift:!0},{key:`h`,ctrl:!0}],run:({a:e})=>{e.openFind(!0)}},{id:`edit.fillDown`,label:e=>e.commands.fillDown,keys:[{key:`d`,mod:!0}],enabled:hw,run:({a:e})=>{e.fill(!0)}},{id:`edit.fillRight`,label:e=>e.commands.fillRight,keys:[{key:`r`,mod:!0}],enabled:hw,run:({a:e})=>{e.fill(!1)}},{id:`edit.selectAll`,label:e=>e.commands.selectAll,keys:[{key:`a`,mod:!0}],run:({a:e})=>{e.selectAll()}},{id:`edit.today`,label:e=>e.commands.today,keys:[{key:`;`,mod:!0}],enabled:hw,run:({a:e})=>{e.typeToday()}},{id:`format.bold`,label:e=>e.bold,keys:[{key:`b`,mod:!0}],enabled:hw,run:({a:e})=>{e.toggleLook(`bold`)}},{id:`format.italic`,label:e=>e.italic,keys:[{key:`i`,mod:!0}],enabled:hw,run:({a:e})=>{e.toggleLook(`italic`)}},{id:`format.underline`,label:e=>e.underline,keys:[{key:`u`,mod:!0}],enabled:hw,run:({a:e})=>{e.toggleLook(`underline`)}},{id:`format.cells`,label:e=>e.menu.formatCells,keys:[{key:`1`,mod:!0}],enabled:hw,run:({c:e})=>{e.ui.setAsking({kind:`format`,tab:`number`})}},...[{key:`~`,code:`General`,name:`general`},{key:`$`,code:`$#,##0.00`,name:`currency`},{key:`%`,code:`0%`,name:`percentage`},{key:`^`,code:`0.00E+00`,name:`scientific`},{key:`#`,code:`d-mmm-yy`,name:`shortDate`},{key:`@`,code:`h:mm AM/PM`,name:`time`},{key:`!`,code:`#,##0.00`,name:`number`}].map(e=>({id:`format.number.${e.name}`,label:t=>t.formats[e.name],keys:[{key:e.key,mod:!0,shift:!0}],enabled:hw,run:({a:t})=>{t.numberFormat(e.code)}})),{id:`format.borderOutside`,label:e=>e.borders.outside,keys:[{key:`&`,mod:!0,shift:!0}],enabled:hw,run:({a:e})=>{e.borders(`outside`)}},{id:`format.borderNone`,label:e=>e.borders.none,keys:[{key:`_`,mod:!0,shift:!0}],enabled:hw,run:({a:e})=>{e.borders(`none`)}},{id:`rows.hide`,label:e=>e.menu.hide,keys:[{key:`9`,ctrl:!0}],enabled:hw,run:({a:e})=>{e.hide(`rows`)}},{id:`columns.hide`,label:e=>e.menu.hide,keys:[{key:`0`,ctrl:!0}],enabled:hw,run:({a:e})=>{e.hide(`columns`)}},{id:`rows.unhide`,label:e=>e.menu.unhide,keys:[{key:`(`,mod:!0,shift:!0}],enabled:hw,run:({a:e})=>{e.unhide(`rows`)}},{id:`columns.unhide`,label:e=>e.menu.unhide,keys:[{key:`)`,mod:!0,shift:!0}],enabled:hw,run:({a:e})=>{e.unhide(`columns`)}},{id:`band.insert`,label:e=>e.insert,keys:[{key:`+`,mod:!0,shift:!0}],enabled:gw,run:({c:e,a:t})=>{t.insertBand(fw(e.area)?`rows`:`columns`)}},{id:`band.delete`,label:e=>e.delete,keys:[{key:`-`,mod:!0}],enabled:gw,run:({c:e,a:t})=>{t.deleteBand(fw(e.area)?`rows`:`columns`)}},{id:`rows.insert`,label:e=>e.menu.entireRow,enabled:hw,run:({a:e})=>{e.insertBand(`rows`)}},{id:`columns.insert`,label:e=>e.menu.entireColumn,enabled:hw,run:({a:e})=>{e.insertBand(`columns`)}},{id:`rows.delete`,label:e=>e.menu.entireRow,enabled:hw,run:({a:e})=>{e.deleteBand(`rows`)}},{id:`columns.delete`,label:e=>e.menu.entireColumn,enabled:hw,run:({a:e})=>{e.deleteBand(`columns`)}},{id:`rows.height`,label:e=>e.menu.rowHeight,enabled:hw,run:({a:e})=>{e.askSize(`row`)}},{id:`columns.width`,label:e=>e.menu.columnWidth,enabled:hw,run:({a:e})=>{e.askSize(`column`)}},{id:`data.filter`,label:e=>e.sortFilter.filter,keys:[{key:`l`,mod:!0,shift:!0}],enabled:hw,run:({a:e})=>{e.filterToggle()}},{id:`data.filterByValue`,label:e=>e.menu.filterByValue,enabled:hw,run:({a:e})=>{e.filterByCell()}},{id:`data.clearFilter`,label:e=>e.sortFilter.clear,enabled:hw,run:({a:e})=>{e.clearFilter()}},{id:`data.sortAscending`,label:e=>e.filter.aToZ,enabled:hw,run:({a:e})=>{e.sort(!1)}},{id:`data.sortDescending`,label:e=>e.filter.zToA,enabled:hw,run:({a:e})=>{e.sort(!0)}},{id:`data.customSort`,label:e=>e.sortFilter.customSort,enabled:hw,run:({a:e})=>{e.customSort()}},{id:`cell.list`,label:e=>e.menu.pickFromList,keys:[{key:`ArrowDown`,alt:!0}],run:({a:e})=>{e.openHere()}},{id:`chart.cut`,label:e=>e.menu.cut,keys:[{key:`x`,mod:!0}],native:!0,scope:`chart`,enabled:hw,run:({a:e})=>{e.chartToClipboard(!0)}},{id:`chart.copy`,label:e=>e.menu.copy,keys:[{key:`c`,mod:!0}],native:!0,scope:`chart`,run:({a:e})=>{e.chartToClipboard(!1)}},{id:`chart.paste`,label:e=>e.menu.paste,keys:[{key:`v`,mod:!0}],native:!0,scope:`chart`,enabled:({c:e})=>hw({c:e})&&e.ui.chartHeld,run:({a:e})=>{e.pasteChart()}},{id:`chart.delete`,label:e=>e.delete,keys:[{key:`Delete`},{key:`Backspace`}],scope:`chart`,enabled:hw,run:({a:e})=>{let t=e.shownChart();t&&e.removeChart(t.index)}},{id:`chart.format`,label:e=>e.pane.title,keys:[{key:`1`,mod:!0}],scope:`chart`,enabled:hw,run:({a:e})=>{let t=e.shownChart();t&&e.openChartPane(t.index)}}],new Set([`edit.undo`,`edit.redo`]));function vw(e){return(0,j.jsxs)(m,{open:!0,modal:e.modal??!0,onOpenChange:t=>{t||e.onClose()},children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsx)(`span`,{"aria-hidden":!0,style:{position:`fixed`,left:e.x,top:e.y,width:0,height:0}})}),(0,j.jsx)(d,{align:`start`,className:`sheet-menu text-xs`,"data-testid":e.testid,onCloseAutoFocus:e=>{e.preventDefault()},children:e.children})]})}function yw(e){let t=jC(),{disabled:n,extras:r}=e,i=e.kind===`row`?`rows`:`columns`;return(0,j.jsxs)(vw,{x:e.x,y:e.y,modal:!1,testid:`sheet-menu`,onClose:e.onClose,children:[(0,j.jsx)(VC,{id:`edit.cut`,testid:`sheet-menu-cut`,disabled:n}),(0,j.jsx)(VC,{id:`edit.copy`,testid:`sheet-menu-copy`}),(0,j.jsx)(VC,{id:`edit.paste`,testid:`sheet-menu-paste`,disabled:n}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{disabled:n,"data-testid":`sheet-menu-paste-special`,children:t.menu.pasteSpecial}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(VC,{id:`edit.pasteValues`,testid:`sheet-paste-values`}),(0,j.jsx)(VC,{id:`edit.pasteFormulas`,testid:`sheet-paste-formulas`}),(0,j.jsx)(VC,{id:`edit.pasteFormats`,testid:`sheet-paste-formats`})]})]}),(0,j.jsx)(p,{}),e.kind===`cell`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{disabled:n,"data-testid":`sheet-menu-insert`,children:t.insert}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(VC,{id:`rows.insert`,testid:`sheet-menu-insert-rows`}),(0,j.jsx)(VC,{id:`columns.insert`,testid:`sheet-menu-insert-columns`})]})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{disabled:n,"data-testid":`sheet-menu-delete`,children:t.delete}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(VC,{id:`rows.delete`,testid:`sheet-menu-delete-rows`}),(0,j.jsx)(VC,{id:`columns.delete`,testid:`sheet-menu-delete-columns`})]})]})]}):(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(VC,{id:`band.insert`,testid:`sheet-menu-insert`,label:t.insert,disabled:n}),(0,j.jsx)(VC,{id:`band.delete`,testid:`sheet-menu-delete`,label:t.delete,disabled:n})]}),(0,j.jsx)(VC,{id:`edit.clear`,testid:`sheet-menu-clear`,disabled:n}),(0,j.jsx)(p,{}),e.kind===`cell`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{disabled:n,"data-testid":`sheet-menu-filter`,children:t.menu.filter}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(VC,{id:`data.clearFilter`,testid:`sheet-menu-filter-clear`}),(0,j.jsx)(VC,{id:`data.filter`,testid:`sheet-menu-filter-toggle`}),(0,j.jsx)(VC,{id:`data.filterByValue`,testid:`sheet-menu-filter-value`})]})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{disabled:n,"data-testid":`sheet-menu-sort`,children:t.menu.sort}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(VC,{id:`data.sortAscending`,testid:`sheet-menu-sort-up`}),(0,j.jsx)(VC,{id:`data.sortDescending`,testid:`sheet-menu-sort-down`}),(0,j.jsx)(VC,{id:`data.customSort`,testid:`sheet-menu-sort-custom`})]})]}),(0,j.jsx)(p,{})]}):null,(0,j.jsx)(VC,{id:`format.cells`,testid:`sheet-menu-format`,disabled:n}),r.insertFile?(0,j.jsx)(b,{disabled:n,"data-testid":`sheet-menu-insert-file`,onSelect:r.insertFile,children:t.files.insert}):null,r.openFile?(0,j.jsx)(b,{"data-testid":`sheet-menu-open-file`,onSelect:r.openFile,children:t.files.open}):null,r.pickFromList?(0,j.jsx)(VC,{id:`cell.list`,testid:`sheet-menu-list`}):null,e.kind===`cell`?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(VC,{id:e.kind===`row`?`rows.height`:`columns.width`,testid:e.kind===`row`?`sheet-menu-height`:`sheet-menu-width`,disabled:n}),(0,j.jsx)(VC,{id:`${i}.hide`,testid:`sheet-menu-hide`,disabled:n}),(0,j.jsx)(VC,{id:`${i}.unhide`,testid:`sheet-menu-unhide`,disabled:n})]}),(0,j.jsx)(ue,{})]})}function bw(e){return(0,j.jsxs)(vw,{x:e.x,y:e.y,testid:`sheet-chart-menu`,onClose:e.onClose,children:[(0,j.jsx)(VC,{id:`chart.cut`,testid:`sheet-chart-cut`,disabled:e.disabled}),(0,j.jsx)(VC,{id:`chart.copy`,testid:`sheet-chart-copy`}),(0,j.jsx)(VC,{id:`chart.paste`,testid:`sheet-chart-paste`,disabled:e.disabled}),(0,j.jsx)(p,{}),(0,j.jsx)(VC,{id:`chart.format`,testid:`sheet-chart-format`,disabled:e.disabled}),(0,j.jsx)(VC,{id:`chart.delete`,testid:`sheet-chart-delete`,disabled:e.disabled}),(0,j.jsx)(ue,{})]})}var xw={rows:10,columns:8};function Sw(e,t){let{sheet:n}=e,r=n.tableAt(t.row,t.col);if(r&&t.row>r.at.row)return r.columns[t.col-r.at.col]?.name;let i=n.filterAt(t.row,t.col);if(i&&t.row>i.area.top){let r=Yr(e.values.value(n,i.area.top,t.col),n.lookAt(i.area.top,t.col).format);return r===``?void 0:r}}var Cw=(e,t,n)=>{let r=Yr(e.values.value(e.sheet,n.row,n.col),e.sheet.lookAt(n.row,n.col).format);return r===``?t.a11y.blank:r};function ww(e,t){let n=e.selection.active,r=Ut(n);if(e.ui.editing)return t.a11y.editing(r);let i=t.a11y.cell(r,Cw(e,t,n),Sw(e,n));return QC(e.selection)?i:t.a11y.range(e.areas.map(Wt).join(`, `),i)}function Tw({c:e,a:t}){let{sheet:n,selection:r,s:i}=e,a=r.active,o=Math.max(n.lastRow+1,a.row+1),s=Math.max(n.columnsUsed,a.col+1),c=Math.max(0,a.row-xw.rows),l=Math.max(0,a.col-xw.columns),u=a.row+xw.rows,d=a.col+xw.columns,f=(t,n)=>e.areas.some(e=>t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right),p=(0,A.useMemo)(()=>{let t=[];for(let r=c;r<=u;r++){let i=[];for(let t=l;t<=d;t++)i.push({col:t,text:Yr(e.values.value(n,r,t),n.lookAt(r,t).format)});t.push({row:r,cells:i})}return t},[n,c,l,e.state.revision]),m=[];for(let e=l;e<=d;e++)m.push(e);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`sheet-a11y`,role:`grid`,"aria-label":i.a11y.grid(e.name),"aria-rowcount":o+1,"aria-colcount":s+1,"aria-multiselectable":!0,"aria-readonly":!e.editable||e.locked,"data-testid":`sheet-a11y-grid`,children:[(0,j.jsx)(`div`,{role:`row`,"aria-rowindex":1,children:m.map(e=>(0,j.jsx)(`span`,{role:`columnheader`,"aria-colindex":e+2,children:Vt(e)},e))}),p.map(e=>(0,j.jsxs)(`div`,{role:`row`,"aria-rowindex":e.row+2,children:[(0,j.jsx)(`span`,{role:`rowheader`,"aria-colindex":1,children:String(e.row+1)}),e.cells.map(t=>{let n=e.row===a.row&&t.col===a.col;return(0,j.jsx)(`span`,{role:`gridcell`,"aria-colindex":t.col+2,"aria-selected":f(e.row,t.col),"aria-current":n?`true`:void 0,"data-testid":n?`sheet-a11y-active`:void 0,children:t.text},t.col)})]},e.row))]}),(0,j.jsx)(`div`,{id:`sheet-a11y-live`,className:`sheet-a11y`,role:`status`,"aria-live":`polite`,"data-testid":`sheet-a11y-live`,children:t.cellLabel()})]})}var Ew=String.raw`(?:'(?:[^']|'')+'|[\p{L}_][\p{L}\p{N}_.]*)!`,Dw=String.raw`\$?[A-Za-z]{1,3}\$?[1-9]\d*`,Ow=String.raw`\$?[A-Za-z]{1,3}:\$?[A-Za-z]{1,3}`,kw=String.raw`\$?[1-9]\d*:\$?[1-9]\d*`,Aw=new RegExp(String.raw`^(${Ew})?(${Dw}(?::${Dw})?|${Ow}|${kw})(?![\p{L}\p{N}_.(])`,`u`),jw=/^[\p{L}_\\][\p{L}\p{N}\p{M}_.?\\]*/u,Mw=/^(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/u;function Nw(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=Aw.exec(i),a=Mw.exec(i),o=jw.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 Pw=e=>e.startsWith(`=`)&&e.length>0;function Fw(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:Ht(t[1]),r=t[3]===void 0?n:Ht(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 Iw=e=>e.startsWith(`'`)?e.slice(1,-2).replaceAll(`''`,`'`):e.slice(0,-1);function Lw(e){if(!Pw(e))return[];let t=[];for(let n of Nw(e)){if(n.kind!==`ref`)continue;let e=n.text.lastIndexOf(`!`),r=Fw(n.text.slice(e+1));r&&t.push({start:n.start,end:n.end,text:n.text,...e<0?{}:{sheet:Iw(n.text.slice(0,e+1))},area:r})}return t}function Rw(e,t){if(!Pw(e))return;let n=Nw(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 zw(e,t,n){let r=e=>`${Vt(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:`${cr(t)}${o}`}var Bw=[[!1,!1],[!0,!0],[!1,!0],[!0,!1]];function Vw(e,t){let n=Nw(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=Bw[(Bw.findIndex(([e,t])=>o[1]===`$`===e&&o[3]===`$`===t)+1)%Bw.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 Hw(e,t){if(!Pw(e))return;let n=Nw(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 Uw(e,t=8){let n=[];for(let t of as.keys())t.startsWith(e)&&n.push(t);return n.sort((e,t)=>e.length-t.length||e.localeCompare(t)),n.slice(0,t)}function Ww(e,t){if(!Pw(e))return;let n=[],r;for(let i of Nw(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 Gw(e){if(!Pw(e))return e;let t=0,n=``,r=Nw(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+=as.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 Kw=`Carlito, Arial, sans-serif`,qw=[`Calibri`,`Arial`,`Courier New`,`Georgia`,`Tahoma`,`Times New Roman`,`Verdana`],Jw=[8,9,10,11,12,14,16,18,20,22,24,26,28,36,48,72];function Yw(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}, ${Kw}`}function Xw(e){let t=Number.parseInt(e.slice(1),16),n=t>>16,r=t>>8&255,i=t&255;return(Math.max(n,r,i)+Math.min(n,r,i))/510}function Zw(e){let t=Number.parseInt(e.slice(1),16),n=[t>>16,t>>8&255,t&255].map(e=>e/255),r=Math.max(...n),i=Math.min(...n),a=(r+i)/2,o=r-i,s=o===0?0:o/(1-Math.abs(2*a-1)),[c=0,l=0,u=0]=n,d=o===0?0:r===c?((l-u)/o+6)%6:r===l?(u-c)/o+2:(c-l)/o+4,f=1-a,p=(1-Math.abs(2*f-1))*s,m=p*(1-Math.abs(d%2-1)),h=f-p/2;return`#${([[p,m,0],[m,p,0],[0,p,m],[0,m,p],[m,0,p],[p,0,m]][Math.floor(d)%6]??[0,0,0]).map(e=>Math.round((e+h)*255).toString(16).padStart(2,`0`)).join(``).toUpperCase()}`}function Qw(e,t){let n=e=>{let t=Number.parseInt(e.slice(1),16),n=e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*n(t>>16)+.7152*n(t>>8&255)+.0722*n(t&255)},[r,i]=[n(e),n(t)].sort((e,t)=>t-e);return((r??0)+.05)/((i??0)+.05)}var $w=`#1E1E1E`;function eT(e){let t={...e},n=typeof e.fill==`string`?e.fill:void 0;if(n!==void 0&&Xw(n)>.55&&(t.fill=Zw(n)),e.border){let n={...e.border};for(let e of[`left`,`right`,`top`,`bottom`]){let t=n[e],r=t?.color;t&&r!==void 0&&Xw(r)>.55&&(n[e]={...t,color:Zw(r)})}t.border=n}if(e.color!==void 0){let n=typeof t.fill==`string`?t.fill:$w;Qw(e.color,n)<3&&delete t.color}return t}function tT(e,t,n,r={}){let i=e.tableAt(t,n);if(!i)return;let a=Tx(i);if(!a)return;let o=Ex(a,i,t,n,t===i.at.row?void 0:r.ordinal?.(i,t)??t-i.at.row-1);return r.dark===!0?eT(o):o}var nT=[{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 rT(e){if(e===void 0||e===`General`)return`general`;let t=nT.find(t=>t.code===e);if(t)return t.id;if(Zr(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 iT=[`#FFFFFF`,`#000000`,`#E7E6E6`,`#44546A`,`#4472C4`,`#ED7D31`,`#A5A5A5`,`#FFC000`,`#5B9BD5`,`#70AD47`],aT=[`#C00000`,`#FF0000`,`#FFC000`,`#FFFF00`,`#92D050`,`#00B050`,`#00B0F0`,`#0070C0`,`#002060`,`#7030A0`],oT=e=>e.startsWith(`'`)||e.startsWith(`=`)?e:`'${e}`,sT=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}},cT=7,lT=e=>46+Math.max(0,String(e).length-5)*cT;function uT(e,t){let n=new Map(t);for(let t of e.tables)for(let e of t.columns){let{width:r}=e.spec??{};r!==void 0&&n.set(t.at.col+e.index,r)}for(let[t,r]of Object.entries(e.spec.columns??{})){let e=Ht(t);e!==void 0&&(r.hidden===!0?n.set(e,0):r.width!==void 0&&n.set(e,r.width))}return n}function dT(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 fT=4,pT=class{rows;columns;rowCount;columnCount;freezeRow;freezeCol;edge=fT;width=0;height=0;scrollX=0;scrollY=0;constructor(e,t,n=new Set,r=new Map){this.rows=new sT(20,dT(e,t,n)),this.columns=new sT(64,uT(e,r)),this.freezeRow=e.freeze?.row??0,this.freezeCol=e.freeze?.col??0,this.rowCount=Math.min(zt,e.lastRow+1+100),this.columnCount=Math.min(Bt,e.columnsUsed+26)}get headWidth(){return lT(this.rowCount)}get contentWidth(){return this.headWidth+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=this.headWidth+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-this.headWidth,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<this.headWidth,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<=this.edge;return e-this.xOf(i)<=this.edge&&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<=this.edge;return t-this.yOf(a)<=this.edge&&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-this.headWidth,n=t<this.frozenWidth&&this.freezeCol>0;return this.columns.at(n?t:t+this.scrollX,Bt)}rowAt(e){let t=e-22,n=t<this.frozenHeight&&this.freezeRow>0;return this.rows.at(n?t:t+this.scrollY,zt)}rectOf(e){let t=this.xOf(e.left),n=this.yOf(e.top),r=this.xOf(Math.min(e.right,Bt-1)),i=this.yOf(Math.min(e.bottom,zt-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-this.headWidth);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)}}},mT=3,hT=15,gT=6,_T=20,vT={left:`left`,center:`center`,right:`right`,justify:`left`,distributed:`center`,centerContinuous:`center`,fill:`left`};function yT(e,t){return(e.align===void 0?void 0:vT[e.align])||(typeof t==`number`?`right`:typeof t==`boolean`||t instanceof M?`center`:`left`)}var bT=e=>{let{fill:t}=e;return typeof t==`string`?t:t?.color??t?.background};function xT(e){let t=Number.parseInt(e.slice(1),16);return .2126*(t>>16)+.7152*(t>>8&255)+.0722*(t&255)>140?`#000000`:`#FFFFFF`}function ST(e,t){let n=e.color??Xr(t,e.format);if(n!==void 0)return n;let r=bT(e);return r===void 0?void 0:xT(r)}function CT(e,t,n,r){let i=e.lookAt(t,n),a=e.tables.length>0?tT(e,t,n,r):void 0;if(!a)return i;let o=a.border&&i.border?{...a.border,...i.border}:i.border??a.border;return{...a,...i,...o?{border:o}:{}}}function wT(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}var TT=class e{withFiles=!1;canvas;g;cells=new Map;sheet;revision=-1;rules;font=``;shade={};dark=!1;ordinals=new Map;counted;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=yr(r,i),s=this.cells.get(o);if(s)return s;let c=a?.at(r,i),l=CT(t,r,i,this.shade),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 gr),h=this.withFiles?t.filesAt(r,i):void 0,g=h!==void 0&&typeof d==`string`?Cr(d,h):void 0,_=t.validations.length===0?void 0:t.validationAt(r,i),v=_?.spec.multiple===!0&&typeof d==`string`?Wo(d,_.spec):void 0,y={text:c?.bare===!0||g!==void 0||v!==void 0?``:Yr(d,u.format),font:Yw(u),color:ST(u,d),fill:bT(u),align:yT(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;if(t!==this.sheet||e.revision!==this.revision||e.dark!==this.dark||n.rows!==this.counted){this.cells=new Map,this.sheet=t,this.revision=e.revision,this.withFiles=Sx(t),this.dark=e.dark,this.counted=n.rows,this.ordinals=new Map;let r=n.rows;this.shade={dark:e.dark,ordinal:(e,t)=>{let n=this.ordinals.get(e);if(!n){let t=e.at.row+1,i=Math.max(t,e.area.bottom);n=new Int32Array(i-t+1);let a=0;for(let e=t;e<=i;e++)n[e-t]=a,r.sizeOf(e)>0&&(a+=1);this.ordinals.set(e,n)}return n[t-e.at.row-1]??t-e.at.row-1}}}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=n.headWidth+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,n.headWidth,u,n.frozenWidth,n.height-u),s&&c&&d(s,c,n.headWidth,22,n.frozenWidth,n.frozenHeight),s&&this.line(n.headWidth,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,values: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 e=t.first;e<=t.last;e++){let t=a.rows.sizeOf(e);if(t===0)continue;let o=a.yOf(e);for(let c=n.first;c<=n.last;c++){let n=a.columns.sizeOf(c);if(n===0)continue;let l=this.showOf(r,i,e,c);l.fill!==void 0&&(s.fillStyle=l.fill,s.fillRect(a.xOf(c),o,n,t)),l.bar&&this.bar(l.bar,a.xOf(c),o,n,t)}}let m=Math.max(0,n.first-_T);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(yr(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)}}}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-hT)/2,c=t+mT;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,hT,hT/2),o.fill(),o.fillStyle=e.color??a.hereInk,o.fillText(n,c+gT,s+hT/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+mT,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}=Ho(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,values: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,values: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.values.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||t===`General`)?Jr(e,e=>l.measureText(e).width<=u):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??=wT(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-mT-a:e.align===`center`?t+(r-a)/2:t+mT+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-mT-f:e.align===`center`?t+(r-f)/2:t+mT+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,a.headWidth,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),a.headWidth),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(Vt(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,a.headWidth,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,a.headWidth,t)),c.fillStyle=r?o.hereInk:o.headInk,c.fillText(String(e+1),a.headWidth/2,n+t/2);let i=Math.round(n+t)-.5;this.line(0,i,a.headWidth,i,o.headRule)};c.save(),c.beginPath(),c.rect(a.headWidth+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,a.headWidth,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,a.headWidth,22),c.fillStyle=o.headRule,c.beginPath(),c.moveTo(a.headWidth-4,18),c.lineTo(a.headWidth-14,18),c.lineTo(a.headWidth-4,8),c.fill(),this.line(0,21.5,a.width,21.5,o.headRule),this.line(a.headWidth-.5,0,a.headWidth-.5,a.height,o.headRule)}},ET=(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}};function DT(e,t){let{ui:n,s:r,files:i,book:a}=e,o=e=>{n.setSaid(e)},s=()=>{t.sink.current?.focus({preventScroll:!0})},c=e=>a.workbook.sheet(e)?.generated===!0&&(n.setAsking({kind:`locked`}),!0),l=(t,n,a=e.selection)=>{let s=i.edit(t,{...n===void 0?{}:{group:n},where:{sheet:e.name,selection:a}});return s===void 0?(o(void 0),!0):(o(ET(s,r)),!1)},u=e=>{n.setShownName(e),n.setChartOn(void 0),n.setChartPane(void 0),n.setSelectionState(t.selections.current.get(e)??{active:{row:0,col:0},anchor:{row:0,col:0},focus:{row:0,col:0}})};return{say:o,focusSink:s,lockedSheet:c,applyAny:l,apply:(t,n,r)=>!c(e.name)&&l(t,n,r),setSelection:(r,i=e.name)=>{t.selections.current.set(i,r),n.setSelectionState(r)},go:(r,i)=>{r!==e.name&&u(r),t.selections.current.set(r,i),n.setSelectionState(i),t.grid.current?.show(i.active)},showSheet:u,closeAsking:()=>{n.setAsking(void 0),requestAnimationFrame(()=>{s()})},nextGroup:e=>`${e}:${String(t.stepId.current+=1)}`,bookNow:()=>({file:a.file,rows:a.rows,workbook:a.workbook}),shownAreas:()=>e.areas.flatMap(t=>nw(t,e.filtered,e.sheet.lastRow)),long:(e,t,r)=>{t<2e4?r():(n.setBusy(e),requestAnimationFrame(()=>{requestAnimationFrame(()=>{try{r()}finally{n.setBusy(void 0)}})}))}}}var OT=e=>Math.round(e*3/4*100)/100,kT=e=>e*4/3,AT=e=>Math.round((e-5)/7*100)/100,jT=e=>Math.round(e*7+5);function MT(e,t,n,r){let i=()=>({from:e.area.top,to:Math.min(e.area.bottom,Math.max(e.sheet.lastRow,e.area.top))}),a=()=>({from:e.area.left,to:Math.min(e.area.right,Math.max(e.sheet.columnsUsed-1,e.area.left))}),o=(t,r)=>{let i=document.createElement(`canvas`).getContext(`2d`);if(!i)return;let{sheet:a}=e,o=0,[s,c]=a.span(t,0,Math.min(a.lastRow,5e3));for(let n=s;n<=c;n++){let r=CT(a,n,t);i.font=Yw(r),o=Math.max(o,i.measureText(Yr(e.values.value(a,n,t),r.format)).width)}n.apply(Wa(n.bookNow(),e.name,t,o===0?void 0:Math.ceil(o)+10),r)},s=(t,i)=>{let{area:a}=e;if(t===`sheet`){i?r.addNewSheet():n.apply(Za(n.bookNow(),e.name));return}let o=t===`rows`,s=o?a.top:a.left,c=o?a.bottom-a.top+1:a.right-a.left+1;o&&dw(a)||!o&&fw(a)||n.apply(eo(n.bookNow(),{op:i?o?`insert-rows`:`insert-columns`:o?`delete-rows`:`delete-columns`,sheet:e.name,at:s,count:c}))};return{insertBand:e=>{s(e,!0)},deleteBand:e=>{s(e,!1)},hide:t=>{let{from:r,to:o}=t===`rows`?i():a();n.apply(sS(n.bookNow(),e.name,t,r,o,!0))},unhide:t=>{let{from:r,to:o}=t===`rows`?i():a();n.apply(sS(n.bookNow(),e.name,t,Math.max(0,r-1),o+1,!1))},askSize:n=>{let r=t.grid.current?.view(),{row:i,col:a}=e.selection.active;e.ui.setAsking({kind:`size`,what:n,start:n===`row`?OT(r?.rows.sizeOf(i)??20):AT(r?.columns.sizeOf(a)??64)})},setSizes:(t,r)=>{let o=n.nextGroup(`size`);if(t===`row`){let{from:t,to:a}=i();for(let i=t;i<=a;i++)n.apply(Ga(n.bookNow(),e.name,i,kT(r)),o)}else{let{from:t,to:i}=a();for(let a=t;a<=i;a++)n.apply(Wa(n.bookNow(),e.name,a,jT(r)),o)}},fitRows:()=>{let t=n.nextGroup(`size`),{from:r,to:a}=i();for(let i=r;i<=a;i++)n.apply(Ga(n.bookNow(),e.name,i,void 0),t)},fitColumns:()=>{let e=n.nextGroup(`size`),{from:t,to:r}=a();for(let n=t;n<=r;n++)o(n,e)},fitColumn:o,resize:(t,r,i)=>{let a=n.bookNow();n.apply(t===`column`?Wa(a,e.name,r,Math.round(i)):Ga(a,e.name,r,Math.round(i)),`size:${t}:${String(r)}`)},fitBand:(t,r)=>{t===`row`?n.apply(Ga(n.bookNow(),e.name,r,void 0)):o(r)},freeze:t=>{let r=t===`panes`?e.selection.active:t===`topRow`?{row:1,col:0}:t===`firstColumn`?{row:0,col:1}:void 0;n.apply(oS(n.bookNow(),e.name,r))}}}var NT=`_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_)`,PT=`_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)`,FT=/"[^"]*"|\\.|_.|\*.|\[[^\]]*\]/gu;function IT(e){let t=e.replace(FT,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 LT(e,t){let n=IT(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 RT(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 zT(e){if(typeof e!=`number`)return 0;let t=yn(e),n=t.indexOf(`.`);return n<0?0:t.length-n-1}function BT(e,t,n){if(e===void 0||e===`General`){let e=Math.max(0,zT(n)+t);return e===0?`0`:`0.${`0`.repeat(e)}`}return Zr(e)||e===`@`?e:RT(e).map(e=>LT(e,t)).join(`;`)}var VT=[`m/d/yyyy`,`dddd, mmmm d, yyyy`,`yyyy-mm-dd`,`m/d/yy`,`d-mmm`,`d-mmm-yy`,`mmm-yy`,`mmmm d, yyyy`],HT=[`h:mm:ss AM/PM`,`h:mm AM/PM`,`h:mm:ss`,`h:mm`,`mm:ss`,`[h]:mm:ss`],UT=[`# ?/?`,`# ??/??`,`# ?/2`,`# ?/4`,`# ?/8`,`# ?/10`,`# ?/100`],WT=[`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`,`@`],GT=[`$`,`€`,`£`,`¥`,`₹`,``],KT=[`general`,`number`,`currency`,`accounting`,`date`,`time`,`percentage`,`fraction`,`scientific`,`text`,`custom`],qT=e=>e===0?``:`.${`0`.repeat(e)}`,JT=e=>e===``?``:/^[$€£¥]$/u.test(e)?e:`"${e}"`;function YT(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 XT(e){let t=qT(e.decimals);switch(e.category){case`general`:return;case`number`:return YT(`${e.thousands?`#,##0`:`0`}${t}`,e.negative);case`currency`:return YT(`${JT(e.symbol)}#,##0${t}`,e.negative);case`accounting`:{let n=JT(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 ZT=e=>{let[t=``]=RT(e),n=IT(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 QT(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(HT.includes(e))return{...t,category:`time`};if(VT.includes(e)||Zr(e))return{...t,category:/[hs]/iu.test(e)&&!/[dy]/iu.test(e)?`time`:`date`};if(UT.includes(e))return{...t,category:`fraction`};let n=ZT(e),[r=``]=RT(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)=>XT({...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`}}function $T(e,t,n,r){let{ui:i,book:a,s:o}=e,s=t=>{let r=n.nextGroup(`look`);for(let i of n.shownAreas())if(!n.apply(Ba(n.bookNow(),e.name,i,t),r))return},c=(t,r,a)=>{n.apply(WS(n.bookNow(),e.name,t,r,a),n.nextGroup(`drag`))&&(n.setSelection({active:{row:r.top,col:r.left},anchor:{row:r.top,col:r.left},focus:{row:r.bottom,col:r.right}}),i.setFilled({sheet:e.name,from:t,to:r,mode:a}))},l=t=>{let n=e.sheet.filesAt(t.row,t.col),r=e.values.value(e.sheet,t.row,t.col);return n!==void 0&&typeof r==`string`?Cr(r,n):[]},u=(t,r)=>{let i=e.sheet.filesAt(t.row,t.col);i!==void 0&&n.apply(Oa(n.bookNow(),e.name,[{...t,text:r.join(Sr(i))}]))};return{look:s,toggleLook:e=>{let t=r.activeLook()[e];s({[e]:t!==void 0&&t!==!1?void 0:!0})},numberFormat:e=>{s({format:e===`General`?void 0:e})},fill:t=>{let{area:r,sheet:i}=e,o=i.used,s={...r,bottom:dw(r)?Math.min(r.bottom,o?.bottom??r.top):r.bottom,right:fw(r)?Math.min(r.right,o?.right??r.left):r.right},c=QC(e.selection),l=t?Math.max(0,c?s.top-1:s.top):Math.max(0,c?s.left-1:s.left),u=n.nextGroup(`fill`),[d,f]=t?[s.left,s.right]:[s.top,s.bottom];for(let r=d;r<=f;r++){let o=t?{row:l,col:r}:{row:r,col:l},c=t?{top:l,bottom:s.bottom,left:r,right:r}:{top:r,bottom:r,left:l,right:s.right};n.apply(Na(n.bookNow(),e.name,o,c,no(a,i,o.row,o.col)),u)}},clear:()=>{let t=n.nextGroup(`clear`);for(let r of n.shownAreas())if(!n.apply(ja(n.bookNow(),e.name,r),t))return},fillOut:c,startFill:r=>{if(r.button!==0)return;r.preventDefault(),r.stopPropagation();let a=e.area,o=r.currentTarget;o.setPointerCapture(r.pointerId);let s,l=e=>{let n=t.grid.current?.under(e.clientX,e.clientY);n?.part===`cell`&&(s=tw(a,n),i.setFillTo(s))},u=()=>{o.removeEventListener(`pointermove`,l),o.removeEventListener(`pointerup`,u),o.removeEventListener(`pointercancel`,u),i.setFillTo(void 0),s&&c(a,s,`auto`),n.focusSink()};o.addEventListener(`pointermove`,l),o.addEventListener(`pointerup`,u),o.addEventListener(`pointercancel`,u)},fillDown:()=>{let t=JS(e.sheet,e.area);t!==void 0&&c(e.area,{...e.area,bottom:t},`auto`),n.focusSink()},refill:t=>{let r=i.filled;r&&(e.files.undoStep(),c(r.from,r.to,t),n.focusSink())},merge:(t,r=!1)=>{!r&&nS(e.sheet,e.area,t)?i.setAsking({kind:`merge`,how:t}):n.apply(rS(n.bookNow(),e.name,e.area,t))},unmerge:()=>{n.apply(aS(n.bookNow(),e.name,e.area))},borders:t=>{let r=n.nextGroup(`border`);for(let i of e.areas)if(!n.apply(eS(n.bookNow(),e.name,i,t),r))return},applyFormat:t=>{let r=n.nextGroup(`format`);if(Object.keys(t.look).length>0){for(let i of n.shownAreas())if(!n.apply(Ba(n.bookNow(),e.name,i,t.look),r))return}if(Object.keys(t.borders).length>0){for(let i of e.areas)if(!n.apply(tS(n.bookNow(),e.name,i,t.borders),r))return}t.merge===!0&&n.apply(rS(n.bookNow(),e.name,e.area,`cells`),r),t.merge===!1&&n.apply(aS(n.bookNow(),e.name,e.area),r)},decimals:t=>{let{row:n,col:r}=e.selection.active;s({format:BT(e.sheet.lookAt(n,r).format,t,e.values.value(e.sheet,n,r))})},rangesOf:()=>e.areas.map(Wt).join(` `),addRule:t=>{n.apply(pS(n.bookNow(),e.name,t))},clearRules:t=>{if(t){n.apply(gS(n.bookNow(),e.name,void 0));return}let r=n.nextGroup(`rules`);for(let t of e.areas)if(!n.apply(gS(n.bookNow(),e.name,t),r))return},setValidation:t=>{let r=n.nextGroup(`validation`);for(let i of e.areas)n.apply(_S(n.bookNow(),e.name,i,t),r)},filesAtPlace:l,writeFiles:u,addFiles:async(t,r)=>{if(!e.editable||n.lockedSheet(e.name))return;if(e.sheet.filesAt(t.row,t.col)===void 0){n.say(o.files.notColumn);return}let i=[];for(let t of r){let{path:n}=await e.host[`files/upload`]({dir:`${e.dir}/${Ce}`,name:t.name,data:await LC(t)});i.push(n.slice(e.dir.length+1))}u(t,[...l(t),...i])},overwrite:()=>{let e=i.offer;e&&(n.apply(ka(n.bookNow(),e.sheet,e.row,e.col,e.text)),i.setOffer(void 0),n.focusSink())}}}function eE(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 tE(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),...li(t.spec)}}var nE=[{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}],rE=40;function iE(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(rE,e.width+t.x*n),a=Math.max(rE,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 aE(e){let{calc:t,sheet:n,chart:r,revision:i,width:a,height:o}=e,s=(0,A.useRef)(null),c=(0,A.useMemo)(()=>ci(t,n,r),[t,n,r,i]);return(0,A.useLayoutEffect)(()=>{s.current&&(s.current.innerHTML=hi({...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,j.jsx)(`div`,{ref:s,className:`sheet-chart-picture`})}function oE(e){let{chart:t,selected:n}=e,[r,i]=(0,A.useState)(),a=(0,A.useRef)(void 0),[,o]=(0,A.useState)(!1);(0,A.useEffect)(()=>{let e=requestAnimationFrame(()=>{o(!0)});return()=>{cancelAnimationFrame(e)}},[]);let s=e.view(),c=r??(s?tE(s,t):void 0);if(!c)return null;let l=li(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:tE(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(iE(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(iE(n.from,n.handle,r,o),n.handle!==void 0),i(void 0)};return(0,j.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,onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),e.onOpen()},onContextMenu:t=>{t.preventDefault(),t.stopPropagation(),e.onMenu(t.clientX,t.clientY)},children:[(0,j.jsx)(aE,{calc:e.calc,sheet:e.sheet,chart:t,revision:e.revision,width:r?.width??l.width,height:r?.height??l.height}),n?nE.map(e=>(0,j.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 sE=[{id:`columnBar`,icon:Oe,groups:[{head:`column2d`,types:[`column-clustered`,`column-stacked`,`column-stacked-100`]},{head:`bar2d`,types:[`bar-clustered`,`bar-stacked`,`bar-stacked-100`]}]},{id:`lineArea`,icon:gt,groups:[{head:`line2d`,types:[`line`,`line-markers`]},{head:`area2d`,types:[`area`,`area-stacked`,`area-stacked-100`]}]},{id:`pieDoughnut`,icon:_t,groups:[{head:`pie2d`,types:[`pie`]},{head:`doughnut`,types:[`doughnut`]}]},{id:`scatter`,icon:vt,groups:[{head:`scatter`,types:[`scatter`,`scatter-lines`,`scatter-smooth`]}]}];function cE(e){let t=jC();return e.groups.map((n,r)=>(0,j.jsxs)(`div`,{children:[r>0?(0,j.jsx)(p,{}):null,(0,j.jsx)(g,{className:`text-xs`,children:t.chart.groups[n.head]}),n.types.map(n=>(0,j.jsx)(b,{"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 lE(e){let t=jC(),n=t=>{t.preventDefault(),e.onDone()};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{className:`sheet-chart-buttons`,children:sE.map(({id:r,icon:i,groups:a})=>(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsx)(k,{icon:!0,"aria-label":t.chart.buttons[r],title:t.chart.buttons[r],disabled:e.disabled,"data-testid":`sheet-chart-insert-${r}`,children:(0,j.jsx)(i,{})})}),(0,j.jsx)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:n,children:(0,j.jsx)(cE,{groups:a,onPick:e.onInsert})})]},r))}),(0,j.jsx)(`span`,{className:`sheet-chart-button`,children:(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{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,j.jsx)(Oe,{}),(0,j.jsx)(re,{})]})}),(0,j.jsx)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:n,children:sE.map(({id:n,icon:r,groups:i})=>(0,j.jsxs)(o,{children:[(0,j.jsxs)(w,{"data-testid":`sheet-chart-insert-one-${n}`,children:[(0,j.jsx)(r,{}),t.chart.buttons[n]]}),(0,j.jsx)(C,{className:`text-xs`,children:(0,j.jsx)(cE,{groups:i,onPick:e.onInsert})})]},n))})]})})]})}var uE=[`right`,`top`,`left`,`bottom`];function dE(e){let t=jC(),{spec:n}=e.chart,r=Si(e.calc,e.sheet,e.chart)??``,[i,a]=(0,A.useState)(!1),[o,s]=(0,A.useState)(r),[c,u]=(0,A.useState)(!1),[f,h]=(0,A.useState)(n.title??``),[g,_]=(0,A.useState)(n.title);return g!==n.title&&(_(n.title),h(n.title??``)),(0,j.jsxs)(ce,{testid:`sheet-chart-design`,"aria-label":t.chart.design,children:[(0,j.jsx)(le,{id:`chart`,keep:!0,children:(0,j.jsx)(`span`,{className:`sheet-chart-design-tab`,children:t.chart.design})}),(0,j.jsxs)(le,{id:`chart-data`,priority:3,children:[(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{disabled:e.disabled,"data-testid":`sheet-chart-change-type`,children:[(0,j.jsx)(Nt,{}),(0,j.jsx)(`span`,{className:de,children:t.chart.changeType})]})}),(0,j.jsx)(d,{align:`start`,className:`max-h-96 overflow-y-auto text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:sE.map((t,r)=>(0,j.jsxs)(`div`,{children:[r>0?(0,j.jsx)(p,{}):null,(0,j.jsx)(cE,{groups:t.groups,on:n.type,onPick:e.onType})]},t.id))})]}),(0,j.jsxs)(ae,{open:i,onOpenChange:e=>{a(e),e&&(s(r),u(!1))},children:[(0,j.jsx)(se,{asChild:!0,children:(0,j.jsxs)(k,{disabled:e.disabled,"data-testid":`sheet-chart-select-data`,children:[(0,j.jsx)(yt,{}),(0,j.jsx)(`span`,{className:de,children:t.chart.selectData})]})}),(0,j.jsx)(he,{align:`start`,className:`sheet-chart-data`,children:(0,j.jsxs)(`form`,{onSubmit:t=>{t.preventDefault(),e.onData(o)?(a(!1),e.onDone()):u(!0)},children:[(0,j.jsxs)(`label`,{children:[(0,j.jsx)(`span`,{children:t.chart.dataRange}),(0,j.jsx)(ht,{value:o,"aria-invalid":c,"data-testid":`sheet-chart-data-range`,spellCheck:!1,onChange:e=>{s(e.target.value),u(!1)}})]}),c?(0,j.jsx)(`p`,{role:`alert`,children:t.chart.noData}):null,(0,j.jsx)(te,{type:`submit`,size:`sm`,"data-testid":`sheet-chart-data-ok`,children:t.dialog.ok})]})})]})]}),(0,j.jsx)(le,{id:`chart-title`,priority:1,children:(0,j.jsxs)(`label`,{className:`sheet-chart-title`,children:[(0,j.jsx)(Et,{"aria-hidden":!0}),(0,j.jsx)(`input`,{"aria-label":t.chart.title,placeholder:t.chart.title,value:f,disabled:e.disabled,"data-testid":`sheet-chart-title`,onChange:e=>{h(e.target.value)},onKeyDown:t=>{t.stopPropagation(),t.key===`Enter`?(t.preventDefault(),t.currentTarget.blur(),e.onDone()):t.key===`Escape`&&(h(n.title??``),e.onDone())},onBlur:()=>{let t=f.trim();t!==(n.title??``)&&e.onTitle(t===``?void 0:t)}})]})}),(0,j.jsx)(le,{id:`chart-legend`,priority:2,children:(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{disabled:e.disabled,"data-testid":`sheet-chart-legend`,children:[(0,j.jsx)(Ot,{}),(0,j.jsx)(`span`,{className:de,children:t.chart.legend})]})}),(0,j.jsxs)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[(0,j.jsx)(b,{"data-testid":`sheet-chart-legend-none`,"data-on":n.legend===void 0?``:void 0,onSelect:()=>{e.onLegend(void 0)},children:t.chart.legendNone}),uE.map(r=>(0,j.jsx)(b,{"data-testid":`sheet-chart-legend-${r}`,"data-on":n.legend===r?``:void 0,onSelect:()=>{e.onLegend(r)},children:t.chart.legendAt[r]},r))]})]})})]})}function fE(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}}function pE(e,t,n){let{ui:r,s:i,book:a}=e,o=()=>r.chartOn===void 0?void 0:e.sheet.charts.find(e=>e.index===r.chartOn),s=(t,r)=>n.apply(yS(n.bookNow(),e.name,t,r)),c=t=>{r.setChartOn(void 0),r.setChartPane(void 0),n.apply(bS(n.bookNow(),e.name,t))};return{shownChart:o,patchChart:s,removeChart:c,selectChart:e=>{r.setChartOn(e),e===void 0&&r.setChartPane(void 0)},placeChart:(e,n,r)=>{let i=t.grid.current?.view();if(!i)return;let{row:a,col:o,x:c,y:l}=eE(i,n.left,n.top);s(e,{at:Ut({row:a,col:o}),x:c>0?c:void 0,y:l>0?l:void 0,...r?{width:Math.round(n.width),height:Math.round(n.height)}:{}})},insertChart:t=>{let{sheet:o}=e,s=QC(e.selection)?is(o,e.selection.active):e.area,c=s&&bi(a.calc,o,o,s,t);if(!s||!c){n.say(i.chart.noData);return}let l=fE(o,s.right,s.top),u=o.charts.length;n.apply(vS(n.bookNow(),e.name,{...c,at:Ut(l),title:c.title??i.chart.title}))&&r.setChartOn(u)},chartData:(t,n)=>{let r=Ci(a.calc,e.sheet,n.trim()),i=r&&bi(a.calc,r.sheet,e.sheet,r.area,t.spec.type);return i?s(t.index,{categories:i.categories,series:i.series}):!1},copyChart:(e,n)=>{let a=e.spec.title??i.chart.name(e.index+1);return t.chartCopied.current={spec:e.spec,text:a,cut:n},r.setChartHeld(!0),n&&c(e.index),a},pasteChart:()=>{let i=t.chartCopied.current;if(!i)return;let a=o()?.at,s=a?{row:a.row+2,col:a.col+2}:{...e.selection.active},c=e.sheet.charts.length,l={...i.spec,at:Ut(s)};delete l.x,delete l.y,n.apply(vS(n.bookNow(),e.name,l))&&r.setChartOn(c)}}}var mE={"&":`&`,"<":`<`,">":`>`,'"':`"`},hE=e=>e.replace(/[&<>"]/gu,e=>mE[e]??e);function gE(e){let t=``;for(let n of e)/[\p{L}\p{N}]/u.test(n)?t+=n:t+=n===`"`?`\\000022`:`\\${n}`;return`"${t}"`}var _E=e=>{if(e&&e.style!==`none`)return`${e.style===`thick`?`3px`:e.style.startsWith(`medium`)?`2px`:`1px`} ${e.style===`double`?`double`:/dot/iu.test(e.style)?`dotted`:/dash/iu.test(e.style)?`dashed`:`solid`} ${e.color??`#000000`}`};function vE(e){let t=[];e.bold===!0&&t.push(`font-weight:700`),e.italic===!0&&t.push(`font-style:italic`);let n=[e.underline!==void 0&&e.underline!==!1?`underline`:``,e.strike===!0?`line-through`:``].filter(e=>e!==``);n.length>0&&t.push(`text-decoration:${n.join(` `)}`),e.font!==void 0&&t.push(`font-family:"${e.font}"`),e.size!==void 0&&t.push(`font-size:${String(e.size)}pt`),e.color!==void 0&&t.push(`color:${e.color}`);let r=typeof e.fill==`string`?e.fill:e.fill?.color??e.fill?.background;r!==void 0&&t.push(`background:${r}`),(e.align===`left`||e.align===`center`||e.align===`right`)&&t.push(`text-align:${e.align}`),e.valign!==void 0&&t.push(`vertical-align:${e.valign===`center`?`middle`:e.valign}`),e.wrap===!0&&t.push(`white-space:normal`);for(let n of[`top`,`right`,`bottom`,`left`]){let r=_E(e.border?.[n]);r!==void 0&&t.push(`border-${n}:${r}`)}return e.format!==void 0&&t.push(`mso-number-format:${gE(e.format)}`),t.join(`;`)}function yE(e,t){let n=e.map(e=>`<tr>${e.map(e=>{let t=vE(e.look);return`<td${[t===``?``:` style="${hE(t)}"`,e.number===void 0?``:` x:num="${String(e.number)}"`,e.input===``?``:` data-allyhub-input="${hE(e.input)}"`].join(``)}>${hE(e.text).replaceAll(`
|
|
32
|
+
`,`<br>`)}</td>`}).join(``)}</tr>`).join(``);return`<meta charset="utf-8"><table data-allyhub-origin="${Ut(t)}" xmlns:x="urn:schemas-microsoft-com:office:excel">${n}</table>`}var bE=e=>tn(e.map(e=>e.map(e=>e.text))),xE={amp:`&`,lt:`<`,gt:`>`,quot:`"`,apos:`'`,nbsp:` `};function SE(e){return e.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);?/giu,(e,t)=>t.startsWith(`#x`)||t.startsWith(`#X`)?String.fromCodePoint(Number.parseInt(t.slice(2),16)):t.startsWith(`#`)?String.fromCodePoint(Number(t.slice(1))):xE[t.toLowerCase()]??e)}function CE(e){let t=/^<\s*(\/)?\s*([a-zA-Z][\w:-]*)([\s\S]*?)\/?\s*>$/u.exec(e);if(!t)return;let n=new Map,r=t[3]??``;for(let e of r.matchAll(/([^\s=/>]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s>]+)))?/gu))n.set((e[1]??``).toLowerCase(),SE(e[2]??e[3]??e[4]??``));return{name:(t[2]??``).toLowerCase(),close:t[1]===`/`,attrs:n}}function wE(e){return e.replace(/\\([0-9a-fA-F]{1,6}\s?|[\s\S])/gu,(e,t)=>/^[0-9a-fA-F]{1,6}\s?$/u.exec(t)?String.fromCodePoint(Number.parseInt(t.trim(),16)):t)}function TE(e){let t=new Map;for(let n of e.matchAll(/([\w-]+)\s*:\s*((?:"(?:[^"\\]|\\[\s\S])*"|'(?:[^'\\]|\\[\s\S])*'|[^;"'])*)/gu))t.set((n[1]??``).toLowerCase(),(n[2]??``).trim());return t}function EE(e){let t=new Map,n=e.replace(/\/\*[\s\S]*?\*\//gu,``).replace(/<!--|-->/gu,``);for(let e of n.matchAll(/([^{}]+)\{([^}]*)\}/gu)){let n=TE(e[2]??``);for(let r of(e[1]??``).split(`,`)){let e=r.trim().toLowerCase();if(!/^(?:td|th|\.[\w-]+|td\.[\w-]+)$/u.test(e))continue;let i=e.startsWith(`td.`)?e.slice(2):e;t.set(i,new Map([...t.get(i)??[],...n]))}}return t}var DE={general:void 0,"general number":void 0,fixed:`0.00`,standard:`#,##0.00`,percent:`0.00%`,scientific:`0.00E+00`,"short date":`m/d/yyyy`,"medium date":`d-mmm-yy`,"long date":`dddd, mmmm d, yyyy`,"short time":`h:mm`,"medium time":`h:mm AM/PM`,"long time":`h:mm:ss AM/PM`,"@":`@`};function OE(e){let t=e.trim();(/^".*"$/su.test(t)||/^'.*'$/su.test(t))&&(t=t.slice(1,-1));let n=wE(t),r=n.toLowerCase();return r in DE?DE[r]:n===``?void 0:n}var kE={black:`#000000`,white:`#FFFFFF`,red:`#FF0000`,green:`#008000`,blue:`#0000FF`,yellow:`#FFFF00`,gray:`#808080`,grey:`#808080`,silver:`#C0C0C0`,maroon:`#800000`,navy:`#000080`,purple:`#800080`,orange:`#FFA500`,teal:`#008080`,olive:`#808000`,lime:`#00FF00`,aqua:`#00FFFF`,fuchsia:`#FF00FF`};function AE(e){let t=e.trim().toLowerCase();if(t===``||t===`transparent`||t===`windowtext`||t===`auto`||t===`inherit`)return;let n=kE[t];if(n)return n;let r=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/u.exec(t);if(r)return`#${r[1]??``}${r[1]??``}${r[2]??``}${r[2]??``}${r[3]??``}${r[3]??``}`.toUpperCase();if(/^#[0-9a-f]{6}$/u.test(t))return t.toUpperCase();let i=/^rgba?\(\s*(\d+)[\s,]+(\d+)[\s,]+(\d+)(?:[\s,/]+([\d.]+))?\s*\)$/u.exec(t);if(i)return i[4]!==void 0&&Number(i[4])===0?void 0:`#${[i[1],i[2],i[3]].map(e=>Math.min(255,Number(e)).toString(16).padStart(2,`0`)).join(``)}`.toUpperCase()}var jE=e=>{let t=/^([\d.]+)\s*(pt|px|em)?$/u.exec(e.trim());if(!t)return;let n=Number(t[1]);return t[2]===`px`?Math.round(n*.75*2)/2:t[2]===`em`?Math.round(n*11*2)/2:n};function ME(e){if(e===void 0)return;let t=e.toLowerCase();if(t===`none`||t.includes(`none`)||t.trim()===``)return;let n=/([\d.]+)\s*(pt|px)/u.exec(t),r=n?n[2]===`pt`?Number(n[1])*(4/3):Number(n[1]):1,i=t.includes(`double`)?`double`:t.includes(`dotted`)?`dotted`:t.includes(`dashed`)?`dashed`:r>=2.5?`thick`:r>=1.5?`medium`:`thin`,a=/(#[0-9a-f]{3,6}|rgba?\([^)]*\)|\b[a-z]+\b)\s*$/u.exec(t.trim()),o=a?AE(a[1]??``):void 0;return o===void 0||o===`#000000`?{style:i}:{style:i,color:o}}function NE(e){let t={},n=e.get(`font-weight`);n!==void 0&&(n.includes(`bold`)||Number(n)>=600)&&(t.bold=!0),e.get(`font-style`)?.includes(`italic`)===!0&&(t.italic=!0);let r=`${e.get(`text-decoration`)??``} ${e.get(`text-decoration-line`)??``}`;r.includes(`underline`)&&(t.underline=!0),r.includes(`line-through`)&&(t.strike=!0);let i=e.get(`font-family`);if(i!==void 0){let e=i.split(`,`)[0]?.trim().replace(/^["']|["']$/gu,``);e&&(t.font=e)}let a=e.get(`font-size`),o=a===void 0?void 0:jE(a);o!==void 0&&o>0&&(t.size=o);let s=AE(e.get(`color`)??``);s!==void 0&&s!==`#000000`&&(t.color=s);let c=e.get(`background-color`)??e.get(`background`),l=c===void 0?void 0:AE(c.split(/\s+/u)[0]??``);l!==void 0&&l!==`#FFFFFF`&&(t.fill=l);let u=e.get(`text-align`);(u===`left`||u===`center`||u===`right`)&&(t.align=u);let d=e.get(`vertical-align`);(d===`top`||d===`bottom`)&&(t.valign=d),d===`middle`&&(t.valign=`center`);let f=e.get(`white-space`);(f===`normal`||f===`pre-wrap`)&&(t.wrap=!0);let p={},m=e.get(`border`);for(let t of[`top`,`right`,`bottom`,`left`]){let n=ME(e.get(`border-${t}`)??m);n&&(p[t]=n)}Object.keys(p).length>0&&(t.border=p);let h=e.get(`mso-number-format`);if(h!==void 0){let e=OE(h);e!==void 0&&(t.format=e)}return t}function PE(e,t){return e.replace(/(?<![\w$.])R(\[-?\d+\]|\d+)?C(\[-?\d+\]|\d+)?(?![\w(])/gu,(e,n,r)=>{let i=(e,t)=>e===void 0?{n:t,abs:!1}:e.startsWith(`[`)?{n:t+Number(e.slice(1,-1)),abs:!1}:{n:Number(e)-1,abs:!0},a=i(n,t.row),o=i(r,t.col);return a.n<0||o.n<0?e:`${o.abs?`$`:``}${Vt(o.n)}${a.abs?`$`:``}${String(a.n+1)}`})}function FE(e){let t=new Map,n=[],r=new Map,i,a=!1,o=0,s,c,l=!1,u=``,d=()=>{if(!c||!s)return;let e=new Map(t.get(c.tag)??[]);for(let n of(c.attrs.get(`class`)??``).split(/\s+/u))if(n!==``)for(let[r,i]of t.get(`.${n.toLowerCase()}`)??[])e.set(r,i);for(let[t,n]of TE(c.attrs.get(`style`)??``))e.set(t,n);let i=SE(c.text).replace(/[ \t\r\n]+/gu,` `).replace(/\uE000/gu,`
|
|
33
|
+
`).replace(/ ?\n ?/gu,`
|
|
34
|
+
`).trim(),a=NE(e),o=i,l,u=c.attrs.get(`data-allyhub-input`),d=c.attrs.get(`data-sheets-formula`),f=c.attrs.get(`x:num`),p=c.attrs.get(`data-sheets-value`);if(u!==void 0)o=u;else if(d?.startsWith(`=`)===!0)l=d;else if(f&&Number.isFinite(Number(f)))o=f;else if(p!==void 0)try{let e=JSON.parse(p);e[1]===3&&typeof e[3]==`number`?o=String(e[3]):e[1]===4&&typeof e[4]==`number`&&(o=e[4]===1?`TRUE`:`FALSE`)}catch{}let m=Math.max(1,Number(c.attrs.get(`colspan`)??`1`)||1),h=Math.max(1,Number(c.attrs.get(`rowspan`)??`1`)||1);(()=>{for(;r.get(n.length)?.has(s?.length??0)===!0;)s?.push({text:``,input:``,look:{}})})();let g=s.length;s.push(l===void 0?{text:i,input:o,look:a}:{text:i,input:o,r1c1:l,look:a});for(let e=1;e<m;e++)s.push({text:``,input:``,look:{}});for(let e=1;e<h;e++){let t=r.get(n.length+e)??new Set;for(let e=0;e<m;e++)t.add(g+e);r.set(n.length+e,t)}c=void 0},f=()=>{if(d(),s){for(;r.get(n.length)?.has(s.length)===!0;)s.push({text:``,input:``,look:{}});n.push(s)}s=void 0};for(let n of e.matchAll(/<!--[\s\S]*?-->|<[^>]*>|[^<]+/gu)){let e=n[0];if(e.startsWith(`<!--`)){l&&(u+=e.slice(4,-3));continue}if(!e.startsWith(`<`)){l?u+=e:c&&(c.text+=e);continue}let r=CE(e);if(r){if(r.name===`style`){if(r.close){for(let[e,n]of EE(u))t.set(e,n);u=``}l=!r.close}else if(!l){if(r.name===`table`&&!r.close){if(o+=1,o>1)break;let e=r.attrs.get(`data-allyhub-origin`);e!==void 0&&(i=Gt(e),a=!0)}else if(r.name===`table`&&r.close){f();break}else r.name===`tr`?r.close?f():(f(),s=[]):r.name===`td`||r.name===`th`?r.close?d():(d(),s??=[],c={attrs:r.attrs,text:``,tag:r.name}):(r.name===`br`&&c||(r.name===`p`||r.name===`div`)&&r.close&&c)&&(c.text+=``)}}}if(f(),!(n.length===0||n.every(e=>e.length===0)))return{rows:n,origin:i,own:a}}var IE=/^(\d{1,2})[/-](\d{1,2})[/-](\d{4})$/u,LE=/^(\d{4})[/-](\d{1,2})[/-](\d{1,2})$/u,RE=e=>e.padStart(2,`0`);function zE(e){let t=e.trim(),n=IE.exec(t);if(n){let e=`${n[3]??``}-${RE(n[1]??``)}-${RE(n[2]??``)}`;if(En(e).format!==void 0)return e}let r=LE.exec(t);if(r){let e=`${r[1]??``}-${RE(r[2]??``)}-${RE(r[3]??``)}`;if(En(e).format!==void 0)return e}return e}function BE(e){return`${String(e.getFullYear())}-${RE(String(e.getMonth()+1))}-${RE(String(e.getDate()))}`}function VE(e){return{sheet:e.sheet,at:e.at,area:e.area,text:e.text,caret:Math.min(Math.max(0,e.caret??e.text.length),e.text.length),surface:e.surface??`cell`,mode:e.mode}}var HE=e=>({...e,pick:void 0}),UE=e=>({...e,mode:e.mode===`edit`?`enter`:`edit`});function WE(e,t,n){let r=`${e.text.slice(0,t)}\n${e.text.slice(n)}`;return{...HE(e),text:r,caret:t+1}}function GE(e,t){let n=Vw(e.text,t);return n?{...e,text:n.text,caret:n.caret}:void 0}function KE(e,t,n){let r=Hw(e.text,t);if(!r)return;let i=`${n}(`,a=e.text.slice(0,r.start)+i+e.text.slice(r.end);return{...e,text:a,caret:r.start+i.length}}function qE(e,t,n,r,i){let a=e.pick??Rw(e.text,t);if(!a)return;let o=zw({top:Math.min(n.row,r.row),bottom:Math.max(n.row,r.row),left:Math.min(n.col,r.col),right:Math.max(n.col,r.col)},i,e.sheet),s=e.text.slice(0,a.start)+o+e.text.slice(a.end),c=a.start+o.length;return{...e,text:s,caret:c,pick:{start:a.start,end:c,from:n,to:r,sheet:i}}}var JE=(e,t)=>e.pick!==void 0||Rw(e.text,t)!==void 0;function YE(e,t,n,r,i){if(e.mode===`edit`)return{kind:`text`};let a=e.pick??Rw(e.text,t);if(!a)return{kind:`leave`};let o=e.pick?.from??e.at,s=e.pick?.to??e.at,c={row:Math.max(0,s.row+n.row),col:Math.max(0,s.col+n.col)},l=qE({...e,pick:{...a,from:o,to:c,sheet:i}},t,r?o:c,c,i);return l?{kind:`pick`,editing:l,to:c}:{kind:`leave`}}function XE(e,t){let n;if(Pw(e)&&e.length>1){n=Gw(e);let t=ar(n);if(!t.ok)return{ok:!1,text:n,at:t.error.at}}else n=zE(e);return{ok:!0,text:t===`@`&&n!==``?oT(n):n}}function ZE(e,t,n){if(!n)return[{row:e.at.row,col:e.at.col,text:t}];let r=[];for(let n=e.area.top;n<=e.area.bottom;n++)for(let i=e.area.left;i<=e.area.right;i++)r.push({row:n,col:i,text:QE(t,n-e.at.row,i-e.at.col)});return r}function QE(e,t,n){if(En(e).formula===void 0||t===0&&n===0)return e;let r=ar(e);return r.ok?mr(Hn(r.node,t,n)):e}function $E(e,t){for(let n=e.file.sheets.length+1;;n++){let r=t.sheetName(n);if(!e.workbook.sheet(r))return r}}function eD(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:Lw(i)[0];return a?{sheet:a.sheet??n,area:a.area}:void 0}function tD(e,t,n){let r=Lw(`=${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 nD=e=>({active:{row:e.top,col:e.left},anchor:{row:e.top,col:e.left},focus:{row:e.bottom,col:e.right}}),rD=e=>typeof e==`object`&&e&&`sheet`in e?e:void 0;function iD(e,t,n){let{book:r,s:i,files:a,ui:o}=e,s=()=>r.file.sheets.filter(e=>e.hidden===!0).map(e=>e.name);return{undo:()=>{let e=rD(a.undoStep());e&&n.go(e.sheet,e.selection)},redo:()=>{let e=rD(a.redoStep());e&&n.go(e.sheet,e.selection)},sheetsHidden:s,hideSheet:t=>{if(!n.lockedSheet(t)&&n.applyAny(cS(n.bookNow(),t,!0))&&t===e.name){let e=r.file.sheets.find(e=>e.hidden!==!0)?.name;e!==void 0&&n.showSheet(e)}},unhideSheet:()=>{s().length>0&&o.setAsking({kind:`unhide`})},showHidden:e=>{n.applyAny(cS(n.bookNow(),e,!1)),n.showSheet(e)},addCopy:e=>{if(n.lockedSheet(e))return;let t=Ya(n.bookNow(),e);n.applyAny(Xa(n.bookNow(),e))&&n.showSheet(t)},addNewSheet:()=>{let t=$E(r,i);n.applyAny(Ja(n.bookNow(),t,e.name))&&n.showSheet(t)},renameSheet:(r,i)=>{if(!n.lockedSheet(r)&&n.applyAny(qa(n.bookNow(),r,i))){let n=t.selections.current.get(r);n&&t.selections.current.set(i,n),r===e.name&&o.setShownName(i)}},deleteSheet:e=>{n.lockedSheet(e)||n.applyAny(Za(n.bookNow(),e))},moveSheet:(e,t)=>{n.lockedSheet(e)||n.applyAny($a(n.bookNow(),e,t))},tabColor:(e,t)=>{n.lockedSheet(e)||n.applyAny(lS(n.bookNow(),e,t))},goTo:t=>{if(t===``){n.focusSink();return}let i=eD(r,t,e.name)??tD(r,t,e.name);i?(n.go(i.sheet,nD(i.area)),n.focusSink()):(n.apply(to(n.bookNow(),t,e.name,e.area)),n.focusSink())},askAgent:()=>{let t=`${`${e.name}!${Wt(e.area)}`} is on a sheet ${e.dir}/${nt} makes. `;n.closeAsking(),e.host[`agent/ask`]({text:t}).then(({delivered:e})=>{if(!e)throw Error(`no agent`)},()=>{navigator.clipboard.writeText(t).catch(()=>void 0),n.say(i.generated.copied)})},makeOrdinary:()=>{o.setAsking(void 0),a.makeOrdinary(e.name).then(e=>{e!==void 0&&n.say(ET(e,i)),n.focusSink()})}}}function aD(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 oD(e,t){let n=[];return t.forEach((t,r)=>{let i=0;for(let a=1;a<=t.length;a++){let o=t[i],s=t[a];a<t.length&&JSON.stringify(s)===JSON.stringify(o)||(o&&Object.keys(o).length>0&&n.push({area:{top:e.row+r,bottom:e.row+r,left:e.col+i,right:e.col+a-1},look:o}),i=a)}}),n}function sD(e,t,n,r){let{ui:i,s:a,book:o}=e,s=(t,n,r)=>{let i=Math.min(n.right,t.used?.right??0);return r.map(r=>{let a=[];for(let s=n.left;s<=i;s++){let n=CT(t,r,s),i=e.values.value(t,r,s);a.push({text:Yr(i,n.format),input:no(o,t,r,s),look:n,number:typeof i==`number`?i:void 0})}return a})},c=t=>{if(e.areas.length>1){n.say(a.menu.multiple);return}let r=aD(e.sheet,e.area,e.filtered),o=s(e.sheet,e.area,r),c=bE(o);return i.setCopied({sheet:e.name,area:e.area,rows:r,text:c,cut:t}),{text:c,html:yE(o,{row:e.area.top,col:e.area.left})}},l=e=>{let{clipboard:t}=navigator;e.html!==void 0&&typeof ClipboardItem<`u`?t.write([new ClipboardItem({"text/plain":new Blob([e.text],{type:`text/plain`}),"text/html":new Blob([e.html],{type:`text/html`})})]).catch(()=>t.writeText(e.text)).catch(()=>void 0):t.writeText(e.text).catch(()=>void 0)},u=(t,r,a,s)=>{let c=o.workbook.sheet(t.sheet);if(!c)return;if(t.cut&&a===`all`){n.apply(QS(n.bookNow(),t.sheet,t.area,e.name,r),s)&&(i.setCopied(void 0),n.setSelection(nD({top:r.row,left:r.col,bottom:r.row+t.area.bottom-t.area.top,right:r.col+t.area.right-t.area.left})));return}let l=t.area,u=Math.min(l.right,c.used?.right??l.left),p=t.rows.length,m=u-l.left+1,{across:h,down:g}=d(p,m),_=[],v=[];for(let n=0;n<g;n++)for(let i=0;i<h;i++)for(let s=0;s<p;s++)for(let u=0;u<m;u++){let d=r.row+n*p+s,f=r.col+i*m+u,h=t.rows[s]??l.top;v.push({from:{row:h,col:l.left+u},to:{row:d,col:f}}),a!==`formats`&&_.push({row:d,col:f,text:a===`values`?Dn(e.values.value(c,h,l.left+u)):QE(no(o,c,h,l.left+u),d-h,f-l.left-u)})}_.length>0&&n.apply(Oa(n.bookNow(),e.name,_),s),(a===`all`||a===`formats`)&&n.apply(qS(n.bookNow(),t.sheet,e.name,v),s),f(r,g*p,h*m)},d=(t,n)=>({across:QC(e.selection)?1:Math.max(1,Math.floor((e.area.right-e.area.left+1)/n)),down:QC(e.selection)?1:Math.max(1,Math.floor((e.area.bottom-e.area.top+1)/t))}),f=(e,t,r)=>{n.setSelection({active:e,anchor:e,focus:{row:e.row+t-1,col:e.col+r-1}})},p=(t,r,i,a,s)=>{let c=a?void 0:nn(s),l=a?a.rows.length:c?.length??0,u=a?a.rows.reduce((e,t)=>Math.max(e,t.length),0):(c??[]).reduce((e,t)=>Math.max(e,t.length),0);if(l===0||u===0)return;let{across:p,down:m}=d(l,u),h=a?.origin,g=(e,t,n,i)=>{if(!a)return zE(c?.[e]?.[t]??``);let o=a.rows[e]?.[t];return o?r===`values`?En(o.input).formula===void 0?zE(o.input):zE(o.text):o.r1c1===void 0?a.own&&h?QE(o.input,n-(h.row+e),i-(h.col+t)):En(o.input).formula===void 0?zE(o.input):o.input:PE(o.r1c1,{row:n,col:i}):``},_=[],v=[];for(let e=0;e<m;e++)for(let n=0;n<l;n++){let i=[];for(let o=0;o<p;o++)for(let s=0;s<u;s++){let c=t.row+e*l+n,d=t.col+o*u+s;i.push(a?.rows[n]?.[s]?.look),r!==`formats`&&_.push({row:c,col:d,text:g(n,s,c,d)})}v.push(i)}let y=a!==void 0&&(r===`all`||r===`formats`),b=_.every(t=>e.sheet.at(t.row,t.col)===void 0&&!e.sheet.tableAt(t.row,t.col)&&!e.sheet.blockAt(t.row,t.col)),x=_.every(e=>En(e.text).formula===void 0);if(_.length>=100&&b&&x&&!y&&m===1&&p===1){let r=[];for(let e=0;e<l;e++){let t=[];for(let n=0;n<u;n++)t.push(_[e*u+n]?.text??``);r.push(t)}let a=e.name.toLowerCase().replace(/[^\p{L}\p{N}]+/gu,`-`),s=`data/${a}-${Ut(t).toLowerCase()}.csv`;for(let e=2;o.rows.has(s);e++)s=`data/${a}-${Ut(t).toLowerCase()}-${String(e)}.csv`;n.apply(Pa(n.bookNow(),e.name,t,r,s),i)}else _.length>0&&n.apply(Oa(n.bookNow(),e.name,_),i);if(y){for(let r of oD(t,v))if(!n.apply(Ba(n.bookNow(),e.name,r.area,r.look),i))break}f(t,m*l,p*u)},m=(t,r=`all`)=>{let s=i.copied?.text===t.text?i.copied:void 0,c=n.nextGroup(`paste`),l=e.selection.active;if(s&&o.workbook.sheet(s.sheet)){u(s,l,r,c);return}let d=t.html===void 0?void 0:FE(t.html),f=d?d.rows.length*(d.rows[0]?.length??1):t.text.length/8;n.long(a.progress.pasting,f,()=>{p(l,r,c,d,t.text)})},h=async()=>{let{clipboard:e}=navigator;try{let t=await e.read(),n=``,r;for(let e of t)e.types.includes(`text/plain`)&&(n=await(await e.getType(`text/plain`)).text()),e.types.includes(`text/html`)&&(r=await(await e.getType(`text/html`)).text());return{text:n,html:r}}catch{return{text:await e.readText()}}};return{take:c,paste:m,clipCut:()=>{let e=c(!0);e&&l(e)},clipCopy:()=>{let e=c(!1);e&&l(e)},menuPaste:e=>{let t=i.copied;t?(m({text:t.text},e),n.focusSink()):h().then(t=>{(t.text!==``||t.html!==void 0)&&m(t,e),n.focusSink()},()=>{n.focusSink()})},onCopy:(e,n)=>{if(i.editing||e.target!==t.sink.current)return;e.preventDefault();let a=r.shownChart();if(a){e.clipboardData.setData(`text/plain`,r.copyChart(a,n));return}let o=c(n);o&&(e.clipboardData.setData(`text/plain`,o.text),o.html!==void 0&&e.clipboardData.setData(`text/html`,o.html))},onPaste:n=>{if(i.editing||!e.editable||n.target!==t.sink.current)return;n.preventDefault();let a=[...n.clipboardData.files],{row:o,col:s}=e.selection.active;if(a.length>0&&e.sheet.filesAt(o,s)!==void 0){r.addFiles(e.selection.active,a);return}let c=n.clipboardData.getData(`text/plain`),l=n.clipboardData.getData(`text/html`);(c!==``||l!==``)&&(t.chartCopied.current?.text===c?r.pasteChart():m({text:c,html:l===``?void 0:l}))},dropCells:(t,r,a,o=!1)=>{let s=(e,n)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;if(!o){let n=!1;for(let t=r.top;t<=r.bottom&&!n;t++)for(let i=r.left;i<=r.right&&!n;i++)n=(a||!s(t,i))&&e.sheet.at(t,i)!==void 0;if(n){i.setAsking({kind:`replace-data`,from:t,to:r,copy:a});return}}let c=n.nextGroup(`drop`),l={row:r.top,col:r.left};a?u({sheet:e.name,area:t,rows:aD(e.sheet,t,new Set),text:``,cut:!1},l,`all`,c):n.apply(QS(n.bookNow(),e.name,t,e.name,l),c)&&n.setSelection(nD(r))}}}function cD(e,t,n,r){let{ui:i,s:a,book:o}=e,s=()=>{let t=e.selection.active,n=e.sheet.filterAt(t.row,t.col);if(n)return{area:n.area,header:!0};if(!QC(e.selection))return{area:e.area,header:!1};let r=is(e.sheet,t);return r?{area:r,header:fo(e.sheet,o.calc,r)}:void 0},c=(t,r)=>{let i=t.header?{...t.area,top:t.area.top+1}:t.area,s=(Math.min(i.bottom,e.sheet.lastRow)-i.top+1)*(Math.min(i.right,e.sheet.columnsUsed-1)-i.left+1),c=e.name,l=e.filtered;n.long(a.progress.sorting,s,()=>{n.apply(lo(n.bookNow(),o.calc,c,i,r,l))})},l=(t,n)=>{(!e.ui.editing||r.commit())&&i.setFilterOpen({at:t,rect:n})},u=e=>{let n=t.grid.current?.pageRect({top:e.row,left:e.col,bottom:e.row,right:e.col});n&&i.setListOpen({at:e,rect:new DOMRect(n.x,n.bottom,n.width,0)})};return{sortTarget:s,sortBy:c,sort:t=>{let r=s();r?c(r,[{col:e.selection.active.col,descending:t}]):n.say(a.sortFilter.noData)},customSort:()=>{let e=s();e?i.setAsking({kind:`sort`,target:e}):n.say(a.sortFilter.noData)},filterByCell:()=>{let{row:t,col:r}=e.selection.active,i=Yr(e.values.value(e.sheet,t,r),e.sheet.lookAt(t,r).format),a=n.nextGroup(`filter`);if(!e.sheet.filterAt(t,r)&&!n.apply(uS(n.bookNow(),e.name,e.area),a))return;let s=o.workbook.sheet(e.name)?.filterAt(t,r);s&&n.apply(dS(n.bookNow(),e.name,s,r,i===``?{blanks:!0}:{values:[i]}),a)},filterToggle:()=>{n.apply(uS(n.bookNow(),e.name,e.area))},clearFilter:()=>{n.apply(fS(n.bookNow(),e.name))},openFilter:l,openList:u,openHere:()=>{let n=e.selection.active;if(e.sheet.filterHeadAt(n.row,n.col)){let e=t.grid.current?.pageRect({top:n.row,left:n.col,bottom:n.row,right:n.col});e&&l(n,e)}else e.sheet.validationAt(n.row,n.col)?.spec.type===`list`&&u(n)}}}function lD(e,t,n,r){let i=e.split(`
|
|
35
|
+
`)[0]??``,a=t(i),o=n-(r.align===`right`?r.left+r.width-r.pad-a:r.align===`center`?r.left+(r.width-a)/2:r.left+r.pad+(r.indent??0));if(o<=0)return 0;if(o>=a)return i.length;let s=0,c=i.length;for(;s<c;){let e=s+c+1>>1;t(i.slice(0,e))<=o?s=e:c=e-1}if(s>=i.length)return i.length;let l=t(i.slice(0,s)),u=t(i.slice(0,s+1));return o-l<u-o?s:s+1}var uD={ArrowDown:{row:1,col:0},ArrowUp:{row:-1,col:0},ArrowRight:{row:0,col:1},ArrowLeft:{row:0,col:-1}},dD=3;function fD(e,t,n,r){let{ui:i,book:a,s:o,files:s}=e,c=e=>e?.surface===`bar`?t.bar.current:t.sink.current,l=e=>c(e)?.selectionStart??e.caret,u=(e,n,r)=>{let i=c(e);t.sink.current&&(t.sink.current.value=n),i&&(i.value!==n&&(i.value=n),i.focus({preventScroll:!0}),i.setSelectionRange(r,r))},d=e=>{i.setEditing(e),u(e,e.text,e.caret)},f=()=>{i.setEditing(void 0),i.setGesture({kind:`idle`}),t.sink.current&&(t.sink.current.value=``),n.focusSink()},p=()=>{let t=i.editing?.sheet;f(),t!==void 0&&t!==e.name&&n.showSheet(t)},m=r=>{if(!e.editable)return;if(n.lockedSheet(e.name)){t.sink.current&&(t.sink.current.value=``);return}let a=r.at??e.selection.active,o=VE({sheet:e.name,at:a,area:r.at?{top:a.row,bottom:a.row,left:a.col,right:a.col}:XC(e.selection),text:r.text,surface:r.surface??`cell`,mode:r.mode,...r.caret===void 0?{}:{caret:r.caret}});i.setEditing(o),i.setChoice(0),i.setOffer(void 0);let s=t.sink.current;s&&s.value!==r.text&&(s.value=r.text),r.surface!==`bar`&&(s?.focus({preventScroll:!0}),s?.setSelectionRange(o.caret,o.caret)),t.grid.current?.show(a)},h=(t={})=>{let r=i.editing;if(!r)return!0;let l=a.workbook.sheet(r.sheet);if(!l)return!0;let u=l.lookAt(r.at.row,r.at.col),d=XE(r.text,u.format);if(!d.ok){i.setEditing({...r,text:d.text,problem:!0,caret:d.at}),n.say(o.formulaProblem);let e=c(r);return e&&(e.value=d.text,e.setSelectionRange(d.at,d.at),e.focus()),!1}let{text:p}=d,m=t.all!==!0&&p===no(a,l,r.at.row,r.at.col),h=l.validationAt(r.at.row,r.at.col);if(!m&&t.accepted!==!0&&h&&h.spec.error?.show!==!1&&p!==``&&!Pw(p)&&!Yo(a.calc,l,h,r.at.row,r.at.col,En(p).value))return i.setAsking({kind:`refused`,rule:h.spec,all:t.all===!0}),!1;if(!m){let e=n.nextGroup(`entry`),a=Oa(n.bookNow(),r.sheet,ZE(r,p,t.all===!0)),c=YC(r.at);if(a.refused!==void 0)return n.say(ET(a.refused,o)),!1;s.edit(a,{group:e,where:{sheet:r.sheet,selection:c}}),n.say(void 0),i.setOffer(a.offer),p.includes(`
|
|
36
|
+
`)&&!Pw(p)&&u.wrap!==!0&&s.edit(Ba(n.bookNow(),r.sheet,{top:r.at.row,bottom:r.at.row,left:r.at.col,right:r.at.col},{wrap:!0}),{group:e,where:{sheet:r.sheet,selection:c}})}return f(),r.sheet!==e.name&&n.showSheet(r.sheet),!0},g=r=>{let a=i.editing,o=a?t.selections.current.get(a.sheet)??e.selection:e.selection;if(!h())return;let s=r(o);n.setSelection(s,a?.sheet??e.name),t.grid.current?.show(s.active)};return{surfaceOf:c,begin:m,stop:f,cancel:p,commit:h,commitAnd:g,setText:u,pickRef:(t,n,r)=>{let i=qE(t,l(t),n,r,e.name);return i?(d(i),!0):!1},accept:(e,t)=>{let n=KE(e,l(e),t);n&&(i.setChoice(0),d(n))},openCell:(o,s)=>{if(!e.editable||i.editing)return;if(r.filesAtPlace(o).length>0){i.setAsking({kind:`file`,at:o});return}if(n.lockedSheet(e.name))return;let c=no(a,e.sheet,o.row,o.col),l=c.length,u=t.grid.current?.view(),d=document.createElement(`canvas`).getContext(`2d`);if(s&&u&&d){let t=CT(e.sheet,o.row,o.col);d.font=Yw(t);let n=e.sheet.mergeAt(o.row,o.col),r=u.rectOf(n??{top:o.row,left:o.col,bottom:o.row,right:o.col}),i=e.values.value(e.sheet,o.row,o.col),a=t.align===`center`||t.align===`right`||t.align===`left`?t.align:typeof i==`number`&&!Pw(c)?`right`:`left`;l=lD(c,e=>d.measureText(e).width,s.x,{left:r.x,width:r.width,pad:dD,align:Pw(c)?`left`:a,indent:(t.indent??0)*9})}m({text:c,mode:`edit`,at:o,caret:l})},editingKey:(n,a)=>{let o=n.meta||n.ctrl,s=r.completions();if(s.length>0){if(n.key===`ArrowDown`||n.key===`ArrowUp`){let e=n.key===`ArrowDown`?1:s.length-1;i.setChoice(t=>(t+e)%s.length),n.preventDefault();return}if(n.key===`Tab`){let e=s[i.choice%s.length];e!==void 0&&r.accept(a,e),n.preventDefault();return}}if(n.key===`Escape`){p(),n.preventDefault();return}if(n.key===`Enter`){if(n.preventDefault(),n.alt){let e=c(a);d(WE(a,e?.selectionStart??a.caret,e?.selectionEnd??a.caret));return}if(o){h({all:!0});return}g(e=>r.enterFrom(e,n.shift));return}if(n.key===`Tab`){n.preventDefault(),g(e=>r.tabFrom(e,n.shift));return}if(n.key===`F4`){let e=GE(a,l(a));e&&d(e),n.preventDefault();return}if(n.key===`F2`){i.setEditing(UE(a)),n.preventDefault();return}let u=uD[n.key];if(!u||o)return;let f=YE(a,l(a),u,n.shift,e.name);f.kind!==`text`&&(n.preventDefault(),f.kind===`pick`?(d(f.editing),t.grid.current?.show(f.to)):g(e=>ow(YC(e.active),u)))}}}var pD=e=>e.replace(/[.*+?^${}()|[\]\\]/gu,`\\$&`);function mD(e){if(e.what===``)return;let t=``;for(let n=0;n<e.what.length;n++){let r=e.what.charAt(n),i=e.what.charAt(n+1);r===`~`&&(i===`*`||i===`?`||i===`~`)?(t+=pD(i),n+=1):t+=r===`*`?`[\\s\\S]*?`:r===`?`?`[\\s\\S]`:pD(r)}return new RegExp(e.wholeCell?`^(?:${t})$`:t,`g${e.matchCase?``:`i`}u`)}function hD(e,t){t.lastIndex=0;let n=t.test(e);return t.lastIndex=0,n}function gD(e,t,n){t.lastIndex=0;let r=e.replace(t,()=>n);return t.lastIndex=0,r}function _D(e,t){let n=[];for(let r of e)hD(r.text,t)&&n.push(r);return n.sort((e,t)=>e.sheetIndex-t.sheetIndex||e.row-t.row||e.col-t.col),n}function vD(e,t,n=!1){if(e.length===0)return;let r=e=>[e.sheetIndex,e.row,e.col],i=e=>{let[n,i,a]=r(e),[o,s,c]=r(t);return n===o?i===s?a>c:i>s:n>o},a=e=>{let[n,i,a]=r(e),[o,s,c]=r(t);return n===o?i===s?a<c:i<s:n<o};if(n){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&a(n))return n}return e[e.length-1]}return e.find(i)??e[0]}function yD(e,t){let{ui:n,book:r}=e,i=t=>r.workbook.sheets.map((e,t)=>({sheet:e,index:t})).filter(({sheet:n})=>n.spec.hidden!==!0&&(t.within===`workbook`||n.name===e.name));function*a(t){for(let{sheet:n,index:a}of i(t)){let i=n.lastRow;for(let o=0;o<n.columnsUsed;o++){let[s,c]=n.span(o,0,i);for(let i=s;i<=c;i++){if(n.at(i,o)===void 0&&!n.spillAt(i,o))continue;let s=t.lookIn===`formulas`?no(r,n,i,o):Yr(e.values.value(n,i,o),n.lookAt(i,o).format);s!==``&&(yield{sheetIndex:a,sheet:n.name,row:i,col:o,text:s})}}}}let o=e=>{let t=mD(e);return t?_D(a(e),t):[]},s=()=>({sheetIndex:r.workbook.sheets.findIndex(t=>t.name===e.name),row:e.selection.active.row,col:e.selection.active.col}),c=e=>{t.go(e.sheet,YC({row:e.row,col:e.col}))},l=(e,t=!1)=>{let n=vD(o(e),s(),t);return n&&c(n),n};return{openFind:e=>{n.setFinding({replace:e})},closeFind:()=>{n.setFinding(void 0),requestAnimationFrame(()=>{t.focusSink()})},findAll:o,findNext:l,showFound:c,replaceOne:(n,i)=>{let a={...n,lookIn:`formulas`},o=mD(a);if(!o)return;let{row:s,col:c}=e.selection.active,u=no(r,e.sheet,s,c);if(u!==``&&hD(u,o)){let n=gD(u,o,i);n!==u&&t.apply(Oa(t.bookNow(),e.name,[{row:s,col:c,text:n}]))}return l(a)},replaceAll:(n,i)=>{let a={...n,lookIn:`formulas`},s=mD(a);if(!s)return{kind:`none`};let c=new Map;for(let e of o(a)){if(r.workbook.sheet(e.sheet)?.generated===!0)continue;let t=gD(e.text,s,i);if(t===e.text)continue;let n=c.get(e.sheet)??[];n.push({row:e.row,col:e.col,text:t}),c.set(e.sheet,n)}let l=0;for(let e of c.values())l+=e.length;if(l===0)return{kind:`none`};let u=t.nextGroup(`replace`);return t.long(e.s.progress.replacing,l,()=>{for(let[e,n]of c)if(!t.applyAny(Oa(t.bookNow(),e,n),u))return}),{kind:`replaced`,count:l}}}}function bD(e,t){let n=e.mergeAt(t.row,t.col);return n?{row:n.top,col:n.left}:t}function xD(e,t,n){let r=e.mergeAt(t.row,t.col),i=n.row>0?(r?.bottom??t.row)+n.row:n.row<0?(r?.top??t.row)+n.row:t.row,a=n.col>0?(r?.right??t.col)+n.col:n.col<0?(r?.left??t.col)+n.col:t.col,o=Math.min(zt-1,Math.max(0,i)),s=Math.min(Bt-1,Math.max(0,a));return bD(e,{row:e.nextRow(o,n.row<0?-1:1),col:e.nextCol(s,n.col<0?-1:1)})}var SD=(e,t,n)=>mw(e.holds,t,n,e.last);function CD(e,t,n,r){let i=r.shift?t.focus:t.active,a=r.mod?SD(e,i,n):xD(e,i,n);return r.shift?sw(t,a):ow(YC(a),{row:0,col:0})}function wD(e,t){let n=t.mod?{row:0,col:0}:{row:e.active.row,col:0};return t.shift?sw(e,n):YC(n)}function TD(e,t,n){let r={row:Math.max(e.last.row,0),col:Math.max(e.last.col,0)};return n.shift?sw(t,r):YC(r)}function ED(e,t,n,r){return QC(t)?r!==void 0&&!n?{selection:YC({row:t.active.row+1,col:r}),tabFrom:void 0}:{selection:YC(xD(e,t.active,{row:n?-1:1,col:0})),tabFrom:r}:{selection:pw(t,`row`,n),tabFrom:r}}function DD(e,t,n,r){return QC(t)?{selection:YC(xD(e,t.active,{row:0,col:n?-1:1})),tabFrom:r??t.active.col}:{selection:pw(t,`col`,n),tabFrom:r}}var OD={ArrowUp:[-1,0],ArrowDown:[1,0],ArrowLeft:[0,-1],ArrowRight:[0,1]};function kD(e,t,n,r){let{ui:i}=e,a=()=>{let{sheet:n}=e,r=t.grid.current?.view();return{holds:e=>n.at(e.row,e.col)!==void 0,last:{row:n.lastRow,col:n.columnsUsed-1},mergeAt:(e,t)=>n.mergeAt(e,t),nextRow:(e,t)=>r?.rows.nextShown(e,t,1048576)??e,nextCol:(e,t)=>r?.columns.nextShown(e,t,16384)??e}};return{shape:a,enterFrom:(e,n)=>{let r=ED(a(),e,n,t.tabFrom.current);return t.tabFrom.current=r.tabFrom,r.selection},tabFrom:(e,n)=>{let r=DD(a(),e,n,t.tabFrom.current);return t.tabFrom.current=r.tabFrom,r.selection},selectAll:()=>{n.setSelection(uw)},typeToday:()=>{r.begin({text:BE(new Date),mode:`enter`})},leaveHand:()=>{i.setFilled(void 0),i.setMenu(void 0)}}}function AD(e,t,n,r,i){let{ui:a}=e,o=r.shape,s=(e,r=e.focus)=>{n.setSelection(e),t.grid.current?.show(r)},c=e=>{jD(t,r,e)},l=a.editing;if(l){r.editingKey(i,l);return}let u={c:e,a:r},d=r.shownChart()?`chart`:`cells`,f=_w.forKey(i,d);if(f){(f.enabled?.(u)??!0)&&f.run(u),i.preventDefault();return}if(d===`chart`){c(i);return}let p=i.meta||i.ctrl;if(i.key===`ContextMenu`||i.shift&&i.key===`F10`){let n=t.grid.current?.pageRect(e.area);n&&a.setMenu({kind:`cell`,x:n.x,y:n.bottom}),i.preventDefault();return}let m=uD[i.key],h=t.grid.current?.pageRows()??20,g=m??(i.key===`PageDown`?{row:h,col:0}:i.key===`PageUp`?{row:-h,col:0}:void 0);if(g)t.tabFrom.current=void 0,a.setOffer(void 0),r.leaveHand(),s(CD(o(),e.selection,g,{shift:i.shift,mod:p})),i.preventDefault();else switch(i.key){case`Home`:s(wD(e.selection,{shift:i.shift,mod:p})),i.preventDefault();return;case`End`:p&&(s(TD(o(),e.selection,{shift:i.shift})),i.preventDefault());return;case`Enter`:{let t=r.enterFrom(e.selection,i.shift);s(t,t.active),i.preventDefault();return}case`Tab`:{let t=r.tabFrom(e.selection,i.shift);s(t,t.active),i.preventDefault();return}case`Escape`:a.setCopied(void 0),a.setOffer(void 0),r.leaveHand(),n.say(void 0);return;case`F2`:r.begin({text:r.inputAt(e.selection.active),mode:`edit`}),i.preventDefault();return;case` `:i.shift?(n.setSelection({...lw(e.area.top,e.area.bottom),active:e.selection.active}),i.preventDefault()):i.ctrl&&(n.setSelection({...cw(e.area.left,e.area.right),active:e.selection.active}),i.preventDefault());return;default:return}}function jD(e,t,n){let r=t.shownChart();if(!r)return;if(n.key===`Escape`){t.selectChart(void 0),n.preventDefault();return}let i=OD[n.key],a=e.grid.current?.view();if(i&&a){let e=tE(a,r);t.placeChart(r.index,{...e,left:Math.max(0,e.left+i[1]),top:Math.max(0,e.top+i[0])},!1),n.preventDefault()}else n.key.length===1&&!n.meta&&!n.ctrl&&n.preventDefault()}function MD(e){return e.picking?{kind:`pick`}:e.border!==void 0&&e.movable?{kind:`move`,from:e.area,grab:e.at,to:e.area,moved:!1}:{kind:`select`}}function ND(e,t){if(e.kind!==`move`)return e;let n=ID(e.from,e.grab,t);return{...e,to:n,moved:e.moved||!FD(n,e.from)}}function PD(e,t){if(e.kind===`move`&&e.moved&&!FD(e.from,e.to))return{from:e.from,to:e.to,copy:t}}var FD=(e,t)=>e.top===t.top&&e.left===t.left&&e.bottom===t.bottom&&e.right===t.right;function ID(e,t,n){let r=e.bottom-e.top,i=e.right-e.left,a=Math.min(zt-1-r,Math.max(0,e.top+n.row-t.row)),o=Math.min(Bt-1-i,Math.max(0,e.left+n.col-t.col));return{top:a,left:o,bottom:a+r,right:o+i}}function LD(e,t,n,r){let i=e.x+e.width,a=e.y+e.height;if(t<e.x-r||t>i+r||n<e.y-r||n>a+r)return;let o=[[`top`,Math.abs(n-e.y)],[`bottom`,Math.abs(n-a)],[`left`,Math.abs(t-e.x)],[`right`,Math.abs(t-i)]],s;for(let e of o)e[1]<=r&&(!s||e[1]<s[1])&&(s=e);return s?.[0]}var RD=e=>e===`top`?{row:-1,col:0}:e===`bottom`?{row:1,col:0}:e===`left`?{row:0,col:-1}:{row:0,col:1};function zD(e,t,n,r){let{ui:i}=e,a=()=>e.editable&&!e.locked&&e.areas.length===1&&!dw(e.area)&&!fw(e.area);return{onPress:o=>{let{hit:s}=o,c=i.editing;if(c){let e=r.surfaceOf(c)?.selectionStart??c.caret;if(s.part===`cell`&&JE(c,e)){let e={row:s.row,col:s.col};i.setGesture({kind:`pick`}),r.pickRef(c,e,e);return}if(!r.commit())return}if(t.tabFrom.current=void 0,i.setOffer(void 0),r.leaveHand(),r.selectChart(void 0),n.focusSink(),s.part===`corner`){n.setSelection(uw);return}let l=t=>o.meta?{...t,more:ZC(e.selection)}:t;if(s.part===`column`){i.setGesture({kind:`select`});let t=o.shift?e.selection.anchor.col:s.col;n.setSelection(l(cw(t,s.col)))}else if(s.part===`row`){i.setGesture({kind:`select`});let t=o.shift?e.selection.anchor.row:s.row;n.setSelection(l(lw(t,s.row)))}else{let t=bD(r.shape(),{row:s.row,col:s.col}),c=MD({border:o.shift||o.meta?void 0:o.border,picking:!1,area:e.area,at:t,movable:a()});if(i.setGesture(c),c.kind===`move`)return;n.setSelection(o.shift?sw(e.selection,t):o.meta?$C(e.selection,t):YC(t))}},onDrag:t=>{let a=i.editing,o=i.gesture;if(a?.pick){t.part===`cell`&&r.pickRef(a,a.pick.from,{row:t.row,col:t.col});return}if(a)return;if(o.kind===`move`){t.part===`cell`&&i.setGesture(ND(o,t));return}let s=e.selection.more?{more:e.selection.more}:{};t.part===`cell`?n.setSelection(sw(e.selection,t)):t.part===`column`&&dw(e.area)?n.setSelection({...cw(e.selection.anchor.col,t.col),...s}):t.part===`row`&&fw(e.area)&&n.setSelection({...lw(e.selection.anchor.row,t.row),...s})},onRelease:e=>{let t=PD(i.gesture,e.alt);i.setGesture({kind:`idle`}),t&&r.dropCells(t.from,t.to,t.copy);let a=i.editing;a?r.surfaceOf(a)?.focus({preventScroll:!0}):n.focusSink()},onEdgeOpen:a=>{if(i.editing)return;let o=SD(r.shape(),e.selection.active,RD(a)),s=YC(o);n.setSelection(s),t.grid.current?.show(o),n.focusSink()},onMenu:(t,a,o)=>{(!i.editing||r.commit())&&(i.setFilled(void 0),t.part===`corner`?(n.setSelection(uw),i.setMenu({kind:`cell`,x:a,y:o})):t.part===`cell`?(((t,n)=>e.areas.some(e=>t>=e.top&&t<=e.bottom&&n>=e.left&&n<=e.right))(t.row,t.col)||n.setSelection(YC(bD(r.shape(),t))),i.setMenu({kind:`cell`,x:a,y:o})):t.part===`column`?(e.areas.some(e=>dw(e)&&t.col>=e.left&&t.col<=e.right)||n.setSelection(cw(t.col,t.col)),i.setMenu({kind:`column`,x:a,y:o})):(e.areas.some(e=>fw(e)&&t.row>=e.top&&t.row<=e.bottom)||n.setSelection(lw(t.row,t.row)),i.setMenu({kind:`row`,x:a,y:o})))}}}var BD=60;function VD(e,t){return{activeLook:()=>CT(e.sheet,e.selection.active.row,e.selection.active.col),inputAt:t=>no(e.book,e.sheet,t.row,t.col),completions:()=>{let t=e.ui.editing,n=t?Hw(t.text,t.caret)?.prefix:void 0;return n===void 0||n===``?[]:Uw(n,BD)},cellLabel:()=>ww(e,e.s),openChartPane:t=>{e.ui.setChartOn(t),e.ui.setChartPane(t)},chartToClipboard:e=>{let n=t.shownChart();n&&navigator.clipboard.writeText(t.copyChart(n,e)).catch(()=>void 0)}}}function HD(e,t){return e?UD(e,t):void 0}function UD(e,t){let n={},r=DT(e,t);return Object.assign(n,r,$T(e,t,r,n),MT(e,t,r,n),cD(e,t,r,n),iD(e,t,r),pE(e,t,r),sD(e,t,r,n),fD(e,t,r,n),zD(e,t,r,n),kD(e,t,r,n),yD(e,r),VD(e,n),{gridKey:i=>{AD(e,t,r,n,i)}}),n}function WD(e){let[t,n]=(0,A.useState)(e),[r,i]=(0,A.useState)({active:{row:0,col:0},anchor:{row:0,col:0},focus:{row:0,col:0}}),[a,o]=(0,A.useState)(),[s,c]=(0,A.useState)(),[l,u]=(0,A.useState)(),[d,f]=(0,A.useState)(),[p,m]=(0,A.useState)({kind:`idle`}),[h,g]=(0,A.useState)(0),[_,v]=(0,A.useState)(),[y,b]=(0,A.useState)(),[x,S]=(0,A.useState)(),[ee,C]=(0,A.useState)(),[te,w]=(0,A.useState)(),[ne,T]=(0,A.useState)(!1),[E,D]=(0,A.useState)(),[re,O]=(0,A.useState)(),[k,ie]=(0,A.useState)(),[ae,oe]=(0,A.useState)(),[se,ce]=(0,A.useState)(),[le,ue]=(0,A.useState)(),[de,fe]=(0,A.useState)();return{shownName:t,setShownName:n,selection:r,setSelectionState:i,editing:a,setEditing:o,copied:s,setCopied:c,said:l,setSaid:u,offer:d,setOffer:f,gesture:p,setGesture:m,choice:h,setChoice:g,asking:_,setAsking:v,menu:y,setMenu:b,chartOn:x,setChartOn:S,chartPane:ee,setChartPane:C,chartMenu:te,setChartMenu:w,chartHeld:ne,setChartHeld:T,filterOpen:E,setFilterOpen:D,listOpen:re,setListOpen:O,fillTo:k,setFillTo:ie,filled:ae,setFilled:oe,read:se,setRead:ce,finding:le,setFinding:ue,busy:de,setBusy:fe}}function GD(e){let{sink:t,grid:n,editing:r,book:i,sheet:a}=e,o=r&&a?CT(i.workbook.sheet(r.sheet)??a,r.at.row,r.at.col):void 0;(0,A.useLayoutEffect)(()=>{let e=t.current;if(!e)return;if(!r||!o){e.style.width=`2px`,e.style.height=`2px`;return}let i=document.createElement(`canvas`).getContext(`2d`),a=Yw(o);e.style.font=a,e.style.background=typeof o.fill==`string`?o.fill:``;let s=0;if(i){i.font=a;for(let e of r.text.split(`
|
|
37
|
+
`))s=Math.max(s,i.measureText(e).width)}let c=n.current?.view(),l=c?.columns.sizeOf(r.at.col)??64,u=c?.rows.sizeOf(r.at.row)??20,d=Math.max(l,(c?.width??800)-(c?.xOf(r.at.col)??0)-12);e.style.width=`${String(Math.min(Math.max(l,s+14),d))}px`,e.style.height=`auto`,e.style.height=`${String(Math.max(u,e.scrollHeight))}px`}),(0,A.useEffect)(()=>{r&&r.surface!==`bar`&&t.current&&t.current.value!==r.text&&(t.current.value=r.text)},[r,t])}var KD=1e4;function qD(e){let t=jC(),n=(0,A.useRef)({getBoundingClientRect:()=>e.rect}),r=(0,A.useRef)(null),i=(0,A.useMemo)(()=>rs(e.sheet,e.calc,e.filter,e.col),[e.sheet,e.calc,e.filter,e.col]),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(()=>new Set(i.values.filter(e=>!e.on).map(e=>e.text.toLowerCase()))),[l,u]=(0,A.useState)(i.blanks?.on??!1),d=a.trim().toLowerCase(),f=(0,A.useMemo)(()=>i.values.filter(e=>d===``||e.text.toLowerCase().includes(d)).slice(0,KD),[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`?Zr(y)?[t.filter.oldest,t.filter.newest]:[t.filter.smallest,t.filter.largest]:[t.filter.aToZ,t.filter.zToA];return(0,j.jsxs)(ae,{open:!0,onOpenChange:t=>{t||e.onClose()},children:[(0,j.jsx)(fe,{virtualRef:n}),(0,j.jsxs)(he,{align:`start`,className:`sheet-filter-menu`,"data-testid":`sheet-filter-menu`,onOpenAutoFocus:e=>{e.preventDefault(),r.current?.focus()},onCloseAutoFocus:e=>{e.preventDefault()},children:[(0,j.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,"data-testid":`sheet-filter-sort-up`,onClick:()=>{e.onSort(!1)},children:b[0]}),(0,j.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,"data-testid":`sheet-filter-sort-down`,onClick:()=>{e.onSort(!0)},children:b[1]}),(0,j.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,j.jsx)(ht,{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,j.jsxs)(`div`,{className:`sheet-filter-list`,"data-testid":`sheet-filter-list`,children:[(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:m?!0:!h&&`indeterminate`,"data-testid":`sheet-filter-all`,onCheckedChange:e=>{g(e===!0)}}),(0,j.jsx)(`span`,{children:t.filter.selectAll})]}),f.map(e=>(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{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,j.jsx)(`span`,{children:e.text})]},e.text)),i.blanks===void 0||d!==``?null:(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:l,"data-value":``,onCheckedChange:e=>{u(e===!0)}}),(0,j.jsx)(`span`,{children:t.filter.blanks})]})]}),(0,j.jsx)(`div`,{className:`sheet-filter-foot`,children:(0,j.jsx)(MC,{cancel:{label:t.dialog.cancel,testid:`sheet-filter-cancel`,onClick:e.onClose},main:{label:t.dialog.ok,testid:`sheet-filter-ok`,onClick:_,disabled:h}})})]})]})}function JD(e){let t=(0,A.useRef)({getBoundingClientRect:()=>e.rect}),{ticked:n}=e;return(0,j.jsxs)(ae,{open:!0,onOpenChange:t=>{t||e.onClose()},children:[(0,j.jsx)(fe,{virtualRef:t}),(0,j.jsxs)(he,{align:`start`,className:`sheet-value-list`,"data-testid":`sheet-value-list`,onCloseAutoFocus:e=>{e.preventDefault()},children:[n&&n.length>0?(0,j.jsx)(`div`,{className:`sheet-chips`,"data-testid":`sheet-chips`,children:n.map(e=>(0,j.jsx)(`span`,{className:`sheet-chip`,children:e},e))}):null,e.values.map(t=>(0,j.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,j.jsx)(ee,{className:`mr-1 inline size-3`,style:{opacity:+!!n.includes(t)}}):null,t]},t))]})]})}function YD({c:e,a:t}){let{ui:n,sheet:r,book:i,name:a}=e,o=n.filterOpen,s=n.listOpen,{row:c,col:l}=e.selection.active,u=r.validationAt(c,l),d=o?r.filterHeadAt(o.at.row,o.at.col):void 0,f=s&&u?.spec.multiple===!0?Wo(Yr(e.values.value(r,s.at.row,s.at.col),void 0),u.spec):[],p=()=>{n.setFilterOpen(void 0),t.focusSink()};return(0,j.jsxs)(j.Fragment,{children:[o&&d?(0,j.jsx)(qD,{sheet:r,calc:i.calc,filter:d,col:o.at.col,rect:o.rect,name:Yr(e.values.value(r,o.at.row,o.at.col),void 0),onClose:p,onSort:e=>{t.sortBy({area:d.area,header:!0},[{col:o.at.col,descending:e}]),p()},onKeep:e=>{t.apply(dS(t.bookNow(),a,d,o.at.col,e)),p()}},`${String(o.at.row)}:${String(o.at.col)}`):null,s&&u?(0,j.jsx)(JD,{values:Ko(i.calc,r,u,s.at.row,s.at.col),rect:s.rect,ticked:u.spec.multiple===!0?f:void 0,onClose:()=>{n.setListOpen(void 0),t.focusSink()},onPick:e=>{let o=s.at,c=u.spec.multiple===!0,l=Ko(i.calc,r,u,o.row,o.col),d=f.includes(e)?f.filter(t=>t!==e):l.filter(t=>f.includes(t)||t===e);t.apply(Oa(t.bookNow(),a,[{row:o.row,col:o.col,text:c?Go(d,u.spec):e}]),c?`choices:${String(o.row)}`:void 0),!c&&(n.setListOpen(void 0),t.focusSink())}}):null]})}var XD=new Set([`pie`,`doughnut`]),ZD=e=>{let t=e.trim();if(t===``)return;let n=Number(t);return Number.isFinite(n)?n:null};function QD(e){let[t,n]=(0,A.useState)(e.value),[r,i]=(0,A.useState)(e.value);return r!==e.value&&(i(e.value),n(e.value)),(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:e.label}),(0,j.jsx)(ht,{value:t,disabled:e.disabled,inputMode:e.inputMode,placeholder:e.placeholder,spellCheck:!1,"data-testid":e.testid,onChange:e=>{n(e.target.value)},onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),t.currentTarget.blur()):t.key===`Escape`&&n(e.value)},onBlur:()=>{t!==e.value&&e.onCommit(t)}})]})}function $D(e){let t=jC(),n=e.axis??{},r=(t,r)=>{let i=Object.fromEntries(Object.entries({...n,[t]:r}).filter(([,e])=>e!==void 0));e.onPatch({[e.which]:Object.keys(i).length===0?void 0:i})},i=e=>t=>{let n=ZD(t);n!==null&&(e===`major`&&n!==void 0&&n<=0||r(e,n))},a=e.which===`value_axis`?`value`:`category`;return(0,j.jsxs)(`fieldset`,{className:`sheet-pane-group`,"data-testid":`sheet-pane-${a}-axis`,children:[(0,j.jsx)(`legend`,{children:e.title}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:n.visible!==!1,disabled:e.disabled,"data-testid":`sheet-pane-${a}-visible`,onCheckedChange:e=>{r(`visible`,e===!0&&void 0)}}),(0,j.jsx)(`span`,{children:t.pane.showAxis})]}),(0,j.jsx)(QD,{label:t.pane.axisTitle,value:n.title??``,testid:`sheet-pane-${a}-title`,disabled:e.disabled,onCommit:e=>{r(`title`,e.trim()===``?void 0:e.trim())}}),e.which===`value_axis`?(0,j.jsxs)(`div`,{className:`sheet-pane-row`,children:[(0,j.jsx)(QD,{label:t.pane.minimum,value:n.min===void 0?``:String(n.min),placeholder:t.pane.auto,inputMode:`decimal`,testid:`sheet-pane-value-min`,disabled:e.disabled,onCommit:i(`min`)}),(0,j.jsx)(QD,{label:t.pane.maximum,value:n.max===void 0?``:String(n.max),placeholder:t.pane.auto,inputMode:`decimal`,testid:`sheet-pane-value-max`,disabled:e.disabled,onCommit:i(`max`)}),(0,j.jsx)(QD,{label:t.pane.major,value:n.major===void 0?``:String(n.major),placeholder:t.pane.auto,inputMode:`decimal`,testid:`sheet-pane-value-major`,disabled:e.disabled,onCommit:i(`major`)})]}):null,(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:n.gridlines??e.which===`value_axis`,disabled:e.disabled,"data-testid":`sheet-pane-${a}-gridlines`,onCheckedChange:e=>{r(`gridlines`,e===!0)}}),(0,j.jsx)(`span`,{children:t.pane.gridlines})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:n.reverse===!0,disabled:e.disabled,"data-testid":`sheet-pane-${a}-reverse`,onCheckedChange:e=>{r(`reverse`,e===!0||void 0)}}),(0,j.jsx)(`span`,{children:e.which===`value_axis`?t.pane.reverseValues:t.pane.reverseCategories})]}),(0,j.jsx)(QD,{label:t.pane.numberFormat,value:n.format??``,placeholder:t.formats.general,testid:`sheet-pane-${a}-format`,disabled:e.disabled,onCommit:e=>{r(`format`,e.trim()===``?void 0:e.trim())}})]})}function eO(e){let t=jC(),[n,r]=(0,A.useState)(!1);return(0,j.jsxs)(`div`,{className:`sheet-pane-series`,"data-testid":`sheet-pane-series`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:e.name}),(0,j.jsxs)(ae,{open:n,onOpenChange:r,children:[(0,j.jsx)(se,{asChild:!0,children:(0,j.jsx)(k,{icon:!0,disabled:e.disabled,"aria-label":t.pane.seriesColor(e.name),title:t.pane.seriesColor(e.name),"data-testid":`sheet-pane-series-color-${String(e.index)}`,children:(0,j.jsx)(`span`,{className:`sheet-pane-swatch`,"data-auto":e.color===void 0?``:void 0,style:e.color===void 0?void 0:{background:e.color}})})}),(0,j.jsxs)(he,{align:`end`,className:`w-auto p-2`,"data-own-keys":``,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-10 gap-1`,children:[...iT,...aT].map(t=>(0,j.jsx)(`button`,{type:`button`,"aria-label":t,"data-color":t,className:`border-rule size-5 rounded-sm border p-0`,style:{background:t},onClick:()=>{e.onColor(t),r(!1)}},t))}),(0,j.jsx)(`button`,{type:`button`,className:`sheet-pane-auto`,"data-testid":`sheet-pane-series-auto`,onClick:()=>{e.onColor(void 0),r(!1)},children:t.automatic})]})]})]})}function tO(e){let t=jC(),{spec:n}=e.chart,r=(0,A.useMemo)(()=>ci(e.calc,e.sheet,e.chart).series.map(e=>e.name),[e.calc,e.sheet,e.chart]),a=(t,r)=>{let i=n.series.map((e,n)=>{if(n!==t)return e;let i={...e};return r===void 0?delete i.color:i.color=r,i});e.onPatch({series:i})};return(0,j.jsxs)(`aside`,{className:`sheet-pane`,"aria-label":t.pane.title,"data-testid":`sheet-chart-pane`,"data-own-keys":``,onKeyDown:t=>{t.stopPropagation(),t.key===`Escape`&&(t.preventDefault(),e.onClose())},children:[(0,j.jsxs)(`header`,{className:`sheet-pane-head`,children:[(0,j.jsx)(`h2`,{children:t.pane.title}),(0,j.jsx)(k,{icon:!0,"aria-label":t.pane.close,title:t.pane.close,"data-testid":`sheet-pane-close`,onClick:e.onClose,children:(0,j.jsx)(i,{})})]}),(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:t.pane.chartType}),(0,j.jsxs)(pe,{value:n.type,disabled:e.disabled,onValueChange:t=>{let n=Te.find(e=>e===t);n&&e.onPatch({type:n})},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-pane-type`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:Te.map(e=>(0,j.jsx)(E,{value:e,"data-testid":`sheet-pane-type-${e}`,children:t.chart.types[e]},e))})]})]}),(0,j.jsx)(QD,{label:t.chart.title,value:n.title??``,testid:`sheet-pane-title`,disabled:e.disabled,onCommit:t=>{e.onPatch({title:t.trim()===``?void 0:t.trim()})}}),(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:t.chart.legend}),(0,j.jsxs)(pe,{value:n.legend??`none`,disabled:e.disabled,onValueChange:t=>{let n=Se.find(e=>e===t);e.onPatch({legend:n})},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-pane-legend`,children:(0,j.jsx)(O,{})}),(0,j.jsxs)(ie,{children:[(0,j.jsx)(E,{value:`none`,children:t.chart.legendNone}),Se.map(e=>(0,j.jsx)(E,{value:e,children:t.chart.legendAt[e]},e))]})]})]}),XD.has(n.type)?null:(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)($D,{which:`category_axis`,title:t.pane.horizontal,axis:n.category_axis,disabled:e.disabled,onPatch:e.onPatch}),(0,j.jsx)($D,{which:`value_axis`,title:t.pane.vertical,axis:n.value_axis,disabled:e.disabled,onPatch:e.onPatch})]}),(0,j.jsxs)(`fieldset`,{className:`sheet-pane-group`,children:[(0,j.jsx)(`legend`,{children:t.pane.series}),n.series.map((n,i)=>(0,j.jsx)(eO,{index:i,name:r[i]??t.pane.seriesN(i+1),color:n.color,disabled:e.disabled,onColor:e=>{a(i,e)}},`${String(i)}:${n.values}`))]})]})}var nO=[`thin`,`hair`,`dotted`,`dashed`,`dashDot`,`dashDotDot`,`medium`,`mediumDashed`,`mediumDashDot`,`thick`,`double`],rO=[`minus`,`red`,`brackets`,`redBrackets`],iO=[`general`,`left`,`center`,`right`,`fill`,`justify`,`centerContinuous`,`distributed`],aO=[`top`,`center`,`bottom`,`justify`,`distributed`],oO=[`top`,`horizontal`,`bottom`,`left`,`vertical`,`right`];function sO(e){return(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`div`,{className:`grid grid-cols-10 gap-1`,"data-testid":e.testid,children:[...iT,...aT].map(t=>(0,j.jsx)(`button`,{type:`button`,"aria-label":t,"data-color":t,className:a(`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,j.jsx)(`button`,{type:`button`,className:`sheet-menu-row`,"data-testid":`${e.testid}-none`,onClick:()=>{e.onPick(void 0)},children:e.none})]})}function cO(e){let t=jC(),[n,r]=(0,A.useState)(()=>QT(e.code)),i=t=>{let i={...n,...t};r(i),e.onCode(XT(i))},a={date:VT,time:HT,fraction:UT,custom:WT},o=a[n.category],s=Yr(e.value??1234.5,XT(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,j.jsxs)(`div`,{className:`sheet-number-tab`,children:[(0,j.jsx)(`div`,{className:`sheet-list`,role:`listbox`,"aria-label":t.formatCells.category,children:KT.map(e=>(0,j.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,j.jsxs)(`div`,{className:`sheet-number-side`,children:[(0,j.jsx)(PC,{label:t.formatCells.sample,children:(0,j.jsx)(`output`,{"data-testid":`sheet-format-sample`,children:s})}),c?(0,j.jsx)(PC,{label:t.formatCells.decimals,children:(0,j.jsx)(ht,{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,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:n.thousands,"data-testid":`sheet-format-thousands`,onCheckedChange:e=>{i({thousands:e===!0})}}),(0,j.jsx)(`span`,{children:t.formatCells.thousands})]}):null,l?(0,j.jsx)(PC,{label:t.formatCells.symbol,children:(0,j.jsxs)(pe,{value:n.symbol===``?`none`:n.symbol,onValueChange:e=>{i({symbol:e===`none`?``:e})},children:[(0,j.jsx)(T,{size:`sm`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:GT.map(e=>(0,j.jsx)(E,{value:e===``?`none`:e,className:`text-xs`,children:e===``?t.formatCells.none:e},e===``?`none`:e))})]})}):null,u?(0,j.jsx)(PC,{label:t.formatCells.negative,children:(0,j.jsxs)(pe,{value:n.negative,onValueChange:e=>{i({negative:e})},children:[(0,j.jsx)(T,{size:`sm`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:rO.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:Yr(-1234.1,XT({...n,negative:e}))},e))})]})}):null,n.category===`custom`?(0,j.jsx)(PC,{label:t.formatCells.type,children:(0,j.jsx)(ht,{"data-testid":`sheet-format-code`,spellCheck:!1,value:n.code,onChange:e=>{i({code:e.target.value})}})}):null,o?(0,j.jsx)(`div`,{className:`sheet-list`,role:`listbox`,"aria-label":t.formatCells.type,children:o.map(t=>(0,j.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:Yr(e.value??46000.5,t)},t))}):null]})]})}function lO(e){let t=jC(),n=e.look,[r,i]=(0,A.useState)(n.format),[a,o]=(0,A.useState)(n.align??`general`),[s,c]=(0,A.useState)(n.valign??`bottom`),[l,u]=(0,A.useState)(n.indent??0),[d,f]=(0,A.useState)(n.wrap===!0),[p,m]=(0,A.useState)(n.shrink===!0),[h,g]=(0,A.useState)(e.merged),[_,v]=(0,A.useState)(n.rotation??0),[y,b]=(0,A.useState)(n.font??`Calibri`),[x,S]=(0,A.useState)(n.size??11),[ee,C]=(0,A.useState)(n.bold===!0),[w,ne]=(0,A.useState)(n.italic===!0),[D,re]=(0,A.useState)(n.underline!==void 0&&n.underline!==!1),[ae,oe]=(0,A.useState)(n.strike===!0),[se,ce]=(0,A.useState)(n.color),[le,ue]=(0,A.useState)(typeof n.fill==`string`?n.fill:void 0),[de,fe]=(0,A.useState)(`thin`),[he,ge]=(0,A.useState)(),[_e,ve]=(0,A.useState)({}),ye=(0,A.useMemo)(()=>({style:de,...he===void 0?{}:{color:he}}),[de,he]),be=e=>{let t=_e[e];return t===void 0?(e===`top`||e===`bottom`||e===`left`||e===`right`)&&n.border?.[e]!==void 0:t!==null},xe=()=>{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`,ee?!0:void 0,n.bold===!0||void 0),i(`italic`,w?!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`,ae?!0:void 0,n.strike===!0||void 0),i(`color`,se,n.color),i(`fill`,le,typeof n.fill==`string`?n.fill:void 0),e.onDone({look:t,borders:_e,merge:h===e.merged?void 0:h})},Se=e=>{ve(t=>({...t,[e]:be(e)?null:ye}))};return(0,j.jsx)(NC,{title:t.formatCells.title,testid:`sheet-format-cells`,wide:!0,onClose:e.onClose,onOk:xe,children:(0,j.jsxs)(Ze,{defaultValue:e.tab,children:[(0,j.jsx)(Ye,{children:[`number`,`alignment`,`font`,`border`,`fill`].map(e=>(0,j.jsx)(He,{value:e,"data-testid":`sheet-tab-${e}`,children:t.formatCells.tabs[e]},e))}),(0,j.jsx)(Ke,{value:`number`,className:`sheet-dialog-tab`,children:(0,j.jsx)(cO,{code:r,value:e.value,onCode:i})}),(0,j.jsxs)(Ke,{value:`alignment`,className:`sheet-dialog-tab`,children:[(0,j.jsx)(PC,{label:t.formatCells.horizontal,children:(0,j.jsxs)(pe,{value:a,onValueChange:e=>{o(e)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-format-align`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:iO.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:t.formatCells.aligns[e]},e))})]})}),(0,j.jsx)(PC,{label:t.formatCells.vertical,children:(0,j.jsxs)(pe,{value:s,onValueChange:e=>{c(e)},children:[(0,j.jsx)(T,{size:`sm`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:aO.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:t.formatCells.valigns[e]},e))})]})}),(0,j.jsx)(PC,{label:t.formatCells.indent,children:(0,j.jsx)(ht,{type:`number`,min:0,value:l,onChange:e=>{u(Math.max(0,Number(e.target.value)||0))}})}),(0,j.jsx)(PC,{label:t.formatCells.orientation,children:(0,j.jsx)(ht,{type:`number`,min:-90,max:90,value:_,onChange:e=>{v(Number(e.target.value)||0)}})}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:d,onCheckedChange:e=>{f(e===!0)}}),(0,j.jsx)(`span`,{children:t.wrapText})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:p,onCheckedChange:e=>{m(e===!0)}}),(0,j.jsx)(`span`,{children:t.formatCells.shrink})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:h,"data-testid":`sheet-format-merge`,onCheckedChange:e=>{g(e===!0)}}),(0,j.jsx)(`span`,{children:t.arrange.mergeCells})]})]}),(0,j.jsxs)(Ke,{value:`font`,className:`sheet-dialog-tab`,children:[(0,j.jsx)(PC,{label:t.font,children:(0,j.jsxs)(pe,{value:y,onValueChange:b,children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-format-font`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:[...new Set([...qw,y])].map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:e},e))})]})}),(0,j.jsx)(PC,{label:t.fontSize,children:(0,j.jsxs)(pe,{value:String(x),onValueChange:e=>{S(Number(e))},children:[(0,j.jsx)(T,{size:`sm`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:[...new Set([...Jw,x])].map(e=>(0,j.jsx)(E,{value:String(e),className:`text-xs`,children:e},e))})]})}),(0,j.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:ee,"data-testid":`sheet-format-bold`,onCheckedChange:e=>{C(e===!0)}}),(0,j.jsx)(`span`,{children:t.bold})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:w,onCheckedChange:e=>{ne(e===!0)}}),(0,j.jsx)(`span`,{children:t.italic})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:D,onCheckedChange:e=>{re(e===!0)}}),(0,j.jsx)(`span`,{children:t.underline})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:ae,onCheckedChange:e=>{oe(e===!0)}}),(0,j.jsx)(`span`,{children:t.formatCells.strikethrough})]})]}),(0,j.jsx)(PC,{label:t.fontColor,children:(0,j.jsx)(sO,{value:se,testid:`sheet-format-color`,none:t.automatic,onPick:ce})})]}),(0,j.jsxs)(Ke,{value:`border`,className:`sheet-dialog-tab`,children:[(0,j.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,j.jsx)(te,{variant:`ghost`,size:`sm`,"data-testid":`sheet-border-none`,onClick:()=>{ve({top:null,bottom:null,left:null,right:null,horizontal:null,vertical:null})},children:t.formatCells.borderNone}),(0,j.jsx)(te,{variant:`ghost`,size:`sm`,"data-testid":`sheet-border-outline`,onClick:()=>{ve(e=>({...e,top:ye,bottom:ye,left:ye,right:ye}))},children:t.formatCells.borderOutline}),(0,j.jsx)(te,{variant:`ghost`,size:`sm`,"data-testid":`sheet-border-inside`,onClick:()=>{ve(e=>({...e,horizontal:ye,vertical:ye}))},children:t.formatCells.borderInside})]}),(0,j.jsx)(PC,{label:t.formatCells.lineStyle,children:(0,j.jsxs)(pe,{value:de,onValueChange:e=>{fe(e)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-border-style`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:nO.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:t.formatCells.lines[e]},e))})]})}),(0,j.jsx)(PC,{label:t.formatCells.lineColor,children:(0,j.jsx)(sO,{value:he,testid:`sheet-border-color`,none:t.automatic,onPick:ge})}),(0,j.jsx)(`div`,{className:`sheet-dialog-row`,"data-testid":`sheet-border-edges`,children:oO.map(e=>(0,j.jsx)(k,{"aria-pressed":be(e),"data-testid":`sheet-edge-${e}`,onClick:()=>{Se(e)},children:t.formatCells.edges[e]},e))})]}),(0,j.jsx)(Ke,{value:`fill`,className:`sheet-dialog-tab`,children:(0,j.jsx)(PC,{label:t.fillColor,children:(0,j.jsx)(sO,{value:le,testid:`sheet-format-fill`,none:t.noFill,onPick:ue})})})]})})}function uO(e){let t=jC();return(0,j.jsxs)(`div`,{className:`sheet-locked`,"data-testid":`sheet-locked`,role:`status`,children:[(0,j.jsx)(ge,{className:`size-3 shrink-0`}),(0,j.jsx)(`span`,{className:`sheet-locked-line`,children:t.generated.line}),(0,j.jsx)(k,{"data-testid":`sheet-locked-ask`,onClick:e.onAsk,children:t.generated.ask(e.agent)}),(0,j.jsx)(k,{"data-testid":`sheet-locked-ordinary`,onClick:e.onOrdinary,children:t.generated.ordinary})]})}function dO(e){let t=jC();return(0,j.jsx)(NC,{title:t.generated.title,testid:`sheet-locked-refused`,onClose:e.onClose,buttons:{others:[{label:t.generated.ordinary,testid:`sheet-locked-refused-ordinary`,onClick:e.onOrdinary},{label:t.generated.ask(e.agent),testid:`sheet-locked-refused-ask`,onClick:e.onAsk}],main:{label:t.dialog.ok,testid:`sheet-locked-refused-ok`,onClick:e.onClose,autoFocus:!0}},children:(0,j.jsx)(`p`,{className:`sheet-dialog-line`,children:t.generated.refused})})}function fO({className:e,...t}){return(0,j.jsx)(`textarea`,{"data-slot":`textarea`,className:a(`flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40`,e),...t})}var pO=[{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`}],mO=e=>{let t=pO.find(t=>t.id===e)??pO[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}:{}}},hO=e=>{let t=e.trim(),n=Number(t);return t!==``&&!Number.isNaN(n)?n:t};function gO(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 _O(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 vO(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:[hO(r)]};case`between`:return{...o,type:`cellIs`,operator:`between`,formula:[hO(r),hO(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 yO(e){let t=jC(),n=e.kind===`top`||e.kind===`topPercent`||e.kind===`bottom`||e.kind===`bottomPercent`,[r,i]=(0,A.useState)(n?`10`:e.start),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(`lightRed`),[l,u]=(0,A.useState)(!1),d=e.kind===`duplicateValues`||e.kind===`above`||e.kind===`below`;return(0,j.jsxs)(NC,{title:_O(t,e.kind),testid:`sheet-rule-dialog`,onClose:e.onClose,onOk:()=>{e.onDone(vO(e.kind,e.range,mO(s),r,a,l))},children:[(0,j.jsx)(`p`,{className:`sheet-dialog-line`,children:gO(t,e.kind)}),e.kind===`duplicateValues`?(0,j.jsxs)(pe,{value:l?`unique`:`duplicate`,onValueChange:e=>{u(e===`unique`)},children:[(0,j.jsx)(T,{size:`sm`,"aria-label":t.rules.duplicateValues,children:(0,j.jsx)(O,{})}),(0,j.jsxs)(ie,{children:[(0,j.jsx)(E,{value:`duplicate`,className:`text-xs`,children:t.rules.duplicate}),(0,j.jsx)(E,{value:`unique`,className:`text-xs`,children:t.rules.unique})]})]}):null,d?null:(0,j.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,j.jsx)(ht,{autoFocus:!0,"aria-label":_O(t,e.kind),"data-testid":`sheet-rule-value`,value:r,onChange:e=>{i(e.target.value)}}),e.kind===`between`?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(`span`,{children:t.rules.and}),(0,j.jsx)(ht,{"aria-label":t.rules.and,"data-testid":`sheet-rule-second`,value:a,onChange:e=>{o(e.target.value)}})]}):null]}),(0,j.jsx)(PC,{label:t.rules.with,children:(0,j.jsxs)(pe,{value:s,onValueChange:e=>{c(e)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-rule-look`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:pO.map(e=>(0,j.jsx)(E,{value:e.id,className:`text-xs`,children:t.rules.looks[e.id]},e.id))})]})})]})}var bO=[`any`,`whole`,`decimal`,`list`,`date`,`time`,`textLength`,`custom`],xO=[`between`,`notBetween`,`equal`,`notEqual`,`greaterThan`,`lessThan`,`greaterThanOrEqual`,`lessThanOrEqual`],SO=e=>e===void 0?``:String(e),CO=e=>hO(e);function wO(e){let t=jC(),{rule:n}=e,[r,i]=(0,A.useState)(n?.type??`any`),[a,o]=(0,A.useState)(n?.operator??`between`),[s,c]=(0,A.useState)(()=>n?.values?n.values.join(`,`):SO(n?.formula?.[0])),[l,u]=(0,A.useState)(SO(n?.formula?.[1])),[d,f]=(0,A.useState)(n?.blank!==!1),[p,m]=(0,A.useState)(n?.dropdown!==!1),[h,g]=(0,A.useState)(n?.prompt?.show!==!1),[_,v]=(0,A.useState)(n?.prompt?.title??``),[y,b]=(0,A.useState)(n?.prompt?.message??``),[x,S]=(0,A.useState)(n?.error?.show!==!1),[ee,C]=(0,A.useState)(n?.error?.style??`stop`),[w,ne]=(0,A.useState)(n?.error?.title??``),[D,re]=(0,A.useState)(n?.error?.message??``),k=r!==`any`&&r!==`list`&&r!==`custom`,ae=k&&(a===`between`||a===`notBetween`);return(0,j.jsx)(NC,{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:ee===`stop`?void 0:ee,title:w,message:D,show:x?void 0:!1}),o=r===`list`&&!s.trim().startsWith(`=`);e.onDone({type:r,...k&&a!==`between`?{operator:a}:{},...o?{values:s.split(`,`).map(e=>e.trim())}:{formula:ae?[CO(s),CO(l)]:[CO(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,j.jsx)(te,{variant:`ghost`,size:`sm`,"data-testid":`sheet-validation-clear`,onClick:()=>{e.onDone(void 0)},children:t.validation.clearAll}),children:(0,j.jsxs)(Ze,{defaultValue:`settings`,children:[(0,j.jsxs)(Ye,{children:[(0,j.jsx)(He,{value:`settings`,children:t.validation.settings}),(0,j.jsx)(He,{value:`input`,"data-testid":`sheet-validation-input`,children:t.validation.inputMessage}),(0,j.jsx)(He,{value:`error`,"data-testid":`sheet-validation-error`,children:t.validation.errorAlert})]}),(0,j.jsxs)(Ke,{value:`settings`,className:`sheet-dialog-tab`,children:[(0,j.jsx)(PC,{label:t.validation.allow,children:(0,j.jsxs)(pe,{value:r,onValueChange:e=>{i(e)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-validation-allow`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:bO.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,"data-testid":`sheet-allow-${e}`,children:t.validation.kinds[e]},e))})]})}),r===`any`?null:(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:d,onCheckedChange:e=>{f(e===!0)}}),(0,j.jsx)(`span`,{children:t.validation.ignoreBlank})]}),r===`list`?(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:p,onCheckedChange:e=>{m(e===!0)}}),(0,j.jsx)(`span`,{children:t.validation.dropdown})]}):null,k?(0,j.jsx)(PC,{label:t.validation.data,children:(0,j.jsxs)(pe,{value:a,onValueChange:e=>{o(e)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-validation-data`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:xO.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:t.validation.operators[e]},e))})]})}):null,r===`any`?null:(0,j.jsx)(PC,{label:r===`list`?t.validation.source:r===`custom`?t.validation.formula:ae?t.validation.minimum:t.validation.value,children:(0,j.jsx)(ht,{"data-testid":`sheet-validation-first`,value:s,onChange:e=>{c(e.target.value)}})}),ae?(0,j.jsx)(PC,{label:t.validation.maximum,children:(0,j.jsx)(ht,{"data-testid":`sheet-validation-second`,value:l,onChange:e=>{u(e.target.value)}})}):null]}),(0,j.jsxs)(Ke,{value:`input`,className:`sheet-dialog-tab`,children:[(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:h,onCheckedChange:e=>{g(e===!0)}}),(0,j.jsx)(`span`,{children:t.validation.showPrompt})]}),(0,j.jsx)(PC,{label:t.validation.titleWord,children:(0,j.jsx)(ht,{"data-testid":`sheet-validation-prompt-title`,value:_,onChange:e=>{v(e.target.value)}})}),(0,j.jsx)(PC,{label:t.validation.inputMessage,children:(0,j.jsx)(fO,{"data-testid":`sheet-validation-prompt`,value:y,onChange:e=>{b(e.target.value)}})})]}),(0,j.jsxs)(Ke,{value:`error`,className:`sheet-dialog-tab`,children:[(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:x,onCheckedChange:e=>{S(e===!0)}}),(0,j.jsx)(`span`,{children:t.validation.showError})]}),(0,j.jsx)(PC,{label:t.validation.style,children:(0,j.jsxs)(pe,{value:ee,onValueChange:e=>{C(e)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-validation-style`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:[`stop`,`warning`,`information`].map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:t.validation.styles[e]},e))})]})}),(0,j.jsx)(PC,{label:t.validation.titleWord,children:(0,j.jsx)(ht,{"data-testid":`sheet-validation-error-title`,value:w,onChange:e=>{ne(e.target.value)}})}),(0,j.jsx)(PC,{label:t.validation.errorMessage,children:(0,j.jsx)(fO,{"data-testid":`sheet-validation-error-message`,value:D,onChange:e=>{re(e.target.value)}})})]})]})})}function TO(e){let t=jC(),n=e.rule.error?.style??`stop`,r=e.rule.error?.title??t.validation.refusedTitle,i=e.rule.error?.message??t.validation.refused;return(0,j.jsxs)(NC,{title:r,testid:`sheet-refused`,onClose:e.onCancel,buttons:n===`stop`?{cancel:{label:t.dialog.cancel,testid:`sheet-refused-cancel`,onClick:e.onCancel},main:{label:t.validation.retry,testid:`sheet-refused-retry`,onClick:e.onRetry}}:n===`warning`?{others:[{label:t.validation.no,testid:`sheet-refused-no`,onClick:e.onRetry}],cancel:{label:t.dialog.cancel,testid:`sheet-refused-cancel`,onClick:e.onCancel},main:{label:t.validation.yes,testid:`sheet-refused-yes`,onClick:e.onAccept}}:{cancel:{label:t.dialog.cancel,testid:`sheet-refused-cancel`,onClick:e.onCancel},main:{label:t.dialog.ok,testid:`sheet-refused-yes`,onClick:e.onAccept}},children:[(0,j.jsx)(`p`,{className:`sheet-dialog-line`,children:i}),n===`warning`?(0,j.jsx)(`p`,{className:`sheet-dialog-line`,children:t.validation.continue}):null]})}function EO(e){let t=jC(),[n,r]=(0,A.useState)([e.start]),[i,a]=(0,A.useState)(e.header),o=(e,t)=>{r(n=>n.map((n,r)=>r===e?{...n,...t}:n))};return(0,j.jsxs)(NC,{title:t.sort.title,testid:`sheet-sort-dialog`,wide:!0,onClose:e.onClose,onOk:()=>{e.onDone(n,i)},left:(0,j.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,j.jsx)(te,{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,j.jsx)(te,{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,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:i,"data-testid":`sheet-sort-header`,onCheckedChange:e=>{a(e===!0)}}),(0,j.jsx)(`span`,{children:t.sort.hasHeaders})]}),n.map((n,r)=>(0,j.jsxs)(`div`,{className:`sheet-dialog-row`,children:[(0,j.jsx)(`span`,{children:r===0?t.sort.sortBy:t.sort.thenBy}),(0,j.jsxs)(pe,{value:String(n.col),onValueChange:e=>{o(r,{col:Number(e)})},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-sort-column-${String(r)}`,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:e.columns.map(e=>(0,j.jsx)(E,{value:String(e.col),className:`text-xs`,children:e.name},e.col))})]}),(0,j.jsxs)(pe,{value:n.descending?`down`:`up`,onValueChange:e=>{o(r,{descending:e===`down`})},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-sort-order-${String(r)}`,children:(0,j.jsx)(O,{})}),(0,j.jsxs)(ie,{children:[(0,j.jsx)(E,{value:`up`,className:`text-xs`,children:t.filter.aToZShort}),(0,j.jsx)(E,{value:`down`,className:`text-xs`,children:t.filter.zToAShort})]})]})]},String(r)))]})}function DO(e){let[t,n]=(0,A.useState)(String(e.start)),r=Number(t);return(0,j.jsx)(NC,{title:e.title,testid:`sheet-size-dialog`,onClose:e.onClose,onOk:()=>{Number.isFinite(r)&&r>=0&&e.onDone(r)},children:(0,j.jsx)(ht,{autoFocus:!0,"aria-label":e.title,"data-testid":`sheet-size-value`,value:t,onChange:e=>{n(e.target.value)}})})}function OO(e){let t=jC(),[n,r]=(0,A.useState)(e.sheets[0]??``);return(0,j.jsx)(NC,{title:t.arrange.unhideSheet,testid:`sheet-unhide-dialog`,onClose:e.onClose,onOk:()=>{e.onDone(n)},children:(0,j.jsxs)(pe,{value:n,onValueChange:r,children:[(0,j.jsx)(T,{size:`sm`,"aria-label":t.arrange.unhideSheet,children:(0,j.jsx)(O,{})}),(0,j.jsx)(ie,{children:e.sheets.map(e=>(0,j.jsx)(E,{value:e,className:`text-xs`,children:e},e))})]})})}function kO(e){return(0,j.jsx)(NC,{title:e.title,testid:`sheet-ask`,onClose:e.onClose,onOk:e.onDone,children:(0,j.jsx)(`p`,{className:`sheet-dialog-line`,children:e.message})})}function AO(e){let t=jC(),[n,r]=(0,A.useState)(e.shown),i=e.rows.find(e=>e.name===n);return(0,j.jsxs)(NC,{title:t.scenario.manager,testid:`sheet-scenarios`,onClose:e.onClose,buttons:{cancel:{label:t.scenario.close,testid:`sheet-scenario-close`,onClick:e.onClose},main:{label:t.scenario.show,testid:`sheet-scenario-show`,onClick:()=>{e.onShow(n)}}},children:[(0,j.jsx)(`p`,{className:`sheet-dialog-label`,children:t.scenario.scenarios}),(0,j.jsx)(`div`,{className:`sheet-scenario-list`,role:`listbox`,children:e.rows.map(i=>(0,j.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,j.jsx)(`p`,{className:`sheet-dialog-label`,children:t.scenario.changing}),(0,j.jsx)(`p`,{className:`sheet-scenario-sets`,"data-testid":`sheet-scenario-sets`,children:i?.sets.join(`, `)})]})}function jO({c:e,a:t,merged:n,pictures:r}){let i=jC(),{ui:a,sheet:o,book:s}=e,c=a.asking;if(!c)return null;let{row:l,col:u}=e.selection.active,d=e.values.value(o,l,u);switch(c.kind){case`format`:return(0,j.jsx)(lO,{tab:c.tab,look:t.activeLook(),value:d,merged:n,onClose:t.closeAsking,onDone:e=>{t.applyFormat(e),t.closeAsking()}});case`rule`:return(0,j.jsx)(yO,{kind:c.rule,range:t.rangesOf(),start:t.inputAt(e.selection.active),onClose:t.closeAsking,onDone:e=>{t.addRule(e),t.closeAsking()}});case`validation`:return(0,j.jsx)(wO,{rule:o.validationAt(l,u)?.spec,onClose:t.closeAsking,onDone:e=>{t.setValidation(e),t.closeAsking()}});case`refused`:return(0,j.jsx)(TO,{rule:c.rule,onCancel:()=>{a.setAsking(void 0),t.cancel()},onRetry:()=>{a.setAsking(void 0),requestAnimationFrame(()=>{let e=t.surfaceOf(a.editing);e?.focus(),e?.select()})},onAccept:()=>{let{all:e}=c;a.setAsking(void 0),t.commit({all:e,accepted:!0})}});case`sort`:{let{target:n}=c,r=[];for(let t=n.area.left;t<=n.area.right;t++)r.push({col:t,name:n.header&&Yr(e.values.value(o,n.area.top,t),o.lookAt(n.area.top,t).format)||i.sort.column(Vt(t))});let a={col:Math.min(Math.max(u,n.area.left),n.area.right),descending:!1};return(0,j.jsx)(EO,{columns:r,start:a,header:n.header,onClose:t.closeAsking,onDone:(e,r)=>{t.sortBy({area:n.area,header:r},e),t.closeAsking()}})}case`size`:return(0,j.jsx)(DO,{title:c.what===`row`?i.menu.rowHeightWord:i.menu.columnWidthWord,start:c.start,onClose:t.closeAsking,onDone:e=>{t.setSizes(c.what,e),t.closeAsking()}});case`unhide`:return(0,j.jsx)(OO,{sheets:t.sheetsHidden(),onClose:t.closeAsking,onDone:e=>{t.showHidden(e),t.closeAsking()}});case`locked`:return(0,j.jsx)(dO,{agent:e.context?.agent?.name,onAsk:t.askAgent,onOrdinary:t.makeOrdinary,onClose:t.closeAsking});case`scenarios`:{let n=[{name:void 0,sets:[]},...Object.entries(s.workbook.file.scenarios??{}).map(([e,t])=>({name:e,sets:Object.entries(t).map(([e,t])=>`${e} = ${String(t)}`)}))];return(0,j.jsx)(AO,{rows:n,shown:s.scenario,onShow:n=>{e.files.showScenario(n),t.closeAsking()},onClose:t.closeAsking})}case`file`:{let{at:n}=c,i=t.filesAtPlace(n);return i.length===0?null:(0,j.jsx)(IC,{paths:i,urlOf:e=>r.urlOf(e),onRemove:e.locked?void 0:e=>{t.writeFiles(n,i.filter(t=>t!==e)),i.length===1&&t.closeAsking()},onClose:t.closeAsking})}case`merge`:return(0,j.jsx)(kO,{title:i.arrange.mergeCells,message:i.arrange.mergeLoses,onClose:t.closeAsking,onDone:()=>{t.merge(c.how,!0),t.closeAsking()}});case`replace-data`:return(0,j.jsx)(kO,{title:i.drop.title,message:i.drop.replace,onClose:t.closeAsking,onDone:()=>{t.dropCells(c.from,c.to,c.copy,!0),t.closeAsking()}})}}function MO(e){let t=jC(),{a:n}=e,[r,i]=(0,A.useState)(e.replace?`replace`:`find`),[a,o]=(0,A.useState)(``),[s,c]=(0,A.useState)(``),[l,u]=(0,A.useState)(`sheet`),[d,f]=(0,A.useState)(`formulas`),[p,m]=(0,A.useState)(!1),[h,g]=(0,A.useState)(!1),[_,v]=(0,A.useState)({kind:`none`}),[y,b]=(0,A.useState)(),x=(0,A.useRef)(null);(0,A.useEffect)(()=>{x.current?.focus(),x.current?.select()},[r]);let S=()=>({what:a,matchCase:p,wholeCell:h,lookIn:r===`replace`?`formulas`:d,within:l}),ee=(e=!1)=>{let t=n.findNext(S(),e);v(t?{kind:`none`}:{kind:`notFound`}),x.current?.focus()},C=()=>{let e=n.findAll(S());b(e),v(e.length===0?{kind:`notFound`}:{kind:`found`,count:e.length})},te=()=>{let e=n.replaceOne(S(),s);v(e?{kind:`none`}:{kind:`notFound`})},w=()=>{let e=n.replaceAll(S(),s);b(void 0),v(e.kind===`none`?{kind:`notFound`}:e)},ne=_.kind===`notFound`?t.find.notFound:_.kind===`replaced`?t.find.replaced(_.count):_.kind===`found`?t.find.found(_.count):void 0;return(0,j.jsxs)(`div`,{className:`sheet-find`,role:`dialog`,"aria-label":t.find.title,"data-testid":`sheet-find`,"data-own-keys":``,onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`?(e.preventDefault(),n.closeFind()):e.key===`Enter`&&e.target instanceof HTMLInputElement&&(e.preventDefault(),ee(e.shiftKey))},children:[(0,j.jsx)(`div`,{className:`sheet-find-tabs`,role:`tablist`,children:[`find`,`replace`].map(e=>(0,j.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":r===e,"data-testid":`sheet-find-tab-${e}`,onClick:()=>{i(e),v({kind:`none`})},children:e===`find`?t.find.find:t.find.replace},e))}),(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:t.find.findWhat}),(0,j.jsx)(ht,{ref:x,value:a,spellCheck:!1,"data-testid":`sheet-find-what`,onChange:e=>{o(e.target.value),v({kind:`none`})}})]}),r===`replace`?(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:t.find.replaceWith}),(0,j.jsx)(ht,{value:s,spellCheck:!1,"data-testid":`sheet-find-with`,onChange:e=>{c(e.target.value)}})]}):null,(0,j.jsxs)(`div`,{className:`sheet-find-options`,children:[(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:t.find.within}),(0,j.jsxs)(pe,{value:l,onValueChange:e=>{u(e===`workbook`?`workbook`:`sheet`)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-find-within`,children:(0,j.jsx)(O,{})}),(0,j.jsxs)(ie,{children:[(0,j.jsx)(E,{value:`sheet`,children:t.find.sheet}),(0,j.jsx)(E,{value:`workbook`,children:t.find.workbook})]})]})]}),r===`find`?(0,j.jsxs)(`label`,{className:`sheet-field`,children:[(0,j.jsx)(`span`,{children:t.find.lookIn}),(0,j.jsxs)(pe,{value:d,onValueChange:e=>{f(e===`values`?`values`:`formulas`)},children:[(0,j.jsx)(T,{size:`sm`,"data-testid":`sheet-find-look-in`,children:(0,j.jsx)(O,{})}),(0,j.jsxs)(ie,{children:[(0,j.jsx)(E,{value:`formulas`,children:t.find.formulas}),(0,j.jsx)(E,{value:`values`,children:t.find.values})]})]})]}):null,(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:p,"data-testid":`sheet-find-case`,onCheckedChange:e=>{m(e===!0)}}),(0,j.jsx)(`span`,{children:t.find.matchCase})]}),(0,j.jsxs)(`label`,{className:`sheet-tick`,children:[(0,j.jsx)(me,{checked:h,"data-testid":`sheet-find-whole`,onCheckedChange:e=>{g(e===!0)}}),(0,j.jsx)(`span`,{children:t.find.wholeCell})]})]}),ne===void 0?null:(0,j.jsx)(`p`,{className:`sheet-find-said`,role:`status`,"data-testid":`sheet-find-said`,children:ne}),y&&y.length>0?(0,j.jsx)(`div`,{className:`sheet-find-list`,role:`listbox`,"data-testid":`sheet-find-list`,children:y.map(e=>(0,j.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":!1,"data-testid":`sheet-find-item`,onClick:()=>{n.showFound(e)},children:[(0,j.jsx)(`span`,{children:e.sheet}),(0,j.jsx)(`span`,{children:Ut({row:e.row,col:e.col})}),(0,j.jsx)(`span`,{className:`truncate`,children:e.text})]},`${e.sheet}!${String(e.row)}:${String(e.col)}`))}):null,(0,j.jsx)(MC,{cancel:{label:t.find.close,testid:`sheet-find-close`,onClick:n.closeFind},others:[...r===`replace`?[{label:t.find.replaceAll,testid:`sheet-find-replace-all`,disabled:!e.editable||a===``,onClick:w},{label:t.find.replaceOne,testid:`sheet-find-replace`,disabled:!e.editable||a===``,onClick:te}]:[{label:t.find.findAll,testid:`sheet-find-all`,disabled:a===``,onClick:C}]],main:{label:t.find.findNext,testid:`sheet-find-next`,disabled:a===``,onClick:()=>{ee()}}})]})}var NO=[`[data-testid="sheet-bar"]`,`[data-testid="sheet-formula-row"]`,`grid`,`.sheet-foot`],PO=`button:not(:disabled):not([tabindex="-1"]), input:not(:disabled):not([type="file"]), textarea:not(:disabled), [tabindex="0"]`;function FO(e){for(let t of e.querySelectorAll(PO)){let e=t.getBoundingClientRect();if(e.width>0&&e.height>0)return t}}function IO(e,t,n){let r=document.activeElement,i=e.querySelector(`[data-testid="sheet-sink"]`),a=NO.findIndex(t=>t===`grid`?r===i:r!==null&&e.querySelector(t)?.contains(r)===!0);for(let r=1;r<=NO.length;r++){let i=NO[(a+(t?-r:r)+NO.length*2)%NO.length];if(i===`grid`){n();return}let o=i===void 0?null:e.querySelector(i),s=o?FO(o):void 0;if(s){s.focus();return}}}var LO=[.5,.75,.9,1,1.25,1.5,2];function RO(e,t){return(t>0?LO.find(t=>t>e):LO.findLast(t=>t<e))??e}function zO(e){let t=typeof e==`string`?Number(e):void 0;return t!==void 0&&LO.includes(t)?t:void 0}var BO=5;function VO(e){let t=jC(),[n,r]=(0,A.useState)(!1);return e.renaming?(0,j.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,j.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,j.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&&(e.active||e.onShow(),r(!0))},children:[e.locked?(0,j.jsx)(ge,{className:`mr-1 inline size-3`,"data-testid":`sheet-tab-lock`}):null,e.name]}),(0,j.jsxs)(m,{open:n,onOpenChange:t=>{t&&!e.active&&e.onShow(),r(t)},children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.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,j.jsx)(re,{})})}),(0,j.jsxs)(d,{align:`start`,side:`top`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[(0,j.jsx)(b,{"data-testid":`sheet-tab-insert`,onSelect:e.onInsert,children:t.insert}),(0,j.jsx)(b,{disabled:e.locked,"data-testid":`sheet-tab-delete`,onSelect:e.onDelete,children:t.delete}),(0,j.jsx)(b,{disabled:e.locked,"data-testid":`sheet-tab-rename`,onSelect:()=>{e.onRenaming(!0)},children:t.rename}),(0,j.jsx)(b,{disabled:e.locked,"data-testid":`sheet-tab-duplicate`,onSelect:e.onDuplicate,children:t.duplicate}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{disabled:e.locked,"data-testid":`sheet-tab-color`,children:t.arrange.tabColor}),(0,j.jsxs)(C,{className:`p-2`,children:[(0,j.jsx)(`div`,{className:`grid grid-cols-10 gap-1`,children:[...iT,...aT].map(t=>(0,j.jsx)(b,{"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,j.jsx)(b,{className:`text-xs`,"data-testid":`sheet-tab-no-color`,onSelect:()=>{e.onColor(void 0)},children:t.arrange.noColor})]})]}),(0,j.jsx)(p,{}),(0,j.jsx)(b,{disabled:e.locked,"data-testid":`sheet-tab-hide`,onSelect:e.onHide,children:t.menu.hide}),(0,j.jsx)(b,{disabled:!e.onUnhide,"data-testid":`sheet-tab-unhide`,onSelect:()=>e.onUnhide?.(),children:t.arrange.unhideEllipsis}),(0,j.jsx)(ue,{})]})]})]})}function HO(e){let t=jC();return(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsx)(k,{icon:!0,"aria-label":t.allSheets,title:t.allSheets,"data-testid":`sheet-all`,children:(0,j.jsx)(At,{})})}),(0,j.jsxs)(d,{align:`start`,side:`top`,className:`max-h-80 text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[e.sheets.map(t=>(0,j.jsxs)(b,{"data-testid":`sheet-all-item`,"data-name":t.name,onSelect:()=>{e.onShow(t.name)},children:[(0,j.jsx)(ee,{className:t.name===e.shown?``:`invisible`}),t.name,t.locked?(0,j.jsx)(ge,{className:`ml-auto size-3`}):null]},t.name)),e.onUnhide?(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(p,{}),(0,j.jsx)(b,{"data-testid":`sheet-all-unhide`,onSelect:()=>e.onUnhide?.(),children:t.arrange.unhideEllipsis})]}):null]})]})}function UO(e){let t=jC(),[n,r]=(0,A.useState)(),[i,a]=(0,A.useState)(),o=(0,A.useRef)(null);(0,A.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)<BO||(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,j.jsxs)(`nav`,{className:`sheet-tabs-place`,"aria-label":t.sheetTabs,children:[(0,j.jsx)(k,{icon:!0,"aria-label":t.newSheet,title:t.newSheet,disabled:e.disabled,"data-testid":`sheet-add`,onClick:()=>{e.onAdd()},children:(0,j.jsx)(dt,{})}),(0,j.jsx)(HO,{sheets:e.sheets,shown:e.shown,onShow:e.onShow,onUnhide:e.onUnhide,onDone:e.onDone}),(0,j.jsx)(`div`,{ref:o,className:`sheet-tabs`,"data-testid":`sheet-tabs`,children:e.sheets.map((t,a)=>(0,j.jsx)(VO,{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 WO(e){let{stats:t,records:n,scenario:r}=e,i=jC();return(0,j.jsxs)(`div`,{className:`sheet-status`,"data-testid":`sheet-status`,children:[e.busy===void 0?null:(0,j.jsxs)(`span`,{className:`sheet-busy`,"data-testid":`sheet-busy`,children:[(0,j.jsx)(`span`,{className:`sheet-busy-track`,role:`progressbar`,"aria-label":e.busy,"aria-busy":!0,children:(0,j.jsx)(`span`,{className:`sheet-busy-bar`})}),e.busy]}),r===void 0?null:(0,j.jsx)(`button`,{type:`button`,className:`sheet-scenario-on`,"data-testid":`sheet-scenario-on`,onClick:e.onScenario,children:i.scenario.on(r)}),n?(0,j.jsx)(`span`,{"data-testid":`sheet-records`,children:i.filter.found(n.shown,n.total)}):null,t?(0,j.jsx)(KO,{...t}):null,(0,j.jsx)(GO,{zoom:e.zoom,onZoom:e.onZoom,onDone:e.onDone})]})}function GO(e){let t=jC(),n=e=>`${String(Math.round(e*100))}%`;return(0,j.jsxs)(`span`,{className:`sheet-zoom`,children:[(0,j.jsx)(k,{icon:!0,"aria-label":t.zoomOut,title:t.zoomOut,disabled:e.zoom<=(LO[0]??1),"data-testid":`sheet-zoom-out`,onClick:()=>{e.onZoom(RO(e.zoom,-1))},children:(0,j.jsx)(ct,{})}),(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsx)(`button`,{type:`button`,className:`sheet-zoom-size`,"aria-label":t.zoom,title:t.zoom,"data-testid":`sheet-zoom`,children:n(e.zoom)})}),(0,j.jsx)(d,{align:`end`,side:`top`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:LO.map(t=>(0,j.jsxs)(b,{"data-testid":`sheet-zoom-to`,"data-zoom":t,onSelect:()=>{e.onZoom(t)},children:[(0,j.jsx)(ee,{className:t===e.zoom?``:`invisible`}),n(t)]},t))})]}),(0,j.jsx)(k,{icon:!0,"aria-label":t.zoomIn,title:t.zoomIn,disabled:e.zoom>=(LO[LO.length-1]??1),"data-testid":`sheet-zoom-in`,onClick:()=>{e.onZoom(RO(e.zoom,1))},children:(0,j.jsx)(dt,{})})]})}function KO(e){let t=jC();return(0,j.jsxs)(j.Fragment,{children:[e.average===void 0?null:(0,j.jsxs)(`span`,{"data-testid":`sheet-average`,children:[t.average,`: `,e.average]}),(0,j.jsxs)(`span`,{"data-testid":`sheet-count`,children:[t.count,`: `,e.count]}),e.sum===void 0?null:(0,j.jsxs)(`span`,{"data-testid":`sheet-sum`,children:[t.sum,`: `,e.sum]})]})}function qO(e,t,n,r,i){if(QC(n))return;let a=0,o=0,s=0,{rows:c,columns:l}=t.spec,u=new Set;for(let n of r){let r=Math.min(n.right,t.columnsUsed-1);for(let d=n.left;d<=r;d++){if(l?.[Vt(d)]?.hidden===!0)continue;let[r,f]=t.span(d,n.top,n.bottom);for(let n=r;n<=f;n++){if(i.has(n)||c?.[String(n+1)]?.hidden===!0)continue;let r=yr(n,d);if(u.has(r))continue;u.add(r);let l=e.value(t,n,d);l!==null&&l!==``&&(a+=1,typeof l==`number`&&(o+=1,s+=l))}}}if(a===0)return;let d=t.lookAt(n.active.row,n.active.col).format,f=e=>Yr(e,d);return o===0?{count:a,average:void 0,sum:void 0}:{count:a,average:f(s/o),sum:f(s)}}function JO(e,t){if(t.size===0)return;let n=0;for(let t of e.filters)t.columns.size>0&&(n+=Math.min(t.area.bottom,e.lastRow)-t.area.top);return{shown:n-t.size,total:n}}function YO({c:e,a:t,zoom:n,onZoom:r}){let{ui:i,book:a,sheet:o,selection:s,areas:c,filtered:l,state:u}=e,d=(0,A.useMemo)(()=>qO(e.values,o,s,c,l),[s,o,u.revision,l]),f=(0,A.useMemo)(()=>JO(o,l),[o,l]);return(0,j.jsxs)(`div`,{className:`sheet-foot`,onMouseDown:e=>{e.target instanceof HTMLInputElement||e.preventDefault()},children:[(0,j.jsx)(UO,{sheets:a.workbook.sheets.filter(e=>e.spec.hidden!==!0).map(e=>({name:e.name,color:e.spec.tab,locked:e.generated})),shown:e.name,disabled:!e.editable,onShow:e=>{let n=i.editing;(!n||n.pick||Rw(n.text,n.caret)||t.commit())&&(t.showSheet(e),n?t.surfaceOf(n)?.focus({preventScroll:!0}):t.focusSink())},onAdd:t.addNewSheet,onRename:t.renameSheet,onDuplicate:t.addCopy,onDelete:t.deleteSheet,onMove:t.moveSheet,onHide:t.hideSheet,onUnhide:t.sheetsHidden().length>0?t.unhideSheet:void 0,onColor:t.tabColor,onDone:t.focusSink}),(0,j.jsx)(WO,{stats:d,records:f,scenario:a.scenario,busy:i.busy,onScenario:()=>{i.setAsking({kind:`scenarios`})},zoom:n,onZoom:r,onDone:t.focusSink})]})}var XO=8,ZO=(e,t,n,r)=>n===r?`${e} ${n}`:`${t} ${n} to ${r}`;function QO(e,t){let n=`${e.name}!${Wt(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=ZO(`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}, ${ZO(`row`,`rows`,s(c),s(t.bottom))} (${n})`}function $O(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>=XO)break outer;let r=Yr(t.value(n,e,i),n.lookAt(e,i).format);r!==``&&o.push(r)}return{name:QO(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(` | `)}}}function ek(e){let{dir:t,book:n,sheet:r,grid:i,zoom:a}=e,o=r?.name??``;s({freeze:()=>Promise.resolve({key:`${t}@${String(e.revision)}@${o}`,what:`The sheet ${t}, ${o}`,source:{path:`${t}/sheet.yaml`}}),pictures:()=>{let e=i.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:e=>{let o=i.current?.view(),s=i.current?.canvas()?.getBoundingClientRect();if(!o||!s||!r)return Promise.resolve([]);let c=o.shownRows(),l=o.shownColumns(),u;for(let t=c.first;t<=c.last;t++)for(let n=l.first;n<=l.last;n++){let r=o.rectOf({top:t,left:n,bottom:t,right:n});D(e,{x:s.x+r.x*a,y:s.y+r.y*a,width:r.width*a,height:r.height*a})&&(u=u?{top:Math.min(u.top,t),left:Math.min(u.left,n),bottom:Math.max(u.bottom,t),right:Math.max(u.right,n)}:{top:t,left:n,bottom:t,right:n})}return Promise.resolve(u?[$O(n.workbook,n.calc,r,u,t)]:[])}})}var tk={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`},nk=4;function rk(e){let t=tk[e];if(t!==void 0)return t===``?[]:t.split(`, `);let n=as.get(e);if(!n)return;let r=[],i=Math.min(n.max,Math.max(n.min,nk));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 ik(e,t){let n=e.length-1;return e[n]===`…`?Math.min(t,Math.max(0,n-1)):Math.min(t,n)}var ak=e=>`${String(e.top)},${String(e.left)},${String(e.bottom)},${String(e.right)}`;function ok({c:e,a:t,zoom:n,spillOn:r,sink:i,view:a}){let o=jC(),{ui:s,sheet:c,name:u,selection:f,area:p,areas:h,merges:g,book:_}=e,v=s.editing,y=v?.sheet===u||!v,x=v&&y?v.at:f.active,{row:S,col:ee}=f.active,C=(0,A.useMemo)(()=>v?Lw(v.text).map((e,t)=>({sheet:e.sheet??v.sheet,area:e.area,color:t%6})).filter(e=>e.sheet.toLowerCase()===u.toLowerCase()):[],[v,u]),te=QC(f)&&(!g.length||!c.mergeAt(S,ee)),w=c.mergeAt(S,ee)??{top:S,left:ee,bottom:S,right:ee},ne=te?[]:[...h.slice(0,-1),{...p,bottom:w.top-1},{...p,top:w.bottom+1},{top:w.top,bottom:w.bottom,left:p.left,right:w.left-1},{top:w.top,bottom:w.bottom,left:w.right+1,right:p.right}].filter(e=>e.top<=e.bottom&&e.left<=e.right),T=v?.at??f.active,E=ak(c.mergeAt(x.row,x.col)??{top:x.row,left:x.col,bottom:x.row,right:x.col}),D=ak({top:T.row+1,left:T.col,bottom:T.row+1,right:T.col}),re=c.validationAt(S,ee),O=!v&&re&&re.spec.prompt?.show!==!1?re.spec.prompt:void 0,k=!v&&e.editable&&!e.locked&&re?.spec.type===`list`&&re.spec.dropdown!==!1,ie=!v&&e.editable&&h.length===1&&!dw(p)&&!fw(p),ae=t.completions(),oe=v?.caret??0,se=v?Ww(v.text,oe):void 0,ce=se?rk(se.name):void 0,le=ae.length>0?s.choice%ae.length:0,ue=s.gesture.kind===`move`&&s.gesture.moved?s.gesture.to:void 0,de=s.offer,fe=s.filled,pe=s.copied;return(0,j.jsxs)(j.Fragment,{children:[pe?.sheet===u?(0,j.jsx)(`div`,{className:`sheet-copied`,"data-testid":`sheet-copied`,"data-area":ak(pe.area)}):null,C.map((e,t)=>(0,j.jsx)(`div`,{className:`sheet-ref`,"data-testid":`sheet-ref`,"data-color":e.color,"data-area":ak(e.area)},`${String(t)}:${Wt(e.area)}`)),r?.spill&&!v?(0,j.jsx)(`div`,{className:`sheet-spill`,"data-testid":`sheet-spill`,"data-area":ak(r.spill)}):null,r?.blocked&&!v?(0,j.jsx)(`div`,{className:`sheet-spill`,"data-blocked":``,"data-testid":`sheet-spill-blocked`,title:o.spillBlocked,"data-area":ak(r.blocked)}):null,ne.map(e=>(0,j.jsx)(`div`,{className:`sheet-selection-fill`,"data-testid":`sheet-selection-fill`,"data-area":ak(e)},ak(e))),(0,j.jsx)(`div`,{className:`sheet-selection`,"data-testid":`sheet-selection`,"data-address":Wt(p),"data-areas":h.map(Wt).join(` `),"data-area":ak(p)}),ue?(0,j.jsx)(`div`,{className:`sheet-move-to`,"data-testid":`sheet-move-to`,"data-area":ak(ue)}):null,s.fillTo?(0,j.jsx)(`div`,{className:`sheet-fill-to`,"data-testid":`sheet-fill-to`,"data-area":ak(s.fillTo)}):null,ie?(0,j.jsx)(`div`,{className:`sheet-handle`,"data-testid":`sheet-handle`,"data-corner":`foot`,"data-size":`free`,"data-area":ak(p),onPointerDown:t.startFill,onDoubleClick:t.fillDown}):null,c.charts.map(r=>(0,j.jsx)(oE,{zoom:n,calc:_.calc,sheet:c,chart:r,revision:e.state.revision,view:a,selected:s.chartOn===r.index,disabled:!e.editable||e.locked,onSelect:()=>{(!v||t.commit())&&(t.selectChart(r.index),t.focusSink())},onOpen:()=>{(!v||t.commit())&&t.openChartPane(r.index)},onMenu:(e,n)=>{(!v||t.commit())&&(t.selectChart(r.index),s.setChartMenu({x:e,y:n}))},onPlaced:(e,n)=>{t.placeChart(r.index,e,n)}},r.index)),fe?.sheet===u&&!v?(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsx)(`button`,{type:`button`,className:`sheet-fill-options`,"aria-label":o.fill.options,title:o.fill.options,"data-testid":`sheet-fill-options`,"data-corner":`foot`,"data-size":`free`,"data-area":ak(fe.to)})}),(0,j.jsxs)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:e=>{e.preventDefault(),t.focusSink()},children:[(0,j.jsx)(b,{"data-testid":`sheet-fill-copy`,onSelect:()=>{t.refill(`copy`)},children:o.fill.copy}),(0,j.jsx)(b,{"data-testid":`sheet-fill-series`,onSelect:()=>{t.refill(`series`)},children:o.fill.series})]})]}):null,k?(0,j.jsx)(`button`,{type:`button`,className:`sheet-list-arrow`,"aria-label":o.menu.pickFromList,title:o.menu.pickFromList,"data-testid":`sheet-list-arrow`,"data-corner":`side`,"data-size":`free`,"data-area":ak({top:S,left:ee,bottom:S,right:ee}),onPointerDown:e=>{e.preventDefault(),t.openList(f.active)}}):null,O&&(O.title!==void 0||O.message!==void 0)?(0,j.jsxs)(`div`,{className:`sheet-hint sheet-prompt`,"data-testid":`sheet-prompt`,"data-area":D,"data-size":`free`,children:[O.title===void 0?null:(0,j.jsx)(`b`,{children:O.title}),O.message===void 0?null:(0,j.jsx)(`p`,{children:O.message})]}):null,(0,j.jsx)(`textarea`,{ref:i,className:`sheet-sink`,"data-testid":`sheet-sink`,"data-sink":``,"data-area":E,"data-size":`free`,"data-editing":v&&y?``:void 0,rows:1,spellCheck:!1,"aria-label":t.cellLabel(),"aria-roledescription":v?void 0:o.a11y.cellRole,onInput:n=>{let r=n.currentTarget;v?(s.setEditing({...v,pick:void 0,text:r.value,caret:r.selectionStart,problem:!1}),s.setChoice(0)):r.value!==``&&e.editable?t.begin({text:r.value,mode:`enter`}):r.value=``},onSelect:e=>{let t=e.currentTarget.selectionStart;s.setEditing(e=>e&&e.caret!==t?{...e,caret:t}:e)},onCompositionStart:()=>{!v&&e.editable&&t.begin({text:``,mode:`enter`})},onCompositionEnd:e=>{v?.text===``&&e.data===``&&t.stop()}}),v&&y&&ae.length>0?(0,j.jsxs)(`div`,{className:`sheet-hint sheet-functions`,"data-testid":`sheet-functions`,"data-area":D,"data-size":`free`,role:`listbox`,"aria-label":o.insertFunction,children:[(0,j.jsx)(`div`,{className:`sheet-functions-list`,children:ae.map((e,n)=>(0,j.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":n===le,"data-on":n===le?``:void 0,ref:e=>{n===le&&e?.scrollIntoView({block:`nearest`})},onPointerDown:n=>{n.preventDefault(),t.accept(v,e)},children:e},e))}),(0,j.jsx)(sk,{name:ae[le]})]}):v&&y&&se&&ce?(0,j.jsxs)(`div`,{className:`sheet-hint`,"data-testid":`sheet-arguments`,"data-area":D,"data-size":`free`,children:[se.name,`(`,ce.map((e,t)=>(0,j.jsxs)(`span`,{children:[t>0?`, `:``,t===ik(ce,se.argument)?(0,j.jsx)(`b`,{children:e}):e]},e)),`)`]}):null,de?.sheet===u?(0,j.jsx)(`button`,{type:`button`,className:`sheet-offer`,"data-testid":`sheet-overwrite`,"data-area":ak({top:de.row+1,left:de.col,bottom:de.row+1,right:de.col}),"data-size":`free`,onClick:t.overwrite,children:o.overwrite}):null]})}function sk({name:e}){let t=jC();if(e===void 0)return null;let n=t.functions[e],r=rk(e),i=n??(r?`${e}(${r.join(`, `)})`:void 0);return i===void 0?null:(0,j.jsx)(`p`,{className:`sheet-function-line`,"data-testid":`sheet-function-line`,children:i})}function ck(e){let{onProbe:t,book:n,sheet:r,grid:i,invalid:a}=e;(0,A.useEffect)(()=>{let e=e=>{let t=e.lastIndexOf(`!`);return{on:t<0?r:n.workbook.sheet(e.slice(0,t)),p:Gt(e.slice(t+1))}};t?.({settled:()=>n.pending===0,shown:t=>{let{on:r,p:i}=e(t);return!r||!i?``:Yr(n.values.value(r,i.row,i.col),r.lookAt(i.row,i.col).format)},input:t=>{let{on:r,p:i}=e(t);return r&&i?no(n,r,i.row,i.col):``},view:()=>{let e=i.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)=>i.current?.pageRect({top:e,left:t,bottom:e,right:t}),draw:()=>i.current?.draw()??0,look:e=>{let t=Gt(e);if(!r||!t)return`{}`;let i=new Po(r,n.calc).at(t.row,t.col);return JSON.stringify({...CT(r,t.row,t.col),...i?.look,...i?.scale===void 0?{}:{fill:i.scale},...i?.bar?{bar:i.bar}:{},...i?.icon?{icon:i.icon}:{},...a.has(yr(t.row,t.col))?{invalid:!0}:{}})},hiddenRows:()=>{let e=i.current?.view(),t=[];for(let n=0;n<=(r?.lastRow??0);n++)e?.rows.sizeOf(n)===0&&t.push(n);return t}})})}function lk(e){let[t,n]=(0,A.useState)(),[r,i]=(0,A.useState)(!1),a=t??e.value,o=t=>{n(void 0),i(!1),t.trim()!==``&&t!==e.value&&e.onPick(t.trim()),e.onDone()};return(0,j.jsxs)(ae,{open:r,onOpenChange:i,children:[(0,j.jsx)(fe,{asChild:!0,children:(0,j.jsxs)(`span`,{className:`sheet-combo ${e.className??``}`,"data-own-keys":``,"data-disabled":e.disabled?``:void 0,children:[(0,j.jsx)(`input`,{className:`sheet-combo-field`,"aria-label":e.label,title:e.label,role:`combobox`,"aria-expanded":r,"aria-autocomplete":`list`,disabled:e.disabled,spellCheck:!1,value:a,"data-testid":e.testid,onFocus:e=>{e.currentTarget.select()},onChange:e=>{n(e.target.value)},onBlur:()=>{n(void 0)},onKeyDown:t=>{t.stopPropagation(),t.key===`Enter`||t.key===`Tab`?(t.preventDefault(),o(a)):t.key===`Escape`?(t.preventDefault(),n(void 0),i(!1),e.onDone()):t.key===`ArrowDown`&&t.altKey&&(t.preventDefault(),i(!0))}}),(0,j.jsx)(`button`,{type:`button`,className:`sheet-combo-open`,tabIndex:-1,"aria-label":e.label,disabled:e.disabled,"data-testid":`${e.testid}-list`,onMouseDown:e=>{e.preventDefault()},onClick:()=>{i(e=>!e)},children:(0,j.jsx)(re,{})})]})}),(0,j.jsx)(he,{align:`start`,className:`sheet-combo-list`,role:`listbox`,"aria-label":e.label,onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},children:e.options.map(t=>(0,j.jsx)(`button`,{type:`button`,role:`option`,"aria-selected":t===e.value,"data-on":t===e.value?``:void 0,"data-testid":`${e.testid}-option`,"data-value":t,onMouseDown:e=>{e.preventDefault()},onClick:()=>{o(t)},children:t},t))})]})}function uk(e){let t=Number(e.replace(`,`,`.`));if(!(!Number.isFinite(t)||t<1||t>409))return Math.round(t*2)/2}var dk=[`#638EC6`,`#63C384`,`#FF555A`,`#FFB628`,`#008AEF`,`#D6007B`],fk=[{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`]}],pk=[`3Arrows`,`5Arrows`,`3TrafficLights1`,`4TrafficLights`,`3Symbols`,`3Flags`,`5Rating`];function mk(e){let t=BC(e.id),n=HC(e.id),r=e.icon;return(0,j.jsx)(k,{icon:!0,"aria-label":t.label,"aria-keyshortcuts":t.aria,title:n,disabled:e.disabled||!t.enabled,"data-testid":e.testid,onClick:t.run,children:(0,j.jsx)(r,{})})}function hk(e){let t=BC(e.command),n=HC(e.command),r=e.icon;return(0,j.jsx)(k,{icon:!0,"aria-label":t.label,"aria-pressed":e.on,"aria-keyshortcuts":t.aria,title:n,disabled:e.disabled,"data-testid":e.testid,onClick:e.onClick,children:(0,j.jsx)(r,{})})}function gk(e){let t=e.icon;return(0,j.jsx)(k,{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,j.jsx)(t,{})})}function _k(e){let t=e.icon,n=t=>(0,j.jsx)(`button`,{type:`button`,"aria-label":t,"data-color":t,className:a(`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,j.jsxs)(ae,{children:[(0,j.jsx)(se,{asChild:!0,children:(0,j.jsxs)(k,{icon:!0,className:`relative`,"aria-label":e.label,title:e.label,disabled:e.disabled,"data-testid":e.testid,children:[(0,j.jsx)(t,{}),(0,j.jsx)(`span`,{className:`absolute inset-x-1.5 bottom-0.5 h-0.5 rounded-full`,style:{background:e.value??`currentColor`}})]})}),(0,j.jsxs)(he,{align:`start`,className:`w-auto p-2`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:[(0,j.jsxs)(`div`,{className:`grid grid-cols-10 gap-1`,"data-testid":`${e.testid}-colors`,children:[iT.map(n),aT.map(n)]}),(0,j.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 vk(e){let t=e.icon;return(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{icon:e.words!==!0,"aria-label":e.label,title:e.label,disabled:e.disabled,"data-testid":e.testid,children:[(0,j.jsx)(t,{}),e.words===!0?(0,j.jsx)(`span`,{className:`@max-[72rem]:hidden`,children:e.label}):null]})}),(0,j.jsx)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:t=>{t.preventDefault(),e.onDone()},children:e.children})]})}var yk=new Set([`right`,`thickOutside`]);function bk(e){let t=jC(),{look:n,disabled:r,onLook:i}=e,a=e=>n[e]===!0,s=n.underline!==void 0&&n.underline!==!1,c=rT(n.format),u=n.align,f=e=>{i({align:u===e?void 0:e})},h=t=>{t.preventDefault(),e.onDone()},g=typeof n.fill==`string`?n.fill:void 0,_=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b,{"data-testid":`sheet-insert-rows`,onSelect:()=>{e.onInsert(`rows`)},children:t.insertRows}),(0,j.jsx)(b,{"data-testid":`sheet-insert-columns`,onSelect:()=>{e.onInsert(`columns`)},children:t.insertColumns}),(0,j.jsx)(b,{"data-testid":`sheet-insert-sheet`,onSelect:()=>{e.onInsert(`sheet`)},children:t.insertSheet})]}),v=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b,{"data-testid":`sheet-delete-rows`,onSelect:()=>{e.onDelete(`rows`)},children:t.deleteRows}),(0,j.jsx)(b,{"data-testid":`sheet-delete-columns`,onSelect:()=>{e.onDelete(`columns`)},children:t.deleteColumns}),(0,j.jsx)(b,{"data-testid":`sheet-delete-sheet`,onSelect:()=>{e.onDelete(`sheet`)},children:t.deleteSheet})]}),y=(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(b,{"data-testid":`sheet-row-height`,onSelect:e.onRowHeight,children:t.menu.rowHeight}),(0,j.jsx)(b,{onSelect:e.onFitRows,children:t.arrange.fitRows}),(0,j.jsx)(b,{"data-testid":`sheet-column-width`,onSelect:e.onColumnWidth,children:t.menu.columnWidth}),(0,j.jsx)(b,{onSelect:e.onFitColumns,children:t.arrange.fitColumns}),(0,j.jsx)(p,{}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-hide-menu`,children:t.arrange.hideUnhide}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(b,{"data-testid":`sheet-hide-rows`,onSelect:()=>{e.onHide(`rows`)},children:t.arrange.hideRows}),(0,j.jsx)(b,{"data-testid":`sheet-hide-columns`,onSelect:()=>{e.onHide(`columns`)},children:t.arrange.hideColumns}),(0,j.jsx)(b,{"data-testid":`sheet-hide-sheet`,onSelect:()=>{e.onHide(`sheet`)},children:t.arrange.hideSheet}),(0,j.jsx)(p,{}),(0,j.jsx)(b,{"data-testid":`sheet-unhide-rows`,onSelect:()=>{e.onUnhide(`rows`)},children:t.arrange.unhideRows}),(0,j.jsx)(b,{"data-testid":`sheet-unhide-columns`,onSelect:()=>{e.onUnhide(`columns`)},children:t.arrange.unhideColumns}),(0,j.jsx)(b,{"data-testid":`sheet-unhide-sheet`,onSelect:()=>{e.onUnhide(`sheet`)},children:t.arrange.unhideSheet})]})]}),(0,j.jsx)(p,{}),(0,j.jsx)(b,{"data-testid":`sheet-format-cells-item`,onSelect:()=>{e.onFormatCells(`number`)},children:t.menu.formatCells})]});return(0,j.jsxs)(ce,{testid:`sheet-bar`,onMouseDown:e=>{e.target instanceof HTMLInputElement||e.preventDefault()},children:[(0,j.jsxs)(le,{id:`undo`,keep:!0,children:[(0,j.jsx)(mk,{id:`edit.undo`,icon:be,disabled:!e.canUndo,testid:`sheet-undo`}),(0,j.jsx)(mk,{id:`edit.redo`,icon:ke,disabled:!e.canRedo,testid:`sheet-redo`})]}),(0,j.jsxs)(le,{id:`font`,priority:6,children:[(0,j.jsx)(lk,{label:t.font,value:n.font??`Calibri`,options:[...new Set([...qw,n.font??`Calibri`])],disabled:r,className:`w-28 shrink-0`,testid:`sheet-font`,onPick:e=>(i({font:e===`Calibri`?void 0:e}),!0),onDone:e.onDone}),(0,j.jsx)(lk,{label:t.fontSize,value:String(n.size??11),options:[...new Set([...Jw,n.size??11])].sort((e,t)=>e-t).map(String),disabled:r,className:`w-16 shrink-0`,testid:`sheet-size`,onPick:e=>{let t=uk(e);return t!==void 0&&(i({size:t===11?void 0:t}),!0)},onDone:e.onDone})]}),(0,j.jsxs)(le,{id:`style`,priority:7,children:[(0,j.jsx)(hk,{command:`format.bold`,icon:Ae,on:a(`bold`),disabled:r,testid:`sheet-bold`,onClick:()=>{i({bold:!a(`bold`)||void 0})}}),(0,j.jsx)(hk,{command:`format.italic`,icon:Ue,on:a(`italic`),disabled:r,testid:`sheet-italic`,onClick:()=>{i({italic:!a(`italic`)||void 0})}}),(0,j.jsx)(hk,{command:`format.underline`,icon:ye,on:s,disabled:r,testid:`sheet-underline`,onClick:()=>{i({underline:!s||void 0})}}),(0,j.jsxs)(vk,{label:t.borders.title,icon:Tt,disabled:r,testid:`sheet-borders`,onDone:e.onDone,children:[Yx.map(n=>(0,j.jsxs)(`span`,{children:[(0,j.jsx)(b,{"data-testid":`sheet-border-${n}`,onSelect:()=>{e.onBorders(n)},children:t.borders[n]}),yk.has(n)?(0,j.jsx)(p,{}):null]},n)),(0,j.jsx)(p,{}),(0,j.jsx)(b,{"data-testid":`sheet-border-more`,onSelect:()=>{e.onFormatCells(`border`)},children:t.borders.more})]}),(0,j.jsx)(_k,{label:t.fillColor,icon:We,none:t.noFill,value:g,disabled:r,testid:`sheet-fill`,onPick:e=>{i({fill:e})},onDone:e.onDone}),(0,j.jsx)(_k,{label:t.fontColor,icon:xe,none:t.automatic,value:n.color,disabled:r,testid:`sheet-color`,onPick:e=>{i({color:e})},onDone:e.onDone})]}),(0,j.jsxs)(le,{id:`alignment`,priority:5,children:[(0,j.jsxs)(`span`,{className:`sheet-align-three`,children:[(0,j.jsx)(gk,{label:t.alignLeft,icon:st,on:u===`left`,disabled:r,testid:`sheet-align-left`,onClick:()=>{f(`left`)}}),(0,j.jsx)(gk,{label:t.center,icon:ot,on:u===`center`,disabled:r,testid:`sheet-align-center`,onClick:()=>{f(`center`)}}),(0,j.jsx)(gk,{label:t.alignRight,icon:at,on:u===`right`,disabled:r,testid:`sheet-align-right`,onClick:()=>{f(`right`)}})]}),(0,j.jsx)(`span`,{className:`sheet-align-one`,children:(0,j.jsx)(vk,{label:t.formatCells.tabs.alignment,icon:u===`right`?at:u===`center`?ot:st,disabled:r,testid:`sheet-align-menu`,onDone:e.onDone,children:[[`left`,st,t.alignLeft],[`center`,ot,t.center],[`right`,at,t.alignRight]].map(([e,t,n])=>(0,j.jsxs)(b,{"data-testid":`sheet-align-menu-${e}`,onSelect:()=>{f(e)},children:[(0,j.jsx)(t,{}),n]},e))})}),(0,j.jsx)(vk,{label:t.formatCells.vertical,icon:n.valign===`top`?we:n.valign===`center`?De:Ee,disabled:r,testid:`sheet-valign`,onDone:e.onDone,children:[[`top`,we],[`center`,De],[`bottom`,Ee]].map(([e,n])=>(0,j.jsxs)(b,{"data-testid":`sheet-valign-${e}`,onSelect:()=>{i({valign:e===`bottom`?void 0:e})},children:[(0,j.jsx)(n,{}),t.formatCells.valigns[e]]},e))}),(0,j.jsx)(gk,{label:t.wrapText,icon:Rt,on:n.wrap===!0,disabled:r,testid:`sheet-wrap`,onClick:()=>{i({wrap:n.wrap!==!0||void 0})}}),(0,j.jsx)(gk,{label:t.arrange.mergeCenter,icon:Lt,on:e.merged,disabled:r,testid:`sheet-merge`,onClick:()=>{e.merged?e.onUnmerge():e.onMerge(`center`)}}),(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsx)(k,{icon:!0,className:`w-4`,"aria-label":t.arrange.mergeMenu,title:t.arrange.mergeMenu,disabled:r,"data-testid":`sheet-merge-menu`,children:(0,j.jsx)(re,{})})}),(0,j.jsxs)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:h,children:[(0,j.jsx)(b,{"data-testid":`sheet-merge-center`,onSelect:()=>{e.onMerge(`center`)},children:t.arrange.mergeCenter}),(0,j.jsx)(b,{"data-testid":`sheet-merge-across`,onSelect:()=>{e.onMerge(`across`)},children:t.arrange.mergeAcross}),(0,j.jsx)(b,{"data-testid":`sheet-merge-cells`,onSelect:()=>{e.onMerge(`cells`)},children:t.arrange.mergeCells}),(0,j.jsx)(b,{"data-testid":`sheet-unmerge`,onSelect:e.onUnmerge,children:t.arrange.unmerge})]})]})]}),(0,j.jsx)(le,{id:`number`,priority:4,children:(0,j.jsxs)(pe,{value:c??`custom`,disabled:r,onValueChange:t=>{if(t===`more`){e.onFormatCells(`number`);return}let n=nT.find(e=>e.id===t);n&&i({format:n.code})},children:[(0,j.jsx)(ne,{"aria-label":t.numberFormat,title:t.numberFormat,className:`w-32 shrink-0`,"data-testid":`sheet-format`,children:(0,j.jsx)(O,{children:(0,j.jsx)(`span`,{className:`truncate`,children:c===void 0?t.custom:t.formats[c]})})}),(0,j.jsxs)(ie,{position:`popper`,align:`start`,onCloseAutoFocus:h,children:[c===void 0?(0,j.jsx)(E,{value:`custom`,className:`text-xs`,children:t.custom}):null,nT.map(n=>(0,j.jsx)(E,{value:n.id,className:`text-xs`,"data-testid":`sheet-format-${n.id}`,children:(0,j.jsxs)(`span`,{className:`flex w-52 justify-between gap-4`,children:[(0,j.jsx)(`span`,{children:t.formats[n.id]}),(0,j.jsx)(`span`,{className:`text-lead truncate`,children:xk(e.value,n.code)})]})},n.id)),(0,j.jsx)(E,{value:`more`,className:`text-xs`,"data-testid":`sheet-format-more`,children:t.number.more})]})]})}),(0,j.jsxs)(le,{id:`number-styles`,priority:3,children:[(0,j.jsx)(gk,{label:t.number.accounting,icon:St,on:c===`accounting`,disabled:r,testid:`sheet-accounting`,onClick:()=>{i({format:PT})}}),(0,j.jsx)(gk,{label:t.number.percent,icon:jt,on:n.format===`0%`,disabled:r,testid:`sheet-percent`,onClick:()=>{i({format:`0%`})}}),(0,j.jsx)(k,{icon:!0,"aria-label":t.number.comma,title:t.number.comma,"aria-pressed":n.format===NT,disabled:r,"data-testid":`sheet-comma`,className:`font-semibold`,onClick:()=>{i({format:NT})},children:`,`}),(0,j.jsx)(k,{icon:!0,"aria-label":t.number.increaseDecimal,title:t.number.increaseDecimal,disabled:r,"data-testid":`sheet-more-decimals`,onClick:()=>{e.onDecimals(1)},children:(0,j.jsx)(xt,{})}),(0,j.jsx)(k,{icon:!0,"aria-label":t.number.decreaseDecimal,title:t.number.decreaseDecimal,disabled:r,"data-testid":`sheet-less-decimals`,onClick:()=>{e.onDecimals(-1)},children:(0,j.jsx)(bt,{})})]}),(0,j.jsx)(le,{id:`styles`,priority:1,children:(0,j.jsxs)(vk,{label:t.rules.title,icon:It,disabled:r,testid:`sheet-rules`,onDone:e.onDone,children:[(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-rules-highlight`,children:t.rules.highlight}),(0,j.jsx)(C,{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,j.jsx)(b,{"data-testid":`sheet-rule-${t}`,onSelect:()=>{e.onRule(t)},children:n},t))})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-rules-top`,children:t.rules.topBottom}),(0,j.jsx)(C,{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,j.jsx)(b,{"data-testid":`sheet-rule-${t}`,onSelect:()=>{e.onRule(t)},children:n},t))})]}),(0,j.jsx)(p,{}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-rules-bars`,children:t.rules.dataBars}),(0,j.jsx)(C,{className:`text-xs`,children:dk.map((t,n)=>(0,j.jsx)(b,{"data-testid":`sheet-bar-${String(n)}`,onSelect:()=>{e.onDataBar(t)},children:(0,j.jsx)(`span`,{className:`h-3 w-16 rounded-sm`,style:{background:`linear-gradient(90deg, ${t}, ${t}40)`}})},t))})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-rules-scales`,children:t.rules.colorScales}),(0,j.jsx)(C,{className:`text-xs`,children:fk.map(({id:n,colors:r})=>(0,j.jsxs)(b,{"data-testid":`sheet-scale-${n}`,onSelect:()=>{e.onColorScale(r)},children:[(0,j.jsx)(`span`,{className:`h-3 w-16 rounded-sm`,style:{background:`linear-gradient(90deg, ${r.join(`, `)})`}}),t.rules.scales[n]]},n))})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-rules-icons`,children:t.rules.iconSets}),(0,j.jsx)(C,{className:`text-xs`,children:pk.map(n=>(0,j.jsx)(b,{"data-testid":`sheet-icons-${n}`,onSelect:()=>{e.onIcons(n)},children:t.rules.icons[n]},n))})]}),(0,j.jsx)(p,{}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-rules-clear`,children:t.rules.clearRules}),(0,j.jsxs)(C,{className:`text-xs`,children:[(0,j.jsx)(b,{"data-testid":`sheet-rules-clear-selected`,onSelect:()=>{e.onClearRules(!1)},children:t.rules.clearSelected}),(0,j.jsx)(b,{"data-testid":`sheet-rules-clear-sheet`,onSelect:()=>{e.onClearRules(!0)},children:t.rules.clearSheet})]})]})]})}),(0,j.jsxs)(le,{id:`cells`,priority:2,children:[(0,j.jsxs)(`span`,{className:`sheet-cells`,children:[(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{disabled:r,"data-testid":`sheet-insert`,children:[t.insert,(0,j.jsx)(re,{})]})}),(0,j.jsx)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:h,children:_})]}),(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{disabled:r,"data-testid":`sheet-delete`,children:[t.delete,(0,j.jsx)(re,{})]})}),(0,j.jsx)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:h,children:v})]}),(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{disabled:r,"data-testid":`sheet-format-menu`,children:[t.arrange.format,(0,j.jsx)(re,{})]})}),(0,j.jsx)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:h,children:y})]})]}),(0,j.jsx)(`span`,{className:`sheet-cells-one`,children:(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.jsxs)(k,{disabled:r,"data-testid":`sheet-cells`,children:[t.arrange.cells,(0,j.jsx)(re,{})]})}),(0,j.jsxs)(d,{align:`start`,className:`text-xs`,onCloseAutoFocus:h,children:[(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-cells-insert`,children:t.insert}),(0,j.jsx)(C,{className:`text-xs`,children:_})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-cells-delete`,children:t.delete}),(0,j.jsx)(C,{className:`text-xs`,children:v})]}),(0,j.jsxs)(o,{children:[(0,j.jsx)(w,{"data-testid":`sheet-cells-format`,children:t.arrange.format}),(0,j.jsx)(C,{className:`text-xs`,children:y})]})]})]})})]}),(0,j.jsxs)(le,{id:`editing`,priority:1,children:[(0,j.jsxs)(vk,{label:t.sortFilter.title,icon:wt,disabled:r,testid:`sheet-sort-filter`,onDone:e.onDone,children:[(0,j.jsx)(VC,{id:`data.sortAscending`,testid:`sheet-sort-up`}),(0,j.jsx)(VC,{id:`data.sortDescending`,testid:`sheet-sort-down`}),(0,j.jsx)(VC,{id:`data.customSort`,testid:`sheet-sort-custom`}),(0,j.jsx)(p,{}),(0,j.jsx)(VC,{id:`data.filter`,testid:`sheet-filter`}),(0,j.jsx)(VC,{id:`data.clearFilter`,testid:`sheet-filter-clear-all`,disabled:!e.filtering}),(0,j.jsx)(b,{disabled:!e.filtered,"data-testid":`sheet-filter-reapply`,onSelect:e.onReapply,children:t.sortFilter.reapply})]}),(0,j.jsxs)(vk,{label:t.find.findSelect,icon:Pt,disabled:!1,testid:`sheet-find-select`,onDone:e.onDone,children:[(0,j.jsx)(VC,{id:`edit.find`,testid:`sheet-find-item`}),(0,j.jsx)(VC,{id:`edit.replace`,testid:`sheet-replace-item`})]}),(0,j.jsxs)(vk,{label:t.arrange.freezePanes,icon:Mt,disabled:r,testid:`sheet-freeze`,onDone:e.onDone,children:[(0,j.jsx)(b,{"data-testid":`sheet-freeze-panes`,onSelect:()=>{e.onFreeze(e.frozen?`none`:`panes`)},children:e.frozen?t.arrange.unfreeze:t.arrange.freezePanes}),(0,j.jsx)(b,{"data-testid":`sheet-freeze-top`,onSelect:()=>{e.onFreeze(`topRow`)},children:t.arrange.freezeTopRow}),(0,j.jsx)(b,{"data-testid":`sheet-freeze-first`,onSelect:()=>{e.onFreeze(`firstColumn`)},children:t.arrange.freezeFirstColumn})]}),(0,j.jsx)(k,{icon:!0,"aria-label":t.validation.title,title:t.validation.title,disabled:r,"data-testid":`sheet-validation-button`,onClick:e.onValidation,children:(0,j.jsx)(kt,{})})]}),(0,j.jsxs)(le,{id:`charts`,priority:0,children:[(0,j.jsx)(lE,{disabled:r,onInsert:e.onChart,onDone:e.onDone}),e.onScenarios?(0,j.jsx)(k,{icon:!0,"aria-label":t.scenario.manager,title:t.scenario.manager,"data-testid":`sheet-scenarios-button`,onClick:e.onScenarios,children:(0,j.jsx)(Dt,{})}):null]})]})}var xk=(e,t)=>e===null?``:Yr(e,t);function Sk({c:e,a:t,merged:n}){let{ui:r,sheet:i,book:a,state:o,name:s}=e,c=r.editing,l=t.shownChart(),{row:u,col:d}=e.selection.active,f=Object.keys(a.workbook.file.scenarios??{}).length>0;return(0,j.jsx)(oe,{start:(0,j.jsxs)(`div`,{className:`@container relative flex min-w-0 flex-1 items-center`,children:[l?(0,j.jsx)(`div`,{className:`sheet-chart-over`,children:(0,j.jsx)(dE,{chart:l,calc:a.calc,sheet:i,disabled:!e.editable||e.locked,onType:e=>{t.patchChart(l.index,{type:e})},onTitle:e=>{t.patchChart(l.index,{title:e})},onLegend:e=>{t.patchChart(l.index,{legend:e})},onData:e=>t.chartData(l,e),onDone:t.focusSink},l.index)}):null,(0,j.jsx)(`div`,{className:`flex min-w-0 flex-1`,style:l?{visibility:`hidden`}:void 0,children:(0,j.jsx)(bk,{look:t.activeLook(),value:e.values.value(i,u,d),disabled:!e.editable||c!==void 0||e.locked,canUndo:o.canUndo&&!c,canRedo:o.canRedo&&!c,frozen:i.freeze!==void 0,filtered:i.filters.length>0,filtering:i.filters.some(e=>e.columns.size>0),merged:n,onUndo:t.undo,onRedo:t.redo,onLook:t.look,onInsert:t.insertBand,onDelete:t.deleteBand,onBorders:t.borders,onMerge:t.merge,onUnmerge:t.unmerge,onDecimals:t.decimals,onSort:t.sort,onCustomSort:t.customSort,onFilter:t.filterToggle,onClearFilter:t.clearFilter,onReapply:e.files.reapply,onFreeze:t.freeze,onRule:e=>{r.setAsking({kind:`rule`,rule:e})},onDataBar:e=>{t.addRule({range:t.rangesOf(),type:`dataBar`,color:e})},onColorScale:e=>{let n=e.length-1;t.addRule({range:t.rangesOf(),type:`colorScale`,stops:e.map((e,t)=>t===0?{at:`min`,color:e}:t===n?{at:`max`,color:e}:{at:`percentile`,value:50,color:e})})},onIcons:e=>{t.addRule({range:t.rangesOf(),type:`iconSet`,icons:e})},onClearRules:t.clearRules,onValidation:()=>{r.setAsking({kind:`validation`})},onFormatCells:e=>{r.setAsking({kind:`format`,tab:e})},onRowHeight:()=>{t.askSize(`row`)},onColumnWidth:()=>{t.askSize(`column`)},onFitRows:t.fitRows,onFitColumns:t.fitColumns,onHide:e=>{e===`sheet`?t.hideSheet(s):t.hide(e)},onUnhide:e=>{e===`sheet`?t.unhideSheet():t.unhide(e)},onTabColor:e=>{t.apply(lS(t.bookNow(),s,e))},onChart:t.insertChart,onScenarios:f?()=>{r.setAsking({kind:`scenarios`})}:void 0,onDone:t.focusSink})})]}),saved:{state:o.state}})}function Ck({field:e,...t}){let n=jC(),[r,a]=(0,A.useState)(),[o,s]=(0,A.useState)(t.name);return o!==t.name&&(s(t.name),a(void 0)),(0,j.jsxs)(`div`,{className:`sheet-formula-row`,"data-testid":`sheet-formula-row`,children:[(0,j.jsxs)(`span`,{className:`sheet-name-place`,children:[(0,j.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=>{a(e.target.value)},onKeyDown:e=>{e.stopPropagation(),e.key===`Enter`?(e.preventDefault(),t.onGo(e.currentTarget.value.trim()),a(void 0)):e.key===`Escape`&&(a(void 0),t.onDone())},onBlur:()=>{a(void 0)}}),(0,j.jsxs)(m,{children:[(0,j.jsx)(l,{asChild:!0,children:(0,j.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,j.jsx)(re,{})})}),(0,j.jsx)(d,{align:`start`,className:`max-h-80 text-xs`,onCloseAutoFocus:e=>{e.preventDefault(),t.onDone()},children:t.names.map(e=>(0,j.jsx)(b,{"data-testid":`sheet-name-item`,"data-name":e,onSelect:()=>{t.onGo(e)},children:e},e))})]})]}),(0,j.jsxs)(`div`,{className:`sheet-formula-tools`,onMouseDown:e=>{e.preventDefault()},children:[(0,j.jsx)(k,{icon:!0,"aria-label":n.cancel,title:n.cancel,disabled:!t.editing,"data-testid":`sheet-cancel`,onClick:t.onCancel,children:(0,j.jsx)(i,{})}),(0,j.jsx)(k,{icon:!0,"aria-label":n.enter,title:n.enter,disabled:!t.editing,"data-testid":`sheet-enter`,onClick:t.onEnter,children:(0,j.jsx)(ee,{})}),(0,j.jsx)(k,{icon:!0,"aria-label":n.insertFunction,title:n.insertFunction,disabled:t.disabled,"data-testid":`sheet-function`,onClick:t.onFunction,children:(0,j.jsx)(Ft,{})})]}),(0,j.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 wk=2e4,Tk=20;function Ek(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=Kt(r);e&&t.push(e)}for(let[i,a]of Object.entries(e.spec.columns??{})){if(!n(a))continue;let e=Kt(`${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 Dk(e,t,n,r,i){let a=new Map,o=wk;for(let{row:n,paths:r,column:i}of Cx(e,t))r.some(bx)&&a.set(n,Math.max(a.get(n)??0,xx(i)+4));for(let t of Ek(e))for(let s=t.top;s<=t.bottom;s++)for(let c=t.left;c<=t.right;c++){if(o===0)return a;let t=n.value(e,s,c);if(t===null)continue;--o;let l=CT(e,s,c),u=(l.size??11)*4/3,d=Math.round(u*1.25),f=1;l.wrap===!0&&(i.font=Yw(l),f=wT(Yr(t,l.format),r(c)-6,e=>i.measureText(e).width).length);let p=Math.max(Tk,f*d+4);p>(a.get(s)??Tk)&&a.set(s,p)}return a}var Ok=200,kk=320,Ak=12;function jk(e,t,n){let r=new Map,i=e.spec.columns??{};for(let a of e.tables)for(let o of a.columns){if(o.spec?.width!==void 0)continue;let s=a.at.col+o.index;if(i[Vt(s)]?.width!==void 0)continue;let c=a.at.row,l=0,u=r=>{let i=CT(e,r,s);n.font=Yw(i);let a=Yr(t.value(e,r,s),i.format);return a===``?0:n.measureText(a).width};l=u(c)+(e.filterHeadAt(c,s)?21:0);let d=Math.min(a.area.bottom,c+Ok);for(let e=c+1;e<=d;e++)l=Math.max(l,u(e));let f=Math.min(kk,Math.ceil(l)+Ak);f>64&&r.set(s,f)}return r}var Mk=e=>e.tables.map(e=>`${e.name}@${String(e.at.row)},${String(e.at.col)}:${e.columns.map(e=>e.name).join(`|`)}`).join(`;`),Nk={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`,caution:`--allyhub-caution`,pencil:`--allyhub-pencil`};function Pk(e){let t={};for(let[n,r]of Object.entries(Nk))e.style.color=`var(${r})`,t[n]=getComputedStyle(e).color;return t}var Fk=40,Ik={fine:3,coarse:10},Lk={fine:4,coarse:10},Rk={fine:1,coarse:10};function zk(){let[e,t]=(0,A.useState)(()=>globalThis.matchMedia(`(pointer: coarse)`).matches);return(0,A.useEffect)(()=>{let e=globalThis.matchMedia(`(pointer: coarse)`),n=()=>{t(e.matches)};return e.addEventListener(`change`,n),()=>{e.removeEventListener(`change`,n)}},[]),e}function Bk({ref:e,children:t,...n}){let r=(0,A.useRef)(null),i=(0,A.useRef)(null),a=(0,A.useRef)(null),o=(0,A.useRef)(null),s=(0,A.useRef)(null),c=(0,A.useRef)(null),l=(0,A.useRef)(void 0),u=(0,A.useRef)(void 0),d=(0,A.useRef)(0),f=zk(),[p]=(0,A.useState)(()=>document.createElement(`canvas`).getContext(`2d`)),m=Mk(n.sheet),h=(0,A.useMemo)(()=>p?jk(n.sheet,n.values,p):new Map,[n.sheet,m,p]),g=(0,A.useMemo)(()=>{if(!p)return new Map;let e=new pT(n.sheet,new Map,n.filtered,h);return Dk(n.sheet,n.calc,n.values,t=>e.columns.sizeOf(t),p)},[n.sheet,n.calc,n.revision,p,h]),_=(0,A.useRef)(void 0),v=(0,A.useMemo)(()=>{let e=new pT(n.sheet,g,n.filtered,h);return e.edge=f?Lk.coarse:Lk.fine,e},[n.sheet,g,n.filtered,h,f]),y=(0,A.useMemo)(()=>n.sheet.conditions.length===0?void 0:new Po(n.sheet,n.calc),[n.sheet,n.calc,n.revision]),b=(0,A.useRef)({p:n,view:v,rules:y}),x=(0,A.useCallback)(()=>{d.current=0;let{p:e,view:t,rules:n}=b.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??=Pk(c.current)),!u.current)return;l.current.paint({sheet:e.sheet,values:e.values,dark:e.theme===`dark`,revision:e.revision,view:t,inks:u.current,selected:XC(e.selection),invalid:e.invalid,pictures:e.pictures,rules:n});let h=s.current;if(!h)return;let g=t.headWidth;h.style.left=`${String(g)}px`;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,g),Math.max(g,t.width-24)):Math.max(c.x,g-8),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-g)}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<g||c.y+c.height<22?`hidden`:``)}},[]),S=(0,A.useCallback)(()=>{d.current||=requestAnimationFrame(x)},[x]);(0,A.useLayoutEffect)(()=>{i.current&&(l.current??=new TT(i.current))},[]),(0,A.useLayoutEffect)(()=>{b.current={p:n,view:v,rules:y};let e=b.current.view,t=_.current;t?.sheet===n.sheet.name&&(e.rowCount=Math.max(e.rowCount,t.rows),e.columnCount=Math.max(e.columnCount,t.columns)),_.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`),x()}),(0,A.useEffect)(()=>{u.current=void 0,S()},[n.theme,S]),(0,A.useEffect)(()=>{let e=a.current;if(!e)return;let t=new ResizeObserver(()=>{S()});return t.observe(e),()=>{t.disconnect()}},[S]);let ee=(0,A.useCallback)(()=>{let e=a.current,t=o.current;if(!e||!t)return;let{view:n}=b.current,r=!1;e.scrollTop+e.clientHeight>n.contentHeight-400&&(n.rowCount=Math.min(zt,n.rowCount+100),r=!0),e.scrollLeft+e.clientWidth>n.contentWidth-400&&(n.columnCount=Math.min(Bt,n.columnCount+26),r=!0),r&&(t.style.width=`${String(n.contentWidth)}px`,t.style.height=`${String(n.contentHeight)}px`,_.current={sheet:b.current.p.sheet.name,rows:n.rowCount,columns:n.columnCount})},[]);(0,A.useImperativeHandle)(e,()=>({view:()=>b.current.view,show:e=>{let t=a.current,n=o.current;if(!t||!n)return;let{view:r}=b.current;e.row+100>r.rowCount&&(r.rowCount=Math.min(zt,e.row+100)),e.col+26>r.columnCount&&(r.columnCount=Math.min(Bt,e.col+26)),n.style.width=`${String(r.contentWidth)}px`,n.style.height=`${String(r.contentHeight)}px`,_.current={sheet:b.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,S()},pageRows:()=>{let{view:e}=b.current,{first:t,last:n}=e.shownRows();return Math.max(1,n-t)},canvas:()=>i.current,draw:()=>{let e=performance.now();return x(),performance.now()-e},pageRect:e=>{let t=i.current?.getBoundingClientRect();if(!t)return;let{p:n,view:r}=b.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=b.current.p.zoom,s=(e-(n?.x??0))/o,c=(t-(n?.y??0))/o,l=b.current.view.headWidth;return r&&(s>r.clientWidth?r.scrollLeft+=Fk:s<l&&(r.scrollLeft-=Fk),c>r.clientHeight?r.scrollTop+=Fk:c<22&&(r.scrollTop-=Fk)),b.current.view.hit(Math.max(s,l),Math.max(c,22))}}),[S,x]);let C=e=>{let t=i.current?.getBoundingClientRect();return{x:(e.clientX-(t?.x??0))/n.zoom,y:(e.clientY-(t?.y??0))/n.zoom}},te=(e,t)=>{let r=XC(n.selection);if((n.selection.more?.length??0)>0||dw(r)||fw(r)||e<v.headWidth||t<22)return;let i=n.sheet.mergeAt(r.top,r.left),a=i&&r.top===r.bottom&&r.left===r.right?i:r;return LD(v.rectOf(a),e,t,f?Ik.coarse:Ik.fine)},w=(0,A.useRef)(void 0),ne=e=>{if(e.button!==0)return;let t=a.current;if(!t)return;let{x:r,y:o}=C(e);if(r>t.clientWidth||o>t.clientHeight)return;let s=v.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;w.current={kind:`resize`,what:s.part,index:n,from:s.part===`column`?r:o,size:s.part===`column`?v.columns.sizeOf(n):v.rows.sizeOf(n)}}else{if(s.part===`cell`&&n.sheet.filterHeadAt(s.row,s.col)){let t=v.xOf(s.col)+v.columns.sizeOf(s.col),a=v.yOf(s.row)+v.rows.sizeOf(s.row),c=f?Rk.coarse:Rk.fine;if(t-r<=17+c&&a-o<=17+c){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),w.current={kind:`select`,x:r,y:o},n.onPress({hit:s,shift:e.shiftKey,meta:e.metaKey||e.ctrlKey,alt:e.altKey,border:s.part===`cell`?te(r,o):void 0})}},T=e=>{let t=a.current,r=w.current;if(!t)return;let{x:i,y:o}=C(e);if(!r){let e=v.hit(i,o);t.style.cursor=e.part===`column`&&e.edge?`col-resize`:e.part===`row`&&e.edge?`row-resize`:e.part===`cell`?te(i,o)===void 0?`cell`:`move`:`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(v.hit(Math.max(i,v.headWidth),Math.max(o,22))),i>t.clientWidth?t.scrollLeft+=Fk:i<v.headWidth&&(t.scrollLeft-=Fk),o>t.clientHeight?t.scrollTop+=Fk:o<22&&(t.scrollTop-=Fk)},E=(0,A.useRef)(n.onZoomStep);(0,A.useEffect)(()=>{E.current=n.onZoomStep}),(0,A.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)&&(E.current(t>0?-1:1),t=0))};return e.addEventListener(`wheel`,n,{passive:!1}),()=>{e.removeEventListener(`wheel`,n)}},[]),(0,A.useEffect)(()=>{S()},[n.zoom,S]);let D=e=>{let t=w.current;w.current=void 0,t?.kind===`select`&&n.onRelease({alt:e.altKey})};return(0,j.jsxs)(`div`,{ref:r,className:`sheet-grid`,"data-testid":`sheet-grid`,style:{zoom:n.zoom},children:[(0,j.jsx)(`canvas`,{ref:i,className:`sheet-canvas`,"aria-hidden":!0}),(0,j.jsx)(`div`,{ref:a,className:`sheet-scroller`,"data-testid":`sheet-scroller`,onScroll:()=>{ee(),S()},onPointerDown:ne,onPointerMove:T,onPointerUp:D,onPointerCancel:D,onContextMenu:e=>{e.preventDefault();let{x:t,y:r}=C(e);n.onMenu(v.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}=C(e),a=v.hit(r,i);a.part===`cell`&&n.onDropFiles(a,t)},onDoubleClick:e=>{let{x:t,y:r}=C(e),i=v.hit(t,r),a=i.part===`cell`?te(t,r):void 0;a===void 0?i.part===`cell`?n.onOpen(i,{x:t,y:r}):i.part===`column`&&i.edge?n.onFit(`column`,i.col):i.part===`row`&&i.edge&&n.onFit(`row`,i.row):n.onEdgeOpen(a)},children:(0,j.jsx)(`div`,{ref:o,className:`sheet-sizer`})}),(0,j.jsxs)(`div`,{ref:s,className:`sheet-overlay`,onWheel:e=>{a.current?.scrollBy(e.deltaX,e.deltaY)},children:[(0,j.jsx)(`span`,{ref:c,hidden:!0}),t]})]})}var Vk=e=>`${String(e.bottom-e.top+1)}R x ${String(e.right-e.left+1)}C`;function Hk(e){let{selection:t,area:n}=e;if(e.dragging&&!QC(t))return Vk(n);if((t.more?.length??0)===0){let t=Wt(n),r=e.sheet.toLowerCase();for(let n of e.named)if((n.sheet===void 0||n.sheet.toLowerCase()===r)&&Wt(n.area)===t)return n.name}return Ut(t.active)}var Uk=new Set,Wk=e=>({key:e.key,meta:e.metaKey,ctrl:e.ctrlKey,shift:e.shiftKey,alt:e.altKey,preventDefault:()=>{e.preventDefault()}});function Gk({dir:e,files:t,state:n,book:r,onProbe:i}){let a=jC(),o=x(),s=_(),c=(0,A.useRef)(null),l=(0,A.useRef)(null),d=(0,A.useRef)(null),f=(0,A.useRef)(null),p=(0,A.useRef)(null),m={grid:l,sink:d,bar:f,filePicker:p,tabFrom:(0,A.useRef)(void 0),stepId:(0,A.useRef)(0),selections:(0,A.useRef)(new Map),chartCopied:(0,A.useRef)(void 0)},[h,g]=(0,A.useState)(1),v=WD(r.workbook.file.sheets.filter(e=>e.hidden!==!0)[0]?.name??``),b=r.workbook.sheet(v.shownName)??r.workbook.sheets.find(e=>e.spec.hidden!==!0)??r.workbook.sheets[0],[,S]=(0,A.useState)(0),[ee]=(0,A.useState)(()=>new FC(s,e,()=>{S(e=>e+1)})),C=(0,A.useMemo)(()=>b?r.values.filtered(b):Uk,[b,n.revision]),te=b?.name??``,w=b?.merges??[],ne=v.selection,T=ew(XC(ne),w),E=b?{s:a,host:s,context:o,dir:e,files:t,state:n,book:r,values:r.values,sheet:b,name:te,ui:v,selection:ne,area:T,areas:ZC(ne).map(e=>ew(e,w)),merges:w,filtered:C,editable:n.problems===void 0&&o?.readOnly!==!0,locked:b.generated}:void 0,D=HD(E,m),re=E&&D?_w.bind({c:E,a:D},a,qC()):void 0;(0,A.useEffect)(()=>{d.current?.focus({preventScroll:!0})},[]);let{readOnly:O,ask:k}=y(),ie=u(),ae=e=>{O&&rt(e)&&k()},oe=(0,A.useRef)(ae);(0,A.useLayoutEffect)(()=>{oe.current=ae});let se=(0,A.useRef)(D);(0,A.useLayoutEffect)(()=>{se.current=D}),(0,A.useEffect)(()=>{let e=e=>{e.target===document.body&&(oe.current(e),d.current?.focus({preventScroll:!0}),e.isComposing||se.current?.gridKey(Wk(e)))};return document.addEventListener(`keydown`,e,!0),()=>{document.removeEventListener(`keydown`,e,!0)}},[]);let ce=(0,A.useMemo)(()=>{let e=new Set;if(!b||b.validations.length===0)return e;for(let t of Zo(r.workbook,r.calc))t.sheet===te&&e.add(yr(t.row,t.col));return e},[r,b,te,n.revision]),le=(0,A.useMemo)(()=>{let e=[];for(let t of r.workbook.names.values()){let n=t.formula?Lw(t.formula.text)[0]:void 0;n&&e.push({name:t.name,sheet:n.sheet,area:n.area})}for(let t of r.workbook.tables)e.push({name:t.name,sheet:t.sheet.name,area:t.area}),t.rows>0&&e.push({name:t.name,sheet:t.sheet.name,area:t.data});return e},[r,n.revision]),ue=(0,A.useMemo)(()=>[...[...r.workbook.names.values()].map(e=>e.name),...r.workbook.tables.map(e=>e.name)],[r,n.revision]);(0,A.useEffect)(()=>{let e=setTimeout(()=>{r.calc.prepare()},50);return()=>{clearTimeout(e)}},[r,n.revision]),ck({onProbe:i,book:r,sheet:b,grid:l,invalid:ce});let de=`sheet-zoom:${e}`;(0,A.useEffect)(()=>{s[`storage/get`]({key:de}).then(({value:e})=>{let t=zO(e);t!==void 0&&g(t)}).catch(()=>void 0)},[s,de]);let fe=e=>{g(e),s[`storage/set`]({key:de,value:String(e)}).catch(()=>void 0),requestAnimationFrame(()=>{l.current?.show(ne.active)})};ek({dir:e,revision:n.revision,book:r,sheet:b,grid:l,zoom:h});let pe=v.editing;if(GD({sink:d,grid:l,editing:pe,book:r,sheet:b}),!b||!E||!D||!re)return null;let{row:me,col:he}=ne.active,ge=D.shownChart(),_e=b.spillAt(me,he),ve=b.at(me,he),ye=_e??(ve instanceof gr?ve:void 0),be=w.some(e=>e.top<=T.bottom&&T.top<=e.bottom&&e.left<=T.right&&T.left<=e.right),xe=n.conflicts,Se=xe.length>0&&xe!==v.read?a.bothChanged(o?.agent?.name??``):void 0,Ce=E.editable&&!E.locked,we=()=>{requestAnimationFrame(()=>{D.focusSink()})};return(0,j.jsx)(zC,{value:re,children:(0,j.jsxs)(`div`,{ref:c,className:`sheet-root flex min-h-0 flex-1 flex-col`,"data-testid":`sheet-root`,"data-editing":pe?``:void 0,onPasteCapture:O?k:void 0,onDoubleClickCapture:O?k:void 0,onKeyDownCapture:e=>{ae(e.nativeEvent),e.key===`F6`&&c.current&&(e.preventDefault(),e.stopPropagation(),IO(c.current,e.shiftKey,D.focusSink))},onKeyDown:e=>{!e.nativeEvent.isComposing&&c.current?.contains(e.target)&&(e.target===d.current||e.target===f.current)&&D.gridKey(Wk(e))},onCopy:e=>{D.onCopy(e,!1)},onCut:e=>{D.onCopy(e,!0)},onPaste:D.onPaste,children:[ie?null:(0,j.jsx)(Sk,{c:E,a:D,merged:be}),n.problems===void 0?null:(0,j.jsxs)(`div`,{className:`sheet-notice`,role:`alert`,"data-testid":`sheet-notice`,children:[(0,j.jsx)(`p`,{children:a.unreadable}),n.problems.map(e=>(0,j.jsx)(`p`,{children:e},e))]}),(0,j.jsx)(Ck,{field:f,name:ge?a.chart.name(ge.index+1):Hk({selection:ne,area:T,dragging:v.gesture.kind===`select`&&!pe,sheet:te,named:le}),names:ue,text:ge?``:pe?pe.text:_e?_e.text:D.inputAt(ne.active),ghost:_e!==void 0&&!pe&&!ge,editing:pe!==void 0,disabled:!Ce,onGo:D.goTo,onBegin:()=>{pe?pe.surface!==`bar`&&v.setEditing({...pe,surface:`bar`}):D.begin({text:D.inputAt(ne.active),surface:`bar`,mode:`edit`})},onText:(e,t)=>{pe&&(v.setEditing({...pe,pick:void 0,text:e,caret:t,problem:!1}),v.setChoice(0),d.current&&(d.current.value=e))},onCaret:e=>{v.setEditing(t=>t&&t.caret!==e?{...t,caret:e}:t)},onCancel:D.cancel,onEnter:()=>{D.commit()},onFunction:()=>{pe||D.begin({text:`=`,surface:`bar`,mode:`edit`})},onDone:D.focusSink}),E.locked&&!ie?(0,j.jsx)(uO,{agent:o?.agent?.name,onAsk:D.askAgent,onOrdinary:D.makeOrdinary}):null,(0,j.jsx)(Bk,{ref:l,zoom:h,onZoomStep:e=>{fe(RO(h,e))},sheet:b,values:r.values,calc:r.calc,revision:n.revision,theme:o?.theme,selection:ne,onPress:D.onPress,onOpen:D.openCell,onEdgeOpen:D.onEdgeOpen,onDrag:D.onDrag,onRelease:D.onRelease,filtered:C,invalid:ce,pictures:ee,onDropFiles:(e,t)=>{D.addFiles(e,t)},onFilterButton:D.openFilter,onMenu:D.onMenu,onResize:D.resize,onFit:D.fitBand,children:(0,j.jsx)(ok,{c:E,a:D,zoom:h,spillOn:ye,sink:d,view:()=>l.current?.view()})}),(0,j.jsx)(Tw,{c:E,a:D}),v.said===void 0?null:(0,j.jsx)(`div`,{className:`sheet-say`,role:`alert`,"data-testid":`sheet-say`,children:v.said}),n.codeFailed?(0,j.jsx)(`div`,{className:`sheet-say`,role:`alert`,"data-testid":`sheet-code-failed`,children:a.generated.failed}):null,Se===void 0?null:(0,j.jsx)(`button`,{type:`button`,className:`sheet-say`,"data-testid":`sheet-conflict`,onClick:()=>{v.setRead(xe)},children:Se}),(0,j.jsx)(jO,{c:E,a:D,merged:be,pictures:ee}),v.finding?(0,j.jsx)(MO,{a:D,replace:v.finding.replace,editable:E.editable},v.finding.replace?`replace`:`find`):null,v.chartPane!==void 0&&ge?.index===v.chartPane?(0,j.jsx)(tO,{chart:ge,sheet:b,calc:r.calc,disabled:!Ce,onPatch:e=>D.patchChart(ge.index,e),onClose:()=>{v.setChartPane(void 0),we()}},ge.index):null,v.menu?(0,j.jsx)(yw,{kind:v.menu.kind,x:v.menu.x,y:v.menu.y,disabled:!Ce,extras:{pickFromList:b.validationAt(me,he)?.spec.type===`list`,insertFile:b.filesAt(me,he)===void 0?void 0:()=>{p.current?.click()},openFile:D.filesAtPlace(ne.active).length===0?void 0:()=>{v.setAsking({kind:`file`,at:ne.active})}},onClose:()=>{v.setMenu(void 0),we()}}):null,v.chartMenu&&ge?(0,j.jsx)(bw,{x:v.chartMenu.x,y:v.chartMenu.y,disabled:!Ce,onClose:()=>{v.setChartMenu(void 0),we()}}):null,(0,j.jsx)(`input`,{ref:p,type:`file`,multiple:!0,hidden:!0,"data-testid":`sheet-file-input`,onChange:e=>{let t=[...e.currentTarget.files??[]];e.currentTarget.value=``,t.length>0&&D.addFiles(ne.active,t)}}),(0,j.jsx)(YD,{c:E,a:D}),(0,j.jsx)(YO,{c:E,a:D,zoom:h,onZoom:fe})]})})}var Kk=()=>()=>void 0,qk=()=>void 0;function Jk(e){let t=_(),[n,r]=(0,A.useState)(),[i,a]=(0,A.useState)();return(0,A.useEffect)(()=>{if(e===void 0)return;let n=!0,i;return DC.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 Yk({className:e,bare:t,onProbe:n}){let r=x(),i=r?.item.dir,{files:a,failed:o}=Jk(i),s=(0,A.useSyncExternalStore)(a?.subscribe??Kk,a?.get??qk),c=jC(),l=`sheet-page ${t===!0?`sheet-bare `:``}${e??``}`,u=s?.book;return(0,j.jsx)(`div`,{className:l,"data-testid":`sheet-editor`,lang:r?.locale,"data-state":s?`ready`:`loading`,children:(0,j.jsx)(`div`,{className:`sheet-sheet`,children:o===void 0?s&&a&&u&&i!==void 0?(0,j.jsx)(Gk,{dir:i,files:a,state:s,book:u,onProbe:n}):s?.problems?(0,j.jsxs)(`div`,{className:`sheet-notice`,role:`alert`,"data-testid":`sheet-notice`,children:[(0,j.jsx)(`p`,{children:c.unreadable}),s.problems.map(e=>(0,j.jsx)(`p`,{children:e},e))]}):(0,j.jsx)(`p`,{className:`sheet-message`,children:c.loading}):(0,j.jsx)(`p`,{className:`sheet-message`,role:`alert`,children:o})})})}export{Yk as SheetEditor};
|