@allyhub/sdk 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/NOTICE +46 -49
  3. package/dist/dom.d.ts +1 -209
  4. package/dist/dom.js +1 -1
  5. package/dist/image.d.ts +2 -0
  6. package/dist/image.js +2 -0
  7. package/dist/index.d.ts +1 -21
  8. package/dist/index.js +1 -1
  9. package/dist/media.d.ts +1 -5
  10. package/dist/media.js +1 -1
  11. package/dist/node_modules/@allyhub/audio/dist/levels.d.ts +4 -5
  12. package/dist/node_modules/@allyhub/audio/dist/levels.js +1 -1
  13. package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.d.ts +1 -6
  14. package/dist/node_modules/@allyhub/audio/dist/node/ffmpeg.js +1 -1
  15. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  16. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
  17. package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +4 -1
  18. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  19. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
  20. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  21. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  22. package/dist/node_modules/@allyhub/diagnostics/LICENSE +241 -0
  23. package/dist/node_modules/@allyhub/diagnostics/dist/fact.d.ts +37 -0
  24. package/dist/node_modules/@allyhub/diagnostics/dist/fact.js +2 -0
  25. package/dist/node_modules/@allyhub/diagnostics/dist/index.d.ts +4 -0
  26. package/dist/node_modules/@allyhub/diagnostics/dist/index.js +2 -0
  27. package/dist/node_modules/@allyhub/diagnostics/dist/problem.d.ts +43 -0
  28. package/dist/node_modules/@allyhub/diagnostics/dist/problem.js +2 -0
  29. package/dist/node_modules/@allyhub/diagnostics/dist/rules.d.ts +30 -0
  30. package/dist/node_modules/@allyhub/diagnostics/dist/rules.js +2 -0
  31. package/dist/node_modules/@allyhub/diagnostics/package.json +14 -0
  32. package/dist/node_modules/@allyhub/formats/dist/contributed.d.ts +126 -0
  33. package/dist/node_modules/@allyhub/formats/dist/contributed.js +2 -0
  34. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  35. package/dist/node_modules/@allyhub/formats/dist/data/reference.d.ts +7 -12
  36. package/dist/node_modules/@allyhub/formats/dist/data/reference.js +1 -1
  37. package/dist/node_modules/@allyhub/formats/dist/data/script.d.ts +9 -4
  38. package/dist/node_modules/@allyhub/formats/dist/data/script.js +1 -1
  39. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +107 -83
  40. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  41. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +185 -8
  42. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  43. package/dist/node_modules/@allyhub/formats/dist/data/website.d.ts +2 -1
  44. package/dist/node_modules/@allyhub/formats/dist/data/website.js +1 -1
  45. package/dist/node_modules/@allyhub/formats/dist/data/work.d.ts +42 -0
  46. package/dist/node_modules/@allyhub/formats/dist/data/work.js +2 -0
  47. package/dist/node_modules/@allyhub/formats/dist/extension.d.ts +91 -0
  48. package/dist/node_modules/@allyhub/formats/dist/extension.js +2 -0
  49. package/dist/node_modules/@allyhub/formats/dist/files.d.ts +51 -0
  50. package/dist/node_modules/@allyhub/formats/dist/files.js +2 -0
  51. package/dist/node_modules/@allyhub/formats/dist/index.d.ts +5 -1
  52. package/dist/node_modules/@allyhub/formats/dist/index.js +1 -1
  53. package/dist/node_modules/@allyhub/formats/dist/items.d.ts +226 -90
  54. package/dist/node_modules/@allyhub/formats/dist/items.js +1 -1
  55. package/dist/node_modules/@allyhub/formats/dist/layout.d.ts +7 -1
  56. package/dist/node_modules/@allyhub/formats/dist/layout.js +1 -1
  57. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +96 -42
  58. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  59. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  60. package/dist/node_modules/@allyhub/image-draw/LICENSE +241 -0
  61. package/dist/node_modules/@allyhub/image-draw/dist/context.d.ts +5 -0
  62. package/dist/node_modules/@allyhub/image-draw/dist/context.js +2 -0
  63. package/dist/node_modules/@allyhub/image-draw/dist/contrast.d.ts +13 -0
  64. package/dist/node_modules/@allyhub/image-draw/dist/contrast.js +2 -0
  65. package/dist/node_modules/@allyhub/image-draw/dist/env.d.ts +112 -0
  66. package/dist/node_modules/@allyhub/image-draw/dist/env.js +2 -0
  67. package/dist/node_modules/@allyhub/image-draw/dist/errors.d.ts +20 -0
  68. package/dist/node_modules/@allyhub/image-draw/dist/errors.js +2 -0
  69. package/dist/node_modules/@allyhub/image-draw/dist/fonts.d.ts +110 -0
  70. package/dist/node_modules/@allyhub/image-draw/dist/fonts.js +2 -0
  71. package/dist/node_modules/@allyhub/image-draw/dist/guards.d.ts +32 -0
  72. package/dist/node_modules/@allyhub/image-draw/dist/guards.js +2 -0
  73. package/dist/node_modules/@allyhub/image-draw/dist/hash.d.ts +3 -0
  74. package/dist/node_modules/@allyhub/image-draw/dist/hash.js +2 -0
  75. package/dist/node_modules/@allyhub/image-draw/dist/inspect.d.ts +113 -0
  76. package/dist/node_modules/@allyhub/image-draw/dist/inspect.js +3 -0
  77. package/dist/node_modules/@allyhub/image-draw/dist/layer-style.d.ts +151 -0
  78. package/dist/node_modules/@allyhub/image-draw/dist/layer-style.js +2 -0
  79. package/dist/node_modules/@allyhub/image-draw/dist/paint.d.ts +29 -0
  80. package/dist/node_modules/@allyhub/image-draw/dist/paint.js +2 -0
  81. package/dist/node_modules/@allyhub/image-draw/dist/pictures.d.ts +39 -0
  82. package/dist/node_modules/@allyhub/image-draw/dist/pictures.js +2 -0
  83. package/dist/node_modules/@allyhub/image-draw/dist/plan.d.ts +52 -0
  84. package/dist/node_modules/@allyhub/image-draw/dist/plan.js +2 -0
  85. package/dist/node_modules/@allyhub/image-draw/dist/reads.d.ts +145 -0
  86. package/dist/node_modules/@allyhub/image-draw/dist/reads.js +2 -0
  87. package/dist/node_modules/@allyhub/image-draw/dist/shape-path.d.ts +26 -0
  88. package/dist/node_modules/@allyhub/image-draw/dist/shape-path.js +2 -0
  89. package/dist/node_modules/@allyhub/image-draw/dist/stage.d.ts +56 -0
  90. package/dist/node_modules/@allyhub/image-draw/dist/stage.js +2 -0
  91. package/dist/node_modules/@allyhub/image-draw/dist/styles.d.ts +35 -0
  92. package/dist/node_modules/@allyhub/image-draw/dist/styles.js +2 -0
  93. package/dist/node_modules/@allyhub/image-draw/dist/tone.d.ts +53 -0
  94. package/dist/node_modules/@allyhub/image-draw/dist/tone.js +2 -0
  95. package/dist/node_modules/@allyhub/image-draw/package.json +14 -0
  96. package/dist/node_modules/@allyhub/image-measure/LICENSE +241 -0
  97. package/dist/node_modules/@allyhub/image-measure/dist/contrast.d.ts +43 -0
  98. package/dist/node_modules/@allyhub/image-measure/dist/contrast.js +2 -0
  99. package/dist/node_modules/@allyhub/image-measure/dist/layout.d.ts +186 -0
  100. package/dist/node_modules/@allyhub/image-measure/dist/layout.js +5 -0
  101. package/dist/node_modules/@allyhub/image-measure/package.json +14 -0
  102. package/dist/node_modules/@allyhub/image-sdk/LICENSE +241 -0
  103. package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.d.ts +13 -0
  104. package/dist/node_modules/@allyhub/image-sdk/dist/adjustment.js +2 -0
  105. package/dist/{define.d.ts → node_modules/@allyhub/image-sdk/dist/define.d.ts} +21 -4
  106. package/dist/node_modules/@allyhub/image-sdk/dist/define.js +2 -0
  107. package/dist/node_modules/@allyhub/image-sdk/dist/dom.d.ts +210 -0
  108. package/dist/node_modules/@allyhub/image-sdk/dist/dom.js +2 -0
  109. package/dist/node_modules/@allyhub/image-sdk/dist/fill.d.ts +21 -0
  110. package/dist/node_modules/@allyhub/image-sdk/dist/fill.js +2 -0
  111. package/dist/node_modules/@allyhub/image-sdk/dist/group.d.ts +17 -0
  112. package/dist/node_modules/@allyhub/image-sdk/dist/group.js +2 -0
  113. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +166 -0
  114. package/dist/node_modules/@allyhub/image-sdk/dist/index.js +2 -0
  115. package/dist/node_modules/@allyhub/image-sdk/dist/media.d.ts +6 -0
  116. package/dist/node_modules/@allyhub/image-sdk/dist/media.js +2 -0
  117. package/dist/{messages.d.ts → node_modules/@allyhub/image-sdk/dist/messages.d.ts} +1 -1
  118. package/dist/node_modules/@allyhub/image-sdk/dist/picture.d.ts +59 -0
  119. package/dist/node_modules/@allyhub/image-sdk/dist/picture.js +2 -0
  120. package/dist/{props.d.ts → node_modules/@allyhub/image-sdk/dist/props.d.ts} +4 -4
  121. package/dist/node_modules/@allyhub/image-sdk/dist/shape.d.ts +34 -0
  122. package/dist/node_modules/@allyhub/image-sdk/dist/shape.js +2 -0
  123. package/dist/node_modules/@allyhub/image-sdk/dist/stack.d.ts +16 -0
  124. package/dist/node_modules/@allyhub/image-sdk/dist/stack.js +2 -0
  125. package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.d.ts +38 -0
  126. package/dist/node_modules/@allyhub/image-sdk/dist/text-layer.js +2 -0
  127. package/dist/{written.js → node_modules/@allyhub/image-sdk/dist/written.js} +1 -1
  128. package/dist/node_modules/@allyhub/image-sdk/package.json +19 -0
  129. package/dist/node_modules/@allyhub/measure/LICENSE +241 -0
  130. package/dist/node_modules/@allyhub/measure/dist/compare.d.ts +195 -0
  131. package/dist/node_modules/@allyhub/measure/dist/compare.js +2 -0
  132. package/dist/node_modules/@allyhub/measure/dist/grain.d.ts +8 -0
  133. package/dist/node_modules/@allyhub/measure/dist/grain.js +2 -0
  134. package/dist/node_modules/@allyhub/measure/dist/image.d.ts +16 -0
  135. package/dist/node_modules/@allyhub/measure/dist/image.js +2 -0
  136. package/dist/node_modules/@allyhub/measure/dist/index.d.ts +4 -0
  137. package/dist/node_modules/@allyhub/measure/dist/index.js +2 -0
  138. package/dist/node_modules/@allyhub/measure/package.json +13 -0
  139. package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.d.ts +4 -1
  140. package/dist/node_modules/@allyhub/ooxml/dist/generated/presets.js +1 -1
  141. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.d.ts +15 -1
  142. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  143. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  144. package/dist/node_modules/@allyhub/piece/LICENSE +241 -0
  145. package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.d.ts +1 -9
  146. package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.js +1 -1
  147. package/dist/node_modules/@allyhub/piece/dist/context.d.ts +39 -0
  148. package/dist/node_modules/@allyhub/piece/dist/context.js +2 -0
  149. package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.d.ts +2 -2
  150. package/dist/node_modules/@allyhub/{video-core → piece}/dist/export.d.ts +27 -10
  151. package/dist/node_modules/@allyhub/piece/dist/export.js +2 -0
  152. package/dist/node_modules/@allyhub/{video-core → piece}/dist/formats.d.ts +12 -68
  153. package/dist/node_modules/@allyhub/piece/dist/formats.js +2 -0
  154. package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +104 -0
  155. package/dist/node_modules/@allyhub/piece/dist/index.d.ts +26 -0
  156. package/dist/node_modules/@allyhub/piece/dist/index.js +2 -0
  157. package/dist/node_modules/@allyhub/piece/dist/layer-style.d.ts +1558 -0
  158. package/dist/node_modules/@allyhub/piece/dist/layer-style.js +2 -0
  159. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +389 -0
  160. package/dist/node_modules/@allyhub/piece/dist/layer.js +2 -0
  161. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +437 -0
  162. package/dist/node_modules/@allyhub/piece/dist/layout.js +2 -0
  163. package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.d.ts +1 -1
  164. package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.d.ts +39 -9
  165. package/dist/node_modules/@allyhub/{video-core → piece}/dist/media.js +1 -1
  166. package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.d.ts +6 -0
  167. package/dist/node_modules/@allyhub/piece/dist/names.d.ts +26 -0
  168. package/dist/node_modules/@allyhub/piece/dist/names.js +2 -0
  169. package/dist/node_modules/@allyhub/piece/dist/page/console.d.ts +21 -0
  170. package/dist/node_modules/@allyhub/piece/dist/page/console.js +2 -0
  171. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +3 -0
  172. package/dist/node_modules/@allyhub/piece/dist/page/index.js +2 -0
  173. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +4 -0
  174. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +2 -0
  175. package/dist/node_modules/@allyhub/piece/dist/picture.d.ts +62 -0
  176. package/dist/node_modules/@allyhub/piece/dist/picture.js +2 -0
  177. package/dist/node_modules/@allyhub/piece/dist/piece.d.ts +15 -0
  178. package/dist/node_modules/@allyhub/piece/dist/piece.js +2 -0
  179. package/dist/node_modules/@allyhub/{video-core → piece}/dist/script.d.ts +9 -4
  180. package/dist/node_modules/@allyhub/piece/dist/script.js +2 -0
  181. package/dist/node_modules/@allyhub/piece/dist/source.d.ts +131 -0
  182. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +291 -0
  183. package/dist/node_modules/@allyhub/piece/dist/stage.js +2 -0
  184. package/dist/node_modules/@allyhub/piece/dist/version.d.ts +15 -0
  185. package/dist/node_modules/@allyhub/piece/dist/version.js +2 -0
  186. package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.d.ts +1 -20
  187. package/dist/node_modules/@allyhub/piece/package.json +18 -0
  188. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +271 -0
  189. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  190. package/dist/node_modules/@allyhub/protocol/dist/app.d.ts +3 -10
  191. package/dist/node_modules/@allyhub/protocol/dist/app.js +1 -1
  192. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  193. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  194. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  195. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  196. package/dist/node_modules/@allyhub/protocol/dist/cli.d.ts +12 -1
  197. package/dist/node_modules/@allyhub/protocol/dist/cli.js +1 -1
  198. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +155 -0
  199. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  200. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +235 -133
  201. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  202. package/dist/node_modules/@allyhub/protocol/dist/files.d.ts +2 -0
  203. package/dist/node_modules/@allyhub/protocol/dist/files.js +1 -1
  204. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +65 -197
  205. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  206. package/dist/node_modules/@allyhub/protocol/dist/image.d.ts +8 -0
  207. package/dist/node_modules/@allyhub/protocol/dist/image.js +2 -0
  208. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +6 -0
  209. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  210. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
  211. package/dist/node_modules/@allyhub/protocol/dist/kinds.d.ts +98 -0
  212. package/dist/node_modules/@allyhub/protocol/dist/kinds.js +2 -0
  213. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +274 -0
  214. package/dist/node_modules/@allyhub/protocol/dist/mail.js +2 -0
  215. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +77 -91
  216. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  217. package/dist/node_modules/@allyhub/protocol/dist/peer.d.ts +59 -0
  218. package/dist/node_modules/@allyhub/protocol/dist/peer.js +2 -0
  219. package/dist/node_modules/@allyhub/protocol/dist/place.d.ts +21 -0
  220. package/dist/node_modules/@allyhub/protocol/dist/place.js +2 -0
  221. package/dist/node_modules/@allyhub/protocol/dist/presence.d.ts +125 -0
  222. package/dist/node_modules/@allyhub/protocol/dist/presence.js +2 -0
  223. package/dist/node_modules/@allyhub/protocol/dist/registry.d.ts +1 -1
  224. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  225. package/dist/node_modules/@allyhub/protocol/dist/shape.d.ts +35 -0
  226. package/dist/node_modules/@allyhub/protocol/dist/shape.js +2 -0
  227. package/dist/node_modules/@allyhub/protocol/dist/shares.d.ts +2 -8
  228. package/dist/node_modules/@allyhub/protocol/dist/shares.js +1 -1
  229. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +70 -40
  230. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  231. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +224 -177
  232. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  233. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  234. package/dist/node_modules/@allyhub/runtimes/dist/bundled.js +1 -1
  235. package/dist/node_modules/@allyhub/runtimes/dist/declared.d.ts +14 -0
  236. package/dist/node_modules/@allyhub/runtimes/dist/declared.js +2 -0
  237. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.d.ts +15 -0
  238. package/dist/node_modules/@allyhub/runtimes/dist/ffmpeg.js +2 -0
  239. package/dist/node_modules/@allyhub/runtimes/dist/index.d.ts +2 -0
  240. package/dist/node_modules/@allyhub/runtimes/dist/index.js +1 -1
  241. package/dist/node_modules/@allyhub/runtimes/dist/packages.js +3 -3
  242. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.d.ts +1 -0
  243. package/dist/node_modules/@allyhub/runtimes/dist/runtimes.js +1 -1
  244. package/dist/node_modules/@allyhub/runtimes/manifest.json +0 -82
  245. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  246. package/dist/node_modules/@allyhub/scenery/dist/define.d.ts +2 -0
  247. package/dist/node_modules/@allyhub/scenery/dist/define.js +1 -1
  248. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  249. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  250. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  251. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  252. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  253. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  254. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  255. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  256. package/dist/node_modules/@allyhub/sheet/dist/api/code.d.ts +4 -4
  257. package/dist/node_modules/@allyhub/sheet/dist/api/code.js +1 -1
  258. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +15 -11
  259. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  260. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  261. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  262. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  263. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  264. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  265. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  266. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  267. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  268. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  269. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  270. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  271. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  272. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  273. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  274. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  275. package/dist/node_modules/@allyhub/sheet/dist/calc/server.d.ts +1 -1
  276. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  277. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  278. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  279. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  280. package/dist/node_modules/@allyhub/sheet/dist/export.js +1 -1
  281. package/dist/node_modules/@allyhub/sheet/dist/file.d.ts +5 -0
  282. package/dist/node_modules/@allyhub/sheet/dist/file.js +1 -1
  283. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  284. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  285. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  286. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  287. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  288. package/dist/node_modules/@allyhub/sheet/dist/generated.d.ts +5 -19
  289. package/dist/node_modules/@allyhub/sheet/dist/generated.js +1 -1
  290. package/dist/node_modules/@allyhub/sheet/dist/import.d.ts +3 -1
  291. package/dist/node_modules/@allyhub/sheet/dist/import.js +1 -1
  292. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +5 -5
  293. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  294. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +88 -3
  295. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  296. package/dist/node_modules/@allyhub/sheet/dist/patch.d.ts +1 -1
  297. package/dist/node_modules/@allyhub/sheet/dist/patch.js +1 -1
  298. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  299. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  300. package/dist/node_modules/@allyhub/sheet/dist/sdk.d.ts +2 -0
  301. package/dist/node_modules/@allyhub/sheet/dist/sdk.js +2 -0
  302. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  303. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  304. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +8 -6
  305. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  306. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  307. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  308. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  309. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  310. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +2 -1
  311. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  312. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  313. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  314. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  315. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  316. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  317. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  318. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  319. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  320. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  321. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  322. package/dist/node_modules/@allyhub/sheet/package.json +5 -1
  323. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +23 -7
  324. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  325. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +101 -11
  326. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  327. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  328. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +18 -1
  329. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  330. package/dist/node_modules/@allyhub/slides-core/dist/code.d.ts +1 -1
  331. package/dist/node_modules/@allyhub/slides-core/dist/connect.d.ts +62 -0
  332. package/dist/node_modules/@allyhub/slides-core/dist/connect.js +2 -0
  333. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  334. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  335. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +223 -0
  336. package/dist/node_modules/@allyhub/slides-core/dist/fact.js +2 -0
  337. package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +4 -4
  338. package/dist/node_modules/@allyhub/slides-core/dist/file.js +2 -2
  339. package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +2 -0
  340. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  341. package/dist/node_modules/@allyhub/slides-core/dist/measure.d.ts +4 -2
  342. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  343. package/dist/node_modules/@allyhub/slides-core/dist/merge.d.ts +5 -5
  344. package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
  345. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +25 -4
  346. package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +1 -1
  347. package/dist/node_modules/@allyhub/slides-core/dist/path.d.ts +1 -1
  348. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +20 -11
  349. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  350. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +18 -0
  351. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +2 -0
  352. package/dist/node_modules/@allyhub/slides-core/dist/stage.d.ts +28 -11
  353. package/dist/node_modules/@allyhub/slides-core/dist/units.d.ts +3 -6
  354. package/dist/node_modules/@allyhub/slides-core/dist/units.js +1 -1
  355. package/dist/node_modules/@allyhub/slides-core/package.json +5 -1
  356. package/dist/node_modules/@allyhub/video-core/dist/audio-types.d.ts +1 -2
  357. package/dist/node_modules/@allyhub/video-core/dist/captions.d.ts +1 -10
  358. package/dist/node_modules/@allyhub/video-core/dist/captions.js +1 -1
  359. package/dist/node_modules/@allyhub/video-core/dist/check.d.ts +62 -0
  360. package/dist/node_modules/@allyhub/video-core/dist/check.js +2 -0
  361. package/dist/node_modules/@allyhub/video-core/dist/cut-report.d.ts +2 -2
  362. package/dist/node_modules/@allyhub/video-core/dist/cut-report.js +1 -1
  363. package/dist/node_modules/@allyhub/video-core/dist/edits.d.ts +3 -3
  364. package/dist/node_modules/@allyhub/video-core/dist/edits.js +1 -1
  365. package/dist/node_modules/@allyhub/video-core/dist/fact.d.ts +21 -762
  366. package/dist/node_modules/@allyhub/video-core/dist/fact.js +1 -1
  367. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.d.ts +3 -2
  368. package/dist/node_modules/@allyhub/video-core/dist/footage-motion.js +1 -1
  369. package/dist/node_modules/@allyhub/video-core/dist/index.d.ts +3 -17
  370. package/dist/node_modules/@allyhub/video-core/dist/index.js +1 -1
  371. package/dist/node_modules/@allyhub/video-core/dist/measure.d.ts +72 -423
  372. package/dist/node_modules/@allyhub/video-core/dist/measure.js +1 -4
  373. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.d.ts +44 -0
  374. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +2 -0
  375. package/dist/node_modules/@allyhub/video-core/dist/motion.d.ts +1 -1
  376. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +24 -432
  377. package/dist/node_modules/@allyhub/video-core/dist/piece.js +1 -1
  378. package/dist/node_modules/@allyhub/video-core/dist/placement.d.ts +1 -1
  379. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +8 -14
  380. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  381. package/dist/node_modules/@allyhub/video-core/dist/script-edit.d.ts +11 -6
  382. package/dist/node_modules/@allyhub/video-core/dist/script-edit.js +1 -1
  383. package/dist/node_modules/@allyhub/video-core/dist/seams.d.ts +2 -3
  384. package/dist/node_modules/@allyhub/video-core/dist/sound-under.d.ts +2 -2
  385. package/dist/node_modules/@allyhub/video-core/dist/sound-under.js +1 -1
  386. package/dist/node_modules/@allyhub/video-core/dist/speech.d.ts +2 -4
  387. package/dist/node_modules/@allyhub/video-core/dist/speech.js +2 -2
  388. package/dist/node_modules/@allyhub/video-core/dist/stage.d.ts +52 -0
  389. package/dist/node_modules/@allyhub/video-core/dist/stage.js +2 -0
  390. package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +18 -136
  391. package/dist/node_modules/@allyhub/video-core/dist/timeline.js +1 -1
  392. package/dist/node_modules/@allyhub/video-core/dist/timing.d.ts +3 -3
  393. package/dist/node_modules/@allyhub/video-core/dist/timing.js +1 -1
  394. package/dist/node_modules/@allyhub/video-core/dist/transcript.d.ts +2 -2
  395. package/dist/node_modules/@allyhub/video-core/dist/transcript.js +1 -1
  396. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  397. package/dist/node_modules/@allyhub/video-sdk/LICENSE +241 -0
  398. package/dist/node_modules/@allyhub/video-sdk/NOTICE +118 -0
  399. package/dist/{free.d.ts → node_modules/@allyhub/video-sdk/dist/free.d.ts} +14 -10
  400. package/dist/node_modules/@allyhub/video-sdk/dist/free.js +2 -0
  401. package/dist/node_modules/@allyhub/video-sdk/dist/index.d.ts +28 -0
  402. package/dist/node_modules/@allyhub/video-sdk/dist/index.js +2 -0
  403. package/dist/{input.d.ts → node_modules/@allyhub/video-sdk/dist/input.d.ts} +76 -22
  404. package/dist/node_modules/@allyhub/video-sdk/dist/input.js +2 -0
  405. package/dist/{module.d.ts → node_modules/@allyhub/video-sdk/dist/module.d.ts} +6 -4
  406. package/dist/node_modules/@allyhub/video-sdk/dist/module.js +2 -0
  407. package/dist/{parts.d.ts → node_modules/@allyhub/video-sdk/dist/parts.d.ts} +15 -6
  408. package/dist/node_modules/@allyhub/video-sdk/dist/parts.js +2 -0
  409. package/dist/{phone.d.ts → node_modules/@allyhub/video-sdk/dist/phone.d.ts} +12 -5
  410. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +2 -0
  411. package/dist/{piece.d.ts → node_modules/@allyhub/video-sdk/dist/piece.d.ts} +26 -16
  412. package/dist/node_modules/@allyhub/video-sdk/dist/piece.js +2 -0
  413. package/dist/node_modules/@allyhub/video-sdk/dist/route.d.ts +46 -0
  414. package/dist/node_modules/@allyhub/video-sdk/dist/route.js +2 -0
  415. package/dist/node_modules/@allyhub/video-sdk/dist/scenery.d.ts +2 -0
  416. package/dist/node_modules/@allyhub/video-sdk/dist/scenery.js +2 -0
  417. package/dist/node_modules/@allyhub/video-sdk/package.json +19 -0
  418. package/dist/scenery.d.ts +1 -1
  419. package/dist/scenery.js +1 -1
  420. package/dist/sheets.d.ts +1 -1
  421. package/dist/sheets.js +1 -1
  422. package/dist/slides.d.ts +1 -9
  423. package/dist/slides.js +1 -1
  424. package/docs/README.md +10 -6
  425. package/docs/batches.md +5 -5
  426. package/docs/canvas.md +28 -0
  427. package/docs/contract.md +2 -2
  428. package/docs/defaults.md +298 -22
  429. package/docs/docs.md +80 -66
  430. package/docs/footage.md +7 -7
  431. package/docs/image.md +165 -0
  432. package/docs/layers.md +22 -13
  433. package/docs/modeling.md +4 -4
  434. package/docs/pictures.md +65 -0
  435. package/docs/project.md +51 -31
  436. package/docs/scenery.md +14 -15
  437. package/docs/sheets.md +46 -28
  438. package/docs/slides.md +121 -67
  439. package/docs/sound.md +3 -3
  440. package/docs/speech.md +8 -8
  441. package/docs/video.md +16 -13
  442. package/docs/websites.md +4 -4
  443. package/docs/x.md +73 -0
  444. package/package.json +7 -2
  445. package/dist/define.js +0 -2
  446. package/dist/free.js +0 -2
  447. package/dist/input.js +0 -2
  448. package/dist/module.js +0 -2
  449. package/dist/node_modules/@allyhub/formats/dist/data/comments.d.ts +0 -94
  450. package/dist/node_modules/@allyhub/formats/dist/data/comments.js +0 -2
  451. package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package-lock.json +0 -227
  452. package/dist/node_modules/@allyhub/runtimes/pins/onnxruntime-node/package.json +0 -8
  453. package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package-lock.json +0 -105
  454. package/dist/node_modules/@allyhub/runtimes/pins/sherpa-onnx-node/package.json +0 -8
  455. package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package-lock.json +0 -128
  456. package/dist/node_modules/@allyhub/runtimes/pins/tesseract.js/package.json +0 -9
  457. package/dist/node_modules/@allyhub/video-core/dist/export.js +0 -2
  458. package/dist/node_modules/@allyhub/video-core/dist/formats.js +0 -2
  459. package/dist/node_modules/@allyhub/video-core/dist/gen.d.ts +0 -37
  460. package/dist/node_modules/@allyhub/video-core/dist/problem.d.ts +0 -278
  461. package/dist/node_modules/@allyhub/video-core/dist/problem.js +0 -2
  462. package/dist/node_modules/@allyhub/video-core/dist/script.js +0 -2
  463. package/dist/node_modules/@allyhub/video-core/dist/source.d.ts +0 -7
  464. package/dist/parts.js +0 -2
  465. package/dist/phone.js +0 -2
  466. package/dist/piece.js +0 -2
  467. /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.d.ts +0 -0
  468. /package/dist/node_modules/@allyhub/{sheet → formats}/dist/csv.js +0 -0
  469. /package/dist/{fit.d.ts → node_modules/@allyhub/image-sdk/dist/fit.d.ts} +0 -0
  470. /package/dist/{fit.js → node_modules/@allyhub/image-sdk/dist/fit.js} +0 -0
  471. /package/dist/{messages.js → node_modules/@allyhub/image-sdk/dist/messages.js} +0 -0
  472. /package/dist/{props.js → node_modules/@allyhub/image-sdk/dist/props.js} +0 -0
  473. /package/dist/{text.d.ts → node_modules/@allyhub/image-sdk/dist/text.d.ts} +0 -0
  474. /package/dist/{text.js → node_modules/@allyhub/image-sdk/dist/text.js} +0 -0
  475. /package/dist/{written.d.ts → node_modules/@allyhub/image-sdk/dist/written.d.ts} +0 -0
  476. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/anchors.js +0 -0
  477. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/component.d.ts +0 -0
  478. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.d.ts +0 -0
  479. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/console.js +0 -0
  480. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/contrast.js +0 -0
  481. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/gen.js +0 -0
  482. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/look.js +0 -0
  483. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.d.ts +0 -0
  484. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/marks.js +0 -0
  485. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.d.ts +0 -0
  486. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/matrix.js +0 -0
  487. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/messages.js +0 -0
  488. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/source.js +0 -0
  489. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/voice.js +0 -0
  490. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.d.ts +0 -0
  491. /package/dist/node_modules/@allyhub/{video-core → piece}/dist/words.js +0 -0
  492. /package/dist/{anim.d.ts → node_modules/@allyhub/video-sdk/dist/anim.d.ts} +0 -0
  493. /package/dist/{anim.js → node_modules/@allyhub/video-sdk/dist/anim.js} +0 -0
  494. /package/dist/{noise.d.ts → node_modules/@allyhub/video-sdk/dist/noise.d.ts} +0 -0
  495. /package/dist/{noise.js → node_modules/@allyhub/video-sdk/dist/noise.js} +0 -0
  496. /package/dist/{paths.d.ts → node_modules/@allyhub/video-sdk/dist/paths.d.ts} +0 -0
  497. /package/dist/{paths.js → node_modules/@allyhub/video-sdk/dist/paths.js} +0 -0
