@allyhub/sdk 0.8.0 → 0.10.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/CHANGELOG.md +19 -0
- package/NOTICE +46 -49
- package/dist/dom.d.ts +1 -209
- package/dist/dom.js +1 -1
- package/dist/image.d.ts +2 -0
- package/dist/image.js +2 -0
- package/dist/index.d.ts +1 -21
- package/dist/index.js +1 -1
- package/dist/media.d.ts +1 -5
- package/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/levels.d.ts +4 -5
- package/dist/node_modules/@allyhub/audio/dist/levels.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.d.ts +1 -6
- package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.js +1 -1
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +4 -1
- package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
- package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
- package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/LICENSE +241 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/fact.d.ts +37 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/fact.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +43 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/problem.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.d.ts +30 -0
- package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +2 -0
- package/dist/node_modules/@allyhub/diagnostics/package.json +14 -0
- package/dist/node_modules/@allyhub/formats/dist/contributed.d.ts +126 -0
- package/dist/node_modules/@allyhub/formats/dist/contributed.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +7 -12
- package/dist/node_modules/@allyhub/formats/dist/data/reference.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/script.d.ts +9 -4
- package/dist/node_modules/@allyhub/formats/dist/data/script.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +107 -83
- package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +185 -8
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.d.ts +2 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
- package/dist/node_modules/@allyhub/formats/dist/data/work.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/extension.d.ts +91 -0
- package/dist/node_modules/@allyhub/formats/dist/extension.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/files.d.ts +51 -0
- package/dist/node_modules/@allyhub/formats/dist/files.js +2 -0
- package/dist/node_modules/@allyhub/formats/dist/index.d.ts +5 -1
- package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +226 -90
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +7 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +96 -42
- package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-draw/dist/context.d.ts +5 -0
- package/dist/node_modules/@allyhub/image-draw/dist/context.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/contrast.d.ts +13 -0
- package/dist/node_modules/@allyhub/image-draw/dist/contrast.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/env.d.ts +112 -0
- package/dist/node_modules/@allyhub/image-draw/dist/env.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/errors.d.ts +20 -0
- package/dist/node_modules/@allyhub/image-draw/dist/errors.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.d.ts +110 -0
- package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/guards.d.ts +32 -0
- package/dist/node_modules/@allyhub/image-draw/dist/guards.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/hash.d.ts +3 -0
- package/dist/node_modules/@allyhub/image-draw/dist/hash.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.d.ts +113 -0
- package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +3 -0
- package/dist/node_modules/@allyhub/image-draw/dist/layer-style.d.ts +151 -0
- package/dist/node_modules/@allyhub/image-draw/dist/layer-style.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/paint.d.ts +29 -0
- package/dist/node_modules/@allyhub/image-draw/dist/paint.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/pictures.d.ts +39 -0
- package/dist/node_modules/@allyhub/image-draw/dist/pictures.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/plan.d.ts +52 -0
- package/dist/node_modules/@allyhub/image-draw/dist/plan.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/reads.d.ts +145 -0
- package/dist/node_modules/@allyhub/image-draw/dist/reads.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/shape-path.d.ts +26 -0
- package/dist/node_modules/@allyhub/image-draw/dist/shape-path.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/stage.d.ts +56 -0
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/styles.d.ts +35 -0
- package/dist/node_modules/@allyhub/image-draw/dist/styles.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/dist/tone.d.ts +53 -0
- package/dist/node_modules/@allyhub/image-draw/dist/tone.js +2 -0
- package/dist/node_modules/@allyhub/image-draw/package.json +14 -0
- package/dist/node_modules/@allyhub/image-measure/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-measure/dist/contrast.d.ts +43 -0
- package/dist/node_modules/@allyhub/image-measure/dist/contrast.js +2 -0
- package/dist/node_modules/@allyhub/image-measure/dist/layout.d.ts +186 -0
- package/dist/node_modules/@allyhub/image-measure/dist/layout.js +5 -0
- package/dist/node_modules/@allyhub/image-measure/package.json +14 -0
- package/dist/node_modules/@allyhub/image-sdk/LICENSE +241 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.d.ts +13 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.js +2 -0
- package/dist/{define.d.ts → node_modules/@allyhub/image-sdk/dist/define.d.ts} +21 -4
- package/dist/node_modules/@allyhub/image-sdk/dist/define.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/dom.d.ts +210 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/dom.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/fill.d.ts +21 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/fill.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/group.d.ts +17 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/group.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +166 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/media.d.ts +6 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/media.js +2 -0
- package/dist/{messages.d.ts → node_modules/@allyhub/image-sdk/dist/messages.d.ts} +1 -1
- package/dist/node_modules/@allyhub/image-sdk/dist/picture.d.ts +59 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/picture.js +2 -0
- package/dist/{props.d.ts → node_modules/@allyhub/image-sdk/dist/props.d.ts} +4 -4
- package/dist/node_modules/@allyhub/image-sdk/dist/shape.d.ts +34 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/shape.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/stack.d.ts +16 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/stack.js +2 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.d.ts +38 -0
- package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.js +2 -0
- package/dist/{written.js → node_modules/@allyhub/image-sdk/dist/written.js} +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +19 -0
- package/dist/node_modules/@allyhub/measure/LICENSE +241 -0
- package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +195 -0
- package/dist/node_modules/@allyhub/measure/dist/compare.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +8 -0
- package/dist/node_modules/@allyhub/measure/dist/grain.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/image.d.ts +16 -0
- package/dist/node_modules/@allyhub/measure/dist/image.js +2 -0
- package/dist/node_modules/@allyhub/measure/dist/index.d.ts +4 -0
- package/dist/node_modules/@allyhub/measure/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/measure/package.json +13 -0
- package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.d.ts +4 -1
- package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.d.ts +15 -1
- package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/LICENSE +241 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.d.ts +1 -9
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/context.d.ts +39 -0
- package/dist/node_modules/@allyhub/piece/dist/context.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.d.ts +2 -2
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/export.d.ts +27 -10
- package/dist/node_modules/@allyhub/piece/dist/export.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/formats.d.ts +12 -68
- package/dist/node_modules/@allyhub/piece/dist/formats.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +104 -0
- package/dist/node_modules/@allyhub/piece/dist/index.d.ts +26 -0
- package/dist/node_modules/@allyhub/piece/dist/index.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layer-style.d.ts +1558 -0
- package/dist/node_modules/@allyhub/piece/dist/layer-style.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +389 -0
- package/dist/node_modules/@allyhub/piece/dist/layer.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +437 -0
- package/dist/node_modules/@allyhub/piece/dist/layout.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.d.ts +1 -1
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.d.ts +39 -9
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.js +1 -1
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.d.ts +6 -0
- package/dist/node_modules/@allyhub/piece/dist/names.d.ts +26 -0
- package/dist/node_modules/@allyhub/piece/dist/names.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +21 -0
- package/dist/node_modules/@allyhub/piece/dist/page/console.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +3 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +4 -0
- package/dist/node_modules/@allyhub/piece/dist/page/locate.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/picture.d.ts +62 -0
- package/dist/node_modules/@allyhub/piece/dist/picture.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/piece.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/piece.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/script.d.ts +9 -4
- package/dist/node_modules/@allyhub/piece/dist/script.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +131 -0
- package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +291 -0
- package/dist/node_modules/@allyhub/piece/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/version.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/version.js +2 -0
- package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.d.ts +1 -20
- package/dist/node_modules/@allyhub/piece/package.json +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +271 -0
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +3 -10
- package/dist/node_modules/@allyhub/protocol/dist/app.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
- package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +12 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +155 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +235 -133
- package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/files.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +65 -197
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/image.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +6 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +98 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +274 -0
- package/dist/node_modules/@allyhub/protocol/dist/mail.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +77 -91
- package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +59 -0
- package/dist/node_modules/@allyhub/protocol/dist/peer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +21 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +125 -0
- package/dist/node_modules/@allyhub/protocol/dist/presence.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +35 -0
- package/dist/node_modules/@allyhub/protocol/dist/shape.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +2 -8
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +70 -40
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +224 -177
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/package.json +5 -1
- package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +14 -0
- package/dist/node_modules/@allyhub/runtimes/dist/declared.js +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +15 -0
- package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.js +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +1 -0
- package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
- package/dist/node_modules/@allyhub/runtimes/manifest.json +0 -82
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/define.d.ts +2 -0
- package/dist/node_modules/@allyhub/scenery/dist/define.js +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
- package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
- package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
- package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/code.d.ts +4 -4
- package/dist/node_modules/@allyhub/sheet/dist/api/code.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +15 -11
- package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/server.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
- package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/file.d.ts +5 -0
- package/dist/node_modules/@allyhub/sheet/dist/file.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/generated.d.ts +5 -19
- package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/import.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +5 -5
- package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +88 -3
- package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/patch.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/patch.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
- package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/sdk.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/sdk.js +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
- package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +8 -6
- package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +2 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
- package/dist/node_modules/@allyhub/sheet/package.json +5 -1
- package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +23 -7
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +101 -11
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +18 -1
- package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/code.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/connect.d.ts +62 -0
- package/dist/node_modules/@allyhub/slides-core/dist/connect.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
- package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +223 -0
- package/dist/node_modules/@allyhub/slides-core/dist/fact.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +4 -4
- package/dist/node_modules/@allyhub/slides-core/dist/file.js +2 -2
- package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/measure.d.ts +4 -2
- package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/merge.d.ts +5 -5
- package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +25 -4
- package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/path.d.ts +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +20 -11
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +18 -0
- package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +2 -0
- package/dist/node_modules/@allyhub/slides-core/dist/stage.d.ts +28 -11
- package/dist/node_modules/@allyhub/slides-core/dist/units.d.ts +3 -6
- package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +5 -1
- package/dist/node_modules/@allyhub/video-core/dist/audio-types.d.ts +1 -2
- package/dist/node_modules/@allyhub/video-core/dist/captions.d.ts +1 -10
- package/dist/node_modules/@allyhub/video-core/dist/captions.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/check.d.ts +62 -0
- package/dist/node_modules/@allyhub/video-core/dist/check.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/cut-report.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/cut-report.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/edits.d.ts +3 -3
- package/dist/node_modules/@allyhub/video-core/dist/edits.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/fact.d.ts +21 -762
- package/dist/node_modules/@allyhub/video-core/dist/fact.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.d.ts +3 -2
- package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/index.d.ts +3 -17
- package/dist/node_modules/@allyhub/video-core/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/measure.d.ts +72 -423
- package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -4
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.d.ts +44 -0
- package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/motion.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +24 -432
- package/dist/node_modules/@allyhub/video-core/dist/piece.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/placement.d.ts +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +8 -14
- package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/script-edit.d.ts +11 -6
- package/dist/node_modules/@allyhub/video-core/dist/script-edit.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/seams.d.ts +2 -3
- package/dist/node_modules/@allyhub/video-core/dist/sound-under.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/sound-under.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/speech.d.ts +2 -4
- package/dist/node_modules/@allyhub/video-core/dist/speech.js +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/stage.d.ts +52 -0
- package/dist/node_modules/@allyhub/video-core/dist/stage.js +2 -0
- package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +18 -136
- package/dist/node_modules/@allyhub/video-core/dist/timeline.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/timing.d.ts +3 -3
- package/dist/node_modules/@allyhub/video-core/dist/timing.js +1 -1
- package/dist/node_modules/@allyhub/video-core/dist/transcript.d.ts +2 -2
- package/dist/node_modules/@allyhub/video-core/dist/transcript.js +1 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/LICENSE +241 -0
- package/dist/node_modules/@allyhub/video-sdk/NOTICE +118 -0
- package/dist/{free.d.ts → node_modules/@allyhub/video-sdk/dist/free.d.ts} +14 -10
- package/dist/node_modules/@allyhub/video-sdk/dist/free.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/index.d.ts +28 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/index.js +2 -0
- package/dist/{input.d.ts → node_modules/@allyhub/video-sdk/dist/input.d.ts} +76 -22
- package/dist/node_modules/@allyhub/video-sdk/dist/input.js +2 -0
- package/dist/{module.d.ts → node_modules/@allyhub/video-sdk/dist/module.d.ts} +6 -4
- package/dist/node_modules/@allyhub/video-sdk/dist/module.js +2 -0
- package/dist/{parts.d.ts → node_modules/@allyhub/video-sdk/dist/parts.d.ts} +15 -6
- package/dist/node_modules/@allyhub/video-sdk/dist/parts.js +2 -0
- package/dist/{phone.d.ts → node_modules/@allyhub/video-sdk/dist/phone.d.ts} +12 -5
- package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +2 -0
- package/dist/{piece.d.ts → node_modules/@allyhub/video-sdk/dist/piece.d.ts} +26 -16
- package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/route.d.ts +46 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/route.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/scenery.d.ts +2 -0
- package/dist/node_modules/@allyhub/video-sdk/dist/scenery.js +2 -0
- package/dist/node_modules/@allyhub/video-sdk/package.json +19 -0
- package/dist/scenery.d.ts +1 -1
- package/dist/scenery.js +1 -1
- package/dist/sheets.d.ts +1 -1
- package/dist/sheets.js +1 -1
- package/dist/slides.d.ts +1 -9
- package/dist/slides.js +1 -1
- package/docs/README.md +10 -6
- package/docs/batches.md +5 -5
- package/docs/canvas.md +28 -0
- package/docs/contract.md +2 -2
- package/docs/defaults.md +298 -22
- package/docs/docs.md +80 -66
- package/docs/footage.md +7 -7
- package/docs/image.md +165 -0
- package/docs/layers.md +22 -13
- package/docs/modeling.md +4 -4
- package/docs/pictures.md +65 -0
- package/docs/project.md +51 -31
- package/docs/scenery.md +14 -15
- package/docs/sheets.md +46 -28
- package/docs/slides.md +121 -67
- package/docs/sound.md +3 -3
- package/docs/speech.md +8 -8
- package/docs/video.md +16 -13
- package/docs/websites.md +4 -4
- package/docs/x.md +73 -0
- package/package.json +7 -2
- package/dist/define.js +0 -2
- package/dist/free.js +0 -2
- package/dist/input.js +0 -2
- package/dist/module.js +0 -2
- package/dist/node_modules/@allyhub/formats/dist/data/comments.d.ts +0 -94
- package/dist/node_modules/@allyhub/formats/dist/data/comments.js +0 -2
- package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package-lock.json +0 -227
- package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package.json +0 -8
- package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -105
- package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package.json +0 -8
- package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package-lock.json +0 -128
- package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package.json +0 -9
- package/dist/node_modules/@allyhub/video-core/dist/export.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/formats.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/gen.d.ts +0 -37
- package/dist/node_modules/@allyhub/video-core/dist/problem.d.ts +0 -278
- package/dist/node_modules/@allyhub/video-core/dist/problem.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/script.js +0 -2
- package/dist/node_modules/@allyhub/video-core/dist/source.d.ts +0 -7
- package/dist/parts.js +0 -2
- package/dist/phone.js +0 -2
- package/dist/piece.js +0 -2
- /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.js +0 -0
- /package/dist/{fit.d.ts → node_modules/@allyhub/image-sdk/dist/fit.d.ts} +0 -0
- /package/dist/{fit.js → node_modules/@allyhub/image-sdk/dist/fit.js} +0 -0
- /package/dist/{messages.js → node_modules/@allyhub/image-sdk/dist/messages.js} +0 -0
- /package/dist/{props.js → node_modules/@allyhub/image-sdk/dist/props.js} +0 -0
- /package/dist/{text.d.ts → node_modules/@allyhub/image-sdk/dist/text.d.ts} +0 -0
- /package/dist/{text.js → node_modules/@allyhub/image-sdk/dist/text.js} +0 -0
- /package/dist/{written.d.ts → node_modules/@allyhub/image-sdk/dist/written.d.ts} +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/gen.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/source.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.js +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.d.ts +0 -0
- /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.js +0 -0
- /package/dist/{anim.d.ts → node_modules/@allyhub/video-sdk/dist/anim.d.ts} +0 -0
- /package/dist/{anim.js → node_modules/@allyhub/video-sdk/dist/anim.js} +0 -0
- /package/dist/{noise.d.ts → node_modules/@allyhub/video-sdk/dist/noise.d.ts} +0 -0
- /package/dist/{noise.js → node_modules/@allyhub/video-sdk/dist/noise.js} +0 -0
- /package/dist/{paths.d.ts → node_modules/@allyhub/video-sdk/dist/paths.d.ts} +0 -0
- /package/dist/{paths.js → node_modules/@allyhub/video-sdk/dist/paths.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{FIRST_CUSTOM as g,builtinId as
|
|
2
|
+
import{FIRST_CUSTOM as g,builtinId as x}from"./numfmt.js";import{NS as y,el as e}from"./xml.js";export const DEFAULT_FONT={name:"Calibri",size:11};export function fontName(t){if(t.length<=31)return t;const n=t.split(/[;,]/u)[0]?.trim()??"";return(n===""?t:n).slice(0,31)}const s=t=>`FF${t.slice(1).toUpperCase()}`;class f{items=[];index=new Map;add(n){const i=this.index.get(n);if(i!==void 0)return i;const r=this.items.length;return this.items.push(n),this.index.set(n,r),r}}function b(t){const{underline:n}=t;return e("font",{},t.bold===!0?"<b/>":"",t.italic===!0?"<i/>":"",t.strike===!0?"<strike/>":"",n===!0||n==="single"?"<u/>":n?e("u",{val:n}):"",e("sz",{val:t.size??DEFAULT_FONT.size}),t.color===void 0?e("color",{theme:1}):e("color",{rgb:s(t.color)}),e("name",{val:fontName(t.font??DEFAULT_FONT.name)}),e("family",{val:2}),t.font===void 0?e("scheme",{val:"minor"}):"")}function F(t){const{pattern:n,color:i,background:r}=typeof t=="string"?{pattern:"solid",color:t,background:void 0}:t;return e("fill",{},e("patternFill",{patternType:n},i===void 0?"":e("fgColor",{rgb:s(i)}),r===void 0?n==="solid"?e("bgColor",{indexed:64}):"":e("bgColor",{rgb:s(r)})))}function o(t,n){return n?e(t,{style:n.style},n.color===void 0?e("color",{auto:1}):e("color",{rgb:s(n.color)})):e(t)}function h(t){return e("border",{},o("left",t.left),o("right",t.right),o("top",t.top),o("bottom",t.bottom),e("diagonal"))}function p(t,n="dxf"){const{underline:i}=t,r=[t.bold===void 0?"":e("b",{val:t.bold}),t.italic===void 0?"":e("i",{val:t.italic}),t.strike===void 0?"":e("strike",{val:t.strike}),i===!0?"<u/>":"",t.color===void 0?"":e("color",{rgb:s(t.color)})].join(""),{fill:d,border:l}=t;return e(n,{},r===""?"":e("font",{},r),typeof d=="string"?e("fill",{},e("patternFill",{},e("bgColor",{rgb:s(d)}))):"",l?h(l):"")}const I=t=>t<0?90-t:t;function v(t){const n={horizontal:t.align,vertical:t.valign,textRotation:t.rotation===void 0?void 0:I(t.rotation),wrapText:t.wrap===!0?!0:void 0,indent:t.indent,shrinkToFit:t.shrink===!0?!0:void 0};return Object.values(n).every(i=>i===void 0)?"":e("alignment",n)}export class Styles{fonts=new f;fills=new f;borders=new f;formats=new Map;xfs=new f;byLook=new Map;dxfs=new f;constructor(){this.fonts.add(b({})),this.fills.add(e("fill",{},e("patternFill",{patternType:"none"}))),this.fills.add(e("fill",{},e("patternFill",{patternType:"gray125"}))),this.borders.add(e("border",{},e("left"),e("right"),e("top"),e("bottom"),e("diagonal"))),this.xfs.add(e("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0,xfId:0}))}format(n){if(n===void 0)return 0;const i=x(n);if(i!==void 0)return i;let r=this.formats.get(n);return r===void 0&&(r=g+this.formats.size,this.formats.set(n,r)),r}xf(n){const i=JSON.stringify(n),r=this.byLook.get(i);if(r!==void 0)return r;const d=this.format(n.format),l=this.fonts.add(b(n)),u=n.fill===void 0?0:this.fills.add(F(n.fill)),a=n.border===void 0?0:this.borders.add(h(n.border)),c=v(n),m=this.xfs.add(e("xf",{numFmtId:d,fontId:l,fillId:u,borderId:a,xfId:0,applyNumberFormat:d===0?void 0:!0,applyFont:l===0?void 0:!0,applyFill:u===0?void 0:!0,applyBorder:a===0?void 0:!0,applyAlignment:c===""?void 0:!0},c));return this.byLook.set(i,m),m}dxf(n){return this.dxfs.add(p(n))}dxfXml(n,i){return p(n,i)}xml(){const n=(r,d)=>e(r,{count:d.length},d.join("")),i=[...this.formats].map(([r,d])=>e("numFmt",{numFmtId:d,formatCode:r}));return e("styleSheet",{xmlns:y.main},i.length>0?n("numFmts",i):"",n("fonts",this.fonts.items),n("fills",this.fills.items),n("borders",this.borders.items),n("cellStyleXfs",[e("xf",{numFmtId:0,fontId:0,fillId:0,borderId:0})]),n("cellXfs",this.xfs.items),n("cellStyles",[e("cellStyle",{name:"Normal",xfId:0,builtinId:0})]),this.dxfs.items.length===0?e("dxfs",{count:0}):n("dxfs",this.dxfs.items),e("tableStyles",{count:0,defaultTableStyle:"TableStyleMedium2",defaultPivotStyle:"PivotStyleLight16"}))}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{SHEET_MARGINS as pe,SHEET_NOTE_AUTHOR as K,SHEET_PAPERS as we}from"@allyhub/formats";import{MAX_COLUMNS as Q,MAX_ROWS as ee,cellName as _,columnIndex as xe,columnLetter as D,rangeName as M,readAddress as te,readArea as ge}from"../address.js";import{parseFormula as $e}from"../formula/parse.js";import{sheetPrefix as X}from"../formula/print.js";import{walk as ye}from"../formula/walk.js";import{fileCells as be,isPicture as ve,pictureHeight as Se,pictureSize as se}from"../files.js";import{scenariosByCell as ke}from"../scenario.js";import{CellError as P,readTyped as Ae}from"../values.js";import{FormulaCell as Ce}from"../workbook.js";import{chartPart as Ee,drawingPart as Te}from"./charts.js";import{fileFormula as N,needsArray as B}from"./formula.js";import{GRID_END as W}from"./read.js";import{Styles as Me}from"./styles.js";import{THEME_XML as Re}from"./theme.js";import{HEAD as S,NS as k,el as o,xstring as x}from"./xml.js";import{ZipOut as _e}from"./zip.js";const A={comments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",sheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",styles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",strings:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",table:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",metadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",drawing:"application/vnd.openxmlformats-officedocument.drawing+xml",chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"},v=`${k.rel}/`,ne="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",oe="http://schemas.microsoft.com/office/excel/2006/main",re={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}"},je=191029;export const DEFAULT_TABLE_STYLE="TableStyleMedium2",LISTS_SHEET="AllyHub lists";const Le=64,Oe=7,Fe=a=>Math.min(255,Math.floor(a/Oe*256)/256),Ie=a=>Math.min(409.5,a*3/4),q=32767,De=255,Pe=2e5,Ne=o("metadata",{xmlns:k.main,"xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},o("metadataTypes",{count:1},o("metadataType",{name:"XLDAPR",minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1})),o("futureMetadata",{name:"XLDAPR",count:1},o("bk",{},o("extLst",{},o("ext",{uri:"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"},o("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0}))))),o("cellMetadata",{count:1},o("bk",{},o("rc",{t:1,v:0}))));class Ve{index=new Map;count=0;of(t){this.count+=1;let s=this.index.get(t);return s===void 0&&(s=this.index.size,this.index.set(t,s)),s}write(t){t.write(`${S}<sst xmlns="${k.main}" count="${String(this.count)}" uniqueCount="${String(this.index.size)}">`);for(const s of this.index.keys()){const e=/^\s|\s$|\n/u.test(s);t.write(`<si><t${e?' xml:space="preserve"':""}>${x(s)}</t></si>`)}t.write("</sst>"),t.end()}}function ze(a){for(const t in a)if(Object.hasOwn(a,t))return!1;return!0}const He=a=>o("x",a).slice(2,-2),Ue="Base case";function Xe(a){const t=new Map;for(const n of a.scenarios)for(const r of n.cells)t.set(_(r),r);const s=(n,r)=>o("inputCells",{r:_(n),val:r===null||r instanceof P?"":typeof r=="boolean"?r?"1":"0":String(r)}),e=(n,r)=>o("scenario",{name:n,locked:!0,count:r.length,user:"AllyHub"},r.join(""));return o("scenarios",{current:0,show:0,sqref:[...t.keys()].join(" ")},e(Ue,[...t.values()].map(n=>s(n,n.base))),...a.scenarios.map(n=>e(n.name,n.cells.map(r=>s(r,r.value)))))}function Be(a,t,s,e){const n=[];let r=0;for(const{row:l,col:h,paths:c,column:i}of be(a,t)){let d=0;const f=Se(i);for(const m of c){const u=ve(m)?s?.(m):void 0,$=u&&se(u);if(!u||!$){r+=1;continue}const T=Math.round($.width/$.height*f);n.push({row:l,col:h,x:d,width:T,height:f,name:m.split("/").pop()??m,path:m,file:`.${$.type==="jpeg"?"jpg":$.type}`,bytes:u}),d+=T+4}}for(const l of a.spec.pictures??[]){const h=te(l.at),c=s?.(l.file),i=c&&se(c);if(!h||!c||!i)continue;const d=i.width/i.height,f=l.width??(l.height===void 0?i.width:l.height*d);n.push({row:h.row,col:h.col,x:l.x??0,y:l.y??0,width:Math.round(f),height:Math.round(l.height??f/d),name:l.file.split("/").pop()??l.file,path:l.file,file:`.${i.type==="jpeg"?"jpg":i.type}`,bytes:c})}return r>0&&e.push(`${a.name}: ${String(r)} file${r===1?"":"s"} in a cell, which stay${r===1?"s":""} a name`),n}class We{name;columns=[];known=new Map;constructor(t){let s=LISTS_SHEET;for(let e=2;t.sheet(s);e++)s=`${LISTS_SHEET} (${String(e)})`;this.name=s}place(t){const s=JSON.stringify(t);let e=this.known.get(s);e===void 0&&(e=this.columns.length,this.columns.push(t),this.known.set(s,e));const n=D(e);return`${X(this.name)}$${n}$1:$${n}$${String(Math.max(1,t.length))}`}xml(t){const s=[],e=Math.max(0,...this.columns.map(n=>n.length));for(let n=0;n<e;n++){let r=`<row r="${String(n+1)}">`;this.columns.forEach((l,h)=>{const c=l[n];c!==void 0&&(r+=`<c r="${_({row:n,col:h})}" t="s"><v>${String(t.of(c))}</v></c>`)}),s.push(`${r}</row>`)}return`${S}<worksheet xmlns="${k.main}" xmlns:r="${k.rel}"><dimension ref="${M({top:0,left:0,bottom:Math.max(0,e-1),right:Math.max(0,this.columns.length-1)})}"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData>${s.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`}}class qe{rows=new Int32Array(1024);cols=new Int32Array(1024);size=0;add(t,s){if(this.size===this.rows.length){const e=new Int32Array(this.size*2);e.set(this.rows),this.rows=e;const n=new Int32Array(this.size*2);n.set(this.cols),this.cols=n}this.rows[this.size]=t,this.cols[this.size]=s,this.size+=1}byRow(){const{size:t}=this;if(t===0)return{start:new Uint32Array(1),cols:new Int32Array(0),top:0,used:void 0};let s=1/0,e=-1,n=1/0,r=-1;for(let i=0;i<t;i++){const d=this.rows[i]??0,f=this.cols[i]??0;d<s&&(s=d),d>e&&(e=d),f<n&&(n=f),f>r&&(r=f)}const l=new Uint32Array(e-s+2);for(let i=0;i<t;i++){const d=(this.rows[i]??0)-s+1;l[d]=(l[d]??0)+1}for(let i=1;i<l.length;i++)l[i]=(l[i]??0)+(l[i-1]??0);const h=l.slice(0,-1),c=new Int32Array(t);for(let i=0;i<t;i++){const d=(this.rows[i]??0)-s,f=h[d]??0;c[f]=this.cols[i]??0,h[d]=f+1}return{start:l,cols:c,top:s,used:{top:s,bottom:e,left:n,right:r}}}}function Ge(a,t){if(!a)return!1;let s=!1;const e=t.toLowerCase();return ye(a,n=>{(n.kind==="ref"||n.kind==="name")&&n.sheet!==void 0&&n.sheet.toLowerCase()!==e&&(s=!0)}),s}const Ye=(a,t)=>`{00000000-0000-4000-8000-${(a*65536+t).toString(16).toUpperCase().padStart(12,"0")}}`;class Ze{arrays=!1;sheet;calc;styles;strings;wb;cached;left;lists;index;isTable;isRangeName;hiddenRows;tall;scenarios;drawn;newerRules=[];newerValidations=[];shapes=new Map;groups=new Map;constructor(t,s,e,n,r,l,h,c,i=[],d){this.sheet=t,this.calc=s,this.wb=s.wb,this.styles=e,this.strings=n,this.cached=r,this.left=l,this.lists=h,this.index=c,this.isTable=m=>this.wb.table(m)!==void 0,this.isRangeName=m=>{const u=this.wb.name(m,t)?.formula?.node;return this.isTable(m)||u!==void 0&&B({kind:"unary",op:"-",arg:u})},this.hiddenRows=s.filtered(t),this.scenarios=d,this.drawn=t.charts.length>0||i.length>0;const f=new Map;for(const m of i)m.y===void 0&&f.set(m.row,Math.max(f.get(m.row)??0,m.height));this.tall=f}grid(){const{sheet:t}=this;if(t.lastRow>=ee)throw new Error(`${t.name} reaches row ${(t.lastRow+1).toLocaleString("en-US")}, and ${W}: an Excel file cannot hold it.`);if(t.columnsUsed>Q)throw new Error(`${t.name} reaches past column ${D(Q-1)}, and ${W}: an Excel file cannot hold it.`);for(const s of Object.keys(t.spec.rows??{}))if(Number(s)>ee)throw new Error(`${t.name} sets row ${s}, and ${W}: an Excel file cannot hold it.`)}gather(){const{sheet:t}=this,s=new qe;for(let e=0;e<t.columnsUsed;e++){const[n,r]=t.span(e,0,Number.MAX_SAFE_INTEGER);for(let l=n;l<=r;l++)(t.at(l,e)!==void 0||t.spillAt(l,e))&&s.add(l,e)}for(const{area:e}of t.styledAreas()){const n=(e.bottom-e.top+1)*(e.right-e.left+1);if(n>Pe){this.left.push(`${t.name}!${M(e)}: its look on the cells that hold something, ${String(n)} cells being too many to write empty`);continue}for(let r=e.top;r<=e.bottom;r++)for(let l=e.left;l<=e.right;l++)s.add(r,l)}for(const e of t.keys.keys())s.add(Math.floor(e/16384),e%16384);return s.byRow()}styleOf(t,s){const e=this.sheet.lookAt(t,s);return ze(e)?void 0:this.styles.xf(e)}held(t,s){return s.length<=q?s:(this.left.push(`${this.sheet.name}!${t} past Excel's ${String(q)} characters, of its ${String(s.length)}`),s.slice(0,q))}value(t,s,e){return e===null?`<c r="${t}"${C(s)}/>`:typeof e=="number"?`<c r="${t}"${C(s)}><v>${String(e)}</v></c>`:typeof e=="boolean"?`<c r="${t}"${C(s)} t="b"><v>${e?"1":"0"}</v></c>`:e instanceof P?ce(e)?`<c r="${t}"${C(s)} t="e"><v>${e.code}</v></c>`:`<c r="${t}"${C(s)} t="s"><v>${String(this.strings.of(e.code))}</v></c>`:`<c r="${t}"${C(s)} t="s"><v>${String(this.strings.of(this.held(t,e)))}</v></c>`}table(t){return this.sheet.tableAt(t.row,t.col)?.name}formula(t,s,e){const n=this.calc.value(e.sheet,e.row,e.col),{shared:r}=e,{node:l}=r;if(!l)return`<c r="${t}"${C(s)} t="e"><v>#NAME?</v></c>`;let h=this.shapes.get(r);h===void 0&&(h=B(l,this.isRangeName),this.shapes.set(r,h));const c=e.array!==void 0||e.blocked!==void 0||h;let i=c?void 0:this.groups.get(r);i?.written===!1&&(e.row!==i.ref.top||e.col!==i.ref.left)&&(i=void 0);let d,f="";if(i?.written===!0)d=`<f t="shared" si="${String(i.si)}"/>`;else{const m=N(e.moved,{table:this.table(e),isTable:this.isTable,array:c});d=i?`<f t="shared" ref="${M(i.ref)}" si="${String(i.si)}">${x(m)}</f>`:`<f>${x(m)}</f>`,i&&(i.written=!0),c&&(d=this.arrayFormula(e,m))}return c&&(this.arrays=!0,f=' cm="1"'),this.cached?n===null||typeof n=="number"?`<c r="${t}"${C(s)}${f}>${d}<v>${String(n??0)}</v></c>`:typeof n=="boolean"?`<c r="${t}"${C(s)} t="b"${f}>${d}<v>${n?"1":"0"}</v></c>`:n instanceof P?ce(n)?`<c r="${t}"${C(s)} t="e"${f}>${d}<v>${n.code}</v></c>`:`<c r="${t}"${C(s)}${f}>${d}<v>0</v></c>`:`<c r="${t}"${C(s)} t="str"${f}>${d}<v>${x(this.held(t,n))}</v></c>`:`<c r="${t}"${C(s)}${f}>${d}</c>`}arrayFormula(t,s){const e=t.spill??{top:t.row,left:t.col,bottom:t.row,right:t.col};return`<f t="array" ref="${M(e)}">${x(s)}</f>`}shareFormulas(){const t=new Map;for(const e of this.sheet.formulas){const n=t.get(e.shared);if(!n)t.set(e.shared,{area:{top:e.row,bottom:e.row,left:e.col,right:e.col},first:e,n:1});else{const{area:r}=n;e.row<r.top&&(r.top=e.row),e.row>r.bottom&&(r.bottom=e.row),e.col<r.left&&(r.left=e.col),e.col>r.right&&(r.right=e.col),(e.row<n.first.row||e.row===n.first.row&&e.col<n.first.col)&&(n.first=e),n.n+=1}}let s=0;for(const[e,{area:n,first:r,n:l}]of t)l>1&&r.row===n.top&&r.col===n.left&&(this.groups.set(e,{si:s,ref:n,written:!1}),s+=1)}cell(t,s){const e=_({row:t,col:s}),n=this.styleOf(t,s),r=this.sheet.at(t,s);return r instanceof Ce?this.formula(e,n,r):r===void 0&&this.cached&&this.sheet.spillAt(t,s)?this.value(e,n,this.calc.value(this.sheet,t,s)):this.value(e,n,r??null)}columns(){const{sheet:t}=this,{spec:s}=t,e=new Map,n=new Map;for(const c of t.tables)for(const i of c.columns)i.spec?.width!==void 0&&n.set(c.at.col+i.index,i.spec.width);const r=new Set(n.keys()),l=new Map;for(const[c,i]of Object.entries(s.columns??{})){const d=xe(c);d!==void 0&&(l.set(d,i),r.add(d))}for(const c of r){const i=l.get(c),d=i?.width??n.get(c),f=de(i);e.set(c,o("col",{min:c+1,max:c+1,width:Fe(d??Le),style:f===void 0?void 0:this.styles.xf(f),hidden:i?.hidden===!0?!0:void 0,customWidth:d===void 0?void 0:!0,outlineLevel:i?.level}))}const h=[...e.keys()].sort((c,i)=>c-i).map(c=>e.get(c)??"");return h.length===0?"":`<cols>${h.join("")}</cols>`}rowAttrs(t){const s=this.sheet.spec.rows?.[String(t+1)],e=de(s),n=s?.height??this.tall.get(t);return He({r:t+1,s:e===void 0?void 0:this.styles.xf(e),customFormat:e===void 0?void 0:!0,ht:n===void 0?void 0:Ie(n),customHeight:n===void 0?void 0:!0,hidden:s?.hidden===!0||this.hiddenRows.has(t)?!0:void 0,outlineLevel:s?.level})}rows(t,s){const{sheet:e}=this,n=new Set(this.hiddenRows);for(const d of Object.keys(e.spec.rows??{}))n.add(Number(d)-1);const{start:r,cols:l,top:h}=s;let c=s.used?h:1/0,i=s.used?s.used.bottom:-1;for(const d of n)d<c&&(c=d),d>i&&(i=d);for(let d=Math.max(0,c);d<=i;d++){const f=d-h,m=f>=0&&f<r.length-1?r[f]??0:0,u=f>=0&&f<r.length-1?r[f+1]??0:0;if(m===u&&!n.has(d))continue;if(m===u){t.write(`<row${this.rowAttrs(d)}/>`);continue}const $=l.subarray(m,u).sort();let T=`<row${this.rowAttrs(d)}>`,y=-1;for(const b of $)b!==y&&(y=b,T+=this.cell(d,b));t.write(`${T}</row>`)}}view(t){const{freeze:s}=this.sheet;let e="";if(s&&(s.row>0||s.col>0)){const n=s.row>0&&s.col>0?"bottomRight":s.row>0?"bottomLeft":"topRight";e=o("pane",{xSplit:s.col>0?s.col:void 0,ySplit:s.row>0?s.row:void 0,topLeftCell:_(s),activePane:n,state:"frozen"})}return o("sheetViews",{},o("sheetView",{showGridLines:this.sheet.spec.gridlines===!1?!1:void 0,tabSelected:t?!0:void 0,workbookViewId:0},e))}write(t,s,e){const{sheet:n}=this;this.grid();const r=this.gather();this.shareFormulas();const l=n.tables.map((y,b)=>o("tablePart",{"r:id":`rId${String(b+1)}`})),{print:h}=n.spec,c=h?.fit,i=Object.keys(n.spec.notes??{}).length>0;t.write(`${S}<worksheet xmlns="${k.main}" xmlns:r="${k.rel}">`+(n.spec.tab===void 0&&c===void 0?"":o("sheetPr",{},n.spec.tab===void 0?"":o("tabColor",{rgb:`FF${n.spec.tab.slice(1).toUpperCase()}`}),c===void 0?"":o("pageSetUpPr",{fitToPage:!0})))+o("dimension",{ref:r.used?M(r.used):"A1"})+this.view(s)+o("sheetFormatPr",{defaultRowHeight:15,outlineLevelRow:ie(n.spec.rows),outlineLevelCol:ie(n.spec.columns)})+this.columns()+"<sheetData>"),this.rows(t,r);const d=l.length+1+(this.drawn?1:0)+(i?2:0);let f=0;const m=Object.entries(n.spec.links??{}).map(([y,b])=>b.startsWith("#")?o("hyperlink",{ref:y,location:b.slice(1)}):o("hyperlink",{ref:y,"r:id":`rId${String(d+f++)}`})),u=n.merges.map(y=>o("mergeCell",{ref:M(y)})),$=n.conditions.map((y,b)=>this.condition(y,b+1)).join(""),T=this.validations();return t.write("</sheetData>"+(n.spec.protect===!0?o("sheetProtection",{sheet:!0,objects:!0,scenarios:!0}):"")+(this.scenarios?Xe(this.scenarios):"")+this.sheetFilter()+(u.length>0?o("mergeCells",{count:u.length},u.join("")):"")+$+T+(m.length>0?o("hyperlinks",{},m.join("")):"")+o("pageMargins",{...pe,...h?.margins})+(h?.orientation!==void 0||h?.paper!==void 0||c!==void 0?o("pageSetup",{paperSize:h?.paper===void 0?void 0:we[h.paper],fitToWidth:c?.width,fitToHeight:c?.height,orientation:h?.orientation}):"")+(h?.header||h?.footer?o("headerFooter",{},h.header?o("oddHeader",{},x(ae(h.header))):"",h.footer?o("oddFooter",{},x(ae(h.footer))):""):"")+(this.drawn?o("drawing",{"r:id":`rId${String(l.length+1)}`}):"")+(i?o("legacyDrawing",{"r:id":`rId${String(l.length+(this.drawn?2:1))}`}):"")+(l.length>0?o("tableParts",{count:l.length},l.join("")):"")+this.extensions()+"</worksheet>"),t.end(),n.tables.map((y,b)=>this.tableXml(y,e+b))}extensions(){const t=[];return this.newerRules.length>0&&t.push(o("ext",{uri:re.conditional,"xmlns:x14":ne},o("x14:conditionalFormattings",{},this.newerRules.join("")))),this.newerValidations.length>0&&t.push(o("ext",{uri:re.validations,"xmlns:x14":ne},o("x14:dataValidations",{count:this.newerValidations.length,"xmlns:xm":oe},this.newerValidations.join("")))),t.length===0?"":o("extLst",{},t.join(""))}bound(t){if(t===void 0)return"";if(typeof t=="number")return String(t);if(!t.startsWith("=")){const e=Ae(t);return typeof e.value=="number"&&e.formula===void 0?String(e.value):`"${t.replaceAll('"','""')}"`}const s=$e(t);return s.ok?N(s.node,{isTable:this.isTable,array:!0}):t.slice(1)}cfvo(t,s){const e=t.value===void 0?void 0:typeof t.value=="number"?String(t.value):this.bound(t.value);return s?o("x14:cfvo",{type:t.at},e===void 0?"":o("xm:f",{},x(e))):o("cfvo",{type:t.at,val:e})}crosses(t){return t.some(s=>Ge(s?.node,this.sheet.name))}condition(t,s){const{spec:e}=t,n=e.range,r=e.type!=="dataBar"&&this.crosses(t.formulas),l=(f,m,...u)=>{if(!r){const $=Object.keys(m).length===0?void 0:this.styles.dxf(m);return o("conditionalFormatting",{sqref:n},o("cfRule",{...f,dxfId:$,priority:s,stopIfTrue:e.stop===!0?!0:void 0},...u))}return this.newerRules.push(o("x14:conditionalFormatting",{"xmlns:xm":oe},o("x14:cfRule",{...f,priority:s,stopIfTrue:e.stop===!0?!0:void 0,id:Ye(this.index,s)},...u.map($=>$.replace(/^<formula>(.*)<\/formula>$/su,"<xm:f>$1</xm:f>")),Object.keys(m).length===0?"":this.styles.dxfXml(m,"x14:dxf")),o("xm:sqref",{},n))),""},h=et(e),c=t.areas[0],i=c?_({row:c.top,col:c.left}):"A1",d=f=>o("formula",{},x(f));switch(e.type){case"cellIs":return l({type:"cellIs",operator:e.operator},h,...e.formula.map(f=>d(this.bound(f))));case"containsText":{const f=e.operator??"contains",m=`"${e.text.replaceAll('"','""')}"`,u=f==="contains"?`NOT(ISERROR(SEARCH(${m},${i})))`:f==="notContains"?`ISERROR(SEARCH(${m},${i}))`:f==="beginsWith"?`LEFT(${i},LEN(${m}))=${m}`:`RIGHT(${i},LEN(${m}))=${m}`;return l({type:f==="contains"?"containsText":f==="notContains"?"notContainsText":f,operator:f==="contains"?"containsText":f,text:e.text},h,d(u))}case"duplicateValues":case"uniqueValues":return l({type:e.type},h);case"top10":return l({type:"top10",percent:e.percent===!0?!0:void 0,bottom:e.bottom===!0?!0:void 0,rank:e.rank},h);case"aboveAverage":return l({type:"aboveAverage",aboveAverage:e.below===!0?!1:void 0,equalAverage:e.equal===!0?!0:void 0},h);case"expression":return l({type:"expression"},h,d(this.bound(e.formula.startsWith("=")?e.formula:`=${e.formula}`)));case"dataBar":return l({type:"dataBar"},{},o("dataBar",{showValue:e.show===!1?!1:void 0},this.cfvo(e.min??{at:"min"},!1),this.cfvo(e.max??{at:"max"},!1),o("color",{rgb:le(e.color)})));case"colorScale":{const f=r?"x14:":"";return l({type:"colorScale"},{},o(`${f}colorScale`,{},...e.stops.map(m=>this.cfvo(m,r)),...e.stops.map(m=>o(`${f}color`,{rgb:le(m.color)}))))}case"iconSet":{const f=Number.parseInt(e.icons,10),m=e.stops??Array.from({length:f},(u,$)=>({at:"percent",value:Math.round($*100/f)}));return l({type:"iconSet"},{},o(r?"x14:iconSet":"iconSet",{iconSet:e.icons,showValue:e.show===!1?!1:void 0,reverse:e.reverse===!0?!0:void 0},...m.map(u=>this.cfvo(u,r))))}}}validation(t){const{spec:s}=t;let e="",n=this.crosses(t.formulas);if(s.values){const i=s.values.join(",");i.length>De||s.values.some(d=>d.includes(",")||d.includes('"'))?(e=this.lists.place(s.values),n=!0):e=`"${i}"`}else e=this.bound(s.formula?.[0]);const r=this.bound(s.formula?.[1]),{error:l,prompt:h}=s;s.multiple===!0&&this.left.push(`${this.sheet.name}!${s.range}: several choices in a cell: its text stays, and Excel's list offers one at a time`);const c={type:s.type,errorStyle:l?.style===void 0||l.style==="stop"?void 0:l.style,operator:s.operator===void 0||s.operator==="between"?void 0:s.operator,allowBlank:s.blank===!1?void 0:!0,showDropDown:s.dropdown===!1?!0:void 0,showInputMessage:h?.show===!1?void 0:!0,showErrorMessage:l?.show===!1||s.multiple===!0?void 0:!0,errorTitle:l?.title,error:l?.message,promptTitle:h?.title,prompt:h?.message};return n?(this.newerValidations.push(o("x14:dataValidation",c,e===""?"":o("x14:formula1",{},o("xm:f",{},x(e))),r===""?"":o("x14:formula2",{},o("xm:f",{},x(r))),o("xm:sqref",{},s.range))),""):o("dataValidation",{...c,sqref:s.range},e===""?"":o("formula1",{},x(e)),r===""?"":o("formula2",{},x(r)))}validations(){const t=this.sheet.validations.map(s=>this.validation(s)).filter(s=>s!=="");return t.length===0?"":o("dataValidations",{count:t.length},t.join(""))}filterColumns(t){return[...t.columns.entries()].sort(([s],[e])=>s-e).map(([s,e])=>tt(s-t.area.left,e))}sheetFilter(){const t=this.sheet.filters.find(s=>!s.table);return t?o("autoFilter",{ref:M(t.area)},...this.filterColumns(t)):""}columnFormula(t,s){if(!s?.node)return"";const e=B(s.node,this.isRangeName),n=N(s.node,{table:t.name,isTable:this.isTable,array:e});return o("calculatedColumnFormula",{array:e?!0:void 0},x(n))}tableXml(t,s){const e=t.area,n=M({...e,bottom:Math.max(e.bottom,e.top+1)}),r=t.spec.style??DEFAULT_TABLE_STYLE,l=this.sheet.filters.find(h=>h.table===t);return S+o("table",{xmlns:k.main,id:s,name:t.name,displayName:t.name,ref:n,totalsRowShown:0},l?o("autoFilter",{ref:n},...this.filterColumns(l)):"",o("tableColumns",{count:t.columns.length},t.columns.map((h,c)=>o("tableColumn",{id:c+1,name:h.name},this.columnFormula(t,h.formula))).join("")),r==="none"?o("tableStyleInfo",{showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}):o("tableStyleInfo",{name:r,showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}))}}const ie=a=>{let t;for(const s of Object.values(a??{}))s.level!==void 0&&(t=Math.max(t??0,s.level));return t},ae=a=>[a.left===void 0?"":`&L${a.left}`,a.center===void 0?"":`&C${a.center}`,a.right===void 0?"":`&R${a.right}`].join(""),Je=a=>typeof a=="string"?{text:a,author:K}:{text:a.text,author:a.author??K};function Ke(a){const t=a.map(([e,n])=>({ref:e,...Je(n)})),s=[...new Set(t.map(e=>e.author))];return S+o("comments",{xmlns:k.main},o("authors",{},s.map(e=>o("author",{},x(e))).join("")),o("commentList",{},t.map(e=>o("comment",{ref:e.ref,authorId:s.indexOf(e.author)},o("text",{},o("r",{},o("t",/^\s|\s$|\n/u.test(e.text)?{"xml:space":"preserve"}:{},x(e.text)))))).join("")))}function Qe(a){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>${a.flatMap(([s],e)=>{const n=te(s);return n?[`<v:shape id="_x0000_s${String(1025+e)}" type="#_x0000_t202" style="position:absolute;margin-left:80pt;margin-top:5pt;width:120pt;height:60pt;z-index:${String(e+1)};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${String(n.col+1)}, 15, ${String(n.row)}, 2, ${String(n.col+3)}, 15, ${String(n.row+4)}, 4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${String(n.row)}</x:Row><x:Column>${String(n.col)}</x:Column></x:ClientData></v:shape>`]:[]}).join("")}</xml>`}const le=a=>`FF${a.slice(1).toUpperCase()}`;function et(a){if(a.type==="dataBar"||a.type==="colorScale"||a.type==="iconSet")return{};const t={};for(const s of["bold","italic","underline","strike","color","fill","border"])a[s]!==void 0&&(t[s]=a[s]);return t}function tt(a,t){return o("filterColumn",{colId:a},o("filters",{blank:t.blanks===!0?!0:void 0},(t.values??[]).map(s=>o("filter",{val:s})).join("")))}const C=a=>a===void 0?"":` s="${String(a)}"`,ce=a=>a.code!=="#CYCLE!",st=new Set(["width","height","hidden"]);function de(a){if(!a)return;const t=Object.fromEntries(Object.entries(a).filter(([s])=>!st.has(s)));return Object.keys(t).length===0?void 0:t}const V=a=>S+o("Relationships",{xmlns:k.pkg},a.map(([t,s,e],n)=>o("Relationship",{Id:`rId${String(n+1)}`,Type:t,Target:s,TargetMode:e})).join(""));function nt(a,t){const s=t.formula?.node;if(s)return N(s,{isTable:n=>a.table(n)!==void 0,array:!0});const{value:e}=t;return e==null?'""':typeof e=="string"?`"${e.replaceAll('"','""')}"`:typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof P?e.code:String(e)}const ot=(a,t)=>a.length===t.length&&a.every((s,e)=>s===t[e]),he=a=>`$${D(a.left)}$${String(a.top+1)}:$${D(a.right)}$${String(a.bottom+1)}`;function rt(a){const t=[],s=(e,n)=>o("definedName",{name:e.name,localSheetId:n,hidden:e.hidden===!0?!0:void 0},x(nt(a,e)));for(const e of a.names.values())t.push(s(e));return a.sheets.forEach((e,n)=>{for(const d of e.names.values())t.push(s(d,n));const r=e.filters.find(d=>!d.table);r&&t.push(o("definedName",{name:"_xlnm._FilterDatabase",localSheetId:n,hidden:!0},x(`${X(e.name)}${he(r.area)}`)));const l=X(e.name),h=e.spec.print,c=h?.area===void 0?void 0:ge(h.area);c&&t.push(o("definedName",{name:"_xlnm.Print_Area",localSheetId:n},x(`${l}${he(c)}`)));const i=[h?.title_cols?.toUpperCase().replace(/([A-Z]+):([A-Z]+)/u,"$$$1:$$$2"),h?.title_rows?.replace(/(\d+):(\d+)/u,"$$$1:$$$2")].flatMap(d=>d===void 0?[]:[`${l}${d}`]);i.length>0&&t.push(o("definedName",{name:"_xlnm.Print_Titles",localSheetId:n},x(i.join(","))))}),t}export function writeXlsx(a,t={}){const s=a.wb,e=[];s.checks.length>0&&e.push(`${String(s.checks.length)} check${s.checks.length===1?"":"s"}: a file has no such thing`);const n=ke(a);e.push(...n.left);const r=new Me,l=new Ve,h=new We(s),c=new _e,i=[["/xl/workbook.xml",A.sheet]],d=Math.max(0,s.sheets.findIndex(p=>p.spec.hidden!==!0));let f=1,m=!1;const u=new Map;let $=0,T=0,y=0;for(const[p,w]of s.sheets.entries()){const H=String(p+1),O=Be(w,a,t.file,e),F=w.charts.filter(({spec:g})=>[g.categories,...g.series.flatMap(E=>[E.values,E.x])].some(E=>E?.endsWith("#"))).length;F>0&&e.push(`${w.name}: ${String(F)} chart${F===1?"":"s"} on a spill: ${F===1?"it reads":"they read"} the cells the spill covers now, and will not grow with it`);const Z=new Ze(w,a,r,l,t.cached!==!1,e,h,p,O,n.sheets.find(g=>g.sheet===w)),me=Z.write(c.part(`xl/worksheets/sheet${H}.xml`),p===d,f);m||=Z.arrays,i.push([`/xl/worksheets/sheet${H}.xml`,A.worksheet]);const R=[];for(const g of me){const E=`table${String(f)}.xml`;f+=1,c.add(`xl/tables/${E}`,g),i.push([`/xl/tables/${E}`,A.table]),R.push([`${v}table`,`../tables/${E}`])}if(w.charts.length>0||O.length>0){$+=1;const g=`drawing${String($)}.xml`;c.add(`xl/drawings/${g}`,Te(w.charts,O)),i.push([`/xl/drawings/${g}`,A.drawing]),R.push([`${v}drawing`,`../drawings/${g}`]);const E=w.charts.map(L=>{T+=1;const I=`chart${String(T)}.xml`;return c.add(`xl/charts/${I}`,Ee(a,w,L)),i.push([`/xl/charts/${I}`,A.chart]),[`${v}chart`,`../charts/${I}`]});for(const L of O){const J=[...u].find(([,ue])=>ot(ue,L.bytes))?.[0]??`image${String(u.size+1)}${L.file}`;u.set(J,L.bytes),E.push([`${v}image`,`../media/${J}`])}c.add(`xl/drawings/_rels/${g}.rels`,V(E))}const U=Object.entries(w.spec.notes??{});if(U.length>0){y+=1;const g=String(y);c.add(`xl/comments${g}.xml`,Ke(U)),i.push([`/xl/comments${g}.xml`,A.comments]),c.add(`xl/drawings/vmlDrawing${g}.vml`,Qe(U)),R.push([`${v}vmlDrawing`,`../drawings/vmlDrawing${g}.vml`]),R.push([`${v}comments`,`../comments${g}.xml`])}for(const g of Object.values(w.spec.links??{}))g.startsWith("#")||R.push([`${v}hyperlink`,g,"External"]);R.length>0&&c.add(`xl/worksheets/_rels/sheet${H}.xml.rels`,V(R))}const b=s.sheets.length,z=h.columns.length>0;if(z){const p=`xl/worksheets/sheet${String(b+1)}.xml`;c.add(p,h.xml(l)),i.push([`/${p}`,A.worksheet])}const j=[...s.sheets,...z?[void 0]:[]].map((p,w)=>[`${v}worksheet`,`worksheets/sheet${String(w+1)}.xml`]);j.push([`${v}theme`,"theme/theme1.xml"]),j.push([`${v}styles`,"styles.xml"]),j.push([`${v}sharedStrings`,"sharedStrings.xml"]),m&&(j.push([`${v}sheetMetadata`,"metadata.xml"]),i.push(["/xl/metadata.xml",A.metadata]));const G=rt(s),Y=s.sheets.map((p,w)=>o("sheet",{name:p.name,sheetId:w+1,state:p.spec.hidden===!0?"hidden":void 0,"r:id":`rId${String(w+1)}`}));z&&Y.push(o("sheet",{name:h.name,sheetId:b+1,state:"veryHidden","r:id":`rId${String(b+1)}`})),c.add("xl/workbook.xml",S+o("workbook",{xmlns:k.main,"xmlns:r":k.rel},o("workbookPr",{}),o("bookViews",{},o("workbookView",{activeTab:d===0?void 0:d})),o("sheets",{},Y.join("")),G.length>0?o("definedNames",{},G.join("")):"",o("calcPr",{calcId:je,fullCalcOnLoad:!0}))),c.add("xl/_rels/workbook.xml.rels",V(j)),c.add("xl/styles.xml",S+r.xml()),l.write(c.part("xl/sharedStrings.xml")),c.add("xl/theme/theme1.xml",S+Re),m&&c.add("xl/metadata.xml",S+Ne),c.add("docProps/core.xml",S+o("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},s.title===void 0?"":o("dc:title",{},x(s.title)))),c.add("docProps/app.xml",S+o("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},o("Application",{},"AllyHub"))),c.add("_rels/.rels",V([[`${v}officeDocument`,"xl/workbook.xml"],["http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"],[`${v}extended-properties`,"docProps/app.xml"]])),i.push(["/xl/styles.xml",A.styles],["/xl/sharedStrings.xml",A.strings],["/xl/theme/theme1.xml",A.theme],["/docProps/core.xml",A.core],["/docProps/app.xml",A.app]);const fe=[...u].sort(([p],[w])=>p.localeCompare(w));for(const[p,w]of fe)c.add(`xl/media/${p}`,w);return c.add("[Content_Types].xml",S+o("Types",{xmlns:k.types},o("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),o("Default",{Extension:"xml",ContentType:"application/xml"}),y>0?o("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}):"",[...new Set([...u.keys()].map(p=>p.split(".").pop()??""))].sort().map(p=>o("Default",{Extension:p,ContentType:`image/${p==="jpg"?"jpeg":p}`})).join(""),i.map(([p,w])=>o("Override",{PartName:p,ContentType:w})).join(""))),{bytes:c.finish(),left:e}}
|
|
2
|
+
import{SHEET_MARGINS as we,SHEET_NOTE_AUTHOR as K,SHEET_PAPERS as xe}from"@allyhub/formats";import{MAX_COLUMNS as Q,MAX_ROWS as ee,cellName as R,columnIndex as $e,columnLetter as D,rangeName as M,readAddress as te,readArea as ye}from"../address.js";import{analyse as be}from"../calc/analyse.js";import{ITERATION_DEFAULTS as ne}from"../calc/engine.js";import{parseFormula as ve}from"../formula/parse.js";import{sheetPrefix as X}from"../formula/print.js";import{walk as se}from"../formula/walk.js";import{fileCells as Se,isPicture as ke,pictureHeight as Ae,pictureSize as oe}from"../files.js";import{scenariosByCell as Ee}from"../scenario.js";import{CellError as N,readTyped as Te}from"../values.js";import{FormulaCell as Ce}from"../workbook.js";import{chartPart as Me,drawingPart as _e}from"./charts.js";import{fileFormula as P,needsArray as B}from"./formula.js";import{GRID_END as W}from"./read.js";import{Styles as Re}from"./styles.js";import{THEME_XML as Le}from"./theme.js";import{HEAD as A,NS as E,el as o,xstring as x}from"./xml.js";import{ZipOut as je}from"./zip.js";const T={comments:"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml",sheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml",worksheet:"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml",styles:"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml",strings:"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",table:"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml",metadata:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml",drawing:"application/vnd.openxmlformats-officedocument.drawing+xml",chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"},k=`${E.rel}/`,re="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",ie="http://schemas.microsoft.com/office/excel/2006/main",ae={conditional:"{78C0D931-6437-407d-A8EE-F0AAD7539E65}",validations:"{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}"},Ie=191029;export const DEFAULT_TABLE_STYLE="TableStyleMedium2",LISTS_SHEET="AllyHub lists";const Oe=64,Fe=7,De=i=>Math.min(255,Math.floor(i/Fe*256)/256),Ne=i=>Math.min(409.5,i*3/4),q=32767,Pe=255,Ve=2e5,ze=o("metadata",{xmlns:E.main,"xmlns:xda":"http://schemas.microsoft.com/office/spreadsheetml/2017/dynamicarray"},o("metadataTypes",{count:1},o("metadataType",{name:"XLDAPR",minSupportedVersion:12e4,copy:1,pasteAll:1,pasteValues:1,merge:1,splitFirst:1,rowColShift:1,clearFormats:1,clearComments:1,assign:1,coerce:1,cellMeta:1})),o("futureMetadata",{name:"XLDAPR",count:1},o("bk",{},o("extLst",{},o("ext",{uri:"{bdbb8cdc-fa1e-496e-a857-3c3f30c029c3}"},o("xda:dynamicArrayProperties",{fDynamic:1,fCollapsed:0}))))),o("cellMetadata",{count:1},o("bk",{},o("rc",{t:1,v:0}))));class Ue{index=new Map;count=0;of(t){this.count+=1;let n=this.index.get(t);return n===void 0&&(n=this.index.size,this.index.set(t,n)),n}write(t){t.write(`${A}<sst xmlns="${E.main}" count="${String(this.count)}" uniqueCount="${String(this.index.size)}">`);for(const n of this.index.keys()){const e=/^\s|\s$|\n/u.test(n);t.write(`<si><t${e?' xml:space="preserve"':""}>${x(n)}</t></si>`)}t.write("</sst>"),t.end()}}function He(i){let t=!1;return i&&se(i,n=>{(n.kind==="structured"||n.kind==="ref"&&n.sheet!==void 0)&&(t=!0)}),t}function Xe(i){for(const t in i)if(Object.hasOwn(i,t))return!1;return!0}const Be=i=>o("x",i).slice(2,-2),We="Base case";function qe(i){const t=new Map;for(const s of i.scenarios)for(const r of s.cells)t.set(R(r),r);const n=(s,r)=>o("inputCells",{r:R(s),val:r===null||r instanceof N?"":typeof r=="boolean"?r?"1":"0":String(r)}),e=(s,r)=>o("scenario",{name:s,locked:!0,count:r.length,user:"AllyHub"},r.join(""));return o("scenarios",{current:0,show:0,sqref:[...t.keys()].join(" ")},e(We,[...t.values()].map(s=>n(s,s.base))),...i.scenarios.map(s=>e(s.name,s.cells.map(r=>n(r,r.value)))))}function Ge(i,t,n,e){const s=[];let r=0;for(const{row:a,col:h,paths:l,column:c}of Se(i,t)){let d=0;const f=Ae(c);for(const u of l){const m=ke(u)?n?.(u):void 0,$=m&&oe(m);if(!m||!$){r+=1;continue}const S=Math.round($.width/$.height*f);s.push({row:a,col:h,x:d,width:S,height:f,name:u.split("/").pop()??u,path:u,file:`.${$.type==="jpeg"?"jpg":$.type}`,bytes:m}),d+=S+4}}for(const a of i.spec.pictures??[]){const h=te(a.at),l=n?.(a.file),c=l&&oe(l);if(!h||!l||!c)continue;const d=c.width/c.height,f=a.width??(a.height===void 0?c.width:a.height*d);s.push({row:h.row,col:h.col,x:a.x??0,y:a.y??0,width:Math.round(f),height:Math.round(a.height??f/d),name:a.file.split("/").pop()??a.file,path:a.file,file:`.${c.type==="jpeg"?"jpg":c.type}`,bytes:l})}return r>0&&e.push(`${i.name}: ${String(r)} file${r===1?"":"s"} in a cell, which stay${r===1?"s":""} a name`),s}class Ye{name;columns=[];known=new Map;constructor(t){let n=LISTS_SHEET;for(let e=2;t.sheet(n);e++)n=`${LISTS_SHEET} (${String(e)})`;this.name=n}place(t){const n=JSON.stringify(t);let e=this.known.get(n);e===void 0&&(e=this.columns.length,this.columns.push(t),this.known.set(n,e));const s=D(e);return`${X(this.name)}$${s}$1:$${s}$${String(Math.max(1,t.length))}`}xml(t){const n=[],e=Math.max(0,...this.columns.map(s=>s.length));for(let s=0;s<e;s++){let r=`<row r="${String(s+1)}">`;this.columns.forEach((a,h)=>{const l=a[s];l!==void 0&&(r+=`<c r="${R({row:s,col:h})}" t="s"><v>${String(t.of(l))}</v></c>`)}),n.push(`${r}</row>`)}return`${A}<worksheet xmlns="${E.main}" xmlns:r="${E.rel}"><dimension ref="${M({top:0,left:0,bottom:Math.max(0,e-1),right:Math.max(0,this.columns.length-1)})}"/><sheetViews><sheetView workbookViewId="0"/></sheetViews><sheetFormatPr defaultRowHeight="15"/><sheetData>${n.join("")}</sheetData><pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/></worksheet>`}}class Ze{rows=new Int32Array(1024);cols=new Int32Array(1024);size=0;add(t,n){if(this.size===this.rows.length){const e=new Int32Array(this.size*2);e.set(this.rows),this.rows=e;const s=new Int32Array(this.size*2);s.set(this.cols),this.cols=s}this.rows[this.size]=t,this.cols[this.size]=n,this.size+=1}byRow(){const{size:t}=this;if(t===0)return{start:new Uint32Array(1),cols:new Int32Array(0),top:0,used:void 0};let n=1/0,e=-1,s=1/0,r=-1;for(let c=0;c<t;c++){const d=this.rows[c]??0,f=this.cols[c]??0;d<n&&(n=d),d>e&&(e=d),f<s&&(s=f),f>r&&(r=f)}const a=new Uint32Array(e-n+2);for(let c=0;c<t;c++){const d=(this.rows[c]??0)-n+1;a[d]=(a[d]??0)+1}for(let c=1;c<a.length;c++)a[c]=(a[c]??0)+(a[c-1]??0);const h=a.slice(0,-1),l=new Int32Array(t);for(let c=0;c<t;c++){const d=(this.rows[c]??0)-n,f=h[d]??0;l[f]=this.cols[c]??0,h[d]=f+1}return{start:a,cols:l,top:n,used:{top:n,bottom:e,left:s,right:r}}}}function Je(i,t){if(!i)return!1;let n=!1;const e=t.toLowerCase();return se(i,s=>{(s.kind==="ref"||s.kind==="name")&&s.sheet!==void 0&&s.sheet.toLowerCase()!==e&&(n=!0)}),n}const Ke=(i,t)=>`{00000000-0000-4000-8000-${(i*65536+t).toString(16).toUpperCase().padStart(12,"0")}}`;class Qe{arrays=!1;sheet;calc;styles;strings;wb;cached;left;lists;index;isTable;isRangeName;hiddenRows;tall;scenarios;drawn;newerRules=[];newerValidations=[];misgiven=new Set;shapes=new Map;groups=new Map;constructor(t,n,e,s,r,a,h,l,c=[],d){this.sheet=t,this.calc=n,this.wb=n.wb,this.styles=e,this.strings=s,this.cached=r,this.left=a,this.lists=h,this.index=l,this.isTable=u=>this.wb.table(u)!==void 0,this.isRangeName=u=>{const m=this.wb.name(u,t)?.formula?.node;return this.isTable(u)||m!==void 0&&B({kind:"unary",op:"-",arg:m})},this.hiddenRows=n.filtered(t),this.scenarios=d,this.drawn=t.charts.length>0||c.length>0;const f=new Map;for(const u of c)u.y===void 0&&f.set(u.row,Math.max(f.get(u.row)??0,u.height));this.tall=f}grid(){const{sheet:t}=this;if(t.lastRow>=ee)throw new Error(`${t.name} reaches row ${(t.lastRow+1).toLocaleString("en-US")}, and ${W}: an Excel file cannot hold it.`);if(t.columnsUsed>Q)throw new Error(`${t.name} reaches past column ${D(Q-1)}, and ${W}: an Excel file cannot hold it.`);for(const n of Object.keys(t.spec.rows??{}))if(Number(n)>ee)throw new Error(`${t.name} sets row ${n}, and ${W}: an Excel file cannot hold it.`)}gather(){const{sheet:t}=this,n=new Ze;for(let e=0;e<t.columnsUsed;e++){const[s,r]=t.span(e,0,Number.MAX_SAFE_INTEGER);for(let a=s;a<=r;a++)(t.at(a,e)!==void 0||t.spillAt(a,e))&&n.add(a,e)}for(const{area:e}of t.styledAreas()){const s=(e.bottom-e.top+1)*(e.right-e.left+1);if(s>Ve){this.left.push(`${t.name}!${M(e)}: its look on the cells that hold something, ${String(s)} cells being too many to write empty`);continue}for(let r=e.top;r<=e.bottom;r++)for(let a=e.left;a<=e.right;a++)n.add(r,a)}for(const e of t.keys.keys())n.add(Math.floor(e/16384),e%16384);return n.byRow()}styleOf(t,n){const e=this.sheet.lookAt(t,n);return Xe(e)?void 0:this.styles.xf(e)}held(t,n){return n.length<=q?n:(this.left.push(`${this.sheet.name}!${t} past Excel's ${String(q)} characters, of its ${String(n.length)}`),n.slice(0,q))}value(t,n,e){return e===null?`<c r="${t}"${v(n)}/>`:typeof e=="number"?`<c r="${t}"${v(n)}><v>${String(e)}</v></c>`:typeof e=="boolean"?`<c r="${t}"${v(n)} t="b"><v>${e?"1":"0"}</v></c>`:e instanceof N?fe(e)?`<c r="${t}"${v(n)} t="e"><v>${e.code}</v></c>`:`<c r="${t}"${v(n)} t="s"><v>${String(this.strings.of(e.code))}</v></c>`:`<c r="${t}"${v(n)} t="s"><v>${String(this.strings.of(this.held(t,e)))}</v></c>`}dataTable(t,n,e,s){const r=this.value(t,n,s),{shared:a}=e;if(e.row!==a.row||e.col!==a.col)return r;const h=a.node,l=p=>{if(p===void 0||p.kind==="missing")return null;if(!(p.kind!=="ref"||p.sheet!==void 0||!p.row||!p.col))return R({row:p.row.index,col:p.col.index})},c=h?.kind==="call"?h.args:[],d=l(c[0]),f=l(c[1]);if(d===void 0||f===void 0||d===null&&f===null)return this.left.push(`${this.sheet.name}!${t}: a data table whose inputs a file cannot hold, as its values`),r;const m=this.sheet.fills.find(p=>p.shared===a)?.area??{top:e.row,left:e.col,bottom:e.row,right:e.col},$=d!==null&&f!==null?{dt2D:!0,dtr:!0,r1:d,r2:f}:d!==null?{dtr:!0,r1:d}:{dtr:!1,r1:f??""},S=o("f",{t:"dataTable",ref:M(m),...$});return typeof s=="string"?`<c r="${t}"${v(n)} t="str">${S}<v>${x(s)}</v></c>`:r.includes("<v>")?r.replace("<v>",`${S}<v>`):r.replace("/>",`>${S}</c>`)}table(t){return this.sheet.tableAt(t.row,t.col)?.name}formula(t,n,e){const s=this.calc.value(e.sheet,e.row,e.col),{shared:r}=e,{node:a}=r;if(!a)return`<c r="${t}"${v(n)} t="e"><v>#NAME?</v></c>`;if(a.kind==="call"&&a.name==="TABLE"&&a.args.length<=2)return this.dataTable(t,n,e,s);const h=(r.analysis??=be(this.wb,r)).arguments[0];if(h!==void 0)return this.misgiven.has(r)||(this.misgiven.add(r),this.left.push(`${this.sheet.name}!${t}: a formula's value, not the formula, as ${h.name} is given ${String(h.given)} arguments`)),this.value(t,n,s);let l=this.shapes.get(r);l===void 0&&(l=B(a,this.isRangeName),this.shapes.set(r,l));const c=e.array!==void 0||e.blocked!==void 0||l;let d=c?void 0:this.groups.get(r);d?.written===!1&&(e.row!==d.ref.top||e.col!==d.ref.left)&&(d=void 0);let f,u="";if(d?.written===!0)f=`<f t="shared" si="${String(d.si)}"/>`;else{const m=P(e.moved,{table:this.table(e),isTable:this.isTable,array:c});f=d?`<f t="shared" ref="${M(d.ref)}" si="${String(d.si)}">${x(m)}</f>`:`<f>${x(m)}</f>`,d&&(d.written=!0),c&&(f=this.arrayFormula(e,m))}return c&&(this.arrays=!0,u=' cm="1"'),this.cached?s===null||typeof s=="number"?`<c r="${t}"${v(n)}${u}>${f}<v>${String(s??0)}</v></c>`:typeof s=="boolean"?`<c r="${t}"${v(n)} t="b"${u}>${f}<v>${s?"1":"0"}</v></c>`:s instanceof N?fe(s)?`<c r="${t}"${v(n)} t="e"${u}>${f}<v>${s.code}</v></c>`:s.code==="#CYCLE!"?`<c r="${t}"${v(n)}${u}>${f}<v>0</v></c>`:`<c r="${t}"${v(n)} t="e"${u}>${f}<v>#VALUE!</v></c>`:`<c r="${t}"${v(n)} t="str"${u}>${f}<v>${x(this.held(t,s))}</v></c>`:`<c r="${t}"${v(n)}${u}>${f}</c>`}arrayFormula(t,n){const e=t.spill??{top:t.row,left:t.col,bottom:t.row,right:t.col};return`<f t="array" ref="${M(e)}">${x(n)}</f>`}shareFormulas(){const t=new Map;for(const e of this.sheet.formulas){const s=t.get(e.shared);if(!s)t.set(e.shared,{area:{top:e.row,bottom:e.row,left:e.col,right:e.col},first:e,n:1});else{const{area:r}=s;e.row<r.top&&(r.top=e.row),e.row>r.bottom&&(r.bottom=e.row),e.col<r.left&&(r.left=e.col),e.col>r.right&&(r.right=e.col),(e.row<s.first.row||e.row===s.first.row&&e.col<s.first.col)&&(s.first=e),s.n+=1}}let n=0;for(const[e,{area:s,first:r,n:a}]of t)a>1&&r.row===s.top&&r.col===s.left&&!He(e.node)&&(this.groups.set(e,{si:n,ref:s,written:!1}),n+=1)}cell(t,n){const e=R({row:t,col:n}),s=this.styleOf(t,n),r=this.sheet.at(t,n);return r instanceof Ce?this.formula(e,s,r):r===void 0&&this.cached&&this.sheet.spillAt(t,n)?this.value(e,s,this.calc.value(this.sheet,t,n)):this.value(e,s,r??null)}columns(){const{sheet:t}=this,{spec:n}=t,e=new Map,s=new Map;for(const l of t.tables)for(const c of l.columns)c.spec?.width!==void 0&&s.set(l.at.col+c.index,c.spec.width);const r=new Set(s.keys()),a=new Map;for(const[l,c]of Object.entries(n.columns??{})){const d=$e(l);d!==void 0&&(a.set(d,c),r.add(d))}for(const l of r){const c=a.get(l),d=c?.width??s.get(l),f=he(c);e.set(l,o("col",{min:l+1,max:l+1,width:De(d??Oe),style:f===void 0?void 0:this.styles.xf(f),hidden:c?.hidden===!0?!0:void 0,customWidth:d===void 0?void 0:!0,outlineLevel:c?.level}))}const h=[...e.keys()].sort((l,c)=>l-c).map(l=>e.get(l)??"");return h.length===0?"":`<cols>${h.join("")}</cols>`}rowAttrs(t){const n=this.sheet.spec.rows?.[String(t+1)],e=he(n),s=n?.height??this.tall.get(t);return Be({r:t+1,s:e===void 0?void 0:this.styles.xf(e),customFormat:e===void 0?void 0:!0,ht:s===void 0?void 0:Ne(s),customHeight:s===void 0?void 0:!0,hidden:n?.hidden===!0||this.hiddenRows.has(t)?!0:void 0,outlineLevel:n?.level})}rows(t,n){const{sheet:e}=this,s=new Set(this.hiddenRows);for(const d of Object.keys(e.spec.rows??{}))s.add(Number(d)-1);const{start:r,cols:a,top:h}=n;let l=n.used?h:1/0,c=n.used?n.used.bottom:-1;for(const d of s)d<l&&(l=d),d>c&&(c=d);for(let d=Math.max(0,l);d<=c;d++){const f=d-h,u=f>=0&&f<r.length-1?r[f]??0:0,m=f>=0&&f<r.length-1?r[f+1]??0:0;if(u===m&&!s.has(d))continue;if(u===m){t.write(`<row${this.rowAttrs(d)}/>`);continue}const $=a.subarray(u,m).sort();let S=`<row${this.rowAttrs(d)}>`,p=-1;for(const b of $)b!==p&&(p=b,S+=this.cell(d,b));t.write(`${S}</row>`)}}view(t){const{freeze:n}=this.sheet;let e="";if(n&&(n.row>0||n.col>0)){const s=n.row>0&&n.col>0?"bottomRight":n.row>0?"bottomLeft":"topRight";e=o("pane",{xSplit:n.col>0?n.col:void 0,ySplit:n.row>0?n.row:void 0,topLeftCell:R(n),activePane:s,state:"frozen"})}return o("sheetViews",{},o("sheetView",{showGridLines:this.sheet.spec.gridlines===!1?!1:void 0,tabSelected:t?!0:void 0,workbookViewId:0},e))}write(t,n,e){const{sheet:s}=this;this.grid();const r=this.gather();this.shareFormulas();const a=s.tables.map((p,b)=>o("tablePart",{"r:id":`rId${String(b+1)}`})),{print:h}=s.spec,l=h?.fit,c=Object.keys(s.spec.notes??{}).length>0;t.write(`${A}<worksheet xmlns="${E.main}" xmlns:r="${E.rel}">`+(s.spec.tab===void 0&&l===void 0?"":o("sheetPr",{},s.spec.tab===void 0?"":o("tabColor",{rgb:`FF${s.spec.tab.slice(1).toUpperCase()}`}),l===void 0?"":o("pageSetUpPr",{fitToPage:!0})))+o("dimension",{ref:r.used?M(r.used):"A1"})+this.view(n)+o("sheetFormatPr",{defaultRowHeight:15,outlineLevelRow:le(s.spec.rows),outlineLevelCol:le(s.spec.columns)})+this.columns()+"<sheetData>"),this.rows(t,r);const d=a.length+1+(this.drawn?1:0)+(c?2:0);let f=0;const u=Object.entries(s.spec.links??{}).map(([p,b])=>b.startsWith("#")?o("hyperlink",{ref:p,location:b.slice(1)}):o("hyperlink",{ref:p,"r:id":`rId${String(d+f++)}`})),m=s.merges.map(p=>o("mergeCell",{ref:M(p)})),$=s.conditions.map((p,b)=>this.condition(p,b+1)).join(""),S=this.validations();return t.write("</sheetData>"+(s.spec.protect===!0?o("sheetProtection",{sheet:!0,objects:!0,scenarios:!0}):"")+(this.scenarios?qe(this.scenarios):"")+this.sheetFilter()+(m.length>0?o("mergeCells",{count:m.length},m.join("")):"")+$+S+(u.length>0?o("hyperlinks",{},u.join("")):"")+o("pageMargins",{...we,...h?.margins})+(h?.orientation!==void 0||h?.paper!==void 0||l!==void 0?o("pageSetup",{paperSize:h?.paper===void 0?void 0:xe[h.paper],fitToWidth:l?.width,fitToHeight:l?.height,orientation:h?.orientation}):"")+(h?.header||h?.footer?o("headerFooter",{},h.header?o("oddHeader",{},x(ce(h.header))):"",h.footer?o("oddFooter",{},x(ce(h.footer))):""):"")+(this.drawn?o("drawing",{"r:id":`rId${String(a.length+1)}`}):"")+(c?o("legacyDrawing",{"r:id":`rId${String(a.length+(this.drawn?2:1))}`}):"")+(a.length>0?o("tableParts",{count:a.length},a.join("")):"")+this.extensions()+"</worksheet>"),t.end(),s.tables.map((p,b)=>this.tableXml(p,e+b))}extensions(){const t=[];return this.newerRules.length>0&&t.push(o("ext",{uri:ae.conditional,"xmlns:x14":re},o("x14:conditionalFormattings",{},this.newerRules.join("")))),this.newerValidations.length>0&&t.push(o("ext",{uri:ae.validations,"xmlns:x14":re},o("x14:dataValidations",{count:this.newerValidations.length,"xmlns:xm":ie},this.newerValidations.join("")))),t.length===0?"":o("extLst",{},t.join(""))}bound(t){if(t===void 0)return"";if(typeof t=="number")return String(t);if(!t.startsWith("=")){const e=Te(t);return typeof e.value=="number"&&e.formula===void 0?String(e.value):`"${t.replaceAll('"','""')}"`}const n=ve(t);return n.ok?P(n.node,{isTable:this.isTable,array:!0}):t.slice(1)}cfvo(t,n){const e=t.value===void 0?void 0:typeof t.value=="number"?String(t.value):this.bound(t.value);return n?o("x14:cfvo",{type:t.at},e===void 0?"":o("xm:f",{},x(e))):o("cfvo",{type:t.at,val:e})}crosses(t){return t.some(n=>Je(n?.node,this.sheet.name))}condition(t,n){const{spec:e}=t,s=e.range,r=e.type!=="dataBar"&&this.crosses(t.formulas),a=(f,u,...m)=>{if(!r){const $=Object.keys(u).length===0?void 0:this.styles.dxf(u);return o("conditionalFormatting",{sqref:s},o("cfRule",{...f,dxfId:$,priority:n,stopIfTrue:e.stop===!0?!0:void 0},...m))}return this.newerRules.push(o("x14:conditionalFormatting",{"xmlns:xm":ie},o("x14:cfRule",{...f,priority:n,stopIfTrue:e.stop===!0?!0:void 0,id:Ke(this.index,n)},...m.map($=>$.replace(/^<formula>(.*)<\/formula>$/su,"<xm:f>$1</xm:f>")),Object.keys(u).length===0?"":this.styles.dxfXml(u,"x14:dxf")),o("xm:sqref",{},s))),""},h=st(e),l=t.areas[0],c=l?R({row:l.top,col:l.left}):"A1",d=f=>o("formula",{},x(f));switch(e.type){case"cellIs":return a({type:"cellIs",operator:e.operator},h,...e.formula.map(f=>d(this.bound(f))));case"containsText":{const f=e.operator??"contains",u=`"${e.text.replaceAll('"','""')}"`,m=f==="contains"?`NOT(ISERROR(SEARCH(${u},${c})))`:f==="notContains"?`ISERROR(SEARCH(${u},${c}))`:f==="beginsWith"?`LEFT(${c},LEN(${u}))=${u}`:`RIGHT(${c},LEN(${u}))=${u}`;return a({type:f==="contains"?"containsText":f==="notContains"?"notContainsText":f,operator:f==="contains"?"containsText":f,text:e.text},h,d(m))}case"duplicateValues":case"uniqueValues":return a({type:e.type},h);case"top10":return a({type:"top10",percent:e.percent===!0?!0:void 0,bottom:e.bottom===!0?!0:void 0,rank:e.rank},h);case"aboveAverage":return a({type:"aboveAverage",aboveAverage:e.below===!0?!1:void 0,equalAverage:e.equal===!0?!0:void 0},h);case"expression":return a({type:"expression"},h,d(this.bound(e.formula.startsWith("=")?e.formula:`=${e.formula}`)));case"dataBar":return a({type:"dataBar"},{},o("dataBar",{showValue:e.show===!1?!1:void 0},this.cfvo(e.min??{at:"min"},!1),this.cfvo(e.max??{at:"max"},!1),o("color",{rgb:de(e.color)})));case"colorScale":{const f=r?"x14:":"";return a({type:"colorScale"},{},o(`${f}colorScale`,{},...e.stops.map(u=>this.cfvo(u,r)),...e.stops.map(u=>o(`${f}color`,{rgb:de(u.color)}))))}case"iconSet":{const f=Number.parseInt(e.icons,10),u=e.stops??Array.from({length:f},(m,$)=>({at:"percent",value:Math.round($*100/f)}));return a({type:"iconSet"},{},o(r?"x14:iconSet":"iconSet",{iconSet:e.icons,showValue:e.show===!1?!1:void 0,reverse:e.reverse===!0?!0:void 0},...u.map(m=>this.cfvo(m,r))))}}}validation(t){const{spec:n}=t;let e="",s=this.crosses(t.formulas);if(n.values){const c=n.values.join(",");c.length>Pe||n.values.some(d=>d.includes(",")||d.includes('"'))?(e=this.lists.place(n.values),s=!0):e=`"${c}"`}else e=this.bound(n.formula?.[0]);const r=this.bound(n.formula?.[1]),{error:a,prompt:h}=n;n.multiple===!0&&this.left.push(`${this.sheet.name}!${n.range}: several choices in a cell: its text stays, and Excel's list offers one at a time`);const l={type:n.type,errorStyle:a?.style===void 0||a.style==="stop"?void 0:a.style,operator:n.operator===void 0||n.operator==="between"?void 0:n.operator,allowBlank:n.blank===!1?void 0:!0,showDropDown:n.dropdown===!1?!0:void 0,showInputMessage:h?.show===!1?void 0:!0,showErrorMessage:a?.show===!1||n.multiple===!0?void 0:!0,errorTitle:a?.title,error:a?.message,promptTitle:h?.title,prompt:h?.message};return s?(this.newerValidations.push(o("x14:dataValidation",l,e===""?"":o("x14:formula1",{},o("xm:f",{},x(e))),r===""?"":o("x14:formula2",{},o("xm:f",{},x(r))),o("xm:sqref",{},n.range))),""):o("dataValidation",{...l,sqref:n.range},e===""?"":o("formula1",{},x(e)),r===""?"":o("formula2",{},x(r)))}validations(){const t=this.sheet.validations.map(n=>this.validation(n)).filter(n=>n!=="");return t.length===0?"":o("dataValidations",{count:t.length},t.join(""))}filterColumns(t){return[...t.columns.entries()].sort(([n],[e])=>n-e).map(([n,e])=>ot(n-t.area.left,e))}sheetFilter(){const t=this.sheet.filters.find(n=>!n.table);return t?o("autoFilter",{ref:M(t.area)},...this.filterColumns(t)):""}columnFormula(t,n){if(!n?.node)return"";const e=B(n.node,this.isRangeName),s=P(n.node,{table:t.name,isTable:this.isTable,array:e});return o("calculatedColumnFormula",{array:e?!0:void 0},x(s))}tableXml(t,n){const e=t.area,s=M({...e,bottom:Math.max(e.bottom,e.top+1)}),r=t.spec.style??DEFAULT_TABLE_STYLE,a=this.sheet.filters.find(h=>h.table===t);return A+o("table",{xmlns:E.main,id:n,name:t.name,displayName:t.name,ref:s,totalsRowShown:0},a?o("autoFilter",{ref:s},...this.filterColumns(a)):"",o("tableColumns",{count:t.columns.length},t.columns.map((h,l)=>o("tableColumn",{id:l+1,name:h.name},this.columnFormula(t,h.formula))).join("")),r==="none"?o("tableStyleInfo",{showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}):o("tableStyleInfo",{name:r,showFirstColumn:0,showLastColumn:0,showRowStripes:1,showColumnStripes:0}))}}const le=i=>{let t;for(const n of Object.values(i??{}))n.level!==void 0&&(t=Math.max(t??0,n.level));return t},ce=i=>[i.left===void 0?"":`&L${i.left}`,i.center===void 0?"":`&C${i.center}`,i.right===void 0?"":`&R${i.right}`].join(""),et=i=>typeof i=="string"?{text:i,author:K}:{text:i.text,author:i.author??K};function tt(i){const t=i.map(([e,s])=>({ref:e,...et(s)})),n=[...new Set(t.map(e=>e.author))];return A+o("comments",{xmlns:E.main},o("authors",{},n.map(e=>o("author",{},x(e))).join("")),o("commentList",{},t.map(e=>o("comment",{ref:e.ref,authorId:n.indexOf(e.author)},o("text",{},o("r",{},o("t",/^\s|\s$|\n/u.test(e.text)?{"xml:space":"preserve"}:{},x(e.text)))))).join("")))}function nt(i){return`<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="1"/></o:shapelayout><v:shapetype id="_x0000_t202" coordsize="21600,21600" o:spt="202" path="m,l,21600r21600,l21600,xe"><v:stroke joinstyle="miter"/><v:path gradientshapeok="t" o:connecttype="rect"/></v:shapetype>${i.flatMap(([n],e)=>{const s=te(n);return s?[`<v:shape id="_x0000_s${String(1025+e)}" type="#_x0000_t202" style="position:absolute;margin-left:80pt;margin-top:5pt;width:120pt;height:60pt;z-index:${String(e+1)};visibility:hidden" fillcolor="#ffffe1" o:insetmode="auto"><v:fill color2="#ffffe1"/><v:shadow on="t" color="black" obscured="t"/><v:path o:connecttype="none"/><v:textbox style="mso-direction-alt:auto"><div style="text-align:left"></div></v:textbox><x:ClientData ObjectType="Note"><x:MoveWithCells/><x:SizeWithCells/><x:Anchor>${String(s.col+1)}, 15, ${String(s.row)}, 2, ${String(s.col+3)}, 15, ${String(s.row+4)}, 4</x:Anchor><x:AutoFill>False</x:AutoFill><x:Row>${String(s.row)}</x:Row><x:Column>${String(s.col)}</x:Column></x:ClientData></v:shape>`]:[]}).join("")}</xml>`}const de=i=>`FF${i.slice(1).toUpperCase()}`;function st(i){if(i.type==="dataBar"||i.type==="colorScale"||i.type==="iconSet")return{};const t={};for(const n of["bold","italic","underline","strike","color","fill","border"])i[n]!==void 0&&(t[n]=i[n]);return t}function ot(i,t){return o("filterColumn",{colId:i},o("filters",{blank:t.blanks===!0?!0:void 0},(t.values??[]).map(n=>o("filter",{val:n})).join("")))}const v=i=>i===void 0?"":` s="${String(i)}"`,rt=new Set(["#NULL!","#DIV/0!","#VALUE!","#REF!","#NAME?","#NUM!","#N/A","#GETTING_DATA"]),fe=i=>rt.has(i.code),it=new Set(["width","height","hidden"]);function he(i){if(!i)return;const t=Object.fromEntries(Object.entries(i).filter(([n])=>!it.has(n)));return Object.keys(t).length===0?void 0:t}const V=i=>A+o("Relationships",{xmlns:E.pkg},i.map(([t,n,e],s)=>o("Relationship",{Id:`rId${String(s+1)}`,Type:t,Target:n,TargetMode:e})).join(""));function at(i,t){const n=t.formula?.node;if(n)return P(n,{isTable:s=>i.table(s)!==void 0,array:!0});const{value:e}=t;return e==null?'""':typeof e=="string"?`"${e.replaceAll('"','""')}"`:typeof e=="boolean"?e?"TRUE":"FALSE":e instanceof N?e.code:String(e)}const lt=(i,t)=>i.length===t.length&&i.every((n,e)=>n===t[e]),ue=i=>`$${D(i.left)}$${String(i.top+1)}:$${D(i.right)}$${String(i.bottom+1)}`;function ct(i){const t=[],n=(e,s)=>o("definedName",{name:e.name,localSheetId:s,hidden:e.hidden===!0?!0:void 0},x(at(i,e)));for(const e of i.names.values())t.push(n(e));return i.sheets.forEach((e,s)=>{for(const d of e.names.values())t.push(n(d,s));const r=e.filters.find(d=>!d.table);r&&t.push(o("definedName",{name:"_xlnm._FilterDatabase",localSheetId:s,hidden:!0},x(`${X(e.name)}${ue(r.area)}`)));const a=X(e.name),h=e.spec.print,l=h?.area===void 0?void 0:ye(h.area);l&&t.push(o("definedName",{name:"_xlnm.Print_Area",localSheetId:s},x(`${a}${ue(l)}`)));const c=[h?.title_cols?.toUpperCase().replace(/([A-Z]+):([A-Z]+)/u,"$$$1:$$$2"),h?.title_rows?.replace(/(\d+):(\d+)/u,"$$$1:$$$2")].flatMap(d=>d===void 0?[]:[`${a}${d}`]);c.length>0&&t.push(o("definedName",{name:"_xlnm.Print_Titles",localSheetId:s},x(c.join(","))))}),t}function dt(i){if(i===void 0)return{};const t=i===!0?{}:i;return{iterate:!0,iterateCount:t.max_iterations??ne.max_iterations,iterateDelta:t.max_change??ne.max_change}}export function writeXlsx(i,t={}){const n=i.wb,e=[];n.checks.length>0&&e.push(`${String(n.checks.length)} check${n.checks.length===1?"":"s"}: a file has no such thing`);const s=Ee(i);e.push(...s.left);const r=new Re,a=new Ue,h=new Ye(n),l=new je,c=[["/xl/workbook.xml",T.sheet]],d=Math.max(0,n.sheets.findIndex(g=>g.spec.hidden!==!0));let f=1,u=!1;const m=new Map;let $=0,S=0,p=0;for(const[g,w]of n.sheets.entries()){const U=String(g+1),I=Ge(w,i,t.file,e),O=w.charts.filter(({spec:y})=>[y.categories,...y.series.flatMap(C=>[C.values,C.x])].some(C=>C?.endsWith("#"))).length;O>0&&e.push(`${w.name}: ${String(O)} chart${O===1?"":"s"} on a spill: ${O===1?"it reads":"they read"} the cells the spill covers now, and will not grow with it`);const Z=new Qe(w,i,r,a,t.cached!==!1,e,h,g,I,s.sheets.find(y=>y.sheet===w)),pe=Z.write(l.part(`xl/worksheets/sheet${U}.xml`),g===d,f);u||=Z.arrays,c.push([`/xl/worksheets/sheet${U}.xml`,T.worksheet]);const _=[];for(const y of pe){const C=`table${String(f)}.xml`;f+=1,l.add(`xl/tables/${C}`,y),c.push([`/xl/tables/${C}`,T.table]),_.push([`${k}table`,`../tables/${C}`])}if(w.charts.length>0||I.length>0){$+=1;const y=`drawing${String($)}.xml`;l.add(`xl/drawings/${y}`,_e(w.charts,I)),c.push([`/xl/drawings/${y}`,T.drawing]),_.push([`${k}drawing`,`../drawings/${y}`]);const C=w.charts.map(j=>{S+=1;const F=`chart${String(S)}.xml`;return l.add(`xl/charts/${F}`,Me(i,w,j)),c.push([`/xl/charts/${F}`,T.chart]),[`${k}chart`,`../charts/${F}`]});for(const j of I){const J=[...m].find(([,ge])=>lt(ge,j.bytes))?.[0]??`image${String(m.size+1)}${j.file}`;m.set(J,j.bytes),C.push([`${k}image`,`../media/${J}`])}l.add(`xl/drawings/_rels/${y}.rels`,V(C))}const H=Object.entries(w.spec.notes??{});if(H.length>0){p+=1;const y=String(p);l.add(`xl/comments${y}.xml`,tt(H)),c.push([`/xl/comments${y}.xml`,T.comments]),l.add(`xl/drawings/vmlDrawing${y}.vml`,nt(H)),_.push([`${k}vmlDrawing`,`../drawings/vmlDrawing${y}.vml`]),_.push([`${k}comments`,`../comments${y}.xml`])}for(const y of Object.values(w.spec.links??{}))y.startsWith("#")||_.push([`${k}hyperlink`,y,"External"]);_.length>0&&l.add(`xl/worksheets/_rels/sheet${U}.xml.rels`,V(_))}const b=n.sheets.length,z=h.columns.length>0;if(z){const g=`xl/worksheets/sheet${String(b+1)}.xml`;l.add(g,h.xml(a)),c.push([`/${g}`,T.worksheet])}const L=[...n.sheets,...z?[void 0]:[]].map((g,w)=>[`${k}worksheet`,`worksheets/sheet${String(w+1)}.xml`]);L.push([`${k}theme`,"theme/theme1.xml"]),L.push([`${k}styles`,"styles.xml"]),L.push([`${k}sharedStrings`,"sharedStrings.xml"]),u&&(L.push([`${k}sheetMetadata`,"metadata.xml"]),c.push(["/xl/metadata.xml",T.metadata]));const G=ct(n),Y=n.sheets.map((g,w)=>o("sheet",{name:g.name,sheetId:w+1,state:g.spec.hidden===!0?"hidden":void 0,"r:id":`rId${String(w+1)}`}));z&&Y.push(o("sheet",{name:h.name,sheetId:b+1,state:"veryHidden","r:id":`rId${String(b+1)}`})),l.add("xl/workbook.xml",A+o("workbook",{xmlns:E.main,"xmlns:r":E.rel},o("workbookPr",{}),o("bookViews",{},o("workbookView",{activeTab:d===0?void 0:d})),o("sheets",{},Y.join("")),G.length>0?o("definedNames",{},G.join("")):"",o("calcPr",{calcId:Ie,fullCalcOnLoad:!0,...dt(n.file.iteration)}))),l.add("xl/_rels/workbook.xml.rels",V(L)),l.add("xl/styles.xml",A+r.xml()),a.write(l.part("xl/sharedStrings.xml")),l.add("xl/theme/theme1.xml",A+Le),u&&l.add("xl/metadata.xml",A+ze),l.add("docProps/core.xml",A+o("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},n.title===void 0?"":o("dc:title",{},x(n.title)))),l.add("docProps/app.xml",A+o("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},o("Application",{},"AllyHub"))),l.add("_rels/.rels",V([[`${k}officeDocument`,"xl/workbook.xml"],["http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties","docProps/core.xml"],[`${k}extended-properties`,"docProps/app.xml"]])),c.push(["/xl/styles.xml",T.styles],["/xl/sharedStrings.xml",T.strings],["/xl/theme/theme1.xml",T.theme],["/docProps/core.xml",T.core],["/docProps/app.xml",T.app]);const me=[...m].sort(([g],[w])=>g.localeCompare(w));for(const[g,w]of me)l.add(`xl/media/${g}`,w);return l.add("[Content_Types].xml",A+o("Types",{xmlns:E.types},o("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),o("Default",{Extension:"xml",ContentType:"application/xml"}),p>0?o("Default",{Extension:"vml",ContentType:"application/vnd.openxmlformats-officedocument.vmlDrawing"}):"",[...new Set([...m.keys()].map(g=>g.split(".").pop()??""))].sort().map(g=>o("Default",{Extension:g,ContentType:`image/${g==="jpg"?"jpeg":g}`})).join(""),c.map(([g,w])=>o("Override",{PartName:g,ContentType:w})).join(""))),{bytes:l.finish(),left:e}}
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/** Text as an ST_Xstring, then escaped for XML. */
|
|
2
2
|
export declare function xstring(text: string): string;
|
|
3
|
+
/**
|
|
4
|
+
* An attribute's value: an XML reader makes a line break or a tab in one a
|
|
5
|
+
* space (3.3.3 Attribute-Value Normalization), so they are written as
|
|
6
|
+
* Excel writes them, _x000a_ (a table's column "Also LONG\nBUT TWO LINES",
|
|
7
|
+
* which Excel otherwise repairs as no longer its header's text).
|
|
8
|
+
*/
|
|
9
|
+
export declare const xattr: (text: string) => string;
|
|
3
10
|
/** What an ST_Xstring says. */
|
|
4
11
|
export declare const readXstring: (text: string) => string;
|
|
5
12
|
export type Attrs = Record<string, string | number | boolean | undefined>;
|
|
@@ -15,7 +22,11 @@ export declare const NS: {
|
|
|
15
22
|
};
|
|
16
23
|
/** An element or an attribute as the parser gives it. */
|
|
17
24
|
export type Tag = Record<string, unknown>;
|
|
18
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* A part's root element. Line ends are XML's first (2.11 End-of-Line
|
|
27
|
+
* Handling): a CR LF or a CR in the text is a LF, as Excel reads it; a CR
|
|
28
|
+
* written as or _x000D_ stays one.
|
|
29
|
+
*/
|
|
19
30
|
export declare function readXml(text: string): Tag;
|
|
20
31
|
export declare const tags: (v: unknown) => Tag[];
|
|
21
32
|
export declare const tag: (v: unknown) => Tag | undefined;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{XMLParser as
|
|
3
|
-
`,NS={main:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",rel:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",pkg:"http://schemas.openxmlformats.org/package/2006/relationships",types:"http://schemas.openxmlformats.org/package/2006/content-types",drawing:"http://schemas.openxmlformats.org/drawingml/2006/main"};const u=new Set(["c","row","col","cols","si","r","rPh","sheet","definedName","font","fill","border","numFmt","xf","Relationship","Override","Default","mergeCell","tablePart","tableColumn","sheetView","pane","selection","conditionalFormatting","dataValidation","hyperlink","rgbColor","brk","filterColumn","externalReference","gsd"]),d=new
|
|
2
|
+
import{XMLParser as c}from"fast-xml-parser";const l={"&":"&","<":"<",">":">",'"':"""},p=e=>e<32&&e!==9&&e!==10||e===65534||e===65535||e>=55296&&e<=57343,i=e=>e.toString(16).toUpperCase().padStart(4,"0");export function xstring(e){const t=e.replace(/_(?=x[0-9A-Fa-f]{4}_)/gu,"_x005F_");let r="";for(const n of t){const o=n.codePointAt(0)??0;r+=n.length===1&&p(o)?`_x${i(o)}_`:n}return r.replace(/[&<>"]/gu,n=>l[n]??n)}export const xattr=e=>xstring(e).replace(/[\t\n\r]/gu,t=>`_x${i(t.charCodeAt(0))}_`),readXstring=e=>e.includes("_x")?e.replace(/_x([0-9A-Fa-f]{4})_/gu,(t,r)=>String.fromCharCode(Number.parseInt(r,16))):e;export function el(e,t={},...r){let n="";for(const[f,s]of Object.entries(t))s!==void 0&&(n+=` ${f}="${xattr(typeof s=="boolean"?s?"1":"0":String(s))}"`);const o=r.join("");return o===""?`<${e}${n}/>`:`<${e}${n}>${o}</${e}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
3
|
+
`,NS={main:"http://schemas.openxmlformats.org/spreadsheetml/2006/main",rel:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",pkg:"http://schemas.openxmlformats.org/package/2006/relationships",types:"http://schemas.openxmlformats.org/package/2006/content-types",drawing:"http://schemas.openxmlformats.org/drawingml/2006/main"};const u=new Set(["c","row","col","cols","si","r","rPh","sheet","definedName","font","fill","border","numFmt","xf","Relationship","Override","Default","mergeCell","tablePart","tableColumn","sheetView","pane","selection","conditionalFormatting","dataValidation","hyperlink","rgbColor","brk","filterColumn","externalReference","gsd"]),d=new c({ignoreAttributes:!1,attributeNamePrefix:"",removeNSPrefix:!0,trimValues:!1,parseTagValue:!1,parseAttributeValue:!1,processEntities:!0,htmlEntities:!0,textNodeName:"#text",isArray:(e,t,r,n)=>!n&&u.has(e)});export function readXml(e){return d.parse(e.replace(/\r\n?/gu,`
|
|
4
|
+
`))}const a=e=>typeof e=="object"?e:{};export const tags=e=>Array.isArray(e)?e.map(a):e===void 0?[]:[a(e)],tag=e=>{const t=Array.isArray(e)?e[0]:e;return t===void 0?void 0:a(t)};export function textOf(e){if(typeof e=="string")return e;if(e==null)return"";if(Array.isArray(e))return e.map(textOf).join("");const t=e["#text"];return typeof t=="string"?t:""}export const attr=(e,t)=>{const r=e?.[t];return typeof r=="string"?r:void 0},numberAttr=(e,t)=>{const r=attr(e,t);if(r===void 0||r==="")return;const n=Number(r);return Number.isFinite(n)?n:void 0},flag=(e,t)=>{const r=attr(e,t);return r===void 0?void 0:r==="1"||r==="true"};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@allyhub/sheet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -11,6 +11,10 @@
|
|
|
11
11
|
"types": "./dist/api/index.d.ts",
|
|
12
12
|
"default": "./dist/api/index.js"
|
|
13
13
|
},
|
|
14
|
+
"./sdk": {
|
|
15
|
+
"types": "./dist/sdk.d.ts",
|
|
16
|
+
"default": "./dist/sdk.js"
|
|
17
|
+
},
|
|
14
18
|
"./xlsx": {
|
|
15
19
|
"types": "./dist/xlsx/index.d.ts",
|
|
16
20
|
"default": "./dist/xlsx/index.js"
|
|
@@ -62,27 +62,43 @@ export interface SlideClock {
|
|
|
62
62
|
/** Each step's still, seconds into the slide: step 0 first, the last the slide's. */
|
|
63
63
|
rests: number[];
|
|
64
64
|
}
|
|
65
|
-
/** An animation as slides
|
|
65
|
+
/** An animation as the slides file has it, with its defaults; undefined for a path that does not read. */
|
|
66
66
|
export declare function resolveAnimation(a: AnimationFile): ResolvedAnimation | undefined;
|
|
67
67
|
/**
|
|
68
|
-
* A slide's clock. `
|
|
69
|
-
* a step that brings
|
|
70
|
-
* that after it comes on, and
|
|
68
|
+
* A slide's clock. `moving` is how long each shape that moves by its own
|
|
69
|
+
* code (a component) takes, by name: a step that brings one on rests no
|
|
70
|
+
* sooner than that after it comes on, and one with no entrance moves from
|
|
71
|
+
* the slide's start. `settle` is the window of a slide with nothing
|
|
72
|
+
* animated: it rests at it, or once what moves has.
|
|
71
73
|
* A click's animations start `frame` after the last rest, so a still never
|
|
72
74
|
* shows what the next click brings. `lead` is the transition's: what is
|
|
73
75
|
* on the slide starts when it is over.
|
|
74
76
|
*/
|
|
75
|
-
export declare function slideClock(animations: readonly ResolvedAnimation[], moving:
|
|
76
|
-
/** A slide's window on the stage's clock when nothing on it is animated, seconds
|
|
77
|
+
export declare function slideClock(animations: readonly ResolvedAnimation[], moving: ReadonlyMap<string, number>, settle: number, frame?: number, lead?: number): SlideClock;
|
|
78
|
+
/** A slide's window on the stage's clock when nothing on it is animated, seconds; and how long a component moves unless its `dur` says. */
|
|
77
79
|
export declare const SLIDE_SECONDS = 4;
|
|
80
|
+
/** How long a component moves, seconds from when it comes on: its own `dur`, else SLIDE_SECONDS. */
|
|
81
|
+
export declare const componentSeconds: (c: {
|
|
82
|
+
dur?: number;
|
|
83
|
+
}) => number;
|
|
78
84
|
/** The stage's frame rate for a deck: the grid a slide's still is on. */
|
|
79
85
|
export declare const DECK_FPS = 30;
|
|
86
|
+
/**
|
|
87
|
+
* Whether `t`, seconds into a slide, is still its transition of `lead`
|
|
88
|
+
* seconds. A slide's time is stage time less its start, a sum over the
|
|
89
|
+
* slides before it, which can fall a hair short of the transition's end,
|
|
90
|
+
* where what comes on with the slide starts: within a millionth of a
|
|
91
|
+
* second (far under a frame), the transition is over.
|
|
92
|
+
*/
|
|
93
|
+
export declare const inTransition: (t: number, lead: number) => boolean;
|
|
80
94
|
/** A slide's clock as the stage and the exports go by: on the frame grid, the first slide with no transition. */
|
|
81
95
|
export declare function clockOf(slide: {
|
|
82
96
|
animations: readonly ResolvedAnimation[];
|
|
83
97
|
shapes: readonly {
|
|
84
98
|
name: string;
|
|
85
|
-
component?:
|
|
99
|
+
component?: {
|
|
100
|
+
dur?: number;
|
|
101
|
+
};
|
|
86
102
|
}[];
|
|
87
103
|
transition?: ResolvedTransition;
|
|
88
104
|
}, first: boolean): SlideClock & {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{pathSteps as
|
|
2
|
+
import{pathSteps as w}from"./path.js";import{EMU_PER_PT as u}from"./units.js";export const ANIMATION_DURATIONS={appear:0,fade:.5,wipe:.5,"fly-in":.5,zoom:.5,disappear:0,"fade-out":.5,"wipe-out":.5,"fly-out":.5,"zoom-out":.5,pulse:.5,path:2};const T=new Set(["disappear","fade-out","wipe-out","fly-out","zoom-out"]),E=new Set(["appear","fade","wipe","fly-in","zoom"]);export const isExit=t=>T.has(t),isEntrance=t=>E.has(t),TRANSITION_DURATIONS={fade:.7,push:1,wipe:1,morph:2},resolveTransition=t=>({type:t.type,direction:t.direction??"from-right",duration:t.duration??TRANSITION_DURATIONS[t.type]});const N={"from-left":{x:-1,y:0},"from-right":{x:1,y:0},"from-top":{x:0,y:-1},"from-bottom":{x:0,y:1}};export function transitionAt(t,o){const e={opacity:1,x:0,y:0};if(t.type==="fade")return{incoming:{...e,opacity:o},outgoing:{x:0,y:0}};if(t.type==="push"){const r=N[t.direction];return{incoming:{...e,x:r.x*(1-o),y:r.y*(1-o)},outgoing:{x:-r.x*o,y:-r.y*o}}}return t.type==="wipe"?{incoming:{...e,clip:S(t.direction,1-o)},outgoing:{x:0,y:0}}:{incoming:e,outgoing:{x:0,y:0}}}export function morphFrame(t,o,e){const r=e*e*(3-2*e),i=(p,f)=>p+(f-p)*r;return{left:i(t.left,o.left),top:i(t.top,o.top),width:i(t.width,o.width),height:i(t.height,o.height)}}export function resolveAnimation(t){const o=t.path===void 0?void 0:w(t.path);if(!(t.path!==void 0&&!o)&&!(t.effect==="path"&&!o))return{shape:t.shape,...t.paragraph===void 0?{}:{paragraph:t.paragraph},effect:t.effect,direction:t.direction??"from-bottom",start:t.start??"on-click",duration:t.duration??ANIMATION_DURATIONS[t.effect],delay:t.delay??0,...o?{path:o.map(e=>e.op==="close"?e:e.op!=="curve"?{...e,x:e.x*u,y:e.y*u}:{op:"curve",x1:e.x1*u,y1:e.y1*u,x2:e.x2*u,y2:e.y2*u,x:e.x*u,y:e.y*u})}:{}}}export function slideClock(t,o,e,r=0,i=0){const p=new Set(t.filter(s=>isEntrance(s.effect)).map(s=>s.shape)),f=[...o].filter(([s])=>!p.has(s)).map(([,s])=>s);let n=i+Math.max(0,...f);if(t.length===0)return{timed:[],rests:[Math.max(e,i,...f)]};const c=[],a=[];let h=0,y=i;for(const s of t){s.start==="on-click"?(c.push(n),h++,n+=r,y=n):s.start==="after-previous"&&(y=n);const l=y+s.delay,d=l+s.duration;a.push({...s,step:h,from:l,to:d}),n=Math.max(n,d);const m=o.get(s.shape);m!==void 0&&isEntrance(s.effect)&&(n=Math.max(n,l+m))}return c.push(n),{timed:a,rests:c}}export const SLIDE_SECONDS=4,componentSeconds=t=>t.dur??SLIDE_SECONDS,DECK_FPS=30;const A=t=>Math.ceil(t*DECK_FPS-1e-6)/DECK_FPS;export const inTransition=(t,o)=>t<o-1e-6;export function clockOf(t,o){const e=o?0:t.transition?.duration??0,r=slideClock(t.animations,new Map(t.shapes.flatMap(i=>i.component?[[i.name,componentSeconds(i.component)-1/DECK_FPS]]:[])),SLIDE_SECONDS-1/DECK_FPS,1/DECK_FPS,e);return{timed:r.timed,rests:r.rests.map(A),lead:e,comesOn:i=>r.timed.find(p=>p.shape===i&&isEntrance(p.effect))?.from??e,goesOff:i=>r.timed.find(p=>p.shape===i&&isExit(p.effect))?.to}}const g=1e-6,x={hidden:!1,opacity:1,x:0,y:0,scale:1},I=t=>1-(1-t)*(1-t);function O(t){const o=[];let e={x:0,y:0};for(const r of t){if(r.op==="close")continue;if(r.op!=="curve"){e={x:r.x,y:r.y},o.push(e);continue}const i=e;for(let p=1;p<=24;p++){const f=p/24,n=1-f,c=(a,h,y,s)=>n*n*n*a+3*n*n*f*h+3*n*f*f*y+f*f*f*s;o.push({x:c(i.x,r.x1,r.x2,r.x),y:c(i.y,r.y1,r.y2,r.y)})}e={x:r.x,y:r.y}}return o}export function pathPoint(t,o){const e=O(t),[r]=e;if(!r)return{x:0,y:0};let i=0;for(let f=1;f<e.length;f++){const[n,c]=[e[f-1]??r,e[f]??r];i+=Math.hypot(c.x-n.x,c.y-n.y)}let p=i*o;for(let f=1;f<e.length;f++){const[n,c]=[e[f-1]??r,e[f]??r],a=Math.hypot(c.x-n.x,c.y-n.y);if(p<=a&&a>0){const h=p/a;return{x:n.x+(c.x-n.x)*h,y:n.y+(c.y-n.y)*h}}p-=a}return e.at(-1)??r}function b(t,o,e){return t==="from-left"?{x:-(o.left+o.width),y:0}:t==="from-right"?{x:e.width-o.left,y:0}:t==="from-top"?{x:0,y:-(o.top+o.height)}:{x:0,y:e.height-o.top}}function S(t,o){const e={top:0,right:0,bottom:0,left:0};return t==="from-left"?e.right=o:t==="from-right"?e.left=o:t==="from-top"?e.bottom=o:e.top=o,e}function M(t,o,e,r){if(t.effect==="fade"||t.effect==="fade-out")return{opacity:o};if(t.effect==="zoom"||t.effect==="zoom-out")return{scale:o,opacity:o};if(t.effect==="wipe"||t.effect==="wipe-out")return{clip:S(t.direction,1-o)};if(t.effect==="fly-in"||t.effect==="fly-out"){const i=b(t.direction,e,r);return{x:i.x*(1-o),y:i.y*(1-o)}}return{}}export function drawnAt(t,o,e,r){let i={...x};const[p]=t,f=n=>o<n-g;if(p&&isEntrance(p.effect)&&f(p.from))return{...x,hidden:!0};for(const n of t){if(f(n.from))break;const c=n.to>n.from&&o<n.to-g?Math.min(1,(o-n.from)/(n.to-n.from)):1;if(n.effect==="path"&&n.path){const a=pathPoint(n.path,c);i={...i,x:a.x,y:a.y}}else n.effect==="pulse"?i={...i,scale:1+.05*Math.sin(c*Math.PI)}:isExit(n.effect)?i=c>=1?{...x,hidden:!0}:{...i,...M(n,1-(n.effect==="fly-out"?c*c:c),e,r)}:i={...x,...c<1?M(n,n.effect==="fly-in"?I(c):c,e,r):{}}}return i}export function animationTargets(t){const o=new Map;for(const e of t){const r=JSON.stringify([e.shape,e.paragraph??null]),i=o.get(r);i?i.animations.push(e):o.set(r,{shape:e.shape,...e.paragraph===void 0?{}:{paragraph:e.paragraph},animations:[e]})}return[...o.values()]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Numbering, AnimationEffect, AnimationFile, LineDash, TransitionFile, LineEnd, ShapeGeometry, TextAlign, ThemeColor } from "@allyhub/formats";
|
|
1
|
+
import type { ArrowSize, Numbering, AnimationEffect, AnimationFile, LineDash, TransitionFile, LineEnd, ShapeGeometry, TextAlign, ThemeColor } from "@allyhub/formats";
|
|
2
2
|
import type { Anchor, AutoSize, FillType, PlaceholderType, ShapeType } from "./enums.js";
|
|
3
3
|
import type { Color, ComponentContext, DeckDef, FontDef, Frame, GradientDef, FreeformPath, GeneratedSlideDef, GeneratorContext, LayoutDef, MasterDef, ParagraphDef, TableCellDef, TableDef, ParagraphFormatDef, PropSpec, RunDef, ShapeDef, TextFrameDef } from "./model.js";
|
|
4
4
|
import type { SheetChartType } from "@allyhub/formats";
|
|
@@ -203,9 +203,19 @@ export declare class FillFormat {
|
|
|
203
203
|
/** A gradient's degrees, clockwise from left to right. python-pptx's run the other way. */
|
|
204
204
|
get gradient_angle(): number;
|
|
205
205
|
set gradient_angle(v: number);
|
|
206
|
-
/**
|
|
207
|
-
|
|
208
|
-
|
|
206
|
+
/**
|
|
207
|
+
* A gradient's stops. Read, each is python-pptx's: its `color` a
|
|
208
|
+
* ColorFormat, its `position` a share. Set, a list of
|
|
209
|
+
* `{ at, color, transparency }`, `at` and `transparency` shares and a
|
|
210
|
+
* colour as the slides file writes one (`accent1`, `accent1 lighter 40%`,
|
|
211
|
+
* `#RRGGBB`) or a Color.
|
|
212
|
+
*/
|
|
213
|
+
get gradient_stops(): GradientStop[];
|
|
214
|
+
set gradient_stops(v: readonly (GradientStop | {
|
|
215
|
+
at: number;
|
|
216
|
+
color: Exclude<Color, string> | string;
|
|
217
|
+
transparency?: number;
|
|
218
|
+
})[]);
|
|
209
219
|
private _gradient;
|
|
210
220
|
/** How much of the fill shows through, a share (PowerPoint's Transparency). */
|
|
211
221
|
get transparency(): number;
|
|
@@ -215,6 +225,21 @@ export declare class FillFormat {
|
|
|
215
225
|
/** A solid fill's colour; python-pptx refuses it for another fill: call solid() first. */
|
|
216
226
|
get fore_color(): ColorFormat;
|
|
217
227
|
}
|
|
228
|
+
/** python-pptx's `_GradientStop`: one of a gradient's stops. */
|
|
229
|
+
export declare class GradientStop {
|
|
230
|
+
private readonly stop;
|
|
231
|
+
constructor(stop: GradientDef["stops"][number]);
|
|
232
|
+
/** A stop as the model holds it, a copy: what setting gradient_stops to stops read back keeps. */
|
|
233
|
+
static defOf(s: GradientStop): GradientDef["stops"][number];
|
|
234
|
+
/** Its colour. */
|
|
235
|
+
get color(): ColorFormat;
|
|
236
|
+
/** Where it stands along the gradient, a share from 0 to 1. */
|
|
237
|
+
get position(): number;
|
|
238
|
+
set position(v: number);
|
|
239
|
+
/** How much of its colour shows through, a share; python-pptx has none. */
|
|
240
|
+
get transparency(): number;
|
|
241
|
+
set transparency(v: number);
|
|
242
|
+
}
|
|
218
243
|
/**
|
|
219
244
|
* python-pptx's `ShadowFormat`: a shape's shadow. Its `inherit` is there; what
|
|
220
245
|
* a shadow is made of, python-pptx has no API for.
|
|
@@ -223,7 +248,7 @@ export declare class ShadowFormat {
|
|
|
223
248
|
private readonly def;
|
|
224
249
|
constructor(def: ShapeDef);
|
|
225
250
|
private _shadow;
|
|
226
|
-
/** Whether it
|
|
251
|
+
/** Whether it takes its style's effects; false gives it none of its own (no shadow), as python-pptx's empty effect list does. */
|
|
227
252
|
get inherit(): boolean;
|
|
228
253
|
set inherit(v: boolean);
|
|
229
254
|
get blur_radius(): LengthValue;
|
|
@@ -254,6 +279,18 @@ export declare class LineFormat {
|
|
|
254
279
|
/** What the end of the line where it ends has (MSO_ARROWHEAD). */
|
|
255
280
|
get end_arrow(): LineEnd;
|
|
256
281
|
set end_arrow(v: LineEnd);
|
|
282
|
+
/** How wide the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE). */
|
|
283
|
+
get begin_arrow_width(): ArrowSize;
|
|
284
|
+
set begin_arrow_width(v: ArrowSize);
|
|
285
|
+
/** How long the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE). */
|
|
286
|
+
get begin_arrow_length(): ArrowSize;
|
|
287
|
+
set begin_arrow_length(v: ArrowSize);
|
|
288
|
+
/** How wide the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE). */
|
|
289
|
+
get end_arrow_width(): ArrowSize;
|
|
290
|
+
set end_arrow_width(v: ArrowSize);
|
|
291
|
+
/** How long the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE). */
|
|
292
|
+
get end_arrow_length(): ArrowSize;
|
|
293
|
+
set end_arrow_length(v: ArrowSize);
|
|
257
294
|
}
|
|
258
295
|
/** python-pptx's `_Background` of a slide, a layout or a master. */
|
|
259
296
|
export declare class Background {
|
|
@@ -310,6 +347,13 @@ export declare class Shape {
|
|
|
310
347
|
/** Degrees clockwise about its centre; python-pptx's, kept from 0 up to 360. */
|
|
311
348
|
get rotation(): number;
|
|
312
349
|
set rotation(v: number);
|
|
350
|
+
/** Whether it is mirrored left to right (`a:xfrm` flipH), as the slides file's flip_h; its text reads as it is. python-pptx has no such property. */
|
|
351
|
+
get flip_h(): boolean;
|
|
352
|
+
set flip_h(v: boolean);
|
|
353
|
+
/** Whether it is mirrored top to bottom (`a:xfrm` flipV), as the slides file's flip_v. */
|
|
354
|
+
get flip_v(): boolean;
|
|
355
|
+
set flip_v(v: boolean);
|
|
356
|
+
private _flip;
|
|
313
357
|
get has_text_frame(): boolean;
|
|
314
358
|
get text_frame(): TextFrame;
|
|
315
359
|
/** Its text frame's text (python-pptx's `shape.text`). */
|
|
@@ -320,6 +364,28 @@ export declare class Shape {
|
|
|
320
364
|
get shadow(): ShadowFormat;
|
|
321
365
|
/** Its geometry's adjustments: `adjustments[0] = 0.1` sets a rounded rectangle's corner. */
|
|
322
366
|
get adjustments(): Adjustments;
|
|
367
|
+
/** A connector's ends (python-pptx's Connector): refuses another shape. */
|
|
368
|
+
private _ends;
|
|
369
|
+
/** A connector's ends moved to these points, its frame and flips made again. */
|
|
370
|
+
private _move;
|
|
371
|
+
get begin_x(): LengthValue;
|
|
372
|
+
set begin_x(v: Length);
|
|
373
|
+
get begin_y(): LengthValue;
|
|
374
|
+
set begin_y(v: Length);
|
|
375
|
+
get end_x(): LengthValue;
|
|
376
|
+
set end_x(v: Length);
|
|
377
|
+
get end_y(): LengthValue;
|
|
378
|
+
set end_y(v: Length);
|
|
379
|
+
/**
|
|
380
|
+
* A connector's begin glued to connection site `cxn_pt_idx` of `shape`
|
|
381
|
+
* (a shape of the same slide, layout or master), and moved there: it
|
|
382
|
+
* follows the shape where it moves. The sites are its geometry's, as
|
|
383
|
+
* PowerPoint's (a rectangle's 0 top, 1 left, 2 bottom, 3 right).
|
|
384
|
+
*/
|
|
385
|
+
begin_connect(shape: Shape, cxn_pt_idx: number): void;
|
|
386
|
+
/** A connector's end glued to a site of `shape`, as begin_connect glues its begin. */
|
|
387
|
+
end_connect(shape: Shape, cxn_pt_idx: number): void;
|
|
388
|
+
private _connect;
|
|
323
389
|
}
|
|
324
390
|
/**
|
|
325
391
|
* python-pptx's `FreeformBuilder`: an outline drawn in local units from a
|
|
@@ -379,9 +445,15 @@ export declare class Cell {
|
|
|
379
445
|
get text(): string;
|
|
380
446
|
set text(v: string);
|
|
381
447
|
get fill(): FillFormat;
|
|
382
|
-
/**
|
|
448
|
+
/**
|
|
449
|
+
* Its edges, each a colour (as the slides file writes one, or a Color)
|
|
450
|
+
* and a width, a Length (`Pt(1)`); python-pptx has none (`a:lnL`…).
|
|
451
|
+
*/
|
|
383
452
|
get borders(): NonNullable<TableCellDef["borders"]>;
|
|
384
|
-
set borders(v:
|
|
453
|
+
set borders(v: Partial<Record<"left" | "right" | "top" | "bottom", {
|
|
454
|
+
color: Exclude<Color, string> | string;
|
|
455
|
+
width: Length;
|
|
456
|
+
}>>);
|
|
385
457
|
get margin_left(): LengthValue;
|
|
386
458
|
set margin_left(v: Length);
|
|
387
459
|
get margin_right(): LengthValue;
|
|
@@ -491,7 +563,11 @@ export declare class ShapeCollection implements Iterable<Shape> {
|
|
|
491
563
|
*/
|
|
492
564
|
add_connector(connector_type: ShapeGeometry, begin_x: Length, begin_y: Length, end_x: Length, end_y: Length): Shape;
|
|
493
565
|
/** A component of the presentation (`prs.components.add`), drawn by its code in the frame (an extension). */
|
|
494
|
-
add_component(component: string, left: Length, top: Length, width: Length, height: Length, props?: Record<string, unknown
|
|
566
|
+
add_component(component: string, left: Length, top: Length, width: Length, height: Length, props?: Record<string, unknown>,
|
|
567
|
+
/** How long it moves, seconds from when it comes on (SLIDE_SECONDS when absent). */
|
|
568
|
+
options?: {
|
|
569
|
+
dur?: number;
|
|
570
|
+
}): Shape;
|
|
495
571
|
}
|
|
496
572
|
/** The name a placeholder of a type has when it is given none. */
|
|
497
573
|
export declare const NAME_OF_TYPE: Record<PlaceholderType, string>;
|
|
@@ -677,7 +753,7 @@ export declare class Presentation {
|
|
|
677
753
|
get slide_master(): SlideMaster;
|
|
678
754
|
/** The first master's layouts (python-pptx's); `get_by_name` finds one of any master with prs.slide_masters. */
|
|
679
755
|
get slide_layouts(): SlideLayouts;
|
|
680
|
-
/** python-pptx's slides are slides
|
|
756
|
+
/** python-pptx's slides are the slides file's here. */
|
|
681
757
|
get slides(): never;
|
|
682
758
|
save(): never;
|
|
683
759
|
/** The theme over the project's look (an extension: python-pptx reads it from a template). */
|
|
@@ -688,7 +764,7 @@ export declare class Presentation {
|
|
|
688
764
|
add: (name: string, c: ComponentInput) => void;
|
|
689
765
|
};
|
|
690
766
|
/**
|
|
691
|
-
* Generators: slides made from data, which slides
|
|
767
|
+
* Generators: slides made from data, which the slides file places as one
|
|
692
768
|
* block (`- id: stories, generate: name`) (an extension).
|
|
693
769
|
*/
|
|
694
770
|
get generators(): {
|
|
@@ -700,6 +776,20 @@ export declare class Presentation {
|
|
|
700
776
|
/** Marks a deck made by presentation(). */
|
|
701
777
|
export declare const DECK_BRAND = "__allyhubDeck";
|
|
702
778
|
export interface PresentationOptions {
|
|
779
|
+
/**
|
|
780
|
+
* Its slides' file (YAML), from this module's folder: the slides in
|
|
781
|
+
* order, each on a layout, and what was placed or changed on each, which
|
|
782
|
+
* the editor writes. Paths in it are from this module's folder too. A
|
|
783
|
+
* deck the project lists names it (AK-M011).
|
|
784
|
+
*/
|
|
785
|
+
slides?: string;
|
|
786
|
+
/**
|
|
787
|
+
* Its script, a file per language, from this module's folder: `{locale}`
|
|
788
|
+
* in its name stands for each (`./q3.{locale}.yaml`): each slide's words
|
|
789
|
+
* by shape name, and its speaker notes. A deck the project lists names
|
|
790
|
+
* it (AK-M011).
|
|
791
|
+
*/
|
|
792
|
+
script?: string;
|
|
703
793
|
/** Its name for people: what lists show it by. */
|
|
704
794
|
title?: string;
|
|
705
795
|
/** The slide size: a name (`16:9`, `4:3`, `a4`…) or `{ width, height }` in EMU; default 16:9. */
|
|
@@ -710,7 +800,7 @@ export interface PresentationOptions {
|
|
|
710
800
|
/** The theme, over the project's look. */
|
|
711
801
|
theme?: ThemeInput;
|
|
712
802
|
}
|
|
713
|
-
/** A deck: the default export of
|
|
803
|
+
/** A deck: the default export of a deck's module. */
|
|
714
804
|
export interface Deck {
|
|
715
805
|
readonly [DECK_BRAND]: true;
|
|
716
806
|
readonly kind: "slides";
|