allyhub 0.15.3 → 0.17.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 +17 -0
- package/dist/commands/add.js +1 -1
- package/dist/commands/cloud-tools.js +1 -1
- package/dist/commands/dev.js +5 -5
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/frames/doc.js +1 -1
- package/dist/commands/inspect/common.js +3 -3
- package/dist/commands/inspect/facts.js +2 -2
- package/dist/commands/inspect/index.js +1 -1
- package/dist/commands/inspect/layout.js +1 -1
- package/dist/commands/inspect/uses.js +3 -0
- package/dist/commands/mail.js +6 -6
- package/dist/commands/render.js +1 -1
- package/dist/main.js +8 -8
- package/dist/node_modules/@allyhub/3d-extension/dist/cli/scenery-text.js +2 -2
- package/dist/node_modules/@allyhub/3d-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/audio/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/audio/dist/place.js +2 -0
- package/dist/node_modules/@allyhub/audio/package.json +1 -1
- package/dist/node_modules/@allyhub/browser/package.json +1 -1
- package/dist/node_modules/@allyhub/build/dist/content.d.ts +7 -0
- package/dist/node_modules/@allyhub/build/dist/file-check.d.ts +2 -2
- package/dist/node_modules/@allyhub/build/dist/imports.d.ts +17 -0
- package/dist/node_modules/@allyhub/build/dist/imports.js +2 -0
- package/dist/node_modules/@allyhub/build/dist/index.d.ts +3 -2
- package/dist/node_modules/@allyhub/build/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.d.ts +1 -1
- package/dist/node_modules/@allyhub/build/dist/inspect-view.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/kind-build.d.ts +19 -3
- package/dist/node_modules/@allyhub/build/dist/prepare.js +3 -3
- package/dist/node_modules/@allyhub/build/dist/uses.d.ts +27 -6
- package/dist/node_modules/@allyhub/build/dist/uses.js +1 -1
- package/dist/node_modules/@allyhub/build/dist/work.d.ts +9 -1
- package/dist/node_modules/@allyhub/build/dist/work.js +3 -3
- package/dist/node_modules/@allyhub/build/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/canvas-extension/skills/allyhub/references/canvas.md +2 -2
- package/dist/node_modules/@allyhub/canvas-model/package.json +1 -1
- package/dist/node_modules/@allyhub/chart/package.json +1 -1
- package/dist/node_modules/@allyhub/check/package.json +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/client.d.ts +12 -3
- package/dist/node_modules/@allyhub/cloud/dist/client.js +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.d.ts +1 -1
- package/dist/node_modules/@allyhub/cloud/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/cloud/package.json +1 -1
- package/dist/node_modules/@allyhub/components/package.json +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/deletion.js +2 -0
- package/dist/node_modules/@allyhub/dev-server/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/inputs.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/live.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/project.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/record.js +1 -1
- package/dist/node_modules/@allyhub/dev-server/dist/writer.js +3 -2
- package/dist/node_modules/@allyhub/dev-server/package.json +1 -1
- package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
- package/dist/node_modules/@allyhub/doc/dist/docx.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/html.js +40 -40
- package/dist/node_modules/@allyhub/doc/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/markdown.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/parse.js +4 -4
- package/dist/node_modules/@allyhub/doc/dist/table.js +1 -1
- package/dist/node_modules/@allyhub/doc/dist/write.js +26 -26
- package/dist/node_modules/@allyhub/doc/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-extension/dist/build.js +2 -2
- package/dist/node_modules/@allyhub/doc-extension/dist/inspect.js +1 -1
- package/dist/node_modules/@allyhub/doc-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/doc-print/package.json +1 -1
- package/dist/node_modules/@allyhub/export/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/export/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-api/package.json +1 -1
- package/dist/node_modules/@allyhub/extension-host/dist/points.js +1 -1
- package/dist/node_modules/@allyhub/extension-host/package.json +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +15 -3
- package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/items.d.ts +70 -11
- package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +15 -4
- package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
- package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +4 -0
- package/dist/node_modules/@allyhub/formats/package.json +1 -1
- package/dist/node_modules/@allyhub/i18n/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/i18n/package.json +1 -1
- package/dist/node_modules/@allyhub/image-draw/dist/stage.js +1 -1
- package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/dist/workspace.js +1 -1
- package/dist/node_modules/@allyhub/image-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/image-extension/skills/allyhub/references/images.md +3 -3
- package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/image-psd/package.json +1 -1
- package/dist/node_modules/@allyhub/image-render/package.json +1 -1
- package/dist/node_modules/@allyhub/image-runtime/dist/load.js +2 -2
- package/dist/node_modules/@allyhub/image-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/jobs/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/linkedin-extension/skills/allyhub/references/linkedin.md +1 -1
- package/dist/node_modules/@allyhub/linkedin-model/package.json +1 -1
- package/dist/node_modules/@allyhub/linkedin-view/package.json +1 -1
- package/dist/node_modules/@allyhub/measure/package.json +1 -1
- package/dist/node_modules/@allyhub/media/package.json +1 -1
- package/dist/node_modules/@allyhub/media-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/model/package.json +1 -1
- package/dist/node_modules/@allyhub/office-extension/LICENSE +241 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/data/leads.csv +5 -0
- package/dist/node_modules/@allyhub/office-extension/markup/csv/markup.json +19 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/briefs/launch.docx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/document/markup.json +11 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/decks/pitch.pptx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/presentation/markup.json +11 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/data/plans.xlsx +0 -0
- package/dist/node_modules/@allyhub/office-extension/markup/workbook/markup.json +10 -0
- package/dist/node_modules/@allyhub/office-extension/package.json +124 -0
- package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
- package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +15 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -0
- package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.d.ts +9 -0
- package/dist/node_modules/@allyhub/piece/dist/page/runtimes.js +2 -0
- package/dist/node_modules/@allyhub/piece/dist/source.d.ts +53 -10
- package/dist/node_modules/@allyhub/piece/dist/source.js +1 -1
- package/dist/node_modules/@allyhub/piece/package.json +1 -1
- package/dist/node_modules/@allyhub/project/dist/digest.js +1 -1
- package/dist/node_modules/@allyhub/project/dist/part-keys.js +1 -1
- package/dist/node_modules/@allyhub/project/package.json +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +10 -11
- package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +7 -0
- package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/blobs.d.ts +9 -0
- package/dist/node_modules/@allyhub/protocol/dist/blobs.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.d.ts +77 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud-computer.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +39 -9
- package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +15 -15
- package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +441 -5
- package/dist/node_modules/@allyhub/protocol/dist/events.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -2
- package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +4 -1
- package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +8 -0
- package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +5 -5
- package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +45 -0
- package/dist/node_modules/@allyhub/protocol/dist/kinds.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/paywall.d.ts +134 -0
- package/dist/node_modules/@allyhub/protocol/dist/paywall.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/place.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +3 -3
- package/dist/node_modules/@allyhub/protocol/dist/purposes.d.ts +47 -0
- package/dist/node_modules/@allyhub/protocol/dist/purposes.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +52 -5
- package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.d.ts +34 -0
- package/dist/node_modules/@allyhub/protocol/dist/sidebar-deletion.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/sites.d.ts +1 -0
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +21 -52
- package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.d.ts +264 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-server.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.d.ts +18 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-tool-calls.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.d.ts +97 -0
- package/dist/node_modules/@allyhub/protocol/dist/studio-window-requests.js +2 -0
- package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +3 -2
- package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +26 -20
- package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
- package/dist/node_modules/@allyhub/protocol/dist/turns.d.ts +71 -0
- package/dist/node_modules/@allyhub/protocol/dist/turns.js +2 -0
- package/dist/node_modules/@allyhub/protocol/package.json +1 -1
- package/dist/node_modules/@allyhub/registry/package.json +1 -1
- package/dist/node_modules/@allyhub/render/package.json +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/compose.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/embed.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/film.js +1 -1
- package/dist/node_modules/@allyhub/runtime/dist/piece.js +2 -2
- package/dist/node_modules/@allyhub/runtime/dist/player/player.js +1 -1
- package/dist/node_modules/@allyhub/runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
- package/dist/node_modules/@allyhub/scaffold/dist/index.js +4 -4
- package/dist/node_modules/@allyhub/scaffold/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery/package.json +1 -1
- package/dist/node_modules/@allyhub/scenery-host/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
- 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/dynamic.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/logical.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/text.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
- package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
- package/dist/node_modules/@allyhub/sheet/package.json +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/dist/cli/sheet.js +1 -1
- package/dist/node_modules/@allyhub/sheet-extension/package.json +3 -3
- package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/api.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/components.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
- package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/build.js +2 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/cli/slides.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/deck-pptx.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/dist/evaluate.js +2 -2
- package/dist/node_modules/@allyhub/slides-extension/dist/export.js +1 -1
- package/dist/node_modules/@allyhub/slides-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/dist/audio-icon.js +1 -1
- package/dist/node_modules/@allyhub/slides-pptx/dist/write.js +2 -2
- package/dist/node_modules/@allyhub/slides-pptx/package.json +5 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/component.js +1 -1
- package/dist/node_modules/@allyhub/slides-runtime/dist/draw.js +2 -2
- package/dist/node_modules/@allyhub/slides-runtime/dist/item.js +2 -0
- package/dist/node_modules/@allyhub/slides-runtime/dist/load.js +5 -5
- package/dist/node_modules/@allyhub/slides-runtime/dist/slide-css.js +20 -0
- package/dist/node_modules/@allyhub/slides-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/stage/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/install.js +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.html +1 -1
- package/dist/node_modules/@allyhub/stage-page/dist/runtime/stage.js +2 -2
- package/dist/node_modules/@allyhub/stage-page/package.json +1 -1
- package/dist/node_modules/@allyhub/stage-runtime/dist/runtime.js +20 -20
- package/dist/node_modules/@allyhub/stage-runtime/package.json +1 -1
- package/dist/node_modules/@allyhub/telemetry/dist/doc.js +17 -2
- package/dist/node_modules/@allyhub/telemetry/dist/level.js +2 -2
- package/dist/node_modules/@allyhub/telemetry/dist/levels.js +2 -0
- package/dist/node_modules/@allyhub/telemetry/dist/scrub.js +1 -1
- package/dist/node_modules/@allyhub/telemetry/package.json +5 -1
- package/dist/node_modules/@allyhub/text-extension/markup/markup.json +1 -1
- package/dist/node_modules/@allyhub/text-extension/markup-file/allyhub.yaml +2 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/archive/assets.zip +0 -0
- package/dist/node_modules/@allyhub/text-extension/markup-file/markup.json +10 -0
- package/dist/node_modules/@allyhub/text-extension/package.json +35 -1
- package/dist/node_modules/@allyhub/video-core/package.json +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/build.js +1 -1
- package/dist/node_modules/@allyhub/video-extension/dist/cli/reference-text.js +3 -3
- package/dist/node_modules/@allyhub/video-extension/package.json +2 -2
- package/dist/node_modules/@allyhub/video-measure/package.json +1 -1
- package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
- package/dist/node_modules/@allyhub/website/package.json +1 -1
- package/dist/node_modules/@allyhub/website-extension/package.json +1 -1
- package/dist/node_modules/@allyhub/x-extension/package.json +3 -1
- package/dist/node_modules/@allyhub/x-extension/skills/allyhub/references/x.md +1 -1
- package/dist/node_modules/@allyhub/x-model/package.json +1 -1
- package/dist/node_modules/@allyhub/x-view/package.json +1 -1
- package/dist/package.json +13 -12
- package/dist/project.js +1 -1
- package/dist/telemetry.js +3 -3
- package/dist/text/console-text.js +2 -2
- package/dist/works.js +1 -1
- package/editor-web/assets/{abnfDiagram-WEYOIA3C-arPHIJYC.js → abnfDiagram-WEYOIA3C-CHNpVSPv.js} +1 -1
- package/editor-web/assets/{architecture-WOLXFQ4H-XPJlj9Iq.js → architecture-WOLXFQ4H-gPsJqQwV.js} +1 -1
- package/editor-web/assets/{architectureDiagram-ZHVYKT53-BZNJvOtd.js → architectureDiagram-ZHVYKT53-CEIDcC6r.js} +1 -1
- package/editor-web/assets/arrow-down-B8VUPCGi.js +1 -0
- package/editor-web/assets/arrow-up-Ds4juY8X.js +1 -0
- package/editor-web/assets/article-BHTjq0_Y.js +3 -0
- package/editor-web/assets/{article-Ck2ii-gZ.js → article-DfELjJ2o.js} +2 -2
- package/editor-web/assets/{audio-lines-1s1eRs4Q.js → audio-lines-PZj77e7t.js} +1 -1
- package/editor-web/assets/{bar-button-6Perrucg.js → bar-button-J9vbfzTx.js} +1 -1
- package/editor-web/assets/{blockDiagram-RJAE7QA3-B4L2P9Zz.js → blockDiagram-RJAE7QA3-CUzEGVet.js} +4 -4
- package/editor-web/assets/browser-C1XuTMlp.js +1 -0
- package/editor-web/assets/{c4Diagram-XDPPPE54-D5t2-Sm8.js → c4Diagram-XDPPPE54-CB94NR9s.js} +1 -1
- package/editor-web/assets/calc-worker-BdHh5LXM.js +45 -0
- package/editor-web/assets/channel-DCDCx5Es.js +1 -0
- package/editor-web/assets/chart-amT4lgX3.js +2 -0
- package/editor-web/assets/chart-file-CfbWK9l1.js +1 -0
- package/editor-web/assets/{chart-no-axes-column-CJmeYOSo.js → chart-no-axes-column-Be0lFcGF.js} +1 -1
- package/editor-web/assets/{chunk-2E7WHVMD-bWUHKM6h.js → chunk-2E7WHVMD-DFYo_Boi.js} +1 -1
- package/editor-web/assets/{chunk-4EMNKR2T-CGGaxE7r.js → chunk-4EMNKR2T-CLLjmweX.js} +1 -1
- package/editor-web/assets/{chunk-55XCU76K-BXCHI3wC.js → chunk-55XCU76K-CkwQ_3m1.js} +1 -1
- package/editor-web/assets/{chunk-7S6XSTFO-H4tWSKhS.js → chunk-7S6XSTFO-V-AvHpAB.js} +1 -1
- package/editor-web/assets/{chunk-AQDTSKZB-kyBZy8vG.js → chunk-AQDTSKZB-PjHyYpb8.js} +1 -1
- package/editor-web/assets/chunk-DSNLSHJZ-QaczBS3J.js +127 -0
- package/editor-web/assets/{chunk-HAGFOTED-P8dIUq9O.js → chunk-HAGFOTED-aLaQB5Xu.js} +1 -1
- package/editor-web/assets/{chunk-HNE4Q36P-B_BAZXMj.js → chunk-HNE4Q36P-De3ftDQR.js} +1 -1
- package/editor-web/assets/{chunk-NQOKRVIF-Bubl63jI.js → chunk-NQOKRVIF-CrhVQyvP.js} +17 -17
- package/editor-web/assets/{chunk-UHW7PFBP-DYGk0ZDz.js → chunk-UHW7PFBP-BFmZ5ZLn.js} +1 -1
- package/editor-web/assets/{chunk-VQ5W62QI-BLFRyEGi.js → chunk-VQ5W62QI-CzppUHLA.js} +1 -1
- package/editor-web/assets/{chunk-WQQL4CDK-kiwalF_c.js → chunk-WQQL4CDK-BrAU7V6v.js} +1 -1
- package/editor-web/assets/{chunk-YZO67HFG-D-bT0L2N.js → chunk-YZO67HFG-BSiF71qj.js} +1 -1
- package/editor-web/assets/{chunk-ZAUX2LTX-C_P5nPKV.js → chunk-ZAUX2LTX-BJc4r5b1.js} +1 -1
- package/editor-web/assets/{chunk-ZCHMQSOR-Deizt1PO.js → chunk-ZCHMQSOR-CkGTuehB.js} +1 -1
- package/editor-web/assets/{classDiagram-v2-4MYWR3UA-PUtBnliw.js → classDiagram-v2-4MYWR3UA-Byxc7J88.js} +7 -7
- package/editor-web/assets/code-CD-CbJG9.js +1 -0
- package/editor-web/assets/{collaborator--S95EupA.js → collaborator-BU4qU7O3.js} +1 -1
- package/editor-web/assets/{copy-DvOiv9Ra.js → copy-CuJSs0nI.js} +1 -1
- package/editor-web/assets/{createLucideIcon-REX213UO.js → createLucideIcon-lm_6n8YT.js} +1 -1
- package/editor-web/assets/csv-Bwre9FdI.js +11 -0
- package/editor-web/assets/{cynefin-EF2NZ3EQ-C09G_QFD.js → cynefin-EF2NZ3EQ-BSxkVbdf.js} +1 -1
- package/editor-web/assets/{cynefinDiagram-WF24UDRP-JxxJ5-Ov.js → cynefinDiagram-WF24UDRP-IkCgARNs.js} +1 -1
- package/editor-web/assets/{dagre-NK4GIZVX-6DkhWeGP.js → dagre-NK4GIZVX-9PgeH6nY.js} +1 -1
- package/editor-web/assets/deck-tTzKONci.js +1 -0
- package/editor-web/assets/{diagram-CBK3MWTC-kI_Q07du.js → diagram-CBK3MWTC-DRzeg3Ds.js} +1 -1
- package/editor-web/assets/{diagram-I5XIIV2D-FYaR41qP.js → diagram-I5XIIV2D-B_zeKMN6.js} +1 -1
- package/editor-web/assets/{diagram-ODIL2UCW-29WBGOdl.js → diagram-ODIL2UCW-FFm0O8SN.js} +1 -1
- package/editor-web/assets/{diagram-PFBEJUXE-BFZJ9s9P.js → diagram-PFBEJUXE-DrtCT8OA.js} +1 -1
- package/editor-web/assets/{diagram-RJA3I4VV-BSNFe4e-.js → diagram-RJA3I4VV-DtxJ3V0q.js} +1 -1
- package/editor-web/assets/{diagram-TYUNFSNR-Cb1wZgqj.js → diagram-TYUNFSNR-DmxF_8H_.js} +16 -16
- package/editor-web/assets/dist-BEpzsYn_.js +6 -0
- package/editor-web/assets/dist-BUD4ywMB.js +18 -0
- package/editor-web/assets/{dist-BrGYx10E.js → dist-Bd8IxQPP.js} +1 -1
- package/editor-web/assets/dist-C21CkR7Z.js +531 -0
- package/editor-web/assets/{dist-BuG-vxxb.js → dist-C56mWAec.js} +3 -3
- package/editor-web/assets/dist-CAb3W9_P.js +43 -0
- package/editor-web/assets/dist-CEknsRDd.js +24 -0
- package/editor-web/assets/dist-CbZAznNW.js +19 -0
- package/editor-web/assets/{dist-BaCVkpwc.js → dist-D3C6FyrO.js} +1 -1
- package/editor-web/assets/dist-DDzjbKIg.js +4 -0
- package/editor-web/assets/dist-DaEbElXI.js +3 -0
- package/editor-web/assets/{dist-CnbKC_fW.js → dist-Dr3o4vee.js} +1 -1
- package/editor-web/assets/{dist-BlqK1Oua.js → dist-DruvDNQe.js} +1 -1
- package/editor-web/assets/dist-JLyDtl9X.js +1 -0
- package/editor-web/assets/dist-PBbWAsrV.js +17 -0
- package/editor-web/assets/dist-ZZlQa66J.js +1 -0
- package/editor-web/assets/{dist-DXUMNYNX.js → dist-bQKpw3Zz.js} +5 -5
- package/editor-web/assets/dist-d4dayaWE.js +17 -0
- package/editor-web/assets/docx-draw-9Q_fArBC.js +4 -0
- package/editor-web/assets/docx-preview-pcg9ioe3.js +21 -0
- package/editor-web/assets/{ebnfDiagram-V4P3TTPT-t3vO5qHB.js → ebnfDiagram-V4P3TTPT-DSX1Aoty.js} +1 -1
- package/editor-web/assets/{elk-QONTBCTQ-DfIcGBDb.js → elk-QONTBCTQ-C7gy9q56.js} +1 -1
- package/editor-web/assets/{erDiagram-KYQIGQAA-Bgy1PYQf.js → erDiagram-KYQIGQAA-CKx_HoY4.js} +2 -2
- package/editor-web/assets/esm-BZb5QMQf.js +21 -0
- package/editor-web/assets/{eventmodeling-K75KTNOO-b8j935GM.js → eventmodeling-K75KTNOO-DL4HvSrd.js} +1 -1
- package/editor-web/assets/{file-exclamation-point-C_fX4fpI.js → file-exclamation-point-_L3ElCJ5.js} +1 -1
- package/editor-web/assets/file-question-mark-DlIjUK37.js +1 -0
- package/editor-web/assets/flowDiagram-IUGLLWBU-BUnRtJ8q.js +1 -0
- package/editor-web/assets/{ganttDiagram-R7GPNTJY-B6C_nkwn.js → ganttDiagram-R7GPNTJY-N-AP4slN.js} +1 -1
- package/editor-web/assets/{gitGraph-VSP46ZUC-CWtulOri.js → gitGraph-VSP46ZUC-BKRGJKWm.js} +1 -1
- package/editor-web/assets/{gitGraphDiagram-PDYL7XHY-BT80Z9gj.js → gitGraphDiagram-PDYL7XHY-ClwL7w2_.js} +1 -1
- package/editor-web/assets/{group-pebHQTdP.js → group-BdrTp7gi.js} +1 -1
- package/editor-web/assets/{hint-CKIaljPY.js → hint-rlht0uxG.js} +1 -1
- package/editor-web/assets/index-BedbINE5.css +2 -0
- package/editor-web/assets/index-DG2nHq4D.js +28 -0
- package/editor-web/assets/{info-OHQRW6UA-CyWiLOaB.js → info-OHQRW6UA-DpcY8t23.js} +1 -1
- package/editor-web/assets/{infoDiagram-MVDRKAX5-3TQgBeRh.js → infoDiagram-MVDRKAX5-ChtmtWni.js} +1 -1
- package/editor-web/assets/{ishikawaDiagram-HPEHV2GE-C3RAGFl7.js → ishikawaDiagram-HPEHV2GE-BZNTuG_F.js} +1 -1
- package/editor-web/assets/iso-ahTwmFwH.js +56 -0
- package/editor-web/assets/{italic-CtlNOXN9.js → italic-zw4_eUNF.js} +1 -1
- package/editor-web/assets/{journeyDiagram-BOSHW7O7-B3ZJp3pT.js → journeyDiagram-BOSHW7O7-C3uVmZbL.js} +1 -1
- package/editor-web/assets/{kanban-definition-FNSA4HC5-ChjUoDH7.js → kanban-definition-FNSA4HC5-puEhftGG.js} +4 -4
- package/editor-web/assets/{link-CW2KxKT_.js → link-DopSU3aa.js} +1 -1
- package/editor-web/assets/{mermaid-parser.core-CqJ7hTUI.js → mermaid-parser.core-Bw8re-WE.js} +3 -3
- package/editor-web/assets/mermaid.core-Cc2GIqBr.js +44 -0
- package/editor-web/assets/{mindmap-definition-6OY57UG3-Di0DNds3.js → mindmap-definition-6OY57UG3-C6MUl_S_.js} +3 -3
- package/editor-web/assets/minus-CbPnUIOy.js +1 -0
- package/editor-web/assets/{packet-JDAUHWVQ-CkCyk5LQ.js → packet-JDAUHWVQ-C75RnvC5.js} +1 -1
- package/editor-web/assets/{pegDiagram-ECIUJNBX-DGyUszOM.js → pegDiagram-ECIUJNBX-ChjmsdV4.js} +1 -1
- package/editor-web/assets/{pie-XZMESJXO-D56l6NOA.js → pie-XZMESJXO-BaKxJQpj.js} +1 -1
- package/editor-web/assets/{pieDiagram-GNMPY74T-C6Gy4c9c.js → pieDiagram-GNMPY74T-CT2ez8pr.js} +1 -1
- package/editor-web/assets/{progress-I2qmIfF4.js → progress-CwKcXARv.js} +1 -1
- package/editor-web/assets/props-form-D5oKHfpk.js +1 -0
- package/editor-web/assets/purify.es-B9ve_eFf.js +3 -0
- package/editor-web/assets/{quadrantDiagram-D57K4MC3-CWfkAwXQ.js → quadrantDiagram-D57K4MC3-BJItlTfk.js} +1 -1
- package/editor-web/assets/{radar-ABXABTNO-BhyQtVw_.js → radar-ABXABTNO-DnLzBlTo.js} +1 -1
- package/editor-web/assets/{railroad-I3PHUGI6-CyOyOgY6.js → railroad-I3PHUGI6-D5hj6Yv3.js} +1 -1
- package/editor-web/assets/{railroad-abnf-LNEFI6M7-ExhYWNk4.js → railroad-abnf-LNEFI6M7-DUZlZoPu.js} +1 -1
- package/editor-web/assets/{railroad-ebnf-DWYD2UWJ-B7vR6DFd.js → railroad-ebnf-DWYD2UWJ-CDyyDC6d.js} +1 -1
- package/editor-web/assets/{railroad-peg-JR7BVNR7-hqCnhLuG.js → railroad-peg-JR7BVNR7-CC3ImNnT.js} +1 -1
- package/editor-web/assets/{railroadDiagram-Y72NRBL7-D5X_R2ve.js → railroadDiagram-Y72NRBL7-Bjw-8Se5.js} +1 -1
- package/editor-web/assets/{react-Bk7NnOLX.js → react-Edyoga_4.js} +1 -1
- package/editor-web/assets/{requirementDiagram-EQYSW5RA-CIP8sDsk.js → requirementDiagram-EQYSW5RA-CDFnuEIO.js} +1 -1
- package/editor-web/assets/{row-k2eAfT-g.js → row-C_svyL8o.js} +1 -1
- package/editor-web/assets/{sankeyDiagram-SY24JHO5-BKDJlzrK.js → sankeyDiagram-SY24JHO5-CQPVLY1w.js} +1 -1
- package/editor-web/assets/schemas-moE_A7Nj.js +1 -0
- package/editor-web/assets/{scissors-BURkYWPv.js → scissors-B_xOiUhd.js} +1 -1
- package/editor-web/assets/{search-jKDvFIEU.js → search-Ba2BbT6T.js} +1 -1
- package/editor-web/assets/{sequenceDiagram-BLEHNHQU-CkRLYFZ7.js → sequenceDiagram-BLEHNHQU-BQzuLmBX.js} +1 -1
- package/editor-web/assets/{session-CUCSWPTE.js → session-s1I85rox.js} +1 -1
- package/editor-web/assets/{sigma-CY2Chbro.js → sigma-DSUsJhMn.js} +1 -1
- package/editor-web/assets/slides-oQ_C0SVJ.js +1 -0
- package/editor-web/assets/snapshots-BPJKywuN.js +1 -0
- package/editor-web/assets/{sound-DUCxe9eC.js → sound-bTlco_K3.js} +1 -1
- package/editor-web/assets/{split-Cjm6rVDC.js → split-7CVjIkSU.js} +2 -2
- package/editor-web/assets/square-arrow-out-up-right-DF5dvsSp.js +1 -0
- package/editor-web/assets/{stateDiagram-v2-A6IESKWZ-CCvwoTcz.js → stateDiagram-v2-A6IESKWZ-DOuageUf.js} +7 -7
- package/editor-web/assets/{sticky-note-C5qUDHhC.js → sticky-note-BdkIu5_D.js} +1 -1
- package/editor-web/assets/{strikethrough-DP-7tMz0.js → strikethrough-BwXWi4zg.js} +1 -1
- package/editor-web/assets/{surface-BocGwSox.js → surface-DtCjIlrq.js} +1 -1
- package/editor-web/assets/svg-CWIBMIQ9.js +1 -0
- package/editor-web/assets/{swatch-DGdJ5SeN.js → swatch-DhztHwPU.js} +1 -1
- package/editor-web/assets/{swimlanes-B3ENRKFQ-BXgW4pi4.js → swimlanes-B3ENRKFQ-CXKkok7X.js} +1 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-C3Car2M0.js +8 -0
- package/editor-web/assets/{switch-Dwqxw1kp.js → switch-8MU4Nfxe.js} +1 -1
- package/editor-web/assets/{syntax-DSsHrzWF.js → syntax-CU_WPKxt.js} +1 -1
- package/editor-web/assets/{table-CTjNpE4W.js → table-DRbddzx0.js} +1 -1
- package/editor-web/assets/tabs-CiF1N-pL.js +1 -0
- package/editor-web/assets/tag-CIfWT8B_.js +1 -0
- package/editor-web/assets/text-align-start-Cic2-TLh.js +1 -0
- package/editor-web/assets/{textarea-BNH6Y1-o.js → textarea-D7TnPwv1.js} +1 -1
- package/editor-web/assets/{timeline-definition-JXYKGLGB-BwuUmgv1.js → timeline-definition-JXYKGLGB-DgAjAeZp.js} +3 -3
- package/editor-web/assets/{treeView-D4JQ5SDB-Da35tnkE.js → treeView-D4JQ5SDB-C0Xvnhck.js} +1 -1
- package/editor-web/assets/{treemap-SAJKECNS-4TcJReov.js → treemap-SAJKECNS-aXfKAeSX.js} +1 -1
- package/editor-web/assets/{undo-2-DUGGyBdX.js → undo-2-C47jrRp5.js} +1 -1
- package/editor-web/assets/{usecaseDiagram-WPOLBNNX-wj02og_C.js → usecaseDiagram-WPOLBNNX-CvUlBa-L.js} +1 -1
- package/editor-web/assets/{vennDiagram-Q3Y3IDCW-Cun6o3pg.js → vennDiagram-Q3Y3IDCW-qMJ1iCxs.js} +3 -3
- package/editor-web/assets/{video-DkuN7Uu7.js → video-DQrjo1TI.js} +1 -1
- package/editor-web/assets/{wardley-7MLQ67FV-DiL2aSXm.js → wardley-7MLQ67FV-DEdnH0by.js} +1 -1
- package/editor-web/assets/{wardleyDiagram-IVAIDKWA-Cll7rTnv.js → wardleyDiagram-IVAIDKWA-Bt-B2hQ5.js} +1 -1
- package/editor-web/assets/{whole-word-6DliXke2.js → whole-word-D3ZAtnkw.js} +1 -1
- package/editor-web/assets/{words-QKSIyC_P.js → words-0Ww2RyT4.js} +1 -1
- package/editor-web/assets/{words-B-7GbYO2.js → words-XlXG79Ur.js} +1 -1
- package/editor-web/assets/workbook-FSSUiIp9.js +45 -0
- package/editor-web/assets/x-DlhyIKuu.js +41 -0
- package/editor-web/assets/{xychartDiagram-4URNHDU4-s55eVncs.js → xychartDiagram-4URNHDU4-DV4bSzTb.js} +1 -1
- package/editor-web/assets/{zoom-in-C4lxmIDE.js → zoom-in-PgsC94hP.js} +1 -1
- package/editor-web/index.html +8 -7
- package/package.json +2 -2
- package/editor-web/assets/arrow-down-DzZjFrBL.js +0 -1
- package/editor-web/assets/arrow-up-hdmh9LVD.js +0 -1
- package/editor-web/assets/article-v30Q5cvX.js +0 -3
- package/editor-web/assets/calc-worker-jImBXoeb.js +0 -45
- package/editor-web/assets/channel-B8881pqR.js +0 -1
- package/editor-web/assets/chart-BC3kUUDD.js +0 -2
- package/editor-web/assets/chunk-DSNLSHJZ-BlB7YIMo.js +0 -129
- package/editor-web/assets/code-BID_OoRp.js +0 -1
- package/editor-web/assets/dist-B3RkByp0.js +0 -1
- package/editor-web/assets/dist-BAeqmRLA.js +0 -530
- package/editor-web/assets/dist-CGJv5-SE.js +0 -45
- package/editor-web/assets/dist-CUdvgRW5.js +0 -1
- package/editor-web/assets/dist-DhKxOqdu.js +0 -43
- package/editor-web/assets/dist-Dx2yV02v.js +0 -6
- package/editor-web/assets/dist-QuK0-suW.js +0 -24
- package/editor-web/assets/dist-Sl2_j-4w.js +0 -38
- package/editor-web/assets/dist-b5nFx4mV.js +0 -3
- package/editor-web/assets/dist-tteqAu5L.js +0 -4
- package/editor-web/assets/flowDiagram-IUGLLWBU-CnzC5OOy.js +0 -1
- package/editor-web/assets/index-C3A0pCmH.css +0 -2
- package/editor-web/assets/index-CFqSJBZ-.js +0 -28
- package/editor-web/assets/mermaid.core-DR2O-coV.js +0 -44
- package/editor-web/assets/minus-D1tgAHbU.js +0 -1
- package/editor-web/assets/props-form-gwp-8pGV.js +0 -1
- package/editor-web/assets/schemas-B89k2jEC.js +0 -1
- package/editor-web/assets/slides-BdaWgL_N.js +0 -1
- package/editor-web/assets/snapshots-CTS2iez5.js +0 -56
- package/editor-web/assets/svg-nJtFNJ-7.js +0 -1
- package/editor-web/assets/swimlanesDiagram-AYQRV4AK-AFpLq-Wf.js +0 -8
- package/editor-web/assets/tabs-B0bv2mMP.js +0 -1
- package/editor-web/assets/x-BsePFh6d.js +0 -41
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{consoleAt as Q,consoleAtAsync as
|
|
3
|
-
${P.stack??""}`)}const d=b.default;if(!Tt(d))throw new pe("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let g;try{g=Q({phase:"build"},()=>Ct(d))}catch(u){throw new pe("load_failed",`The deck's code failed: ${u instanceof Error?u.message:String(u)}`)}for(const[u,P]of Object.entries(moduleComponents(b)))Object.hasOwn(g.components,u)||(g.components[u]=P);return g}export function moduleComponents(i){const b=i.components,d={};if(typeof b!="object"||b===null)return d;for(const[g,u]of Object.entries(b)){const P=qt(g,u);P&&(d[g]=P)}return d}export async function deckCodeOf(i,b){const{log:d}=Be(i,b,void 0,"slides"),g=await importDeck(i);return{code:Q({phase:"build"},()=>Ke(g,P=>d.readData(P))),theme:lookTheme(i)}}export const lookTheme=i=>Ft(i.looks?.clean??Xe);export async function loadDeck(i,b,d){const g=Be(i,b,void 0,"slides"),{log:u,ledger:P,guards:W}=g,[C,I]=i.format.split("x").map(Number);if(!(C>0&&I>0))throw new pe("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);const ne=await importDeck(i),J=i.kindData,U=Pt(J?.code)?J.code:Q({phase:"build"},()=>Ke(ne,e=>u.readData(e))),Y=Ht(i.piece),oe=i.looks?.clean??Xe,se=i.file.split("/").slice(0,-1).join("/"),fe={file:J?.slidesFile??i.file},{deck:ae}=jt({code:U,file:J?.slides??{slides:[]},words:Vt(u),prefix:Y,base:se,theme:lookTheme(i),data:e=>u.readData(e)});let v=ae;if(v.slides.length===0)throw new pe("no_parts","The deck has no slides to draw (AK-K003).");const k=C/v.width;Object.assign(d.style,{position:"relative",width:`${String(C)}px`,height:`${String(I)}px`,overflow:"hidden"});const ie=()=>{for(const[e,t]of Object.entries({...Rt(oe),...Gt(v.theme)}))d.style.setProperty(e,t)};ie(),d.replaceChildren();const he=b.purpose==="play";b.purpose==="render"&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const De=new Map,ue=e=>De.get(e)??u.mediaAt(e),tt=e=>ue(e)?.url??"",V=e=>Math.round(e*z)/z,me=g.combo.lang,nt=(e,t,n)=>{const s=Mt(e,t===0),{rests:o,comesOn:a,goesOff:p,playsAt:f}=s,m=n+(o.at(-1)??0),l=e.shapes.flatMap(c=>{if(c.kind!=="movie"&&c.kind!=="audio"||!c.media)return[];const $=c.media.playback,E=ue(c.media.path)?.duration??0,N=Math.min(E,$?.trim?.end??E);return[{shape:c.name,from:f(c.name),poster:c.media.poster??0,length:N,rest:o.at(-1)??0,begin:$?.trim?.start??c.media.poster??0,loop:$?.loop===!0,volume:$?.volume??1,hide:$?.hide===!0,fullscreen:$?.fullscreen===!0}]}),h=Math.max(m+1/z,...l.map(c=>n+c.from+c.length-c.begin)),r=[],D=[],w=l.flatMap(c=>{const $=e.shapes.find(F=>F.name===c.shape);if($?.kind!=="audio"||!$.media||c.volume===0||he)return[];const E=$.media,N=p($.name),x=N===void 0?h:n+V(N),y=n+V(c.from),_=(F,T)=>({t:F,sound:E.path,part:e.id,file:E.path,...c.volume===1?{}:{gainDb:20*Math.log10(c.volume)},...c.begin>0?{from:c.begin}:{},...T===void 0?{}:{length:T}}),A=c.length-c.begin;if(A<=0)return[_(y)];const R=[];for(let F=y;F<x&&(R.length===0||c.loop)&&R.length<1e3;F+=A){const T=Math.min(A,x-F);R.push(_(F,E.playback?.trim?.end!==void 0||T<A?T:void 0))}return R}),S=new Map,M=[!1];for(const c of e.shapes){et(c)&&(S.set(c.name,M.length-1),M[M.length-1]=!0);const $=c.component&&et(c)?ne.components[c.component.name]:void 0;if($){const E=Q({phase:"build",part:e.id},()=>$.layers(c.component?.props??{},{width:c.frame.width*k,height:c.frame.height*k,slide:e.id}));for(const N of E)Qt(N)?r.push({shape:c.name,layer:N}):P.problems.push(Ve("AK-M011",`Component ${$.name} on slide ${e.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:e.id,where:fe}))}if(c.kind==="movie"&&c.media&&!he&&ue(c.media.path)){const E=[c.frame.left*k,c.frame.top*k,c.frame.width*k,c.frame.height*k],N=c.media.playback,x=ue(c.media.path),y=l.find(T=>T.shape===c.name),_=p(c.name),A=_===void 0?h:n+V(_),R=y!==void 0&&y.volume>0&&x?.audio===!0,F={gainDb:R?20*Math.log10(y.volume):0,audio:R};if(!N||!y){const T=V(a(c.name));D.push({part:e.id,file:c.media.path,start:n+T,end:A,from:(c.media.poster??0)-((o.at(-1)??0)-T),speed:1,...F,fit:"cover",box:E,picture:E,over:M.length})}else{const T=V(y.hide||y.loop?y.from:a(c.name)),K=V(y.from),te=Math.max(1/z,y.length-y.begin),He=y.loop?A:Math.min(A,n+K+te),we=[];for(let Oe=n+K+te;y.loop&&Oe<He&&we.length<1e3;Oe+=te)we.push({at:Oe,from:y.begin});D.push({part:e.id,file:c.media.path,start:n+T,end:He,from:y.begin-(K-T),speed:1,...F,...we.length>0?{cuts:[{at:n+T,from:y.begin},...we]}:{},fit:"cover",box:E,picture:E,over:M.length})}M.push(!1)}}for(;M.length>1&&M.at(-1)===!1;)M.pop();const L=M.length,j=V(m),q=c=>r.filter($=>$.shape===c).map($=>$.layer.component);return{slide:e,sign:_t(v,e),clock:s,movies:l,footage:D,cues:w,planeOf:S,planes:L,made:r,part:{key:e.id,layers:[...new Set(r.map(c=>c.layer.component))],start:n,end:h,planes:Array.from({length:L},(c,$)=>({layers:[{component:SLIDE_LAYER,start:n,end:h},...e.shapes.filter(E=>S.get(E.name)===$).flatMap(E=>q(E.name)).map(E=>({component:E,start:n,end:h}))]})),still:j,...o.length>1?{steps:o.map(c=>Math.round((n+c)*z)/z)}:{},...Zt(e),...e.hidden?{hidden:!0}:{}}}},Te=e=>{let t=0;return e.slides.map((n,s)=>{const o=nt(n,s,t);return t=o.part.end,o})};let O=Te(v);const Se=O.at(-1)?.part.end??0,Pe={fps:z,width:C,height:I,paper:`${String(v.width/Ue)}in ${String(v.height/Ue)}in`,duration:Se,background:v.theme.colors.lt1,parts:O.map(e=>e.part),cues:O.flatMap(e=>e.cues),...O.some(e=>e.footage.length>0)?{footage:O.flatMap(e=>e.footage)}:{},audio:{}},H=new Map,xe=new Map;let Z,re;const ot=async e=>{const{slide:t,part:n}=e,s=Wt(t,{k,url:tt,editing:!1,playing:he,...me===void 0?{}:{lang:me},colors:v.theme.colors});s.style.visibility="hidden",d.append(s);const o=Array.from({length:e.planes},()=>[]),a=[],p=[];for(const f of t.shapes){const m=s.querySelector(`[${G}="${CSS.escape(`${t.id}/${f.name}`)}"]`);if(m){o[e.planeOf.get(f.name)??0]?.push(m);for(const[l,{layer:h}]of e.made.filter(r=>r.shape===f.name).entries()){const r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0px"}),m.append(r);const D=stageContext({look:oe,width:f.frame.width*k,height:f.frame.height*k,start:n.start,end:n.end,combo:g.combo,format:i.format,asset:w=>u.asset(w),wait:w=>p.push(w),report:w=>P.problems.push(Ve(w.code,w.message,{part:t.id,where:fe}))});a.push({layer:h,el:r,ctx:D,props:h.props,from:e.clock.comesOn(f.name)}),Q({phase:"mount",part:t.id,layer:h.component,index:l},()=>{h.mount(r,h.props,D)})}}}await gt(s),s.style.visibility="visible",Kt(s);for(const f of s.querySelectorAll("[data-ak-autofit='text']"))zt(f);return s.style.visibility="hidden",await Promise.all(p),{slide:t,slot:e,el:s,part:n,layers:a,targets:vt(e.clock.timed),lead:e.clock.lead,movies:e.movies,planes:o,pictures:St(s)}},ge=e=>{H.delete(e.slide.id);for(const[t,n]of e.layers.entries())Q({phase:"mount",part:e.slide.id,layer:n.layer.component,index:t},()=>{n.layer.unmount?.(n.el,n.props,n.ctx)});e.el.remove(),Z===e&&(Z=void 0),re===e&&(re=void 0)},ce=async e=>{const t=e.slide.id,n=H.get(t);if(n?.slot===e)return H.delete(t),H.set(t,n),n;n&&ge(n);let s=xe.get(t);s||(s=ot(e).finally(()=>xe.delete(t)),xe.set(t,s));const o=await s,a=ve(t);return a&&a!==e?(o.el.remove(),ce(a)):(H.set(t,o),o)},ke=()=>{for(const e of[...H.values()]){if(H.size<=SLIDES_KEPT)return;e!==Z&&e!==re&&ge(e)}},ve=e=>O.find(t=>t.slide.id===e),st=e=>{let t=0,n=O.length-1;for(;t<n;){const s=t+n>>1,o=O[s];o&&e<o.part.end-1e-6?n=s:t=s+1}return O[t]},at=e=>O.slice(0,O.indexOf(e)).reverse().find(t=>!t.slide.hidden),je=new WeakMap,le=[],B=(e,t)=>{const n={...t};for(const s of Object.keys(t))n[s]=e.style[s];le.push(()=>{Object.assign(e.style,n)}),Object.assign(e.style,t)},ye=(e,t)=>e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${t}`)}"]`);let _e;const Fe=(e,t)=>ye(e,t)?.querySelector("video, audio")??void 0,Me=new Set,it=(e,t)=>{const n=_e;if(n&&n.m!==e){for(const o of n.m.movies)Fe(n.m,o.shape)?.pause();Me.clear()}const s=n?.m===e&&t>n.t&&t-n.t<Jt;_e={m:e,t};for(const o of e.movies){const a=Fe(e,o.shape);if(!a)continue;a.volume=o.volume;const p=o.length-o.begin;let f=o.begin+Math.max(0,t-o.from);o.loop&&p>0&&f>=o.length&&(f=o.begin+(f-o.begin)%p);const m=s&&t>=o.from&&f<o.length;o.hide&&(a.style.visibility=m?"":"hidden");const l=o.fullscreen?ye(e,o.shape):null;if(l){const r=l.dataset.akFull;m&&r===void 0?(l.dataset.akFull=l.style.cssText,Object.assign(l.style,{left:"0px",top:"0px",width:"100%",height:"100%",transform:"none",zIndex:"1000"})):!m&&r!==void 0&&(l.style.cssText=r,delete l.dataset.akFull)}if(m){Math.abs(a.currentTime-f)>Ut&&(a.currentTime=f),a.paused&&(o.volume===0&&(a.muted=!0),Yt(a,o.volume>0));continue}a.pause(),s&&f>=o.length&&Me.add(o.shape);const h=Me.has(o.shape)?o.length:Math.max(o.begin===o.poster?0:o.begin,o.poster-(o.rest-t));Math.abs(a.currentTime-h)>1/z&&(a.currentTime=h)}},rt=(e,t)=>{const n=e.slide.transition;if(!n||!Je(t,e.lead))return;const s=re;if(!s)return;Le(s,s.part.still-s.part.start),s.el.style.visibility="visible";const o=Math.min(1,t/e.lead);if(n.type!=="morph"){const l=Ot(n,o),h=r=>{const D=r.x!==0||r.y!==0?`translate(${String(r.x*100)}%, ${String(r.y*100)}%)`:"",w=[r.scale===1?"":`scale(${String(r.scale)})`,r.rotate===0?"":`rotate(${String(r.rotate)}deg)`],S=r.clip;return{opacity:String(r.opacity),transform:[D,...w].filter(M=>M!=="").join(" "),clipPath:r.polygon?`polygon(${r.polygon.map(([M,L])=>`${String(M*100)}% ${String(L*100)}%`).join(", ")})`:S?`inset(${String(S.top*100)}% ${String(S.right*100)}% ${String(S.bottom*100)}% ${String(S.left*100)}%)`:""}};B(e.el,{...h(l.incoming),zIndex:l.outgoingOver?"0":"1"}),B(s.el,{...h(l.outgoing),zIndex:l.outgoingOver?"1":"0"}),l.black&&B(d,{background:"#000"});return}const a=new Map(s.slide.shapes.map(l=>[l.name,l]));B(e.el,{background:`color-mix(in srgb, ${getComputedStyle(e.el).backgroundColor} ${String(o*100)}%, transparent)`});const p=(l,h,r)=>{B(l,{left:`${String(r.left*k)}px`,top:`${String(r.top*k)}px`,width:`${String(r.width*k)}px`,height:`${String(r.height*k)}px`});const D=h.width>0?r.width/h.width:1,w=h.height>0?r.height/h.height:1;for(const S of l.querySelectorAll(":scope > svg:not([viewBox])"))B(S,{transformOrigin:"0 0",transform:`scale(${String(D)}, ${String(w)})`})},f=l=>JSON.stringify({...l,frame:void 0,sources:void 0}),m=new Map;for(const l of e.slide.shapes){const h=ye(e,l.name);if(!h)continue;const r=a.get(l.name);if(!r){B(h,{opacity:String(o)});continue}const D=$t(r.frame,l.frame,o),w=f(r)===f(l);m.set(l.name,{frame:D,same:w}),p(h,l.frame,D),w||B(h,{opacity:String(o)})}for(const l of s.slide.shapes){const h=ye(s,l.name);if(!h)continue;const r=m.get(l.name);r?r.same?B(h,{visibility:"hidden"}):(p(h,l.frame,r.frame),B(h,{opacity:String(1-o)})):B(h,{opacity:String(1-o)})}},Le=(e,t)=>{for(const n of e.targets){const s=e.slide.shapes.find(S=>S.name===n.shape),o=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${n.shape}`)}"]`);if(!s||!o)continue;const a=n.paragraph===void 0?o:o.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!a)continue;const p=je.get(a)??{transform:a.style.transform,clipPath:a.style.clipPath};je.set(a,p);const f={width:v.width,height:v.height},m=n.animations.filter(S=>S.iterate),l=n.animations.filter(S=>!S.iterate),h=Ge(l,t,s.frame,f),[r]=n.animations,D=r?.iterate!==void 0&&At(r.effect)&&t<r.from-1e-6;Ne(a,D?{...h,hidden:!0}:h,p);const w=m[0]?.iterate?.by;if(w!==void 0)for(const[S,M]of ct(a,w).entries()){const L=Ge(m,t,s.frame,f,S);for(const j of M)Ne(j,L,{transform:"",clipPath:""})}}},Ne=(e,t,n)=>{e.style.visibility=t.hidden?"hidden":"",e.style.opacity=t.opacity===1?"":String(t.opacity);const s=t.x!==0||t.y!==0?`translate(${String(t.x*k)}px, ${String(t.y*k)}px)`:"",o=t.scale*t.sx,a=t.scale*t.sy,p=o===1&&a===1?"":o===a?`scale(${String(o)})`:`scale(${String(o)}, ${String(a)})`,f=t.rotate===0?"":`rotate(${String(t.rotate)}deg)`;e.style.transform=[s,p,f,n.transform].filter(m=>m!=="").join(" "),e.style.clipPath=t.polygon?`polygon(${t.polygon.map(([m,l])=>`${String(m*100)}% ${String(l*100)}%`).join(", ")})`:t.clip?`inset(${String(t.clip.top*100)}% ${String(t.clip.right*100)}% ${String(t.clip.bottom*100)}% ${String(t.clip.left*100)}%)`:n.clipPath},qe=new WeakMap,ct=(e,t)=>{const n=qe.get(e);if(n)return n.of;const s=[],o=e.matches("[data-ak-paragraph]")?[e]:[...e.querySelectorAll("[data-ak-paragraph]")];for(const a of o){const p=document.createTreeWalker(a,NodeFilter.SHOW_TEXT),f=[];for(;p.nextNode();)f.push(p.currentNode);const m=Et(f.map(h=>h.data),t),l=s.length;s.push(...m.map(()=>[])),f.forEach((h,r)=>{const D=m.flatMap((j,q)=>j.filter(c=>c.piece===r).map(c=>({...c,unit:q})));if(D.length===0)return;const w=Xt(h.parentElement,a),S=document.createDocumentFragment();let M=0,L;for(const j of D){j.start>M&&(S.append(h.data.slice(M,j.start)),L=void 0);const q=document.createElement("span");q.dataset.akUnit="",q.style.display="inline-block",w&&Object.assign(q.style,w),q.textContent=h.data.slice(j.start,j.end),s[l+j.unit]?.push(q),t==="letter"?(L||(L=document.createElement("span"),L.style.whiteSpace="nowrap",S.append(L)),L.append(q)):S.append(q),M=j.end}M<h.data.length&&S.append(h.data.slice(M)),h.replaceWith(S)})}return qe.set(e,{by:t,of:s}),s},lt=(e,t)=>{if(t>0){const n=e.el.style.background;e.el.style.background="none",le.push(()=>{e.el.style.background=n})}for(const[n,s]of e.planes.entries())for(const o of n===t?[]:s){const a=o.style.visibility;o.style.visibility="hidden",le.push(()=>{o.style.visibility=a})}};let de;const X=async(e,t)=>{de={t:e,plane:t};const n=Math.min(Math.max(0,e),Se-1/z),s=st(n);if(!s)return;const o=n-s.part.start,a=await ce(s),p=s.slide.transition&&Je(o,s.clock.lead)?at(s):void 0,f=p?await ce(p):void 0;if(de.t===e){for(const m of H.values())m.el.style.visibility=m===a?"visible":"hidden";for(Z=a,re=f,W.setMoment(n,`${g.seedBase}:${a.slide.id}`);le.length>0;)le.pop()?.();Le(a,o),rt(a,o),it(a,o);for(const[m,l]of a.layers.entries())Q({phase:"render",part:a.slide.id,layer:l.layer.component,index:m,t:o},()=>{l.layer.render(l.el,Math.max(0,o-l.from),l.props,l.ctx)});if(t!==void 0&<(a,t),await Promise.all([a.pictures(Ae*1e3),...f?[f.pictures(Ae*1e3)]:[]]),ke(),he){const m=O[O.indexOf(s)+1];m&&!H.has(m.slide.id)&&ce(m).then(ke,()=>{})}}},$e=()=>Z,Re=async e=>{await X(e);const t=$e(),n=d.getBoundingClientRect(),s=n.width>0?C/n.width:1;return{m:t,blocks:t?ze(t.el,d,C):[],scale:s}},dt=()=>{const e=new Map,t=new Map,n=(p,f)=>{e.has(be(p))||e.set(be(p),f),t.set(be(p),(t.get(be(p))??new Set).add(p))},s=v.theme.fonts;for(const p of[s.major,s.minor,s.major_east_asian,s.minor_east_asian])n(p,"theme");for(const p of v.slides)for(const f of p.shapes){const m=[...f.text?.style.levels.map(l=>l.font.name)??[],...f.text?.paragraphs.flatMap(l=>[l.font?.name,...l.runs.map(h=>h.font?.name)])??[]];for(const l of m)l!==void 0&&!l.startsWith("+")&&n(l,"text")}const o=new Set(wt().map(p=>p.family)),a=p=>{const f=mt(p)[0]??p;return o.has(f)||yt(f)};return[...e].map(([p,f])=>({name:p,where:f,drawn:[...t.get(p)??[]].some(a)}))},pt=e=>{const t=e.text?.paragraphs[0],n=t?.alignment??e.text?.style.levels[t?.level??0]?.alignment;return n===void 0?{}:{align:n}},ft=(e,t)=>{const n=d.getBoundingClientRect(),s=n.width>0?C/n.width:1,o=[],a=[],p=[],f=[],m=[],l=[],h=k*Ye;return e.slide.shapes.forEach((r,D)=>{const w=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${r.name}`)}"]`);if(!w)return;const S=w.getBoundingClientRect(),M=[Math.round((S.left-n.left)*s),Math.round((S.top-n.top)*s),Math.round(S.width*s),Math.round(S.height*s)],L=getComputedStyle(w).visibility==="hidden",j=ze(w,d,C).filter(x=>x.ink!==null&&x.runs.some(y=>getComputedStyle(y.el).visibility!=="hidden")),q=j.map(x=>Qe([...new Set(x.runs.map(y=>y.el))],d,C));j.forEach((x,y)=>{const _=q[y]??[],A=Ce(_);A&&(o.push({layer:r.name,z:"front",text:x.text,box:A,...x.opacity<1?{opacity:x.opacity}:{}}),a.push(D),p.push(x.containers),f.push(A),m.push(_))});const c={name:r.name,kind:Ee(r.geometry)?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*k),Math.round(r.frame.top*k),Math.round(r.frame.width*k),Math.round(r.frame.height*k)],box:M,...L?{hidden:L}:{},opaque:r.kind==="picture"||r.kind==="movie"||!Ee(r.geometry)&&r.fill!==void 0&&r.fill!==null},$=tn(r,k);if($&&(c.ends=$),r.chart){const x=r.chart.series.flatMap(y=>y.values.filter(_=>_!==null));c.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...x.length>0?{low:Math.min(...x),high:Math.max(...x)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const x=[...w.querySelectorAll("tr")];c.rows=r.table.rows.map((y,_)=>({set:Math.round(y.height*k),drawn:Math.round((x[_]?.getBoundingClientRect().height??0)*s)}))}const E=q.flat();if(E.length>0){const x=new Map;for(const A of j)for(const R of A.runs){const F=getComputedStyle(R.el),T=Math.round(parseFloat(F.fontSize)/h*10)/10,K=parseInt(F.fontWeight,10)||400,te=`${String(T)}/${String(K)}`;x.has(te)||x.set(te,{size:T,weight:K,...A.xHeight===void 0?{}:{xHeight:Math.round(A.xHeight/h*10)/10}})}const y=j.map(A=>A.text).join(`
|
|
4
|
-
`),_=w.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;if(c.text={text:
|
|
5
|
-
`)]:[])})),reads:()=>
|
|
6
|
-
`)),owners:[...new Set(n.made.map(
|
|
2
|
+
import{consoleAt as Q,consoleAtAsync as wt}from"@allyhub/piece/page";import{inkOfBlock as bt}from"@allyhub/image-draw/contrast";import{createEnv as Ge}from"@allyhub/image-draw/env";import{LoadFailure as pe}from"@allyhub/image-draw/errors";import{families as kt,loadTextFonts as St,localFamily as xt,pageFaces as vt}from"@allyhub/image-draw/fonts";import{realTimers as Mt}from"@allyhub/image-draw/guards";import{domHash as Ue}from"@allyhub/image-draw/hash";import{textBlocks as Je}from"@allyhub/image-draw/inspect";import{pictureWaiter as $t}from"@allyhub/image-draw/pictures";import{answerFilm as Ot,playFilm as At}from"@allyhub/runtime/stage";import{joinPath as Et,animationTargets as Ct,clockOf as Dt,DECK_FPS as z,deckCode as Ye,drawnAt as Ve,morphFrame as Pt,inTransition as Xe,transitionAt as Tt,unitsAcross as jt,isEntrance as _t,EMU_PER_INCH as Qe,EMU_PER_PT as Ze,evaluateDeck as Ft,fontFace as be,connectorEnds as Lt,isConnectorGeometry as Pe,isDeck as qt,isDeckCode as Nt,resolveDeck as Rt,slideSign as It,themeOfLook as Ht}from"@allyhub/slides-core";import{problem as et}from"@allyhub/diagnostics";import{CLEAN_LOOK as tt,LAYER_BRAND as Bt,SEEK_LIMIT as Te,countWords as Wt,framedComponent as zt,lookCss as Kt,measureMoment as Gt,messagePrefix as Ut}from"@allyhub/piece";import{shownOf as Jt}from"@allyhub/formats";import{filmSummary as Yt}from"@allyhub/video-core";import{drawSlide as Vt,fitText as Xt,hangLabels as Qt,SHAPE_ATTR as G,themeCss as Zt}from"./draw.js";import{inkLines as nt,union as je}from"./ink.js";import{itemLayer as en,itemSounds as tn,itemsRead as ot}from"./item.js";export const SLIDE_LAYER="slide",SLIDES_KEPT=5;const nn=.5,on=.3,at={top:0,bottom:0,left:0,right:0};async function an(i,y=!0){i.muted=!y,await i.play().catch(async()=>{i.muted=!0,await i.play().catch(()=>{})})}function sn(i){const y=d=>{if(i.peek(d)!==void 0)return i.s(d);const u=[...new Set(i.keysUnder(d).map(m=>m.slice(d.length+1).split(".")[0]).filter(m=>m!==void 0&&/^\d+$/u.test(m)))].sort((m,C)=>Number(m)-Number(C));if(u.length!==0)return u.map(m=>y(`${d}.${m}`)).filter(m=>m!==void 0)};return y}function rn(i,y){for(let d=i;d;d=d.parentElement){const u=getComputedStyle(d);if(u.textDecorationLine!=="none"&&u.textDecorationLine!=="")return{textDecorationLine:u.textDecorationLine,textDecorationStyle:u.textDecorationStyle,textDecorationThickness:u.textDecorationThickness,textDecorationColor:u.textDecorationColor};if(d===y)break}}const st=i=>!(i.kind==="placeholder"&&i.text?.empty===!0),cn=i=>typeof i=="object"&&i!==null&&i[Bt]==="graphic";export async function loadStyles(i){const y=new Set([...document.querySelectorAll("link[rel=stylesheet]")].map(d=>d.href));for(const d of i.styles??[]){if(y.has(new URL(d,document.baseURI).href))continue;const u=document.createElement("link");u.rel="stylesheet",u.href=d;const m=new Promise(C=>{u.onload=C,u.onerror=C});document.head.append(u),await m}}export async function importDeck(i){await loadStyles(i);let y;try{y=await wt({phase:"module"},()=>import(i.module))}catch(m){const C=m instanceof Error?m:new Error(String(m));throw new pe("load_failed",`Failed to load the deck's module: ${C.message}
|
|
3
|
+
${C.stack??""}`)}const d=y.default;if(!qt(d))throw new pe("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let u;try{u=Q({phase:"build"},()=>Ft(d))}catch(m){throw new pe("load_failed",`The deck's code failed: ${m instanceof Error?m.message:String(m)}`)}for(const[m,C]of Object.entries(moduleComponents(y)))Object.hasOwn(u.components,m)||(u.components[m]=C);return u}export function moduleComponents(i){const y=i.components,d={};if(typeof y!="object"||y===null)return d;for(const[u,m]of Object.entries(y)){const C=zt(u,m);C&&(d[u]=C)}return d}export async function deckCodeOf(i,y){const{log:d}=Ge(i,y,void 0,"slides"),u=await importDeck(i);return{code:Q({phase:"build"},()=>Ye(u,C=>d.readData(C))),theme:lookTheme(i)}}export const lookTheme=i=>Ht(i.looks?.clean??tt);export async function loadDeck(i,y,d){const u=Ge(i,y,void 0,"slides"),{log:m,ledger:C,guards:W}=u,[D,I]=i.format.split("x").map(Number);if(!(D>0&&I>0))throw new pe("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);const oe=await importDeck(i),U=i.kindData,J=Nt(U?.code)?U.code:Q({phase:"build"},()=>Ye(oe,e=>m.readData(e))),Y=Ut(i.piece),ae=i.looks?.clean??tt,Z=i.file.split("/").slice(0,-1).join("/"),fe={file:U?.slidesFile??i.file},{deck:se}=Rt({code:J,file:U?.slides??{slides:[]},words:sn(m),prefix:Y,base:Z,theme:lookTheme(i),data:e=>{const t=Jt(e);return t===void 0?m.readData(e):i.data?.[Et(Z,t)]?.shown}});let v=se;if(v.slides.length===0)throw new pe("no_parts","The deck has no slides to draw (AK-K003).");const x=D/v.width;Object.assign(d.style,{position:"relative",width:`${String(D)}px`,height:`${String(I)}px`,overflow:"hidden"});const ie=()=>{for(const[e,t]of Object.entries({...Kt(ae),...Zt(v.theme)}))d.style.setProperty(e,t)};ie(),d.replaceChildren();const he=y.purpose==="play";y.purpose==="render"&&y.inside===void 0&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const _e=new Map,me=e=>_e.get(e)??m.mediaAt(e),it=e=>me(e)?.url??"",V=e=>Math.round(e*z)/z,ue=u.combo.lang,ke=new Map,Se=new Map,xe=new Map;let ve;const rt=(e,t,n)=>{const o=Dt(e,t===0),{rests:a,comesOn:s,goesOff:f,playsAt:h}=o,b=n+(a.at(-1)??0),l=e.shapes.flatMap(c=>{if(c.kind!=="movie"&&c.kind!=="audio"||!c.media)return[];const O=c.media.playback,A=me(c.media.path)?.duration??0,q=Math.min(A,O?.trim?.end??A);return[{shape:c.name,from:h(c.name),poster:c.media.poster??0,length:q,rest:a.at(-1)??0,begin:O?.trim?.start??c.media.poster??0,loop:O?.loop===!0,volume:O?.volume??1,hide:O?.hide===!0,fullscreen:O?.fullscreen===!0}]}),p=Math.max(b+1/z,...l.map(c=>n+c.from+c.length-c.begin)),r=[],P=[],w=l.flatMap(c=>{const O=e.shapes.find(F=>F.name===c.shape);if(O?.kind!=="audio"||!O.media||c.volume===0||he)return[];const A=O.media,q=f(O.name),S=q===void 0?p:n+V(q),g=n+V(c.from),_=(F,T)=>({t:F,sound:A.path,part:e.id,file:A.path,...c.volume===1?{}:{gainDb:20*Math.log10(c.volume)},...c.begin>0?{from:c.begin}:{},...T===void 0?{}:{length:T}}),E=c.length-c.begin;if(E<=0)return[_(g)];const R=[];for(let F=g;F<S&&(R.length===0||c.loop)&&R.length<1e3;F+=E){const T=Math.min(E,S-F);R.push(_(F,A.playback?.trim?.end!==void 0||T<E?T:void 0))}return R}),k=new Map,$=[!1];for(const c of e.shapes){st(c)&&(k.set(c.name,$.length-1),$[$.length-1]=!0);const O=c.component&&st(c)?oe.components[c.component.name]:void 0;if(O){const A=Q({phase:"build",part:e.id},()=>O.layers(c.component?.props??{},{width:c.frame.width*x,height:c.frame.height*x,slide:e.id}));for(const q of A)cn(q)?r.push({shape:c.name,layer:q}):C.problems.push(et("AK-M011",`Component ${O.name} on slide ${e.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:e.id,where:fe}))}if(c.kind==="item"&&c.item&&r.push({shape:c.name,layer:en({source:i,options:y,shape:{path:c.item.path,playback:c.item.playback,delay:Math.max(0,h(c.name)-s(c.name))},lengths:ke,drawn:Se,kept:xe})}),c.kind==="movie"&&c.media&&!he&&me(c.media.path)){const A=[c.frame.left*x,c.frame.top*x,c.frame.width*x,c.frame.height*x],q=c.media.playback,S=me(c.media.path),g=l.find(T=>T.shape===c.name),_=f(c.name),E=_===void 0?p:n+V(_),R=g!==void 0&&g.volume>0&&S?.audio===!0,F={gainDb:R?20*Math.log10(g.volume):0,audio:R};if(!q||!g){const T=V(s(c.name));P.push({part:e.id,file:c.media.path,start:n+T,end:E,from:(c.media.poster??0)-((a.at(-1)??0)-T),speed:1,...F,fit:"cover",box:A,picture:A,over:$.length})}else{const T=V(g.hide||g.loop?g.from:s(c.name)),K=V(g.from),ne=Math.max(1/z,g.length-g.begin),Ke=g.loop?E:Math.min(E,n+K+ne),we=[];for(let De=n+K+ne;g.loop&&De<Ke&&we.length<1e3;De+=ne)we.push({at:De,from:g.begin});P.push({part:e.id,file:c.media.path,start:n+T,end:Ke,from:g.begin-(K-T),speed:1,...F,...we.length>0?{cuts:[{at:n+T,from:g.begin},...we]}:{},fit:"cover",box:A,picture:A,over:$.length})}$.push(!1)}}for(;$.length>1&&$.at(-1)===!1;)$.pop();const L=$.length,j=V(b),N=c=>r.filter(O=>O.shape===c).map(O=>O.layer.component);return{slide:e,sign:It(v,e),clock:o,movies:l,footage:P,cues:w,planeOf:k,planes:L,made:r,part:{key:e.id,layers:[...new Set(r.map(c=>c.layer.component))],start:n,end:p,planes:Array.from({length:L},(c,O)=>({layers:[{component:SLIDE_LAYER,start:n,end:p},...e.shapes.filter(A=>k.get(A.name)===O).flatMap(A=>N(A.name)).map(A=>({component:A,start:n,end:p}))]})),still:j,...a.length>1?{steps:a.map(c=>Math.round((n+c)*z)/z)}:{},...ln(e),...e.hidden?{hidden:!0}:{}}}},Fe=e=>{let t=0;return e.slides.map((n,o)=>{const a=rt(n,o,t);return t=a.part.end,a})};let M=Fe(v);const Me=M.at(-1)?.part.end??0,Le={fps:z,width:D,height:I,paper:`${String(v.width/Qe)}in ${String(v.height/Qe)}in`,duration:Me,background:v.theme.colors.lt1,parts:M.map(e=>e.part),cues:M.flatMap(e=>e.cues),...M.some(e=>e.footage.length>0)?{footage:M.flatMap(e=>e.footage)}:{},audio:{}},H=new Map,$e=new Map;let ee,re;const ct=async e=>{const{slide:t,part:n}=e,o=Vt(t,{k:x,url:it,editing:!1,playing:he,...ue===void 0?{}:{lang:ue},colors:v.theme.colors});o.style.visibility="hidden",d.append(o);const a=Array.from({length:e.planes},()=>[]),s=[],f=[];for(const h of t.shapes){const b=o.querySelector(`[${G}="${CSS.escape(`${t.id}/${h.name}`)}"]`);if(b){a[e.planeOf.get(h.name)??0]?.push(b);for(const[l,{layer:p}]of e.made.filter(r=>r.shape===h.name).entries()){const r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0px"}),b.append(r);const P=stageContext({look:ae,width:h.frame.width*x,height:h.frame.height*x,start:n.start,end:n.end,combo:u.combo,format:i.format,asset:w=>m.asset(w),wait:w=>(ve??f).push(w),report:w=>C.problems.push(et(w.code,w.message,{part:t.id,where:fe}))});s.push({layer:p,el:r,ctx:P,props:p.props,from:e.clock.comesOn(h.name)}),Q({phase:"mount",part:t.id,layer:p.component,index:l},()=>{p.mount(r,p.props,P)})}}}await St(o),o.style.visibility="visible",Qt(o);for(const h of o.querySelectorAll("[data-ak-autofit='text']"))Xt(h);return o.style.visibility="hidden",await Promise.all(f),{slide:t,slot:e,el:o,part:n,layers:s,targets:Ct(e.clock.timed),lead:e.clock.lead,movies:e.movies,planes:a,pictures:$t(o)}},ge=e=>{H.delete(e.slide.id);for(const[t,n]of e.layers.entries())Q({phase:"mount",part:e.slide.id,layer:n.layer.component,index:t},()=>{n.layer.unmount?.(n.el,n.props,n.ctx)});e.el.remove(),ee===e&&(ee=void 0),re===e&&(re=void 0)},ce=async e=>{const t=e.slide.id,n=H.get(t);if(n?.slot===e)return H.delete(t),H.set(t,n),n;n&&ge(n);let o=$e.get(t);o||(o=ct(e).finally(()=>$e.delete(t)),$e.set(t,o));const a=await o,s=Ae(t);return s&&s!==e?(a.el.remove(),ce(s)):(H.set(t,a),a)},Oe=()=>{for(const e of[...H.values()]){if(H.size<=SLIDES_KEPT)return;e!==ee&&e!==re&&ge(e)}},Ae=e=>M.find(t=>t.slide.id===e),lt=e=>{let t=0,n=M.length-1;for(;t<n;){const o=t+n>>1,a=M[o];a&&e<a.part.end-1e-6?n=o:t=o+1}return M[t]},dt=e=>M.slice(0,M.indexOf(e)).reverse().find(t=>!t.slide.hidden),qe=new WeakMap,le=[],B=(e,t)=>{const n={...t};for(const o of Object.keys(t))n[o]=e.style[o];le.push(()=>{Object.assign(e.style,n)}),Object.assign(e.style,t)},ye=(e,t)=>e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${t}`)}"]`);let Ne;const Re=(e,t)=>ye(e,t)?.querySelector("video, audio")??void 0,Ee=new Set,pt=(e,t)=>{const n=Ne;if(n&&n.m!==e){for(const a of n.m.movies)Re(n.m,a.shape)?.pause();Ee.clear()}const o=n?.m===e&&t>n.t&&t-n.t<nn;Ne={m:e,t};for(const a of e.movies){const s=Re(e,a.shape);if(!s)continue;s.volume=a.volume;const f=a.length-a.begin;let h=a.begin+Math.max(0,t-a.from);a.loop&&f>0&&h>=a.length&&(h=a.begin+(h-a.begin)%f);const b=o&&t>=a.from&&h<a.length;a.hide&&(s.style.visibility=b?"":"hidden");const l=a.fullscreen?ye(e,a.shape):null;if(l){const r=l.dataset.akFull;b&&r===void 0?(l.dataset.akFull=l.style.cssText,Object.assign(l.style,{left:"0px",top:"0px",width:"100%",height:"100%",transform:"none",zIndex:"1000"})):!b&&r!==void 0&&(l.style.cssText=r,delete l.dataset.akFull)}if(b){Math.abs(s.currentTime-h)>on&&(s.currentTime=h),s.paused&&(a.volume===0&&(s.muted=!0),an(s,a.volume>0));continue}s.pause(),o&&h>=a.length&&Ee.add(a.shape);const p=Ee.has(a.shape)?a.length:Math.max(a.begin===a.poster?0:a.begin,a.poster-(a.rest-t));Math.abs(s.currentTime-p)>1/z&&(s.currentTime=p)}},ft=(e,t)=>{const n=e.slide.transition;if(!n||!Xe(t,e.lead))return;const o=re;if(!o)return;Ie(o,o.part.still-o.part.start),o.el.style.visibility="visible";const a=Math.min(1,t/e.lead);if(n.type!=="morph"){const l=Tt(n,a),p=r=>{const P=r.x!==0||r.y!==0?`translate(${String(r.x*100)}%, ${String(r.y*100)}%)`:"",w=[r.scale===1?"":`scale(${String(r.scale)})`,r.rotate===0?"":`rotate(${String(r.rotate)}deg)`],k=r.clip;return{opacity:String(r.opacity),transform:[P,...w].filter($=>$!=="").join(" "),clipPath:r.polygon?`polygon(${r.polygon.map(([$,L])=>`${String($*100)}% ${String(L*100)}%`).join(", ")})`:k?`inset(${String(k.top*100)}% ${String(k.right*100)}% ${String(k.bottom*100)}% ${String(k.left*100)}%)`:""}};B(e.el,{...p(l.incoming),zIndex:l.outgoingOver?"0":"1"}),B(o.el,{...p(l.outgoing),zIndex:l.outgoingOver?"1":"0"}),l.black&&B(d,{background:"#000"});return}const s=new Map(o.slide.shapes.map(l=>[l.name,l]));B(e.el,{background:`color-mix(in srgb, ${getComputedStyle(e.el).backgroundColor} ${String(a*100)}%, transparent)`});const f=(l,p,r)=>{B(l,{left:`${String(r.left*x)}px`,top:`${String(r.top*x)}px`,width:`${String(r.width*x)}px`,height:`${String(r.height*x)}px`});const P=p.width>0?r.width/p.width:1,w=p.height>0?r.height/p.height:1;for(const k of l.querySelectorAll(":scope > svg:not([viewBox])"))B(k,{transformOrigin:"0 0",transform:`scale(${String(P)}, ${String(w)})`})},h=l=>JSON.stringify({...l,frame:void 0,sources:void 0}),b=new Map;for(const l of e.slide.shapes){const p=ye(e,l.name);if(!p)continue;const r=s.get(l.name);if(!r){B(p,{opacity:String(a)});continue}const P=Pt(r.frame,l.frame,a),w=h(r)===h(l);b.set(l.name,{frame:P,same:w}),f(p,l.frame,P),w||B(p,{opacity:String(a)})}for(const l of o.slide.shapes){const p=ye(o,l.name);if(!p)continue;const r=b.get(l.name);r?r.same?B(p,{visibility:"hidden"}):(f(p,l.frame,r.frame),B(p,{opacity:String(1-a)})):B(p,{opacity:String(1-a)})}},Ie=(e,t)=>{for(const n of e.targets){const o=e.slide.shapes.find(k=>k.name===n.shape),a=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${n.shape}`)}"]`);if(!o||!a)continue;const s=n.paragraph===void 0?a:a.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!s)continue;const f=qe.get(s)??{transform:s.style.transform,clipPath:s.style.clipPath};qe.set(s,f);const h={width:v.width,height:v.height},b=n.animations.filter(k=>k.iterate),l=n.animations.filter(k=>!k.iterate),p=Ve(l,t,o.frame,h),[r]=n.animations,P=r?.iterate!==void 0&&_t(r.effect)&&t<r.from-1e-6;He(s,P?{...p,hidden:!0}:p,f);const w=b[0]?.iterate?.by;if(w!==void 0)for(const[k,$]of ht(s,w).entries()){const L=Ve(b,t,o.frame,h,k);for(const j of $)He(j,L,{transform:"",clipPath:""})}}},He=(e,t,n)=>{e.style.visibility=t.hidden?"hidden":"",e.style.opacity=t.opacity===1?"":String(t.opacity);const o=t.x!==0||t.y!==0?`translate(${String(t.x*x)}px, ${String(t.y*x)}px)`:"",a=t.scale*t.sx,s=t.scale*t.sy,f=a===1&&s===1?"":a===s?`scale(${String(a)})`:`scale(${String(a)}, ${String(s)})`,h=t.rotate===0?"":`rotate(${String(t.rotate)}deg)`;e.style.transform=[o,f,h,n.transform].filter(b=>b!=="").join(" "),e.style.clipPath=t.polygon?`polygon(${t.polygon.map(([b,l])=>`${String(b*100)}% ${String(l*100)}%`).join(", ")})`:t.clip?`inset(${String(t.clip.top*100)}% ${String(t.clip.right*100)}% ${String(t.clip.bottom*100)}% ${String(t.clip.left*100)}%)`:n.clipPath},Be=new WeakMap,ht=(e,t)=>{const n=Be.get(e);if(n)return n.of;const o=[],a=e.matches("[data-ak-paragraph]")?[e]:[...e.querySelectorAll("[data-ak-paragraph]")];for(const s of a){const f=document.createTreeWalker(s,NodeFilter.SHOW_TEXT),h=[];for(;f.nextNode();)h.push(f.currentNode);const b=jt(h.map(p=>p.data),t),l=o.length;o.push(...b.map(()=>[])),h.forEach((p,r)=>{const P=b.flatMap((j,N)=>j.filter(c=>c.piece===r).map(c=>({...c,unit:N})));if(P.length===0)return;const w=rn(p.parentElement,s),k=document.createDocumentFragment();let $=0,L;for(const j of P){j.start>$&&(k.append(p.data.slice($,j.start)),L=void 0);const N=document.createElement("span");N.dataset.akUnit="",N.style.display="inline-block",w&&Object.assign(N.style,w),N.textContent=p.data.slice(j.start,j.end),o[l+j.unit]?.push(N),t==="letter"?(L||(L=document.createElement("span"),L.style.whiteSpace="nowrap",k.append(L)),L.append(N)):k.append(N),$=j.end}$<p.data.length&&k.append(p.data.slice($)),p.replaceWith(k)})}return Be.set(e,{by:t,of:o}),o},mt=(e,t)=>{if(t>0){const n=e.el.style.background;e.el.style.background="none",le.push(()=>{e.el.style.background=n})}for(const[n,o]of e.planes.entries())for(const a of n===t?[]:o){const s=a.style.visibility;a.style.visibility="hidden",le.push(()=>{a.style.visibility=s})}};let de;const X=async(e,t)=>{de={t:e,plane:t};const n=Math.min(Math.max(0,e),Me-1/z),o=lt(n);if(!o)return;const a=n-o.part.start,s=await ce(o),f=o.slide.transition&&Xe(a,o.clock.lead)?dt(o):void 0,h=f?await ce(f):void 0;if(de.t!==e)return;for(const l of H.values())l.el.style.visibility=l===s?"visible":"hidden";for(ee=s,re=h,W.setMoment(n,`${u.seedBase}:${s.slide.id}`);le.length>0;)le.pop()?.();Ie(s,a),ft(s,a),pt(s,a);const b=[];ve=b;try{for(const[l,p]of s.layers.entries())Q({phase:"render",part:s.slide.id,layer:p.layer.component,index:l,t:a},()=>{p.layer.render(p.el,Math.max(0,a-p.from),p.props,p.ctx)})}finally{ve=void 0}if(t!==void 0&&mt(s,t),await Promise.all([...b,s.pictures(Te*1e3),...h?[h.pictures(Te*1e3)]:[]]),Oe(),he){const l=M[M.indexOf(o)+1];l&&!H.has(l.slide.id)&&ce(l).then(Oe,()=>{})}},Ce=()=>ee,We=async e=>{await X(e);const t=Ce(),n=d.getBoundingClientRect(),o=n.width>0?D/n.width:1;return{m:t,blocks:t?Je(t.el,d,D):[],scale:o}},ut=()=>{const e=new Map,t=new Map,n=(f,h)=>{e.has(be(f))||e.set(be(f),h),t.set(be(f),(t.get(be(f))??new Set).add(f))},o=v.theme.fonts;for(const f of[o.major,o.minor,o.major_east_asian,o.minor_east_asian])n(f,"theme");for(const f of v.slides)for(const h of f.shapes){const b=[...h.text?.style.levels.map(l=>l.font.name)??[],...h.text?.paragraphs.flatMap(l=>[l.font?.name,...l.runs.map(p=>p.font?.name)])??[]];for(const l of b)l!==void 0&&!l.startsWith("+")&&n(l,"text")}const a=new Set(vt().map(f=>f.family)),s=f=>{const h=kt(f)[0]??f;return a.has(h)||xt(h)};return[...e].map(([f,h])=>({name:f,where:h,drawn:[...t.get(f)??[]].some(s)}))},gt=e=>{const t=e.text?.paragraphs[0],n=t?.alignment??e.text?.style.levels[t?.level??0]?.alignment;return n===void 0?{}:{align:n}},yt=(e,t)=>{const n=d.getBoundingClientRect(),o=n.width>0?D/n.width:1,a=[],s=[],f=[],h=[],b=[],l=[],p=x*Ze;return e.slide.shapes.forEach((r,P)=>{const w=e.el.querySelector(`[${G}="${CSS.escape(`${e.slide.id}/${r.name}`)}"]`);if(!w)return;const k=w.getBoundingClientRect(),$=[Math.round((k.left-n.left)*o),Math.round((k.top-n.top)*o),Math.round(k.width*o),Math.round(k.height*o)],L=getComputedStyle(w).visibility==="hidden",j=Je(w,d,D).filter(S=>S.ink!==null&&S.runs.some(g=>getComputedStyle(g.el).visibility!=="hidden")),N=j.map(S=>nt([...new Set(S.runs.map(g=>g.el))],d,D));j.forEach((S,g)=>{const _=N[g]??[],E=je(_);E&&(a.push({layer:r.name,z:"front",text:S.text,box:E,...S.opacity<1?{opacity:S.opacity}:{}}),s.push(P),f.push(S.containers),h.push(E),b.push(_))});const c={name:r.name,kind:Pe(r.geometry)?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*x),Math.round(r.frame.top*x),Math.round(r.frame.width*x),Math.round(r.frame.height*x)],box:$,...L?{hidden:L}:{},opaque:r.kind==="picture"||r.kind==="movie"||!Pe(r.geometry)&&r.fill!==void 0&&r.fill!==null},O=pn(r,x);if(O&&(c.ends=O),r.chart){const S=r.chart.series.flatMap(g=>g.values.filter(_=>_!==null));c.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...S.length>0?{low:Math.min(...S),high:Math.max(...S)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const S=[...w.querySelectorAll("tr")];c.rows=r.table.rows.map((g,_)=>({set:Math.round(g.height*x),drawn:Math.round((S[_]?.getBoundingClientRect().height??0)*o)}))}const A=N.flat();if(A.length>0){const S=new Map;for(const E of j)for(const R of E.runs){const F=getComputedStyle(R.el),T=Math.round(parseFloat(F.fontSize)/p*10)/10,K=parseInt(F.fontWeight,10)||400,ne=`${String(T)}/${String(K)}`;S.has(ne)||S.set(ne,{size:T,weight:K,...E.xHeight===void 0?{}:{xHeight:Math.round(E.xHeight/p*10)/10}})}const g=j.map(E=>E.text).join(`
|
|
4
|
+
`),_=w.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;if(c.text={text:g,words:Wt(g).words,lines:A,glyphs:je(A),type:[...S.values()],..._===void 0?{}:{scale:Number(_)},...gt(r)},r.rotation!==void 0){const E=w.style.transform;w.style.transform="none";const R=w.getBoundingClientRect(),F=j.flatMap(T=>nt([...new Set(T.runs.map(K=>K.el))],d,D));w.style.transform=E,c.text.own={box:[Math.round((R.left-n.left)*o),Math.round((R.top-n.top)*o),Math.round(R.width*o),Math.round(R.height*o)],glyphs:je(F),lines:F}}}const q=w.querySelector("img");if(q&&q.naturalWidth>0){const S=r.media?.crop??{left:0,top:0,right:0,bottom:0},g=(_,E)=>1-Math.max(0,_)-Math.max(0,E);c.picture={source:[q.naturalWidth,q.naturalHeight],shown:[Math.round(q.naturalWidth*g(S.left,S.right)),Math.round(q.naturalHeight*g(S.top,S.bottom))]}}l.push(c)}),{moment:Gt({t,part:e.slide.id,texts:a,safe:at,width:D,height:I,owner:s,containers:f,seen:h,glyphs:b}),slide:{slide:e.slide.id,steps:e.part.steps?.length??1,t,layout:e.slide.layout,hidden:e.slide.hidden,...e.slide.notes===void 0?{}:{notes:e.slide.notes},shapes:l}}},ze=e=>JSON.stringify(e.map(t=>[t.part.key,t.part.start,t.part.end,t.part.still,t.part.steps,t.part.hidden,t.part.layers,t.footage])),te={kind:"slides",get timeline(){return Le},async ready(){await X(M[0]?.part.still??0)},summary:()=>Yt(te),seek:(e,t)=>X(e,t?.plane),async update(e,t){for(const[s,f]of Object.entries(t??{}))_e.set(s,f);const n=v;v=e;const o=Fe(e);if(e.width!==n.width||e.height!==n.height||ze(o)!==ze(M))return v=n,{redrawn:[],reload:!0};const a=[];M=o.map((s,f)=>{const h=M[f];return h?.sign===s.sign?h:(a.push(s.slide.id),s)}),Le.parts=M.map(s=>s.part),ie();for(const s of[...H.values()])Ae(s.slide.id)!==s.slot&&ge(s);return de&&a.length>0&&await X(de.t,de.plane),{redrawn:a}},sheet:()=>ee?.el,words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>M.map(({slide:e})=>({key:e.id,...e.notes===void 0?{}:{notes:e.notes},onScreen:e.shapes.flatMap(t=>t.text&&!t.text.empty?[t.text.paragraphs.map(n=>n.runs.map(o=>o.text).join("")).join(`
|
|
5
|
+
`)]:[])})),reads:()=>{const e=m.reads(Y,M.map(n=>n.slide.id)),t=(n,o)=>[...new Map(n.map(a=>[o(a),a])).values()];return ot(Se,xe).reduce((n,{reads:o})=>({messages:t([...n.messages,...o.messages],a=>a.key),media:t([...n.media,...o.media],a=>a.path),data:t([...n.data,...o.data],a=>a.path)}),e)},problems:()=>[...m.problems,...C.problems,...m.translationProblems(),...ot(Se,xe).flatMap(({path:e,problems:t})=>t.map(n=>({...n,message:`In ${e}: ${n.message}`})))],stuck:()=>{},seekLimit:Te,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(M.map(e=>[e.slide.id,JSON.stringify({slide:JSON.parse(e.sign),width:D})])),mixPlan:()=>({duration:Me,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(e){const t=[],n=[];for(const o of e??M.flatMap(a=>a.part.steps??[a.part.still])){await X(o);const a=Ce();if(!a)continue;const s=yt(a,o);t.push(s.moment),n.push(s.slide)}return{width:D,height:I,deck:{pxPerPt:x*Ze,slides:n,fonts:ut()},safe:at,moments:t,footage:[]}},tracks:()=>Promise.resolve([]),async deck(){const e={};for(const t of M){const n=await ce(t);for(const o of n.el.querySelectorAll("[data-ak-font-scale]")){const a=o.closest(`[${G}]`)?.getAttribute(G),s=Number(o.dataset.akFontScale);a&&s<1&&(e[a]=s)}Oe()}return{width:v.width,height:v.height,theme:v.theme,masters:J.masters,slides:v.slides,...ke.size>0?{items:Object.fromEntries(ke)}:{},fitted:e,...ue===void 0?{}:{lang:ue}}},async inks(e){const{blocks:t,scale:n}=await We(e);return t.flatMap(o=>o.ink===null?[]:[{text:{layer:"slide",z:"front",text:o.text,box:o.box},...bt(o,n)}])},async objects(e){const{m:t,blocks:n}=await We(e),o=d.getBoundingClientRect(),a=o.width>0?D/o.width:1;return{t:e,elements:t?[...t.el.querySelectorAll(`[${G}]`)].map(s=>{const f=s.getBoundingClientRect();return{id:s.getAttribute(G)??"",box:[(f.left-o.left)*a,(f.top-o.top)*a,f.width*a,f.height*a]}}):[],texts:n.map(s=>({text:s.text,box:[s.box[0],s.box[1],s.box[2],s.box[3]],size:s.size,keys:m.keysShowing(s.text)}))}},signature:()=>{const e=Ce();if(!(!e||e.el.querySelector("canvas, video, iframe")))return Ue(JSON.stringify(v.theme)+e.el.outerHTML)},async signatureAt(e){return await X(e),te.signature()},async partSignature(e,t){const n=Ae(e);if(!n)return{unknown:`no slide ${e}`};const o=[];for(const a of t){await X(a);const s=H.get(e);if(!s)return{unknown:`slide ${e} is not at ${String(a)}`};if(s.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};o.push(s.el.outerHTML)}return{sign:Ue(o.join(`
|
|
6
|
+
`)),owners:[...new Set(n.made.map(a=>a.layer.component))]}},ask:()=>Promise.resolve([]),play:async(e,t)=>At(te,e,t,await tn({source:i,options:{combo:u.combo,purpose:"play"},items:M.flatMap(n=>n.slide.shapes.flatMap(o=>o.kind==="item"&&o.item?[{path:o.item.path,at:n.part.start+n.clock.playsAt(o.name),begin:o.item.playback?.trim?.start,end:o.item.playback?.trim?.end,loop:o.item.playback?.loop===!0,until:n.part.end}]:[]))})),answer(e){return e.type!=="deck-update"?Ot(te,e):te.update(e.deck,e.media).then(t=>({type:"deck-updated",...t}))},dispose(){for(const e of[...H.values()])ge(e);d.replaceChildren()}};return te}const ln=i=>{const y=dn(i);return y===void 0?{}:{title:y}};function dn(i){const d=i.shapes.find(u=>u.placeholder?.type==="title"||u.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(u=>u.runs.map(m=>m.text).join("")).join(" ").trim();return d===void 0||d===""?void 0:d}export function stageContext(i){const y=d=>()=>{throw new Error(`${d} is a video's: a slide has no speech.`)};return{look:i.look,format:i.format,dims:{width:i.width,height:i.height,orient:i.width>i.height?"landscape":i.width<i.height?"portrait":"square",safe:{top:0,bottom:0,left:0,right:0}},combo:i.combo,dur:i.end-i.start,asset:i.asset,words:()=>[],at:y("ctx.at()"),layer:{start:0,end:i.end-i.start},wait:i.wait,report:i.report,captions:()=>[],face:()=>{},faces:()=>[],texts:()=>[],covered:[],content:[0,0,i.width,i.height],realTimers:Mt}}function pn(i,y){const d=i.frame,u=i.rotation??0;let m;if(Pe(i.geometry))m=Lt(d,i.flip,u);else{const W=i.path?.steps??[];if(W.length<2||W.some(Z=>Z.op==="close"))return;const D=W[0],I=W[W.length-1];if(!D||!I||D.op==="close"||I.op==="close")return;const oe=i.path?.w??0,U=i.path?.h??0,J=[d.left+d.width/2,d.top+d.height/2],Y=u*Math.PI/180,ae=(Z,fe)=>{let se=oe>0?Z/oe*d.width:0,v=U>0?fe/U*d.height:0;i.flip?.h&&(se=d.width-se),i.flip?.v&&(v=d.height-v);const x=d.left+se-J[0],ie=d.top+v-J[1];return[J[0]+x*Math.cos(Y)-ie*Math.sin(Y),J[1]+x*Math.sin(Y)+ie*Math.cos(Y)]};m=[ae(D.x,D.y),ae(I.x,I.y)]}const C=(W,D,I)=>({at:[Math.round(W[0]*y),Math.round(W[1]*y)],head:D??"none",...I===void 0?{}:{glued:I}});return[C(m[0],i.line_begin,i.connect?.begin?.shape),C(m[1],i.line_end,i.connect?.end?.shape)]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
const i="ak-slide-style";export const SLIDE_CSS=`
|
|
3
|
+
:where(.ak-slide) {
|
|
4
|
+
all: initial;
|
|
5
|
+
display: block;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
-webkit-font-smoothing: antialiased;
|
|
9
|
+
cursor: inherit;
|
|
10
|
+
}
|
|
11
|
+
:where(.ak-slide) :where(*:not(svg, svg *)),
|
|
12
|
+
:where(.ak-slide) :where(*:not(svg, svg *))::before,
|
|
13
|
+
:where(.ak-slide) :where(*:not(svg, svg *))::after {
|
|
14
|
+
all: revert;
|
|
15
|
+
box-sizing: border-box;
|
|
16
|
+
}
|
|
17
|
+
:where(.ak-slide) :where(*) { cursor: inherit; }
|
|
18
|
+
:where(.ak-slide) ::selection { background: var(--allyhub-pencil-select); }
|
|
19
|
+
:where(.ak-slide) [contenteditable] { outline: none; caret-color: auto; }
|
|
20
|
+
`;export function slideStyle(e=document){if(e.getElementById(i))return;const t=e.createElement("style");t.id=i,t.textContent=SLIDE_CSS,e.head.append(t)}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
import{declareAll as w}from"@allyhub/diagnostics";import{mapShape as k}from"@allyhub/formats";import{resolveMedia as E,resolveSource as x}from"@allyhub/piece";import{consoleLog as S,installConsole as b,locateLayers as v,pickLayer as L}from"@allyhub/piece/page";export function installStage(
|
|
2
|
+
import{declareAll as w}from"@allyhub/diagnostics";import{mapShape as k}from"@allyhub/formats";import{resolveMedia as E,resolveSource as x}from"@allyhub/piece";import{consoleLog as S,installConsole as b,locateLayers as v,pickLayer as L,registerRuntimes as M}from"@allyhub/piece/page";export function installStage(a,y){b(),w(y);const l=new URL("../",import.meta.url),s=e=>x(e,l),m=new Map(a.flatMap(e=>Object.entries(e.runtimes??{})));M(m);const u=a.find(e=>e.code)?.code,p=a.find(e=>e.componentStage)?.componentStage,d=e=>new Error(`No extension the stage was built with lends ${e}.`);let o,i;const g=()=>{const e=document.getElementById("ak-stage");if(!e)throw new Error("The stage page has no #ak-stage element.");return e},f={get output(){return o},async load(e,t){const n=s(e);o?.dispose(),o=void 0;const r=g(),h=n.kind===void 0?void 0:m.get(n.kind);if(!h)throw d(`a runtime for the kind ${n.kind??"(none given)"}`);const c=await h(n,t,r);return await c.ready(),o=c,c.summary()},console:()=>S(),code:(e,t)=>u?u(s(e),t):Promise.reject(d("code")),async component(e,t,n){const r=s(e);if(!p)throw d("a component stage");return i?.module!==r.module&&(i?.stage.dispose(),i={module:r.module,stage:await p(r,t,g())}),i.stage.draw(n)},locate:e=>v(document,k(e,({x:t,y:n})=>({x:t*innerWidth,y:n*innerHeight}))),pick:e=>{const t=L(document,{x:e.x*innerWidth,y:e.y*innerHeight});return t&&{...t,outline:t.outline.map(n=>n.map(r=>({x:r.x/innerWidth,y:r.y/innerHeight})))}},async play(e){const t=document.getElementById("ak-stage");if(!o||!t)throw new Error("Nothing is loaded to play.");if(!o.play)throw new Error(`What the kind ${o.kind} loads does not play.`);return o.play(t,{...e,...e.media?{media:E(e.media,l)}:{}})}};window.allyhub=f}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
#ak-stage *, #ak-stage *::before, #ak-stage *::after { box-sizing: border-box; }
|
|
19
19
|
</style>
|
|
20
20
|
<script type="module" src="runtime.js"></script>
|
|
21
|
-
<script type="module" src="stage.js"></script>
|
|
21
|
+
<script type="module" async src="stage.js"></script>
|
|
22
22
|
</head>
|
|
23
23
|
<body><div id="ak-stage"></div></body>
|
|
24
24
|
</html>
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
-
var allyhub=()=>window.allyhub,post=
|
|
3
|
-
`)[0]??"",fail=
|
|
2
|
+
var allyhub=()=>window.allyhub;function runtimeInstalled(){if(window.allyhub!==void 0)return Promise.resolve();const e=document.querySelector('script[src$="runtime.js"]');return e===null?Promise.reject(new Error("The stage has no runtime.")):new Promise((t,n)=>{e.addEventListener("load",()=>{t()},{once:!0}),e.addEventListener("error",()=>{n(new Error("The stage's runtime did not load."))},{once:!0})})}function preloadModulesOf(e){const t=new URL("../",location.href);for(const n of[e.module,...e.imports??[]]){const r=document.createElement("link");r.rel="modulepreload",r.href=new URL(n,t).href,document.head.append(r)}}var post=e=>{parent.postMessage({allyhub:!0,...e},"*")},firstLine=e=>String(e instanceof Error?e.message:e).split(`
|
|
3
|
+
`)[0]??"",fail=e=>{post({type:"error",message:firstLine(e)})},asked=e=>e.source===parent&&typeof e.data=="object"&&e.data!==null&&e.data.allyhub===!0,q=new URLSearchParams(location.search),value=e=>{const t=q.get(e);return t===null||t===""?void 0:t},optional=(e,t)=>t===void 0?{}:{[e]:t},number=e=>{const t=value(e),n=t===void 0?void 0:Number(t);return n!==void 0&&Number.isFinite(n)?n:void 0};function comboOf(e){return e===void 0||e==="default"?{}:Object.fromEntries(e.split(",").map(t=>{const n=t.indexOf("=");return[t.slice(0,n),t.slice(n+1)]}))}async function sourceOf(e){const t=encodeURIComponent(encodeURIComponent(e)),n=await fetch(new URL(`../build/sources/${t}.json`,location.href));if(!n.ok)throw new Error(`The piece ${e} is not built here.`);return await n.json()}async function player(e,t,n){const r=await e,u=await allyhub().load(r,t),p=allyhub().output;if(!p)throw new Error("Nothing loaded.");const i={...optional("t",number("t")),...optional("part",value("part")),...optional("offset",number("offset")),...optional("dur",number("dur"))},a={...n,size:r.format},c=Object.keys(a).sort().map(d=>`${d}=${a[d]??""}`).join(","),s={},l=[];addEventListener("message",d=>{if(!asked(d))return;const o=d.data,f=typeof o.type=="string"?p.answer?.({...o,type:o.type}):void 0;if(f){f.then(post,fail);return}if(o.type==="locate"){post({type:"located",id:o.id,layers:allyhub().locate(o.mark)});return}if(o.type==="pick"){const h=allyhub().pick(o.at);post({type:"picked",id:o.id,...h?{picked:h}:{}});return}if(typeof o.type!="string")return;const y={...o,type:o.type};s.control?s.control.command(y):l.push(y)});const m=await allyhub().play({media:r.media,seed:`${r.piece}:${u.kind}:${c}`,at:i,...value("chrome")==="0"?{chrome:!1}:{},post});s.control=m,value("play")==="1"&&m.command({type:"play"});for(const d of l.splice(0))m.command(d)}async function main(e){const t=comboOf(value("combo")),n=value("mode"),r=sourceOf(e);r.then(preloadModulesOf,()=>{});const u=Promise.all([r,runtimeInstalled()]).then(([i])=>i),p={combo:t,purpose:n==="component"?"render":"play"};if(n==="code"){const i=u.then(a=>allyhub().code(a,p));i.then(post,fail),addEventListener("message",a=>{if(!asked(a))return;const c=a.data.type;i.then(s=>{c===s.type&&post(s)},fail)});return}if(n==="component"){let i=u.then(()=>{},fail);addEventListener("message",a=>{if(!asked(a)||a.data.type!=="component")return;const c=a.data;i=i.then(()=>u).then(s=>allyhub().component(s,p,{name:String(c.name),props:c.props??{},width:Number(c.width),height:Number(c.height),t:Number(c.t)})).then(s=>{post({type:"component-ready",component:s})},fail)});return}await player(u,p,t)}var piece=value("piece");piece!==void 0&&main(piece).catch(e=>{const t=firstLine(e);document.body.style.cssText="margin:0;padding:16px;background:#141210;color:#fc9cbd;font:14px/1.5 system-ui,sans-serif",document.body.textContent=t,post({type:"error",message:t})});
|