allyhub 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (632) hide show
  1. package/dist/audio-text.js +1 -1
  2. package/dist/commands/add.js +2 -2
  3. package/dist/commands/cloud-tools.js +5 -5
  4. package/dist/commands/dev.js +1 -1
  5. package/dist/commands/frames/piece.js +1 -1
  6. package/dist/commands/frames/sheet.js +1 -1
  7. package/dist/commands/frames.js +8 -8
  8. package/dist/commands/index.js +1 -1
  9. package/dist/commands/inspect/common.js +1 -1
  10. package/dist/commands/inspect/layout.js +1 -1
  11. package/dist/commands/render.js +1 -1
  12. package/dist/commands/sheet.js +7 -7
  13. package/dist/commands/site.js +3 -2
  14. package/dist/commands/skills.js +3 -3
  15. package/dist/commands/slides.js +2 -2
  16. package/dist/node_modules/@allyhub-next/audio/dist/node/index.js +1 -1
  17. package/dist/node_modules/@allyhub-next/audio/dist/node/master.js +1 -1
  18. package/dist/node_modules/@allyhub-next/audio/package.json +1 -1
  19. package/dist/node_modules/@allyhub-next/browser/dist/html.js +1 -1
  20. package/dist/node_modules/@allyhub-next/browser/package.json +1 -1
  21. package/dist/node_modules/@allyhub-next/build/dist/content.d.ts +4 -0
  22. package/dist/node_modules/@allyhub-next/build/dist/content.js +1 -1
  23. package/dist/node_modules/@allyhub-next/build/dist/index.d.ts +2 -2
  24. package/dist/node_modules/@allyhub-next/build/dist/index.js +1 -1
  25. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.d.ts +2 -2
  26. package/dist/node_modules/@allyhub-next/build/dist/meta-worker.js +3 -3
  27. package/dist/node_modules/@allyhub-next/build/dist/move-refs.d.ts +1 -1
  28. package/dist/node_modules/@allyhub-next/build/dist/move-refs.js +1 -1
  29. package/dist/node_modules/@allyhub-next/build/dist/plugin.d.ts +12 -3
  30. package/dist/node_modules/@allyhub-next/build/dist/plugin.js +7 -6
  31. package/dist/node_modules/@allyhub-next/build/dist/prepare.d.ts +9 -5
  32. package/dist/node_modules/@allyhub-next/build/dist/prepare.js +2 -2
  33. package/dist/node_modules/@allyhub-next/build/dist/vite.d.ts +10 -0
  34. package/dist/node_modules/@allyhub-next/build/dist/vite.js +2 -2
  35. package/dist/node_modules/@allyhub-next/build/package.json +1 -1
  36. package/dist/node_modules/@allyhub-next/chart/dist/chart-xml.js +2 -2
  37. package/dist/node_modules/@allyhub-next/chart/dist/chart.d.ts +14 -5
  38. package/dist/node_modules/@allyhub-next/chart/dist/chart.js +1 -1
  39. package/dist/node_modules/@allyhub-next/chart/package.json +1 -1
  40. package/dist/node_modules/@allyhub-next/check/dist/check.js +3 -3
  41. package/dist/node_modules/@allyhub-next/check/package.json +1 -1
  42. package/dist/node_modules/@allyhub-next/cloud/dist/blobs.js +2 -0
  43. package/dist/node_modules/@allyhub-next/cloud/dist/call.js +4 -2
  44. package/dist/node_modules/@allyhub-next/cloud/dist/client.js +1 -1
  45. package/dist/node_modules/@allyhub-next/cloud/dist/errors.js +1 -1
  46. package/dist/node_modules/@allyhub-next/cloud/dist/hashes.js +2 -0
  47. package/dist/node_modules/@allyhub-next/cloud/dist/index.js +1 -1
  48. package/dist/node_modules/@allyhub-next/cloud/dist/sites.js +2 -0
  49. package/dist/node_modules/@allyhub-next/cloud/dist/voice.js +1 -1
  50. package/dist/node_modules/@allyhub-next/cloud/package.json +1 -1
  51. package/dist/node_modules/@allyhub-next/components/package.json +1 -1
  52. package/dist/node_modules/@allyhub-next/components/r/caption-subtitle.json +1 -1
  53. package/dist/node_modules/@allyhub-next/components/src/caption-subtitle.ts +54 -16
  54. package/dist/node_modules/@allyhub-next/dev-server/dist/background.js +1 -1
  55. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.js +1 -1
  56. package/dist/node_modules/@allyhub-next/dev-server/dist/fonts.js +2 -0
  57. package/dist/node_modules/@allyhub-next/dev-server/dist/index.js +1 -1
  58. package/dist/node_modules/@allyhub-next/dev-server/dist/live.js +1 -1
  59. package/dist/node_modules/@allyhub-next/dev-server/dist/project.js +1 -1
  60. package/dist/node_modules/@allyhub-next/dev-server/dist/reach.js +2 -0
  61. package/dist/node_modules/@allyhub-next/dev-server/dist/record.js +2 -0
  62. package/dist/node_modules/@allyhub-next/dev-server/dist/server.js +2 -2
  63. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.js +1 -1
  64. package/dist/node_modules/@allyhub-next/dev-server/dist/tree.js +2 -0
  65. package/dist/node_modules/@allyhub-next/dev-server/package.json +1 -1
  66. package/dist/node_modules/@allyhub-next/doc/package.json +1 -1
  67. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.js +1 -1
  68. package/dist/node_modules/@allyhub-next/export/dist/export.js +5 -5
  69. package/dist/node_modules/@allyhub-next/export/dist/index.js +1 -1
  70. package/dist/node_modules/@allyhub-next/export/package.json +1 -1
  71. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.d.ts +205 -0
  72. package/dist/node_modules/@allyhub-next/formats/dist/data/deck-code.js +2 -0
  73. package/dist/node_modules/@allyhub-next/formats/dist/data/script.d.ts +4 -1
  74. package/dist/node_modules/@allyhub-next/formats/dist/data/script.js +1 -1
  75. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +248 -18
  76. package/dist/node_modules/@allyhub-next/formats/dist/data/sheet.js +1 -1
  77. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.d.ts +1114 -91
  78. package/dist/node_modules/@allyhub-next/formats/dist/data/slides.js +1 -1
  79. package/dist/node_modules/@allyhub-next/formats/dist/data/website.d.ts +20 -0
  80. package/dist/node_modules/@allyhub-next/formats/dist/data/website.js +2 -0
  81. package/dist/node_modules/@allyhub-next/formats/dist/index.d.ts +4 -0
  82. package/dist/node_modules/@allyhub-next/formats/dist/index.js +1 -1
  83. package/dist/node_modules/@allyhub-next/formats/dist/items.d.ts +1 -1
  84. package/dist/node_modules/@allyhub-next/formats/dist/items.js +1 -1
  85. package/dist/node_modules/@allyhub-next/formats/dist/media-type.d.ts +3 -0
  86. package/dist/node_modules/@allyhub-next/formats/dist/media-type.js +2 -0
  87. package/dist/node_modules/@allyhub-next/formats/dist/schemas.d.ts +625 -30
  88. package/dist/node_modules/@allyhub-next/formats/dist/schemas.js +1 -1
  89. package/dist/node_modules/@allyhub-next/formats/dist/strict.d.ts +2 -0
  90. package/dist/node_modules/@allyhub-next/formats/dist/strict.js +1 -1
  91. package/dist/node_modules/@allyhub-next/formats/dist/zip.d.ts +17 -0
  92. package/dist/node_modules/@allyhub-next/formats/dist/zip.js +2 -0
  93. package/dist/node_modules/@allyhub-next/formats/package.json +2 -1
  94. package/dist/node_modules/@allyhub-next/measure/package.json +1 -1
  95. package/dist/node_modules/@allyhub-next/media/dist/index.d.ts +1 -1
  96. package/dist/node_modules/@allyhub-next/media/dist/index.js +1 -1
  97. package/dist/node_modules/@allyhub-next/media/dist/sheet.d.ts +2 -0
  98. package/dist/node_modules/@allyhub-next/media/dist/sheet.js +7 -7
  99. package/dist/node_modules/@allyhub-next/media/package.json +1 -1
  100. package/dist/node_modules/@allyhub-next/model/package.json +1 -1
  101. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.d.ts +31 -0
  102. package/dist/node_modules/@allyhub-next/ooxml/dist/brightness.js +2 -0
  103. package/dist/node_modules/@allyhub-next/ooxml/dist/color.d.ts +33 -0
  104. package/dist/node_modules/@allyhub-next/ooxml/dist/color.js +2 -0
  105. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.d.ts +13 -0
  106. package/dist/node_modules/@allyhub-next/ooxml/dist/enums.js +2 -0
  107. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.d.ts +79 -0
  108. package/dist/node_modules/@allyhub-next/ooxml/dist/ext.js +2 -0
  109. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.d.ts +132 -0
  110. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/enums.js +2 -0
  111. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.d.ts +28 -0
  112. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/presets.js +2 -0
  113. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.d.ts +4708 -0
  114. package/dist/node_modules/@allyhub-next/ooxml/dist/generated/spec.js +2 -0
  115. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.d.ts +57 -0
  116. package/dist/node_modules/@allyhub-next/ooxml/dist/geometry/index.js +2 -0
  117. package/dist/node_modules/@allyhub-next/ooxml/dist/index.d.ts +10 -0
  118. package/dist/node_modules/@allyhub-next/ooxml/dist/index.js +2 -0
  119. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.d.ts +12 -0
  120. package/dist/node_modules/@allyhub-next/ooxml/dist/mce.js +2 -0
  121. package/dist/node_modules/@allyhub-next/ooxml/dist/node.d.ts +111 -0
  122. package/dist/node_modules/@allyhub-next/ooxml/dist/node.js +2 -0
  123. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.d.ts +45 -0
  124. package/dist/node_modules/@allyhub-next/ooxml/dist/ns.js +2 -0
  125. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.d.ts +48 -0
  126. package/dist/node_modules/@allyhub-next/ooxml/dist/opc.js +2 -0
  127. package/dist/node_modules/@allyhub-next/ooxml/dist/report.d.ts +45 -0
  128. package/dist/node_modules/@allyhub-next/ooxml/dist/report.js +2 -0
  129. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.d.ts +28 -0
  130. package/dist/node_modules/@allyhub-next/ooxml/dist/xml.js +2 -0
  131. package/dist/node_modules/@allyhub-next/ooxml/package.json +26 -0
  132. package/dist/node_modules/@allyhub-next/project/dist/deck-keys.js +2 -0
  133. package/dist/node_modules/@allyhub-next/project/dist/deck-measure.js +2 -0
  134. package/dist/node_modules/@allyhub-next/project/dist/deck-pool.js +2 -0
  135. package/dist/node_modules/@allyhub-next/project/dist/index.js +1 -1
  136. package/dist/node_modules/@allyhub-next/project/dist/session.js +1 -1
  137. package/dist/node_modules/@allyhub-next/project/dist/stills.js +2 -0
  138. package/dist/node_modules/@allyhub-next/project/package.json +1 -1
  139. package/dist/node_modules/@allyhub-next/protocol/dist/account.d.ts +338 -0
  140. package/dist/node_modules/@allyhub-next/protocol/dist/account.js +2 -0
  141. package/dist/node_modules/@allyhub-next/protocol/dist/auth.d.ts +12 -13
  142. package/dist/node_modules/@allyhub-next/protocol/dist/auth.js +1 -1
  143. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.d.ts +35 -0
  144. package/dist/node_modules/@allyhub-next/protocol/dist/blobs.js +2 -0
  145. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +101 -32
  146. package/dist/node_modules/@allyhub-next/protocol/dist/cloud.js +1 -1
  147. package/dist/node_modules/@allyhub-next/protocol/dist/editor.d.ts +89 -5
  148. package/dist/node_modules/@allyhub-next/protocol/dist/editor.js +1 -1
  149. package/dist/node_modules/@allyhub-next/protocol/dist/files.d.ts +2 -2
  150. package/dist/node_modules/@allyhub-next/protocol/dist/index.d.ts +6 -0
  151. package/dist/node_modules/@allyhub-next/protocol/dist/index.js +1 -1
  152. package/dist/node_modules/@allyhub-next/protocol/dist/notes.d.ts +23 -0
  153. package/dist/node_modules/@allyhub-next/protocol/dist/notes.js +1 -1
  154. package/dist/node_modules/@allyhub-next/protocol/dist/open.d.ts +13 -0
  155. package/dist/node_modules/@allyhub-next/protocol/dist/open.js +2 -0
  156. package/dist/node_modules/@allyhub-next/protocol/dist/registry.d.ts +73 -59
  157. package/dist/node_modules/@allyhub-next/protocol/dist/registry.js +1 -1
  158. package/dist/node_modules/@allyhub-next/protocol/dist/routes.d.ts +1 -1
  159. package/dist/node_modules/@allyhub-next/protocol/dist/routes.js +1 -1
  160. package/dist/node_modules/@allyhub-next/protocol/dist/shares.d.ts +115 -0
  161. package/dist/node_modules/@allyhub-next/protocol/dist/shares.js +2 -0
  162. package/dist/node_modules/@allyhub-next/protocol/dist/sites.d.ts +293 -0
  163. package/dist/node_modules/@allyhub-next/protocol/dist/sites.js +2 -0
  164. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.d.ts +377 -0
  165. package/dist/node_modules/@allyhub-next/protocol/dist/snapshots.js +2 -0
  166. package/dist/node_modules/@allyhub-next/protocol/dist/teams.d.ts +27 -9
  167. package/dist/node_modules/@allyhub-next/protocol/dist/teams.js +1 -1
  168. package/dist/node_modules/@allyhub-next/protocol/dist/tools.d.ts +53 -14
  169. package/dist/node_modules/@allyhub-next/protocol/dist/tools.js +1 -1
  170. package/dist/node_modules/@allyhub-next/protocol/package.json +2 -1
  171. package/dist/node_modules/@allyhub-next/registry/package.json +1 -1
  172. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.js +3 -2
  173. package/dist/node_modules/@allyhub-next/render/dist/doc/index.js +1 -1
  174. package/dist/node_modules/@allyhub-next/render/dist/doc/pdf.js +34 -0
  175. package/dist/node_modules/@allyhub-next/render/dist/doc/print.js +4 -4
  176. package/dist/node_modules/@allyhub-next/render/dist/exports.js +2 -2
  177. package/dist/node_modules/@allyhub-next/render/dist/pdf.js +2 -0
  178. package/dist/node_modules/@allyhub-next/render/package.json +1 -1
  179. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.js +1 -1
  180. package/dist/node_modules/@allyhub-next/runtime/dist/music.js +1 -1
  181. package/dist/node_modules/@allyhub-next/runtime/package.json +1 -1
  182. package/dist/node_modules/@allyhub-next/runtimes/package.json +1 -1
  183. package/dist/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +25 -5
  184. package/dist/node_modules/@allyhub-next/scaffold/dist/index.js +4 -4
  185. package/dist/node_modules/@allyhub-next/scaffold/package.json +1 -1
  186. package/dist/node_modules/@allyhub-next/scenery/package.json +1 -1
  187. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.d.ts +10 -0
  188. package/dist/node_modules/@allyhub-next/scenery-host/dist/bundle.js +3 -3
  189. package/dist/node_modules/@allyhub-next/scenery-host/package.json +1 -1
  190. package/dist/node_modules/@allyhub-next/sheet/dist/api/capabilities.js +1 -1
  191. package/dist/node_modules/@allyhub-next/sheet/dist/api/index.d.ts +1 -0
  192. package/dist/node_modules/@allyhub-next/sheet/dist/api/index.js +1 -1
  193. package/dist/node_modules/@allyhub-next/sheet/dist/api/page.d.ts +83 -0
  194. package/dist/node_modules/@allyhub-next/sheet/dist/api/page.js +2 -0
  195. package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.d.ts +40 -1
  196. package/dist/node_modules/@allyhub-next/sheet/dist/api/workbook.js +1 -1
  197. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.d.ts +9 -3
  198. package/dist/node_modules/@allyhub-next/sheet/dist/calc/analyse.js +1 -1
  199. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.d.ts +5 -1
  200. package/dist/node_modules/@allyhub-next/sheet/dist/calc/coerce.js +1 -1
  201. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.d.ts +60 -13
  202. package/dist/node_modules/@allyhub-next/sheet/dist/calc/engine.js +1 -1
  203. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/aggregate.js +1 -1
  204. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.d.ts +4 -0
  205. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/convert.js +2 -0
  206. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/criteria.js +1 -1
  207. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/database.js +1 -1
  208. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/date.js +1 -1
  209. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.d.ts +27 -1
  210. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/define.js +1 -1
  211. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.d.ts +16 -0
  212. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/delimiters.js +2 -0
  213. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.d.ts +18 -1
  214. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/dynamic.js +1 -1
  215. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/finance.js +1 -1
  216. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.d.ts +2 -0
  217. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/index.js +1 -1
  218. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/info.js +1 -1
  219. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/kernels.js +1 -1
  220. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/logical.js +1 -1
  221. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/lookup.js +1 -1
  222. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/maths.js +1 -1
  223. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.d.ts +2 -0
  224. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/modern.js +2 -0
  225. package/dist/node_modules/@allyhub-next/sheet/dist/calc/functions/text.js +1 -1
  226. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.d.ts +38 -0
  227. package/dist/node_modules/@allyhub-next/sheet/dist/calc/graph.js +2 -0
  228. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.d.ts +19 -0
  229. package/dist/node_modules/@allyhub-next/sheet/dist/calc/indexes.js +2 -0
  230. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.d.ts +49 -0
  231. package/dist/node_modules/@allyhub-next/sheet/dist/calc/remote.js +2 -0
  232. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.d.ts +82 -0
  233. package/dist/node_modules/@allyhub-next/sheet/dist/calc/server.js +2 -0
  234. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.d.ts +6 -1
  235. package/dist/node_modules/@allyhub-next/sheet/dist/calc/types.js +1 -1
  236. package/dist/node_modules/@allyhub-next/sheet/dist/chart.js +1 -1
  237. package/dist/node_modules/@allyhub-next/sheet/dist/check.js +1 -1
  238. package/dist/node_modules/@allyhub-next/sheet/dist/diff.d.ts +15 -0
  239. package/dist/node_modules/@allyhub-next/sheet/dist/diff.js +1 -1
  240. package/dist/node_modules/@allyhub-next/sheet/dist/export.d.ts +29 -8
  241. package/dist/node_modules/@allyhub-next/sheet/dist/export.js +3 -4
  242. package/dist/node_modules/@allyhub-next/sheet/dist/file.js +2 -2
  243. package/dist/node_modules/@allyhub-next/sheet/dist/format.d.ts +8 -2
  244. package/dist/node_modules/@allyhub-next/sheet/dist/format.js +1 -1
  245. package/dist/node_modules/@allyhub-next/sheet/dist/html.d.ts +52 -4
  246. package/dist/node_modules/@allyhub-next/sheet/dist/html.js +43 -11
  247. package/dist/node_modules/@allyhub-next/sheet/dist/index.d.ts +7 -3
  248. package/dist/node_modules/@allyhub-next/sheet/dist/index.js +1 -1
  249. package/dist/node_modules/@allyhub-next/sheet/dist/inspect.js +1 -1
  250. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.d.ts +98 -0
  251. package/dist/node_modules/@allyhub-next/sheet/dist/paginate.js +2 -0
  252. package/dist/node_modules/@allyhub-next/sheet/dist/structure.js +1 -1
  253. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.d.ts +32 -0
  254. package/dist/node_modules/@allyhub-next/sheet/dist/table-style.js +2 -0
  255. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.d.ts +3 -0
  256. package/dist/node_modules/@allyhub-next/sheet/dist/table-styles.js +2 -0
  257. package/dist/node_modules/@allyhub-next/sheet/dist/values.js +1 -1
  258. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.d.ts +10 -1
  259. package/dist/node_modules/@allyhub-next/sheet/dist/workbook.js +1 -1
  260. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.d.ts +12 -1
  261. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/charts.js +1 -1
  262. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.d.ts +14 -4
  263. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/formula.js +2 -2
  264. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.d.ts +11 -1
  265. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/functions.js +36 -16
  266. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.d.ts +6 -1
  267. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/import.js +1 -1
  268. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.d.ts +44 -2
  269. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/read.js +2 -1
  270. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.d.ts +23 -0
  271. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/sax.js +2 -0
  272. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.d.ts +2 -0
  273. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/styles.js +1 -1
  274. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.d.ts +6 -0
  275. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/write.js +1 -1
  276. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.d.ts +40 -0
  277. package/dist/node_modules/@allyhub-next/sheet/dist/xlsx/zip.js +2 -0
  278. package/dist/node_modules/@allyhub-next/sheet/package.json +1 -1
  279. package/dist/node_modules/@allyhub-next/slides-core/dist/animation.js +1 -1
  280. package/dist/node_modules/@allyhub-next/slides-core/dist/api.d.ts +121 -44
  281. package/dist/node_modules/@allyhub-next/slides-core/dist/api.js +2 -2
  282. package/dist/node_modules/@allyhub-next/slides-core/dist/capabilities.js +1 -1
  283. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.d.ts +50 -13
  284. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-api.js +1 -1
  285. package/dist/node_modules/@allyhub-next/slides-core/dist/chart-file.js +1 -1
  286. package/dist/node_modules/@allyhub-next/slides-core/dist/check.js +1 -1
  287. package/dist/node_modules/@allyhub-next/slides-core/dist/code.d.ts +33 -0
  288. package/dist/node_modules/@allyhub-next/slides-core/dist/code.js +2 -0
  289. package/dist/node_modules/@allyhub-next/slides-core/dist/components.d.ts +31 -0
  290. package/dist/node_modules/@allyhub-next/slides-core/dist/components.js +2 -0
  291. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.d.ts +188 -5
  292. package/dist/node_modules/@allyhub-next/slides-core/dist/enums.js +1 -1
  293. package/dist/node_modules/@allyhub-next/slides-core/dist/file.d.ts +43 -21
  294. package/dist/node_modules/@allyhub-next/slides-core/dist/file.js +3 -3
  295. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.d.ts +17 -0
  296. package/dist/node_modules/@allyhub-next/slides-core/dist/identity.js +2 -0
  297. package/dist/node_modules/@allyhub-next/slides-core/dist/index.d.ts +5 -0
  298. package/dist/node_modules/@allyhub-next/slides-core/dist/index.js +1 -1
  299. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.d.ts +6 -0
  300. package/dist/node_modules/@allyhub-next/slides-core/dist/lang.js +2 -0
  301. package/dist/node_modules/@allyhub-next/slides-core/dist/measure.js +1 -1
  302. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.d.ts +58 -0
  303. package/dist/node_modules/@allyhub-next/slides-core/dist/merge.js +2 -0
  304. package/dist/node_modules/@allyhub-next/slides-core/dist/model.d.ts +38 -4
  305. package/dist/node_modules/@allyhub-next/slides-core/dist/office.d.ts +27 -1
  306. package/dist/node_modules/@allyhub-next/slides-core/dist/office.js +1 -1
  307. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.d.ts +26 -5
  308. package/dist/node_modules/@allyhub-next/slides-core/dist/resolve.js +1 -1
  309. package/dist/node_modules/@allyhub-next/slides-core/dist/script.d.ts +18 -16
  310. package/dist/node_modules/@allyhub-next/slides-core/dist/script.js +2 -2
  311. package/dist/node_modules/@allyhub-next/slides-core/dist/stage.d.ts +51 -53
  312. package/dist/node_modules/@allyhub-next/slides-core/dist/strict.js +1 -1
  313. package/dist/node_modules/@allyhub-next/slides-core/dist/units.d.ts +27 -0
  314. package/dist/node_modules/@allyhub-next/slides-core/dist/units.js +1 -1
  315. package/dist/node_modules/@allyhub-next/slides-core/dist/values.d.ts +7 -0
  316. package/dist/node_modules/@allyhub-next/slides-core/dist/values.js +2 -0
  317. package/dist/node_modules/@allyhub-next/slides-core/package.json +1 -1
  318. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.js +1 -1
  319. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/code.js +4 -0
  320. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/index.js +3 -0
  321. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/names.js +2 -0
  322. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import/script.js +2 -0
  323. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.js +1 -1
  324. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/chart.js +2 -0
  325. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/common.js +2 -0
  326. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/index.js +4 -0
  327. package/dist/{site.js → node_modules/@allyhub-next/slides-pptx/dist/read/model.js} +1 -1
  328. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/shapes.js +2 -0
  329. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/table.js +2 -0
  330. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/text.js +2 -0
  331. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read/timing.js +2 -0
  332. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.js +1 -1
  333. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.js +1 -1
  334. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.js +1 -1
  335. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.js +1 -1
  336. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.js +2 -2
  337. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.js +2 -2
  338. package/dist/node_modules/@allyhub-next/slides-pptx/package.json +1 -1
  339. package/dist/node_modules/@allyhub-next/slides-runtime/dist/component.js +2 -0
  340. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.js +2 -2
  341. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.js +1 -1
  342. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.js +5 -5
  343. package/dist/node_modules/@allyhub-next/slides-runtime/package.json +5 -1
  344. package/dist/node_modules/@allyhub-next/stage/dist/graphics.js +1 -1
  345. package/dist/node_modules/@allyhub-next/stage/dist/index.js +1 -1
  346. package/dist/node_modules/@allyhub-next/stage/dist/page.js +22 -12
  347. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.js +5 -5
  348. package/dist/node_modules/@allyhub-next/stage/dist/server.js +1 -1
  349. package/dist/node_modules/@allyhub-next/stage/package.json +1 -1
  350. package/dist/node_modules/@allyhub-next/stage-page/dist/host.js +1 -20
  351. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/probe.html +8 -0
  352. package/dist/{astro.js → node_modules/@allyhub-next/stage-page/dist/runtime/probe.js} +1 -1
  353. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/runtime.js +79 -0
  354. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.html +21 -0
  355. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/stage.js +3 -0
  356. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.html +9 -0
  357. package/dist/node_modules/@allyhub-next/stage-page/dist/runtime/viewer.js +3 -0
  358. package/dist/node_modules/@allyhub-next/stage-page/package.json +2 -3
  359. package/dist/node_modules/@allyhub-next/video-core/dist/captions.js +6 -6
  360. package/dist/node_modules/@allyhub-next/video-core/dist/fact.d.ts +47 -8
  361. package/dist/node_modules/@allyhub-next/video-core/dist/fact.js +1 -1
  362. package/dist/node_modules/@allyhub-next/video-core/dist/index.d.ts +1 -0
  363. package/dist/node_modules/@allyhub-next/video-core/dist/index.js +1 -1
  364. package/dist/node_modules/@allyhub-next/video-core/dist/marks.d.ts +14 -0
  365. package/dist/node_modules/@allyhub-next/video-core/dist/marks.js +1 -1
  366. package/dist/node_modules/@allyhub-next/video-core/dist/music.d.ts +2 -1
  367. package/dist/node_modules/@allyhub-next/video-core/dist/piece.d.ts +11 -2
  368. package/dist/node_modules/@allyhub-next/video-core/dist/problem.d.ts +4 -0
  369. package/dist/node_modules/@allyhub-next/video-core/dist/problem.js +1 -1
  370. package/dist/node_modules/@allyhub-next/video-core/dist/schema.d.ts +2 -2
  371. package/dist/node_modules/@allyhub-next/video-core/dist/schema.js +1 -1
  372. package/dist/node_modules/@allyhub-next/video-core/dist/script.d.ts +2 -1
  373. package/dist/node_modules/@allyhub-next/video-core/dist/script.js +1 -1
  374. package/dist/node_modules/@allyhub-next/video-core/dist/source.d.ts +7 -0
  375. package/dist/node_modules/@allyhub-next/video-core/dist/source.js +2 -0
  376. package/dist/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +10 -33
  377. package/dist/node_modules/@allyhub-next/video-core/package.json +1 -1
  378. package/dist/node_modules/@allyhub-next/website/LICENSE +241 -0
  379. package/dist/node_modules/@allyhub-next/website/dist/index.js +2 -0
  380. package/dist/node_modules/@allyhub-next/website/dist/publish.js +3 -0
  381. package/dist/node_modules/@allyhub-next/website/dist/rules.js +2 -0
  382. package/dist/node_modules/@allyhub-next/website/dist/website.js +4 -0
  383. package/dist/node_modules/@allyhub-next/website/package.json +13 -0
  384. package/dist/text/facts-text.js +4 -4
  385. package/dist/works.js +1 -1
  386. package/editor-web/assets/calc-worker-Bz9r26p1.js +158 -0
  387. package/editor-web/assets/dist-0emakyZE.js +36 -0
  388. package/editor-web/assets/dist-B3UoDUa5.js +37 -0
  389. package/editor-web/assets/dist-B6KzR3pN.js +10 -0
  390. package/editor-web/assets/dist-Bc5iA5k1.js +1 -0
  391. package/editor-web/assets/dist-CTQIm8Im.js +10 -0
  392. package/editor-web/assets/dist-CiHNHwyq.js +2 -0
  393. package/editor-web/assets/dist-DNZ8PQ-E.js +224 -0
  394. package/editor-web/assets/index-CFt3ovRY.js +69 -0
  395. package/editor-web/assets/index-ujKjdu_s.css +2 -0
  396. package/editor-web/assets/minus-BhoPZC5P.js +1 -0
  397. package/editor-web/assets/react-C_-rEEBU.js +101 -0
  398. package/editor-web/assets/tabs-Den4gHrU.js +105 -0
  399. package/editor-web/assets/text-align-start-CsW4nqqL.js +1 -0
  400. package/editor-web/index.html +5 -5
  401. package/package.json +8 -14
  402. package/dist/astro.d.ts +0 -2
  403. package/dist/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +0 -52
  404. package/dist/node_modules/@allyhub-next/audio/dist/decode.d.ts +0 -33
  405. package/dist/node_modules/@allyhub-next/audio/dist/envelope.d.ts +0 -37
  406. package/dist/node_modules/@allyhub-next/audio/dist/index.d.ts +0 -17
  407. package/dist/node_modules/@allyhub-next/audio/dist/levels.d.ts +0 -97
  408. package/dist/node_modules/@allyhub-next/audio/dist/master.d.ts +0 -29
  409. package/dist/node_modules/@allyhub-next/audio/dist/music.d.ts +0 -11
  410. package/dist/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +0 -39
  411. package/dist/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +0 -25
  412. package/dist/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +0 -31
  413. package/dist/node_modules/@allyhub-next/audio/dist/node/index.d.ts +0 -8
  414. package/dist/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +0 -18
  415. package/dist/node_modules/@allyhub-next/audio/dist/node/master.d.ts +0 -42
  416. package/dist/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +0 -60
  417. package/dist/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +0 -31
  418. package/dist/node_modules/@allyhub-next/audio/dist/plan.d.ts +0 -143
  419. package/dist/node_modules/@allyhub-next/audio/dist/recorded.d.ts +0 -26
  420. package/dist/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +0 -47
  421. package/dist/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +0 -89
  422. package/dist/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +0 -64
  423. package/dist/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +0 -26
  424. package/dist/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +0 -42
  425. package/dist/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +0 -56
  426. package/dist/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +0 -10
  427. package/dist/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +0 -12
  428. package/dist/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +0 -67
  429. package/dist/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +0 -32
  430. package/dist/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +0 -27
  431. package/dist/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +0 -64
  432. package/dist/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +0 -78
  433. package/dist/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +0 -111
  434. package/dist/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +0 -3
  435. package/dist/node_modules/@allyhub-next/audio/dist/render.d.ts +0 -26
  436. package/dist/node_modules/@allyhub-next/audio/dist/sfx.d.ts +0 -10
  437. package/dist/node_modules/@allyhub-next/audio/dist/shape.d.ts +0 -118
  438. package/dist/node_modules/@allyhub-next/audio/dist/voice.d.ts +0 -45
  439. package/dist/node_modules/@allyhub-next/browser/dist/browser.d.ts +0 -24
  440. package/dist/node_modules/@allyhub-next/browser/dist/capture.d.ts +0 -61
  441. package/dist/node_modules/@allyhub-next/browser/dist/cdp.d.ts +0 -51
  442. package/dist/node_modules/@allyhub-next/browser/dist/flags.d.ts +0 -13
  443. package/dist/node_modules/@allyhub-next/browser/dist/frames.d.ts +0 -35
  444. package/dist/node_modules/@allyhub-next/browser/dist/html.d.ts +0 -19
  445. package/dist/node_modules/@allyhub-next/browser/dist/index.d.ts +0 -10
  446. package/dist/node_modules/@allyhub-next/browser/dist/launch.d.ts +0 -35
  447. package/dist/node_modules/@allyhub-next/browser/dist/page.d.ts +0 -67
  448. package/dist/node_modules/@allyhub-next/browser/dist/server.d.ts +0 -26
  449. package/dist/node_modules/@allyhub-next/check/dist/cache.d.ts +0 -46
  450. package/dist/node_modules/@allyhub-next/check/dist/check.d.ts +0 -142
  451. package/dist/node_modules/@allyhub-next/check/dist/generated.d.ts +0 -22
  452. package/dist/node_modules/@allyhub-next/check/dist/index.d.ts +0 -7
  453. package/dist/node_modules/@allyhub-next/check/dist/plans.d.ts +0 -111
  454. package/dist/node_modules/@allyhub-next/check/dist/result.d.ts +0 -12
  455. package/dist/node_modules/@allyhub-next/check/dist/scenery.d.ts +0 -23
  456. package/dist/node_modules/@allyhub-next/dev-server/dist/background.d.ts +0 -50
  457. package/dist/node_modules/@allyhub-next/dev-server/dist/card.d.ts +0 -17
  458. package/dist/node_modules/@allyhub-next/dev-server/dist/exports.d.ts +0 -18
  459. package/dist/node_modules/@allyhub-next/dev-server/dist/index.d.ts +0 -11
  460. package/dist/node_modules/@allyhub-next/dev-server/dist/live.d.ts +0 -77
  461. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.d.ts +0 -2
  462. package/dist/node_modules/@allyhub-next/dev-server/dist/mime.js +0 -2
  463. package/dist/node_modules/@allyhub-next/dev-server/dist/paths.d.ts +0 -27
  464. package/dist/node_modules/@allyhub-next/dev-server/dist/project.d.ts +0 -153
  465. package/dist/node_modules/@allyhub-next/dev-server/dist/reveal.d.ts +0 -6
  466. package/dist/node_modules/@allyhub-next/dev-server/dist/server.d.ts +0 -47
  467. package/dist/node_modules/@allyhub-next/dev-server/dist/sound.d.ts +0 -21
  468. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.d.ts +0 -82
  469. package/dist/node_modules/@allyhub-next/dev-server/dist/stage.js +0 -121
  470. package/dist/node_modules/@allyhub-next/dev-server/dist/tools.d.ts +0 -24
  471. package/dist/node_modules/@allyhub-next/dev-server/dist/validate.d.ts +0 -6
  472. package/dist/node_modules/@allyhub-next/dev-server/dist/watcher.d.ts +0 -47
  473. package/dist/node_modules/@allyhub-next/dev-server/dist/writer.d.ts +0 -51
  474. package/dist/node_modules/@allyhub-next/export/dist/batch.d.ts +0 -70
  475. package/dist/node_modules/@allyhub-next/export/dist/deck-fonts.d.ts +0 -24
  476. package/dist/node_modules/@allyhub-next/export/dist/deck-pptx.d.ts +0 -12
  477. package/dist/node_modules/@allyhub-next/export/dist/export.d.ts +0 -123
  478. package/dist/node_modules/@allyhub-next/export/dist/index.d.ts +0 -5
  479. package/dist/node_modules/@allyhub-next/export/dist/names.d.ts +0 -36
  480. package/dist/node_modules/@allyhub-next/measure/dist/compare.d.ts +0 -195
  481. package/dist/node_modules/@allyhub-next/measure/dist/contrast.d.ts +0 -14
  482. package/dist/node_modules/@allyhub-next/measure/dist/cut-sheet.d.ts +0 -90
  483. package/dist/node_modules/@allyhub-next/measure/dist/cuts.d.ts +0 -108
  484. package/dist/node_modules/@allyhub-next/measure/dist/facts.d.ts +0 -60
  485. package/dist/node_modules/@allyhub-next/measure/dist/fidelity.d.ts +0 -40
  486. package/dist/node_modules/@allyhub-next/measure/dist/flat.d.ts +0 -42
  487. package/dist/node_modules/@allyhub-next/measure/dist/index.d.ts +0 -24
  488. package/dist/node_modules/@allyhub-next/measure/dist/loop.d.ts +0 -22
  489. package/dist/node_modules/@allyhub-next/measure/dist/overlay.d.ts +0 -57
  490. package/dist/node_modules/@allyhub-next/measure/dist/recording-report.d.ts +0 -66
  491. package/dist/node_modules/@allyhub-next/measure/dist/reference/compare.d.ts +0 -118
  492. package/dist/node_modules/@allyhub-next/measure/dist/reference/folder.d.ts +0 -75
  493. package/dist/node_modules/@allyhub-next/measure/dist/reference/interpret.d.ts +0 -39
  494. package/dist/node_modules/@allyhub-next/measure/dist/reference/piece.d.ts +0 -53
  495. package/dist/node_modules/@allyhub-next/measure/dist/reference/sections.d.ts +0 -53
  496. package/dist/node_modules/@allyhub-next/measure/dist/reference/sets.d.ts +0 -84
  497. package/dist/node_modules/@allyhub-next/measure/dist/reference/text.d.ts +0 -27
  498. package/dist/node_modules/@allyhub-next/measure/dist/reference/video.d.ts +0 -55
  499. package/dist/node_modules/@allyhub-next/measure/dist/seams.d.ts +0 -46
  500. package/dist/node_modules/@allyhub-next/measure/dist/sound-measures.d.ts +0 -74
  501. package/dist/node_modules/@allyhub-next/measure/dist/sound-report.d.ts +0 -156
  502. package/dist/node_modules/@allyhub-next/measure/dist/still.d.ts +0 -58
  503. package/dist/node_modules/@allyhub-next/measure/dist/version-voice.d.ts +0 -12
  504. package/dist/node_modules/@allyhub-next/project/dist/console.d.ts +0 -34
  505. package/dist/node_modules/@allyhub-next/project/dist/digest.d.ts +0 -9
  506. package/dist/node_modules/@allyhub-next/project/dist/index.d.ts +0 -11
  507. package/dist/node_modules/@allyhub-next/project/dist/ledger.d.ts +0 -17
  508. package/dist/node_modules/@allyhub-next/project/dist/media-index.d.ts +0 -27
  509. package/dist/node_modules/@allyhub-next/project/dist/page.d.ts +0 -119
  510. package/dist/node_modules/@allyhub-next/project/dist/says.d.ts +0 -15
  511. package/dist/node_modules/@allyhub-next/project/dist/scenery.d.ts +0 -35
  512. package/dist/node_modules/@allyhub-next/project/dist/session.d.ts +0 -37
  513. package/dist/node_modules/@allyhub-next/project/dist/stretch.d.ts +0 -38
  514. package/dist/node_modules/@allyhub-next/project/dist/version.d.ts +0 -114
  515. package/dist/node_modules/@allyhub-next/render/dist/cap.d.ts +0 -41
  516. package/dist/node_modules/@allyhub-next/render/dist/capture.d.ts +0 -78
  517. package/dist/node_modules/@allyhub-next/render/dist/clip.d.ts +0 -27
  518. package/dist/node_modules/@allyhub-next/render/dist/composite.d.ts +0 -106
  519. package/dist/node_modules/@allyhub-next/render/dist/delivery.d.ts +0 -18
  520. package/dist/node_modules/@allyhub-next/render/dist/doc/fonts.d.ts +0 -3
  521. package/dist/node_modules/@allyhub-next/render/dist/doc/index.d.ts +0 -3
  522. package/dist/node_modules/@allyhub-next/render/dist/doc/print.d.ts +0 -51
  523. package/dist/node_modules/@allyhub-next/render/dist/encode.d.ts +0 -111
  524. package/dist/node_modules/@allyhub-next/render/dist/errors.d.ts +0 -15
  525. package/dist/node_modules/@allyhub-next/render/dist/exports.d.ts +0 -76
  526. package/dist/node_modules/@allyhub-next/render/dist/ffmpeg.d.ts +0 -75
  527. package/dist/node_modules/@allyhub-next/render/dist/footage.d.ts +0 -169
  528. package/dist/node_modules/@allyhub-next/render/dist/image.d.ts +0 -16
  529. package/dist/node_modules/@allyhub-next/render/dist/index.d.ts +0 -26
  530. package/dist/node_modules/@allyhub-next/render/dist/junction.d.ts +0 -70
  531. package/dist/node_modules/@allyhub-next/render/dist/look.d.ts +0 -21
  532. package/dist/node_modules/@allyhub-next/render/dist/page.d.ts +0 -186
  533. package/dist/node_modules/@allyhub-next/render/dist/parts.d.ts +0 -140
  534. package/dist/node_modules/@allyhub-next/render/dist/png.d.ts +0 -37
  535. package/dist/node_modules/@allyhub-next/render/dist/pool.d.ts +0 -54
  536. package/dist/node_modules/@allyhub-next/render/dist/post-probe.d.ts +0 -27
  537. package/dist/node_modules/@allyhub-next/render/dist/post.d.ts +0 -27
  538. package/dist/node_modules/@allyhub-next/render/dist/render.d.ts +0 -151
  539. package/dist/node_modules/@allyhub-next/render/dist/segments.d.ts +0 -40
  540. package/dist/node_modules/@allyhub-next/render/dist/sound.d.ts +0 -24
  541. package/dist/node_modules/@allyhub-next/render/dist/stills.d.ts +0 -41
  542. package/dist/node_modules/@allyhub-next/render/dist/tools.d.ts +0 -25
  543. package/dist/node_modules/@allyhub-next/render/dist/webp.d.ts +0 -17
  544. package/dist/node_modules/@allyhub-next/runtime/dist/bridge.d.ts +0 -211
  545. package/dist/node_modules/@allyhub-next/runtime/dist/captions.d.ts +0 -24
  546. package/dist/node_modules/@allyhub-next/runtime/dist/clock.d.ts +0 -32
  547. package/dist/node_modules/@allyhub-next/runtime/dist/compose.d.ts +0 -149
  548. package/dist/node_modules/@allyhub-next/runtime/dist/console.d.ts +0 -21
  549. package/dist/node_modules/@allyhub-next/runtime/dist/contrast.d.ts +0 -13
  550. package/dist/node_modules/@allyhub-next/runtime/dist/embed.d.ts +0 -50
  551. package/dist/node_modules/@allyhub-next/runtime/dist/env.d.ts +0 -101
  552. package/dist/node_modules/@allyhub-next/runtime/dist/errors.d.ts +0 -21
  553. package/dist/node_modules/@allyhub-next/runtime/dist/facade.d.ts +0 -42
  554. package/dist/node_modules/@allyhub-next/runtime/dist/fonts.d.ts +0 -110
  555. package/dist/node_modules/@allyhub-next/runtime/dist/footage.d.ts +0 -52
  556. package/dist/node_modules/@allyhub-next/runtime/dist/frame.d.ts +0 -61
  557. package/dist/node_modules/@allyhub-next/runtime/dist/guards.d.ts +0 -32
  558. package/dist/node_modules/@allyhub-next/runtime/dist/index.d.ts +0 -14
  559. package/dist/node_modules/@allyhub-next/runtime/dist/inspect.d.ts +0 -112
  560. package/dist/node_modules/@allyhub-next/runtime/dist/locate.d.ts +0 -11
  561. package/dist/node_modules/@allyhub-next/runtime/dist/measure.d.ts +0 -41
  562. package/dist/node_modules/@allyhub-next/runtime/dist/mix-plan.d.ts +0 -42
  563. package/dist/node_modules/@allyhub-next/runtime/dist/music.d.ts +0 -29
  564. package/dist/node_modules/@allyhub-next/runtime/dist/output.d.ts +0 -5
  565. package/dist/node_modules/@allyhub-next/runtime/dist/pictures.d.ts +0 -39
  566. package/dist/node_modules/@allyhub-next/runtime/dist/piece.d.ts +0 -34
  567. package/dist/node_modules/@allyhub-next/runtime/dist/player/clips.d.ts +0 -41
  568. package/dist/node_modules/@allyhub-next/runtime/dist/player/cutout.d.ts +0 -57
  569. package/dist/node_modules/@allyhub-next/runtime/dist/player/player.d.ts +0 -78
  570. package/dist/node_modules/@allyhub-next/runtime/dist/reads.d.ts +0 -132
  571. package/dist/node_modules/@allyhub-next/runtime/dist/sound.d.ts +0 -22
  572. package/dist/node_modules/@allyhub-next/runtime/dist/speech.d.ts +0 -107
  573. package/dist/node_modules/@allyhub-next/runtime/dist/stage-kit.d.ts +0 -12
  574. package/dist/node_modules/@allyhub-next/runtime/dist/stage.d.ts +0 -34
  575. package/dist/node_modules/@allyhub-next/runtime/dist/styles.d.ts +0 -35
  576. package/dist/node_modules/@allyhub-next/runtime/dist/takes.d.ts +0 -72
  577. package/dist/node_modules/@allyhub-next/runtime/dist/titles.d.ts +0 -10
  578. package/dist/node_modules/@allyhub-next/runtime/dist/transitions.d.ts +0 -26
  579. package/dist/node_modules/@allyhub-next/site/dist/assets.d.ts +0 -59
  580. package/dist/node_modules/@allyhub-next/site/dist/assets.js +0 -2
  581. package/dist/node_modules/@allyhub-next/site/dist/astro.d.ts +0 -22
  582. package/dist/node_modules/@allyhub-next/site/dist/astro.js +0 -3
  583. package/dist/node_modules/@allyhub-next/site/dist/lockfile.d.ts +0 -40
  584. package/dist/node_modules/@allyhub-next/site/dist/lockfile.js +0 -3
  585. package/dist/node_modules/@allyhub-next/site/dist/media.d.ts +0 -24
  586. package/dist/node_modules/@allyhub-next/site/dist/media.js +0 -4
  587. package/dist/node_modules/@allyhub-next/site/package.json +0 -25
  588. package/dist/node_modules/@allyhub-next/slides-pptx/dist/charts.d.ts +0 -6
  589. package/dist/node_modules/@allyhub-next/slides-pptx/dist/fonts.d.ts +0 -45
  590. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.d.ts +0 -18
  591. package/dist/node_modules/@allyhub-next/slides-pptx/dist/import.js +0 -3
  592. package/dist/node_modules/@allyhub-next/slides-pptx/dist/index.d.ts +0 -5
  593. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.d.ts +0 -55
  594. package/dist/node_modules/@allyhub-next/slides-pptx/dist/read.js +0 -4
  595. package/dist/node_modules/@allyhub-next/slides-pptx/dist/shapes.d.ts +0 -67
  596. package/dist/node_modules/@allyhub-next/slides-pptx/dist/text.d.ts +0 -21
  597. package/dist/node_modules/@allyhub-next/slides-pptx/dist/theme.d.ts +0 -4
  598. package/dist/node_modules/@allyhub-next/slides-pptx/dist/timing.d.ts +0 -32
  599. package/dist/node_modules/@allyhub-next/slides-pptx/dist/write.d.ts +0 -32
  600. package/dist/node_modules/@allyhub-next/slides-pptx/dist/xml.d.ts +0 -26
  601. package/dist/node_modules/@allyhub-next/slides-runtime/dist/draw.d.ts +0 -40
  602. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.d.ts +0 -4
  603. package/dist/node_modules/@allyhub-next/slides-runtime/dist/edit.js +0 -2
  604. package/dist/node_modules/@allyhub-next/slides-runtime/dist/index.d.ts +0 -4
  605. package/dist/node_modules/@allyhub-next/slides-runtime/dist/ink.d.ts +0 -10
  606. package/dist/node_modules/@allyhub-next/slides-runtime/dist/load.d.ts +0 -6
  607. package/dist/node_modules/@allyhub-next/stage/dist/bakes.d.ts +0 -42
  608. package/dist/node_modules/@allyhub-next/stage/dist/graphics.d.ts +0 -7
  609. package/dist/node_modules/@allyhub-next/stage/dist/identity.d.ts +0 -2
  610. package/dist/node_modules/@allyhub-next/stage/dist/index.d.ts +0 -9
  611. package/dist/node_modules/@allyhub-next/stage/dist/page.d.ts +0 -87
  612. package/dist/node_modules/@allyhub-next/stage/dist/scenery-page.d.ts +0 -69
  613. package/dist/node_modules/@allyhub-next/stage/dist/scenery-solve.d.ts +0 -49
  614. package/dist/node_modules/@allyhub-next/stage/dist/scenery.d.ts +0 -8
  615. package/dist/node_modules/@allyhub-next/stage/dist/server.d.ts +0 -21
  616. package/dist/node_modules/@allyhub-next/stage-page/dist/host.d.ts +0 -22
  617. package/dist/node_modules/@allyhub-next/stage-page/dist/page.js +0 -79
  618. package/dist/site.d.ts +0 -2
  619. package/editor-web/assets/dist-Cg2PdedY.js +0 -6
  620. package/editor-web/assets/dist-CuW84oPe.js +0 -233
  621. package/editor-web/assets/dist-CxAS_vp7.js +0 -2
  622. package/editor-web/assets/dist-DCVaj9i1.js +0 -4
  623. package/editor-web/assets/dist-DGVUuVPB.js +0 -33
  624. package/editor-web/assets/dist-Yi3sy7Ea.js +0 -1
  625. package/editor-web/assets/index-B7S9RZhL.css +0 -2
  626. package/editor-web/assets/index-pwRfZ2Jv.js +0 -69
  627. package/editor-web/assets/minus-BizJdinJ.js +0 -1
  628. package/editor-web/assets/react-D54s6gwK.js +0 -101
  629. package/editor-web/assets/textarea-CvxipnGW.js +0 -105
  630. package/editor-web/assets/trash-2-Bq1Dt8XG.js +0 -1
  631. package/editor-web/assets/undo-2-Djhvu4xt.js +0 -1
  632. /package/dist/node_modules/@allyhub-next/{site → ooxml}/LICENSE +0 -0
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{as as T}from"@allyhub-next/ooxml";import{EMU_PER_PT as D,pathText as R}from"@allyhub-next/slides-core";import{PRESETS as A,SUBTYPES as P,TRANSITION_SIDES as j}from"../timing.js";import{say as m}from"./common.js";const q=Object.fromEntries(Object.entries(A).map(([o,s])=>[`${s.kind}:${String(s.id)}`,o])),F=new Map(Object.entries(P).map(([o,s])=>[s,o])),L=new Map(Object.entries(j).map(([o,s])=>[s,o])),U={fast:.5,med:.75,slow:1};export function transitionOf(o,s){if(!o)return{};const h=o.attr("advTm"),c=h===void 0?{}:{advance:h/1e3},p=o.attr("p14:dur"),u=U[o.attrOr("spd")],y=p===void 0?u:p/1e3;o.attrOr("advClick")||m(s,"cannot-hold","p:transition@advClick","a slide that a click does not advance");const n=o.one("p:sndAc");n&&(m(s,"cannot-hold","p:sndAc","a transition's sound"),n.consume());const t=o.kids().find(r=>r.key!=="p:sndAc"&&r.key!=="p:extLst");if(!t)return c;t.use();const a=t.key==="p:push"||t.key==="p:wipe"?L.get(T(t).attrOr("dir")):void 0,d=t.key==="p:fade"?"fade":t.key==="p:push"?"push":t.key==="p:wipe"?"wipe":t.key==="p159:morph"?"morph":void 0;return t.key==="p159:morph"&&T(t).attrOr("option"),t.key==="p:fade"&&T(t).attr("thruBlk"),d?{transition:{type:d,...a&&d!=="fade"&&d!=="morph"?{direction:a}:{},duration:y},...c}:(m(s,"cannot-hold",t.key,"a transition a deck has none of"),t.consume(),c)}function _(o,s){const h=o.match(/[A-Za-z]|-?[\d.]+(?:[eE]-?\d+)?/gu)??[],c=(n,t)=>Math.round(n*(t===0?s.width:s.height)/D*100)/100,p=[];let u=[0,0],y=[0,0];for(let n=0;n<h.length;){const t=h[n++]??"",a=t.toUpperCase();if(a==="E")continue;if(a==="Z"){p.push({op:"close"}),u=y;continue}const d=a==="C"?6:a==="M"||a==="L"?2:-1,r=h.slice(n,n+d).map(Number);if(d<0||r.length<d||r.some(i=>!Number.isFinite(i)))return;n+=d;const f=r.map((i,l)=>t===a?i:i+(u[l%2]??0)),k=i=>({x:c(f[i]??0,0),y:c(f[i+1]??0,1)});if(a==="C"){const i=k(0),l=k(2);p.push({op:"curve",x1:i.x,y1:i.y,x2:l.x,y2:l.y,...k(4)})}else p.push({op:a==="M"?"move":"line",...k(0)});u=f.slice(-2),a==="M"&&(y=u)}return p[0]?.op==="move"?R(p):void 0}const B=new Set(["wipe","wipe-out","fly-in","fly-out"]);function w(o){return o.kids().flatMap(s=>[s,...w(s)])}export function animationsOf(o,s,h,c){if(!o)return[];const p=w(o),u=[];for(const y of p.filter(n=>n.key==="p:seq"))T(y).one("p:cTn")?.attr("nodeType")==="interactiveSeq"&&m(c,"cannot-hold","p:seq","animations a click on a shape starts (a trigger)");for(const y of p.filter(n=>n.key==="p:cTn")){const n=T(y),t=n.attr("nodeType");if(t!=="clickEffect"&&t!=="withEffect"&&t!=="afterEffect"||n.attr("presetClass")==="mediacall")continue;const a=w(n),d=a.find(e=>e.key==="p:spTgt")?.el.attrs.find(e=>e.key==="spid")?.value??"",r=s.get(d);if(r===void 0){m(c,"cannot-hold","p:spTgt",`an animation of shape ${d}, which is not read`);continue}const f=n.attr("presetClass")??"",k=n.attr("presetID")??0,i=q[`${f}:${String(k)}`],l=i??(f==="path"?"path":f==="exit"?"fade-out":f==="emph"?"pulse":"fade");if(i===void 0&&f!=="path"&&m(c,"approximated","p:cTn@presetID",`${r}: effect ${f} ${String(k)} is read as ${l}`),i===void 0)for(const[e,E]of[["repeatCount","repeated"],["accel","accelerated"],["decel","decelerated"]])a.concat([n]).some(b=>b.key==="p:cTn"&&b.el.attrs.some(v=>v.key===e&&Number(v.value)>0&&!(e==="repeatCount"&&v.value==="1000")))&&m(c,"cannot-hold",`p:cTn@${e}`,`${r}: an effect ${E}`);a.some(e=>e.key==="p:iterate")&&m(c,"cannot-hold","p:iterate",`${r}: an effect by word or letter`);const x=n.attr("presetSubtype")??0,M=F.get(x),O=a.find(e=>e.key==="p:pRg"),g=O?Number(O.el.attrs.find(e=>e.key==="st")?.value):void 0,C=a.find(e=>e.key==="p:cond"),N=Number(C?.el.attrs.find(e=>e.key==="delay")?.value??0)||0,I=(n.one("p:childTnLst")?.kids()??[]).filter(e=>e.key!=="p:set").flatMap(e=>w(e).filter(E=>E.key==="p:cTn").map(E=>(Number(E.el.attrs.find(v=>v.key==="dur")?.value??0)||0)*(E.el.attrs.find(v=>v.key==="autoRev")?.value==="1"?2:1))),S=a.find(e=>e.key==="p:animMotion")?.el.attrs.find(e=>e.key==="path")?.value,$=S===void 0?void 0:_(S,h);S!==void 0&&$===void 0&&(m(c,"cannot-hold","p:animMotion@path",`${r}: a motion path of ${S}`),l==="path")||u.push({shape:r,effect:l,...g===void 0||Number.isNaN(g)?{}:{paragraph:g},...M&&x>0&&B.has(l)?{direction:M}:{},start:t==="clickEffect"?"on-click":t==="withEffect"?"with-previous":"after-previous",duration:Math.max(0,...I)/1e3,...N>0?{delay:N/1e3}:{},...$===void 0?{}:{path:$}})}return o.consume(),u}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{NS as s,el as n,fill as x}from"./xml.js";const m=(e,r={})=>n("a:xfrm",{rot:r.rotation===void 0?void 0:Math.round(r.rotation*6e4),flipH:r.flip?.h?1:void 0,flipV:r.flip?.v?1:void 0},n("a:off",{x:e.left,y:e.top}),n("a:ext",{cx:e.width,cy:e.height})),h=(e,r)=>n("a:prstGeom",{prst:e},n("a:avLst",{},...(r??[]).map((a,t)=>n("a:gd",{name:r?.length===1?"adj":`adj${String(t+1)}`,fmla:`val ${String(Math.round(a*1e5))}`}))));function P(e){const r=(t,i)=>n("a:pt",{x:Math.round(t),y:Math.round(i)}),a=e.steps.map(t=>t.op==="close"?n("a:close"):t.op==="move"?n("a:moveTo",{},r(t.x,t.y)):t.op==="line"?n("a:lnTo",{},r(t.x,t.y)):n("a:cubicBezTo",{},r(t.x1,t.y1),r(t.x2,t.y2),r(t.x,t.y)));return n("a:custGeom",{},n("a:avLst"),n("a:gdLst"),n("a:ahLst"),n("a:cxnLst"),n("a:rect",{l:"l",t:"t",r:"r",b:"b"}),n("a:pathLst",{},n("a:path",{w:Math.round(e.w),h:Math.round(e.h)},...a)))}const o=e=>e.line===void 0&&e.lineWidth===void 0&&e.lineDash===void 0&&e.lineBegin===void 0&&e.lineEnd===void 0?"":n("a:ln",{w:e.lineWidth},e.line===void 0?"":x(e.line),e.lineDash===void 0?"":n("a:prstDash",{val:e.lineDash}),e.lineBegin===void 0?"":n("a:headEnd",{type:e.lineBegin}),e.lineEnd===void 0?"":n("a:tailEnd",{type:e.lineEnd})),c=(e,r,a)=>n(e,{idx:r},n("a:schemeClr",{val:a})),g={shape:n("p:style",{},c("a:lnRef",1,"accent1"),c("a:fillRef",3,"accent1"),c("a:effectRef",2,"accent1"),c("a:fontRef","minor","lt1")),connector:n("p:style",{},c("a:lnRef",2,"accent1"),c("a:fillRef",0,"accent1"),c("a:effectRef",1,"accent1"),c("a:fontRef","minor","tx1"))},y=e=>n("p:ph",{type:e.type==="obj"?void 0:e.type,idx:e.idx===0?void 0:e.idx,sz:e.sz}),v=(e,r="")=>n("p:nvPr",{},e.placeholder?y(e.placeholder):"",r);export function shapeXml(e){if(e.kind==="table"||e.kind==="chart")return n("p:graphicFrame",{},n("p:nvGraphicFramePr",{},n("p:cNvPr",{id:e.id,name:e.name}),n("p:cNvGraphicFramePr",{},n("a:graphicFrameLocks",{noGrp:1})),n("p:nvPr")),n("p:xfrm",{},n("a:off",{x:e.frame?.left??0,y:e.frame?.top??0}),n("a:ext",{cx:e.frame?.width??0,cy:e.frame?.height??0})),n("a:graphic",{},n("a:graphicData",{uri:`http://schemas.openxmlformats.org/drawingml/2006/${e.kind}`},e.kind==="table"?e.table??"":n("c:chart",{"xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","xmlns:r":s.r,"r:id":e.chart??""}))));if(e.kind==="cxn")return n("p:cxnSp",{},n("p:nvCxnSpPr",{},n("p:cNvPr",{id:e.id,name:e.name}),n("p:cNvCxnSpPr"),n("p:nvPr")),n("p:spPr",{},e.frame?m(e.frame,e):"",h("line"),o(e)),e.style?g[e.style]:"");if(e.kind==="pic"){const a=e.video;return n("p:pic",{},n("p:nvPicPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.picture?.descr},a?n("a:hlinkClick",{"r:id":"",action:"ppaction://media"}):""),n("p:cNvPicPr",{},n("a:picLocks",{noChangeAspect:1})),v(e,a?n("a:videoFile",{"r:link":a.link})+n("p:extLst",{},n("p:ext",{uri:"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}"},n("p14:media",{"xmlns:p14":s.p14,"r:embed":a.media}))):"")),n("p:blipFill",{},n("a:blip",{"r:embed":e.picture?.image}),e.picture?.crop?n("a:srcRect",{l:f(e.picture.crop.left),t:f(e.picture.crop.top),r:f(e.picture.crop.right),b:f(e.picture.crop.bottom)}):"",n("a:stretch",{},n("a:fillRect"))),n("p:spPr",{},e.frame?m(e.frame,e):"",h("rect")))}const r=e.placeholder?n("a:spLocks",{noGrp:1}):"";return n("p:sp",{},n("p:nvSpPr",{},n("p:cNvPr",{id:e.id,name:e.name}),n("p:cNvSpPr",{txBox:e.textbox?1:void 0},r),v(e)),n("p:spPr",{},e.frame?m(e.frame,e):"",e.path?P(e.path):e.geometry?h(e.geometry,e.adjustments):"",e.fill===void 0?"":x(e.fill),o(e)),e.style?g[e.style]:"",e.text??"")}function b(e,r,a){const t=a.flatMap(p=>p.frame?[p.frame]:[]),i=Math.min(...t.map(p=>p.left)),l=Math.min(...t.map(p=>p.top)),d=Math.max(...t.map(p=>p.left+p.width))-i,u=Math.max(...t.map(p=>p.top+p.height))-l;return n("p:grpSp",{},n("p:nvGrpSpPr",{},n("p:cNvPr",{id:e,name:r}),n("p:cNvGrpSpPr"),n("p:nvPr")),n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:i,y:l}),n("a:ext",{cx:d,cy:u}),n("a:chOff",{x:i,y:l}),n("a:chExt",{cx:d,cy:u}))),...a.map(shapeXml))}export function treeXml(e){const r=[];let a=Math.max(0,...e.map(t=>t.id));for(let t=0;t<e.length;t++){const i=e[t];if(!i)continue;if(i.group===void 0){r.push(shapeXml(i));continue}const l=[i];for(;e[t+1]?.group===i.group;){const d=e[++t];d&&l.push(d)}r.push(b(++a,i.group,l))}return r}const f=e=>e===0?void 0:Math.round(e*1e5);export const NO_PARAGRAPHS=[];
2
+ import{presetAdjustments as k}from"@allyhub-next/ooxml/geometry";import{NS as x,effects as s,el as n,fill as g,gradientFill as M}from"./xml.js";export const LOCKED={noMove:1,noResize:1,noRot:1};const m=e=>e.locked?LOCKED:{},h=(e,r={})=>n("a:xfrm",{rot:r.rotation===void 0?void 0:Math.round(r.rotation*6e4),flipH:r.flip?.h?1:void 0,flipV:r.flip?.v?1:void 0},n("a:off",{x:e.left,y:e.top}),n("a:ext",{cx:e.width,cy:e.height})),u=(e,r)=>{const a=k(e);return n("a:prstGeom",{prst:e},n("a:avLst",{},...(r??[]).flatMap((t,i)=>{const p=a[i]?.name;return p===void 0?[]:[n("a:gd",{name:p,fmla:`val ${String(Math.round(t*1e5))}`})]})))};function w(e){const r=(t,i)=>n("a:pt",{x:Math.round(t),y:Math.round(i)}),a=e.steps.map(t=>t.op==="close"?n("a:close"):t.op==="move"?n("a:moveTo",{},r(t.x,t.y)):t.op==="line"?n("a:lnTo",{},r(t.x,t.y)):n("a:cubicBezTo",{},r(t.x1,t.y1),r(t.x2,t.y2),r(t.x,t.y)));return n("a:custGeom",{},n("a:avLst"),n("a:gdLst"),n("a:ahLst"),n("a:cxnLst"),n("a:rect",{l:"l",t:"t",r:"r",b:"b"}),n("a:pathLst",{},n("a:path",{w:Math.round(e.w),h:Math.round(e.h)},...a)))}const v=e=>e.line===void 0&&e.lineWidth===void 0&&e.lineDash===void 0&&e.lineBegin===void 0&&e.lineEnd===void 0?"":n("a:ln",{w:e.lineWidth},e.line===void 0?"":g(e.line),e.lineDash===void 0?"":n("a:prstDash",{val:e.lineDash}),e.lineBegin===void 0?"":n("a:headEnd",{type:e.lineBegin}),e.lineEnd===void 0?"":n("a:tailEnd",{type:e.lineEnd})),d=(e,r,a)=>n(e,{idx:r},n("a:schemeClr",{val:a})),y={shape:n("p:style",{},d("a:lnRef",1,"accent1"),d("a:fillRef",3,"accent1"),d("a:effectRef",2,"accent1"),d("a:fontRef","minor","lt1")),connector:n("p:style",{},d("a:lnRef",2,"accent1"),d("a:fillRef",0,"accent1"),d("a:effectRef",1,"accent1"),d("a:fontRef","minor","tx1"))},R=e=>n("p:ph",{type:e.type==="obj"?void 0:e.type,idx:e.idx===0?void 0:e.idx,sz:e.sz}),P=(e,r="")=>n("p:nvPr",{},e.placeholder?R(e.placeholder):"",r);export function shapeXml(e){if(e.kind==="table"||e.kind==="chart")return n("p:graphicFrame",{},n("p:nvGraphicFramePr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr}),n("p:cNvGraphicFramePr",{},n("a:graphicFrameLocks",{noGrp:1,...e.locked?{noMove:1,noResize:1}:{}})),n("p:nvPr")),n("p:xfrm",{},n("a:off",{x:e.frame?.left??0,y:e.frame?.top??0}),n("a:ext",{cx:e.frame?.width??0,cy:e.frame?.height??0})),n("a:graphic",{},n("a:graphicData",{uri:`http://schemas.openxmlformats.org/drawingml/2006/${e.kind}`},e.kind==="table"?e.table??"":n("c:chart",{"xmlns:c":"http://schemas.openxmlformats.org/drawingml/2006/chart","xmlns:r":x.r,"r:id":e.chart??""}))));if(e.kind==="cxn")return n("p:cxnSp",{},n("p:nvCxnSpPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr}),n("p:cNvCxnSpPr",{},e.locked?n("a:cxnSpLocks",m(e)):""),n("p:nvPr")),n("p:spPr",{},e.frame?h(e.frame,e):"",u(e.geometry??"line",e.adjustments),v(e),e.shadow?s(e.shadow):""),e.style?y[e.style]:"");if(e.kind==="pic"){const a=e.video;return n("p:pic",{},n("p:nvPicPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr},a?n("a:hlinkClick",{"r:id":"",action:"ppaction://media"}):""),n("p:cNvPicPr",{},n("a:picLocks",{noChangeAspect:1,...m(e)})),P(e,a?n("a:videoFile",{"r:link":a.link})+n("p:extLst",{},n("p:ext",{uri:"{DAA4B4D4-6D71-4841-9C94-3DE7FCFB9230}"},n("p14:media",{"xmlns:p14":x.p14,"r:embed":a.media}))):"")),n("p:blipFill",{},n("a:blip",{"r:embed":e.picture?.image}),e.picture?.crop?n("a:srcRect",{l:f(e.picture.crop.left),t:f(e.picture.crop.top),r:f(e.picture.crop.right),b:f(e.picture.crop.bottom)}):"",n("a:stretch",{},n("a:fillRect"))),n("p:spPr",{},e.frame?h(e.frame,e):"",u("rect"),e.shadow?s(e.shadow):""))}const r=e.placeholder||e.locked?n("a:spLocks",{...e.placeholder?{noGrp:1}:{},...m(e)}):"";return n("p:sp",{},n("p:nvSpPr",{},n("p:cNvPr",{id:e.id,name:e.name,descr:e.descr}),n("p:cNvSpPr",{txBox:e.textbox?1:void 0},r),P(e)),n("p:spPr",{},e.frame?h(e.frame,e):"",e.path?w(e.path):e.geometry?u(e.geometry,e.adjustments):"",e.gradient?M(e.gradient):e.fill===void 0?"":g(e.fill,e.fillTransparency),v(e),e.shadow?s(e.shadow):""),e.style?y[e.style]:"",e.text??"")}function b(e,r,a){const t=a.flatMap(c=>c.frame?[c.frame]:[]),i=Math.min(...t.map(c=>c.left)),p=Math.min(...t.map(c=>c.top)),l=Math.max(...t.map(c=>c.left+c.width))-i,o=Math.max(...t.map(c=>c.top+c.height))-p;return n("p:grpSp",{},n("p:nvGrpSpPr",{},n("p:cNvPr",{id:e,name:r}),n("p:cNvGrpSpPr"),n("p:nvPr")),n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:i,y:p}),n("a:ext",{cx:l,cy:o}),n("a:chOff",{x:i,y:p}),n("a:chExt",{cx:l,cy:o}))),...a.map(shapeXml))}export function treeXml(e){const r=[];let a=Math.max(0,...e.map(t=>t.id));for(let t=0;t<e.length;t++){const i=e[t];if(!i)continue;if(i.group===void 0){r.push(shapeXml(i));continue}const p=[i];for(;e[t+1]?.group===i.group;){const l=e[++t];l&&p.push(l)}r.push(b(++a,i.group,p))}return r}const f=e=>e===0?void 0:Math.round(e*1e5);export const NO_PARAGRAPHS=[];
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{face as g}from"./theme.js";import{centipoints as d,el as t,esc as b,fill as f}from"./xml.js";const h={t:"t",ctr:"ctr",b:"b"},P={"+mj-lt":"+mj-ea","+mn-lt":"+mn-ea"};export function runProps(n,e,a){const r=e?.rgb!==void 0?f({rgb:e.rgb}):e?.color!==void 0?f(e.color):"",i=e?.name===void 0?void 0:P[e.name];return t(n,{lang:a,sz:e?.size===void 0?void 0:d(e.size),b:e?.bold,i:e?.italic,u:e?.underline===void 0?void 0:e.underline?"sng":"none",spc:e?.spacing===void 0?void 0:d(e.spacing)},r,e?.name===void 0?"":t("a:latin",{typeface:g(e.name)}),i===void 0?"":t("a:ea",{typeface:i}))}function m(n,e){const a=n.line_spacing;return{attrs:{marL:n.margin_left,indent:n.indent,algn:n.alignment},children:[a===void 0?"":t("a:lnSpc",{},"lines"in a?t("a:spcPct",{val:Math.round(a.lines*1e5)}):t("a:spcPts",{val:d(a.fixed)})),n.space_before===void 0?"":t("a:spcBef",{},t("a:spcPts",{val:d(n.space_before)})),n.space_after===void 0?"":t("a:spcAft",{},t("a:spcPts",{val:d(n.space_after)})),n.bullet_font===void 0||n.bullet===null?"":t("a:buFont",{typeface:n.bullet_font}),n.bullet===void 0?"":n.bullet===null?t("a:buNone"):t("a:buChar",{char:n.bullet}),e&&n.font&&Object.keys(n.font).length>0?runProps("a:defRPr",n.font):""]}}export function listStyle(n,e="a:lstStyle"){const a=n.slice(0,9).flatMap((r,i)=>{const{attrs:o,children:l}=m(r,!0),u=l.join("");return u===""&&Object.values(o).every(s=>s===void 0)?[]:[t(`a:lvl${String(i+1)}pPr`,o,u)]});return t(e,{},...a)}export function levelOf(n){return{alignment:n.alignment,line_spacing:n.line_spacing,space_before:n.space_before,space_after:n.space_after,bullet:n.bullet?n.bullet.char:null,...n.bullet?.font===void 0?{}:{bullet_font:n.bullet.font},margin_left:n.margin_left,indent:n.indent,font:n.font}}export function bodyProps(n,e,a={}){const r=e!==void 0?t("a:normAutofit",{fontScale:Math.round(e*1e5)}):n.auto_size==="text"?t("a:normAutofit"):n.auto_size==="shape"?t("a:spAutoFit"):n.auto_size==="none"?t("a:noAutofit"):"";return t("a:bodyPr",{wrap:n.word_wrap===void 0?void 0:n.word_wrap?"square":"none",lIns:n.margin_left,tIns:n.margin_top,rIns:n.margin_right,bIns:n.margin_bottom,anchor:n.vertical_anchor===void 0?void 0:h[n.vertical_anchor],...a},r)}export const bodyOfStyle=n=>({vertical_anchor:n.vertical_anchor,auto_size:n.auto_size,word_wrap:n.word_wrap,margin_left:n.margins.left,margin_top:n.margins.top,margin_right:n.margins.right,margin_bottom:n.margins.bottom});export function paragraph(n,e,a){const{attrs:r,children:i}=m({...n,...a?.alignment===void 0?{}:{alignment:a.alignment}},!1),o=t("a:pPr",{...r,lvl:n.level>0?n.level:void 0},...i),l=n.runs.flatMap(u=>u.text.split("\v").flatMap((c,s)=>{const p={...n.font,...a?.font,...u.font},_=runProps("a:rPr",Object.keys(p).length>0?p:void 0,e);return[...s>0?[t("a:br",{},runProps("a:rPr",void 0,e))]:[],...c===""?[]:[t("a:r",{},_,t("a:t",{},b(c)))]]}));return t("a:p",{},o==="<a:pPr/>"?"":o,...l,l.length===0?runProps("a:endParaRPr",a?.font,e):"")}export function txBody(n,e,a,r,i,o){const l=r.map(u=>paragraph(u,i,o));return t(n,{},e,a,...l.length>0?l:[t("a:p")])}
2
+ import{runLang as _}from"@allyhub-next/slides-core";import{face as h}from"./theme.js";import{centipoints as c,color as y,el as t,esc as m,fill as P}from"./xml.js";const v={t:"t",ctr:"ctr",b:"b"},x={"+mj-lt":"+mj-ea","+mn-lt":"+mn-ea"};export const LINK="link:";export function runProps(e,n,a){const r=n?.color===void 0?"":P(n.color),i=n?.name===void 0?void 0:x[n.name];return t(e,{lang:a,sz:n?.size===void 0?void 0:c(n.size),b:n?.bold,i:n?.italic,u:n?.underline===void 0?void 0:n.underline?"sng":"none",strike:n?.strike===void 0?void 0:n.strike?"sngStrike":"noStrike",baseline:n?.baseline===void 0?void 0:Math.round(n.baseline*1e5),spc:n?.spacing===void 0?void 0:c(n.spacing)},r,n?.highlight===void 0?"":t("a:highlight",{},y({rgb:n.highlight})),n?.name===void 0?"":t("a:latin",{typeface:h(n.name)}),i===void 0?"":t("a:ea",{typeface:i}),n?.link===void 0?"":t("a:hlinkClick",{"r:id":`${LINK}${n.link}`}))}function b(e,n){const a=e.line_spacing;return{attrs:{marL:e.margin_left,indent:e.indent,algn:e.alignment},children:[a===void 0?"":t("a:lnSpc",{},"lines"in a?t("a:spcPct",{val:Math.round(a.lines*1e5)}):t("a:spcPts",{val:c(a.fixed)})),e.space_before===void 0?"":t("a:spcBef",{},t("a:spcPts",{val:c(e.space_before)})),e.space_after===void 0?"":t("a:spcAft",{},t("a:spcPts",{val:c(e.space_after)})),e.bullet_font===void 0?"":t("a:buFont",{typeface:e.bullet_font}),e.numbered!==void 0?t("a:buAutoNum",{type:e.numbered}):e.bullet===void 0?"":e.bullet===null?t("a:buNone"):t("a:buChar",{char:e.bullet}),n&&e.font&&Object.keys(e.font).length>0?runProps("a:defRPr",e.font):""]}}export function listStyle(e,n="a:lstStyle"){const a=e.slice(0,9).flatMap((r,i)=>{const{attrs:l,children:o}=b(r,!0),d=o.join("");return d===""&&Object.values(l).every(u=>u===void 0)?[]:[t(`a:lvl${String(i+1)}pPr`,l,d)]});return t(n,{},...a)}export function levelOf(e){return{alignment:e.alignment,line_spacing:e.line_spacing,space_before:e.space_before,space_after:e.space_after,...e.numbered===void 0?{bullet:e.bullet?e.bullet.char:null}:{numbered:e.numbered},...e.bullet?.font===void 0?{}:{bullet_font:e.bullet.font},margin_left:e.margin_left,indent:e.indent,font:e.font}}export function bodyProps(e,n,a={}){const r=n!==void 0?t("a:normAutofit",{fontScale:Math.round(n*1e5)}):e.auto_size==="text"?t("a:normAutofit"):e.auto_size==="shape"?t("a:spAutoFit"):e.auto_size==="none"?t("a:noAutofit"):"";return t("a:bodyPr",{wrap:e.word_wrap===void 0?void 0:e.word_wrap?"square":"none",lIns:e.margin_left,tIns:e.margin_top,rIns:e.margin_right,bIns:e.margin_bottom,anchor:e.vertical_anchor===void 0?void 0:v[e.vertical_anchor],...a},r)}export const bodyOfStyle=e=>({vertical_anchor:e.vertical_anchor,auto_size:e.auto_size,word_wrap:e.word_wrap,margin_left:e.margins.left,margin_top:e.margins.top,margin_right:e.margins.right,margin_bottom:e.margins.bottom}),bodyUnder=(e,n)=>n?.anchor===void 0?e:{...e,vertical_anchor:n.anchor};const A="{B6F15528-21DE-4FAA-801E-634DDDAF4B2B}";export const SLIDE_NUMBER=[{level:0,runs:[{text:"‹#›",field:"slidenum"}]}];export function paragraph(e,n,a){const r={...e,...a?.paragraph,...a?.levels?.[e.level]};a?.paragraph.bullet!==void 0&&delete r.numbered,(a?.paragraph.bullet!==void 0||a?.paragraph.numbered!==void 0)&&delete r.bullet_font;const{attrs:i,children:l}=b(r,!1),o=t("a:pPr",{...i,lvl:e.level>0?e.level:void 0},...l),d=e.runs.flatMap(s=>s.text.split("\v").flatMap((u,g)=>{const p={...e.font,...a?.font,...s.font},f=runProps("a:rPr",Object.keys(p).length>0?p:void 0,_(u,n));return[...g>0?[t("a:br",{},runProps("a:rPr",void 0,n))]:[],...u===""?[]:[s.field?t("a:fld",{id:A,type:s.field},f,t("a:t",{},m(u))):t("a:r",{},f,t("a:t",{},m(u)))]]}));return t("a:p",{},o==="<a:pPr/>"?"":o,...d,d.length===0?runProps("a:endParaRPr",a?.font,n):"")}export function txBody(e,n,a,r,i,l){const o=r.map(d=>paragraph(d,i,l));return t(e,{},n,a,...o.length>0?o:[t("a:p")])}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{fontFace as l}from"@allyhub-next/slides-core";export{l as face};import{HEAD as s,NS as r,el as a}from"./xml.js";const m=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],f=t=>a("a:srgbClr",{val:t.replace("#","").toUpperCase().slice(0,6)}),e=a("a:solidFill",{},a("a:schemeClr",{val:"phClr"}));export function themeXml(t){const c=(n,o)=>a("a:latin",{typeface:l(n)})+a("a:ea",{typeface:l(o)})+a("a:cs",{typeface:""});return s+a("a:theme",{"xmlns:a":r.a,name:t.name},a("a:themeElements",{},a("a:clrScheme",{name:t.name},...m.map(n=>a(`a:${n}`,{},f(t.colors[n])))),a("a:fontScheme",{name:t.name},a("a:majorFont",{},c(t.fonts.major,t.fonts.major_east_asian)),a("a:minorFont",{},c(t.fonts.minor,t.fonts.minor_east_asian))),a("a:fmtScheme",{name:t.name},a("a:fillStyleLst",{},e,e,e),a("a:lnStyleLst",{},...[6350,12700,19050].map(n=>a("a:ln",{w:n,cap:"flat",cmpd:"sng",algn:"ctr"},e,a("a:prstDash",{val:"solid"})))),a("a:effectStyleLst",{},...[0,1,2].map(()=>a("a:effectStyle",{},a("a:effectLst")))),a("a:bgFillStyleLst",{},e,e,e))),a("a:objectDefaults"),a("a:extraClrSchemeLst"))}
2
+ import{fontFace as l}from"@allyhub-next/slides-core";export{l as face};import{HEAD as f,NS as m,el as a}from"./xml.js";const r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],p=t=>a("a:srgbClr",{val:t.replace("#","").toUpperCase().slice(0,6)}),e=a("a:solidFill",{},a("a:schemeClr",{val:"phClr"}));export function themeXml(t){const c=(n,o)=>a("a:latin",{typeface:l(n)})+a("a:ea",{typeface:l(o)})+a("a:cs",{typeface:""})+["Jpan","Hang","Hans","Hant"].map(s=>a("a:font",{script:s,typeface:l(o)})).join("");return f+a("a:theme",{"xmlns:a":m.a,name:t.name},a("a:themeElements",{},a("a:clrScheme",{name:t.name},...r.map(n=>a(`a:${n}`,{},p(t.colors[n])))),a("a:fontScheme",{name:t.name},a("a:majorFont",{},c(t.fonts.major,t.fonts.major_east_asian)),a("a:minorFont",{},c(t.fonts.minor,t.fonts.minor_east_asian))),a("a:fmtScheme",{name:t.name},a("a:fillStyleLst",{},e,e,e),a("a:lnStyleLst",{},...[6350,12700,19050].map(n=>a("a:ln",{w:n,cap:"flat",cmpd:"sng",algn:"ctr"},e,a("a:prstDash",{val:"solid"})))),a("a:effectStyleLst",{},...[0,1,2].map(()=>a("a:effectStyle",{},a("a:effectLst")))),a("a:bgFillStyleLst",{},e,e,e))),a("a:objectDefaults"),a("a:extraClrSchemeLst"))}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{isEntrance as q,isExit as I}from"@allyhub-next/slides-core";import{el as t}from"./xml.js";const w=e=>Math.round(e*1e3),W="http://schemas.microsoft.com/office/powerpoint/2010/main",Y="http://schemas.microsoft.com/office/powerpoint/2015/09/main",Z="http://schemas.openxmlformats.org/markup-compatibility/2006";export const TRANSITION_SIDES={"from-right":"l","from-left":"r","from-bottom":"u","from-top":"d"};const G=e=>e<.75?"fast":e<1.5?"med":"slow";export function transitionXml(e){if(!e)return"";const n=G(e.duration),o=e.type==="morph"?t("p159:morph",{option:"byObject"}):e.type==="fade"?t("p:fade"):t(`p:${e.type}`,{dir:TRANSITION_SIDES[e.direction]});return t("mc:AlternateContent",{"xmlns:mc":Z},t("mc:Choice",{"xmlns:p14":W,...e.type==="morph"?{"xmlns:p159":Y}:{},Requires:e.type==="morph"?"p159":"p14"},t("p:transition",{spd:n,"p14:dur":w(e.duration)},o)),t("mc:Fallback",{},t("p:transition",{spd:n},e.type==="morph"?t("p:fade"):o)))}export const PRESETS={appear:{kind:"entr",id:1},fade:{kind:"entr",id:10},wipe:{kind:"entr",id:22},"fly-in":{kind:"entr",id:2},zoom:{kind:"entr",id:53},disappear:{kind:"exit",id:1},"fade-out":{kind:"exit",id:10},"wipe-out":{kind:"exit",id:22},"fly-out":{kind:"exit",id:2},"zoom-out":{kind:"exit",id:53},pulse:{kind:"emph",id:26},path:{kind:"path",id:0}},SUBTYPES={"from-top":1,"from-right":2,"from-bottom":4,"from-left":8};const H={"from-top":"up","from-right":"right","from-bottom":"down","from-left":"left"},F={"from-top":["ppt_y","0-#ppt_h/2"],"from-right":["ppt_x","1+#ppt_w/2"],"from-bottom":["ppt_y","1+#ppt_h/2"],"from-left":["ppt_x","0-#ppt_w/2"]};export function motionPath(e,n){const o=i=>String(i/n.width),s=i=>String(i/n.height);return`${e.map(i=>i.op==="close"?"Z":i.op==="curve"?`C ${o(i.x1)} ${s(i.y1)} ${o(i.x2)} ${s(i.y2)} ${o(i.x)} ${s(i.y)}`:`${i.op==="move"?"M":"L"} ${o(i.x)} ${s(i.y)}`).join(" ")} E`}class J{next=1;take(){return this.next++}}const _=e=>t("p:stCondLst",{},t("p:cond",{delay:e})),B=(...e)=>t("p:attrNameLst",{},...e.map(n=>t("p:attrName",{},n))),k=e=>t("p:tgtEl",{},t("p:spTgt",{spid:e.spid},e.paragraph===void 0?"":t("p:txEl",{},t("p:pRg",{st:e.paragraph,end:e.paragraph})))),z=(e,n,o,s)=>t("p:set",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:1,fill:"hold"},_(s)),k(n),B("style.visibility")),t("p:to",{},t("p:strVal",{val:o}))),E=(e,n,o,s,r)=>t("p:animEffect",{transition:o,filter:s},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:r}),k(n))),T=(e,n,o,s,r,i,f={})=>t("p:anim",{calcmode:"lin",valueType:"num"},t("p:cBhvr",{additive:"base"},t("p:cTn",{id:e.take(),dur:i,fill:"hold",...f}),k(n),B(o)),t("p:tavLst",{},...[[0,s],[1e5,r]].map(([a,c])=>t("p:tav",{tm:a},t("p:val",{},t("p:strVal",{val:c}))))));function K(e,n,o,s){const r=Math.max(1,w(n.duration)),i=I(n.effect)?z(e,o,"hidden",Math.max(0,r-1)):n.effect==="pulse"||n.effect==="path"?"":z(e,o,"visible",0),f=I(n.effect)?"out":"in",a=[];switch(n.effect){case"fade":case"fade-out":a.push(E(e,o,f,"fade",r));break;case"wipe":case"wipe-out":a.push(E(e,o,f,`wipe(${H[n.direction]})`,r));break;case"fly-in":{const[c,v]=F[n.direction];a.push(T(e,o,c,v,`#${c}`,r,{decel:1e5}));break}case"fly-out":{const[c,v]=F[n.direction];a.push(T(e,o,c,`#${c}`,v,r,{accel:1e5}));break}case"zoom":a.push(T(e,o,"ppt_w","0","#ppt_w",r),T(e,o,"ppt_h","0","#ppt_h",r),E(e,o,"in","fade",r));break;case"zoom-out":a.push(T(e,o,"ppt_w","#ppt_w","0",r),T(e,o,"ppt_h","#ppt_h","0",r),E(e,o,"out","fade",r));break;case"pulse":a.push(t("p:animScale",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:Math.round(r/2),autoRev:1,fill:"hold"}),k(o)),t("p:by",{x:105e3,y:105e3})));break;case"path":a.push(t("p:animMotion",{origin:"layout",path:motionPath(n.path??[],s),pathEditMode:"relative",ptsTypes:""},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:r,fill:"hold"}),k(o),B("ppt_x","ppt_y"))));break;default:break}return I(n.effect)?[...a,i]:[i,...a]}const x=["clickEffect","withEffect","afterEffect"],A=(e,n,o,s)=>t("p:par",{},t("p:cTn",{id:e.take(),presetID:1,presetClass:"mediacall",presetSubtype:0,fill:"hold",nodeType:o},_(0),t("p:childTnLst",{},t("p:cmd",{type:"call",cmd:"playFrom(0.0)"},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:w(s),fill:"hold"}),k({spid:n}))))));export function timingXml(e,n,o,s,r,i=new Map){const f=e.filter(p=>o(p.shape)!==void 0),a=[...i].filter(([p])=>o(p)!==void 0&&!f.some(d=>d.shape===p&&q(d.effect)));if(f.length===0&&n.length===0)return"";const c=new J,v=c.take(),N=f.length>0||a.length>0,S=N?c.take():0,C=[];for(const p of f){const d=C.at(-1);if(p.start==="on-click"||!d){C.push({auto:p.start!=="on-click",groups:[{at:0,of:[p]}]});continue}const l=d.groups.at(-1);if(p.start==="with-previous"&&l)l.of.push(p);else{const u=d.groups.reduce((g,m)=>Math.max(g,...m.of.map(h=>m.at+h.delay+h.duration)),0);d.groups.push({at:u,of:[p]})}}const P=new Map,$=[],D=(p,d)=>{const l=o(p.shape)??0,u={spid:l,paragraph:p.paragraph},g=PRESETS[p.effect],m=p.paragraph!==void 0||s(p.shape),h=P.get(l)??0;m&&(P.set(l,h+1),$.push(t("p:bldP",{spid:l,grpId:h,...p.paragraph===void 0?{}:{build:"p"}})));const M=c.take();return t("p:par",{},t("p:cTn",{id:M,presetID:g.id,presetClass:g.kind,presetSubtype:p.effect==="wipe"||p.effect==="wipe-out"||p.effect==="fly-in"||p.effect==="fly-out"?SUBTYPES[p.direction]:0,fill:"hold",...m?{grpId:h}:{},nodeType:d},_(w(p.delay)),t("p:childTnLst",{},...K(c,p,u,r))))},X=C.map(p=>{const d=c.take(),l=p.groups.map((u,g)=>{const m=c.take(),h=u.of.map((y,b)=>{const L=g===0&&b===0&&!p.auto?x[0]:b>0||y.start==="with-previous"?x[1]:x[2];return D(y,L)}),M=u.of.flatMap(y=>{const b=i.get(y.shape),L=o(y.shape);return b!==void 0&&L!==void 0&&q(y.effect)?[A(c,L,x[1],b)]:[]});return t("p:par",{},t("p:cTn",{id:m,fill:"hold"},_(w(u.at)),t("p:childTnLst",{},...h,...M)))});return t("p:par",{},t("p:cTn",{id:d,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),p.auto?t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:S})):""),t("p:childTnLst",{},...l)))}),j=p=>{const d=c.take(),l=c.take();return t("p:par",{},t("p:cTn",{id:d,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:S}))),t("p:childTnLst",{},t("p:par",{},t("p:cTn",{id:l,fill:"hold"},_(0),t("p:childTnLst",{},...p))))))},V=a.length>0?[j(a.map(([p,d],l)=>A(c,o(p)??0,l===0?x[2]:x[1],d)))]:[],R=p=>t("p:cond",{evt:p,delay:0},t("p:tgtEl",{},t("p:sldTgt"))),O=N?t("p:seq",{concurrent:1,nextAc:"seek"},t("p:cTn",{id:S,dur:"indefinite",nodeType:"mainSeq"},t("p:childTnLst",{},...V,...X)),t("p:prevCondLst",{},R("onPrev")),t("p:nextCondLst",{},R("onNext"))):"",U=n.map(p=>t("p:video",{},t("p:cMediaNode",{vol:8e4},t("p:cTn",{id:c.take(),fill:"hold",display:0},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}))),t("p:tgtEl",{},t("p:spTgt",{spid:p})))));return t("p:timing",{},t("p:tnLst",{},t("p:par",{},t("p:cTn",{id:v,dur:"indefinite",restart:"never",nodeType:"tmRoot"},t("p:childTnLst",{},O,...U)))),$.length>0?t("p:bldLst",{},...$):"")}
2
+ import{isEntrance as q,isExit as I}from"@allyhub-next/slides-core";import{el as t}from"./xml.js";const k=e=>Math.round(e*1e3),W="http://schemas.microsoft.com/office/powerpoint/2010/main",Y="http://schemas.microsoft.com/office/powerpoint/2015/09/main",Z="http://schemas.openxmlformats.org/markup-compatibility/2006";export const TRANSITION_SIDES={"from-right":"l","from-left":"r","from-bottom":"u","from-top":"d"};const G=e=>e<.625?"fast":e<.875?"med":"slow";export function transitionXml(e,o){const p=o===void 0?void 0:k(o);if(!e)return p===void 0?"":t("p:transition",{advTm:p});const c=G(e.duration),i=e.type==="morph"?t("p159:morph",{option:"byObject"}):e.type==="fade"?t("p:fade"):t(`p:${e.type}`,{dir:TRANSITION_SIDES[e.direction]});return t("mc:AlternateContent",{"xmlns:mc":Z},t("mc:Choice",{"xmlns:p14":W,...e.type==="morph"?{"xmlns:p159":Y}:{},Requires:e.type==="morph"?"p159":"p14"},t("p:transition",{spd:c,"p14:dur":k(e.duration),advTm:p},i)),t("mc:Fallback",{},t("p:transition",{spd:c,advTm:p},e.type==="morph"?t("p:fade"):i)))}export const PRESETS={appear:{kind:"entr",id:1},fade:{kind:"entr",id:10},wipe:{kind:"entr",id:22},"fly-in":{kind:"entr",id:2},zoom:{kind:"entr",id:53},disappear:{kind:"exit",id:1},"fade-out":{kind:"exit",id:10},"wipe-out":{kind:"exit",id:22},"fly-out":{kind:"exit",id:2},"zoom-out":{kind:"exit",id:53},pulse:{kind:"emph",id:26},path:{kind:"path",id:0}},SUBTYPES={"from-top":1,"from-right":2,"from-bottom":4,"from-left":8};const H={"from-top":"up","from-right":"right","from-bottom":"down","from-left":"left"},F={"from-top":["ppt_y","0-#ppt_h/2"],"from-right":["ppt_x","1+#ppt_w/2"],"from-bottom":["ppt_y","1+#ppt_h/2"],"from-left":["ppt_x","0-#ppt_w/2"]};export function motionPath(e,o){const p=r=>String(r/o.width),c=r=>String(r/o.height);return`${e.map(r=>r.op==="close"?"Z":r.op==="curve"?`C ${p(r.x1)} ${c(r.y1)} ${p(r.x2)} ${c(r.y2)} ${p(r.x)} ${c(r.y)}`:`${r.op==="move"?"M":"L"} ${p(r.x)} ${c(r.y)}`).join(" ")} E`}class J{next=1;take(){return this.next++}}const _=e=>t("p:stCondLst",{},t("p:cond",{delay:e})),B=(...e)=>t("p:attrNameLst",{},...e.map(o=>t("p:attrName",{},o))),T=e=>t("p:tgtEl",{},t("p:spTgt",{spid:e.spid},e.paragraph===void 0?"":t("p:txEl",{},t("p:pRg",{st:e.paragraph,end:e.paragraph})))),z=(e,o,p,c)=>t("p:set",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:1,fill:"hold"},_(c)),T(o),B("style.visibility")),t("p:to",{},t("p:strVal",{val:p}))),E=(e,o,p,c,i)=>t("p:animEffect",{transition:p,filter:c},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i}),T(o))),x=(e,o,p,c,i,r,f={})=>t("p:anim",{calcmode:"lin",valueType:"num"},t("p:cBhvr",{additive:"base"},t("p:cTn",{id:e.take(),dur:r,fill:"hold",...f}),T(o),B(p)),t("p:tavLst",{},...[[0,c],[1e5,i]].map(([a,s])=>t("p:tav",{tm:a},t("p:val",{},t("p:strVal",{val:s}))))));function K(e,o,p,c){const i=Math.max(1,k(o.duration)),r=I(o.effect)?z(e,p,"hidden",Math.max(0,i-1)):o.effect==="pulse"||o.effect==="path"?"":z(e,p,"visible",0),f=I(o.effect)?"out":"in",a=[];switch(o.effect){case"fade":case"fade-out":a.push(E(e,p,f,"fade",i));break;case"wipe":case"wipe-out":a.push(E(e,p,f,`wipe(${H[o.direction]})`,i));break;case"fly-in":{const[s,b]=F[o.direction];a.push(x(e,p,s,b,`#${s}`,i,{decel:1e5}));break}case"fly-out":{const[s,b]=F[o.direction];a.push(x(e,p,s,`#${s}`,b,i,{accel:1e5}));break}case"zoom":a.push(x(e,p,"ppt_w","0","#ppt_w",i),x(e,p,"ppt_h","0","#ppt_h",i),E(e,p,"in","fade",i));break;case"zoom-out":a.push(x(e,p,"ppt_w","#ppt_w","0",i),x(e,p,"ppt_h","#ppt_h","0",i),E(e,p,"out","fade",i));break;case"pulse":a.push(t("p:animScale",{},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:Math.round(i/2),autoRev:1,fill:"hold"}),T(p)),t("p:by",{x:105e3,y:105e3})));break;case"path":a.push(t("p:animMotion",{origin:"layout",path:motionPath(o.path??[],c),pathEditMode:"relative",ptsTypes:""},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:i,fill:"hold"}),T(p),B("ppt_x","ppt_y"))));break;default:break}return I(o.effect)?[...a,r]:[r,...a]}const v=["clickEffect","withEffect","afterEffect"],A=(e,o,p,c)=>t("p:par",{},t("p:cTn",{id:e.take(),presetID:1,presetClass:"mediacall",presetSubtype:0,fill:"hold",nodeType:p},_(0),t("p:childTnLst",{},t("p:cmd",{type:"call",cmd:"playFrom(0.0)"},t("p:cBhvr",{},t("p:cTn",{id:e.take(),dur:k(c),fill:"hold"}),T({spid:o}))))));export function timingXml(e,o,p,c,i,r=new Map){const f=e.filter(n=>p(n.shape)!==void 0),a=[...r].filter(([n])=>p(n)!==void 0&&!f.some(d=>d.shape===n&&q(d.effect)));if(f.length===0&&o.length===0)return"";const s=new J,b=s.take(),N=f.length>0||a.length>0,S=N?s.take():0,C=[];for(const n of f){const d=C.at(-1);if(n.start==="on-click"||!d){C.push({auto:n.start!=="on-click",groups:[{at:0,of:[n]}]});continue}const l=d.groups.at(-1);if(n.start==="with-previous"&&l)l.of.push(n);else{const u=d.groups.reduce((g,m)=>Math.max(g,...m.of.map(h=>m.at+h.delay+h.duration)),0);d.groups.push({at:u,of:[n]})}}const P=new Map,$=[],D=(n,d)=>{const l=p(n.shape)??0,u={spid:l,paragraph:n.paragraph},g=PRESETS[n.effect],m=n.paragraph!==void 0||c(n.shape),h=P.get(l)??0;m&&(P.set(l,h+1),$.push(t("p:bldP",{spid:l,grpId:h,...n.paragraph===void 0?{}:{build:"p"}})));const M=s.take();return t("p:par",{},t("p:cTn",{id:M,presetID:g.id,presetClass:g.kind,presetSubtype:n.effect==="wipe"||n.effect==="wipe-out"||n.effect==="fly-in"||n.effect==="fly-out"?SUBTYPES[n.direction]:0,fill:"hold",...m?{grpId:h}:{},nodeType:d},_(k(n.delay)),t("p:childTnLst",{},...K(s,n,u,i))))},X=C.map(n=>{const d=s.take(),l=n.groups.map((u,g)=>{const m=s.take(),h=u.of.map((y,w)=>{const L=g===0&&w===0&&!n.auto?v[0]:w>0||y.start==="with-previous"?v[1]:v[2];return D(y,L)}),M=u.of.flatMap(y=>{const w=r.get(y.shape),L=p(y.shape);return w!==void 0&&L!==void 0&&q(y.effect)?[A(s,L,v[1],w)]:[]});return t("p:par",{},t("p:cTn",{id:m,fill:"hold"},_(k(u.at)),t("p:childTnLst",{},...h,...M)))});return t("p:par",{},t("p:cTn",{id:d,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),n.auto?t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:S})):""),t("p:childTnLst",{},...l)))}),j=n=>{const d=s.take(),l=s.take();return t("p:par",{},t("p:cTn",{id:d,fill:"hold"},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}),t("p:cond",{evt:"onBegin",delay:0},t("p:tn",{val:S}))),t("p:childTnLst",{},t("p:par",{},t("p:cTn",{id:l,fill:"hold"},_(0),t("p:childTnLst",{},...n))))))},V=a.length>0?[j(a.map(([n,d],l)=>A(s,p(n)??0,l===0?v[2]:v[1],d)))]:[],R=n=>t("p:cond",{evt:n,delay:0},t("p:tgtEl",{},t("p:sldTgt"))),O=N?t("p:seq",{concurrent:1,nextAc:"seek"},t("p:cTn",{id:S,dur:"indefinite",nodeType:"mainSeq"},t("p:childTnLst",{},...V,...X)),t("p:prevCondLst",{},R("onPrev")),t("p:nextCondLst",{},R("onNext"))):"",U=o.map(n=>t("p:video",{},t("p:cMediaNode",{vol:8e4},t("p:cTn",{id:s.take(),fill:"hold",display:0},t("p:stCondLst",{},t("p:cond",{delay:"indefinite"}))),t("p:tgtEl",{},t("p:spTgt",{spid:n})))));return t("p:timing",{},t("p:tnLst",{},t("p:par",{},t("p:cTn",{id:b,dur:"indefinite",restart:"never",nodeType:"tmRoot"},t("p:childTnLst",{},O,...U)))),$.length>0?t("p:bldLst",{},...$):"")}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{createHash as ve}from"node:crypto";import{zipSync as Me}from"fflate";import{AUTOSHAPE_STYLE as ke,CONNECTOR_STYLE as Pe,joinPath as le,placeholderFrame as $e,plainLevels as Le,Pt as Te}from"@allyhub-next/slides-core";import{chartBook as De,chartXml as Ce}from"./charts.js";import{asFace as Ee,fontInfo as Ie,eotOf as Oe}from"./fonts.js";import{NO_PARAGRAPHS as Re,shapeXml as pe,treeXml as ee}from"./shapes.js";import{bodyOfStyle as Be,bodyProps as q,levelOf as de,listStyle as B,txBody as j}from"./text.js";import{themeXml as me}from"./theme.js";import{timingXml as Ae,transitionXml as Ne}from"./timing.js";import{HEAD as w,PML as T,el as n,esc as je,fill as ce}from"./xml.js";const te={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif"},fe={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},A=e=>(e.split(".").pop()??"").toLowerCase(),Fe=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],d={chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},b={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class D{list=[];add(t,s){const o=this.list.find(l=>l.type===t&&l.target===s);if(o)return o.id;const i=`rId${String(this.list.length+1)}`;return this.list.push({id:i,type:t,target:s}),i}xml(){return w+n("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>n("Relationship",{Id:t.id,Type:t.type,Target:t.target})))}}class He{list=[];add(t,s){return this.list.push({chart:t,frame:s}),`../charts/chart${String(this.list.length)}.xml`}}class ze{parts=new Map;byHash=new Map;add(t,s,o){const i=ve("sha256").update(t).digest("hex"),l=this.byHash.get(`${o}:${i}`);if(l)return l;const r=`${o}${String(this.parts.size+1)}.${s}`;return this.parts.set(`ppt/media/${r}`,t),this.byHash.set(`${o}:${i}`,`../media/${r}`),`../media/${r}`}}function he(e){return e.kind==="component"||e.kind==="movie"?!1:e.kind==="picture"?te[A(e.media?.path??"")]!==void 0:!0}function ne(e){return e.kind==="component"||e.kind==="movie"?!0:e.kind==="picture"?te[A(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(s=>ne(s)).map(s=>({key:`${t.id}/${s.name}`,slide:t.id,shape:s.name,frame:s.frame})))}export function filesOf(e){const t=new Set;for(const s of e.masters)for(const o of[...s.shapes,...s.layouts.flatMap(i=>i.shapes)])o.media&&he(o)&&t.add(le(o.media.base,o.media.path));for(const s of e.slides)for(const o of s.shapes)o.media&&(o.kind==="picture"||o.kind==="movie")&&t.add(o.media.path);return[...t].sort()}const Ge=n("p:nvGrpSpPr",{},n("p:cNvPr",{id:1,name:""}),n("p:cNvGrpSpPr"),n("p:nvPr")),Xe=n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:0,y:0}),n("a:ext",{cx:0,cy:0}),n("a:chOff",{x:0,y:0}),n("a:chExt",{cx:0,cy:0}))),U=e=>n("p:spTree",{},Ge,Xe,...e),ue={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},oe=e=>n("p:bg",{},n("p:bgPr",{},n("a:solidFill",{},Ue(e)),n("a:effectLst"))),Ue=e=>typeof e=="string"?n("a:schemeClr",{val:e}):n("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()}),xe=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function Z(e){const t=s=>({...e.fill===void 0||"fill"in s&&xe(e.fill,s.fill)?{}:{fill:e.fill},...e.line===void 0||xe(e.line,s.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===s.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?e.geometry==="line"?{style:"connector",...t(Pe)}:{style:"shape",...t(ke)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const We=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(s,o)=>{const i=e[o]??{},l=t[o]??{},r={...i.font,...l.font};return{...i,...l,...Object.keys(r).length>0?{font:r}:{}}});function ge(e,t,s,o,i,l,r,m){const x=o!==void 0&&i!==void 0&&JSON.stringify(o.text_styles.other)!==JSON.stringify(i.text_styles.other);return j("p:txBody",q(t,r,e==="autoshape"?{rtlCol:0}:{}),B(x?We(o.text_styles.other,t.levels):t.levels),s,l,m)}const Je="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",Ye=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function ye(e,t){return n("a:tbl",{},n("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},n("a:tableStyleId",{},Je)),n("a:tblGrid",{},...e.columns.map(s=>n("a:gridCol",{w:s}))),...e.rows.map((s,o)=>n("a:tr",{h:s.height},...s.cells.map((i,l)=>{const r=i.text.own??i.text,m=s.cells[l-1],x=e.rows[o-1]?.cells[l];return n("a:tc",{gridSpan:i.span_width,rowSpan:i.span_height,hMerge:i.spanned&&m&&(m.spanned||m.span_width)?1:void 0,vMerge:i.spanned&&x&&(x.spanned||x.span_height)?1:void 0},j("a:txBody",n("a:bodyPr"),n("a:lstStyle"),i.text.paragraphs,t,se(i.fileText)),n("a:tcPr",{marL:r.margin_left,marR:r.margin_right,marT:r.margin_top,marB:r.margin_bottom,anchor:r.vertical_anchor},...Ye.map(([P,$])=>{const C=i.borders?.[P];return C?n($,{w:C.width},ce(C.color)):""}),i.fill===void 0?"":ce(i.fill)))}))))}const ae=e=>e.group===void 0?{}:{group:e.group},V=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end}});function Se(e,t,s,o,i,l,r){const m={id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation}};if(e.kind==="placeholder"&&e.placeholder){const x=r.on==="master"?{...$e(e.placeholder.type),...e.text}:e.text;return{...m,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:j("p:txBody",x?q(x):n("a:bodyPr"),B(x?.levels??[]),Re,l)}}if(he(e)){if(e.table)return{...m,kind:"table",table:ye(e.table,l)};if(e.kind==="picture"&&e.media){const x=i(le(e.media.base,e.media.path));return x?{...m,kind:"pic",picture:{image:s.add(d.image,o.add(x,A(e.media.path),"image")),descr:e.media.path.split("/").pop()??""}}:void 0}return e.geometry==="line"?{...m,kind:"cxn",...e.flip?{flip:e.flip}:{},...Z(e),...V(e)}:{...m,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...Z(e),...V(e),...e.text?{text:ge(e.kind,e.text,e.text.paragraphs,r.master,r.first,l)}:{}}}}function se(e){if(e)return{font:{...e.size===void 0?{}:{size:Te(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:e.color.startsWith("#")?{rgb:e.color.toUpperCase()}:{color:e.color}},...e.align===void 0?{}:{alignment:e.align}}}function qe(e,t,s,o,i,l,r,m,x){const P=`${e.id}/${t.name}`,$=l.deck.fitted[P];if(t.level!=="slide"&&!ne(t))return;const C=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},F=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},v={id:s,name:t.name,...C,...F,...t.rotation===void 0?{}:{rotation:t.rotation}},W=()=>{const f=l.pictures.get(P);return f?{image:o.add(d.image,i.add(f,"png","image")),descr:t.name}:void 0};if(t.table)return{...v,kind:"table",table:ye(t.table,r)};if(t.chart)return{...v,frame:t.frame,kind:"chart",chart:o.add(d.chart,x.add(t.chart,t.frame))};if(t.kind==="movie"&&t.media){const f=W(),I=fe[A(t.media.path)]?l.file(t.media.path):void 0;if(!f)return;if(!I)return{...v,frame:t.frame,kind:"pic",picture:f};const O=i.add(I,A(t.media.path),"media");return m.push(s),{...v,frame:t.frame,kind:"pic",picture:{image:f.image},video:{link:o.add(d.video,O),media:o.add(d.media,O)}}}if(ne(t)){const f=W(),I=l.movies?.get(P);if(f&&I){const O=i.add(I.bytes,"mp4","media");return m.push(s),{...v,frame:t.frame,kind:"pic",picture:{image:f.image},video:{link:o.add(d.video,O),media:o.add(d.media,O)}}}return f?{...v,frame:t.frame,kind:"pic",picture:f}:void 0}if(t.kind==="picture"&&t.media){const f=l.file(t.media.path);return f?{...v,frame:t.frame,kind:"pic",picture:{image:o.add(d.image,i.add(f,A(t.media.path),"image")),...t.media.crop?{crop:t.media.crop}:{},descr:t.media.path.split("/").pop()??""}}:void 0}if(t.geometry==="line")return{...v,kind:"cxn",...t.flip?{flip:t.flip}:{},...Z(t),...V(t)};const k=t.text,J=l.deck.masters.find(f=>f.name===e.master),H=k?t.placeholder?j("p:txBody",$===void 0?n("a:bodyPr"):q({},$),n("a:lstStyle"),k.paragraphs,r,se(t.fileText)):k.own?ge(t.kind,k.own,k.paragraphs,J,l.deck.masters[0],r,$,se(t.fileText)):j("p:txBody",q(Be(k.style),$),B(k.style.levels.map(de)),k.paragraphs,r):void 0,z=t.sources.frame.from==="code",G=t.fill!==void 0&&(z||t.sources.fill?.from==="slide"),E=t.line!==void 0&&(z||t.sources.line?.from==="slide");return{...v,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||G||E?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...V(t),...t.placeholder?{...G?{fill:t.fill}:{},...E?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:Z(t),...H?{text:H}:{}}}const Ze={cx:6858e3,cy:9144e3};function be(e,t){const s=pe({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),o=pe({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:j("p:txBody",n("a:bodyPr"),n("a:lstStyle"),(e??"").split(`
3
- `).map(i=>({runs:[{text:i}],level:0})),t)});return[s,o]}export function pptxParts(e){const{deck:t}=e,s=t.lang?.split("-").map((a,p)=>p===0?a.toLowerCase():a.toUpperCase()).join("-"),o=new Map,i=new ze,l=new He,r=[],m=new D,x=[],P=new Map;let $=2147483648;t.masters.forEach((a,p)=>{const c=p+1,_=$++,g=`ppt/slideMasters/slideMaster${String(c)}.xml`,y=`ppt/theme/theme${String(c)}.xml`;o.set(y,me(t.theme)),r.push([y,b.theme]);const S=new D,L=[];a.layouts.forEach(M=>{const h=P.size+1,u=`ppt/slideLayouts/slideLayout${String(h)}.xml`;P.set(M,u);const X=new D;X.add(d.slideMaster,`../slideMasters/slideMaster${String(c)}.xml`);const _e=M.shapes.flatMap((ie,we)=>{const re=Se(ie,we+2,X,i,e.file,s,{master:a,first:e.deck.masters[0],on:"layout"});return re?[{...re,...ae(ie)}]:[]});o.set(u,w+n("p:sldLayout",{...T,...M.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},n("p:cSld",{name:M.name},M.background===void 0?"":oe(M.background),U(ee(_e))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),o.set(`ppt/slideLayouts/_rels/slideLayout${String(h)}.xml.rels`,X.xml()),r.push([u,b.slideLayout]),L.push(n("p:sldLayoutId",{id:$++,"r:id":S.add(d.slideLayout,`../slideLayouts/slideLayout${String(h)}.xml`)}))}),S.add(d.theme,`../theme/theme${String(c)}.xml`);const Y=a.shapes.flatMap((M,h)=>{const u=Se(M,h+2,S,i,e.file,s,{master:a,first:e.deck.masters[0],on:"master"});return u?[{...u,...ae(M)}]:[]}),N=a.text_styles;o.set(g,w+n("p:sldMaster",T,n("p:cSld",{name:a.name},oe(a.background),U(ee(Y))),n("p:clrMap",ue),n("p:sldLayoutIdLst",{},...L),n("p:txStyles",{},B(N.title,"p:titleStyle"),B(N.body,"p:bodyStyle"),B(N.other,"p:otherStyle")))),o.set(`ppt/slideMasters/_rels/slideMaster${String(c)}.xml.rels`,S.xml()),r.push([g,b.slideMaster]),x.push(n("p:sldMasterId",{id:_,"r:id":m.add(d.slideMaster,`slideMasters/slideMaster${String(c)}.xml`)}))});const C=t.slides.some(a=>a.notes!==void 0),K=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let F="";if(C){o.set(K,me(t.theme)),r.push([K,b.theme]);const a=new D;a.add(d.theme,`../theme/theme${String(t.masters.length+1)}.xml`),o.set("ppt/notesMasters/notesMaster1.xml",w+n("p:notesMaster",T,n("p:cSld",{},oe("lt1"),U(be(void 0,s))),n("p:clrMap",ue))),o.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",a.xml()),r.push(["ppt/notesMasters/notesMaster1.xml",b.notesMaster]),F=m.add(d.notesMaster,"notesMasters/notesMaster1.xml")}const v=[],W=new Map(t.masters.flatMap(a=>a.layouts.map(p=>[p.name,p]))),k=a=>{const p=new Set,c=t.slides[a];for(const[_,g]of[[t.slides[a-1],c],[c,t.slides[a+1]]])if(_&&g&&g.transition?.type==="morph")for(const y of _.shapes)y.level==="slide"&&g.shapes.some(S=>S.name===y.name)&&p.add(y.name);return p};t.slides.forEach((a,p)=>{const c=p+1,_=`ppt/slides/slide${String(c)}.xml`,g=new D,y=W.get(a.layout),S=y?P.get(y):void 0;S&&g.add(d.slideLayout,`../${S.slice(4)}`);const L=[],Y=new Map;let N=1;const M=a.shapes.flatMap(h=>{const u=qe(a,h,++N,g,i,e,s,L,l);if(!u)return N--,[];Y.set(h.name,u.id);const X=k(p).has(h.name)?{name:`!!${u.name}`}:{};return[{...u,...ae(h),...X}]});if(a.notes!==void 0){const h=`ppt/notesSlides/notesSlide${String(c)}.xml`,u=new D;u.add(d.notesMaster,"../notesMasters/notesMaster1.xml"),u.add(d.slide,`../slides/slide${String(c)}.xml`),o.set(h,w+n("p:notes",T,n("p:cSld",{},U(be(a.notes,s))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),o.set(`ppt/notesSlides/_rels/notesSlide${String(c)}.xml.rels`,u.xml()),r.push([h,b.notesSlide]),g.add(d.notesSlide,`../notesSlides/notesSlide${String(c)}.xml`)}o.set(_,w+n("p:sld",{...T,show:a.hidden?0:void 0},n("p:cSld",{name:a.id},U(ee(M))),n("p:clrMapOvr",{},n("a:masterClrMapping")),Ne(a.transition),Ae(a.animations,L,h=>Y.get(h),h=>a.shapes.find(u=>u.name===h)?.text!==void 0,t,new Map(a.shapes.flatMap(h=>{const u=e.movies?.get(`${a.id}/${h.name}`);return u?[[h.name,u.seconds]]:[]}))))),o.set(`ppt/slides/_rels/slide${String(c)}.xml.rels`,g.xml()),r.push([_,b.slide]),v.push(n("p:sldId",{id:256+p,"r:id":m.add(d.slide,`slides/slide${String(c)}.xml`)}))}),m.add(d.theme,"theme/theme1.xml"),m.add(d.presProps,"presProps.xml"),m.add(d.viewProps,"viewProps.xml"),m.add(d.tableStyles,"tableStyles.xml");const J=new Map;let H=0;const z=(e.fonts??[]).flatMap(a=>{const p=Fe.flatMap(([c,_,g])=>{const y=a[c]&&Ee(a[c],a.typeface,g),S=y&&Ie(y);if(!y||!S)return[];const L=`fonts/font${String(++H)}.fntdata`;return J.set(`ppt/${L}`,Oe(y,S,a.typeface,g)),[n(_,{"r:id":m.add(d.font,L)})]});return p.length===0?[]:[n("p:embeddedFont",{},n("p:font",{typeface:a.typeface}),...p)]}),G=z.length===0?"":n("p:embeddedFontLst",{},...z);o.set("ppt/presentation.xml",w+n("p:presentation",{...T,...G===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},n("p:sldMasterIdLst",{},...x),F===""?"":n("p:notesMasterIdLst",{},n("p:notesMasterId",{"r:id":F})),n("p:sldIdLst",{},...v),n("p:sldSz",{cx:t.width,cy:t.height}),n("p:notesSz",Ze),G,e.deck.masters[0]?B(Le(e.deck.masters[0]).map(de),"p:defaultTextStyle"):"")),o.set("ppt/_rels/presentation.xml.rels",m.xml()),r.push(["ppt/presentation.xml",b.presentation]),o.set("ppt/presProps.xml",w+n("p:presentationPr",T)),o.set("ppt/viewProps.xml",w+n("p:viewPr",T)),o.set("ppt/tableStyles.xml",w+n("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"})),r.push(["ppt/presProps.xml",b.presProps]),r.push(["ppt/viewProps.xml",b.viewProps]),r.push(["ppt/tableStyles.xml",b.tableStyles]),o.set("docProps/core.xml",w+n("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${je(e.title)}</dc:title>`)),o.set("docProps/app.xml",w+n("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},n("Application",{},"AllyHub"),n("Slides",{},String(t.slides.length)),n("Notes",{},String(t.slides.filter(a=>a.notes!==void 0).length)),n("HiddenSlides",{},String(t.slides.filter(a=>a.hidden).length)))),r.push(["docProps/core.xml",b.core]),r.push(["docProps/app.xml",b.app]);const E=new D;E.add(d.officeDocument,"ppt/presentation.xml"),E.add(d.core,"docProps/core.xml"),E.add(d.app,"docProps/app.xml");const f=new Map;l.list.forEach(({chart:a,frame:p},c)=>{const _=String(c+1),g=`ppt/charts/chart${_}.xml`,y=new D,S=`Microsoft_Excel_Sheet${_}.xlsx`;f.set(`ppt/embeddings/${S}`,De(a)),o.set(g,Ce(a,p,y.add(d.package,`../embeddings/${S}`))),o.set(`ppt/charts/_rels/chart${_}.xml.rels`,y.xml()),r.push([g,b.chart])});const I=new Set([...i.parts.keys(),...f.keys()].map(A)),O=w+n("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},n("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),n("Default",{Extension:"xml",ContentType:"application/xml"}),H>0?n("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...I].sort().map(a=>n("Default",{Extension:a,ContentType:a==="xlsx"?b.workbook:te[a]??fe[a]??"application/octet-stream"})),...r.map(([a,p])=>n("Override",{PartName:`/${a}`,ContentType:p}))),Q=new TextEncoder,R=new Map;R.set("[Content_Types].xml",Q.encode(O)),R.set("_rels/.rels",Q.encode(E.xml()));for(const[a,p]of o)R.set(a,Q.encode(p));for(const[a,p]of i.parts)R.set(a,p);for(const[a,p]of f)R.set(a,p);for(const[a,p]of J)R.set(a,p);return R}const Ve=new Date(1980,0,1);export function writePptx(e){const t={};for(const[s,o]of pptxParts(e))t[s]=[o,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(s)?0:6,mtime:Ve}];return Me(t)}
2
+ import{createHash as $e}from"node:crypto";import{zipSync as Le}from"fflate";import{AUTOSHAPE_STYLE as De,colorOfFile as Te,CONNECTOR_STYLE as Ee,isConnectorGeometry as ne,joinPath as me,placeholderFrame as Ie,plainLevels as Oe,Pt as ae}from"@allyhub-next/slides-core";import{chartBook as Ce,chartXml as Re}from"./charts.js";import{asFace as Be,fontInfo as je,eotOf as Ne}from"./fonts.js";import{NO_PARAGRAPHS as Ae,shapeXml as ce,treeXml as oe}from"./shapes.js";import{bodyOfStyle as Fe,bodyProps as K,bodyUnder as ie,LINK as ze,SLIDE_NUMBER as He,levelOf as fe,listStyle as N,txBody as H}from"./text.js";import{themeXml as he}from"./theme.js";import{timingXml as Ge,transitionXml as Xe}from"./timing.js";import{HEAD as w,PML as I,color as Ue,el as n,esc as We,fill as ue,gradientFill as Je,unesc as Ye}from"./xml.js";const V={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",emf:"image/x-emf",wmf:"image/x-wmf"},ge={mp4:"video/mp4",m4v:"video/mp4",mov:"video/quicktime"},D=e=>(e.split(".").pop()??"").toLowerCase(),Ze=[["regular","p:regular","Regular"],["bold","p:bold","Bold"],["italic","p:italic","Italic"],["boldItalic","p:boldItalic","Bold Italic"]],d={hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",package:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/package",font:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/font",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",core:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",app:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",slideMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster",slideLayout:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout",slide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",notesMaster:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesMaster",notesSlide:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/notesSlide",image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",video:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/video",media:"http://schemas.microsoft.com/office/2007/relationships/media",presProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/presProps",viewProps:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/viewProps",tableStyles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/tableStyles"},S={chart:"application/vnd.openxmlformats-officedocument.drawingml.chart+xml",workbook:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",presentation:"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml",slideMaster:"application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml",slideLayout:"application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml",slide:"application/vnd.openxmlformats-officedocument.presentationml.slide+xml",theme:"application/vnd.openxmlformats-officedocument.theme+xml",notesMaster:"application/vnd.openxmlformats-officedocument.presentationml.notesMaster+xml",notesSlide:"application/vnd.openxmlformats-officedocument.presentationml.notesSlide+xml",presProps:"application/vnd.openxmlformats-officedocument.presentationml.presProps+xml",viewProps:"application/vnd.openxmlformats-officedocument.presentationml.viewProps+xml",tableStyles:"application/vnd.openxmlformats-officedocument.presentationml.tableStyles+xml",core:"application/vnd.openxmlformats-package.core-properties+xml",app:"application/vnd.openxmlformats-officedocument.extended-properties+xml"};class O{list=[];linked(t){return t.replaceAll(new RegExp(`r:id="${ze}([^"]*)"`,"gu"),(i,a)=>`r:id="${this.add(d.hyperlink,Ye(a),!0)}"`)}add(t,i,a=!1){const r=this.list.find(s=>s.type===t&&s.target===i);if(r)return r.id;const p=`rId${String(this.list.length+1)}`;return this.list.push({id:p,type:t,target:i,...a?{external:a}:{}}),p}xml(){return w+n("Relationships",{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"},...this.list.map(t=>n("Relationship",{Id:t.id,Type:t.type,Target:t.target,TargetMode:t.external?"External":void 0})))}}class qe{list=[];add(t,i){return this.list.push({chart:t,frame:i}),`../charts/chart${String(this.list.length)}.xml`}}class Ke{parts=new Map;byHash=new Map;add(t,i,a,r){const p=$e("sha256").update(t).digest("hex"),s=this.byHash.get(`${a}:${p}`);if(s)return s;const m=r?.split("/").pop()?.replace(/\.[^.]*$/u,"").replace(/[^A-Za-z0-9_-]+/gu,"-").replace(/^-+|-+$/gu,""),u=m===void 0||m===""?void 0:m;let b=`${u??`${a}${String(this.parts.size+1)}`}.${i}`;for(let M=2;this.parts.has(`ppt/media/${b}`);M++)b=`${u??a}-${String(M)}.${i}`;return this.parts.set(`ppt/media/${b}`,t),this.byHash.set(`${a}:${p}`,`../media/${b}`),`../media/${b}`}}function xe(e){return e.kind==="component"||e.kind==="movie"?!1:e.kind==="picture"?V[D(e.media?.path??"")]!==void 0:!0}function re(e){return e.kind==="component"||e.kind==="movie"?!0:e.kind==="picture"?V[D(e.media?.path??"")]===void 0:!1}export function picturedShapes(e){return e.slides.flatMap(t=>t.shapes.filter(i=>re(i)).map(i=>({key:`${t.id}/${i.name}`,slide:t.id,shape:i.name,frame:i.frame})))}export function filesOf(e){const t=new Set;for(const i of e.masters)for(const a of[...i.shapes,...i.layouts.flatMap(r=>r.shapes)])a.media&&xe(a)&&t.add(me(a.media.base,a.media.path));for(const i of e.slides){i.background_picture!==void 0&&t.add(i.background_picture);for(const a of i.shapes)a.media&&(a.kind==="picture"||a.kind==="movie")&&t.add(a.media.path)}return[...t].sort()}const Ve=n("p:nvGrpSpPr",{},n("p:cNvPr",{id:1,name:""}),n("p:cNvGrpSpPr"),n("p:nvPr")),Qe=n("p:grpSpPr",{},n("a:xfrm",{},n("a:off",{x:0,y:0}),n("a:ext",{cx:0,cy:0}),n("a:chOff",{x:0,y:0}),n("a:chExt",{cx:0,cy:0}))),J=e=>n("p:spTree",{},Ve,Qe,...e),ye={bg1:"lt1",tx1:"dk1",bg2:"lt2",tx2:"dk2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink"},Q=e=>n("p:bg",{},n("p:bgPr",{},n("a:solidFill",{},Ue(e)),n("a:effectLst")));function et(e,t,i){if(e.background_picture!==void 0){const a=i(e.background_picture);if(a!==void 0)return n("p:bg",{},n("p:bgPr",{},n("a:blipFill",{dpi:0,rotWithShape:1},n("a:blip",{"r:embed":a}),n("a:srcRect"),n("a:stretch",{},n("a:fillRect"))),n("a:effectLst")))}return e.background_gradient?n("p:bg",{},n("p:bgPr",{},Je(e.background_gradient),n("a:effectLst"))):se(e.background,t)?"":Q(e.background)}const se=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function be(e){return{...e.fill_transparency===void 0?{}:{fillTransparency:e.fill_transparency,...e.fill===void 0?{}:{fill:e.fill}},...e.gradient?{gradient:e.gradient}:{},...e.shadow?{shadow:e.shadow}:{}}}function ee(e){const t=i=>({...e.fill===void 0||"fill"in i&&se(e.fill,i.fill)?{}:{fill:e.fill},...e.line===void 0||se(e.line,i.line)?{}:{line:e.line},...e.line_width===void 0||e.line_width===i.line_width?{}:{lineWidth:e.line_width}});return e.kind==="autoshape"?ne(e.geometry)?{style:"connector",...t(Ee)}:{style:"shape",...t(De)}:{...e.kind==="textbox"?{fill:e.fill??null}:e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width}}}const tt=(e,t)=>Array.from({length:Math.max(e.length,t.length)},(i,a)=>{const r=e[a]??{},p=t[a]??{},s={...r.font,...p.font};return{...r,...p,...Object.keys(s).length>0?{font:s}:{}}});function _e(e,t,i,a,r,p,s,m){const u=a!==void 0&&r!==void 0&&JSON.stringify(a.text_styles.other)!==JSON.stringify(r.text_styles.other);return H("p:txBody",K(ie(t,m),s,e==="autoshape"?{rtlCol:0}:{}),N(u?tt(a.text_styles.other,t.levels):t.levels),i,p,m)}const nt="{2D5ABB26-0587-4C30-8999-92F81FD0307C}",at=[["left","a:lnL"],["right","a:lnR"],["top","a:lnT"],["bottom","a:lnB"]];function Se(e,t){return n("a:tbl",{},n("a:tblPr",{firstRow:e.first_row?1:void 0,firstCol:e.first_col?1:void 0,lastRow:e.last_row?1:void 0,lastCol:e.last_col?1:void 0,bandRow:e.horz_banding?1:void 0,bandCol:e.vert_banding?1:void 0},n("a:tableStyleId",{},nt)),n("a:tblGrid",{},...e.columns.map(i=>n("a:gridCol",{w:i}))),...e.rows.map((i,a)=>n("a:tr",{h:i.height},...i.cells.map((r,p)=>{const s=r.text.own??r.text,m=we(r.fileText,r.text.style),u=i.cells[p-1],b=e.rows[a-1]?.cells[p];return n("a:tc",{gridSpan:r.span_width,rowSpan:r.span_height,hMerge:r.spanned&&u&&(u.spanned||u.span_width)?1:void 0,vMerge:r.spanned&&b&&(b.spanned||b.span_height)?1:void 0},H("a:txBody",n("a:bodyPr"),n("a:lstStyle"),r.text.paragraphs,t,m),n("a:tcPr",{marL:s.margin_left,marR:s.margin_right,marT:s.margin_top,marB:s.margin_bottom,anchor:ie(s,m).vertical_anchor},...at.map(([M,G])=>{const C=r.borders?.[M];return C?n(G,{w:C.width},ue(C.color)):""}),r.fill===void 0?"":ue(r.fill)))}))))}const le=e=>e.group===void 0?{}:{group:e.group},te=e=>({...e.line_dash===void 0?{}:{lineDash:e.line_dash},...e.line_begin===void 0?{}:{lineBegin:e.line_begin},...e.line_end===void 0?{}:{lineEnd:e.line_end}});function ke(e,t,i,a,r,p,s){const m={...be(e),id:t,name:e.name,...e.frame?{frame:e.frame}:{},...e.rotation===void 0?{}:{rotation:e.rotation},...e.flip?{flip:e.flip}:{}};if(e.kind==="placeholder"&&e.placeholder){const u=s.on==="master"?{...Ie(e.placeholder.type),...e.text}:e.text;return{...m,kind:"sp",placeholder:{...e.placeholder},...e.fill===void 0?{}:{fill:e.fill},...e.line===void 0?{}:{line:e.line},...e.line_width===void 0?{}:{lineWidth:e.line_width},...e.fill===void 0&&e.line===void 0?{}:{geometry:e.geometry??"rect"},text:H("p:txBody",u?K(u):n("a:bodyPr"),N(u?.levels??[]),e.placeholder.type==="sldNum"?He:Ae,p)}}if(xe(e)){if(e.table)return{...m,kind:"table",table:Se(e.table,p)};if(e.kind==="picture"&&e.media){const u=r(me(e.media.base,e.media.path));return u?{...m,kind:"pic",picture:{image:i.add(d.image,a.add(u,D(e.media.path),"image",e.media.path))},descr:e.media.path.split("/").pop()??""}:void 0}return!e.path&&ne(e.geometry)?{...m,kind:"cxn",geometry:e.geometry??"line",...e.adjustments?{adjustments:e.adjustments}:{},...ee(e),...te(e)}:{...m,kind:"sp",...e.kind==="textbox"?{textbox:!0}:{},...e.path?{path:e.path}:{geometry:e.geometry??"rect"},...e.adjustments?{adjustments:e.adjustments}:{},...ee(e),...te(e),...e.text?{text:_e(e.kind,e.text,e.text.paragraphs,s.master,s.first,p)}:{}}}}function we(e,t){if(!e)return;const i=e.numbered!==void 0||e.bullet!==void 0&&e.bullet!==!1;return{font:{...e.size===void 0?{}:{size:ae(e.size)},...e.bold===void 0?{}:{bold:e.bold},...e.italic===void 0?{}:{italic:e.italic},...e.underline===void 0?{}:{underline:e.underline},...e.strike===void 0?{}:{strike:e.strike},...e.font===void 0?{}:{name:e.font},...e.color===void 0?{}:{color:Te(e.color)}},paragraph:{...e.align===void 0?{}:{alignment:e.align},...e.line_spacing===void 0?{}:{line_spacing:{lines:e.line_spacing}},...e.space_before===void 0?{}:{space_before:ae(e.space_before)},...e.space_after===void 0?{}:{space_after:ae(e.space_after)},...e.numbered!==void 0?{numbered:e.numbered}:e.bullet===void 0?{}:{bullet:e.bullet===!1?null:e.bullet}},...i&&t?{levels:t.levels.map(a=>({margin_left:a.margin_left,indent:a.indent}))}:{},...e.anchor===void 0?{}:{anchor:e.anchor}}}function ot(e,t,i,a,r,p,s,m,u){const b=`${e.id}/${t.name}`,M=p.deck.fitted[b];if(t.level!=="slide"&&!re(t))return;const G=t.level==="slide"&&t.placeholder?{placeholder:{...t.placeholder}}:{},X=!t.placeholder||t.sources.frame.from==="slide"||t.sources.frame.from==="code"?{frame:t.frame}:{},v={...be(t),id:i,name:t.name,...G,...X,...t.rotation===void 0?{}:{rotation:t.rotation},...t.flip?{flip:t.flip}:{},...t.alt===void 0?{}:{descr:t.alt},...t.locked?{locked:!0}:{}},Y=()=>{const x=p.pictures.get(b);return x?{image:a.add(d.image,r.add(x,"png","image"))}:void 0};if(t.table)return{...v,kind:"table",table:Se(t.table,s)};if(t.chart)return{...v,frame:t.frame,kind:"chart",chart:a.add(d.chart,u.add(t.chart,t.frame))};if(t.kind==="movie"&&t.media){const x=Y(),B=ge[D(t.media.path)]?p.file(t.media.path):void 0;if(!x)return;if(!B)return{...v,frame:t.frame,kind:"pic",picture:x};const L=r.add(B,D(t.media.path),"media",t.media.path);return m.push(i),{...v,frame:t.frame,kind:"pic",picture:{image:x.image},video:{link:a.add(d.video,L),media:a.add(d.media,L)}}}if(re(t)){const x=Y(),B=p.movies?.get(b);if(x&&B){const L=r.add(B.bytes,"mp4","media");return m.push(i),{...v,frame:t.frame,kind:"pic",picture:{image:x.image},video:{link:a.add(d.video,L),media:a.add(d.media,L)}}}return x?{...v,frame:t.frame,kind:"pic",picture:x}:void 0}if(t.kind==="picture"&&t.media){const x=p.file(t.media.path);return x?{...v,kind:"pic",picture:{image:a.add(d.image,r.add(x,D(t.media.path),"image",t.media.path)),...t.media.crop?{crop:t.media.crop}:{}},descr:t.alt??t.media.path.split("/").pop()??""}:void 0}if(!t.path&&ne(t.geometry))return{...v,kind:"cxn",geometry:t.geometry??"line",...t.adjustments?{adjustments:t.adjustments}:{},...ee(t),...te(t)};const P=t.text,Z=p.deck.masters.find(x=>x.name===e.master),A=we(t.fileText,P?.style),U=P?t.placeholder?H("p:txBody",K(ie({},A),M),n("a:lstStyle"),P.paragraphs,s,A):P.own?_e(t.kind,P.own,P.paragraphs,Z,p.deck.masters[0],s,M,A):H("p:txBody",K(Fe(P.style),M),N(P.style.levels.map(fe)),P.paragraphs,s):void 0,W=t.sources.frame.from==="code",R=t.fill!==void 0&&(W||t.sources.fill?.from==="slide"),F=t.line!==void 0&&(W||t.sources.line?.from==="slide");return{...v,kind:"sp",...t.kind==="textbox"?{textbox:!0}:{},...t.path?{path:t.path}:!t.placeholder||R||F?{geometry:t.geometry??"rect"}:{},...t.adjustments?{adjustments:t.adjustments}:{},...te(t),...t.placeholder?{...R?{fill:t.fill}:{},...F?{line:t.line}:{},...t.line_width===void 0?{}:{lineWidth:t.line_width}}:ee(t),...U?{text:U}:{}}}const it={cx:6858e3,cy:9144e3};function ve(e,t){const i=ce({id:2,name:"Slide Image Placeholder 1",kind:"sp",placeholder:{type:"sldImg",idx:2},...e===void 0?{frame:{left:1143e3,top:685800,width:4572e3,height:3429e3}}:{}}),a=ce({id:3,name:"Notes Placeholder 2",kind:"sp",placeholder:{type:"body",idx:3,sz:"quarter"},...e===void 0?{frame:{left:685800,top:4343400,width:5486400,height:4114800}}:{},text:H("p:txBody",n("a:bodyPr"),n("a:lstStyle"),(e??"").split(`
3
+ `).map(r=>({runs:[{text:r}],level:0})),t)});return[i,a]}export function pptxParts(e){const{deck:t}=e,i=t.lang?.split("-").map((o,c)=>c===0?o.toLowerCase():o.toUpperCase()).join("-"),a=new Map,r=new Ke,p=new qe,s=[],m=new O,u=[],b=new Map;let M=2147483648;t.masters.forEach((o,c)=>{const f=c+1,k=M++,g=`ppt/slideMasters/slideMaster${String(f)}.xml`,y=`ppt/theme/theme${String(f)}.xml`;a.set(y,he(t.theme)),s.push([y,S.theme]);const _=new O,T=[];o.layouts.forEach($=>{const l=b.size+1,h=`ppt/slideLayouts/slideLayout${String(l)}.xml`;b.set($,h);const E=new O;E.add(d.slideMaster,`../slideMasters/slideMaster${String(f)}.xml`);const Me=$.shapes.flatMap((de,Pe)=>{const pe=ke(de,Pe+2,E,r,e.file,i,{master:o,first:e.deck.masters[0],on:"layout"});return pe?[{...pe,...le(de)}]:[]});a.set(h,w+n("p:sldLayout",{...I,...$.display_master_shapes===!1?{showMasterSp:0}:{},preserve:1},n("p:cSld",{name:$.name},$.background===void 0?"":Q($.background),J(oe(Me))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),a.set(`ppt/slideLayouts/_rels/slideLayout${String(l)}.xml.rels`,E.xml()),s.push([h,S.slideLayout]),T.push(n("p:sldLayoutId",{id:M++,"r:id":_.add(d.slideLayout,`../slideLayouts/slideLayout${String(l)}.xml`)}))}),_.add(d.theme,`../theme/theme${String(f)}.xml`);const q=o.shapes.flatMap(($,l)=>{const h=ke($,l+2,_,r,e.file,i,{master:o,first:e.deck.masters[0],on:"master"});return h?[{...h,...le($)}]:[]}),z=o.text_styles;a.set(g,w+n("p:sldMaster",I,n("p:cSld",{name:o.name},Q(o.background),J(oe(q))),n("p:clrMap",ye),n("p:sldLayoutIdLst",{},...T),n("p:txStyles",{},N(z.title,"p:titleStyle"),N(z.body,"p:bodyStyle"),N(z.other,"p:otherStyle")))),a.set(`ppt/slideMasters/_rels/slideMaster${String(f)}.xml.rels`,_.xml()),s.push([g,S.slideMaster]),u.push(n("p:sldMasterId",{id:k,"r:id":m.add(d.slideMaster,`slideMasters/slideMaster${String(f)}.xml`)}))});const G=t.slides.some(o=>o.notes!==void 0),C=`ppt/theme/theme${String(t.masters.length+1)}.xml`;let X="";if(G){a.set(C,he(t.theme)),s.push([C,S.theme]);const o=new O;o.add(d.theme,`../theme/theme${String(t.masters.length+1)}.xml`),a.set("ppt/notesMasters/notesMaster1.xml",w+n("p:notesMaster",I,n("p:cSld",{},Q("lt1"),J(ve(void 0,i))),n("p:clrMap",ye))),a.set("ppt/notesMasters/_rels/notesMaster1.xml.rels",o.xml()),s.push(["ppt/notesMasters/notesMaster1.xml",S.notesMaster]),X=m.add(d.notesMaster,"notesMasters/notesMaster1.xml")}const v=[],Y=new Map(t.masters.flatMap(o=>o.layouts.map(c=>[c.name,c]))),P=o=>{const c=new Set,f=t.slides[o];for(const[k,g]of[[t.slides[o-1],f],[f,t.slides[o+1]]])if(k&&g&&g.transition?.type==="morph")for(const y of k.shapes)y.level==="slide"&&g.shapes.some(_=>_.name===y.name)&&c.add(y.name);return c};t.slides.forEach((o,c)=>{const f=c+1,k=`ppt/slides/slide${String(f)}.xml`,g=new O,y=Y.get(o.layout),_=y?b.get(y):void 0;_&&g.add(d.slideLayout,`../${_.slice(4)}`);const T=[],q=new Map;let z=1;const $=o.shapes.flatMap(l=>{const h=ot(o,l,++z,g,r,e,i,T,p);if(!h)return z--,[];q.set(l.name,h.id);const E=P(c).has(l.name)?{name:`!!${h.name}`}:{};return[{...h,...le(l),...E}]});if(o.notes!==void 0){const l=`ppt/notesSlides/notesSlide${String(f)}.xml`,h=new O;h.add(d.notesMaster,"../notesMasters/notesMaster1.xml"),h.add(d.slide,`../slides/slide${String(f)}.xml`),a.set(l,w+n("p:notes",I,n("p:cSld",{},J(ve(o.notes,i))),n("p:clrMapOvr",{},n("a:masterClrMapping")))),a.set(`ppt/notesSlides/_rels/notesSlide${String(f)}.xml.rels`,h.xml()),s.push([l,S.notesSlide]),g.add(d.notesSlide,`../notesSlides/notesSlide${String(f)}.xml`)}a.set(k,w+n("p:sld",{...I,show:o.hidden?0:void 0},n("p:cSld",{name:o.id},et(o,y?.background??t.masters.find(l=>l.name===o.master)?.background,l=>{const h=e.file(l);return h&&V[D(l)]!==void 0?g.add(d.image,r.add(h,D(l),"image",l)):void 0}),g.linked(J(oe($)))),n("p:clrMapOvr",{},n("a:masterClrMapping")),Xe(o.transition,o.advance),Ge(o.animations,T,l=>q.get(l),l=>o.shapes.find(h=>h.name===l)?.text!==void 0,t,new Map(o.shapes.flatMap(l=>{const h=e.movies?.get(`${o.id}/${l.name}`),E=l.kind==="movie"&&l.media?e.lengths?.get(l.media.path):h?.seconds;return E===void 0?[]:[[l.name,E]]}))))),a.set(`ppt/slides/_rels/slide${String(f)}.xml.rels`,g.xml()),s.push([k,S.slide]),v.push(n("p:sldId",{id:256+c,"r:id":m.add(d.slide,`slides/slide${String(f)}.xml`)}))}),m.add(d.theme,"theme/theme1.xml"),m.add(d.presProps,"presProps.xml"),m.add(d.viewProps,"viewProps.xml"),m.add(d.tableStyles,"tableStyles.xml");const Z=new Map;let A=0;const U=(e.fonts??[]).flatMap(o=>{const c=Ze.flatMap(([f,k,g])=>{const y=o[f]&&Be(o[f],o.typeface,g),_=y&&je(y);if(!y||!_)return[];const T=`fonts/font${String(++A)}.fntdata`;return Z.set(`ppt/${T}`,Ne(y,_,o.typeface,g)),[n(k,{"r:id":m.add(d.font,T)})]});return c.length===0?[]:[n("p:embeddedFont",{},n("p:font",{typeface:o.typeface}),...c)]}),W=U.length===0?"":n("p:embeddedFontLst",{},...U);a.set("ppt/presentation.xml",w+n("p:presentation",{...I,...W===""?{}:{embedTrueTypeFonts:1},saveSubsetFonts:1},n("p:sldMasterIdLst",{},...u),X===""?"":n("p:notesMasterIdLst",{},n("p:notesMasterId",{"r:id":X})),n("p:sldIdLst",{},...v),n("p:sldSz",{cx:t.width,cy:t.height}),n("p:notesSz",it),W,e.deck.masters[0]?N(Oe(e.deck.masters[0]).map(fe),"p:defaultTextStyle"):"")),a.set("ppt/_rels/presentation.xml.rels",m.xml()),s.push(["ppt/presentation.xml",S.presentation]),a.set("ppt/presProps.xml",w+n("p:presentationPr",I)),a.set("ppt/viewProps.xml",w+n("p:viewPr",I)),a.set("ppt/tableStyles.xml",w+n("a:tblStyleLst",{"xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main",def:"{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}"})),s.push(["ppt/presProps.xml",S.presProps]),s.push(["ppt/viewProps.xml",S.viewProps]),s.push(["ppt/tableStyles.xml",S.tableStyles]),a.set("docProps/core.xml",w+n("cp:coreProperties",{"xmlns:cp":"http://schemas.openxmlformats.org/package/2006/metadata/core-properties","xmlns:dc":"http://purl.org/dc/elements/1.1/"},e.title===void 0?"":`<dc:title>${We(e.title)}</dc:title>`)),a.set("docProps/app.xml",w+n("Properties",{xmlns:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"},n("Application",{},"AllyHub"),n("Slides",{},String(t.slides.length)),n("Notes",{},String(t.slides.filter(o=>o.notes!==void 0).length)),n("HiddenSlides",{},String(t.slides.filter(o=>o.hidden).length)))),s.push(["docProps/core.xml",S.core]),s.push(["docProps/app.xml",S.app]);const R=new O;R.add(d.officeDocument,"ppt/presentation.xml"),R.add(d.core,"docProps/core.xml"),R.add(d.app,"docProps/app.xml");const F=new Map;p.list.forEach(({chart:o,frame:c},f)=>{const k=String(f+1),g=`ppt/charts/chart${k}.xml`,y=new O,_=`Microsoft_Excel_Sheet${k}.xlsx`;F.set(`ppt/embeddings/${_}`,Ce(o)),a.set(g,Re(o,c,y.add(d.package,`../embeddings/${_}`))),a.set(`ppt/charts/_rels/chart${k}.xml.rels`,y.xml()),s.push([g,S.chart])});const x=new Set([...r.parts.keys(),...F.keys()].map(D)),B=w+n("Types",{xmlns:"http://schemas.openxmlformats.org/package/2006/content-types"},n("Default",{Extension:"rels",ContentType:"application/vnd.openxmlformats-package.relationships+xml"}),n("Default",{Extension:"xml",ContentType:"application/xml"}),A>0?n("Default",{Extension:"fntdata",ContentType:"application/x-fontdata"}):"",...[...x].sort().map(o=>n("Default",{Extension:o,ContentType:o==="xlsx"?S.workbook:V[o]??ge[o]??"application/octet-stream"})),...s.map(([o,c])=>n("Override",{PartName:`/${o}`,ContentType:c}))),L=new TextEncoder,j=new Map;j.set("[Content_Types].xml",L.encode(B)),j.set("_rels/.rels",L.encode(R.xml()));for(const[o,c]of a)j.set(o,L.encode(c));for(const[o,c]of r.parts)j.set(o,c);for(const[o,c]of F)j.set(o,c);for(const[o,c]of Z)j.set(o,c);return j}const rt=new Date(1980,0,1);export function writePptx(e){const t={};for(const[i,a]of pptxParts(e))t[i]=[a,{level:/\.(png|jpe?g|gif|mp4|m4v|mov)$/u.test(i)?0:6,mtime:rt}];return Le(t)}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- const l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},p=o=>{const t=o.charCodeAt(0);return t<32&&t!==9&&t!==10&&t!==13||t===65534||t===65535};export const esc=o=>Array.from(o,t=>p(t)?"":l[t]??t).join("");export function el(o,t={},...a){const r=Object.entries(t).filter(([,n])=>n!==void 0).map(([n,e])=>` ${n}="${esc(typeof e=="boolean"?e?"1":"0":String(e))}"`).join(""),s=a.join("");return s===""?`<${o}${r}/>`:`<${o}${r}>${s}</${o}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- `,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(o){return typeof o=="string"?el("a:schemeClr",{val:o}):el("a:srgbClr",{val:o.rgb.replace("#","").toUpperCase()})}export const fill=o=>o===null?el("a:noFill"):el("a:solidFill",{},color(o)),centipoints=o=>Math.round(o/127);
2
+ import{lumOf as s}from"@allyhub-next/ooxml/brightness";const p={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},i=t=>{const o=t.charCodeAt(0);return o<32&&o!==9&&o!==10&&o!==13||o===65534||o===65535};export const esc=t=>Array.from(t,o=>i(o)?"":p[o]??o).join(""),unesc=t=>t.replaceAll("&quot;",'"').replaceAll("&gt;",">").replaceAll("&lt;","<").replaceAll("&amp;","&");export function el(t,o={},...e){const n=Object.entries(o).filter(([,a])=>a!==void 0).map(([a,l])=>` ${a}="${esc(typeof l=="boolean"?l?"1":"0":String(l))}"`).join(""),r=e.join("");return r===""?`<${t}${n}/>`:`<${t}${n}>${r}</${t}>`}export const HEAD=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
+ `,NS={a:"http://schemas.openxmlformats.org/drawingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",p:"http://schemas.openxmlformats.org/presentationml/2006/main",p14:"http://schemas.microsoft.com/office/powerpoint/2010/main"},PML={"xmlns:a":NS.a,"xmlns:r":NS.r,"xmlns:p":NS.p};export function color(t,o=0){const e=o>0?el("a:alpha",{val:Math.round((1-o)*1e5)}):"";if(typeof t=="string")return el("a:schemeClr",{val:t},e);if("rgb"in t)return el("a:srgbClr",{val:t.rgb.replace("#","").toUpperCase()},e);const{lumMod:n,lumOff:r}=s(t.brightness);return el("a:schemeClr",{val:t.theme_color},el("a:lumMod",{val:n}),r===void 0?"":el("a:lumOff",{val:r}),e)}export const fill=(t,o=0)=>t===null?el("a:noFill"):el("a:solidFill",{},color(t,o)),gradientFill=t=>el("a:gradFill",{rotWithShape:1},el("a:gsLst",{},...[...t.stops].sort((o,e)=>o.at-e.at).map(o=>el("a:gs",{pos:Math.round(o.at*1e5)},color(o.color,o.transparency)))),el("a:lin",{ang:Math.round(t.angle*6e4),scaled:0})),effects=t=>el("a:effectLst",{},el("a:outerShdw",{blurRad:t.blur,dist:t.distance,dir:Math.round(t.angle*6e4),algn:"ctr",rotWithShape:0},color(t.color,t.transparency))),centipoints=t=>Math.round(t/127);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub-next/slides-pptx",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{consoleAt as s,createEnv as b,loadTextFonts as x,pictureWaiter as E}from"@allyhub-next/runtime/stage";import{CLEAN_LOOK as k,LAYER_BRAND as S,SEEK_LIMIT as $}from"@allyhub-next/video-core";import{importDeck as j,stageContext as v}from"./load.js";export async function componentStage(i,y,o){const d=b(i,y),h=await j(i),w=i.looks?.clean??k;document.documentElement.style.background="transparent",document.body.style.background="transparent";let a=[];const m=()=>{for(const t of a)s({phase:"mount",layer:t.layer.component},()=>{t.layer.unmount?.(t.el,t.layer.props,t.ctx)});a=[],o.replaceChildren()};return{async draw(t){m();const l=h.components[t.name];if(!l)throw new Error(`There is no component ${t.name} in slides.ts (it has ${Object.keys(h.components).join(", ")||"none"}).`);Object.assign(o.style,{position:"relative",width:`${String(t.width)}px`,height:`${String(t.height)}px`,overflow:"hidden",background:"transparent"});const u=[],f=s({phase:"build"},()=>l.layers(t.props,{width:t.width,height:t.height,slide:""}));for(const[g,r]of f.entries()){if(typeof r!="object"||r===null||r[S]!=="graphic")continue;const e=r,n=document.createElement("div");Object.assign(n.style,{position:"absolute",inset:"0px"}),o.append(n);const c=v({look:w,width:t.width,height:t.height,start:0,end:Math.max(t.t,0)+1,combo:d.combo,format:`${String(Math.round(t.width))}x${String(Math.round(t.height))}`,asset:p=>d.log.asset(p),wait:p=>u.push(p),report:()=>{}});a.push({layer:e,el:n,ctx:c}),s({phase:"mount",layer:e.component,index:g},()=>{e.mount(n,e.props,c)}),s({phase:"render",layer:e.component,index:g},()=>{e.render(n,Math.max(0,t.t),e.props,c)})}await x(o),await Promise.all(u),await E(o)($*1e3)},dispose:m}}
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{ADJUSTMENT_DEFAULTS as z,chartDrawing as M,EMU_PER_PT as $,Pt as R}from"@allyhub-next/slides-core";export const SHAPE_ATTR="data-ak-shape",LINE_WIDTH=R(.75),SINGLE_SPACING=1.2,MIN_FONT_SCALE=.25;export function themeCss(e){const t={};for(const[i,o]of Object.entries(e.colors))t[`--ak-theme-${i}`]=o;return t["--ak-theme-major"]=y(e.fonts.major),t["--ak-theme-minor"]=y(e.fonts.minor),t["--ak-theme-major-ea"]=y(e.fonts.major_east_asian),t["--ak-theme-minor-ea"]=y(e.fonts.minor_east_asian),t}const y=e=>e.includes(",")||e.includes('"')?e:`"${e}", "Noto Sans SC", sans-serif`;export const colorCss=e=>e==null?"transparent":typeof e=="string"?`var(--ak-theme-${e})`:e.rgb;const E=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":y(e),I={l:"left",ctr:"center",r:"right",just:"justify"},L={t:"flex-start",ctr:"center",b:"flex-end"},B=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,P=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;export function eastAsianRuns(e,t){const i=[];for(const o of e){const r=B.test(o)||t&&P.test(o),c=i.at(-1);c?.ea===r?c.text+=o:i.push({text:o,ea:r})}return i}function j(e,t,i,o){if(!t)return;const r=E(t.name);r&&(e.style.fontFamily=r),t.size!==void 0&&(e.style.fontSize=`${String(t.size*i*o)}px`),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),t.underline!==void 0&&(e.style.textDecoration=t.underline?"underline":"none"),t.spacing!==void 0&&(e.style.letterSpacing=`${String(t.spacing*i*o)}px`),t.rgb!==void 0?e.style.color=t.rgb:t.color!==void 0&&(e.style.color=colorCss(t.color))}function G(){if(document.getElementById("ak-bullet-style"))return;const e=document.createElement("style");e.id="ak-bullet-style",e.textContent="[data-ak-bullet]::before{content:attr(data-ak-bullet)}",document.head.append(e)}function U(e,t){const i=t[e.level]??t[0];if(!i)throw new Error("A text style has nine levels.");return{...i,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},font:{...i.font,...e.font}}}function C(e,t,i,o,r=!1){e.replaceChildren(),t.paragraphs.forEach((c,d)=>{const s=U(c,t.style.levels),a=document.createElement("div");a.dataset.akParagraph=String(d),a.dataset.akLevel=String(c.level);const f=s.font.size*i*o,u="lines"in s.line_spacing?String(s.line_spacing.lines*SINGLE_SPACING):`${String(s.line_spacing.fixed*i*o)}px`,g=c.runs.some(l=>l.text!==""&&l.text!=="\v")?s.bullet:void 0;if(Object.assign(a.style,{position:"relative",textAlign:I[s.alignment],paddingLeft:`${String(s.margin_left*i)}px`,textIndent:g?"0px":`${String(s.indent*i)}px`,marginTop:d===0?"0px":`${String(s.space_before*i*o)}px`,marginBottom:`${String(s.space_after*i*o)}px`,lineHeight:u,fontSize:`${String(f)}px`,minHeight:"lines"in s.line_spacing?`${String(f*s.line_spacing.lines*SINGLE_SPACING)}px`:u}),j(a,s.font,i,o),g){G();const l=document.createElement("span");l.dataset.akBullet=g.char,Object.assign(l.style,{position:"absolute",left:`${String((s.margin_left+s.indent)*i)}px`,...g.font===void 0?{}:{fontFamily:E(g.font)}}),a.append(l)}for(const l of c.runs){const p=document.createElement("span");j(p,l.font,i,o);const m=l.font?.color??l.font?.rgb;m!==void 0&&(p.dataset.akColor=m),l.code?p.dataset.akCode="":l.font?.name!==void 0&&(p.dataset.akFont=l.font.name);const w=`var(--ak-theme-${(l.font?.name??s.font.name)==="+mj-lt"?"major":"minor"}-ea)`;for(const b of eastAsianRuns(l.text.replaceAll("\v",`
3
- `),r)){if(!b.ea){p.append(b.text);continue}const x=document.createElement("span");x.style.fontFamily=w,x.textContent=b.text,p.append(x)}a.append(p)}e.append(a)})}const _=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function v(e,t,i){const{style:o}=e,r=o.auto_size==="shape",c=document.createElement("div");c.dataset.akText="",c.dataset.akAutofit=o.auto_size,Object.assign(c.style,{position:r?"relative":"absolute",inset:r?"auto":"0px",minHeight:"100%",display:"flex",flexDirection:"column",justifyContent:L[o.vertical_anchor],padding:`${String(o.margins.top*t)}px ${String(o.margins.right*t)}px ${String(o.margins.bottom*t)}px ${String(o.margins.left*t)}px`,whiteSpace:o.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box"});const d=document.createElement("div");return d.dataset.akBody="",c.append(d),C(d,e,t,1,i),c.akText=e,i&&(c.dataset.akCjk=""),c}export function fitText(e,t){const i=e.akText,o=e.querySelector("[data-ak-body]");if(!i||!o||e.dataset.akAutofit!=="text")return 1;const r=e.clientHeight-parseFloat(getComputedStyle(e).paddingTop)-parseFloat(getComputedStyle(e).paddingBottom),c=a=>(C(o,i,t,a,e.dataset.akCjk!==void 0),o.scrollHeight<=r+.5);if(c(1))return 1;let d=MIN_FONT_SCALE,s=1;if(!c(d))return d;for(;s-d>.01;){const a=(d+s)/2;c(a)?d=a:s=a}return c(d),e.dataset.akFontScale=d.toFixed(2),d}function W(e,t,i,o){const r=t.frame.width*i,c=t.frame.height*i,d=t.flip?.h?r:0,s=t.flip?.v?c:0,a="http://www.w3.org/2000/svg",f=document.createElementNS(a,"svg");f.setAttribute("width",String(Math.max(r,1))),f.setAttribute("height",String(Math.max(c,1))),Object.assign(f.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const u=r-d,n=c-s,g=colorCss(t.line??"accent1"),l=h=>h===void 0||h==="none"||h==="arrow"?0:o*1.5,p=Math.hypot(u-d,n-s)||1,m=(u-d)/p,S=(n-s)/p,w=l(t.line_begin),b=l(t.line_end),x=document.createElementNS(a,"line");x.setAttribute("x1",String(d+m*w)),x.setAttribute("y1",String(s+S*w)),x.setAttribute("x2",String(u-m*b)),x.setAttribute("y2",String(n-S*b)),x.setAttribute("stroke",g),x.setAttribute("stroke-width",String(o));const A=F(t.line_dash,o);A&&x.setAttribute("stroke-dasharray",A),f.append(x);for(const[h,D,T,N,H]of[[t.line_begin,d,s,-m,-S],[t.line_end,u,n,m,S]]){const k=J(h,D,T,N,H,o,g);k&&f.append(k)}e.append(f)}const q={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]},F=(e,t)=>e&&q[e]?.map(i=>String(i*t)).join(" ");function J(e,t,i,o,r,c,d){if(e===void 0||e==="none")return;const s="http://www.w3.org/2000/svg",a=c*3,f=(l,p)=>`${String(t-o*l-r*p)},${String(i-r*l+o*p)}`;if(e==="oval"){const l=document.createElementNS(s,"circle");return l.setAttribute("cx",String(t)),l.setAttribute("cy",String(i)),l.setAttribute("r",String(a/2)),l.setAttribute("fill",d),l}const u=e==="arrow",n=document.createElementNS(s,u?"polyline":"polygon"),g={triangle:[f(0,0),f(a,a/2),f(a,-a/2)],stealth:[f(0,0),f(a,a/2),f(a*.7,0),f(a,-a/2)],diamond:[f(-a/2,0),f(0,a/2),f(a/2,0),f(0,-a/2)],arrow:[f(a,a/2),f(0,0),f(a,-a/2)]}[e];return n.setAttribute("points",g.join(" ")),u?(n.setAttribute("fill","none"),n.setAttribute("stroke",d),n.setAttribute("stroke-width",String(c))):n.setAttribute("fill",d),n}function K(e,t,i,o){const r=t.path;if(!r)return;const c=t.frame.width*i,d=t.frame.height*i,s=r.w===0?0:c/r.w,a=r.h===0?0:d/r.h,f=r.steps.map(l=>l.op==="close"?"Z":l.op==="move"?`M${String(l.x*s)} ${String(l.y*a)}`:l.op==="line"?`L${String(l.x*s)} ${String(l.y*a)}`:`C${String(l.x1*s)} ${String(l.y1*a)} ${String(l.x2*s)} ${String(l.y2*a)} ${String(l.x*s)} ${String(l.y*a)}`).join(""),u="http://www.w3.org/2000/svg",n=document.createElementNS(u,"svg");n.setAttribute("width",String(Math.max(c,1))),n.setAttribute("height",String(Math.max(d,1))),Object.assign(n.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const g=document.createElementNS(u,"path");if(g.setAttribute("d",f),g.setAttribute("fill-rule","evenodd"),g.setAttribute("fill",colorCss(t.fill)),t.line!==void 0&&t.line!==null){g.setAttribute("stroke",colorCss(t.line)),g.setAttribute("stroke-width",String(o));const l=F(t.line_dash,o);l&&g.setAttribute("stroke-dasharray",l)}n.append(g),e.append(n)}function V(e,t,i){const o=t.geometry??"rect",r=t.frame.width*i,c=t.frame.height*i;o==="roundRect"?e.style.borderRadius=`${String(Math.min(r,c)*Math.min(.5,Math.max(0,t.adjustments?.[0]??z.roundRect?.[0]??0)))}px`:o==="ellipse"?e.style.borderRadius="50%":o==="triangle"?e.style.clipPath="polygon(50% 0, 100% 100%, 0 100%)":o==="rightArrow"&&(e.style.clipPath="polygon(0 25%, 60% 25%, 60% 0, 100% 50%, 60% 100%, 60% 75%, 0 75%)")}const Z={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},O="http://www.w3.org/2000/svg";function Q(e,t,i,o){const r=i.width/$,c=i.height/$,d=o*$,s=M(t,r,c),a=document.createElementNS(O,"svg");a.setAttribute("viewBox",`0 0 ${String(r)} ${String(c)}`),a.setAttribute("width","100%"),a.setAttribute("height","100%"),Object.assign(a.style,{position:"absolute",inset:"0px",overflow:"visible"});const f=(n,g)=>{const l=document.createElementNS(O,n);for(const[p,m]of Object.entries(g))l.setAttribute(p,String(m));a.append(l)},u=n=>{f("path",{d:n.d,fill:n.fill===void 0?"none":colorCss(n.fill),stroke:n.width>0?colorCss(n.color):"none","stroke-width":n.width,"stroke-linejoin":"round"})};for(const n of[...s.grid,...s.shapes])u(n);for(const n of[...s.boxes,...s.keys])f("rect",{x:n.x,y:n.y,width:n.width,height:n.height,fill:colorCss(n.color)});for(const n of[...s.axes,...s.lines])u(n);for(const n of s.dots)f("circle",{cx:n.x,cy:n.y,r:n.r,fill:colorCss(n.color)});e.append(a);for(const n of s.words){const g=document.createElement("div");g.textContent=n.text,Object.assign(g.style,{position:"absolute",left:`${String(n.x*d)}px`,top:`${String(n.y*d)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[n.anchor]}, -50%)`,fontSize:`${String(n.size*d)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(n.color),fontFamily:"var(--ak-theme-minor)"}),e.append(g)}}function X(e,t,i,o){const r=document.createElement("table");Object.assign(r.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((d,s)=>d+s,0)*i)}px`});const c=document.createElement("colgroup");for(const d of t.columns){const s=document.createElement("col");s.style.width=`${String(d*i)}px`,c.append(s)}r.append(c);for(const[d,s]of t.rows.entries()){const a=document.createElement("tr");a.style.height=`${String(s.height*i)}px`;for(const[f,u]of s.cells.entries()){if(u.spanned)continue;const n=document.createElement("td");n.dataset.akCell=`${String(d)},${String(f)}`,u.span_width&&(n.colSpan=u.span_width),u.span_height&&(n.rowSpan=u.span_height),n.style.padding="0px",n.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[u.text.style.vertical_anchor],u.fill!==void 0&&(n.style.background=colorCss(u.fill));for(const[l,p]of Object.entries(Z)){const m=u.borders?.[l];m&&(n.style[p]=`${String(m.width*i)}px solid ${colorCss(m.color)}`)}const g=v(u.text,i,o);g.style.minHeight="0px",n.append(g),a.append(n)}r.append(a)}e.style.height="auto",e.append(r)}export function drawShape(e,t,i){const{k:o}=i;if(t.kind==="placeholder"&&t.text?.empty===!0&&!i.editing)return;const r=document.createElement("div");r.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:c,top:d,width:s,height:a}=t.frame;Object.assign(r.style,{position:"absolute",left:`${String(c*o)}px`,top:`${String(d*o)}px`,width:`${String(s*o)}px`,height:`${String(a*o)}px`}),t.rotation!==void 0&&(r.style.transform=`rotate(${String(t.rotation)}deg)`);const f=(t.line_width??LINE_WIDTH)*o;if(t.chart)Q(r,t.chart,t.frame,o);else if(t.table)return X(r,t.table,o,_(i.lang)),r;if(t.kind==="autoshape"){if(t.geometry==="line")return W(r,t,o,f),r;if(t.path)return K(r,t,o,f),t.text&&r.append(v(t.text,o,_(i.lang))),r;r.style.background=colorCss(t.fill),V(r,t,o)}else t.fill!==void 0&&(r.style.background=colorCss(t.fill));if(t.line!==void 0&&t.line!==null&&(r.style.outline=`${String(f)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line)}`),t.text?.style.auto_size==="shape"&&(r.style.height="auto",r.style.minHeight="0px",t.text.style.word_wrap||(r.style.width="max-content")),t.kind==="picture"&&t.media){r.style.overflow="hidden";const u=document.createElement("img");u.alt="",u.src=i.url(t.media.path);const n=t.media.crop??{left:0,top:0,right:0,bottom:0},g=1-n.left-n.right,l=1-n.top-n.bottom;Object.assign(u.style,{position:"absolute",width:`${String(100/g)}%`,height:`${String(100/l)}%`,left:`${String(-n.left/g*100)}%`,top:`${String(-n.top/l*100)}%`,maxWidth:"none"}),r.append(u)}else if(t.kind==="movie"&&t.media&&!i.playing)r.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const u=document.createElement("video");u.src=i.url(t.media.path),u.muted=!0,u.playsInline=!0,u.preload="auto",t.media.poster!==void 0&&(u.currentTime=t.media.poster),Object.assign(u.style,{width:"100%",height:"100%",objectFit:"fill"}),r.append(u)}return t.text&&r.append(v(t.text,o,_(i.lang))),r}export function drawSlide(e,t){const i=document.createElement("div");i.dataset.akSlide=e.id,Object.assign(i.style,{position:"absolute",inset:"0px",background:colorCss(e.background),overflow:"hidden"});for(const o of e.shapes){const r=drawShape(e.id,o,t);r&&i.append(r)}return i}
2
+ import{adjustmentDefaults as P,chartDrawing as z,colorRgb as I,CONNECTOR_STYLE as B,EMU_PER_PT as v,isConnectorGeometry as G,Pt as U,runLang as Z}from"@allyhub-next/slides-core";import{presetOutline as C}from"@allyhub-next/ooxml/geometry";export const SHAPE_ATTR="data-ak-shape",LINE_WIDTH=U(.75),SINGLE_SPACING=1.2,MIN_FONT_SCALE=.25;export function themeCss(e){const t={};for(const[i,r]of Object.entries(e.colors))t[`--ak-theme-${i}`]=r;return t["--ak-theme-major"]=y(e.fonts.major),t["--ak-theme-minor"]=y(e.fonts.minor),t["--ak-theme-major-ea"]=y(e.fonts.major_east_asian),t["--ak-theme-minor-ea"]=y(e.fonts.minor_east_asian),t}const y=e=>e.includes(",")||e.includes('"')?e:`"${e}", "Noto Sans SC", sans-serif`;export const colorCss=(e,t)=>e==null?"transparent":I(e,t);const O=e=>e===void 0?void 0:e==="+mj-lt"?"var(--ak-theme-major)":e==="+mn-lt"?"var(--ak-theme-minor)":y(e),W={l:"left",ctr:"center",r:"right",just:"justify"},q={t:"flex-start",ctr:"center",b:"flex-end"},J=/[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\u2E80-\u2FDF\u3000-\u303F\uFF00-\uFFEF]/u,K=/[\u2018\u2019\u201C\u201D\u2026\u2014\u2013\u2025\u00B7]/u;export function eastAsianRuns(e,t){const i=[];for(const r of e){const n=J.test(r)||t&&K.test(r),o=i.at(-1);o?.ea===n?o.text+=r:i.push({text:r,ea:n})}return i}const x=e=>`calc(${String(e)}px * var(--ak-fit, 1))`;function M(e,t,i,r){if(!t)return;const n=O(t.name);n&&(e.style.fontFamily=n),t.size!==void 0&&(e.style.fontSize=x(t.size*i)),t.bold!==void 0&&(e.style.fontWeight=t.bold?"700":"400"),t.italic!==void 0&&(e.style.fontStyle=t.italic?"italic":"normal"),(t.underline!==void 0||t.strike!==void 0||t.link)&&(e.style.textDecorationLine=[t.underline===!0||t.link!==void 0?"underline":"",t.strike===!0?"line-through":""].filter(o=>o!=="").join(" ")||"none"),t.highlight!==void 0&&(e.style.backgroundColor=t.highlight),t.baseline!==void 0&&t.baseline!==0&&(e.style.fontSize="0.66em",e.style.verticalAlign=`${String(t.baseline/.66)}em`),t.spacing!==void 0&&(e.style.letterSpacing=x(t.spacing*i)),t.link!==void 0?e.style.color=colorCss("hlink",r):t.color!==void 0&&(e.style.color=colorCss(t.color,r))}function V(){if(document.getElementById("ak-bullet-style"))return;const e=document.createElement("style");e.id="ak-bullet-style",e.textContent="[data-ak-bullet]::before{content:attr(data-ak-bullet)}",document.head.append(e)}export function paragraphStyle(e,t){const i=t[e.level]??t[0];if(!i)throw new Error("A text style has nine levels.");return{...i,...e.alignment===void 0?{}:{alignment:e.alignment},...e.line_spacing===void 0?{}:{line_spacing:e.line_spacing},...e.space_before===void 0?{}:{space_before:e.space_before},...e.space_after===void 0?{}:{space_after:e.space_after},...e.margin_left===void 0?{}:{margin_left:e.margin_left},...e.indent===void 0?{}:{indent:e.indent},...e.numbered===void 0?{}:{numbered:e.numbered},font:{...i.font,...e.font}}}export function numberText(e,t){const i=n=>(n>26?i(Math.floor((n-1)/26)):"")+String.fromCharCode(97+(n-1)%26),r=n=>{const o=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]];let s="",a=n;for(const[u,d]of o)for(;a>=u;)s+=d,a-=u;return s};return e==="arabicParenR"?`${String(t)})`:e==="alphaLcPeriod"?`${i(t)}.`:e==="alphaUcPeriod"?`${i(t).toUpperCase()}.`:e==="romanLcPeriod"?`${r(t)}.`:e==="romanUcPeriod"?`${r(t).toUpperCase()}.`:`${String(t)}.`}export function paragraphLabels(e,t){const i=[];return e.map(r=>{const n=paragraphStyle(r,t);i.length=r.level+1,n.numbered===void 0?i[r.level]=0:i[r.level]=(i[r.level]??0)+1;const o=r.runs.some(s=>s.text!==""&&s.text!=="\v");return n.numbered===void 0?o?n.bullet?.char:void 0:numberText(n.numbered,i[r.level]??1)})}export function paragraphElement(e,t,i,r,n,o){const s=paragraphStyle(e,i),a=document.createElement("div");a.dataset.akParagraph=String(t),a.dataset.akLevel=String(e.level);const u=s.font.size*n,d="lines"in s.line_spacing?String(s.line_spacing.lines*SINGLE_SPACING):x(s.line_spacing.fixed*n),f=s.numbered===void 0&&r!==void 0;if(Object.assign(a.style,{position:"relative",textAlign:W[s.alignment],paddingLeft:`${String(s.margin_left*n)}px`,textIndent:f?"0px":`${String(s.indent*n)}px`,marginTop:t===0?"0px":x(s.space_before*n),marginBottom:x(s.space_after*n),lineHeight:d,fontSize:x(u),minHeight:"lines"in s.line_spacing?x(u*s.line_spacing.lines*SINGLE_SPACING):d}),M(a,s.font,n,o),r!==void 0){V();const c=document.createElement("span");c.dataset.akBullet=r;const l=s.numbered===void 0?s.bullet?.font:void 0;Object.assign(c.style,{position:"absolute",left:`${String((s.margin_left+s.indent)*n)}px`,...l===void 0?{}:{fontFamily:O(l)}}),a.append(c)}return a}export const exactSpacing=(e,t)=>!("lines"in paragraphStyle(e,t).line_spacing);export function runElement(e,t,i,r=!1,n){const o=document.createElement("span");M(o,e.font,t,i);const s=e.text===void 0?n:Z(e.text,n);return s!==void 0&&s!==n&&(o.lang=s),r&&(o.style.lineHeight="0"),e.font?.link!==void 0&&(o.dataset.akLink=e.font.link),o}export function eastAsianFace(e,t){return`var(--ak-theme-${(e.font?.name??t)==="+mj-lt"?"major":"minor"}-ea)`}function Y(e,t,i,r,n){const o=isCjk(r);e.replaceChildren();const s=paragraphLabels(t.paragraphs,t.style.levels);t.paragraphs.forEach((a,u)=>{const d=paragraphElement(a,u,t.style.levels,s[u],i,n),f=paragraphStyle(a,t.style.levels).font.name,c=exactSpacing(a,t.style.levels);for(const l of a.runs){const g=runElement(l,i,n,c,r),m=eastAsianFace(l,f);for(const b of eastAsianRuns(l.text.replaceAll("\v",`
3
+ `),o)){if(!b.ea){g.append(b.text);continue}const p=document.createElement("span");p.style.fontFamily=m,p.textContent=b.text,g.append(p)}d.append(g)}e.append(d)})}export const isCjk=e=>e!==void 0&&/^(zh|ja|ko)(-|$)/iu.test(e);function k(e,t,i,r){const{style:n}=e,o=n.auto_size==="shape",s=document.createElement("div");s.dataset.akText="",s.dataset.akAutofit=n.auto_size,Object.assign(s.style,{position:o?"relative":"absolute",inset:o?"auto":"0px",minHeight:"100%",display:"flex",flexDirection:"column",justifyContent:q[n.vertical_anchor],padding:`${String(n.margins.top*t)}px ${String(n.margins.right*t)}px ${String(n.margins.bottom*t)}px ${String(n.margins.left*t)}px`,whiteSpace:n.word_wrap?"pre-wrap":"pre",overflowWrap:"break-word",boxSizing:"border-box"});const a=document.createElement("div");return a.dataset.akBody="",s.append(a),Y(a,e,t,i,r),i!==void 0&&(s.lang=i),isCjk(i)&&(s.dataset.akCjk=""),s}export function fitText(e){const t=e.querySelector("[data-ak-body]");if(!t||e.dataset.akAutofit!=="text")return 1;const i=e.clientHeight-parseFloat(getComputedStyle(e).paddingTop)-parseFloat(getComputedStyle(e).paddingBottom),r=s=>(e.style.setProperty("--ak-fit",String(s)),t.scrollHeight<=i+.5);if(r(1))return delete e.dataset.akFontScale,1;let n=MIN_FONT_SCALE,o=1;if(!r(n))return e.dataset.akFontScale=n.toFixed(2),n;for(;o-n>.01;){const s=(n+o)/2;r(s)?n=s:o=s}return r(n),e.dataset.akFontScale=n.toFixed(2),n}function Q(e,t,i,r){const n=e.split(" "),o=[],s=a=>{const u=Number(n[a]),d=Number(n[a+1]);return[r?.h?t-u:u,r?.v?i-d:d]};for(let a=0;a<n.length;){const u=n[a++];u==="M"||u==="L"?(o.push({op:u,at:[s(a)]}),a+=2):u==="C"?(o.push({op:u,at:[s(a),s(a+2),s(a+4)]}),a+=6):u==="Z"&&o.push({op:u})}return o}const X=e=>e.map(t=>t.op==="Z"?"Z":`${t.op}${t.at.map(([i,r])=>`${String(i)} ${String(r)}`).join(" ")}`).join(" ");function tt(e,t){const i=e.flatMap(o=>o.op==="Z"?[]:o.at),r=t?[...i].reverse():i,n=r[0];if(n)for(const o of r.slice(1)){const s=Math.hypot(n[0]-o[0],n[1]-o[1]);if(s>1e-6)return{at:n,out:[(n[0]-o[0])/s,(n[1]-o[1])/s]}}}function et(e,t,i,r){const n=e.filter(a=>a.op!=="Z"),o=t?n[n.length-1]:n[0];if(!o)return;const s=t?o.at.slice(o.op==="C"?-2:-1):[...o.at,...n[1]?.op==="C"?n[1].at.slice(0,1):[]];for(const a of s)a[0]+=i,a[1]+=r}function nt(e,t,i,r,n){if(t.line===null)return;const o=t.frame.width*i,s=t.frame.height*i,a=(C(t.geometry??"line",o,s,t.adjustments)?.paths??[]).filter(p=>p.stroke).map(p=>Q(p.d,o,s,t.flip)),u=a[0],d=a[a.length-1];if(!u||!d)return;const f="http://www.w3.org/2000/svg",c=document.createElementNS(f,"svg");c.setAttribute("width",String(Math.max(o,1))),c.setAttribute("height",String(Math.max(s,1))),Object.assign(c.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"});const l=colorCss(t.line??B.line,n),g=Math.max(r,ot*i),m=p=>p===void 0||p==="none"||p==="arrow"?0:g*1.5,b=[];for(const[p,S,h]of[[t.line_begin,u,!1],[t.line_end,d,!0]]){const w=tt(S,h);if(!w)continue;const[T,R]=w.at,[A,E]=w.out,j=rt(p,T,R,A,E,r,g,l);j&&b.push(j);const $=m(p);$>0&&et(S,h,-A*$,-E*$)}for(const p of a){const S=document.createElementNS(f,"path");S.setAttribute("d",X(p)),S.setAttribute("fill","none"),S.setAttribute("stroke",l),S.setAttribute("stroke-width",String(r));const h=F(t.line_dash,r);h&&S.setAttribute("stroke-dasharray",h),c.append(S)}c.append(...b),e.append(c)}const it={sysDash:[3,1],sysDot:[1,1],dash:[4,3],dashDot:[4,3,1,3],lgDash:[8,3],lgDashDot:[8,3,1,3],lgDashDotDot:[8,3,1,3,1,3]},F=(e,t)=>e&&it[e]?.map(i=>String(i*t)).join(" "),ot=25200;function rt(e,t,i,r,n,o,s,a){if(e===void 0||e==="none")return;const u="http://www.w3.org/2000/svg",d=s*(e==="arrow"?3.5:3),f=(m,b)=>`${String(t-r*m-n*b)},${String(i-n*m+r*b)}`;if(e==="oval"){const m=document.createElementNS(u,"circle");return m.setAttribute("cx",String(t)),m.setAttribute("cy",String(i)),m.setAttribute("r",String(d/2)),m.setAttribute("fill",a),m}const c=e==="arrow",l=document.createElementNS(u,c?"polyline":"polygon"),g={triangle:[f(0,0),f(d,d/2),f(d,-d/2)],stealth:[f(0,0),f(d,d/2),f(d*.7,0),f(d,-d/2)],diamond:[f(-d/2,0),f(0,d/2),f(d/2,0),f(0,-d/2)],arrow:[f(d,d/2),f(0,0),f(d,-d/2)]}[e];return l.setAttribute("points",g.join(" ")),c?(l.setAttribute("fill","none"),l.setAttribute("stroke",a),l.setAttribute("stroke-width",String(o))):l.setAttribute("fill",a),l}function st(e,t,i,r,n,o){const s=t.frame.width*r,a=t.frame.height*r,u="http://www.w3.org/2000/svg",d=document.createElementNS(u,"svg");d.setAttribute("width",String(Math.max(s,1))),d.setAttribute("height",String(Math.max(a,1))),Object.assign(d.style,{position:"absolute",left:"0px",top:"0px",overflow:"visible"}),N(d,t);let f=colorCss(t.fill,o);if(t.gradient){const c=`ak-gradient-${String(dt++)}`;d.append(ut(u,c,t.gradient,t.frame,o)),f=`url(#${c})`}for(const c of i){const l=document.createElementNS(u,"path");if(l.setAttribute("d",c.d),l.setAttribute("fill-rule","evenodd"),l.setAttribute("fill",c.fill==="none"||t.fill===null||t.fill===void 0?c.fill==="none"||!t.gradient?"none":f:c.fill==="norm"?f:lt[c.fill](colorCss(t.fill,o))),t.fill_transparency!==void 0&&l.setAttribute("fill-opacity",String(1-t.fill_transparency)),c.stroke&&t.line!==void 0&&t.line!==null){l.setAttribute("stroke",colorCss(t.line,o)),l.setAttribute("stroke-width",String(n)),l.setAttribute("stroke-linejoin","round");const g=F(t.line_dash,n);g&&l.setAttribute("stroke-dasharray",g)}d.append(l)}e.append(d)}const lt={darken:e=>`color-mix(in srgb, ${e} 60%, black)`,darkenLess:e=>`color-mix(in srgb, ${e} 80%, black)`,lighten:e=>`color-mix(in srgb, ${e} 60%, white)`,lightenLess:e=>`color-mix(in srgb, ${e} 80%, white)`};function at(e,t){const i=e.path;if(!i)return[];const r=i.w===0?0:e.frame.width*t/i.w,n=i.h===0?0:e.frame.height*t/i.h;return[{d:i.steps.map(s=>s.op==="close"?"Z":s.op==="move"?`M${String(s.x*r)} ${String(s.y*n)}`:s.op==="line"?`L${String(s.x*r)} ${String(s.y*n)}`:`C${String(s.x1*r)} ${String(s.y1*n)} ${String(s.x2*r)} ${String(s.y2*n)} ${String(s.x*r)} ${String(s.y*n)}`).join(""),fill:"norm",stroke:!0}]}function N(e,t){!t.flip?.h&&!t.flip?.v||(e.style.transform=`scale(${t.flip.h?"-1":"1"}, ${t.flip.v?"-1":"1"})`)}const ct=new Set(["rect","roundRect","ellipse"]),_=(e,t,i)=>t===void 0||t===0?colorCss(e,i):`color-mix(in srgb, ${colorCss(e,i)} ${String((1-t)*100)}%, transparent)`,D=(e,t)=>`linear-gradient(${String(e.angle+90)}deg, ${e.stops.map(i=>`${_(i.color,i.transparency,t)} ${String(i.at*100)}%`).join(", ")})`,H=(e,t)=>e.gradient?D(e.gradient,t):e.fill===null||e.fill===void 0?"transparent":_(e.fill,e.fill_transparency,t);let dt=0;function ut(e,t,i,r,n){const o=document.createElementNS(e,"linearGradient");o.id=t;const s=i.angle*Math.PI/180,a=Math.cos(s),u=Math.sin(s),d=(Math.abs(r.width*a)+Math.abs(r.height*u))/Math.max(r.width,r.height,1)/2;o.setAttribute("x1",String(.5-a*d)),o.setAttribute("y1",String(.5-u*d)),o.setAttribute("x2",String(.5+a*d)),o.setAttribute("y2",String(.5+u*d));for(const f of i.stops){const c=document.createElementNS(e,"stop");c.setAttribute("offset",String(f.at)),c.setAttribute("stop-color",colorCss(f.color,n)),f.transparency!==void 0&&c.setAttribute("stop-opacity",String(1-f.transparency)),o.append(c)}return o}function ft(e,t,i,r){const n=t.angle*Math.PI/180,o=t.distance*i;e.style.filter=`drop-shadow(${String(o*Math.cos(n))}px ${String(o*Math.sin(n))}px ${String(t.blur*i)}px ${_(t.color,t.transparency,r)})`}function gt(e,t,i){const r=t.geometry??"rect",n=t.frame.width*i,o=t.frame.height*i;r==="roundRect"?e.style.borderRadius=`${String(Math.min(n,o)*Math.min(.5,Math.max(0,t.adjustments?.[0]??P("roundRect")[0]??0)))}px`:r==="ellipse"&&(e.style.borderRadius="50%")}const mt={left:"borderLeft",right:"borderRight",top:"borderTop",bottom:"borderBottom"},L="http://www.w3.org/2000/svg";function pt(e,t,i,r,n){const o=i.width/v,s=i.height/v,a=r*v,u=z(t,o,s),d=document.createElementNS(L,"svg");d.setAttribute("viewBox",`0 0 ${String(o)} ${String(s)}`),d.setAttribute("width","100%"),d.setAttribute("height","100%"),Object.assign(d.style,{position:"absolute",inset:"0px",overflow:"visible"});const f=(l,g)=>{const m=document.createElementNS(L,l);for(const[b,p]of Object.entries(g))m.setAttribute(b,String(p));d.append(m)},c=l=>{f("path",{d:l.d,fill:l.fill===void 0?"none":colorCss(l.fill,n),stroke:l.width>0?colorCss(l.color,n):"none","stroke-width":l.width,"stroke-linejoin":"round"})};for(const l of[...u.grid,...u.shapes])c(l);for(const l of[...u.boxes,...u.keys])f("rect",{x:l.x,y:l.y,width:l.width,height:l.height,fill:colorCss(l.color,n)});for(const l of[...u.axes,...u.lines])c(l);for(const l of u.dots)f("circle",{cx:l.x,cy:l.y,r:l.r,fill:colorCss(l.color,n)});e.append(d);for(const l of u.words){const g=document.createElement("div");g.textContent=l.text,Object.assign(g.style,{position:"absolute",left:`${String(l.x*a)}px`,top:`${String(l.y*a)}px`,transform:`translate(${{start:"0",middle:"-50%",end:"-100%"}[l.anchor]}, -50%)`,fontSize:`${String(l.size*a)}px`,lineHeight:"1",whiteSpace:"nowrap",color:colorCss(l.color,n),fontFamily:"var(--ak-theme-minor)"}),e.append(g)}}function bt(e,t,i,r,n){const o=document.createElement("table");Object.assign(o.style,{borderCollapse:"collapse",tableLayout:"fixed",width:`${String(t.columns.reduce((a,u)=>a+u,0)*i)}px`});const s=document.createElement("colgroup");for(const a of t.columns){const u=document.createElement("col");u.style.width=`${String(a*i)}px`,s.append(u)}o.append(s);for(const[a,u]of t.rows.entries()){const d=document.createElement("tr");d.style.height=`${String(u.height*i)}px`;for(const[f,c]of u.cells.entries()){if(c.spanned)continue;const l=document.createElement("td");l.dataset.akCell=`${String(a)},${String(f)}`,c.span_width&&(l.colSpan=c.span_width),c.span_height&&(l.rowSpan=c.span_height),l.style.padding="0px",l.style.verticalAlign={t:"top",ctr:"middle",b:"bottom"}[c.text.style.vertical_anchor],c.fill!==void 0&&(l.style.background=colorCss(c.fill,n));for(const[m,b]of Object.entries(mt)){const p=c.borders?.[m];p&&(l.style[b]=`${String(p.width*i)}px solid ${colorCss(p.color,n)}`)}const g=k(c.text,i,r,n);g.style.minHeight="0px",l.append(g),d.append(l)}o.append(d)}e.style.height="auto",e.append(o)}export function drawShape(e,t,i){const{k:r,colors:n}=i;if(t.kind==="placeholder"&&t.text?.empty===!0&&!i.editing)return;const o=document.createElement("div");o.setAttribute(SHAPE_ATTR,`${e}/${t.name}`);const{left:s,top:a,width:u,height:d}=t.frame;Object.assign(o.style,{position:"absolute",left:`${String(s*r)}px`,top:`${String(a*r)}px`,width:`${String(u*r)}px`,height:`${String(d*r)}px`}),t.rotation!==void 0&&(o.style.transform=`rotate(${String(t.rotation)}deg)`);const f=(t.line_width??LINE_WIDTH)*r;if(t.chart)pt(o,t.chart,t.frame,r,n);else if(t.table)return bt(o,t.table,r,i.lang,n),o;if(t.shadow&&ft(o,t.shadow,r,n),t.alt!==void 0&&o.setAttribute("aria-label",t.alt),t.kind==="autoshape"){if(!t.path&&G(t.geometry))return nt(o,t,r,f,n),o;const c=t.path?at(t,r):ct.has(t.geometry??"rect")?void 0:C(t.geometry??"rect",t.frame.width*r,t.frame.height*r,t.adjustments)?.paths;if(c)return st(o,t,c,r,f,n),t.text&&o.append(k(t.text,r,i.lang,n)),o;o.style.background=H(t,n),gt(o,t,r)}else(t.fill!==void 0||t.gradient)&&(o.style.background=H(t,n));if(t.line!==void 0&&t.line!==null&&(o.style.outline=`${String(f)}px ${t.line_dash===void 0||t.line_dash==="solid"?"solid":"dashed"} ${colorCss(t.line,n)}`),t.text?.style.auto_size==="shape"&&(o.style.height="auto",o.style.minHeight="0px",t.text.style.word_wrap||(o.style.width="max-content")),t.kind==="picture"&&t.media){o.style.overflow="hidden";const c=document.createElement("img");c.alt=t.alt??"",c.src=i.url(t.media.path),N(c,t);const l=t.media.crop??{left:0,top:0,right:0,bottom:0},g=1-l.left-l.right,m=1-l.top-l.bottom;Object.assign(c.style,{position:"absolute",width:`${String(100/g)}%`,height:`${String(100/m)}%`,left:`${String(-l.left/g*100)}%`,top:`${String(-l.top/m*100)}%`,maxWidth:"none"}),t.flip&&(c.style.transformOrigin=`${String(50/g-l.left/g*100)}% ${String(50/m-l.top/m*100)}%`),o.append(c)}else if(t.kind==="movie"&&t.media&&!i.playing)o.dataset.akFilm="";else if(t.kind==="movie"&&t.media){const c=document.createElement("video");c.src=i.url(t.media.path),c.muted=!0,c.playsInline=!0,c.preload="auto",t.media.poster!==void 0&&(c.currentTime=t.media.poster),Object.assign(c.style,{width:"100%",height:"100%",objectFit:"fill"}),o.append(c)}return t.text&&o.append(k(t.text,r,i.lang,n)),o}export function drawSlide(e,t){const i=document.createElement("div");i.dataset.akSlide=e.id,Object.assign(i.style,{position:"absolute",inset:"0px",background:colorCss(e.background,t.colors),overflow:"hidden"}),e.background_gradient&&(i.style.background=D(e.background_gradient,t.colors)),e.background_picture!==void 0&&(i.style.background=`${colorCss(e.background,t.colors)} url(${JSON.stringify(t.url(e.background_picture))}) center / 100% 100% no-repeat`);for(const r of e.shapes){const n=drawShape(e.id,r,t);n&&i.append(n)}return i}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- export{DECK_FPS,SLIDE_SECONDS}from"@allyhub-next/slides-core";export{loadDeck}from"./load.js";export{drawShape,drawSlide,fitText,themeCss,colorCss,SHAPE_ATTR,LINE_WIDTH,SINGLE_SPACING,MIN_FONT_SCALE}from"./draw.js";
2
+ export{DECK_FPS,SLIDE_SECONDS}from"@allyhub-next/slides-core";export{deckCodeOf,loadDeck,SLIDES_KEPT}from"./load.js";export{componentStage}from"./component.js";export{drawShape,drawSlide,fitText,themeCss,colorCss,SHAPE_ATTR,LINE_WIDTH,SINGLE_SPACING,MIN_FONT_SCALE}from"./draw.js";
@@ -1,6 +1,6 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{LoadFailure as B,consoleAt as z,consoleAtAsync as Nt,createEnv as It,domHash as bt,inkOfBlock as Bt,loadTextFonts as Wt,pictureWaiter as Kt,realTimers as zt,textBlocks as St}from"@allyhub-next/runtime/stage";import{animationTargets as Gt,clockOf as Ut,DECK_FPS as q,drawnAt as Yt,morphFrame as Jt,transitionAt as Vt,EMU_PER_INCH as kt,EMU_PER_PT as $t,evaluateDeck as Qt,fontFace as nt,isDeck as Xt,resolveDeck as Zt,themeOfLook as te}from"@allyhub-next/slides-core";import{CLEAN_LOOK as ee,LAYER_BRAND as ne,SEEK_LIMIT as vt,countWords as oe,lookCss as se,measureMoment as ae,messagePrefix as ie,problem as ot}from"@allyhub-next/video-core";import{SLIDES_FILE as Mt}from"@allyhub-next/formats";import{drawSlide as re,fitText as ce,SHAPE_ATTR as D,themeCss as le}from"./draw.js";import{deckEditor as de}from"./edit.js";import{inkLines as pe,union as Et}from"./ink.js";export const SLIDE_LAYER="slide";const he=.5,fe=.3,At={top:0,bottom:0,left:0,right:0};async function me(i){i.muted=!1,await i.play().catch(async()=>{i.muted=!0,await i.play().catch(()=>{})})}function ue(i){const $=p=>{if(i.peek(p)!==void 0)return i.s(p);const v=[...new Set(i.keysUnder(p).map(m=>m.slice(p.length+1).split(".")[0]).filter(m=>m!==void 0&&/^\d+$/u.test(m)))].sort((m,R)=>Number(m)-Number(R));if(v.length!==0)return v.map(m=>$(`${p}.${m}`)).filter(m=>m!==void 0)};return $}export async function loadDeck(i,$,p){const v=It(i,$),{log:m,ledger:R,guards:Pt}=v,[M,F]=i.format.split("x").map(Number);if(!(M>0&&F>0))throw new B("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);for(const t of i.styles??[]){const e=document.createElement("link");e.rel="stylesheet",e.href=t;const n=new Promise(o=>{e.onload=o,e.onerror=o});document.head.append(e),await n}let st;try{st=await Nt({phase:"module"},()=>import(i.module))}catch(t){const e=t instanceof Error?t:new Error(String(t));throw new B("load_failed",`Failed to load the deck's module: ${e.message}
3
- ${e.stack??""}`)}const at=st.default;if(!Xt(at))throw new B("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);let W;try{W=z({phase:"build"},()=>Qt(at))}catch(t){throw new B("load_failed",`The deck's code failed: ${t instanceof Error?t.message:String(t)}`)}const it=ie(i.piece),G=i.looks?.clean??ee,U=i.file.split("/").slice(0,-1).join("/"),Y={file:`${U===""?"":`${U}/`}${Mt}`},{deck:b,problems:Ct}=Zt({def:W,file:i.slides??{slides:[]},words:ue(m),prefix:it,base:U,theme:te(G),data:t=>m.readData(t)});for(const t of Ct)R.problems.push(ot("AK-M011",t.message,{...t.slide===void 0?{}:{part:t.slide},where:Y}));if(b.slides.length===0)throw new B("no_parts",`The deck has no slides: its ${Mt} lists none (AK-K003).`);const g=M/b.width;Object.assign(p.style,{position:"relative",width:`${String(M)}px`,height:`${String(F)}px`,overflow:"hidden"});for(const[t,e]of Object.entries({...se(G),...le(b.theme)}))p.style.setProperty(t,e);p.replaceChildren();const rt=$.purpose==="play";$.purpose==="render"&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const Ot=t=>m.mediaAt(t)?.url??"",J=t=>Math.round(t*q)/q,S=[],V=[],ct=[];let Q=0;b.slides.forEach((t,e)=>{const n=Ut(t,e===0),{rests:o,comesOn:s,goesOff:a}=n,c=Q,h=c+(o.at(-1)??0),d=t.shapes.flatMap(l=>l.kind!=="movie"||!l.media?[]:[{shape:l.name,from:s(l.name),poster:l.media.poster??0,length:m.mediaAt(l.media.path)?.duration??0,rest:o.at(-1)??0}]),u=Math.max(h+1/q,...d.map(l=>c+l.from+l.length-l.poster));Q=u;const y=v.combo.lang,r=re(t,{k:g,url:Ot,editing:$.editing===!0,playing:rt,...y===void 0?{}:{lang:y}});r.style.visibility="hidden",p.append(r);const _=[],w=[[]];for(const l of t.shapes){const P=r.querySelector(`[${D}="${CSS.escape(`${t.id}/${l.name}`)}"]`);if(P&&w.at(-1)?.push(P),l.component&&P){const E=W.components[l.component.name];if(!E)continue;const T=l.frame.width*g,C=l.frame.height*g;z({phase:"build",part:t.id},()=>E.layers(l.component?.props??{},{width:T,height:C,slide:t.id})).forEach((O,f)=>{if(typeof O!="object"||O===null||O[ne]!=="graphic"){R.problems.push(ot("AK-M011",`Component ${E.name} on slide ${t.id} drew something that is not a graphic layer (custom(), a component): a footage layer is a movie shape on a slide.`,{part:t.id,where:Y}));return}const x=O,k=document.createElement("div");Object.assign(k.style,{position:"absolute",inset:"0px"}),P.append(k);const A=we({look:G,width:T,height:C,start:c,end:u,combo:v.combo,format:i.format,asset:j=>m.asset(j),wait:j=>ct.push(j),report:j=>R.problems.push(ot(j.code,j.message,{part:t.id,where:Y}))});_.push({layer:x,el:k,ctx:A,props:x.props,from:s(l.name)}),z({phase:"mount",part:t.id,layer:x.component,index:f},()=>{x.mount(k,x.props,A)})})}if(l.kind==="movie"&&l.media&&!rt&&m.mediaAt(l.media.path)){const E=[l.frame.left*g,l.frame.top*g,l.frame.width*g,l.frame.height*g],T=J(s(l.name)),C=a(l.name);V.push({part:t.id,file:l.media.path,start:c+T,end:C===void 0?u:c+J(C),from:(l.media.poster??0)-((o.at(-1)??0)-T),speed:1,gainDb:0,audio:!1,fit:"cover",box:E,picture:E,over:w.length}),w.push([])}}for(;w.length>1&&w.at(-1)?.length===0;)w.pop();const N=J(h);S.push({slide:t,el:r,layers:_,targets:Gt(n.timed),lead:n.lead,movies:d,planes:w,part:{key:t.id,layers:[...new Set(_.map(l=>l.layer.component))],start:c,end:u,planes:w.map(l=>({layers:[{component:SLIDE_LAYER,start:c,end:u},..._.filter(P=>l.some(E=>E.contains(P.el))).map(P=>({component:P.layer.component,start:c,end:u}))]})),still:N,...o.length>1?{steps:o.map(l=>Math.round((c+l)*q)/q)}:{},...ge(t),...t.hidden?{hidden:!0}:{}}})});const X=Q,_t={fps:q,width:M,height:F,paper:`${String(b.width/kt)}in ${String(b.height/kt)}in`,duration:X,background:b.theme.colors.lt1,parts:S.map(t=>t.part),cues:[],...V.length>0?{footage:V}:{},audio:{}},Tt=Kt(p);let lt;const dt=new WeakMap,I=[],L=(t,e)=>{const n={...e};for(const o of Object.keys(e))n[o]=t.style[o];I.push(()=>{Object.assign(t.style,n)}),Object.assign(t.style,e)},Z=(t,e)=>t.el.querySelector(`[${D}="${CSS.escape(`${t.slide.id}/${e}`)}"]`);let pt;const ht=(t,e)=>Z(t,e)?.querySelector("video")??void 0,tt=new Set,jt=(t,e)=>{const n=pt;if(n&&n.m!==t){for(const s of n.m.movies)ht(n.m,s.shape)?.pause();tt.clear()}const o=n?.m===t&&e>n.t&&e-n.t<he;pt={m:t,t:e};for(const s of t.movies){const a=ht(t,s.shape);if(!a)continue;const c=s.poster+Math.max(0,e-s.from);if(o&&e>=s.from&&c<s.length){Math.abs(a.currentTime-c)>fe&&(a.currentTime=c),a.paused&&me(a);continue}a.pause(),o&&c>=s.length&&tt.add(s.shape);const h=tt.has(s.shape)?s.length:Math.max(0,s.poster-(s.rest-e));Math.abs(a.currentTime-h)>1/q&&(a.currentTime=h)}},qt=(t,e)=>{const n=t.slide.transition;if(!n||e>=t.lead)return;const o=S.indexOf(t),s=S.slice(0,o).reverse().find(d=>!d.slide.hidden);if(!s)return;ft(s,s.part.still-s.part.start),s.el.style.visibility="visible";const a=Math.min(1,e/t.lead);if(n.type!=="morph"){const d=Vt(n,a),u=(r,_)=>`translate(${String(r*100)}%, ${String(_*100)}%)`,y=d.incoming.clip;L(t.el,{opacity:String(d.incoming.opacity),transform:u(d.incoming.x,d.incoming.y),...y?{clipPath:`inset(${String(y.top*100)}% ${String(y.right*100)}% ${String(y.bottom*100)}% ${String(y.left*100)}%)`}:{}}),L(s.el,{transform:u(d.outgoing.x,d.outgoing.y)});return}const c=new Map(s.slide.shapes.map(d=>[d.name,d]));L(t.el,{background:`color-mix(in srgb, ${getComputedStyle(t.el).backgroundColor} ${String(a*100)}%, transparent)`});const h=new Set;for(const d of t.slide.shapes){const u=Z(t,d.name);if(!u)continue;const y=c.get(d.name);if(!y){L(u,{opacity:String(a)});continue}h.add(d.name);const r=Jt(y.frame,d.frame,a),_=d.frame.width>0?r.width/d.frame.width:1,w=d.frame.height>0?r.height/d.frame.height:1;L(u,{transformOrigin:"0 0",transform:`translate(${String((r.left-d.frame.left)*g)}px, ${String((r.top-d.frame.top)*g)}px) scale(${String(_)}, ${String(w)}) ${u.style.transform}`})}for(const d of s.slide.shapes){const u=Z(s,d.name);u&&(h.has(d.name)?L(u,{visibility:"hidden"}):L(u,{opacity:String(1-a)}))}},ft=(t,e)=>{for(const n of t.targets){const o=t.slide.shapes.find(y=>y.name===n.shape),s=t.el.querySelector(`[${D}="${CSS.escape(`${t.slide.id}/${n.shape}`)}"]`);if(!o||!s)continue;const a=n.paragraph===void 0?s:s.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!a)continue;const c=dt.get(a)??{transform:a.style.transform,clipPath:a.style.clipPath};dt.set(a,c);const h=Yt(n.animations,e,o.frame,{width:b.width,height:b.height});a.style.visibility=h.hidden?"hidden":"",a.style.opacity=h.opacity===1?"":String(h.opacity);const d=h.x!==0||h.y!==0?`translate(${String(h.x*g)}px, ${String(h.y*g)}px)`:"",u=h.scale===1?"":`scale(${String(h.scale)})`;a.style.transform=[d,u,c.transform].filter(y=>y!=="").join(" "),a.style.clipPath=h.clip?`inset(${String(h.clip.top*100)}% ${String(h.clip.right*100)}% ${String(h.clip.bottom*100)}% ${String(h.clip.left*100)}%)`:c.clipPath}},Dt=(t,e)=>{if(e>0){const n=t.el.style.background;t.el.style.background="none",I.push(()=>{t.el.style.background=n})}for(const[n,o]of t.planes.entries())for(const s of n===e?[]:o){const a=s.style.visibility;s.style.visibility="hidden",I.push(()=>{s.style.visibility=a})}},H=async(t,e)=>{const n=Math.min(Math.max(0,t),X-1/q),o=S.find(a=>n<a.part.end-1e-6)??S[S.length-1];if(!o)return;for(const a of S)a.el.style.visibility=a===o?"visible":"hidden";lt=o,Pt.setMoment(n,`${v.seedBase}:${o.slide.id}`);const s=n-o.part.start;for(;I.length>0;)I.pop()?.();ft(o,s),qt(o,s),jt(o,s);for(const[a,c]of o.layers.entries())z({phase:"render",part:o.slide.id,layer:c.layer.component,index:a,t:n-o.part.start},()=>{c.layer.render(c.el,Math.max(0,s-c.from),c.props,c.ctx)});e!==void 0&&Dt(o,e),await Tt(vt*1e3)},et=()=>lt??S[0],Lt=de(p,g),mt=async t=>{await H(t);const e=et(),n=p.getBoundingClientRect(),o=n.width>0?M/n.width:1;return{m:e,blocks:e?St(e.el,p,M):[],scale:o}},Rt=()=>{const t=new Map,e=b.theme.fonts;for(const n of[e.major,e.minor,e.major_east_asian,e.minor_east_asian])t.set(nt(n),"theme");for(const n of b.slides)for(const o of n.shapes){const s=[...o.text?.style.levels.map(a=>a.font.name)??[],...o.text?.paragraphs.flatMap(a=>[a.font?.name,...a.runs.map(c=>c.font?.name)])??[]];for(const a of s)a!==void 0&&!a.startsWith("+")&&!t.has(nt(a))&&t.set(nt(a),"text")}return[...t].map(([n,o])=>({name:n,where:o}))},Ft=t=>{const e=t.text?.paragraphs[0],n=e?.alignment??t.text?.style.levels[e?.level??0]?.alignment;return n===void 0?{}:{align:n}},Ht=(t,e)=>{const n=p.getBoundingClientRect(),o=n.width>0?M/n.width:1,s=[],a=[],c=[],h=[],d=[],u=[],y=g*$t;return t.slide.shapes.forEach((r,_)=>{const w=t.el.querySelector(`[${D}="${CSS.escape(`${t.slide.id}/${r.name}`)}"]`);if(!w)return;const N=w.getBoundingClientRect(),l=[Math.round((N.left-n.left)*o),Math.round((N.top-n.top)*o),Math.round(N.width*o),Math.round(N.height*o)],P=getComputedStyle(w).visibility==="hidden",E=St(w,p,M).filter(f=>f.ink!==null&&f.runs.some(x=>getComputedStyle(x.el).visibility!=="hidden")),T=E.map(f=>pe([...new Set(f.runs.map(x=>x.el))],p,M));E.forEach((f,x)=>{const k=T[x]??[],A=Et(k);A&&(s.push({layer:r.name,z:"front",text:f.text,box:A,...f.opacity<1?{opacity:f.opacity}:{}}),a.push(_),c.push(f.containers),h.push(A),d.push(k))});const C={name:r.name,kind:r.geometry==="line"?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*g),Math.round(r.frame.top*g),Math.round(r.frame.width*g),Math.round(r.frame.height*g)],box:l,...P?{hidden:P}:{},opaque:r.kind==="picture"||r.kind==="movie"||r.geometry!=="line"&&r.fill!==void 0&&r.fill!==null};if(r.chart){const f=r.chart.series.flatMap(x=>x.values.filter(k=>k!==null));C.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...f.length>0?{low:Math.min(...f),high:Math.max(...f)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const f=[...w.querySelectorAll("tr")];C.rows=r.table.rows.map((x,k)=>({set:Math.round(x.height*g),drawn:Math.round((f[k]?.getBoundingClientRect().height??0)*o)}))}const K=T.flat();if(K.length>0){const f=new Map;for(const A of E)for(const j of A.runs){const gt=getComputedStyle(j.el),yt=Math.round(parseFloat(gt.fontSize)/y*10)/10,wt=parseInt(gt.fontWeight,10)||400,xt=`${String(yt)}/${String(wt)}`;f.has(xt)||f.set(xt,{size:yt,weight:wt,...A.xHeight===void 0?{}:{xHeight:Math.round(A.xHeight/y*10)/10}})}const x=E.map(A=>A.text).join(`
4
- `),k=w.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;C.text={text:x,words:oe(x).words,lines:K,glyphs:Et(K),type:[...f.values()],...k===void 0?{}:{scale:Number(k)},...Ft(r)}}const O=w.querySelector("img");if(O&&O.naturalWidth>0){const f=r.media?.crop??{left:0,top:0,right:0,bottom:0};C.picture={source:[O.naturalWidth,O.naturalHeight],shown:[Math.round(O.naturalWidth*(1-f.left-f.right)),Math.round(O.naturalHeight*(1-f.top-f.bottom))]}}u.push(C)}),{moment:ae({t:e,part:t.slide.id,texts:s,safe:At,width:M,height:F,owner:a,containers:c,seen:h,glyphs:d}),slide:{slide:t.slide.id,steps:t.part.steps?.length??1,t:e,layout:t.slide.layout,hidden:t.slide.hidden,...t.slide.notes===void 0?{}:{notes:t.slide.notes},shapes:u}}},ut={kind:"slides",get timeline(){return _t},async ready(){await Wt(p);for(const t of S){t.el.style.visibility="visible";for(const e of t.el.querySelectorAll("[data-ak-autofit='text']"))ce(e,g);t.el.style.visibility="hidden"}await Promise.all(ct),await H(S[0]?.part.still??0)},seek:(t,e)=>H(t,e?.plane),edit:(t,e)=>{Lt(t,e)},words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>S.map(t=>({key:t.slide.id,...t.slide.notes===void 0?{}:{notes:t.slide.notes},onScreen:t.slide.shapes.flatMap(e=>e.text&&!e.text.empty?[e.text.paragraphs.map(n=>n.runs.map(o=>o.text).join("")).join(`
5
- `)]:[])})),reads:()=>m.reads(it,S.map(t=>t.slide.id)),problems:()=>[...m.problems,...R.problems,...m.translationProblems()],stuck:()=>{},seekLimit:vt,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(S.map(t=>[t.slide.id,JSON.stringify({slide:t.slide,theme:b.theme,width:M,height:F})])),mixPlan:()=>({duration:X,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(t){const e=[],n=[];for(const o of t??S.flatMap(s=>s.part.steps??[s.part.still])){await H(o);const s=et();if(!s)continue;const a=Ht(s,o);e.push(a.moment),n.push(a.slide)}return{width:M,height:F,deck:{pxPerPt:g*$t,slides:n,fonts:Rt()},safe:At,moments:e,footage:[]}},tracks:()=>Promise.resolve([]),deck:()=>{const t={};for(const n of S)for(const o of n.el.querySelectorAll("[data-ak-font-scale]")){const s=o.closest(`[${D}]`)?.getAttribute(D),a=Number(o.dataset.akFontScale);s&&a<1&&(t[s]=a)}const e=v.combo.lang;return{width:b.width,height:b.height,theme:b.theme,masters:W.masters,slides:b.slides,fitted:t,...e===void 0?{}:{lang:e}}},async inks(t){const{blocks:e,scale:n}=await mt(t);return e.flatMap(o=>o.ink===null?[]:[{text:{layer:"slide",z:"front",text:o.text,box:o.box},...Bt(o,n)}])},async objects(t){const{m:e,blocks:n}=await mt(t),o=p.getBoundingClientRect(),s=o.width>0?M/o.width:1;return{t,elements:e?[...e.el.querySelectorAll(`[${D}]`)].map(a=>{const c=a.getBoundingClientRect();return{id:a.getAttribute(D)??"",box:[(c.left-o.left)*s,(c.top-o.top)*s,c.width*s,c.height*s]}}):[],texts:n.map(a=>({text:a.text,box:[a.box[0],a.box[1],a.box[2],a.box[3]],size:a.size,keys:m.keysShowing(a.text)}))}},signature:()=>{const t=et();if(!(!t||t.el.querySelector("canvas, video, iframe")))return bt(JSON.stringify(b.theme)+t.el.outerHTML)},async signatureAt(t){return await H(t),ut.signature()},async partSignature(t,e){const n=S.find(s=>s.slide.id===t);if(!n)return{unknown:`no slide ${t}`};const o=[];for(const s of e){if(await H(s),n.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};o.push(n.el.outerHTML)}return{sign:bt(o.join(`
6
- `)),owners:n.layers.map(s=>s.layer.component)}},ask:()=>Promise.resolve([]),dispose(){p.replaceChildren()}};return ut}const ge=i=>{const $=ye(i);return $===void 0?{}:{title:$}};function ye(i){const p=i.shapes.find(v=>v.placeholder?.type==="title"||v.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(v=>v.runs.map(m=>m.text).join("")).join(" ").trim();return p===void 0||p===""?void 0:p}function we(i){const $=p=>()=>{throw new Error(`${p} 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:$("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:zt}}
2
+ import{LoadFailure as G,consoleAt as F,consoleAtAsync as ot,createEnv as _e,domHash as Te,inkOfBlock as st,loadTextFonts as at,pictureWaiter as it,realTimers as rt,textBlocks as je}from"@allyhub-next/runtime/stage";import{animationTargets as ct,clockOf as lt,DECK_FPS as L,deckCode as De,drawnAt as dt,morphFrame as pt,transitionAt as ft,EMU_PER_INCH as qe,EMU_PER_PT as Le,evaluateDeck as ht,fontFace as le,isConnectorGeometry as Ne,isDeck as mt,isDeckCode as ut,resolveDeck as gt,slideSign as yt,themeOfLook as wt}from"@allyhub-next/slides-core";import{CLEAN_LOOK as Re,LAYER_BRAND as St,SEEK_LIMIT as de,countWords as xt,lookCss as kt,measureMoment as bt,messagePrefix as vt,problem as Fe}from"@allyhub-next/video-core";import{SLIDES_FILE as $t}from"@allyhub-next/formats";import{drawSlide as Mt,fitText as Ot,SHAPE_ATTR as N,themeCss as At}from"./draw.js";import{inkLines as Et,union as He}from"./ink.js";export const SLIDE_LAYER="slide",SLIDES_KEPT=5;const Ct=.5,Pt=.3,Ie={top:0,bottom:0,left:0,right:0};async function _t(i){i.muted=!1,await i.play().catch(async()=>{i.muted=!0,await i.play().catch(()=>{})})}function Tt(i){const b=u=>{if(i.peek(u)!==void 0)return i.s(u);const y=[...new Set(i.keysUnder(u).map(h=>h.slice(u.length+1).split(".")[0]).filter(h=>h!==void 0&&/^\d+$/u.test(h)))].sort((h,P)=>Number(h)-Number(P));if(y.length!==0)return y.map(h=>b(`${u}.${h}`)).filter(h=>h!==void 0)};return b}const Be=i=>!(i.kind==="placeholder"&&i.text?.empty===!0),jt=i=>typeof i=="object"&&i!==null&&i[St]==="graphic";export async function importDeck(i){for(const y of i.styles??[]){const h=document.createElement("link");h.rel="stylesheet",h.href=y;const P=new Promise(J=>{h.onload=J,h.onerror=J});document.head.append(h),await P}let b;try{b=await ot({phase:"module"},()=>import(i.module))}catch(y){const h=y instanceof Error?y:new Error(String(y));throw new G("load_failed",`Failed to load the deck's module: ${h.message}
3
+ ${h.stack??""}`)}const u=b.default;if(!mt(u))throw new G("no_content",`The default export of ${i.file} is not a presentation({ … }) from @allyhub/sdk/slides.`);try{return F({phase:"build"},()=>ht(u))}catch(y){throw new G("load_failed",`The deck's code failed: ${y instanceof Error?y.message:String(y)}`)}}export async function deckCodeOf(i,b){const{log:u}=_e(i,b),y=await importDeck(i);return{code:F({phase:"build"},()=>De(y,P=>u.readData(P))),theme:We(i)}}const We=i=>wt(i.looks?.clean??Re);export async function loadDeck(i,b,u){const y=_e(i,b),{log:h,ledger:P,guards:J}=y,[M,I]=i.format.split("x").map(Number);if(!(M>0&&I>0))throw new G("bad_format",`${i.piece} is drawn at ${i.format}: a deck's stage is WIDTHxHEIGHT pixels.`);const pe=await importDeck(i),fe=ut(i.code)?i.code:F({phase:"build"},()=>De(pe,e=>h.readData(e))),he=vt(i.piece),me=i.looks?.clean??Re,Q=i.file.split("/").slice(0,-1).join("/"),ue={file:`${Q===""?"":`${Q}/`}${$t}`},{deck:ze}=gt({code:fe,file:i.slides??{slides:[]},words:Tt(h),prefix:he,base:Q,theme:We(i),data:e=>h.readData(e)});let k=ze;if(k.slides.length===0)throw new G("no_parts","The deck has no slides to draw (AK-K003).");const S=M/k.width;Object.assign(u.style,{position:"relative",width:`${String(M)}px`,height:`${String(I)}px`,overflow:"hidden"});const ge=()=>{for(const[e,t]of Object.entries({...kt(me),...At(k.theme)}))u.style.setProperty(e,t)};ge(),u.replaceChildren();const X=b.purpose==="play";b.purpose==="render"&&(document.documentElement.style.background="transparent",document.body.style.background="transparent");const ye=new Map,Z=e=>ye.get(e)??h.mediaAt(e),Ke=e=>Z(e)?.url??"",ee=e=>Math.round(e*L)/L,U=y.combo.lang,Ge=(e,t,n)=>{const o=lt(e,t===0),{rests:s,comesOn:a,goesOff:p}=o,l=n+(s.at(-1)??0),g=e.shapes.flatMap(d=>d.kind!=="movie"||!d.media?[]:[{shape:d.name,from:a(d.name),poster:d.media.poster??0,length:Z(d.media.path)?.duration??0,rest:s.at(-1)??0}]),c=Math.max(l+1/L,...g.map(d=>n+d.from+d.length-d.poster)),f=[],r=[],$=new Map,m=[!1];for(const d of e.shapes){Be(d)&&($.set(d.name,m.length-1),m[m.length-1]=!0);const A=d.component&&Be(d)?pe.components[d.component.name]:void 0;if(A){const v=F({phase:"build",part:e.id},()=>A.layers(d.component?.props??{},{width:d.frame.width*S,height:d.frame.height*S,slide:e.id}));for(const T of v)jt(T)?f.push({shape:d.name,layer:T}):P.problems.push(Fe("AK-M011",`Component ${A.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:ue}))}if(d.kind==="movie"&&d.media&&!X&&Z(d.media.path)){const v=[d.frame.left*S,d.frame.top*S,d.frame.width*S,d.frame.height*S],T=ee(a(d.name)),j=p(d.name);r.push({part:e.id,file:d.media.path,start:n+T,end:j===void 0?c:n+ee(j),from:(d.media.poster??0)-((s.at(-1)??0)-T),speed:1,gainDb:0,audio:!1,fit:"cover",box:v,picture:v,over:m.length}),m.push(!1)}}for(;m.length>1&&m.at(-1)===!1;)m.pop();const _=m.length,ce=ee(l),V=d=>f.filter(A=>A.shape===d).map(A=>A.layer.component);return{slide:e,sign:yt(k,e),clock:o,movies:g,footage:r,planeOf:$,planes:_,made:f,part:{key:e.id,layers:[...new Set(f.map(d=>d.layer.component))],start:n,end:c,planes:Array.from({length:_},(d,A)=>({layers:[{component:SLIDE_LAYER,start:n,end:c},...e.shapes.filter(v=>$.get(v.name)===A).flatMap(v=>V(v.name)).map(v=>({component:v,start:n,end:c}))]})),still:ce,...s.length>1?{steps:s.map(d=>Math.round((n+d)*L)/L)}:{},...Dt(e),...e.hidden?{hidden:!0}:{}}}},we=e=>{let t=0;return e.slides.map((n,o)=>{const s=Ge(n,o,t);return t=s.part.end,s})};let x=we(k);const te=x.at(-1)?.part.end??0,Se={fps:L,width:M,height:I,paper:`${String(k.width/qe)}in ${String(k.height/qe)}in`,duration:te,background:k.theme.colors.lt1,parts:x.map(e=>e.part),cues:[],...x.some(e=>e.footage.length>0)?{footage:x.flatMap(e=>e.footage)}:{},audio:{}},O=new Map,ne=new Map;let H,B;const Je=async e=>{const{slide:t,part:n}=e,o=Mt(t,{k:S,url:Ke,editing:!1,playing:X,...U===void 0?{}:{lang:U},colors:k.theme.colors});o.style.visibility="hidden",u.append(o);const s=Array.from({length:e.planes},()=>[]),a=[],p=[];for(const l of t.shapes){const g=o.querySelector(`[${N}="${CSS.escape(`${t.id}/${l.name}`)}"]`);if(g){s[e.planeOf.get(l.name)??0]?.push(g);for(const[c,{layer:f}]of e.made.filter(r=>r.shape===l.name).entries()){const r=document.createElement("div");Object.assign(r.style,{position:"absolute",inset:"0px"}),g.append(r);const $=stageContext({look:me,width:l.frame.width*S,height:l.frame.height*S,start:n.start,end:n.end,combo:y.combo,format:i.format,asset:m=>h.asset(m),wait:m=>p.push(m),report:m=>P.problems.push(Fe(m.code,m.message,{part:t.id,where:ue}))});a.push({layer:f,el:r,ctx:$,props:f.props,from:e.clock.comesOn(l.name)}),F({phase:"mount",part:t.id,layer:f.component,index:c},()=>{f.mount(r,f.props,$)})}}}await at(o),o.style.visibility="visible";for(const l of o.querySelectorAll("[data-ak-autofit='text']"))Ot(l);return o.style.visibility="hidden",await Promise.all(p),{slide:t,slot:e,el:o,part:n,layers:a,targets:ct(e.clock.timed),lead:e.clock.lead,movies:e.movies,planes:s,pictures:it(o)}},Y=e=>{O.delete(e.slide.id);for(const[t,n]of e.layers.entries())F({phase:"mount",part:e.slide.id,layer:n.layer.component,index:t},()=>{n.layer.unmount?.(n.el,n.props,n.ctx)});e.el.remove(),H===e&&(H=void 0),B===e&&(B=void 0)},W=async e=>{const t=e.slide.id,n=O.get(t);if(n?.slot===e)return O.delete(t),O.set(t,n),n;n&&Y(n);let o=ne.get(t);o||(o=Je(e).finally(()=>ne.delete(t)),ne.set(t,o));const s=await o,a=se(t);return a&&a!==e?(s.el.remove(),W(a)):(O.set(t,s),s)},oe=()=>{for(const e of[...O.values()]){if(O.size<=SLIDES_KEPT)return;e!==H&&e!==B&&Y(e)}},se=e=>x.find(t=>t.slide.id===e),Ue=e=>{let t=0,n=x.length-1;for(;t<n;){const o=t+n>>1,s=x[o];s&&e<s.part.end-1e-6?n=o:t=o+1}return x[t]},Ye=e=>x.slice(0,x.indexOf(e)).reverse().find(t=>!t.slide.hidden),xe=new WeakMap,z=[],C=(e,t)=>{const n={...t};for(const o of Object.keys(t))n[o]=e.style[o];z.push(()=>{Object.assign(e.style,n)}),Object.assign(e.style,t)},ae=(e,t)=>e.el.querySelector(`[${N}="${CSS.escape(`${e.slide.id}/${t}`)}"]`);let ke;const be=(e,t)=>ae(e,t)?.querySelector("video")??void 0,ie=new Set,Ve=(e,t)=>{const n=ke;if(n&&n.m!==e){for(const s of n.m.movies)be(n.m,s.shape)?.pause();ie.clear()}const o=n?.m===e&&t>n.t&&t-n.t<Ct;ke={m:e,t};for(const s of e.movies){const a=be(e,s.shape);if(!a)continue;const p=s.poster+Math.max(0,t-s.from);if(o&&t>=s.from&&p<s.length){Math.abs(a.currentTime-p)>Pt&&(a.currentTime=p),a.paused&&_t(a);continue}a.pause(),o&&p>=s.length&&ie.add(s.shape);const l=ie.has(s.shape)?s.length:Math.max(0,s.poster-(s.rest-t));Math.abs(a.currentTime-l)>1/L&&(a.currentTime=l)}},Qe=(e,t)=>{const n=e.slide.transition;if(!n||t>=e.lead)return;const o=B;if(!o)return;ve(o,o.part.still-o.part.start),o.el.style.visibility="visible";const s=Math.min(1,t/e.lead);if(n.type!=="morph"){const c=ft(n,s),f=($,m)=>`translate(${String($*100)}%, ${String(m*100)}%)`,r=c.incoming.clip;C(e.el,{opacity:String(c.incoming.opacity),transform:f(c.incoming.x,c.incoming.y),...r?{clipPath:`inset(${String(r.top*100)}% ${String(r.right*100)}% ${String(r.bottom*100)}% ${String(r.left*100)}%)`}:{}}),C(o.el,{transform:f(c.outgoing.x,c.outgoing.y)});return}const a=new Map(o.slide.shapes.map(c=>[c.name,c]));C(e.el,{background:`color-mix(in srgb, ${getComputedStyle(e.el).backgroundColor} ${String(s*100)}%, transparent)`});const p=(c,f,r)=>{C(c,{left:`${String(r.left*S)}px`,top:`${String(r.top*S)}px`,width:`${String(r.width*S)}px`,height:`${String(r.height*S)}px`});const $=f.width>0?r.width/f.width:1,m=f.height>0?r.height/f.height:1;for(const _ of c.querySelectorAll(":scope > svg:not([viewBox])"))C(_,{transformOrigin:"0 0",transform:`scale(${String($)}, ${String(m)})`})},l=c=>JSON.stringify({...c,frame:void 0,sources:void 0}),g=new Map;for(const c of e.slide.shapes){const f=ae(e,c.name);if(!f)continue;const r=a.get(c.name);if(!r){C(f,{opacity:String(s)});continue}const $=pt(r.frame,c.frame,s),m=l(r)===l(c);g.set(c.name,{frame:$,same:m}),p(f,c.frame,$),m||C(f,{opacity:String(s)})}for(const c of o.slide.shapes){const f=ae(o,c.name);if(!f)continue;const r=g.get(c.name);r?r.same?C(f,{visibility:"hidden"}):(p(f,c.frame,r.frame),C(f,{opacity:String(1-s)})):C(f,{opacity:String(1-s)})}},ve=(e,t)=>{for(const n of e.targets){const o=e.slide.shapes.find(f=>f.name===n.shape),s=e.el.querySelector(`[${N}="${CSS.escape(`${e.slide.id}/${n.shape}`)}"]`);if(!o||!s)continue;const a=n.paragraph===void 0?s:s.querySelector(`[data-ak-paragraph="${String(n.paragraph)}"]`);if(!a)continue;const p=xe.get(a)??{transform:a.style.transform,clipPath:a.style.clipPath};xe.set(a,p);const l=dt(n.animations,t,o.frame,{width:k.width,height:k.height});a.style.visibility=l.hidden?"hidden":"",a.style.opacity=l.opacity===1?"":String(l.opacity);const g=l.x!==0||l.y!==0?`translate(${String(l.x*S)}px, ${String(l.y*S)}px)`:"",c=l.scale===1?"":`scale(${String(l.scale)})`;a.style.transform=[g,c,p.transform].filter(f=>f!=="").join(" "),a.style.clipPath=l.clip?`inset(${String(l.clip.top*100)}% ${String(l.clip.right*100)}% ${String(l.clip.bottom*100)}% ${String(l.clip.left*100)}%)`:p.clipPath}},Xe=(e,t)=>{if(t>0){const n=e.el.style.background;e.el.style.background="none",z.push(()=>{e.el.style.background=n})}for(const[n,o]of e.planes.entries())for(const s of n===t?[]:o){const a=s.style.visibility;s.style.visibility="hidden",z.push(()=>{s.style.visibility=a})}};let K;const R=async(e,t)=>{K={t:e,plane:t};const n=Math.min(Math.max(0,e),te-1/L),o=Ue(n);if(!o)return;const s=n-o.part.start,a=await W(o),p=o.slide.transition&&s<o.clock.lead?Ye(o):void 0,l=p?await W(p):void 0;if(K.t===e){for(const g of O.values())g.el.style.visibility=g===a?"visible":"hidden";for(H=a,B=l,J.setMoment(n,`${y.seedBase}:${a.slide.id}`);z.length>0;)z.pop()?.();ve(a,s),Qe(a,s),Ve(a,s);for(const[g,c]of a.layers.entries())F({phase:"render",part:a.slide.id,layer:c.layer.component,index:g,t:s},()=>{c.layer.render(c.el,Math.max(0,s-c.from),c.props,c.ctx)});if(t!==void 0&&Xe(a,t),await Promise.all([a.pictures(de*1e3),...l?[l.pictures(de*1e3)]:[]]),oe(),X){const g=x[x.indexOf(o)+1];g&&!O.has(g.slide.id)&&W(g).then(oe,()=>{})}}},re=()=>H,$e=async e=>{await R(e);const t=re(),n=u.getBoundingClientRect(),o=n.width>0?M/n.width:1;return{m:t,blocks:t?je(t.el,u,M):[],scale:o}},Ze=()=>{const e=new Map,t=k.theme.fonts;for(const n of[t.major,t.minor,t.major_east_asian,t.minor_east_asian])e.set(le(n),"theme");for(const n of k.slides)for(const o of n.shapes){const s=[...o.text?.style.levels.map(a=>a.font.name)??[],...o.text?.paragraphs.flatMap(a=>[a.font?.name,...a.runs.map(p=>p.font?.name)])??[]];for(const a of s)a!==void 0&&!a.startsWith("+")&&!e.has(le(a))&&e.set(le(a),"text")}return[...e].map(([n,o])=>({name:n,where:o}))},et=e=>{const t=e.text?.paragraphs[0],n=t?.alignment??e.text?.style.levels[t?.level??0]?.alignment;return n===void 0?{}:{align:n}},tt=(e,t)=>{const n=u.getBoundingClientRect(),o=n.width>0?M/n.width:1,s=[],a=[],p=[],l=[],g=[],c=[],f=S*Le;return e.slide.shapes.forEach((r,$)=>{const m=e.el.querySelector(`[${N}="${CSS.escape(`${e.slide.id}/${r.name}`)}"]`);if(!m)return;const _=m.getBoundingClientRect(),ce=[Math.round((_.left-n.left)*o),Math.round((_.top-n.top)*o),Math.round(_.width*o),Math.round(_.height*o)],V=getComputedStyle(m).visibility==="hidden",d=je(m,u,M).filter(w=>w.ink!==null&&w.runs.some(E=>getComputedStyle(E.el).visibility!=="hidden")),A=d.map(w=>Et([...new Set(w.runs.map(E=>E.el))],u,M));d.forEach((w,E)=>{const D=A[E]??[],q=He(D);q&&(s.push({layer:r.name,z:"front",text:w.text,box:q,...w.opacity<1?{opacity:w.opacity}:{}}),a.push($),p.push(w.containers),l.push(q),g.push(D))});const v={name:r.name,kind:Ne(r.geometry)?"line":r.kind,level:r.level,...r.placeholder?{placeholder:r.placeholder.type}:{},frame:[Math.round(r.frame.left*S),Math.round(r.frame.top*S),Math.round(r.frame.width*S),Math.round(r.frame.height*S)],box:ce,...V?{hidden:V}:{},opaque:r.kind==="picture"||r.kind==="movie"||!Ne(r.geometry)&&r.fill!==void 0&&r.fill!==null};if(r.chart){const w=r.chart.series.flatMap(E=>E.values.filter(D=>D!==null));v.chart={type:r.chart.type,categories:r.chart.categories.length,series:r.chart.series.length,...w.length>0?{low:Math.min(...w),high:Math.max(...w)}:{},...r.chart.source===void 0?{}:{source:r.chart.source}}}if(r.table){const w=[...m.querySelectorAll("tr")];v.rows=r.table.rows.map((E,D)=>({set:Math.round(E.height*S),drawn:Math.round((w[D]?.getBoundingClientRect().height??0)*o)}))}const T=A.flat();if(T.length>0){const w=new Map;for(const q of d)for(const nt of q.runs){const Ae=getComputedStyle(nt.el),Ee=Math.round(parseFloat(Ae.fontSize)/f*10)/10,Ce=parseInt(Ae.fontWeight,10)||400,Pe=`${String(Ee)}/${String(Ce)}`;w.has(Pe)||w.set(Pe,{size:Ee,weight:Ce,...q.xHeight===void 0?{}:{xHeight:Math.round(q.xHeight/f*10)/10}})}const E=d.map(q=>q.text).join(`
4
+ `),D=m.querySelector("[data-ak-font-scale]")?.dataset.akFontScale;v.text={text:E,words:xt(E).words,lines:T,glyphs:He(T),type:[...w.values()],...D===void 0?{}:{scale:Number(D)},...et(r)}}const j=m.querySelector("img");if(j&&j.naturalWidth>0){const w=r.media?.crop??{left:0,top:0,right:0,bottom:0};v.picture={source:[j.naturalWidth,j.naturalHeight],shown:[Math.round(j.naturalWidth*(1-w.left-w.right)),Math.round(j.naturalHeight*(1-w.top-w.bottom))]}}c.push(v)}),{moment:bt({t,part:e.slide.id,texts:s,safe:Ie,width:M,height:I,owner:a,containers:p,seen:l,glyphs:g}),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:c}}},Me=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])),Oe={kind:"slides",get timeline(){return Se},async ready(){await R(x[0]?.part.still??0)},seek:(e,t)=>R(e,t?.plane),async update(e,t){const n=e;for(const[p,l]of Object.entries(t??{}))ye.set(p,l);const o=k;k=n;const s=we(n);if(n.width!==o.width||n.height!==o.height||Me(s)!==Me(x))return k=o,{redrawn:[],reload:!0};const a=[];x=s.map((p,l)=>{const g=x[l];return g?.sign===p.sign?g:(a.push(p.slide.id),p)}),Se.parts=x.map(p=>p.part),ge();for(const p of[...O.values()])se(p.slide.id)!==p.slot&&Y(p);return K&&a.length>0&&await R(K.t,K.plane),{redrawn:a}},sheet:()=>H?.el,words:()=>[],lines:()=>[],captionOptions:()=>null,setPlaying:()=>{},text:()=>x.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:()=>h.reads(he,x.map(e=>e.slide.id)),problems:()=>[...h.problems,...P.problems,...h.translationProblems()],stuck:()=>{},seekLimit:de,facts:()=>[],says:()=>[],signs:()=>Object.fromEntries(x.map(e=>[e.slide.id,JSON.stringify({slide:JSON.parse(e.sign),width:M})])),mixPlan:()=>({duration:te,speech:[],footage:[],sfx:[]}),covers:()=>[],drawCover:()=>Promise.resolve(),async measure(e){const t=[],n=[];for(const o of e??x.flatMap(s=>s.part.steps??[s.part.still])){await R(o);const s=re();if(!s)continue;const a=tt(s,o);t.push(a.moment),n.push(a.slide)}return{width:M,height:I,deck:{pxPerPt:S*Le,slides:n,fonts:Ze()},safe:Ie,moments:t,footage:[]}},tracks:()=>Promise.resolve([]),async deck(){const e={};for(const t of x){const n=await W(t);for(const o of n.el.querySelectorAll("[data-ak-font-scale]")){const s=o.closest(`[${N}]`)?.getAttribute(N),a=Number(o.dataset.akFontScale);s&&a<1&&(e[s]=a)}oe()}return{width:k.width,height:k.height,theme:k.theme,masters:fe.masters,slides:k.slides,fitted:e,...U===void 0?{}:{lang:U}}},async inks(e){const{blocks:t,scale:n}=await $e(e);return t.flatMap(o=>o.ink===null?[]:[{text:{layer:"slide",z:"front",text:o.text,box:o.box},...st(o,n)}])},async objects(e){const{m:t,blocks:n}=await $e(e),o=u.getBoundingClientRect(),s=o.width>0?M/o.width:1;return{t:e,elements:t?[...t.el.querySelectorAll(`[${N}]`)].map(a=>{const p=a.getBoundingClientRect();return{id:a.getAttribute(N)??"",box:[(p.left-o.left)*s,(p.top-o.top)*s,p.width*s,p.height*s]}}):[],texts:n.map(a=>({text:a.text,box:[a.box[0],a.box[1],a.box[2],a.box[3]],size:a.size,keys:h.keysShowing(a.text)}))}},signature:()=>{const e=re();if(!(!e||e.el.querySelector("canvas, video, iframe")))return Te(JSON.stringify(k.theme)+e.el.outerHTML)},async signatureAt(e){return await R(e),Oe.signature()},async partSignature(e,t){const n=se(e);if(!n)return{unknown:`no slide ${e}`};const o=[];for(const s of t){await R(s);const a=O.get(e);if(!a)return{unknown:`slide ${e} is not at ${String(s)}`};if(a.el.querySelector("canvas, video, iframe"))return{unknown:"a canvas, a video or a frame on the slide"};o.push(a.el.outerHTML)}return{sign:Te(o.join(`
6
+ `)),owners:[...new Set(n.made.map(s=>s.layer.component))]}},ask:()=>Promise.resolve([]),dispose(){for(const e of[...O.values()])Y(e);u.replaceChildren()}};return Oe}const Dt=i=>{const b=qt(i);return b===void 0?{}:{title:b}};function qt(i){const u=i.shapes.find(y=>y.placeholder?.type==="title"||y.placeholder?.type==="ctrTitle")?.text?.paragraphs.map(y=>y.runs.map(h=>h.text).join("")).join(" ").trim();return u===void 0||u===""?void 0:u}export function stageContext(i){const b=u=>()=>{throw new Error(`${u} 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:b("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:rt}}
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@allyhub-next/slides-runtime",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
8
8
  "default": "./dist/index.js"
9
+ },
10
+ "./draw": {
11
+ "types": "./dist/draw.d.ts",
12
+ "default": "./dist/draw.js"
9
13
  }
10
14
  },
11
15
  "sideEffects": false,