@@ -0,0 +1,113 @@
1
+ import { type Box, type Problem } from "@allyhub/diagnostics";
2
+ import type { TextContainer } from "@allyhub/piece";
3
+ export interface ScreenText {
4
+ text: string;
5
+ el: HTMLElement;
6
+ bbox: Box;
7
+ /** Effective opacity, the product of the element's and its ancestors'. */
8
+ opacity: number;
9
+ /**
10
+ * The rows its glyphs cover, [top, bottom] in viewport pixels: the first
11
+ * line's box down to the highest glyph's top, the last line's up to the
12
+ * lowest glyph's bottom. A line's box is the font's whole ascent and
13
+ * descent, taller than what is drawn.
14
+ */
15
+ rows: [top: number, bottom: number];
16
+ /**
17
+ * What its glyphs cover, a box per line in viewport pixels, [x0, y0, x1,
18
+ * y1]: each line's box down to its glyphs' rows (as `rows`), out to the
19
+ * first glyph's overhang on the left of the first line and the last
20
+ * glyph's on the right of the last.
21
+ */
22
+ lines: [x0: number, y0: number, x1: number, y1: number][];
23
+ /** Its font size as drawn, in viewport pixels: the computed size scaled as a transform scales its line's box. */
24
+ size: number;
25
+ /**
26
+ * The height of its font's lowercase x as drawn, in viewport pixels,
27
+ * scaled as `size`: how large its lowercase letters are, which a
28
+ * handwriting or display face draws much smaller than its size says.
29
+ * Only for text with a lowercase Latin letter.
30
+ */
31
+ xHeight?: number;
32
+ }
33
+ /**
34
+ * Visible text in `root`, in document order, with where it is drawn;
35
+ * `screens: false` leaves out what is part of a picture: drawn on a 3D
36
+ * scenery's screens, or inside an element marked `data-ak-picture`.
37
+ */
38
+ export declare function screenTexts(root: HTMLElement, opts?: {
39
+ screens?: boolean;
40
+ }): ScreenText[];
41
+ export interface TextBlock {
42
+ text: string;
43
+ /** In the frame's pixels (the stage's, unscaled), whole pixels. */
44
+ box: Box;
45
+ /** Inside a page viewport (a site demo): the page's own text. */
46
+ viewport?: boolean;
47
+ /** The lowest opacity of its text nodes (each with its ancestors'). */
48
+ opacity: number;
49
+ /**
50
+ * What shows of its glyphs, in the frame's pixels: the rows they cover
51
+ * (a line's box is taller), cut where an ancestor clips its content
52
+ * (overflow); null when all of it is clipped away.
53
+ */
54
+ ink: Box | null;
55
+ /** The share of its glyphs' box that shows, the lowest of its text nodes' (1: nothing clips it). */
56
+ shown: number;
57
+ /** Its font size as drawn, in the frame's pixels: the smallest of its text nodes'. */
58
+ size: number;
59
+ /** Its lowercase x's height as drawn, in the frame's pixels: the smallest of its text nodes' that have lowercase Latin letters. */
60
+ xHeight?: number;
61
+ /** The boxes it is drawn inside, nearest first (see `containersOf`). */
62
+ containers: TextContainer[];
63
+ /**
64
+ * What shows of its glyphs, a box per line in the frame's pixels (not
65
+ * rounded): cut where an ancestor clips its content, except where that
66
+ * ancestor's edge is at or past the frame's, so the frame's own edges are
67
+ * measured against them (the text-off-frame fact).
68
+ */
69
+ glyphs: Box[];
70
+ /** Its text nodes: the element each is drawn by, its opacity and its glyphs' boxes (as `glyphs`). */
71
+ runs: {
72
+ el: HTMLElement;
73
+ opacity: number;
74
+ glyphs: Box[];
75
+ }[];
76
+ /** The block-level element whose text it is. */
77
+ el: HTMLElement;
78
+ }
79
+ /**
80
+ * Visible text in `root` as blocks: the text nodes of one block-level
81
+ * element (a line of word spans, a paragraph) joined, with the box round
82
+ * them in the stage's own pixels, whatever the stage is scaled to.
83
+ */
84
+ export declare function textBlocks(root: HTMLElement, stage: HTMLElement, width: number): TextBlock[];
85
+ /**
86
+ * What allyhub inspect motion follows in a layer: every element that
87
+ * draws something of its own and shows (opacity over 0.05): one that holds
88
+ * text directly, one that paints a background, a border or a shadow, and a
89
+ * picture (img, svg, canvas, video; nothing inside an svg).
90
+ */
91
+ export declare function trackedIn(root: HTMLElement): {
92
+ el: Element;
93
+ what: string;
94
+ opacity: number;
95
+ name?: string;
96
+ }[];
97
+ /** A selector that finds el inside the stage. */
98
+ export declare function selectorOf(el: Element, stage: HTMLElement): string;
99
+ export interface InspectInput {
100
+ part: string;
101
+ t: number;
102
+ section: HTMLElement;
103
+ stage: HTMLElement;
104
+ format: string;
105
+ /** The file the keys a text shows are written in (ReadLog's fileOfKeys). */
106
+ messagesFile: (keys: readonly string[]) => string;
107
+ width: number;
108
+ height: number;
109
+ /** Message keys showing a text, to say what to shorten. */
110
+ keysShowing(text: string): string[];
111
+ }
112
+ export declare function inspectFrame(input: InspectInput): Problem[];
113
+ //# sourceMappingURL=inspect.d.ts.map
@@ -0,0 +1,3 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{problem as v}from"@allyhub/diagnostics";import{fontIssue as K,fontIssueText as X,fontWant as G,localFamily as _,pageFaces as V}from"./fonts.js";const z=new Map;let E;function F(i,a){const s=`${i}
3
+ ${a}`,t=z.get(s);if(t)return t;if(E??=document.createElement("canvas").getContext("2d"),!E)return;E.font=i;const e=E.measureText(a),r={fontUp:e.fontBoundingBoxAscent,fontDown:e.fontBoundingBoxDescent,up:e.actualBoundingBoxAscent,down:e.actualBoundingBoxDescent,left:Math.max(0,e.actualBoundingBoxLeft),right:Math.max(0,e.actualBoundingBoxRight-e.width)};return z.set(s,r),r}function Y(i,a,s){const t=s.getClientRects(),e=t.item(0),r=t.item(t.length-1),c=s.getBoundingClientRect(),u=Array.from(t).filter(x=>x.width>0&&x.height>0),h=(u.length>0?u:[c]).map(x=>[x.left,x.top,x.right,x.bottom]),n=getComputedStyle(i),o=parseFloat(n.fontSize)||0;if(!e||!r)return{rows:[c.top,c.bottom],lines:h,size:o};const l={rows:[e.top,r.bottom],lines:h,size:o},d=n.textTransform==="uppercase"?a.toUpperCase():n.textTransform==="lowercase"?a.toLowerCase():a,f=F(`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,d),g=f?f.fontUp+f.fontDown:0;if(!f||g<=0||f.up+f.down<=0)return l;const y=e.height/g,b=e.top+(f.fontUp-f.up)*y,M=r.bottom-(f.fontDown-f.down)*y,m=M>b?[b,M]:[e.top,r.bottom],w=u.map((x,p)=>{const S=x.height/g,C=x.top+(f.fontUp-f.up)*S,$=x.bottom-(f.fontDown-f.down)*S,A=x.left-(p===0?f.left*S:0),R=x.right+(p===u.length-1?f.right*S:0);return $>C?[A,C,R,$]:[A,x.top,R,x.bottom]}),k=/[a-z]/.test(d)?F(`${n.fontStyle} ${n.fontWeight} ${n.fontSize} ${n.fontFamily}`,"x"):void 0;return{rows:m,lines:w.length>0?w:h,size:o*y,...k&&k.up>0?{xHeight:k.up*y}:{}}}const L=i=>i.replace(/\u200b/g,"").replace(/\s+/g," ").trim();function B(i,a){let s=1;for(let t=i;t&&t!==a.parentElement;t=t.parentElement){const e=getComputedStyle(t);if(e.display==="none"||e.visibility==="hidden")return 0;s*=Number(e.opacity)}return s}function N(i,a){const s=i.closest("[data-ak-screen]");if(s!==null&&s!==a&&a.contains(s))return!0;const t=i.closest("[data-ak-picture]");return t!==null&&a.contains(t)}export function screenTexts(i,a={}){const s=[],t=document.createTreeWalker(i,NodeFilter.SHOW_TEXT);for(let e=t.nextNode();e;e=t.nextNode()){const r=L(e.textContent??""),c=e.parentElement;if(!r||!c||a.screens===!1&&N(c,i))continue;const u=B(c,i);if(u<=.05)continue;const h=document.createRange();h.selectNodeContents(e);const n=h.getBoundingClientRect();if(n.width===0&&n.height===0)continue;const o=Y(c,r,h);s.push({text:r,el:c,bbox:[n.left,n.top,n.width,n.height],opacity:u,rows:o.rows,lines:o.lines,size:o.size,...o.xHeight===void 0?{}:{xHeight:o.xHeight}})}return s}const H=new Set(["hidden","clip","scroll","auto"]);function O(i,a,s,t){let[e,r,c,u]=i;const h=.5;for(let n=a;n&&n!==s.parentElement;n=n.parentElement){const o=getComputedStyle(n),l=H.has(o.overflowX),d=H.has(o.overflowY);if(!l&&!d)continue;const f=n.getBoundingClientRect(),g=(y,b,M)=>t&&(M?y>=b-h:y<=b+h);if(l&&(g(f.left,t?.left??0,!1)||(e=Math.max(e,f.left)),g(f.right,t?.right??0,!0)||(c=Math.min(c,f.right))),d&&(g(f.top,t?.top??0,!1)||(r=Math.max(r,f.top)),g(f.bottom,t?.bottom??0,!0)||(u=Math.min(u,f.bottom))),c<=e||u<=r)return}return[e,r,c,u]}const J=/^(transparent|rgba\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\))$/,q=/[,/]\s*0(\.0+)?\s*\)$/;function D(i){const a=[],s=i.backgroundColor;return(i.backgroundImage!=="none"||!J.test(s)&&!q.test(s))&&a.push("background"),["Top","Right","Bottom","Left"].some(e=>{const r=i[`border${e}Style`];return r!=="none"&&r!=="hidden"&&parseFloat(i[`border${e}Width`])>0})&&a.push("border"),i.boxShadow!=="none"&&a.push("shadow"),a}function Z(i,a,s,t,e){const r=[];for(let c=i;c&&c!==a;c=c.parentElement){const u=getComputedStyle(c);if(H.has(u.overflowX)&&H.has(u.overflowY))continue;const h=D(u);if(h.length===0||B(c,a)<=.05)continue;const n=c.getBoundingClientRect(),o=Math.round((n.left-s.left)*t),l=Math.round((n.top-s.top)*t),d=Math.round((n.right-s.left)*t),f=Math.round((n.bottom-s.top)*t);o<=0&&l<=0&&d>=e[0]&&f>=e[1]||r.push({box:[o,l,d-o,f-l],paint:h})}return r}const W=/[\u3000-\u9fff\uf900-\uffef]/;export function textBlocks(i,a,s){const t=a.getBoundingClientRect(),e=t.width>0?s/t.width:1,r=[s,Math.round(t.height*e)],c=new Map;for(const o of screenTexts(i,{screens:!1})){let l=o.el;for(;l!==i&&l.parentElement&&getComputedStyle(l).display.startsWith("inline");)l=l.parentElement;const[d,f,g,y]=o.bbox,[b,M]=o.rows,m=O([d,b,d+g,M],o.el,i),w=Math.max(0,g)*Math.max(0,M-b),k=m&&w>0?Math.min(1,(m[2]-m[0])*(m[3]-m[1])/w):m?1:0,x=o.lines.flatMap(C=>{const $=O(C,o.el,i,t);return $?[$]:[]}),p=c.get(l);if(!p){c.set(l,{text:o.text,x0:d,y0:f,x1:d+g,y1:f+y,opacity:o.opacity,...m?{ink:m}:{},shown:k,size:o.size,...o.xHeight===void 0?{}:{xHeight:o.xHeight},glyphs:x,runs:[{el:o.el,opacity:o.opacity,glyphs:x}]});continue}p.glyphs.push(...x),p.runs.push({el:o.el,opacity:o.opacity,glyphs:x});const S=W.test(p.text.slice(-1))||W.test(o.text.slice(0,1))?"":" ";p.text+=S+o.text,p.x0=Math.min(p.x0,d),p.y0=Math.min(p.y0,f),p.x1=Math.max(p.x1,d+g),p.y1=Math.max(p.y1,f+y),p.opacity=Math.min(p.opacity,o.opacity),p.shown=Math.min(p.shown,k),p.size=Math.min(p.size,o.size),o.xHeight!==void 0&&(p.xHeight=Math.min(p.xHeight??1/0,o.xHeight)),m&&(p.ink=p.ink?[Math.min(p.ink[0],m[0]),Math.min(p.ink[1],m[1]),Math.max(p.ink[2],m[2]),Math.max(p.ink[3],m[3])]:m)}const u=(o,l,d,f)=>{const g=Math.round((o-t.left)*e),y=Math.round((l-t.top)*e);return[g,y,Math.round((d-t.left)*e)-g,Math.round((f-t.top)*e)-y]},h=o=>Math.round(o*e*100)/100,n=([o,l,d,f])=>[h(o-t.left),h(l-t.top),h(d-o),h(f-l)];return[...c.entries()].map(([o,l])=>({text:l.text,...o.closest("[data-ak-viewport]")?{viewport:!0}:{},box:u(l.x0,l.y0,l.x1,l.y1),opacity:Math.round(l.opacity*1e3)/1e3,ink:l.ink?u(...l.ink):null,shown:Math.round(l.shown*1e3)/1e3,size:Math.round(l.size*e*10)/10,...l.xHeight===void 0?{}:{xHeight:Math.round(l.xHeight*e*10)/10},containers:Z(o,i,t,e,r),glyphs:l.glyphs.map(n),runs:l.runs.map(d=>({el:d.el,opacity:d.opacity,glyphs:d.glyphs.map(n)})),el:o}))}const Q=new Set(["img","svg","canvas","video"]);export function trackedIn(i){const a=[],s=t=>{const e=t.tagName.toLowerCase(),r=Q.has(e);let c=r?e:void 0;if(!r&&t instanceof HTMLElement){const u=L(Array.from(t.childNodes).filter(h=>h.nodeType===Node.TEXT_NODE).map(h=>h.textContent??"").join(" "));u?c=`text ${JSON.stringify(T(u))}`:D(getComputedStyle(t)).length>0&&(c="box")}if(c!==void 0){const u=t instanceof HTMLElement?B(t,i):t.parentElement?B(t.parentElement,i)*Number(getComputedStyle(t).opacity):1;if(u>.05){const h=t instanceof HTMLElement||t instanceof SVGElement?t.dataset.ak:void 0;a.push({el:t,what:c,opacity:Math.round(u*1e3)/1e3,...h?{name:h}:{}})}}if(!r)for(const u of Array.from(t.children))s(u)};for(const t of Array.from(i.children))s(t);return a}export function selectorOf(i,a){const s=[];for(let t=i;t&&t!==a;t=t.parentElement){const e=t instanceof HTMLElement||t instanceof SVGElement?t.dataset:{},r=e.key;if(r!==void 0&&t.classList.contains("ak-part")){s.unshift(`section[data-key="${r}"]`);break}const c=e.ak;if(c!==void 0){s.unshift(`[data-ak="${c}"]`);continue}const u=t.parentElement,h=u?Array.from(u.children).indexOf(t)+1:1;s.unshift(`${t.tagName.toLowerCase()}:nth-child(${String(h)})`)}return s.join(" > ")}const T=i=>i.length>40?`${i.slice(0,40)}…`:i;let I;const U=new Map,j=new Map;function P(i,a){I??=Object.assign(document.createElement("canvas"),{width:64,height:64}).getContext("2d",{willReadFrequently:!0});const s=I;return s?(s.clearRect(0,0,64,64),s.font=i,s.textBaseline="middle",s.fillText(a,4,32),s.getImageData(0,0,64,64).data.join(",")):""}function tt(i,a){const s=getComputedStyle(i),t=`${s.fontStyle} ${s.fontWeight} 40px ${s.fontFamily}`;let e=U.get(t);e===void 0&&(e=P(t,"􏿽"),U.set(t,e));const r=[];for(const c of new Set(Array.from(a.replace(/\s/g,"")))){const u=`${t}|${c}`;let h=j.get(u);h===void 0&&(h=P(t,c)===e,j.set(u,h)),h&&r.push(c)}return r}export function inspectFrame(i){const{part:a,t:s,section:t,stage:e}=i,r=[],c=new Set,u=new Set;let h;for(const n of screenTexts(t)){const o=m=>{const w=i.keysShowing(n.text);return{selector:selectorOf(n.el,e),bbox:m.map(k=>Math.round(k)),...w.length>0?{file:i.messagesFile(w)}:{}}},l=i.keysShowing(n.text),d=l.length>0?`Shorten the text (${l.join(", ")})`:"Shorten the text",f=n.el.closest("[data-ak-viewport]")!==null,g=getComputedStyle(n.el);if((g.overflowX!=="visible"||g.overflowY!=="visible")&&!N(n.el,t)&&!c.has(n.el)&&(n.el.scrollWidth>n.el.clientWidth+1||n.el.scrollHeight>n.el.clientHeight+1)&&(c.add(n.el),r.push(v("AK-L002",`Text is cut off: "${T(n.text)}" does not fit its box. ${d}.`,{part:a,t:s,where:o(n.bbox)}))),!f){const m=tt(n.el,n.text);m.length>0&&r.push(v("AK-L003",`No font can draw ${m.map(w=>`"${w}" (U+${(w.codePointAt(0)??0).toString(16).toUpperCase().padStart(4,"0")})`).join(", ")} in "${T(n.text)}": they will show as boxes. Replace these characters, or add a font that supports them to the style.`,{part:a,t:s,where:o(n.bbox)}))}const b=G(g),M=`${g.fontFamily}|${String(b.weight)}|${g.fontStyle}`;if(!u.has(M)){h??=V();const m=Array.from(n.text.replace(/\s/g,"")).map(k=>k.codePointAt(0)??0),w=K(b,m,h,_);w&&(u.add(M),r.push(v("AK-L006",`"${T(n.text)}": ${X(w)}`,{part:a,t:s,where:o(n.bbox)})))}}return r}
@@ -0,0 +1,151 @@
1
+ import { type Adjustment, type Effects, type GraphicLayer, type LayerMask, type LayerTransform, type MediaInfo, type MediaRef, type StageContext } from "@allyhub/piece";
2
+ /** A box in the frame's pixels: x, y, width, height. */
3
+ export type PxBox = readonly [x: number, y: number, w: number, h: number];
4
+ /** A name for an SVG resource, unique in its document, in the order they are made. */
5
+ export declare function nextId(doc: Document, what: string): string;
6
+ /**
7
+ * The SVG defs a layer's resources go in, made once: its board's, or the
8
+ * stage's that holds its part. Never inside the part, which is hidden
9
+ * between moments: Chrome draws an element an feImage names only while it
10
+ * is shown.
11
+ */
12
+ export declare function defsOf(el: Element): SVGDefsElement;
13
+ /** A layer's own box, the frame's pixels: its `box` (shares) where it has one, else the frame. */
14
+ export declare function boxOf(layer: GraphicLayer, frame: {
15
+ width: number;
16
+ height: number;
17
+ }): PxBox;
18
+ /** A picture's media, read through the stage (so the output records it): an import by its path, a path from `base`. */
19
+ export declare function mediaOfRef(ref: MediaRef, base: string, ctx: StageContext): MediaInfo | undefined;
20
+ /** Whether a mask written as a string is a picture's path (else CSS, or "ellipse"). */
21
+ export declare const maskIsPath: (m: string) => boolean;
22
+ /** An adjustment's filter, for `backdrop-filter`: what it makes of what lies under it. */
23
+ export declare function adjustmentFilter(a: Adjustment, defs: SVGDefsElement): string;
24
+ /**
25
+ * A gradient as SVG paints it over a box: linear (Photoshop's angle,
26
+ * counter-clockwise from left to right), radial (from the box's centre to
27
+ * its farthest corner), or reflected (a linear one mirrored about its
28
+ * middle). Its length is `scale` percent of the box's.
29
+ */
30
+ export declare function svgGradient(doc: Document, id: string, gradient: NonNullable<NonNullable<Effects["gradientOverlay"]>["gradient"]>, box: PxBox): SVGLinearGradientElement | SVGRadialGradientElement;
31
+ export interface EffectsInput {
32
+ readonly fx: Effects;
33
+ readonly fillOpacity: number;
34
+ readonly box: PxBox;
35
+ readonly frame: {
36
+ readonly width: number;
37
+ readonly height: number;
38
+ };
39
+ readonly defs: SVGDefsElement;
40
+ readonly ctx: StageContext;
41
+ /** The folder a pattern's path is from. */
42
+ readonly base: string;
43
+ }
44
+ /**
45
+ * The layer's effects and its fill opacity as one filter (Photoshop's
46
+ * layer style), bottom to top: the drop shadow and the outer glow under
47
+ * what it shows (knocked out where it shows), then the overlays, the
48
+ * satin, the inner glow, the inner shadow and the bevel over it, each
49
+ * cut to what it shows. A stroke is the type or shape layer's own (it
50
+ * draws its glyphs' or path's stroke). Its id, or undefined when it has
51
+ * nothing to draw.
52
+ */
53
+ export declare function effectsFilter(o: EffectsInput): string | undefined;
54
+ export interface MaskInput {
55
+ readonly mask: LayerMask;
56
+ /** Where its source lies when it gives no box, the target's pixels. */
57
+ readonly box: PxBox;
58
+ /** The target's own size, its pixels: what a box in shares is of. */
59
+ readonly frame: {
60
+ readonly width: number;
61
+ readonly height: number;
62
+ };
63
+ readonly defs: SVGDefsElement;
64
+ readonly ctx: StageContext;
65
+ readonly base: string;
66
+ }
67
+ /**
68
+ * Masks an element: CSS's mask-image (a picture's alpha, a gradient) or
69
+ * clip-path (an ellipse) where that is all it asks, else an SVG mask (a
70
+ * path, a picture's luminance, its density, feather and inversion). An
71
+ * error message where it cannot be drawn.
72
+ */
73
+ export declare function applyMask(el: HTMLElement, o: MaskInput): string | undefined;
74
+ /** The CSS transform that turns and flips an element about a box's centre; undefined when it does neither. */
75
+ export declare function transformCss(t: LayerTransform | undefined, box: PxBox): string | undefined;
76
+ export interface StyleInput {
77
+ readonly layer: GraphicLayer;
78
+ readonly ctx: StageContext;
79
+ readonly frame: {
80
+ readonly width: number;
81
+ readonly height: number;
82
+ };
83
+ /** The folder its paths are from. */
84
+ readonly base: string;
85
+ }
86
+ /** The folder a layer's paths are from: its module's, where its function knew it. */
87
+ export declare const baseOf: (layer: GraphicLayer) => string;
88
+ /** The class of a layer's content element: what moves, turns and is masked with it, under its effects and its clipping. */
89
+ export declare const LAYER_CONTENT = "ak-content";
90
+ /**
91
+ * A layer's element made ready for its style before its content mounts:
92
+ * where it is masked, turned, flipped or clipped, an element of its own
93
+ * inside it, which its content mounts in, holds its mask and its turn (and
94
+ * a person's move: what moves with the layer), and the layer's element its
95
+ * effects, blend, opacity and clipping, which Photoshop draws after them.
96
+ * The element to mount its content in.
97
+ */
98
+ export declare function contentOf(el: HTMLElement, layer: GraphicLayer, frame: {
99
+ width: number;
100
+ height: number;
101
+ }): HTMLElement;
102
+ /** Where a layer's content is: its content element where it has one, else itself. */
103
+ export declare const contentEl: (el: HTMLElement) => HTMLElement;
104
+ /** Whether a layer, or a layer in it, is an adjustment: what lies under it in its group must be a backdrop root's. */
105
+ export declare function holdsAdjustment(layer: GraphicLayer): boolean;
106
+ /** Makes an element the root what an adjustment in it reads stops at (CSS's backdrop root), changing nothing it draws. */
107
+ export declare function backdropRoot(el: HTMLElement): void;
108
+ /**
109
+ * Draws a layer's style on its element (its content mounted): blend,
110
+ * opacity, fill opacity and effects, mask; and for a group, its isolation.
111
+ * A picture masks its own box (picture()). Undefined, or why it cannot be
112
+ * drawn.
113
+ */
114
+ export declare function styleLayer(el: HTMLElement, o: StyleInput): string | undefined;
115
+ /**
116
+ * The SVG mask of a clipping base's own shape (Photoshop's clipping mask):
117
+ * a picture's shown pixels, a shape's path, a fill's frame. Its id, or why
118
+ * this base cannot clip.
119
+ */
120
+ export declare function silhouetteOf(base: GraphicLayer, o: {
121
+ frame: {
122
+ width: number;
123
+ height: number;
124
+ };
125
+ defs: SVGDefsElement;
126
+ ctx: StageContext;
127
+ }): {
128
+ id: string;
129
+ } | {
130
+ refused: string;
131
+ };
132
+ /** A layer's element among its siblings, with its spec. */
133
+ export interface Stacked {
134
+ readonly layer: GraphicLayer;
135
+ readonly el: HTMLElement;
136
+ }
137
+ /**
138
+ * Puts clipped layers with their base (Photoshop's clipping groups): each
139
+ * base and the clipped layers over it in an element of their own, isolated
140
+ * with the base's blend and opacity, each clipped layer masked by the
141
+ * base's shape. The layers' elements are siblings, back to front, in their
142
+ * parent. What could not be clipped, each with why.
143
+ */
144
+ export declare function clipStack(stacked: readonly Stacked[], o: {
145
+ frame: {
146
+ width: number;
147
+ height: number;
148
+ };
149
+ ctx: StageContext;
150
+ }): string[];
151
+ //# sourceMappingURL=layer-style.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{ADJUSTMENT_DEFAULTS as X,BLEND_DRAWN as _,EFFECT_DEFAULTS as q,LUMA as Z,mediaKindOf as ee,pathIn as te,placePicture as ne,PICTURE_DEFAULTS as se}from"@allyhub/piece";import{strokeOnto as oe}from"./paint.js";import{shapePath as ie}from"./shape-path.js";import{brightnessContrastTable as re,colorBalanceTable as I,compose as B,curveTable as E,exposureTable as ae,gradientTables as ce,identity as R,invertTable as le,levelsTable as D,lightnessTable as de,rgbOf as L,stopsOf as pe,tableValues as P,thresholdTable as ue}from"./tone.js";const fe="http://www.w3.org/2000/svg",W=new WeakMap;export function nextId(t,n){const e=(W.get(t)??0)+1;return W.set(t,e),`ak-${n}-${String(e)}`}function k(t,n,e={},o=[]){const s=t.createElementNS(fe,n);for(const[r,i]of Object.entries(e))s.setAttribute(r,String(i));for(const r of o)s.append(r);return s}export function defsOf(t){const n=t.closest("[data-ak-board]")??t.closest(".ak-part")?.parentElement??t.ownerDocument.body,o=n.querySelector(":scope > svg[data-ak-defs]")?.querySelector("defs");if(o)return o;const s=t.ownerDocument,r=k(s,"svg",{width:0,height:0,"aria-hidden":"true","data-ak-defs":""});r.style.position="absolute",r.style.overflow="hidden";const i=k(s,"defs");return r.append(i),n.prepend(r),i}const a=t=>String(Math.round(t*1e4)/1e4);export function boxOf(t,n){const e=t.props.box;if(Array.isArray(e)&&e.length===4&&e.every(o=>typeof o=="number"&&Number.isFinite(o))){const[o,s,r,i]=e;return[o*n.width,s*n.height,r*n.width,i*n.height]}return[0,0,n.width,n.height]}export function mediaOfRef(t,n,e){if(typeof t!="string"){const s=e.asset(`/${t.path}`);return s.sha256===t.sha256?s:t}const o=te(n,t);return e.asset(o===void 0?t:`/${o}`)}export const maskIsPath=t=>t!=="ellipse"&&ee(t)==="image"&&!t.includes("(");function V(t,n){const e=new Image;e.decoding="sync",e.src=t,n.wait(e.decode().catch(()=>{n.report?.({code:"AK-A005",message:`The picture ${t} a layer's mask, pattern or clipping draws did not load.`})}))}class he{k=0;doc;el;constructor(n,e){this.doc=n,this.el=e}add(n,e,o=[]){const s=`r${String(++this.k)}`;return this.el.append(k(this.doc,n,{...e,result:s},o)),s}transfer(n,e){const o=["R","G","B","A"].flatMap(s=>{const r=e[s];return r?[k(this.doc,`feFunc${s}`,r)]:[]});return this.add("feComponentTransfer",{in:n},o)}tables(n,e,o,s,r="table"){return this.transfer(n,{R:{type:r,tableValues:P(e)},G:{type:r,tableValues:P(o)},B:{type:r,tableValues:P(s)}})}matrix(n,e){return this.add("feColorMatrix",{in:n,type:"matrix",values:e.map(a).join(" ")})}arith(n,e,o,s,r,i=0){return this.add("feComposite",{in:n,in2:e,operator:"arithmetic",k1:a(o),k2:a(s),k3:a(r),k4:a(i)})}composite(n,e,o){return this.add("feComposite",{in:n,in2:e,operator:o})}blend(n,e,o){const s=_[o];return this.add("feBlend",{in:n,in2:e,mode:"css"in s?s.css:"normal"})}flood(n,e){return this.add("feFlood",{"flood-color":n,"flood-opacity":a(e)})}blur(n,e){return e<=0?n:this.add("feGaussianBlur",{in:n,stdDeviation:a(e)})}offset(n,e,o){return e===0&&o===0?n:this.add("feOffset",{in:n,dx:a(e),dy:a(o)})}merge(n){return this.add("feMerge",{},n.map(e=>k(this.doc,"feMergeNode",{in:e})))}sub(n,e){const o={type:"table",tableValues:"1 0"},s=this.transfer(n,{R:o,G:o,B:o}),r=this.arith(s,e,0,1,1);return this.transfer(r,{R:o,G:o,B:o})}add2(n,e,o=1){return this.arith(n,e,0,1,o)}luma(n){const[e,o,s]=Z;return this.matrix(n,[e,o,s,0,0,e,o,s,0,0,e,o,s,0,0,0,0,0,1,0])}channel(n,e){const o=[0,0,0,0,0];return o[e]=1,this.matrix(n,[...o,...o,...o,0,0,0,1,0])}}function H(t,n,e){const o=t.ownerDocument,s=nextId(o,n),r=k(o,"filter",{id:s,"color-interpolation-filters":"sRGB",...e?{filterUnits:"userSpaceOnUse",x:a(e[0]),y:a(e[1]),width:a(e[2]),height:a(e[3])}:{}});return t.append(r),new he(o,r)}function U(t,n="SourceGraphic"){return t.matrix(n,[1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,1])}function K(t,n,e){const o=t.luma(n),s=t.luma(e),r=t.sub(o,s),i=t.sub(s,o);return t.sub(t.add2(e,r),i)}export function adjustmentFilter(t,n){const e=H(n,"adjust"),o=X;switch(t.kind){case"levels":{const s=D(t.rgb);e.tables("SourceGraphic",B(s,D(t.red)),B(s,D(t.green)),B(s,D(t.blue)));break}case"curves":{const s=E(t.rgb);e.tables("SourceGraphic",B(s,E(t.red)),B(s,E(t.green)),B(s,E(t.blue)));break}case"brightnessContrast":{const s=re(t.brightness??o.brightnessContrast.brightness,t.contrast??o.brightnessContrast.contrast);e.tables("SourceGraphic",s,s,s);break}case"exposure":{const s=ae(t.exposure??o.exposure.exposure,t.offset??o.exposure.offset,t.gammaCorrection??o.exposure.gammaCorrection);e.tables("SourceGraphic",s,s,s);break}case"invert":{const s=le();e.tables("SourceGraphic",s,s,s);break}case"threshold":{const s=e.luma("SourceGraphic"),r=ue(t.level??o.threshold.level);e.tables(s,r,r,r,"discrete");break}case"gradientMap":{const s=e.luma("SourceGraphic"),r=ce(t.gradient??{stops:[...o.gradientMap.gradient.stops]},t.reverse??!1),[i,p,w]=r??[R(),R(),R()];e.tables(s,i,p,w);break}case"hueSaturation":{let s="SourceGraphic";const r=t.hue??0;r!==0&&(s=e.add("feColorMatrix",{in:s,type:"hueRotate",values:a(r)}));const i=t.saturation??0;i!==0&&(s=e.add("feColorMatrix",{in:s,type:"saturate",values:a(1+i/100)}));const p=de(t.lightness??0);e.tables(s,p,p,p);break}case"vibrance":{let s="SourceGraphic";const r=t.saturation??0;r!==0&&(s=e.add("feColorMatrix",{in:s,type:"saturate",values:a(1+r/100)}));const i=(t.vibrance??0)/100;if(i!==0){const p=U(e,s),w=e.channel(p,0),h=e.channel(p,1),x=e.channel(p,2),y=e.add("feBlend",{in:e.add("feBlend",{in:w,in2:h,mode:"lighten"}),in2:x,mode:"lighten"}),l=e.add("feBlend",{in:e.add("feBlend",{in:w,in2:h,mode:"darken"}),in2:x,mode:"darken"}),b=e.sub(y,l),g={type:"table",tableValues:"1 0"},c=e.transfer(b,{R:g,G:g,B:g}),d=e.luma(p),f=e.arith(c,e.sub(p,d),1,0,0),u=e.arith(c,e.sub(d,p),1,0,0),m={type:"linear",slope:a(Math.abs(i))},S=e.transfer(f,{R:m,G:m,B:m}),M=e.transfer(u,{R:m,G:m,B:m}),[v,O]=i>0?[S,M]:[M,S],G=e.sub(e.add2(p,v),O);e.composite(G,"SourceGraphic","in")}break}case"colorBalance":{const s=t.shadows??[0,0,0],r=t.midtones??[0,0,0],i=t.highlights??[0,0,0],p=U(e),w=e.tables(p,I(s[0],r[0],i[0]),I(s[1],r[1],i[1]),I(s[2],r[2],i[2])),h=t.preserveLuminosity??o.colorBalance.preserveLuminosity?K(e,p,w):w;e.composite(h,"SourceGraphic","in");break}case"photoFilter":{const s=L(t.color??o.photoFilter.color)??[1,1,1,1],r=(t.density??o.photoFilter.density)/100,i=U(e),p=x=>1-r+r*s[x],w=e.matrix(i,[p(0),0,0,0,0,0,p(1),0,0,0,0,0,p(2),0,0,0,0,0,0,1]),h=t.preserveLuminosity??o.photoFilter.preserveLuminosity?K(e,i,w):w;e.composite(h,"SourceGraphic","in");break}case"blackAndWhite":{const s=o.blackAndWhite,r={r:(t.reds??s.reds)/100,y:(t.yellows??s.yellows)/100,g:(t.greens??s.greens)/100,c:(t.cyans??s.cyans)/100,b:(t.blues??s.blues)/100,m:(t.magentas??s.magentas)/100},i=U(e),p=(f,u)=>{const m=[0,0,0,0,0];m[f]=1,m[u]=-1,m[4]=1;const S=e.matrix(i,[...m,...m,...m,0,0,0,1,0]),M=R().map((v,O)=>O>=255?1:0);return e.tables(S,M,M,M,"discrete")},w=p(0,1),h=p(1,2),x=p(0,2),y=f=>{const u={type:"table",tableValues:"1 0"};return e.transfer(f,{R:u,G:u,B:u})},l=(f,u)=>e.arith(f,u,1,0,0),b=(f,u,m,S,M)=>{const v=[0,0,0];v[f]=S,v[u]=M-S,v[m]=1-M;const O=[v[0]??0,v[1]??0,v[2]??0,0,0];return e.matrix(i,[...O,...O,...O,0,0,0,1,0])},g=[[l(w,h),b(0,1,2,r.r,r.y)],[l(x,y(h)),b(0,2,1,r.r,r.m)],[l(y(w),x),b(1,0,2,r.g,r.y)],[l(h,y(x)),b(1,2,0,r.g,r.c)],[l(y(h),y(w)),b(2,1,0,r.b,r.c)],[l(y(x),w),b(2,0,1,r.b,r.m)]];let c,d;for(const[f,u]of g){const m=d===void 0?f:l(f,y(d)),S=e.arith(m,u,1,0,0);c=c===void 0?S:e.add2(c,S),d=d===void 0?f:e.add2(d,f)}e.composite(c??i,"SourceGraphic","in");break}}return e.el.childElementCount===0&&e.offset("SourceGraphic",0,1e-4),e.el.id}const z=t=>t*Math.PI/180,N=(t,n)=>[-Math.cos(z(t))*n,Math.sin(z(t))*n];function F(t,n,e){if(e<=0)return n;const o=e>=100?1e4:1/(1-e/100);return t.transfer(n,{A:{type:"linear",slope:a(o)}})}function j(t,n){return t.transfer(n,{A:{type:"table",tableValues:"1 0"}})}function me(t,n,e){const o=t.ownerDocument,s=nextId(o,"gradient"),r=svgGradient(o,s,n,e);t.append(r);const i=k(o,"rect",{id:`${s}-r`,x:a(e[0]),y:a(e[1]),width:a(e[2]),height:a(e[3]),fill:`url(#${s})`});return t.append(i),`#${s}-r`}export function svgGradient(t,n,e,o){const s=e.style??"linear",r=pe(e),[i,p,w,h]=o,x=i+w/2,y=p+h/2,l=(e.scale??100)/100,b=m=>m.map(S=>k(t,"stop",{offset:`${a(S.location)}%`,"stop-color":S.color}));if(s==="radial"){const m=Math.hypot(w,h)/2*l;return k(t,"radialGradient",{id:n,gradientUnits:"userSpaceOnUse",cx:a(x),cy:a(y),r:a(m)},b(r))}const g=z(e.angle??90),c=(Math.abs(Math.cos(g))*w+Math.abs(Math.sin(g))*h)/2*l,d=Math.cos(g)*c,f=-Math.sin(g)*c,u=s==="reflected"?[...r.map(m=>({color:m.color,location:50-m.location/2})).reverse(),...r.map(m=>({color:m.color,location:50+m.location/2}))]:r;return k(t,"linearGradient",{id:n,gradientUnits:"userSpaceOnUse",x1:a(x-d),y1:a(y-f),x2:a(x+d),y2:a(y+f)},b(u))}export function effectsFilter(t){const{fx:n,frame:e}=t,o=c=>c!==void 0&&c.enabled!==!1,s=e.width,r=e.height,i=H(t.defs,"fx",[-s,-r,3*s,3*r]),p="SourceAlpha",w=t.fillOpacity/100,h=w<1?i.transfer("SourceGraphic",{A:{type:"linear",slope:a(w)}}):"SourceGraphic",x=[],y=(c,d)=>(c??d)/100,l=q;if(o(n.dropShadow)){const c=n.dropShadow,d=F(i,i.blur(p,(c.size??l.dropShadow.size)/2),c.spread??l.dropShadow.spread),[f,u]=N(c.angle??l.dropShadow.angle,c.distance??l.dropShadow.distance),m=i.composite(i.flood(c.color??l.dropShadow.color,y(c.opacity,l.dropShadow.opacity)),i.offset(d,f,u),"in");x.push(i.composite(m,p,"out"))}if(o(n.outerGlow)){const c=n.outerGlow,d=F(i,i.blur(p,(c.size??l.outerGlow.size)/2),c.spread??l.outerGlow.spread),f=i.composite(i.flood(c.color??l.outerGlow.color,y(c.opacity,l.outerGlow.opacity)),d,"in");x.push(i.composite(f,p,"out"))}let b=h;const g=(c,d)=>{b=i.blend(i.composite(c,p,"in"),b,d)};if(o(n.patternOverlay)){const c=n.patternOverlay,d=mediaOfRef(c.pattern,t.base,t.ctx);if(d){V(d.url,t.ctx);const f=(c.scale??l.patternOverlay.scale)/100,u=(d.width??1)*f,m=(d.height??1)*f,S=i.add("feImage",{href:d.url,x:0,y:0,width:a(u),height:a(m),preserveAspectRatio:"none"}),M=i.add("feTile",{in:S}),v=i.transfer(M,{A:{type:"linear",slope:a(y(c.opacity,l.patternOverlay.opacity))}});g(v,c.blendMode??l.patternOverlay.blendMode)}}if(o(n.gradientOverlay)){const c=n.gradientOverlay,d=l.gradientOverlay.gradient,f=me(t.defs,c.gradient??{...d,stops:d.stops.map(S=>({...S}))},t.box),u=i.add("feImage",{href:f,x:0,y:0,width:s,height:r}),m=i.transfer(u,{A:{type:"linear",slope:a(y(c.opacity,l.gradientOverlay.opacity))}});g(m,c.blendMode??l.gradientOverlay.blendMode)}if(o(n.colorOverlay)){const c=n.colorOverlay;g(i.flood(c.color??l.colorOverlay.color,y(c.opacity,l.colorOverlay.opacity)),c.blendMode??l.colorOverlay.blendMode)}if(o(n.satin)){const c=n.satin,d=(c.size??l.satin.size)/2,[f,u]=N(c.angle??l.satin.angle,c.distance??l.satin.distance),m=i.blur(i.offset(p,f,u),d),S=i.blur(i.offset(p,-f,-u),d),M=i.arith(i.arith(m,S,0,1,-1),i.arith(S,m,0,1,-1),0,1,1),v=c.invert??l.satin.invert?j(i,M):M;g(i.composite(i.flood(c.color??l.satin.color,y(c.opacity,l.satin.opacity)),v,"in"),c.blendMode??l.satin.blendMode)}if(o(n.innerGlow)){const c=n.innerGlow,d=(c.size??l.innerGlow.size)/2,u=(c.source??l.innerGlow.source)==="edge"?i.blur(j(i,p),d):j(i,i.blur(j(i,p),d)),m=F(i,u,c.choke??l.innerGlow.choke);g(i.composite(i.flood(c.color??l.innerGlow.color,y(c.opacity,l.innerGlow.opacity)),m,"in"),c.blendMode??l.innerGlow.blendMode)}if(o(n.innerShadow)){const c=n.innerShadow,[d,f]=N(c.angle??l.innerShadow.angle,c.distance??l.innerShadow.distance),u=F(i,i.offset(i.blur(j(i,p),(c.size??l.innerShadow.size)/2),d,f),c.choke??l.innerShadow.choke);g(i.composite(i.flood(c.color??l.innerShadow.color,y(c.opacity,l.innerShadow.opacity)),u,"in"),c.blendMode??l.innerShadow.blendMode)}if(o(n.bevelEmboss)){const c=n.bevelEmboss,d=l.bevelEmboss,f=c.size??d.size,u=i.blur(p,f/2),m=Math.min(c.altitude??d.altitude,89.9),S=(c.direction??d.direction)==="up",M=(360-(c.angle??d.angle)+(S?0:180))%360,v=i.blur(i.add("feDiffuseLighting",{in:u,surfaceScale:a(f*(c.depth??d.depth)/100),diffuseConstant:1,"lighting-color":"#ffffff"},[k(i.doc,"feDistantLight",{azimuth:a(M),elevation:a(m)})]),(c.soften??d.soften)/2),O=Math.sin(z(m)),G=L(c.highlightColor??d.highlightColor)??[1,1,1,1],$=L(c.shadowColor??d.shadowColor)??[0,0,0,1],A=y(c.highlightOpacity,d.highlightOpacity)*G[3],T=y(c.shadowOpacity,d.shadowOpacity)*$[3],C=i.matrix(v,[0,0,0,0,G[0],0,0,0,0,G[1],0,0,0,0,G[2],A/(1-O),0,0,0,-O*A/(1-O)]),Q=i.matrix(v,[0,0,0,0,$[0],0,0,0,0,$[1],0,0,0,0,$[2],-T/O,0,0,0,T]);g(Q,c.shadowMode??d.shadowMode),g(C,c.highlightMode??d.highlightMode)}if(x.length===0&&b==="SourceGraphic"){i.el.remove();return}return i.merge([...x,b]),i.el.id}function ye(t){return typeof t=="string"||!("src"in t||"path"in t||"box"in t||"mode"in t||"density"in t||"feather"in t||"invert"in t||"enabled"in t)?{src:t}:t}export function applyMask(t,n){const e=ye(n.mask);if(e.enabled===!1)return;const o=n.frame.width,s=n.frame.height,r=e.box?[e.box[0]*o,e.box[1]*s,e.box[2]*o,e.box[3]*s]:n.box,[i,p,w,h]=r,x=(e.density??100)/100,y=e.feather??0,l=e.invert===!0,b=e.mode==="luminance",g=e.src,c=typeof g=="string"&&g!=="ellipse"&&!maskIsPath(g),d=x===1&&y===0&&!l&&!b;if(c){if(y>0)return"a CSS mask-image is feathered by its own stops, not by feather";const $=[g],A=[];l&&($.unshift("linear-gradient(black, black)"),A.push("exclude")),x<1&&($.unshift(`linear-gradient(rgb(0 0 0 / ${a(1-x)}), rgb(0 0 0 / ${a(1-x)}))`),A.unshift("add")),Object.assign(t.style,{maskImage:$.join(", "),maskMode:$.map((T,C)=>C===$.length-1&&b?"luminance":"alpha").join(", "),maskRepeat:"no-repeat",maskPosition:$.map((T,C)=>C===$.length-1?`${a(i)}px ${a(p)}px`:"0px 0px").join(", "),maskSize:$.map((T,C)=>C===$.length-1?`${a(w)}px ${a(h)}px`:"100% 100%").join(", "),...A.length>0?{maskComposite:[...A,"add"].join(", ")}:{}});return}if(d&&g==="ellipse"){t.style.clipPath=`ellipse(${a(w/2)}px ${a(h/2)}px at ${a(i+w/2)}px ${a(p+h/2)}px)`;return}const f=g!==void 0&&g!=="ellipse"?mediaOfRef(g,n.base,n.ctx):void 0;if(d&&f&&e.path===void 0){Object.assign(t.style,{maskImage:`url("${f.url}")`,maskSize:`${a(w)}px ${a(h)}px`,maskPosition:`${a(i)}px ${a(p)}px`,maskRepeat:"no-repeat"});return}const u=t.ownerDocument,m=nextId(u,"mask"),S=[k(u,"rect",{x:0,y:0,width:a(o),height:a(s),fill:"black"})];if(e.path!==void 0)S.push(k(u,"path",{d:e.path,fill:"white"}));else if(g==="ellipse")S.push(k(u,"ellipse",{cx:a(i+w/2),cy:a(p+h/2),rx:a(w/2),ry:a(h/2),fill:"white"}));else if(f){V(f.url,n.ctx);const $=nextId(u,"white");b||n.defs.append(k(u,"filter",{id:$,"color-interpolation-filters":"sRGB"},[k(u,"feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"})])),S.push(k(u,"image",{href:f.url,x:a(i),y:a(p),width:a(w),height:a(h),preserveAspectRatio:"none",...b?{}:{filter:`url(#${$})`}}))}else return'a mask has a src (a picture, "ellipse" or a CSS mask-image) or a path';const M=nextId(u,"maskfx"),v=[];y>0&&v.push(k(u,"feGaussianBlur",{stdDeviation:a(y)}));const O=$=>k(u,"feComponentTransfer",{},["R","G","B"].map(A=>k(u,`feFunc${A}`,$)));l&&v.push(O({type:"table",tableValues:"1 0"})),x<1&&v.push(O({type:"linear",slope:a(x),intercept:a(1-x)}));const G=k(u,"g",{},S);v.length>0&&(n.defs.append(k(u,"filter",{id:M,filterUnits:"userSpaceOnUse",x:0,y:0,width:a(o),height:a(s),"color-interpolation-filters":"sRGB"},v)),G.setAttribute("filter",`url(#${M})`)),n.defs.append(k(u,"mask",{id:m,maskUnits:"userSpaceOnUse",x:0,y:0,width:a(o),height:a(s),style:"mask-type: luminance"},[G])),t.style.maskImage=`url(#${m})`}export function transformCss(t,n){if(!t)return;const e=t.rotation??0,o=t.flipH===!0?-1:1,s=t.flipV===!0?-1:1;if(e===0&&o===1&&s===1)return;const r=n[0]+n[2]/2,i=n[1]+n[3]/2;return`translate(${a(r)}px, ${a(i)}px) rotate(${a(e)}deg) scale(${String(o)}, ${String(s)}) translate(${a(-r)}px, ${a(-i)}px)`}export const baseOf=t=>{const n=t.props.base;return typeof n=="string"?n:""},LAYER_CONTENT="ak-content";export function contentOf(t,n,e){const o=transformCss(n.transform,boxOf(n,e)),s=n.mask!==void 0&&n.kind!=="pixel";if(n.kind==="adjustment"||o===void 0&&!s&&n.clipping!==!0)return t;const r=t.ownerDocument.createElement("div");return r.className=LAYER_CONTENT,Object.assign(r.style,{position:"absolute",inset:"0"}),o!==void 0&&Object.assign(r.style,{transform:o,transformOrigin:"0 0"}),t.append(r),r}export const contentEl=t=>t.querySelector(`:scope > .${LAYER_CONTENT}`)??t;export function holdsAdjustment(t){if(t.kind==="adjustment")return!0;const n=t.props.layers;return Array.isArray(n)&&n.some(e=>holdsAdjustment(e))}export function backdropRoot(t){t.style.filter===""&&(t.style.filter="opacity(1)")}export function styleLayer(t,n){const e=n.layer,o=e.kind==="group",s=e.blendMode??(o?"passThrough":"normal"),r=_[s];if("refused"in r)return`blendMode ${s} ${r.refused}`;const i=(e.opacity??100)/100,p=e.fillOpacity??100,w=e.effects,h=J(w);if(o&&s==="passThrough"){const l=i<1||p<100||h||e.mask!==void 0;if(l&&Y(e))return"a passThrough group that fades, is masked or has effects, holding an adjustment or a layer of another blend mode: Chrome draws a group's opacity, mask and effects on its own picture, which its layers would then no longer blend through";l&&(t.style.isolation="isolate")}else o&&(t.style.isolation="isolate",holdsAdjustment(e)&&backdropRoot(t));s!=="normal"&&s!=="passThrough"&&(e.kind!=="pixel"||J(e.effects))&&(t.style.mixBlendMode=r.css);const x=()=>defsOf(t),y=w?.stroke;if(y&&y.enabled!==!1){const l=q.stroke,b=y.size??l.size,g=y.position??l.position,c=y.color??l.color,d=(y.opacity??l.opacity)/100;if(e.kind==="type")for(const f of t.querySelectorAll("[data-ak-text]"))f.style.setProperty("-webkit-text-stroke",`${a(g==="outside"?b*2:b)}px ${d<1?`color-mix(in srgb, ${c} ${a(d*100)}%, transparent)`:c}`),g==="outside"&&f.style.setProperty("paint-order","stroke fill");else if(e.kind==="shape")for(const f of t.querySelectorAll("svg[data-ak-shape]")){const u=f.querySelector("path")?.getAttribute("d");u&&oe(f,u,{color:c,width:b,alignment:g,opacity:d*100,join:"round",cap:"round"},n.frame)}}if(h){const l=effectsFilter({fx:w,fillOpacity:p,box:boxOf(e,n.frame),frame:n.frame,defs:x(),ctx:n.ctx,base:n.base});l!==void 0&&(t.style.filter=`url(#${l})`),i<1&&(t.style.opacity=a(i))}else{const l=i*(p/100);l<1&&(t.style.opacity=a(l))}if(e.mask!==void 0&&e.kind!=="pixel"){const l=applyMask(contentEl(t),{mask:e.mask,box:boxOf(e,n.frame),frame:n.frame,defs:x(),ctx:n.ctx,base:n.base});if(l!==void 0)return l}}function J(t){return t!==void 0&&Object.values(t).some(n=>n!==void 0&&n.enabled!==!1)}function Y(t){const n=t.props.layers;return Array.isArray(n)?n.some(e=>{const o=e;return o.kind==="adjustment"||o.blendMode!==void 0&&o.blendMode!=="normal"&&o.blendMode!=="passThrough"||o.kind==="group"&&(o.blendMode??"passThrough")==="passThrough"&&Y(o)}):!1}export function silhouetteOf(t,n){const e=n.defs.ownerDocument,o=n.frame.width,s=n.frame.height,r=t.props;if(t.mask!==void 0)return{refused:"a clipping base with a mask of its own: not drawn yet"};if(t.transform!==void 0)return{refused:"a clipping base turned or flipped: not drawn yet"};const i=[];if(t.kind==="pixel"){if(r.filter!==void 0||r.radius!==void 0)return{refused:"a clipping base picture with a filter or a radius: its shape is then Chrome's drawing, which a mask cannot read"};const w=r.src,h=w===void 0?void 0:mediaOfRef(w,baseOf(t),n.ctx);if(!h)return{refused:"the clipping base's picture does not load"};V(h.url,n.ctx);const[x,y,l,b]=boxOf(t,n.frame),g=ne({source:{width:h.width??1,height:h.height??1},box:{width:l,height:b},fit:r.fit,position:r.position??se.position,crop:r.crop}),c=nextId(e,"clip"),[d,f,u,m]=g.shown;n.defs.append(k(e,"clipPath",{id:c,clipPathUnits:"userSpaceOnUse"},[k(e,"rect",{x:a(x+d),y:a(y+f),width:a(u),height:a(m)})]));const S=nextId(e,"white");n.defs.append(k(e,"filter",{id:S,"color-interpolation-filters":"sRGB"},[k(e,"feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0"})]));const[M,v,O,G]=g.whole;i.push(k(e,"g",{"clip-path":`url(#${c})`},[k(e,"image",{href:h.url,x:a(x+M),y:a(y+v),width:a(O),height:a(G),preserveAspectRatio:"none",filter:`url(#${S})`})]))}else if(t.kind==="shape"){const w=ie(r,n.frame);if(w==="")return{refused:"the clipping base shape has no path"};const h=r.stroke,x=h?h.width??1:0,y=h?.alignment??"center";i.push(k(e,"path",{d:w,fill:r.fill===null||r.shape==="line"?"none":"white",...x>0&&y!=="inside"?{stroke:"white","stroke-width":a(y==="center"?x:x*2)}:{}}))}else if(t.kind==="fill")i.push(k(e,"rect",{x:0,y:0,width:a(o),height:a(s),fill:"white"}));else return{refused:`a ${t.kind??"component"} layer as a clipping base: its pixels are Chrome's drawing of HTML, which a mask cannot read (an SVG mask's foreignObject draws nothing); clip to a picture, a shape or a fill`};const p=nextId(e,"base");return n.defs.append(k(e,"mask",{id:p,maskUnits:"userSpaceOnUse",x:0,y:0,width:a(o),height:a(s),style:"mask-type: luminance"},i)),{id:p}}export function clipStack(t,n){const e=[];for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.layer.clipping===!0){s&&o===0&&e.push(`layer ${s.layer.key??String(o+1)} is clipped with no layer under it`);continue}const r=[];for(let b=o+1;b<t.length&&t[b]?.layer.clipping===!0;b++){const g=t[b];g&&r.push(g)}if(r.length===0)continue;const i=defsOf(s.el),p=silhouetteOf(s.layer,{frame:n.frame,defs:i,ctx:n.ctx});if("refused"in p){e.push(`layer ${r.map(b=>b.layer.key??"?").join(", ")} clipped to ${s.layer.key??"?"}: ${p.refused}`);for(const b of r)b.el.style.display="none";o+=r.length;continue}const h=s.el.ownerDocument.createElement("div");h.className="ak-clip",Object.assign(h.style,{position:"absolute",inset:"0",isolation:"isolate"}),s.el.before(h);const x=s.el.querySelector("[data-ak-picture]");h.style.mixBlendMode=s.el.style.mixBlendMode||(x?.style.mixBlendMode??""),s.el.style.mixBlendMode="",x&&(x.style.mixBlendMode="");const y=(s.layer.opacity??100)/100;y<1&&(h.style.opacity=a(y));const l=(s.layer.fillOpacity??100)/100;s.el.style.opacity=s.el.style.filter===""&&l<1?a(l):"",r.some(b=>holdsAdjustment(b.layer))&&backdropRoot(h),h.append(s.el);for(const b of r){const g=b.el.style.maskImage;b.el.style.maskImage=g===""||g==="none"?`url(#${p.id})`:`${g}, url(#${p.id})`,g!==""&&g!=="none"&&(b.el.style.maskComposite="intersect"),h.append(b.el)}o+=r.length}return e}
@@ -0,0 +1,29 @@
1
+ import { type Fill, type Gradient, type ShapeStroke, type StageContext } from "@allyhub/piece";
2
+ import { type ShapeGeometry } from "./shape-path.js";
3
+ /** Why a gradient cannot be painted, or undefined. */
4
+ export declare function gradientRefusal(g: Gradient, svgOnly: boolean): string | undefined;
5
+ /** A gradient as a CSS background image over its box: Photoshop's angle (counter-clockwise from left to right) as CSS's (clockwise from the top). */
6
+ export declare function cssGradient(g: Gradient): string;
7
+ /** Paints an element with a fill as CSS backgrounds: what a fill layer draws. */
8
+ export declare function paintCss(el: HTMLElement, fill: Fill, ctx: StageContext, base: string): void;
9
+ /** A shape's options as it draws them. */
10
+ export interface ShapeDrawing extends ShapeGeometry {
11
+ readonly fill?: Fill | null;
12
+ readonly stroke?: ShapeStroke | null;
13
+ }
14
+ /**
15
+ * Draws a shape into its element as SVG over the frame: its path filled,
16
+ * and stroked about it (center), inside it (twice as wide, cut to it) or
17
+ * outside it (twice as wide, with what is inside it cut away).
18
+ */
19
+ export declare function drawShape(el: HTMLElement, s: ShapeDrawing, ctx: StageContext, base: string): void;
20
+ /**
21
+ * Strokes a path in an SVG: about it (center), inside it (twice as wide,
22
+ * cut to it) or outside it (twice as wide, with what is inside it cut
23
+ * away): a shape's stroke, and the stroke effect of a shape layer.
24
+ */
25
+ export declare function strokeOnto(root: SVGSVGElement, d: string, st: ShapeStroke, frame: {
26
+ width: number;
27
+ height: number;
28
+ }): void;
29
+ //# sourceMappingURL=paint.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{SHAPE_DEFAULTS as y}from"@allyhub/piece";import{defsOf as $,mediaOfRef as v,nextId as O,svgGradient as j}from"./layer-style.js";import{shapePath as x}from"./shape-path.js";import{stopsOf as A}from"./tone.js";const o=i=>String(Math.round(i*1e4)/1e4);export function gradientRefusal(i,t){const n=i.style??"linear";if(n==="diamond")return"a diamond gradient is no CSS or SVG gradient";if(t&&n==="angle")return"an angle gradient on a shape: SVG paints no conic gradient (a fill layer draws one)"}export function cssGradient(i){const t=i.style??"linear",n=(i.scale??100)/100,f=A(i),a=r=>t==="linear"||t==="reflected"?50+(r-50)*n:r*n,s=(r,e)=>r.flatMap((p,g)=>{const m=r[g+1],h=`${p.color} ${o(e(p.location))}%`;if(!m||(p.midpoint??50)===50)return[h];const u=p.location+(m.location-p.location)*(p.midpoint??50)/100;return[h,`${o(e(u))}%`]}).join(", "),d=90-(i.angle??90);if(t==="radial")return`radial-gradient(farthest-corner at 50% 50%, ${s(f,a)})`;if(t==="angle"){const r=f.map(e=>({...e,location:100-e.location})).reverse();return`conic-gradient(from ${o(d)}deg at 50% 50%, ${s(r,e=>e)})`}if(t==="reflected"){const r=[...f.map(e=>({color:e.color,location:50-e.location/2})).reverse(),...f.map(e=>({color:e.color,location:50+e.location/2}))];return`linear-gradient(${o(d)}deg, ${s(r,a)})`}return`linear-gradient(${o(d)}deg, ${s(f,a)})`}export function paintCss(i,t,n,f){if("color"in t){i.style.background=t.color;return}if("gradient"in t){i.style.backgroundImage=cssGradient(t.gradient);return}const a=v(t.pattern,f,n);if(!a)return;const s=(t.scale??100)/100;Object.assign(i.style,{backgroundImage:`url("${a.url}")`,backgroundSize:`${o((a.width??1)*s)}px ${o((a.height??1)*s)}px`,backgroundRepeat:"repeat",backgroundPosition:"0px 0px"})}const b="http://www.w3.org/2000/svg";function E(i,t,n,f,a){if("color"in t)return t.color;const s=$(i),d=i.ownerDocument,r=O(d,"paint");if("gradient"in t)return s.append(j(d,r,t.gradient,n)),`url(#${r})`;const e=v(t.pattern,a,f);if(!e)return"none";const p=(t.scale??100)/100,g=(e.width??1)*p,m=(e.height??1)*p,h=d.createElementNS(b,"pattern");for(const[c,l]of Object.entries({id:r,patternUnits:"userSpaceOnUse",x:"0",y:"0",width:o(g),height:o(m)}))h.setAttribute(c,l);const u=d.createElementNS(b,"image");for(const[c,l]of Object.entries({href:e.url,x:"0",y:"0",width:o(g),height:o(m),preserveAspectRatio:"none"}))u.setAttribute(c,l);return h.append(u),s.append(h),`url(#${r})`}export function drawShape(i,t,n,f){const a=i.ownerDocument,s=n.dims.width,d=n.dims.height,r=x(t,n.dims),e=a.createElementNS(b,"svg");for(const[c,l]of Object.entries({width:o(s),height:o(d),viewBox:`0 0 ${o(s)} ${o(d)}`}))e.setAttribute(c,l);e.dataset.akShape="",Object.assign(e.style,{position:"absolute",left:"0",top:"0",overflow:"visible"});const p=(()=>{const c=t.box??[0,0,1,1];return[c[0]*s,c[1]*d,c[2]*s,c[3]*d]})();i.append(e);const g=t.fill===void 0?y.fill:t.fill,m=t.shape==="line";g!==null&&!m&&(c=>{const l=a.createElementNS(b,"path");l.setAttribute("d",r);for(const[k,w]of Object.entries(c))l.setAttribute(k,w);return e.append(l),l})({fill:E(i,g,p,n,f),"data-ak-fill":""});const u=t.stroke??(m?{}:null);u!==null&&strokeOnto(e,r,m?{...u,alignment:"center"}:u,n.dims)}export function strokeOnto(i,t,n,f){const a=i.ownerDocument,s=f.width,d=f.height,r=y.stroke,e=n.width??r.width,p=n.alignment??r.alignment,g={d:t,fill:"none",stroke:n.color??r.color,"stroke-width":o(p==="center"?e:e*2),"stroke-linecap":n.cap??r.cap,"stroke-linejoin":n.join??r.join,"data-ak-stroke":""};if((n.opacity??r.opacity)<100&&(g["stroke-opacity"]=o((n.opacity??r.opacity)/100)),n.dashes&&n.dashes.length>0&&(g["stroke-dasharray"]=n.dashes.map(h=>o(h*e)).join(" ")),p!=="center"){const h=$(i),u=O(a,"stroke");if(p==="inside"){const c=a.createElementNS(b,"clipPath");c.id=u;const l=a.createElementNS(b,"path");l.setAttribute("d",t),c.append(l),h.append(c),g["clip-path"]=`url(#${u})`}else{const c=a.createElementNS(b,"mask");c.id=u;const l=a.createElementNS(b,"rect");for(const[w,S]of Object.entries({maskUnits:"userSpaceOnUse",x:o(-s),y:o(-d),width:o(3*s),height:o(3*d)}))c.setAttribute(w,S);for(const[w,S]of Object.entries({x:o(-s),y:o(-d),width:o(3*s),height:o(3*d),fill:"white"}))l.setAttribute(w,S);const k=a.createElementNS(b,"path");k.setAttribute("d",t),k.setAttribute("fill","black"),c.append(l,k),h.append(c),g.mask=`url(#${u})`}}const m=a.createElementNS(b,"path");for(const[h,u]of Object.entries(g))m.setAttribute(h,u);i.append(m)}
@@ -0,0 +1,39 @@
1
+ /** A picture that did not load. */
2
+ export interface BrokenPicture {
3
+ /** The element that draws it: the `<img>`, or the element with the background. */
4
+ el: Element;
5
+ /** The source as written: the `src` attribute, or the background's URL. */
6
+ src: string;
7
+ via: "img" | "background";
8
+ }
9
+ export interface PictureWatch {
10
+ /** Decodes what the stage draws now; what fails is recorded. */
11
+ sweep(): Promise<void>;
12
+ /** What did not load so far, once per element and source. */
13
+ broken(): BrokenPicture[];
14
+ }
15
+ /**
16
+ * Whether a source is the stage's to serve: on its own origin, or inline
17
+ * (data:, blob:). Another origin is the sandbox's (AK-N003).
18
+ */
19
+ export declare function servedHere(src: string, base: string): boolean;
20
+ /** The URLs of a computed `background-image` (`url("…")`, quoted by the browser). */
21
+ export declare function backgroundUrls(value: string): string[];
22
+ /** What to do about a source that did not load, in one sentence. */
23
+ export declare function pictureHint(src: string): string;
24
+ export declare function watchPictures(stage: HTMLElement): PictureWatch;
25
+ /**
26
+ * Waits until every picture the stage shows now is decoded, so a frame is
27
+ * never taken while a picture is still blank. A layer may change what an
28
+ * `<img>` shows, or an inline background image, as it plays (a captured
29
+ * screen swapped for the next state), and the browser may let a decoded
30
+ * picture go while it is out of sight and decode it again only when it is
31
+ * painted: either way a capture taken before it is ready shows nothing
32
+ * where it goes. So every frame asks each `<img>` that is shown, and each
33
+ * inline background URL, to be decoded (at once when it already is).
34
+ * The returned function waits at most `limitMs` and resolves with the
35
+ * sources still not decoded then; a picture that does not load, at any
36
+ * moment, is given to `broken` (AK-A005).
37
+ */
38
+ export declare function pictureWaiter(stage: HTMLElement, broken?: (b: BrokenPicture) => void): (limitMs: number) => Promise<string[]>;
39
+ //# sourceMappingURL=pictures.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import{within as m}from"./guards.js";export function servedHere(c,o){let s;try{s=new URL(c,o)}catch{return!0}return s.protocol==="data:"||s.protocol==="blob:"||s.protocol!=="http:"&&s.protocol!=="https:"?!0:s.origin===new URL(o).origin}export function backgroundUrls(c){const o=[],s=/url\(\s*(?:"((?:[^"\\]|\\.)*)"|'((?:[^'\\]|\\.)*)'|([^)\s]*))\s*\)/g;for(const u of c.matchAll(s)){const e=(u[1]??u[2]??u[3]??"").replace(/\\(.)/g,"$1");e&&o.push(e)}return o}export function pictureHint(c){const o=c.trim();return o==="[object Object]"?"That is an object turned into text: for an imported media value or ctx.asset(…), use its .url.":o==="undefined"||o==="null"?`The source is ${o}: for an imported media value or ctx.asset(…), use its .url.`:/^[a-z][a-z0-9+.-]*:/i.test(o)?"The file is not there, or it is not a picture the browser can draw.":'A path is not a URL the stage serves: import the file (import logo from "./logo.svg") or use ctx.asset(path), and use its .url.'}const d=c=>c.decode().then(()=>!0,()=>!1);export function watchPictures(c){const o=[],s=()=>document.baseURI,u=(a,e,t)=>{!e||!servedHere(e,s())||o.some(i=>i.el===a&&i.src===e)||o.push({el:a,src:e,via:t})};return c.addEventListener("error",a=>{const e=a.target;e instanceof HTMLImageElement&&u(e,e.getAttribute("src")??"","img")},!0),{async sweep(){const a=Array.from(c.querySelectorAll("img"));await Promise.all(a.map(async t=>{const i=t.getAttribute("src")??"";i&&!await d(t)&&t.complete&&t.naturalWidth===0&&u(t,i,"img")}));const e=new Map;for(const t of Array.from(c.querySelectorAll("*"))){const i=getComputedStyle(t).backgroundImage;if(!i.includes("url("))continue;const r=t instanceof HTMLElement||t instanceof SVGElement?t.style.backgroundImage:"",n=r.includes("url(")?r:i;for(const l of backgroundUrls(n))e.set(l,[...e.get(l)??[],t])}await Promise.all([...e].map(async([t,i])=>{if(!servedHere(t,s()))return;const r=new Image;if(r.src=t,!await d(r))for(const n of i)u(n,t,"background")}))},broken:()=>[...o]}}export function pictureWaiter(c,o){const s=new Map,u=()=>document.baseURI;return async a=>{const e=[],t=[];for(const r of Array.from(c.querySelectorAll("img"))){if(!(r.currentSrc||r.src)||r.getClientRects().length===0)continue;const n=r.getAttribute("src")??r.currentSrc;t.push(n),e.push(r.decode().catch(()=>{r.complete&&r.naturalWidth===0&&servedHere(n,u())&&o?.({el:r,src:n,via:"img"})}))}for(const r of Array.from(c.querySelectorAll('[style*="url("]')))if(r.getClientRects().length!==0)for(const n of backgroundUrls(r.style.backgroundImage)){let l=s.get(n);l||(l=new Image,l.src=n,s.set(n,l)),t.push(n);const f=l;e.push(f.decode().catch(()=>{f.complete&&f.naturalWidth===0&&servedHere(n,u())&&o?.({el:r,src:n,via:"background"})}))}if(e.length===0)return[];const i=await m(e,a);return t.filter((r,n)=>i[n]===void 0)}}
@@ -0,0 +1,52 @@
1
+ import { LAYER_BRAND, type GraphicLayer, type LayerTiming, type TimeShape } from "@allyhub/piece";
2
+ /** A layer of a stack: a graphic layer, or a footage layer (the video's), of which the plan reads its file. */
3
+ export type StackLayer = GraphicLayer | (LayerTiming & {
4
+ readonly [LAYER_BRAND]: "footage";
5
+ readonly file?: unknown;
6
+ });
7
+ /** A graphics plane of a stack: its layers' windows, and whether they are behind the person or over the finished picture. */
8
+ export interface StackPlane {
9
+ layers: {
10
+ component: string;
11
+ start: number;
12
+ end: number;
13
+ }[];
14
+ behindPerson?: true;
15
+ overlay?: true;
16
+ }
17
+ export declare const isFootage: <L extends StackLayer>(l: L) => l is Exclude<L, GraphicLayer>;
18
+ /** A graphic layer's plane: behind the person, in front, or over the finished picture. */
19
+ export declare const zOf: (l: GraphicLayer) => "front" | "behind-person" | "overlay";
20
+ /** The layers' names, for the timeline: component names and "footage". */
21
+ export declare const layerNames: (layers: readonly StackLayer[]) => string[];
22
+ /** Replaces word references in props with seconds, where the shape says they are times. */
23
+ export declare function resolveTimes(v: unknown, shape: true | TimeShape, at: (ref: unknown) => number): unknown;
24
+ /** A layer's window in its part, seconds from the part's start. */
25
+ export declare function windowOf(l: LayerTiming, dur: number, at: (ref: unknown) => number): [number, number];
26
+ /** A part's stack, planned from its layers alone. */
27
+ export interface StackPlan {
28
+ /** The part's own footage (the first footage layer without a file) when layers are behind its person; else -1. */
29
+ takeAt: number;
30
+ /** Some graphic layer is behind the person. */
31
+ hasBehind: boolean;
32
+ /** The layers' indices in the order they are drawn, back to front. */
33
+ order: number[];
34
+ /** Its graphics planes, back to front (their layers filled in by compose). */
35
+ planes: StackPlane[];
36
+ /** Each graphic layer's plane. */
37
+ planeOf: Map<number, number>;
38
+ /** Each footage layer's count of planes under it. */
39
+ overOf: Map<number, number>;
40
+ /** Whether layer i is over the finished picture. */
41
+ overlaid(i: number): boolean;
42
+ }
43
+ /**
44
+ * The stack: the layers in the order they are listed, back to front,
45
+ * footage and graphics alike. A layer behind the person belongs to the
46
+ * part's own footage (the first footage layer without a file): drawn
47
+ * right over it, under its speaker. Graphic layers with no footage
48
+ * between them are one plane; a footage layer is over the planes before
49
+ * it; layers over the finished picture come last.
50
+ */
51
+ export declare function planStack(layers: readonly StackLayer[]): StackPlan;
52
+ //# sourceMappingURL=plan.d.ts.map
@@ -0,0 +1,2 @@
1
+ /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
+ import"@allyhub/piece";export const isFootage=n=>n.__allyhubLayer==="footage",zOf=n=>n.z==="behind-person"||n.z==="overlay"?n.z:"front",layerNames=n=>n.map(r=>isFootage(r)?"footage":r.component);export function resolveTimes(n,r,i){if(Array.isArray(n))return n.map(o=>resolveTimes(o,r,i));if(r===!0)return typeof n=="string"||typeof n=="number"?i(n):n;if(typeof n!="object"||n===null)return n;const t={...n};for(const[o,f]of Object.entries(r))o in t&&t[o]!==void 0&&(t[o]=resolveTimes(t[o],f,i));return t}export function windowOf(n,r,i){const t=u=>Math.min(Math.max(u,0),r),o=t(n.at===void 0?0:i(n.at)),f=n.until!==void 0?t(i(n.until)):n.dur!==void 0?t(o+n.dur):r;return[o,f]}export function planStack(n){const r=n.some(e=>!isFootage(e)&&zOf(e)==="behind-person"),i=r?n.findIndex(e=>isFootage(e)&&e.file===void 0):-1,t=e=>i>=0&&!isFootage(e)&&zOf(e)==="behind-person",o=e=>e!==void 0&&!isFootage(e)&&zOf(e)==="overlay",f=[];n.forEach((e,s)=>{isFootage(e)?(f.push(s),s===i&&n.forEach((c,h)=>{t(c)&&f.push(h)})):!t(e)&&!o(e)&&f.push(s)}),n.forEach((e,s)=>{o(e)&&f.push(s)});const u=[],a=new Map,p=new Map;let d;for(const e of f){const s=n[e];if(!s)continue;if(isFootage(s)){d=void 0,p.set(e,u.length);continue}const c=t(s)?"behind":o(s)?"overlay":"front";d!==c&&(u.push({layers:[],...c==="behind"?{behindPerson:!0}:{},...c==="overlay"?{overlay:!0}:{}}),d=c),a.set(e,u.length-1)}return{takeAt:i,hasBehind:r,order:f,planes:u,planeOf:a,overOf:p,overlaid:e=>o(n[e])}}